text: /*! 
  * DevExtreme (Web Widgets)
  * Version: 15.1.6
  * Build date: Aug 14, 2015
  *
  * Copyright (c) 2012 - 2015 Developer Express Inc. ALL RIGHTS RESERVED
  * EULA: https://www.devexpress.com/Support/EULAs/DevExtreme.xml
  */
  "use strict";if(!DevExpress.MOD_WIDGETS_WEB){if(!DevExpress.MOD_WIDGETS_BASE)throw Error("Required module is not referenced: widgets-base");(function(n,t,i){var e=t.ui,c=e.events,o=t.fx,l="dx-accordion",a="dx-accordion-wrapper",h="dx-accordion-item",r="dx-accordion-item-opened",s="dx-accordion-item-closed",u="dx-accordion-item-title",f="dx-accordion-item-body",v="dxAccordionItemData",y="dxAccordionItemTitleData",p="dxAccordionItemContentData";t.registerComponent("dxAccordion",e,e.CollectionWidget.inherit({_activeStateUnit:"."+h,_setDefaultOptions:function(){this.callBase(),this.option({height:i,itemTitleTemplate:"title",onItemTitleClick:null,onItemTitleHold:null,selectedIndex:0,collapsible:!1,multiple:!1,animationDuration:300,deferRendering:!0,selectionByClick:!0,activeStateEnabled:!0,_itemAttributes:{role:"tab"}})},_defaultOptionsRules:function(){return this.callBase().concat([{device:function(){return t.devices.real().generic&&!t.devices.isSimulator()},options:{hoverStateEnabled:!0,focusStateEnabled:!0}}])},_init:function(){this.callBase(),this.option("selectionRequired",!this.option("collapsible")),this.option("selectionMode",this.option("multiple")?"multi":"single");var t=this.element();t.addClass(l),this._$container=n("<div>").addClass(a),t.append(this._$container)},_render:function(){this._deferredItems=[],this.callBase(),this.setAria({role:"tablist",multiselectable:this.option("multiple")}),this._attachItemTitleClickAction()},_itemDataKey:function(){return v},_itemClass:function(){return h},_itemContainer:function(){return this._$container},_itemTitles:function(){return this._itemElements().find("."+u)},_itemContents:function(){return this._itemElements().find("."+f)},_getItemData:function(t){return n(t).parent().data(this._itemDataKey())||this.callBase.apply(this,arguments)},_executeItemRenderAction:function(n){n.type||this.callBase.apply(this,arguments)},_itemSelectHandler:function(t){n(t.target).closest("."+f).length||this.callBase.apply(this,arguments)},_renderItemContent:function(t,i,r){r=r||this._itemContainer();var u=this.callBase.apply(this,[t,n.extend({type:"title",titleTemplate:this._getTemplateByOption("itemTitleTemplate")},i),r]),f=u.parent();this._deferredItems.push(n.Deferred()),this._deferredItems[t].done(n.proxy(this._renderItemBody,this,this.callBase,t,i,f)),this.option("deferRendering")||this._deferredItems[t].resolve()},_renderItemBody:function(t,i,r,u){var f=n("<div>").appendTo(u);t.apply(this,[i,n.extend({type:"content",template:this._getTemplateByOption("itemTemplate")},r),f])},_getItemTemplateName:function(n){var t=this.option("itemTemplateProperty");return n.type==="title"&&(t="titleTemplate"),n&&n[t]||this.option("itemTemplate")},_addItemContentClasses:function(n,t){switch(t.type){case"title":n.addClass(u).data(y,t);break;case"content":n.addClass(f).data(p,t);break;default:this.callBase.apply(this,arguments)}},_attachItemTitleClickAction:function(){var t="."+u,i=c.addNamespace("dxclick",this.NAME);this._itemContainer().off(i,t).on(i,t,n.proxy(this._itemTitleClickHandler,this))},_itemTitleClickHandler:function(n){this._itemJQueryEventHandler(n,"onItemTitleClick")},_renderSelection:function(n,t){this._itemElements().addClass(s),this._updateItems(n,t,!0)},_updateSelection:function(n,t){this._updateItems(n,t,!1)},_updateItems:function(t,i,u){var e=this._itemElements(),o=this;n.each(t,function(n,t){var i=e.eq(t);i.find("."+f).length===0&&o._deferredItems[t].resolve(),i.addClass(r),i.removeClass(s)}),n.each(i,function(n,t){e.eq(t).removeClass(r)}),this._updateItemHeights(u)},_updateItemHeights:function(t){var i=this._itemElements(),f=this._splitFreeSpace(this._calculateFreeSpace());n.each(i,n.proxy(function(i,e){var s=n(e),c=s.children("."+u),l,h;o.isAnimating(s)&&o.stop(s),l=s.outerHeight(),h=s.hasClass(r)?f+c.outerHeight()||s.height("auto").outerHeight():c.outerHeight(),t?s.css("height",h):this._animateItem(s,l,h)},this))},_animateItem:function(t,i,u){o.animate(t,{type:"slide",from:{height:i},to:{height:u},duration:this.option("animationDuration"),complete:n.proxy(function(){this._deferredAnimate&&this._deferredAnimate.resolveWith(this),this._itemElements().not("."+r).addClass(s)},this)})},_splitFreeSpace:function(n){return n?n/this.option("selectedItems").length:n},_calculateFreeSpace:function(){var r=this.option("height"),u,t;if(r!==i&&r!=="auto")return u=this._itemTitles(),t=0,n.each(u,function(i,r){t+=n(r).outerHeight()}),this.element().height()-t},_visibilityChanged:function(n){n&&this._dimensionChanged()},_dimensionChanged:function(){this._updateItemHeights(!0)},_optionChanged:function(n){switch(n.name){case"animationDuration":case"onItemTitleClick":break;case"collapsible":this.option("selectionRequired",!this.option("collapsible"));break;case"itemTitleTemplate":case"itemContentTemplate":case"onItemTitleHold":case"height":case"deferRendering":this._invalidate();break;case"multiple":this.option("selectionMode",n.value?"multi":"single");break;default:this.callBase(n)}},expandItem:function(t){return this._deferredAnimate=n.Deferred(),this.selectItem(t),this._deferredAnimate.promise()},collapseItem:function(t){return this._deferredAnimate=n.Deferred(),this.unselectItem(t),this._deferredAnimate.promise()}}))})(jQuery,DevExpress),function(n,t,i){var o=t.ui,r=t.utils,e=o.events,v=t.Class,u=4,y="dx-pager",s="dx-page",p="dx-pages",h="dx-selection",w="dx-separator",b="dx-page-sizes",c="dx-page-size",k="dx-navigate-button",l="dx-prev-button",a="dx-next-button",d="dx-info",g="dx-button-disable",f=v.inherit({ctor:function(t,i){var r=this;r.index=i,r._$page=n("<div />").text(t).addClass(s)},value:function(n){var i=this,t;if(r.isDefined(n))i._$page.text(n);else return t=i._$page.text(),r.isNumber(t)?parseInt(t):t},element:function(){return this._$page},select:function(n){this._$page.toggleClass(h,n)},render:function(n,t){t?this._$page.prependTo(n):this._$page.appendTo(n)}});t.registerComponent("dxPager",o,o.Widget.inherit({_setDefaultOptions:function(){this.callBase(),this.option({visible:!0,pageIndex:1,maxPagesCount:10,pageCount:10,pageSize:5,showPageSizes:!0,pageSizes:[5,10],hasKnownLastPage:!0,showNavigationButtons:!1,showInfo:!1,infoText:Globalize.localize("dxPager-infoText"),rtlEnabled:!1,pageIndexChanged:n.noop,pageSizeChanged:n.noop})},_toggleVisibility:function(n){var t=this.element();t&&t.css("display",n?"":"none")},_getPages:function(n,t){var r=[],e=!this.option("hasKnownLastPage"),o,i;if(t>0||e)if(t<=this.option("maxPagesCount")){for(i=1;i<=t;i++)r.push(new f(i,i-1));e&&r.push(new f(">",i-1))}else{for(r.push(new f(1,0)),o=n?n.value()-n.index:1,i=1;i<=u;i++)r.push(new f(o+i,i));r.push(new f(t,u+1)),e&&r.push(new f(">",u+1))}return r},_getPageByValue:function(n){for(var r=this,i,t=0;t<r._pages.length;t++)if(i=r._pages[t],i.value()===n)return i},_processSelectedPage:function(t,i,e){var o=this,s=!1,h;o._pages&&(n.each(o._pages,function(n,t){i===t.value()&&(s=!0)}),s||(o.selectedPage=null)),r.isDefined(o.selectedPage)?i===e&&e>t&&o.selectedPage.index!==u+1&&(o.selectedPage.index=u+1):i>u&&i<e&&(h=e-u<i?u-(e-i)+1:2,o.selectedPage=new f(i,h))},_selectPageByValue:function(n){var u=this,f,t=u._getPageByValue(n),h=u._pages,o=h.length,s,e,c;if(r.isDefined(t)){if(s=u._pages[t.index-1],e=u._pages[t.index+1],e&&e.value()===">"&&(c=e,e=i,o--,h.pop()),u.selectedPage&&u.selectedPage.select(!1),t.select(!0),u.selectedPage=t,e&&e.value()-n>1)if(t.index!==0)for(s.value(n+1),u._pages.splice(t.index,1),u._pages.splice(t.index-1,0,t),u._pages[t.index].index=t.index,t.index=t.index-1,f=t.index-1;f>0;f--)u._pages[f].value(u._pages[f+1].value()-1);else for(f=0;f<o-1;f++)u._pages[f].value(f+1);if(s&&n-s.value()>1)if(t.index!==o-1)for(e.value(n-1),u._pages.splice(t.index,1),u._pages.splice(t.index+1,0,t),u._pages[t.index].index=t.index,t.index=t.index+1,f=t.index+1;f<o-1;f++)u._pages[f].value(u._pages[f-1].value()+1);else for(f=1;f<=o-2;f++)u._pages[o-1-f].value(u._pages[o-1].value()-f);c&&h.push(c)}},_nextPage:function(n){var t=this.selectedPage&&this.selectedPage.value(),i=this.option("pageCount");r.isDefined(t)&&(t=n==="next"?++t:--t,t>0&&t<=i&&this.option("pageIndex",t))},_renderPages:function(t){var i=this,f,o=t.length,h=i._createAction(function(t){var u=t.jQueryEvent,r=n(u.target).text(),f=r===">"?i.option("pageCount")+1:Number(r);i.option("pageIndex",f)}),u,r;if(o>1){i._pageClickHandler=function(n){h({jQueryEvent:n})};i.$pagesChooser.on(e.addNamespace("dxclick",i.Name+"Pages"),"."+s,i._pageClickHandler)}for(r=0;r<o;r++)u=t[r],u.render(i.$pagesChooser,i.option("rtlEnabled")),i.setAria({role:"button",label:"Page "+u.value()},u.element()),t[r+1]&&t[r+1].value()-u.value()>1&&(f=n("<div>. . .<\/div>").addClass(w),i.option("rtlEnabled")?f.prependTo(i.$pagesChooser):f.appendTo(i.$pagesChooser))},_renderPagesChooser:function(){var t=this,i=t.element();if(i){if(t._pages.length===0){t.selectedPage=null;return}r.isDefined(t.$pagesChooser)?t.$pagesChooser.empty():t.$pagesChooser=n("<div />").addClass(p),t._renderInfo(),t._renderNavigateButton("prev"),t._renderPages(t._pages),t._renderNavigateButton("next"),r.isDefined(t.$pagesChooser[0].parentElement)||t.$pagesChooser.appendTo(i)}},_renderPagesSizeChooser:function(){var t=this,i,u,a=t.option("pageSize"),f=t.option("pageSizes"),v=t.option("showPageSizes"),o,s=f&&f.length,l=t.element();if(l&&(t._clickPagesSizeAction=t._createAction(function(i){var r=i.jQueryEvent;o=parseInt(n(r.target).text()),t.option("pageSize",o)}),r.isDefined(t.pagesSizeChooserElement)?t.pagesSizeChooserElement.empty():t.pagesSizeChooserElement=n("<div />").addClass(b).on(e.addNamespace("dxclick",t.Name+"PageSize"),"."+c,function(n){t._clickPagesSizeAction({jQueryEvent:n})}),v&&s)){for(i=0;i<s;i++)u=n("<div />").text(f[i]).addClass(c),t.setAria({role:"button",label:"Display "+f[i]+" items on page"},u),a===f[i]&&u.addClass(h),t.option("rtlEnabled")?t.pagesSizeChooserElement.prepend(u):t.pagesSizeChooserElement.append(u);r.isDefined(t.pagesSizeChooserElement[0].parentElement)||t.pagesSizeChooserElement.appendTo(l)}},_renderInfo:function(){var t=this.option("infoText");this.option("showInfo")&&r.isDefined(t)&&n("<div>").addClass(d).text(r.stringFormat(t,this.selectedPage&&this.selectedPage.value(),this.option("pageCount"))).appendTo(this.$pagesChooser)},_renderNavigateButton:function(t){var i=this,u,o=i._createAction(function(){i._nextPage(t)}),r,f;i.option("showNavigationButtons")&&(u=i.option("pageIndex"),f=u>1&&t==="prev"||u<i.option("pageCount")&&t==="next",r=n("<div>").addClass(k).addClass(f?"":g).on(e.addNamespace("dxclick",i.Name+"Pages"),function(n){o({jQueryEvent:n})}),i.setAria({role:"button",label:t==="prev"?"Previous page":" Next page"},r),i.option("rtlEnabled")?(r.addClass(t==="prev"?a:l),r.prependTo(this.$pagesChooser)):(r.addClass(t==="prev"?l:a),r.appendTo(this.$pagesChooser)))},_render:function(){this.callBase(),this._update(),this.element().addClass(y),this._toggleVisibility(this.option("visible")),this._renderPagesSizeChooser(),this._renderPagesChooser()},_update:function(){var n=this.option("pageCount"),t=this.option("pageIndex");this._processSelectedPage(this.option("maxPagesCount"),t,n),this._pages=this._getPages(this.selectedPage,n),this._selectPageByValue(t)},_optionChanged:function(n){var t,i;switch(n.name){case"visible":this._toggleVisibility(n.value);break;case"pageIndex":t=this.option("pageIndexChanged"),t&&t(n.value),this._update(),this._renderPagesChooser();break;case"maxPagesCount":case"pageCount":case"hasKnownLastPage":case"showNavigationButtons":this._update(),this._renderPagesChooser();break;case"pageSize":i=this.option("pageSizeChanged"),i&&i(n.value),this._renderPagesSizeChooser();break;case"pageSizes":this._renderPagesSizeChooser();break;default:this._invalidate()}},_clean:function(){this.$pagesChooser&&this.$pagesChooser.off(e.addNamespace("dxclick",this.Name+"Pages"),"."+s,this._pageClickHandler)},getHeight:function(){return this.option("visible")?this.element().outerHeight():0}}))}(jQuery,DevExpress),function(n,t){var e=t.ui,u=t.utils,f="dx-menu",c="dx-menu-base",r=f+"-item",s=r+"-selected",h=r+"-wrapper",l=f+"-items-container",a=r+"-expanded",v=f+"-separator",y=f+"-last-group-item",p=r+"-has-text",w=r+"-has-icon",b=r+"-has-submenu",k="dx-state-focused",d="."+r,g="."+s,o="single",nt="none",tt=1,it=50,rt=300,ut=e.CollectionWidget.inherit({NAME:"dxMenuBase",_setDefaultOptions:function(){this.callBase(),this.option({items:[],cssClass:"",activeStateEnabled:!0,showSubmenuMode:{name:"onHover",delay:{show:50,hide:300}},animation:{show:{type:"fade",from:0,to:1,duration:100},hide:{type:"fade",from:1,to:0,duration:100}},selectionByClick:!1,selectionMode:"none",focusOnSelectedItem:!1,_remoteSelectionSync:!1,hoverStateEnabled:!0,_itemAttributes:{role:"menuitem"}})},_defaultOptionsRules:function(){return this.callBase().concat([{device:function(){return t.devices.real().generic&&!t.devices.isSimulator()},options:{focusStateEnabled:!0}}])},_activeStateUnit:d,_itemDataKey:function(){return"dxMenuItemDataKey"},_itemClass:function(){return r},_setAriaSelected:n.noop,_selectedItemClass:function(){return s},_focusTarget:function(){return this._itemContainer()},_eventBindingTarget:function(){return this._itemContainer()},_supportedKeys:function(){var t=function(){var t=this.option("focusedElement");t&&this._isSelectionEnabled()&&this.selectItem(t)};return n.extend(this.callBase(),{space:t,pageUp:n.noop,pageDown:n.noop})},_isSelectionEnabled:function(){return this._getSelectionMode()===o},_getSelectionMode:function(){return this.option("selectionMode")===o?o:nt},_init:function(){this.callBase(),this._initActions()},_initActions:n.noop,_render:function(){var n=this.element();this.callBase(arguments),this._addCustomCssClass(n),this._itemContainer().addClass(c)},_getShowSubmenuMode:function(){var n;return n=u.isObject(this.option("showSubmenuMode"))?this._isDesktopDevice()?this.option("showSubmenuMode").name:"onClick":this._isDesktopDevice()?this.option("showSubmenuMode"):"onClick"},_isDesktopDevice:function(){return t.devices.real().deviceType==="desktop"},_initEditStrategy:function(){var n=e.CollectionWidget.MenuBaseEditStrategy;this._editStrategy=new n(this)},_addCustomCssClass:function(n){n.addClass(this.option("cssClass"))},_itemWrapperSelector:function(){return"."+h},_hoverStartHandler:function(t){var i=this,r=i._getItemElementByEventArgs(t);if(r){if(i._isItemDisabled(r))return;t.stopPropagation(),i.option("focusedElement",r),i._getShowSubmenuMode()==="onHover"&&setTimeout(n.proxy(i._showSubmenu,i,r),i._getSubmenuShowDelay())}},_isItemDisabled:function(n){return n.data(this._itemDataKey()).disabled},_showSubmenu:function(n){n.hasClass(k)&&this._addExpandedClass(n)},_addExpandedClass:function(n){n.addClass(a)},_getSubmenuHideDelay:function(){var n=this.option("showSubmenuMode").delay;return n?u.isObject(n)?n.hide:n:rt},_getSubmenuShowDelay:function(){var n=this.option("showSubmenuMode").delay,t;return t=n?u.isObject(n)?n.show:n:it},_getItemElementByEventArgs:function(t){var i=n(t.target);if(i.hasClass(this._itemClass())||i.get(0)===t.currentTarget)return i;while(!i.hasClass(this._itemClass()))if(i=i.parent(),i.hasClass("dx-submenu"))return null;return i},_hoverEndHandler:n.noop,_hasSubmenu:function(n){return n.items&&n.items.length>0},_renderItems:function(t,i,r){i=i||tt;var f=this,u;t.length&&(u=this._renderContainer(i,r),n.each(t,function(n,t){f._renderItem(n,t,u,i)})),this._setSelectionFromItems()},_renderContainer:function(){return this._createItemsContainer().addClass(l)},_createItemsContainer:function(){var t=n("<div>").appendTo(this.element());return n("<ul>").appendTo(t)},_renderItem:function(t,i,r,f){var s=this.option("items"),e=n("<li>"),o;this._renderSeparator(i,t,r),e.appendTo(r).addClass(h),s[t+1]&&s[t+1].beginGroup&&e.addClass(y),u.isObject(i)||(i={text:i}),u.isDefined(i.selected)||(i.selected=!1),o=this.callBase(t,i,e),this._addContentClasses(i,o),this._hasSubmenu(i)&&this._renderSubmenuItems(i,o,f)},_addContentClasses:function(n,t){n.text&&t.addClass(p),(n.icon||n.iconSrc)&&t.addClass(w),n.items&&n.items.length>0&&t.addClass(b)},_setSelectionFromItems:function(){var t=this.option("selectedIndex"),i=!t||t===-1;!this.option("_remoteSelectionSync")&&i&&(n.each(this._editStrategy._getPlainItems(),function(n,i){i.selected&&i.selectable!==!1&&(t=n)}),t>=0&&this.option("selectedIndex",t))},_renderSeparator:function(t,i,r){t.beginGroup&&i>0&&n("<li>").appendTo(r).addClass(v)},_renderSubmenuItems:function(n,t){this.setAria("haspopup","true",t)},_itemClickHandler:function(t){var i=this._createAction(n.proxy(this._updateSubmenuVisibilityOnClick,this));this._itemJQueryEventHandler(t,"onItemClick",{},{afterExecute:n.proxy(i,this)})},_updateSubmenuVisibilityOnClick:function(n){this._updateSelectedItemOnClick(n),this._getShowSubmenuMode()==="onClick"&&this._addExpandedClass(n.args[0].itemElement)},_updateSelectedItemOnClick:function(n){var t=n.args?n.args[0]:n,u=this._isSelectionEnabled()&&this.option("selectionByClick"),i,r;u&&t.itemData.selectable!==!1&&!this._hasSubmenu(t.itemData)&&(i=this._itemContainer().find(g),i.length?(r=this._getItemData(i),i.removeClass(this._selectedItemClass()),r&&(r.selected=!1,this._clearSelectedItems()),i.is(t.itemElement)||this._setSelectedItems(t)):this._setSelectedItems(t))},_setSelectedItems:function(n){n.itemData.selected=!0,this.option("selectedItems",[n.itemData])},_syncSelectionOptions:function(t){var i=this._editStrategy._getPlainItems()||[],e=this.option("selectedItems")||[],r=this.option("selectedItem"),f=this.option("selectedIndex");t=t||this._chooseSelectOption();switch(t){case"selectedItems":this._setOptionSilent("selectedItem",e[0]),this._setOptionSilent("selectedIndex",n.inArray(e[0],i));break;case"selectedItem":u.isDefined(r)?(this._setOptionSilent("selectedItems",[r]),this._setOptionSilent("selectedIndex",n.inArray(r,i))):(this._setOptionSilent("selectedItems",[]),this._setOptionSilent("selectedIndex",-1));break;case"selectedIndex":u.isDefined(i[f])?(this._setOptionSilent("selectedItems",[i[f]]),this._setOptionSilent("selectedItem",i[f])):(this._setOptionSilent("selectedItems",[]),this._setOptionSilent("selectedItem",null))}},_getStringifiedArray:function(t){return n.map(t,function(n){return JSON.stringify(n)})},_isOwnItem:function(t){var i=this._editStrategy._getPlainItems();return n.inArray(JSON.stringify(t),this._getStringifiedArray(i))>=0},_optionChanged:function(n){switch(n.name){case"showSubmenuMode":break;case"_remoteSelectionSync":case"cssClass":case"position":case"selectionByClick":case"animation":this._invalidate();break;default:this.callBase(n)}},selectItem:function(t){var i=this._editStrategy.getNormalizedIndex(t),f=this._getItemData(t),u,r;i!==-1&&(u=n.inArray(i,this._selectedItemIndices),u===-1)&&this.option("selectionMode")==="single"&&f.selectable!==!1&&(r=this._editStrategy.fetchSelectedItems([i]),r[0].selected=!0,this.option("selectedItems",r))},unselectItem:function(t){var r=this._editStrategy.getNormalizedIndex(t),i,u;r!==-1&&(i=n.inArray(r,this._selectedItemIndices),i!==-1)&&(u=this._editStrategy.fetchSelectedItems([i]),u[0].selected=!1,this.option("selectedItems",[]))}});e.dxMenuBase=ut}(jQuery,DevExpress),function(n,t){var r=t.ui;r.CollectionWidget.MenuBaseEditStrategy=r.CollectionWidget.PlainEditStrategy.inherit({_getPlainItems:function(){return n.map(this._collectionWidget.option("items"),function t(i){return i.items?[i].concat(n.map(i.items,t)):i})},_getStringifiedArray:function(t){var i=this;return n.map(t,function(n){return i._stringifyItem(n)})},_stringifyItem:function(n){var t=this;return JSON.stringify(n,function(n,i){return n==="template"?t._getTemplateString(i):i})},_getTemplateString:function(t){var i;return i=typeof t=="object"?n(t).text():t.toString()},selectedItemIndices:function(){var t=[],i=this._getStringifiedArray(this._getPlainItems()),r=this._collectionWidget.option("selectedItems");return n.each(r,function(r,u){var f=n.inArray(JSON.stringify(u),i);f!==-1&&t.push(f)}),t},fetchSelectedItems:function(t){t=t||this._collectionWidget._selectedItemIndices;var r=this._getPlainItems(),i=[];return n.each(t,function(n,t){i.push(r[t])}),i}})}(jQuery,DevExpress),function(n,t,i){var o=t.ui,k=t.utils,s=o.events,h=t.fx,c="dx-menu",e=c+"-item",r=e+"-expanded",d="dx-menu-phone-overlay",f=c+"-items-container",g=e+"-wrapper",u="dx-submenu",nt="dx-context-menu",tt="dx-has-context-menu",it="dx-state-disabled",rt="dxSubmenuLevel",l="up",a="down",v="left",y="right",p="first",w="last",b=["onShowing","onShown","onHiding","onHidden","onPositioning","onLeftFirstItem","onLeftLastItem","onCloseRootSubmenu","onExpandLastSubmenu"],ut=[l,a,p,w];t.registerComponent("dxContextMenu",o,o.dxMenuBase.inherit({_setDefaultOptions:function(){this.callBase(),this.option({alternativeInvocationMode:{enabled:!1,invokingElement:null},position:{at:"top left",my:"top left"},onShowing:null,onShown:null,onHiding:null,onHidden:null,onPositioning:null,submenuDirection:"auto",visible:!1,target:window,onLeftFirstItem:null,onLeftLastItem:null,onCloseRootSubmenu:null,onExpandLastSubmenu:null})},_initActions:function(){this._actions={},n.each(b,n.proxy(function(t,i){this._actions[i]=this._createActionByOption(i)||n.noop},this))},_setOptionsByReference:function(){this.callBase(),n.extend(this._optionsByReference,{animation:!0,position:!0,selectedItem:!0})},_itemContainer:function(){return this._overlay.content()},_supportedKeys:function(){return n.extend(this.callBase(),{esc:this.hide})},_moveFocus:function(n){var t=this._getItemsByLocation(n),r=this._getActiveItem(!0),i,u=this.option("focusedElement");switch(n){case l:if(i=u?this._prevItem(t):t.last(),r.is(t.first()))this._actions.onLeftFirstItem(r);break;case a:if(i=u?this._nextItem(t):t.first(),r.is(t.last()))this._actions.onLeftLastItem(r);break;case y:i=this.option("rtlEnabled")?this._hideSubmenuHandler(t):this._expandSubmenuHandler(t);break;case v:i=this.option("rtlEnabled")?this._expandSubmenuHandler(t):this._hideSubmenuHandler(t);break;case p:i=t.first();break;case w:i=t.last();break;default:return this.callBase(n)}i.length!==0&&this.option("focusedElement",i)},_getItemsByLocation:function(t){var i,r=this._getActiveItem(!0),u=this.option("rtlEnabled")?v:y;return n.inArray(t,ut)>=0?i=r.closest("."+f).children().children():(i=this._itemElements(),t!==u&&(i=i.filter(":visible"))),i},_getAriaTarget:function(){return this.element()},_refreshActiveDescendant:function(){var n=this._overlay.content(),t=this.getFocusedItemId();if(!n)return this.callBase();this.setAria("activedescendant","",n),this.setAria("activedescendant",t,n)},_hideSubmenuHandler:function(){var t=this._getActiveItem(!0),i=t.parents("."+r).first();if(i.length)return this._hideSubmenusOnSameLevel(i),i;this._actions.onCloseRootSubmenu(t);return t},_expandSubmenuHandler:function(n){var t=this._getActiveItem(!0),i=t.children("."+u);if(i.length&&!t.hasClass(it))return i.css("visibility")==="hidden"&&this._showSubmenu(t),this._nextItem(n);this._actions.onExpandLastSubmenu(t);return t},_render:function(){this.element().addClass(tt),this.callBase(),this.setAria("role","menu")},_renderContentImpl:function(){this._renderContextMenuOverlay(),this._detachShowContextMenuEvents(this.option("target")),this._attachShowContextMenuEvents(),this._attachInvokeContextMenuEvents(),this.callBase()},_renderContextMenuOverlay:function(){var i=this._getOverlayOptions(),r=n("<div>"),t;this._overlay=this._createComponent(r.appendTo(this._$element),"dxOverlay",i),t=this._overlay.content(),t.addClass(nt),this._addCustomCssClass(t),this._addPlatformDependentClass(t),this._overlay.option("visible")&&this._show()},_addPlatformDependentClass:function(n){t.devices.current().phone&&n.addClass(d)},_detachShowContextMenuEvents:function(t){var i=s.addNamespace("dxcontextmenu",this.NAME);n(t).off(i),this._overlay&&this._overlay.content().off(i)},_attachShowContextMenuEvents:function(){var t=this,i=s.addNamespace("dxcontextmenu",this.NAME),r=this._createAction(n.proxy(function(n){t.option("alternativeInvocationMode").enabled||t._show(n.jQueryEvent)},this));this._overlay&&this._overlay.content().on(i,n.noop);n(this.option("target")).on(i,n.proxy(function(n){r({jQueryEvent:n})},this))},_attachInvokeContextMenuEvents:function(){var i=this,t=s.addNamespace("dxclick",this.NAME),r=this._createAction(n.proxy(function(){i.toggle()},this));if(this.option("alternativeInvocationMode").enabled&&this._getInvokeTarget())n(this._getInvokeTarget()).off(t).on(t,n.proxy(function(n){r({jQueryEvent:n})},this))},_getInvokeTarget:function(){return this.option("alternativeInvocationMode").invokingElement},_hoverEndHandler:function(n){n.stopPropagation()},_renderDimensions:n.noop,_renderContainer:function(t,i){var e=n("<div>"),r=n("<ul>"),o=t===1?this._itemContainer():i;return e.appendTo(o).addClass(u).data(rt,t).css("visibility",t===1?"visible":"hidden"),r.appendTo(e).addClass(f),t===1&&(this.option("width")&&r.css("min-width",this.option("width")),this.option("height")&&r.css("min-height",this.option("height"))),r},_renderSubmenuItems:function(n,t,i){this._renderItems(n.items,++i,t),this.callBase(n,t)},_getOverlayOptions:function(){var t=this.option("position"),i=this.option("animation");return{focusStateEnabled:this.option("focusStateEnabled"),animation:i,closeOnOutsideClick:n.proxy(this._closeOnOutsideClickHandler,this),closeOnTargetScroll:!0,deferRendering:!1,disabled:this.option("disabled"),position:{at:t.at,my:t.my,of:this.option("target")},shading:!1,showTitle:!1,height:"auto",width:"auto",onShowing:n.proxy(this._overlayShowingActionHandler,this),onShown:n.proxy(this._overlayShownActionHandler,this),onHiding:n.proxy(this._overlayHidingActionHandler,this),onHidden:n.proxy(this._overlayHiddenActionHandler,this),onPositioned:n.proxy(this._overlayPositionedActionHandler,this),onPositioning:n.proxy(this._overlayPositioningActionHandler,this)}},_overlayShowingActionHandler:function(n){this._actions.onShowing(n);this._clearFocusedItem()},_overlayShownActionHandler:function(n){this._actions.onShown(n);this._clearFocusedItem()},_clearFocusedItem:function(){this._removeFocusedItem(),this.option("focusedElement",null)},_overlayHidingActionHandler:function(n){this._actions.onHiding(n);n.cancel||this._hideAllShownSubmenus()},_overlayHiddenActionHandler:function(n){this._actions.onHidden(n);this._setOptionSilent("visible",!1)},_overlayPositionedActionHandler:n.noop,_overlayPositioningActionHandler:function(n){var i=n.position,r=i;i.h.oversize===0&&i.v.oversize===0||this.option("_notChangePosition")||(r.h.location=Math.round(i.h.location-i.h.oversize),r.v.location=Math.round(i.v.location-i.v.oversize),t.position(this.element(),r))},_closeOnOutsideClickHandler:function(t){var i,u,f,r,o,s,h=n(t.target).closest(this._getInvokeTarget());return t.target===document?!0:h&&h.length?!1:(u=this._getActiveItemsContainer(t.target),f=this._getItemsContainers(),i=this._searchActiveItem(t.target),r=this.element().parents("."+e),o=i[0]===r[0]&&i.length&&r.length,s=this._isIncludeOverlay(u,f)&&i.length,s||o)?(this._getShowSubmenuMode()==="onClick"&&this._hideAllShownChildSubmenus(i),!1):!0},_getActiveItemsContainer:function(t){return n(t).closest("."+f)},_getItemsContainers:function(){return this._overlay._$content.find("."+f)},_searchActiveItem:function(t){return n(t).closest("."+e).eq(0)},_isIncludeOverlay:function(t,i){var r=!1;return n.each(i,function(n,i){t.is(i)&&!r&&(r=!0)}),r},_hideAllShownChildSubmenus:function(t){var r=this,f=t.find("."+u),e=n.extend([],this._shownSubmenus),i;f.length>0&&n.each(e,function(n,u){i=r._searchActiveItem(u.context).parent(),i.parent().is(t.parent().parent())&&!i.is(t.parent())&&r._hideSubmenu(u)})},_showSubmenu:function(n){var i=n.children("."+u).length,t;this._hideSubmenusOnSameLevel(n),i&&(this.callBase(n),n.closest("."+f).find("."+r).removeClass(r),t=this._isSubmenuVisible(n.children("."+u)),t||(n.addClass(r),this._drawSubmenu(n)))},_hideSubmenusOnSameLevel:function(n){var t=n.closest("."+f).find("."+r);t.length&&(t.removeClass(r),this._hideSubmenu(t.find("."+u)))},_hideSubmenuGroup:function(n){this._isSubmenuVisible(n)&&this._hideSubmenuCore(n)},_isSubmenuVisible:function(n){return n.css("visibility")==="visible"},_drawSubmenu:function(i){var f=this.option("animation")?this.option("animation").show:{},r=i.children("."+u);this._overlay&&this._overlay.option("visible")&&(k.isDefined(this._shownSubmenus)||(this._shownSubmenus=[]),n.inArray(r,this._shownSubmenus)&&this._shownSubmenus.push(r),t.position(r,this._getSubmenuPosition(i)),f&&this._animate(r,f),r.css("visibility","visible"),this._stopAnimate(r))},_animate:function(n,t){h.animate(n,t)},_getSubmenuPosition:function(n){var i=this.option("submenuDirection").toLowerCase(),r=n.parent("."+g),t={collision:"flip",of:r,offset:{h:0,v:-1}};switch(i){case"left":t.at="left top",t.my="right top";break;case"right":t.at="right top",t.my="left top";break;default:this.option("rtlEnabled")?(t.at="left top",t.my="right top"):(t.at="right top",t.my="left top")}return t},_updateSubmenuVisibilityOnClick:function(t){var r,f,i,e,o;if(t.args.length&&t.args[0]){if(t.args[0].jQueryEvent.stopPropagation(),r=t.args[0].itemElement,f=this._getItemData(r),e=f&&f.closeMenuOnClick===!1,i=r.children("."+u),r.context===i.context&&i.css("visibility")==="visible")return;if(!f||f.disabled||e)return;this._updateSelectedItemOnClick(t),i.length===0?(o=n(r.parents("."+u)[0]),this._hideSubmenu(o),!t.canceled&&this._overlay&&this._overlay.option("visible")&&this.option("visible",!1)):(this._shownSubmenus&&this._shownSubmenus.length>0&&(this._shownSubmenus[0].is(i)||this._shownSubmenus[0].has(i).length===1?this._hideSubmenu(i):this._hideAllShownSubmenus()),this._showSubmenu(r))}},_hideSubmenu:function(t){var i=this,u=n.extend([],i._shownSubmenus);n.each(u,function(n,u){(t.is(u)||t.has(u).length)&&(u.parent().removeClass(r),i._hideSubmenuCore(u))})},_hideSubmenuCore:function(t){var i=n.inArray(t,this._shownSubmenus),r=this.option("animation")?this.option("animation").hide:null;i>=0&&this._shownSubmenus.splice(i,1),this._stopAnimate(t),r&&this._animate(t,r),t.css("visibility","hidden")},_stopAnimate:function(n){h.stop(n,!0)},_hideAllShownSubmenus:function(){var t=this,i=n.extend([],t._shownSubmenus),u=this._overlay.content().find("."+r);u.removeClass(r),n.each(i,function(n,i){t._hideSubmenuCore(i)})},_optionChanged:function(t){if(!this._cancelOptionChange){if(n.inArray(t.name,b)>-1){this._initActions();return}switch(t.name){case"visible":this._toggleVisibility(t.value);break;case"alternativeInvocationMode":this._invalidate();break;case"items":this._overlay.option("visible")&&this._overlay.hide(),this.callBase(t);break;case"position":case"submenuDirection":this._invalidate();break;case"target":t.previousValue&&this._detachShowContextMenuEvents(n(t.previousValue)),this._invalidate();break;case"focusedElement":this.callBase(t);break;default:this._overlay&&this._overlay.option("visible")&&this._overlay.hide(),this.callBase(t)}}},_toggleVisibility:function(n){n?this._show():this._hide()},_show:function(t){var u=!(this._overlay&&this._positionContextMenu(t)),i=new DevExpress.data.Guid,r;return u&&this._overlay&&(this.option("focusedElement",this._itemElements().first()),r=this._overlay.show(),this._overlay.content().attr({id:i,role:"menu"}),this.setAria("owns",i),this._setOptionSilent("visible",!0)),r||n.Deferred().reject().promise()},_positionContextMenu:function(n){var t=this.option("position"),r=this._createActionByOption("onPositioning",i),i;return n&&n.preventDefault&&(t={at:"top left",my:"top left",of:n}),t.of||(t.of=this.option("target")),i={position:t,jQueryEvent:n},r(i),!i.canceled&&this._overlay?t&&this._overlay.option("position",t):i.jQueryEvent.cancel=!0,i.canceled},_hide:function(){var t;return this._overlay&&(this._overlay.content().removeAttr("id"),t=this._overlay.hide(),this._setOptionSilent("visible",!1)),this.setAria("owns",i),t||n.Deferred().reject().promise()},_clean:function(){this._overlay&&(this._overlay.element().remove(),this._overlay=null),this._detachShowContextMenuEvents(n(this.option("target")))},toggle:function(n){var t=this.option("visible");return n=n===i?!t:n,n?this._show():this._hide()},show:function(){return this.toggle(!0)},hide:function(){return this.toggle(!1)}}))}(jQuery,DevExpress),function(n,t,i){var f=t.ui,e=t.utils,y=f.events,o="dx-menu",b=o+"-vertical",k=o+"-horizontal",d=o+"-item",c=o+"-items-container",l=d+"-expanded",h="dx-context-menu",a=h+"-container-border",p="dx-context-menu-content-delimiter",w="dx-submenu",g="dx-state-disabled",v="dx-state-focused",nt="dx-state-hover",tt="up",it="down",rt="left",ut="right",s="showSubmenu",u="nextItem",r="prevItem",ft=50,et=300,ot=["onSubmenuShowing","onSubmenuShown","onSubmenuHiding","onSubmenuHidden"],st=f.dxContextMenu.inherit({_setDefaultOptions:function(){this.callBase(),this.option({orientation:"horizontal"})},_renderContentImpl:function(){this.callBase(),this.option("_hideDelimiter")||this._renderDelimiter()},_renderDelimiter:function(){this.$contentDelimiter=n("<div>").appendTo(this._itemContainer()).addClass(p)},_overlayPositionedActionHandler:function(n){this._showDelimiter(n)},_hoverEndHandler:function(t){var i=n(t.currentTarget);i.removeClass(v)},_hoverStartHandler:function(t){this.callBase(t);var i=n(t.currentTarget);i.addClass(v)},_showDelimiter:function(n){var f=this._itemContainer().children("."+w).eq(0),e=this.option("position").of,i={of:f},r,u;this.$contentDelimiter&&(r=n.position,u=e.offset(),this.$contentDelimiter.css("display","block"),this.option("orientation")==="horizontal"?(this.$contentDelimiter.width(e.width()<f.width()?e.width()-2:f.width()-2),this.$contentDelimiter.height(2),r.v.location>u.top?Math.round(r.h.location)===Math.round(u.left)?(i.offset="1 -1",i.at="left top",i.my="left top"):(i.offset="-1 -1",i.at="right top",i.my="right top"):(this.$contentDelimiter.height(5),Math.round(r.h.location)===Math.round(u.left)?(i.offset="1 4",i.at="left bottom",i.my="left bottom"):(i.offset="-1 2",i.at="right bottom",i.my="right bottom"))):this.option("orientation")==="vertical"&&(this.$contentDelimiter.width(2),this.$contentDelimiter.height(e.height()<f.height()?e.height()-2:f.height()-2),r.h.location>u.left?Math.round(r.v.location)===Math.round(u.top)?(i.offset="-1 1",i.at="left top",i.my="left top"):(i.offset="-1 -1",i.at="left bottom",i.my="left bottom"):Math.round(r.v.location)===Math.round(u.top)?(i.offset="1 1",i.at="right top",i.my="right top"):(i.offset="1 -1",i.at="right bottom",i.my="right bottom")),t.position(this.$contentDelimiter,i))}});t.registerComponent("dxMenu",f,f.dxMenuBase.inherit({_setDeprecatedOptions:function(){this.callBase(),n.extend(this._deprecatedOptions,{allowSelection:{since:"14.2",message:'Use the "selectionMode" option instead'},submenuHiddenAction:{since:"14.2",alias:"onSubmenuHidden"},submenuHidingAction:{since:"14.2",alias:"onSubmenuHiding"},submenuShowingAction:{since:"14.2",alias:"onSubmenuShowing"},submenuShownAction:{since:"14.2",alias:"onSubmenuShown"}})},_setDefaultOptions:function(){this.callBase(),this.option({orientation:"horizontal",submenuDirection:"auto",showFirstSubmenuMode:{name:"onClick",delay:{show:50,hide:300}},hideSubmenuOnMouseLeave:!1,onSubmenuShowing:null,onSubmenuShown:null,onSubmenuHiding:null,onSubmenuHidden:null})},_setOptionsByReference:function(){this.callBase(),n.extend(this._optionsByReference,{animation:!0,selectedItem:!0})},_focusTarget:function(){return this.element()},_eventBindingTarget:function(){return this.element()},_getOrientation:function(){return this.option("orientation")==="vertical"?"vertical":"horizontal"},_isMenuHorizontal:function(){return this._getOrientation()==="horizontal"},_moveFocus:function(n){var h=this._itemElements().filter(":visible"),t=this._isMenuHorizontal(),i,c=this._getActiveItem(!0),f,e,o;switch(n){case tt:f=t?s:this._getItemsNavigationOperation(r),i=t?c:h,e=this._getKeyboardNavigationAction(f,i),o=e();break;case it:f=t?s:this._getItemsNavigationOperation(u),i=t?c:h,e=this._getKeyboardNavigationAction(f,i),o=e();break;case ut:f=t?this._getItemsNavigationOperation(u):s,i=t?h:c,e=this._getKeyboardNavigationAction(f,i),o=e();break;case rt:f=t?this._getItemsNavigationOperation(r):s,i=t?h:c,e=this._getKeyboardNavigationAction(f,i),o=e();break;default:return this.callBase(n)}o&&o.length!==0&&this.option("focusedElement",o)},_getItemsNavigationOperation:function(n){var t=n;return this.option("rtlEnabled")&&(t=n===r?u:r),t},_getKeyboardNavigationAction:function(t,i){var f=n.noop;switch(t){case s:i.hasClass(g)||(f=n.proxy(this._showSubmenu,this,i));break;case u:f=n.proxy(this._nextItem,this,i);break;case r:f=n.proxy(this._prevItem,this,i)}return f},_init:function(){this.callBase(),this._submenus=[]},_initActions:function(){this._actions={},n.each(ot,n.proxy(function(t,i){this._actions[i]=this._createActionByOption(i)||n.noop},this))},_render:function(){this._visibleSubmenu=[],this.callBase(),this.element().addClass(o),this.setAria("role","menubar")},_getHideDelay:function(){var n=this.option("showFirstSubmenuMode").delay;return n?e.isObject(n)?n.hide:n:et},_getShowDelay:function(){var n=this.option("showFirstSubmenuMode").delay,t;return t=n?e.isObject(n)?n.show:n:ft},_renderContainer:function(){var r=this.option("orientation")==="vertical",t=n("<div>"),i=n("<ul>");return t.appendTo(this.element()).addClass(r?b:k),i.appendTo(t).addClass(c).css("min-height",this._getValueHeight(t)),i},_getValueHeight:function(t){var i=n("<div>").html("Jj").css({width:"auto",position:"fixed",top:"-3000px",left:"-3000px"}).appendTo(t),r=i.height();return i.remove(),r},_renderSubmenuItems:function(n,t){var i=this._createSubmenu(n.items,t);this._submenus.push(i),this._renderBorderElement(t),this.callBase(n,t)},_createSubmenu:function(t,i){var u=n("<div>").addClass(h).appendTo(i),r=this._createComponent(u,"dxSubmenu",n.extend(this._getSubmenuOptions(),{items:t,position:this.getSubmenuPosition(i)}));return this._attachSubmenuHandlers(i,r),r},_getSubmenuOptions:function(){var i=n("<div>"),t=this._isMenuHorizontal();return{itemTemplate:this.option("itemTemplate"),templateProvider:this.option("templateProvider"),target:i,orientation:this.option("orientation"),selectionMode:this.option("selectionMode"),selectionByClick:this.option("selectionByClick"),cssClass:this.option("cssClass"),hoverStateEnabled:this.option("hoverStateEnabled"),activeStateEnabled:this.option("activeStateEnabled"),focusStateEnabled:this.option("focusStateEnabled"),animation:this.option("animation"),disabled:this.option("disabled"),showSubmenuMode:this._getShowSubmenuMode(),onSelectionChanged:n.proxy(this._nestedItemOnSelectionChangedHandler,this),onItemClick:n.proxy(this._nestedItemOnItemClickHandler,this),onLeftFirstItem:t?null:n.proxy(this._moveMainMenuFocus,this,r),onLeftLastItem:t?null:n.proxy(this._moveMainMenuFocus,this,u),onCloseRootSubmenu:t?n.proxy(this._moveMainMenuFocus,this,r):null,onExpandLastSubmenu:t?n.proxy(this._moveMainMenuFocus,this,u):null,_remoteSelectionSync:!0,_notChangePosition:!0,_hideDelimiter:this.option("_hideDelimiter")}},_getShowFirstSubmenuMode:function(){var n;return n=e.isObject(this.option("showFirstSubmenuMode"))?this._isDesktopDevice()?this.option("showFirstSubmenuMode").name:"onClick":this._isDesktopDevice()?this.option("showFirstSubmenuMode"):"onClick"},_moveMainMenuFocus:function(n){var i=this.element().find("."+l).first(),t;switch(n){case r:t=i.parent().prev(),t.length||(t=i.parent().siblings().last()),t=t.children();break;case u:t=i.parent().next(),t.length||(t=i.parent().siblings().first()),t=t.children()}this._visibleSubmenu.length&&this._hideSubmenu(this._visibleSubmenu),this.focus(),this.option("focusedElement",t)},_nestedItemOnSelectionChangedHandler:function(n){var t=n.addedItems,i=n.element.dxSubmenu("instance"),r=this._createActionByOption("onSelectionChanged",{});r(n),this._clearSelectionInSubmenus(t[0],i),this._clearRootSelection(),this.option("selectedItems",t)},_clearSelectionInSubmenus:function(t,i){var r=this,u=!arguments.length;n.each(this._submenus,function(n,t){var o=t._itemContainer(),s=!o.is(i&&i._itemContainer()),f=o.find("."+r._selectedItemClass()),e;(s&&f.length||u)&&(f.removeClass(r._selectedItemClass()),e=r._getItemData(f),e&&(e.selected=!1),t._clearSelectedItems())})},_clearRootSelection:function(){var n=this.element().find("."+c).first().children().children().filter("."+this._selectedItemClass()),t;n.length&&(t=this._getItemData(n),t.selected=!1,n.removeClass(this._selectedItemClass())),this._clearSelectedItems()},_nestedItemOnItemClickHandler:function(n){var t=this._createActionByOption("onItemClick",{});t(n)},_updateSelectedItemOnClick:function(n){var t=this.option("selectedIndex");this.callBase(n),t!==this.option("selectedIndex")&&this._clearSelectionInSubmenus()},_attachSubmenuHandlers:function(t,i){var r=this,f=i._overlay.content(),e=f.find("."+w),u=y.addNamespace("dxhoverend",this.NAME+"_submenu");i.option({onShowing:n.proxy(this._submenuOnShowingHandler,this,t,i),onShown:n.proxy(this._submenuOnShownHandler,this,t,i),onHiding:n.proxy(this._submenuOnHidingHandler,this,t,i),onHidden:n.proxy(this._submenuOnHiddenHandler,this,t,i)}),n.each(e,function(i,f){n(f).off(u).on(u,null,n.proxy(r._submenuMouseLeaveHandler,r,t))})},_submenuOnShowingHandler:function(n,t){var r=n.children("."+a);this._actions.onSubmenuShowing({rootItem:n,submenu:t});this._options.width!==i&&(this._options.rtlEnabled?r.css("width",this._$element.width()-n.position().right):r.css("width",this._$element.width()-n.position().left)),r.show(),n.addClass(l)},_submenuOnShownHandler:function(n,t){this._actions.onSubmenuShown({rootItem:n,submenu:t})},_submenuOnHidingHandler:function(n,t,i){var u=n.children("."+a),r=i;r.rootItem=n,r.submenu=t;this._actions.onSubmenuHiding(r);i=r,i.cancel||(u.hide(),n.removeClass(l))},_submenuOnHiddenHandler:function(n,t){this._actions.onSubmenuHidden({rootItem:n,submenu:t})},_submenuMouseLeaveHandler:function(t,i){var r=this,u=n(i.relatedTarget).parents("."+h)[0],f=this._getSubmenuElementByRootElement(t).dxSubmenu("instance")._overlay.content()[0];this.option("hideSubmenuOnMouseLeave")&&u!==f&&(clearTimeout(this._showSubmenuTimer),clearTimeout(this._hideSubmenuTimer),setTimeout(n.proxy(this._hideSubmenuAfterTimeout,this),r._getHideDelay(),t))},_hideSubmenuAfterTimeout:function(t){var i=this._getSubmenuElementByRootElement(t),r=this._visibleSubmenu.length,u=n(this._visibleSubmenu.context).hasClass(nt);!r||this._getFocusedSubmenuItem(this._getSubmenuInstance(this._visibleSubmenu)).length||u||i.length&&this._getSubmenuInstance(i).hide()},_getFocusedSubmenuItem:function(n){return n._overlay.content().find("."+v)},_getSubmenuInstance:function(n){return n.data().dxSubmenu},_getSubmenuElementByRootElement:function(n){return n&&n.children("."+h)},_getSubmenuInstanceByRootElement:function(n){var t=this._getSubmenuElementByRootElement(n);return t.length&&this._getSubmenuInstance(t)},getSubmenuPosition:function(n){var i=this.option("orientation").toLowerCase()==="vertical",u=this.option("submenuDirection").toLowerCase(),r=this.option("rtlEnabled"),t={collision:"flip",of:n};switch(u){case"leftortop":t.at=i?"left top":"left top",t.my=i?"right top":"left bottom";break;case"rightorbottom":t.at=i?"right top":"left bottom",t.my=i?"left top":"left top";break;default:i?(t.at=r?"left top":"right top",t.my=r?"right top":"left top"):(t.at=r?"right bottom":"left bottom",t.my=r?"right top":"left top")}return t},_renderBorderElement:function(t){n("<div>").appendTo(t).addClass(a).hide()},_hoverStartHandler:function(t){var u=y.addNamespace("dxpointermove",this.NAME),i=this._getItemElementByEventArgs(t),r=this._getSubmenuInstanceByRootElement(i),f=e.isDefined(t.buttons)&&t.buttons===1||!e.isDefined(t.buttons)&&t.which===1;if(!this._isItemDisabled(i)&&(i.off(u),this._getShowFirstSubmenuMode()==="onHover"&&r&&!f)){if(clearTimeout(this._hideSubmenuTimer),clearTimeout(this._showSubmenuTimer),!r._overlay.option("visible")){i.on(u,n.proxy(this._itemMouseMoveHandler,this));this._showSubmenuTimer=this._getHideDelay()}r.element().is(this._visibleSubmenu)||this._hideSubmenu(this._visibleSubmenu)}},_hoverEndHandler:function(t){var i=this,r=this._getItemElementByEventArgs(t);this._isItemDisabled(r)||n(t.relatedTarget).hasClass(p)||this.option("hideSubmenuOnMouseLeave")&&!n(t.relatedTarget).hasClass(c)&&(clearTimeout(this._showSubmenuTimer),clearTimeout(this._hideSubmenuTimer),this._hideSubmenuTimer=setTimeout(function(){i._hideSubmenuAfterTimeout(r)},i._getHideDelay()))},_showSubmenu:function(n){var t=this._getSubmenuElementByRootElement(n);this._visibleSubmenu.length&&!this._visibleSubmenu.is(t)&&this._hideSubmenu(this._visibleSubmenu),t.length&&this._getSubmenuInstance(t).show(),this._visibleSubmenu=t,this._hoveredRootItem=n},_hideSubmenu:function(n){n.length&&this._getSubmenuInstance(n).hide(),this._visibleSubmenu.length&&this._visibleSubmenu.is(n)&&(this._visibleSubmenu=[]),this._hoveredRootItem=null},_itemMouseMoveHandler:function(t){var i=this,r=n(t.currentTarget);this._showSubmenuTimer&&(clearTimeout(this._hideSubmenuTimer),clearTimeout(this._showSubmenuTimer),this._showSubmenuTimer=setTimeout(function(){var n=i._getSubmenuInstanceByRootElement(r);n&&!n._overlay.option("visible")&&i._showSubmenu(r)},i._getShowDelay()))},_updateSubmenuVisibilityOnClick:function(n){var r,u,t,i=n.args.length&&n.args[0];if(i){if(i.jQueryEvent.stopPropagation(),u=i.itemData,r=i.itemElement,u.disabled)return;t=this._getSubmenuInstanceByRootElement(r),this._updateSelectedItemOnClick(n),t?t._overlay.option("visible")?this._getShowFirstSubmenuMode()==="onClick"&&this._hideSubmenu(t.element()):this._showSubmenu(r):this._visibleSubmenu.length&&this._hideSubmenu(this._visibleSubmenu)}},_optionChanged:function(n){if(!this._cancelOptionChange){this._hideShownSubmenuOnOptionChange(n.name);switch(n.name){case"selectedItems":var t=n.value[0];this._isItemInSubmenu(t)?(this._syncSelectionOptions(n.name),this._normalizeSelectedItems()):this.callBase(n);break;case"orientation":case"submenuDirection":case"hideSubmenuOnMouseLeave":case"showFirstSubmenuMode":this._invalidate();break;case"showSubmenuMode":this._changeSubmenusOption(n.name,n.value);break;case"onSubmenuShowing":case"onSubmenuShown":case"onSubmenuHiding":case"onSubmenuHidden":this._initActions();break;default:this.callBase(n)}}},_hideShownSubmenuOnOptionChange:function(n){n!=="focusedElement"&&this._visibleSubmenu.length&&this._hideSubmenu(this._visibleSubmenu)},_changeSubmenusOption:function(t,i){n.each(this._submenus,function(n,r){r.option(t,i)})},_isItemInSubmenu:function(t){return n.inArray(JSON.stringify(t),this._getStringifiedArray(this.option("items")))<0},selectItem:function(t){var i=this._getItemData(t);this._isItemInSubmenu(i)?n.each(this._submenus,function(n,r){r._isOwnItem(i)&&r.selectItem(t)}):this.callBase(t)}})),t.registerComponent("dxSubmenu",f.dxMenu,st)}(jQuery,DevExpress),function(n,t,i){var l=t.ui,c=l.events,u=t.data.utils,o=t.utils,b="dx-treeview",e="dx-treeview-node-container",s="dx-treeview-node-container-opened",f="dx-treeview-node",r="dx-treeview-item",k="dx-treeview-item-with-checkbox",d="dx-treeview-item-data",a="dx-treeview-node-is-leaf",h="dx-treeview-toggle-item-visibility",y="dx-treeview-toggle-item-visibility-opened",g="dx-treeview-select-all-item",w="dx-state-focused",v="dx-state-disabled",nt="dx-state-selected",p="data-item-id",tt="dxdblclick",it=n.noop;t.registerComponent("dxTreeView",l,l.CollectionWidget.inherit({_supportedKeys:function(){var i=function(n){var t=this.option("focusedElement");t&&(n.target=t,n.currentTarget=t,this._itemClickHandler(n,t.find(">."+r)))},u=function(n){n.preventDefault(),this._changeCheckBoxState(this.option("focusedElement"))},f=function(n,t){var i,u;this.option("expandAllEnabled")&&(t.preventDefault(),i=this.option("focusedElement"),i)&&(u=this._getItemData(i.find("."+r)),this._toggleExpandedNestedItems([u],n))};return n.extend(this.callBase(),{enter:this.option("showCheckBoxes")?u:i,space:this.option("showCheckBoxes")?u:i,asterisk:n.proxy(f,this,!0),minus:n.proxy(f,this,!1)})},_changeCheckBoxState:function(n){var i=n.find("> .dx-checkbox"),t=i.dxCheckBox("instance"),u=t.option("value");t.option("disabled")||this._updateItemSelection(!u,n.find("."+r).get(0),!0,n)},_toggleExpandedNestedItems:function(n,t){var i,u,r;if(n)for(i=0,u=n.length;i<u;i++)r=n[i],this._toggleExpandedState(r,t),this._toggleExpandedNestedItems(r.items,t)},_getNodeElementById:function(n){return this.element().find("["+p+"='"+n+"']")},_activeStateUnit:"."+r,_setDefaultOptions:function(){this.callBase(),this.option({animationEnabled:!0,dataStructure:"tree",expandedItems:[],expandAllEnabled:!1,keyExpr:"id",displayExpr:"text",selectedExpr:"selected",expandedExpr:"expanded",disabledExpr:"disabled",itemsExpr:"items",parentIdExpr:"parentId",hasItemsExpr:"hasItems",showCheckBoxes:!1,selectNodesRecursive:!0,selectAllEnabled:!1,selectAllText:Globalize.localize("dxList-selectAll"),onItemSelected:null,onItemExpanded:null,onItemCollapsed:null,scrollDirection:"vertical",virtualModeEnabled:!1,rootValue:0,focusStateEnabled:!1,selectionMode:"multi"})},_setDeprecatedOptions:function(){this.callBase(),n.extend(this._deprecatedOptions,{selectedItems:{since:"14.2",message:"Use item.selected instead"},expandedItems:{since:"14.2",message:"Use item.expanded instead"}})},_defaultOptionsRules:function(){return this.callBase().concat([{device:function(){return t.devices.real().generic&&!t.devices.isSimulator()},options:{hoverStateEnabled:!0,focusStateEnabled:!0}}])},_initSelectedItems:n.noop,_syncSelectionOptions:n.noop,_fireSelectionChanged:function(){var t=this._selectionChangePromise;n.when(t).done(n.proxy(function(){this._createActionByOption("onSelectionChanged",{excludeValidators:["disabled","readOnly"]})()},this))},_initExpressions:function(){this._compileKeyAccessors(),this._compileDisplayAccessors(),this._compileSelectedAccessors(),this._compileExpandedAccessors(),this._compileItemsAccessors(),this._compileParentIdAccessors(),this._compileDisabledAccessors(),this._compileHasItemsAccessors()},_initDynamicTemplates:function(){var t=this.option("displayExpr");t!=="text"&&t!=="html"?this._dynamicTemplates.item=new l.DefaultTemplate(n.proxy(function(t){var i=n("<div>"),r=t.icon||t.iconSrc;return r&&o.getImageContainer(r).appendTo(i),n("<span>").text(this._displayGetter(t)).appendTo(i),i},this)):delete this._dynamicTemplates.item},_compileKeyAccessors:function(){this._keyGetter=u.compileGetter(this.option("keyExpr")),this._keySetter=u.compileSetter(this.option("keyExpr"))},_compileDisplayAccessors:function(){this._displayGetter=u.compileGetter(this.option("displayExpr")),this._displaySetter=u.compileSetter(this.option("displayExpr"))},_compileSelectedAccessors:function(){this._selectedGetter=u.compileGetter(this.option("selectedExpr")),this._selectedSetter=u.compileSetter(this.option("selectedExpr"))},_compileExpandedAccessors:function(){this._expandedGetter=u.compileGetter(this.option("expandedExpr")),this._expandedSetter=u.compileSetter(this.option("expandedExpr"))},_compileItemsAccessors:function(){this._itemsGetter=u.compileGetter(this.option("itemsExpr")),this._itemsSetter=u.compileSetter(this.option("itemsExpr"))},_compileParentIdAccessors:function(){this._parentIdGetter=u.compileGetter(this.option("parentIdExpr")),this._parentIdSetter=u.compileSetter(this.option("parentIdExpr"))},_compileDisabledAccessors:function(){this._disabledGetter=u.compileGetter(this.option("disabledExpr")),this._disabledSetter=u.compileSetter(this.option("disabledExpr"))},_compileHasItemsAccessors:function(){this._hasItemsGetter=u.compileGetter(this.option("hasItemsExpr")),this._hasItemsSetter=u.compileSetter(this.option("hasItemsExpr"))},_optionChanged:function(n){var o=n.name,t=n.value,i,r,u,f,e;switch(o){case"selectAllEnabled":t?this._$selectAllItem&&this._$selectAllItem.length||this._renderSelectAllItem():this._$selectAllItem&&(this._$selectAllItem.remove(),delete this._$selectAllItem);break;case"selectAllText":this._$selectAllItem&&this._$selectAllItem.dxCheckBox("instance").option("text",t);break;case"scrollDirection":this._scrollableContainer.option("direction",t);break;case"selectedItems":if(this._$selectAllItem){if(i=this._$selectAllItem.dxCheckBox("instance"),r=i.option("value"),r&&this._itemsCount===t.length)return;this._suppressUpdateSelectAllItemValue=!0,i.option("value",this._calculateSelectAllItemValue()),this._suppressUpdateSelectAllItemValue=!1}break;case"items":this._suppressDeprecatedWarnings(),delete this._$selectAllItem,this.option("selectedItems").length&&this.option("selectedItems",[]),this.option("expandedItems").length&&this.option("expandedItems",[]),this.callBase(n),this._resumeDeprecatedWarnings();break;case"keyExpr":case"displayExpr":this._dynamicTemplates.item||this._initDynamicTemplates(),this._initExpressions(),this.repaint();break;case"itemsExpr":case"selectedExpr":case"expandedExpr":case"parentIdExpr":case"disabledExpr":case"hasItemsExpr":this._initExpressions(),this.repaint();break;case"dataStructure":case"showCheckBoxes":case"rootValue":this.repaint();break;case"expandedItems":u=this.element().hasClass(w),this.repaint(),u&&(this.element().focus(),f=this.option("focusedElement").attr(p),e=this._getNodeElementById(f),this.option("focusedElement",e));break;case"selectNodesRecursive":case"onItemSelected":case"onItemExpanded":case"onItemCollapsed":case"expandAllEnabled":case"animationEnabled":case"virtualModeEnabled":break;default:this.callBase(n)}},_nodes:[],_initDataSource:function(){this.callBase(),this._isVirtualMode()&&this._dataSource.filter(this.option("parentIdExpr"),this.option("rootValue"))},_dataSourceLoadErrorHandler:function(){this._renderEmptyMessage()},_init:function(){this._initExpressions(),this.callBase(),this._initDynamicTemplates()},_render:function(){if(this._isVirtualMode()&&this._dataSource&&!this._dataSource.items().length){this._initialized=!1;return}var t=this;this.element().addClass(b),this._itemsCount=0;this.element().off("dxpointerdown").on("dxpointerdown",function(i){var r=n(i.target).closest(t._activeStateUnit);r.length||i.preventDefault()});this._makeNodes(),this._setKeyForItems(this._nodes,1),this.callBase(),this.setAria("role","tree")},_makeNodes:function(){this._nodes=this._getSmartItemsCopy(this.option("items")),this.option("dataStructure")==="plain"&&(this._nodes=this._createHierarchicalStructure(this._nodes))},_getSmartItemsCopy:function(t){var i=this,r=[];return n.each(t,function(t,u){var f=n.extend(!0,{},u),e,o;i._itemHasChildren(f)&&(e=i._itemsGetter(f),o=i._getSmartItemsCopy(e),i._itemsSetter(f,o)),r.push(f)}),r},_setKeyForItems:function(t,i){var r=this;return n.each(t,function(n,t){if(r._isPrimitiveValue(t)&&(t=r._makeObjectFromPrimitive(t)),o.isDefined(r._keyGetter(t)))return!1;r._keySetter(t,i),i++,r._itemHasChildren(t)&&(i=r._setKeyForItems(r._itemsGetter(t),i))}),i},_makePlainItems:function(){return this._makePlainList(this.option("items"),null,!0)},_makePlainNodes:function(){return this._makePlainList(this._nodes,null,!0)},_updateSelectionItemsOption:function(){var t=this,i=[];return n.each(t._plainItems,function(n,r){t._selectedGetter(r)&&i.push(r)}),i},_renderContentImpl:function(){var n=this._nodes,i,r,t;n.length&&(this._makePlainStructures(),this._applyExpandedItemsFromOption(),this._applySelectedItemsFromOption(n),i=this._makePlainList(n,null),this.option("selectNodesRecursive")&&(n=this._calculateChildrenSelectedState(n),this._calculateParentSelectedState(i)),this._calculateParentExpandedState(i),this._createParentFieldForEachItem(n),this._suppressDeprecatedWarnings(),r=this._updateSelectionItemsOption(),r.length&&this.option("selectedItems",r),this._resumeDeprecatedWarnings(),this._renderScrollableContainer(),t=this._renderNodeContainer(),this._scrollableContainer.content().append(t),this._renderItems(t,n,!0),this.option("selectAllEnabled")&&this._renderSelectAllItem(t)),this._renderEmptyMessage()},_makePlainStructures:function(){this._startIndex=1,this._plainItems=this._makePlainItems(),this._startIndex=1,this._plainNodes=this._makePlainNodes()},_isVirtualMode:function(){return this.option("virtualModeEnabled")&&this.option("dataSource")},_fireContentReadyAction:function(){this.callBase(),this._scrollableContainer&&this._scrollableContainer.content().height()>this.element().height()&&(this._scrollableContainer.update(),it())},_createHierarchicalStructure:function(n){for(var u=[],f={},e=n.length,i,r,o,t=0;t<e;t++)f[this._keyGetter(n[t])]=n[t],this._itemsSetter(n[t],[]);for(t=0;t<e;t++)i=this._parentIdGetter(n[t]),r=this._createNode(n[t]),i?(o=this._itemsGetter(f[i]),o.push(r)):u.push(r);return u},_createNode:function(n){var t={};return this._keySetter(t,this._keyGetter(n)),this._displaySetter(t,this._displayGetter(n)),this._itemsSetter(t,this._itemsGetter(n)),this._expandedSetter(t,this._expandedGetter(n)),this._disabledSetter(t,this._disabledGetter(n)),n.hasOwnProperty(this.option("selectedExpr"))&&typeof this._selectedGetter(n)!="undefined"?this._selectedSetter(t,this._selectedGetter(n)):this._selectedSetter(t,!1),t},_createParentFieldForEachItem:function(t,i){var r=this;i=i?n.extend(!0,{},i):null,n.each(t,function(n,t){r._itemsCount++,o.isDefined(i)&&r._itemsGetter(i)&&r._itemsSetter(i,null),r._isPrimitiveValue(t)&&(t=r._makeObjectFromPrimitive(t)),t.parent=i,r._plainNodes[r._keyGetter(t)].parent=i,r._itemHasChildren(t)&&r._createParentFieldForEachItem(r._itemsGetter(t),t)})},_makeObjectFromPrimitive:function(n){var t=n;return n={},this._keySetter(n,t),n},_isPrimitiveValue:function(t){return n.inArray(n.type(t),["object","array","function"])===-1},_itemHasChildren:function(n){var t=this._itemsGetter(n);return t&&t.length},_renderScrollableContainer:function(){this._scrollableContainer=this._createComponent(n("<div>").appendTo(this.element()),"dxScrollable",{direction:this.option("scrollDirection"),useKeyboard:!1})},_renderNodeContainer:function(t){var i=n("<ul>").addClass(e),u;return this.setAria("role","group",i),t&&(u=this._getItemData(t.find("> ."+r)),this._expandedGetter(u)&&i.addClass(s),i.appendTo(t)),i},_renderItems:function(t,i){var r=this,u=r.option("showCheckBoxes");n.each(i,function(i,e){var v,c,l;r._isPrimitiveValue(e)&&(e=r._makeObjectFromPrimitive(e));var a=r._keyGetter(e),o=n("<li>").addClass(f).appendTo(t).attr(p,a),h=r._getSourceItemByKey(a);if(r.setAria({role:"treeitem",label:r._displayGetter(h)||"",expanded:h.items&&(r._expandedGetter(h)||"false")},o),u&&r._renderCheckBox(o,e),v=r._renderItem.call(r,i,h,o),r._attachDblclickToItem(v),r._hasItemsGetter(h)!==!1){if(r._isVirtualMode()){r._renderToggleItemVisibilityIcon(o,e),r._renderNodeContainer(o);return}c=r._itemsGetter(e),c&&n.isArray(c)&&c.length?(r._renderToggleItemVisibilityIcon(o,e),l=r._renderNodeContainer(o),r._expandedGetter(e)&&(r._renderItems(l,c,!1),l.addClass(s))):r._addLeafClass(o)}else r._addLeafClass(o)}),this._renderFocusTarget()},_executeItemRenderAction:function(n,t,i){var r=this._getNodeByKey(this._getItemKey(t));this._getItemRenderAction()({itemElement:i,itemIndex:n,itemData:t,node:r})},_addLeafClass:function(n){n.addClass(a)},_attachDblclickToItem:function(n){var t=this,r=c.addNamespace(tt,t.NAME);n.off(r).on(r,function(r){var u=t._getItemData(n);t._toggleExpandedState(u,i,r)})},_toggleExpandedState:function(n,t,i){var u,r;(this._isVirtualMode()&&(u=this._getNodeElementById(this._getItemKey(n)),this._createLoadIndicator(u)),r=this._expandedGetter(n),this._disabledGetter(n))||o.isDefined(r)&&r===t||(o.isDefined(t)||(t=!r),this._updateExpandedState(n,t),this._updateExpandedItemsUI(n,t,i))},_createLoadIndicator:function(n){var t=n.find(">."+h),i=n.find(" > ."+e);!t.hasClass(y)&&i.is(":empty")&&(this._createComponent("<div>","dxLoadIndicator",{}).element().appendTo(n),t.css("display","none"))},_getSourceItemByKey:function(n){return this._plainItems[n]},_getItemKey:function(n){var t=this._keyGetter(n);return o.isDefined(t)||(t=this._getKeyForSourceItem(n)),t},_getKeyForSourceItem:function(t){var i=null;return n.each(this._plainItems,function(n,r){if(t===r)return i=n,!1}),i},_getNodeByKey:function(n){return this._plainNodes[n]},_renderSelectAllItem:function(t){t=t||this.element().find("."+e).first(),this._$selectAllItem=n("<div>").addClass(g);var i=this._calculateSelectAllItemValue();this._createComponent(this._$selectAllItem,"dxCheckBox",{value:i,text:this.option("selectAllText"),onValueChanged:n.proxy(this._toggleSelectAll,this)}),this._toggleSelectedClass(this._$selectAllItem,i),t.before(this._$selectAllItem)},_calculateSelectAllItemValue:function(){this._suppressDeprecatedWarnings();var n=!1,t=this.option("selectedItems").length;return t&&(n=this._itemsCount===t?!0:i),this._resumeDeprecatedWarnings(),n},_toggleSelectAll:function(n){if(!this._suppressUpdateSelectAllItemValue){if(this._suppressDeprecatedWarnings(),this._updateAllItems(this._nodes,n.value),n.value){var t=this._updateSelectionItemsOption();this.option("selectedItems",t)}else this.option("selectedItems",[]);this._resumeDeprecatedWarnings(),this._fireSelectionChanged()}},_updateAllItems:function(t,i){var r=this;n.each(t,function(n,t){var u=r._getNodeElementById(r._keyGetter(t)),f=r._getSourceItemByKey(r._keyGetter(t)),e=r._selectedGetter(t);if(e===i)return!0;u.length&&(u.find("> .dx-checkbox").dxCheckBox("instance").option("value",i),r._toggleSelectedClass(u,i)),r._commonSelectedSetter(f,t,i),u=null,r._itemHasChildren(t)&&r._updateAllItems(r._itemsGetter(t),i)})},_applySelectedItemsFromOption:function(t){var i=this;this._suppressDeprecatedWarnings(),n.each(this.option("selectedItems"),function(n,r){var u=i._getItemFromArray(r,t),f,e;u&&(f=i._getNodeByKey(i._keyGetter(u)),i._commonSelectedSetter(u,f,!0)),e=i._getNodeByKey(i._getItemKey(r)),i._commonSelectedSetter(r,e,!0)}),this._resumeDeprecatedWarnings()},_applyExpandedItemsFromOption:function(){var t=this;this._suppressDeprecatedWarnings(),n.each(this.option("expandedItems"),function(n,i){var r=t._getNodeByKey(t._getItemKey(i));t._commonExpandedSetter(i,r,!0)}),this._resumeDeprecatedWarnings()},_commonExpandedSetter:function(n,t,i){this._expandedSetter(n,i),this._expandedSetter(t,i)},_commonSelectedSetter:function(n,t,i){this._selectedSetter(n,i),this._selectedSetter(t,i)},_calculateChildrenSelectedState:function(t){var i=this;return n.each(t,function(t,r){i._selectedGetter(r)&&i._itemHasChildren(r)&&n.each(i._itemsGetter(r),function(n,t){var r=i._getSourceItemByKey(i._keyGetter(t));i._commonSelectedSetter(r,t,!0)}),i._itemHasChildren(r)&&i._itemsSetter(r,i._calculateChildrenSelectedState(i._itemsGetter(r)))}),t},_makePlainList:function(t,i,r){var u=this,f=r?{}:[];return i=i||f,n.each(t,function(n,t){if(r){u._isPrimitiveValue(t)&&(t=u._makeObjectFromPrimitive(t));var f=u._keyGetter(t);o.isDefined(f)||(f=u._startIndex),i[f]=t,u._startIndex++}else i.push(t);u._itemHasChildren(t)&&u._makePlainList(u._itemsGetter(t),i,r)}),i},_calculateParentSelectedState:function(t){function h(n){return f._selectedGetter(n)===!0}function c(n){return n.hasOwnProperty(f.option("selectedExpr"))&&typeof f._selectedGetter(n)=="undefined"}for(var s=t.length-1,f=this,u,r=s;r>=0;r--)if(!this._selectedGetter(t[r])&&(u=this._itemsGetter(t[r]),u&&u.length)){var o=n.grep(u,h),l=n.grep(u,c),a=this._getSourceItemByKey(this._keyGetter(t[r])),e=!1;o.length?e=o.length===u.length?!0:i:l.length&&(e=i),f._commonSelectedSetter(t[r],a,e)}return t},_calculateParentExpandedState:function(t){function s(n){return o._expandedGetter(n)===!0}for(var e=t.length-1,o=this,r,u,f,i=e;i>=0;i--)this._expandedGetter(t[i])||(r=this._itemsGetter(t[i]),r&&r.length&&(u=n.grep(r,s),u.length&&(f=this._getSourceItemByKey(this._keyGetter(t[i])),this._commonExpandedSetter(t[i],f,!0))))},_renderCheckBox:function(t,i){var r=this._calculateCheckBoxValue(i),u;t.addClass(k),this.setAria("selected",r,t),u=n("<div>").appendTo(t),this._createComponent(u,"dxCheckBox",{value:r,onValueChanged:n.proxy(this._changeCheckboxValue,this),focusStateEnabled:!1,disabled:this._disabledGetter(i)}),r!==!1&&this._toggleSelectedClass(t,r),this._attachCheckboxClick(u,i)},_toggleSelectedClass:function(n,t){n.toggleClass(nt,!!t)},_attachCheckboxClick:function(t,i){var r=c.addNamespace("dxclick",this.NAME),u=this._keyGetter(i),f=function(n){this._itemJQueryEventHandler(n,"onItemSelected",{node:this._getNodeByKey(u)})};t.off(r).on(r,n.proxy(f,this))},_renderToggleItemVisibilityIcon:function(t,i){var r=n("<div>").addClass(h).appendTo(t);this._expandedGetter(i)&&!this._isVirtualMode()&&(r.addClass(y),t.parent().addClass(s)),this._disabledGetter(i)&&r.addClass(v),this._renderToggleItemVisibilityIconClick(r,i)},_renderToggleItemVisibilityIconClick:function(n){var u=c.addNamespace("dxclick",this.NAME),f=this;n.off(u).on(u,function(t){var u=n.parent().find(">."+r),e=f._getItemData(u);f._toggleExpandedState(e,i,t)})},_updateExpandedState:function(t,i){this._suppressDeprecatedWarnings();var r=this.option("expandedItems"),f=this._getItemKey(t),e=this._getNodeByKey(f),u=this;u._commonExpandedSetter(t,e,i),i?u._getItemFromArray(t,r)||r.push(t):n.each(r,function(n,t){if(u._keyGetter(t)===f)return r.splice(n,1),!1}),this._resumeDeprecatedWarnings()},_updateExpandedItemsUI:function(t,i,r){var u=this._getNodeElementById(this._getItemKey(t)),o=u.find(">."+h),f=u.find(" > ."+e);o.toggleClass(y,i),i?this._renderNestedItems(f).done(n.proxy(function(n){n&&(this.setAria("expanded",i,u),this._fireExpandedStateUpdatedEvt(i,t,r)),this._animateNodeContainer(f,i)},this)):(this.setAria("expanded",i,u),this._animateNodeContainer(f,i),this._fireExpandedStateUpdatedEvt(i,t,r))},_animateNodeContainer:function(i,r){var u=i.height();t.fx.stop(i,!0),t.fx.animate(i,{type:"custom",duration:this.option("animationEnabled")?400:0,from:{"max-height":r?0:u},to:{"max-height":r?u:0},start:function(){i.addClass(s)},complete:n.proxy(function(){i.css("max-height","none"),i.toggleClass(s,r),this._scrollableContainer.update()},this)})},_fireExpandedStateUpdatedEvt:function(n,t,i){var r=n?"onItemExpanded":"onItemCollapsed",u=this._getItemKey(t),f=this._getNodeByKey(u),e,s=this.option(r);s&&(o.isDefined(i)?this._itemJQueryEventHandler(i,r,{node:f}):(e=this._itemElements().eq(u-1),this._itemEventHandler(e,r,{jQueryEvent:i,node:f})))},_getParentById:function(t,i){var r;return n.each(t,function(n,t){t.id===i&&(r=t);return}),r},_renderNestedItems:function(t){if(!t.is(":empty"))return n.Deferred().resolve(!0).promise();var u=t.parent().find(">."+r),f=this._getItemData(u),e=this._getItemKey(f),o=this._getNodeByKey(e),i=n.Deferred();return this._isVirtualMode()?this._renderVirtualNodes(t).done(function(n){i.resolve(n&&n.length)}):(this._renderItems(t,this._itemsGetter(o),!1),i.resolve(!0)),i.promise()},_renderVirtualNodes:function(t){var u=t.parent().find(">."+r),f=this._getItemData(u),e=this._getItemKey(f),i=this;return this._dataSource.filter([this.option("parentIdExpr"),e]),this._dataSource.load().done(function(r){var e=[],o,s;n.each(r,function(n,t){e.push(i._createNode(t))}),i._renderItems(t,e,!1),e.length&&!i._selectedGetter(f)&&(o=i._keyGetter(e[0]),s=i._getNodeElementById(o),i._updateParentsState(i._getNodeByKey(o),s)),i._normalizeIconState(u,e.length)})},_normalizeIconState:function(n,t){var i=n.siblings(".dx-loadindicator"),r=n.siblings("."+h);i.dxLoadIndicator("instance").option("visible",!1),t?r.css("display","block"):(n.siblings("."+h).removeClass(h),n.parent().addClass(a))},_dataSourceChangedHandler:function(n){this._initialized&&this._isVirtualMode()?(this.option().items=this.option("items").concat(n),this._updateNodesFields(n)):this.option("items",n)},_updateNodes:function(){this._makeNodes(),this._makePlainStructures()},_calculateCheckBoxValue:function(n){var t;return t=this._isVirtualMode()?!!n.selected:n.hasOwnProperty(this.option("selectedExpr"))?this._selectedGetter(n):!1},_changeCheckboxValue:function(n){this._isVirtualMode()&&this._updateNodesFields();var t=n.element.parent("."+f),u=this._getItemData(t.find("> ."+r)),i=n.value,o=this._getItemKey(u),e=this._getNodeByKey(o);(this._commonSelectedSetter(u,e,i),this._toggleSelectedClass(t,i),this.setAria("selected",i,t),n.jQueryEvent&&!this.option("selectNodesRecursive")&&this._fireSelectionChanged(),n.jQueryEvent&&this.option("selectNodesRecursive"))&&this._updateParentsAndChildren(e,i,!1,t)},_updateNodesFields:function(t){var i,r,u;this._isVirtualMode()&&(i=this._dataSource.filter()&&this._dataSource.filter()[1],i&&i!==this.option("rootValue")&&(r=this._getNodeByKey(i),u=this.option("selectNodesRecursive"),t&&t.length&&this._itemsSetter(r,t),this._updateNodes(),t&&this._selectedGetter(r)?u&&n.each(t,n.proxy(function(n,t){this._selectedSetter(t,!0)},this)):(u&&this._calculateParentSelectedState(this._makePlainList(this._nodes,null)),this._createParentFieldForEachItem(this._nodes))))},_updateParentsAndChildren:function(n,t,i,r){n.parent&&n.parent!==null&&this._updateParentsState(n,r),n.items&&n.items.length&&this._updateChildrenState(this._itemsGetter(n),t,r),this._suppressDeprecatedWarnings();var u=this._updateSelectionItemsOption();this.option("selectedItems",u),this._resumeDeprecatedWarnings(),i||this._fireSelectionChanged()},_getItemFromArray:function(t,i){var r=null,u=this,f=u._keyGetter(t);return n.each(i,function(n,t){if(f===u._keyGetter(t))return r=t,!1}),r},_calculateSelectedItemsOption:function(n,t){var i=this._getItemKey(t),r=this._getNodeByKey(i);this._commonSelectedSetter(t,r,n)},_reduceSelectedItemsOption:function(t,i){var r=this,u=r._keyGetter(i);n.each(t,function(n,t){if(u===r._keyGetter(t))return!1})},_updateParentsState:function(t,i){var r=this._getNodeByKey(this._keyGetter(t.parent)),e,o=this;n.each(this._itemsGetter(r),function(n,i){o._keyGetter(t)===o._keyGetter(i)&&o._selectedSetter(i,o._selectedGetter(t))});var h=this._itemsGetter(r).length,s=this._getSelectedChildrenFromNode(r),c=this._getIntermediateChildrenFromNode(r),u;s===h?u=!0:s||c||(u=!1),i&&this.option("showCheckBoxes")&&(e=n(i.parents("."+f)[0]),e.find("> .dx-checkbox").dxCheckBox("instance").option("value",u),this._toggleSelectedClass(e,u)),this._updateParentField(t,u),this._selectedSetter(r,u),r.parent&&this._updateParentsState(r,e),this._calculateSelectedItemsOption(u,this._getSourceItemByKey(this._keyGetter(t.parent)))},_getSelectedChildrenFromNode:function(t){var i=this._itemsGetter(t),r=this;return i&&i.length?n.grep(i,function(n){return r._selectedGetter(n)===!0}).length:0},_getIntermediateChildrenFromNode:function(t){var r=this._itemsGetter(t),u=this;return r&&r.length?n.grep(r,function(n){return n.hasOwnProperty(u.option("selectedExpr"))&&u._selectedGetter(n)===i}).length:0},_updateChildrenState:function(t,i,r){var u=this,o;n.each(t,function(n,t){var r=u._getSourceItemByKey(u._keyGetter(t));u._updateParentField(t,i),u._calculateSelectedItemsOption(i,r),u._itemHasChildren(t)&&u._updateChildrenState(u._itemsGetter(t),i)}),r&&(o=r.find("> ."+e),o.find("."+f).each(function(t,r){var f=n(r);n(f.find(".dx-checkbox")).dxCheckBox("instance").option("value",i),u._toggleSelectedClass(f,i)}))},_updateParentField:function(n,t){n.parent&&this._selectedSetter(n.parent,t)},_itemEventHandlerImpl:function(t,i,u){var e=n(t).closest("."+f).find("> ."+r);return i(n.extend(this._extendActionArgs(e),u))},_itemContextMenuHandler:function(n){this._createEventHandler("onItemContextMenu",n)},_itemHoldHandler:function(n){this._createEventHandler("onItemHold",n)},_createEventHandler:function(n,t){var i=this._getItemData(t.currentTarget),r=this._getNodeByKey(this._getItemKey(i));this._itemJQueryEventHandler(t,n,{node:r})},_itemClass:function(){return r},_itemDataKey:function(){return d},_selectionEnabled:function(){return!0},_attachClickEvent:function(){var t=this,i=t._itemSelector(),r=c.addNamespace("dxclick",t.NAME),u=c.addNamespace("dxpointerdown",this.NAME);t._itemContainer().off(r,i).on(r,i,function(i){t._itemClickHandler(i,n(this))}).off(u,i).on(u,i,n.proxy(this._itemPointerDownHandler,this))},_itemClickHandler:function(n,t){var i=this._getItemData(t),r=this._getNodeByKey(this._getItemKey(i));this._itemJQueryEventHandler(n,"onItemClick",{node:r})},_updateItemSelection:function(t,i,r,u){var e=i.nodeType?this._getItemData(i):i,h=this._getItemKey(e),f=this._getNodeByKey(h),c,o,l,s;this._disabledGetter(e)||(c=this._selectedGetter(f),c!==t)&&(u||(o=this._getNodeElementById(h),o.length&&(u=o)),u&&(u.find("> .dx-checkbox").dxCheckBox("instance").option("value",t),this._toggleSelectedClass(n(u),t)),this._commonSelectedSetter(e,f,t),this._calculateSelectedItemsOption(t,f),this.option("selectNodesRecursive")?this._updateParentsAndChildren(f,t,r,u):(this._suppressDeprecatedWarnings(),l=this._updateSelectionItemsOption(),this.option("selectedItems",l),this._resumeDeprecatedWarnings()),s=this.option("onItemSelected"),s&&s.call(this,{itemData:e,node:f}))},_updateSelectionToFirstItem:function(t,i){for(var u=i,f;u>=0;)f=n(t[u]),this._updateItemSelection(!0,f.find("."+r).get(0),!0,f),u--},_updateSelectionToLastItem:function(t,i){for(var u=i,e=t.length,f;u<e;)f=n(t[u]),this._updateItemSelection(!0,f.find("."+r).get(0),!0,f),u++},_enlargeExpandedItemsOption:function(n,t){return this._getItemFromArray(n,t)||(t.push(n),this._expandedSetter(n,!0)),n.parent&&this._enlargeExpandedItemsOption(n.parent,t),t},_reduceExpandedItemsOption:function(t,i){var r=this,u=r._keyGetter(t),f=r._getSourceItemByKey(u);return r._commonExpandedSetter(f,t,!1),n.each(i,function(f,e){r._keyGetter(e)===u&&(i.splice(f,1),r._itemHasChildren(t)&&n.each(r._itemsGetter(t),function(n,t){var u=r._getSourceItemByKey(r._keyGetter(t));r._commonExpandedSetter(u,t,!1),r._reduceExpandedItemsOption(t,i)}))}),i},_focusInHandler:function(t){var i=t.currentTarget,u=this._focusTarget(),r;n.inArray(i,u)!==-1&&n(i).addClass(w),this.option("focusedElement")?this._setFocusedItem(this.option("focusedElement")):(r=this._getActiveItem(),this.option("focusedElement",r.closest("."+f)))},_setFocusedItem:function(n){n&&n.length&&(n.children().hasClass(v)||this.callBase(n))},_itemPointerDownHandler:function(t){if(this.option("focusStateEnabled")){var i=n(t.target).closest("."+f);i.hasClass(f)&&(i.hasClass(v)?this.option("focusedElement",null):this.option("focusedElement",i))}},_moveFocus:function(i,u){var l="up",a="down",y="first",p="last",w=this.option("rtlEnabled")?"right":"left",b=this.option("rtlEnabled")?"left":"right",f,o,s,h,c;this.element().find("."+e).each(function(){t.fx.stop(this,!0)}),f=this._nodeElements().not(function(){return n(this).find(">."+r).hasClass(v)});switch(i){case l:o=this._prevItem(f),this.option("focusedElement",o),u.shiftKey&&this.option("showCheckBoxes")&&this._updateItemSelection(!0,o.find("."+r).get(0),!0,o);break;case a:s=this._nextItem(f),this.option("focusedElement",s),u.shiftKey&&this.option("showCheckBoxes")&&this._updateItemSelection(!0,s.find("."+r).get(0),!0,s);break;case y:h=f.first(),u.shiftKey&&this.option("showCheckBoxes")&&this._updateSelectionToFirstItem(f,f.index(this._prevItem(f))),this.option("focusedElement",h);break;case p:c=f.last(),u.shiftKey&&this.option("showCheckBoxes")&&this._updateSelectionToLastItem(f,f.index(this._nextItem(f))),this.option("focusedElement",c);break;case b:this._expandFocusedContainer();break;case w:this._collapseFocusedContainer();break;default:this.callBase.apply(this,arguments);return}},_nodeElements:function(){return this.element().find("."+f).not(":hidden")},_expandFocusedContainer:function(){var n=this.option("focusedElement"),t,i;if(n&&!n.hasClass(a)){if(t=n.find("."+e).eq(0),t.hasClass(s)){this.option("focusedElement",this._nextItem(this._nodeElements()));return}i=this._getItemData(n.find(">."+r)),this._toggleExpandedState(i,!0)}},_collapseFocusedContainer:function(){var n=this.option("focusedElement"),i,u,o,t;n&&(i=n.find("."+e).eq(0),!n.hasClass(a)&&i.hasClass(s)?(u=this._getItemData(n.find(">."+r)),this._toggleExpandedState(u,!1)):(o=n.parent("."+e),t=o.parent("."+f).eq(0),t.length&&this.option("focusedElement",t)))},updateDimensions:function(){var t=this,i=n.Deferred();return t._scrollableContainer?t._scrollableContainer.update().done(function(){i.resolveWith(t)}):i.resolveWith(t),i.promise()},selectItem:function(n){this._updateItemSelection(!0,n)},unselectItem:function(n){this._updateItemSelection(!1,n)},expandItem:function(t){var i=this._getItemData(n(t));this._toggleExpandedState(i,!0)},collapseItem:function(t){var i=this._getItemData(n(t));this._toggleExpandedState(i,!1)},getNodes:function(){return this._nodes},selectAll:function(){this._toggleSelectAll({value:!0})},unselectAll:function(){this._toggleSelectAll({value:!1})}}))}(jQuery,DevExpress),function(n,t){function e(t,i,r){var f=n(t),u=f.offset();if(i>=u.left&&i<=u.left+f.outerWidth(!0)&&r>=u.top&&r<=u.top+f.outerHeight(!0))return!0}function o(t){var i=[];return n.each(t,function(){var t=this;n(t).is(":visible")&&i.push({pos:n(t).offset().top+n(t).outerHeight(!0)/2,item:n(t)})}),i}var u=t.ui,i=u.events.addNamespace,r="dxSortable",f="dx-sortable";t.registerComponent("dxSortable",u,t.DOMComponent.inherit({_setDefaultOptions:function(){this.callBase(),this.option({onChanged:null,onDragging:null,itemRender:null,groupSelector:null,itemSelector:".dx-sort-item",itemContainerSelector:".dx-sortable",sourceClass:"dx-drag-source",dragClass:"dx-drag",targetClass:"dx-drag-target"})},_renderItem:function(n,t){var r=this.option("itemRender"),i;return r?i=r(n,t):(i=n.clone(),i.css({width:n.width(),height:n.height()})),i},_attachEventHandlers:function(){var f=this,b=f.option("itemSelector"),nt=f.option("itemContainerSelector"),y=f.option("groupSelector"),l=f.option("sourceClass"),tt=f.option("dragClass"),a=f.option("targetClass"),k=f.option("onDragging"),t,w,s,u,v,p,d,h=f.element(),g,c;h.off(i("dxdragstart dxdrag dxdragend dxdragenter dxdragleave dxdrop",r)).on(i("dxdragstart",r),b,function(i){t=n(i.currentTarget),v=t.offset(),v.top-=h.offset().top,v.left-=h.offset().left,w=t.index(),g=y?h.find(y):h,d=t.closest(y).attr("group"),p=f._renderItem(t,"drag").appendTo(h),s=f._renderItem(t,"target"),p.addClass(tt),t.addClass(l),s.addClass(a)}).on(i("dxdrag",r),function(i){var h,r,tt,y,f=[];if(t)if(p.css({top:v.top+i.offset.y,left:v.left+i.offset.x}),u&&u.removeClass(a),u=undefined,n.each(g,function(){if(e(this,i.pageX,i.pageY))return u=n(this),!1}),u&&(h={sourceGroup:d,sourceIndex:w,sourceElement:t,targetGroup:u.attr("group"),targetIndex:s.index()},k&&k(h)),h&&h.cancel&&(u=undefined),u){for(u.addClass(a),tt=u.find(nt),y=tt.find(b),f=o(y),c=0;c<f.length;c++)if(i.pageY<f[c].pos){r=f[c]&&f[c].item;break}r?r.hasClass(l)||r.prev().hasClass(l)&&r.prev().is(":visible")?s.detach():s.insertBefore(r):y.last().is(":visible")&&y.last().hasClass(l)||s.appendTo(tt)}else s.detach()}).on(i("dxdragend",r),function(){var r=f.option("onChanged"),n,i;t&&(u&&(u.removeClass(a),i=t.closest(y).attr("group"),n={sourceGroup:i,sourceIndex:w,sourceElement:t,targetGroup:u.attr("group"),targetIndex:s.index(),removeSourceElement:!0},(i!==n.targetGroup||s.parent().length)&&(r&&r(n),n.removeSourceElement&&t.remove())),t.removeClass(l),p.remove(),t=null,s.removeClass(a),s=null)})},_init:function(){this.callBase(),this._attachEventHandlers()},_render:function(){this.callBase(),this.element().addClass(f)},_optionChanged:function(n){var t=this;switch(n.name){case"onDragging":case"onChanged":case"itemRender":case"groupSelector":case"itemSelector":case"itemContainerSelector":case"sourceClass":case"targetClass":case"dragClass":t._attachEventHandlers();break;default:t.callBase(n)}}}))}(jQuery,DevExpress),function(n,t){var i=t.ui,r=t.utils,c=".dx-row",l="Specifying grid templates with the name of a jQuery selector is now deprecated. Instead, use the jQuery object that references this selector.",e=t.Class.inherit({_endUpdateCore:function(){},ctor:function(t){var i=this;i._updateLockCount=0,i.component=t,i._actions={},i._actionConfigs={},n.each(this.callbackNames()||[],function(t,r){var u=i.callbackFlags(r);i[this]=n.Callbacks(u)})},init:function(){},callbackNames:function(){},callbackFlags:function(){},publicMethods:function(){},beginUpdate:function(){this._updateLockCount++},endUpdate:function(){this._updateLockCount--,this._updateLockCount||this._endUpdateCore()},option:function(){return this.component.option.apply(this.component,arguments)},on:function(){return this.component.on.apply(this.component,arguments)},off:function(){return this.component.off.apply(this.component,arguments)},optionChanged:function(n){n.name in this._actions&&(this.createAction(n.name,this._actionConfigs[n.name]),n.handled=!0)},getAction:function(n){return this._actions[n]},setAria:function(){return this.component.setAria.apply(this.component,arguments)},_createComponent:function(){return this.component._createComponent.apply(this.component,arguments)},getController:function(n){return this.component._controllers[n]},createAction:function(t,i){var u;if(r.isFunction(t))return u=this.component._createAction(n.proxy(t,this),i),function(n){u({jQueryEvent:n})};this._actions[t]=this.component._createActionByOption(t,i),this._actionConfigs[t]=i},executeAction:function(n,t){var i=this._actions[n];return i&&i(t)},dispose:function(){var t=this;n.each(t.callbackNames()||[],function(){t[this].empty()})}}),f=e,a=f.inherit({getView:function(n){return this.component._views[n]},getViews:function(){return this.component._views}}),o=e.inherit({_isReady:function(){return this.component.isReady()},_endUpdateCore:function(){this.callBase(),!this._isReady()&&this._requireReady&&(this._requireRender=!1,this.component._requireResize=!1,this._requireReady=!1),this._requireRender&&(this._requireRender=!1,this.render(this._$parent))},_invalidate:function(n,t){this._requireRender=!0,this.component._requireResize=this.component._requireResize||n,this._requireReady=this._requireReady||t},_renderCore:function(){},_resizeCore:function(){},_afterRender:function(){},_parentElement:function(){return this._$parent},ctor:function(t){this.callBase(t),this.renderCompleted=n.Callbacks(),this.resizeCompleted=n.Callbacks()},element:function(){return this._$element},isVisible:function(){return!0},getTemplate:function(n){return this.component._getTemplate(n)},render:function(t,i){var r=this._$element,u=this.isVisible();r||(r=this._$element=n("<div />").appendTo(t),this._$parent=t),r.toggle(u),u&&(this._renderCore(i),this._afterRender(t),this.renderCompleted.fire())},resize:function(){this.isResizing=!0,this._resizeCore(),this.resizeCompleted.fire(),this.isResizing=!1},focus:function(){this.element().focus()}}),s=function(i,r){var u={},e={},h,s;n.each(r,function(){var r=this.controllers,i=this.name,s=this.views;r&&n.each(r,function(n,r){if(u[n])throw t.Error("E1001",i,n);else if(!(r&&r.subclassOf&&r.subclassOf(f))){r.subclassOf(f);throw t.Error("E1002",i,n);}u[n]=r}),s&&n.each(s,function(n,r){if(e[n])throw t.Error("E1003",i,n);else if(!(r&&r.subclassOf&&r.subclassOf(o)))throw t.Error("E1004",i,n);e[n]=r})}),n.each(r,function(){var t=this.extenders;t&&(t.controllers&&n.each(t.controllers,function(n,t){u[n]&&(u[n]=u[n].inherit(t))}),t.views&&n.each(t.views,function(n,t){e[n]&&(e[n]=e[n].inherit(t))}))}),h=function(i,r,u){var f=u.publicMethods();f&&n.each(f,function(n,f){if(u[f])if(i[f])throw t.Error("E1005",f);else i[f]=function(){return u[f].apply(u,arguments)};else throw t.Error("E1006",r,f);})},s=function(t){var r={};return n.each(t,function(n,t){var u=new t(i);u.name=n,h(i,n,u),r[n]=u}),r},i._controllers=s(u),i._views=s(e)},u=function(t,i,r){r=r||[],t._controllers&&n.each(t._controllers,function(){this[i]&&this[i].apply(this,r)}),t._views&&n.each(t._views,function(){this[i]&&this[i].apply(this,r)})},h;t.registerComponent("dxDataGrid",i,i.Widget.inherit({_activeStateUnit:c,_setDeprecatedOptions:function(){this.callBase(),n.extend(this._deprecatedOptions,{rowClick:{since:"14.2",alias:"onRowClick"},cellClick:{since:"14.2",alias:"onCellClick"},cellHoverChanged:{since:"14.2",alias:"onCellHoverChanged"},cellPrepared:{since:"14.2",message:"The cellPrepared option is deprecated. Use the onCellPrepared option instead. For further information, see http://js.devexpress.com/Documentation/ApiReference/UI_Widgets/dxDataGrid/Configuration/?version=14_2#onCellPrepared"},rowPrepared:{since:"14.2",message:"The rowPrepared option is deprecated. Use the onRowPrepared option instead. For further information, see http://js.devexpress.com/Documentation/ApiReference/UI_Widgets/dxDataGrid/Configuration/?version=14_2#onRowPrepared"},selectionChanged:{since:"14.2",alias:"onSelectionChanged"},dataErrorOccurred:{since:"14.2",alias:"onDataErrorOccurred"},initNewRow:{since:"14.2",alias:"onInitNewRow"},rowInserting:{since:"14.2",alias:"onRowInserting"},rowInserted:{since:"14.2",alias:"onRowInserted"},editingStart:{since:"14.2",alias:"onEditingStart"},rowUpdating:{since:"14.2",alias:"onRowUpdating"},rowUpdated:{since:"14.2",alias:"onRowUpdated"},rowRemoving:{since:"14.2",alias:"onRowRemoving"},rowRemoved:{since:"14.2",alias:"onRowRemoved"},editorPreparing:{since:"14.2",message:"The editorPreparing option is deprecated. Use the onEditorPreparing option instead. For further information, see http://js.devexpress.com/Documentation/ApiReference/UI_Widgets/dxDataGrid/Configuration/?version=14_2#onEditorPreparing"},editorPrepared:{since:"14.2",message:"The editorPrepared option is deprecated. Use the onEditorPrepared option instead. For further information, see http://js.devexpress.com/Documentation/ApiReference/UI_Widgets/dxDataGrid/Configuration/?version=14_2#onEditorPrepared"},contentReadyAction:{since:"14.2",alias:"onContentReady"}})},_setDefaultOptions:function(){var t=this;t.callBase(),n.each(i.dxDataGrid.modules,function(){n.isFunction(this.defaultOptions)&&t.option(this.defaultOptions())})},_defaultOptionsRules:function(){return this.callBase().concat([{device:{platform:"ios"},options:{showRowLines:!0}},{device:function(){return DevExpress.browser.webkit},options:{loadPanel:{animation:{show:{easing:"cubic-bezier(1, 0, 1, 0)",duration:500,from:{opacity:0},to:{opacity:1}}}}}}])},_init:function(){var n=this;n.callBase(),s(n,i.dxDataGrid.modules),u(n,"init")},_clean:n.noop,_optionChanged:function(n){var t=this;u(t,"optionChanged",[n]),n.handled||t.callBase(n)},_dimensionChanged:function(){this.updateDimensions()},_visibilityChanged:function(n){n&&this.updateDimensions()},_renderContentImpl:function(){var n=this;n.getView("gridView").render(n.element())},_renderContent:function(){this._renderContentImpl()},_getTemplate:function(i){var r=i;return t.utils.isString(r)&&r[0]==="#"&&(r=n(i),t.utils.logger.warn(l)),this.callBase(r)},_dispose:function(){var n=this;n.callBase(),u(n,"dispose")},isReady:function(){return this.getController("data").isReady()},beginUpdate:function(){var n=this;n.callBase(),u(n,"beginUpdate")},endUpdate:function(){var n=this;u(n,"endUpdate"),n.callBase()},getController:function(n){return this._controllers[n]},getView:function(n){return this._views[n]},focus:function(n){this.callBase(),r.isDefined(n)&&this.getController("keyboardNavigation").focus(n)}})),h=3,n.extend(i.dxDataGrid,{__internals:{},modules:[],View:o,ViewController:a,Controller:f,registerModule:function(n,t){for(var r=this.modules,i=0;i<r.length;i++)if(r[i].name===n)return;t.name=n,r.push(t)},unregisterModule:function(t){this.modules=n.grep(this.modules,function(n){return n.name!==t})},processModules:s,formatValue:function(n,i){var r=t.formatHelper.format(n,i.format,i.precision)||n&&n.toString()||"",u={value:n,valueText:i.getDisplayFormat?i.getDisplayFormat(r):r};return i.customizeText?i.customizeText.call(i,u):u.valueText},getDisplayValue:function(n,t){return n.lookup?n.lookup.calculateCellValue(t):t},getGroupRowSummaryText:function(n,t){for(var u="(",f,r=0;r<n.length;r++)f=n[r],u+=(r>0?", ":"")+i.dxDataGrid.getSummaryText(f,t);return u+=")"},getSummaryText:function(n,t){var i=n.displayFormat||n.columnCaption&&t[n.summaryType+"OtherColumn"]||t[n.summaryType];return this.formatValue(n.value,{format:n.valueFormat,precision:n.precision,getDisplayFormat:function(t){return i?r.stringFormat(i,t,n.columnCaption):t},customizeText:n.customizeText})},equalKeys:function(n,t,u){var f,e;if(u=u||0,u<h){if(r.isObject(n)&&r.isObject(t)){for(f in n)if(n.hasOwnProperty(f)&&!i.dxDataGrid.equalKeys(n[f],t[f],u+1))return!1;for(f in t)if(!(f in n))return!1;return!0}if(r.isArray(n)&&r.isArray(t)){if(n.length!==t.length)return!1;for(e=0;e<n.length;e++)if(!i.dxDataGrid.equalKeys(n[e],t[e],u+1))return!1;return!0}return r.isDate(n)&&r.isDate(t)?n.getTime()===t.getTime():n===t}return!0},getIndexByKey:function(t,r){var u=-1;return n.each(r,function(n,r){if(i.dxDataGrid.equalKeys(t,r.key))return u=n,!1}),u},normalizeSortingInfo:function(n){n=n||[];for(var r=t.data.utils.normalizeSortingInfo(n),i=0;i<n.length;i++)n&&n[i]&&n[i].isExpanded!==undefined&&(r[i].isExpanded=n[i].isExpanded);return r},getFormatByDataType:function(n){switch(n){case"date":return"shortDate"}}})}(jQuery,DevExpress),function(n,t){var r=t.ui,u=t.utils,i=r.dxDataGrid;i.StateStoringController=i.ViewController.inherit(function(){var i=function(n){var i=n.type==="sessionStorage"?t.utils.getSessionStorage():localStorage;if(!i)throw new Error("E1007");return i},r=function(n){return"dx_datagrid_"+(u.isDefined(n.storageKey)?n.storageKey:"storage")},f=function(n,t){var i;return typeof t=="string"&&(i=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(t),i)?new Date(Date.UTC(+i[1],+i[2]-1,+i[3],+i[4],+i[5],+i[6])):t},e=function(t){var r=t.getController("columns"),f=t.getController("selection"),u=t.getController("export"),i=t.getController("data"),e=t.getView("pagerView");r&&r.columnsChanged.add(function(){n.extend(t._state,{columns:r.getUserState()}),t.isEnabled()&&t.save()}),f&&f.selectionChanged.add(function(i){n.extend(t._state,{selectedRowKeys:i}),t.isEnabled()&&t.save()}),i&&(t._initialPageSize=t.option("paging.pageSize"),i.changed.add(function(){n.extend(t._state,{searchText:t.option("searchPanel.text"),pageIndex:i.pageIndex(),pageSize:i.pageSize(),allowedPageSizes:e?e.getPageSizes():undefined}),t.isEnabled()&&t.save()})),u&&u.selectionOnlyChanged.add(function(){n.extend(t._state,{exportSelectionOnly:u.selectionOnly()}),t.isEnabled()&&t.save()})},o=function(n,t){var i=t.allowedPageSizes,e=t.searchText,o=t.selectedRowKeys,r=n.getController("export"),u=n.getController("columns"),f=n.option("scrolling.mode");n.component.beginUpdate(),u&&u.setUserState(t.columns),r&&r.selectionOnly(t.exportSelectionOnly),n.option("selectedRowKeys",o||[]),i&&n.option("pager.allowedPageSizes")==="auto"&&(n.option("pager").allowedPageSizes=i),n.option("searchPanel.text",e||""),n.option("paging.pageSize",f!=="virtual"&&f!=="infinite"&&t.pageSize?t.pageSize:n._initialPageSize),n.option("paging.pageIndex",t.pageIndex||0),n.component.endUpdate()};return{_loadState:function(){var n=this.option("stateStoring");if(n.type==="custom")return n.customLoad&&n.customLoad();try{return JSON.parse(i(n).getItem(r(n)),f)}catch(u){t.utils.logger.error(u.message)}},_saveState:function(n){var t=this.option("stateStoring");if(t.type==="custom"){t.customSave&&t.customSave(n);return}try{i(t).setItem(r(t),JSON.stringify(n))}catch(u){}},publicMethods:function(){return["state"]},isEnabled:function(){return this.option("stateStoring.enabled")},init:function(){var t=this;t._state={},t._isLoaded=!1,t._isLoading=!1,t._windowUnloadHandler=function(){t._savingTimeoutID!==undefined&&t._saveState(t.state())},n(window).on("unload",t._windowUnloadHandler),e(t)},isLoaded:function(){return this._isLoaded},isLoading:function(){return this._isLoading},load:function(){var i=this,t;return i._isLoading=!0,t=i._loadState(),t&&n.isFunction(t.done)||(t=n.Deferred().resolve(t)),t.done(function(n){i._isLoaded=!0,i._isLoading=!1,i.state(n)}),t},state:function(t){var i=this;if(arguments.length)i._state=n.extend({},t),o(i,n.extend({},t));else return n.extend(!0,{},i._state)},save:function(){var n=this;clearTimeout(n._savingTimeoutID),n._savingTimeoutID=setTimeout(function(){n._saveState(n.state()),n._savingTimeoutID=undefined},n.option("stateStoring.savingTimeout"))},optionChanged:function(n){var t=this;switch(n.name){case"stateStoring":t.isEnabled()&&t.load(),n.handled=!0;break;default:t.callBase(n)}},dispose:function(){clearTimeout(this._savingTimeoutID),n(window).off("unload",this._windowUnloadHandler)}}}()),i.registerModule("stateStoring",{defaultOptions:function(){return{stateStoring:{enabled:!1,storageKey:null,type:"localStorage",customLoad:null,customSave:null,savingTimeout:2e3}}},controllers:{stateStoring:r.dxDataGrid.StateStoringController},extenders:{controllers:{columns:{getVisibleColumns:function(){var t=this.callBase(),n=this.getController("stateStoring");return n.isEnabled()&&!n.isLoaded()?[]:t}},data:{_refreshDataSource:function(){var n=this,i=n.callBase,t=n.getController("stateStoring");t.isEnabled()&&!t.isLoaded()?(clearTimeout(n._restoreStateTimeoutID),n._restoreStateTimeoutID=setTimeout(function(){t.load().always(function(){n._restoreStateTimeoutID=null,i.call(n)})})):n._restoreStateTimeoutID||i.call(n)},isLoading:function(){var n=this,t=n.getController("stateStoring");return this.callBase()||t.isLoading()},dispose:function(){clearTimeout(this._restoreStateTimeoutID),this.callBase()}}}}})}(jQuery,DevExpress),function(n,t,i){var c=t.ui,e=c.dxDataGrid,o=e.normalizeSortingInfo,r=t.utils,s=r.normalizeIndexes,f=t.data.utils,u=r.isDefined,l=["filterValues","filterType","fixed","fixedPosition"],a=["visibleIndex","dataField","name","dataType","width","visibleWidth","visible","sortOrder","sortIndex","groupIndex","filterValue","selectedFilterOperation"].concat(l),v="dx-command-expand",h;e.checkChanges=function(n,t){for(var r=0,i=0;i<t.length;i++)n[t[i]]&&r++;return n.length&&n.length===r},h=e.Controller.inherit(function(){var at={visible:!0,showInColumnChooser:!0},vt={number:["=","<>","<",">","<=",">="],string:["contains","notcontains","startswith","endswith","=","<>"],date:["=","<>","<",">","<=",">="]},c="group",y="columnChooser",yt=function(n){for(var u=[],t,f=!1,i=!1,r=0;r<n.length;r++)t=n.charAt(r),i=t===t.toUpperCase()||t in["0","1","2","3","4","5","6","7","8","9"],t==="_"||t==="."?(t=" ",i=!0):r===0?(t=t.toUpperCase(),i=!0):!f&&i&&u.length>0&&u.push(" "),u.push(t),f=i;return u.join("")},nt=function(t,i,u){var f,e;if(i)return r.isString(i)&&(i={dataField:i}),i.command?n.extend(!0,{},i):(f=t.getCommonSettings(),u&&u.name&&u.dataField&&(i=n.extend({},i,{dataField:u.dataField})),e=t._createCalculatedColumnOptions(i),n.extend(!0,{},at,f,e,i))},b=function(t,i){var r=[];return i&&n.each(i,function(n,i){var f=t._columnsUserState&&ct(i,t._columnsUserState[n])&&t._columnsUserState[n],u=nt(t,i,f);u&&r.push(u)}),r},ft=function(t){var r=n.type(t);return r!=="string"&&r!=="boolean"&&r!=="number"&&r!=="date"&&(r=i),r},et=function(n,t){switch(n){case"date":if(r.isNumber(t))return"number";if(r.isString(t))return"yyyy/MM/dd";break;case"number":if(r.isString(t))return"string"}},tt=function(n,t){n.deserializeValue||(t==="date"&&(n.deserializeValue=function(n){return r.deserializeDate(n,this.serializationFormat)},n.serializeValue=function(n){return r.serializeDate(n,this.serializationFormat)}),t==="number"&&(n.deserializeValue=function(n){return r.isDefined(n)?Number(n):n},n.serializeValue=function(n){return r.isDefined(n)&&this.serializationFormat==="string"?n.toString():n}))},pt=function(n,t){switch(n){case"number":return"right";case"boolean":return"center";case"date":return"left";default:return r.getDefaultAlignment(t)}},wt=function(n){if(n==="boolean")return function(n){return n.value===!0?this.trueText||"true":n.value===!1?this.falseText||"false":n.valueText||""}},bt=function(n,t){for(var u=ot(t),i,f={},e=[],o,r=0;r<u.length;r++)if(u[r])for(i in u[r])f[i]=!0;for(i in f)i.indexOf("__")!==0&&(o=nt(n,i),e.push(o));return e},k=function(t,i){var r;if(n.isArray(t)&&n.isArray(i)){if(t.length!==i.length)return!1;for(r=0;r<t.length;r++)if(t[r].selector!==i[r].selector||t[r].desc!==i[r].desc||Boolean(t[r].isExpanded)!==Boolean(i[r].isExpanded))return!1;return!0}return(!t||!t.length)==(!i||!i.length)},ot=function(n){var t,i=[],r=function(n,t){var i,u;if(!n||!t)return n;for(i=0;i<n.length;i++)if(u=r(n[i].items||n[i].collapsedItems,t-1),u&&u.length)return u};return n&&n.items().length>0&&(t=o(n.group()).length,i=r(n.items(),t)||[]),i},kt=function(t){n.each(t._columns,function(n,t){t.index=n}),n.each(t._commandColumns,function(n,t){t.index=-(n+1)})},it=function(n,t){s(n._columns,"groupIndex",t,function(n){var t=n.grouped;return delete n.grouped,t})},st=function(t,i){n.each(t._columns,function(n,t){u(t.sortIndex)&&!g(t.sortOrder)&&delete t.sortIndex}),s(t._columns,"sortIndex",i,function(n){return!u(n.groupIndex)&&g(n.sortOrder)})},ht=function(n,t){s(n._columns,"visibleIndex",t)},rt=function(n,t,i){var f=i===c?n.getGroupColumns():i===y?n.getChooserColumns():n.getVisibleColumns(),r=f[t];return r&&u(r.index)?r.index:-1},dt=function(n,t,i){var u=n.getGroupColumns(),r;if(i>=0)for(r=0;r<u.length;r++)u[r].groupIndex>=i&&u[r].groupIndex++;else for(i=0,r=0;r<u.length;r++)i=Math.max(i,u[r].groupIndex+1);t.groupIndex=i},ct=function(n,t){return n&&t&&t.name===n.name&&(t.dataField===n.dataField||n.name)},lt=function(t){function s(t,u){u==="dataType"?f[u]=f[u]||r[i][u]:n.inArray(u,l)>=0?u in r[i]&&(f[u]=r[i][u]):f[u]=r[i][u]}var r=t._columnsUserState,e=t._columns,o=[],f,i;if(r){if(e.length!==r.length)return;for(i=0;i<r.length;i++)if(f=u(r[i].initialIndex)?e[r[i].initialIndex]:e[i],f&&ct(f,r[i]))f=n.extend({},f),n.each(a,s),o.push(f);else return;p(t,o)}},d=function(n,t){kt(n),it(n,t),st(n,t),ht(n,t)},p=function(n,t){n._columns=t,n._visibleColumns=i,n.updateColumnDataTypes()},h=function(n,t,r,u){var f=n._columnChanges||{optionNames:{length:0},changeTypes:{length:0},columnIndex:u},e,o;r=r||"all",e=f.changeTypes,t&&!e[t]&&(e[t]=!0,e.length++),o=f.optionNames,r&&!o[r]&&(o[r]=!0,o.length++),(u===i||u!==f.columnIndex)&&delete f.columnIndex,n._columnChanges=f,n._visibleColumns=i},w=function(t){var u=t.option("onColumnsChanging"),r=t._columnChanges;t.isInitialized()&&!t._updateLockCount&&r&&(u&&(t._updateLockCount++,u(n.extend({component:t.component},r)),t._updateLockCount--),t._columnChanges=i,r.optionNames&&r.optionNames.dataField&&t.reinit(),t.columnsChanged.fire(r))},ut=function(n,t,i,r,u){var o=f.compileGetter(i),e;if(arguments.length===3)return o(t,{functionsAsIs:!0});o(t,{functionsAsIs:!0})!==r&&(e=i==="groupIndex"?"grouping":i==="sortIndex"||i==="sortOrder"?"sorting":"columns",f.compileSetter(i)(t,r,{functionsAsIs:!0}),u||h(n,e,i,t.index))},g=function(n){return n==="asc"||n==="desc"},gt=function(n){n.addCommandColumn({command:"expand",width:"auto",cssClass:v,allowEditing:!1,allowGrouping:!1,allowSorting:!1,allowResizing:!1,allowReordering:!1,allowHiding:!1})};return{_endUpdateCore:function(){w(this)},init:function(){var n=this,t=n.option("columns");n._commandColumns=n._commandColumns||[],n._columns=n._columns||[],gt(n),n._isColumnsFromOptions=!!t,n._isColumnsFromOptions?(p(n,t?b(n,t):[]),lt(n)):p(n,n._columnsUserState?b(n,n._columnsUserState):n._columns),n._dataSourceApplied?n.applyDataSource(n._dataSource,!0):d(n)},callbackNames:function(){return["columnsChanged"]},optionChanged:function(n){switch(n.name){case"columns":n.handled=!0,this._columnsUserState=null,this.init();break;case"commonColumnSettings":case"columnAutoWidth":case"allowColumnResizing":case"allowColumnReordering":case"columnFixing":case"grouping":case"groupPanel":case"regenerateColumnsByVisibleItems":case"customizeColumns":case"editing":n.handled=!0,this.reinit();break;case"rtlEnabled":this.reinit();break;default:this.callBase(n)}},publicMethods:function(){return["addColumn","columnOption","columnCount","clearSorting","clearGrouping"]},applyDataSource:function(n,t){var i=this,r=n&&n.isLoaded();return i._dataSource=n,(!i._dataSourceApplied||i._dataSourceColumnsCount===0||t||i.option("regenerateColumnsByVisibleItems"))&&r?(i._isColumnsFromOptions||(p(i,bt(i,n)),i._dataSourceColumnsCount=i._columns.length,lt(i)),i.updateColumns(n,t)):void 0},reset:function(){this._dataSourceApplied=!1,this._dataSourceColumnsCount=i,this.reinit()},reinit:function(){this._columnsUserState=this.getUserState(),this.init()},isInitialized:function(){return!!this._columns.length},isDataSourceApplied:function(){return this._dataSourceApplied},getCommonSettings:function(){var r=this.option("commonColumnSettings")||{},t=this.option("grouping")||{},i=this.option("groupPanel")||{};return n.extend({allowFixing:this.option("columnFixing.enabled"),allowResizing:this.option("allowColumnResizing"),allowReordering:this.option("allowColumnReordering"),autoExpandGroup:t.autoExpandAll,allowCollapsing:t.allowCollapsing,allowGrouping:i.allowColumnDragging&&i.visible},r)},isColumnOptionUsed:function(n){for(var t=0;t<this._columns.length;t++)if(this._columns[t][n])return!0},isAllDataTypesDefined:function(){var t=this._columns,n;if(!t.length)return!1;for(n=0;n<t.length;n++)if(!t[n].dataType)return!1;return!0},getColumns:function(){return n.extend(!0,[],this._columns)},getGroupColumns:function(){var t=[];return n.each(this._columns,function(){var n=this;u(n.groupIndex)&&(t[n.groupIndex]=n)}),t},getVisibleColumns:function(){return this._visibleColumns=this._visibleColumns||this._getVisibleColumnsCore()},getFixedColumns:function(){var e=this,r=[],o=e._isColumnFixing(),t=0,f,i;return o&&(i=e.getVisibleColumns(),n.each(i,function(n,i){i.command||i.fixed||(t++,u(f)||(f=n))}),t<i.length&&(r=i.slice(0),r.splice(f,t,{command:"transparent",colspan:t}))),r},_isColumnFixing:function(){var t=this.option("columnFixing.enabled");return t||n.each(this._columns,function(n,i){if(i.fixed)return t=!0,!1}),t},_getExpandColumnsCore:function(){return this.getGroupColumns()},getExpandColumns:function(){var t=this._getExpandColumnsCore(),i;return t.length&&(i=this.columnOption("command:expand")),t=n.map(t,function(t){return n.extend({},t,{visibleWidth:"auto"},i,{index:t.index})})},_getVisibleColumnsCore:function(){var t=this.getExpandColumns(),i=[{},{},{}],e={},o=0,f,s=this.option("rtlEnabled"),h=this._columns.length?this._commandColumns.concat(this._columns):[];return n.each(h,function(){var t=this,h=t.visibleIndex,r;t.visible&&(!u(t.groupIndex)||t.showWhenGrouped)&&(t=n.extend(!0,{},t),h<0?(h=-h,r=e):t.fixed||t.command?(f=t.fixedPosition==="right",s&&(f=!f),r=f||t.command?i[2]:i[0]):r=i[1],r[h]=r[h]||[],r[h].push(t),o++)}),r.orderEach(e,function(n,i){t.unshift.apply(t,i)}),n.each(i,function(n,i){r.orderEach(i,function(n,i){t.push.apply(t,i)})}),!o&&this._columns.length&&t.push({command:"empty"}),t},getHiddenColumns:function(){var t=[];return n.each(this._columns,function(n,i){i.visible||t.push(i)}),t},getChooserColumns:function(){return n.grep(this.getHiddenColumns(),function(n){return n.showInColumnChooser})},allowMoveColumn:function(n,t,i,r){var f=this,e=rt(f,n,i),u=f._columns[e];return u&&(u.allowReordering||u.allowGrouping||u.allowHiding)?i===r?i===y?!1:n!==t&&n+1!==t:i===c&&r!==y||r===c?u&&u.allowGrouping:i===y||r===y?u&&u.allowHiding:!0:!1},moveColumn:function(n,t,r,f){var o=this,a,s,l,p=r===c||f===c,e,v;a=rt(o,n,r),s=rt(o,t,f),a>=0&&(e=o._columns[a],l=s>=0?o._columns[s].groupIndex:-1,u(e.groupIndex)&&r===c&&(l>e.groupIndex&&l--,delete e.groupIndex,delete e.sortOrder,it(o)),f===c?(dt(o,e,l),it(o)):t>=0&&(s<0?e.visibleIndex=i:(v=o._columns[s],e.visibleIndex=e.fixed^v.fixed?i:v.visibleIndex),ht(o,e)),e.visible=f!==y,h(o,p?"grouping":"columns"),w(o))},changeSortOrder:function(t,i){var f=this,s=f.option("sorting"),o=s&&s.mode,c=o==="single"||!i,l=o==="single"||o==="multiple",r=f._columns[t],a=function(n){if(i==="ctrl"){if(!("sortOrder"in n&&"sortIndex"in n))return!1;delete n.sortOrder,delete n.sortIndex}else n.sortOrder=u(n.groupIndex)||u(n.sortIndex)?n.sortOrder==="desc"?"asc":"desc":"asc";return!0},e=!1;l&&r&&r.allowSorting&&(c&&!u(r.groupIndex)&&n.each(f._columns,function(n){n!==t&&this.sortOrder&&!u(this.groupIndex)&&(delete this.sortOrder,delete this.sortIndex,e=!0)}),g(i)?r.sortOrder!==i&&(r.sortOrder=i,e=!0):i==="none"?r.sortOrder&&(delete r.sortIndex,delete r.sortOrder,e=!0):e=a(r)),e&&(st(f),h(f,"sorting"),w(f))},getSortDataSourceParameters:function(t){var f=this,r=[],i=[];return n.each(f._columns,function(){(this.dataField||this.selector||this.calculateCellValue)&&u(this.sortIndex)&&!u(this.groupIndex)&&(r[this.sortIndex]=this)}),n.each(r,function(){var n=this&&this.sortOrder;g(n)&&i.push({selector:this.calculateSortValue||t&&this.selector||this.dataField||this.calculateCellValue,desc:this.sortOrder==="desc"})}),i.length>0?i:null},getGroupDataSourceParameters:function(t){var i=[];return n.each(this.getGroupColumns(),function(){var n=this.calculateGroupValue||t&&this.selector||this.dataField||this.calculateCellValue;n&&i.push({selector:n,desc:this.sortOrder==="desc",isExpanded:!!this.autoExpandGroup})}),i.length>0?i:null},refresh:function(t){var i=[];return n.each(this._columns,function(){var n=this.lookup;if(n){if(t&&n.valueMap)return;n.update&&i.push(n.update())}}),n.when.apply(n,i)},updateColumnDataTypes:function(t){var i=ot(t),r=this.option("rtlEnabled");n.each(this._columns,function(n,t){var s,c,o,l,h,f=t.lookup;if(t.calculateCellValue&&i.length){if(!t.dataType||f&&!f.dataType){for(s=0;s<i.length;s++)c=t.calculateCellValue(i[s]),h=t.dataType||ft(c),o=o||h,o&&h&&o!==h&&(o="string"),f&&(h=f.dataType||ft(f.calculateCellValue(c)),l=l||h,l&&h&&l!==h&&(l="string"));t.dataType=o,f&&(f.dataType=l)}if(!t.serializationFormat||f&&!f.serializationFormat)for(s=0;s<i.length;s++)c=t.calculateCellValue(i[s],!0),t.serializationFormat=t.serializationFormat||et(t.dataType,c),f&&(f.serializationFormat=f.serializationFormat||et(f.dataType,f.calculateCellValue(c,!0)))}t.selector=t.selector||function(n){return t.calculateCellValue(n)},tt(t,t.dataType),f&&tt(f,f.dataType),o=f?f.dataType:t.dataType,o&&(t.alignment=t.alignment||pt(o,r),t.format=t.format||e.getFormatByDataType(o),t.customizeText=t.customizeText||wt(o),u(t.filterOperations)||(t.filterOperations=!f&&vt[o]||[]),t.defaultFilterOperation=t.filterOperations&&t.filterOperations[0]||"=",t.defaultSelectedFilterOperation=t.selectedFilterOperation,t.showEditorAlways=u(t.showEditorAlways)?t.showEditorAlways:o==="boolean"&&!t.cellTemplate)})},_customizeColumns:function(n){var t=this,i=t.option("customizeColumns");i&&(i(n),p(t,b(t,n)))},updateColumns:function(t,i){var r=this,u,f;return i||r.updateSortingGrouping(t),!t||t.isLoaded()?(u=t?t.sort()||[]:r.getSortDataSourceParameters(),f=t?t.group()||[]:r.getGroupDataSourceParameters(),r._customizeColumns(r._columns),d(r),n.when(r.refresh(!0)).always(function(){t&&(r.updateColumnDataTypes(t),r._dataSourceApplied=!0),k(u,r.getSortDataSourceParameters())||h(r,"sorting"),k(f,r.getGroupDataSourceParameters())||h(r,"grouping"),h(r,"columns"),w(r)})):void 0},updateSortingGrouping:function(t,r){var u=this,f,e,s,c,l,a=function(t,r,u){var f,e,o;n.each(t,function(n,t){if(delete t[u],r)for(f=0;f<r.length;f++)if(e=r[f].selector,o=r[f].isExpanded,e===t.dataField||e===t.name||e===t.selector||e===t.calculateCellValue||e===t.calculateGroupValue){t.sortOrder=t.sortOrder||(r[f].desc?"desc":"asc"),o!==i&&(t.autoExpandGroup=o),t[u]=f;break}})};t&&(f=o(t.sort()),e=o(t.group()),s=u.getGroupDataSourceParameters(),c=u.getSortDataSourceParameters(),u._columns.length||(n.each(e,function(n,t){u._columns.push(t.selector)}),n.each(f,function(n,t){u._columns.push(t.selector)}),p(u,b(u,u._columns))),!r&&(s||u._hasUserState)||k(e,s)||(a(u._columns,e,"groupIndex"),r&&(h(u,"grouping"),l=!0)),!r&&(c||u._hasUserState)||k(f,c)||(a(u._columns,f,"sortIndex"),r&&(h(u,"sorting"),l=!0)),l&&w(u))},updateFilter:function(t){var f=this,i,u;if(r.isArray(t))for(r.isString(t[0])&&(i=f.columnOption(t[0]),i&&i.calculateCellValue&&(t[0]=n.proxy(i,"calculateCellValue"))),u=0;u<t.length;u++)f.updateFilter(t[u])},columnCount:function(){return this._columns.length},columnOption:function(t,u,f,e){var c=this,o,l=r.isString(t)&&t.substr(0,t.indexOf(":")),s=t<0||l==="command"?c._commandColumns:c._columns,h;if(t!==i){for(l&&(t=t.substr(l.length+1)),o=0;o<s.length;o++)if(l){if(""+s[o][l]===t){h=s[o];break}}else if(s[o].index===t||s[o].name===t||s[o].dataField===t||s[o].caption===t){h=s[o];break}if(h){if(arguments.length===1)return n.extend({},h);if(r.isString(u)){if(arguments.length===2)return ut(c,h,u);ut(c,h,u,f,e)}else r.isObject(u)&&n.each(u,function(n,t){ut(c,h,n,t,e)});d(c,h),w(c)}}},clearSorting:function(){var t=this,r=this.columnCount(),n;for(t.beginUpdate(),n=0;n<r;n++)t.columnOption(n,"sortOrder",i);t.endUpdate()},clearGrouping:function(){var t=this,r=this.columnCount(),n;for(t.beginUpdate(),n=0;n<r;n++)t.columnOption(n,"groupIndex",i);t.endUpdate()},getVisibleIndex:function(n){for(var i=this.getVisibleColumns(),t=0;t<i.length;t++)if(i[t].index===n)return t;return-1},addColumn:function(n){var t=this,i=nt(t,n);t._columns.push(i),d(t,i),t.updateColumns(t._dataSource)},addCommandColumn:function(n){for(var i=this._commandColumns,t=0;t<i.length;t++)if(i[t].command===n.command)return;i.push(n)},getUserState:function(){function f(n,f){r[t][f]!==i&&(u[t][f]=r[t][f])}for(var r=this._columns,u=[],t=0;t<r.length;t++)u[t]={},n.each(a,f);return u},setUserState:function(n){this._columnsUserState=n,this._hasUserState=!!n,this.init()},_createCalculatedColumnOptions:function(i){var u={},e=i.dataField,o;return e&&r.isString(e)?(o=f.compileGetter(e),u={caption:yt(e),calculateCellValue:function(n,t){var i=o(n);return this.deserializeValue&&!t?this.deserializeValue(i):i},setCellValue:function(n,t){var r=this.dataField.split("."),f=r.length-1,u,i;for(this.serializeValue&&(t=this.serializeValue(t)),i=0;i<f;i++)u=r[i],n=n[u]=n[u]||{};n[r[f]]=t},parseValue:function(n){var u=this,t,i;return u.dataType==="number"?r.isString(n)?(i=Globalize.parseFloat(n),r.isNumber(i)&&(t=i)):r.isDefined(n)&&(t=Number(n)):u.dataType==="boolean"?n===u.trueText?t=!0:n===u.falseText&&(t=!1):u.dataType==="date"?(i=Globalize.parseDate(n),i&&(t=i)):t=n,t}}):n.extend(!0,u,{allowSorting:!1,allowGrouping:!1,calculateCellValue:function(){return null}}),i.dataType&&(u.userDataType=i.dataType),i.lookup&&(u.lookup={calculateCellValue:function(n,t){return this.valueExpr&&(n=this.valueMap&&this.valueMap[n]),this.deserializeValue&&!t?this.deserializeValue(n):n},updateValueMap:function(){var i,r,t,n;if(this.valueMap={},this.items)for(i=f.compileGetter(this.valueExpr),r=f.compileGetter(this.displayExpr),n=0;n<this.items.length;n++)t=this.items[n],this.valueMap[i(t)]=r(t)},update:function(){var n=this,i=n.dataSource,u;if(i)if(r.isObject(i)||r.isArray(i)){if(n.valueExpr)return u=f.normalizeDataSourceOptions(i),u.paginate=!1,i=new t.data.DataSource(u),i.load().done(function(t){n.items=t,n.updateValueMap&&n.updateValueMap()})}else t.log("E1016");else n.updateValueMap&&n.updateValueMap()}}),u.resizedCallbacks=n.Callbacks(),i.resized&&u.resizedCallbacks.add(n.proxy(i.resized,i)),tt(u,i.dataType),u}}}()),c.dxDataGrid.ColumnsController=h,e.registerModule("columns",{defaultOptions:function(){return{commonColumnSettings:{allowFiltering:!0,allowHiding:!0,allowSorting:!0,allowEditing:!0,encodeHtml:!0,trueText:Globalize.localize("dxDataGrid-trueText"),falseText:Globalize.localize("dxDataGrid-falseText")},allowColumnReordering:!1,allowColumnResizing:!1,columns:i,regenerateColumnsByVisibleItems:!1,customizeColumns:null}},controllers:{columns:h}})}(jQuery,DevExpress),function(n,t){var u=t.ui.dxDataGrid,l=t.ui.events,r=t.utils,o="dx-editor-cell",a="dx-row",s="dx-selection",f="dx-select-checkbox",v="dx-select-checkboxes-hidden",h="dx-command-select",y="dx-selection-disabled",c="dx-data-row",i="selection.showCheckBoxesInMultipleMode",e="selection.mode",p=function(n){return n==="single"||n==="multiple"};u.SelectionController=u.Controller.inherit(function(){var o=function(t,i,u){var f,e=u?t._unselectedItemKeys:t._selectedItemKeys;if(r.isObject(i)){for(f=0;f<e.length;f++)if(a(e[f],i))return f;return-1}return n.inArray(i,e)},s=function(n,t){var i=n.getController("data").keyOf(t);o(n,i)===-1&&(n._selectedItemKeys.push(i),n._addedItemKeys.push(i),n._selectedItems.push(t))},c=function(n,t){var i=o(n,t);i>=0&&(n._selectedItemKeys.splice(i,1),n._removedItemKeys.push(t),n._selectedItems.splice(i,1))},b=function(n){l(n,[],[])},l=function(t,i,r){var u,f=t._selectedItemKeys;for(t._selectedItemKeys=i,t._selectedItems=r,t._unselectedItemKeys=[],u=0;u<f.length;u++)n.inArray(f[u],i)===-1&&t._removedItemKeys.push(f[u]);for(u=0;u<i.length;u++)n.inArray(i[u],f)===-1&&t._addedItemKeys.push(i[u])},a=u.equalKeys,w=function(n){delete n._shiftFocusedItemIndex},f=function(n){return n&&n.rowType==="data"&&!n.inserted},k=function(n,t,i){var e=!1,o,u,l=n.getController("data"),a=i[n._focusedItemIndex]&&n.isRowSelected(l.keyOf(i[n._focusedItemIndex].data)),h=function(n,t,i){i?c(n,l.keyOf(t)):s(n,t)};if(r.isDefined(n._shiftFocusedItemIndex)||(n._shiftFocusedItemIndex=n._focusedItemIndex),n._shiftFocusedItemIndex!==n._focusedItemIndex)for(o=n._focusedItemIndex<n._shiftFocusedItemIndex?1:-1,u=n._focusedItemIndex;u!==n._shiftFocusedItemIndex;u+=o)f(i[u])&&(h(n,i[u].data,!0),e=!0);if(t!==n._shiftFocusedItemIndex)for(o=t<n._shiftFocusedItemIndex?1:-1,u=t;u!==n._shiftFocusedItemIndex;u+=o)f(i[u])&&(h(n,i[u].data,!1),e=!0);return f(i[n._focusedItemIndex])&&!a&&(h(n,i[n._focusedItemIndex].data,!1),e=!0),e},d=function(t,i,r){var o,f,e=t&&t.key(),u=[];return t&&(e?n.each(i,function(t,i){if(u.length>0&&u.push(r?"and":"or"),n.isArray(e)){for(o=[],f=0;f<e.length;f++)f>0&&o.push(r?"or":"and"),o.push([e[f],r?"<>":"=",i[e[f]]]);u.push(o)}else u.push([e,r?"<>":"=",i])}):u=function(n){for(var t=0;t<i.length;t++)if(a(i[t],n))return!r;return r}),u.length>0||n.isFunction(u)?u:void 0},v=function(t){var r=[],u=t.getController("data"),e,o;u&&(n.each(u.items(),function(n,i){f(i)&&i.isSelected!==t.isRowSelected(i.key)&&r.push(n)}),t.option(i)==="onClick"&&(t._selectedItemKeys.length>1?t.startSelectionWithCheckboxes():t._selectedItemKeys.length===0&&r.length&&t.stopSelectionWithCheckboxes()),r.length&&u.updateItems({changeType:"updateSelection",itemIndexes:r}),e=t._addedItemKeys,o=t._removedItemKeys,(e.length||o.length)&&(t._selectedItemsInternalChange=!0,t.option("selectedRowKeys",t._selectedItemKeys.slice(0)),t._selectedItemsInternalChange=!1,t.selectionChanged.fire(t._selectedItemKeys),t._addedItemKeys=[],t._removedItemKeys=[],t.executeAction("onSelectionChanged",{selectedRowsData:t._selectedItems,selectedRowKeys:t._selectedItemKeys,currentSelectedRowKeys:e,currentDeselectedRowKeys:o})))},y=function(n){var t=n.getController("columns"),i=n.isSelectColumnVisible();t.addCommandColumn({command:"select",visible:i,visibleIndex:-1,dataType:"boolean",alignment:"center",cssClass:h,width:"auto"}),t.columnOption("command:select","visible",i)};return{init:function(){var n=this;n._isSelectionWithCheckboxes=!1,n._focusedItemIndex=-1,n._selectedItemKeys=[],n._unselectedItemKeys=[],n._selectedItems=[],n._addedItemKeys=[],n._removedItemKeys=[],y(n),n.createAction("onSelectionChanged",{excludeValidators:["disabled","readOnly"]})},callbackNames:function(){return["selectionChanged"]},optionChanged:function(n){var t=this;t.callBase(n);switch(n.name){case"selection":t.init(),t.getController("columns").updateColumns(),n.handled=!0;break;case"selectedRowKeys":r.isArray(n.value)&&!t._selectedItemsInternalChange&&t.selectRows(n.value),n.handled=!0}},publicMethods:function(){return["selectRows","deselectRows","selectRowsByIndexes","getSelectedRowKeys","getSelectedRowsData","clearSelection","selectAll","startSelectionWithCheckboxes","stopSelectionWithCheckboxes","isRowSelected"]},isRowSelected:function(n){var t=o(this,n);return t!==-1},isSelectColumnVisible:function(){var n=this.option(i);return this.option(e)==="multiple"&&(n==="always"||n==="onClick"||this._isSelectionWithCheckboxes)},isSelectAll:function(){var r=this.getController("data"),u=r.items(),f=r.getCombinedFilter(),n=this.getSelectedRowsData(),i;if(f&&t.data.query(n).filter(f).enumerate().done(function(t){n=t}),n.length){if(n.length>=r.totalCount())return!0}else{for(i=0;i<u.length;i++)if(u[i].selected)return;return!1}},selectAll:function(){return this.option(i)==="onClick"&&this.startSelectionWithCheckboxes(),this.selectedItemKeys([],!0,!1,!0)},deselectAll:function(){return this.selectedItemKeys([],!0,!0,!0)},clearSelection:function(){this.selectedItemKeys([])},refresh:function(){return this.selectedItemKeys(this.option("selectedRowKeys")||[])},selectedItemKeys:function(i,u,f,e){var a=this,k,o,g,h,w=a.getController("data"),nt=w.dataSource(),b=nt&&nt.store(),p,y,tt=[];return r.isDefined(i)?(b&&(k=n.isArray(i)?n.extend([],i):[i],(k.length||e)&&(o=d(nt,k,e),g=n.isFunction(o),(o||e)&&(e&&(p=w.getCombinedFilter()),o&&!g&&p?(y=[],y.push(o),y.push(p)):p?y=p:o&&!g&&(y=o),h=n.Deferred(),f&&new t.data.ArrayStore(a._selectedItems).load({filter:y}).done(function(n){tt=n}),w.setSelectionLoading(!0),n.when(tt.length?tt:b.load({filter:y})).done(function(n){new t.data.ArrayStore(n).load({filter:o}).done(h.resolve)}).fail(n.proxy(h.reject,h)).always(function(){w.setSelectionLoading(!1)})))),h=h||n.Deferred().resolve([]),h.done(function(n){var t,i,r,e=[];if(b&&n.length>0)for(t=0;t<n.length;t++)r=n[t],i=b.keyOf(r),u?f?c(a,i):s(a,r):e.push(i);u||l(a,e,n),v(a)}),h):a._selectedItemKeys},getSelectedRowKeys:function(){return this.selectedItemKeys()},selectRows:function(n,t){return this.selectedItemKeys(n,t)},deselectRows:function(n){return this.selectedItemKeys(n,!0,!0)},selectRowsByIndexes:function(t){var u=this.getController("data").items(),i=[];return r.isArray(t)||(t=Array.prototype.slice.call(arguments,0)),n.each(t,function(){var n=u[this];n&&n.rowType==="data"&&i.push(n.key)}),this.selectRows(i)},getSelectedRowsData:function(){return this._selectedItems},changeItemSelection:function(n,t){var i=this,d=i.getController("data"),g=d.items(),o=g[n],h=o&&o.data,y=i.option(e),u,nt,r;return p(y)&&f(o)&&(r=d.keyOf(h),t=t||{},i.isSelectionWithCheckboxes()&&(t.control=!0),t.shift&&y==="multiple"&&i._focusedItemIndex>=0?u=k(i,n,g):t.control?(w(i),nt=i.isRowSelected(r),y==="single"&&b(i),nt?c(i,r):s(i,h),u=!0):(w(i),i._selectedItemKeys.length===1&&a(i._selectedItemKeys[0],r)||(l(i,[r],[h]),u=!0)),u)?(i._focusedItemIndex=n,v(i),!0):!1},focusedItemIndex:function(n){var t=this;if(r.isDefined(n))t._focusedItemIndex=n;else return t._focusedItemIndex},isSelectionWithCheckboxes:function(){var n=this.option(e),t=this.option(i);return n==="multiple"&&(t==="always"||this._isSelectionWithCheckboxes)},startSelectionWithCheckboxes:function(){var n=this,t=n.isSelectColumnVisible();return n.option(e)==="multiple"&&!n.isSelectionWithCheckboxes()?(n._isSelectionWithCheckboxes=!0,y(n),t===n.isSelectColumnVisible()&&n.option(i)==="onClick"&&v(n),!0):!1},stopSelectionWithCheckboxes:function(){var n=this;return n._isSelectionWithCheckboxes?(n._isSelectionWithCheckboxes=!1,y(n),!0):!1}}}()),u.registerModule("selection",{defaultOptions:function(){return{selection:{mode:"none",showCheckBoxesInMultipleMode:"onClick",allowSelectAll:!0},selectedRowKeys:[]}},controllers:{selection:u.SelectionController},extenders:{controllers:{data:{setDataSource:function(n){this.callBase(n),n&&this.getController("selection").refresh()},setSelectionLoading:function(n){this._isSelectionLoading=n,this._fireLoadingChanged()},isLoading:function(){var n=this.callBase();return n||!!this._isSelectionLoading},pageIndex:function(n){var t=this,i=t._dataSource;return i&&n&&i.pageIndex()!==n&&t.getController("selection").focusedItemIndex(-1),t.callBase(n)},_processDataItem:function(){var i=this,t=i.getController("selection"),r=t.isSelectColumnVisible(),n=this.callBase.apply(this,arguments);return n.isSelected=t.isRowSelected(n.key),r&&n.values&&(n.values[0]=n.isSelected),n},refresh:function(){return n.when(this.getController("selection").refresh(),this.callBase.apply(this,arguments))}}},views:{columnHeadersView:{_renderCore:function(n){var t=this;t.getController("selection").selectionChanged.remove(t._selectionChangedHandler),t.callBase(n)},_getDefaultTemplate:function(t){var i=this,u,r=i.getController("selection"),e=i.getController("data");return t.command==="select"?function(t,s){var h=s.column;if(h.command==="select"){t.addClass(o),u=n("<div />").appendTo(t).addClass(f),i.setAria("label",Globalize.localize("dxDataGrid-ariaSelectAll"),t),i.getController("editorFactory").createEditor(u,n.extend({},h,{parentType:"headerRow",value:r.isSelectAll(),setValue:function(n,t){t.jQueryEvent&&r.isSelectAll()!==n&&((t.previousValue===undefined||t.previousValue)&&(r.deselectAll(),t.component.option("value",!1)),t.previousValue===!1&&(i.option("selection.allowSelectAll")?r.selectAll():t.component.option("value",!1)),t.jQueryEvent.preventDefault())}}));t.on("dxclick",i.createAction(function(t){var i=t.jQueryEvent;n(i.target).closest("."+f).length||n(i.currentTarget).children().trigger("dxclick"),i.preventDefault()}));i._selectionChangedHandler=function(){i.option("selection.mode")==="multiple"&&u.dxCheckBox("instance").option("value",r.isSelectAll())},i._dataChangedHandler=function(n){n&&n.changeType!=="refresh"||i._selectionChangedHandler()},e.changed.add(i._dataChangedHandler),r.selectionChanged.add(i._selectionChangedHandler)}}:i.callBase(t)}},rowsView:{_getDefaultTemplate:function(t){var i=this,r;return t.command==="select"?function(u,e){if(e.rowType==="data"&&!e.row.inserted){u.addClass(o);u.on("dxclick",i.createAction(function(t){var r=i.getController("selection"),u=t.jQueryEvent,f=i.getRowIndex(n(u.currentTarget).closest("."+a));f>=0&&(r.startSelectionWithCheckboxes(),r.changeItemSelection(f,{shift:u.shiftKey}))}));i.setAria("label",Globalize.localize("dxDataGrid-ariaSelectRow"),u),r=n("<div />").addClass(f).appendTo(u),i.getController("editorFactory").createEditor(r,n.extend({},t,{parentType:"dataRow",value:e.value,setValue:function(n,t){t&&t.jQueryEvent&&t.jQueryEvent.type==="keydown"&&u.trigger("dxclick",t)}}))}}:i.callBase(t)},_update:function(t){var i=this,r=i.getTableElements();t.changeType==="updateSelection"?r.length>0&&(n.each(r,function(r,u){n.each(t.itemIndexes||[],function(r,e){var h,o;t.items[e]&&(h=i._getRowElements(n(u)).eq(e),o=!!t.items[e].isSelected,h.toggleClass(s,o).find("."+f).dxCheckBox("option","value",o),i.setAria("selected",o,h))})}),i._updateCheckboxesClass()):i.callBase(t)},_createTable:function(){var t=this,u=t.option("selection.mode"),r=t.callBase.apply(t,arguments);if(u!=="none")r.on(l.addNamespace("dxhold","dxDataGridRowsView"),"."+c,t.createAction(function(r){var u=t.getController("selection"),f=r.jQueryEvent,e=n(f.target).closest("."+c).index();t.option(i)==="onLongTap"?u.isSelectionWithCheckboxes()?u.stopSelectionWithCheckboxes():u.startSelectionWithCheckboxes():(t.option(i)==="onClick"&&u.startSelectionWithCheckboxes(),u.changeItemSelection(e,{control:!0}))})).on("mousedown selectstart",t.createAction(function(n){var t=n.jQueryEvent;t.shiftKey&&t.preventDefault()}));return r},_createRow:function(n){var t=this.callBase(n),i;return n&&(i=!!n.isSelected,t.toggleClass(s,i),this.setAria("selected",i,t)),t},_rowClick:function(t){var r=this,i=t.jQueryEvent,u=n(i.target).closest("."+h).length,f=n(i.target).closest("."+y).length;u||(f||r.getController("selection").changeItemSelection(t.rowIndex,{control:i.ctrlKey,shift:i.shiftKey})&&(i.preventDefault(),t.handled=!0),r.callBase(t))},_renderCore:function(n){this.callBase(n),this._updateCheckboxesClass()},_updateCheckboxesClass:function(){var i=this.getTableElements(),t=this.getController("selection"),r=t.isSelectColumnVisible()&&!t.isSelectionWithCheckboxes();n.each(i,function(t,i){n(i).toggleClass(v,r)})}}}}})}(jQuery,DevExpress),function(n,t){var r=t.ui.dxDataGrid,u=t.utils,s=t.ui.events.addNamespace,a="dx-datagrid-checkbox-size",f="dx-cell-focus-disabled",h="dxDataGridEditorFactory",c=s("focusin dxpointerdown dxclick",h),l="dx-datagrid-focus-overlay",e="dx-focused",v="dx-datagrid-content",o="dx-pointer-events-target",y="dx-pointer-events-none",i="dx-hidden",p=9;r.EditorFactoryController=r.ViewController.inherit(function(){var r=function(t,i){return n.extend(t,{readOnly:i.readOnly,rtlEnabled:i.rtlEnabled,disabled:i.disabled})},w=function(n){return r({placeholder:n.placeholder,width:n.width,value:n.value,onValueChanged:function(t){var i=function(t){n&&n.setValue(t.value)};window.clearTimeout(t.component._valueChangeTimeoutID),t.jQueryEvent&&t.jQueryEvent.type==="keyup"?t.component._valueChangeTimeoutID=window.setTimeout(function(){i(t)},u.isDefined(n.updateValueTimeout)?n.updateValueTimeout:0):i(t)},valueChangeEvent:"change"+(n.parentType==="filterRow"?" keyup":"")},n)},k=function(n){n.editorName="dxDateBox",n.editorOptions=r({value:n.value,pickerType:"calendar",customOverlayCssClass:"dx-datagrid",onValueChanged:function(t){n.setValue(t.value)},formatString:t.utils.isString(n.format)&&t.DateTimeFormat[n.format.toLowerCase()]||n.format,formatWidthCalculator:null,width:"auto"},n)},d=function(n){var i=w(n),r=n.parentType==="searchPanel",u=function(n){return t.utils.isDefined(n)?n.toString():""};i.value=u(n.value),i.valueChangeEvent+=r?" keyup search":"",i.mode=r?"search":"text",n.editorName="dxTextBox",n.editorOptions=i},g=function(n){var t=w(n);t.value=u.isDefined(n.value)?n.value:null,n.editorName="dxNumberBox",n.editorOptions=t},nt=function(t){t.parentType==="filterRow"?b(n.extend(t,{lookup:{displayExpr:function(n){return n===!0?t.trueText||"true":n===!1?t.falseText||"false":void 0},dataSource:[!0,!1],rtlEnabled:t.rtlEnabled,disabled:t.disabled}})):tt(t)},b=function(n){var i=n.lookup,o,f,e,s=n.parentType==="filterRow";i&&(o=t.data.utils.compileGetter(i.displayExpr),(u.isObject(i.dataSource)||u.isArray(i.dataSource))&&(f=t.data.utils.normalizeDataSourceOptions(i.dataSource),s&&(e=f.postProcess,f.postProcess=function(n){return(this.pageIndex()===0&&(n=n.slice(0),n.unshift(null)),e)?e.call(this,n):n})),n.editorName="dxSelectBox",n.editorOptions=r({searchEnabled:!0,value:n.value,valueExpr:n.lookup.valueExpr,showClearButton:i.allowClearing&&!s,displayExpr:function(t){return t===null?n.showAllText:o(t)},dataSource:f,onValueChanged:function(t){n.setValue(t.value,t)}},n))},tt=function(n){n.editorName="dxCheckBox",n.editorOptions=r({value:n.value,onValueChanged:function(t){n.setValue&&n.setValue(t.value,t)}},n)},it=function(t){t.editorName&&t.editorOptions&&t.editorElement[t.editorName]&&(t.editorName==="dxCheckBox"&&t.editorElement.addClass(a),t.editorElement[t.editorName](t.editorOptions),t.editorName==="dxTextBox"&&t.editorElement.dxTextBox("instance").registerKeyHandler("enter",n.noop))};return{_getFocusedElement:function(n){return n.find("[tabindex]:focus, input:focus")},_updateFocusCore:function(){var n=this._$focusedElement,t=this.component&&this.component.element();if(t&&(n=this._getFocusedElement(t),n.length&&(n.hasClass(f)||(n=n.closest(".dx-row > td, ."+f)),n.length&&!n.hasClass(f)))){this.focus(n);return}this.loseFocus()},_updateFocus:function(t){var i=this,r=t&&t.jQueryEvent&&n(t.jQueryEvent.target).hasClass(l);i._isFocusOverlay=i._isFocusOverlay||r,clearTimeout(i._updateFocusTimeoutID),i._updateFocusTimeoutID=setTimeout(function(){delete i._updateFocusTimeoutID,i._isFocusOverlay||i._updateFocusCore(),i._isFocusOverlay=!1})},_updateFocusOverlaySize:function(i,r){var u=t.calculatePosition(i,n.extend({collision:"fit"},r));u.h.oversize>0&&i.outerWidth(i.outerWidth()-u.h.oversize),u.v.oversize>0&&i.outerHeight(i.outerHeight()-u.v.oversize)},callbackNames:function(){return["focused"]},focus:function(r,u){var f=this;if(r===undefined)return f._$focusedElement;r&&setTimeout(function(){var s=f._$focusOverlay=f._$focusOverlay||n("<div>").addClass(l+" "+o),c,a,h;u?f._$focusOverlay&&f._$focusOverlay.addClass(i):(a=DevExpress.browser.msie?"left bottom":DevExpress.browser.mozilla?"right bottom":"left top",h=r.closest("."+v),s.removeClass(i).appendTo(h).outerWidth(r.outerWidth()+1).outerHeight(r.outerHeight()+1),c={my:a,at:a,of:r,boundary:h.length&&h},f._updateFocusOverlaySize(s,c),t.position(s,c),s.css("visibility","visible")),f._$focusedElement&&f._$focusedElement.removeClass(e),r.addClass(e),f._$focusedElement=r,f.focused.fire(r)})},resize:function(){var n=this._$focusedElement;n&&this.focus(n)},loseFocus:function(){this._$focusedElement&&this._$focusedElement.removeClass(e),this._$focusedElement=null,this._$focusOverlay&&this._$focusOverlay.addClass(i)},init:function(){this.createAction("onEditorPreparing",{excludeValidators:["designMode","disabled","readOnly"],category:"rendering"}),this.createAction("onEditorPrepared",{excludeValidators:["designMode","disabled","readOnly"],category:"rendering"}),this._updateFocusHandler=this._updateFocusHandler||this.createAction(n.proxy(this._updateFocus,this));n(document).on(c,this._updateFocusHandler);this._attachContainerEventHandlers()},_attachContainerEventHandlers:function(){var i=this,r=i.component&&i.component.element(),u=t.browser.msie&&parseInt(t.browser.version)<11;if(r){r.on(s("keydown",h),function(n){n.which===p&&i._updateFocusHandler(n)});u&&r.on("dxclick dxpointerup dxpointerdown","."+o,n.proxy(i._focusOverlayEventProxy,i))}},_focusOverlayEventProxy:function(r){var u=n(r.target),f=n(r.currentTarget),e,h=u.hasClass(o)||u.hasClass(y),s=this._$focusedElement;h&&!f.hasClass(i)&&(f.addClass(i),e=u.get(0).ownerDocument.elementFromPoint(r.clientX,r.clientY),t.ui.events.fireEvent({originalEvent:r,target:e}),r.stopPropagation(),f.removeClass(i),s&&s.find("input").focus())},dispose:function(){clearTimeout(this._updateFocusTimeoutID),n(document).off(c,this._updateFocusHandler)},createEditor:function(n,t){this.component._suppressDeprecatedWarnings();var i=this.option("editorPreparing"),r=this.option("editorPrepared");if(this.component._resumeDeprecatedWarnings(),t.rtlEnabled=this.option("rtlEnabled"),t.disabled=t.disabled||this.option("disabled"),t.cancel=!1,t.editorElement=n,t.lookup)b(t);else switch(t.dataType){case"date":k(t);break;case"boolean":nt(t);break;case"number":g(t);break;default:d(t)}(i&&i(n,t),this.executeAction("onEditorPreparing",t),t.cancel)||(it(t),r&&r(n,t),this.executeAction("onEditorPrepared",t))}}}()),r.registerModule("editorFactory",{defaultOptions:function(){return{}},controllers:{editorFactory:r.EditorFactoryController},extenders:{controllers:{columnsResizer:{_startResizing:function(n){this.callBase(n),this.isResizing()&&this.getController("editorFactory").loseFocus()}}}}})}(jQuery,DevExpress),function(n,t){var l=t.ui,r=t.utils,u=l.dxDataGrid,o="dx-datagrid-scroll-container",s="dx-row",a="dx-datagrid-group-space",v="dx-group-row",y="dx-datagrid-content",p="dx-datagrid-table",h="dx-datagrid-text-content",f="dx-column-indicators",w="dx-datagrid-table-fixed",b="dx-indicator-alignment-",d="dx-header-row",e="dxCellHintVisible",c={sort:"dx-sort",headerFilter:"dx-header-filter"},k={render:function(n,t){t.append(n)}};u.getWidths=function(t){var u,f=[],i,r;return t&&(u=t.children("tbody").children("tr").filter(":not(."+v+")").first().find("> td"),n.each(u,function(t,u){i=n(u).outerWidth(!0),u.getBoundingClientRect&&(r=u.getBoundingClientRect(),r.width>i&&(i=Math.ceil(r.width))),f.push(i)})),f},u.ColumnsView=u.View.inherit({_getColumnAlignment:function(n){var t=this.option("rtlEnabled");return n!=="center"?n:r.getDefaultAlignment(t)},_applyColumnState:function(t){var r=this,u=r._getColumnAlignment(t.column.alignment),i=n.extend(!0,{columnAlignment:u},t),f=r._createIndicatorContainer(i),e=n("<span />").addClass(c[t.name]);return i.container=f,i.indicator=e,r._renderIndicator(i),f[t.showColumnLines?"prependTo":"appendTo"](t.rootElement).addClass(b+u),e},_createIndicatorContainer:function(t){var r=this,i=t.rootElement.find("."+f),u=r._getColumnAlignment(t.column.alignment)==="right"?"left":"right";return i.length||(i=n("<div/>").addClass(f)),i.css("float",t.showColumnLines?u:null),i},_getIndicatorContainer:function(n){return n&&n.find("."+f)},_renderIndicator:function(n){var t=n.container,i=n.indicator;t&&i&&t.append(i)},_updateIndicatorHeights:function(n){var r=this,i=r.getColumnElements(),u,t;if(i)for(t=0;t<i.length;t++)u=i.eq(t),r._updateIndicatorHeight(u,n)},_updateIndicatorHeight:function(n,t){var r=n.find("."+h),i=n.find("."+c[t]);i.length&&(i.height("auto"),i.height(r.height()||n.height())),this._setColumnTextWidth(n)},_updateIndicators:function(n){for(var i=this,r=i.getColumns(),u=i.getColumnElements(),t=0;t<r.length;t++)i._updateIndicator(u.eq(t),r[t],n);i._updateIndicatorHeights(n)},_updateIndicator:function(n,t,i){if(!t.command)return this._applyColumnState({name:i,rootElement:n,column:t,showColumnLines:this.option("showColumnLines")})},_setColumnTextWidth:function(n){var t=this._getIndicatorContainer(n);n.find("."+h).css("max-width",n.width()-t.outerWidth())},_updateCell:function(n,t){t.rowType&&this._cellPrepared(n,t)},_createCell:function(t){var i=r.getDefaultAlignment(this.option("rtlEnabled")),u=t.alignment||i;return n("<td/>").css("text-align",u).toggleClass(t.cssClass,!r.isDefined(t.groupIndex)).attr("role","gridcell").toggleClass(a,t.command==="expand")},_createRow:function(){return n("<tr />").addClass(s).attr("role","row")},_createTable:function(i){var u=this,r=n("<table />").addClass(p).addClass(w).attr("role","grid");if(i&&(r.append(u._createColGroup(i)),t.devices.real().ios&&r.append("<thead><tr><\/tr><\/thead>")),u.option("cellHintEnabled"))r.on("mousemove",".dx-row > td",this.createAction(function(t){var o=t.jQueryEvent,i=n(o.target),s=n(o.currentTarget),f=s.parent(),h=f.hasClass("dx-data-row"),c=f.hasClass("dx-header-row"),l=f.children(),a=u._columnsController.getVisibleColumns(),v=l.index(s),r=a[v];(!h&&!c||h&&r&&!r.cellTemplate||c&&r&&!r.headerCellTemplate)&&(i.data(e)&&(i.removeAttr("title"),i.data(e,!1)),i[0].scrollWidth>i[0].clientWidth&&!i.attr("title")&&(i.attr("title",i.text()),i.data(e,!0)))}));return r},_createColGroup:function(t){for(var r,u=n("<colgroup />"),f,e=t.length,i=0;i<e;i++)for(f=t[i].colspan||1,r=0;r<f;r++)u.append(this._createCol(t[i]));return u},_createCol:function(t){return n("<col />").width(t.visibleWidth||t.width)},renderDelayedTemplates:function(){for(var n,t=this._delayedTemplates;t.length;)n=t.shift(),n.template.render(n.options,n.container),n.options.column&&this._updateCell(n.container,n.options)},_processTemplate:function(t){var r=this,u;return t&&t.render?u={allowRenderToDetachedContainer:t.allowRenderToDetachedContainer,render:function(n,i){t.render(i,n)}}:n.isFunction(t)?u={render:function(n,i){t(i,n)}}:(r._templatesCache[t]||(r._templatesCache[t]=r.getTemplate(t)),u=r._templatesCache[t]),u},_renderTemplate:function(n,t,i){var u=this,r=u._processTemplate(t,i);if(r){if(r.allowRenderToDetachedContainer)return r.render(i,n),!0;u._delayedTemplates.push({template:r,container:n,options:i})}return!1},_appendRow:function(n,t){var i=this;i.option("rowTemplate")&&i._delayedTemplates.length&&t?i._delayedTemplates.push({container:n,template:k,options:t}):n.append(t)},_renderCore:function(){var t=this.element().parent();(!t||t.parent().length)&&this.renderDelayedTemplates()},_renderTable:function(n){n=n||{};var t=this,i;return n.columns=t._columnsController.getVisibleColumns(),i=t._createTable(n.columns),t._renderRows(i,n),i},_renderRows:function(t,i){for(var u=this,f=u._getRows(i.change),r=0;r<f.length;r++)u._renderRow(t,n.extend({row:f[r]},i))},_renderRow:function(t,i){var r=this,u;u=r._createRow(i.row),r._renderCells(u,i),r._appendRow(t,u),r._rowPrepared(u,n.extend({columns:i.columns},i.row))},_renderCells:function(t,i){for(var s=this,f=0,o=i.row,e=i.columns,u=0;u<e.length;u++)s._renderCell(t,n.extend({column:e[u],columnIndex:f,value:o.values&&o.values[f]},i)),r.isDefined(e[u].colspan)?f+=e[u].colspan:f++},_renderCell:function(n,t){var u=this,e=u._getCellOptions(t),f=t.column,i;return i=u._createCell(f),r.isDefined(f.command)||u.setAria("label",Globalize.localize("dxDataGrid-ariaColumn")+" "+f.caption+", "+Globalize.localize("dxDataGrid-ariaValue")+" "+e.text,i),u._renderCellContent(i,e),n.append(i),i},_renderCellContent:function(n,t){var i=this._getCellTemplate(t);(!i||this._renderTemplate(n,i,t))&&this._updateCell(n,t)},_getCellTemplate:function(){},_getRows:function(){return[]},_getCellOptions:function(n){return{column:n.column,columnIndex:n.columnIndex,rowType:n.row.rowType}},_cellPrepared:function(t,i){var r=this,u,f=function(t){return{cellElement:n(t.target).closest("td"),jQueryEvent:t,eventType:t.type}};if(r.option("onCellClick"))t.on("dxclick",function(t){r.executeAction("onCellClick",n.extend({},i,f(t)))});if(r.option("onCellHoverChanged")){t.on("mouseover",function(t){r.executeAction("onCellHoverChanged",n.extend({},i,f(t)))});t.on("mouseout",function(t){r.executeAction("onCellHoverChanged",n.extend({},i,f(t)))})}this.component._suppressDeprecatedWarnings(),u=r.option("cellPrepared"),this.component._resumeDeprecatedWarnings(),u&&u(t,i),i.cellElement=t,r.executeAction("onCellPrepared",i)},_rowPrepared:function(n,t){var r=this,i;this.component._suppressDeprecatedWarnings(),i=r.option("rowPrepared"),this.component._resumeDeprecatedWarnings(),i&&i(n,t),t.rowElement=n,this.executeAction("onRowPrepared",t)},_columnOptionChanged:function(t){var f=t.optionNames,i,r;if(u.checkChanges(f,["width","visibleWidth"])){i=this._columnsController.getVisibleColumns(),r=n.map(i,function(n){return n.visibleWidth||n.width||"auto"}),this.setColumnWidths(r);return}this._requireReady||this.render()},getTableElements:function(){return this._tableElement||n()},_getTableElement:function(){return this._tableElement},_setTableElement:function(n){this._tableElement=n},optionChanged:function(n){this.callBase(n);switch(n.name){case"cellHintEnabled":case"onCellPrepared":case"onRowPrepared":case"onCellHoverChanged":this._invalidate(!0,!0),n.handled=!0}},init:function(){var t=this;t._scrollLeft=0,t._columnsController=t.getController("columns"),t._dataController=t.getController("data"),t._delayedTemplates=[],t._templatesCache={},t.createAction("onCellClick"),t.createAction("onCellHoverChanged",{excludeValidators:["disabled","readOnly"]}),t.createAction("onCellPrepared",{excludeValidators:["designMode","disabled","readOnly"],category:"rendering"}),t.createAction("onRowPrepared",{excludeValidators:["designMode","disabled","readOnly"],category:"rendering"}),t._columnsController.columnsChanged.add(n.proxy(t._columnOptionChanged,t)),t._dataController&&t._dataController.changed.add(n.proxy(t._handleDataChanged,t))},_handleDataChanged:function(){},callbackNames:function(){return["scrollChanged"]},scrollTo:function(n){var t=this,i=t.element(),u=i&&i.find("."+o);t._skipScrollChanged=!1,r.isDefined(n)&&r.isDefined(n.left)&&t._scrollLeft!==n.left&&(t._scrollLeft=n.left,u&&u.scrollLeft(n.left),t._skipScrollChanged=!0)},wrapTableInScrollContainer:function(t){var i=this,r;return r=n("<div/>").on("scroll",function(){i._skipScrollChanged||i.scrollChanged.fire({left:r.scrollLeft()},i.name),i._skipScrollChanged=!1}).addClass(y).addClass(o).append(t)},getColumnWidths:function(){var i=this,n=[],t=i._getTableElement();return t&&(n=u.getWidths(t)),n},setColumnWidths:function(t){var o,i,r,u,f,e=this.getTableElements(!0);if(e.length&&t)for(i=0;i<e.length;i++)for(u=0,o=n(e[i]).find("col"),f=this.getColumns(n(e[i])),r=0;r<f.length;r++){if(f[r].colspan){u+=f[r].colspan;continue}o.eq(u).width(t[u]||"auto"),u++}},getCellElements:function(n){var t=this._getRowElements().eq(n);return t.children()},getCellElement:function(n,t){var f=this,e=f.getCellElements(n),i,o=f._columnsController,s,u=t;return r.isString(t)&&(s=o.columnOption(t,"index"),u=o.getVisibleIndex(s)),e.length&&u>=0&&(i=e.eq(u)),i&&i.length?i:void 0},getColumnElements:function(){},getColumns:function(){return this._columnsController.getVisibleColumns()},getCell:function(t){var i,r=this._getTableElement();if(r&&r.length===1)return i=r[0].rows[t.rowIndex],i?n(i.cells[t.columnIndex]):null},getRowsCount:function(){var n=this._getTableElement();return n&&n.length===1?n[0].rows.length:0},_getRowElements:function(t){return t=t||this._getTableElement(),t&&t.children("tbody").children("."+s)||n()},getRowIndex:function(n){return this._getRowElements().index(n)},getBoundingRect:function(){},getName:function(){}})}(jQuery,DevExpress),function(n,t){var f=t.ui,e=t.utils,i=f.dxDataGrid,o="dx-datagrid-column-chooser",r="dx-datagrid-column-chooser-button",s="column-chooser",u="dx-column-chooser-item",h="dx-column-chooser-message",c="dx-datagrid-drag-action";i.ColumnChooserController=i.ViewController.inherit({renderShowColumnChooserButton:function(t){var i=this,e=i.option("columnChooser.enabled"),u=t.find("."+r),f;e?u.length?u.show():(f=n("<div />").addClass(r).appendTo(t),i._createComponent(f,"dxButton",{icon:s,onClick:function(){i.getView("columnChooserView").showColumnChooser()},hint:i.option("columnChooser.title"),_templates:{}})):u.hide()},getPosition:function(){var n=this.getView("rowsView");return{my:"right bottom",at:"right bottom",of:n&&n.element(),collision:"fit",offset:"-2 -2",boundaryOffset:"2 2"}}}),i.ColumnChooserView=i.ColumnsView.inherit({_updateItems:function(){var t=this._columnsController.getChooserColumns(),r=this.option("columnChooser"),u=this._popupContainer.content(),f=this._createComponent(u,"dxScrollable",i.createScrollableOptions(this));this._renderColumnChooserItems(u,t),t.length||n("<span />").addClass(h).text(r?r.emptyPanelText:"").appendTo(f.content())},_initializePopupContainer:function(){var t=this,s=t.element().addClass(o),r=t.option("columnChooser"),u=DevExpress.ui.themes.current(),f=u&&u.indexOf("generic")>-1,h=u&&u.indexOf("android5")>-1,i={visible:!1,shading:!1,showCloseButton:!1,dragEnabled:!0,buttons:[{text:r.title,toolbar:"top",location:f||h?"before":"center"}],position:t.getController("columnChooser").getPosition(),width:r.width,height:r.height,rtlEnabled:t.option("rtlEnabled"),container:r.container};if(f?n.extend(i,{showCloseButton:!0}):i.buttons[i.buttons.length]={shortcut:"cancel"},e.isDefined(this._popupContainer))this._popupContainer.option(i);else{t._popupContainer=t._createComponent(s,"dxPopup",i);t._popupContainer.on("optionChanged",function(n){n.name==="visible"&&t.renderCompleted.fire()})}},_renderCore:function(){this._popupContainer&&this._updateItems()},_renderColumnChooserItems:function(t,i){var r=t.dxScrollable("instance"),f=r.content(),e;f.empty(),n.each(i,function(t,i){e=n("<div />").addClass(i.cssClass).addClass(u).toggleClass(c,i.allowHiding).text(i.caption).appendTo(f)}),r.update()},getColumnElements:function(){var n=this._popupContainer&&this._popupContainer.content();return n&&n.find("."+u)},getName:function(){return"columnChooser"},getColumns:function(){return this._columnsController.getChooserColumns()},allowDragging:function(n){return this.isColumnChooserVisible()&&n&&n.allowHiding},getBoundingRect:function(){var i=this,n=i._popupContainer&&i._popupContainer._container(),t;return n&&n.is(":visible")?(t=n.offset(),{left:t.left,top:t.top,right:t.left+n.outerWidth(),bottom:t.top+n.outerHeight()}):null},showColumnChooser:function(){this._popupContainer||(this._initializePopupContainer(),this.render()),this._popupContainer.show()},hideColumnChooser:function(){this._popupContainer&&this._popupContainer.hide()},isColumnChooserVisible:function(){var n=this._popupContainer;return n&&n.option("visible")},publicMethods:function(){return["showColumnChooser","hideColumnChooser"]}}),i.registerModule("columnChooser",{defaultOptions:function(){return{columnChooser:{enabled:!1,width:250,height:260,title:Globalize.localize("dxDataGrid-columnChooserTitle"),emptyPanelText:Globalize.localize("dxDataGrid-columnChooserEmptyText"),container:undefined}}},controllers:{columnChooser:i.ColumnChooserController},views:{columnChooserView:i.ColumnChooserView},extenders:{views:{headerPanel:{_renderShowColumnChooserButton:function(){this.getController("columnChooser").renderShowColumnChooserButton(this.element())},_renderCore:function(){this.callBase(),this._renderShowColumnChooserButton()},optionChanged:function(n){switch(n.name){case"columnChooser":this._renderShowColumnChooserButton(),n.handled=!0;break;default:this.callBase(n)}},isVisible:function(){var n=this,t=n.option("columnChooser.enabled");return n.callBase()||t}}}}})}(jQuery,DevExpress),function(n,t){var s=t.ui.dxDataGrid,v=t.ui.events,tt=v.addNamespace,l=t.utils,e=s.getIndexByKey,it="dx-link",y="dx-editor-cell",p="dx-selection",w="dx-edit-row",b="dx-edit-button",a="__DX_INSERT_INDEX__",k="dx-row",rt="dx-row-removed",ut="dx-row-inserted",ft="dx-row-modified",d="dx-cell-modified",g="dx-highlight-outline",et="dxDataGridEditing",ot="dx-datagrid-focus-overlay",st="dx-datagrid-readonly",ht="dx-data-row",ct="dx-checkbox",lt="dx-editor-inline-block",nt="dx-cell-focus-disabled",u="batch",r="row",o="cell",f="insert",h="update",c="remove",at="dx-pointer-events-none",vt="dx-pointer-events-target",i=function(n){var t=n.option("editing.editMode");return t===u||t===o?t:r};s.EditingController=s.ViewController.inherit(function(){var s=function(t){return function(i,r){var u=n("<div/>").appendTo(i);t.getController("editorFactory").createEditor(u,n.extend({},r.column,{value:r.value,setValue:r.setValue,row:r.row,parentType:"dataRow",width:null,readOnly:r.setValue===undefined}))}};return{init:function(){var t=this;if(t._insertIndex=1,t._editRowIndex=-1,t._editData=[],t._editColumnIndex=-1,t._columnsController=t.getController("columns"),t._dataController=t.getController("data"),t.createAction("onInitNewRow",{excludeValidators:["disabled","readOnly"]}),t.createAction("onRowInserting",{excludeValidators:["disabled","readOnly"]}),t.createAction("onRowInserted",{excludeValidators:["disabled","readOnly"]}),t.createAction("onEditingStart",{excludeValidators:["disabled","readOnly"]}),t.createAction("onRowUpdating",{excludeValidators:["disabled","readOnly"]}),t.createAction("onRowUpdated",{excludeValidators:["disabled","readOnly"]}),t.createAction("onRowRemoving",{excludeValidators:["disabled","readOnly"]}),t.createAction("onRowRemoved",{excludeValidators:["disabled","readOnly"]}),t._dataChangedHandler||(t._dataChangedHandler=n.proxy(t._handleDataChanged,t),t._dataController.changed.add(t._dataChangedHandler)),!t._saveEditorHandler){t._saveEditorHandler=t.createAction(function(u){var f=u.jQueryEvent,s,c,l,a,e,v,o,h,y;i(t)!==r&&t.isEditing()&&!t._editCellInProgress&&(c=n(f.target).closest(".dx-overlay-wrapper").length,l=n(f.target).closest(document).length,a=n(f.target).hasClass(ot),h=n(f.target).closest("."+ht).length,s=t._columnsController.getVisibleColumns(),e=n(f.target).closest("."+k+"> td"),o=e[0]&&e[0].cellIndex,y=t.getView("rowsView").getRowIndex(e.parent()),v=s[o]&&s[o].allowEditing,h&&(!h||v||t.isEditCell(y,o))||c||a||!l||t.closeEditCell())});n(document).on("dxclick",t._saveEditorHandler)}t._updateEditColumn(),t._updateEditButtons()},_handleDataChanged:function(t){this.option("scrolling.mode")==="standard"&&this.resetRowAndPageIndeces(),t.changeType==="prepend"&&n.each(this._editData,function(n,i){i.rowIndex+=t.items.length,i.type===f&&(i.key.rowIndex+=t.items.length)})},getEditMode:function(){return i(this)},getFirstEditableColumnIndex:function(){var i=this.getController("columns"),r=i.getVisibleColumns(),t;return n.each(r,function(n,i){if(i.allowEditing)return t=n,!1}),t},getFirstEditableCellInRow:function(n){return this.getView("rowsView").getCellElement(n?n:0,this.getFirstEditableColumnIndex())},getFocusedCellInRow:function(n){return this.getFirstEditableCellInRow(n)},getIndexByKey:function(n,t){return e(n,t)},hasChanges:function(){var i=this,t=!1;return n.each(i._editData,function(n,i){t=t||!!i.type}),t},dispose:function(){this.callBase(),n(document).off("dxclick",this._saveEditorHandler)},optionChanged:function(n){n.name==="editing"?(this.init(),n.handled=!0):this.callBase(n)},publicMethods:function(){return["insertRow","editRow","editCell","closeEditCell","removeRow","saveEditData","undeleteRow","cancelEditData"]},refresh:function(){i(this)===r||i(this)===o?this.init():(this._editRowIndex=-1,this._editColumnIndex=-1)},isEditing:function(){return this._editRowIndex>-1},isEditRow:function(n){return i(this)===r&&this._editRowIndex===n},isEditCell:function(n,t){return this._editRowIndex===n&&this._editColumnIndex===t},_needInsertItem:function(n,t){var u=this,i=u._dataController.dataSource(),o=u.option("scrolling.mode"),r=i.pageIndex(),f=i.beginPageIndex?i.beginPageIndex():r,e=i.endPageIndex?i.endPageIndex():r;if(o!=="standard")switch(t){case"append":return n.key.pageIndex===e;case"prepend":return n.key.pageIndex===f;case"refresh":n.key.rowIndex=0,n.key.pageIndex=0;break;default:return n.key.pageIndex>=f&&n.key.pageIndex<=e}return n.key.pageIndex===r},processItems:function(n,t){var e=this,i,r,o,u=e._editData;for(e.update(),i=0;i<u.length;i++)r=u[i].key,o={key:r},u[i].type===f&&e._needInsertItem(u[i],t)&&(o[a]=r[a],n.splice(r.rowIndex,0,o));return n},processDataItem:function(t,r,o){var l=this,v,y,s,p=t.data[a]?t.data.key:t.key,w=i(l);if(v=e(p,l._editData),v>=0){y=l._editData[v],s=y.data;switch(y.type){case f:t.inserted=!0,t.key=p,t.data=s;break;case h:t.modified=!0,t.data=n.extend(!0,{},t.data,s),t.modifiedValues=o(s,r);break;case c:w===u&&(t.data=n.extend(!0,{},t.data,s)),t.removed=!0}}},insertRow:function(){var n=this,e=n._dataController,s=n.getView("rowsView"),r={data:{}},t={pageIndex:e.pageIndex(),rowIndex:s?s.getTopVisibleItemIndex():0},l=n._editRowIndex,h=i(n),c;if(h===o&&n.hasChanges()&&n.saveEditData(),n.refresh(),h!==u){if(n._insertIndex>1)return;n._editRowIndex=t.rowIndex}n.executeAction("onInitNewRow",r),t[a]=n._insertIndex++,n._addEditData({key:t,data:r.data,type:f}),e.updateItems({changeType:"update",rowIndices:[l,t.rowIndex]}),c=n.getFirstEditableCellInRow(t.rowIndex),n._delayedInputFocus(c,function(){var i=n.getFirstEditableCellInRow(t.rowIndex);i&&i.trigger("dxclick")}),n._afterInsertRow({key:t,data:r.data})},_isEditingStart:function(n){return this.executeAction("onEditingStart",n),n.cancel},editRow:function(n){var t=this,u=t._dataController,f=u.items(),i=f[n],e={data:i.data,cancel:!1},o=t._editRowIndex,r;if(n===o)return!0;(i.inserted||(e.key=i.key),t._isEditingStart(e))||(t.init(),t._pageIndex=u.pageIndex(),t._editRowIndex=f[0].inserted?n-1:n,t._addEditData({data:{},key:i.key,oldData:i.data}),u.updateItems({changeType:"update",rowIndices:[o,n]}),r=t.getFocusedCellInRow(t._editRowIndex),t._delayedInputFocus(r,function(){r&&t.component.focus(r)}))},editCell:function(n,t){var u=this,s=u._dataController,v=s.items(),f=v[n],e={data:f&&f.data,cancel:!1,column:u._columnsController.getVisibleColumns()[t]},h=i(u),y=u._editRowIndex,c=u._editColumnIndex,l=u._columnsController.getVisibleColumns(),p=e.column&&e.column.showEditorAlways,a;return e.column&&f&&f.rowType==="data"&&!f.removed&&h!==r?u.isEditCell(n,t)?!0:h===o&&!f.inserted&&u.hasChanges()&&(u.saveEditData(),u.hasChanges())?!0:(f.inserted||(e.key=f.key),u._isEditingStart(e))?!0:(u._editRowIndex=n,u._editColumnIndex=t,u._pageIndex=s.pageIndex(),u._addEditData({data:{},key:f.key,oldData:f.data}),p&&(!l[c]||l[c].showEditorAlways)||(u._editCellInProgress=!0,s.updateItems({changeType:"update",rowIndices:[y,u._editRowIndex]})),a=u.getView("rowsView").getCellElement(u._editRowIndex,u._editColumnIndex),u._delayedInputFocus(a,function(){u._editCellInProgress=!1}),!0):!1},_delayedInputFocus:function(n,t){setTimeout(function(){t&&t(),n.find("[tabindex], input").focus()})},removeRow:function(n){var i=this,r=i.option("editing"),o=r&&r.texts,h=o&&o.confirmDeleteTitle,v=r&&r.editMode===u,y=o&&o.confirmDeleteMessage,p=i._dataController,a,w,k=i._editRowIndex,s=p.items()[n],b=s&&s.key;s&&(a=function(t){i.refresh();var r=e(t,i._editData);r>=0?i._editData[r].type===f?i._editData.splice(r,1):i._editData[r].type=c:i._addEditData({key:t,oldData:s.data,type:c}),v?p.updateItems({changeType:"update",rowIndices:[k,n]}):i.saveEditData()},v||!y?a(b):(w=l.isDefined(h)&&h.length>0,t.ui.dialog.confirm(y,h,w).done(function(n){n&&a(b)})))},undeleteRow:function(t){var i=this,o=i._dataController,u=o.items()[t],s=i._editRowIndex,c=u&&u.key,r,f;u&&(r=e(c,i._editData),r>=0&&(f=i._editData[r],n.isEmptyObject(f.data)?i._editData.splice(r,1):f.type=h,o.updateItems({changeType:"update",rowIndices:[s,t]})))},_saveEditDataCore:function(t,i){var r=this,u=r._dataController.store();n.each(r._editData,function(e,o){var y=o.data,p=o.oldData,l=o.key,w=o.type,a,v,s;if(!r._beforeSaveEditData(o,e)){switch(w){case c:if(s={data:p,key:l,cancel:!1},r.executeAction("onRowRemoving",s),s.cancel)return;a=u.remove(l);break;case f:if(s={data:y,cancel:!1},r.executeAction("onRowInserting",s),s.cancel)return;a=u.insert(s.data);break;case h:if(s={newData:y,oldData:p,key:l,cancel:!1},r.executeAction("onRowUpdating",s),s.cancel)return;a=u.update(l,s.newData)}a&&(v=n.Deferred(),a.always(function(){i.push(l)}).always(v.resolve),t.push(v.promise()))}})},_processSaveEditDataResult:function(n,t){for(var r=this,c=r._dataController,f,s,h,l=i(r),o=0;o<n.length;o++)if(f=n[o],s=e(t[o],r._editData),r._editData[s])if(h=f&&f instanceof Error,h){if(r._editData[s].error=f,c.dataErrorOccurred.fire(f),l!==u)return!1}else r._editData.splice(s,1);return!0},_fireSaveEditDataEvents:function(t){var i=this;n.each(t,function(t,r){var e=r.data,o=r.key,s=r.type,u={key:o,data:e};r.error&&(u.error=r.error);switch(s){case c:i.executeAction("onRowRemoved",n.extend({},u,{data:r.oldData}));break;case f:i.executeAction("onRowInserted",u);break;case h:i.executeAction("onRowUpdated",u)}})},saveEditData:function(){var t=this,f=[],u=[],e=t._dataController,o=t._editRowIndex,h=n.extend({},t._editData),c=i(t),s=function(n){n._editColumnIndex=-1,n._editRowIndex=-1};if(t._beforeSaveEditData()){t._afterSaveEditData();return}if(t._saveEditDataCore(u,f),u.length){n.when.apply(n,u).done(function(){t._processSaveEditDataResult(arguments,f)&&(s(t),n.when(e.refresh()).always(function(){t._fireSaveEditDataEvents(h),t._afterSaveEditData()}))});return}c===r?t.hasChanges()||t.cancelEditData():(s(t),e.updateItems(o>=0&&{changeType:"update",rowIndices:[o]})),t._afterSaveEditData()},_updateEditColumn:function(){var n=this,t=n.option("editing"),u=t&&((t.editEnabled||t.insertEnabled)&&i(n)===r||t.removeEnabled);n._columnsController.addCommandColumn({command:"edit",visible:u,cssClass:"dx-command-edit",width:"auto"}),n._columnsController.columnOption("command:edit","visible",u)},_updateEditButtons:function(){var n=this,t=n._saveChangesButton,i=n._cancelChangesButton,r=n.hasChanges();t&&t.option("disabled",!r),i&&i.option("disabled",!r)},cancelEditData:function(){var n=this,t=n._dataController;n._beforeCancelEditData(),n.init(),t.updateItems()},closeEditCell:function(){var n=this,t=i(n),u=n._editRowIndex,f=n._dataController;t!==r&&setTimeout(function(){t===o&&n.hasChanges()?n.saveEditData():u>=0&&(n._editRowIndex=-1,n._editColumnIndex=-1,f.updateItems({changeType:"update",rowIndices:[u]}))})},update:function(){var n=this,t=n._dataController;n._pageIndex!==t.pageIndex()&&(n.refresh(),n._pageIndex=t.pageIndex()),n._updateEditButtons()},updateFieldValue:function(n,t){var i=this,r={},u=n.key,f=n.cellElement,e;u!==undefined&&n.column.setCellValue&&(f&&f.addClass(d),n.value=t,n.column.setCellValue(r,t),e={data:r,key:u,oldData:n.data,type:h},i._addEditData(e),i._updateEditButtons())},_addEditData:function(n){var t=this,i=e(n.key,t._editData);return i<0&&(i=t._editData.length,t._editData.push(n)),t._editData[i]&&(n.type=t._editData[i].type||n.type,l.deepExtendArraySafe(t._editData[i],{data:n.data,type:n.type})),i},getColumnTemplate:function(t){var u=this,f=t.column,v=t.row&&t.row.rowIndex,c,o,e,p=u.option("editing.editEnabled"),h=i(u)===r,a=u.isEditRow(v),y=u.isEditCell(v,t.columnIndex);return(f.showEditorAlways||f.setCellValue&&(a&&f.allowEditing||y))&&t.rowType==="data"&&!l.isDefined(f.command)?(((p||a)&&f.allowEditing||y)&&(h&&a||!h)&&(t.setValue=function(n){u.updateFieldValue(t,n)}),c=f.editCellTemplate||s(u)):f.command==="edit"&&t.rowType==="data"&&(c=function(t,i){var r=function(t,i,r,f){var e=n("<a />").addClass(it).text(i).on(tt("dxclick",et),u.createAction(function(n){var t=n.jQueryEvent;t.stopPropagation(),setTimeout(function(){f.row&&u[r](f.row.rowIndex)})}));f.rtlEnabled?t.prepend(e,"&nbsp;"):t.append(e,"&nbsp;")};t.css("text-align","center"),i.rtlEnabled=u.option("rtlEnabled"),o=u.option("editing")||{},e=o.texts||{},i.row&&i.row.rowIndex===u._editRowIndex&&h?(r(t,e.saveRowChanges,"saveEditData",i),r(t,e.cancelRowChanges,"cancelEditData",i)):(o.editEnabled&&h&&r(t,e.editRow,"editRow",i),o.removeEnabled&&(i.row.removed?r(t,e.undeleteRow,"undeleteRow",i):r(t,e.deleteRow,"removeRow",i)))}),c},renderEditButtons:function(t){var r=this,s=t.find("."+b),f=r.option("editing")||{},e=r.option("editing.texts")||{},h={cancel:e.cancelAllChanges,save:e.saveAllChanges,addrow:e.addRow},o=function(t,i,u){return n("<div />").addClass(b).addClass("dx-datagrid-"+i+"-button").appendTo(t).dxButton({icon:"edit-button-"+i,onClick:function(n){var t=n.jQueryEvent;t.stopPropagation(),r[u]()},hint:h&&h[i]}).dxButton("instance")};s.length&&s.remove(),(f.editEnabled||f.insertEnabled||f.removeEnabled)&&i(r)===u&&(r._cancelChangesButton=o(t,"cancel","cancelEditData"),r._saveChangesButton=o(t,"save","saveEditData"),r._updateEditButtons()),f.insertEnabled&&o(t,"addrow","insertRow")},createHighlightCell:function(t){var i=t.find("."+g);i.length||t.wrapInner(n("<div>").addClass(g+" "+vt))},resetRowAndPageIndeces:function(t){var i=this;n.each(i._editData,function(n,r){(r.pageIndex!==i._pageIndex||t)&&(delete r.pageIndex,delete r.rowIndex)})},_afterInsertRow:function(){},_beforeEditCell:function(){},_beforeSaveEditData:function(){},_afterSaveEditData:function(){},_beforeCancelEditData:function(){}}}()),s.registerModule("editing",{defaultOptions:function(){return{editing:{editMode:"row",insertEnabled:!1,editEnabled:!1,removeEnabled:!1,texts:{editRow:Globalize.localize("dxDataGrid-editingEditRow"),saveAllChanges:Globalize.localize("dxDataGrid-editingSaveAllChanges"),saveRowChanges:Globalize.localize("dxDataGrid-editingSaveRowChanges"),cancelAllChanges:Globalize.localize("dxDataGrid-editingCancelAllChanges"),cancelRowChanges:Globalize.localize("dxDataGrid-editingCancelRowChanges"),addRow:Globalize.localize("dxDataGrid-editingAddRow"),deleteRow:Globalize.localize("dxDataGrid-editingDeleteRow"),undeleteRow:Globalize.localize("dxDataGrid-editingUndeleteRow"),confirmDeleteMessage:Globalize.localize("dxDataGrid-editingConfirmDeleteMessage"),confirmDeleteTitle:Globalize.localize("dxDataGrid-editingConfirmDeleteTitle")}}}},controllers:{editing:s.EditingController},extenders:{controllers:{data:{init:function(){this._editingController=this.getController("editing"),this.callBase()},reload:function(){var n,t=this.getController("editing");return this._editingController.refresh(),n=this.callBase(),n&&n.done(function(){t.resetRowAndPageIndeces(!0)})},_processItems:function(n,t){return n=this._editingController.processItems(n,t),this.callBase(n,t)},_processDataItem:function(n,t){return this._editingController.processDataItem(n,t.visibleColumns,this._generateDataValues),this.callBase(n,t)},_processItem:function(n,t){return n=this.callBase(n,t),n.inserted&&(t.dataIndex--,delete n.dataIndex),n}},columnsResizer:{_startResizing:function(n){var t=this,i=t.getController("editing"),u=function(){var n=t.option("editing");return n&&n.editMode!==r&&i.isEditing()};t.callBase(n),t.isResizing()&&u()&&i.closeEditCell()}}},views:{rowsView:{_getColumnTemplate:function(n){var t=this,i=t.getController("editing").getColumnTemplate(n);return i||t.callBase(n)},_createTable:function(){var n=this,t=n.option("editing"),i=n.callBase.apply(n,arguments);if(t&&t.editMode!==r&&t.editEnabled)i.on(v.addNamespace("dxhold","dxDataGridRowsView"),"td:not(."+y+")",n.createAction(function(){var i=n.getController("editing");i.isEditing()&&i.closeEditCell()}));return i},_createRow:function(n){var t=this.callBase(n),o,r,f,e,s;return n&&(o=this.getController("editing"),r=o.isEditRow(n.rowIndex),f=!!n.removed,e=!!n.inserted,s=!!n.modified,i(this)===u?t.toggleClass(rt,f):t.toggleClass(w,r),t.toggleClass(ut,e),t.toggleClass(ft,s),(r||e||f)&&t.removeClass(p)),t},_rowClick:function(t){var i=this,r=i.getController("editing"),f=n(t.jQueryEvent.target).closest("."+k+"> td"),u=i.getCellIndex(f),o=i.option("editing.editEnabled"),e=i._columnsController.getVisibleColumns()[u],s=e&&(e.allowEditing||r.isEditCell(t.rowIndex,u));f.hasClass(at)||o&&s&&r.editCell(t.rowIndex,u)||r.isEditRow(t.rowIndex)||i.callBase(t)},_cellPrepared:function(n,t){var c=t.columnIndex,i=this.getController("editing"),s=i.getEditMode(),h=!!t.column.command,r=t.setValue,f,e;t.isEditing=i.isEditCell(t.rowIndex,t.columnIndex)||i.isEditRow(t.rowIndex)&&t.column.allowEditing,!l.isDefined(t.column.command)&&(t.isEditing||t.column.showEditorAlways)&&(f=t.column.alignment,n.addClass(y).toggleClass(st,!r).toggleClass(nt,!r),f&&n.find("input").first().css("text-align",f)),n.children("."+ct).length===1&&n.addClass(lt).toggleClass(nt,h||!r),(s===u||s===o&&t.row.inserted)&&(e=t.row&&(t.row.inserted?t.row.values:t.row.modifiedValues),e&&e[c]!==undefined&&t.column&&!h?(i.createHighlightCell(n),n.addClass(d)):r&&i.createHighlightCell(n,!0)),this.callBase.apply(this,arguments)},_update:function(n){this.callBase(n),n.changeType==="updateSelection"&&this.getTableElements().children("tbody").children("."+w).removeClass(p)}},headerPanel:{_renderCore:function(){this.callBase(),this.getController("editing").renderEditButtons(this.element())},isVisible:function(){var t=this,n=t.getController("editing").option("editing");return t.callBase()||n&&(n.insertEnabled||(n.editEnabled||n.removeEnabled)&&n.editMode===u)}}}}})}(jQuery,DevExpress),function(n,t){var i=t.ui.dxDataGrid,r=t.utils,o="dx-datagrid-invalid",s="dx-invalid-message",h="dx-invalid-message-always",u="__DX_INSERT_INDEX__",f="row",e="batch",c="cell";i.ValidatingController=i.Controller.inherit(function(){return{init:function(){this._editingController=this.getController("editing"),this.createAction("onRowValidating")},_rowValidating:function(n,t){var r=this,u=t?t.brokenRules||t.brokenRule&&[t.brokenRule]:[],f=t?t.isValid:n.isValid,i={brokenRules:u,isValid:f,key:n.key,newData:n.data,oldData:n.oldData,errorText:null};return r.executeAction("onRowValidating",i),n.isValid=i.isValid,n.errorText=i.errorText,i},validate:function(t){var i=this,r=!0,u=i._editingController;return(t=t||u.getEditMode()===f,i._isValidationInProgress)?!1:(i._isValidationInProgress=!0,t?n.each(u._editData,function(t,f){var e;f.type&&(e=i.validateGroup(f),e.isValid||n.each(e.brokenRules,function(){this.validator.option("adapter").getValue()===undefined&&u.updateFieldValue({key:f.key,column:this.column},null,!0)}),r=r&&e.isValid)}):i._currentCellValidator&&(r=i.validateGroup(i._currentCellValidator._findGroup()).isValid),i._isValidationInProgress=!1,r)},validateGroup:function(n){var u=this,i=t.validationEngine.getGroupConfig(n),r;return i&&i.validators.length&&(r=t.validationEngine.validateGroup(n)),u._rowValidating(n,r)},updateEditData:function(n){this.setDisableApplyValidationResults(!0),n.isValid=t.validationEngine.getGroupConfig(n)?t.validationEngine.validateGroup(n).isValid:!0,this.setDisableApplyValidationResults(!1)},setValidator:function(n){this._currentCellValidator=n},getValidator:function(){return this._currentCellValidator},removeValidators:function(i){var u=this,f=u._editingController;n.each(f._editData,function(n,u){var e=t.validationEngine.getGroupConfig(u),f;if((!r.isDefined(i)||i===n)&&e)for(f=0;f<e.validators.length;f++)e.validators[f]._dispose(),f--})},createValidator:function(i,r){var s=this,u=s._editingController,f=i.column,h,e=u.getIndexByKey(i.key,u._editData),c=function(n){if(n.brokenRule&&(n.brokenRule.columnIndex=f.index,n.brokenRule.column=f),r&&!s.getDisableApplyValidationResults()){if(!n.isValid){var t=r.find(":focus");u.createHighlightCell(r,!0),t.is(":focus")||t.focus().trigger("dxpointerdown")}r.toggleClass(o,!n.isValid)}};return e<0&&f.showEditorAlways&&(e=u._addEditData({key:i.key})),e>=0?(h=u._editData[e],new t.ui.dxValidator(r||{},{name:f.caption,validationRules:n.extend(!0,[],f.validationRules),validationGroup:h,adapter:{getValue:function(){return i.value},applyValidationResults:c}})):void 0},setDisableApplyValidationResults:function(n){this._disableApplyValidationResults=n},getDisableApplyValidationResults:function(){return this._disableApplyValidationResults}}}()),i.registerModule("validating",{defaultOptions:function(){return{}},controllers:{validating:i.ValidatingController},extenders:{controllers:{editing:{_addEditData:function(n){var t=this,u=t.getController("validating"),i=t.callBase(n),r;return i>=0&&(r=t._editData[i],u.updateEditData(r)),i},_updateRowAndPageIndices:function(){var t=this,i=t.getView("rowsView").getTopVisibleItemIndex(),r=i;n.each(t._editData,function(n,u){u.isValid||u.pageIndex===t._pageIndex||(u.pageIndex=t._pageIndex,u.rowIndex=u.type==="insert"?i:r,r++)})},processItems:function(t,r){var f=this,l=f.getController("data"),o,s=f._editData,h=t.length,c=0,a=function(t,r){var u=-1,f=t.type==="insert",e=t.key;return n.each(r,function(n,t){if(i.equalKeys(e,f?t:l.keyOf(t)))return u=n,!1}),u},v=function(n){var e={key:n.key},i=a(n,t),r;i>=0&&f.option("scrolling.mode")==="standard"||(n.rowIndex=n.rowIndex>h?n.rowIndex%h:n.rowIndex,r=n.rowIndex,e[u]=1,i>=0&&(t.splice(i,1),r-=c),t.splice(r,0,e),c++)};if(f.update(),f.getEditMode()===e&&r!=="prepend"&&r!=="append")for(o=0;o<s.length;o++)s[o].type&&s[o].pageIndex===f._pageIndex&&s[o].key.pageIndex!==f._pageIndex&&v(s[o]);return f.callBase(t,r)},processDataItem:function(t){var o=this,h,s,l=t.data[u],c=l?t.data.key:t.key,a=o.getEditMode();a===e&&l&&c&&(h=i.getIndexByKey(c,o._editData),h>=0&&(s=o._editData[h],s.type!=="insert"&&(t.data=n.extend(!0,{},s.oldData,s.data),t.key=c))),o.callBase.apply(o,arguments)},_afterInsertRow:function(t){var i=this.getController("validating"),u=this.getController("columns").getHiddenColumns();n.each(u,function(n,u){r.isArray(u.validationRules)&&i.createValidator({column:u,key:t.key,value:t.data[u.dataField]})}),this.callBase(t)},_beforeSaveEditData:function(n,t){var i=this,e,o,u=i.callBase.apply(i,arguments),s=i.getController("validating");return n?(e=n.type==="remove"||n.isValid,e?s.removeValidators(t):r.isDefined(i._hasInvalidRules)&&(i._hasInvalidRules=!0),u=u||!e):(o=s.validate(!0),i._updateRowAndPageIndices(),i.getEditMode()===c?(e=s.validate(),e&&i._hasInvalidRules?(i.cancelEditData(),i._hasInvalidRules=!1,u=!0):o||(i._hasInvalidRules=!0,u=!0)):i.getEditMode()===f&&(u=!o)),u},_afterSaveEditData:function(){var t=this;n.each(t._editData,function(n,i){t._showErrorRow(i)})},_beforeCancelEditData:function(){var n=this.getController("validating");n.removeValidators(),this.callBase()},_showErrorRow:function(n){var t=this.getController("errorHandling"),r=this.getController("data").items(),i=this.getIndexByKey(n.key,r);!n.isValid&&n.errorText&&i>=0&&t&&t.renderErrorRow(n.errorText,i)},createHighlightCell:function(n,t){var r=!0,i;t||(i=n.data("dxValidator"),i&&(r=i.validate().isValid)),r&&this.callBase(n)},updateFieldValue:function(n,t,i){var r=this;r.callBase.apply(r,arguments),i||(r._hasInvalidRules=!1)}},editorFactory:{loseFocus:function(n){n||this.getController("validating").setValidator(null),this.callBase()},focus:function(t){var f=this,o=!1,r=f.getView("rowsView"),i=t&&t.closest("td"),e=i&&i.data("dxValidator"),y=f.getController("validating"),l=i&&i.closest(".dx-datagrid-rowsview").find(".dx-tooltip"),a=i&&f.getController("columns").getVisibleColumns()[i.index()],v,c,u;return l&&l.remove(),e&&a&&(v=e.option("adapter").getValue(),y.setValidator(e),v!==undefined&&(c=e.validate(),c.isValid||(u=a.alignment,o=!0,n("<div/>").addClass(s).addClass(h).text(c.brokenRule.message).appendTo(i).dxTooltip({target:i,container:i,visible:!0,closeOnOutsideClick:!1,closeOnTargetScroll:!1,arrowPosition:u==="left"?"start":"end",arrowOffset:u==="left"?5:-5,position:{collision:"fit flip",boundary:r.element(),boundaryOffset:"0 0",offset:"1 -10",my:"top "+u,at:"bottom "+u},onPositioned:function(){r.element()&&r.updateFreeSpaceRowHeight()}})))),!o&&r.element()&&r.updateFreeSpaceRowHeight(),f.callBase(t,o)}}},views:{rowsView:{updateFreeSpaceRowHeight:function(){var n=this,u=n._getRowElements(),t=n._getFreeSpaceRowElements(),i=t.first(),r=n.element().find(".dx-invalid-message .dx-overlay-content");n.callBase(),r.length&&i&&u.length===1&&(!i.is(":visible")||r.outerHeight()>i.outerHeight())&&(t.show(),t.height(r.outerHeight()))},_cellPrepared:function(n,t){var i=this.getController("validating"),u=t.column;r.isArray(u.validationRules)&&i.createValidator(t,n),this.callBase.apply(this,arguments)}}}}})}(jQuery,DevExpress),function(n,t,i){var u=t.ui,r=u.dxDataGrid,f=t.utils;r.proxyMethod=function(n,t,i){n[t]||(n[t]=function(){var n=this._dataSource;return n?n[t].apply(n,arguments):i})},r.combineFilters=function(n,t){var i=[],r;for(t=t||"and",r=0;r<n.length;r++)n[r]&&(i.length&&i.push(t),i.push(n[r]));return i.length===1&&(i=i[0]),i.length?i:void 0},r.DataController=r.Controller.inherit({}).include(u.DataHelperMixin).inherit(function(){var u={init:function(){var t=this;t._items=[],t._columnsController=t.getController("columns"),t._columnsChangedHandler=n.proxy(t._handleColumnsChanged,t),t._dataChangedHandler=n.proxy(t._handleDataChanged,t),t._loadingChangedHandler=n.proxy(t._handleLoadingChanged,t),t._loadErrorHandler=n.proxy(t._handleLoadError,t),t._customizeStoreLoadOptionsHandler=n.proxy(t._handleCustomizeStoreLoadOptions,t),t._columnsController.columnsChanged.add(t._columnsChangedHandler),t._isLoading=!1,t._isCustomLoading=!1,t._refreshDataSource(),t.createAction("onDataErrorOccurred"),t.dataErrorOccurred.add(function(n){return t.executeAction("onDataErrorOccurred",{error:n})})},callbackNames:function(){return["changed","loadingChanged","dataErrorOccurred","pageChanged","dataSourceChanged"]},callbackFlags:function(n){if(n==="dataErrorOccurred")return"stopOnFalse"},publicMethods:function(){return["beginCustomLoading","endCustomLoading","refresh","filter","clearFilter","getCombinedFilter","keyOf","byKey","getDataByKeys","pageIndex","pageSize","pageCount","totalCount","_disposeDataSource","getKeyByRowIndex","getRowIndexByKey"]},optionChanged:function(n){function i(){n.handled=!0}function r(){t._columnsController.reset(),t._refreshDataSource()}var t=this;if(n.name==="dataSource"&&n.name===n.fullName&&n.value===n.previousValue){i(),t.refresh();return}switch(n.name){case"loadingTimeout":case"remoteOperations":i();break;case"dataSource":case"scrolling":case"paging":i(),r();break;case"rtlEnabled":r();break;default:t.callBase(n)}},isReady:function(){return!this._isLoading},getCombinedFilter:function(){return this.combinedFilter()},combinedFilter:function(n){var t=this,u=t._dataSource,f=t._columnsController,e;return u&&(n===i&&(n=u.filter()),e=t._calculateAdditionalFilter(),e&&(f.isDataSourceApplied()||f.isAllDataTypesDefined())&&(n=r.combineFilters([e,n])),u.remoteOperations().filtering||f.updateFilter(n)),n},_handleCustomizeStoreLoadOptions:function(n){var i=this._columnsController,r=this._dataSource,t=n.storeLoadOptions;this._isLoadingAll&&(t.isLoadingAll=!0,delete t.skip,delete t.take),t.filter=this.combinedFilter(t.filter),i.isDataSourceApplied()||i.updateColumnDataTypes(r),this._columnsUpdating=!0,i.updateSortingGrouping(r,!this._isFirstLoading),this._columnsUpdating=!1,t.sort=i.getSortDataSourceParameters(),t.group=i.getGroupDataSourceParameters(),r.sort(t.sort),r.group(t.group),t.sort=i.getSortDataSourceParameters(!r.remoteOperations().sorting),n.group=i.getGroupDataSourceParameters(!0),this._isFirstLoading=!1},_handleColumnsChanged:function(n){var t=this,e=n.changeTypes,u=n.optionNames,o,s,h=function(){t._columnsController.columnsChanged.remove(h),t.updateItems()};e.sorting||e.grouping?(t._dataSource&&!t._columnsUpdating&&(t._dataSource.group(t._columnsController.getGroupDataSourceParameters()),t._dataSource.sort(t._columnsController.getSortDataSourceParameters()),t.reload()),t.pageChanged.fire()):e.columns&&((u.filterValues||u.filterValue||u.selectedFilterOperation)&&(this.option("filterRow.applyFilter")!=="onClick"||u.filterValues)&&(o=t._columnsController.columnOption(n.columnIndex,"filterValue"),s=t._columnsController.columnOption(n.columnIndex,"filterValues"),(f.isArray(s)||n.columnIndex===i||f.isDefined(o)||!u.selectedFilterOperation||u.filterValue)&&t._applyFilter()),t._needApplyFilter||r.checkChanges(u,["width","visibleWidth","filterValue","selectedFilterOperation","filterValues"])||t._columnsController.columnsChanged.add(h))},_handleDataChanged:function(i){var r=this,u=r._dataSource,f=r._columnsController,e=f.isAllDataTypesDefined();!u||r._isDataSourceApplying||r._isLoadingAll||(r._isDataSourceApplying=!0,n.when(r._columnsController.applyDataSource(u)).done(function(){r._isLoading&&r._handleLoadingChanged(!1),r._isDataSourceApplying=!1;var n=r._calculateAdditionalFilter(),u=r._needApplyFilter;r._needApplyFilter=!1,u&&n&&n.length&&!e?(t.log("W1005",r.component.NAME),r._applyFilter()):r.updateItems(i)}),r._isDataSourceApplying&&r._handleLoadingChanged(!0),r._needApplyFilter=!r._columnsController.isDataSourceApplied())},_handleLoadingChanged:function(n){this._isLoading=n,this._fireLoadingChanged()},_handleLoadError:function(n){this.dataErrorOccurred.fire(n)},_initDataSource:function(){var n=this,t=this.option("dataSource"),r=this.option("paging.pageIndex"),u=this.option("paging.pageSize"),f=n.option("scrolling.mode"),e=this.option("paging.enabled"),o=f==="infinite",h=f==="virtual",s=this._dataSource;n.callBase(),t=n._dataSource,n._isFirstLoading=!0,t?(t.requireTotalCount(!o),e!==i&&t.paginate(e||h||o),u!==i&&t.pageSize(u),r!==i&&t.pageIndex(r),n._dataSource=s,n.setDataSource(t)):s&&n.updateItems()},_loadDataSource:function(){var n=this._dataSource;n&&n.load()},_processItems:function(t){var i=this,u=i._columnsController.getVisibleColumns(),e={visibleColumns:u,dataIndex:0},r=[];return n.each(t,function(n,t){f.isDefined(t)&&(t=i._processItem(t,e),r.push(t))}),r},_processItem:function(n,t){return n=this._generateDataItem(n),n=this._processDataItem(n,t),n.dataIndex=t.dataIndex++,n},_generateDataItem:function(n){return{rowType:"data",data:n,key:this.keyOf(n)}},_processDataItem:function(n,t){return n.values=this._generateDataValues(n.data,t.visibleColumns),n},_generateDataValues:function(t,i){var r=[];return n.each(i,function(){var n=null;this.command?n=null:this.calculateCellValue?n=this.calculateCellValue(t):this.dataField&&(n=t[this.dataField]),r.push(n)}),r},_updateItemsCore:function(t){var i=this,u,l=i._dataSource,f=t.changeType||"refresh",e,s;if(t.changeType=f,l){u=t.items||l.items(),u=i._processItems(u.slice(0),f),t.items=u;switch(f){case"prepend":i._items.unshift.apply(i._items,u);break;case"append":i._items.push.apply(i._items,u);break;case"update":var h=-1,o=t.rowIndices.slice(0),c=0;for(o.sort(function(n,t){return n-t}),e=0;e<o.length;e++)o[e]<0&&(o.splice(e,1),e--);t.items=[],t.rowIndices=[],t.changeTypes=[],s=function(n,t){return r.equalKeys(n.key,t.key)&&n.rowType===t.rowType},n.each(o,function(n,r){var o,e,l,a;(r+=c,h!==r)&&(t.rowIndices.push(r),h=r,o=i._items[r],l=i._items[r+1],e=u[r],a=u[r+1],e&&t.items.push(e),o&&e&&s(o,e)?(f="update",i._items[r]=e,o.visible!==e.visible&&t.items.splice(-1,1,{visible:e.visible})):e&&!o||a&&s(o,a)?(f="insert",i._items.splice(r,0,e),c++):(o&&!e||l&&s(e,l))&&(f="remove",i._items.splice(r,1),c--,h=-1),t.changeTypes.push(f))});break;default:i._items=u.slice(0)}n.each(i._items,function(n,t){t.rowIndex=n})}else i._items=[]},updateItems:function(n){n=n||{},this._updateItemsCore(n),this.changed.fire(n)},isLoading:function(){return this._isLoading||this._isCustomLoading},_fireLoadingChanged:function(n){this.loadingChanged.fire(this.isLoading(),n)},_calculateAdditionalFilter:function(){return null},_applyFilter:function(){var t=this,i=t._dataSource;if(i)return i.pageIndex(0),t.reload().done(n.proxy(t.pageChanged,"fire"))},filter:function(n){var t=this._dataSource;if(arguments.length===0)return t?t.filter():i;n=arguments.length>1?Array.prototype.slice.call(arguments,0):n,t&&t.filter(n),this._applyFilter()},clearFilter:function(n){var t=this,u=t._columnsController,r=function(n){for(var r=u.columnCount(),t=0;t<r;t++)u.columnOption(t,n,i)};if(t.component.beginUpdate(),arguments.length>0)switch(n){case"dataSource":t.filter(null);break;case"search":t.searchByText("");break;case"header":r("filterValues");break;case"row":r("filterValue")}else t.filter(null),t.searchByText(""),r("filterValue"),r("filterValues");t.component.endUpdate()},_fireDataSourceChanged:function(){var n=this,t=function(){n.changed.remove(t),n.dataSourceChanged.fire()};n.changed.add(t)},_getDataSourceAdapterType:function(n){return n&&n.filtering&&n.sorting&&n.paging?r.DataSourceAdapterServer:r.DataSourceAdapterClient},_createDataSourceAdapterCore:function(n,i){var u,r;return i==="auto"&&(i=!(n.store()instanceof t.data.ArrayStore)),i===!0&&(i={filtering:!0,sorting:!0,paging:!0}),u=this._getDataSourceAdapterType(i),r=new u(this.component),r.init(n,i),r},_createDataSourceAdapter:function(n){var t=this.option("remoteOperations");return this._createDataSourceAdapterCore(n,t)},setDataSource:function(n){var t=this,i=t._dataSource;i&&(i.changed.remove(t._dataChangedHandler),i.loadingChanged.remove(t._loadingChangedHandler),i.loadError.remove(t._loadErrorHandler),i.customizeStoreLoadOptions.remove(t._customizeStoreLoadOptionsHandler),i.dispose(t._isSharedDataSource)),n&&(n=t._createDataSourceAdapter(n)),t._dataSource=n,n&&(t._fireDataSourceChanged(),t._isLoading=!n.isLoaded(),t._needApplyFilter=!0,n.changed.add(t._dataChangedHandler),n.loadingChanged.add(t._loadingChangedHandler),n.loadError.add(t._loadErrorHandler),n.customizeStoreLoadOptions.add(t._customizeStoreLoadOptionsHandler))},items:function(){return this._items},isEmpty:function(){return!this.items().length},pageCount:function(){return this._dataSource?this._dataSource.pageCount():1},dataSource:function(){return this._dataSource},store:function(){var n=this._dataSource;return n&&n.store()},loadAll:function(t){var i=this,r=n.Deferred(),u=i._dataSource,f;return u?t?(f={data:t,loadOptions:{isLoadingAll:!0,group:u.group(),sort:u.sort()}},u._handleDataLoaded(f),r.resolve(i._processItems(f.data),f.totalAggregates)):i.isLoading()?r.reject():(i._isLoadingAll=!0,u.load(!0).done(function(n){n=i._processItems(n.slice(0)),r.resolve(n)}).fail(r.reject).always(function(){i._isLoadingAll=!1})):r.resolve([]),r},getKeyByRowIndex:function(n){var t=this.items()[n];if(t)return t.key},getRowIndexByKey:function(n){return r.getIndexByKey(n,this.items())},keyOf:function(n){var t=this.store();if(t)return t.keyOf(n)},byKey:function(t){var i=this.store(),r=this.getRowIndexByKey(t),u;if(i)return r>=0&&(u=n.Deferred().resolve(this.items()[r].data)),u||i.byKey(t)},getDataByKeys:function(t){var f=this,i=n.Deferred(),r=[],u=[];return n.each(t,function(n,t){r.push(f.byKey(t).done(function(t){u[n]=t}))}),n.when.apply(n,r).always(function(){i.resolve(u)}),i},pageIndex:function(t){var u=this,r=u._dataSource;return r?t!==i&&r.pageIndex()!==t?(r.pageIndex(t),r.load().done(n.proxy(u.pageChanged,"fire"))):r.pageIndex():0},pageSize:function(t){var u=this,f=u.option("paging"),r=u._dataSource;return t===i?r?r.pageSize():0:r&&r.pageSize()!==t?(r.pageIndex(0),r.pageSize(t),f&&(f.pageSize=t),r.reload().done(n.proxy(u.pageChanged,"fire"))):void 0},beginCustomLoading:function(n){this._isCustomLoading=!0,this._fireLoadingChanged(n)},endCustomLoading:function(){this._isCustomLoading=!1,this._fireLoadingChanged()},refresh:function(){var i=this,t=n.Deferred();return n.when(this._columnsController.refresh()).always(function(){n.when(i.reload()).done(t.resolve).fail(t.reject)}),t},_disposeDataSource:function(){this.setDataSource(null)}};return r.proxyMethod(u,"load"),r.proxyMethod(u,"reload"),r.proxyMethod(u,"itemsCount",0),r.proxyMethod(u,"totalItemsCount",0),r.proxyMethod(u,"hasKnownLastPage",!0),r.proxyMethod(u,"isLoaded",!1),r.proxyMethod(u,"totalCount",0),u}()),r.registerModule("data",{defaultOptions:function(){return{loadingTimeout:0,dataSource:null,onDataErrorOccurred:null,remoteOperations:"auto",paging:{enabled:!0,pageSize:i,pageIndex:i}}},controllers:{data:u.dxDataGrid.DataController}})}(jQuery,DevExpress),function(n,t){var r=t.ui,i=r.dxDataGrid;i.DataSourceAdapterServer=i.Controller.inherit(function(){return{init:function(t,i){var r=this;r._dataSource=t,r._remoteOperations=i||{},r._isLastPage=!t.isLastPage(),r._hasLastPage=!1,r._currentTotalCount=0,r.changed=n.Callbacks(),r.loadingChanged=n.Callbacks(),r.loadError=n.Callbacks(),r.customizeStoreLoadOptions=n.Callbacks(),r._dataChangedHandler=n.proxy(r._handleDataChanged,r),r._dataLoadingHandler=n.proxy(r._handleDataLoading,r),r._dataLoadedHandler=n.proxy(r._handleDataLoaded,r),r._loadingChangedHandler=n.proxy(r._handleLoadingChanged,r),r._loadErrorHandler=n.proxy(r._handleLoadError,r);t.on("changed",r._dataChangedHandler);t.on("customizeStoreLoadOptions",r._dataLoadingHandler);t.on("customizeLoadResult",r._dataLoadedHandler);t.on("loadingChanged",r._loadingChangedHandler);t.on("loadError",r._loadErrorHandler);n.each(t,function(t,i){!r[t]&&n.isFunction(i)&&(r[t]=function(){return this._dataSource[t].apply(this._dataSource,arguments)})})},remoteOperations:function(){return this._remoteOperations},dispose:function(n){var t=this,i=t._dataSource;i.off("changed",t._dataChangedHandler),i.off("customizeStoreLoadOptions",t._dataLoadingHandler),i.off("customizeLoadResult",t._dataLoadedHandler),i.off("loadingChanged",t._loadingChangedHandler),i.off("loadError",t._loadErrorHandler),n||i.dispose()},refresh:function(n,t){var i=this,r=i._dataSource;t&&(i._currentTotalCount=0,i._isLastPage=!r.paginate(),i._hasLastPage=i._isLastPage)},_handleDataLoading:function(t){var i=this,r;i.customizeStoreLoadOptions.fire(t),t.delay=this.option("loadingTimeout"),t.originalStoreLoadOptions=t.storeLoadOptions,r=!i.isLoaded()&&!i._isRefreshing,i._isRefreshing=!0,n.when(i.refresh(t.storeLoadOptions,r)).always(function(){i._lastOperationId===t.operationId&&i.load(),i._isRefreshing=!1}),i._dataSource.cancel(i._lastOperationId),i._lastOperationId=t.operationId,i._isRefreshing&&i._dataSource.cancel(i._lastOperationId)},_handleDataLoaded:function(n){n.storeLoadOptions=n.originalStoreLoadOptions},_handleLoadingChanged:function(n){this.loadingChanged.fire(n)},_handleLoadError:function(n){this.changed.fire({changeType:"loadError",error:n}),this.loadError.fire(n)},_handleDataChanged:function(n){var t=this,u,i=t._dataSource,r=t.itemsCount();t._isLastPage=!r||!t.pageSize()||r<t.pageSize(),t._isLastPage&&(t._hasLastPage=!0),i.totalCount()>=0?i.pageIndex()>=t.pageCount()&&(i.pageIndex(t.pageCount()-1),i.load()):(u=i.pageIndex()*t.pageSize()+r,t._currentTotalCount=Math.max(t._currentTotalCount,u),r===0&&i.pageIndex()>=t.pageCount()&&(i.pageIndex(t.pageCount()-1),i.load())),i.isLoading()||this.changed.fire(n)},isLastPage:function(){return this._isLastPage},totalCount:function(){return parseInt(this._currentTotalCount||this._dataSource.totalCount())},itemsCount:function(){return this._dataSource.items().length},totalItemsCount:function(){return this.totalCount()},pageSize:function(){var n=this._dataSource;return!arguments.length&&!n.paginate()?0:n.pageSize.apply(n,arguments)},pageCount:function(){var n=this,t=n.totalItemsCount(),i=n.pageSize();return i&&t>0?Math.max(1,Math.ceil(t/i)):1},hasKnownLastPage:function(){return this._hasLastPage||this._dataSource.totalCount()>=0}}}()),i.DataSourceAdapterClient=i.DataSourceAdapterServer.inherit({_handleDataLoading:function(n){this.callBase(n);var i=this._remoteOperations,t=n.loadOptions=n.storeLoadOptions;n.storeLoadOptions={userData:t.userData},i.filtering&&(n.storeLoadOptions.filter=t.filter,delete t.filter),i.sorting&&(n.storeLoadOptions.sort=t.sort,delete t.sort),this._handleDataLoadingCore(n)},_handleDataLoadingCore:function(){},_handleDataLoaded:function(i){var u=this.callBase,r=i.loadOptions;if(!r){this._dataSource.cancel(i.operationId);return}i.skip=r.skip,i.take=r.take,delete r.skip,delete r.take,new t.data.ArrayStore(i.data).load(r).done(function(t){i.data=t,r.requireTotalCount&&(i.extra=n.isPlainObject(i.extra)?i.extra:{totalCount:t.length})}),this._handleDataLoadedCore(i),u.apply(this,arguments)},_handleDataLoadedCore:function(n){n.skip!==undefined&&(n.data=n.data.slice(n.skip)),n.take!==undefined&&(n.data=n.data.slice(0,n.take))}})}(jQuery,DevExpress),function(n,t){var a=t.ui,i=a.dxDataGrid,r=t.utils,u=t.data.utils.normalizeSortingInfo,f="dx-datagrid-group-panel",v="dx-group-panel-message",o="dx-group-panel-item",y="dx-datagrid-group-opened",p="dx-datagrid-group-closed",s="dx-datagrid-expand",w="dx-selection-disabled",h=function(){var i=function(n,t){var i=n.hash;return i&&i[t]},r=function(n,t){for(var i=0;i<n.length;i++)if(n[i].offset>t)break;return i},f=function(n){for(var t,u,i=0;i<n.length;i++)t=n[i],t.data&&t.data.offset!==t.offset&&(n.splice(i,1),t.offset=t.data.offset,u=r(n,t.offset),n.splice(u,0,t),u>i&&i--)},e=function(n,t,i){for(var r=0;r<n.length;r++)t+1>=i?n[r].children=[]:e(n[r].children,t+1,i)};return{init:function(){this.callBase.apply(this,arguments),this.reset()},reset:function(){this._groupsInfo=[],this._totalCountCorrection=0},totalItemsCount:function(){var n=this,t=n.callBase();return t>0&&n._dataSource.group()&&n._dataSource.requireTotalCount()?t+n._totalCountCorrection:t},itemsCount:function(){return this._dataSource.group()?this._itemsCount||0:this.callBase()},updateTotalItemsCount:function(n){this._totalCountCorrection=n||0},_isGroupItemCountable:function(n){return!this._isVirtualPaging()||!n.isContinuation},_isVirtualPaging:function(){var n=this.option("scrolling.mode");return n==="virtual"||n==="infinite"},updateItemsCount:function(n,t){function i(n,t,r){var u,f=0;if(t)if(r)for(u=0;u<t.length;u++)n._isGroupItemCountable(t[u])&&f++,f+=i(n,t[u].items,r-1);else f=t.length;return f}this._itemsCount=i(this,n,t)},foreachGroups:function(t,i,r,u){function e(t,i,o,s){function a(n,t,i,r){var u=t&&n(t,i);return r.push(u),u}for(var l,c=[],h=0;h<t.length;h++){if((s.push(t[h].data),!o&&a(i,t[h].data,s,c)===!1)||(!t[h].data||t[h].data.isExpanded||r)&&(l=e(t[h].children,i,o,s),c.push(l),l===!1)||o&&a(i,t[h].data,s,c)===!1)return!1;t[h].data&&t[h].data.offset===t[h].offset||(u=!0),s.pop()}return u&&n.when.apply(n,c).always(function(){f(t)})}var o=this;return e(o._groupsInfo,t,i,[])},findGroupInfo:function(n){for(var f=this,t,u=f._groupsInfo,r=0;u&&r<n.length;r++)t=i(u,n[r]),u=t&&t.children;return t&&t.data},addGroupInfo:function(n){for(var h=this,s,t,o=n.path,u=h._groupsInfo,e=0;e<o.length;e++)t=i(u,o[e]),t||(t={key:o[e],offset:n.offset,children:[]},s=r(u,n.offset),u.splice(s,0,t),u.hash=u.hash||{},u.hash[t.key]=t),e===o.length-1&&(t.data=n,t.offset!==n.offset&&f(u)),u=t.children},allowCollapseAll:function(){return!0},isRowExpanded:function(n){var t=this.findGroupInfo(n);return t?t.isExpanded:!this.allowCollapseAll()},collapseAll:function(n){return this.allowCollapseAll()?this._collapseExpandAll(n,!1):(t.log("E1018"),!1)},expandAll:function(n){return this._collapseExpandAll(n,!0)},_collapseExpandAll:function(n,t){var e=this,o=e._dataSource,f=o.group(),r=u(f||[]),i;if(r.length){for(i=0;i<r.length;i++)n===undefined||n===i?r[i].isExpanded=t:f&&f[i]&&(r[i].isExpanded=f[i].isExpanded);o.group(r),e.foreachGroups(function(i,r){(n===undefined||n===r.length-1)&&(i.isExpanded=t)},!1,!0)}return!0},refresh:function(n){this.callBase.apply(this,arguments);var i=this,t,f=u(i._group||[]),o=u(n.group||[]),r=Math.min(f.length,o.length);for(i._group=n.group,t=0;t<r;t++)if(f[t].selector!==o[t].selector){r=t;break}r?e(i._groupsInfo,0,r):i.reset()},changeRowExpand:function(n){var i=this,t=i._dataSource;if(t.group())return t._changeLoadingCount(1),i._changeRowExpandCore(n).always(function(){t._changeLoadingCount(-1)})}}}(),c,e,l;i.DataSourceAdapterClient=i.DataSourceAdapterClient.inherit(h),i.DataSourceAdapterServer=i.DataSourceAdapterServer.inherit(h),c=function(){return{init:function(){var n=this;n.callBase(),n.createAction("onRowExpanding"),n.createAction("onRowExpanded"),n.createAction("onRowCollapsing"),n.createAction("onRowCollapsed")},_processItems:function(n,t){var i=this._columnsController.getGroupColumns();return n.length&&i.length&&(n=this._processGroupItems(n,i.length)),this.callBase(n,t)},_processItem:function(n,t){return r.isDefined(n.groupIndex)&&r.isString(n.rowType)&&n.rowType.indexOf("group")===0?(n=this._processGroupItem(n,t),t.dataIndex=0):n=this.callBase.apply(this,arguments),n},_processGroupItem:function(n){return n},_processGroupItems:function(n,t,i){var s=this,o,e,u,f,r;if(i||(o=s.option("scrolling.mode"),i={collectContinuationItems:o!=="virtual"&&o!=="infinite",resultItems:[],path:[]}),f=i.resultItems,r=i.path,i.data&&(i.collectContinuationItems||!i.data.isContinuation)&&f.push({rowType:"group",data:i.data,groupIndex:r.length-1,isExpanded:!!i.data.items,key:r,values:r}),n)if(t===0)f.push.apply(f,n);else for(e=0;e<n.length;e++)u=n[e],u&&(i.data=u,i.path=r.concat(u.key),s._processGroupItems(u.items,t-1,i),i.data=undefined,i.path=r);return f},publicMethods:function(){return this.callBase().concat(["collapseAll","expandAll","isRowExpanded","expandRow","collapseRow"])},collapseAll:function(n){var t=this._dataSource;t&&t.collapseAll(n)&&(t.pageIndex(0),t.reload())},expandAll:function(n){var t=this._dataSource;t&&t.expandAll(n)&&(t.pageIndex(0),t.reload())},changeRowExpand:function(t){var i=this,r=i.isRowExpanded(t),u={key:t,expanded:r};return i.executeAction(r?"onRowCollapsing":"onRowExpanding",u),u.cancel?void 0:n.when(i._changeRowExpandCore(t)).done(function(){u.expanded=!r,i.executeAction(r?"onRowCollapsed":"onRowExpanded",u)})},_changeRowExpandCore:function(t){var u=this,r=this._dataSource,i;if(r)return i=n.Deferred(),n.when(r.changeRowExpand(t)).done(function(){u.load().done(i.resolve).fail(i.reject)}).fail(i.reject),i},isRowExpanded:function(n){var t=this._dataSource;return t&&t.isRowExpanded(n)},expandRow:function(n){this.isRowExpanded(n)||this.changeRowExpand(n)},collapseRow:function(n){this.isRowExpanded(n)&&this.changeRowExpand(n)},optionChanged:function(n){n.name==="grouping"&&(n.name="dataSource"),this.callBase(n)}}}(),e=function(){return{_renderGroupPanel:function(){var i=this,u=i.element(),r=i.option("groupPanel"),t,e=i.getController("columns").getGroupColumns();t=u.find("."+f),r&&r.visible?(t.length?t.show():t=n("<div />").addClass(f).prependTo(u),i._renderGroupPanelItems(t,e),r.allowColumnDragging&&!e.length&&n("<div />").addClass(v).text(r.emptyPanelText).appendTo(t)):t.hide()},_renderGroupPanelItems:function(t,i){var r=this;t.empty(),n.each(i,function(n,i){r._createGroupPanelItem(t,i)})},_createGroupPanelItem:function(t,i){return n("<div />").addClass(i.cssClass).addClass(o).appendTo(t).text(i.caption)},_renderCore:function(){this.callBase.apply(this,arguments),this._renderGroupPanel()},allowDragging:function(n){var t=this.option("groupPanel");return t&&t.visible&&t.allowColumnDragging&&n&&n.allowGrouping},getColumnElements:function(){var n=this.element();return n&&n.find("."+o)},getColumns:function(){return this.getController("columns").getGroupColumns()},getBoundingRect:function(){var i=this,n=i.element(),t;return n&&n.find("."+f).length?(t=n.offset(),{top:t.top,bottom:t.top+n.height()}):null},getName:function(){return"group"},isVisible:function(){return this.callBase()||this.option("groupPanel.visible")},optionChanged:function(n){n.name==="groupPanel"?(this._renderGroupPanel(),n.handled=!0):this.callBase(n)}}}(),i.GroupingHeaderPanelExtender=e,l=function(){return{_rowClick:function(t){var i=this,r=i.getController("data"),f=n(t.jQueryEvent.target).closest("."+s),u;f.length&&(u=r.getKeyByRowIndex(t.rowIndex),r.changeRowExpand(u),t.jQueryEvent.preventDefault(),t.handled=!0),i.callBase(t)},_getDefaultTemplate:function(t){var i=this;return t.command==="expand"?function(t,u){!r.isDefined(u.value)||u.data&&u.data.isContinuation||u.row.inserted||(t.addClass(s).addClass(w),n("<div>").addClass(u.value?y:p).appendTo(t),i.setAria("label",u.value?Globalize.localize("dxDataGrid-ariaCollapse"):Globalize.localize("dxDataGrid-ariaExpand"),t))}:i.callBase(t)}}}(),i.registerModule("grouping",{defaultOptions:function(){return{grouping:{autoExpandAll:!0,allowCollapsing:!0,groupContinuesMessage:Globalize.localize("dxDataGrid-groupContinuesMessage"),groupContinuedMessage:Globalize.localize("dxDataGrid-groupContinuedMessage")},groupPanel:{visible:!1,emptyPanelText:Globalize.localize("dxDataGrid-groupPanelEmptyText"),allowColumnDragging:!0}}},extenders:{controllers:{data:c},views:{headerPanel:e,rowsView:l}}})}(jQuery,DevExpress),function(n,t){var u=t.data.utils,i=t.ui.dxDataGrid,r=i.normalizeSortingInfo,e=u.keysEqual,f=function(t,i){var r=n.Deferred(),u=n.extend({skip:0,take:1,requireTotalCount:!0},i);return t.load(u).done(function(u,f){f&&isFinite(f.totalCount)?r.resolve(f.totalCount):t.totalCount(i).done(n.proxy(r.resolve,r)).fail(n.proxy(r.reject,r))}).fail(n.proxy(r.reject,r)),r};i.DataSourceAdapterServer=i.DataSourceAdapterServer.inherit(function(){var o=function(n,t,i){return n.foreachGroups(function(n){if(!n.isExpanded)return t(n)},!1,!1,i)},h=function(n,t){var i=0,r=t||0;return t&&(o(n,function(n){if(n.offset-i>=t)return!1;i+=n.count-1}),r+=i),r},c=function(n,t,i,r,u,f){for(var e,s,o=0,h=!1,a,l=0;l<t.length;l++)e=t[l],e.items!==undefined?(i.push(e.key),a=n.findGroupInfo(i),a&&!a.isExpanded?(e.collapsedItems=e.items,e.items=null,r+=a.count,f--,f<0&&o++,u&&(h=!0)):e.items&&(s=c(n,e.items,i,r,u,f),u&&(s.offset-r>1?e.isContinuation=!0:h=!0),r=s.offset,f=s.take,f<0&&(e.items.length?e.isContinuationOnNextPage=!0:o++)),i.pop()):(u&&(h=!0),r++,f--,f<0&&o++),u=!1;return h&&t.splice(0,1),o&&t.splice(-o,o),{offset:r,take:f}},a=function(n,t){var i;if(n.length!==t.length)return!1;for(i=0;i<n.length;i++)if(!e(null,n[i],t[i]))return!1;return!0},s=function(n,t,i,r,u){var o,f,e;if(t){for(o=0;o<t.length;o++)f=t[o],"key"in f&&f.items!==undefined?(i.push(f.key),u&&a(u.path,i)&&!f.isContinuation&&(u.offset=r),e=n.findGroupInfo(i),e&&!e.isExpanded?f.isContinuation||(e.offset=r,r+=e.count):r=s(n,f.items,i,r,u),i.pop()):r++;return r}},v=function(n){var t,i;n.group&&(t=r(n.group),i=r(n.sort),n.sort=u.arrangeSortingInfo(t,i),delete n.group)},l=function(n,t){for(var e=r(t.group),f=[],u=0;u<n.length;u++)f.push([e[u].selector,"=",n[u]]);return t.filter&&f.push(t.filter),i.combineFilters(f)},y=function(n,t,u){for(var h=r(u||t.group),f,s,o=[],e=0;e<n.length;e++){for(s=[],f=0;f<=e;f++)s.push([h[f].selector,e===f?"<>":"=",n[f]]);o.push(i.combineFilters(s))}return o=i.combineFilters(o,"or"),i.combineFilters([o,t.filter])},p=function(n,t){for(var o=r(t.group),i,e,u=[],f=0;f<n.length;f++){for(e=[],i=0;i<=f;i++)e.push([o[i].selector,f===i?o[i].desc?">":"<":"=",n[i]]);u.length&&u.push("or"),u.push(e)}return t.filter&&u.push(t.filter),u};return{_handleDataLoading:function(t){this.callBase(t);var s=this,r=t.storeLoadOptions,i,f=[],c=0,l=!1,a,u=r.group,e=0;(v(r),t.group=t.group||u,r.isLoadingAll)||(i=n.extend({},r),i.skip=h(s,r.skip),i.skip&&i.take&&u&&(i.skip--,i.take++,l=!0),i.take&&u&&(a=i.take,i.take++),o(s,function(n){if(n.offset>=i.skip+i.take+e)return!1;n.offset>=i.skip+e&&n.count&&(e+=n.count-1,f.push(n.path),c+=n.count)}),n.each(f,function(){i.filter=y(this,i,u)}),t.storeLoadOptions=i,t.collapsedPaths=f,t.collapsedItemsCount=c,t.skip=i.skip||0,t.skipFirstItem=l,t.take=a)},_handleDataLoaded:function(n){function a(n,t,i){if(n&&t.length&&i.length){for(var f,e=u.toComparable(t[0],!0),r=0;r<n.length;r++)if(f=u.toComparable(n[r].key,!0),i[0].desc?e>=f:e<=f)break;n.length&&e===f||n.splice(r,0,{key:t[0],items:[]}),a(n[r].items,t.slice(1),i.slice(1))}}var s=this,i=n.data,f,h,e=n.collapsedPaths,o=r(n.group),l=o.length;if(this.callBase(n),l){if(h=t.data.query(i),t.data.utils.multiLevelGroup(h,o).enumerate().done(function(n){i=n}),e)for(f=0;f<e.length;f++)a(i,e[f],o);n.storeLoadOptions.isLoadingAll||(c(s,i,[],n.skip,n.skipFirstItem,n.take),s.updateItemsCount(i,l)),n.data=i,n.collapsedItemsCount&&n.extra&&n.extra.totalCount>=0&&(n.extra.totalCount+=n.collapsedItemsCount)}},updateTotalItemsCount:function(){var n=0;o(this,function(t){t.count&&(n-=t.count-1)}),this.callBase(n)},_changeRowExpandCore:function(t){var i=this,u=i._dataSource,a=i.beginPageIndex?i.beginPageIndex():i.pageIndex(),o=i.items(),c=h(i,a*i.pageSize()),r=i.findGroupInfo(t),e;return e=r&&!r.isExpanded?n.Deferred().resolve(r.count):f(u.store(),{filter:l(t,{filter:u.filter(),group:u.group()})}),n.when(e).done(function(n){n=parseInt(n.length?n[0]:n),r?(s(i,o,[],c),r.isExpanded=!r.isExpanded,r.count=n):(r={offset:-1,count:n,path:t,isExpanded:!1},s(i,o,[],c,r),r.offset>=0&&i.addGroupInfo(r)),i.updateTotalItemsCount()}).fail(n.proxy(u.loadError.fire,u.loadError))},allowCollapseAll:function(){return!1},refresh:function(t,i){var r=this,u=r._dataSource,e=u.store();return this.callBase.apply(this,arguments),i?o(r,function(i){var o=f(e,{filter:l(i.path,t)}),s=f(e,{filter:p(i.path,t)});return u._changeLoadingCount(1),n.when(s,o).done(function(n,t){n=parseInt(n.length?n[0]:n),t=parseInt(t.length?t[0]:t),i.offset=n,i.count!==t&&(i.count=t,r.updateTotalItemsCount())}).fail(n.proxy(r._dataSource.loadError.fire,r._dataSource.loadError)).always(function(){u._changeLoadingCount(-1)})},!0):void 0}}}())}(jQuery,DevExpress),function(n,t){var i=t.ui.dxDataGrid,r=i.normalizeSortingInfo;i.DataSourceAdapterClient=i.DataSourceAdapterClient.inherit(function(){var t=function(n,t){return n.foreachGroups(function(n,i){if(n.isExpanded)return t(n,i)},!0)},f=function(n,t,i,r){var e,u,o;if(r)for(e=0;e<t.length;e++)u=t[e],u.items!==undefined&&(i.push(u.key),o=n.findGroupInfo(i),o&&o.isExpanded?f(n,u.items,i,r-1):(u.collapsedItems=u.items,u.items=null),i.pop())},s=function(n,t,i,r){return e(n,t,0,i,[],r)},e=function(n,t,i,r,u,f){var o,c=0,s,h;if(i>=r)return t.length;for(s=0;s<t.length;s++)o=t[s],o&&(u.push(o.key),h=n.findGroupInfo(u),h?(h.count=o.items.length,h.offset=f+s):n.addGroupInfo({isExpanded:n._isGroupExpanded(i),path:u.slice(0),offset:f+s,count:o.items.length}),c+=e(n,o.items,i+1,r,u,0),u.pop());return c},i=function(n,t){return n&&n.length&&n[t]&&!!n[t].isExpanded},o=function(n,t,i){for(var f,e=i,r=0;r<n.length;r++)f=n[r].offset+1,r>0&&(f+=n[r-1].childrenTotalCount,t&&(f+=u(e,t,f,r-1)*r)),e+=f;return e},u=function(n,t,i,r){if(r=r||0,t>1&&i>0){var u=n-Math.floor(n/t)*t||t;return u+=i-r-2,u<0&&(u+=t),Math.floor(u/(t-r-1))}return 0};return{updateTotalItemsCount:function(n){var i=0,e=n.extra&&n.extra.totalCount||0,r=this.pageSize(),f=this._isVirtualPaging();t(this,function(n){n.childrenTotalCount=0}),t(this,function(n,t){var s=o(t,f?0:r,i),e=n.count+n.childrenTotalCount;f||(e+=u(s,r,e,t.length-1)),t[t.length-2]?t[t.length-2].childrenTotalCount+=e:i+=e}),this.callBase(i-e+n.data.length)},_isGroupExpanded:function(n){var t=this._dataSource.group();return i(t,n)},_updatePagingOptions:function(n){var r=this,h=r._isVirtualPaging(),i=r.pageSize(),c=[],f=[],e=0,s=0;n.take&&(t(this,function(n){n.childrenTotalCount=0,n.skipChildrenTotalCount=0}),t(r,function(t,r){var a,y,b=0,k=0,v=o(r,h?0:i,s),d=0,p=0,l=t.count+t.childrenTotalCount,w=l;a=n.skip-v,v<=n.skip+n.take&&l&&(y=n.take,h||(d=u(v,i,l,r.length-1),l+=d*r.length,w+=d,i&&a>=0&&(b=r.length,k=r.length-1,p=Math.floor(a/i))),a>=0?(v+l>n.skip&&c.unshift(a-p*b-t.skipChildrenTotalCount),v+l>=n.skip+y&&f.unshift(y-b-t.childrenTotalCount+t.skipChildrenTotalCount)):v+l>=n.skip+y&&f.unshift(y+a-t.childrenTotalCount)),v<=n.skip&&(r[r.length-2]?r[r.length-2].skipChildrenTotalCount+=Math.min(w,a+1-p*k):e+=Math.min(w,a+1)),v<=n.skip+y&&(l=Math.min(w,a+y-(p+1)*k),r[r.length-2]?r[r.length-2].childrenTotalCount+=l:s+=l)}),n.skip-=e,n.take-=s-e),n.skips=c,n.takes=f},_changeRowExpandCore:function(t){var r=this,i=r.findGroupInfo(t);return i?(i.isExpanded=!i.isExpanded,n.Deferred().resolve()):n.Deferred().reject()},_handleDataLoadedCore:function(n){var e=this,l=e.callBase,o=r(n.loadOptions.group).length,a,c,h,i,u,t;if(n.loadOptions.isLoadingAll){l.call(e,n);return}for(a=s(e,n.data,o,0),o&&n.extra&&(n.extra.totalCount=a),e.updateTotalItemsCount(n),e._updatePagingOptions(n),l.call(e,n),c=n.skips,h=n.takes,t=n.data,i=0;t&&i<o;i++)u=t[0],t=u&&u.items,t&&c[i]!==undefined&&(u.isContinuation=!0,t=t.slice(c[i]),u.items=t);for(t=n.data,i=0;t&&i<o;i++)u=t[t.length-1],t=u&&u.items,t&&h[i]!==undefined&&t.length>h[i]&&(u.isContinuationOnNextPage=!0,t=t.slice(0,h[i]),u.items=t);f(e,n.data,[],o),e.updateItemsCount(n.data,o)},refresh:function(n){function o(n,i){i.length===t+1&&(n.isExpanded=f)}for(var u=this,e=r(u._group),f,t=0;t<e.length;t++)f=i(n.group,t),i(u._group,t)!==f&&u.foreachGroups(o);u.callBase.apply(this,arguments),u.foreachGroups(function(n){n.count=0})}}}())}(jQuery,DevExpress),function(n,t){var a=t.ui,i=a.dxDataGrid,v="dx-datagrid-table",y="dx-row",p="dx-freespace-row",f="dx-column-lines",e="dx-datagrid-bottom-load-panel",o="dx-datagrid-table-content",w="dx-datagrid-group-space",b="dx-scrollable-container",k="dx-scrollable-content",d="dx-datagrid-content",r="infinite",s="virtual",u=25e4,h=15e6,c=function(){var a=function(n){var t=n.pageSize();return t&&n._viewportSize>=0?Math.ceil(n._viewportSize/t):1},e=function(n){var r=n.option("scrolling.preloadEnabled"),t=a(n);return t&&(r&&t++,i(n)&&t--),t},t=function(n){return!n._isLoadingAll&&n.option("scrolling.mode")===s},i=function(n){return!n._isLoadingAll&&n.option("scrolling.mode")===r},u=function(n){return n._cache.length?n._cache[0].pageIndex:-1},o=function(n){return n._cache.length?n._cache[n._cache.length-1].pageIndex:-1},f=function(n){var i=u(n);t(n)&&(i<0||n._viewportSize>=0&&n._viewportItemIndex>=0&&(i*n.pageSize()>n._viewportItemIndex||i*n.pageSize()+n.itemsCount()<n._viewportItemIndex+n._viewportSize)&&n._dataSource.isLoading()?n._isLoading||(n._isLoading=!0,n.loadingChanged.fire(!0)):n._isLoading&&(n._isLoading=!1,n.loadingChanged.fire(!1)))},h=function(n,t,i){n._isChangedFiring=!0,t.call(n,i),n._isChangedFiring=!1},c=function(n,t){if(n._isDelayChanged)return n._isDelayChanged=!1,h(n,t),!0},l=function(n,t,i,r){var e=n._dataSource,u=e.items(),o=i&&{changeType:i,items:u};i==="append"?n._items.push.apply(n._items,u):i==="prepend"?n._items.unshift.apply(n._items,u):n._items=u,f(n),n._lastPageIndex=n.pageIndex(),n._isDelayChanged=r,n._isLoadingAll=!1,r||h(n,t,o)};return{init:function(n){var t=this;t.callBase.apply(t,arguments),t._isLoading=!0,t._pageIndex=n.pageIndex(),t._lastPageIndex=t._pageIndex,t._viewportSize=0,t._viewportItemIndex=-1,t._userPageSize=t.option("paging.pageSize"),t._items=[],t._isLoaded=!0,t._cache=[]},_handleLoadingChanged:function(n){var i=this;t(i)||(i._isLoading=n,i.callBase.apply(i,arguments))},_handleLoadError:function(){var n=this;n._isLoadingAll=!1,n._isLoading=!1,n.loadingChanged.fire(!1),n.callBase.apply(n,arguments)},_handleDataChanged:function(){var n=this,r,e=n.callBase,f=n._dataSource,h=n._cache.length,o,s;t(n)||i(n)?(r=u(n),r>=0&&(t(n)&&r+n._cache.length!==f.pageIndex()&&r-1!==f.pageIndex()&&(n._cache=[]),i(n)&&f.pageIndex()===0&&(n._cache=[])),s={pageIndex:f.pageIndex(),itemsCount:n.itemsCount(!0)},c(n,e),r===f.pageIndex()+1?(o="prepend",n._cache.unshift(s)):(o="append",n._cache.push(s)),l(n,e,n._cache.length>1?o:undefined,h===0),n.load().done(function(){c(n,e)&&n.load()})):l(n,e)},items:function(){return this._items},itemsCount:function(i){var r=0;return!i&&t(this)?n.each(this._cache,function(){r+=this.itemsCount}):r=this.callBase(),r},virtualItemsCount:function(){var n=this,i,f=0,r,e;if(t(n))return i=u(n),i<0&&(i=0),r=i*n.pageSize(),f=n._cache.length*n.pageSize(),e=Math.max(0,n.totalItemsCount()-f-r),{begin:r,end:e}},setViewportItemIndex:function(n){var r=this,f=r.pageSize(),e=r.pageCount(),c=t(r),l=i(r),o=r.totalItemsCount(),a=r._viewportItemIndex<0,s,h,u;r._viewportItemIndex=n,f&&(c||l)&&o>=0&&(r._viewportSize&&n+r._viewportSize>=o?r.hasKnownLastPage()?(u=e-1,s=o%f,u>0&&s>0&&s<f/2&&u--):u=e:(u=Math.floor(n/f),h=e-1,u=Math.max(u,0),u=Math.min(u,h)),(r.pageIndex()!==u||a)&&(r.pageIndex(u),r.load()))},viewportSize:function(n){return n!==undefined&&(this._viewportSize=n),this._viewportSize},pageIndex:function(n){return t(this)||i(this)?(n!==undefined&&(this._pageIndex=n),this._pageIndex):this._dataSource.pageIndex(n)},beginPageIndex:function(){var n=u(this);return n>=0?n:this.pageIndex()},endPageIndex:function(){var n=o(this);return n>0?n:this._lastPageIndex},load:function(r){var s=u(this),h=-1,l=this._dataSource,c,a=function(n,t){var i=n._dataSource;if(t===n.pageIndex()||!i.isLoading()&&t<n.pageCount()||!n.hasKnownLastPage()&&t===n.pageCount())return i.pageIndex(t),i.load()};return this._isLoadingAll=r,t(this)||i(this)?((s<0||!this._cache[this._pageIndex-s])&&(h=this._pageIndex),s>=0&&h<0&&this._viewportSize>=0&&(s>0&&o(this)+1===this.pageCount()&&this._cache.length<e(this)+1?h=s-1:s+this._cache.length<=this._pageIndex+e(this)&&(h=s+this._cache.length)),h>=0&&(c=a(this,h)),f(this)):c=l.load(),c||this._lastPageIndex===this.pageIndex()||this.changed.fire({changeType:"pageIndex"}),c||n.Deferred().resolve()},loadIfNeed:function(){var n=this;(t(n)||i(n))&&!n.isLoading()&&!n._isChangedFiring&&n.load()},isLoading:function(){return this._isLoading},isLoaded:function(){return this._dataSource.isLoaded()&&this._isLoaded},_changeRowExpandCore:function(){var n=this.callBase.apply(this,arguments);return this._cache=[],f(this),n},refresh:function(n,t){var r=this,u=r._dataSource;return t&&(r._cache=[],r._isLoaded=!1,f(r),r._isLoaded=!0,i(r)?(r.pageIndex(0),u.pageIndex(0),n.pageIndex=0,n.skip=0):(u.pageIndex(r.pageIndex()),u.paginate()&&(n.skip=r.pageIndex()*r.pageSize()))),r.callBase.apply(r,arguments)}}}(),l;i.DataSourceAdapterServer=i.DataSourceAdapterServer.inherit(c),i.DataSourceAdapterClient=i.DataSourceAdapterClient.inherit(c),l=function(){return{_renderCore:function(){var n=this;n.callBase.apply(n,arguments),n._updateContentPosition()},_renderContent:function(n,t){var i=this,r=i._dataController.virtualItemsCount();return r?(t.addClass(o),n.children().length?n.children().first().replaceWith(t):n.append(t),n.children("table").length===1&&(n.append(i._createTable()),i._contentHeight=0),n):i.callBase.apply(i,arguments)},_updateContent:function(n,t,i){var r=this,f,u=t&&t.changeType;u==="append"||u==="prepend"?(f=n.children().first(),i.children("tbody").children("tr")[u==="append"?"appendTo":"prependTo"](f),r._getFreeSpaceRowElements().not(":last").remove()):r.callBase.apply(r,arguments),r._updateBottomLoading()},_updateContentPosition:function(){var n=this,o,i,e,u,f,s=n._rowHeight||20,r=n._dataController.virtualItemsCount(),c;return r?(o=n._findContentElement(),e=o.children(),u=e.eq(0),f=e.eq(1),n._contentTableHeight=u.outerHeight(),i=(r.begin+r.end+n._dataController.itemsCount())*n._rowHeight,n._heightRatio=i>h?h/i:1,i=(r.begin+r.end)*s*n._heightRatio+n._contentTableHeight,t.translator.move(u,{top:Math.floor(r.begin*s*n._heightRatio)}),c=n._contentHeight!==i||i===0||!n._isTableLinesDisplaysCorrect(f)||!n._isColumnElementsEqual(u.find("col"),f.find("col")),c&&(n._contentHeight=i,n._renderVirtualTableContent(f,i)),!0):!1},_isTableLinesDisplaysCorrect:function(n){var t=n.find("."+f).length>0;return t===this.option("showColumnLines")},_isColumnElementsEqual:function(t,i){var r=t.length===i.length;return r&&n.each(t,function(n,t){if(t.style.width!==i[n].style.width)return r=!1}),r},_renderVirtualTableContent:function(n,t){for(var r=this,e=r._columnsController.getVisibleColumns(),o=r._createColGroup(e).prop("outerHTML"),s="",c=r.option("showColumnLines")?f:"",h=function(n){return"<tr style='height:"+n+"px;' class='"+p+" "+y+" "+c+"' >"+s+"<\/tr>"},i=0;i<e.length;i++)s+=e[i].command==="expand"?"<td class='"+w+"'/>":"<td />";while(t>u)o+=h(u),t-=u;o+=h(t),n.addClass(v),n.html(o)},_findBottomLoadPanel:function(){var n=this.element().find("."+e);if(n.length)return n},_updateBottomLoading:function(){var t=this,u=t.option("scrolling.mode"),f=u===s,o=u===r,h=!t._dataController.hasKnownLastPage()&&t._dataController.isLoaded()&&(f||o),i=t._findBottomLoadPanel();h?i||n("<div />").addClass(e).append(n("<div />").dxLoadIndicator()).appendTo(t._findContentElement()):i&&i.remove()},_handleScroll:function(n){var t=this;t._hasHeight&&t._rowHeight&&t._setViewportScrollTop(n.scrollOffset.top),t.callBase.apply(t,arguments)},_setViewportScrollTop:function(n){var t=this,i=t._dataController.virtualItemsCount(),f=t._heightRatio||1,r=t._rowHeight,u=i?Math.floor(i.begin*r*f):0;i&&n>=u&&n<=u+t._contentTableHeight?t._dataController.setViewportItemIndex(i.begin+(n-u)/r):t._dataController.setViewportItemIndex(n/(r*f))},_renderScrollableCore:function(n){var t=this;t.callBase.apply(t,arguments),t._subscribeToWindowScrollEvents(n)},_subscribeToWindowScrollEvents:function(t){var i=this,e=i.component.element(),r,u,f;if(e&&!i._windowScrollEvents)for(i._windowScrollEvents=!0,u=function(n,r){var u=function(){var u=n.scrollTop();!i._hasHeight&&i._rowHeight&&(u-=t.offset().top,u=u>0?u:0,i._scrollTop=u,i._setViewportScrollTop(u))};return r?function(n){u(n),r(n)}:u},f=function(t){var f=t.data("dxScrollable"),r,e;if(f){e=f.option("onScroll"),r=u(t,e),f.option("onScroll",r);i.on("disposing",function(){f.option("onScroll")===r&&f.option("onScroll",e)})}else if(t.is(document)||t.css("overflow-y")==="auto"){t.is(document)&&(t=n(window)),r=u(t);t.on("scroll",r);i.on("disposing",function(){t.off("scroll",r)})}},r=i.component.element().parent();r.length;r=r.parent())f(r)},_needUpdateRowHeight:function(n){var t=this;return t.callBase.apply(t,arguments)||n>0&&t.option("scrolling.mode")===r},_updateRowHeight:function(){var t=this,i;t.callBase.apply(t,arguments),t._rowHeight&&(t._updateContentPosition(),i=t._hasHeight?t.element().outerHeight():n(window).outerHeight(),t._dataController.viewportSize(Math.round(i/t._rowHeight)))},setLoading:function(n,t){var i=this,r=i.callBase,u=!!i._findBottomLoadPanel()&&i._dataController.isLoaded();u&&(n=!1),r.call(i,n,t)},_resizeCore:function(){this.callBase();var n=this._dataController.dataSource();n&&n.loadIfNeed&&n.loadIfNeed()},getTableElements:function(n){var t=this.callBase();return n&&this.option("scrolling.mode")==="virtual"&&(t=t.add(this.element().find("> ."+b+" > ."+k+"> ."+d).children(":not(."+o+")"))),t}}}(),i.registerModule("virtualScrolling",{defaultOptions:function(){return{scrolling:{mode:"standard",preloadEnabled:!1,useNativeScrolling:"auto"}}},extenders:{controllers:{data:function(){var n={};return i.proxyMethod(n,"virtualItemsCount"),i.proxyMethod(n,"viewportSize"),i.proxyMethod(n,"setViewportItemIndex"),n}()},views:{rowsView:l}}})}(jQuery,DevExpress),function(n,t){var e=t.ui,r=t.utils,i=e.dxDataGrid,o="dx-datagrid-text-content",s="dx-datagrid-headers",u="dx-header-row",h="dx-datagrid-nowrap",c="dx-column-lines",l="context-menu-sort-asc",a="context-menu-sort-desc",v="context-menu-sort-none",y="dx-cell-focus-disabled",p="dx-column-indicators",f=function(t,i,r){var u=n("<div />").addClass(o);return r?u.appendTo(t):u.css({float:i.alignment||"left"}).prependTo(t),u};i.ColumnHeadersView=i.ColumnsView.inherit({_getDefaultTemplate:function(n){var i=this,t,r=i.option("showColumnLines");return t=n.command?function(n,t){var i=t.column;n.html("&nbsp;"),n.addClass(i.cssClass)}:function(t,i){var u=f(t,i.column,r);u.text(n.caption)}},_getHeaderTemplate:function(n){return!r.isDefined(n.command)&&n.headerCellTemplate||{allowRenderToDetachedContainer:!0,render:this._getDefaultTemplate(n)}},_processTemplate:function(n,t){var u=this,i,e=t.column,r=this.callBase(n);return i=r&&e.headerCellTemplate?{render:function(n,t){var i=f(t,n.column,u.option("showColumnLines"));r.render(n,i)}}:r},_handleDataChanged:function(){(this._isGroupingChanged||this._requireReady)&&(this._isGroupingChanged=!1,this._requireReady=!1,this.render())},_renderCell:function(n,t){var i=this.callBase(n,t);return t.row.rowType==="header"&&(i.addClass(y),r.isDefined(t.column.command)||this.setAria({role:"columnheader",label:t.column.caption+" "+Globalize.localize("dxDataGrid-ariaColumn")},i)),i},_createRow:function(n){var t=this.callBase(n).toggleClass(c,this.option("showColumnLines"));return n.rowType==="header"&&t.addClass(u),t},_renderCore:function(){var n=this,t=n.element(),i=n._scrollLeft;t.addClass(s).toggleClass(h,!n.option("wordWrapEnabled")).empty(),n._setTableElement(n._renderTable()),n.callBase.apply(n,arguments),n._scrollLeft=0,n.scrollTo({left:i})},_renderTable:function(){var n=this.callBase.apply(this,arguments),t=this.element();return this.wrapTableInScrollContainer(n).appendTo(t),n},_getRows:function(){var n=[];return this.option("showColumnHeaders")&&n.push({rowType:"header"}),n},_getCellTemplate:function(n){if(n.rowType==="header")return this._getHeaderTemplate(n.column)},_afterRender:function(){this.processSizeChanged()},_columnOptionChanged:function(n){var i=n.changeTypes,t=n.optionNames;if(i.grouping){this._isGroupingChanged=!0;return}this.callBase(n),(t.width||t.visibleWidth)&&this.resizeCompleted.fire()},_isElementVisible:function(n){return n&&n.visible},getHeadersRowHeight:function(){var t=this._getTableElement(),n;return t?(n=t.find("."+u).first(),n&&n.height()):0},setColumnWidths:function(n){var t=this,i=t._scrollLeft;t.callBase(n),t._scrollLeft=0,t.scrollTo({left:i})},processSizeChanged:function(){var n=this,t=n.element();r.isDefined(n._headersHeight)&&n._headersHeight===t.height()||(n._headersHeight=t.height(),n.sizeChanged.fire())},getHeaderElement:function(n){var t=this.getColumnElements();return t&&t.eq(n)},getColumnElements:function(){if(this.option("showColumnHeaders"))return this.getCellElements(0)},getColumnWidths:function(){var r=this,i=r.getColumnElements(),t=r.callBase();return i&&t&&i.length===t.length&&n.each(i,function(i,r){var u=n(r).find("."+p);u.length&&(t[i]+=u.outerWidth(!0))}),t},allowDragging:function(n,t){for(var u=this.getColumns(),f=0,r,e=function(n){return n.allowReordering||n.allowGrouping||n.allowHiding},i=0;i<u.length;i++)e(u[i])&&f++;if(f<=1)return!1;if(!t)return(this.option("allowColumnReordering")||this._columnsController.isColumnOptionUsed("allowReordering"))&&n&&n.allowReordering;for(i=0;i<t.length;i++)if(r=t[i],r&&r.allowDragging(n))return!0;return!1},getBoundingRect:function(){var n=this,t,i=n.getColumnElements();return i&&i.length?(t=n._getTableElement().offset(),{top:t.top}):null},getName:function(){return"headers"},getColumnCount:function(){var n=this.getColumnElements();return n?n.length:0},init:function(){var t=this;t.callBase(),t._scrollerWidth=0,t.sizeChanged=n.Callbacks()},isVisible:function(){return this.option("showColumnHeaders")},setScrollerSpacing:function(n){var t=this,i=t.element(),r=t.option("rtlEnabled");t._scrollerWidth=n,i&&i.css(r?{paddingLeft:n}:{paddingRight:n})},optionChanged:function(n){var t=this;switch(n.name){case"showColumnHeaders":case"wordWrapEnabled":case"showColumnLines":t._invalidate(!0,!0),n.handled=!0;break;default:t.callBase(n)}},getHeight:function(){var t=this,n=t.element();return n?n.height():0},getContextMenuItems:function(n){var f=this,e,t,r,i;if(n.closest("."+u).length)return(e=n.closest("td"),t=e.length&&f.getColumns(n)[e[0].cellIndex],i=f.option("sorting"),i&&i.mode!=="none"&&t&&t.allowSorting)?(r=function(n){setTimeout(function(){f._columnsController.changeSortOrder(t.index,n.itemData.value)})},[{text:i.ascendingText,value:"asc",disabled:t.sortOrder==="asc",icon:l,onItemClick:r},{text:i.descendingText,value:"desc",disabled:t.sortOrder==="desc",icon:a,onItemClick:r},{text:i.clearText,value:"none",disabled:!t.sortOrder,icon:v,onItemClick:r}]):[]}}),i.registerModule("columnHeaders",{defaultOptions:function(){return{showColumnHeaders:!0,cellHintEnabled:!0}},views:{columnHeadersView:i.ColumnHeadersView}})}(jQuery,DevExpress),function(n,t){var o=t.ui,r=t.utils,i=o.dxDataGrid,u={"=":"filter-operation-equals","<>":"filter-operation-not-equals","<":"filter-operation-less","<=":"filter-operation-less-equal",">":"filter-operation-greater",">=":"filter-operation-greater-equal","default":"filter-operation-default",notcontains:"filter-operation-not-contains",contains:"filter-operation-contains",startswith:"filter-operation-starts-with",endswith:"filter-operation-ends-with"},l=700,a="dx-datagrid",v="dx-first-cell",f="dx-datagrid-filter-row",y="dx-menu",it="dx-menu-image",rt="dx-datagrid-text-content",p="dx-editor-with-menu",w="dx-editor-container",b="dx-editor-cell",k="dx-filter-menu",d="dx-apply-button",e="dx-highlight-outline",s="dx-focused",g="dx-cell-focus-disabled",nt="dx-texteditor",h={_columnOptionChanged:function(n){var t=this,s=n.optionNames,h,u,c,r,l,e,a;if(i.checkChanges(s,["filterValue","selectedFilterOperation"])&&n.columnIndex!==undefined){h=t.getController("columns").getVisibleIndex(n.columnIndex),u=t.getController("columns").columnOption(n.columnIndex),c=t.element().find("."+f).children().eq(h),r=c.find("."+nt),s.filterValue&&r.length&&(l=r.data("dxComponents"),e=l.length&&r.data(l[0]),e instanceof o.Editor&&e&&e.option("value",u.filterValue)),s.selectedFilterOperation&&h>=0&&u&&(a=c.find("."+y),a.length&&t._updateFilterOperationChooser(a,u,r.parent()));return}t.callBase(n)},isFilterRowVisible:function(){return this._isElementVisible(this.option("filterRow"))},isVisible:function(){return this.callBase()||this.isFilterRowVisible()},init:function(){this.callBase(),this._applyFilterViewController=this.getController("applyFilter")},_createRow:function(n){var t=this.callBase(n);return n.rowType==="filter"&&t.addClass(f),t},_getRows:function(){var n=this.callBase();return this.isFilterRowVisible()&&n.push({rowType:"filter"}),n},_renderCellContent:function(t,i){var f=this,u=i.column,s=f._columnsController,o,e,h,c=function(n,t,i){(i===""&&(i=undefined),r.isDefined(t.filterValue)||r.isDefined(i))&&(n._applyFilterViewController.setHighLight(e,t.filterValue!==i),t.filterValue=i,s.columnOption(t.index,"filterValue",i))};i.rowType==="filter"&&(t.toggleClass(v,i.columnIndex===0),u.command?t.html("&nbsp;"):u.allowFiltering&&(f.setAria("label",Globalize.localize("dxDataGrid-ariaColumn")+" "+u.caption+", "+Globalize.localize("dxDataGrid-ariaFilterCell"),t),t.addClass(b),o=n("<div />").appendTo(t),e=n("<div />").addClass(w).appendTo(o),h=n("<div />").appendTo(e),f.getController("editorFactory").createEditor(h,n.extend({},u,{value:s.isDataSourceApplied()?u.filterValue:undefined,setValue:function(n){c(f,u,n)},parentType:"filterRow",showAllText:f.option("filterRow.showAllText"),updateValueTimeout:f.option("filterRow.applyFilter")==="onClick"?0:l,width:null})),u.alignment&&t.find("input").first().css("text-align",u.alignment),u.filterOperations&&u.filterOperations.length&&f._renderFilterOperationChooser(o,u,e))),f.callBase(t,i)},_updateFilterOperationChooser:function(n,t,i){var r=this,f;n.dxMenu({activeStateEnabled:!1,selectionMode:"single",cssClass:a+" "+g+" "+k,showFirstSubmenuMode:"onHover",hideSubmenuOnMouseLeave:!0,items:[{disabled:t.filterOperations&&t.filterOperations.length?!1:!0,icon:u[t.selectedFilterOperation||"default"],selectable:!1,items:r._getFilterOperationMenuItems(t)}],onItemClick:function(n){var u=n.itemData.name;n.itemData.items||(u?r._columnsController.columnOption(t.index,"selectedFilterOperation",u):r._columnsController.columnOption(t.index,{selectedFilterOperation:t.defaultSelectedFilterOperation,filterValue:undefined}),r._applyFilterViewController.setHighLight(i,!0),r._focusEditor(i))},onSubmenuShown:function(){f=r._isEditorFocused(i),r.getController("editorFactory").loseFocus()},onSubmenuHiding:function(){n.blur(),n.dxMenu("instance").option("focusedElement",null),f&&r._focusEditor(i)},rtlEnabled:r.option("rtlEnabled")})},_isEditorFocused:function(n){return n.hasClass(s)||n.parents("."+s).length},_focusEditor:function(n){this.getController("editorFactory").focus(n),n.find("input").focus()},_renderFilterOperationChooser:function(t,i,r){var u=this,f;u.option("filterRow.showOperationChooser")&&(t.addClass(p),f=n("<div />").prependTo(t),u._updateFilterOperationChooser(f,i,r))},_getFilterOperationMenuItems:function(t){var f=this,r=[{}],i=f.option("filterRow"),e=i&&i.operationDescriptions||{};return t.filterOperations&&t.filterOperations.length&&(r=n.map(t.filterOperations,function(n){return{name:n,selected:(t.selectedFilterOperation||t.defaultFilterOperation)===n,text:e[n],icon:u[n]}}),r.push({name:null,text:i&&i.resetOperationText,icon:u["default"]})),r},optionChanged:function(n){var t=this;switch(n.name){case"filterRow":case"showColumnLines":case"disabled":this._invalidate(!0,!0),n.handled=!0;break;default:t.callBase(n)}}},c={_calculateAdditionalFilter:function(){var t=this,u=[t.callBase()],f=t._columnsController.getVisibleColumns();return n.each(f,function(){var n;this.allowFiltering&&this.calculateFilterExpression&&r.isDefined(this.filterValue)&&(n=this.calculateFilterExpression(this.filterValue,this.selectedFilterOperation||this.defaultFilterOperation),u.push(n))}),i.combineFilters(u)}},tt={_createCalculatedColumnOptions:function(t){var i=this.callBase(t);return t.dataField?n.extend(i,{calculateFilterExpression:function(n,t,i){var o=this,u=o.dataField,s=null,f,e;if(o.dataType!=="string"||o.lookup)if(o.dataType==="date"&&r.isDate(n)){switch(i){case"year":f=new Date(n.getFullYear(),0,1),e=new Date(n.getFullYear()+1,0,1);break;case"month":f=new Date(n.getFullYear(),n.getMonth(),1),e=new Date(n.getFullYear(),n.getMonth()+1,1);break;default:f=new Date(n.getFullYear(),n.getMonth(),n.getDate()),e=new Date(n.getFullYear(),n.getMonth(),n.getDate()+1)}switch(t){case"<":return[u,"<",f];case"<=":return[u,"<",e];case">":return[u,">=",e];case">=":return[u,">=",f];case"<>":return[[u,"<",f],"or",[u,">=",e]];default:return[[u,">=",f],"and",[u,"<",e]]}}else s=[u,t||"=",n];else s=[u,t||"contains",n];return s},allowFiltering:!0}):n.extend(i,{allowFiltering:!!t.calculateFilterExpression}),i}};i.ApplyFilterViewController=i.ViewController.inherit({_isOnClick:function(){return this.option("filterRow.applyFilter")==="onClick"},_getHeaderPanel:function(){return this._headerPanel||(this._headerPanel=this.getView("headerPanel")),this._headerPanel},setHighLight:function(n,t){this._isOnClick()&&(n&&n.toggleClass(e,t),this._getHeaderPanel().enableApplyButton(t))},removeHighLights:function(){if(this._isOnClick()){var n=this.getView("columnHeadersView");n.element().find("."+f+" ."+e).removeClass(e),this._getHeaderPanel().enableApplyButton(!1)}}}),i.registerModule("filterRow",{defaultOptions:function(){return{filterRow:{visible:!1,showOperationChooser:!0,showAllText:Globalize.localize("dxDataGrid-filterRowShowAllText"),resetOperationText:Globalize.localize("dxDataGrid-filterRowResetOperationText"),applyFilter:"auto",applyFilterText:Globalize.localize("dxDataGrid-applyFilterText"),operationDescriptions:{"=":Globalize.localize("dxDataGrid-filterRowOperationEquals"),"<>":Globalize.localize("dxDataGrid-filterRowOperationNotEquals"),"<":Globalize.localize("dxDataGrid-filterRowOperationLess"),"<=":Globalize.localize("dxDataGrid-filterRowOperationLessOrEquals"),">":Globalize.localize("dxDataGrid-filterRowOperationGreater"),">=":Globalize.localize("dxDataGrid-filterRowOperationGreaterOrEquals"),startswith:Globalize.localize("dxDataGrid-filterRowOperationStartsWith"),contains:Globalize.localize("dxDataGrid-filterRowOperationContains"),notcontains:Globalize.localize("dxDataGrid-filterRowOperationNotContains"),endswith:Globalize.localize("dxDataGrid-filterRowOperationEndsWith")}}}},controllers:{applyFilter:i.ApplyFilterViewController},extenders:{controllers:{data:c,columns:tt},views:{columnHeadersView:h,headerPanel:{_isShowApplyFilterButton:function(){var n=this.option("filterRow");return n&&n.visible&&n.applyFilter==="onClick"},_renderCore:function(){var t=this,i=t._applyButton?t._applyButton.option("disabled"):!0;t.callBase(),t._$applyButton&&t._$applyButton.remove(),this._isShowApplyFilterButton()&&(t._$applyButton=n("<div>").addClass(d).dxButton({disabled:i,hint:t.option("filterRow.applyFilterText"),icon:"apply-filter",onClick:function(){t._dataController._applyFilter(),t._applyFilterViewController.removeHighLights()}}).appendTo(t.element()),t._applyButton=t._$applyButton.dxButton("instance"))},init:function(){this.callBase(),this._dataController=this.getController("data"),this._applyFilterViewController=this.getController("applyFilter")},enableApplyButton:function(n){this._applyButton&&this._applyButton.option("disabled",!n)},isVisible:function(){return this.callBase()||this._isShowApplyFilterButton()},optionChanged:function(n){n.name==="filterRow"?(this._invalidate(),n.handled=!0):this.callBase(n)}}}}}),i.ColumnHeadersViewFilterRowExtender=h,i.DataControllerFilterRowExtender=c}(jQuery,DevExpress),function(n,t){var r=t.ui,i=r.dxDataGrid,u="dx-datagrid-header-panel";i.HeaderPanel=i.ColumnsView.inherit({_renderCore:function(){this.element().addClass(u)},getHeaderPanel:function(){return this.element()},getHeight:function(){var n=this.element();return n?n.outerHeight(!0):0},isVisible:function(){return!1},optionChanged:function(n){var t=this;switch(n.name){case"disabled":t._invalidate(),n.handled=!0;break;default:t.callBase(n)}}}),i.registerModule("headerPanel",{defaultOptions:function(){return{}},views:{headerPanel:i.HeaderPanel}})}(jQuery,DevExpress),function(n,t){var o=t.ui,i=o.dxDataGrid,r=t.utils,u="dx-header-filter",f="dx-header-filter-menu",s="dx-datagrid-text-content";i.HeaderFilterController=i.ViewController.inherit({init:function(){this._columnsController=this.getController("columns"),this._dataController=this.getController("data"),this._headerFilterView=this.getView("headerFilterView")},getDataSource:function(u){var e=this,o,s,c=e.option("headerFilter"),f=e._dataController.dataSource(),l=f.store(),h=function(f,e,o,s){var a,y,p,w,b,v=u.lookup,l;for(o=o||0,s=s||[],v&&(w=t.data.utils.compileGetter(v.displayExpr),b=t.data.utils.compileGetter(v.valueExpr)),l=0;l<f.length;l++)v?(a=b(f[l]),y=w(f[l])):(a=f[l].key,y=a),f[l]=r.isObject(f[l])?f[l]:{},p=u.dataType==="date"?o===1?{format:{format:"month",dateType:"full"}}:{}:u,f[l].text=i.formatValue(y,p),f[l].text||(f[l].text=c.texts.emptyValue),s.push(a),f[l].filterValue=s.length===1?s[0]:s.join("/"),n.inArray(f[l].filterValue,u.filterValues)>-1^u.filterType==="exclude"&&(f[l].selected=!0),delete f[l].key,"items"in f[l]&&(o!==e&&r.isDefined(f[l].filterValue)?h(f[l].items,e,o+1,s):delete f[l].items),s.pop()};return u.lookup?(f=t.data.utils.normalizeDataSourceOptions(u.lookup.dataSource),f.postProcess=function(n){return this.pageIndex()===0&&(n=n.slice(0),n.unshift(null)),h(n,0),n},f):(u.dataType==="date"?(s=[function(n){var t=u.calculateCellValue(n);return t&&t.getFullYear()},function(n){var t=u.calculateCellValue(n);return t&&t.getMonth()+1},function(n){var t=u.calculateCellValue(n);return t&&t.getDate()}],o=2):(s=n.proxy(u.calculateCellValue,u),o=0),{filter:e._dataController.getCombinedFilter(),group:s,load:function(i){var r=n.Deferred();return n.when(i.userData.data||l.load({filter:i.filter,expand:f.loadOptions().expand})).done(function(n){i.userData.data=n,new t.data.ArrayStore(n).load(i).done(function(n){h(n,o),r.resolve(n)}).fail(r.reject)}).fail(r.reject),r}})},getCurrentColumn:function(){return this._currentColumn},showHeaderFilterMenu:function(t){var i=this,u=i._columnsController.getColumns()[t],f;if(u){var o=i._columnsController.getVisibleIndex(t),e=u&&r.isDefined(u.groupIndex),s=e?i.getView("headerPanel"):i.getView("columnHeadersView"),h=s.getColumnElements().eq(e?u.groupIndex:o);i._currentColumn=u,f=n.extend({},u,{type:u.dataType==="date"?"tree":"list",apply:function(){i._currentColumn=null,i._columnsController.columnOption(t,{filterValues:this.filterValues,filterType:this.filterType})},cancel:function(){i._currentColumn=null},onShowing:function(n){var t=n.component.overlayContent().dxResizable("instance");t&&t.option("onResizeEnd",function(n){var r=i.getController("columns"),t=r.columnOption(f.dataField,"headerFilter");t=t||{},t.width=n.width,t.height=n.height,r.columnOption(f.dataField,"headerFilter",t,!0)})}}),f.dataSource=i.getDataSource(f),i._headerFilterView.showHeaderFilterMenu(h,f)}},hideHeaderFilterMenu:function(){this._headerFilterView.hideHeaderFilterMenu()}}),i.HeaderFilterView=i.View.inherit({getPopupContainer:function(){return this._popupContainer},getListContainer:function(){return this._listContainer},applyHeaderFilter:function(t){var i=this,u=i.getListContainer(),o=u.element().find(".dx-checkbox").eq(0).hasClass("dx-checkbox-checked"),f=[],e=function(t,i,r){n.each(i,function(){!!this.selected^r?t.push(this.filterValue):this.items&&this.items.length&&e(t,this.items)})};o?r.isArray(t.filterValues)&&(t.filterValues=[],t.apply()):(t.type==="tree"&&(e(f,u.option("items"),t.filterType==="exclude"),t.filterValues=f),t.apply()),i.hideHeaderFilterMenu()},showHeaderFilterMenu:function(n,t){var i=this,r;t&&(i._initializePopupContainer(t),r=i.getPopupContainer(),i.hideHeaderFilterMenu(),i.updatePopup(n,t),r.show())},hideHeaderFilterMenu:function(){var n=this.getPopupContainer();n&&n.hide()},updatePopup:function(n,t){var i=this,r=t.alignment==="right"?"left":"right";i._popupContainer&&(i._cleanPopupContent(),i._popupContainer.option("position",{my:r+" top",at:r+" bottom",of:n,collision:"flip"}))},_cleanPopupContent:function(){this._popupContainer&&this._popupContainer.content().empty()},_initializePopupContainer:function(n){var t=this,f=t.element(),i=t.option("headerFilter"),e=n.headerFilter&&n.headerFilter.width||i&&i.width,o=n.headerFilter&&n.headerFilter.height||i&&i.height,u={width:e,height:o,visible:!1,shading:!1,showTitle:!1,showCloseButton:!1,closeOnTargetScroll:!0,closeOnOutsideClick:!0,onShown:function(){t._initializeListContainer(n)},buttons:[{toolbar:"bottom",location:"after",widget:"button",options:{text:i.texts.ok,onClick:function(){t.applyHeaderFilter(n)}}},{toolbar:"bottom",location:"after",widget:"button",options:{text:i.texts.cancel,onClick:function(){t.hideHeaderFilterMenu(),n.cancel&&n.cancel()}}}],rtlEnabled:t.option("rtlEnabled"),resizeEnabled:!0,onShowing:n.onShowing};r.isDefined(t._popupContainer)?t._popupContainer.option(u):t._popupContainer=t._createComponent(f,"dxPopup",u)},_initializeListContainer:function(t){var i=this,r=i._popupContainer.content(),u={dataSource:t.dataSource,onContentReady:function(){i.renderCompleted.fire()}};i._listContainer=t.type==="tree"?i._createComponent(n("<div/>").appendTo(r),"dxTreeView",n.extend(u,{showCheckBoxes:!0,selectAllEnabled:!0,keyExpr:"id"})):i._createComponent(n("<div/>").appendTo(r),"dxList",n.extend(u,{pageLoadMode:"scrollBottom",pullRefreshEnabled:!0,showSelectionControls:!0,selectionMode:"all",onSelectionChanged:function(i){var r=i.component.option("items"),u=i.component.option("selectedItems");i.component._selectedItemsUpdating||(u.length===0&&r.length?(t.filterType="include",t.filterValues=[]):u.length===r.length&&(t.filterType="exclude",t.filterValues=[])),n.each(r,function(i,r){var f=n.inArray(r,u)>=0,o=!!r.selected,e;o!==f&&(r.selected=f,t.filterValues=t.filterValues||[],e=n.inArray(r.filterValue,t.filterValues),e>=0&&t.filterValues.splice(e,1),f^t.filterType==="exclude"&&t.filterValues.push(r.filterValue))})},onContentReady:function(i){var r=i.component,f=r.option("items"),u=r.option("selectedItems"),e=i.element.find(".dx-list-select-all-checkbox").dxCheckBox("instance");n.each(f,function(){this.selected&&u.push(this)}),r._selectedItemsUpdating=!0,r.option("selectedItems",u),r._selectedItemsUpdating=!1,t.filterValues&&t.filterValues.length&&e.option("value",undefined)}}))},_renderCore:function(){this.element().addClass(f)},init:function(){this._headerFilterController=this.getController("headerFilter")}});var e=i.headerFilterMixin={_applyColumnState:function(n){var i,r=n.rootElement,t=n.column;return n.name==="headerFilter"?(r.find("."+u).remove(),t.allowFiltering&&(i=this.callBase(n).toggleClass("dx-header-filter-empty",!t.filterValues||!t.filterValues.length)),i):this.callBase(n)},_renderIndicator:function(n){var t,i=n.container,r=n.indicator;if(n.name==="headerFilter"&&(t=this.option("rtlEnabled"),i.children().length&&(!t&&n.columnAlignment==="right"||t&&n.columnAlignment==="left"))){i.prepend(r);return}this.callBase(n)},optionChanged:function(n){n.name==="headerFilter"?(this._invalidate(),n.handled=!0):this.callBase(n)}},h=n.extend({},e,{_renderCellContent:function(n,t){var i=this,f,u=t.column;i.callBase(n,t),!u.command&&!r.isDefined(u.groupIndex)&&u.allowFiltering&&i.option("headerFilter.visible")&&t.rowType==="header"&&(f=i._applyColumnState({name:"headerFilter",rootElement:n,column:u,showColumnLines:i.option("showColumnLines")}),f&&i._subscribeToIndicatorEvent(f,u,"headerFilter"))},_subscribeToIndicatorEvent:function(n,t,i){var r=this;if(i==="headerFilter")n.on("dxclick",r.createAction(function(n){var i=n.jQueryEvent;i.stopPropagation(),r.getController("headerFilter").showHeaderFilterMenu(t.index)}))},_updateIndicator:function(n,t,i){var r=this.callBase(n,t,i);r&&this._subscribeToIndicatorEvent(r,t,i)},_resizeCore:function(){this.callBase(),this._updateIndicatorHeights("headerFilter")},_columnOptionChanged:function(n){var t=n.optionNames;if(i.checkChanges(t,["filterValues","filterType"])){this._updateIndicators("headerFilter");return}this.callBase(n),(t.width||t.visibleWidth)&&this._updateIndicatorHeights("headerFilter")},_afterRender:function(){this.callBase.apply(this,arguments),this._updateIndicatorHeights("headerFilter")}}),c=n.extend({},e,{_createGroupPanelItem:function(n,t){var i=this,f=i.callBase.apply(i,arguments),u;return!t.command&&t.allowFiltering&&i.option("headerFilter.visible")&&(u=i._applyColumnState({name:"headerFilter",rootElement:f,column:{alignment:r.getDefaultAlignment(i.option("rtlEnabled")),filterValues:t.filterValues,allowFiltering:t.allowFiltering},showColumnLines:!0}),u&&u.on("dxclick",i.createAction(function(n){var r=n.jQueryEvent;r.stopPropagation(),i.getController("headerFilter").showHeaderFilterMenu(t.index)}))),f},_renderGroupPanelItems:function(){this.callBase.apply(this,arguments),this._updateIndicatorHeights("headerFilter")},_resizeCore:function(){this.callBase(),this._updateIndicatorHeights("headerFilter")}}),l={_calculateAdditionalFilter:function(){var t=this,f=[t.callBase()],e=t._columnsController.getVisibleColumns(),o=t.getController("headerFilter"),u=o.getCurrentColumn();if(!u||!u.filterValues||!u.filterValues.length)return n.each(e,function(t,i){var o,u,e;i.allowFiltering&&i.calculateFilterExpression&&r.isArray(i.filterValues)&&i.filterValues.length&&(u=[],e=i.filterType==="exclude",n.each(i.filterValues,function(n,t){var f=t,s,h,c;i.dataType==="date"&&r.isDefined(f)?(s=(""+f).split("/"),h=["year","month","day"],c=h[s.length-1],f=new Date(s[0],(s[1]||1)-1,s[2]||1)):i.deserializeValue&&(f=i.deserializeValue(f)),o=i.calculateFilterExpression(f,e?"<>":"=",c),u.length>0&&u.push(e?"and":"or"),u.push(o)}),f.push(u))}),i.combineFilters(f)}};i.registerModule("headerFilter",{defaultOptions:function(){return{headerFilter:{visible:!1,width:252,height:300,texts:{emptyValue:Globalize.localize("dxDataGrid-headerFilterEmptyValue"),ok:Globalize.localize("dxDataGrid-headerFilterOK"),cancel:Globalize.localize("dxDataGrid-headerFilterCancel")}}}},controllers:{headerFilter:i.HeaderFilterController},views:{headerFilterView:i.HeaderFilterView},extenders:{controllers:{data:l},views:{columnHeadersView:h,headerPanel:c}}}),n.extend(i.__internals,{DATAGRID_HEADER_FILTER_CLASS:u,DATAGRID_HEADER_FILTER_MENU_CLASS:f,DATAGRID_CELL_CONTENT_CLASS:s})}(jQuery,DevExpress),function(n,t){var u=t.ui,i=u.dxDataGrid,f=u.events,r=t.utils,e="dx-sort",o="dx-sort-up",s="dx-sort-down",h="dx-datagrid-action",a="dx-column-indicators",c="dx-datagrid-text-content",v="dxDataGridColumnHeadersView",l=i.sortingMixin={_applyColumnState:function(n){var t=this,f,v=t.option("sorting.mode"),i=n.rootElement,u=n.column,y=i.find("."+a),p,l;if(n.name==="sort"){if(f=t.option("rtlEnabled")?"right":"left",(v==="single"||v==="multiple")&&u.allowSorting&&n.rootElement.addClass(h),i.find("."+e).remove(),y.children().length||y.remove(),i.children("."+c).css("margin-"+f,""),r.isDefined(u.sortOrder))return p=u.sortOrder==="asc"?"ascending":"descending",t.setAria("sort",p,i),l=t.callBase(n).toggleClass(o,u.sortOrder==="asc").toggleClass(s,u.sortOrder==="desc"),u.alignment==="center"&&i.children("."+c).css("margin-"+f,l.outerWidth(!0)),l;t.setAria("sort","none",i)}else return t.callBase(n)},_renderIndicator:function(n){var t,i=n.container,r=n.indicator;if(n.name==="sort"&&(t=this.option("rtlEnabled"),i.children().length&&(!t&&n.columnAlignment==="left"||t&&n.columnAlignment==="right"))){i.prepend(r);return}this.callBase(n)},_updateIndicator:function(n,t,i){i==="sort"&&r.isDefined(t.groupIndex)||this.callBase.apply(this,arguments)}},y=n.extend({},l,{_renderCellContent:function(n,t){var i=this,u=t.column;if(i.callBase(n,t),!u.command&&t.rowType==="header"){n.on(f.addNamespace("dxclick",v),i.createAction(function(n){var t=null,f=n.jQueryEvent;setTimeout(function(){f.shiftKey?t="shift":f.ctrlKey&&(t="ctrl"),u&&!r.isDefined(u.groupIndex)&&i._columnsController.changeSortOrder(u.index,t)})}));i._applyColumnState({name:"sort",rootElement:n,column:u,showColumnLines:i.option("showColumnLines")})}},_columnOptionChanged:function(n){var t=n.changeTypes,i=n.optionNames;if(t.length===1&&t.sorting){this._updateIndicators("sort");return}this.callBase(n),(i.width||i.visibleWidth)&&this._updateIndicatorHeights("sort")},_resizeCore:function(){this.callBase(),this._updateIndicatorHeights("sort")},_afterRender:function(){this.callBase.apply(this,arguments),this._updateIndicatorHeights("sort")},optionChanged:function(n){var t=this;switch(n.name){case"sorting":t._invalidate(),n.handled=!0;break;default:t.callBase(n)}}}),p=n.extend({},l,{_createGroupPanelItem:function(n,t){var i=this,r=i.callBase.apply(i,arguments);r.on(f.addNamespace("dxclick","dxDataGridHeaderPanel"),i.createAction(function(){setTimeout(function(){i.getController("columns").changeSortOrder(t.index)})}));return i._applyColumnState({name:"sort",rootElement:r,column:{alignment:i.option("rtlEnabled")?"right":"left",allowSorting:t.allowSorting,sortOrder:t.sortOrder==="desc"?"desc":"asc"},showColumnLines:!0}),r},_renderGroupPanelItems:function(){this.callBase.apply(this,arguments),this._updateIndicatorHeights("sort")},_resizeCore:function(){this.callBase(),this._updateIndicatorHeights("sort")},optionChanged:function(n){var t=this;switch(n.name){case"sorting":t._invalidate(),n.handled=!0;break;default:t.callBase(n)}}});i.registerModule("sorting",{defaultOptions:function(){return{sorting:{mode:"single",ascendingText:Globalize.localize("dxDataGrid-sortingAscendingText"),descendingText:Globalize.localize("dxDataGrid-sortingDescendingText"),clearText:Globalize.localize("dxDataGrid-sortingClearText")}}},extenders:{views:{columnHeadersView:y,headerPanel:p}}}),n.extend(i.__internals,{DATAGRID_SORT_CLASS:e,DATAGRID_SORTUP_CLASS:o,DATAGRID_SORTDOWN_CLASS:s,DATAGRID_HEADERS_ACTION_CLASS:h})}(jQuery,DevExpress),function(n,t){function u(n){return o.isDefined(n.allowSearch)?n.allowSearch:n.allowFiltering}function f(n,t){var i=n.lookup;return i&&i.items?n.parseValue.call(i,t):n.parseValue?n.parseValue(t):t}var e=t.ui,o=t.utils,i=e.dxDataGrid,s="dx-datagrid-search-panel",r="dx-datagrid-search-text",h=700;i.registerModule("search",{defaultOptions:function(){return{searchPanel:{visible:!1,width:160,placeholder:Globalize.localize("dxDataGrid-searchPanelPlaceholder"),highlightSearchText:!0,text:""}}},extenders:{controllers:{data:function(){var n=function(n,r){function a(n){for(var u=t.data.utils.compileGetter(o.valueExpr),r,i=0;i<n.length;i++)r=u(n[i]),c.push(e.calculateFilterExpression(r))}var s,e,l=n._columnsController.getColumns(),h,o,c=[];if(!r)return null;for(s=0;s<l.length;s++)e=l[s],u(e)&&e.calculateFilterExpression&&(o=e.lookup,h=f(e,r),o&&o.items?t.data.query(o.items).filter(e.calculateFilterExpression.call({dataField:o.displayExpr,dataType:o.dataType},h)).enumerate().done(a):h!==undefined&&c.push(e.calculateFilterExpression(h)));return i.combineFilters(c,"or")};return{publicMethods:function(){return this.callBase().concat(["searchByText"])},_calculateAdditionalFilter:function(){var t=this,r=t.callBase(),u=n(t,t.option("searchPanel.text"));return i.combineFilters([r,u])},searchByText:function(n){this.option("searchPanel.text",n)},optionChanged:function(n){var t=this;switch(n.fullName){case"searchPanel.text":case"searchPanel":t._applyFilter(),n.handled=!0;break;default:t.callBase(n)}}}}()},views:{headerPanel:function(){var t=function(n){return n.option("searchPanel")};return{_renderSearchPanel:function(){var i=this,u=i.element(),f=i.getController("data"),r=t(i);r&&r.visible?(i._$searchPanel?i._$searchPanel.show():(i._$searchPanel=n("<div/>").addClass(s).prependTo(u),i.setAria("label",Globalize.localize("dxDataGrid-ariaSearchInGrid"),i._$searchPanel)),i.getController("editorFactory").createEditor(i._$searchPanel,{width:r.width,placeholder:r.placeholder,parentType:"searchPanel",value:i.option("searchPanel.text"),updateValueTimeout:h,setValue:function(n){f.searchByText(n)}}),i.resize()):i._$searchPanel&&i._$searchPanel.hide()},_renderCore:function(){this.callBase(),this._renderSearchPanel()},focus:function(){var n=this._$searchPanel.dxTextBox("instance");n&&n.focus()},isVisible:function(){var n=t(this);return this.callBase()||n&&n.visible},optionChanged:function(n){n.name==="searchPanel"?(this._renderSearchPanel(),n.handled=!0):this.callBase(n)}}}(),rowsView:{_highlightSearchText:function(t,u,e){var h=this,s,l,o=h.option("searchPanel.text"),c;if(o&&h.option("searchPanel.highlightSearchText")){if(u&&e&&(c=f(e,o),o=i.formatValue(c,e),!o))return;l=n("<div>").text(o).html(),s=t.parent(),s.length||(s=n("<div>").append(t)),n.each(s.find(":dxicontains('"+o+"')"),function(t,i){n.each(n(i).contents(),function(t,i){if(i.nodeType===3){var f=function(t,i){var o=n("<span />").addClass(r),u=t.text(),e=u.toLowerCase().indexOf(i.toLowerCase());if(e>=0)return t[0].textContent?t[0].textContent=u.substr(0,e):t[0].nodeValue=u.substr(0,e),t.after(o.text(u.substr(e,i.length))),t=n(document.createTextNode(u.substr(e+i.length))).insertAfter(o),f(t,i)};u?n(i).text().toLowerCase()===o.toLowerCase()&&n(this).replaceWith(n("<span />").addClass(r).text(n(i).text())):f(n(i),o)}})})}},_renderCore:function(){this.callBase.apply(this,arguments),this.option("rowTemplate")&&this._highlightSearchText(this._getTableElement())},_updateCell:function(n,t){var r=this,i=t.column,f=i.dataType!=="string";u(i)&&r._highlightSearchText(n,f,i),r.callBase(n,t)}}}}})}(jQuery,DevExpress),function(n,t){var c=t.ui,i=t.utils,r=c.dxDataGrid,b="dx-datagrid-text-content",f="dx-group-row",l="dx-datagrid-rowsview",k="dx-datagrid-table",a="dx-data-row",u="dx-freespace-row",e="dx-datagrid-nodata",o="dx-datagrid-content",v="dx-datagrid-nowrap",y="dx-row-lines",s="dx-column-lines",p="dx-row-alt",w=200,h=function(n){var i=n.option("scrolling.useNativeScrolling"),r={direction:"both",rtlEnabled:n.option("rtlEnabled")||t.rtlEnabled,disabled:n.option("disabled"),bounceEnabled:!1,useKeyboard:!1};return i===undefined&&(i=!0),i!=="auto"&&(r.useNative=!!i,r.useSimulatedScrollbar=!i),r};r.createScrollableOptions=h,r.RowsView=r.ColumnsView.inherit({_getDefaultTemplate:function(n){switch(n.command){case"empty":return function(n){n.html("&nbsp;")};default:return function(t,i){var r=!i.text&&i.rowType==="data",u=r?"&nbsp;":i.text;n.encodeHtml&&!r?t.text(u):t.html(u)}}},_getDefaultGroupTemplate:function(){var n=this,t=n.option("summary.texts");return function(n,i){var f=i.data,u=i.column.caption+": "+i.text;i.summaryItems&&i.summaryItems.length&&(u+=" "+r.getGroupRowSummaryText(i.summaryItems,t)),f&&(i.groupContinuedMessage&&i.groupContinuesMessage?u+=" ("+i.groupContinuedMessage+". "+i.groupContinuesMessage+")":i.groupContinuesMessage?u+=" ("+i.groupContinuesMessage+")":i.groupContinuedMessage&&(u+=" ("+i.groupContinuedMessage+")")),n.addClass("dx-group-cell"),n.text(u)}},_update:function(){},_getColumnTemplate:function(n){var r=this,t=n.column,i;return i=n.rowType==="group"&&t.groupIndex!==undefined?t.groupCellTemplate||{allowRenderToDetachedContainer:!0,render:r._getDefaultGroupTemplate()}:t.cellTemplate||{allowRenderToDetachedContainer:!0,render:r._getDefaultTemplate(t)}},_getCellTemplate:function(n){return this._getColumnTemplate(n)},_createRow:function(n){var r=this.callBase(n),u,t,e;return n&&(u=n.rowType==="group",t=n.rowType==="data",r.toggleClass(a,t).toggleClass(p,t&&n.dataIndex%2==1&&this.option("rowAlternationEnabled")).toggleClass(y,t&&this.option("showRowLines")).toggleClass(s,this.option("showColumnLines")).toggleClass(f,u),u&&(e=n.isExpanded,this.setAria({role:"rowgroup",expanded:i.isDefined(e)&&e.toString()},r))),r},_createTable:function(){var t=this;return t.callBase.apply(t,arguments).on("dxclick",".dx-row",t.createAction(function(i){var r=i.jQueryEvent;n(r.target).closest("a").length||(i.rowIndex=t.getRowIndex(r.currentTarget),i.rowElement=n(r.currentTarget),t._rowClick(i))}))},_renderScrollable:function(){var i=this,t=i.element();t.children().length||t.append("<div />"),i._renderLoadPanel(t),i._renderScrollableCore(t)},_handleScroll:function(n){var t=this;t._scrollTop=n.scrollOffset.top,t._scrollLeft=n.scrollOffset.left,t.scrollChanged.fire(n.scrollOffset,t.name)},_renderScrollableCore:function(t){var i=this,r=h(i),u=n.proxy(i._handleScroll,i);r.onScroll=u,r.onStop=u,t.dxScrollable(r),i._scrollable=t.data("dxScrollable"),i._scrollableContainer=i._scrollable._$container},_renderLoadPanel:function(t){var r=this,i;t.dxLoadPanel&&(r._loadPanel&&r._loadPanel.element().remove(),i=r.option("loadPanel"),i&&i.enabled?(i=n.extend({shading:!1,message:i.text,position:{of:t},container:t},i),r._loadPanel=r._createComponent(n("<div />").appendTo(t.parent()),"dxLoadPanel",i)):r._loadPanel=null)},_renderContent:function(t,i){return t.replaceWith(n("<div>").addClass(o).append(i)),this._findContentElement()},_updateContent:function(t,r,u){var f=this,s=f._getTableElement(),h=r&&r.changeType,e=[];switch(h){case"update":n.each(r.rowIndices,function(n,t){var o=f._getRowElements(u).eq(n),c=r.changeTypes[n],h=r.items&&r.items[n];e.push(function(){var r=f._getRowElements(),n=r.eq(t);switch(c){case"update":i.isDefined(h.visible)&&h.visible!==n.is(":visible")?n.toggle(h.visible):n.replaceWith(o);break;case"insert":r.length?n.length?o.insertBefore(n):o.insertAfter(r.last()):o.prependTo(s);break;case"remove":n.remove()}})}),n.each(e,function(){this()});break;default:f._setTableElement(u),t.addClass(o),f._renderContent(t,u)}},_renderFreeSpaceRow:function(n){var t=this,i,r=t._createRow(),f=this.getColumns();for(r.addClass(u).toggleClass(s,t.option("showColumnLines")),i=0;i<f.length;i++)r.append(t._createCell(f[i]));t._appendRow(n,r)},_needUpdateRowHeight:function(n){return n>0&&!this._rowHeight},_updateRowHeight:function(){var n=this,r=n._getTableElement(),i,u=n._dataController.items().length,t;r&&n._needUpdateRowHeight(u)&&(i=r.outerHeight(),t=n._getFreeSpaceRowElements().first(),t&&t.is(":visible")&&(i-=t.outerHeight()),n._rowHeight=i/u)},_findContentElement:function(){var t=this.element(),n;if(t)return n=t.find(".dx-scrollable-content"),n||(n=t),n.children().first()},_getRowElements:function(n){var t=this.callBase(n);return t&&t.not("."+u)},_getFreeSpaceRowElements:function(){var n=this.getTableElements();return n&&n.children("tbody").children("."+u)},_getNoDataText:function(){return this.option("noDataText")},_updateNoDataText:function(t){t=t||this.element();var i=t.find("."+e),u=this._dataController.isEmpty(),f=this._dataController.isLoading(),r=this.option("rtlEnabled");i.length||(i=n("<span>").addClass(e).appendTo(t)),u&&!f?i.text(this._getNoDataText()).css({marginTop:-Math.floor(i.height()/2),marginRight:r?-Math.floor(i.width()/2):0,marginLeft:r?0:-Math.floor(i.width()/2)}).removeClass("dx-hidden"):i.addClass("dx-hidden")},_rowClick:function(i){var r=this._dataController.items()[i.rowIndex]||{};this.executeAction("onRowClick",n.extend({columns:this.getColumns(),evaluate:function(n){var i=t.data.utils.compileGetter(n);return i(r.data)}},i,r))},_getGroupCellOptions:function(n){var t=(n.row.groupIndex||0)+n.columnsCountBeforeGroups;return{columnIndex:t,colspan:n.columns.length-t-1}},_renderCells:function(n,t){t.row.rowType==="group"?this._renderGroupedCells(n,t):t.row.values&&this.callBase(n,t)},_renderGroupedCells:function(t,r){for(var h,f=r.row,o=r.columns,c=f.rowIndex,s,l,a,e=this._getGroupCellOptions(r),u=0;u<=e.columnIndex;u++)s=u===e.columnIndex&&o[u].allowCollapsing&&r.scrollingMode!=="infinite"?!!f.isExpanded:null,this._renderCell(t,{value:s,row:f,rowIndex:c,column:{command:"expand",cssClass:o[u].cssClass},columnIndex:u});a=i.getDefaultAlignment(this.option("rtlEnabled")),l=n.extend({},o[e.columnIndex],{command:null,cssClass:null,alignment:a}),h=this._renderCell(t,{value:f.values[f.groupIndex],row:f,rowIndex:c,column:l,columnIndex:e.columnIndex}),h.attr("colspan",e.colspan)},_renderRows:function(t,i){for(var u=this,f=i.columns,e=0,o=u.option("scrolling.mode"),r=0;r<f.length;r++)if(f[r].command==="expand"){e=r;break}u.callBase(t,n.extend({scrollingMode:o,columnsCountBeforeGroups:e},i)),u._renderFreeSpaceRow(t)},_renderRow:function(t,r){var f=this,u=r.row,e=f.option("rowTemplate");(u.rowType==="data"||u.rowType==="group")&&!i.isDefined(u.groupIndex)&&e?f._renderTemplate(t,e,n.extend({columns:r.columns},u)):f.callBase(t,r)},_renderTable:function(n){var t=this.callBase(n);return i.isDefined(this._getTableElement())||(this._setTableElement(t),this._renderScrollable(t)),t},_renderCore:function(n){var t=this,i,r,u=t.element();u.addClass(l).toggleClass(v,!t.option("wordWrapEnabled")),i=t._renderTable({change:n}),r=t._findContentElement(),t._updateContent(r,n,i),t.callBase(n),t._lastColumnWidths=null},_getRows:function(n){return n&&n.items||this._dataController.items()},_getCellOptions:function(t){var h=this,o,f=t.column,u=t.row,e=u.data,c=u&&u.summaryCells,l=t.value,a=r.getDisplayValue(f,l),s=h.option("grouping"),v=h.option("scrolling.mode");return o=n.extend(this.callBase(t),{value:l,displayValue:a,row:u,key:u.key,data:e,rowType:u.rowType,values:u.values,text:!i.isDefined(f.command)&&r.formatValue(a,f),rowIndex:u.rowIndex,summaryItems:c&&c[t.columnIndex],resized:f.resizedCallbacks}),i.isDefined(f.groupIndex)&&v!=="virtual"&&v!=="infinite"&&(o.groupContinuesMessage=e&&e.isContinuationOnNextPage&&s&&s.groupContinuesMessage,o.groupContinuedMessage=e&&e.isContinuation&&s&&s.groupContinuedMessage),o},getRow:function(t){var i=this._getRowElements();if(i.length>t)return n(i[t])},getCell:function(t,i){var u=i||this._getRowElements(),r;if(u.length>0&&t.rowIndex>=0&&(t.rowIndex=t.rowIndex<u.length?t.rowIndex:u.length-1,r=u[t.rowIndex].cells,r&&r.length>0))return n(r[r.length>t.columnIndex?t.columnIndex:r.length-1])},getCellIndex:function(n){return n.length?n[0].cellIndex:-1},updateFreeSpaceRowHeight:function(){var n=this,f,e=n._findContentElement(),t=n._getFreeSpaceRowElements(),o=0,i,r,u;t&&e&&(t.hide(),f=n.element().height(),o=e.outerHeight(),u=f-o-n.getScrollbarWidth(!0),n._dataController.items().length>0?u>0||!n._dataController.items().length?(t.height(u),t.show()):n._hasHeight||(i=n._dataController.pageSize()-n._dataController.items().length,r=n.option("scrolling.mode"),i>0&&n._dataController.pageCount()>1&&r!=="virtual"&&r!=="infinite"&&(t.height(i*n._rowHeight),t.show())):(t.height(0),t.show()))},_columnOptionChanged:function(n){var t=n.optionNames;n.changeTypes.grouping||(t.width||t.visibleWidth)&&(this.callBase(n),this._fireColumnResizedCallbacks())},getScrollable:function(){return this._scrollable},init:function(){var n=this,t=n.getController("data"),i;n.callBase(),n._editorFactoryController=n.getController("editorFactory"),n._rowHeight=0,n._scrollTop=0,n._scrollLeft=0,n._hasHeight=!1,t.loadingChanged.add(function(t,i){n.setLoading(t,i)}),n.createAction("onRowClick"),i=function(){n.scrollToPage(t.pageIndex())},t.pageChanged.add(i),t.dataSourceChanged.add(function(){n._handleScroll({scrollOffset:{top:n._scrollTop,left:n._scrollLeft}})})},_handleDataChanged:function(n){var t=this;switch(n.changeType){case"refresh":case"prepend":case"append":case"update":t.render(null,n);break;default:t._update(n)}},publicMethods:function(){return["isScrollbarVisible","getTopVisibleRowData","getScrollbarWidth","getCellElement"]},contentWidth:function(){return this.element().width()-this.getScrollbarWidth()},getScrollbarWidth:function(n){var t=this._scrollableContainer&&this._scrollableContainer.get(0),i=0;return t&&(i=n?t.offsetHeight-t.clientHeight:t.offsetWidth-t.clientWidth),i},_fireColumnResizedCallbacks:function(){for(var u=this,f=u._lastColumnWidths||[],r=[],t=u.getColumns(),n=0;n<t.length;n++)r[n]=t[n].visibleWidth,t[n].resizedCallbacks&&!i.isDefined(t[n].groupIndex)&&f[n]!==r[n]&&t[n].resizedCallbacks.fire(r[n]);u._lastColumnWidths=r},_resizeCore:function(){var n=this,t;n.callBase(),n._fireColumnResizedCallbacks(),n._updateRowHeight(),n._updateNoDataText(),n.updateFreeSpaceRowHeight(),t=n.element().data("dxScrollable"),t&&t.update(),n.setLoading(n._dataController.isLoading())},scrollToPage:function(n){var t=this,r=t.option("scrolling.mode"),u=t._dataController,f=u?u.pageSize():0,i;i=r==="virtual"||r==="infinite"?n*t._rowHeight*f:0,t.scrollTo({y:i,x:t._scrollLeft})},scrollTo:function(n){var t=this.element(),i=t&&t.data("dxScrollable");i&&i.scrollTo(n)},height:function(n){var u=this,t=this.element(),r;if(i.isDefined(n))u._hasHeight=n!=="auto",t&&t.height(n),r=this._getFreeSpaceRowElements(),r&&r.hide();else return t?t.height():0},setLoading:function(n,t){var i=this,r=i._loadPanel,e=i._dataController,f=i.option("loadPanel")||{},o=e.isLoaded()?f.animation:null,u;r&&(u={message:t||f.text,animation:o,visible:n},clearTimeout(i._hideLoadingTimeoutID),r.option("visible")&&!n?i._hideLoadingTimeoutID=setTimeout(function(){r.option(u)},w):r.option(u),i._updateNoDataText())},isScrollbarVisible:function(){var n=this.element();return n?this._findContentElement().outerHeight()-n.height()>0:!1},setRowsOpacity:function(t,i){var r=this,u=r._getRowElements().not("."+f)||[];n.each(u,function(u,e){n(e).hasClass(f)||r.getCellElements(u).eq(t).css({opacity:i})})},getTopVisibleItemIndex:function(){var t=this,n=0,f=0,i=0,e,o=t._scrollTop,h=t._findContentElement().offset().top,r=t._dataController.items(),s=t._getTableElement();if(r.length&&s){for(e=s.children("tbody").children(".dx-row:visible, .dx-error-row").not("."+u),n=0;n<r.length;n++)if(f=i,i=e.eq(n).offset().top-h,i>o){o*2<i+f&&n&&n--;break}n&&n===r.length&&n--}return n},getTopVisibleRowData:function(){var n=this.getTopVisibleItemIndex(),t=this._dataController.items();if(t[n])return t[n].data},optionChanged:function(n){var t=this;t.callBase(n);switch(n.name){case"wordWrapEnabled":case"hoverStateEnabled":case"showColumnLines":case"showRowLines":case"rowAlternationEnabled":case"rowTemplate":t._invalidate(!0,!0),n.handled=!0;break;case"scrolling":t._rowHeight=null,t._tableElement=null,n.handled=!0;break;case"rtlEnabled":t._rowHeight=null,t._tableElement=null;break;case"disabled":case"loadPanel":t._tableElement=null,t._invalidate(!0,!0),n.handled=!0;break;case"noDataText":t._updateNoDataText(),n.handled=!0}},dispose:function(){clearTimeout(this._hideLoadingTimeoutID)},setScrollerSpacing:function(){}}),r.registerModule("rows",{defaultOptions:function(){return{hoverStateEnabled:!1,loadPanel:{enabled:!0,text:Globalize.localize("Loading"),width:200,height:70,showIndicator:!0,indicatorSrc:"",showPane:!0},rowTemplate:null,columnAutoWidth:!1,noDataText:Globalize.localize("dxDataGrid-noDataText"),wordWrapEnabled:!1,showColumnLines:!0,showRowLines:!1,rowAlternationEnabled:!1,activeStateEnabled:!1}},views:{rowsView:r.RowsView}})}(jQuery,DevExpress),function(n,t){var u=t.ui,r=t.utils,i=u.dxDataGrid,f="dx-datagrid-pager",e=10;i.PagerView=i.View.inherit({init:function(){var n=this,t=n.getController("data");n._isVisible=!1,t.changed.add(function(){n.render()})},_getPager:function(){var n=this.element();return n&&n.data("dxPager")},_renderCore:function(){var t=this,o=t.element().addClass(f),i=t.option("pager")||{},n=t.getController("data"),u={maxPagesCount:e,pageIndex:1+(parseInt(n.pageIndex())||0),pageCount:n.pageCount(),pageSize:n.pageSize(),showPageSizes:i.showPageSizeSelector,showInfo:i.showInfo,showNavigationButtons:i.showNavigationButtons,pageSizes:t.getPageSizes(),hasKnownLastPage:n.hasKnownLastPage(),pageIndexChanged:function(t){n.pageIndex()!==t-1&&setTimeout(function(){n.pageIndex(t-1)})},pageSizeChanged:function(t){setTimeout(function(){n.pageSize(t)})}};r.isDefined(i.infoText)&&(u.infoText=i.infoText),t._createComponent(o,"dxPager",u)},getPageSizes:function(){var t=this,e=t.getController("data"),u=t.option("pager"),f=u&&u.allowedPageSizes,i=e.pageSize();return r.isDefined(t._pageSizes)&&n.inArray(i,t._pageSizes)!==-1||(t._pageSizes=[],u&&(n.isArray(f)?t._pageSizes=f:f&&i>1&&(t._pageSizes=[Math.floor(i/2),i,i*2]))),t._pageSizes},isVisible:function(){var n=this,i=n.getController("data"),u=n.option("pager"),t=u&&u.visible,r=n.option("scrolling");return n._isVisible?!0:(t==="auto"&&(t=r&&(r.mode==="virtual"||r.mode==="infinite")?!1:i.pageCount()>1||i.isLoaded()&&!i.hasKnownLastPage()),n._isVisible=t,t)},getHeight:function(){var n=this._getPager();return n&&this.isVisible()?n.getHeight():0},optionChanged:function(n){var t=this,i=n.name,r=i==="pager",u=i==="paging",f=i==="scrolling";(r||u||f)&&((r||u)&&(t._pageSizes=null),t._isVisible=!1,t._invalidate(),r&&t.component&&t.component.resize(),n.handled=!0)}}),i.registerModule("pager",{defaultOptions:function(){return{pager:{visible:"auto",showPageSizeSelector:!1,allowedPageSizes:"auto"}}},views:{pagerView:i.PagerView}})}(jQuery,DevExpress),function(n,t){var h=t.ui,f=h.events,r=f.addNamespace,o=t.utils,i=h.dxDataGrid,c=t.fx,d="dx-datagrid-columns-separator",l="dx-datagrid-columns-separator-transparent",a="dx-datagrid-drag-header",g="dx-datagrid-text-content",s="dx-datagrid-drag-action",v="dx-datagrid-tracker",y="dx-block-separator",p="dx-datagrid-drop-highlight",w="dx-header-row",nt="dx-widget",u="dxDataGridResizingReordering",tt=10,b=5,e=function(n){return n.option("allowColumnResizing")||n.getController("columns").isColumnOptionUsed("allowResizing")},k=function(n){return n.option("allowColumnReordering")||n.getController("columns").isColumnOptionUsed("allowReordering")};i.getPointsByColumns=function(n,t,i){for(var e=n.length,h=!1,o,u,f,c=[],l,s=0,r=0;r<=e;r++)r<e&&(u=n.eq(s),f=u.offset(),l=u.css("direction")==="rtl"),o={index:r,x:f?f.left+(!i&&l^r===e?u.outerWidth():0):0,y:f?f.top+(i&&r===e?u.outerHeight():0):0,columnIndex:s},t&&(h=t(o)),h||c.push(o),s++;return c},i.TrackerView=i.View.inherit({_renderCore:function(){this.callBase(),this.element().addClass(v),this.hide()},init:function(){var t=this,n;t.callBase(),t.getController("tablePosition").positionChanged.add(function(i){n=t.element(),n&&n.hasClass(v)&&(n.css({top:i.top}),n.height(i.height))})},isVisible:function(){return e(this)},show:function(){this.element().show()},hide:function(){this.element().hide()},setHeight:function(n){this.element().height(n)}}),i.SeparatorView=i.View.inherit({_renderSeparator:function(){},_renderCore:function(n){this.callBase(n),this._isShown=!0,this._renderSeparator(),this.hide()},show:function(){this._isShown=!0},hide:function(){this._isShown=!1},height:function(n){var t=this.element();if(t)if(o.isDefined(n))t.height(n);else return t.height()},width:function(n){var t=this.element();if(t)if(o.isDefined(n))t.width(n);else return t.width()}}),i.ColumnsSeparatorView=i.SeparatorView.inherit({_renderSeparator:function(){this.callBase();var n=this.element();n.addClass(d)},_subscribeToEvent:function(){var t=this,n;t.getController("tablePosition").positionChanged.add(function(i){n=t.element(),n&&(n.css({top:i.top}),n.height(i.height))})},isVisible:function(){return this.option("showColumnHeaders")&&(k(this)||e(this))},init:function(){this.callBase(),this._isTransparent=e(this),this.isVisible()&&this._subscribeToEvent()},show:function(){var t=this,n=this.element();n&&!t._isShown&&(t._isTransparent?n.removeClass(l):n.show()),this.callBase()},hide:function(){var n=this.element();n&&this._isShown&&(this._isTransparent?n.addClass(l):n.hide()),this.callBase()},moveByX:function(n){var t=this.element();t&&t.css("left",n-this._parentElement().offset().left)},changeCursor:function(n){n=o.isDefined(n)?n:"";var t=this.element();t&&t.css("cursor",n)}}),i.BlockSeparatorView=i.SeparatorView.inherit({_renderSeparator:function(){this.callBase(),this.element().addClass(y).html("&nbsp;")},hide:function(){var t=this,n=this._parentElement(),i=this.element();i&&this._isShown&&i.hide(),n&&!n.children("."+y).length&&n.prepend(t.element()),t.callBase()},isVisible:function(){var n=this.option("groupPanel"),t=this.option("columnChooser");return n&&n.visible||t&&t.enabled},show:function(n){var i=this,t=this.element(),r=function(n){c.stop(t,!0),c.animate(t,{type:"slide",from:{width:0,display:n.display},to:n,duration:300,easing:"swing"})};if(t&&!i._isShown)switch(n){case"group":r({width:"50px",display:"inline-block"});break;case"columnChooser":r({width:"100%",display:"block"});break;default:t.show()}i.callBase()}}),i.DraggingHeaderView=i.View.inherit({_isDragging:!1,_getDropOptions:function(){var n=this;if(n._dragOptions)return{sourceColumnIndex:n._dragOptions.columnIndex,sourceColumnElement:n._dragOptions.columnElement,sourceLocation:n._dragOptions.sourceLocation,targetColumnIndex:n._dropColumnIndex,targetLocation:n._dropLocation}},_getDraggingPanelByPos:function(t){var r=this,i;return n.each(r._dragOptions.draggingPanels,function(n,r){if(r){var u=r.getBoundingRect();if(u&&(u.bottom===undefined||t.y<u.bottom)&&(u.top===undefined||t.y>u.top)&&(u.left===undefined||t.x>u.left)&&(u.right===undefined||t.x<u.right))return i=r,!1}}),i},_renderCore:function(){this.element().addClass(a+" "+g+" "+nt).css("display","none")},dispose:function(){var n=this.element();this._dragOptions=null,n&&n.parent().find("."+a).remove()},isVisible:function(){var t=this.getController("columns"),n=t.getCommonSettings();return this.option("showColumnHeaders")&&(k(this)||n.allowGrouping||n.allowHiding)},init:function(){this.callBase(),this._controller=this.getController("draggingHeader"),this._columnsResizerViewController=this.getController("columnsResizer")},dragHeader:function(t){var r=this,i=t.columnElement;r._dragOptions=t,r._isDragging=!0,r._dropColumnIndex=t.columnIndex,r._dropLocation=t.sourceLocation,r._onSelectStart=document.onselectstart,document.onselectstart=function(){return!1},r.element().css({textAlign:i&&i.css("text-align"),height:i&&i.height(),width:i&&i.width(),whiteSpace:i&&i.css("white-space")}).addClass(s).text(t.sourceColumn.caption),r.element().appendTo(n(document.body))},moveHeader:function(n){var u=n.jQueryEvent,t=u.data.that,e,o,s,h,r=f.eventData(u),c=t._columnsResizerViewController?t._columnsResizerViewController.isResizing():!1,i=t._dragOptions;t._isDragging&&!c&&(s=Math.abs(r.x-i.columnElement.offset().left-i.deltaX),h=Math.abs(r.y-i.columnElement.offset().top-i.deltaY),(t.element().is(":visible")||s>b||h>b)&&(t.element().show(),e=r.x-i.deltaX,o=r.y-i.deltaY,t.element().offset({left:e,top:o}),t.dockHeader(r)),u.preventDefault())},dockHeader:function(t){var r=this,e=r._getDraggingPanelByPos(t),c=r._controller,i,u,s;if(e){var a=r.option("rtlEnabled"),l=e.getName()==="columnChooser",o=l?"y":"x",h=e.getColumnElements()||[],f=c._generatePointsByColumns(n.extend({},r._dragOptions,{targetDraggingPanel:e,columns:e.getColumns(),columnElements:h,isVerticalOrientation:l}));if(r._dropLocation=e.getName(),f.length>0){for(i=0;i<f.length;i++)if(s=f[i+1]&&(f[i][o]+f[i+1][o])/2,s===undefined||(a&&o==="x"?t[o]>s:t[o]<s)){r._dropColumnIndex=f[i].columnIndex,u=r._getDropOptions(),h[i]?u.targetColumnElement=h.eq(i):(u.targetColumnElement=h.last(),u.isLast=!0),u.posX=f[i].x,c.dock(u);break}}else r._dropColumnIndex=-1,u=r._getDropOptions(),c.dock(u)}},dropHeader:function(n){var r=n.jQueryEvent,t=r.data.that,i=t._controller;t.element().hide(),i&&t._isDragging&&i.drop(t._getDropOptions()),t.element().appendTo(t._parentElement()),t._dragOptions=null,t._isDragging=!1,document.onselectstart=t._onSelectStart||null}}),i.ColumnsResizerViewController=i.ViewController.inherit({_isHeadersRowArea:function(n){if(this._columnHeadersView){var i=this._columnHeadersView.element(),r,t;if(i)return t=i.offset().top,r=this._columnHeadersView.getHeadersRowHeight(),n>=t&&n<=t+r}return!1},_pointCreated:function(n,t,i){var r,u;return n.index>0&&n.index<t?(n.columnIndex-=1,r=i[n.columnIndex]||{},u=i[n.columnIndex+1]||{},!(r.allowResizing&&u.allowResizing)):!0},_getTargetPoint:function(n,t,i){if(n)for(var r=0;r<n.length;r++)if(n[r].x-i<=t&&t<=n[r].x+i)return n[r];return null},_moveSeparator:function(n){var r=n.jQueryEvent,t=r.data,s=t._pointsByColumns,u=t._columnsSeparatorView.width(),e=t._columnsSeparatorView.element().offset(),h=u/2,o=t._$parentContainer.offset().left,i=f.eventData(r);t._isResizing?o<=i.x&&i.x<=o+t._$parentContainer.width()&&t._updateColumnsWidthIfNeeded(t._targetPoint.columnIndex,i.x)&&(t._columnsSeparatorView.moveByX(t._targetPoint.x+(i.x-t._resizingInfo.startPosX)),t._tablePositionController.update(),r.preventDefault()):t._isHeadersRowArea(i.y)?(t._targetPoint=t._getTargetPoint(s,i.x,u),t._isReadyResizing=!1,t._columnsSeparatorView.changeCursor(),t._targetPoint&&e.top<=i.y&&e.top+t._columnsSeparatorView.height()>=i.y&&(t._columnsSeparatorView.changeCursor("col-resize"),t._columnsSeparatorView.moveByX(t._targetPoint.x-h),t._isReadyResizing=!0,r.preventDefault())):(t._isReadyResizing=!1,t._columnsSeparatorView.changeCursor())},_endResizing:function(n){var i=n.jQueryEvent,t=i.data;t._isResizing&&(t._generatePointsByColumns(),t._resizingInfo=null,t._columnsSeparatorView.hide(),t._columnsSeparatorView.changeCursor(),t._trackerView.hide(),t._isReadyResizing=!1,t._isResizing=!1)},_setupResizingInfo:function(n){var t=this,i=t._columnHeadersView.getHeaderElement(t._targetPoint.columnIndex),r=t._columnHeadersView.getHeaderElement(t._targetPoint.columnIndex+1);t._resizingInfo={startPosX:n,currentColumnWidth:i&&i.length>0?i.outerWidth():0,nextColumnWidth:r&&r.length>0?r.outerWidth():0}},_startResizing:function(n){var i=n.jQueryEvent,t=i.data,r=f.eventData(i);f.isTouchEvent(i)&&(t._isHeadersRowArea(r.y)?(t._targetPoint=t._getTargetPoint(t._pointsByColumns,r.x,tt),t._targetPoint&&(t._columnsSeparatorView.moveByX(t._targetPoint.x-t._columnsSeparatorView.width()/2),t._isReadyResizing=!0)):t._isReadyResizing=!1),t._isReadyResizing&&(t._targetPoint,t._setupResizingInfo(r.x),t._columnsSeparatorView.show(),t._trackerView.show(),t._isResizing=!0,i.preventDefault(),i.stopPropagation())},_generatePointsByColumns:function(){var n=this,u=n._columnsController?n._columnsController.getVisibleColumns():[],t=n._columnHeadersView.getColumnElements(),r=[];t&&t.length>0&&(r=i.getPointsByColumns(t,function(i){return n._pointCreated(i,t.length,u)})),n._pointsByColumns=r},_unsubscribeFromEvents:function(){this._moveSeparatorHandler&&this._$parentContainer.off(r("dxpointermove",u),this._moveSeparatorHandler),this._startResizingHandler&&this._$parentContainer.off(r("dxpointerdown",u),this._startResizingHandler),this._endResizingHandler&&(this._columnsSeparatorView.element().off(r("dxpointerup",u),this._endResizingHandler),n(document).off(r("dxpointerup",u),this._endResizingHandler))},_subscribeToEvents:function(){this._moveSeparatorHandler=this.createAction(this._moveSeparator),this._startResizingHandler=this.createAction(this._startResizing),this._endResizingHandler=this.createAction(this._endResizing);this._$parentContainer.on(r("dxpointermove",u),this,this._moveSeparatorHandler);this._$parentContainer.on(r("dxpointerdown",u),this,this._startResizingHandler);this._columnsSeparatorView.element().on(r("dxpointerup",u),this,this._endResizingHandler);n(document).on(r("dxpointerup",u),this,this._endResizingHandler)},_updateColumnsWidthIfNeeded:function(n,t){var r,e=!1,o,i=this._columnsController,h=i.getVisibleColumns(),c=this._columnsSeparatorView.width(),u,f,s;return r=t-this._resizingInfo.startPosX,this.option("rtlEnabled")&&(r=-r),s=this._resizingInfo.currentColumnWidth+r,o=this._resizingInfo.nextColumnWidth-r,e=!(s<=c||o<=c),e&&(u=h[n],f=h[n+1],i.beginUpdate(),u&&i.columnOption(u.index,"visibleWidth",undefined),f&&i.columnOption(f.index,"visibleWidth",undefined),u&&i.columnOption(u.index,"width",Math.floor(s)),f&&i.columnOption(f.index,"width",Math.floor(o)),i.endUpdate()),e},isResizing:function(){return this._isResizing},init:function(){var n=this,i,t,r=function(t){n._scrollLeft!==t.left&&(n._scrollLeft=t.left,n._generatePointsByColumns())},u=function(){n._generatePointsByColumns()};n.callBase(),e(n)&&(n._columnsSeparatorView=n.getView("columnsSeparatorView"),n._columnHeadersView=n.getView("columnHeadersView"),n._trackerView=n.getView("trackerView"),n._rowsView=n.getView("rowsView"),n._columnsController=n.getController("columns"),n._tablePositionController=n.getController("tablePosition"),n._$parentContainer=n._columnsSeparatorView.component.element(),n._columnHeadersView.renderCompleted.add(u),n._columnHeadersView.resizeCompleted.add(u),n._columnsSeparatorView.renderCompleted.add(function(){n._unsubscribeFromEvents(),n._subscribeToEvents()}),n._rowsView.renderCompleted.add(function(){n._rowsView.scrollChanged.remove(r),n._rowsView.scrollChanged.add(r)}),i=n.getView("gridView"),t=n._rowsView.getScrollbarWidth()!==0,n.getController("tablePosition").positionChanged.add(function(){if(n._isResizing&&!n._rowsView.isResizing){var r=n._rowsView.getScrollbarWidth()!==0;t!==r?(t=r,i.resize()):(n._rowsView.updateFreeSpaceRowHeight(),n._columnHeadersView.processSizeChanged())}}))},dispose:function(){this._unsubscribeFromEvents()}}),i.TablePositionViewController=i.ViewController.inherit({update:function(){var n=this._columnHeadersView.element(),t=this._columnHeadersView?this._columnHeadersView.getHeight():0,i=this._rowsView?this._rowsView.height()-this._rowsView.getScrollbarWidth(!0):0;this.positionChanged.fire({height:t+i,top:n&&n.length>0?Math.floor(n[0].offsetTop):0})},init:function(){var n=this;n.callBase(),n._columnHeadersView=this.getView("columnHeadersView"),n._rowsView=this.getView("rowsView"),n._pagerView=this.getView("pagerView"),n._rowsView.resizeCompleted.add(function(){n.update()})},ctor:function(t){this.callBase(t),this.positionChanged=n.Callbacks()}}),i.DraggingHeaderViewController=i.ViewController.inherit({_generatePointsByColumns:function(n){var t=this;return i.getPointsByColumns(n.columnElements,function(i){return t._pointCreated(i,n.columns,n.targetDraggingPanel.getName(),n.sourceColumn)},n.isVerticalOrientation)},_pointCreated:function(n,t,i,r){var u=t[n.columnIndex],f=t[n.columnIndex-1];switch(i){case"columnChooser":return!0;case"headers":return r&&!r.allowReordering||(!u||!u.allowReordering)&&(!f||!f.allowReordering);default:return t.length===0}},_subscribeToEvents:function(t,i){var e=this;n.each(i,function(o,h){if(h){var l=h.getColumnElements()||[],a=h.getName(),c=h.getColumns()||[];n.each(l,function(o,l){var v=n(l);if(h.allowDragging(c[o],i)){v.addClass(s);v.on(r("dxdragstart",u),e.createAction(function(r){var u=r.jQueryEvent,e=f.eventData(u);t.dragHeader({deltaX:e.x-n(u.currentTarget).offset().left,deltaY:e.y-n(u.currentTarget).offset().top,sourceColumn:c[o],columnIndex:o,columnElement:v,sourceLocation:a,draggingPanels:i})}));v.on(r("dxdrag",u),{that:t},e.createAction(t.moveHeader));v.on(r("dxdragend",u),{that:t},e.createAction(t.dropHeader))}})}})},_unsubscribeFromEvents:function(t,i){n.each(i,function(t,i){if(i){var f=i.getColumnElements()||[];n.each(f,function(t,i){var f=n(i);f.off(r("dxdragstart",u)),f.off(r("dxdrag",u)),f.off(r("dxdragend",u)),f.removeClass(s)})}})},_getSeparator:function(n){return n==="headers"?this._columnsSeparatorView:this._blockSeparatorView},hideSeparators:function(){var n=this._blockSeparatorView,t=this._columnsSeparatorView;this._animationColumnIndex=null,n&&n.hide(),t&&t.hide()},init:function(){var n=this,t;n.callBase(),n._columnsController=n.getController("columns"),n._columnHeadersView=n.getView("columnHeadersView"),n._columnsSeparatorView=n.getView("columnsSeparatorView"),n._draggingHeaderView=n.getView("draggingHeaderView"),n._rowsView=n.getView("rowsView"),n._blockSeparatorView=n.getView("blockSeparatorView"),n._headerPanelView=n.getView("headerPanel"),n._columnChooserView=n.getView("columnChooserView"),t=function(){if(n._draggingHeaderView){var t=[n._columnChooserView,n._columnHeadersView,n._headerPanelView];n._unsubscribeFromEvents(n._draggingHeaderView,t),n._subscribeToEvents(n._draggingHeaderView,t)}},n._columnHeadersView.renderCompleted.add(t),n._headerPanelView&&n._headerPanelView.renderCompleted.add(t),n._columnChooserView&&n._columnChooserView.renderCompleted.add(t)},allowDrop:function(n){return this._columnsController.allowMoveColumn(n.sourceColumnIndex,n.targetColumnIndex,n.sourceLocation,n.targetLocation)},dock:function(n){var t=this,u=n.targetColumnIndex,f=n.sourceLocation,s=n.sourceColumnIndex,e=n.sourceColumnElement,r=n.targetLocation,i=t._getSeparator(r),o=u>=0,h=function(){t._animationColumnIndex!==u&&(t.hideSeparators(),i.element()[n.isLast?"insertAfter":"insertBefore"](n.targetColumnElement),t._animationColumnIndex=u,i.show(r))};t._columnHeadersView.element().find("."+w).toggleClass(p,f!=="headers"&&r==="headers"&&!o),i&&(e&&(e.css({opacity:.5}),f==="headers"&&t._rowsView.setRowsOpacity(s,.5)),t.allowDrop(n)&&o?r==="group"||r==="columnChooser"?h():(t.hideSeparators(),i.moveByX(n.posX-i.width()),i.show()):t.hideSeparators())},drop:function(n){var i=n.sourceColumnElement,t;i&&(i.css({opacity:""}),this._rowsView.setRowsOpacity(n.sourceColumnIndex,""),this._columnHeadersView.element().find("."+w).removeClass(p)),this.allowDrop(n)&&(t=this._getSeparator(n.targetLocation),t&&t.hide(),this._columnsController.moveColumn(n.sourceColumnIndex,n.targetColumnIndex,n.sourceLocation,n.targetLocation))},dispose:function(){this._draggingHeaderView&&this._unsubscribeFromEvents(this._draggingHeaderView,[this._columnChooserView,this._columnHeadersView,this._headerPanelView])}}),i.registerModule("columnsResizingReordering",{views:{columnsSeparatorView:i.ColumnsSeparatorView,blockSeparatorView:i.BlockSeparatorView,draggingHeaderView:i.DraggingHeaderView,trackerView:i.TrackerView},controllers:{draggingHeader:i.DraggingHeaderViewController,tablePosition:i.TablePositionViewController,columnsResizer:i.ColumnsResizerViewController}})}(jQuery,DevExpress),function(n,t){var r=t.ui,i=r.dxDataGrid,u="dx-datagrid",f="dx-context-menu",e={columnHeadersView:"header",rowsView:"content",footerView:"footer"},o=["columnHeadersView","rowsView","footerView"];i.ContextMenuController=i.ViewController.inherit({init:function(){this.createAction("onContextMenuPreparing")},getContextMenuItems:function(t){var c=this,i,u,f,s,l,r,h;return n.each(o,function(){return i=c.getView(this),i&&i.element().find(t).length&&(r=t.closest("td"),l=r.closest(".dx-row"),f=i.getRowIndex(l),s=r[0]&&r[0].cellIndex,u={targetElement:t,target:e[this],rowIndex:f,row:i._getRows()[f],columnIndex:s,column:i.getColumns()[s],items:i.getContextMenuItems&&i.getContextMenuItems(t)},c.executeAction("onContextMenuPreparing",u),h=u.items,h)?!1:void 0}),h}}),i.ContextMenuView=i.View.inherit({_renderCore:function(){var t=this;this._createComponent(t.element().addClass(f),"dxContextMenu",{onPositioning:function(i){var r=i.jQueryEvent,f=n(r.target),e=i.component,u=t.getController("contextMenu").getContextMenuItems(f);u?(e.option("items",u),r.stopPropagation()):i.canceled=!0},onItemClick:function(n){n.itemData.onItemClick&&n.itemData.onItemClick(n)},cssClass:u,target:t.component.element()})}}),i.registerModule("contextMenu",{defaultOptions:function(){return{onContextMenuPreparing:null}},controllers:{contextMenu:i.ContextMenuController},views:{contextMenuView:i.ContextMenuView}})}(jQuery,DevExpress),function(n,t){var f=t.ui,i=t.utils,r=f.events,u=f.dxDataGrid,o="dx-row",s="dx-group-row",h="dx-datagrid-rowsview",c="dx-master-detail-row",l="dx-datagrid-group-footer",a="dx-command-expand",v=".dx-checkbox, .dx-menu, input",y=["rowsView","columnHeadersView"],e="row";u.KeyboardNavigationController=u.ViewController.inherit({_focusView:function(n,t){this._focusedViews.viewIndex=t,this._focusedView=n},_focusInteractiveElement:function(n){var t=n.find(v).first();t.focus()},_updateFocus:function(){var t=this,i=t._getFocusedCell();i&&(t._hasSkipRow(i.parent())&&(i=t._getNextCell("upArrow")),i&&i.length>0&&setTimeout(function(){t.getController("editorFactory").focus()&&t._focus(i),t._editingController.isEditing()&&n.proxy(t._focusInteractiveElement,t)(i)}))},_clickHandler:function(t){var i=t.jQueryEvent,r=n(i.currentTarget);this._isCellValid(r,!0)?(this._focusView(i.data.view,i.data.viewIndex),this._updateFocusedCellPosition(r),this._editingController.isEditing()||r.focus()):this._resetFocusedCell(this)},_initFocusedViews:function(){var t=this,i=t.createAction(t._clickHandler);t._focusedViews=[],n.each(y,function(n,i){var r=t.getView(i);r&&r.isVisible()&&t._focusedViews.push(r)}),n.each(t._focusedViews,function(n,u){u&&u.renderCompleted.add(function(){var f=u.element();f.off(r.addNamespace("dxpointerdown","dxDataGridKeyboardNavigation"),i);f.on(r.addNamespace("dxpointerdown","dxDataGridKeyboardNavigation"),"."+o+" td",{viewIndex:n,view:u},i);t._initKeyDownProcessor(t,f,t._keyDownHandler),t._focusedView&&t._focusedView.name===u.name&&t._isNeedFocus&&t._updateFocus()})})},_initKeyDownProcessor:function(n,t,i){this._keyDownProcessor&&(this._keyDownProcessor.dispose(),this._keyDownProcessor=null),this._keyDownProcessor=new f.KeyboardProcessor({element:t,context:n,handler:i})},_getFocusedCell:function(){if(this._focusedView&&this._focusedCellPosition)return this._focusedView.getCell(this._focusedCellPosition)},_updateFocusedCellPosition:function(n){var t=this,i=t.getView("rowsView");n.length>0&&(this._focusedCellPosition={columnIndex:i.getCellIndex(n),rowIndex:n.parent().length>0&&t._focusedView?t._focusedView.getRowIndex(n.parent()):null})},_isCellValid:function(n,t){var e;if(i.isDefined(n)){var o=this.getView("rowsView"),u=this._columnsController.getVisibleColumns(),f=o.getCellIndex(n),r=u[f],s=function(){return r&&!i.isDefined(r.groupIndex)||parseInt(n.attr("colspan"))>1};if(u.length>f&&s())return e=t?!1:r.command==="expand",r&&!i.isDefined(r.command)||e}},_isCellByPositionValid:function(n,t){var i=this._focusedView&&this._focusedView.getCell(n);return this._isCellValid(i,t)},_isGroupRow:function(n){return n&&n.hasClass(s)},_focus:function(n){var i=n.parent(),r=this._getFocusedCell(),t;r&&r.attr("tabindex",null),this._isGroupRow(i)?(t=i,this._focusedCellPosition.rowIndex=this._focusedView.getRowIndex(i)):(t=n,this._updateFocusedCellPosition(n)),t.attr("tabindex",0),t.focus(),this.getController("editorFactory").focus(t)},_hasSkipRow:function(n){return n&&(n.hasClass(c)||n.hasClass(l))},_enterKeyHandler:function(t,i){var s=this._getFocusedCell(),h=this.option("editing"),r=this._focusedCellPosition?this._focusedCellPosition.rowIndex:null,c=this._focusedView&&this._focusedView.getRow(r),f,u,o;this.option("grouping.allowCollapsing")&&this._isGroupRow(c)||this.option("masterDetail.enabled")&&s.hasClass(a)?(f=this._dataController.getKeyByRowIndex(r),u=this._dataController.items()[r],f!==undefined&&u&&u.data&&!u.data.isContinuation&&this._dataController.changeRowExpand(f)):(o=this._editingController.getEditMode()===e,i?(this._updateFocusedCellPosition(this._getCellElementFromTarget(t.originalEvent.target)),o?setTimeout(n.proxy(this._editingController.saveEditData,this._editingController)):this._editingController.closeEditCell()):h.editEnabled&&(o?this._editingController.editRow(r):this._focusedCellPosition&&this._editingController.editCell(r,this._focusedCellPosition.columnIndex)))},_leftRightKeysHandler:function(n,t){var u=this._focusedCellPosition?this._focusedCellPosition.rowIndex:null,f=this._focusedView&&this._focusedView.getRow(u),r,i;t||this._isGroupRow(f)||(r=this._getDirectionCodeByKey(n.key),i=this._getNextCell(r),i&&this._isCellValid(i)&&this._focus(i),n.originalEvent.preventDefault())},_getDirectionCodeByKey:function(n){var t;return t=this.option("rtlEnabled")?n==="leftArrow"?"nextInRow":"previousInRow":n==="leftArrow"?"previousInRow":"nextInRow"},_upDownKeysHandler:function(n,t){var r=this._focusedCellPosition?this._focusedCellPosition.rowIndex:null,i;t||(r===0||this._focusedView&&r===this._focusedView.getRowsCount()-1,i=this._getNextCell(n.key),i&&this._isCellValid(i)&&this._focus(i),n.originalEvent.preventDefault())},_pageUpKeyHandler:function(n){var t=this.option("scrolling.mode"),i=this._dataController.pageIndex(),r=t==="virtual"||t==="infinite";i>0&&!r&&(this._dataController.pageIndex(i-1),n.originalEvent.preventDefault())},_pageDownKeyHandler:function(n){var t=this.option("scrolling.mode"),r=t==="virtual"||t==="infinite",i=this._dataController.pageIndex(),u=this._dataController.pageCount();i<u-1&&!r&&(this._dataController.pageIndex(i+1),n.originalEvent.preventDefault())},_spaceKeyHandler:function(n,t){var i=this._focusedCellPosition?this._focusedCellPosition.rowIndex:null;this.option("selection")&&this.option("selection").mode!=="none"&&!t&&(this._selectionController.changeItemSelection(i,{shift:n.shift,control:n.ctrl}),n.originalEvent.preventDefault())},_crtlAKeyHandler:function(n){n.ctrl&&this.option("selection.mode")==="multiple"&&this.option("selection.allowSelectAll")&&(this._selectionController.selectAll(),n.originalEvent.preventDefault())},_tabKeyHandler:function(n,t){var r=this.option("editing"),u=n.shift?"previous":"next",i;r&&n.originalEvent.target&&(t?(r.editEnabled||this._editingController.closeEditCell(),this._updateFocusedCellPosition(this._getCellElementFromTarget(n.originalEvent.target)),i=this._getNextCell(u),this._focusCell(i)&&(this._editingController.getEditMode()!==e&&r.editEnabled?this._editingController.editCell(this._focusedCellPosition.rowIndex,this._focusedCellPosition.columnIndex):this._focusInteractiveElement(i))):(i=this._getNextCell(u,this._getElementType(n.originalEvent.target)),this._focusCell(i))),n.originalEvent.preventDefault()},_focusCell:function(n){if(this._isCellValid(n))return this._focus(n),!0},_getElementType:function(t){return n(t).is("tr")?"row":"cell"},_escapeKeyHandler:function(n,t){if(t){var i=this._getCellElementFromTarget(n.originalEvent.target);this._updateFocusedCellPosition(i),this._editingController.getEditMode()!==e?this._editingController.closeEditCell():this._editingController.cancelEditData(),n.originalEvent.preventDefault()}},_ctrlFKeyHandler:function(n){n.ctrl&&this.option("searchPanel")&&this.option("searchPanel").visible&&(this._headerPanel.focus(),n.originalEvent.preventDefault())},_keyDownHandler:function(n){var t=this._editingController.isEditing(),i={handled:!1,jQueryEvent:n.originalEvent};if((this.executeAction("onKeyDown",i),!n.originalEvent.isDefaultPrevented())&&(this._isNeedFocus=!0,!i.handled)){switch(n.key){case"leftArrow":case"rightArrow":this._leftRightKeysHandler(n,t);break;case"upArrow":case"downArrow":this._upDownKeysHandler(n,t);break;case"pageUp":this._pageUpKeyHandler(n);break;case"pageDown":this._pageDownKeyHandler(n);break;case"space":this._spaceKeyHandler(n,t);break;case"A":this._crtlAKeyHandler(n);break;case"tab":this._tabKeyHandler(n,t);break;case"enter":this._enterKeyHandler(n,t);break;case"escape":this._escapeKeyHandler(n,t);break;case"F":this._ctrlFKeyHandler(n)}n.originalEvent.stopPropagation()}},_isLastRow:function(n){return n===this.getController("data").items().length-1},_getNextCell:function(t,i,r){var f=r||this._focusedCellPosition,h=n.inArray(t,["next","previous"])>-1,o,e,u,s;if(this._focusedView&&f){if(e=this._getNewPositionByCode({columnIndex:f.columnIndex,rowIndex:f.rowIndex},i,t),u=this._focusedView.getCell(e),!this._isCellValid(u)&&this._isCellInRow(e.columnIndex,h)&&(u=this._getNextCell(t,"cell",e)),s=u&&u.parent(),this._hasSkipRow(s)){if(o=this._focusedView.getRowIndex(s),this._isLastRow(o))return null;u=this._getNextCell(t,"row",n.extend({},f,{rowIndex:o}))}return u}return null},_getNewPositionByCode:function(n,t,i){var u=n.columnIndex,r=n.rowIndex,f=this.getController("columns").getVisibleColumns().length;switch(i){case"nextInRow":case"next":u<f-1&&!this._isLastValidCell({columnIndex:u,rowIndex:r})&&t!=="row"?u++:this._isLastRow(r)||i!=="next"||(u=0,r++);break;case"previousInRow":case"previous":u>0&&!this._isFirstValidCell({columnIndex:u,rowIndex:r})&&t!=="row"?u--:r>0&&i==="previous"&&(u=f-1,r--);break;case"upArrow":r=r>0?r-1:r;break;case"downArrow":r=this._isLastRow(r)?r:r+1}return{columnIndex:u,rowIndex:r}},_isFirstValidCell:function(n){var t=!1;return n.rowIndex===0&&n.columnIndex>0&&(t=t||!this._haveValidCellBeforePosition(n)),t},_haveValidCellBeforePosition:function(n){for(var i=n.columnIndex,t=!1,r;i>0&&!t;)r={columnIndex:--i,rowIndex:n.rowIndex},t=this._isCellByPositionValid(r);return t},_isLastValidCell:function(n){var t={columnIndex:n.columnIndex+1,rowIndex:n.rowIndex},i=this.getController("columns").getVisibleColumns().length,r=this._isCellByPositionValid(t);return!this._isLastRow(n.rowIndex)||r?!1:n.columnIndex===i-1?!0:this._isLastValidCell(t)},_isCellInRow:function(n,t){var i=this.getController("columns").getVisibleColumns().length;return t?n>=0&&n<=i-1:n>0&&n<i-1},_resetFocusedCell:function(n){var t=n._getFocusedCell();t&&t.attr("tabindex",null),n._isNeedFocus=!1},_getCellElementFromTarget:function(t){return n(t).closest("."+o+"> td")},init:function(){var t=this;if(t.option("useKeyboard")){t._dataController=t.getController("data"),t._selectionController=t.getController("selection"),t._editingController=t.getController("editing"),t._headerPanel=t.getView("headerPanel"),t._columnsController=t.getController("columns"),t.getController("editorFactory").focused.add(function(n){t.setupFocusedView(),t._isNeedFocus&&n.is(":visible")&&t._focusedView&&t._focusedView.getScrollable&&(t._scrollToElement(n),t._isNeedFocus=!1)}),t._focusedCellPosition={columnIndex:0,rowIndex:0},t._dataController.changed.add(function(n){t._focusedCellPosition&&n&&n.changeType==="prepend"&&(t._focusedCellPosition.rowIndex+=n.items.length)}),t._initFocusedViews(),t._documentClickHandler=t.createAction(function(i){n(i.jQueryEvent.target).closest("."+h).length||t._resetFocusedCell(t)}),t.createAction("onKeyDown");n(document).on(r.addNamespace("dxpointerdown","dxDataGridKeyboardNavigation"),t._documentClickHandler)}},_scrollToElement:function(n,t){this._focusedView.getScrollable().scrollToElement(n,t)},focus:function(n){var t=this._getFocusedViewByElement(n);t&&(this._focusView(t.view,t.viewIndex),this._isNeedFocus=!0,this._focus(n),this._isHeaderView(t.view.name)&&this._focusInteractiveElement(n))},getFocusedView:function(){return this._focusedView},_getFocusedViewByElement:function(n){var t=function(t){return n.closest(t._$element).length};return this._getFocusedViewByCondition(t)},_getFocusedViewByCondition:function(t){var i;return n.each(this._focusedViews,function(n,r){if(t(r))return i={viewIndex:n,view:r},!1}),i},_isHeaderView:function(n){return n==="columnHeadersView"},focusViewByName:function(n){var t=this._getFocusedViewByName(n);this._focusView(t.view,t.viewIndex)},setupFocusedView:function(){i.isDefined(this._focusedView)||this.focusViewByName("rowsView")},_getFocusedViewByName:function(n){var t=function(t){return t.name===n};return this._getFocusedViewByCondition(t)},optionChanged:function(n){var t=this;switch(n.name){case"useKeyboard":n.handled=!0;break;default:t.callBase(n)}},dispose:function(){this.callBase(),this._focusedView=null,this._focusedViews=null,this._keyDownProcessor&&this._keyDownProcessor.dispose(),n(document).off(r.addNamespace("dxpointerdown","dxDataGridKeyboardNavigation"),this._documentClickHandler)}}),u.registerModule("keyboardNavigation",{defaultOptions:function(){return{useKeyboard:!0}},controllers:{keyboardNavigation:u.KeyboardNavigationController},extenders:{views:{rowsView:{_renderCore:function(n){this.callBase(n),this.element().attr("tabindex",this.option("useKeyboard")?0:null)}}},controllers:{editing:{editCell:function(n,t){var i=this.callBase(n,t),r=this.getController("keyboardNavigation");return i&&r.setupFocusedView(),i},getFocusedCellInRow:function(n){var i=this.getController("keyboardNavigation"),t=this.callBase(n);return this.option("useKeyboard")&&i._focusedCellPosition.rowIndex===n&&(t=i._getFocusedCell()||t),t}}}}})}(jQuery,DevExpress),function(n,t){var u=t.ui,i=u.dxDataGrid,r="dx-error-row",f="dx-error-message",e="dx-closebutton",o="dx-datagrid-action";i.ErrorHandlingController=i.ViewController.inherit({init:function(){var n=this;n._columnHeadersView=n.getView("columnHeadersView"),n._rowsView=n.getView("rowsView")},_createErrorRow:function(t,i){var u=this,s=n("<tr />").addClass(r),c=n("<div/>").addClass(f).text(t),h=n("<div/>").addClass(e).addClass(o);h.on("dxclick",u.createAction(function(t){var f=t.jQueryEvent,e,o=n(f.currentTarget).closest("."+r).index();f.stopPropagation(),n.each(i,function(t,i){e=n(i).find("tbody > tr").eq(o),u.removeErrorRow(e)})}));return n("<td/>").attr({colspan:u._columnHeadersView.getColumnCount(),role:"presentation"}).prepend(h).append(c).appendTo(s),s},renderErrorRow:function(t,i){var r=this,u,f,e,o=i>=0?r._rowsView:r._columnHeadersView,s=o.getTableElements();n.each(s,function(h,c){f=r._createErrorRow(t,s),e=n(c).find("tr"),i>=0?(u=o._getRowElements(n(c)).eq(i),r.removeErrorRow(e.eq(u.index()+1)),f.insertAfter(u)):(r.removeErrorRow(e.last()),n(c).append(f))})},removeErrorRow:function(n){n.hasClass(r)&&n.remove()},optionChanged:function(n){var t=this;switch(n.name){case"errorRowEnabled":n.handled=!0;break;default:t.callBase(n)}}}),i.registerModule("errorHandling",{defaultOptions:function(){return{errorRowEnabled:!0}},controllers:{errorHandling:i.ErrorHandlingController},extenders:{controllers:{data:{init:function(){var n=this,t=n.getController("errorHandling");n.callBase(),n.dataErrorOccurred.add(function(i){var r=i&&i.message||i;n.option("errorRowEnabled")&&t.renderErrorRow(r)})}}}}})}(jQuery,DevExpress),function(n,t){var h=t.ui,i=t.utils,r=h.dxDataGrid,c=t.data.utils.normalizeSortingInfo,l="dx-datagrid-total-footer",a="dx-datagrid-summary-item",v="dx-datagrid-text-content",y="dx-datagrid-group-footer",p="dx-datagrid-group-text-content",u="groupFooter",e=function(t,i){var u,o=i.column,e=i.summaryItems,f,s=[];if(!o.command&&e){for(u=0;u<e.length;u++)f=e[u],s.push(n("<div>").css("text-align",f.alignment||o.alignment).addClass(a).addClass(v).addClass(f.cssClass).toggleClass(p,i.rowType==="group").text(r.getSummaryText(f,i.summaryTexts)));t.append(s)}},o=function(n,t){var i=n.option("summary.texts");return{totalItem:t.row,summaryItems:t.row.summaryCells[t.columnIndex],summaryTexts:i}},f,s;r.FooterView=r.ColumnsView.inherit(function(){return{_getRows:function(){return this._dataController.footerItems()},_getCellOptions:function(t){return n.extend(this.callBase(t),o(this,t))},_renderCellContent:function(n,t){e(n,t),this.callBase(n,t)},_renderCore:function(){var n=this._dataController.footerItems()[0];this.element().empty().addClass(l),n&&n.summaryCells&&n.summaryCells.length&&this._setTableElement(this._renderTable())},_renderTable:function(){var n=this.callBase.apply(this,arguments),t=this.element();return this.wrapTableInScrollContainer(n).appendTo(t),n},_columnOptionChanged:function(n){var t=n.optionNames;n.changeTypes.grouping||(t.width||t.visibleWidth)&&this.callBase(n)},_handleDataChanged:function(n){n.changeType==="refresh"&&this.render()},getHeight:function(){var n=this.element();return n?n.outerHeight():0},isVisible:function(){return!!this._dataController.footerItems().length}}}()),f=function(){return{init:function(){this.callBase.apply(this,arguments),this._totalAggregates=[]},summary:function(n){if(!arguments.length)return this._summary;this._summary=n},totalAggregates:function(){return this._totalAggregates}}}(),s=function(){var r=function(n,i,r,u){var f;i&&(f=new t.data.AggregateCalculator({totalAggregates:i.totalAggregates,groupAggregates:i.groupAggregates,data:r,groupLevel:u}),f.calculate()),n._totalAggregates=f?f.totalAggregates():[]},i=function(r,u,f){if(!r||!u.length)return r;var s=u[0],o=f[0],e;return s&&o&&o.length&&(e=t.data.query(r),n.each(o,function(n){e=n===0?e.sortBy(this.selector,this.desc):e.thenBy(this.selector,this.desc)}),e.enumerate().done(function(n){r=n})),u=u.slice(1),f=f.slice(1),u.length&&f.length&&n.each(r,function(){this.items=i(this.items,u,f)}),r},u=function(n,t,r){var u=r&&r.sortByGroups&&r.sortByGroups();return u&&u.length?i(n,t,u):n};return{_handleDataLoadedCore:function(n){var t=this,i=c(n.loadOptions.group||[]),f=t.summary();r(t,f,n.data,i.length),n.data=u(n.data,i,f),n.totalAggregates=t._totalAggregates,t.callBase(n)}}}(),r.DataSourceAdapterServer=r.DataSourceAdapterServer.inherit(f),r.DataSourceAdapterClient=r.DataSourceAdapterClient.inherit(f).inherit(s),r.registerModule("summary",{defaultOptions:function(){return{summary:{groupItems:undefined,totalItems:undefined,calculateCustomSummary:undefined,texts:{sum:Globalize.localize("dxDataGrid-summarySum"),sumOtherColumn:Globalize.localize("dxDataGrid-summarySumOtherColumn"),min:Globalize.localize("dxDataGrid-summaryMin"),minOtherColumn:Globalize.localize("dxDataGrid-summaryMinOtherColumn"),max:Globalize.localize("dxDataGrid-summaryMax"),maxOtherColumn:Globalize.localize("dxDataGrid-summaryMaxOtherColumn"),avg:Globalize.localize("dxDataGrid-summaryAvg"),avgOtherColumn:Globalize.localize("dxDataGrid-summaryAvgOtherColumn"),count:Globalize.localize("dxDataGrid-summaryCount")}},sortByGroupSummaryInfo:undefined}},views:{footerView:r.FooterView},extenders:{controllers:{data:function(){return{_isDataColumn:function(n){return n&&(!i.isDefined(n.groupIndex)||n.showWhenGrouped)},_isGroupFooterVisible:function(){for(var i=this.option("summary.groupItems")||[],t,r,n=0;n<i.length;n++)if(t=i[n],r=this._columnsController.columnOption(t.column),t.showInGroupFooter&&this._isDataColumn(r))return!0;return!1},_processGroupItems:function(n,t,i){var r=this.callBase.apply(this,arguments);return i&&(i.isGroupFooterVisible===undefined&&(i.isGroupFooterVisible=this._isGroupFooterVisible()),i.data&&i.data.items&&i.isGroupFooterVisible&&r.push({rowType:u,data:i.data,groupIndex:i.path.length-1,values:[]})),r},_processGroupItem:function(t,r){var o=this,f,e;return r.summaryGroupItems||(r.summaryGroupItems=o.option("summary.groupItems")||[]),t.rowType==="group"&&(f=-1,e=-1,n.each(r.visibleColumns,function(n){return t.groupIndex===this.groupIndex&&(f=this.index),n>0&&i.isDefined(r.visibleColumns[n-1].groupIndex)&&!i.isDefined(this.groupIndex)?(e=this.index,!1):void 0}),t.summaryCells=this._calculateSummaryCells(r.summaryGroupItems,t.data.aggregates||[],r.visibleColumns,function(n,t){return n.showInGroupFooter?-1:n.alignByColumn&&t&&!i.isDefined(t.groupIndex)&&t.index!==e?t.index:f})),t.rowType===u&&(t.summaryCells=this._calculateSummaryCells(r.summaryGroupItems,t.data.aggregates||[],r.visibleColumns,function(n,t){return n.showInGroupFooter&&o._isDataColumn(t)?t.index:-1})),t},_calculateSummaryCells:function(t,u,f,e){var s=this,h=[],o={};return n.each(t,function(t,f){var h=s._columnsController.columnOption(f.column),a=f.showInColumn&&s._columnsController.columnOption(f.showInColumn)||h,c=e(f,a),l;c>=0&&(o[c]||(o[c]=[]),l=u[t],i.isDefined(l)&&!isNaN(l)&&o[c].push(n.extend({},f,{value:l,valueFormat:i.isDefined(f.valueFormat)?f.valueFormat:r.getFormatByDataType(h&&h.dataType),columnCaption:h&&h.index!==c?h.caption:undefined})))}),n.isEmptyObject(o)||n.each(f,function(){h.push(o[this.index]||[])}),h},_getSummaryCells:function(n,t){var i=this,r=i._columnsController;return i._calculateSummaryCells(n,t,r.getVisibleColumns(),function(n,t){return i._isDataColumn(t)?t.index:-1})},_updateItemsCore:function(n){var t=this,i,u,f=t._dataSource,r=t.option("summary.totalItems");t.callBase(n),t._footerItems=[],f&&r&&r.length&&(u=f.totalAggregates(),i=this._getSummaryCells(r,u),i.length&&t._footerItems.push({rowType:"totalFooter",summaryCells:i}))},_getAggregates:function(i){var u=this,f=u.getController("columns"),r=u.option("summary.calculateCustomSummary");return n.map(i||[],function(i){var o=f.columnOption(i.column),h=o&&o.calculateCellValue?n.proxy(o,"calculateCellValue"):t.data.utils.compileGetter(o?o.dataField:i.column),s=i.summaryType||"count",c=h,e;return(s==="avg"||s==="sum")&&(c=function(n){return Number(h(n))}),s==="custom"&&(r||(t.log("E1026"),r=function(){}),e={component:u.component,name:i.name,summaryProcess:"start",totalValue:undefined},r(e),e.summaryProcess="calculate",s={seed:e.totalValue,step:function(n,t){return e.summaryProcess="calculate",e.totalValue=n,e.value=t,r(e),e.totalValue},finalize:function(n){return e.summaryProcess="finalize",e.totalValue=n,delete e.value,r(e),e.totalValue}}),{selector:c,aggregator:s}})},_addSortInfo:function(n,t,r,u){var f;t&&(f=t.groupIndex,u=u||t.sortOrder,i.isDefined(f)&&(n[f]=n[f]||[],n[f].push({selector:r,desc:u==="desc"})))},_findSummaryItem:function(t,r){var u=-1,f=function(n){var t=n.summaryType,i=n.column;return t&&i&&t+"_"+i};return i.isDefined(r)&&n.each(t||[],function(n){if(this.name===r||n===r||this.summaryType===r||this.column===r||f(this)===r)return u=n,!1}),u},_getSummarySortByGroups:function(t,r){var u=this,e=u._columnsController,o=e.getGroupColumns(),f=[];if(r&&r.length)return n.each(t||[],function(){var h=this.sortOrder,t=this.groupColumn,c=u._findSummaryItem(r,this.summaryItem),s;c<0||(s=function(n){return n.aggregates[c]},i.isDefined(t)?(t=e.columnOption(t),u._addSortInfo(f,t,s,h)):n.each(o,function(n,t){u._addSortInfo(f,t,s,h)}))}),f},_createDataSourceAdapterCore:function(n,t){var r=this._getSummaryOptions(),i;return t==="auto"&&r&&(t={filtering:!0,sorting:!0,paging:!1}),i=this.callBase(n,t),i.summary(r),i},_getSummaryOptions:function(){var n=this,t=n.option("summary.groupItems"),u=n.option("summary.totalItems"),f=n.option("sortByGroupSummaryInfo"),i=n._getAggregates(t),r=n._getAggregates(u),e=function(){return n._getSummarySortByGroups(f,t)};if(i.length||r.length)return{groupAggregates:i,totalAggregates:r,sortByGroups:e}},publicMethods:function(){var n=this.callBase();return n.push("getTotalSummaryValue"),n},getTotalSummaryValue:function(n){var t=this._findSummaryItem(this.option("summary.totalItems"),n),i=this._dataSource.totalAggregates();if(i.length&&t>-1)return i[t]},optionChanged:function(n){(n.name==="summary"||n.name==="sortByGroupSummaryInfo")&&(n.name="dataSource"),this.callBase(n)},init:function(){this._footerItems=[],this.callBase()},footerItems:function(){return this._footerItems}}}()},views:{rowsView:function(){return{_createRow:function(n){var t=this.callBase(n);return n&&t.addClass(n.rowType===u?y:""),t},_renderCells:function(n,t){this.callBase.apply(this,arguments),t.row.rowType==="group"&&t.row.summaryCells&&t.row.summaryCells.length&&this._renderGroupSummaryCells(n,t)},_hasAlignByColumnSummaryItems:function(n,t){return t.row.summaryCells[t.row.summaryCells.length-n].length},_renderGroupSummaryCells:function(n,t){for(var u=n.children().last(),f=Number(u.attr("colspan"))||1,r=0,i=1;i<f;i++)r=this._hasAlignByColumnSummaryItems(i,t)?i:r;r>0&&this._renderGroupSummaryCellsCore(u,t,f,r)},_renderGroupSummaryCellsCore:function(t,i,r,u){var f,e;for(t.attr("colspan",r-u),f=0;f<u;f++)e=i.columns.length-u+f,this._renderCell(t.parent(),n.extend({column:i.columns[e],columnIndex:e},i))},_getColumnTemplate:function(n){return!n.column.command&&!i.isDefined(n.column.groupIndex)&&n.summaryItems&&n.summaryItems.length?e:this.callBase(n)},_getCellOptions:function(t){var i=this,r=i.callBase(t);return t.row.summaryCells?n.extend(r,o(i,t)):r}}}()}}})}(jQuery,DevExpress),function(n,t){var f=t.ui,r=t.utils,i=f.dxDataGrid,u="dx-master-detail-cell",e="dx-master-detail-row",o="dx-row-lines";i.registerModule("masterDetail",{defaultOptions:function(){return{masterDetail:{enabled:!1,autoExpandAll:!1,template:null}}},extenders:{controllers:{editorFactory:{focus:function(n){if(n&&n.hasClass(u))this.loseFocus();else return this.callBase(n)}},columns:{_getExpandColumnsCore:function(){var n=this.callBase();return this.option("masterDetail.enabled")&&n.push({}),n}},data:function(){var t=function(n){n._expandedItems=[],n._isExpandAll=n.option("masterDetail.autoExpandAll")};return{init:function(){var i=this;t(i),i.loadingChanged.add(function(t){t||(i._expandedItems=n.grep(i._expandedItems,function(n){return n.visible}))}),i.callBase()},expandAll:function(n){var t=this;n<0?(t._isExpandAll=!0,t._expandedItems=[],t.updateItems()):t.callBase.apply(t,arguments)},collapseAll:function(n){var t=this;n<0?(t._isExpandAll=!1,t._expandedItems=[],t.updateItems()):t.callBase.apply(t,arguments)},isRowExpanded:function(n){var t=this,u=i.getIndexByKey(n,t._expandedItems);return r.isArray(n)?t.callBase.apply(t,arguments):!!(t._isExpandAll^(u>=0&&t._expandedItems[u].visible))},_changeRowExpandCore:function(n){var t=this,u,f,e;if(r.isArray(n))return t.callBase.apply(t,arguments);u=i.getIndexByKey(n,t._expandedItems),u>=0?(e=t._expandedItems[u].visible,t._expandedItems[u].visible=!e):t._expandedItems.push({key:n,visible:!0}),f=t.getRowIndexByKey(n),t.updateItems({changeType:"update",rowIndices:[f,f+1]})},_processDataItem:function(t,i){var f=this,u=f.callBase.apply(f,arguments);return u.isExpanded=f.isRowExpanded(u.key),i.detailColumnIndex===undefined&&(i.detailColumnIndex=-1,n.each(i.visibleColumns,function(n,t){if(t.command==="expand"&&!r.isDefined(t.groupIndex))return i.detailColumnIndex=n,!1})),i.detailColumnIndex>=0&&(u.values[i.detailColumnIndex]=u.isExpanded),u},_processItems:function(){var t=this,u=t.callBase.apply(t,arguments),f,r=[];return this._isLoadingAll?u:(n.each(u,function(n,u){r.push(u),f=i.getIndexByKey(u.key,t._expandedItems),u.rowType==="data"&&(u.isExpanded||f>=0)&&!u.inserted&&r.push({visible:u.isExpanded,rowType:"detail",key:u.key,data:u.data,values:[]})}),r)},optionChanged:function(n){var e=this,i,r,u,f;if(n.name==="masterDetail"){n.name="dataSource";switch(n.fullName){case"masterDetail":i=n.value||{},r=n.previousValue||{},u=i.enabled!==r.enabled,f=i.autoExpandAll!==r.autoExpandAll;break;case"masterDetail.enabled":u=!0;break;case"masterDetail.autoExpandAll":f=!0}(u||f)&&t(e)}e.callBase(n)},refresh:function(){var n=this;return t(n),n.callBase.apply(n,arguments)}}}()},views:{rowsView:function(){return{_getColumnTemplate:function(n){var t=this,r=n.column,i;return i=r.command==="detail"?t.option("masterDetail.template")||t._getDefaultTemplate(r):t.callBase.apply(t,arguments)},_createRow:function(n){var t=this.callBase(n);return n&&n.rowType==="detail"&&(this.option("showRowLines")&&t.addClass(o),t.addClass(e).toggle(n.visible)),t},_getGroupCellOptions:function(n){var t=n.row,u=this._columnsController.getGroupColumns(),i=u.length+n.columnsCountBeforeGroups,r=i+Number(this.option("masterDetail.enabled"));return t&&t.rowType==="detail"?{columnIndex:i,emptyCellsCount:r,colspan:n.columns.length-r}:this.callBase(n)},_renderCells:function(n,t){var i=t.row,e,f=this._getGroupCellOptions(t),r;if(i.rowType==="detail"){for(r=0;r<f.emptyCellsCount;r++)this._renderCell(n,{value:null,row:i,rowIndex:i.rowIndex,column:t.columns[r]});e=this._renderCell(n,{value:null,row:i,rowIndex:i.rowIndex,column:{command:"detail"},columnIndex:f.columnIndex}),e.addClass(u).attr("colspan",f.colspan)}else this.callBase.apply(this,arguments)}}}()}}})}(jQuery,DevExpress),function(n,t){var l=t.ui,a=t.utils,u=l.dxDataGrid,f="dx-datagrid-content",v="dx-group-row",y="dx-first-cell",o="dx-state-hover",p="dx-header-row",r="dx-datagrid-content-fixed",w="dx-col-fixed",s="dx-pointer-events-target",h="dx-pointer-events-none",c=function(t){var i;return n.each(t,function(n,t){if(t.command==="transparent")return i=n,!1}),i},e={init:function(){this.callBase(),this._isFixedTableRendering=!1,this._isFixedColumns=!1},_createCol:function(n){return this.callBase(n).toggleClass(w,this._isFixedTableRendering&&(n.fixed||n.command&&n.command!=="transparent"))},_createCell:function(n){return this.callBase(n).attr("colspan",n.colspan).toggleClass(h,n.command==="transparent")},_createTable:function(t){var i=this,r=i.callBase(t),u=i.option("hoverStateEnabled"),f=function(n,t){i._fixedTableElement&&i._getRowElements(i._fixedTableElement).eq(n).toggleClass(o,t),i._tableElement&&i._getRowElements(i._tableElement).eq(n).toggleClass(o,t)};if(u&&i._isFixedColumns)r.on("mouseover mouseout",".dx-data-row",i.createAction(function(t){var r=t.jQueryEvent;f(i.getRowIndex(n(r.target).closest(".dx-row")),r.type==="mouseover")}));return r},_renderTable:function(t){var i=this,f,e,u=i._columnsController.getFixedColumns();return i._isFixedColumns=!!u.length,e=i.callBase(t),i._isFixedColumns?(i._isFixedTableRendering=!0,i._fixedTableElement=f=i._createTable(u),i._renderRows(f,n.extend({},t,{columns:u})),i.wrapTableInScrollContainer(i._fixedTableElement).appendTo(i.element()).addClass(r+" "+s),i._isFixedTableRendering=!1):(i._fixedTableElement&&i._fixedTableElement.remove(),i._fixedTableElement=null),e},_renderCellContent:function(n,t){var i=this,u,r=t.column;if(!i._isFixedTableRendering&&i._isFixedColumns&&(t.rowType!=="group"||!a.isDefined(r.groupIndex))){if(r.fixed||r.command){n.html("&nbsp;").addClass(r.cssClass);return}if(t.rowType==="filter"){i.callBase(n,t),u=c(i._columnsController.getFixedColumns()),n.toggleClass(y,t.columnIndex===u);return}}r.command!=="transparent"&&i.callBase(n,t)},getCellElements:function(t){var i=this,f,r=0,e,u=i.callBase(t);return i._fixedTableElement&&u&&(f=i._columnsController.getFixedColumns(),e=i._fixedTableElement.find(".dx-row").eq(t).children("td"),n.each(f,function(n,t){t.command==="transparent"?r+=t.colspan:(u[r]=e.get(n),r++)})),u},getColumnWidths:function(){var t=this,n,i=0,f,r=t.callBase(),e=t._columnsController.getFixedColumns();if(t._fixedTableElement&&r.length)for(f=u.getWidths(t._fixedTableElement),n=0;n<e.length;n++)e[n].command==="transparent"?i+=e[n].colspan:(r[i]<f[n]&&(r[i]=f[n]),i++);return r},_getTableElement:function(){return this._isFixedTableRendering?this._fixedTableElement:this.callBase()},_setTableElement:function(n){this._isFixedTableRendering?this._fixedTableElement=n:this.callBase(n)},getColumns:function(n){return(n=n||this._getTableElement(),this._isFixedTableRendering||n&&n.closest("table").parent("."+r).length)?this._columnsController.getFixedColumns():this.callBase(n)},getRowIndex:function(n){var t=this._fixedTableElement;return t&&t.find(n).length?this._getRowElements(t).index(n):this.callBase(n)},getTableElements:function(){var n=this.callBase.apply(this,arguments);return this._fixedTableElement&&(n=n.add(this._fixedTableElement)),n},getFixedColumns:function(){return this._columnsController.getFixedColumns()},getFixedColumnsOffset:function(){var i={left:0,right:0},n,t;return this._fixedTableElement&&(n=this.getTransparentColumnElement(),t=n.position(),i={left:t.left,right:this.element().outerWidth(!0)-(n.outerWidth(!0)+t.left)}),i},getTransparentColumnElement:function(){return this._fixedTableElement&&this._fixedTableElement.find("."+h).first()},isFixedColumns:function(){return this._isFixedColumns},_resizeCore:function(){this.callBase(),this._synchronizeRows()},setColumnWidths:function(n){this.callBase(n),this._synchronizeRows()},_getClientHeight:function(n){var t=n.getBoundingClientRect&&n.getBoundingClientRect();return t&&t.height?t.height:n.clientHeight},_synchronizeRows:function(){var n=this,r,u,t,e,o,i,f;if(n._isFixedColumns&&n._tableElement&&n._fixedTableElement&&(e=n._getClientHeight(n._tableElement.get(0)),o=n._getClientHeight(n._fixedTableElement.get(0)),i=n._getRowElements(n._tableElement),f=n._getRowElements(n._fixedTableElement),e!==o))for(i.height(""),f.height(""),t=0;t<i.length;t++)r=n._getClientHeight(i.get(t)),u=n._getClientHeight(f.get(t)),r>u?f.eq(t).css("height",r):r<u&&i.eq(t).css("height",u)},_rowPrepared:function(n,t){this._isFixedTableRendering||this.callBase(n,t)}},b=n.extend({},e,{getContextMenuItems:function(n){var i=this,f,t,r,u=i.option("columnFixing"),e=i.callBase(n);return n.closest("."+p).length&&(f=n.closest("td"),t=f.length&&i.getColumns(n)[f[0].cellIndex],t.allowFixing&&(r=function(n){switch(n.itemData.value){case"none":i._columnsController.columnOption(t.index,"fixed",!1);break;case"left":i._columnsController.columnOption(t.index,"fixed",!0),i._columnsController.columnOption(t.index,"fixedPosition","left");break;case"right":i._columnsController.columnOption(t.index,"fixed",!0),i._columnsController.columnOption(t.index,"fixedPosition","right")}},e.push({text:u.texts.fix,beginGroup:!0,items:[{text:u.texts.leftPosition,value:"left",disabled:t.fixed&&(!t.fixedPosition||t.fixedPosition==="left"),onItemClick:r},{text:u.texts.rightPosition,value:"right",disabled:t.fixed&&t.fixedPosition==="right",onItemClick:r}]},{text:u.texts.unfix,value:"none",disabled:!t.fixed,onItemClick:r}))),e},setScrollerSpacing:function(n){var t=this,i=t.option("rtlEnabled");t.callBase(n),t.element().children("."+r).css(i?{paddingLeft:n}:{paddingRight:n})},getFixedColumnElements:function(){return this._fixedTableElement&&this._getRowElements(this._fixedTableElement).eq(0).children()}}),k=n.extend({},e,{_renderTable:function(t){var i=this,f,e,r,u=i._columnsController.getFixedColumns();return i._isFixedColumns=!!u.length,e=i.callBase(t),i._isFixedColumns?(i._isFixedTableRendering=!0,r=i._createTable(u),i._fixedTableElement=i._fixedTableElement||r,i._renderRows(r,n.extend({},t,{columns:u})),f=i._findContentElement(),i._updateContent(f,t.change,r),i._isFixedTableRendering=!1):(i._fixedTableElement&&i._fixedTableElement.remove(),i._fixedTableElement=null),e},_findContentElement:function(){var i=this,r,t,e,u=i.element();return u&&i._isFixedTableRendering?(r=u.children("."+f),r.length||(t=i.getScrollable(),r=n("<div/>").addClass(f).on("dxmousewheel",function(n){if(t&&(e=t.scrollTop(),t.scrollTo({y:e-n.delta}),t.scrollTop()>0&&t.scrollTop()+t.clientHeight()<t.scrollHeight()+i.getScrollbarWidth()))return!1}).appendTo(u)),r):i.callBase()},_updateBottomLoading:function(){this._isFixedTableRendering||this.callBase()},_renderContent:function(n,t){return this._isFixedTableRendering?n.empty().addClass(f+" "+r+" "+s).append(t):this.callBase(n,t)},_getGroupCellOptions:function(t){return this._isFixedTableRendering?this.callBase(n.extend({},t,{columns:this._columnsController.getVisibleColumns()})):this.callBase(t)},_renderGroupSummaryCells:function(t,i){this._isFixedTableRendering?this.callBase(t,n.extend({},i,{columns:this._columnsController.getVisibleColumns()})):this.callBase(t,i)},_renderGroupSummaryCellsCore:function(n){this._isFixedTableRendering?n.css("visibility","hidden"):this.callBase.apply(this,arguments)},getCellIndex:function(t){var r=this._fixedTableElement,u,i=0;return r&&r.find(t).length?(u=this._columnsController.getFixedColumns(),n.each(u,function(n,r){if(n===t[0].cellIndex)return!1;if(r.colspan){i+=r.colspan;return}i++}),i):this.callBase(t)},_updateFixedTablePosition:function(n){this._fixedTableElement&&this._tableElement&&this._fixedTableElement.css("top",n+this._tableElement.position().top)},setScrollerSpacing:function(){var n=this,t=n.getScrollbarWidth(),u=n.getScrollbarWidth(!0),i=n.option("rtlEnabled")?{marginLeft:t}:{marginRight:t};i.marginBottom=u,n.element().children("."+r).css(i)},_handleScroll:function(n){this._updateFixedTablePosition(-n.scrollOffset.top),this.callBase(n)},_updateContentPosition:function(){var n=this.callBase();return n&&this._updateFixedTablePosition(-this._scrollTop),n},getCell:function(n){var i=this,r=i.getColumns(),t=n.columnIndex,f=i._getRowElements(i._fixedTableElement),e=f.eq(n.rowIndex),o=e.hasClass(v),s,u;return r&&t<r.length&&(r[t].fixed||r[t].command==="expand"||o)&&(s=f,u=e.find("[colspan]"),!o&&u.length&&u[0].cellIndex<t&&(n.columnIndex=t-u.attr("colspan")+1)),i.callBase(n,s)}}),d=e;u.registerModule("fixedColumns",{defaultOptions:function(){return{columnFixing:{enabled:!1,texts:{fix:Globalize.localize("dxDataGrid-columnFixingFix"),unfix:Globalize.localize("dxDataGrid-columnFixingUnfix"),leftPosition:Globalize.localize("dxDataGrid-columnFixingLeftPosition"),rightPosition:Globalize.localize("dxDataGrid-columnFixingRightPosition")}}}},extenders:{views:{columnHeadersView:b,rowsView:k,footerView:d},controllers:function(){var t=function(t,i){var r=c(t);return r&&n.each(i,function(n,i){i.index>r&&(i.columnIndex+=t[r].colspan-1,i.index+=t[r].colspan-1)}),i};return{draggingHeader:{_generatePointsByColumns:function(n){var r,i=n.targetDraggingPanel;return i&&i.getName()==="headers"&&i.isFixedColumns()&&n.sourceColumn.fixed?(n.columnElements=i.getFixedColumnElements(),n.columns=i.getFixedColumns(),r=this.callBase(n),t(n.columns,r)):this.callBase(n)},_pointCreated:function(n,t,i,r){var f=this.callBase.apply(this,arguments),e=this._columnHeadersView.getTransparentColumnElement(),u;return!f&&i==="headers"&&e?(u=e.get(0).getBoundingClientRect(),r&&r.fixed?r.fixedPosition==="right"?n.x<u.right:n.x>u.left:n.x<u.left||n.x>u.right):f}},columnsResizer:{_generatePointsByColumns:function(){var n=this,r=n._columnsController?n._columnsController.getFixedColumns():[],i=n._columnHeadersView.getFixedColumnElements(),f=[];n.callBase(),i&&i.length>0&&(f=u.getPointsByColumns(i,function(t){return n._pointCreated(t,i.length,r)}),n._pointsByFixedColumns=t(r,f))},_pointCreated:function(n,t,i){var r,u;return n.index>0&&n.index<t&&(r=i[n.columnIndex-1]||{},u=i[n.columnIndex]||{},r.fixed||u.fixed)?(n.columnIndex-=1,!((r.allowResizing||r.command==="transparent")&&(u.allowResizing||u.command==="transparent"))):this.callBase.apply(this,arguments)},_getTargetPoint:function(n,t,i){var u=this._columnHeadersView.getTransparentColumnElement(),r;return u&&(r=u.get(0).getBoundingClientRect(),t<=r.left||t>=r.right)?this.callBase(this._pointsByFixedColumns,t,i):this.callBase(n,t,i)}},keyboardNavigation:{_scrollToElement:function(n){var t=this.getFocusedView();this.callBase(n,t&&t.getFixedColumnsOffset())}}}}()}})}(jQuery,DevExpress),function(n,t){var u=t.ui,i=t.utils,r=u.dxDataGrid,f="dx-datagrid-checkbox-size",e="dx-datagrid-export-menu",o="dx-datagrid-export-button",s="export-to",h="exportxlsx",c="export-excel-button";r.DataProvider=t.Class.inherit({_getGroupValue:function(n){var t=this._options.groupColumns[n.groupIndex],f=r.getDisplayValue(t,n.values[n.groupIndex]),u=t.caption+": "+r.formatValue(f,t),i;return i=this._options.getVisibleIndex(t.index),n.summaryCells&&n.summaryCells.length&&n.summaryCells[i].length&&(u+=" "+r.getGroupRowSummaryText(n.summaryCells[i],this._options.summaryTexts)),u},_correctCellIndex:function(n){var t=this._options.startValueIndex,i=this._options.endValueIndex;return n<=i?t+n:null},ctor:function(n){this._options=n},getColumns:function(){return this._options.columns},getRowsCount:function(){return this._options.items.length},isGroupRow:function(n){return n<this._options.items.length&&this._options.items[n].rowType==="group"},getGroupLevel:function(n){var t=this._options.items[n],r=t.groupIndex;return t.isTotalSummary?0:i.isDefined(r)?r:this._options.groupColumns.length},getCellType:function(n,t){if(t<this._options.columns.length){var u=this._options.items.length&&this._options.items[n],r=this._options.columns[t];return u&&u.rowType==="data"&&isFinite(u.values[this._correctCellIndex(t)])&&!i.isDefined(r.customizeText)?i.isDefined(r.lookup)?r.lookup.dataType:r.dataType:"string"}},ready:function(){var t=this._options;return n.when(t.items).done(function(n){t.items=n})},getCellValue:function(n,t){var f,u,s=this._correctCellIndex(t),e,o=this._options.items.length&&this._options.items[n];if(o){e=o.values;switch(o.rowType){case"summaryFooter":if(s<e.length&&(u=e[s],i.isDefined(u)))return r.getSummaryText(u,this._options.summaryTexts);break;case"group":if(t<1)return this._getGroupValue(o);break;default:if(f=this._options.columns[t],f)return u=r.getDisplayValue(f,e[s]),!isFinite(u)||f.customizeText?r.formatValue(u,f):u}}},isHeadersVisible:function(){return this._options.isHeadersVisible},isTotalRow:function(n){var i=this._options.items,t=i[n];return t&&t.rowType==="summaryFooter"}}),r.ExportController=r.ViewController.inherit({_getColumns:function(){for(var u=[],f=this._columnsController.getVisibleColumns(),e=this._rowsView.getColumnWidths(),r,t=0;t<f.length;t++)r=f[t],i.isDefined(r.command)||u.push(n.extend({},r,{width:e[t]}));return u},_getFooterSummaryItems:function(n,t){var o=[],r=1,u,f,e,i,s=0;do{for(u=[],i=0;i<n.length;i++)e=n[i],f=e.length,r<f&&(r=f),u.push(e[s]);o.push({values:u,rowType:"summaryFooter",isTotalSummary:t})}while(s++<r-1);return o},_hasSummaryGroupFooters:function(){var n,t=this.option("summary.groupItems");if(i.isDefined(t))for(n=0;n<t.length;n++)if(t[n].showInGroupFooter)return!0;return!1},_getItemsWithSummaryGroupFooters:function(n){for(var t,i=[],r=[],f=[],u=0;u<n.length;u++)t=n[u],t.rowType==="groupFooter"?(f=this._getFooterSummaryItems(t.summaryCells),i=i.concat(r,f),r=[]):r.push(t);return i.length?i:r},_getAllItems:function(t){var r=this,u=n.Deferred(),f=this.getController("data"),h=f.footerItems(),e=h.length&&h[0],c=r.option("summary.totalItems"),o,s;return f.loadAll(t).done(function(n,t){r._hasSummaryGroupFooters()&&(n=r._getItemsWithSummaryGroupFooters(n)),o=e&&e.summaryCells,i.isDefined(t)&&c&&(o=f._getSummaryCells(c,t)),s=e&&r._getFooterSummaryItems(o,!0),s&&(n=n.concat(s)),u.resolve(n)}).fail(u.reject),u},_getSelectedItems:function(){var n=this.getController("selection"),t=n.getSelectedRowsData();return this._getAllItems(t)},_getStartEndValueIndexces:function(n){for(var r,u,f=n.length,t=0;t<f;t++)if(!i.isDefined(n[t].command)){r=t;break}for(t=f-1;t>=0;t--)if(!i.isDefined(n[t].command)){u=t;break}return{startIndex:r,endIndex:u}},init:function(){this._columnsController=this.getController("columns"),this._rowsView=this.getView("rowsView"),this.createAction("onExporting",{excludeValidators:["disabled","readOnly"]}),this.createAction("onExported",{excludeValidators:["disabled","readOnly"]}),this._clientExporter=new t.dxClientExporter({exportingAction:this.getAction("onExporting"),exportedAction:this.getAction("onExported")})},optionChanged:function(n){this.callBase(n),n.name==="onExporting"&&this._clientExporter.option("exportingAction",this.getAction(n.name)),n.name==="onExported"&&this._clientExporter.option("exportedAction",this.getAction(n.name))},callbackNames:function(){return["selectionOnlyChanged"]},getExportFormat:function(){return["EXCEL"]},getDataProvider:function(){var i=this._columnsController.getGroupColumns(),t=this._getStartEndValueIndexces(this._columnsController.getVisibleColumns());return new r.DataProvider({columns:this._getColumns(),groupColumns:i,items:!this._selectionOnly?this._getAllItems():this._getSelectedItems(),getVisibleIndex:n.proxy(this._columnsController.getVisibleIndex,this._columnsController),startValueIndex:t.startIndex,endValueIndex:t.endIndex,isHeadersVisible:this.option("showColumnHeaders"),summaryTexts:this.option("summary.texts")})},exportToExcel:function(n){this._selectionOnly=n;var t=this.option("export.excelWrapTextEnabled");i.isDefined(this._clientExporter)&&this._clientExporter.exportTo({fileName:this.option("export.fileName"),proxyUrl:this.option("export.proxyUrl"),format:"EXCEL",wrapTextEnabled:i.isDefined(t)?t:!!this.option("wordWrapEnabled"),autoFilterEnabled:!!this.option("export.excelFilterEnabled"),component:this.component})},publicMethods:function(){return["getDataProvider","getExportFormat","exportToExcel"]},selectionOnly:function(n){if(i.isDefined(n))this._isSelectedRows=n,this.selectionOnlyChanged.fire();else return this._isSelectedRows}}),r.registerModule("export",{defaultOptions:function(){return{"export":{enabled:!1,fileName:"DataGrid",excelFilterEnabled:!1,excelWrapTextEnabled:undefined,proxyUrl:undefined,allowExportSelectedData:!1,texts:{exportTo:Globalize.localize("dxDataGrid-exportTo"),exportToExcel:Globalize.localize("dxDataGrid-exportToExcel"),excelFormat:Globalize.localize("dxDataGrid-excelFormat"),selectedRows:Globalize.localize("dxDataGrid-selectedRows")}}}},controllers:{"export":r.ExportController},extenders:{controllers:{editing:{callbackNames:function(){var n=this.callBase();return i.isDefined(n)?n.push("editingChanged"):["editingChanged"]},_updateEditButtons:function(){this.callBase(),this.editingChanged.fire(this.hasChanges())}}},views:{headerPanel:{_isExportButtonVisible:function(){return this.option("export.enabled")},_getButtonOptions:function(){var n=this,t=n.option("export.texts");return n.option("export.allowExportSelectedData")?{hint:t.exportTo,icon:s}:{hint:t.exportToExcel,icon:c,onClick:function(){n._exportController.exportToExcel()}}},_renderExportButton:function(){var t=this;i.isDefined(t._$exportButton)&&t._$exportButton.remove(),t.option("export.enabled")&&(t._$exportButton=n("<div>").addClass(o).dxButton(t._getButtonOptions()),t.element().append(t._$exportButton))},_renderExportMenu:function(){var t=this,r=t.option("export.texts"),u=[{text:r.excelFormat,icon:h}];i.isDefined(t._exportContextMenu)&&t._exportContextMenu.element().remove(),t.option("export.enabled")&&t.option("export.allowExportSelectedData")&&(u.push({value:"selectionOnly",template:function(){return n("<div>").addClass(f).dxCheckBox({text:r.selectedRows,value:!!t._exportController.selectionOnly(),onValueChanged:function(n){t._exportController.selectionOnly(n.value)}})},beginGroup:!0,closeMenuOnClick:!1}),t._exportContextMenu=n("<div>").dxContextMenu({alternativeInvocationMode:{enabled:!0,invokingElement:t._$exportButton},items:u,cssClass:e,onItemClick:function(n){n.itemData.text&&n.itemData.text.indexOf("Excel")>-1&&t._exportController.exportToExcel(t._exportController.selectionOnly())},target:this._$exportButton,position:{at:"left bottom",my:"left top",offset:"0 3",collision:"fit",boundary:t._$parent,boundaryOffset:"1 1"}}).appendTo(t.component.element()).dxContextMenu("instance"))},_renderCore:function(){this.callBase(),this._renderExportButton(),this._renderExportMenu()},optionChanged:function(n){this.callBase(n),n.name==="export"&&(n.handled=!0,this._invalidate())},init:function(){var n=this;this.callBase(),this._exportController=this.getController("export"),this._editingController=this.getController("editing"),this._editingController.editingChanged.add(function(t){i.isDefined(n._$exportButton)&&n._$exportButton.dxButton("instance").option("disabled",t)})},isVisible:function(){return this.callBase()||this._isExportButtonVisible()}}}}})}(jQuery,DevExpress),function(n,t){var i=t.ui.dxDataGrid,r=t.utils,u="dx-datagrid",f="dx-hidden",l="dx-datagrid-table",e="dx-datagrid-borders",a="dx-datagrid-table-fixed",p="dx-datagrid-headers-hidden",o="dx-datagrid-important-margin",v=100,y=50,s=["columnsSeparatorView","blockSeparatorView","trackerView","headerPanel","columnHeadersView","rowsView","footerView","columnChooserView","pagerView","draggingHeaderView","contextMenuView","errorView","headerFilterView"],h=function(n){return r.isString(n)&&n.slice(-1)==="%"},c=function(n,t){var r=[],i;if(n&&t&&n.length&&n.length===t.length)for(i=0;i<n.length;i++)r.push(n[i]>t[i]?n[i]:t[i]);else n&&(r=n);return r};i.ResizingController=i.ViewController.inherit({_initPostRenderHandlers:function(){var n=this;n._refreshSizesHandler||(n._refreshSizesHandler=function(t){n._dataController.changed.remove(n._refreshSizesHandler);var i=t&&t.changeType;t&&i!=="refresh"&&i!=="prepend"&&i!=="append"&&i!=="update"||n.resize(),i&&i!=="updateSelection"&&(r.triggerShownEvent(n.getView("rowsView").element()),n.component._fireContentReadyAction())},n._dataController.changed.add(function(){n._dataController.changed.add(n._refreshSizesHandler)}),n._columnHeadersView.sizeChanged.add(n._refreshSizesHandler))},_getBestFitWidths:function(){var n=this,i=n._rowsView.getColumnWidths(),r=n._columnHeadersView&&n._columnHeadersView.getColumnWidths(),u=n._footerView&&n._footerView.getColumnWidths(),t;return t=c(i,r),t=c(t,u)},_setVisibleWidths:function(t,i){var r=this._columnsController;r.beginUpdate(),n.each(t,function(n,t){var u=t.command?"command:"+t.command:t.index;r.columnOption(u,"visibleWidth",i[n])}),r.endUpdate()},_toggleBestFitMode:function(n){var t=this.component.element();t.find("."+l).toggleClass(a,!n),t.find("input").toggleClass(f,n),t.find(".dx-group-cell").toggleClass(f,n),t.find(".dx-header-row .dx-datagrid-text-content").css("max-width","")},_synchronizeColumns:function(){var t=this,e=t._columnsController,i=e.getVisibleColumns(),f=t.option("columnAutoWidth"),u=f,o=!1,r=[],s=function(){var t;n.each(i,function(n,i){i.command==="expand"&&(t=r[n])}),n.each(i,function(n,i){i.command==="expand"&&t&&(r[n]=t)})};u||n.each(i,function(n,t){if(t.width==="auto")return u=!0,!1}),t._setVisibleWidths(i,[]),u&&(t._toggleBestFitMode(!0),r=t._getBestFitWidths(),n.each(i,function(n,t){var i=t.command?"command:"+t.command:t.index;e.columnOption(i,"bestFitWidth",r[n],!0)})),n.each(i,function(n){this.width!=="auto"&&(this.width?r[n]=this.width:f||(r[n]=undefined))}),o=t._correctColumnWidths(r,i),f&&(s(),t._processStretch(r,i)),u&&t._toggleBestFitMode(!1),(u||o)&&t._setVisibleWidths(i,r)},_correctColumnWidths:function(t,i){var r=this,s=!1,c=!1,l=!1,f=r.component.element(),a=r._hasWidth,u,e,o;if(n.each(i,function(n){this.width!=="auto"&&(this.width?t[n]=this.width:c=!0),h(this.width)&&(s=!0)}),f&&r._maxWidth&&(delete r._maxWidth,f.css("max-width","")),!c&&t.length&&(e=r._rowsView.contentWidth(),o=r._getTotalWidth(t,e),o<=e)){for(u=t.length-1;u>=0&&i[u]&&i[u].command;)u--;u>=0&&(t[u]="auto",l=!0,a||s||(r._maxWidth=o,f.css("max-width",r._maxWidth)))}return l},_processStretch:function(t,i){var s=this._rowsView.contentWidth(),h=this._getTotalWidth(t,s),u={length:0},f,e,o,r;if(t.length&&(n.each(i,function(n){this.width&&(u[n]=!0,u.length++)}),f=s-h,e=Math.floor(f/(t.length-u.length)),o=f-e*(t.length-u.length),f>=0))for(r=0;r<t.length;r++)u[r]||(t[r]+=e,o&&(t[r]++,o--))},_getTotalWidth:function(n,t){for(var u=0,i,r=0;r<n.length;r++)i=n[r],i&&(u+=h(i)?parseInt(i)*t/100:parseInt(i));return Math.round(u)},updateSize:function(n){var i=this,t,r;i._hasHeight===undefined&&n&&n.closest(document).length&&(t=n.children("."+u),t.length&&t.detach(),i._hasHeight=!!n.height(),r=n.width(),n.addClass(o),i._hasWidth=n.width()===r,n.removeClass(o),t.length&&t.appendTo(n))},publicMethods:function(){return["resize","updateDimensions"]},resize:function(){this.component._requireResize||this.updateDimensions()},updateDimensions:function(){var t=this,c=t._dataController,i=t.component.element(),o=i&&(i.get(0).clientHeight||i.height()),u=t.option("loadPanel"),f=t.option("height"),r,h=t.getController("editorFactory"),e;t._initPostRenderHandlers(),t.updateSize(i),f&&t._hasHeight^f!=="auto"&&(e=n("<div>").height(f).appendTo(i),t._hasHeight=!!e.height(),e.remove()),t._hasHeight&&o>0&&t.option("scrolling")?(r=o,n.each(t.getViews(),function(){this.isVisible()&&this.getHeight&&(r-=this.getHeight())})):r=t._hasHeight||c.items().length!==0?"auto":u&&u.visible?u.height+y:v,t._rowsView.height(r),t._columnHeadersView.setScrollerSpacing(t._rowsView.getScrollbarWidth()),t._rowsView.setScrollerSpacing(),t._synchronizeColumns(),n.each(s,function(n,i){var r=t.getView(i);r&&r.resize()}),h&&h.resize()},optionChanged:function(n){switch(n.name){case"width":case"height":this.component._renderDimensions(),this.resize();default:this.callBase(n)}},init:function(){var n=this;n._dataController=n.getController("data"),n._columnsController=n.getController("columns"),n._columnHeadersView=n.getView("columnHeadersView"),n._footerView=n.getView("footerView"),n._rowsView=n.getView("rowsView")}}),i.SynchronizeScrollingController=i.ViewController.inherit({_scrollChangedHandler:function(n,t,i){for(var r=0;r<n.length;r++)n[r].name!==i&&n[r].scrollTo({left:t.left,top:t.top})},init:function(){for(var i,r=[this.getView("columnHeadersView"),this.getView("footerView"),this.getView("rowsView")],t=0;t<r.length;t++)i=r[t],i&&i.scrollChanged.add(n.proxy(this._scrollChangedHandler,this,r))}}),i.GridView=i.View.inherit({_endUpdateCore:function(){this.component._requireResize&&(this.component._requireResize=!1,this._resizingController.resize())},init:function(){var n=this;n._resizingController=this.getController("resizing"),n._dataController=n.getController("data"),n._rowsView=n.getView("rowsView")},getView:function(n){return this.component._views[n]},element:function(){return this._groupElement},optionChanged:function(n){var t=this;r.isDefined(t._groupElement)&&n.name==="showBorders"?(t._groupElement.toggleClass(e,!!n.value),n.handled=!0):t.callBase(n)},render:function(t){var i=this,r=i._groupElement||n("<div />").addClass(u).toggleClass(e,!!i.option("showBorders"));i.component.setAria({role:"application",label:Globalize.localize("dxDataGrid-ariaDataGrid")},t),i._rootElement=t||i._rootElement,i._groupElement=r,n.each(s,function(n,t){var u=i.getView(t);u&&u.render(r)}),i.update()},update:function(){var n=this,t=n._rootElement,i=n._groupElement,r=n.getController("resizing");t&&i&&(i.parent().length||(r.updateSize(t),i.appendTo(t),n._rowsView.renderDelayedTemplates()),r.resize(),n._dataController.isLoaded()&&n.component._fireContentReadyAction())}}),i.registerModule("gridView",{defaultOptions:function(){return{showBorders:!1}},controllers:{resizing:i.ResizingController,synchronizeScrolling:i.SynchronizeScrollingController},views:{gridView:i.GridView}})}(jQuery,DevExpress),function(n,t){function f(n,t){for(var r=[],i=0;i<n.length;i++)r.push(Math.max(n[i]||0,t[i]||0));return r}function s(n,t){var i=n.groupElement().data("dxScrollable");if(i)i.on("scroll",t).on("stop",t)}function h(t,i){var e=0,u,f={},r=n("<div>").css({position:"absolute",visibility:"hidden",width:100,height:100}).appendTo(t),o=n("<p>").css({width:"100%",height:200}).appendTo(r);return i!=="auto"&&(f.useNative=!!i,f.useSimulatedScrollbar=!i),r.dxScrollable(f),u=r.dxScrollable("instance").option("useNative"),e=u?r.width()-o.width():0,r.remove(),{scrollBarWidth:e,scrollBarUseNative:u}}var u=t.ui,e=u.events,r=t.utils,o=10,i;t.registerComponent("dxPivotGrid",u,u.Widget.inherit({_setDefaultOptions:function(){this.callBase(),this.option({useNativeScrolling:"auto",encodeHtml:!0,descriptions:null,dataSource:null,activeStateEnabled:!1,fieldChooser:{minWidth:250,minHeight:250,enabled:!0,layout:0,title:Globalize.localize("dxPivotGrid-fieldChooserTitle"),width:600,height:600},onContextMenuPreparing:null,allowSorting:!1,allowSortingBySummary:!1,allowFiltering:!1,allowExpandAll:!1,showRowTotals:!0,showRowGrandTotals:!0,showColumnTotals:!0,showColumnGrandTotals:!0,loadPanel:{enabled:!0,text:Globalize.localize("Loading"),width:200,height:70,showIndicator:!0,indicatorSrc:"",showPane:!0},texts:{grandTotal:Globalize.localize("dxPivotGrid-grandTotal"),total:Globalize.localize("dxPivotGrid-total"),noData:Globalize.localize("dxDataGrid-noDataText"),showFieldChooser:Globalize.localize("dxPivotGrid-showFieldChooser"),expandAll:Globalize.localize("dxPivotGrid-expandAll"),collapseAll:Globalize.localize("dxPivotGrid-collapseAll"),sortColumnBySummary:Globalize.localize("dxPivotGrid-sortColumnBySummary"),sortRowBySummary:Globalize.localize("dxPivotGrid-sortRowBySummary"),removeAllSorting:Globalize.localize("dxPivotGrid-removeAllSorting")},onCellClick:null,onCellPrepared:null,onExpandValueChanging:null,renderCellCountLimit:2e4})},_initDataController:function(){var t=this,r;t._dataController&&t._dataController.dispose(),t._dataController=new i.DataController({descriptions:t.option("descriptions"),dataSource:t.option("dataSource"),texts:t.option("texts"),showRowTotals:t.option("showRowTotals"),showRowGrandTotals:t.option("showRowGrandTotals"),showColumnTotals:t.option("showColumnTotals"),showColumnGrandTotals:t.option("showColumnGrandTotals"),onFieldsPrepared:function(i){n.each(i,function(i,r){n.each(["allowSorting","allowSortingBySummary","allowFiltering","allowExpandAll"],function(n,i){r[i]===undefined&&(r[i]=t.option(i))})})}}),t._dataController.changed.add(function(){t._render()}),t._dataController.loadingChanged.add(function(){t._updateLoading()}),r=t.option("onExpandValueChanging"),r&&t._dataController.expandValueChanging.add(function(n){r(n)})},_init:function(){var n=this;n.callBase(),n._initDataController(),n._scrollLeft=n._scrollTop=null,n._initActions()},_initActions:function(){this._actions={onContextMenuPreparing:this._createActionByOption("onContextMenuPreparing")}},_trigger:function(n,t){this._actions[n](t)},_optionValuesEqual:function(n,i,r){return n==="dataSource"&&r instanceof t.data.PivotGridDataSource&&i instanceof t.data.PivotGridDataSource?r===i:this.callBase.apply(this,arguments)},_optionChanged:function(n){var t=this;switch(n.name){case"dataSource":case"descriptions":case"texts":case"showRowTotals":case"showRowGrandTotals":case"showColumnTotals":case"showColumnGrandTotals":case"showColumnGrandTotals":case"allowSorting":case"allowFiltering":t._initDataController(),t._fieldChooserPopup.hide(),t._invalidate();break;case"useNativeScrolling":case"encodeHtml":case"renderCellCountLimit":t._invalidate();break;case"rtlEnabled":t.callBase(n),t._renderFieldChooser(),t._renderContextMenu(),t._renderLoadPanel(t._dataArea.groupElement()),t._invalidate();break;case"onCellClick":case"onExpandValueChanging":case"onCellPrepared":case"allowSortingBySummary":case"allowExpandAll":break;case"onContextMenuPreparing":t._actions[n.name]=t._createActionByOption(n.name);break;case"fieldChooser":t._renderFieldChooser();break;case"loadPanel":t._renderLoadPanel(t._dataArea.groupElement()),t._invalidate();break;default:t.callBase(n)}},_updateScrollPosition:function(n,t,i){var r=this,u,f,e=function(n,t){var i;n&&(i=n.groupElement().data("dxScrollable"),i&&(i.scrollTo(t),i.update()))};t&&!t.hasScroll()&&(r._scrollTop=null),n&&!n.hasScroll()&&(r._scrollLeft=null),(r._scrollTop!==null||r._scrollLeft!==null)&&(u=r._scrollTop||0,f=r._scrollLeft||0,e(i,{x:f,y:u}),e(n,f),e(t,u))},_subscribeToEvents:function(n,t,i){var r=this;s(i,function(i){var u=i.scrollOffset;(r._scrollLeft!==u.left||r._scrollTop!==u.top)&&(r._scrollLeft=Math.floor(i.scrollOffset.left),r._scrollTop=Math.floor(i.scrollOffset.top),r._updateScrollPosition(n,t,null))});t.groupElement().off("dxmousewheel").on("dxmousewheel",function(n){var t=i.groupElement().data("dxScrollable");t&&t.scrollTo({y:r._scrollTop-Math.floor(n.delta)})})},_clean:n.noop,_needDelayResizing:function(){var n=this._dataController.getCellsInfo(),t=n.length*(n.length?n[0].length:0);return t>this.option("renderCellCountLimit")},_renderFieldChooser:function(){var t=this,u=t._pivotGridContainer,i=t.option("fieldChooser")||{},r={visible:!1,shading:!1,title:i.title,width:i.width,height:i.height,showCloseButton:!0,rtlEnabled:t.option("rtlEnabled"),onShown:function(n){var u=n.component,r=n.component.content();t._createComponent(r,"dxPivotGridFieldChooser",{layout:i.layout,texts:i.texts||{},dataSource:t.getDataSource(),width:undefined,height:undefined}),t._createComponent(r.parent(),"dxResizable",{handles:t.option("rtlEnabled")?"left bottom":"right bottom",onResize:function(){u._setContentHeight(),r.dxPivotGridFieldChooser("updateDimensions")},minWidth:i.minWidth,minHeight:i.minHeight})}};t._fieldChooserPopup?t._fieldChooserPopup.option(r):t._fieldChooserPopup=t._createComponent(n("<div>").addClass("dx-fieldchooser-popup").appendTo(u),"dxPopup",r)},_renderContextMenu:function(){var t=this,r=t._pivotGridContainer;t._contextMenu&&t._contextMenu.element().remove(),t._contextMenu=t._createComponent(n("<div>").appendTo(r),"dxContextMenu",{onPositioning:function(i){var r=i.jQueryEvent,f=r.target.cellIndex>=0?r.target:n(r.target).closest("td").get(0),e=t._createCellArgs(f),u=t._getContextMenuItems(e);u?i.component.option("items",u):i.canceled=!0},onItemClick:function(n){n.itemData.onItemClick&&n.itemData.onItemClick(n)},cssClass:i.cssClassNames.pivotGrid,target:t.element()})},_getContextMenuItems:function(t){var f=this,u=[],s;if(t.area==="row"||t.area==="column"){var c=t[t.area+"Fields"],h=t[t.area==="column"?"rowFields":"columnFields"],o=t.cell.path&&c[t.cell.path.length-1],e=f.getDataSource();o&&o.allowExpandAll&&t.cell.path.length<t[t.area+"Fields"].length&&t.cell.type==="D"&&(u.push({beginGroup:!0,icon:"none",text:f.option("texts.expandAll"),onItemClick:function(){e.expandAll(o.index)}}),u.push({text:f.option("texts.collapseAll"),icon:"none",onItemClick:function(){e.collapseAll(o.index)}})),t.cell.isLast&&(s=0,n.each(h,function(o,h){h.allowSortingBySummary&&n.each(t.dataFields,function(n,o){if(!r.isDefined(t.cell.dataIndex)||t.cell.dataIndex===n){var c=!r.isDefined(t.cell.dataIndex)&&t.dataFields.length>1,l=f.option(t.area==="column"?"texts.sortColumnBySummary":"texts.sortRowBySummary"),a=i.findField(t.dataFields,h.sortBySummaryField)===n&&(t.cell.path||[]).join("/")===(h.sortBySummaryPath||[]).join("/"),v=r.stringFormat(l,c?h.caption+" - "+o.caption:h.caption);u.push({beginGroup:s===0,icon:a?h.sortOrder==="desc"?"desc":"asc":"none",text:v,onItemClick:function(){e.field(h.index,{sortBySummaryField:o.caption||o.dataField,sortBySummaryPath:t.cell.path,sortOrder:h.sortOrder==="desc"?"asc":"desc"}),e.load()}}),s++}})}),n.each(h,function(t,i){if(i.allowSortingBySummary&&r.isDefined(i.sortBySummaryField))return u.push({beginGroup:s===0,icon:"none",text:f.option("texts.removeAllSorting"),onItemClick:function(){n.each(h,function(n,t){e.field(t.index,{sortBySummaryField:undefined,sortBySummaryPath:undefined,sortOrder:undefined})}),e.load()}}),!1}))}return f.option("fieldChooser.enabled")&&u.push({beginGroup:!0,icon:"field-chooser",text:f.option("texts.showFieldChooser"),onItemClick:function(){f._fieldChooserPopup.show()}}),t.items=u,f._trigger("onContextMenuPreparing",t),u=t.items,u&&u.length?u:void 0},_createCellArgs:function(t){var i=this,f=n(t),e=t.cellIndex,r=t.parentElement.rowIndex,o=f.closest("table"),s=o.data("area"),u=o.data("data"),h=u&&u[r]&&u[r][e];return{area:s,rowFields:i.getDataSource().getAreaFields("row"),columnFields:i.getDataSource().getAreaFields("column"),dataFields:i.getDataSource().getAreaFields("data"),rowIndex:r,columnIndex:e,cellElement:f,cell:h}},_handleCellClick:function(n){var i=this,r=i.option("onCellClick"),t=i._createCellArgs(n.currentTarget);!t.area&&(t.rowIndex||t.columnIndex)||(r&&r(t),t.handled||!t.area&&i.option("fieldChooser.enabled")&&i._fieldChooserPopup.show())},_getNoDataText:function(){return this.option("texts.noData")},_updateNoDataText:t.ui.dxDataGrid.RowsView.prototype._updateNoDataText,_renderLoadPanel:t.ui.dxDataGrid.RowsView.prototype._renderLoadPanel,_updateLoading:function(){var n=this;n._loadPanel&&n._loadPanel.option("visible",n._dataController.isLoading())},_renderContentImpl:function(){var t=this,l=n("<td>"),a=n("<td>"),v=n("<td>"),u=n("<table>"),f=t._dataArea||new i.DataArea(t),s=(t._rowsArea||new i.VerticalHeadersArea(t)).setDataController(t._dataController),o=(t._columnsArea||new i.HorizontalHeadersArea(t)).setDataController(t._dataController),y=h(t.element(),t.option("useNativeScrolling")),c;if(t._scrollBarWidth=y.scrollBarWidth,t._scrollBarUseNative=y.scrollBarUseNative,r.isDefined(t._pivotGridContainer))u=t._pivotGridContainer.children().first();else{t._pivotGridContainer=n("<div>"),t._renderFieldChooser(),t._renderContextMenu(),n("<tr>").append(n("<td>").addClass(i.cssClassNames.areaDescription)).append(l).appendTo(u),n("<tr>").addClass(i.cssClassNames.bottomAraesRow).append(a).append(v).appendTo(u),u.appendTo(t._pivotGridContainer);u.on(e.addNamespace("dxclick","dxPivotGrid"),"td",n.proxy(t,"_handleCellClick"))}t._rowsArea=s,t._columnsArea=o,t._dataArea=f,o.render(l,t._dataController.getColumnsInfo()),s.render(a,t._dataController.getRowsInfo()),f.render(v,t._dataController.getCellsInfo()),f.tableElement().prepend(o.headElement()),c=function(){t.updateDimensions(),t._subscribeToEvents(o,s,f)},r.isDefined(t._pivotGridContainer[0].parentElement)?c():(t._hasHeight=t.element().height()>0,t._pivotGridContainer.appendTo(t.element()),t.element().addClass(i.cssClassNames.pivotGrid).addClass(i.cssClassNames.rowLines),t._renderLoadPanel(f.groupElement()),s.processScroll(),o.processScroll(),t._needDelayResizing()?setTimeout(c):c())},_fireContentReadyAction:function(){this._dataController.isLoading()||this.callBase()},getScrollPath:function(n){var i=this,t,f=0,u,r;for(n==="column"?(u=i._scrollLeft,r=i._columnsArea.getColumnsWidth()):(u=i._scrollTop,r=i._rowsArea.getRowsHeight()),t=0;t<r.length;t++){if(u<f+r[t]/2)return i._dataController.getHeaderItemPath(n,t);f+=r[t]}},getDataSource:function(){return this._dataController.getDataSource()},hasScroll:function(n){var t=this;return n==="column"?t._columnsArea.hasScroll():t._rowsArea.hasScroll()},_dimensionChanged:function(){this.updateDimensions()},_visibilityChanged:function(n){n&&this.updateDimensions()},_dispose:function(){var n=this;n.callBase.apply(n,arguments),n._dataController&&n._dataController.dispose()},resize:function(){this.updateDimensions()},updateDimensions:function(){var r=this,nt,y,e,tt=r.element().find("table").first(),it,u=r._rowsArea,s=r._columnsArea,t=r._dataArea,w,b,h,p,k,rt=0,d=0,ut=0,c,a,ft=r.getDataSource().getAreaFields("data"),g=r.option("loadPanel")||{},v,l=r._scrollBarWidth||0;t.headElement().length||(t.tableElement().prepend(s.headElement()),t.resetColumnsWidth()),t.groupWidth(o),p=t.getColumnsWidth(),b=u.getRowsHeight(),w=t.getRowsHeight(),h=f(b,w.slice(w.length-b.length)),k=u.getColumnsWidth(),r._hasHeight&&(nt=r.element().height()-tt.height()-t.headElement().height(),it=tt.find("."+i.cssClassNames.bottomAraesRow),e=Math.floor(it.height()+nt)),rt=t.tableElement().width(),n.each(h,function(n,t){d+=t||0}),n.each(k,function(n,t){ut+=t||0}),y=r.element().width()-ut,c=e<d,a=y<rt,c||(e=d+(a?l:0)),s.tableElement().append(t.headElement()),h.length===1&&g.enabled&&g.height&&(v=g.height+50,h[0]<v&&(h[0]=v,e<v&&(e=v))),s.groupWidth(y),s.processScrollBarSpacing(c?l:0),s.processStretch(p,a,ft),s.setColumnsWidth(p),u.groupHeight(e),u.processScrollBarSpacing(a?l:0),u.setColumnsWidth(k),u.setRowsHeight(h),t.setColumnsWidth(p),t.setRowsHeight(h),t.groupWidth(y),t.groupHeight(e),t.groupElement().css("border-bottom-width",c||l?"0px":""),u.groupElement().css("border-bottom-width",c&&!l?"0px":""),t.processScroll(l,c,a,r._scrollBarUseNative),r._updateNoDataText(t.groupElement()),r._updateLoading(),r._updateScrollPosition(s,u,t)},applyPartialDataSource:function(n,t,i){this._dataController.applyPartialDataSource(n,t,i)}})),i=n.extend(u.dxPivotGrid,{cssClassNames:{pivotGrid:"dx-pivotgrid",rowLines:"dx-row-lines",area:"dx-pivotgrid-area",areaData:"dx-pivotgrid-area-data",areaDescription:"dx-pivotgrid-area-description",splitter:"dx-pivotgrid-splitter",splitterButton:"dx-button",splitterButtonDisable:"dx-button-disable",splitterExpand:"dx-expand",splitterCollapse:"dx-collapse",bottomAraesRow:"dx-bottom-row",verticalScroll:"dx-vertical-scroll",headersVertical:"dx-pivotgrid-vertical-headers",headersHorizontal:"dx-pivotgrid-horizontal-headers",headersVerticalLastCell:"dx-last-cell",headersVerticalExpandBorder:"dx-expand-border",headersExpandCollapseImage:"dx-expand",headersExpanded:"dx-pivotgrid-expanded",headersCollapsed:"dx-pivotgrid-collapsed",bottomBorder:"dx-pivotgrid-bottom-border",total:"dx-total",grandTotal:"dx-grandtotal",rowTotal:"dx-row-total"},mergeArraysByMaxValue:f})}(jQuery,DevExpress),function(n,t){function o(n,t){var r,u;if(n&&i.isDefined(t))for(r=0;r<n.length;r++)if(u=n[r],u.name===t||u.caption===t||u.dataField===t||u.index===t)return r;return-1}function u(n,t,i,r){var f,e;if(n)for(f=0;f<n.length;f++)if(e=n[f],e){if((i&&i.push(e.value),r&&t(e,i,f,n)===!1)||u(e.children,t,i,r)===!1||!r&&t(e,i,f,n)===!1)return!1;i&&i.pop()}}function c(n,i){var r={value:n,valueText:t.formatHelper.format(n,i.format,i.precision)||""};return i.customizeText?i.customizeText.call(i,r):r.valueText}function s(n,t,i,r){var u,f;for(i=i||0,r=r||"children",n.length&&t(n,i),f=0;f<n.length;f++)u=n[f],u[r]&&u[r].length&&s(u[r],t,i+1,r)}function h(n){return function(t,i){var r=0;return n(t)>n(i)?r=1:n(t)<n(i)&&(r=-1),r}}var f=t.ui.dxPivotGrid,i=t.utils,r=i.isDefined,e={row:"rows",column:"columns",data:"values",filter:"filters"};t.data.PivotGridDataSource=f.DataSource=t.Class.inherit(function(){function ut(i){var u,r;return n.isPlainObject(i)&&i.load?u=new f.LocalStore(i):(i&&!i.store&&(i={store:i}),r=i.store,r.type==="xmla"?u=new f.XmlaStore(r):n.isPlainObject(r)&&r.type||r instanceof t.data.Store||n.isArray(r)?u=new f.LocalStore(i):r instanceof t.Class&&(u=r)),u}function p(n,t,i){var r=[],f=t[i];return u(n[i],function(n,t){n.children&&f[t.length-1]&&!f[t.length-1].expanded&&t.length<f.length&&r.push(t.slice())},[],!0),r.length?r:void 0}function ft(t,r){return n.map(t,function(t){return t.groupName===r.groupName&&i.isNumber(t.groupIndex)&&t.visible!==!1?n.extend(t,{areaIndex:r.areaIndex,area:r.area,dataField:t.dataField||r.dataField,dataType:t.dataType||r.dataType,sortBy:t.sortBy||r.sortBy,sortOrder:t.sortOrder||r.sortOrder,sortBySummaryField:t.sortBySummaryField||r.sortBySummaryField,sortBySummaryPath:t.sortBySummaryPath||r.sortBySummaryPath,visible:t.visible||r.visible}):null}).sort(function(n,t){return n.groupIndex-t.groupIndex})}function w(n){n.sort(function(n,t){return n.areaIndex-t.areaIndex})}function et(t){var u=this,f=u.fields(),r={rows:[],columns:[],values:[],filters:[]};return n.each(["row","column","data","filter"],function(n,r){i.normalizeIndexes(u.getAreaFields(r,!0),"areaIndex",t)}),n.each(f||[],function(n,t){var s=e[t.area],u=r[s],o=t.groupName;(o&&!i.isNumber(t.groupIndex)&&(t.levels=ft(f,t)),!u||o&&i.isNumber(t.groupIndex)||t.visible===!1)||(t.levels&&u!==r.filters?(u.push.apply(u,t.levels),t.filterValues&&t.filterValues.length&&r.filters.push(t)):u.push(t))}),n.each(r,function(n,t){w(t)}),r}function b(n){return(n.dataField||n.groupName||"")+(n.groupInterval?n.groupName||"":"NOGROUP")+(n.groupInterval||"")}function k(t,i,r){var u=[],f={},e={},o=[],s=d(t);return i?(n.each(i,function(n,t){f[b(t)]=t}),n.each(t,function(t,i){var r=b(i),h=f[r]||e[r],o;h?o=n.extend({},h,i):f[r]=o=i,n.extend(o,{dataType:s[i.dataField]}),delete f[r],e[r]=h,u.push(o)}),r&&n.each(f,function(n,t){u.push(t)})):u=t,u.push.apply(u,o),u}function ot(n){var u=n.dataField||n.groupName||"",r=(n.summaryType||"").toLowerCase();return i.isString(n.groupInterval)&&(u+="_"+n.groupInterval),r&&r!=="custom"?(r=r.replace(/^./,r[0].toUpperCase()),u.length&&(r=" ("+r+")")):r="",t.inflector.titleize(u)+r}function d(t){var i={};return n.each(t,function(n,t){i[t.dataField]=i[t.dataField]||t.dataType}),i}function st(t){var i=n.Deferred(),r=t._store,f=r&&r.getFields(d(t._fields)),u;return n.when(f).done(function(n){t._storeFields=n,u=k(t._fields,n,t._retrieveFields),i.resolve(u)}).fail(function(){i.resolve(t._fields)}),i}function ht(n,t){var i=null,r=(t||[]).join(".");return r.length&&u(n,function(n,t){if(r===t.join("."))return i=n.index,!1},[]),i}function ct(n,t,i,u){var e=t.values,h=o(i.values,n.sortBySummaryField),f=u==="rows",l=f?t.columns:t.rows,a=f?t.grandTotalRowIndex:t.grandTotalColumnIndex,c=n.sortBySummaryPath||[],s=c.length?ht(l,c):a;if(e&&e.length&&h>=0&&r(s))return function(n){var t=f?n.index:s,i=f?s:n.index;return((e[t]||[[]])[i]||[])[h]||null}}function lt(n,t,i,r){var e=n.sortOrder,o=n.sortingMethod||h(function(n){return n.value}),u=ct(n,t,i,r),f=u&&h(u);return function(n,t){var i=f&&f(n,t)||0;return i===0&&(i=o(n,t)),e==="desc"?-i:i}}function g(n,t,i){var u=t[i]||[],f=t.headerName===i?t.path.length:0,r=[];s(n[i],function(f,e){var o=u[e]||{},s=r[e]=r[e]||lt(o,n,t,i);f.sort(s)},f)}function at(n,t){g(t,n,"rows"),g(t,n,"columns")}function nt(n,t,i){u(n[i],function(n,r){n.text=n.text||c(n.value,t[i][r.length-1])},[])}function tt(n,t){nt(t,n,"columns"),nt(t,n,"rows")}var it=function(n,t){return DevExpress.data.utils.toComparable(n)===DevExpress.data.utils.toComparable(t)},l=function(t,i){var r,f,u=null,e=function(n){return it(n.value,i[r])};if(n.isArray(i))for(r=0;r<i.length&&t;r++){if(f=n.grep(t||[],e),f.length===0){u=null;break}u=f[0],t=u.children}return u},a=function(n,t){var f,i=-1,u;if(n)for(f=0;f<n.length;f++)u=n[f],i=Math.max(i,u.index),u.children?i=Math.max(i,a(u.children)):u.collapsedChildren&&(i=Math.max(i,a(u.collapsedChildren)));return r(t)&&(i=Math.max(i,t)),i},v=function(t,i,r,f){for(var s=a(r)+1,h=a(t,f)+1,o=[],e=0;e<s;e++)o[e]=h++;return i.children=[],n.extend(!0,i.children,r),u(i.children,function(n){n.index=o[n.index]}),o},y=function(n,t){var i=[];return u(n,function(n){delete n.collapsedChildren}),u(t,function(t,r){var u=l(n,r);u&&(i[t.index]=u.index)},[]),i},rt=function(n,t,i,u){var e,o,h,c,f,s,l=n.values;if(t)for(e=0;e<=t.length;e++)if(h=t[e],f=i[e],r(f)||(f=n.grandTotalRowIndex),h&&r(f))for(l[f]||(l[f]=[]),o=0;o<=h.length;o++)c=h[o],s=u[o],r(s)||(s=n.grandTotalColumnIndex),r(c)&&r(s)&&(l[f][s]=c)};return{ctor:function(t){t=t||{};var i=this,u=ut(t);i._store=u,i._loadedData={rows:[],columns:[],values:[]},i._data=n.extend(!0,{},i._loadedData),i._loadingCount=0,n.each(["changed","loadError","loadingChanged","fieldsPrepared","expandValueChanging"],n.proxy(function(n,i){var r="on"+i[0].toUpperCase()+i.slice(1);if(t.hasOwnProperty(r))this.on(i,t[r])},this)),i._localSorting=!!t.localSorting,i._retrieveFields=r(t.retrieveFields)?t.retrieveFields:!0,i._fields=t.fields||[],i._descriptions=t.descriptions?n.extend(i._createDescriptions(),t.descriptions):undefined,u||(n.extend(!0,i._loadedData,t.store||t),i._data=n.extend(!0,{},i._loadedData))},getData:function(){return this._data},getAreaFields:function(t,i){var u=[],f;return i||t==="data"?(n.each(this._fields,function(){this.area!==t||r(this.groupIndex)||this.visible===!1||u.push(this)}),w(u)):(f=this._descriptions||{},u=f[e[t]]||[]),u},fields:function(n){var t=this;return n&&(t._fields=k(n,t._storeFields,t._retrieveFields),t._fieldsPrepared(t._fields)),t._fields},field:function(t,r){var f=this,e=f._fields,u=e&&e[i.isNumber(t)?t:o(e,t)],s;return u&&r&&(n.each(r,function(n,t){if(u[n]=t,n==="sortOrder"){s=u.levels||[];for(var i=0;i<s.length;i++)s[i][n]=t}}),f._descriptions=f._createDescriptions(u)),u},getFieldValues:function(t){var o=this,r=this._fields&&this._fields[t],f=this.store(),e=[],u={columns:e,rows:[],values:this.getAreaFields("data"),filters:[],localSorting:this._localSorting},i=n.Deferred();return r&&f?(n.each(r.levels||[r],function(){e.push(n.extend({},this,{expanded:!0,filterValues:null,sortOrder:"asc",sortBySummaryField:null}))}),f.load(u).done(function(n){tt(u,n),o._sort(u,n),i.resolve(n.columns)}).fail(i)):i.reject(),i},load:function(i){var r=this,u=n.Deferred();return i=i||{},r._changeLoadingCount(1),u.fail(function(n){r.fireEvent("loadError",[n])}).always(function(){r._changeLoadingCount(-1)}),r._delayedLoadTask=t.utils.executeAsync(function(){r._delayedLoadTask=undefined,r._descriptions?r._loadCore(i,u):n.when(st(r)).done(function(n){r._fieldsPrepared(n),r._loadCore(i,u)}).fail(u.reject).fail(r._loadErrorHandler)}),u},_createDescriptions:et,_fieldsPrepared:function(t){var i=this;i._fields=t,n.each(t,function(n,t){t.index=n,r(t.caption)||(t.caption=ot(t))}),i.fireEvent("fieldsPrepared",[t]),i._descriptions=i._createDescriptions()},isLoading:function(){return this._loadingCount>0},_changeLoadingCount:function(n){var i=this.isLoading(),t;this._loadingCount+=n,t=this.isLoading(),i^t&&this.fireEvent("loadingChanged",[t])},_loadCore:function(t,i){var r=this,u=this._store,o=this._descriptions,f=e[t.area];t=t||{},u?(n.extend(t,o),t.columnExpandedPaths=p(this._loadedData,t,"columns"),t.rowExpandedPaths=p(this._loadedData,t,"rows"),r._localSorting&&(t.localSorting=!0),f&&(t.headerName=f),n.when(u.load(t)).done(function(u){t.path?r.applyPartialDataSource(t.area,t.path,u,i):(n.extend(r._loadedData,u),r._update(i)),i.resolve(r._data)}).fail(i.reject)):(r._update(i),i.resolve(r._data))},_sort:function(n,t){var i=this._store;i&&i.supportSorting&&(this._localSorting||!i.supportSorting())&&at(n,t)},_update:function(t){var r=this;tt(r._descriptions,r._loadedData),r._sort(r._descriptions,r._loadedData),r._data=n.extend(!0,{},r._loadedData),n.when(t).done(function(){r.fireEvent("changed"),i.isDefined(r._data.grandTotalRowIndex)&&(r._loadedData.grandTotalRowIndex=r._data.grandTotalRowIndex),i.isDefined(r._data.grandTotalColumnIndex)&&(r._loadedData.grandTotalColumnIndex=r._data.grandTotalColumnIndex)})},getHeaderItemPath:function(n,t){var i=this,r=0,f,e=n==="column"?i._data.columns:i._data.rows;return n==="column"&&i._descriptions.values.length>1&&(t=Math.floor(t/i._descriptions.values.length)),u(e,function(n,i){if(r===t)return f=i,!1;r++},[]),f},store:function(){return this._store},collapseHeaderItem:function(n,t){var i=this,f=n==="column"?i._loadedData.columns:i._loadedData.rows,r=l(f,t),u=i.getAreaFields(n)[t.length-1];return r&&r.children?(i.fireEvent("expandValueChanging",[{area:n,path:t,expanded:!1}]),u&&(u.expanded=!1),r.collapsedChildren=r.children,delete r.children,i._update(),!0):!1},collapseAll:function(n){var i=!1,t=this.fields()[n]||{};t.expanded=!1,u(this._loadedData[t.area+"s"],function(n,r){n&&n.children&&t.areaIndex===r.length-1&&(n.collapsedChildren=n.children,delete n.children,i=!0)},[],!0),i&&this._update()},expandAll:function(n){var t=this.fields()[n];t&&t.area&&(t.expanded=!0,this.load())},expandHeaderItem:function(n,t){var r=this,u,e=n==="column"?r._loadedData.columns:r._loadedData.rows,i=l(e,t),f;return i&&!i.children?(u=!!i.collapsedChildren,f={area:n,path:t,expanded:!0,needExpandData:!u},r.fireEvent("expandValueChanging",[f]),u?(i.children=i.collapsedChildren,delete i.collapsedChildren,r._update()):r.load(f),u):!1},applyPartialDataSource:function(n,t,i,r){var h=this,u=h._loadedData,e=n==="column"?u.columns:u.rows,f,o,s;i&&i.values&&(i.rows=i.rows||[],i.columns=i.columns||[],f=l(e,t),f&&(n==="column"?(s=v(e,f,i.columns,u.grandTotalColumnIndex),o=y(u.rows,i.rows)):(o=v(e,f,i.rows,u.grandTotalRowIndex),s=y(u.columns,i.columns)),rt(u,i.values,o,s),h._update(r)))},dispose:function(){var t=this,n=t._delayedLoadTask;this._disposeEvents(),n&&n.abort(),this._isDisposed=!0},isDisposed:function(){return!!this._isDisposed}}}()).include(t.EventsMixin),f.foreachTreeItems=u,f.foreachDataLevel=s,f.getCompareFunction=h,f.findField=o,f.formatValue=c}(jQuery,DevExpress),function(n,t){var i=t.ui.dxPivotGrid,r=t.utils;i.proxyMethod=function(n,t,i){n[t]||(n[t]=function(){var n=this._dataSource;return n?n[t].apply(n,arguments):i})},i.DataController=t.Class.inherit(function(){function s(n,t,i){var u=n.text;return r.isDefined(n.displayText)?u=n.displayText:r.isDefined(n.caption)?u=n.caption:n.type==="GT"&&(u=i.texts.grandTotal),n.isAdditionalTotal&&(u=r.stringFormat(i.texts.total||"",u)),u}var t=i.foreachTreeItems,o=i.formatValue,f=function(){var i=function(n){var i=0;return t(n,function(n,t){i=Math.max(i,t.length)},[]),i},u=function(n,t,i){var u={type:n.type,text:n.text};return n.path&&(u.path=n.path),n.width&&(u.width=n.width),n.isLast&&(u.isLast=!0),n.sorted&&(u.sorted=!0),n.isMetric&&(u.dataIndex=n.dataIndex),r.isDefined(n.expanded)&&(u.expanded=n.expanded),t>1&&(u[i?"colspan":"rowspan"]=t),n.depthSize&&n.depthSize>1&&(u[i?"rowspan":"colspan"]=n.depthSize),u},f=function(n,t){var i,r=t.lastIndex-t.index||1,f=function(n,t,i,r,u){for(var f=u?r:i;!n[f];)n.push([]);u?n[f].push(t):n[f].unshift(t)};return(i=u(t.headerItem,r,t.isHorizontal),f(n,i,t.index,t.depth,t.isHorizontal),!t.headerItem.children||t.headerItem.children.length===0)?t.lastIndex+1:t.lastIndex},e=function(i,u,f,e,l){var v=f.length,a=n.extend(!0,[],i);return o(a,u),l.showTotals!==!1&&c(a),l.showGrandTotals!==!1&&a.push({type:"GT"}),t(a,function(n,t){n.children&&n.children.length!==0||(n.depthSize=e-t.length+1)},[]),v>1&&h(a,f),t(a,function(t,i){var f=u[i.length-1]||{};t.text=s(t,f,l),t.type==="D"&&(t.width=f.width),t.isLast=!t.children||!t.children.length,t.isLast&&n.each(l.sortBySummaryPaths,function(n,u){var f=i;return r.isDefined(t.dataIndex)||(u=u.slice(0),u.pop()),t.type==="GT"&&(f=f.slice(1)),f.join("/")===u.join("/")?(t.sorted=!0,!1):void 0})},[]),a.length||a.push({}),a},o=function(n,i){var r=i&&i.length||0;t(n,function(n){n.type="D"}),t(n,function(n,t){n.path=t.slice(0),t.length<r&&(!n.children||n.children.length!==0)&&(n.expanded=!!n.children)},[])},h=function(n,i){t(n,function(n){var t;if(!n.children||n.children.length===0)for(n.children=[],t=0;t<i.length;t++)n.children.push({caption:i[t].caption,path:n.path,type:n.type,value:t,dataIndex:t,isMetric:!0})})},c=function(i){t(i,function(t,i,r,u){t.type==="D"&&t.expanded&&u.splice(r+1,0,n.extend(!0,{},t,{children:null,type:"T",expanded:null,isAdditionalTotal:!0}))},[])},l=function(n,i,r,u){var s=0,h,o,e=[0];t(i,function(t,i){for(o=t.isMetric?r:i.length-1;e.length-1<o;)e.push(e[e.length-1]);h=e[o]||0,s=f(n,{headerItem:t,index:h,lastIndex:s,depth:o,isHorizontal:u}),e.length=o,e.push(s)},[])};return function(n,t,r,u,f){var o=[],s,h=i(n)||1;return s=e(n,t,r,h,f),l(o,s,h,u),o}}(),h=function(t,i,r,u){var f,c,e,k,l,a=t.values,y=i?i.length:0,v,p,s,h,d=function(n){return n?n.children&&n.children.length>0?"T":"D":"GT"},w=0,b=[];if(a&&y>0){for(f=0;f<a.length;f++)w=Math.max(w,a[f].length);for(f=0;f<a.length;f++)if(h=r[f],h||f===t.grandTotalRowIndex){for(k=a[f],l=[],c=0;c<w;c++)if(s=u[c],s||c===t.grandTotalColumnIndex)for(v=k[c],n.isArray(v)||(v=[v]),e=0;e<y;e++)p={text:o(v[e],i[e]),columnType:d(s),rowType:d(h),rowPath:h&&h.path,columnPath:s&&s.path,dataIndex:e},i[e].width&&(p.width=i[e].width),s?l[s.visibleIndex*y+e]=p:u.grandTotalVisibleIndex>=0&&(l[u.grandTotalVisibleIndex*y+e]=p);h?b[h.visibleIndex]=l:r.grandTotalVisibleIndex>=0&&(b[r.grandTotalVisibleIndex]=l)}}return b},e=function(i,u,f){var o=0,e=[];return t(i,function(t,i){if(!t.children||f.showTotals!==!1){var u=n.extend(!0,{},t,{visibleIndex:o++,path:i});r.isDefined(u.index)?e[u.index]=u:e.push(u)}},[]),f.showGrandTotals!==!1&&(e.grandTotalVisibleIndex=o),e},u={ctor:function(t){var i=this;i._options=t||{},i._dataSource=i._createDataSource(t),i._columnsInfo=[],i._rowsInfo=[],i._cellsInfo=[],i.expandValueChanging=n.Callbacks(),i.loadingChanged=n.Callbacks(),i._dataSource.load(),i._update(),i.changed=n.Callbacks()},_handleChanged:function(){this._update()},_handleExpandValueChanging:function(n){this.expandValueChanging.fire(n)},_handleLoadingChanged:function(n){this.loadingChanged.fire(n)},_handleFieldsPrepared:function(n){this._options.onFieldsPrepared&&this._options.onFieldsPrepared(n)},_createDataSource:function(t){var r=this,f=t.dataSource,u;r._isSharedDataSource=f instanceof i.DataSource,u=r._isSharedDataSource?f:new i.DataSource(f),r._changedHandler=n.proxy(r,"_handleChanged"),r._expandValueChangingHandler=n.proxy(r,"_handleExpandValueChanging"),r._loadingChangedHandler=n.proxy(r,"_handleLoadingChanged"),r._fieldsPreparedHandler=n.proxy(r,"_handleFieldsPrepared");u.on("changed",r._changedHandler);u.on("expandValueChanging",r._expandValueChangingHandler);u.on("loadingChanged",r._loadingChangedHandler);u.on("fieldsPrepared",r._fieldsPreparedHandler);return u},getDataSource:function(){return this._dataSource},isLoading:function(){return this._dataSource.isLoading()},isEmpty:function(){var n=this._dataSource.getAreaFields("data"),t=this._dataSource.getData();return!n.length||!t.values.length},_update:function(){var o=this._dataSource.getAreaFields("column"),s=this._dataSource.getAreaFields("row"),u=this._dataSource.getAreaFields("data"),t=this._dataSource.getData(),c=function(t,r){var u=[];return n.each(t,function(n,t){var f=i.findField(r,t.sortBySummaryField);f>=0&&u.push((t.sortBySummaryPath||[]).concat([f]))}),u},l={texts:this._options.texts||{},showTotals:this._options.showRowTotals,showGrandTotals:this._options.showRowGrandTotals,sortBySummaryPaths:c(o,u)},a={texts:this._options.texts||{},showTotals:this._options.showColumnTotals,showGrandTotals:this._options.showColumnGrandTotals,sortBySummaryPaths:c(s,u)},v=e(t.rows,s.length-1,l),y=e(t.columns,o.length-1,a);r.isDefined(t.grandTotalRowIndex)||(t.grandTotalRowIndex=v.length),r.isDefined(t.grandTotalColumnIndex)||(t.grandTotalColumnIndex=y.length),this._columnsInfo=f(t.columns,o,u,!0,a),this._rowsInfo=f(t.rows,s,[],!1,l),this._cellsInfo=h(t,u,v,y),this.changed&&this.changed.fire()},getHeaderItemPath:function(n,i){var r=this,u=0,f,e=r._dataSource.getData(),o=r._dataSource.getAreaFields("data"),s=n==="column"?e.columns:e.rows;return n==="column"&&o.length>1&&(i=Math.floor(i/o.length)),t(s,function(n,t){if(u===i)return f=t,!1;u++},[]),f},getRowsInfo:function(){return this._rowsInfo},getColumnsInfo:function(){return this._columnsInfo},getCellsInfo:function(){return this._cellsInfo},dispose:function(){var n=this;n._isSharedDataSource?(n._dataSource.off("changed",n._changedHandler),n._dataSource.off("expandValueChanging",n._expandValueChangingHandler),n._dataSource.off("loadingChanged",n._loadingChangedHandler)):n._dataSource.dispose(),n.expandValueChanging.empty(),n.changed.empty(),n.loadingChanged.empty()}};return i.proxyMethod(u,"load"),i.proxyMethod(u,"applyPartialDataSource"),i.proxyMethod(u,"collapseHeaderItem"),i.proxyMethod(u,"expandHeaderItem"),i.proxyMethod(u,"getData"),u}())}(jQuery,DevExpress),function(n,t){t.data.XmlaStore=t.ui.dxPivotGrid.XmlaStore=t.Class.inherit(function(){function u(i,u){var f=n.Deferred(),e=i.beforeSend,o={url:i.url,dataType:"text",data:u,headers:{"Content-Type":"text/xml"},xhrFields:{},method:"POST"};return r.isFunction(e)&&e(o),t.ui.dxPivotGrid.sendRequest(o).fail(function(){f.reject(arguments)}).done(function(t){var i;try{i=n.parseXML(t)}catch(r){f.reject({statusText:r.message,stack:r.stack,responseText:t})}f.resolve(i)}),f}function yt(n,t,i){return t=t?".["+t+"]":"","Descendants({"+n+t+"}, "+i+", SELF_AND_BEFORE)"}function b(n){return(n.hierarchyName||n.dataField)+".[All]"}function f(n){return n.dataField+".allMembers"}function c(n){return(n.hierarchyName||n.dataField)+".currentMember"}function l(n){var t=n.join(",");return n.length>1?i(lt,t):t}function pt(n,t,r,u,f){var e=vt[n.sortOrder];return e||y[(n.sortBy+"").toLowerCase()]?i(et,t,dt(n,r,u,t,f),e||"asc"):t}function wt(n,t,r,u,e,s,h,a){for(var g=[],p=s[h],tt,et,st=[],w,v,d,it,rt,ot,nt,k,ut,ft,y=u;y<=t;y++)k=p[y],tt=k.dataField,it=p[y-1]&&p[y-1].hierarchyName,w=k.hierarchyName,rt=!w||!p[y+1]||p[y+1].hierarchyName!==w,nt=n.length+r+u,v=null,ft=!1,st.push(k),y<n.length?rt&&(v="("+tt+".["+n[y]+"])"):y<=nt?y===0&&r===0?(et=b(p[u]),v=w?et+","+p[u].dataField:f(p[u])):w?(ut=e[e.length-1],(rt||y===nt)&&(it===w?(e.length&&(d=p[e.length-1]),d&&d.hierarchyName===w||(d=p[y-1],ut=""),v=yt(d.dataField,ut,tt)):v=f(k))):(v=f(k),k.sortBySummaryField&&g.length&&y===nt&&(ft=!0)):(ot=!w||it!==w,ot&&(v="("+b(k)+")")),v&&(v=i(o,v),v=pt(k,v,s,h,a),ft&&(v=i(at,g.pop(),c(p[y-1]),v)),g.push(v));return l(g)}function k(n,t,i,r,u,f,e,o){var h=-1,c=f[e],s;do h++,s=t.length+h+r,n.push(wt(t,i,h,r,u,f,e,o));while(c[s]&&c[s+1]&&c[s].expanded)}function d(n,t,r){return r=r||"DX_Set_"+t.length,t.push(i(ft,r,n)),"["+r+"]"}function bt(n,t,r){var u;return u=n.hierarchyName?d(i(ht,t),r):f(n),"rank("+c(n)+","+u+")"}function kt(i,r,u){var h=(u==="columns"?r.rows:r.columns)||[],e=r.values||[],o=t.ui.dxPivotGrid.findField(e,i.sortBySummaryField),f=e[o]?[e[o].dataField]:[],c=i.sortBySummaryPath||[],s;return n.each(c,function(n,t){var i=h[n];i&&(i.hierarchyName&&i.hierarchyName===s?f[f.length-1]=(i.hierarchyName||i.dataField)+".["+t+"]":(f.push((i.hierarchyName||i.dataField)+".["+t+"]"),s=i.hierarchyName))}),f.join(",")}function dt(n,t,i,r,u){var f=y[(n.sortBy+"").toLowerCase()];return n.sortBySummaryField?"("+kt(n,t,i)+")":f?c(n)+f:bt(n,r,u)}function g(t,r,u,f,e){var s=t[r],a=[],v=[],y=[],p=0,h=0,w=[],b=i(o,u.join(",")),c;if(s&&s.length){for(t.headerName===r?(v=t.path,h=p=v.length):(y=(r==="columns"?t.columnExpandedPaths:t.rowExpandedPaths)||y,n.each(y,function(n,t){h=Math.max(h,t.length)}));s[h+1]&&s[h].expanded;)h++;for(k(a,[],h,p,v,t,r,f),n.each(y,function(n,i){k(a,i,h,p,i,t,r,f)}),c=h;c>=v.length;c--)s[c].hierarchyName&&(e.visibleLevels[s[c].hierarchyName]=e.visibleLevels[s[c].hierarchyName]||[],e.visibleLevels[s[c].hierarchyName].push(s[c].dataField))}return a.length&&w.push(i(st,d(i(o,a.join(",")),f,r),b)),r==="columns"&&u.length&&w.push(b),i(ct,l(w),r)}function a(t){var u=[];return n.each(t,function(t,e){var l=e.dataField,h=[],c=e.filterValues||[],s;e.hierarchyName&&r.isNumber(e.groupIndex)||(n.each(c,function(n,t){var i=l+".["+(r.isArray(t)?t[t.length-1]:t)+"]";e.filterType==="exclude"&&(h.push(i+".parent"),i="Descendants("+i+")"),h.push(i)}),c.length&&(s=i(o,h.join(",")),e.filterType==="exclude"&&(s="Except("+f(e)+","+s+")"),u.push(s)))}),u.length?l(u):""}function gt(t,r,u,f){var e="["+f+"]";return n.each([t,r,u],function(n,t){t&&(e=i(ut,t+"on 0",e))}),e}function ni(t,r,u){var h=t.columns||[],c=t.rows||[],l=t.values&&t.values.length?t.values:[{dataField:"[Measures]"}],o=[],f=[],e=[],s=n.map(l,function(n){return n.dataField}),v;return(u.measureCount=l.length,u.visibleLevels={},t.headerName&&t.path&&n.each(t.path,function(n,i){var r=t[t.headerName][n];r.hierarchyName&&r.hierarchyName===t[t.headerName][n+1].hierarchyName||o.push(r.dataField+".["+i+"]")}),(h.length||s.length)&&e.push(g(t,"columns",s,f,u)),c.length&&e.push(g(t,"rows",s,f,u)),!e.length)?"":(v=(f.length?"with"+f.join(" "):"")+" ",v+i(rt,gt(a(h),a(c),a(t.filters||[]),r),o.length?i(ot,o.join(",")):"",e.join(",")))}function s(n){return parseInt(n,10)}function ti(t){var i=[];for(n.each(n(t).find("Axis"),function(t,u){var o=n(u),f=u.getAttribute("name"),e=[],h=0;f.indexOf("Axis")===0&&r.isNumber(s(f.substr(4)))&&(i.push(e),n.each(o.children("Tuples").children(),function(t,r){var c=n(r).children(),f,l=0,a=[],o,v=c.length-1,y=i.length===1,u;for(y&&v--,e.push(a),u=v;u>=0;u--)f=n(c[u]),o=s(f.children("LNum").text()),a[u]={caption:f.children("Caption").text(),level:o,index:h++,hasValue:!l&&(!!o||u===0),name:f.children("UName").text(),parentName:f.children("PARENT_UNIQUE_NAME").text(),levelName:f.children("LName").text(),hierarchyName:c[u].getAttribute("Hierarchy")},l+=o}))});i.length<2;)i.push([[{level:0}]]);return i}function ii(t,i,r){var h=[],f=[],u=0,c,e=[],o;return n.each(n(t).find("CellData > Cell"),function(t,i){var u=n(i),r=parseFloat(u.children("Value").text());e[s(i.getAttribute("CellOrdinal"))]={value:isNaN(r)?null:r}}),n.each(i[1],function(){o=[],h.push(o),n.each(i[0],function(){c=u%r,c===0&&(f=[],o.push(f)),f.push(e[u]?e[u].value:null),u++})}),h}function nt(n,t,i,r){var u=n[t];return u||(u={},n[t]=u),!u.value&&i&&(u.value=i.caption,u.levelName=i.levelName,u.hierarchyName=i.hierarchyName,u.parentName=i.parentName,u.index=r,u.level=i.level),u}function h(t,i){var e=[],u=t.children&&(t.children.length?t.children:n.map(t.children.grandTotalHash||[],function(n){return n.children})),r=u&&u[0],o,f;if(r&&(i[r.hierarchyName]&&n.inArray(r.levelName,i[r.hierarchyName])!==-1||!i[r.hierarchyName]||r.level===0))return o=n.map(u,function(n){return n.hierarchyName===r.hierarchyName?n:null}),o.grandTotalHash=u.grandTotalHash,o;if(r)for(f=0;f<u.length;f++)u[f].hierarchyName===r.hierarchyName&&e.push.apply(e,h(u[f],i));return e}function ri(n,t,i){var r,u=i.children=i.children||[],e=u.hash=u.hash||{},f=u.grandTotalHash=u.grandTotalHash||{};return t.parentName&&(i=nt(e,t.parentName),u=i.children=i.children||[]),r=nt(e,t.name,t,n),t.hasValue&&!r.added&&(r.index=n,r.added=!0,u.push(r)),i.value&&i.parentName||!t.parentName?f[i.name]&&delete f[t.parentName]:f[t.parentName]=i,r}function ui(n,t){var i,r;return n.children.length===1&&n.children[0].parentName===""?(i=n.children[0].index,r=n.children.grandTotalHash,n.children=n.children[0].children,n.children.grandTotalHash=r,n.children=h(n,t)):n.children.length===0&&(i=0),i}function tt(i,u,f,e){var s,c=[],o;return n.each(u,function(t,i){var u={children:c},e=r.isDefined(f)?Math.floor(t/f):t;n.each(i,function(n,t){u=ri(e,t,u)})}),o={children:c},o.children=h(o,e),s=ui(o,e),t.ui.dxPivotGrid.foreachTreeItems(o.children,function(n){var t=h(n,e);t.length?n.children=t:delete n.children,delete n.levelName,delete n.hierarchyName,delete n.added,delete n.parentName,delete n.level},undefined,!0),n.each(o.children||[],function(n,t){i.push(t)}),s}function fi(t,i){var u={columns:[],rows:[]},f,e=n(t).find("Error"),o=i.measureCount;return e.length?(r.logger.error(e.attr("Description")),null):(f=ti(t),u.grandTotalColumnIndex=tt(u.columns,f[0],o,i.visibleLevels),u.grandTotalRowIndex=tt(u.rows,f[1],undefined,i.visibleLevels),u.values=ii(t,f,o),u)}function v(t,i,r){var f=[],u=i==="MEASURE",e=u?"MEASUREGROUP_NAME":i+"_DISPLAY_FOLDER";return n.each(n(t).find("row"),function(t,o){var h=n(o),v=i==="LEVEL"?h.children("HIERARCHY_UNIQUE_NAME").text():undefined,c=h.children("LEVEL_NUMBER").text(),l,a;(c!=="0"||h.children(i+"_IS_VISIBLE").text()!=="true")&&h.children("DIMENSION_TYPE").text()!==w&&(l=u?p:h.children("DIMENSION_UNIQUE_NAME").text(),a=h.children(i+"_UNIQUE_NAME").text(),f.push({dimension:r.names[l]||l,groupIndex:c?s(c)-1:undefined,dataField:a,caption:h.children(i+"_CAPTION").text(),hierarchyName:v,groupName:v,displayFolder:h.children(e).text(),isMeasure:u,isDefault:!!r.defaultHierarhies[a]}))}),f}function ei(t){var i={names:{},defaultHierarhies:{}};return n.each(n(t).find("row"),function(){var t=n(this),r=t.children("DIMENSION_TYPE").text(),u=r===w?p:t.children("DIMENSION_UNIQUE_NAME").text();i.names[u]=t.children("DIMENSION_CAPTION").text(),i.defaultHierarhies[t.children("DEFAULT_HIERARCHY").text()]=!0}),i}var e='<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"><Body><Discover xmlns="urn:schemas-microsoft-com:xml-analysis"><RequestType>{2}<\/RequestType><Restrictions><RestrictionList><CATALOG_NAME>{0}<\/CATALOG_NAME><CUBE_NAME>{1}<\/CUBE_NAME><\/RestrictionList><\/Restrictions><Properties><PropertyList><Catalog>{0}<\/Catalog><\/PropertyList><\/Properties><\/Discover><\/Body><\/Envelope>',it='<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"><Body><Execute xmlns="urn:schemas-microsoft-com:xml-analysis"><Command><Statement>{0}<\/Statement><\/Command><Properties><PropertyList><Catalog>{1}<\/Catalog><ShowHiddenCubes>True<\/ShowHiddenCubes><SspropInitAppName>Microsoft SQL Server Management Studio<\/SspropInitAppName><Timeout>3600<\/Timeout><\/PropertyList><\/Properties><\/Execute><\/Body><\/Envelope>',rt="SELECT {2} FROM {0} {1} CELL PROPERTIES VALUE, FORMAT_STRING, LANGUAGE, BACK_COLOR, FORE_COLOR, FONT_FLAGS",ut="(SELECT {0} FROM {1})",ft=" set [{0}] as {1}",et="ORDER({0}, {1}, {2})",ot="WHERE ({0})",st="NonEmpty({0}, {1})",ht="Hierarchize({{0}})",ct="{0} DIMENSION PROPERTIES PARENT_UNIQUE_NAME,HIERARCHY_UNIQUE_NAME ON {1}",lt="CrossJoin({0})",at="Generate({{0}}, ({1}, {2}))",o="{{0}}",r=t.utils,i=r.stringFormat,vt={asc:"asc",desc:"desc"},y={displaytext:".member_caption",value:".member_value"},p="DX_MEASURES",w="2";return t.ui.dxPivotGrid.sendRequest=function(t){return n.ajax(t)},{ctor:function(n){this._options=n},getFields:function(){var t=this._options,r=t.catalog,f=t.cube,s=u(t,i(e,r,f,"MDSCHEMA_DIMENSIONS")),h=u(t,i(e,r,f,"MDSCHEMA_MEASURES")),c=u(t,i(e,r,f,"MDSCHEMA_HIERARCHIES")),l=u(t,i(e,r,f,"MDSCHEMA_LEVELS")),o=n.Deferred();return n.when(s,h,c,l).done(function(t,i,r,u){var e=ei(t),h=v(r,"HIERARCHY",e),c=v(u,"LEVEL",e),s=v(i,"MEASURE",e).concat(h),f={};n.each(c,function(n,t){f[t.hierarchyName]=f[t.hierarchyName]||[],f[t.hierarchyName].push(t)}),n.each(h,function(n,t){f[t.dataField]&&f[t.dataField].length>1&&(t.groupName=t.hierarchyName=t.dataField,s.push.apply(s,f[t.hierarchyName]))}),o.resolve(s)}).fail(o.reject),o},load:function(t){var r=n.Deferred(),f=this._options,e,o,s={},h=ni(t,f.cube,s);return h?(o=i(it,h,f.catalog),n.when(u(f,o)).done(function(n){e=fi(n,s),e?r.resolve(e):r.reject()}).fail(r.reject)):r.resolve({columns:[],rows:[],values:[],grandTotalColumnIndex:0,grandTotalRowIndex:0}),r},supportSorting:function(){return!0}}}())}(jQuery,DevExpress),function(n,t){var r=t.data.utils,i=t.utils,u=t.ui.dxPivotGrid;u.LocalStore=DevExpress.Class.inherit(function(){function u(f){n.each(f||[],function(){var e,s,o=this.dataField,f,h=this.levels;this.selector||(e=o?o.indexOf(".")!==-1?r.compileGetter(o):function(n){return n[o]}:function(n){return n},h?(u(h),this.selector=function(t){var i=[];return n.each(h,function(n,r){i.push(r.selector(t))}),i}):this.dataType==="date"?(s=a[this.groupInterval],this.selector=function(n){var t=e(n);return!t||t instanceof Date||(t=new Date(t)),s?s(t):t},this.format=this.format||v[this.groupInterval]):this.dataType==="number"?(f=i.isNumber(this.groupInterval)&&this.groupInterval>0&&this.groupInterval,f&&(this.customizeText=this.customizeText||function(n){var r=n.value+f,i=t.formatHelper.format(r,this.format,this.precision);return n.valueText&&i?n.valueText+" - "+i:""}),this.selector=function(n){var i=e(n);return t.utils.isString(i)&&(i=Number(i)),f?Math.floor(i/f)*f:i}):this.selector=e)})}function o(n,t,i,r,u){var s=t.dimensions[r],h=t.expandedPathsHash,e,f;s&&(e=s.selector(t.data),u=u?u+"."+e:e,f=y(e,i,u,t.childrenHash),n.push(f.index),(h&&h[u]||s.expanded)&&(f.children||(f.children=[]),o(n,t,f.children,r+1,u)))}function s(n,t,i,r){var u=[0],e=t.headerName===r?t.path.length:0,f=r==="rows"?t.rowExpandedPaths:t.columnExpandedPaths,s={data:n,childrenHash:i[r+"Hash"],dimensions:t[r],expandedPathsHash:t.headerName!==r&&f&&f.hash};return o(u,s,i[r],e),u}function p(n,t,i,r){for(var h=[],f,u,o,c=s(n,r,i,"rows"),l=s(n,r,i,"columns"),e=0;e<c.length;e++)for(u=c[e],t[u]=t[u]||[],f=0;f<l.length;f++)o=l[f],h.push(t[u][o]=t[u][o]||[]);return h}function h(t){t&&(t.hash={},n.each(t,function(){t.hash[this.join(".")]=!0}))}function w(n){n.rows=n.rows||[],n.columns=n.columns||[],n.filters=n.filters||[],h(n.columnExpandedPaths),h(n.rowExpandedPaths),u(n.columns),u(n.rows),u(n.values),u(n.filters)}function c(t){return t.summaryType==="custom"?(t.calculateCustomSummary=t.calculateCustomSummary||n.noop,{seed:function(){var n={summaryProcess:"start",totalValue:undefined};return t.calculateCustomSummary(n),n},step:function(n,i){return n.summaryProcess="calculate",n.value=i,t.calculateCustomSummary(n),n},finalize:function(n){return n.summaryProcess="finalize",delete n.value,t.calculateCustomSummary(n),n.totalValue}}):r.aggregators[t.summaryType]||r.aggregators.count}function b(n,t,r){for(var o,f,u=0;u<n.length;u++){var h=n[u],s=h.selector(r),e=c(h);for(o=0;o<t.length;o++)f=t[o],f.length<=u&&(f[u]=i.isFunction(e.seed)?e.seed():e.seed),f[u]===undefined?f[u]=s:i.isDefined(s)&&(f[u]=e.step(f[u],s))}}function k(t,i){n.each(t,function(t,r){var u=c(r);u.finalize&&n.each(i,function(i,r){n.each(r,function(n,i){i&&(i[t]=u.finalize(i[t]))})})})}function d(n,t){if(i.isArray(n)){t=t||[];for(var r=0;r<n.length;r++)if(n[r]!==t[r])return!1;return!0}return n===t}function f(t){var r=[];return n.each(t,function(n,t){var u=t.filterValues||[],e=t.groupName,f;e&&i.isNumber(t.groupIndex)||(f=function(n){for(var f=t.selector(n),r=!1,i=0;i<u.length;i++)if(d(u[i],f)){r=!0;break}return t.filterType==="exclude"?!r:r},u.length&&r.push(f))}),r}function g(n){var t=f(n.rows).concat(f(n.columns)).concat(f(n.filters)),i=n[n.headerName],r=n.path;return i&&t.push(function(n){for(var u,t=0;t<r.length;t++)if(u=i[t].selector(n),u!==r[t])return!1;return!0}),function(n){for(var i=0;i<t.length;i++)if(!t[i](n))return!1;return!0}}function nt(n,t){var u={columns:[],rows:[],columnsHash:{length:1},rowsHash:{length:1}},f=[[[]]],e,o,i,r;for(w(t),o=g(t),r=0;r<n.length;r++)i=n[r],o(i)&&(e=p(i,f,u,t),b(t.values,e,i));return k(t.values,f),{rows:u.rows,columns:u.columns,values:f,grandTotalRowIndex:0,grandTotalColumnIndex:0}}function tt(t){return n.map(["year","quarter","month"],function(i,r){return n.extend({},t,{groupInterval:i,groupIndex:r})})}function l(t,u,f,e){var o=[];return n.each(u||[],function(u,s){for(var v=1,a=f.length?f+"."+u:u,h=e[a],y=r.compileGetter(a),c;!i.isDefined(s)&&t[v];)s=y(t[v]),v++;!h&&i.isDefined(s)&&(h=n.type(s)),c=[{dataField:a,dataType:h,groupName:h==="date"?u:undefined,groupInterval:undefined,displayFolder:f}],h==="date"?c=c.concat(tt(c[0])):h==="object"&&(c=l(t,s,a,e)),o.push.apply(o,c)}),o}function it(n,t){return t=t||{},l(n,n[0],"",t)}function e(t){var i=n.Deferred();return t.isLoaded()?i.resolve(t.items()):n.when(t.load()).always(function(){e(t).done(i.resolve).fail(i.reject)}),i}var a={year:function(n){return n&&n.getFullYear()},quarter:function(n){return n&&Math.floor(n.getMonth()/3)+1},month:function(n){return n&&n.getMonth()+1},day:function(n){return n&&n.getDate()},dayOfWeek:function(n){return n&&n.getDay()}},v={month:{format:"month",dateType:"full"},quarter:{format:"quarter",dateType:"full"},dayOfWeek:{format:"dayOfWeek",dateType:"full"}},y=function(n,t,i,r){var u=r[i];return u||(u={value:n,index:r.length++},r[i]=u,t.push(u)),u};return{ctor:function(i){i=n.extend(r.normalizeDataSourceOptions(i),{paginate:!1,onChanged:null}),this._dataSource=new t.data.DataSource(i)},getFields:function(t){var r=this,u=r._dataSource,i=n.Deferred();return e(u).done(function(n){i.resolve(it(n,t))}).fail(i.reject),i},load:function(t){var r=this,u=r._dataSource,i=n.Deferred();return e(u).done(function(n){var r=nt(n,t);i.resolve(r)}).fail(i.reject),i},supportSorting:function(){return!1}}}())}(jQuery,DevExpress),function(n,t){var i=t.ui.dxPivotGrid,r=t.utils,u=t.Class,f=1,e=function(n,t){return t?n.offsetWidth:n.offsetWidth+f};i.AreaItem=u.inherit({_getRowElement:function(n){var t=this;return t._tableElement&&t._tableElement.length>0?t._tableElement[0].rows[n]:null},_createGroupElement:function(){return n("<div>")},_createTableElement:function(){return n("<table>")},_renderTableContent:function(n,t){var f=this,l=n.find("tr"),e=f._getAreaName(),o=f.option("onCellPrepared"),s,h,u,c,i,r;if(n.data("area",e),n.data("data",t),o)for(i=0;i<t.length;i++)for(u=t[i],s=l.eq(i),r=0;r<u.length;r++)c=u[r],h=s.children().eq(r),o({area:e,rowIndex:i,columnIndex:r,cellElement:h,cell:c})},_getRowHeight:function(n){var t=this._getRowElement(n);return t&&t.lastChild?t.lastChild.offsetHeight:0},_setRowHeight:function(n,t){var i=this._getRowElement(n);i&&(i.style.height=t+"px")},ctor:function(n){this.component=n},option:function(){return this.component.option.apply(this.component,arguments)},getRowsLength:function(){var n=this;return n._tableElement&&n._tableElement.length>0?n._tableElement[0].rows.length:0},getRowsHeight:function(){for(var t=this,i=[],r=t.getRowsLength(),n=0;n<r;n++)i.push(t._getRowHeight(n));return i},setRowsHeight:function(n){for(var r=this,i=0,u=n.length,t=0;t<u;t++)i+=n[t],r._setRowHeight(t,n[t]);this._tableHeight=i,this._tableElement[0].style.height=i+"px"},getColumnsWidth:function(){var o=this.getRowsLength(),n,s=this._tableElement[0].style.tableLayout==="fixed",i,t,r,u=[],f=[],h=function(n,t,i,r,u){for(var e,f=0;f<r;f++)for(e=0;e<u;e++)n[t+f]=n[t+f]||[],n[t+f][i+e]=!0};if(o)for(n=0;n<o;n++)for(u[n]=u[n]||[],i=this._getRowElement(n),t=0;t<i.cells.length;t++){for(r=0;u[n][r];r++);h(u,n,r,i.cells[t].rowSpan,i.cells[t].colSpan),i.cells[t].colSpan===1&&(f[r]=f[r]||e(i.cells[t],s))}return f},setColumnsWidth:function(n){for(var i=0,r="",t=0;t<n.length;t++)i+=n[t],r+='<col style="width: '+n[t]+'px"/>';this._colgroupElement.html(r),this._tableWidth=i,this._tableElement[0].style.width=i+"px",this._tableElement[0].style.tableLayout="fixed"},resetColumnsWidth:function(){this._colgroupElement.find("col").width("auto"),this._tableElement.css({width:"",tableLayout:""})},groupWidth:function(n){return n===undefined?this._groupElement.width():n>=0?(this._groupWidth=n,this._groupElement[0].style.width=n+"px"):void 0},groupHeight:function(n){if(n===undefined)return this._groupElement.height();n>=0&&(this._groupHeight=n,this._groupElement[0].style.height=n+"px")},groupElement:function(){return this._groupElement},tableElement:function(){return this._tableElement},element:function(){return this._rootElement},headElement:function(){return this._tableElement.find("thead")},render:function(t,i){var u=this,f=u._createTableElement();if(r.isDefined(u._tableElement)){try{u._tableElement[0].innerHTML=""}catch(e){u._tableElement.empty()}u._tableElement.attr("style",""),u._colgroupElement=n("<colgroup>").appendTo(u._tableElement),u._renderTableContent(u._tableElement,i)}else u._groupElement=u._createGroupElement(),u._tableElement=f,u._colgroupElement=n("<colgroup>").appendTo(u._tableElement),u._renderTableContent(u._tableElement,i),u._tableElement.appendTo(u._groupElement),u._groupElement.appendTo(t),u._rootElement=t}})}(jQuery,DevExpress),function(n,t){var r=t.ui,u=r.events,i=r.dxPivotGrid,f=t.utils;i.HorizontalHeadersArea=i.AreaItem.inherit({_getAreaName:function(){return"column"},_getAreaClassName:function(){return i.cssClassNames.headersHorizontal},_textCellRender:function(t,i){var r=n("<span>");i?this.option("encodeHtml")?r.text(i):r.html(i):r.html("&nbsp"),r.appendTo(t)},_createGroupElement:function(){return n("<div>").addClass(this._getAreaClassName()).addClass(i.cssClassNames.area)},_createTableElement:function(){return n("<table>")},_createRow:function(){return n("<tr>")},_createCell:function(t){var r=this,e=n("<td>").attr({colspan:t.colspan,rowspan:t.rowspan});if(f.isDefined(t.expanded)){e.addClass(t.expanded?i.cssClassNames.headersExpanded:i.cssClassNames.headersCollapsed).on(u.addNamespace("dxclick",this._getEventsNamespace()),function(){setTimeout(function(){var n=r._getAreaName();t.expanded?r._dataSource.collapseHeaderItem(n,t.path):r._dataSource.expandHeaderItem(n,t.path)})});n("<span>").addClass(i.cssClassNames.headersExpandCollapseImage).appendTo(e)}return e},_applyCustomStyles:function(t){t.cellIndex===t.cellsCount-1&&t.cellElement.css("border-right","0px"),(t.cell.rowspan===t.rowsCount-t.rowIndex||t.rowIndex+1===t.rowsCount)&&t.cellElement.css("border-bottom-width","0px"),t.cellElement.toggleClass(i.cssClassNames.rowTotal,t.cell.type==="T"||t.cell.type==="GT").toggleClass(i.cssClassNames.total,t.cell.type==="T").toggleClass(i.cssClassNames.grandTotal,t.cell.type==="GT"),t.cell.width&&t.cellElement.css("min-width",t.cell.width),t.cell.sorted&&n("<span>").addClass("dx-icon-sorted").appendTo(t.cellElement)},_renderTableContent:function(t,i){var r=this,c=i.length,e,o,u,f,s,h,l=n("<thead>").addClass(this._getAreaClassName());for(t.width("auto"),u=0;u<c;u++){for(e=i[u],s=r._createRow(),f=0;f<e.length;f++)o=e[f],h=r._createCell(o),r._textCellRender(h,o.text),r._applyCustomStyles({cellElement:h,cell:o,cellsCount:e.length,cellIndex:f,rowElement:s,rowIndex:u,rowsCount:c}),s.append(h);l.append(s)}t.append(l),r.callBase.apply(r,arguments)},_getEventsNamespace:function(){return"dxHeadersArea"},hasScroll:function(){return this._groupWidth&&this._tableWidth?this._tableWidth>this._groupWidth:!1},processScroll:function(){this._groupElement.data("dxScrollable")||(this._groupElement.dxScrollable({useNative:!0,useSimulatedScrollbar:!1,showScrollbar:!1,bounceEnabled:!1,direction:"horizontal"}),this._groupElement.find(".dx-scrollable-container").css("overflow","hidden"))},processScrollBarSpacing:function(n){var t=this;t._groupWidth&&t.groupWidth(t._groupWidth-n),t._scrollBarWidth&&t._groupElement.next().remove(),t._groupElement.toggleClass(i.cssClassNames.verticalScroll,n>0),t._groupElement.css("float","left").width(t._groupHeight),t._scrollBarWidth=n},processStretch:function(n,t,i){for(var c=this,s=0,h=c._groupWidth,u,f,e,o=0,r=0;r<n.length;r++)i.length&&i[r%i.length].width&&(i.length>1&&o++,n[r]=i[r%i.length].width),s+=n[r];if(h&&!t)for(u=h-s,f=Math.floor(u/(n.length-o)),e=u-f*(n.length-o),r=0;r<n.length;r++)i.length>1&&i[r%i.length].width||(n[r]+=f,e&&(n[r]++,e--))},ctor:function(n){this.callBase(n),this._scrollBarWidth=0},setDataController:function(n){return this._dataSource=n,this}}),i.VerticalHeadersArea=i.HorizontalHeadersArea.inherit({_getAreaClassName:function(){return i.cssClassNames.headersVertical},_applyCustomStyles:function(n){var t=n.cellElement;this.callBase(n),t.addClass(n.cellIndex===n.cellsCount-1?i.cssClassNames.headersVerticalLastCell:null),n.rowIndex===n.rowsCount-1&&t.css("border-bottom","0px"),n.rowIndex!==0&&n.cell.expanded&&n.rowElement.addClass(i.cssClassNames.headersVerticalExpandBorder)},_getAreaName:function(){return"row"},_getEventsNamespace:function(){return"dxVerticalHeadersArea"},hasScroll:function(){return this._groupHeight&&this._tableHeight?this._tableHeight>this._groupHeight:!1},processScroll:function(){this._groupElement.data("dxScrollable")||(this._groupElement.dxScrollable({useNative:!0,useSimulatedScrollbar:!1,showScrollbar:!1,bounceEnabled:!1,direction:"vertical"}),this._groupElement.find(".dx-scrollable-container").css("overflow","hidden"))},processScrollBarSpacing:function(t){var i=this;i._groupHeight&&i.groupHeight(i._groupHeight-t),i._scrollBarWidth&&i._groupElement.next().remove(),t&&i._groupElement.after(n("<div>").width("100%").height(t-1)),i._scrollBarWidth=t}})}(jQuery,DevExpress),function(n,t){var i=t.ui.dxPivotGrid;i.DataArea=i.AreaItem.inherit({_getAreaName:function(){return"data"},_createGroupElement:function(){return n("<div />").addClass(i.cssClassNames.area).addClass(i.cssClassNames.areaData)},_renderTableContent:function(t,r){for(var h,l,u,f,c="",e,o,s=0;s<r.length;s++){for(c+="<tr>",l=r[s],h=0;h<l.length;h++)u=l[h],o=[],e="",s===r.length-1&&(e="border-bottom: 0px"),u?((u.rowType==="T"||u.columnType==="T")&&o.push(i.cssClassNames.total),(u.rowType==="GT"||u.columnType==="GT")&&o.push(i.cssClassNames.grandTotal),(u.rowType==="T"||u.rowType==="GT")&&o.push(i.cssClassNames.rowTotal),f=u.text||"",this.option("encodeHtml")&&(f.indexOf("<")!==-1||f.indexOf(">")!==-1)&&(f=n("<div>").text(f).html()),u.width&&(e&&(e+="; "),e+="min-width: "+u.width+"px")):f="",c+='<td class="'+o.join(" ")+'" style="'+e+'">'+f+"<\/td>";c+="<\/tr>"}t.append(c),this.callBase.apply(this,arguments)},_processScrollCore:function(n,t,i){var u=this,f=u._groupElement,r={useNative:!!i,useSimulatedScrollbar:!i,direction:"both",bounceEnabled:!1};t&&!n?r.direction="horizontal":t||(r.direction="vertical"),f.dxScrollable(r)},processScroll:function(n,t,i,r){var u=this,f=u._groupElement;u._rootElement.css({position:"relative",display:"block"}),f.css("border-top-width",0),u._processScrollCore(t,i,r)}})}(jQuery,DevExpress),function(n,t){function c(n,t){var i=[],u;if(n.items)for(u=0;u<n.items.length;u++)i.push.apply(i,c(n.items[u],t));else r.isDefined(n.index)&&i.push(t[n.index]);return i}function e(n,t){var i,r;if(n.items)for(i=0;i<n.items.length;i++)if(r=e(n.items[i],t),r)return r;if(t(n))return n}function w(n,t){for(var i=0,r=0;!i&&l[r];)i=l[r++](n,t);return i}function a(n){return n.find(".dx-scrollable").dxScrollable("instance")}var u=t.ui,r=t.utils,o=u.dxPivotGrid,f=u.dxDataGrid,i="<div>",v=f.ColumnsView.inherit(f.sortingMixin).inherit(f.headerFilterMixin),y=f.HeaderFilterView,p="dx-pivotgridfieldchooser",s="dx-pivotgridfieldchooser-container",h=function(i,r,u,f,e,o){e=e||0,o=o||[];for(var c=r.levels?r.levels[e]:r,s=0;s<i.length;s++)i[s].text=i[s].text||t.formatHelper.format(i[s].value,c.format,c.precision),o.push(i[s].value),i[s].filterValue=f?o.slice(0):i[s].value,n.inArray(f?o.join("/"):i[s].value,u)>-1^r.filterType==="exclude"&&(i[s].selected=!0),i[s].children&&(i[s].items=i[s].children,i[s].children=null,h(i[s].items,r,u,f,e+1,o)),o.pop()},l=[function(n,t){var i=-!!n.isMeasure,r=+!!t.isMeasure;return i+r},function(n,t){var i=-!!(n.items&&n.items.length),r=+!!(t.items&&t.items.length);return i+r},function(n,t){var i=+!!(n.field&&n.field.levels&&n.field.levels.length),r=-!!(t.field&&t.field.levels&&t.field.levels.length);return i+r},o.getCompareFunction(function(n){return n.text})];t.registerComponent("dxPivotGridFieldChooser",u,u.Widget.inherit({_setDefaultOptions:function(){this.callBase(),this.option({height:400,layout:0,dataSource:null,texts:{columnFields:Globalize.localize("dxPivotGrid-columnFields"),rowFields:Globalize.localize("dxPivotGrid-rowFields"),dataFields:Globalize.localize("dxPivotGrid-dataFields"),filterFields:Globalize.localize("dxPivotGrid-filterFields"),allFields:Globalize.localize("dxPivotGrid-allFields")},headerFilter:{width:252,height:300,texts:{emptyValue:Globalize.localize("dxDataGrid-headerFilterEmptyValue"),ok:Globalize.localize("dxDataGrid-headerFilterOK"),cancel:Globalize.localize("dxDataGrid-headerFilterCancel")}}})},_refreshDataSource:function(){var t=this,i;t._expandedPaths=[],t._changedHandler=t._changedHandler||function(){n.each(t._dataChangedHandlers,function(n,t){t()}),t._updateIndicatorsPosition()},t._dataSource&&(t._dataSource.off("changed",t._changedHandler),t._dataSource=undefined),i=this.option("dataSource"),i&&i.fields&&i.load&&(t._dataSource=i),t._dataSource&&t._dataSource.on("changed",t._changedHandler)},_init:function(){this.callBase(),this._columnsView=new v(this),this._headerFilterView=new y(this),this._subscribeToEvents(),this._refreshDataSource(),this._dataChangedHandlers=[]},_subscribeToEvents:function(){var i=this;i.element().on("dxclick",".dx-area-field.dx-area-box",function(u){var f=n.extend(!0,{},n(u.currentTarget).data("field")),e=n(u.target).hasClass("dx-header-filter");e?i._headerFilterView.showHeaderFilterMenu(n(u.currentTarget),{type:f.groupName?"tree":"list",dataSource:{load:function(r){var e=r.userData,u;return e.store?e.store.load(r):(u=n.Deferred(),i._dataSource.getFieldValues(f.index).done(function(n){e.store=new t.data.ArrayStore(n),e.store.load(r).done(u.resolve).fail(u.reject)}).fail(u.reject),u)},postProcess:function(t){var i=[];return f.filterValues&&n.each(f.filterValues,function(n,t){i.push(r.isArray(t)?t.join("/"):t)}),h(t,f,i,!!f.groupName),t}},filterValues:f.filterValues,filterType:f.filterType,apply:function(){i._dataSource.field(f.index,{filterValues:this.filterValues,filterType:this.filterType}),i._dataSource.load()}}):f.allowSorting&&f.area!=="data"&&(i._dataSource.field(f.index,{sortOrder:f.sortOrder==="desc"?"asc":"desc"}),i._dataSource.load())})},_setOptionsByReference:function(){this.callBase(),n.extend(this._optionsByReference,{dataSource:!0})},_optionChanged:function(n){var t=this;switch(n.name){case"dataSource":t._refreshDataSource(),t._invalidate();break;case"layout":case"texts":case"headerFilter":t._invalidate();break;default:t.callBase(n)}},_clean:function(){this.element().children("."+s).remove()},_renderContentImpl:function(){var e=this,f=this.element(),r,t,u;f.addClass(p),e._dataChangedHandlers=[],e._renderSortable(f),e._headerFilterView.render(f),u=n(i).addClass(s).appendTo(f),this.option("layout")===0?(r=n(i).addClass("dx-col").appendTo(u),t=n(i).addClass("dx-col").appendTo(u),this._renderArea(r,"all"),this._renderArea(r,"filter"),this._renderArea(t,"row"),this._renderArea(t,"column"),this._renderArea(t,"data")):this.option("layout")===1?(r=n(i).addClass("dx-col").appendTo(u),t=n(i).addClass("dx-col").appendTo(u),this._renderArea(r,"all"),this._renderArea(t,"filter"),this._renderArea(t,"row"),this._renderArea(t,"column"),this._renderArea(t,"data")):(this._renderArea(u,"all"),r=n(i).addClass("dx-col").appendTo(u),t=n(i).addClass("dx-col").appendTo(u),this._renderArea(r,"filter"),this._renderArea(r,"row"),this._renderArea(t,"column"),this._renderArea(t,"data")),this.updateDimensions()},_renderSortable:function(t){var r=this;r._createComponent(t,"dxSortable",{itemSelector:".dx-area-field",itemContainerSelector:".dx-area-field-container",groupSelector:".dx-area-fields",itemRender:function(r,u){var f;return r.hasClass("dx-area-box")?(f=r.clone(),f.insertBefore(r)):f=n(i).addClass("dx-area-field").addClass("dx-area-box").text(r.text()),u==="drag"&&f.width(t.find(".dx-area-field-container").first().width()),f},onDragging:function(n){var i=n.sourceElement.data("field"),t=n.targetGroup;n.cancel=!1,i.isMeasure===!0?(t==="column"||t==="row"||t==="filter")&&(n.cancel=!0):i.isMeasure===!1&&t==="data"&&(n.cancel=!0)},onChanged:function(n){var t=r._dataSource,i=n.sourceElement.data("field");n.removeSourceElement=!!n.sourceGroup,i&&(t.field(i.index,{area:n.targetGroup,areaIndex:n.targetIndex}),t.load())}})},_createTreeItems:function(t,i,u){var s=this,e,f=[],h=[],c=i[0],o={};return c?(n.each(t,function(n,t){var i=t[c]||"";o[i]=o[i]||[],o[i].push(t),e===undefined&&(e=!0),e=e&&t.isMeasure===!0}),n.each(o,function(t,r){var e=u?u+"."+t:t,o=s._createTreeItems(r,i.slice(1),e);t?h.push({key:t,text:t,path:e,isMeasure:o.isMeasure,expanded:n.inArray(e,s._expandedPaths)>=0,items:o}):f=o}),f=h.concat(f),f.isMeasure=e):n.each(t,function(n,t){var i;t.isMeasure===!0&&(i="measure"),t.isMeasure===!1&&(i=t.groupName?"hierarchy":"dimension"),f.push({index:t.index,field:t,key:t.dataField,selected:r.isDefined(t.area),text:t.caption||t.dataField,icon:i,isMeasure:t.isMeasure,isDefault:t.isDefault})}),f},_createFieldsDataSource:function(t){var i=t&&t.fields()||[],u;return i=n.map(i,function(n){return n.visible===!1||r.isDefined(n.groupIndex)?null:n}),u=this._createTreeItems(i,["dimension","displayFolder"]),o.foreachDataLevel(u,function(n){n.sort(w)},0,"items"),u},_renderFieldsTreeView:function(t){var i=this,u=i._dataSource,f=i._createComponent(t,"dxTreeView",{dataSource:i._createFieldsDataSource(u),showCheckBoxes:!0,itemTemplate:function(t,i,u){t.icon&&r.getImageContainer(t.icon).appendTo(u),n("<span>").toggleClass("dx-area-field",!t.items).data("field",t.field).text(t.text).appendTo(u)},onItemCollapsed:function(t){var r=n.inArray(t.itemData.path,i._expandedPaths);r>=0&&i._expandedPaths.splice(r,1)},onItemExpanded:function(t){var r=n.inArray(t.itemData.path,i._expandedPaths);r<0&&i._expandedPaths.push(t.itemData.path)},onItemSelected:function(t){var i=t.itemData,s,o,a=!0,v,h,l;if(i.items){if(i.selected){f.unselectItem(i);return}for(o=c(i,u.fields()),h=0;h<o.length;h++)if(o[h].area){a=!1;break}if(a){l=e(i,function(n){return n.isDefault})||e(i,function(n){return r.isDefined(n.index)}),l&&f.selectItem(l);return}}else s=u.fields()[i.index],i.selected&&(v=s.isMeasure?"data":"column"),s&&(o=[s]);n.each(o,function(n,t){u.field(t.index,{area:v,areaIndex:undefined})}),u.load()}}),o=function(){var n=a(t),r=n?n.scrollTop():0;f.option({dataSource:i._createFieldsDataSource(u)}),n=a(t),n&&(n.scrollTo({y:r}),n.update())};i._dataChangedHandlers.push(o)},_renderField:function(t){var r=this,f=n(i).addClass("dx-area-field-content").text(t.caption||t.dataField),u=n(i).addClass("dx-area-field").addClass("dx-area-box").data("field",t).append(f);return t.area!=="data"&&(t.allowSorting&&r._columnsView._applyColumnState({name:"sort",rootElement:u,column:{alignment:r.option("rtlEnabled")?"right":"left",sortOrder:t.sortOrder==="desc"?"desc":"asc"},showColumnLines:!0}),r._columnsView._applyColumnState({name:"headerFilter",rootElement:u,column:{alignment:r.option("rtlEnabled")?"right":"left",filterValues:t.filterValues,allowFiltering:t.allowFiltering},showColumnLines:!0})),u},_renderAreaFields:function(t,i){var r=this,u=r._dataSource,f=u?u.getAreaFields(i,!0):[];t.empty(),n.each(f,function(){r._renderField(this).appendTo(t)})},_renderArea:function(t,r){var f=this,e=n(i).addClass("dx-area").appendTo(t),h=f.option("texts."+r+"Fields"),u,s,o;n("<span>").addClass("dx-area-icon").addClass("dx-area-icon-"+r).appendTo(e),n("<span>").html("&nbsp;").appendTo(e),n("<span>").addClass("dx-area-caption").text(h).appendTo(e),u=n(i).addClass("dx-area-fields").height(0).appendTo(e),r!=="all"?(s=n(i).addClass("dx-area-field-container").appendTo(u),o=function(){f._renderAreaFields(s,r)},f._dataChangedHandlers.push(o),o(),u.attr("group",r).dxScrollable()):(u.addClass("dx-treeview-border-visible"),f._renderFieldsTreeView(u))},_updateIndicatorsPosition:function(){var t=this._columnsView;n.each(this.element().find(".dx-area-field.dx-area-box"),function(){t._updateIndicatorHeight(n(this),"sort"),t._updateIndicatorHeight(n(this),"headerFilter")})},updateDimensions:function(){var f=this,t=this.element(),u=t.children(".dx-pivotgridfieldchooser-container"),r=t.find(".dx-col"),i=t.find(".dx-area-fields"),e=t.find(".dx-area .dx-scrollable"),n;f._updateIndicatorsPosition(),i.height(0),this.option("layout")===0?(n=Math.floor((t.height()-u.height())/3),i.height(n),i.eq(0).height(r.eq(1).height()-r.eq(0).height()+n)):this.option("layout")===1?(n=Math.floor((t.height()-u.height())/4),i.height(n),i.eq(0).height(r.eq(1).height()-r.eq(0).height()+n)):(n=Math.floor((t.height()-u.height())/4),i.height(n),i.eq(0).height(n*2)),e.dxScrollable("update")}}))}(jQuery,DevExpress),function(n,t,i){var r=t.ui,f=t.utils,o="dx-scheduler",e="dx-scheduler-readonly",u="dx-scheduler-appointment-popup",s=610,h={day:"dxSchedulerWorkSpaceDay",week:"dxSchedulerWorkSpaceWeek",workWeek:"dxSchedulerWorkSpaceWorkWeek",month:"dxSchedulerWorkSpaceMonth"};t.registerComponent("dxScheduler",r,r.Widget.inherit({_stripDateTime:function(n){return f.correctDateWithUnitBeginning(n,"day"),n},_setDefaultOptions:function(){this.callBase(),this.option({views:["day","week"],currentView:"day",currentDate:this._stripDateTime(new Date),firstDayOfWeek:i,groups:[],resources:[],dataSource:null,appointmentTemplate:"item",startDayHour:0,endDayHour:24,editing:!0,onAppointmentRendered:null,onAppointmentAdding:null,onAppointmentAdded:null,onAppointmentUpdating:null,onAppointmentUpdated:null,onAppointmentDeleting:null,onAppointmentDeleted:null})},_defaultOptionsRules:function(){return this.callBase().concat([{device:function(){return t.devices.real().generic&&!t.devices.isSimulator()},options:{focusStateEnabled:!0}}])},_optionChanged:function(n){var t=n.value;switch(n.name){case"firstDayOfWeek":this._workSpace.option("firstDayOfWeek",t),this._header.option("firstDayOfWeek",t);break;case"currentDate":t=f.makeDate(t),t=this._stripDateTime(t),this._appointments.element().empty(),this._workSpace.option("currentDate",t),this._header.option("currentDate",t),this._filterAppointmentsByDate();break;case"dataSource":this._initDataSource(),this._appointmentModel.setDataSource(this._dataSource),this._filterAppointmentsByDateAndResources(),this._appointments.option("dataSource",this._dataSource);break;case"views":this._header.option("views",t);break;case"currentView":this._header.option("currentView",t),this._refreshWorkSpace(),this._appointments.option("renderingStrategy",this._getAppointmentsRenderingStrategy()),this._appointments.option("allowAllDayResize",t!=="day"),this._filterAppointmentsByDateAndResources(!0);break;case"appointmentTemplate":this._appointments.option("itemTemplate",t);break;case"groups":this._filterAppointmentsByDateAndResources(!0);break;case"resources":this._resourcesManager.setResources(t),this._filterAppointmentsByDateAndResources(!0);break;case"startDayHour":this._filterAppointmentsByDate(),this._workSpace.option("startDayHour",t);break;case"endDayHour":this._filterAppointmentsByDate(),this._workSpace.option("endDayHour",t);break;case"onAppointmentAdding":case"onAppointmentAdded":case"onAppointmentUpdating":case"onAppointmentUpdated":case"onAppointmentDeleting":case"onAppointmentDeleted":this._actions[n.name]=this._createActionByOption(n.name);break;case"onAppointmentRendered":this._appointments.option("onItemRendered",t);break;case"tabIndex":case"focusStateEnabled":this._header.option(n.name,t),this._workSpace.option(n.name,t),this._appointments.option(n.name,t),this.callBase(n);break;case"width":this._header.option("width",t),this.callBase(n);break;case"editing":this.element().toggleClass(e,!t),this._appointments.option({allowDrag:t,allowResize:t,allowAllDayResize:t}),this._refreshPopup(),this._hideTooltip();break;default:this.callBase(n)}},_filterAppointmentsByDate:function(){var n=this._workSpace.getDateRange();this._appointmentModel.filterByDate(n[0],n[1],this.option("startDayHour"),this.option("endDayHour")),this._reloadDataSource()},_filterAppointmentsByDateAndResources:function(n){var t=this,i=t._workSpace.getDateRange(),r=t.option("groups");this._resourcesManager.getResourcesValueByFields(r).done(function(r){t._workSpace.option("groups",r);var u=t._prepareResourcesForFilter(r);t._appointmentModel.filterByDateAndResources({min:i[0],max:i[1],resources:u,startDayHour:t.option("startDayHour"),endDayHour:t.option("endDayHour")}),n&&t._reloadDataSource()})},_reloadDataSource:function(){this._dataSource&&this._dataSource.load()},_prepareResourcesForFilter:function(t){return n.map(t,function(n){for(var i=n.items,r=[],t=0,u=i.length;t<u;t++)r.push(i[t].id);return{field:n.name,data:r}})},_dimensionChanged:function(){this._appointments.repaint()},_visibilityChanged:function(n){n&&this._dimensionChanged()},_init:function(){this.callBase(),this._initDataSource(),this._proxiedCustomizeStoreLoadOptionsHandler=n.proxy(this._customizeStoreLoadOptionsHandler,this),this._customizeStoreLoadOptions(),this.element().addClass(o),this.element().toggleClass(e,!this.option("editing")),this._appointmentModel=new r.dxScheduler.dxSchedulerAppointmentModel(this._dataSource),this._resourcesManager=new r.dxScheduler.dxSchedulerResourceManager(this.option("resources")),this._initActions(),this._subscribes=r.dxScheduler.subscribes},_dataSourceOptions:function(){return{paginate:!1}},_customizeStoreLoadOptions:function(){this._dataSource&&this._dataSource.on("customizeStoreLoadOptions",this._proxiedCustomizeStoreLoadOptionsHandler)},_dispose:function(){this._dataSource&&this._dataSource.off("customizeStoreLoadOptions",this._proxiedCustomizeStoreLoadOptionsHandler),this.callBase()},_customizeStoreLoadOptionsHandler:function(n){n.storeLoadOptions.dxScheduler={startDate:this._workSpace.getFirstViewDate(),endDate:this._workSpace.getLastViewDate(),resources:this.option("resources")}},_initActions:function(){this._actions={onAppointmentAdding:this._createActionByOption("onAppointmentAdding"),onAppointmentAdded:this._createActionByOption("onAppointmentAdded"),onAppointmentUpdating:this._createActionByOption("onAppointmentUpdating"),onAppointmentUpdated:this._createActionByOption("onAppointmentUpdated"),onAppointmentDeleting:this._createActionByOption("onAppointmentDeleting"),onAppointmentDeleted:this._createActionByOption("onAppointmentDeleted")}},_initAppointmentRenderedAction:function(){return this._createActionByOption("onAppointmentRendered",{excludeValidators:["designMode","disabled","readOnly"]})},_defaultAppointmentViewEditors:function(){var n=this;return[{key:"text",type:"dxTextBox",label:"dxScheduler-editorLabelTitle",cssClass:u+"-caption"},{key:"allDay",type:"dxSwitch",label:"dxScheduler-allDay",cssClass:u+"-allday",options:{onValueChanged:function(t){var f=t.value,r=n._appointmentView.getEditorInstance("startDate"),u=n._appointmentView.getEditorInstance("endDate"),i,e;r&&u&&(r.option("format",f?"date":"datetime"),u.option("format",f?"date":"datetime"),i=new Date(r.option("value")),f?(i.setHours(0),i.setMinutes(0),r.option("value",i),e=new Date(i),e.setDate(i.getDate()+1),u.option("value",e)):r.option("value")&&(i.setHours(n.option("startDayHour")),r.option("value",i),u.option("value",n._workSpace._calculateEndDate(r.option("value")))))}}},{key:"startDate",type:"dxDateBox",label:"dxScheduler-editorLabelStartDate",cssClass:u+"-start-date",options:{format:"datetime",onValueChanged:function(t){var i=t.value,e=t.previousValue,r=n._appointmentView.getEditorInstance("endDate"),u=r.option("value"),f;u<=i&&(f=u.getTime()-e.getTime(),r.option("value",new Date(i.getTime()+f)))}}},{key:"endDate",type:"dxDateBox",label:"dxScheduler-editorLabelEndDate",cssClass:u+"-end-date",options:{format:"datetime",onValueChanged:function(t){var i=t.value,e=t.previousValue,r=n._appointmentView.getEditorInstance("startDate"),u=r.option("value"),f;u>=i&&(f=e.getTime()-u.getTime(),r.option("value",new Date(i.getTime()-f)))}}},{key:"description",type:"dxTextArea",label:"dxScheduler-editorLabelDescription",cssClass:u+"-description"},{key:"recurrenceRule",type:"dxSchedulerRecurrenceEditor",label:"dxScheduler-editorLabelRecurrence",cssClass:u+"-recurrence"}]},_renderFocusTarget:n.noop,_render:function(){this.callBase(),this._renderHeader(),this._appointments=this._createComponent("<div>","dxSchedulerAppointments",this._appointmentsConfig()),this._resourcesManager.getResourcesValueByFields(this.option("groups")).done(n.proxy(function(n){this._renderWorkSpace(n);var t=this._workSpace.getAllDayContainerClass();this._appointments.option({fixedContainer:this.element().find("."+t)}),this._filterAppointmentsByDateAndResources(),this._appointments.option("dataSource",this._dataSource)},this))},_renderHeader:function(){this._header=this._createComponent("<div>","dxSchedulerHeader",this._headerConfig()),this.element().append(this._header.element())},_headerConfig:function(){return{observer:this,views:this.option("views"),firstDayOfWeek:this.option("firstDayOfWeek"),currentView:this.option("currentView"),currentDate:this._stripDateTime(f.makeDate(this.option("currentDate"))),tabIndex:this.option("tabIndex"),focusStateEnabled:this.option("focusStateEnabled"),width:this.option("width")}},_appointmentsConfig:function(){return{observer:this,renderingStrategy:this._getAppointmentsRenderingStrategy(),itemTemplate:this._getTemplateByOption("appointmentTemplate"),onItemRendered:this.option("onAppointmentRendered"),tabIndex:this.option("tabIndex"),focusStateEnabled:this.option("focusStateEnabled"),allowDrag:this.option("editing"),allowResize:this.option("editing"),allowAllDayResize:this.option("editing")&&this.option("currentView")!=="day"}},_getAppointmentsRenderingStrategy:function(){return this.option("currentView")==="month"?"horizontal":"vertical"},_renderWorkSpace:function(n){this._workSpace=this._createComponent("<div>",h[this.option("currentView")],this._workSpaceConfig(n)),this._workSpace.getWorkArea().append(this._appointments.element()),this.element().append(this._workSpace.element()),t.utils.triggerShownEvent(this._workSpace.element())},_workSpaceConfig:function(n){return{observer:this,currentDate:this._stripDateTime(f.makeDate(this.option("currentDate"))),firstDayOfWeek:this.option("firstDayOfWeek"),groups:n,startDayHour:this.option("startDayHour"),endDayHour:this.option("endDayHour"),tabIndex:this.option("tabIndex"),focusStateEnabled:this.option("focusStateEnabled")}},_refreshWorkSpace:function(){var t=this._workSpace.getAllDayContainerClass();this._appointments.element().detach(),this._workSpace._dispose(),this._workSpace.element().remove(),delete this._workSpace,this._resourcesManager.getResourcesValueByFields(this.option("groups")).done(n.proxy(function(n){this._renderWorkSpace(n),this._appointments.option({fixedContainer:this.element().find("."+t)})},this))},getWorkSpaceScrollableScrollTop:function(){return this._workSpace.getScrollableScrollTop()},getWorkSpaceScrollableContainer:function(){return this._workSpace.getScrollableContainer()},getWorkSpaceAllDayHeight:function(){return this._workSpace.getAllDayHeight()},_createPopup:function(){this._$popup||this._refreshPopup()},_refreshPopup:function(){var i,t,f;this._$popup=n("<div>").addClass(u).appendTo(this.element()),this._popup=this._createComponent(this._$popup,"dxPopup",this._popupConfig()),i=this._popup.content(),i.empty(),t=this._defaultAppointmentViewEditors(),f=this.option("resources"),f&&f.length&&(this._resourcesManager.setResources(this.option("resources")),t=t.concat(this._resourcesManager.getEditors())),this._appointmentView=new r.dxScheduler.dxSchedulerAppointmentDetailsView(i,{editors:t,rtlEnabled:this.option("rtlEnabled"),readOnly:!this.option("editing")})},_popupConfig:function(){var t=[];return this.option("editing")&&(t=[{shortcut:"done",location:"after",onClick:n.proxy(this._doneButtonClickHandler,this)},{shortcut:"cancel",location:"after"}]),{width:s,buttons:t,onHiding:n.proxy(function(){this._workSpace.focus()},this)}},_doneButtonClickHandler:function(t){var i=n.extend({},!0,this._editAppointmentData);this._saveChanges(t),i&&!this._appointmentView.option("values").allDay&&i.allDay&&this._updateScrollPosition()},_saveChanges:function(){var t=this._appointmentView.option("values"),i=this._editAppointmentData;i?this._checkRecurringAppointment(i.recurrenceRule,n.proxy(function(){this.updateAppointment(this._editAppointmentData,t)},this)):this.addAppointment(t)},_updateScrollPosition:function(){var n=this._appointmentView.option("values").startDate;this.scrollToTime(n.getHours(),n.getMinutes())},_checkRecurringAppointment:function(t,i,r){t?this._showRecurrenceChangeConfirm(r).done(n.proxy(function(n){n?i():this._appointments.repaint()},this)):i()},_showRecurrenceChangeConfirm:function(n){var t;return t=n?"All occurrences of the recurring appointment will be deleted.<br> Are you sure you want to delete them?":"All occurrences of the recurring appointment will be edited.<br> Are you sure you want to edit them?",r.dialog.confirm(t,null,!1)},_getUpdatedData:function(n){var r=n.data,u=this.getTargetCellData(),e=u.date||r.startDate,f=u.groups,o=r.endDate.getTime()-r.startDate.getTime(),t={},i;t.allDay=u.allDay,t.startDate=e,t.endDate=new Date(e.getTime()+o);for(i in f)f.hasOwnProperty(i)&&(t[i]=f[i]);return t},_getCoordinates:function(n,t,i){for(var u=[],r=0;r<n.length;r++)u=u.concat(this._workSpace.getCoordinatesByDateInGroup(n[r],t,i));return u},subsribe:function(n,t){this._subscribes[n]=r.dxScheduler.subscribes[n]=t},fire:function(i,r){var u=this._subscribes[i];if(!n.isFunction(u))throw t.Error("E1031",i);u.call(this,r)},getTargetCellData:function(){return this._workSpace.getDataByDroppableCell()},showAppointmentTooltip:function(n,t){r.dxScheduler.tooltip.show(n,t,this)},_hideTooltip:function(){r.dxScheduler.tooltip.hide()},_executeActionWhenOperationIsCompleted:function(n,t,i){var r={appointment:t},u=i&&i.name==="Error";u&&(r.error=i),n(r)},_processActionResult:function(t,i){n.when(t.cancel).then(n.proxy(i,this))},_updateAppointment:function(t,i,r){var u={newData:i,oldData:t,cancel:!1};this._actions.onAppointmentUpdating(u);this._processActionResult(u,function(u){u?n.isFunction(r)&&r.call(this):this._appointmentModel.update(t,i).always(n.proxy(function(n){this._executeActionWhenOperationIsCompleted(this._actions.onAppointmentUpdated,i,n)},this))})},showAppointmentPopup:function(n){this._createPopup(),this._popup.show(),this._appointmentView.option("values",n)},getAppointmentDetailsView:function(){return this._appointmentView},getAppointmentsInstance:function(){return this._appointments},getAppointmentResourceData:function(n,t){return this._resourcesManager.getResourceDataByValue(n,t)},getActions:function(){return this._actions},appointmentTakesAllDay:function(n){var t=this.option("endDayHour")-this.option("startDayHour"),i=(n.endDate.getTime()-n.startDate.getTime())/36e5;return i>=t},scrollToTime:function(n,t){if(this.option("currentView")!=="month"){var i=new Date(this.option("currentDate")),r=this._workSpace.getScrollable(),u=this.option("startDayHour"),f=this.option("endDayHour"),e;n<u&&(n=u),n>=f&&(n=f-1),i.setHours(n),i.setMinutes(t),e=this._workSpace.getCoordinatesByDate(i),r.scrollBy(e.top-r.scrollTop())}},addAppointment:function(t){t.text||(t.text="");var i={appointment:t,cancel:!1};this._actions.onAppointmentAdding(i);this._processActionResult(i,function(i){i||this._appointmentModel.add(t).always(n.proxy(function(n){this._executeActionWhenOperationIsCompleted(this._actions.onAppointmentAdded,t,n)},this))})},updateAppointment:function(n,t){this._updateAppointment(n,t)},deleteAppointment:function(t){var i={appointment:t,cancel:!1};this._actions.onAppointmentDeleting(i);this._processActionResult(i,function(i){i||this._appointmentModel.remove(t).always(n.proxy(function(n){this._executeActionWhenOperationIsCompleted(this._actions.onAppointmentDeleted,t,n)},this))})}}).include(r.DataHelperMixin))}(jQuery,DevExpress),function(n,t){t.ui.dxScheduler.subscribes={currentViewUpdated:function(n){this.option("currentView",n)},needCoordinates:function(n){var i=n.appointmentData,u=n.startDate,f=this._workSpace.getDateRange(),r=t.utils.getDatesByRecurrence(i.recurrenceRule,u,f[0],f[1]),e;r.length||r.push(u),e=this._resourcesManager.getResourcesFromItem(i),n.callback(this._getCoordinates(r,e,i.allDay))},showEditAppointmentPopup:function(n){this._editAppointmentData=n,this.showAppointmentPopup(n)},showAppointmentTooltip:function(n){this._editAppointmentData=n.data,this.showAppointmentTooltip(n.data,n.target)},hideAppointmentTooltip:function(){this._hideTooltip()},showAddAppointmentPopup:function(n){delete this._editAppointmentData,this.option("editing")&&this.showAppointmentPopup(n)},updateAppointmentAfterResize:function(i){this._checkRecurringAppointment(i.target.recurrenceRule,n.proxy(function(){this._updateAppointment(i.target,i.data,function(){t.translator.move(i.$appointment,i.initialCoordinates),i.target.startDate=t.utils.makeDate(i.target.startDate),i.target.endDate=t.utils.makeDate(i.target.endDate),this.option("currentView")==="month"||i.target.allDay||this.appointmentTakesAllDay(i.target)?i.$appointment.outerWidth(i.initialSize.width):i.$appointment.outerHeight(i.initialSize.height)})},this))},updateAppointmentAfterDrag:function(i){var u=i.data,r=this._getUpdatedData(i),o=this._workSpace.getAllDayContainerClass(),f,s=this._workSpace.getDroppableCellIndex(),h=this._workSpace.getCellIndexByCoordinates(i.initialCoordinates),e;i.$appointment.parent().hasClass(o)&&!r.allDay&&(r.endDate=this._workSpace._calculateEndDate(r.startDate)),f=n.extend({},u,r),e=u.allDay||r.allDay,s!==h||e?this._checkRecurringAppointment(u.recurrenceRule,n.proxy(function(){this._updateAppointment(u,f,function(){t.translator.move(i.$appointment,i.initialCoordinates)})},this)):t.translator.move(i.$appointment,i.initialCoordinates)},updateCurrentDate:function(n){this.option("currentDate",this._stripDateTime(t.utils.makeDate(n)))},getAppointmentColor:function(n){var r=this._resourcesManager.getResourceForPainting(this.option("groups")),i,e;if(r&&(i=r.field,n.itemData[i])){var o=t.utils.wrapToArray(n.itemData[i]),u=n.resourceIndex,f=this.option("groups");f&&f.length||(u=0),e=o[u],n.callback(this._resourcesManager.getResourceColor(i,e))}},getResourceForPainting:function(n){n.callback(this._resourcesManager.getResourceForPainting(this.option("groups")))},getResourcesFromItem:function(n){n.callback(this._resourcesManager.getResourcesFromItem(n.itemData))},getCellDimensions:function(n){this._workSpace&&n.callback(this._workSpace.getCellWidth(),this._workSpace.getCellHeight(),this._workSpace.getAllDayHeight())},initAppointmentRenderedAction:function(n){n.callback(this._initAppointmentRenderedAction())},getMaxAllowedPosition:function(n){this._workSpace&&n.callback(this._workSpace.getMaxAllowedPosition())},getItemGroupIndexes:function(n){var t=this._resourcesManager.getResourcesFromItem(n.item),i=this._workSpace._getGroupIndexes(t);n.callback(i)},appointmentTakesAllDay:function(n){n.callback(this.appointmentTakesAllDay({startDate:n.startDate,endDate:n.endDate}))},checkContainerVisibility:function(n){n.callback(this.element().is(":hidden"))},getResizableAppointmentArea:function(n){var i,t;this.option("groups")&&this.option("groups").length&&(n.allDay||this.option("currentView")==="month")&&(t=this._workSpace.getGroupBounds(n.coordinates,n.allDay),i={left:t.left,right:t.right,top:0,bottom:0}),n.callback(i)}}}(jQuery,DevExpress),function(n,t){var r=t.ui,u="dx-scheduler-appointment-tooltip",f="dx-scheduler-appointment-tooltip-title",e="dx-scheduler-appointment-tooltip-date",o="dx-scheduler-appointment-tooltip-buttons";r.dxScheduler.tooltip={show:function(n,t,i){this.instance=i;var u=this,f=i.appointmentTakesAllDay(n)||n.allDay;r.tooltip.show({target:t,rtlEnabled:i.option("rtlEnabled"),contentTemplate:function(t){var i=u._tooltipContent(n);i.addClass(t.attr("class")),t.replaceWith(i)},position:{my:"bottom",at:"top",of:t,boundary:f?i.element():i.getWorkSpaceScrollableContainer(),collision:"fit flipfit"}})},hide:function(){r.tooltip.hide()},_tooltipContent:function(t){var i=this,r=n("<div>").addClass(u),s;return n("<div>").text(t.text).addClass(f).appendTo(r),n("<div>").addClass(e).text(i._formatTooltipDate(t.startDate,t.endDate)).appendTo(r),s=n("<div>").addClass(o).appendTo(r),i.instance.option("editing")&&n("<div>").appendTo(s).dxButton({icon:"trash",onClick:function(){i.instance._checkRecurringAppointment(t.recurrenceRule,function(){i.instance.deleteAppointment(t)},!0),i.hide()}}),n("<div>").appendTo(s).dxButton({icon:i.instance.option("editing")?"edit":"",text:Globalize.localize("dxScheduler-openAppointment"),onClick:function(){i.instance.showAppointmentPopup(t)}}),r},_formatTooltipDate:function(n,t){var i="MMMM d h:mm tt",r,u;return this.instance.option("currentView")==="month"?(r=Globalize.format(n,i)+" - ",u=n.getDate()===t.getDate()?Globalize.format(t,"t"):Globalize.format(t,i),r+u):Globalize.format(n,"t")+" - "+Globalize.format(t,"t")}}}(jQuery,DevExpress),function(n,t){var r=t.utils,u=t.Class.inherit({_resourceFilter:function(t,i){for(var u=!0,r,o,e,h,f=0,s=i.length;f<s;f++)if(r=i[f].field,o=i[f].data,t.hasOwnProperty(r)){if(n.isArray(t[r])){for(u=!1,e=0,h=t[r].length;e<h;e++)if(n.inArray(t[r][e],o)>-1){u=!0;break}}else if(n.inArray(t[r],o)===-1){u=!1;break}}else{u=!1;break}return u},ctor:function(n){this.setDataSource(n)},setDataSource:function(n){this._dataSource=n},filterByDate:function(n,t,i,r){if(this._dataSource){var u=this._prepareDateFilter(n,t,i,r);this._dataSource.filter(u)}},_prepareDateFilter:function(t,i,u,f){var e=this._dataSource;return function(o){n.isFunction(e._mapFunc)&&(o=e._mapFunc(o));var s=r.makeDate(o.startDate),l=o.recurrenceRule,c=o.allDay,a=function(n){return n=new Date(n),r.correctDateWithUnitBeginning(n,"day"),n},h=r.dateInRange(s,t,i)&&!l||r.dateInRange(s,a(t),i)&&c||r.dateInRecurrenceRange(l,s,t,i);return h&&u&&(h=s.getHours()>=u||c),h&&f&&(h=s.getHours()<=f||c),h}},filterByResources:function(n){if(this._dataSource){var t=this._prepareResourcesFilter(n);this._dataSource.filter(t)}},_prepareResourcesFilter:function(t){return n.proxy(function(n){return this._resourceFilter(n,t)},this)},filterByDateAndResources:function(t){this._dataSource&&this._dataSource.filter(n.proxy(function(n){var i=this._prepareDateFilter(t.min,t.max,t.startDayHour,t.endDayHour),r=this._prepareResourcesFilter(t.resources);return i(n)&&r(n)},this))},add:function(t){return this._dataSource.store().insert(t).done(n.proxy(function(){this._dataSource.load()},this))},update:function(t,i){return this._dataSource.store().update(t,i).done(n.proxy(function(){this._dataSource.load()},this))},remove:function(t){return this._dataSource.store().remove(t).done(n.proxy(function(){this._dataSource.load()},this))}});t.ui.dxScheduler.dxSchedulerAppointmentModel=u}(jQuery,DevExpress),function(n,t){var r=t.utils,a="dx-recurrence-editor",f="-label",v="dx-recurrence-editor-container",y="dx-recurrence-switch",p="dx-recurrence-switch-repeat-end",w="dx-recurrence-radiogroup-freq",o="dx-recurrence-numberbox-interval",b="dx-recurrence-interval-field",s="dx-recurrence-repeat-end",k="dx-recurrence-repeat-end-field",d="dx-recurrence-repeat-end-container",h="dx-recurrence-radiogroup-repeat-type",g="dx-recurrence-numberbox-repeat-count",nt="dx-recurrence-datebox-until-date",l="dx-recurrence-repeat-on",tt="dx-recurrence-repeat-on-week",it="dx-recurrence-checkbox-day-of-week",rt="dx-recurrence-repeat-on-month",ut="dx-recurrence-numberbox-day-of-month",ft="dx-recurrence-repeat-on-year",et="dx-recurrence-selectbox-month-of-year",e="dx-field",c="dx-field-label",u="dx-field-value",ot=[{text:function(){return Globalize.localize("dxScheduler-recurrenceDaily")},value:"DAILY"},{text:function(){return Globalize.localize("dxScheduler-recurrenceWeekly")},value:"WEEKLY"},{text:function(){return Globalize.localize("dxScheduler-recurrenceMonthly")},value:"MONTHLY"},{text:function(){return Globalize.localize("dxScheduler-recurrenceYearly")},value:"YEARLY"}],st=[{text:function(){return Globalize.localize("dxScheduler-recurrenceRepeatCount")},value:"count"},{text:function(){return Globalize.localize("dxScheduler-recurrenceRepeatOnDate")},value:"until"}],ht=t.Class.inherit({ctor:function(n){this._recurrenceRule=t.utils.getRecurrenceRule(n)},makeRules:function(n){var t=this;t._recurrenceRule=r.getRecurrenceRule(n)},makeRule:function(n,t){if(!t){delete this._recurrenceRule[n];return}r.isDefined(n)&&(n==="until"&&delete this._recurrenceRule.count,n==="count"&&delete this._recurrenceRule.until,this._recurrenceRule[n]=t)},repeatableRule:function(){var n=this._recurrenceRule;return"count"in n?"count":"until"in n?"until":null},recurrenceString:function(){return r.getRecurrenceString(this._recurrenceRule)},rules:function(){return this._recurrenceRule},daysFromByDayRule:function(){var n=[];return this._recurrenceRule.byday&&(n=this._recurrenceRule.byday.split(",")),n}});t.registerComponent("dxSchedulerRecurrenceEditor",t.ui.dxScheduler,t.ui.Editor.inherit({_setDefaultOptions:function(){this.callBase(),this.option({value:null,onValueChanged:null,startDate:new Date})},_init:function(){this.callBase(),this._recurrenceRule=new ht(this.option("value"))},_render:function(){this.callBase(),this.element().addClass(a),this._renderSwitch(),this._$container=n("<div>").addClass(v).appendTo(this.element()),this._renderEditors(),this._renderContainerVisibility()},_renderSwitch:function(){var t=n("<div>").addClass(y);this._switchEditor=this._createComponent(t,"dxSwitch",{value:!1,onValueChanged:n.proxy(this._switchValueChangeHandler,this)}),this.element().append(t)},_switchValueChangeHandler:function(n){var t=n.value;this._renderContainerVisibility(t),!this.option("value")&&t?this._handleDefaults():t||(this._recurrenceRule.makeRules(""),this.option("value",""))},_renderContainerVisibility:function(n){n?(this._$container.show(),t.utils.triggerShownEvent(this._$container)):this._$container.hide()},_handleDefaults:function(){this._recurrenceRule.makeRule("freq","DAILY"),this.option("value",this._recurrenceRule.recurrenceString())},_renderEditors:function(){this._renderFreqEditor(),this._renderIntervalEditor(),this._renderRepeatOnEditor(),this._renderRepeatEndSwitch(),this._renderRepeatEndEditor(),this._renderRepeatEndVisibility()},_renderFreqEditor:function(){var r=this._recurrenceRule.rules().freq||"DAILY",t=n("<div>").addClass(w).addClass(u),i;this._freqEditor=this._createComponent(t,"dxRadioGroup",{field:"freq",items:ot,value:r,valueExpr:"value",displayExpr:"text",layout:"horizontal",onValueChanged:n.proxy(this._valueChangedHandler,this)}),i=n("<div>").addClass(e).append(t),this._$container.append(i)},_renderIntervalEditor:function(){var t=this._recurrenceRule.rules().freq||"DAILY",i=n("<div>").addClass(o).addClass(u),r=n("<div>").text(Globalize.localize("dxScheduler-recurrenceEvery")+":").addClass(o+f).addClass(c),s,l;this._$intervalTypeLabel=n("<div>").text(Globalize.localize("dxScheduler-recurrenceRepeat"+t.charAt(0).toUpperCase()+t.substr(1).toLowerCase())).addClass(h+f),s=this._recurrenceRule.rules().interval||1,this._intervalEditor=this._createComponent(i,"dxNumberBox",{field:"interval",min:1,value:s,showSpinButtons:!0,useTouchSpinButtons:!1,onValueChanged:n.proxy(this._valueChangedHandler,this)}),l=n("<div>").addClass(e).addClass(b).append(r,i,this._$intervalTypeLabel),this._$container.append(l),this._setAriaDescribedBy(this._intervalEditor,r)},_renderRepeatOnEditor:function(){var t=this._recurrenceRule.rules().freq;if(r.isDefined(this._$repeatOnEditor)||(this._$repeatOnEditor=n("<div>").addClass(l).addClass(e).appendTo(this._$container)),!t||t==="DAILY"){this._clearRepeatOnEditor(),this._clearRepeatOnLabel();return}if(r.isDefined(this._$repeatOnLabel)||this._renderRepeatOnLabel(this._$repeatOnEditor),t==="WEEKLY"&&!this._$repeatOnWeek){this._renderRepeatOnWeekEditor();return}if(t==="MONTHLY"&&!this._$repeatOnMonth){this._renderRepeatOnMonthEditor();return}if(t==="YEARLY"&&!this._$repeatOnYear){this._renderRepeatOnYearEditor();return}},_renderRepeatOnLabel:function(t){this._$repeatOnLabel=n("<div>").text(Globalize.localize("dxScheduler-recurrenceOn")+":").addClass(l+f).addClass(c),t.append(this._$repeatOnLabel)},_clearRepeatOnEditor:function(){r.isDefined(this._$repeatOnWeek)&&(this._$repeatOnWeek.detach(),this._$repeatOnWeek.remove(),delete this._$repeatOnWeek),r.isDefined(this._$repeatOnMonth)&&(this._$repeatOnMonth.detach(),this._$repeatOnMonth.remove(),delete this._$repeatOnMonth),r.isDefined(this._$repeatOnYear)&&(this._$repeatOnYear.detach(),this._$repeatOnYear.remove(),delete this._$repeatOnYear)},_clearRepeatOnEditorValues:function(){this._recurrenceRule.makeRule("bymonth",""),this._recurrenceRule.makeRule("bymonthday",""),this._recurrenceRule.makeRule("byday","")},_clearRepeatOnLabel:function(){r.isDefined(this._$repeatOnLabel)&&(this._$repeatOnLabel.detach(),this._$repeatOnLabel.remove(),delete this._$repeatOnLabel)},_renderRepeatOnWeekEditor:function(){var i,r,t;for(this._clearRepeatOnEditor(),this._$repeatOnWeek=n("<div>").addClass(tt).addClass(u).appendTo(this._$repeatOnEditor),i=Globalize.culture().calendar.days.namesShort,r=this._daysOfWeekByRules(),this._daysOfWeek=[],t=0;t<7;t++){var f=i[t].toUpperCase(),e=n("<div>").addClass(it),o=this._createComponent(e,"dxCheckBox",{text:f,value:n.inArray(f,r)>-1?!0:!1,onValueChanged:n.proxy(this._repeatByDayValueChangeHandler,this)});this._daysOfWeek[t]=o,this._$repeatOnWeek.append(e)}},_daysOfWeekByRules:function(){var t=Globalize.culture().calendar.days.namesShort,n=this._recurrenceRule.daysFromByDayRule();return n.length||(n=[t[this.option("startDate").getDay()].toUpperCase()]),n},_repeatByDayValueChangeHandler:function(){var t="";n.each(this._daysOfWeek,function(n,i){if(i.option("value")){var r=i.option("text");t=t?t+","+r:r}}),this._recurrenceRule.makeRule("byday",t),this.option("value",this._recurrenceRule.recurrenceString())},_renderRepeatOnMonthEditor:function(){this._clearRepeatOnEditor(),this._$repeatOnMonth=n("<div>").addClass(rt).addClass(u).appendTo(this._$repeatOnEditor),this._renderDayOfMonthEditor(this._$repeatOnMonth)},_renderRepeatOnYearEditor:function(){var i,r,t;for(this._clearRepeatOnEditor(),this._$repeatOnYear=n("<div>").addClass(ft).addClass(u).appendTo(this._$repeatOnEditor),i=[],r=Globalize.culture().calendar.months.names,t=0;t<12;t++)i[t]={value:String(t+1),text:r[t]};var f=this._monthOfYearByRules(),e=n("<div>").addClass(et).appendTo(this._$repeatOnYear),o=function(n){var t,i;this._valueChangedHandler.call(this,n),t=parseInt(n.component.option("value")),this._dayEditor&&t&&(i=new Date((new Date).getFullYear(),parseInt(t),0).getDate(),t===2&&(i=29),this._dayEditor.option("max",i))};this._monthEditor=this._createComponent(e,"dxSelectBox",{field:"bymonth",items:i,value:f,displayExpr:"text",valueExpr:"value",onValueChanged:n.proxy(o,this)}),this._renderDayOfMonthEditor(this._$repeatOnYear)},_monthOfYearByRules:function(){var n=this._recurrenceRule.rules().bymonth;return n||(n=this.option("startDate").getMonth()),n},_renderDayOfMonthEditor:function(t){var r=this._dayOfMonthByRules(),i=n("<div>").addClass(ut);this._dayEditor=this._createComponent(i,"dxNumberBox",{field:"bymonthday",min:1,max:31,showSpinButtons:!0,useTouchSpinButtons:!1,value:r,onValueChanged:n.proxy(this._valueChangedHandler,this)}),t.append(i)},_dayOfMonthByRules:function(){var n=this._recurrenceRule.rules().bymonthday;return n||(n=this.option("startDate").getDate()),n},_setAriaDescribedBy:function(n,t){var i="label-"+new DevExpress.data.Guid;n.setAria("describedby",i),n.setAria("id",i,t)},_renderRepeatEndSwitch:function(){var r=this,t=n("<div>").addClass(p).addClass(u),i=n("<div>").text(Globalize.localize("dxScheduler-recurrenceEnd")+":").addClass(o+f).addClass(c);this._switchEndEditor=this._createComponent(t,"dxSwitch",{value:r._recurrenceRule.repeatableRule()?!0:!1,onValueChanged:n.proxy(this._repeatEndSwitchValueChangeHandler,this)}),n("<div>").addClass(e).addClass(k).append(i,t).appendTo(this._$container),this._setAriaDescribedBy(this._switchEndEditor,i)},_repeatEndSwitchValueChangeHandler:function(n){var t=n.value;this._renderRepeatEndVisibility(t),this._recurrenceRule.rules().count||this._recurrenceRule.rules().until||!t?t||(this._recurrenceRule.makeRule("count",""),this._recurrenceRule.makeRule("until",""),this.option("value",this._recurrenceRule.recurrenceString())):this._handleRepeatEndDefaults()},_renderRepeatEndVisibility:function(n){n?this._$repeatEndEditor.show():this._$repeatEndEditor.hide()},_handleRepeatEndDefaults:function(){this._recurrenceRule.makeRule("count",1),this.option("value",this._recurrenceRule.recurrenceString())},_renderRepeatEndEditor:function(t){t=r.isDefined(t)?t:this._recurrenceRule.repeatableRule(),t||(t="count"),r.isDefined(this._$repeatEndEditor)||(this._$repeatEndEditor=n("<div>").addClass(d).addClass(e).appendTo(this._$container),this._renderRepeatEndTypeEditor())},_renderRepeatEndTypeEditor:function(){var t=this._recurrenceRule.repeatableRule()||"count",i=this;this._$repeatTypeEditor=n("<div>").addClass(h).addClass(u).appendTo(this._$repeatEndEditor),this._repeatTypeEditor=this._createComponent(this._$repeatTypeEditor,"dxRadioGroup",{items:st,value:t,displayExpr:"text",valueExpr:"value",itemTemplate:function(n){return n.value==="count"?i._renderRepeatCountEditor():i._renderRepeatUntilEditor()},layout:"vertical",onValueChanged:n.proxy(this._repeatTypeValueChangedHandler,this)}),this._disableRepeatEndParts(t)},_repeatTypeValueChangedHandler:function(n){var t=n.value;this._disableRepeatEndParts(t),t==="until"?this._recurrenceRule.makeRule(t,r.getAsciiStringByDate(this._repeatUntilDate.option("value"))):t==="count"&&this._recurrenceRule.makeRule(t,this._repeatCountEditor.option("value")),this.option("value",this._recurrenceRule.recurrenceString())},_disableRepeatEndParts:function(n){n==="until"?(this._repeatCountEditor.option("disabled",!0),this._repeatUntilDate.option("disabled",!1)):n==="count"&&(this._repeatCountEditor.option("disabled",!1),this._repeatUntilDate.option("disabled",!0))},_renderRepeatCountEditor:function(){var i=this._recurrenceRule.rules().count||1,t=n("<div>");return n("<div>").text(Globalize.localize("dxScheduler-recurrenceAfter")+":").addClass(s+f).appendTo(t),this._$repeatCountEditor=n("<div>").addClass(g).addClass(u).appendTo(t),n("<div>").text(Globalize.localize("dxScheduler-recurrenceRepeatCount")).addClass(s+f).appendTo(t),this._repeatCountEditor=this._createComponent(this._$repeatCountEditor,"dxNumberBox",{field:"count",min:1,showSpinButtons:!0,useTouchSpinButtons:!1,value:i,onValueChanged:n.proxy(this._repeatCountValueChangeHandler,this)}),t},_repeatCountValueChangeHandler:function(n){if(this._recurrenceRule.repeatableRule()==="count"){var t=n.value;this._recurrenceRule.makeRule("count",t),this.option("value",this._recurrenceRule.recurrenceString())}},_renderRepeatUntilEditor:function(){var i=this._recurrenceRule.rules().until||new Date,t=n("<div>");return n("<div>").text(Globalize.localize("dxScheduler-recurrenceOn")+":").addClass(s+f).appendTo(t),this._$repeatDateEditor=n("<div>").addClass(nt).addClass(u).appendTo(t),this._repeatUntilDate=this._createComponent(this._$repeatDateEditor,"dxDateBox",{field:"until",value:i,format:"date",onValueChanged:n.proxy(this._repeatUntilValueChangeHandler,this)}),t},_repeatUntilValueChangeHandler:function(n){if(this._recurrenceRule.repeatableRule()==="until"){var t=n.value;typeof t!="string"&&(t=r.getAsciiStringByDate(t)),this._recurrenceRule.makeRule("until",t),this.option("value",this._recurrenceRule.recurrenceString())}},_valueChangedHandler:function(n){var i=n.component.option("value"),t=n.component.option("field");t==="freq"&&this._clearRepeatOnEditorValues(),this._recurrenceRule.makeRule(t,i),this.option("value",this._recurrenceRule.recurrenceString()||"")},_optionChanged:function(n){switch(n.name){case"value":this._recurrenceRule.makeRules(n.value),this._switchEditor.option("value",!!n.value),this._switchEndEditor.option("value",!!this._recurrenceRule.repeatableRule()),this._repeatTypeEditor.option("value",this._recurrenceRule.repeatableRule()||"count"),this._renderRepeatEndEditor(),this._renderRepeatOnEditor(),this._changeEditorsValues(this._recurrenceRule.rules()),this.callBase(n);break;case"startDate":this._clearRepeatOnEditor(),this._renderRepeatOnEditor();break;default:this.callBase(n)}},_changeEditorsValues:function(n){this._freqEditor.option("value",n.freq),this._changeRepeatTypeLabel(),this._intervalEditor.option("value",n.interval),this._changeRepeatCountValue(),this._changeRepeatUntilValue(),this._changeCheckBoxesValue(),this._changeDayOfMonthValue(),this._changeMonthOfYearValue()},_changeRepeatTypeLabel:function(){var i=this.element().find("."+h+f),t;i.length&&(t=this._recurrenceRule.rules().freq||"DAILY",n.each(i,function(i,r){n(r).text(Globalize.localize("dxScheduler-recurrenceRepeat"+t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()))}))},_changeRepeatCountValue:function(){if(this._$repeatCountEditor){var n=this._recurrenceRule.rules().count||1;this._repeatCountEditor.option("value",n)}},_changeRepeatUntilValue:function(){if(this._$repeatDateEditor){var n=r.getDateByAsciiString(this._recurrenceRule.rules().until)||new Date;this._repeatUntilDate.option("value",n)}},_changeCheckBoxesValue:function(){if(this._$repeatOnWeek){var t=this._daysOfWeekByRules();n.each(this._daysOfWeek,function(i,r){r.option("value",n.inArray(r.option("text"),t)>-1)})}},_changeDayOfMonthValue:function(){if(this._$repeatOnMonth||this._$repeatOnYear){var n=this._dayOfMonthByRules()||1;this._dayEditor.option("value",n)}},_changeMonthOfYearValue:function(){if(this._$repeatOnYear){var n=this._monthOfYearByRules()||1;this._monthEditor.option("value",n)}},setAria:function(){this._switchEditor&&this._switchEditor.setAria(arguments[0],arguments[1])}}))}(jQuery,DevExpress),function(n,t,i){var r="dx-scheduler-editor-label-",u="dx-field",f="-field",e="dx-field-label",o="dx-field-value",s="dx-fieldset",h=t.DOMComponent.inherit({_setDefaultOptions:function(){this.callBase(),this.option({values:{},editors:[],readOnly:!1})},_optionChanged:function(n){switch(n.name){case"values":this._setEditorValues(n.value);break;case"editors":break;case"readOnly":break;default:this.callBase(n)}},_setEditorValues:function(n){for(var r=this.option("editors"),o,t=0,u=r.length;t<u;t++){var i=r[t],f=i.type,s=this.element().find("."+i.cssClass),e=s[f]("instance");i.key==="recurrenceRule"&&e.option("startDate",n.startDate),o=n?n[i.key]:null,e.option(this._getEditorValueOptions(f,o))}},_render:function(){var i=this.option("editors"),t,r;for(this._$fieldset=n("<div>").addClass(s),this._scrollable=this._createComponent("<div>","dxScrollable",{useKeyboard:!1}),this._scrollable.content().append(this._$fieldset),t=0,r=i.length;t<r;t++)this._renderEditor(i[t]);this.element().append(this._scrollable.element())},_renderEditor:function(t){var p=this._scrollable,h=this.option("values"),s=t.key,l=t.type,w=this._getEditorValueOptions(l,h[s]),b=n.extend(w,t.options,{onValueChanged:function(n){if(t.options&&t.options.onValueChanged)t.options.onValueChanged(n);p.update(),h[s]=n.values?n.values:n.value,h[s]===i&&delete h[s]},readOnly:this.option("readOnly")}),a=n("<div>").addClass(u).addClass(t.cssClass+f),v="label-"+new DevExpress.data.Guid,k=Globalize.localize(t.label)||t.label,y=n("<div>").attr("id",v).text(k+":").addClass(r+s.toLowerCase()),c=n("<div>").addClass(t.cssClass),d=this._createComponent(c,l,b);d.setAria("describedby",v),y.addClass(e),s!=="recurrenceRule"&&c.addClass(o),a.append(y,c),this._$fieldset.append(a)},_getEditorValueOptions:function(n,i){var r={value:i},u;return n==="dxTagBox"&&(u=i?t.utils.wrapToArray(i):[],r={values:u}),r},getEditorInstance:function(n){for(var r=null,u=this.option("editors"),i,t=0,f=u.length;t<f;t++)i=u[t],i.key===n&&(r=this.element().find("."+i.cssClass)[i.type]("instance"));return r}});t.ui.dxScheduler.dxSchedulerAppointmentDetailsView=h}(jQuery,DevExpress),function(n,t){var e=t.utils,u=t.data.utils,o="dx-scheduler-resource-",r="id",f="text",s=t.Class.inherit({_wrapDataSource:function(n){return n instanceof t.data.DataSource?n:new t.data.DataSource({store:new DevExpress.data.ArrayStore(n),pageSize:0})},_mapResourceData:function(t,i){var e=u.compileGetter(t.valueExpr||r),o=u.compileGetter(t.displayExpr||f);return n.map(i,function(n){return{id:e(n),text:o(n)}})},ctor:function(n){this.setResources(n)},setResources:function(t){this._resources=t,this._resourceFields=n.map(t||[],function(n){return n.field})},getResources:function(){return this._resources||[]},getEditors:function(){var t=[];return n.each(this.getResources(),function(n,i){t.push({options:{dataSource:i.dataSource,displayExpr:i.displayExpr||f,valueExpr:i.valueExpr||r},key:i.field,type:i.allowMultiple?"dxTagBox":"dxSelectBox",label:i.label||i.field,cssClass:o+i.field.toLowerCase()})}),t},getResourceDataByValue:function(t,i){var u=n.Deferred(),f=this;return n.each(this.getResources(),function(n,e){if(e.field===t){var o=f._wrapDataSource(e.dataSource);return o.filter(e.valueExpr||r,i),o.load().done(function(n){u.resolve(n[0])}).fail(function(){u.reject()}),!1}}),u.promise()},getResourcesFromItem:function(t){var r=this,i=null;return n.each(t,function(u){n.inArray(u,r._resourceFields)>-1&&(i||(i={}),i[u]=e.wrapToArray(t[u]))}),i},getResourcesValueByFields:function(t){var i=n.Deferred(),r=this,u=[];return n.each(this.getResourcesByFields(t),function(t,i){var f=n.Deferred();r._wrapDataSource(i.dataSource).load().done(function(n){f.resolve({name:i.field,items:r._mapResourceData(i,n)}),u.push(f)}).fail(function(){f.reject()})}),n.when.apply(null,u).done(function(){i.resolve(Array.prototype.slice.call(arguments))}).fail(function(){i.reject()}),i.promise()},getResourceColor:function(t,i){var r=n.Deferred(),u;return this.getResourceDataByValue(t,i).done(function(n){n&&(u=n.color),r.resolve(u)}).fail(function(){r.reject()}),r.promise()},getResourcesByFields:function(t){return n.grep(this.getResources(),function(i){return n.inArray(i.field,t)>-1})},getResourceForPainting:function(t){var i=this.getResources(),r;return n.each(i,function(n,t){if(t.mainColor)return r=t,!1}),r||(n.isArray(t)&&t.length&&(i=this.getResourcesByFields(t)),r=i[i.length-1]),r}});t.ui.dxScheduler.dxSchedulerResourceManager=s}(jQuery,DevExpress),function(n,t){var r=t.ui;r.dxScheduler.PublisherMixin={notifyObserver:function(n,t){var i=this.option("observer");i&&i.fire(n,t)}}}(jQuery,DevExpress),function(n,t,i){var r=t.ui,f=t.utils,e="dx-scheduler-navigator",o="dx-scheduler-navigator-next",s="dx-scheduler-navigator-caption",h="dx-scheduler-navigator-previous",u=function(n,t){var r=f.getFirstWeekDate(n,t?this.option("firstDayOfWeek")||1:this.option("firstDayOfWeek")),i=new Date(r);return t=t||6,i=new Date(i.setDate(i.getDate()+t)),Globalize.format(r," d")+"-"+Globalize.format(i,"d MMMM yyyy")},c={day:{duration:1,setter:"setDate",getter:"getDate",getCaption:function(n){return Globalize.format(n,"d MMMM yyyy")}},week:{duration:7,setter:"setDate",getter:"getDate",getCaption:u},workWeek:{duration:7,setter:"setDate",getter:"getDate",getCaption:function(n){return u.call(this,n,4)}},month:{duration:1,setter:"setMonth",getter:"getMonth",getCaption:function(n){return Globalize.format(n,"MMMM yyyy")}}};t.registerComponent("dxSchedulerNavigator",r.dxScheduler,r.Widget.inherit({_setDefaultOptions:function(){this.callBase(),this.option({date:new Date,step:"day",firstDayOfWeek:i})},_optionChanged:function(n){switch(n.name){case"step":case"date":this._renderCaption();break;case"firstDayOfWeek":this._setCalendarOption(n.name,n.value);break;case"tabIndex":case"focusStateEnabled":this._next.option(n.name,n.value),this._caption.option(n.name,n.value),this._prev.option(n.name,n.value),this._setCalendarOption(n.name,n.value),this.callBase(n);break;default:this.callBase(n)}},_init:function(){this.callBase(),this.element().addClass(e),this._initButtons()},_initButtons:function(){var i=n("<div>").addClass(o),r,t;this._next=this._createComponent(i,"dxButton",{icon:"chevronnext",onClick:n.proxy(this._updateCurrentDate,this,1),focusStateEnabled:this.option("focusStateEnabled"),tabIndex:this.option("tabIndex"),_templates:{}}),r=n("<div>").addClass(s),this._caption=this._createComponent(r,"dxButton",{focusStateEnabled:this.option("focusStateEnabled"),tabIndex:this.option("tabIndex"),_templates:{}}),t=n("<div>").addClass(h),this._prev=this._createComponent(t,"dxButton",{icon:"chevronprev",onClick:n.proxy(this._updateCurrentDate,this,-1),focusStateEnabled:this.option("focusStateEnabled"),tabIndex:this.option("tabIndex"),_templates:{}}),this.setAria("label","Next period",i),this.setAria("label","Previous period",t),this.element().append(t,r,i)},_updateCurrentDate:function(n){var t=this._getConfig(),r=t.duration*n,i=new Date(this.option("date"));i[t.setter](i[t.getter]()+r),this.notifyObserver("updateCurrentDate",i)},_renderFocusTarget:n.noop,_render:function(){this.callBase(),this._renderPopover(),this._renderCaption(),this._renderCaptionKeys()},_renderPopover:function(){this._popover=this._createComponent("<div>","dxPopover",{target:this._caption.element(),onContentReady:n.proxy(this._popoverContentReadyHandler,this)}),this._popover.element().appendTo(this.element())},_popoverContentReadyHandler:function(){this._calendar=this._createComponent(n("<div>"),"dxCalendar",this._calendarOptions()),this._popover.content().append(this._calendar.element())},_calendarOptions:function(){return{firstDayOfWeek:this.option("firstDayOfWeek"),value:this.option("date"),focusStateEnabled:this.option("focusStateEnabled"),onValueChanged:n.proxy(function(n){this.notifyObserver("updateCurrentDate",n.value),this._popover.hide()},this),_keyboardProcessor:this._calendarKeyboardProcessor}},_renderCaption:function(){var t=this.option("date"),i=this._getConfig().getCaption.call(this,t);this._caption.option({text:i,onClick:n.proxy(function(){this._popover.toggle()},this)})},_renderCaptionKeys:function(){if(this.option("focusStateEnabled")&&!this.option("disabled")){this._calendarKeyboardProcessor=this._caption._keyboardProcessor.attachChildProcessor(),this._setCalendarOption("_keyboardProcessor",this._calendarKeyboardProcessor);var t=n.proxy(function(){if(this._popover.content().is(":hidden"))this._popover.show();else return!0},this);this._caption.registerKeyHandler("enter",t),this._caption.registerKeyHandler("space",t)}},_setCalendarOption:function(n,t){this._calendar&&this._calendar.option(n,t)},_getConfig:function(){var n=this.option("step"),i=c[n];if(!i)throw t.Error("E1033",n);return i}}).include(r.dxScheduler.PublisherMixin))}(jQuery,DevExpress),function(n,t,i){var r=t.ui,u="dx-scheduler-header",f="dx-scheduler-view-switcher";t.registerComponent("dxSchedulerHeader",r.dxScheduler,r.Widget.inherit({_setDefaultOptions:function(){this.callBase(),this.option({views:[],currentView:"day",firstDayOfWeek:i,currentDate:new Date})},_optionChanged:function(n){var t=n.value;switch(n.name){case"views":this._viewSwitcher.option("items",t);break;case"currentView":this._viewSwitcher.option("selectedItem",t),this._navigator.option("step",t);break;case"currentDate":this._navigator.option("date",t);break;case"firstDayOfWeek":this._navigator.option("firstDayOfWeek",t);break;case"tabIndex":case"focusStateEnabled":this._viewSwitcher.option(n.name,t),this._navigator.option(n.name,t),this.callBase(n);break;default:this.callBase(n)}},_init:function(){this.callBase(),this.element().addClass(u),this._navigator=this._createComponent("<div>","dxSchedulerNavigator",{date:this.option("currentDate"),step:this.option("currentView"),firstDayOfWeek:this.option("firstDayOfWeek"),tabIndex:this.option("tabIndex"),focusStateEnabled:this.option("focusStateEnabled"),observer:this.option("observer")}),this._navigator.element().appendTo(this.element());var i=n("<div>").addClass(f).appendTo(this.element());this._viewSwitcher=this._createComponent(i,"dxTabs",{selectionRequired:!0,scrollingEnabled:!1,onSelectionChanged:n.proxy(this._updateCurrentView,this),items:this.option("views"),itemTemplate:function(i){return n("<span>").addClass("dx-tab-text").text(Globalize.localize("dxScheduler-switcher"+t.inflector.camelize(i,!0)))},selectedItem:this.option("currentView"),tabIndex:this.option("tabIndex"),focusStateEnabled:this.option("focusStateEnabled")})},_updateCurrentView:function(n){var t=n.component.option("selectedItem");this.notifyObserver("currentViewUpdated",t)},_renderFocusTarget:n.noop}).include(r.dxScheduler.PublisherMixin))}(jQuery,DevExpress),function(n,t,i){var f=t.ui,u=t.utils,s=f.events,p="dx-scheduler-work-space",w="dx-scheduler-work-space-grouped",b="dx-scheduler-time-panel",k="dx-scheduler-time-panel-cell",d="dx-scheduler-time-panel-row",g="dx-scheduler-all-day-panel",nt="dx-scheduler-all-day-table",l="dx-scheduler-fixed-appointments",tt="dx-scheduler-all-day-title",e="dx-scheduler-all-day-table-cell",it="dx-scheduler-all-day-table-row",rt="dx-scheduler-header-panel",ut="dx-scheduler-header-panel-cell",ft="dx-scheduler-header-row",et="dx-scheduler-group-row",ot="dx-scheduler-group-header",st="dx-scheduler-date-table",r="dx-scheduler-date-table-cell",ht="dx-scheduler-date-table-row",ct="dx-scheduler-date-table-current-date",lt="dx-scheduler-date-table-other-month",o="dx-scheduler-date-table-droppable-cell",a=s.addNamespace("dxpointerdown","dxSchedulerWorkSpace"),v=s.addNamespace("dxdragenter","dxSchedulerDateTable"),y=s.addNamespace("dxdrop","dxSchedulerDateTable"),h="dx-state-focused",c="dxCellData";t.registerComponent("dxSchedulerWorkSpace",f.dxScheduler,f.Widget.inherit({_supportedKeys:function(){var t=this.option("rtlEnabled"),i=function(n){n.preventDefault(),n.stopPropagation(),this._$focusedCell&&this._$focusedCell.length&&this._showAddAppointmentPopup(this._$focusedCell)};return n.extend(this.callBase(),{enter:i,space:i,downArrow:function(n){n.preventDefault(),n.stopPropagation();var t=this._getFocusedCell().index(),i=this._getFocusedCell().parent(),r=i.next().children().eq(t);this._moveToCell(r)},upArrow:function(n){n.preventDefault(),n.stopPropagation();var t=this._getFocusedCell().index(),i=this._getFocusedCell().parent(),r=i.prev().children().eq(t);this._moveToCell(r)},rightArrow:function(n){n.preventDefault(),n.stopPropagation();var i=t?this._getFocusedCell().prev():this._getFocusedCell().next();this._moveToCell(i)},leftArrow:function(n){n.preventDefault(),n.stopPropagation();var i=t?this._getFocusedCell().next():this._getFocusedCell().prev();this._moveToCell(i)}})},_getFocusedCell:function(){return this._$focusedCell||this._$dateTable.find("."+r).eq(0)},_setFocusedCell:function(n){n.length&&(this._releaseFocusedCell(),n.addClass(h),u.isDefined(this._$focusedCell)&&this.setAria("label",i,this._$focusedCell),this._$focusedCell=n,this.setAria("label","Add appointment",this._$focusedCell))},_moveToCell:function(n){this._setFocusedCell(n),this._scrollable.scrollToElement(n)},_releaseFocusedCell:function(){u.isDefined(this._$focusedCell)&&this._$focusedCell.removeClass(h)},_focusTarget:function(){return this.element()},_focusInHandler:function(t){if(n(t.target).is(this._focusTarget())&&this._isCellClick!==!1){delete this._isCellClick,this.callBase.apply(this,arguments);var i=this._getFocusedCell();this._setFocusedCell(i)}},_focusOutHandler:function(){this.callBase.apply(this,arguments),this._releaseFocusedCell()},_activeStateUnit:"."+r+", ."+e,_setDefaultOptions:function(){this.callBase(),this.option({currentDate:new Date,firstDayOfWeek:i,startDayHour:0,endDayHour:24,hoursInterval:.5,activeStateEnabled:!0,hoverStateEnabled:!0,groups:[]})},_optionChanged:function(n){function i(){t._cleanView(),t._setFirstViewDate(),t._renderView()}var t=this;switch(n.name){case"firstDayOfWeek":case"currentDate":case"groups":this._toggleGroupedClass(),i();break;case"startDayHour":case"endDayHour":i();break;default:this.callBase(n)}},_init:function(){this.callBase(),this.element().addClass(p),this._$headerPanel=n("<table>").addClass(rt),this._$allDayTable=n("<table>").addClass(nt),this._$fixedContainer=n("<div>").addClass(l),this._$allDayPanel=n("<div>").append(n("<div>").addClass(tt).text(Globalize.localize("dxScheduler-allDay"))).append(this._$allDayTable).addClass(g),this._$timePanel=n("<table>").addClass(b),this._$dateTable=n("<table>").addClass(st),this._scrollable=this._createComponent("<div>","dxScrollable",{useKeyboard:!1}),this._scrollable.content().append(this._$timePanel,this._$dateTable),this.element().append(this._$headerPanel,this._$fixedContainer,this._$allDayPanel,this._scrollable.element()),this.element().addClass(this._getElementClass())},_getElementClass:n.noop,_getRowCount:n.noop,_getCellCount:n.noop,_render:function(){this.callBase(),this._setFirstViewDate(),this._renderView(),this._toggleGroupedClass(),this._attachEvents()},_setFirstViewDate:function(){this._firstViewDate=u.getFirstWeekDate(this.option("currentDate"),this._firstDayOfWeek()),this.option("startDayHour")&&this._firstViewDate.setHours(this.option("startDayHour"))},_firstDayOfWeek:function(){return this.option("firstDayOfWeek")},_renderView:function(){this._renderHeaderPanel(),this._renderAllDayPanel(),this._renderTimePanel(),this._renderDateTable()},_toggleGroupedClass:function(){this.element().toggleClass(w,this.option("groups").length>0)},_attachEvents:function(){var t=this._createAction(n.proxy(this._pointerDownHandler,this));this.element().off(a).on(a,function(n){if(f.events.isMouseEvent(n)&&n.which>1){n.preventDefault();return}t({jQueryEvent:n})})},_pointerDownHandler:function(t){var i=n(t.jQueryEvent.target);if(!i.hasClass(r)&&!i.hasClass(e)){this._isCellClick=!1;return}this._isCellClick=!0,i.hasClass(h)?this._showAddAppointmentPopup(i):this._setFocusedCell(i)},_showAddAppointmentPopup:function(t){var i=this.getCellData(t),r=n.extend(i,i.groups);delete r.groups,this.notifyObserver("showAddAppointmentPopup",r)},_renderHeaderPanel:function(){var t=n("<thead>");this._renderGroupHeader(t),this._renderDateHeader(t),this._$headerPanel.append(t)},_renderDateHeader:function(t){for(var f=n("<tr>").addClass(ft),o=this._getCellCount(),s=this._getGroupCount()||1,i,u,e,r=0;r<s;r++)for(i=0;i<o;i++)u=this._getHeaderText(i),e=n("<th>").text(u).addClass(ut).attr("title",u),f.append(e);t.append(f)},_renderGroupHeader:function(n){var i=this._getGroupCount(),t;i&&(t=this._makeGroupRows(this.option("groups")),this.element().attr("dx-group-row-count",t.length),n.append(t))},_makeGroupRows:function(t){for(var f=1,e=t.length,l=this._getCellCount()||1,r=[],h,c,u,o,s,i=0;i<e;i++)i>0&&(f=t[i-1].items.length*f),h=this._makeGroupRowCells(t[i].items,f),r.push(n("<tr>").addClass(et).append(h));for(c=r[e-1].find("th").length,u=0;u<e;u++)o=r[u].find("th"),s=c/o.length*l,s>1&&o.attr("colspan",s);return r},_makeGroupRowCells:function(t,i){for(var f=[],e=t.length,r,u=0;u<i;u++)for(r=0;r<e;r++)f.push(n("<th>").addClass(ot).text(t[r].text));return f},_renderAllDayPanel:function(){var t=this._getCellCount()*(this._getGroupCount()||1),n=this;this._renderTableBody({container:this._$allDayTable,rowCount:1,cellCount:t,cellClass:e,rowClass:it,dataGenerator:function(t,i,r){var s=n._getDateByCellIndexes(i,r),o,f,e;for(u.correctDateWithUnitBeginning(s,"day"),o={startDate:s,endDate:new Date(s.getTime()+864e5),allDay:!0},f=n._getCellGroups(r),f.length&&(o.groups={}),e=0;e<f.length;e++)o.groups[f[e].name]=f[e].id;t.data(c,o)}})},_renderTimePanel:function(){this._renderTableBody({container:this._$timePanel,rowCount:this._calculateDayDuration(),cellCount:1,cellClass:k,rowClass:d});var t=this.option("startDayHour");this._$timePanel.find("td").each(function(i){n(this).text(Globalize.format(new Date(+new Date(1970,0)+36e5*(t+i)),"t"))})},_calculateDayDuration:function(){return this.option("endDayHour")-this.option("startDayHour")},_renderDateTable:function(){var t=this._getCellCount()*(this._getGroupCount()||1),n=this;this._renderTableBody({container:this._$dateTable,rowCount:this._getRowCount(),cellCount:t,cellClass:r,rowClass:ht,dataGenerator:function(t,i,r){var e=n._getDateByCellIndexes(i,r),o={startDate:e,endDate:n._calculateEndDate(e),allDay:n._getTableAllDay()},u,f;for(t.toggleClass(ct,n._isCurrentDateCell(e)).toggleClass(lt,n._isOtherMonth(e)),u=n._getCellGroups(r),u.length&&(o.groups={}),f=0;f<u.length;f++)o.groups[u[f].name]=u[f].id;t.data(c,o)}}),this._attachTablesEvents()},_getTableAllDay:function(){return!1},_isCurrentDateCell:function(n){var t=new Date;return u.sameMonthAndYear(n,t)&&n.getDate()===t.getDate()},_isOtherMonth:function(n){return n.getMonth()!==this.option("currentDate").getMonth()},_calculateEndDate:function(n){return new Date(n.getTime()+this._getInterval())},_getGroupCount:function(){for(var t=this.option("groups"),i=0,n=0,r=t.length;n<r;n++)n?i*=t[n].items.length:i=t[n].items.length;return i},_getPathToLeaf:function(n){function t(n,i){for(var u,r=0;r<n.length;r++){if(n[r].leafIndex===i)return n[r];if(u=t(n[r].children,i),u)return u}}function i(n,t){return t=t||[],t.push(n.value),n.parent&&i(n.parent,t),t}var r=this._createGroupTree(this.option("groups")[0],0),u=t(r,n);return i(u).reverse()},_getCellGroups:function(n){var u=[],i,r,f,t;if(this._getGroupCount()){if(i=Math.floor(n/this._getCellCount()),r=this.option("groups"),i<0)return;for(f=this._getPathToLeaf(i),t=0;t<r.length;t++)u.push({name:r[t].name,id:f[t]})}return u},_attachTablesEvents:function(){this._attachTableEvents(this._getDateTable()),this._attachTableEvents(this._getAllDayTable())},_attachTableEvents:function(t){var i=this,r,u;t.off(v).off(y).on(v,"td",{itemSizeFunc:function(n){return r||(r=n.height()),u||(u=n.width()),{width:u,height:r}}},function(t){i._$currentTableTarget&&i._$currentTableTarget.removeClass(o),i._$currentTableTarget=n(t.target),i._$currentTableTarget.addClass(o)}).on(y,"td",function(t){n(t.target).removeClass(o),r=0,u=0})},_getDateTables:function(){return this._$dateTable.add(this._$allDayTable)},_getDateTable:function(){return this._$dateTable},_getAllDayTable:function(){return this._$allDayTable},_getInterval:function(){return this.option("hoursInterval")*36e5},_getHeaderText:function(n){return Globalize.format(this._getDateByIndex(n),this._getFormat()).toUpperCase()},_getDateByIndex:t.abstract,_getFormat:t.abstract,_getCellText:function(){return""},_calculateCellIndex:function(n,t){t=t%this._getCellCount();var i=this._getVirtualRowCount();return(this._getRowCount()+i)*t+n},_getVirtualRowCount:function(){return this.option("startDayHour")/this.option("hoursInterval")+this._getEndDayHours()/this.option("hoursInterval")},_getEndDayHours:function(){return 24-this.option("endDayHour")},_getEndDayMilliseconds:function(){return this._getEndDayHours()*36e5},_renderTableBody:function(t){for(var e=[],u,r,f,i=0;i<t.rowCount;i++){for(u=n("<tr>"),t.rowClass&&u.addClass(t.rowClass),r=0;r<t.cellCount;r++)f=n("<td>").text(this._getCellText(i,r)),t.cellClass&&f.addClass(t.cellClass),n.isFunction(t.dataGenerator)&&t.dataGenerator(f,i,r),u.append(f);e.push(u)}t.container.append(n("<tbody>").append(e))},_cleanView:function(){this._$headerPanel.empty(),this._$dateTable.empty(),this._$timePanel.empty(),this._$allDayTable.empty()},getWorkArea:function(){return this._scrollable.content()},getScrollable:function(){return this._scrollable},getScrollableScrollTop:function(){return this._scrollable.scrollTop()},getScrollableContainer:function(){return this._scrollable._container()},_getCellCoordinatesByIndex:function(n){var t=Math.floor(n/this._getRowCount()),i=n-this._getRowCount()*t;return{cellIndex:t,rowIndex:i}},_createGroupTree:function(n,t){function r(n,t,u,f){var o,e,s;for(u=u||[],o=0;o<n.items.length;o++)e={name:n.name,value:n.items[o].id,children:[],parent:f?f:null},u.push(e),s=t+1,this.option("groups")[s]&&r.call(this,this.option("groups")[s],s,e.children,e),e.children.length||(e.leafIndex=i,i++);return u}var i=0;return r.call(this,n,t)},_hasGroupItem:function(t,i,r){var u=t[i];return u&&n.inArray(r,u)>-1?!0:!1},_grep:function(n,t,i){i=i||[];for(var r=0;r<n.length;r++)this._hasGroupItem(t,n[r].name,n[r].value)&&(u.isDefined(n[r].leafIndex)&&i.push(n[r].leafIndex),n[r].children&&this._grep(n[r].children,t,i));return i},_getDateByCellIndexes:function(n,t){var i=this._getInterval()*this._calculateCellIndex(n,t);return new Date(this.getFirstViewDate().getTime()+i)},_getCellTimeOffset:function(n){var t=this._getInterval(),i=n%t;return i?i/t:0},_getIntervalBetween:function(n,t,i){var e=this.option("startDayHour"),u=t.getTime(),r,f;return i&&(u=u-e*36e5),r=n.getTime()-u,f=Math.floor(r/864e5),i||(r=r-f*e*36e5-f*this._getEndDayMilliseconds()),r},_getGroupIndexes:function(n){var t=[],i;return n&&this.option("groups").length&&(i=this._createGroupTree(this.option("groups")[0],0),t=this._grep(i,n)),t},_updateIndex:function(n){return n*this._getRowCount()},_getTimePanelWidth:function(){return this._$timePanel.outerWidth()},_getDroppableCell:function(){return this._getDateTables().find("."+o)},getCellData:function(t){return n.extend(!0,{},t.data(c))},getCoordinatesByDate:function(n,t,i){var s=this.option("rtlEnabled"),h=this._getCellCount()*this._getRowCount(),c=i?864e5:this._getInterval(),e=this._getIntervalBetween(n,this.getFirstViewDate(),i),r;if(t=t||0,r=Math.floor(e/c),i&&(r=this._updateIndex(r)),Math.ceil(r/this._getRowCount())*this.option("startDayHour")*2,r<0||r>=h)return{top:-1e3,left:-1e3};var o=this._getCellCoordinatesByIndex(r),u=this._$dateTable.find("tr").eq(o.rowIndex).find("td").eq(o.cellIndex+t*this._getCellCount()),f=u.position();return f.top+=u.height()*this._getCellTimeOffset(e),s&&(f.left+=u.outerWidth()),f},getCoordinatesByDateInGroup:function(n,t,i){var u=this._getGroupIndexes(t),f=[],r;if(u.length)for(r=0;r<u.length;r++)f.push(this.getCoordinatesByDate(n,u[r],i));else f.push(this.getCoordinatesByDate(n,0,i));return f},getDroppableCellIndex:function(){var n=this._getDroppableCell(),t=n.parent(),i=t.index();return i*t.find("td").length+n.index()},getDataByDroppableCell:function(){var n=this.getCellData(this._getDroppableCell());return{date:n.startDate,allDay:n.allDay,groups:n.groups}},getDateRange:function(){return[this.getFirstViewDate(),this.getLastViewDate()]},getCellWidth:function(){return this.element().find("."+r).first().outerWidth()},getCellHeight:function(){return this.element().find("."+r).first().outerHeight()},getAllDayHeight:function(){return this.element().find("."+e).first().outerHeight()},getMaxAllowedPosition:function(){var t=[],i=this.option("rtlEnabled");return this._$dateTable.find("tr").first().find("td:nth-child("+this._getCellCount()+"n)").each(function(r,u){var f=n(u).position().left;i||(f+=n(u).outerWidth()),t.push(f)}),t},getAllDayContainerClass:function(){return l},getCellIndexByCoordinates:function(n){var f=this.element().find("."+r).first(),t=this._getCellCount()*(this._getGroupCount()||1),u=this._getTimePanelWidth(),e=Math.floor((this.element().outerWidth()-u)/t),o=this.option("rtlEnabled")?0:u,s=Math.floor(n.top/f.outerHeight()),i=Math.floor((n.left+5-o)/e);return this.option("rtlEnabled")&&(i=t-i-1),t*s+i},getFirstViewDate:function(){return this._firstViewDate},getLastViewDate:function(){var n=this._getDateByCellIndexes(this._getRowCount()-1,this._getCellCount()-1);return new Date(n.getTime()+this._getInterval()-6e4)},getGroupBounds:function(n,t){var l=this.getCellIndexByCoordinates(n),i=this._getCellCount(),a=Math.floor(l/i),v=t?e:r,u=this.element().find("."+v),f=u.first().outerWidth(),s=a*i,h=u.eq(s).offset().left,c=u.eq(s+i-1).offset().left+f,o={left:h,right:c};return this.option("rtlEnabled")&&(o.left=c-f,o.right=h+f),o}}).include(f.dxScheduler.PublisherMixin))}(jQuery,DevExpress),function(n,t){var r=t.ui,u="dx-scheduler-work-space-day";t.registerComponent("dxSchedulerWorkSpaceDay",r.dxScheduler,r.dxScheduler.dxSchedulerWorkSpace.inherit({_getElementClass:function(){return u},_getRowCount:function(){var n=this._calculateDayDuration();return n/this.option("hoursInterval")},_getCellCount:function(){return 1},_setFirstViewDate:function(){this._firstViewDate=this.option("currentDate"),this.option("startDayHour")&&this._firstViewDate.setHours(this.option("startDayHour"))},_getDateByIndex:function(){return this._firstViewDate},_getFormat:function(){return"D"},_renderDateHeader:n.noop}))}(jQuery,DevExpress),function(n,t){var r=t.ui,u="dx-scheduler-work-space-week";t.registerComponent("dxSchedulerWorkSpaceWeek",r.dxScheduler,r.dxScheduler.dxSchedulerWorkSpace.inherit({_getElementClass:function(){return u},_getRowCount:function(){var n=this._calculateDayDuration();return n/this.option("hoursInterval")},_getCellCount:function(){return 7},_getDateByIndex:function(n){var t=new Date(this._firstViewDate);return t.setDate(this._firstViewDate.getDate()+n),t},_getFormat:function(){return"ddd d"}}))}(jQuery,DevExpress),function(n,t){var u=t.ui,f="dx-scheduler-work-space-work-week",r=0;t.registerComponent("dxSchedulerWorkSpaceWorkWeek",u.dxScheduler,u.dxScheduler.dxSchedulerWorkSpaceWeek.inherit({_getElementClass:function(){return f},_getCellCount:function(){return 5},_firstDayOfWeek:function(){return this.option("firstDayOfWeek")||1},_getDateByIndex:function(n){var t=new Date(this._firstViewDate),i;return t.setDate(this._firstViewDate.getDate()+n+r),i=t.getDay(),i%6==0&&(r=Math.floor(i/6+1),t.setDate(t.getDate()+r)),t},_renderHeaderPanel:function(){r=0,this.callBase()}}))}(jQuery,DevExpress),function(n,t){var r=t.ui,u=t.utils,e="dx-scheduler-work-space-month",f=7,o=864e5;t.registerComponent("dxSchedulerWorkSpaceMonth",r.dxScheduler,r.dxScheduler.dxSchedulerWorkSpace.inherit({_getElementClass:function(){return e},_getRowCount:function(){return 6},_getCellCount:function(){return f},_getDateByIndex:function(n){var t=new Date(this._firstViewDate);return t.setDate(this._firstViewDate.getDate()+n),t},_getFormat:function(){return"ddd"},_calculateCellIndex:function(n,t){return t=t%this._getCellCount(),n*this._getCellCount()+t},_getInterval:function(){return o},_calculateEndDate:function(n){var t=new Date(n);return new Date(t.setHours(this.option("endDayHour")))},_getIntervalBetween:function(n,t){return n.getTime()-(t.getTime()-this.option("startDayHour")*36e5)},_getCellCoordinatesByIndex:function(n){var t=Math.floor(n/this._getCellCount()),i=n-this._getCellCount()*t;return{rowIndex:t,cellIndex:i}},_renderTimePanel:n.noop,_renderAllDayPanel:n.noop,_getTableAllDay:n.noop,_getCellTimeOffset:function(){return 0},_setFirstViewDate:function(){var n=t.utils.getFirstMonthDate(this.option("currentDate"));this._firstViewDate=u.getFirstWeekDate(n,this.option("firstDayOfWeek")),this.option("startDayHour")&&this._firstViewDate.setHours(this.option("startDayHour"))},_getDate:function(n,t){var i=new Date(this._firstViewDate);return i.setDate(i.getDate()+n*f+t),i},_getCellText:function(n,t){t=t%this._getCellCount();var i=this._getDate(n,t);return Globalize.format(i,"dd")},_updateIndex:function(n){return n},_getTimePanelWidth:function(){return 0},getCoordinatesByDates:function(n,t){for(var r=[],i=new Date(n);i<=t;)r.push(this.getCoordinatesByDate(i)),i.setDate(i.getDate()+7),i=u.getFirstWeekDate(i,this.option("firstDayOfWeek"));return r}}))}(jQuery,DevExpress),function(n,t,i){var r=t.ui,u=t.Class.inherit({ctor:function(n){this.instance=n},resizableConfig:t.abstract,handleResize:t.abstract,renderAppointmentGeometry:function(n,i){var r=this.getAppointmentGeometry(i);this.instance.option("allowResize")||(i.skipResizing=!0),t.translator.move(n,{top:r.top,left:r.left}),n.css({width:r.width,height:r.height}),this._geometry=r},getAppointmentGeometry:function(){return{height:0,width:0,top:0,left:0}},createTaskPositionMap:function(n){var r=n.length,t,i,u,f;if(r){for(t=[],i=0;i<r;i++)t.push(this._getItemPosition(n[i]));return u=this._getSortedPositions(t),f=this._getResultPositions(u),this._getExtendedPositionMap(t,f)}},_getItemPosition:function(t){for(var s=this.calculateAppointmentHeight(t),u=this.calculateAppointmentWidth(t),r=this.instance._getAppointmentCoordinates(t),e=this.isAllDay(t),o=!1,f,i=0;i<r.length;i++)e&&(r[i].top=0),(this._needVerifyItemSize()||e)&&this.instance._maxAllowedPosition&&(f=this._getCurrentMaxAllowedPosition(i,t),this.isAppointmentGreaterThan(f,{left:r[i].left,width:u})&&(o=!0,u=this._isRtl()?Math.floor(r[i].left-f):f-Math.floor(r[i].left))),n.extend(r[i],{height:s,width:u,allDay:e,appointmentReduced:o});return r},_needVerifyItemSize:function(){return!1},_isRtl:function(){return this.instance.option("rtlEnabled")},_getCurrentMaxAllowedPosition:function(n,t){return this.instance.notifyObserver("getItemGroupIndexes",{item:t,callback:function(t){t.length&&(n=t[n])}}),Math.floor(this.instance._maxAllowedPosition[n])},calculateAppointmentHeight:function(){return 0},calculateAppointmentWidth:function(){return 0},isAppointmentGreaterThan:function(n,t){return this._isRtl()?t.left-t.width<n:t.left+t.width>n},isAllDay:function(){return!1},_getSortedPositions:function(t){for(var f=[],u,o,i,r=0,e=t.length;r<e;r++)for(u=0,o=t[r].length;u<o;u++)i=t[r][u],f.push({i:r,j:u,top:i.top,left:i.left,isStart:!0,allDay:i.allDay},{i:r,j:u,top:i.top+i.height,left:i.left+i.width,isStart:!1,allDay:i.allDay});return f.sort(n.proxy(this._sortCondition,this)),f},_sortCondition:t.abstract,_rowCondition:function(n,t){var i=n.left-t.left,r=n.top-t.top;return i?i:r?r:n.isStart-t.isStart},_columnCondition:function(n,t){var i=n.left-t.left,r=n.top-t.top;return r?r:i?i:n.isStart-t.isStart},_getResultPositions:function(n){for(var u=[],t=[],v=[],o=[],s=0,e,f,r,a,c,l,h=0;h<n.length;h++)if(f=n[h],f.isStart){for(e=i,r=0;r<t.length;r++)if(!t[r]){e=r,t[r]=!0;break}if(e===i)for(e=t.length,t.push(!0),r=0;r<u.length;r++)u[r].count++;u.push({index:e,count:t.length,i:f.i,j:f.j}),s<t.length&&(s=t.length)}else{if(a=this._findIndexByKey(u,"i","j",f.i,f.j),c=u[a],u.splice(a,1),t[c.index]=!1,o.push(c),!u.length){for(t=[],l=0;l<o.length;l++)o[l].count=s;o=[],s=0}v.push(c)}return v.sort(function(n,t){var r=n.j-t.j,i=n.i-t.i;return i?i:r})},_findIndexByKey:function(n,t,i,r,u){for(var e=0,f=0,o=n.length;f<o;f++)if(n[f][t]===r&&n[f][i]===u){e=f;break}return e},_getExtendedPositionMap:function(n,t){for(var u=0,r,e,i=0,f=n.length;i<f;i++)for(r=0,e=n[i].length;r<e;r++)n[i][r].index=t[u].index,n[i][r].count=t[u++].count;return n},_startDate:function(n){var i=this.instance._getStartDate(n);if(isNaN(i.getTime()))throw t.Error("E1032",n.text);return i},_endDate:function(n){var t=this.instance._getEndDate(n);return t||(t=new Date(this._startDate(n).getTime()+this.instance.option("appointmentDurationInMinutes")*6e4)),n.endDate=t,t}});r.dxScheduler.BaseAppointmentsStrategy=u}(jQuery,DevExpress),function(n,t){var e=t.ui,r=20,o=.6,u=3,f=15,s="dx-scheduler-appointment-empty",h=e.dxScheduler.BaseAppointmentsStrategy.inherit({resizableConfig:function(){return{minWidth:this.instance._defaultWidth,minHeight:0,step:this.instance._defaultWidth,handles:"right left"}},_needVerifyItemSize:function(){return!0},handleResize:function(t,i,u,f,e){var o=n(t.jQueryEvent.target).hasClass("dx-resizable-handle-left")&&!this._isRtl()||n(t.jQueryEvent.target).hasClass("dx-resizable-handle-right")&&this._isRtl(),s=this.instance._defaultWidth||r,c=e.width,h=864e5*(Math.round(t.width/s)-Math.round(c/s)||1),l=o?i.getTime()-h:i.getTime(),a=o?u.getTime():u.getTime()+h;return[l,a]},calculateAppointmentWidth:function(n){var t=this._startDate(n),i=this._endDate(n),u=this.instance._defaultWidth||r,f=(i.getTime()-t.getTime())/36e5;return Math.ceil(f/24)*u},renderAppointmentGeometry:function(n,t){this.callBase(n,t),t.index>1&&n.addClass(s)},getAppointmentGeometry:function(n){var h=this.instance._defaultHeight||r,t=n.index,i=o*h/2,e=n.width,c=(1-o)*h+n.top+t*i,s=n.left;return t>1&&(c=n.top+u,s=n.left+(t-2)*(f+u)+u,i=f,e=f,n.skipResizing=!0),this._isRtl()&&(s-=e),{height:i,width:e,top:c,left:s}},_sortCondition:function(n,t){return this._columnCondition(n,t)}});e.dxScheduler.HorizontalAppointmentsStrategy=h}(jQuery,DevExpress),function(n,t){var f=t.ui,e=45,o=10,r=20,u=15,s="dx-scheduler-appointment-empty",h=f.dxScheduler.BaseAppointmentsStrategy.inherit({resizableConfig:function(n){return this.isAllDay(n)?{minWidth:this.instance._defaultWidth,step:this.instance._defaultWidth,handles:"right left"}:{minHeight:this.instance._defaultHeight,step:this.instance._defaultHeight,handles:"top bottom"}},handleResize:function(t,i,u,f,e){var s,o,h,c;this.isAllDay(f)?(h=this.instance._defaultWidth||r,s=this._isRtl()?"dx-resizable-handle-right":"dx-resizable-handle-left",o=864e5*((t.width-e.width)/h)||1):(s="dx-resizable-handle-top",c=t.height-e.height,o=6e4*c/this.instance._defaultHeight*this.instance.option("appointmentDurationInMinutes"));var l=n(t.jQueryEvent.target).hasClass(s),a=l?i.getTime()-o:i.getTime(),v=l?u.getTime():u.getTime()+o;return[a,v]},renderAppointmentGeometry:function(n,t){this.callBase(n,t),this._geometry.width<e&&n.addClass(s)},getAppointmentGeometry:function(n){return n.allDay?this._getAllDayAppointmentGeometry(n):this._getSimpleAppointmentGeometry(n)},_getMinuteHeight:function(){return this.instance._defaultHeight/this.instance.option("appointmentDurationInMinutes")},_getAllDayAppointmentGeometry:function(n){var h=this.instance._allDayHeight||r,i=n.index,f=n.count,t=h/(f>3?3:f),e=n.width,o=n.top+i*t,s=n.left;return this.instance.option("allowResize")&&this.instance.option("allowAllDayResize")||(n.skipResizing=!0),f>3&&(i>1?(o=n.top,s=n.left+(i-2)*u,t=u,e=u,n.skipResizing=!0):o+=t),this._isRtl()&&(s-=e),{height:t,width:e,top:o,left:s}},_getSimpleAppointmentGeometry:function(n){var t=this.instance._defaultWidth-o||r,i=t/n.count,f=n.height,e=n.top,u=n.left+n.index*i;return this._isRtl()&&(u-=t),{height:f,width:i,top:e,left:u}},isAllDay:function(n){var i=this._startDate(n),r=this._endDate(n),t=!1;return this.instance.notifyObserver("appointmentTakesAllDay",{startDate:i,endDate:r,callback:function(n){t=n}}),n.allDay||t},calculateAppointmentWidth:function(n){if(!this.isAllDay(n))return 0;var t=this._startDate(n),i=this._endDate(n),u=this.instance._defaultWidth||r,f=(i.getTime()-t.getTime())/36e5;return Math.ceil(f/24)*u},calculateAppointmentHeight:function(n){if(this.isAllDay(n))return 0;var u=this._startDate(n),f=this._endDate(n),e=(f.getTime()-u.getTime())/6e4,i=r,t=Math.round(e*this._getMinuteHeight());return t<i&&(t=i),t},_sortCondition:function(n,t){var i=n.allDay-t.allDay;return i?i:this._rowCondition(n,t)}});f.dxScheduler.VerticalAppointmentsStrategy=h}(jQuery,DevExpress),function(n,t,i){var r=t.ui,u=t.translator,f=r.events,h="dx-scheduler-scrollable-appointments",c="dx-scheduler-appointment",l="dx-scheduler-all-day-appointment",a="dx-scheduler-appointment-recurrence",v="dx-scheduler-appointment-reduced",y="dx-appointment-reduced-icon",e=f.addNamespace("dxpointerenter","dxSchedulerAppointment"),o=f.addNamespace("dxpointerleave","dxSchedulerAppointment"),s=f.addNamespace("dxdblclick","dxSchedulerAppointment");t.registerComponent("dxSchedulerAppointments",r.dxScheduler,r.CollectionWidget.inherit({_supportedKeys:function(){var r=this,u=function(i){var u=r._getItemData(i.target);u.initialCoordinates&&t.translator.move(n(i.target),u.initialCoordinates),u.initialSize&&(n(i.target).outerWidth(u.initialSize.width),n(i.target).outerHeight(u.initialSize.height)),u._escPressed=!0};return n.extend(this.callBase(),{escape:n.proxy(u,this)})},_moveFocus:n.noop,_focusTarget:function(){return this._itemElements()},_focusInHandler:function(t){this.callBase.apply(this,arguments),this.option("focusedElement",n(t.target))},_keyboardEventBindingTarget:function(){return this._itemContainer()},_setDefaultOptions:function(){this.callBase(),this.option({noDataText:null,activeStateEnabled:!0,hoverStateEnabled:!0,tabIndex:0,appointmentDurationInMinutes:30,fixedContainer:null,renderingStrategy:"vertical",allowDrag:!0,allowResize:!0,allowAllDayResize:!0})},_optionChanged:function(n){switch(n.name){case"appointmentDurationInMinutes":break;case"renderingStrategy":this._initRenderingStrategy(),this.repaint();break;case"fixedContainer":break;case"allowDrag":case"allowResize":case"allowAllDayResize":this.repaint();break;default:this.callBase(n)}},_itemClass:function(){return c},_itemContainer:function(){var n=this.callBase(),t=n,i=this.option("fixedContainer");return i&&(t=n.add(i)),t},_cleanItemContainer:function(){this.callBase();var n=this.option("fixedContainer");n&&n.empty()},_init:function(){this.callBase(),this._initRenderingStrategy(),this.element().addClass(h),this._preventSingleAppointmentClick=!1},_initRenderingStrategy:function(){this._renderingStrategy=this.option("renderingStrategy")==="horizontal"?new r.dxScheduler.HorizontalAppointmentsStrategy(this):new r.dxScheduler.VerticalAppointmentsStrategy(this)},_executeItemRenderAction:function(n,t,i){var r=this._getItemRenderAction();r&&r({appointmentElement:i,appointmentIndex:n,appointment:t})},_createItemRenderAction:function(){return this.notifyObserver("initAppointmentRenderedAction",{callback:n.proxy(function(n){this._itemRenderAction=n},this)}),this._itemRenderAction},_getStartDate:function(n){var i=n.startDate;return t.utils.makeDate(i)},_getEndDate:function(n){var i=n.endDate;return i?t.utils.makeDate(i):i},_itemClickHandler:function(t){this._createAction(n.proxy(function(n){this._processItemClick(n.jQueryEvent)},this))({jQueryEvent:t}),this.callBase(t)},_processItemClick:function(t){var i=t.currentTarget,r=this._getItemData(i);this._normalizeAppointmentDates(r),this._appointmentClickTimeout=setTimeout(n.proxy(function(){this._preventSingleAppointmentClick||this.notifyObserver("showAppointmentTooltip",{data:r,target:i}),this._preventSingleAppointmentClick=!1},this),300)},_normalizeAppointmentDates:function(n){var i=t.utils.makeDate(n.startDate),r=t.utils.makeDate(n.endDate);n.startDate=i,n.endDate=r},_renderItems:function(t){this._isContainerInvisible()||(this.notifyObserver("getCellDimensions",{callback:n.proxy(function(n,t,i){this._defaultWidth=n,this._defaultHeight=t,this._allDayHeight=i},this)}),this.notifyObserver("getMaxAllowedPosition",{callback:n.proxy(function(n){n&&(this._maxAllowedPosition=n)},this)}),this._positionMap=this._renderingStrategy.createTaskPositionMap(t),this.callBase(t))},_renderItem:function(n,t){var i=this.option("fixedContainer"),r=this.itemsContainer().not(i);this._renderingStrategy.isAllDay(t)&&i&&(r=i),this.callBase(n,t,r)},_toggleAllDayClass:function(n,t){n.toggleClass(l,!!t)},_postprocessRenderItem:function(n){var t=n.itemElement,r=n.itemData,i=this._positionMap[n.itemIndex];this._toggleAllDayClass(t,r.allDay),this._attachAppointmentDblclick(t,r),this._paintAppointment(t,0),r.recurrenceRule&&t.addClass(a),this._applyResourceDataAttr(t),this._renderAppointmentClones(t,i),this._renderingStrategy.renderAppointmentGeometry(t,i[0]),this._renderDraggable(t),i[0].skipResizing||this._renderResizable(t,i[0]),i[0].appointmentReduced&&this._renderAppointmentReducedIcon(t)},_isContainerInvisible:function(){var n=!1;return this.notifyObserver("checkContainerVisibility",{callback:function(t){n=t}}),n},_attachAppointmentDblclick:function(t,i){var r=this._createAction(n.proxy(function(){clearTimeout(this._appointmentClickTimeout),this._preventSingleAppointmentClick=!0,this.notifyObserver("showEditAppointmentPopup",i)},this));t.off(s).on(s,n.proxy(function(n){r({jQueryEvent:n})},this))},_getAppointmentCoordinates:function(n){var i=this._getStartDate(n),t=[{top:0,left:0}];return this.notifyObserver("needCoordinates",{startDate:i,appointmentData:n,callback:function(n){t=n}}),t},_applyResourceDataAttr:function(t){this.notifyObserver("getResourcesFromItem",{itemData:this._getItemData(t),callback:function(i){i&&n.each(i,function(n,i){for(var u="data-"+n.toLowerCase()+"-",r=0;r<i.length;r++)t.attr(u+i[r],!0)})}})},_renderDraggable:function(n){if(this.option("allowDrag")){var f=this,t=f._getItemData(n),e=this._renderingStrategy.isAllDay(t),o=this.option("fixedContainer"),s=n.closest(".dx-scheduler"),r=s.dxScheduler("instance"),c=r?r.getWorkSpaceScrollableContainer():i,h=r?r.getWorkSpaceAllDayHeight():0;this._createComponent(n,"dxDraggable",{onDragStart:function(i){f.notifyObserver("hideAppointmentTooltip"),i.jQueryEvent.targetElements=s,!e&&o&&o.append(n),t.initialSize={width:i.width,height:i.height},t.initialCoordinates=u.locate(i.element)},onDrag:function(t){var i=r&&!e?r.getWorkSpaceScrollableScrollTop()-h:0,f=u.locate(t.element);u.move(n,{top:f.top-i})},onDragEnd:function(i){if(e||f.element().append(n),t._escPressed){delete t._escPressed,i.jQueryEvent.cancel=!0;return}f._dragEndHandler(i,t.initialCoordinates)},area:c,boundOffset:{left:0,top:-h,right:0,bottom:0}})}},_renderResizable:function(i,r){var u=this._getItemData(i),f=this._renderingStrategy.resizableConfig(u);n.extend(f,{area:this._calculateResizableArea(r,u),onResizeStart:n.proxy(function(n){u.initialSize={width:n.width,height:n.height},u.initialCoordinates=t.translator.locate(n.element)},this),onResizeEnd:n.proxy(function(n){if(u._escPressed){delete u._escPressed,n.jQueryEvent.cancel=!0;return}this._resizeEndHandler(n,u.initialSize,u.initialCoordinates)},this)}),this._createComponent(i,"dxResizable",f)},_calculateResizableArea:function(n,t){var i=this.element().closest(".dx-scrollable-content"),r=this._renderingStrategy.isAllDay(t);return this.notifyObserver("getResizableAppointmentArea",{coordinates:{left:n.left,top:0},allDay:r,callback:function(n){n&&(i=n)}}),i},_paintAppointment:function(n,t){this.notifyObserver("getAppointmentColor",{itemData:this._getItemData(n),resourceIndex:t,callback:function(t){t.done(function(t){t&&n.css("background-color",t)})}})},_renderAppointmentReducedIcon:function(t){t.toggleClass(v,!0);var i=n("<div>").addClass(y).appendTo(t),u=this._getEndDate(this._getItemData(t));i.off(e).on(e,function(){r.tooltip.show({target:i,content:Globalize.localize("dxScheduler-editorLabelEndDate")+": "+Globalize.format(u,"d MMMM yyyy")})}).off(o).on(o,function(){r.tooltip.hide()})},_renderAppointmentClones:function(n,i){var e=i.length,f,r,h;if(e>1){var o=[],c=this._getItemData(n),s=this._getResourceForPainting();for(f=e-1;f>0;f--)r=n.clone(!0),n.after(r),u.clearCache(r),this._renderingStrategy.renderAppointmentGeometry(r,i[f]),this._renderDraggable(r),i[f].skipResizing||this._renderResizable(r,i[f]),i[f].appointmentReduced&&this._renderAppointmentReducedIcon(r),o.push(r);s&&(h=t.utils.wrapToArray(c[s]),this._loop(h,e-1,function(n,t){this._paintAppointment(o[t],n)},1))}},_getResourceForPainting:function(){var n;return this.notifyObserver("getResourceForPainting",{callback:function(t){t&&(n=t.field)}}),n},_loop:function(n,t,i,r){var e,u,f;for(r=r||0,e=n.length,u=0;u<t;u++)f=r+u,f>=e&&(f=f%e),i.call(this,f,u)},_resizeEndHandler:function(t,i,r){var u=this._getItemData(t.element),s=this._getStartDate(u),h=this._getEndDate(u),e=this._renderingStrategy.handleResize(t,s,h,u,i),f={},o;f.startDate=new Date(e[0]),f.endDate=new Date(e[1]),o=n.extend({},u,f),this.notifyObserver("updateAppointmentAfterResize",{target:u,data:o,$appointment:t.element,initialSize:i,initialCoordinates:r})},_dragEndHandler:function(n,t){var i=this._getItemData(n.element);this._normalizeAppointmentDates(i),this.notifyObserver("updateAppointmentAfterDrag",{data:i,$appointment:n.element,initialCoordinates:t})}}).include(r.dxScheduler.PublisherMixin))}(jQuery,DevExpress),function(n,t){var i=n.utils;n.registerComponent("dxClientExporter",n,n.Component.inherit({NAME:"dxClientExporter",_getDocumentCreator:function(i,r){if(r.format==="EXCEL")return new n.dxClientExporter.ExcelCreator(i.getDataProvider(),t.extend({rtlEnabled:i.option("rtlEnabled")},r))},exportTo:function(t){var h=this,r,f=this.option("exportingAction"),e=this.option("exportedAction"),o,u,s=t.component;s&&(r={fileName:t.fileName,format:t.format,cancel:!1},i.isDefined(f)&&f(r),r.cancel||(u=h._getDocumentCreator(s,t),u.ready().done(function(){o=u.getData(i.isFunction(window.Blob)),i.isDefined(e)&&e(),n.dxClientExporter.fileSaver.saveAs(r.fileName,t.format,o,t.proxyUrl)})))}}))}(DevExpress,jQuery),function(n,t){var i=t.utils,p=t.Class,u=t.dxClientExporter,f='<?xml version="1.0" encoding="utf-8"?>',w='<sheetPr><outlinePr summaryBelow="0"/><\/sheetPr>',b="<sheetPr/>",k='<fonts count="2"><font><sz val="11"/><color theme="1"/><name val="Calibri"/><family val="2"/><scheme val="minor"/><\/font><font><b/><sz val="11"/><color theme="1"/><name val="Calibri"/><family val="2"/><scheme val="minor"/><\/font><\/fonts><fills count="1"><fill><patternFill patternType="none"/><\/fill><\/fills><borders count="1"><border><left style="thin"><color rgb="FFD3D3D3"/><\/left><right style="thin"><color rgb="FFD3D3D3"/><\/right><top style="thin"><color rgb="FFD3D3D3"/><\/top><bottom style="thin"><color rgb="FFD3D3D3"/><\/bottom><\/border><\/borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/><\/cellStyleXfs>',r="http://schemas.openxmlformats.org",s="rels",o="xl",h="workbook.xml",d="[Content_Types].xml",c="sharedStrings.xml",l="styles.xml",g="worksheets",a="sheet1.xml",nt=["quarter","quarterAndYear","millisecond"],tt="shortDate",v={thousands:"#,##0{0},&quot;K&quot;",millions:"#,##0{0},,&quot;M&quot;",billions:"#,##0{0},,,&quot;B&quot;",trillions:"#,##0{0},,,,&quot;T&quot;",percent:"0{0}%",decimal:"#{0}",fixedPoint:"#,##0{0}",exponential:"0{0}E+00",currency:" "},it=Date.UTC(1899,11,30),rt=60,e=4,ut=7,y=165;u.excelFormatConverter={_applyPrecision:function(n,t){var i,r;if(t>0){for(i=n!=="decimal"?".":"",r=0;r<t;r++)i+="0";return i}return""},_getCurrencyFormat:function(){var r=Globalize.cultures[Globalize.cultureSelector].numberFormat.currency,t,n,u,f;if(i.isArray(r.pattern)){f={n:"#,##0{0}","'":"\\'","\\(":"\\(","\\)":"\\)"," ":"\\ ",'"':"&quot;","\\$":r.symbol},n=r.pattern.slice();for(u in f)for(t=0;t<n.length;t++)n[t]=n[t].replace(new RegExp(u,"g"),f[u]);return n.length===2?n[1]+"_);"+n[0]:n[0]}},_convertDateFormat:function(r){t.DateTimeFormat[r.toLowerCase()]&&n.inArray(r,nt)===-1||(r=tt);var f=Globalize.cultures[Globalize.cultureSelector].calendar.patterns,u=t.DateTimeFormat[r.toLowerCase()];return i.isDefined(f[u])&&(u=f[u]),u.replace(/\//g,"\\/").replace(/ /g,"\\ ").replace(/,/g,"\\,").replace(/:/g,"\\:").replace(/tt/g,"AM/PM").replace(/N/g,"#\\,###")},_convertNumberFormat:function(n,t){var r,u=n==="currency"?this._getCurrencyFormat():v[n];return u&&(r=i.stringFormat(u,this._applyPrecision(n,t))),r},convertFormat:function(n,t,r){if(i.isDefined(n)){if(r==="date")return u.excelFormatConverter._convertDateFormat(n);if(v[n])return u.excelFormatConverter._convertNumberFormat(n,t)}}},u.ExcelCreator=p.inherit({_getXMLTag:function(n,t,r){var u=["<"],f;u.push(n);for(f in t)u.push(" "),u.push(f),u.push('="'),u.push(t[f]),u.push('"');return i.isDefined(r)?(u.push(">"),u.push(r),u.push("<\/"),u.push(n),u.push(">")):u.push(" />"),u.join("")},_getDataProviderRowIndex:function(n){return n-!!this._dataProvider.isHeadersVisible()},_getExcelRowIndex:function(n){return n+!!this._dataProvider.isHeadersVisible()},_getCellIndex:function(n,t){var i="",r=26,u;this._maxIndex[0]<Number(n)&&(this._maxIndex[0]=Number(n)),this._maxIndex[1]<Number(t)&&(this._maxIndex[1]=Number(t));do if(u=65+(t>=r?t%r:Math.ceil(t)),i=String.fromCharCode(u)+i,t>=r)t=Math.floor(t/r)-1;else break;while(1);return i+=n},_getDataType:function(n){var t={boolean:"b",date:"d",number:"n",string:"s"};return i.isDefined(t[n])?t[n]:"s"},_appendFormat:function(t,i,r){return t=u.excelFormatConverter.convertFormat(t,i,r),t?(n.inArray(t,this._styleFormat)===-1&&this._styleFormat.push(t),n.inArray(t,this._styleFormat)+1):void 0},_appendString:function(t){if(i.isDefined(t)&&(t=String(t),t.length))return n.inArray(t,this._stringArray)===-1&&(t.indexOf("&")>0&&(t=t.replace(new RegExp("&","g"),"&amp;")),t=t.replace("<","&lt;").replace(">","&gt;"),this._stringArray.push(t)),n.inArray(t,this._stringArray)},_getExcelDateValue:function(n){var t,r;if(i.isDefined(n))return t=Math.floor((Date.UTC(n.getFullYear(),n.getMonth(),n.getDate())-it)/864e5),t<rt&&t--,r=(n.getHours()*3600+n.getMinutes()*60+n.getSeconds())/86400,t+r},_prepareValue:function(n,i){var r=this._dataProvider.getCellValue(n,i),u=this._getDataType(this._dataProvider.getCellType(n,i)),f=this._styleArray[i+e].formatID,o=t.utils.isNumber(f)?this._styleFormat[f-1]:null;switch(u){case"s":r=this._appendString(r);break;case"d":r=this._getExcelDateValue(r,o),u="n"}return{value:r,type:u}},_getHeadersArray:function(){for(var t=this._dataProvider.getColumns(),i=[],r=this._rtlEnabled?t.length-1:0,u=this._rtlEnabled?-1:t.length,f=this._rtlEnabled?-1:1,n=r;n!==u;n+=f)i.push({style:0,type:"s",value:this._appendString(t[n].caption)});return i},_getDataArray:function(){for(var t,f,r,h=[],o,u,s=this._dataProvider.getColumns(),c=this._rtlEnabled?s.length-1:0,l=this._rtlEnabled?-1:s.length,n=0;n<this._dataProvider.getRowsCount();n++){for(f=[],t=c;t!==l;t+=this._rtlEnabled?-1:1)r=this._prepareValue(n,t),o=r.type,!this._dataProvider.isGroupRow(n)&&i.isDefined(this._styleArray[t+e].formatID)&&r.type!=="s"&&(o="n"),u=t+e,this._dataProvider.isGroupRow(n)&&(u=e-1),this._dataProvider.isTotalRow(n)&&(u=this._getBoldStyleID(s[t].alignment)),f.push({style:u,value:r.value,type:o});n&&!this._needSheetPr&&this._dataProvider.getGroupLevel(this._getDataProviderRowIndex(n))>0&&(this._needSheetPr=!0),h.push(f)}return h},_getBoldStyleID:function(n){for(var t=0;t<e-1;t++)if(this._styleArray[t].alignment===n)return t},_culculateWidth:function(n){return Math.min(255,Math.floor((n-5)/ut*100+.5)/100)},_prepareStyleData:function(){for(var t,r=Number(!!this._options.wrapTextEnabled),u=["center","left","right"],f=this._dataProvider.getColumns(),n=0;n<u.length;n++)this._styleArray.push({bold:!0,alignment:u[n],wrapText:r});for(this._styleArray.push({bold:!0,alignment:i.getDefaultAlignment(this._rtlEnabled),wrapText:0}),n=0;n<f.length;n++)t=f[n],this._styleArray.push({alignment:i.isDefined(t.alignment)?t.alignment:"left",formatID:this._appendFormat(t.format,t.precision,t.dataType),wrapText:r}),this._colsArray.push(this._culculateWidth(t.width))},_prepareCellData:function(){this._dataProvider.isHeadersVisible()&&this._cellsArray.push(this._getHeadersArray()),this._cellsArray=this._cellsArray.concat(this._getDataArray())},_createXMLRelationships:function(n){return this._getXMLTag("Relationships",{xmlns:r+"/package/2006/relationships"},n)},_createXMLRelationship:function(n,t,i){return this._getXMLTag("Relationship",{Id:"rId"+n,Type:r+"/officeDocument/2006/relationships/"+t,Target:i})},_getWorkbookContent:function(){var n='<bookViews><workbookView xWindow="0" yWindow="0" windowWidth="0" windowHeight="0"/><\/bookViews><sheets><sheet name="Sheet" sheetId="1" r:id="rId1" /><\/sheets><definedNames><definedName name="_xlnm.Print_Titles" localSheetId="0">Sheet!$1:$1<\/definedName><definedName name="_xlnm._FilterDatabase" hidden="0" localSheetId="0">Sheet!$A$1:$F$6332<\/definedName><\/definedNames>';return f+this._getXMLTag("workbook",{"xmlns:r":r+"/officeDocument/2006/relationships",xmlns:r+"/spreadsheetml/2006/main"},n)},_getContentTypesContent:function(){return f+'<Types xmlns="'+r+'/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Default Extension="xml" ContentType="application/xml" /><Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" /><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml" /><Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml" /><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" /><\/Types>'},_generateStylesXML:function(){var h=this._zip.folder(o),s,n,e=[],u,t="";for(u in this._styleFormat)this._styleFormat[u]=this._getXMLTag("numFmt",{numFmtId:Number(u)+y,formatCode:this._styleFormat[u]});t+=this._getXMLTag("numFmts",{count:this._styleFormat.length},this._styleFormat.join("")),t+=k;for(s in this._styleArray)n=this._styleArray[s],e.push(this._getXMLTag("xf",{xfId:0,applyAlignment:1,fontId:Number(!!n.bold),applyNumberFormat:i.isDefined(n.formatID)?1:0,numFmtId:i.isDefined(n.formatID)?Number(n.formatID)+y-1:0},this._getXMLTag("alignment",{horizontal:n.alignment,wrapText:n.wrapText})));t+=this._getXMLTag("cellXfs",{count:e.length},e.join("")),t+=this._getXMLTag("cellStyles",{count:1},this._getXMLTag("cellStyle",{name:"Normal",xfId:0,builtinId:0})),t=f+this._getXMLTag("styleSheet",{xmlns:r+"/spreadsheetml/2006/main"},t),h.file(l,t),this._styleArray=[]},_generateStringsXML:function(){var i=this._zip.folder(o),n,t=f;for(n in this._stringArray)this._stringArray[n]=this._getXMLTag("si",{},this._getXMLTag("t",{},this._stringArray[n]));t+=this._getXMLTag("sst",{xmlns:r+"/spreadsheetml/2006/main",count:this._stringArray.length,uniqueCount:this._stringArray.length},this._stringArray.join("")),i.file(c,t),this._stringArray=[]},_generateWorksheetXML:function(){var t,n,u,e,s,h=0,f=[],c="1:"+this._colsArray.length,r=[['<?xml version="1.0" encoding="UTF-8" standalone="yes"?><worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac">',this._needSheetPr?w:b,'<dimension ref="A1:',this._getCellIndex(this._maxIndex[0],this._maxIndex[1])+'"/><sheetViews><sheetView tabSelected="1" workbookViewId="0"><pane ySplit="1" topLeftCell="A2" activePane="bottomLeft" state="frozen"/><\/sheetView><\/sheetViews><sheetFormatPr defaultRowHeight="15" outlineLevelRow="',this._dataProvider.getRowsCount()>0?this._dataProvider.getGroupLevel(0):0,'" x14ac:dyDescent="0.25"/>'].join("")];for(t in this._colsArray)this._colsArray[t]=this._getXMLTag("col",{width:this._colsArray[t],min:Number(t)+1,max:Number(t)+1});r.push(this._getXMLTag("cols",[],this._colsArray.join(""))+"<sheetData>");for(n in this._cellsArray){e=[];for(t in this._cellsArray[n])n=Number(n),u=this._cellsArray[n][t],e.push(this._getXMLTag("c",{r:this._getCellIndex(n+1,t),s:u.style,t:u.type},i.isDefined(u.value)?this._getXMLTag("v",{},u.value):null));f.push(this._getXMLTag("row",{r:Number(n)+1,spans:c,outlineLevel:Number(n)?this._dataProvider.getGroupLevel(this._getDataProviderRowIndex(n)):0,"x14ac:dyDescent":"0.25"},e.join(""))),this._cellsArray[n]=null,h++>1e4&&(r.push(f.join("")),f=[],h=0)}r.push(f.join("")),f=[],s=this._getCellIndex(this._maxIndex[0],this._maxIndex[1]),r.push("<\/sheetData>"+(this._options.autoFilterEnabled?'<autoFilter ref="A1:'+s+'" />':"")+'<ignoredErrors><ignoredError sqref="A1:'+s+'" numberStoredAsText="1" /><\/ignoredErrors><\/worksheet>'),this._zip.folder(o).folder(g).file(a,r.join("")),this._colsArray=[],this._cellsArray=[],r=[]},_generateCommonXML:function(){var r=f+this._createXMLRelationships(this._createXMLRelationship(1,"officeDocument","xl/"+h)),n,t=this._zip.folder(o),i=f;this._zip.folder("_"+s).file("."+s,r),n=this._createXMLRelationship(1,"worksheet","worksheets/"+a)+this._createXMLRelationship(2,"styles",l)+this._createXMLRelationship(3,"sharedStrings",c),i+=this._createXMLRelationships(n),t.folder("_"+s).file(h+".rels",i),t.file(h,this._getWorkbookContent()),this._zip.file(d,this._getContentTypesContent())},_generateContent:function(){this._prepareStyleData(),this._prepareCellData(),this._generateWorkXML(),this._generateCommonXML()},_generateWorkXML:function(){this._generateStylesXML(),this._generateStringsXML(),this._generateWorksheetXML()},ctor:function(n,t){this._rtlEnabled=t&&!!t.rtlEnabled,this._options=t,this._maxIndex=[1,2],this._stringArray=[],this._styleArray=[],this._colsArray=[],this._cellsArray=[],this._styleFormat=[],this._needSheetPr=!1,this._dataProvider=n,this._zip=new JSZip},ready:function(){return this._dataProvider.ready()},getData:function(n){return this._generateContent(),this._zip.generate({type:n?"blob":"base64",compression:"DEFLATE",mimeType:u.MIME_TYPES.EXCEL})}})}(jQuery,DevExpress),function(n,t){var r=n.dxClientExporter,i=n.utils,u={EXCEL:"xlsx",CSS:"css"};r.MIME_TYPES={CSS:"text/css",EXCEL:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},r.fileSaver={_linkDownloader:function(n,i){var u=document.createElement("a"),f={download:n,href:i};return document.body.appendChild(u),t(u).css({display:"none"}).text("load").attr(f)[0].click(),u},_formDownloader:function(n,i,r,u){var o={method:"post",action:n,enctype:"multipart/form-data"},e=t("<form>").css({display:"none"}).attr(o);e.append('<input type="hidden" name="fileName" value="'+i+'" />'),e.append('<input type="hidden" name="contentType" value="'+r+'" />'),e.append('<input type="hidden" name="data" value="'+u+'" />'),e.appendTo("body"),e.submit(),e.submit()&&e.remove()},_saveByProxy:function(n,t,i,f,e){return t+="."+u[i],this._formDownloader(n,t,r.MIME_TYPES[i],f,e)},_saveBase64As:function(n,t,i,f){var e="data:"+r.MIME_TYPES[t]+";base64,"+i;return n+="."+u[t],this._linkDownloader(n,e,f)},_saveBlobAs:function(n,f,e,o){if(this._blobSaved=!1,n+="."+u[f],i.isDefined(navigator.msSaveOrOpenBlob))navigator.msSaveOrOpenBlob(e,n),this._blobSaved=!0;else{var s=window.URL||window.webkitURL||window.mozURL||window.msURL||window.oURL;if(o=i.isDefined(o)?o:function(){var n=t("#dxExportLink");s.revokeObjectURL(n.attr("href")),n.remove(),r.blobSaved=!0},i.isDefined(s))return this._linkDownloader(n,s.createObjectURL(e),o)}},saveAs:function(t,r,u,f){if(i.isFunction(window.Blob))this._saveBlobAs(t,r,u);else if(i.isDefined(f)&&!i.isDefined(navigator.userAgent.match(/iPad/i)))this._saveByProxy(f,t,r,u);else{if(i.isDefined(navigator.userAgent.match(/iPad/i))||n.log("E1034"),n.browser.msie&&parseInt(n.browser.version)<10)return;this._saveBase64As(t,r,u)}}}}(DevExpress,jQuery),DevExpress.MOD_WIDGETS_WEB=!0}