"use strict";(function(factory){if(typeof define==="function"&&define.amd){define(["jquery","jquery-ui","jquery-ui/ui/core","jquery-ui/ui/data","jquery-ui/ui/focusable","jquery-ui/ui/keycode","jquery-ui/ui/tabbable","jquery-ui/ui/version","jquery-ui/ui/widget","jquery-ui/ui/widgets/mouse","jquery-ui/ui/widgets/datepicker","jquery-ui/ui/widgets/draggable","jquery-ui/ui/widgets/droppable","jquery-ui/ui/widgets/mouse","jquery-ui/ui/widgets/resizable","./infragistics.core"],factory)}else{factory(jQuery)}})(function($){/*!@license
* Infragistics.Web.ClientUI Combo 21.2.12
*
* Copyright (c) 2011-2022 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on:
* jquery.js
* jquery.ui.core.js
* jquery.ui.widget.js
* infragistics.templating.js
* infragistics.util.js
* infragistics.util.jquery.js
* infragistics.dataSource.js
* infragistics.ui.widget.js
*
* Example to use:
*   <script type="text/javascript">
*   $(function () {
*       $("#combo").igCombo();
*   });
*   </script>
*   <input id="combo" />
*/
(function($){$.widget("ui.igCombo",$.ui.igWidget,{options:{width:null,height:null,dropDownWidth:null,dataSource:null,dataSourceType:null,dataSourceUrl:null,responseTotalRecCountKey:null,responseDataKey:null,responseDataType:null,responseContentType:null,requestType:"GET",valueKey:null,textKey:null,itemTemplate:null,headerTemplate:null,footerTemplate:null,inputName:null,animationShowDuration:100,animationHideDuration:100,dropDownAttachedToBody:true,filteringType:"local",filterExprUrlKey:null,filteringCondition:"contains",filteringLogic:"OR",noMatchFoundText:undefined,dropDownButtonTitle:undefined,clearButtonTitle:undefined,placeHolder:undefined,locale:{noMatchFoundText:undefined,dropDownButtonTitle:undefined,clearButtonTitle:undefined,placeHolder:undefined},loadOnDemandSettings:{enabled:false,pageSize:16},visibleItemsCount:15,mode:"editable",virtualization:false,multiSelection:{enabled:false,addWithKeyModifier:false,showCheckboxes:false,itemSeparator:", "},grouping:{key:null,dir:"asc"},validatorOptions:null,highlightMatchesMode:"multi",caseSensitive:false,autoSelectFirstMatch:true,autoComplete:false,allowCustomValue:false,closeDropDownOnBlur:true,delayInputChangeProcessing:250,tabIndex:null,dropDownOnFocus:false,closeDropDownOnSelect:true,selectItemBySpaceKey:false,initialSelectedItems:[{index:-1,value:null}],preventSubmitOnEnter:true,format:"auto",suppressKeyboard:false,enableClearButton:true,dropDownOrientation:"auto"},events:{rendered:"rendered",dataBinding:"dataBinding",dataBound:"dataBound",filtering:"filtering",filtered:"filtered",itemsRendering:"itemsRendering",itemsRendered:"itemsRendered",dropDownOpening:"dropDownOpening",dropDownOpened:"dropDownOpened",dropDownClosing:"dropDownClosing",dropDownClosed:"dropDownClosed",selectionChanging:"selectionChanging",selectionChanged:"selectionChanged"},css:{comboWrapper:"ui-igcombo-wrapper",combo:"ui-igcombo ui-widget ui-state-default ui-corner-all ui-unselectable",dropDownMode:"ui-igcombo-mode-dropdown",readOnlyMode:"ui-igcombo-mode-readonly",readOnlyListMode:"ui-igcombo-mode-readonlylist",textBox:"ui-igcombo-textbox ui-state-default ui-corner-all",field:"ui-igcombo-field ui-corner-all",fieldHolder:"ui-igcombo-fieldholder",fieldHolderLTR:"ui-igcombo-fieldholder-ltr ui-corner-left",fieldHolderRTL:"ui-igcombo-fieldholder-rtl ui-corner-right",dropDownListRTL:"ig-rtl",button:"ui-igcombo-button ui-state-default ui-unselectable",buttonIcon:"ui-igcombo-buttonicon ui-icon-triangle-1-s ui-icon",buttonLTR:"ui-igcombo-button-ltr ui-corner-right",buttonRTL:"ui-igcombo-button-rtl ui-corner-left",clear:"ui-igcombo-clear ui-unselectable",clearRTL:"ui-igcombo-clear-rtl ui-unselectable",clearHover:"ui-igcombo-clear-hover ui-state-hover",clearIcon:"ui-igcombo-clearicon ui-icon-circle-close ui-icon",dropDown:"ui-igcombo-dropdown ui-widget ui-widget-content ui-corner-all",list:"ui-igcombo-list",listOverflow:"ui-igcombo-list-overflow",listItemHolder:"ui-igcombo-listitemholder",listItem:"ui-igcombo-listitem ui-state-default ui-unselectable",header:"ui-igcombo-header",footer:"ui-igcombo-footer",group:"ui-igcombo-group",groupHeader:"ui-igcombo-group-header ui-state-default ui-unselectable",itemInFocus:"ui-igcombo-item-in-focus",listItemHighlighted:"ui-igcombo-highlight",noMatchFound:"ui-igcombo-nomatchfound",listItemTextWithCheckbox:"ui-igcombo-listitemtextwithcheckbox",checkbox:"ui-igcombo-checkbox ui-state-default ui-corner-all ui-igcheckbox-small",checkboxOff:"ui-icon ui-igcombo-checkbox-off ui-igcheckbox-small-off",checkboxOn:"ui-icon ui-icon-check ui-igcombo-checkbox-on ui-igcheckbox-small-on",hiddenField:"ui-igcombo-hidden-field",hover:"ui-state-hover",active:"ui-state-active",unselectable:"ui-unselectable",noBorder:"ui-igcombo-no-border",scrollHolder:"ui-igcombo-scrollholder ui-unselectable",scroll:"ui-igcombo-scroll ui-unselectable",recordsView:"ui-igcombo-records-view",recordsData:"ui-igcombo-records-data",recordsServer:"ui-igcombo-records-server",recordsServerTotal:"ui-igcombo-records-server-total",loading:"ui-igcombo-loading",hidden:"ui-helper-hidden",disabled:"ui-state-disabled",orientationTop:"ui-igcombo-orientation-top",orientationBottom:"ui-igcombo-orientation-bottom"},RECORDS_VIEW:"{0}",RECORDS_DATA:"{1}",RECORDS_SERVER:"{2}",RECORDS_SERVER_TOTAL:"{3}",_createWidget:function(options){var mode;this._options={$window:$(window),$comboWrapper:null,$combo:null,$input:null,$hiddenInput:null,$fieldCont:null,$clearCont:null,$clearIcon:null,$dropDownBtnCont:null,$dropDownBtnIcon:null,$dropDownCont:null,$dropDownListCont:null,$dropDownList:null,$header:undefined,$footer:undefined,$dropDownScrollCont:null,$dropDownScroll:null,$loading:null,$noMatchFound:null,$itemsToSelectOnShiftUpDown:$(),$itemsToSelectOnShiftClick:$(),selectedData:[],keyNavItemData:null,autoSelectedItemData:null,autoCompleteItemData:null,inputVal:"",highlightElement:"span",ltr:true,dropDownOpened:false,deltaItemsForLoadOnDemand:5,dataBinding:false,shiftKeyCode:16,validator:null,shiftDown:false,nameAttribute:"",internalSelChangeSubs:[],initialDataBinding:true,remoteFilteringTriggerEvt:null,preventInputBlur:false,mouseDownStartedFromListItem:false,cachedData:[],strDataSource:null,updateInputValuesOnRemoteFilter:false,hasFooterVariables:false,hadInputSelectionOnKeydown:false,expression:null,preventItemSeparatorOnFocus:false,preventDropDownOnFocus:false,keyUpTimeout:null,repositionInterval:null,disableScroll:false,cachedGroupLength:null,dropDownModeSearchBy:"",dropDownModeSearchByResetTimeout:null,dropDownModeSearchByResetDelay:1e3,originalOptions:options,checkboxItemTemplate:"<span class='{css.checkbox}'>"+"<span class='{css.checkboxOff}''></span></span>"+"<div class='{css.listItemTextWithCheckbox}'>{innerMarkup}</div>",scrollCallback:null,closingDropDownOnBlur:false,composition:null};if(options){mode=options.mode;if(options.multiSelection&&options.multiSelection.enabled&&options.closeDropDownOnSelect===undefined){options.closeDropDownOnSelect=false}if(mode==="readonly"||mode==="readonlylist"||mode==="dropdown"&&!(options.multiSelection&&options.multiSelection.enabled)&&options.enableClearButton===undefined){options.enableClearButton=false}}this._superApply(arguments)},_create:function(){this._handlers={windowResize:$.proxy(this._windowResize,this),documentMouseUp:$.proxy(this._documentMouseUp,this),inputFocus:$.proxy(this._inputFocus,this),inputBlur:$.proxy(this._inputBlur,this),inputClick:$.proxy(this._inputClick,this),inputKeyDown:$.proxy(this._inputKeyDown,this),inputPaste:$.proxy(this._inputPaste,this),inputKeyUp:$.proxy(this._inputKeyUp,this),inputKeyPress:$.proxy(this._inputKeyPress,this),inputMouseDown:$.proxy(this._inputMouseDown,this),inputCompositionUpdate:$.proxy(this._inputCompositionUpdate,this),inputCompositionEnd:$.proxy(this._inputCompositionEnd,this),inputInput:$.proxy(this._inputInputHandler,this)};this._analyzeOptions();this._analyzeInitialElem();this._render();this.validator();this._attachEvents();this.dataBind();this._initCompositionObject()},_analyzeOptions:function(){var key,firstDataItem,options=this.options,$combo=$(this.element),lod=options.loadOnDemandSettings;if(this.options.dataSource){if($.isArray(this.options.dataSource)){firstDataItem=this.options.dataSource[0]}else if(this.options.dataSource&&typeof this.options.dataSource._xmlToArray==="function"&&typeof this.options.dataSource._encodePkParams==="function"){firstDataItem=this.options.dataSource.data()[0]}}if(options.mode!=="editable"&&options.mode!=="dropdown"&&options.mode!=="readonly"&&options.mode!=="readonlylist"){options.mode="editable"}if(lod&&lod.enabled&&lod.pageSize&&options.loadOnDemandSettings.pageSize<5){lod.pageSize=5}else if(lod&&lod.enabled&&!lod.pageSize){lod.pageSize=this.options.visibleItemsCount+1}if(!options.textKey){if(options.valueKey){options.textKey=options.valueKey}else if(firstDataItem&&$.type(firstDataItem)==="object"){for(key in firstDataItem){if(firstDataItem.hasOwnProperty(key)){options.textKey=key;break}}}}if(!options.valueKey){options.valueKey=options.textKey}if(!options.textKey&&!options.valueKey){options.textKey="text";options.valueKey="value"}if(options.filteringType!=="local"&&options.filteringType!=="remote"&&options.filteringType!=="none"){options.filteringType="none"}if($combo.attr("name")&&this._options.originalOptions.inputName===undefined){options.inputName=$combo.attr("name")}if($combo.attr("multiple")==="multiple"&&(this._options.originalOptions.multiSelection===undefined||this._options.originalOptions.multiSelection.enabled===undefined)){this.options.multiSelection.enabled=true}if($combo.attr("dir")==="rtl"){this._options.ltr=false}if(this.options.grouping.key&&firstDataItem&&firstDataItem[this.options.grouping.key]===undefined){throw new Error(this._getLocaleValue("errorIncorrectGroupingKey"))}},_analyzeInitialElem:function(){var element=this.element,_options=this._options;if(element.is("div")||element.is("span")){_options.$comboWrapper=element}else if(element.is("input")){_options.$input=element;_options.nameAttribute=element.attr("name");element.removeAttr("name")}else if(element.is("select")){element.hide();_options.nameAttribute=element.attr("name");element.removeAttr("name")}},_setupInput:function(){var _options=this._options;_options.$input.attr({placeholder:this._getLocaleValue("placeHolder"),"data-localeid":"placeHolder","data-localeattr":"placeholder"});if(this.options.mode!=="editable"){_options.$input.attr({readonly:true,unselectable:"on"}).addClass(this.css.unselectable)}},_renderHeaderTemplate:function(css,options,parent){var $header,headerClass,$existingHeader;headerClass="."+css.header;$existingHeader=parent.find(headerClass);if($existingHeader.length){if(typeof options.headerTemplate==="string"){$existingHeader.remove()}}$header=$("<div>").addClass(css.header).html(options.headerTemplate);$header.prependTo(parent);this._options.$header=$header},_renderFooterTemplate:function(css,options,parent,combo){var $footer,footerMarkup,footerClass,$existingFooter;footerClass="."+css.footer;$existingFooter=parent.find(footerClass);if($existingFooter.length){if(typeof options.footerTemplate==="string"){$existingFooter.remove()}}footerMarkup=options.footerTemplate.replace(combo.RECORDS_VIEW,"<span class="+css.recordsView+"></span>").replace(combo.RECORDS_DATA,"<span class="+css.recordsData+"></span>").replace(combo.RECORDS_SERVER,"<span class="+css.recordsServer+"></span>").replace(combo.RECORDS_SERVER_TOTAL,"<span class="+css.recordsServerTotal+"></span>");combo._options.hasFooterVariables=footerMarkup!==options.footerTemplate;if(combo._options.hasFooterVariables){$footer=$("<div>").addClass(css.footer).html(footerMarkup);$footer.appendTo(parent);combo._options.$footer=$footer;return}$footer=$("<div>").addClass(css.footer).html(footerMarkup);$footer.appendTo(parent);this._options.$footer=$footer},_render:function(){var css=this.css,options=this.options,_options=this._options,$comboWrapper=(_options.$comboWrapper||$("<div>")).addClass(css.comboWrapper),$combo=$("<div>").addClass(css.combo).attr("unselectable","on"),$input=(_options.$input||$("<input type='text'>")).addClass(css.field).attr({tabIndex:options.tabIndex,autocomplete:"off"}),$hiddenInput=$("<input type='hidden'>").addClass(css.hiddenField),$fieldCont=$("<div>").addClass(css.fieldHolder),$clearCont=$("<div>").addClass(css.clear).attr({unselectable:"on",title:this._getLocaleValue("clearButtonTitle"),"data-localeid":"clearButtonTitle","data-localeattr":"title"}),$clearIcon=$("<div>").addClass(css.clearIcon),$dropDownBtnCont=$("<div>").addClass(css.button).attr({unselectable:"on",title:this._getLocaleValue("dropDownButtonTitle"),"data-localeid":"dropDownButtonTitle","data-localeattr":"title"}),$dropDownBtnIcon=$("<div>").addClass(css.buttonIcon),$dropDownCont=$("<div>").addClass(css.dropDown).width(options.dropDownWidth),$dropDownListCont=$("<div>").addClass(css.list),$dropDownList=$("<ul>").addClass(css.listItemHolder),$dropDownScrollCont=$("<div>").addClass(css.scrollHolder).attr("unselectable","on"),$dropDownScroll=$("<div>").addClass(css.scroll).attr("unselectable","on"),$loading=$("<div>").addClass(css.loading);switch(options.mode){case"dropdown":$combo.addClass(css.dropDownMode);break;case"readonlylist":$combo.addClass(css.readOnlyListMode);break;case"readonly":$combo.addClass(css.readOnlyMode);$comboWrapper.addClass(css.disabled);break}$fieldCont.addClass(css.fieldHolderLTR);if(!_options.ltr){$dropDownList.addClass(css.dropDownListRTL);$dropDownBtnCont.addClass(css.buttonRTL);$clearCont.addClass(css.clearRTL)}else{$dropDownBtnCont.addClass(css.buttonLTR)}if(options.grouping.key){$dropDownList.addClass(css.group)}$clearIcon.appendTo($clearCont);$dropDownBtnIcon.appendTo($dropDownBtnCont);$dropDownList.appendTo($dropDownListCont);$dropDownListCont.appendTo($dropDownCont);if(typeof options.headerTemplate==="string"){this._renderHeaderTemplate(css,options,$dropDownCont)}if(typeof options.footerTemplate==="string"){this._renderFooterTemplate(this.css,this.options,$dropDownCont,this)}if(options.virtualization){$dropDownListCont.addClass(css.listOverflow);$dropDownScrollCont.insertBefore($dropDownList);$dropDownScroll.appendTo($dropDownScrollCont)}if(this.element.is("input")){$input.wrap($fieldCont);$fieldCont=$input.parent();$fieldCont.wrap($combo);$combo=$fieldCont.parent();$combo.wrap($comboWrapper);$comboWrapper=$combo.parent();$clearCont.prependTo($combo);$dropDownBtnCont.prependTo($combo)}else{$input.appendTo($fieldCont);$dropDownBtnCont.appendTo($combo);$clearCont.appendTo($combo);$fieldCont.appendTo($combo);$combo.appendTo($comboWrapper)}$clearCont.hide();$hiddenInput.attr("name",options.inputName).appendTo($combo);$dropDownCont.css({height:0,top:-99999,left:-99999,overflow:"hidden"}).addClass(css.noBorder);if(options.dropDownAttachedToBody){$dropDownCont.appendTo($("body"))}else{$dropDownCont.appendTo($comboWrapper)}if(this.element.is("select")){$comboWrapper.insertBefore(this.element)}$comboWrapper.outerWidth(options.width);$comboWrapper.outerHeight(options.height);_options.$comboWrapper=$comboWrapper;_options.$combo=$combo;_options.$input=$input;_options.$hiddenInput=$hiddenInput;_options.$fieldCont=$fieldCont;_options.$clearCont=$clearCont;_options.$clearIcon=$clearIcon;_options.$dropDownBtnCont=$dropDownBtnCont;_options.$dropDownBtnIcon=$dropDownBtnIcon;_options.$dropDownCont=$dropDownCont;_options.$dropDownListCont=$dropDownListCont;_options.$dropDownList=$dropDownList;_options.$loading=$loading;this._setInputVal($input.val());if(options.virtualization){_options.$dropDownScrollCont=$dropDownScrollCont;_options.$dropDownScroll=$dropDownScroll}this._setupInput();if(options.disabled){this._disableCombo(true)}this._triggerRendered()},_itemInnerMarkup:function(data){var unwrappedData,dataItem,unwrappedDataItem;unwrappedData=this._unwrapData(data);dataItem=unwrappedData[this.options.textKey];unwrappedDataItem=this._unwrapData(dataItem);unwrappedDataItem=this._formatItem(unwrappedDataItem);unwrappedDataItem=$.ig.encode(unwrappedDataItem);return this.options.itemTemplate?$.ig.tmpl(this.options.itemTemplate,data):unwrappedDataItem},_formatItem:function(item){if($.ig&&$.ig.formatter){if(this.options.format==="auto"&&($.type(item)==="date"||$.type(item)==="number")){item=$.ig.formatter({val:item,reg:$.ig.regional[this.options.regional]})}else if(this._formatEnabled()){item=$.ig.formatter({val:item,format:this.options.format,reg:$.ig.regional[this.options.regional]})}}return item},_formatEnabled:function(){return!(this.options.format===""||this.options.format===null||this.options.format==="none")},_itemsToRenderCount:function(){return this._isPossibleToVirtualize()?this.options.visibleItemsCount:this.options.dataSource.dataView().length},_sortDataSource:function(){var options=this.options;options.dataSource.sort([{fieldName:options.grouping.key}],options.grouping.dir)},_groups:function(data){var prevGroup,curGroup,curData,len,i,options=this.options,groupKey=options.grouping.key,groups=[];data=data||options.dataSource.dataView();for(i=0,len=data.length;i<len;i++){curData=data[i];if(curData[groupKey]===undefined){throw new Error(this._getLocaleValue("errorIncorrectGroupingKey"))}curGroup=curData[groupKey];if(prevGroup===curGroup){groups[groups.length-1].members.push(curData)}else{prevGroup=curGroup;groups[groups.length]={name:curGroup,members:[curData]}}}return groups},_itemMarkup:function(data){var css=this.css,value=this._unwrapData(this._unwrapData(data)[this.options.valueKey]),innerMarkup=this._itemInnerMarkup(data),markup,escapedValue;escapedValue=$.ig.encode(value);markup='<li class="'+css.listItem+'" data-value="'+escapedValue+'" unselectable="on">';if(this._checkBoxesEnabled()){markup+=this._options.checkboxItemTemplate.replace("{css.checkbox}",css.checkbox).replace("{css.checkboxOff}",css.checkboxOff).replace("{css.listItemTextWithCheckbox}",css.listItemTextWithCheckbox).replace("{innerMarkup}",innerMarkup)}else{markup+=innerMarkup}markup+="</li>";return markup},_itemsMarkup:function(){var i,dataView=this.options.dataSource.dataView(),dataLen=this._itemsToRenderCount(),markup="";for(i=0;i<dataLen;i++){markup+=this._itemMarkup(dataView[i])}return markup},_groupHeaderMarkup:function(groupName){return'<li class="'+this.css.groupHeader+'">'+groupName+"</li>"},_groupMarkup:function(group){var len,i,members=group.members,itemsMarkup="";for(i=0,len=members.length;i<len;i++){itemsMarkup+=this._itemMarkup(members[i])}return this._groupHeaderMarkup(group.name)+itemsMarkup},_groupsMarkup:function(){var groups,groupsLen,i,dataView,dataLen=this._itemsToRenderCount(),headers=1,markup="";this._sortDataSource();dataView=this.options.dataSource.dataView();if(this.options.virtualization&&!this._options.cachedGroupLength){this._options.cachedGroupLength=this._groups(dataView).length}dataView=dataView.slice(0,dataLen);groups=this._groups(dataView);if(this._isPossibleToVirtualize()){for(i=0;i<dataLen;i++){if(this._isBoundaryOfGroups(dataView,i)){headers++;i++}}dataView=dataView.slice(0,dataLen-headers);groups=this._groups(dataView)}for(i=0,groupsLen=groups.length;i<groupsLen;i++){markup+=this._groupMarkup(groups[i])}return markup},_noMatchMarkup:function(){return'<li unselectable="on" class="'+this.css.noMatchFound+" "+this.css.unselectable+'" data-localeid="noMatchFoundText">'+this._getLocaleValue("noMatchFoundText")+"</li>"},_renderItems:function(success,msg,data){var markup,dropDownScrollHeight,schema,noCancel,options=this.options,_options=this._options,lod=this.options.loadOnDemandSettings,dataView=data.dataView(),dataLen=this._itemsToRenderCount();if(success!==null){this._triggerDataBound(success,msg)}this._convertToArrayOfObjects(options);if(!options.dataSource.settings.schema&&options.dataSource&&dataView.length>0){schema=this._initSchema(this._unwrapData(dataView)[0]);options.dataSource.settings.schema=schema;options.dataSource._initSchema()}noCancel=this._triggerItemsRendering();if(noCancel){if(dataLen>0){if(options.grouping.key){markup=this._groupsMarkup()}else{markup=this._itemsMarkup()}}else{markup=this._noMatchMarkup()}_options.$dropDownList.html(markup);if(dataLen>0){this._setListContMaxHeight()}if(options.virtualization){dropDownScrollHeight=data.totalLocalRecordsCount()*this._itemHeight();_options.$dropDownScroll.height(dropDownScrollHeight);_options.$dropDownScrollCont.width($.ig.util.getScrollWidth()+1);this._updateVirtualScrollVisibility();if(lod&&lod.enabled&&lod.pageSize<=options.visibleItemsCount){_options.$dropDownScroll.height(dropDownScrollHeight+this._itemHeight());_options.$dropDownScrollCont.removeClass(this.css.hidden)}}this._updateFooterVariables();if(_options.initialDataBinding){this._handleInitialSelection();_options.initialDataBinding=false}this._triggerItemsRendered()}},_handleRemoteFiltering:function(success,msg,data){var $items,selectedData,_options=this._options,event=_options.remoteFilteringTriggerEvt;this._renderItems(success,msg,data);this.positionDropDown();$items=this._$items();selectedData=_options.selectedData;_options.selectedData=[];this._selectData(selectedData,{focusCombo:true,keepFiltering:true,keepInputText:true,keepNavItem:true});this._updateSelection(event);this._updateAutoComplete();if(_options.keyNavItemData&&!this._isDataSelected(_options.keyNavItemData)){this._setKeyNavigationItem({data:_options.keyNavItemData,addStyles:true,resetDataOnNonFound:true})}if(_options.updateInputValuesOnRemoteFilter){this._updateInputValues();this._updateHighlighting();_options.updateInputValuesOnRemoteFilter=false}if(_options.inputVal){this._showClearButton()}else{this._hideClearButton()}this._updateFooterVariables();if(_options.validator){_options.validator._validateInternal(this.element,event)}if(event){this._triggerFiltered(event);_options.remoteFilteringTriggerEvt=null}},_handleLocalFilteringWithVirt:function(data){var $items,selectedData,_options=this._options;this._renderItems(null,null,data);this.positionDropDown();$items=this._$items();selectedData=_options.selectedData;_options.selectedData=[];this._selectData(selectedData,{focusCombo:true,keepFiltering:true,keepInputText:true});this._updateHighlighting()},_handleLoadOnDemand:function(err,success,data){var $items,selectedData,_options=this._options;this._renderItems(err,success,data);this.positionDropDown();$items=this._$items();selectedData=_options.selectedData;_options.selectedData=[];this._selectData(selectedData,{focusCombo:true,keepFiltering:true,keepInputText:true,keepScrollPosition:true});this._updateHighlighting();if(this.options.multiSelection.enabled&&_options.keyNavItemData&&!this._isDataSelected(_options.keyNavItemData)){this._setKeyNavigationItem({data:_options.keyNavItemData,addStyles:true})}if(this.options.filteringType!=="remote"&&_options.expression){this._updateFiltering()}this._updateFooterVariables()},_updateGroupHeader:function($item,data){if(this.options.grouping.key&&this._isItem($item)){this._setVisualStylesToGroupHeader($item)}this._updateMarkupForGroupHeader($item,data);$item.attr("data-value",null);return this},_updateItem:function($item,data){var unwrappedDataItem,unwrappedDataValue,innerMarkup=this._itemInnerMarkup(data);if(this.options.grouping.key&&this._isGroupHeader($item)){this._setVisualStylesToItem($item);if(this._checkBoxesEnabled()){$item.html(this._options.checkboxItemTemplate.replace("{css.checkbox}",this.css.checkbox).replace("{css.checkboxOff}",this.css.checkboxOff).replace("{css.listItemTextWithCheckbox}",this.css.listItemTextWithCheckbox).replace("{innerMarkup}",""))}}this._updateMarkupForItem($item,innerMarkup);unwrappedDataItem=this._unwrapData(data);unwrappedDataValue=this._unwrapData(unwrappedDataItem[this.options.valueKey]);$item.attr("data-value",unwrappedDataValue);return this},_removePlaceholderOnEmptyTextVal:function(){var _options=this._options,placeholderAttr=_options.$input.attr("placeholder");if(_options.inputVal===""&&_options.selectedData.length>0&&(typeof placeholderAttr!==typeof undefined||placeholderAttr!==false)){_options.$input.removeAttr("placeholder")}},_addPlaceholderWhenEmptyTextVal:function(){var _options=this._options,placeholderAttr=_options.$input.attr("placeholder");if(_options.inputVal===""&&_options.selectedData.length===0&&(typeof placeholderAttr===typeof undefined||placeholderAttr===false)){_options.$input.attr({placeholder:this.options.placeHolder,"data-localeid":"placeHolder","data-localeattr":"placeholder"})}},_convertToArrayOfObjects:function(options){var curData,len,i,ds;if($.type(options.dataSource)==="object"&&(options.dataSource._data!==null&&options.dataSource._data!==undefined)){ds=options.dataSource._data}else{ds=options.dataSource}if($.type(ds)==="array"&&($.type(ds[0])==="number"||$.type(ds[0])==="string"||$.type(ds[0])==="date")){for(i=0,len=ds.length;i<len;i++){curData=ds[i];ds[i]={};ds[i][options.textKey]=curData;ds[i][options.valueKey]=curData}}},_isGroupHeader:function($item){return $item.hasClass(this.css.groupHeader)},_isItem:function($item){return $item.hasClass(this.css.listItem)},_setVisualStylesToGroupHeader:function($item){$item.removeClass(this.css.listItem);$item.addClass(this.css.groupHeader)},_setVisualStylesToItem:function($item){$item.removeClass(this.css.groupHeader);$item.addClass(this.css.listItem)},_updateMarkupForGroupHeader:function($item,data){if(this.options.grouping.key&&data[this.options.grouping.key]!==undefined){$item.html(data[this.options.grouping.key])}},_updateMarkupForItem:function($item,innerMarkup){var $listItem=$item;if(this._checkBoxesEnabled()){$listItem=$item.find("."+this.css.listItemTextWithCheckbox)}var templateItems=jQuery.parseHTML(innerMarkup);if(templateItems[0].nodeName!=="#text"){this._setItemHTML(templateItems,$listItem)}else{$listItem.html(innerMarkup)}},_setItemHTML:function(templateItems,$listItem){for(var i=0;i<templateItems.length;i++){var item=templateItems[i];if(item.childElementCount>0){this._setItemHTML(item.children,$listItem.children())}else{$listItem[0].children[i].defaultValue=item.defaultValue;$listItem[0].children[i].innerHTML=item.innerHTML}}},_$items:function(includeGroupHeaders){var selector="."+this.css.listItem.split(" ",1)[0];if(this.options.grouping.key&&includeGroupHeaders){selector+=",."+this.css.groupHeader.split(" ",1)[0]}return this._options.$dropDownList.children(selector)},_$noMatchFoundItem:function(){var selector="."+this.css.noMatchFound;return this._options.$dropDownList.children(selector)},_$filteredItems:function(){return this._$items().not("."+this.css.hidden)},_$elementFromData:function(data,$items){var curData,i,len,valueKey=this.options.valueKey,values=[];$items=$items||this._$items();if($.type(data)!=="array"){data=[data]}for(i=0,len=data.length;i<len;i++){curData=data[i];if(curData!==null&&curData!==undefined){values.push(curData[valueKey])}}return this._$elementFromValue(values,$items)},_$elementFromValue:function(value,$items){var i,currentValue,result=$();$items=$items||this._$items();if($.type(value)!=="array"){value=[value]}for(i=0;i<value.length;i++){currentValue=value[i];if(value[i]){currentValue=$.ig.util.escapeStr(value[i].toString())}result=result.add($items.filter("[ data-value='"+currentValue+"' ]"))}return result},_$elementsFromItems:function(items){var i,result=$();if($.type(items)!=="array"){items=[items]}for(i=0;i<items.length;i++){result=result.add(items[i].element)}return result},_$selectedItems:function(){var i,selItems=this.selectedItems(),$selItems=$(),len=selItems.length;for(i=0;i<len;i++){$selItems=$selItems.add(selItems[i].element)}return $selItems},_isDataEqual:function(data1,data2){var data1Value,data2Value;if(data1!==null&&data1!==undefined&&data2!==null&&data2!==undefined){data1Value=this._unwrapData(this._unwrapData(data1)[this.options.valueKey]);data2Value=this._unwrapData(this._unwrapData(data2)[this.options.valueKey]);return data1Value===data2Value}return false},_isDataSelected:function(data){return this.isValueSelected(data[this.options.valueKey])},_filterData:function(data1,data2){var data2Len,self=this;if($.type(data1)!=="array"){data1=[data1]}if($.type(data2)!=="array"){data2=[data2]}data2Len=data2.length;return data1.filter(function(data){var i;for(i=0;i<data2Len;i++){if(self._isDataEqual(data,data2[i])){return false}}return true})},_filterItems:function(items1,items2){var result,valKey=this.options.valueKey,self=this;result=items1.filter(function(item){var i,unwrappedDataItem,unwrappedDataValue,unwrappedDataItemToCompare,unwrappedDataValueToCompare,matchFound=false;unwrappedDataItem=self._unwrapData(item.data);unwrappedDataValue=self._unwrapData(unwrappedDataItem[valKey]);for(i=0;i<items2.length&&!matchFound;i++){unwrappedDataItemToCompare=self._unwrapData(items2[i].data);unwrappedDataValueToCompare=self._unwrapData(unwrappedDataItemToCompare[valKey]);if(unwrappedDataValue===unwrappedDataValueToCompare){matchFound=true}}return!matchFound});return result},_valuesFromData:function(data){var unwrappedDataItem,unwrappedDataValue,i,len=data.length,valKey=this.options.valueKey,values=[];for(i=0;i<len;i++){unwrappedDataItem=this._unwrapData(data[i]);unwrappedDataValue=this._unwrapData(unwrappedDataItem[valKey]);values.push(unwrappedDataValue)}return values},_valuesFromElements:function($items){var i,values=[];for(i=0;i<$items.length;i++){values.push($items.eq(i).attr("data-value"))}return values},_valuesFromItems:function(item){var i,unwrappedDataItem,unwrappedDataValue,values=[],valueKey=this.options.valueKey;if(!item){return}if($.type(item)!=="array"){item=[item]}for(i=0;i<item.length;i++){unwrappedDataItem=this._unwrapData(item[i].data);unwrappedDataValue=this._unwrapData(unwrappedDataItem[valueKey]);values.push(unwrappedDataValue)}return values},_dataFromItems:function(items){var len,i,data=[];for(i=0,len=items.length;i<len;i++){data.push(items[i].data)}return data},_dataFromIndex:function(index){var data=this.options.dataSource.data();return data.length>index?data[index]:null},_dataForValues:function(value){var data,i,len,result=[];if($.type(value)!=="array"){value=[value]}for(i=0,len=value.length;i<len;i++){data=this.dataForValue(value[i]);if(data!==null){result.push(data)}}return result},_dataIndexByValue:function(value,searchDataViewOnly){var unwrappedDataItem,unwrappedDataValue,i,result=-1,data=searchDataViewOnly?this.options.dataSource.dataView():this.options.dataSource.data(),len=data.length,valKey=this.options.valueKey;for(i=0;i<len;i++){unwrappedDataItem=this._unwrapData(data[i]);unwrappedDataValue=this._unwrapData(unwrappedDataItem[valKey]);if(this._areValuesEqual(unwrappedDataValue,value)){result=i;break}}return result},_itemsFromData:function(data){var curData,len,i,$items=this._$items(),result=[];if($.type(data)!=="array"){data=[data]}for(i=0,len=data.length;i<len;i++){curData=data[i];if(curData!==null&&curData!==undefined){result.push({element:this._$elementFromData(curData,$items),data:curData})}}return result.length>0?result:null},_$keyNavItem:function(){return this._$elementFromData(this._options.keyNavItemData)},_updateFooterVariables:function(){var ds,recordsView,recordsData,recordsServer,recordsServerTotal;if(this._options.hasFooterVariables){ds=this.options.dataSource;recordsView=ds.dataView().length;recordsData=ds.data().length;recordsServer=Math.max(ds.totalRecordsCount(),recordsData);recordsServerTotal=Math.max(recordsServer,parseInt(this._options.totalAll||0,10));this._options.$footer.find("."+this.css.recordsView).html(recordsView);this._options.$footer.find("."+this.css.recordsData).html(recordsData);this._options.$footer.find("."+this.css.recordsServer).html(recordsServer);this._options.$footer.find("."+this.css.recordsServerTotal).html(recordsServerTotal)}},_moveCaretToInputEnd:function(preventItemSeparatorOnFocus){var range,input=this._options.$input[0],readonly=this._options.$input.attr("readonly");if(document.activeElement===input){return}if(readonly&&!($.ig.util.isEdge||$.ig.util.isIE)){this._options.$input.removeAttr("readonly")}this._safeFocusInput(preventItemSeparatorOnFocus);if(typeof input.selectionStart==="number"&&!$.ig.util.isIE&&!$.ig.util.isEdge){if(!this._options.ltr&&this._options.selectedData.length>0){input.selectionStart=input.selectionEnd=this._options.selectedData[this._options.selectedData.length-1][this.options.textKey].length}else{input.selectionStart=input.selectionEnd=input.value.length}}else if(typeof input.createTextRange!=="undefined"&&$(input).is(":visible")&&!readonly){range=input.createTextRange();range.collapse(false);range.select()}if(readonly){this._options.$input.attr("readonly",readonly)}},_refreshVisualStylesForItem:function($item,data){var isSelected=this._isDataSelected(data);if(isSelected){this._addItemSelectionStyles($item)}else{this._removeItemSelectionStyles($item)}if(this.options.multiSelection.enabled){if(this._isDataEqual(this._options.keyNavItemData,data)&&!isSelected){$item.addClass(this.css.itemInFocus)}else{$item.removeClass(this.css.itemInFocus)}}},_handleInitialSelection:function(){var curSelItem,selectOptions,selectedOptions,curIndex,i,curDataItem,selItems=this.options.initialSelectedItems,data=this.options.dataSource.data(),dataToSel=[],mode=this.options.mode;
if($.type(selItems)==="array"){for(i=0;i<selItems.length;i++){curSelItem=selItems[i];curIndex=curSelItem.index;if(curIndex>=0&&data.length>=curIndex){curDataItem=data[curIndex]}else if(curSelItem.value!==undefined&&curSelItem.value!==null){curDataItem=this.dataForValue(curSelItem.value)}if(curDataItem&&dataToSel.indexOf(curDataItem)===-1){dataToSel.push(curDataItem)}}}if(this.element.is("select")){selectOptions=this.element.find("option");selectedOptions=selectOptions.filter(":selected");for(i=0;i<selectedOptions.length;i++){dataToSel.push(data[selectOptions.index(selectedOptions.eq(i))])}}this._selectFirstItemInNonEditableModes(mode,dataToSel,data)},_selectFirstItemInNonEditableModes:function(mode,dataToSel,data){if((mode==="dropdown"&&!this.options.multiSelection.enabled||mode==="readonly"||mode==="readonlylist")&&dataToSel.length===0){if(data[0]!==null&&data[0]!==undefined){dataToSel.push(data[0])}}if(dataToSel.length>0){this._selectData(dataToSel,{additive:true,keepScrollPosition:true})}},_checkBoxesEnabled:function(){return this.options.multiSelection.enabled&&this.options.multiSelection.showCheckboxes},_isPossibleToVirtualize:function(){return this.options.virtualization&&this.options.dataSource.dataView().length>this.options.visibleItemsCount},_areItemsLowerInVir:function(){return this.options.virtualization&&this.options.dataSource.dataView().length<=this.options.visibleItemsCount},_itemHeight:function(){return this._$items().first().outerHeight()},_isFilteringEnabled:function(){return this.options.filteringType!=="none"},_updateItems:function(offset){var elementIndex,lengthOfElements,itemIndex,$this,curData,self=this,options=this.options,dataView=options.dataSource.dataView(),$items=this._$items(true),realOffset=0;offset=offset>0?offset:0;this._unhighlight();for(elementIndex=0,itemIndex=0,lengthOfElements=$items.length;elementIndex<lengthOfElements;elementIndex++){$this=$items.eq(elementIndex);realOffset=itemIndex+offset;curData=dataView[realOffset];if(curData&&this.options.grouping.key&&(self._isBoundaryOfGroups(dataView,realOffset)||self._isFirstItem(dataView,realOffset))){this._updateGroupHeader($this,curData)._refreshVisualStylesForItem($this,curData[options.grouping.key]);elementIndex++;$this=$items.eq(elementIndex)}if($this){this._updateItem($this,curData)._refreshVisualStylesForItem($this,curData)}itemIndex++}this._updateHighlighting()},_isFirstItem:function(data,itemIndex){if(!data[itemIndex-1]){return true}return false},_isBoundaryOfGroups:function(data,itemIndex){if(this.options.grouping.key&&data[itemIndex-1]&&data[itemIndex-1][this.options.grouping.key]!==data[itemIndex][this.options.grouping.key]){return true}return false},_toggleDropDownState:function(event){if(this._options.dropDownOpened){this.closeDropDown(null,event)}else{this.openDropDown(null,this._focusInInputWhenUsingTouchDevice(),event)}},_lastValAfterItemSep:function(){return this._options.inputVal.split(this.options.multiSelection.itemSeparator).pop()},_startsWith:function(text,fragment){return fragment!==""&&text.indexOf(fragment)===0},_endsPartialyWithItemSep:function(text){var separator=this.options.multiSelection.itemSeparator,i=separator.length,matchFound=0;for(;i>0&&!matchFound;i--){if(text.endsWith(separator.slice(0,i))){matchFound=i}}return matchFound},_filterItemSeparator:function(text){return text.slice(0,text.length-this._endsPartialyWithItemSep(text))},_separatedInputTexts:function(){var result=this._options.inputVal.split(this.options.multiSelection.itemSeparator);result[result.length-1]=this._filterItemSeparator(result[result.length-1]);return result},_updateSelection:function(event){var textsLen,dataLen,curText,curData,curDataValue,curDataText,setAsKeyNav,matchFound,isLastText,unwrappedData,i,j,options=this.options,_options=this._options,texts=_options.inputVal,data=options.dataSource.data(),textKey=options.textKey,valueKey=options.valueKey,justSelectedData=[],multiSelect=options.multiSelection.enabled;if(options.filteringType==="remote"){data=this._filterData(_options.cachedData,data).concat(data)}dataLen=data.length;if(multiSelect){texts=this._separatedInputTexts(texts)}else{texts=[texts]}if(options.autoSelectFirstMatch){_options.autoSelectedItemData=null}unwrappedData=this._unwrapData(data);for(i=0,textsLen=texts.length;i<textsLen;i++){curText=texts[i];matchFound=false;isLastText=i===textsLen-1;if(!options.caseSensitive){curText=curText.toLowerCase()}for(j=0;j<dataLen&&!matchFound;j++){curData=this._unwrapData(unwrappedData[j]);curDataText=this._unwrapData(curData[textKey]).toString();curDataValue=this._unwrapData(curData[valueKey]);setAsKeyNav=isLastText&&!this.isValueSelected(curDataValue);if(!options.caseSensitive){curDataText=curDataText.toLowerCase()}if(options.autoSelectFirstMatch){if(this._startsWith(curDataText,curText)){if(multiSelect){if(this._filterData(curData,justSelectedData).length===1){if(setAsKeyNav){this._setKeyNavigationItem({data:curData,addStyles:true,clearPrevItem:true,scrollToItem:true})}else{this._selectData(curData,{additive:true,focusCombo:true,keepInputText:true,keepHighlighting:true,keepFiltering:true},event)}matchFound=true;if(curDataText!==curText){_options.autoSelectedItemData=curData}}if(!setAsKeyNav){justSelectedData.push(curData)}}else{this._selectData(curData,{focusCombo:true,keepInputText:true,keepHighlighting:true,keepFiltering:true},event);_options.autoSelectedItemData=curData;matchFound=true;justSelectedData.push(curData)}}}else if(curDataText===curText){if(multiSelect){if(this._filterData(curData,justSelectedData).length===1){if(setAsKeyNav){this._setKeyNavigationItem({data:curData,addStyles:true,clearPrevItem:true,scrollToItem:true})}else{this._selectData(curData,{additive:true,focusCombo:true,keepInputText:true,keepHighlighting:true,keepFiltering:true},event)}matchFound=true}if(!setAsKeyNav){justSelectedData.push(curData)}}else{this._selectData(curData,{additive:true,focusCombo:true,keepInputText:true,keepHighlighting:true,keepFiltering:true},event);matchFound=true;justSelectedData.push(curData)}}}}this._deselectData(this._filterData(_options.selectedData,justSelectedData),{focusCombo:true,keepInputText:true},event);if(multiSelect&&_options.inputVal.endsWith(options.multiSelection.itemSeparator)){this._updateInputValues(false)}this._updateHighlighting()},_updateAutoComplete:function(){var text,curData,curDataText,unwrappedData,i,options=this.options,_options=this._options,texts=_options.inputVal,data=options.dataSource.data(),dataLen=data.length,textKey=options.textKey,multiSelect=options.multiSelection.enabled;if(multiSelect){texts=this._options.inputVal.split(options.multiSelection.itemSeparator)}else{texts=[texts]}if(texts.length>this._fullySelectedItemsLen()){text=texts[texts.length-1];if(multiSelect&&this._endsPartialyWithItemSep(text)){return}if(!options.caseSensitive){text=text.toLowerCase()}if(_options.autoSelectedItemData){_options.autoCompleteItemData=_options.autoSelectedItemData;this._autoComplete(_options.autoCompleteItemData[textKey].toString().slice(text.length))}else{for(i=0;i<dataLen;i++){unwrappedData=this._unwrapData(data);curData=this._unwrapData(unwrappedData[i]);curDataText=this._unwrapData(curData[textKey]).toString();if(!options.caseSensitive){curDataText=curDataText.toLowerCase()}if(!(curData!==_options.autoSelectedItemData&&this._isDataSelected(curData))&&this._startsWith(curDataText,text)){_options.autoCompleteItemData=curData;this._autoComplete(this._unwrapData(curData[textKey]).toString().slice(text.length));break}}}}},_autoComplete:function(autoCompleteText){var oldInputVal,newInputVal;if(this.options.autoComplete&&this._options.composition.isAutocompleteNeeded()){oldInputVal=this._options.inputVal;newInputVal=oldInputVal+autoCompleteText;this._options.composition.autocompleteText=autoCompleteText;this._options.composition.inputVal=oldInputVal;this._options.$input.val(newInputVal);this._setInputSelection(oldInputVal.length,newInputVal.length)}},_setInputSelection:function(start,end){var selRange,field=this._options.$input[0];if(field.createTextRange){selRange=field.createTextRange();selRange.collapse(true);selRange.moveStart("character",start);selRange.moveEnd("character",end);selRange.select();field.focus()}else if(field.setSelectionRange){field.focus();field.setSelectionRange(start,end)}else if(typeof field.selectionStart!=="undefined"){field.selectionStart=start;field.selectionEnd=end;field.focus()}},_hasInputSelection:function(){var field=this._options.$input[0],result=false;if(typeof field.selectionStart!=="undefined"){result=field.selectionStart!==field.selectionEnd}return result},_scrollToItem:function(data){var listContHeight,listContTop,listContScrollTop,itemTop,itemHeight,itemIndex,$item=this._$elementFromData(data);if(this._options.dropDownOpened){if($item.length>0){listContHeight=this._options.$dropDownListCont.height();listContTop=this._options.$dropDownListCont.igOffset().top;listContScrollTop=this.listScrollTop();itemTop=$item.igOffset().top;itemHeight=$item.outerHeight();if(!(itemTop>listContTop&&itemTop+itemHeight<listContHeight+listContTop)){this.listScrollTop(itemTop+listContScrollTop+itemHeight-listContTop-listContHeight)}}else if(this.options.virtualization){itemIndex=this._dataIndexByValue(data[this.options.valueKey]);this.listScrollTop((itemIndex-this.options.visibleItemsCount+2)*this._itemHeight())}}},_scrollToLastSelItem:function(){if(this._options.keyNavItemData!==null){this._scrollToItem(this._options.keyNavItemData)}else if(this._options.selectedData.length>0){this._scrollToItem(this._options.selectedData[this._options.selectedData.length-1])}},_positionItemInVisibleArea:function($item){var $listCont=this._options.$dropDownListCont,listContHeight=$listCont.height(),listContTop=$listCont.igOffset().top,listContScrollTop=this.listScrollTop(),itemTop=$item.igOffset().top,itemHeight=$item.outerHeight(true);if(listContTop>itemTop){this.listScrollTop(this._$items().filter(":visible").index($item)*itemHeight)}if(itemTop+itemHeight>listContHeight+listContTop){this.listScrollTop(itemTop+itemHeight+listContScrollTop-listContHeight-listContTop)}},_setKeyNavigationItem:function(options){var $item,$prevKeyNavItem,data=options.data,addStyles=options.addStyles,clearPrevItem=options.clearPrevItem,scrollToItem=options.scrollToItem,resetDataOnNonFound=options.resetDataOnNonFound;if(data instanceof $){$item=data;data=this.dataForValue($item.attr("data-value"))}else{$item=this._$elementFromData(data)}if(clearPrevItem){$prevKeyNavItem=this._$elementFromData(this._options.keyNavItemData);if($prevKeyNavItem.length>0){$prevKeyNavItem.removeClass(this.css.itemInFocus)}}if(addStyles&&$item.length>0){$item.addClass(this.css.itemInFocus)}if($item.length===0&&resetDataOnNonFound){this._options.keyNavItemData=null}else{this._options.keyNavItemData=data}if(scrollToItem){this._scrollToItem(data)}},_navigateToItem:function($item,addStyles,clearPrevItem,event,keepScrollPosition){if($item.length===0){return}if(!this.options.multiSelection.enabled){this.select($item,{focusCombo:true,keepFiltering:true,keepScrollPosition:keepScrollPosition},event)}else{this._setKeyNavigationItem({data:$item,addStyles:addStyles,clearPrevItem:clearPrevItem})}this._positionItemInVisibleArea($item)},_prevVisibleItem:function($item){do{$item=$item.prev()}while($item.length>0&&(!$item.is("."+this.css.listItem.split(" ",1)[0])||!$item.is(":visible")));return $item},_nextVisibleItem:function($item){do{$item=$item.next()}while($item.length>0&&(!$item.is("."+this.css.listItem.split(" ",1)[0])||!$item.is(":visible")));return $item},_visibleItemByIndex:function(index){return this._$items().filter(":visible").eq(index)},_handleInputChange:function(openDropDown,event){var options=this.options,_options=this._options,curVal=_options.$input.val();if(options.autoComplete&&event&&event.which===8&&_options.hadInputSelectionOnKeydown){curVal=curVal.slice(0,curVal.length-1);_options.$input.val(curVal)}if(options.autoComplete&&this._hasInputSelection()){return}if(curVal!==_options.inputVal){this._setInputVal(curVal);if(options.filteringType==="remote"){this._updateFiltering(event)}else{if(options.filteringType==="local"){_options.disableScroll=true;this._updateFiltering(event);setTimeout(function(){_options.disableScroll=false},0)}if(curVal){this._showClearButton()}else{this._hideClearButton()}this._updateSelection(event);this._updateAutoComplete();if(_options.validator){_options.validator._validateInternal(this.element,event)}}if(openDropDown){this.openDropDown(null,false,event)}}},_handleShiftNavigation:function($itemToNavigate,event){var _options=this._options,$keyNavItem=this._$keyNavItem();if($itemToNavigate.is(_options.$itemsToSelectOnShiftUpDown)){$keyNavItem.removeClass(this.css.itemInFocus);_options.$itemsToSelectOnShiftUpDown=_options.$itemsToSelectOnShiftUpDown.not($keyNavItem)}else{$itemToNavigate.addClass(this.css.itemInFocus);_options.$itemsToSelectOnShiftUpDown=_options.$itemsToSelectOnShiftUpDown.add($itemToNavigate)}this._navigateToItem($itemToNavigate,false,false,event)},_handleShiftUp:function(event){var _options=this._options;if(_options.$itemsToSelectOnShiftUpDown.length>1){this.select(_options.$itemsToSelectOnShiftUpDown,{additive:true,focusCombo:true,keepNavItem:true,keepFiltering:true},event);_options.$itemsToSelectOnShiftUpDown.removeClass(this.css.itemInFocus)}_options.$itemsToSelectOnShiftUpDown=$();_options.shiftDown=false},_handleShiftClick:function(event){var _options=this._options;if(_options.$itemsToSelectOnShiftClick.length>1){this.select(_options.$itemsToSelectOnShiftClick,{additive:true,focusCombo:true,keepNavItem:true,keepFiltering:true},event);_options.$itemsToSelectOnShiftClick.removeClass(this.css.itemInFocus);this._setKeyNavigationItem({data:$(event.target),clearPrevItem:true})}_options.$itemsToSelectOnShiftClick=$()},_groupHeaderClass:function(){return"."+this.css.groupHeader.split(" ",1)[0]},_$groupHeaders:function(){return this._$items(true).filter(this._groupHeaderClass())},_handleKeyNavigation:function(event){var $item,index,multiSelect,closeDropDown,isAutoSelectedActive,$lastSelectedItem,visibleItemsCount,self=this,options=this.options,_options=this._options,lod=this.options.loadOnDemandSettings,multiSelection=options.multiSelection.enabled,$keyNavItem=this._$keyNavItem(),$visibleItems=this._$items().filter(":visible"),currentScrollTop=this.listScrollTop(),activeIndex=this.activeIndex(),itemHeight=this._itemHeight(),addScrollCallback=false;if(event.keyCode===$.ui.keyCode.ESCAPE){if(options.multiSelection.enabled){if(this._lastValAfterItemSep().length===0){this.closeDropDown(null,event)}else{this._updateInputValues();this.clearFiltering(event);this._unhighlight()}}else{if(_options.inputVal.length===0){this.closeDropDown(null,event)}else if(_options.selectedData.length===0){this._updateInputValues();this.clearFiltering(event);this._unhighlight()}else if(_options.autoSelectedItemData){this._deselectData(_options.autoSelectedItemData,null,event);this.clearFiltering(event);this._unhighlight()}else{this.closeDropDown(null,event)}}event.preventDefault()}if(event.keyCode===$.ui.keyCode.DOWN){if(event.altKey||!_options.dropDownOpened){this.openDropDown(null,true,event)}else{$item=$keyNavItem.length>0?this._nextVisibleItem($keyNavItem):$visibleItems.eq(0);if(event.shiftKey&&multiSelection&&_options.dropDownOpened){this._handleShiftNavigation($item,event)}else{this._navigateToItem($item,true,true,event)}visibleItemsCount=options.visibleItemsCount-1;if(options.grouping){visibleItemsCount-=this._$groupHeaders().length}if(options.virtualization&&activeIndex>=visibleItemsCount){this.listScrollTop(currentScrollTop+itemHeight+1)}if(options.virtualization&&lod&&lod.enabled&&this.activeIndex()+1===this.listItems().length&&this.listItems().length<options.visibleItemsCount){self._callNextChunk(_options.$dropDownListCont,self._itemHeight())}}event.preventDefault()}if(event.keyCode===$.ui.keyCode.UP){if(_options.dropDownOpened){if(event.altKey||$keyNavItem.length===0||this._isDataEqual(_options.keyNavItemData,options.dataSource.dataView()[0])){this.closeDropDown(null,event)}else{$item=this._prevVisibleItem($keyNavItem);if(event.shiftKey&&multiSelection&&_options.dropDownOpened){this._handleShiftNavigation($item,event)}else{this._navigateToItem($item,true,true,event)}if(options.virtualization&&activeIndex-1<0){this.listScrollTop(currentScrollTop-itemHeight-1)}}}event.preventDefault()}if(event.keyCode===$.ui.keyCode.ENTER||options.selectItemBySpaceKey&&event.keyCode===$.ui.keyCode.SPACE){if(event.shiftKey&&_options.$itemsToSelectOnShiftUpDown.length===1){$lastSelectedItem=this._$elementFromData(_options.selectedData[_options.selectedData.length-1]);this.select(this._itemsBetweenTwoItems($keyNavItem,$lastSelectedItem),{additive:true})}else{isAutoSelectedActive=$keyNavItem.is(_options.$autoSelectedItem);multiSelect=multiSelection&&(!options.multiSelection.addWithKeyModifier||event.ctrlKey||isAutoSelectedActive);if(multiSelect&&this.isSelected($keyNavItem)&&!isAutoSelectedActive){this._deselectData(_options.keyNavItemData,{focusCombo:true},event)}else{closeDropDown=multiSelect?false:options.closeDropDownOnSelect;if(options.autoComplete&&$keyNavItem.length===0&&_options.autoCompleteItemData){this._selectData(_options.autoCompleteItemData,{additive:multiSelect,closeDropDown:closeDropDown,focusCombo:true},event)}else{this._selectData(_options.keyNavItemData,{additive:multiSelect,closeDropDown:closeDropDown,focusCombo:true},event)}}}if(event.keyCode===$.ui.keyCode.ENTER&&options.preventSubmitOnEnter||event.keyCode===$.ui.keyCode.SPACE){event.preventDefault()}}if(event.keyCode===$.ui.keyCode.HOME&&event.ctrlKey&&_options.dropDownOpened){if(options.virtualization){this.listScrollTop(0);addScrollCallback=true}if(addScrollCallback){this._options.scrollCallback=function(){self._navigateToItem($visibleItems.first(),true,true,event)}}else{this._navigateToItem($visibleItems.first(),true,true,event)}event.preventDefault()}if(event.keyCode===$.ui.keyCode.END&&event.ctrlKey&&_options.dropDownOpened){if(options.virtualization){this.listScrollTop(this.options.dataSource.totalLocalRecordsCount()*itemHeight);addScrollCallback=true}if(addScrollCallback){this._options.scrollCallback=function(){self._navigateToItem($visibleItems.last(),true,true,event)}}else{this._navigateToItem($visibleItems.last(),true,true,event)}event.preventDefault()}if(event.keyCode===$.ui.keyCode.PAGE_UP&&_options.dropDownOpened){index=-options.visibleItemsCount+1;if($keyNavItem.length>0){index+=$visibleItems.index($keyNavItem)}if(index<0){if(options.virtualization&&currentScrollTop>0){this.listScrollTop(currentScrollTop+itemHeight*index);addScrollCallback=true}index=0}if(addScrollCallback){this._options.scrollCallback=function(){self._navigateToItem($visibleItems.eq(index),true,true,event,true)}}else{this._navigateToItem($visibleItems.eq(index),true,true,event,true)}event.preventDefault()}if(event.keyCode===$.ui.keyCode.PAGE_DOWN&&_options.dropDownOpened){index=options.visibleItemsCount-1;if($keyNavItem.length>0){index+=$visibleItems.index($keyNavItem)}if(index>$visibleItems.length-1){if(options.virtualization){index-=options.visibleItemsCount-1;this.listScrollTop(currentScrollTop+itemHeight*index);addScrollCallback=currentScrollTop<this.listScrollTop()}index=$visibleItems.length-1}if(addScrollCallback){this._options.scrollCallback=function(){self._navigateToItem($visibleItems.eq(index),true,true,event)}}else{this._navigateToItem($visibleItems.eq(index),true,true,event)}event.preventDefault()}if(event.keyCode===_options.shiftKeyCode&&multiSelection&&_options.dropDownOpened&&!_options.shiftDown){_options.shiftDown=true;_options.$itemsToSelectOnShiftUpDown=$keyNavItem;$keyNavItem.addClass(this.css.itemInFocus)}},_dropDownContHeight:function(){var _options=this._options,dropDownContainerHeight=parseInt(_options.$dropDownListCont.outerHeight(true),10);if(_options.$header!==undefined){dropDownContainerHeight+=_options.$header.outerHeight(true)}if(_options.$footer!==undefined){dropDownContainerHeight+=_options.$footer.outerHeight(true)}return dropDownContainerHeight},_itemsBetweenTwoItems:function($item1,$item2){var firstIndex,sndIndex,temp,$items=this._$items(),$result=$();firstIndex=$items.index($item1);sndIndex=$items.index($item2);if(firstIndex>sndIndex){temp=firstIndex;firstIndex=sndIndex;sndIndex=temp}for(;firstIndex<=sndIndex;firstIndex++){$result=$result.add(this._visibleItemByIndex(firstIndex))}return $result},_safeFocusInput:function(preventItemSeparatorOnFocus){var $input=this._options.$input,input=$input[0];this._options.preventDropDownOnFocus=true;this._options.preventItemSeparatorOnFocus=preventItemSeparatorOnFocus;if(!$input.is(":focus")){input.focus()}else{$input.focus()}},_windowResize:function(){this.positionDropDown()},_documentMouseUp:function(){var _options=this._options;if(_options.$itemsToSelectOnShiftClick.length>0){_options.$itemsToSelectOnShiftClick=$()}_options.mouseDownStartedFromListItem=false},_inputFocus:function(event){var mode=this.options.mode;if(this.options.disabled){return}if(mode==="editable"||mode==="dropdown"){this._options.$combo.addClass(this.css.active)}if(mode==="editable"){if(this._options.preventItemSeparatorOnFocus){this._options.preventItemSeparatorOnFocus=false}else{this._addItemSeparatorToEnd()}}if(mode==="editable"&&this.options.dropDownOnFocus){if(this._options.preventDropDownOnFocus){this._options.preventDropDownOnFocus=false}else{this.openDropDown(null,true,event)}}},_inputBlur:function(event){var _options=this._options,$activeEl=$(document.activeElement);if(this.options.disabled){return}if($activeEl.is(_options.$dropDownListCont)||$activeEl.is(_options.$dropDownBtnIcon)||$activeEl.is(_options.$clearIcon)){_options.preventInputBlur=true;this._safeFocusInput(true)}if(!_options.preventInputBlur){if(this.options.mode==="editable"||this.options.mode==="dropdown"){_options.$combo.removeClass(this.css.active)}if(this.options.mode==="editable"){this._removeItemSeparatorFromEnd();if(_options.selectedData.length===0&&!this.options.allowCustomValue){this._setInputVal("");_options.$input.val("")}}if(this.options.closeDropDownOnBlur){_options.closingDropDownOnBlur=true;this.closeDropDown(null,event)}if(_options.validator){_options.validator._validateInternal(this.element,event,true)}}else{_options.preventInputBlur=false}},_inputClick:function(event){if(this.options.disabled){return}if(this.options.mode==="dropdown"||this.options.mode==="readonlylist"){this._toggleDropDownState(event)}},_inputKeyDown:function(event){if(this.options.disabled){return}if(this.options.mode==="editable"||this.options.mode==="dropdown"){this._handleKeyNavigation(event);if(this.options.autoComplete){this._options.hadInputSelectionOnKeydown=this._hasInputSelection()}}},_inputPaste:function(event){var self=this;if(this.options.disabled){return}if(this.options.mode==="editable"){setTimeout(function(){self._handleInputChange(!self._options.dropDownOpened,event)},0)}},_handleDropDownModeKeypress:function(event){var curText,curData,value,startValue,startIndex,i,options=this.options,_options=this._options,curChar=String.fromCharCode(event.which),data=options.dataSource.dataView(),len=data.length,textKey=options.textKey;clearTimeout(_options.dropDownModeSearchByResetTimeout);if(_options.dropDownModeSearchBy!==curChar){_options.dropDownModeSearchBy+=curChar}if(options.multiSelection.enabled){startValue=_options.keyNavItemData}else{startValue=_options.selectedData.length?_options.selectedData[_options.selectedData.length-1][options.valueKey]:0}startIndex=this._dataIndexByValue(startValue,true);if(_options.dropDownModeSearchBy.length===1){startIndex+=1}for(i=0;i<len;i++){curData=this._unwrapData(data[(i+startIndex)%len]);if(curData){curText=this._unwrapData(curData[textKey]);if(!options.caseSensitive){curText=curText.toLowerCase();_options.dropDownModeSearchBy=_options.dropDownModeSearchBy.toLowerCase()}if(curText.startsWith(_options.dropDownModeSearchBy)){if(options.multiSelection.enabled){this._setKeyNavigationItem({data:curData,addStyles:true,clearPrevItem:true})}else{this._selectData(curData,{},event)}break}}}if(value!==undefined){if(options.multiSelection.enabled){this._scrollToItem(_options.keyNavItemData)}else{this._scrollToLastSelItem()}}_options.dropDownModeSearchByResetTimeout=setTimeout(function(){_options.dropDownModeSearchBy=""},_options.dropDownModeSearchByResetDelay)},_inputKeyPress:function(event){if(this.options.disabled){return}if(this.options.mode==="dropdown"){this._handleDropDownModeKeypress(event)}},_inputKeyUp:function(event){var self=this;if(this.options.disabled){return}if(this.options.mode==="editable"){clearTimeout(this._options.keyUpTimeout);this._options.autoCompleteItemData=null;this._options.keyUpTimeout=setTimeout(function(){self._handleInputChange(!self._options.dropDownOpened,event)},this.options.delayInputChangeProcessing)}if(this.options.mode==="editable"||this.options.mode==="dropdown"){if(event.keyCode===this._options.shiftKeyCode&&this.options.multiSelection.enabled){this._handleShiftUp(event)}}},_inputMouseDown:function(event){if(this.options.disabled){return}if(!this._options.$input.is(":focus")){this._options.$input.focus();this._moveCaretToInputEnd(true);event.preventDefault()}},_inputCompositionUpdate:function(){this._options.composition.isConfirmationNeeded=true},_inputCompositionEnd:function(){if($.ig.util.isFF){return}this._options.composition.isCompositionEndFired=true;if(this._options.composition.isConfirmationNeeded){this._options.composition.isConfirmationNeeded=false;if($.ig.util.isIE||$.ig.util.isEdge){this._inputInputHandler()}this._updateAutoComplete()}},_inputInputHandler:function(){this._options.composition.handleInput()},_initCompositionObject:function(){var comboContext=this;this._options.composition={isCompositionEndFired:false,isConfirmationNeeded:false,autocompleteText:"",isAutocompleteNeeded:function(){return $.ig.util.isFF||!this.isConfirmationNeeded},autocompleteAfterComposition:function(newInputVal,oldInputVal){comboContext._options.$input.val(newInputVal);comboContext._setInputSelection(oldInputVal.length,newInputVal.length)},handleInput:function(){var val,newInputVal,oldInputVal,compositionContext=this;if($.ig.util.isSafari&&this.isCompositionEndFired&&this.autoCompleteText){val=comboContext._options.$input.val();if($.ig.util.isOpera){oldInputVal=val}else{oldInputVal=val.slice(0,-val.length/2)}if(oldInputVal.length===this.inputVal.length-1&&oldInputVal===this.inputVal.slice(0,-1)){oldInputVal=this.inputVal}newInputVal=oldInputVal+this.autocompleteText;if($.ig.util.isSafari){setTimeout(function(){compositionContext.autocompleteAfterComposition(newInputVal,oldInputVal)},0)}else{this.autocompleteAfterComposition(newInputVal,oldInputVal)}}this.isCompositionEndFired=false;this.autocompleteText=""}}},_attachEvents:function(){var lastY,self=this,css=this.css,options=this.options,_options=this._options,_handlers=this._handlers;_options.$window.on({resize:_handlers.windowResize});$(document).on({mouseup:_handlers.documentMouseUp});_options.$combo.on({mouseenter:function(){if(options.disabled){return}if(options.mode!=="readonly"){_options.$combo.addClass(css.hover)}},mouseleave:function(){if(options.disabled){return}_options.$combo.removeClass(css.hover);if(!((options.mode==="editable"||options.mode==="dropdown")&&_options.$input.is(":focus"))){_options.$combo.removeClass(css.active)}},mousedown:function(){if(options.disabled){return}if(options.mode!=="readonly"){_options.$combo.addClass(css.active)}},mouseup:function(){if(options.disabled){return}if(options.mode==="readonlylist"){_options.$combo.removeClass(css.active)}}});_options.$dropDownBtnCont.on({mouseenter:function(){if(options.disabled){return}if(options.mode!=="readonly"){_options.$dropDownBtnCont.addClass(css.hover)}},mouseleave:function(){if(options.disabled){return}if(options.mode!=="readonly"){_options.$dropDownBtnCont.removeClass(css.hover)}},mousedown:function(event){if(options.disabled){return}event.preventDefault()},click:function(event){if(options.disabled||!(self._$items().length>0||_options.$dropDownListCont.find("."+css.noMatchFound).length>0)){return}if(options.mode!=="readonly"){if(_options.dropDownOpened){self.closeDropDown(null,event)}else{if(self.options.suppressKeyboard&&$.ig.util.isTouchDevice()){event.stopPropagation();if(self._options.$input.is(":focus")){self._options.$input.blur()}self.openDropDown(null,false,event);return}self.openDropDown(null,true,event)}}event.stopPropagation()}});_options.$clearCont.on({mouseenter:function(){if(options.disabled){return}if(options.mode!=="readonly"){_options.$clearCont.addClass(css.clearHover)}},mouseleave:function(){if(options.disabled){return}if(options.mode!=="readonly"){_options.$clearCont.removeClass(css.clearHover)}},mousedown:function(event){if(options.disabled){return}event.preventDefault()},click:function(event){if(options.disabled||_options.dataBinding){return}if(options.mode==="editable"||options.mode==="dropdown"){self._hideClearButton();self.clearInput({focusCombo:true},event);if(self._focusInInputWhenUsingTouchDevice()){self._moveCaretToInputEnd(true)}}}});_options.$input.on({focus:_handlers.inputFocus,blur:_handlers.inputBlur,click:_handlers.inputClick,keydown:_handlers.inputKeyDown,paste:_handlers.inputPaste,keyup:_handlers.inputKeyUp,keypress:_handlers.inputKeyPress,mousedown:_handlers.inputMouseDown,compositionupdate:_handlers.inputCompositionUpdate,compositionend:_handlers.inputCompositionEnd,input:_handlers.inputInput});_options.$dropDownListCont.on({mouseenter:function(){var $this,$prevItems;if(options.disabled){return}if(options.mode==="editable"||options.mode==="dropdown"){$this=$(this);if(_options.$itemsToSelectOnShiftClick.length>0){$prevItems=_options.$itemsToSelectOnShiftClick;_options.$itemsToSelectOnShiftClick=self._itemsBetweenTwoItems(self._$keyNavItem(),$this);$prevItems.not(_options.$itemsToSelectOnShiftClick).removeClass(css.itemInFocus);_options.$itemsToSelectOnShiftClick.addClass(css.itemInFocus)}else{$this.addClass(css.hover);if(_options.mouseDownStartedFromListItem){$this.addClass(css.itemInFocus)}}}},mouseleave:function(){var $this;if(options.disabled){return}if(options.mode==="editable"||options.mode==="dropdown"){$this=$(this);$this.removeClass(css.hover);if(!($this.is(self._$keyNavItem())||$this.is(_options.$itemsToSelectOnShiftUpDown))){$this.removeClass(css.itemInFocus)}if(_options.$itemsToSelectOnShiftClick.length>0){_options.$itemsToSelectOnShiftClick.removeClass(css.itemInFocus)}}},mousedown:function(event){var $this,$keyNavItem;if(options.disabled){return}if(options.mode==="editable"||options.mode==="dropdown"){if(event.which===1){$this=$(this);$keyNavItem=self._$keyNavItem();if(event.shiftKey&&options.multiSelection.enabled){if($keyNavItem.length===0){$keyNavItem=self._$items().filter(":visible").eq(0);self._setKeyNavigationItem({data:$keyNavItem,addStyles:true})}_options.$itemsToSelectOnShiftClick=self._itemsBetweenTwoItems($this,$keyNavItem);_options.$itemsToSelectOnShiftClick.addClass(css.itemInFocus)}else{$this.addClass(css.itemInFocus)}_options.mouseDownStartedFromListItem=true}}},mouseup:function(event){var $this,multiSelect,closeDropDown,shouldSuppress=options.suppressKeyboard&&$.ig.util.isTouchDevice();if(options.disabled){return}if(options.mode==="editable"||options.mode==="dropdown"){if(_options.mouseDownStartedFromListItem&&event.which===1){$this=$(this);if(event.shiftKey&&options.multiSelection.enabled){self._handleShiftClick(event)}else{multiSelect=options.multiSelection.enabled&&(!options.multiSelection.addWithKeyModifier||event.ctrlKey);closeDropDown=multiSelect?false:options.closeDropDownOnSelect;if(multiSelect&&self.isSelected($this)&&!self._$keyNavItem().is(_options.$autoSelectedItem)){self.deselect($this,{focusCombo:!shouldSuppress},event)}else{self.select($this,{additive:multiSelect,closeDropDown:closeDropDown,focusCombo:!shouldSuppress},event);
}}$this.removeClass(css.itemInFocus)}}}},"."+css.listItem.split(" ",1)[0]);_options.$dropDownListCont.on({mousedown:function(event){if(options.disabled){return}event.preventDefault()},scroll:function(){if(options.disabled){return}_options.$loading.css({top:self.listScrollTop()});if(!(_options.dataBinding||_options.disableScroll)){self._callNextChunk(_options.$dropDownListCont,self._itemHeight())}}});_options.$dropDownCont.on({mousedown:function(event){event.preventDefault()}},"."+css.header+", ."+css.footer);if(_options.$dropDownScrollCont){_options.$dropDownScrollCont.on("scroll",function(){if(options.disabled){return}self._scrollVirtualization($(this));if(_options.scrollCallback){_options.scrollCallback();_options.scrollCallback=null}});_options.$dropDownListCont.on("mousewheel DOMMouseScroll",function(event){var currentScrollTop=self.listScrollTop(),itemHeight=self._itemHeight();if(options.disabled){return}if(event.originalEvent.wheelDelta>0||event.originalEvent.detail<0){self.listScrollTop(currentScrollTop-itemHeight)}else{self.listScrollTop(currentScrollTop+itemHeight)}if(options.virtualization){return false}});_options.$dropDownListCont.on("touchmove",function(event){var currentY=event.originalEvent.touches[0].clientY,currentScrollTop=self.listScrollTop(),itemHeight=self._itemHeight();if(options.disabled){return}if(currentY<lastY){self.listScrollTop(currentScrollTop+itemHeight)}else if(currentY>lastY){self.listScrollTop(currentScrollTop-itemHeight)}lastY=currentY;if(options.virtualization){return false}})}},_scrollVirtualization:function($this){var itemHeight,offset,dropDownScrollHeight,options=this.options,self=this,_options=this._options;if(!options.virtualization||_options.dataBinding){return}if(options.filteringType==="local"&&_options.inputVal!==""&&_options.expression!==undefined&&_options.expression!==null){options.dataSource.filter(_options.expression,options.filteringLogic,true)}itemHeight=this._itemHeight();offset=this._calculateOffset();this._updateItems(offset);options.dataSource.settings.callback=function(err,success,data){dropDownScrollHeight=data.totalLocalRecordsCount()*itemHeight;_options.$dropDownScroll.height(dropDownScrollHeight);self._updateFooterVariables()};this._callNextChunk($this,itemHeight)},_calculateOffset:function(){var offset,offsetCeil,offsetFloor,itemsLength=this.options.dataSource.dataView().length,visibleItems=this.options.visibleItemsCount,containerRatio=this.listScrollTop()/this._options.$dropDownScrollCont.prop("scrollHeight");offset=containerRatio*itemsLength;offsetCeil=Math.ceil(offset);if(visibleItems+offsetCeil>itemsLength){offsetFloor=Math.floor(offset);return offsetFloor}return offsetCeil},_callNextChunk:function($element,itemHeight){var delta=this._options.deltaItemsForLoadOnDemand*itemHeight;if(this.listScrollTop()+$element.innerHeight()+delta>=$element.prop("scrollHeight")){this._nextChunk()}},_disableCombo:function(value){this._options.$comboWrapper.toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!value).attr("aria-disabled",value);this.hoverable.removeClass("ui-state-hover");this.focusable.removeClass("ui-state-focus");if(value){this._options.$input.attr("disabled",true);this._options.$hiddenInput.attr("disabled",true)}else{this._options.$input.removeAttr("disabled");this._options.$hiddenInput.removeAttr("disabled")}},changeLocale:function(){this._super();var $noMatchFound=this._options.$noMatchFound;if($noMatchFound&&$noMatchFound.length){this._changeLocaleForElement($noMatchFound)}},changeRegional:function(){this.dataBind()},_setOption:function(option,value){var options=this.options,_options=this._options;if(options[option]===value){return}if(option==="dropDownAttachedToBody"||option==="virtualization"||option==="mode"||option==="format"){throw new Error(this._getLocaleValue("notSuported"))}if(option==="multiSelection"){value=$.extend(true,{},options.multiSelection,value)}if(option==="loadOnDemandSettings"){value=$.extend(true,{},options.loadOnDemandSettings,value)}if(option==="disabled"){this._disableCombo(value)}if(option==="grouping"){value=$.extend(true,{},options.grouping,value)}this._super(option,value);this._analyzeOptions();switch(option){case"enableClearButton":if(_options.inputVal){if(value===true){this._showClearButton(true)}else{this._hideClearButton()}}break;case"width":_options.$comboWrapper.outerWidth(value);break;case"height":_options.$comboWrapper.outerHeight(value);break;case"headerTemplate":this._renderHeaderTemplate(this.css,this.options,_options.$dropDownCont);break;case"footerTemplate":this._renderFooterTemplate(this.css,this.options,_options.$dropDownCont,this);this._updateFooterVariables();break;case"dropDownWidth":this.positionDropDown();break;case"itemTemplate":this._renderItems(null,null,this.options.dataSource);break;case"inputName":_options.$hiddenInput.attr("name",value);break;case"visibleItemsCount":this._setListContMaxHeight();break;case"multiSelection":this._selectData(this._options.selectedData[0]);this._renderItems(null,null,this.options.dataSource);this.clearInput();break;case"tabIndex":this._options.$input.attr("tabIndex",value);break;case"validatorOptions":if(this._options.validator){this.element.igValidator(this.options.validatorOptions)}else{this.validator()}break;case"dataSource":case"dataSourceType":case"dataSourceUrl":case"responseTotalRecCountKey":case"responseDataKey":case"responseDataType":case"responseContentType":case"requestType":case"filteringType":case"filterExprUrlKey":case"filteringCondition":case"filteringLogic":case"loadOnDemandSettings":case"grouping":this.dataBind();break;case"valueKey":case"textKey":this._updateItems();break}},_initDataSource:function(){var dataSourceOptions,schema,pagingOptions,self=this,lod=this.options.loadOnDemandSettings,options=this.options,isStringDataSource=$.type(options.dataSource)==="string",url=options.dataSourceUrl;if(!options.dataSource&&this.element.is("select")){options.dataSource=this.element[0];schema=this._initSelectSchema()}else if(!options.dataSource&&url){options.dataSource=url;isStringDataSource=true}if($.type(options.dataSource)==="function"){options.dataSource=options.dataSource()}if(!(options.dataSource&&this._isInstanceOfDataSource(options.dataSource))){this._convertToArrayOfObjects(options);if(!schema&&options.dataSource&&($.isArray(options.dataSource)||$.isFunction(options.dataSource))){schema=this._initSchema(this._unwrapData(options.dataSource)[0])}dataSourceOptions={callback:this._renderItems,callee:this,dataSource:options.dataSource,type:options.dataSourceType||undefined,requestType:options.requestType||"GET",responseContentType:options.responseContentType||null,responseDataType:options.responseDataType||null,responseDataKey:options.responseDataKey||null,responseTotalRecCountKey:options.responseTotalRecCountKey||null,localSchemaTransform:false,schema:schema||null,dataBinding:function(){if(!self._options.dropDownOpened||self._options.dataBinding){return}self._options.dataBinding=true;self._options.$loading.insertBefore(self._options.$dropDownList)},dataBound:function(){self._options.$loading.remove();self._options.dataBinding=false}};if(lod&&lod.enabled&&(url||isStringDataSource)){pagingOptions={enabled:true,appendPage:true,pageSize:lod.pageSize,pageIndex:0,pageSizeUrlKey:lod.pageSizeUrlKey||null,pageIndexUrlKey:lod.pageIndexUrlKey||null};$.extend(dataSourceOptions,{paging:pagingOptions})}if($.type(options.dataSource)==="string"&&!options.dataSourceType&&$.ig.util.isJsonpUrl(options.dataSource)){this._options.strDataSource=options.dataSource;options.dataSource=new $.ig.JSONPDataSource(dataSourceOptions)}else{options.dataSource=new $.ig.DataSource(dataSourceOptions)}if(url){options.dataSource.settings.dataSource=url;options.dataSource.settings.type="remoteUrl";options.dataSource._runtimeType=options.dataSource.analyzeDataSource();options.dataSource.settings.urlParamsEncoded=$.proxy(function(data,params){params=params?params.filteringParams:null;if(params){params.textKey=options.textKey||options.valueKey;params.valueKey=options.valueKey;if(!options.caseSensitive){params.toLower="1"}if(options.compactData){params.compact="1"}}},this)}var _aNull=function(v,nan){return v===null||v===undefined||nan&&typeof v==="number"&&isNaN(v)};options.dataSource._responseData=function(data){var len=data?data.length:0,count=len>0?data[len-1][":totals:"]:null;if(count){data.pop();count=count.split(":");options.dataSource.totalRecordsCount(_aNull(len=parseInt(count[0],10),true)?0:len);len=_aNull(len=parseInt(count[1],10),true)?0:len;if(len){self._options.totalAll=len}}}}},_isInstanceOfDataSource:function(ds){return typeof ds._xmlToArray==="function"&&typeof ds._encodePkParams==="function"},_nextChunk:function(){var lod=this.options.loadOnDemandSettings,ds=this.options.dataSource;if(lod&&ds&&lod.enabled){ds.settings.paging.appendPage=true;if(!this.options.virtualization){this.options.dataSource.settings.callback=this._handleLoadOnDemand}ds.nextPage()}return this},_initSelectSchema:function(){var schema={};schema.fields=[{name:this.options.valueKey,type:"string"},{name:this.options.textKey,type:"string"}];return schema},_initSchema:function(firstDsRow){var field,schema={fields:[]};for(field in firstDsRow){if(firstDsRow.hasOwnProperty(field)){schema.fields.push({name:field,type:$.type(firstDsRow[field])})}}return schema},_filteringCondition:function(){return this.options.autoComplete?"startsWith":this.options.filteringCondition},_generateExpressions:function(texts){var i,expressions=[];if($.type(texts)==="string"){if(texts.length>0||this._options.expression&&this._options.expression.length>0){if(texts.indexOf("\u0131")>-1&&!this.options.caseSensitive){texts=texts.replace("\u0131","\u0131|I");texts=new RegExp(texts)}expressions.push({fieldName:this.options.textKey,expr:texts,cond:this._filteringCondition()})}}else if($.type(texts)==="array"){for(i=0;i<texts.length;i++){if($.type(texts[i])==="string"){expressions.push({fieldName:this.options.textKey,expr:texts[i],cond:this._filteringCondition(),logic:this.options.filteringLogic})}else{throw new Error(this._getLocaleValue("errorNoSupportedTextType"))}}}else{throw new Error(this._getLocaleValue("errorNoSupportedTextsType"))}return expressions},_generateRegExpPattern:function(texts){var pattern=null,types={multi:function(texts){return"("+texts.join("|")+")"},startsWith:function(texts){return"^("+texts.join("|")+")"},full:function(texts){return"^"+texts.join("|")+"$"},contains:function(texts){return texts.join("|")}};if($.type(texts)==="string"){texts=[texts]}texts=$.grep(texts,function(text){return text!==""});texts=$.map(texts,function(text){return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")});if(texts.length>0){if($.type(types[this.options.highlightMatchesMode])==="function"){pattern=types[this.options.highlightMatchesMode](texts)}else{throw new Error(this._getLocaleValue("errorUnrecognizedHighlightMatchesMode"))}}return pattern},_highlight:function(texts){var pattern,regex,$curContents,$matchingTextNodes,filterMatches,highlighMatches,len,i,$items=this._$items(),highlightElement=this._options.highlightElement,highlightCssClass=this.css.listItemHighlighted,regExpFlag=this.options.caseSensitive?"":"i";if(this.options.highlightMatchesMode===null||this.options.itemTemplate){return}if(this.options.highlightMatchesMode!=="contains"){regExpFlag+="g"}pattern=this._generateRegExpPattern(texts);if(pattern){regex=new RegExp(pattern,regExpFlag);if(pattern.indexOf("\u0131")>-1&&!this.options.caseSensitive){pattern=pattern.replace("\u0131","\u0131|I");regex=new RegExp(pattern,regExpFlag)}filterMatches=function(){return this.nodeType===3&&regex.test(this.nodeValue)};highlighMatches=function(){return(this.nodeValue||"").replace(regex,function(match){return"<"+highlightElement+' class="'+highlightCssClass+'">'+match+"</"+highlightElement+">"})};for(i=0,len=$items.length;i<len;i++){if(this._checkBoxesEnabled()){$curContents=$items.eq(i).children("."+this.css.listItemTextWithCheckbox).contents()}else{$curContents=$items.eq(i).contents()}$matchingTextNodes=$curContents.filter(filterMatches);$matchingTextNodes.replaceWith(highlighMatches)}}},_unhighlight:function(){var $highlightedItems,curItem,curParent,len,i;if(this.options.highlightMatchesMode===null){return this}if(this._checkBoxesEnabled()){$highlightedItems=this._$items().children("."+this.css.listItemTextWithCheckbox).children("."+this.css.listItemHighlighted)}else{$highlightedItems=this._$items().children("."+this.css.listItemHighlighted)}for(i=0,len=$highlightedItems.length;i<len;i++){curItem=$highlightedItems.eq(i)[0];curParent=curItem.parentNode;curParent.replaceChild(curItem.firstChild,curItem);curParent.normalize()}},_updateFiltering:function(event){var val=this._options.inputVal;if(this.options.multiSelection.enabled){if(this._endsPartialyWithItemSep(val)){val=""}else{val=this._lastValAfterItemSep()}}this.filter(val,event)},_updateHighlighting:function(){var val=this._options.inputVal,selItemsLen=this._fullySelectedItemsLen(),skipHighlight=false;if(!this.options.multiSelection.enabled){if(selItemsLen===1){skipHighlight=true}}else{if(this._separatedInputTexts(val).length===selItemsLen){skipHighlight=true}else{val=this._lastValAfterItemSep(val)}}this._unhighlight();if(!skipHighlight){this._highlight(val)}},_updateInputValues:function(keepInputText,selectedItems){var curText,curData,len,i,options=this.options,_options=this._options,inputVal="",hiddenInputVal="",itemSeparator=options.multiSelection.itemSeparator;selectedItems=selectedItems||this.selectedItems();len=selectedItems?selectedItems.length:0;if(options.allowCustomValue&&!len){inputVal=_options.$input.val();hiddenInputVal=inputVal}for(i=0;i<len;i++){curData=this._unwrapData(selectedItems[i].data);curText=this._unwrapData(curData[options.textKey]);if(i!==0){if(!_options.ltr){inputVal=itemSeparator+inputVal;hiddenInputVal=itemSeparator+hiddenInputVal}else{inputVal+=itemSeparator;hiddenInputVal+=itemSeparator}}if(!_options.ltr){if(curText!==""){inputVal=this._formatItem(curText)+inputVal}hiddenInputVal=this._unwrapData(curData[options.valueKey])+hiddenInputVal}else{if(curText!==""){inputVal+=this._formatItem(curText)}hiddenInputVal+=this._unwrapData(curData[options.valueKey])}}if(!keepInputText){if(options.multiSelection.enabled&&len>0&&options.mode==="editable"&&_options.$input.is(":focus")){inputVal+=itemSeparator}_options.$input.val(inputVal);this._setInputVal(inputVal);_options.autoSelectedItemData=null}_options.$hiddenInput.val(hiddenInputVal)},_handleLocalFilteringWithGrouping:function(){var groupsLen,i,$group,visibleItems=[],self=this,$groupHeaders=this._$groupHeaders(),filterVisible=function(index,item){return!$(item).hasClass(self.css.hidden)&&!$(item).hasClass(self.css.noMatchFound)};for(i=0,groupsLen=$groupHeaders.length;i<groupsLen;i++){$group=$($groupHeaders[i]);visibleItems=$group.nextUntil(self._groupHeaderClass()).filter(filterVisible);if(visibleItems.length===0){$group.addClass(this.css.hidden)}else{$group.removeClass(this.css.hidden)}}},_handleLocalFiltering:function(dataSource){var $curItem,curKey,filterItem,dataLen,i,j,unwrappedDataViewItem,unwrappedDataViewValue,$noMatchFoundItem,_options=this._options,valKey=this.options.valueKey,dataView=dataSource.dataView().slice(),initialDataLen=dataView.length,$items=this._$items(),len=$items.length,$keyNavItem=this._$keyNavItem(),cssHidden=this.css.hidden;for(i=0;i<len;i++){$curItem=$items.eq(i);curKey=$curItem.attr("data-value");filterItem=true;for(j=0,dataLen=dataView.length;j<dataLen&&filterItem;j++){unwrappedDataViewItem=this._unwrapData(dataView[j]);unwrappedDataViewValue=this._unwrapData(unwrappedDataViewItem[valKey]);if(this._areValuesEqual(curKey,unwrappedDataViewValue)){filterItem=false;dataView.splice(j,1)}}if(filterItem){$curItem.addClass(cssHidden)}else{$curItem.removeClass(cssHidden)}}if(this.options.grouping.key){this._handleLocalFilteringWithGrouping()}if($keyNavItem.length>0&&$keyNavItem.hasClass(cssHidden)){this._setKeyNavigationItem({data:$(),clearPrevItem:true})}if(initialDataLen===0){if(!_options.$noMatchFound){$noMatchFoundItem=this._$noMatchFoundItem();if($noMatchFoundItem.length===0){_options.$noMatchFound=$(this._noMatchMarkup())}else{_options.$noMatchFound=$noMatchFoundItem}}if(_options.$noMatchFound.parent().length===0){_options.$noMatchFound.appendTo(_options.$dropDownList)}}else if(_options.$noMatchFound&&_options.$noMatchFound.parent().length>0){_options.$noMatchFound.detach()}},_setInputVal:function(val){this._options.inputVal=val},_setListContMaxHeight:function(){this._options.$dropDownListCont.css("maxHeight",this.options.visibleItemsCount*this._itemHeight())},_updateVirtualScrollVisibility:function(){if(this._isPossibleToVirtualize()){this._options.$dropDownScrollCont.removeClass(this.css.hidden)}else if(this._areItemsLowerInVir()){this._options.$dropDownScrollCont.addClass(this.css.hidden)}},_addItemSelectionStyles:function($items){var $curItem,len,i;for(i=0,len=$items.length;i<len;i++){$curItem=$items.eq(i);if(this._isGroupHeader($curItem)){continue}$curItem.addClass(this.css.active);if(this._checkBoxesEnabled()){$curItem.find(".ui-igcombo-checkbox .ui-icon").removeClass(this.css.checkboxOff).addClass(this.css.checkboxOn)}}},_removeItemSelectionStyles:function($items){var $curItem,len,i;for(i=0,len=$items.length;i<len;i++){$curItem=$items.eq(i);$curItem.removeClass(this.css.active);if(this._checkBoxesEnabled()){$curItem.find(".ui-igcombo-checkbox .ui-icon").removeClass(this.css.checkboxOn).addClass(this.css.checkboxOff)}}},_addItemSeparatorToEnd:function(){var newVal,inputVal=this._options.inputVal,itemSep=this.options.multiSelection.itemSeparator,sepTexts=this._separatedInputTexts(inputVal),selItemsLen=this._fullySelectedItemsLen();if(inputVal.length>0&&this.options.multiSelection.enabled&&!inputVal.endsWith(itemSep)&&sepTexts.length===selItemsLen){newVal=inputVal+itemSep;this._options.$input.val(newVal);this._setInputVal(newVal)}},_removeItemSeparatorFromEnd:function(){var newVal,inputVal=this._options.inputVal,itemSep=this.options.multiSelection.itemSeparator;if(this.options.multiSelection.enabled&&inputVal.endsWith(itemSep)){newVal=inputVal.slice(0,inputVal.length-itemSep.length);this._options.$input.val(newVal);this._setInputVal(newVal)}},_callInternalSelChangeSubs:function(event){var curCallback,i,callbacks=this._options.internalSelChangeSubs;if($.type(callbacks)==="array"){for(i=0;i<callbacks.length;i++){curCallback=callbacks[i];if(typeof curCallback==="function"){curCallback()}}}if(this._options.validator){this._options.validator._validateInternal(this.element,event)}},_fullySelectedItemsLen:function(){var autoSelItemLen=this._options.autoSelectedItemData===null?0:1;return this._options.selectedData.length-autoSelItemLen},_unwrapData:function(data){if(typeof data==="function"){data=data()}return data},_dropDownOrientation:function(){var dropDownAndComboHeight,_options=this._options,direction=this.options.dropDownOrientation,$combo=_options.$combo,comboOffset=$combo.igOffset(),comboTopOffset=comboOffset.top,comboOuterHeight=parseInt($combo.outerHeight(),10),dropDownContainerHeight=this._dropDownContHeight(),windowHeight=_options.$window.height(),windowScrollTop=comboOffset.documentScrollTop?comboOffset.documentScrollTop:_options.$window.scrollTop();dropDownAndComboHeight=parseInt(comboTopOffset+comboOuterHeight+dropDownContainerHeight,10);if(direction==="auto"){if(dropDownAndComboHeight<windowHeight+windowScrollTop){direction="bottom"}else if(comboTopOffset-dropDownContainerHeight>0){direction="top"}else{direction="bottom"}}if(direction==="top"){if(_options.$dropDownCont.hasClass(this.css.orientationBottom)){_options.$dropDownCont.removeClass(this.css.orientationBottom).addClass(this.css.orientationTop)}}else{if(_options.$dropDownCont.hasClass(this.css.orientationTop)){_options.$dropDownCont.removeClass(this.css.orientationTop).addClass(this.css.orientationBottom)}}return direction},_startRepositionInterval:function(){var self=this;this._options.repositionInterval=setInterval(function(){self.positionDropDown()},200)},_clearRepositionInterval:function(){clearInterval(this._options.repositionInterval)},_areValuesEqual:function(val1,val2){return val1!==null&&val1!==undefined&&val2!==null&&val2!==undefined?$.ig.encode(val1.toString())===$.ig.encode(val2.toString()):false},_isValueInArray:function(val,vals){var i=0,len=vals.length;val=val&&val.toString();for(;i<len;i++){if(this._areValuesEqual(val,vals[i])){return i}}return-1},_focusInInputWhenUsingTouchDevice:function(){return!("ontouchstart"in window&&this.options.mode!=="editable")},_triggerItemsRendering:function(){var args={owner:this,dataSource:this.options.dataSource};return this._trigger(this.events.itemsRendering,null,args)},_triggerItemsRendered:function(){var args={owner:this,dataSource:this.options.dataSource};this._trigger(this.events.itemsRendered,null,args)},_triggerRendered:function(){var args={owner:this,element:this._options.$comboWrapper};this._trigger(this.events.rendered,null,args)},_triggerDataBinding:function(){var args={owner:this,dataSource:this.options.dataSource};return this._trigger(this.events.dataBinding,null,args)},_triggerDataBound:function(success,msg){var args={owner:this,success:success,errorMessage:msg,dataSource:this.options.dataSource};this._trigger(this.events.dataBound,null,args)},_triggerFiltering:function(event){var args={owner:this,expression:this._options.expression};return this._trigger(this.events.filtering,event,args)},_triggerFiltered:function(event){var args={owner:this,elements:this._$filteredItems()};this._trigger(this.events.filtered,event,args)},_triggerDropDownOpening:function(event){var args={owner:this,list:this._options.$dropDownCont};return this._trigger(this.events.dropDownOpening,event,args)},_triggerDropDownOpened:function(event){var args={owner:this,list:this._options.$dropDownCont};this._trigger(this.events.dropDownOpened,event,args)},_triggerDropDownClosing:function(event){var args={owner:this,list:this._options.$dropDownCont};return this._trigger(this.events.dropDownClosing,event,args)},_triggerDropDownClosed:function(event){var args={owner:this,list:this._options.$dropDownCont};this._trigger(this.events.dropDownClosed,event,args)},_triggerSelectionChanging:function(newSelItems,currentSelItems,event){var args={owner:this,items:newSelItems,currentItems:currentSelItems};return this._trigger(this.events.selectionChanging,event,args)},_triggerSelectionChanged:function(newSelItems,oldItems,event){var args={owner:this,items:newSelItems,oldItems:oldItems};this._trigger(this.events.selectionChanged,event,args)},dataBind:function(){var noCancel;this._initDataSource();this._options.cachedData=[];noCancel=this._triggerDataBinding();if(noCancel){if(!this._options.initialDataBinding){this.clearInput();this._options.selectedData=[]}this.options.dataSource.dataBind(this._renderItems,this)}return this},refreshValue:function(){this._updateInputValues(true)},dataForValue:function(value){var data,unwrappedDataItem,unwrappedDataValue,len,i,valKey=this.options.valueKey,cachedData=this._options.cachedData,matchFound=false,result=null;if(!this.options.dataSource||value===null||value===undefined){return null}data=this.options.dataSource.data();for(i=0,len=data.length;i<len&&!matchFound;i++){unwrappedDataItem=this._unwrapData(data[i]);unwrappedDataValue=this._unwrapData(unwrappedDataItem[valKey]);if(this._areValuesEqual(unwrappedDataValue,value)){result=data[i];matchFound=true}}if(!matchFound&&this.options.filteringType==="remote"){for(i=0,len=cachedData.length;i<len&&!matchFound;i++){unwrappedDataItem=this._unwrapData(cachedData[i]);unwrappedDataValue=this._unwrapData(unwrappedDataItem[valKey]);if(this._areValuesEqual(unwrappedDataValue,value)){result=cachedData[i];matchFound=true}}}return result},dataForElement:function($element){if(!($element instanceof $&&$element.is(this._$items()))){return null}return this.dataForValue($element.attr("data-value"))},itemsFromElement:function($element){var i,result,$curElement;if(!($element instanceof $&&$element.is(this._$items()))){return null}if($element.length===1){result={element:$element,data:this.dataForElement($element)}}else{result=[];for(i=0;i<$element.length;i++){$curElement=$element.eq(i);result.push({element:$curElement,data:this.dataForElement($curElement)})}}return result},itemsFromValue:function(value){var data,i,len,self=this,$items=this._$items(),result=null;if($.type(value)==="array"){value=$.grep(value,function(val,index){return self._isValueInArray(val,value)===index});for(i=0,len=value.length;i<len;i++){data=this.dataForValue(value[i]);if(data){if(!result){result=[]}result.push({element:this._$elementFromValue(value[i],$items),data:data})}}}else{data=this.dataForValue(value);if(data){result={element:this._$elementFromValue(value,$items),data:data}}}return result},itemsFromIndex:function(index){var value,i,data=this.options.dataSource.data(),dataLen=data.length,valKey=this.options.valueKey;if($.type(index)==="array"){value=[];for(i=0;i<index.length;i++){if(typeof index[i]==="number"&&index[i]>=0&&index[i]<dataLen){value.push(data[index[i]][valKey])}}}else if(typeof index==="number"&&index>=0&&index<dataLen){value=this._unwrapData(this._unwrapData(data[index])[valKey])}return this.itemsFromValue(value)},items:function(){return this._itemsFromData(this.options.dataSource.data())},filteredItems:function(){return this._itemsFromData(this.options.dataSource.dataView())},selectedItems:function(){return this._options.selectedData.length>0?this._itemsFromData(this._options.selectedData):null},filter:function(texts,event){var expressions=[],type=this.options.filteringType,clearFiltering=texts==="",ds=this.options.dataSource;if(!this._isFilteringEnabled()){return this}expressions=this._options.expression=this._generateExpressions(texts);if(type==="local"){if(clearFiltering){this._options.expression=null;ds.clearLocalFilter()}}this.filterByExpressions(expressions,event)},filterByExpressions:function(expressions,event){var noCancel,logic=this.options.filteringLogic,filterExprUrlKey=this.options.filterExprUrlKey,type=this.options.filteringType,ds=this.options.dataSource,paging=ds.settings.paging,filtering=ds.settings.filtering,textKeyValueOption=this.options.textKey;if(!this._isFilteringEnabled()){return this}filtering.type=type;filtering.caseSensitive=this.options.caseSensitive;filtering.expressions=expressions;filtering.expressions.forEach(function(element){if(element.fieldName===undefined){element.fieldName=textKeyValueOption}});noCancel=event?this._triggerFiltering(event):true;if(noCancel){if(type==="local"){ds.filter(filtering.expressions,logic,true);if(this.options.virtualization){this._handleLocalFilteringWithVirt(ds)}else{this._handleLocalFiltering(ds)}}if(type==="remote"){if(paging){paging.pageIndex=0;paging.appendPage=false}if(filterExprUrlKey){filtering.filterExprUrlKey=filterExprUrlKey}this._options.remoteFilteringTriggerEvt=event;ds.dataBind(this._handleRemoteFiltering,this)}if(this._options.dropDownOpened){this.listScrollTop(0)}if(event&&!this._options.remoteFilteringTriggerEvt){this._triggerFiltered(event)}}return this},clearFiltering:function(event){var ds=this.options.dataSource,expression=this._options.expression;if(!ds||!expression||expression.length<=0||expression.length===1&&expression[0].expr===""){if(this._options.updateInputValuesOnRemoteFilter&&this._endsPartialyWithItemSep(this._options.inputVal)){this._updateInputValues();this._hideClearButton()}this._options.updateInputValuesOnRemoteFilter=false;return}this.filter("",event);this.positionDropDown();return this},openDropDown:function(callback,focusCombo,event){var offset,noCancel,newAnimationStyle,_options=this._options,borderWidth=parseInt(_options.$combo.css("borderTopWidth"),10),topPosition=$.ig.util.offset(_options.$combo).top-borderWidth,self=this,$ddCont=_options.$dropDownCont,orientation=this._dropDownOrientation(),autoHeight=this._dropDownContHeight();if(focusCombo===undefined){focusCombo=true}if(self.options.suppressKeyboard&&$.ig.util.isTouchDevice()){focusCombo=false}if(!_options.dropDownOpened){noCancel=event?this._triggerDropDownOpening(event):true;if(noCancel){_options.dropDownOpened=true;this.positionDropDown();this._scrollToLastSelItem();if(orientation==="top"){$ddCont.addClass(this.css.orientationTop).removeClass(this.css.orientationBottom).css({top:parseInt($ddCont.css("top"),10)-1});if(this.options.dropDownAttachedToBody){newAnimationStyle={height:autoHeight,top:topPosition-autoHeight}}else{newAnimationStyle={height:autoHeight,top:-autoHeight-borderWidth}}}else{$ddCont.addClass(this.css.orientationBottom).removeClass(this.css.orientationTop);newAnimationStyle={height:autoHeight}}this._startRepositionInterval();$ddCont.stop().removeClass(this.css.noBorder).animate(newAnimationStyle,{duration:this.options.animationShowDuration,queue:false,easing:"swing",complete:function(){$ddCont.height("").css("overflow","");if(self.options.virtualization){offset=self._calculateOffset();self._updateItems(offset)}if($.type(callback)==="function"){callback()}if(event){self._triggerDropDownOpened(event)}}});if(focusCombo){this._moveCaretToInputEnd(false)}}}return this},closeDropDown:function(callback,event){var noCancel,newAnimationStyle,_options=this._options,self=this,borderWidth=parseInt(_options.$combo.css("borderTopWidth"),10),orientation=this._dropDownOrientation();if(_options.dropDownOpened&&(!_options.dataBinding||_options.closingDropDownOnBlur)){noCancel=event?this._triggerDropDownClosing(event):true;if(noCancel){this.positionDropDown();if(orientation==="top"){if(this.options.dropDownAttachedToBody){newAnimationStyle={height:0,top:$.ig.util.offset(_options.$combo).top-borderWidth,left:$.ig.util.offset(_options.$dropDownCont).left}}else{newAnimationStyle={height:0,top:0}}}else{newAnimationStyle={height:0}}_options.$dropDownCont.stop().css("overflow","hidden").animate(newAnimationStyle,{duration:this.options.animationHideDuration,queue:false,easing:"swing",complete:function(){self._clearRepositionInterval();_options.$dropDownCont.addClass(self.css.noBorder).removeClass(self.css.orientationBottom).removeClass(self.css.orientationTop).css({top:-99999,left:-99999});if(self.options.filteringType!=="remote"){self._updateInputValues();self._unhighlight();self.clearFiltering(event);if(self.options.multiSelection.enabled){self._setKeyNavigationItem({data:$(),clearPrevItem:true})}if(!self.options.allowCustomValue&&_options.selectedData.length===0||self.options.allowCustomValue&&_options.$input.val()===""){self._hideClearButton()}self._removePlaceholderOnEmptyTextVal();if(_options.validator){_options.validator._validateInternal(self.element,event,true)}}else{_options.updateInputValuesOnRemoteFilter=true;self.clearFiltering(event)}if($.type(callback)==="function"){callback()}_options.dropDownOpened=false;_options.closingDropDownOnBlur=false;if(event){self._triggerDropDownClosed(event)}}})}}return this},clearInput:function(options,event){options=options||{};this._options.$input.val("");this._options.$hiddenInput.val("");this._setInputVal("");this.deselectAll(options,event);this.clearFiltering(event);this._unhighlight();this._hideClearButton();this._setKeyNavigationItem({data:$(),clearPrevItem:true});return this},_hideClearButton:function(){if(!this.options.enableClearButton){return}this._options.$clearCont.hide()},_showClearButton:function(force){if(!force&&!this.options.enableClearButton){return}this._options.$clearCont.show()},isSelected:function($item){return $item instanceof $?this.isValueSelected($item.attr("data-value")):false},isValueSelected:function(value){return this._isValueInArray(value,this._valuesFromData(this._options.selectedData))!==-1},isIndexSelected:function(index){return this.isValueSelected(this.options.dataSource.data()[index][this.options.valueKey])},_selectData:function(data,options,event){var items,itemsLen,selectedValues,newSelItems,selAutoSelectedItem,selChanged,additive,prevSelValues,newSelData,skipEventTrigger,noCancel,i,comboOptions=this.options,_options=this._options,multiSelEnabled=comboOptions.multiSelection.enabled,prevSelItems=this.selectedItems(),returnValue={
combo:this,selectionCanceled:false};data=$.type(data)==="array"&&!multiSelEnabled?data[0]:data;items=this._itemsFromData(data);options=options||{};if(items===null){if(!options.additive){this.deselectAll(options,event)}return returnValue}if($.type(items)!=="array"){items=[items]}additive=options.additive&&multiSelEnabled;itemsLen=items.length;selectedValues=this._valuesFromItems(items);if(additive){for(i=0;i<itemsLen&&!selChanged;i++){if(!this.isValueSelected(items[i].data[comboOptions.valueKey])){selChanged=true}}}else{prevSelValues=this._valuesFromItems(prevSelItems);if(!$.ig.util.areSetsEqual(selectedValues,prevSelValues)){selChanged=true}}if(this._isValueInArray(_options.autoSelectedItemData&&_options.autoSelectedItemData[comboOptions.valueKey],selectedValues)!==-1){selAutoSelectedItem=true;if(this._options.selectedData.length>0){if(itemsLen===1&&this._options.autoSelectedItemData[comboOptions.valueKey]===this._options.selectedData[0][comboOptions.valueKey]){skipEventTrigger=itemsLen===1&&this._options.autoSelectedItemData[comboOptions.valueKey]===this._options.selectedData[0][comboOptions.valueKey]}}}if(selChanged||selAutoSelectedItem){if(additive&&prevSelItems){newSelItems=prevSelItems.concat(this._filterItems(items,prevSelItems));newSelData=this._dataFromItems(newSelItems)}else{newSelItems=items;newSelData=this._dataFromItems(newSelItems)}if(event&&!skipEventTrigger){noCancel=this._triggerSelectionChanging(newSelItems,prevSelItems,event)}else{noCancel=true}returnValue.selectionCanceled=!noCancel;if(noCancel){_options.selectedData=newSelData;if(prevSelItems&&prevSelItems.length>0&&!additive){this._removeItemSelectionStyles(this._$elementsFromItems(this._filterItems(prevSelItems,items)))}this._addItemSelectionStyles(this._$elementsFromItems(newSelItems));this._updateInputValues(options.keepInputText,newSelItems);if(!options.keepHighlighting){this._unhighlight()}this._showClearButton();if(options.focusCombo){if(!(options.autoComplete&&this._hasInputSelection())){this._moveCaretToInputEnd(true)}}if(!options.keepNavItem){this._setKeyNavigationItem({data:items[itemsLen-1].data?items[itemsLen-1].data:$(),clearPrevItem:true})}if(comboOptions.filteringType==="remote"){this._options.cachedData=this._dataFromItems(newSelItems)}if(options.closeDropDown){this.closeDropDown(null,event)}if(!options.keepFiltering){this.clearFiltering(event)}this._removePlaceholderOnEmptyTextVal();if(!options.keepScrollPosition){this._scrollToLastSelItem()}this._callInternalSelChangeSubs(event);if(event&&!skipEventTrigger){this._triggerSelectionChanged(newSelItems,prevSelItems,event)}}}else if(options.closeDropDown){noCancel=event?this._triggerDropDownClosing(event):true;if(noCancel){this.closeDropDown(null,event)}}return returnValue},value:function(value,options,event){var selectedValues,selectedItems,i,retValue;if(value===undefined){selectedValues=[];selectedItems=this.selectedItems();if(selectedItems){for(i=0;i<selectedItems.length;i++){selectedValues.push(selectedItems[i].data[this.options.valueKey])}}else if(this.options.allowCustomValue&&this._options.$hiddenInput.val()!==""){selectedValues.push(this._options.$hiddenInput.val())}if(!this.options.multiSelection.enabled&&selectedItems){selectedValues=selectedValues.length>0?selectedValues[0]:null}return selectedValues}retValue=this._selectData(this._dataForValues(value),options,event);if(this.options.allowCustomValue&&!this.selectedItems()&&!retValue.selectionCanceled){this._options.$input.val(value);this._updateInputValues();this._showClearButton()}},select:function($items,options,event){if($items instanceof $){this.value(this._valuesFromElements($items),options,event)}return this},index:function(index,options,event){var selectedItems,indexes,unwrappedDataItem,unwrappedDataValue,i,len,dataToSel=[];if(index===undefined){selectedItems=this.selectedItems();if(selectedItems.length===1){unwrappedDataItem=this._unwrapData(selectedItems[0].data);unwrappedDataValue=this._unwrapData(unwrappedDataItem[this.options.valueKey]);indexes=this._dataIndexByValue(unwrappedDataValue)}else{indexes=[];for(i=0;i<selectedItems.length;i++){unwrappedDataItem=this._unwrapData(selectedItems[i].data);unwrappedDataValue=this._unwrapData(unwrappedDataItem[this.options.valueKey]);indexes.push(this._dataIndexByValue(unwrappedDataValue))}}return indexes}if($.type(index)!=="array"){index=[index]}for(i=0,len=index.length;i<len;i++){dataToSel.push(this._dataFromIndex(index[i]))}this._selectData(dataToSel,options,event);return this},selectAll:function(options,event){options=options||{};this._selectData(this.options.dataSource.data(),options,event);return this},_deselectData:function(data,options,event){var newSelItems,selChanged,noCancel,len,i,_options=this._options,items=this._itemsFromData(data),prevSelItems=this.selectedItems();options=options||{};if(items===null){return this}if($.type(items)!=="array"){items=[items]}for(i=0,len=items.length;i<len&&!selChanged;i++){if(this.isValueSelected(items[i].data[this.options.valueKey])){selChanged=true}}if(selChanged){newSelItems=this._filterItems(prevSelItems,items);noCancel=event?this._triggerSelectionChanging(newSelItems,prevSelItems,event):true;if(noCancel){_options.selectedData=this._dataFromItems(newSelItems);this._removeItemSelectionStyles(this._$elementsFromItems(items));this._updateInputValues(options.keepInputText,newSelItems);this._unhighlight();if(_options.selectedData.length===0){this._setKeyNavigationItem({data:$(),clearPrevItem:true})}if(_options.inputVal===""){this._hideClearButton()}if(options.focusCombo){if(this._focusInInputWhenUsingTouchDevice()){this._moveCaretToInputEnd(true)}}if(this.options.filteringType==="remote"){this._options.cachedData=this._dataFromItems(newSelItems)}this._addPlaceholderWhenEmptyTextVal();this._callInternalSelChangeSubs(event);if(event){this._triggerSelectionChanged(newSelItems,prevSelItems,event)}}}return this},deselectByValue:function(value,options,event){options=options||{};if(value===undefined&&this._options.selectedData.length===1){value=this._options.selectedData[0][this.options.valueKey]}this._deselectData(this._dataForValues(value),options,event)},deselect:function($items,options,event){if($items===undefined){this.deselectByValue()}if($items instanceof $){$items=$items.filter(this._$items());this.deselectByValue(this._valuesFromElements($items),options,event)}return this},deselectByIndex:function(index,options,event){var i,len,dataToDeselect=[];if($.type(index)!=="array"){index=[index]}for(i=0,len=index.length;i<len;i++){dataToDeselect.push(this._dataFromIndex(index[i]))}this._deselectData(dataToDeselect,options,event);return this},deselectAll:function(options,event){this._deselectData(this._options.selectedData,options,event);this._selectFirstItemInNonEditableModes(this.options.mode,[],this.options.dataSource.dataView());return this},activeIndex:function(index){if(index===undefined){return this._$items().index(this._$keyNavItem())}this._setKeyNavigationItem({data:this._dataFromIndex(index),addStyles:true,clearPrevItem:true});return this},text:function(text){if(text===undefined){return this._options.$input.val()}this._options.$input.val(text);this._handleInputChange(false);return this},listScrollTop:function(value){var $listCont,_options=this._options;if(value!==undefined&&!_options.dropDownOpened){this.openDropDown()}$listCont=_options.$dropDownScrollCont||_options.$dropDownListCont;if(value===undefined){return $listCont?$listCont.prop("scrollTop"):0}if($listCont){$listCont.prop("scrollTop",value||0)}return this},listItems:function(){return this._$items()},comboWrapper:function(){return this._options.$comboWrapper},dropDown:function(){return this._options.$dropDownCont},list:function(){return this._options.$dropDownListCont},textInput:function(){return this._options.$input},valueInput:function(){return this._options.$hiddenInput},validator:function(destroy){var validatorOptions=this.options.validatorOptions,validator=this._options.validator;if(validator&&(destroy||!validatorOptions)&&validator.owner===this){validator.destroy();this._options.validator=validator=null}else if(!validator&&!destroy&&validatorOptions&&this.element.igValidator){this._options.validator=validator=this.element.igValidator(validatorOptions).data("igValidator");this._options.validator.owner=this}return validator},validate:function(){return this._options.validator?this._options.validator.validate():null},dropDownOpened:function(){return this._options.dropDownOpened},positionDropDown:function(){var comboOffset,width,_options=this._options,$combo=_options.$combo,orientation=this.options.dropDownOrientation;if(orientation==="auto"){orientation=this._dropDownOrientation()}if(this.options.dropDownAttachedToBody){comboOffset=$.ig.util.offset($combo);width=this.options.dropDownWidth||$combo.outerWidth();_options.$dropDownCont.outerWidth(width);if(orientation==="top"){_options.$dropDownCont.css({left:comboOffset.left,top:comboOffset.top-_options.$dropDownCont.outerHeight()})}else{_options.$dropDownCont.css({left:comboOffset.left,top:comboOffset.top+$combo.outerHeight()})}}else{if(orientation==="top"){_options.$dropDownCont.css({left:"",top:-_options.$dropDownCont.outerHeight()})}else{_options.$dropDownCont.css({left:"",top:""})}}},_unsetupInput:function(){var _handlers=this._handlers;this.element.insertAfter(this._options.$comboWrapper);this._options.$comboWrapper.remove();this.element.removeClass(this.css.field).val("").removeAttr("placeholder").removeAttr("tabIndex").attr("name",this._options.nameAttribute);if(this.options.mode!=="editable"){this.element.removeAttr("readonly").removeAttr("unselectable").removeClass(this.css.unselectable)}this.element.off({focus:_handlers.inputFocus,blur:_handlers.inputBlur,click:_handlers.inputClick,keydown:_handlers.inputKeyDown,paste:_handlers.inputPaste,keyup:_handlers.inputKeyUp,keypress:_handlers.inputKeyPress,mousedown:_handlers.inputMouseDown,compositionupdate:_handlers.inputCompositionUpdate,compositionend:_handlers.inputCompositionEnd,input:_handlers.inputInput})},destroy:function(){var _options=this._options,_handlers=this._handlers;this.validator(true);_options.$window.off("resize",_handlers.windowResize);$(document).off("mouseup",_handlers.documentMouseUp);this._clearRepositionInterval();_options.$dropDownCont.remove();if(this.element.is("input")){this._unsetupInput()}else if(this.element.is("select")){_options.$comboWrapper.remove();this.element.show().attr("name",_options.nameAttribute)}else{this.element.empty().removeClass(this.css.comboWrapper)}_options=null;this._superApply(arguments);return this}});$.extend($.ui.igCombo,{version:"21.2.12"})})($);/*!@license
* Infragistics.Web.ClientUI Dialog 21.2.12
*
* Copyright (c) 2011-2022 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on:
* jquery.js
* jqueryui/1.8.11/jquery-ui.js
* jquery.ui.core.js
* jquery.ui.widget.js
* jquery.ui.mouse.js
* jquery.ui.draggable.js
* jquery.ui.resizable.js
* infragistics.util.js
* infragistics.util.jquery.js
* infragistics.ui.widget.js
*
* Example to use:
*	<script type="text/javascript">
*	$(function () {
*		$("#dialog1").igDialog();
*	});
*	</script>
*	<div id="dialog1"></div>
*/
(function($){var _lastTop,_iframe,_visCount=0,_modals=[],_lastZ=0,_maxZ=0,CLOSE=0,OPEN=1,MIN=2,MAX=3,PIN=4,UNPIN=5,RESTORE=6,_pos={my:"center",at:"center",collision:"fit",of:window,using:function(pos){if(pos.top<0){pos.top=0}if(pos.left<0){pos.left=0}var p=$(this).css(pos).igOffset();if(p.top<0){$(this).css("top",pos.top-p.top)}if(p.left<0){$(this).css("left",pos.left-p.left)}}},_isSrc=function(elem,src){return elem&&src&&(elem.has(src).length>0||elem[0]===src)},_notab=function(elem){return elem.attr("zIndex",-1).css("outline",0).attr("unselectable","on")},_toPx=function(elem,css){var val=elem.css(css);if(!val){return 0}css=parseFloat(val);if(val.indexOf("px")>0){css+=.7}else if(val.indexOf("em")>0){css*=12}else{return 0}return Math.floor(css)},_getPadding=function(elem,vert,margin){return _toPx(elem,(margin||"padding")+(vert?"Top":"Left"))+_toPx(elem,(margin||"padding")+(vert?"Bottom":"Right"))+_toPx(elem,"border"+(vert?"Top":"Left")+"Width")+_toPx(elem,"border"+(vert?"Bottom":"Right")+"Width")},_stopEvt=function(e){try{e.preventDefault();e.stopPropagation()}catch(ex){}};$.widget("ui.igDialog",$.ui.igWidget,{options:{mainElement:null,state:"opened",pinned:false,closeOnEscape:true,showCloseButton:true,showMaximizeButton:false,showMinimizeButton:false,showPinButton:false,pinOnMinimized:false,imageClass:null,headerText:null,showHeader:true,showFooter:false,footerText:null,dialogClass:null,container:null,height:null,width:300,minHeight:100,minWidth:150,maxHeight:null,maxWidth:null,draggable:true,position:null,resizable:true,tabIndex:0,openAnimation:null,closeAnimation:null,zIndex:null,modal:false,trackFocus:true,closeButtonTitle:undefined,minimizeButtonTitle:undefined,maximizeButtonTitle:undefined,pinButtonTitle:undefined,unpinButtonTitle:undefined,restoreButtonTitle:undefined,locale:{closeButtonTitle:undefined,minimizeButtonTitle:undefined,maximizeButtonTitle:undefined,pinButtonTitle:undefined,unpinButtonTitle:undefined,restoreButtonTitle:undefined},temporaryUrl:null,enableHeaderFocus:true,enableDblclick:"auto"},events:{stateChanging:null,stateChanged:null,animationEnded:null,focus:null,blur:null},css:{dialog:"ui-igdialog ui-dialog ui-widget "+"ui-widget-content ui-corner-all",header:"ui-igdialog-header ui-dialog-titlebar ui-widget-header "+"ui-corner-top ui-helper-clearfix",headerFocus:"ui-igdialog-header-focus ui-state-focus",headerMinimized:"ui-corner-bottom",headerText:"ui-igdialog-headertext ui-dialog-title",headerImage:"ui-igdialog-headerimage",headerTextMinimized:"ui-igdialog-headertext-minimized",headerButton:"ui-igdialog-headerbutton ui-corner-all ui-state-default",headerButtonHover:"ui-igdialog-headerbutton-hover ui-state-hover",close:"ui-igdialog-buttonclose",minimize:"ui-igdialog-buttonminimize",maximize:"ui-igdialog-buttonmaximize",pin:"ui-igdialog-buttonpin",closeIcon:"ui-igdialog-close-icon ui-icon ui-icon-close",minimizeIcon:"ui-igdialog-minimize-icon ui-icon ui-icon-minus",maximizeIcon:"ui-igdialog-maximize-icon ui-icon ui-icon-extlink",restoreIcon:"ui-igdialog-restore-icon ui-icon ui-icon-newwin",pinIcon:"ui-igdialog-pin-icon ui-icon ui-icon-pin-s",unpinIcon:"ui-igdialog-unpin-icon ui-icon ui-icon-pin-w",footer:"ui-igdialog-footer ui-widget-header ui-corner-bottom ui-helper-clearfix",resizing:"ui-igdialog-resizing",dragging:"ui-igdialog-dragging",unmovable:"ui-igdialog-unmovable",overlay:"ui-igdialog-overlay ui-widget-overlay",contentIframe:"ui-igdialog-content-iframe",content:"ui-igdialog-content ui-widget-content ui-dialog-content"},_create:function(){var elem,self=this,elem0=self.element,el=elem0[0],url=el&&el.nodeName==="IFRAME"?el.src:null,o=self.options,state=o.state,parent,css=self.css;o.container=o.container||this.element.parent();parent=o.container;self._fixIE(elem0);self._old={position:elem0.css("position"),left:elem0.css("left"),top:elem0.css("top"),display:elem0.css("display"),visibility:elem0.css("visibility"),width:el.style.width,height:el.style.height};if(url){el.src=o.temporaryUrl||""}self._min=state==="minimized"||state===MIN;self._max=state==="maximized"||state===MAX;self._opened=state&&state!=="closed";self._oldDad=el.parentNode;self._next=self._oldDad?el.nextSibling:null;self._dad=parent;elem0=$("<div />");this.element.contents().appendTo(elem0);el=elem=this.element;elem.css({zIndex:o.zIndex||1e3,outline:0}).attr("tabIndex",o.tabIndex).keydown(function(e){if(o.closeOnEscape&&e.keyCode===$.ui.keyCode.ESCAPE){self.close(e);e.preventDefault()}if(e.keyCode!==$.ui.keyCode.TAB){return}self._tabTime=(new Date).getTime();if(!self._modal&&!self._max){return}var min,max,ti,next,iNext=-1,big=999999,iMin=big,iMax=-1,targ=e.target,ti0=self._getTabIndex(targ),shift=e.shiftKey,tabs=$(":tabbable",elem[0]),len=tabs.length,i=len;while(i-- >0){ti=self._getTabIndex(el=tabs[i]);if(ti>iMax){iMax=ti;max=el}if(ti<=iMin){iMin=ti;min=el}if(ti===ti0){if(!next){next=el===targ;if(!next){iNext=i}}else if(iNext<0){iNext=i}}}if(iNext<0){i=len}iMin=shift?-1:big;while(i-- >0){ti=self._getTabIndex(tabs[i]);if(ti>ti0&&ti<iMin&&!shift||ti<ti0&&ti>iMin&&shift){iMin=ti;iNext=i}}max=max||elem[0];min=min||max;self._nextTabElem=iNext>=0?tabs[iNext]:shift?max:min;if(targ===elem[0]||targ===min&&shift||targ===max&&!shift){_stopEvt(e);el=shift?max:min;try{el.focus()}catch(ex){}}}).mousedown(function(e){self.moveToTop(e)});el.addClass(css.dialog);if(o.dialogClass){el.addClass(o.dialogClass)}elem0.show().addClass(css.content).appendTo(el);if(url!==null){elem0[0].src=url;elem0.addClass(css.contentIframe)}self._modal=self._hasFocus=false;self._lastFoc="blur";self._doHeader();self._doFooter();self._doDraggable();self._doResizable();if(self._min){self._onMin(true,true,true)}if(self._max){o.pinned=false;self._onMax(true,true,true)}if(o.pinned){self._onPin(true,true,true)}if(self._opened){self._open()}else{elem.hide()}self._created=true;self._save()},_fixIE:function(elem){elem=elem.find("*");var n,e,i=elem.length;while(i-- >0){e=elem[i];n=e.nodeName;if(n==="/INPUT"||n==="/IMG"){e.parentNode.removeChild(e)}}},destroy:function(){var self=this,elem0=this.element.children(".ui-igdialog-content");this.element.stop(true,true);this._doClose(null,true);if(self._winResize){$(window).unbind("resize",self._winResize)}this.element.children(".ui-igdialog-header").remove();this.element.children(".ui-igdialog-footer").remove();elem0.contents().unwrap();this.element.removeClass(self.css.dialog).css(self._old);if(this.options.draggable){this.element.draggable("destroy")}if(this.options.resizable){this.element.resizable("destroy")}this.element.unbind();this._superApply(arguments);return this},state:function(state){if(!arguments.length){return this.options.state}if((state==="minimized"||state===MIN)&&(!this._min||!this._opened)){if(!this._min){this._minimize()}else{this._open(null,1)}}if((state==="maximized"||state===MAX)&&(!this._max||!this._opened)){if(!this._max){this._maximize()}else{this._open(null,1)}}if((state==="opened"||state===OPEN)&&(this._min||this._max||!this._opened)){this._onMin();this._onMax();this._open();this.options.state=state}if((state==="closed"||!state)&&(this._min||this._max||this._opened)){this._onMin();this._onMax();this.close()}return this},mainElement:function(){return this.element},close:function(e){if(this._opened){this._doClose(e)}return this},open:function(){return this._open(null,1)},minimize:function(){if(!this._min){this._minimize()}return this},maximize:function(){if(!this._max){this._maximize()}return this},restore:function(){if(this._max){this._onMax()}if(this._min){this._onMin()}this._fixState();return this},pin:function(){if(!this.options.pinned){this._pin()}return this},unpin:function(){if(this.options.pinned){this._pin()}return this},getTopModal:function(){return _modals[_modals.length-1]},isTopModal:function(){return this.getTopModal()===this},moveToTop:function(e){var src,name,self=this,o=self.options,zi=o.zIndex,elem=self.element,zi0=self._created?null:zi,modal=o.modal,elem0=this.element[0],scrollTop=elem0.scrollTop,scrollLeft=elem0.scrollLeft;if($.ig&&$.ig.util&&$.ig.util.evtButton(e)){return}zi=zi||1e3;src=e?e.target:null;if(_isSrc(self._header,src)||_isSrc(self._footer,src)){name=src.nodeName;if(name!=="INPUT"&&name!=="BUTTON"){_stopEvt(e);self._setFocus()}}else if(e&&!this._hasFocus){self._setFocus()}_maxZ=Math.max(zi0||zi,_maxZ);if(o.pinned){return self}if(modal&&self._lastZ){elem=self._modalDiv;if(elem&&elem[0].offsetWidth<10){self._onResize()}return self}if(_lastTop===self&&(zi0||zi)>=_maxZ){return self}if(_lastTop&&!zi0){_lastTop.element.css("zIndex",_lastTop._lastZ||-1);_lastTop._save()}if(_lastZ>=_maxZ){_maxZ++}if(modal&&!zi0){_maxZ++;_maxZ++}_lastTop=self;self._lastZ=_lastZ=zi0||(modal||_modals.length>0?_maxZ:zi);if(!zi0){elem.css("zIndex",zi0||_maxZ);self._save()}elem0.scrollTop=scrollTop;elem0.scrollLeft=scrollLeft;if(modal){self._doModal(_maxZ)}return self},content:function(newContent){if(arguments.length===0){return this.element.children(".ui-igdialog-content")}this.element.children(".ui-igdialog-content").html(newContent)},_save:function(){var str,input,pos,o=this.options,name=o.inputName;if(!name){return}input=$('input[name="'+name+'"]');if(input.length===0){input=input.parents("form")[0]||document.forms[0];if(!input){return}input=$('<input type="hidden" name="'+name+'" />').appendTo(input)}str="s"+(o.pinned?"1":"")+(this._opened?this._min?2:this._max?3:1:0)+(o.width?":w"+o.width:"")+(o.height?":h"+o.height:"")+(":z"+this.element.css("zIndex")||o.zIndex);pos=o.position;if(pos&&pos.length===2){str+=":p"+pos[0]+","+pos[1]}input.val(str)},_open:function(e,raiseEvt){var self=this,o=self.options,elem=self.element,anim=self._min?null:o.openAnimation,arg={action:"open",owner:this};if(self._opened&&self._vis||raiseEvt&&!self._fireState(e,true,arg)){return self}if(!o.pinned){elem.css("position","absolute")}if(o.width!==null){elem.show()}self._opened=true;self._doSize(1);if(anim){if(typeof anim==="string"){self.moveToTop(true);elem.hide().show(anim,function(){self._trigger("animationEnded",e,arg)})}else{if(typeof anim!=="object"){anim={easing:anim}}anim.complete=function(){self._trigger("animationEnded",e,arg)};self.moveToTop(true);elem.hide(0).show(anim)}}else{self.moveToTop(true)}self._vis=true;_visCount++;self._trackFocus(elem);self._fixState();if(raiseEvt){self._fireState(e,false,arg)}self._save();return self},_initContainer:function(container,change){if(container){if(typeof container==="string"){container=$(container)}if(container&&container[0]){container=container[0]}}if(!container||!container.parentNode){container=this.element.parents("form")[0]||document.body}else if(container.nodeName!=="BODY"){var style=container.style,pos=style?style.position:null;if(style&&(!pos||pos==="static")){style.position="relative"}}if(change){this.element.appendTo(container)}return container},_fixState:function(){this.options.state=this._opened?this._min?"minimized":this._max?"maximized":"opened":"closed"},_minimize:function(e){return this._doState(e,{action:this._min?"restore":"minimize"},e?"minimize":null,"_onMin",true)},_maximize:function(e){return this._doState(e,{action:this._max?"restore":"maximize"},e?"maximize":null,"_onMax",true)},_pin:function(e){return this._doState(e,{action:this.options.pinned?"unpin":"pin"},e?"pin":null,"_onPin")},_close:function(e){return this._opened?this.close(e):this._open(e)},_getTabIndex:function(e){return isNaN(e=parseInt(e.tabIndex,10))||e<1?0:e},_doHeader:function(){var button,id,evts,i=4,self=this,header=self._header,o=self.options,txt=o.headerText,css=self.css;if(header){header.remove()}delete self._minHW;header=self._header=_notab($("<div />").addClass(css.header).css("display","block").prependTo(self.element)).dblclick(function(e){var dbl=o.enableDblclick;if(!dbl){return}if(self._min){self._doState(e,{action:"restore"},null,"_onMin",true)}else if(dbl===true||dbl==="auto"&&o.showMaximizeButton){self._doState(e,{action:self._max?"restore":"maximize"},null,"_onMax",true)}});if(o.imageClass){self._img=$("<span />").addClass(css.headerImage).addClass(o.imageClass).html("&nbsp;").appendTo(header)}self._headerText=$("<span />").addClass(css.headerText).html(txt||"&nbsp;").appendTo(header);evts={mouseover:function(){$(this).addClass(css.headerButtonHover)},mouseleave:function(){$(this).removeClass(css.headerButtonHover)},mousedown:function(e){this._mdb=$.ig&&$.ig.util&&$.ig.util.evtButton(e)},click:function(e){if(!e||this._mdb){return}try{self["_"+$(this).attr("data-id")](e)}catch(ex){}$(this).removeClass(css.headerButtonHover);_stopEvt(e)},touchstart:function(e){e.stopPropagation()},touchmove:function(e){_stopEvt(e)}};while(i-- >=0){if(i===3&&o.showCloseButton){id="close"}else if(i===2&&o.showMaximizeButton){id="maximize"}else if(i===1&&o.showMinimizeButton){id="minimize"}else{id=i===0&&o.showPinButton?"pin":null}if(id){button=$("<a />").addClass(css.headerButton+" "+css[id]).attr("data-id",id).attr("href","#").attr("role","button").bind(evts).appendTo(header);$("<span />").addClass(css[id+"Icon"]).appendTo(button);self._setButtonAttributes(button,i===3?CLOSE:i===2?MAX:i===1?MIN:PIN)}}if(!o.showHeader){header.hide()}},_doFooter:function(){var self=this,o=self.options,txt=o.footerText,css=self.css;if(self._footer){self._footer.remove();delete self._footer}if(o.showFooter){self._footer=_notab($("<div />").addClass(css.footer).css("display","block").html(txt||"&nbsp").appendTo(self.element))}},_onMin:function(e,noSize,noFocus){var but,o=this.options,bar=this._footer,css=this.css,header=this._header,min=e&&e.type?!this._min:!!e;if(min===this._min&&this._created){return}this._min=min;if(min&&o.pinOnMinimized){this._onPin(min,true,true)}but=header.find("."+css.minimize);but.find("*").removeClass(min?css.minimizeIcon:css.restoreIcon).addClass(min?css.restoreIcon:css.minimizeIcon);if(e&&e.type&&min&&this._max){this._onMax(false,true,true)}this._setButtonAttributes(but,min?RESTORE:MIN);if(min){header.addClass(css.headerMinimized);if(bar){bar.hide()}}else{header.removeClass(css.headerMinimized);if(bar){bar.show()}}if(!noSize&&this._vis){this._doSize()}if(!noFocus&&this._vis){this._setFocus()}this._save()},_onMax:function(e,noSize,noFocus){var but,o=this.options,header=this._header,css=this.css,max=e&&e.type?!this._max:!!e;if(max===this._max&&this._created){return}if(max){if(this._min){this._onMin(false,true,true)}if(o.pinned){this._onPin(false,true,true)}}this._max=max;if(!max){this._restoreHtml()}else{if(!this.element.parent().is(document.body)){this._originalParent=this.element.parent();this.element.appendTo(document.body)}}but=header.find("."+css.maximize);but.find("*").removeClass(max?css.maximizeIcon:css.restoreIcon).addClass(max?css.restoreIcon:css.maximizeIcon);this._setButtonAttributes(but,max?RESTORE:MAX);if(max){header.addClass(css.unmovable)}else{header.removeClass(css.unmovable)}if(!noSize&&this._vis){this._doSize()}if(!noFocus&&this._vis){this._setFocus()}this._save()},_onPin:function(e,noSize,noFocus){var but,elem,parent,dad,pos,old=this._old,next=this._next,css=this.css,header=this._header,o=this.options,pin=e&&e.type?!o.pinned:!!e;if(pin===o.pinned&&this._created){return}o.pinned=pin;but=header.find("."+css.pin);but.find("*").removeClass(pin?css.pinIcon:css.unpinIcon).addClass(pin?css.unpinIcon:css.pinIcon);if(this._max&&pin){this._onMax(false,false,true)}this._setButtonAttributes(but,pin?UNPIN:PIN);if(pin){header.addClass(css.unmovable)}else{header.removeClass(css.unmovable)}elem=this.element;if(pin){pos=old.position;if(this._resize&&(pos==="static"||!pos)){pos="relative"}this._pinPos=pos={position:pos,left:old.left,top:old.top}}else{pos={position:"absolute"}}elem.css(pos);parent=elem.parent()[0];dad=pin?this._oldDad:this._dad;if(dad&&!$(dad).is(parent)){if(pin&&next&&next.parentNode===dad){elem.insertBefore(next)}else{elem.appendTo(dad)}}if(!noFocus&&this._vis){this._setFocus()}if(!noSize&&this._vis){if(!pin){this._doSize(1)}else{this._doModal()}}this._save()},_doClose:function(e,destroy){var i,self=this,elem=self.element,arg={action:"close"},o=self.options,anim=self._min||destroy?null:o.closeAnimation;if(!self._opened||!destroy&&!self._fireState(e,true,arg,e?"close":null)){return}self._trackFocus(elem,1);self._restoreHtml();if(_lastTop===self){_lastTop=null}self._fireFoc(false);self._hasFocus=false;delete self._lastZ;self._vis=self._opened=false;if(destroy){o.modal=false}self._doModal();if(anim){if(typeof anim==="string"){elem.hide(anim,function(){self._trigger("animationEnded",e,arg)})}else{if(typeof anim!=="object"){anim={easing:anim}}anim.complete=function(){self._trigger("animationEnded",e,arg)};elem.hide(anim)}}else if(!destroy){elem.hide()}if(!destroy){self._fixState();self._fireState(e,false,arg)}if(--_visCount<1){_visCount=_lastZ=_maxZ=0}else if(_visCount===(i=_modals.length)){_modals[i-1]._setFocus()}self._save()},_fireState:function(e,before,arg,but){if(before){var o=this.options;arg.oldState=o.state;arg.oldPinned=o.pinned;arg.owner=this;if(but){arg.button=but}}return this._created?this._trigger("stateChang"+(before?"ing":"ed"),e,arg):true},_doState:function(e,arg,but,fnName,show){if(this._fireState(e,true,arg,but)){this[fnName](e||{type:1});if(show&&!this._opened){this._open(null,true)}this._fixState();if(this._created){this._trigger("stateChanged",e,arg)}}return this},_fireFoc:function(foc,e){var name=foc?"focus":"blur";if(name!==this._lastFoc){this._trigger(this._lastFoc=name,e,{owner:this});if(this.options.enableHeaderFocus){name=this.css.headerFocus;if(foc){this._header.addClass(name)}else{this._header.removeClass(name)}}}},_trackFocus:function(elem,remove){var self=this,focusEvt=self._focusEvt,track=self.options.trackFocus;if(!focusEvt&&!track){return}if(remove){if(self._focBind){self._focBind.unbind(focusEvt);delete self._focBind}return}if(!focusEvt){focusEvt=function(e){var elems,old=self._focBind,foc=e.type==="focus";if(self._isDatePickerOpened()){return}if(!foc&&old&&elem){elems=elem.find("*").not(old);if(elems.length){self._focBind=old.add(elems);elems.bind(focusEvt)}}self._hasFocus=foc;setTimeout(function(){var focusTo=self.getTopModal(),elem=self.element;if(elem&&focusTo&&!self._hasFocus&&!foc&&_lastTop===self){if(self._max||focusTo===self){focusTo=self._nextTabElem||elem[0]}else{focusTo=self._tabTime&&(new Date).getTime()-self._tabTime<200?elem[0]:null}if(focusTo){self._setFocus(focusTo)}}self._fireFoc(self._hasFocus,e)},50)};focusEvt=self._focusEvt={focus:focusEvt,blur:focusEvt}}if(track&&elem){self._focBind=elem.find("*").add(elem).bind(focusEvt)}},_isDatePickerOpened:function(){return $("#ui-datepicker-div")[0]&&$("#ui-datepicker-div").css("display")==="block"},_setFocus:function(elem){try{if(elem&&$(document.activeElement).closest(".ui-igdialog").is(this.element)){this._hasFocus=true;return}}catch(ex){}var self=this;setTimeout(function(){try{if(!self._hasFocus){if(!self.options.trackFocus){self._hasFocus=true}elem=elem||self.element[0];elem.focus()}}catch(ex){}},100)},_restoreHtml:function(){var html,old=this._oldHtml,parent=this._originalParent;if(parent){this.element.appendTo(parent);this._originalParent=null}if(old){html=old.html;if(html.style){html.style.overflow=old.overflow}html.scrollLeft=old.scrollLeft;html.scrollTop=old.scrollTop;delete this._oldHtml}},_touch:function(elem,name){var start,self=this,evt=function(evt,type){var act,e=evt.originalEvent,touches=e?e.touches:null,one=touches&&touches.length===1;if(one&&type){_stopEvt(evt)}one=one&&type==="move";if(start){start=one?start:null;act=one?"Drag":"Stop"}else if(one){start=true;elem.trigger("mouseover");act="Start"}if(act){e=self.element.data(name);act="_mouse"+act;if(e&&e[act]){evt.pageX=one?touches[0].pageX:0;evt.pageY=one?touches[0].pageY:0;e[act](evt)}}};elem.bind({touchstart:function(e){evt(e,"start")},touchmove:function(e){evt(e,"move")},touchend:function(e){evt(e)}})},_doDraggable:function(){var self=this,o=self.options,elem=self.element;if(elem.draggable&&o.draggable){self._touch(self._header,"draggable");elem.draggable({cancel:".ui-igdialog-content, .ui-igdialog-headerbutton",handle:".ui-igdialog-header",containment:"document",start:function(){if(o.pinned||self._max){return false}$(this).addClass(self.css.dragging)},stop:function(e,ui){var doc=$(document);o.position=[ui.position.left-doc.scrollLeft(),ui.position.top-doc.scrollTop()];$(this).removeClass(self.css.dragging);self._save()}})}},_doResizable:function(){var elems,r,i=0,self=this,o=self.options,elem=self.element;if(!elem.resizable){return}self._resize=o.resizable;if(!self._resize){return}elem.css("position",elem.css("position")).resizable({cancel:"."+self.css.content,containment:"document",alsoResize:self.element.children(".ui-igdialog-content"),maxWidth:o.maxWidth,maxHeight:o.maxHeight,minWidth:self._minWidth(),minHeight:o.minHeight,handles:typeof o.resizable==="string"?o.resizable:"n,e,s,w,se,sw,ne,nw",start:function(){$(this).addClass(self.css.resizing);if(o.pinned&&self._pinPos){elem.css(self._pinPos)}},resize:function(){self._fixCaption();if(o.pinned&&self._pinPos){elem.css(self._pinPos)}},stop:function(){$(this).removeClass(self.css.resizing);o.height=$(this).height();o.width=$(this).width();self._save()}}).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se");r=elem.data("resizable")||elem.data("ui-resizable");if(r){if(!r._dragFix){r._dragFix=r._mouseDrag;r._mouseDrag=function(e){var x,y,d=r.parentData;if(d&&e){x=e.pageX;y=e.pageY;if(x<=d.left||y<=d.top||x>=d.left+d.width||y>=d.top+d.height){return false}}return r._dragFix(e)}}elems=r._handles;i=elems.length}while(i-- >0){self._touch($(elems[i]),"resizable")}},_toPx:function(val,height){if(typeof val==="number"){return val}if(!val){return height?val:0}val=val.toString();var elem,num=parseInt(val,10);if(isNaN(num)){return 0}if(val.indexOf("m")>0||val.indexOf("e")>0||val.indexOf("i")>0||val.indexOf("t")>0){elem=$("<div />").css({visibility:"hidden",width:val}).appendTo(this._dad);num=elem.width();elem.remove()}else if(val.indexOf("%")>0){val=this._winRect(1);val=height?val.height:val.width;return Math.floor(num*val/100)}return num},_doSize:function(fixPos){var self=this,o=self.options,max=self._max,pos=max?[0,0]:o.position,resize=self._resize?".ui-resizable-handle":null,elem0=self.element.children(".ui-igdialog-content"),elem=self.element;if(resize){if(self._min||max){$(resize,elem).hide()}else{$(resize,elem).show()}}self._headerText.css("width",0);if(self._min){elem0.hide();self._fixCaption(elem)}else if(max){elem0.show().css({width:"auto",height:"auto"});elem.css({width:100,height:50})}else if(o.width!==null){this._doSizePX(elem0,elem,Math.max(self._minWidth(),self._toPx(o.width)),self._toPx(o.height,true),o.minHeight);if(resize){this._doResizable()}}if(o.width===null){this._fixCaption(elem);elem.show()}if(!o.pinned&&(fixPos||max||self._oldMax)){self._oldMax=max;if(max){self._onResize()}if(elem.position){if(pos){if(pos.left!==undefined&&pos.top!==undefined){pos=[pos.left,pos.top]}if(pos&&pos.length>1){if(typeof pos[0]!=="number"){pos[0]=parseInt(pos[0])}if(typeof pos[1]!=="number"){pos[1]=parseInt(pos[1])}if(isNaN(pos[0])||isNaN(pos[1])){pos={}}else{if($.ig.util.jQueryUIMainVersion<=1&&$.ig.util.jQueryUISubVersion<9){pos={my:"left top",at:"left top",offset:pos[0]+" "+pos[1]}}else{pos={my:"left+"+pos[0]+" top+"+pos[1],at:"left top"}}}}pos=$.extend({},_pos,pos)}elem.css({top:0,left:0}).position(pos||_pos)}}self._doModal();self._save()},_doSizePX:function(elem0,elem,width,height,minHeight){elem0.show().css({width:"auto",height:0,minHeight:0});var zeroHeight=elem.css({width:width,height:"auto",display:"block"}).height();this._fixCaption(elem);if(typeof height==="string"){if(height.indexOf("px")>0){height=parseInt(height,10)}}if(typeof height!=="number"){height=elem0.css("height","auto").height()+zeroHeight}height=Math.max(minHeight,height);elem0.height(Math.max(height-zeroHeight,0));minHeight=height-elem[0].offsetHeight;if(minHeight>0){elem0.height(Math.max(height-zeroHeight+minHeight,0))}},_onResize:function(){var self=this,div=self.isTopModal()?self._modalDiv:null;if(!self._winResize){$(window).bind("resize",self._winResize=function(){setTimeout(function(){self._onResize()},50)})}if(!self._opened||self.options.pinned){return}if(div){div.hide();self._doIframe(div,1)}if(self._max){self._doMaxSize(self.element)}if(div){div.show();self._doIframe(div,1)}},_minHeaderWidth:function(){var outerWidth,elem,width=this._minHW,elems=this._header.children().not(this._headerText),i=elems.length;if(!width){width=3+_getPadding(this._header);while(--i>=0){elem=elems[i];try{outerWidth=$(elem).outerWidth(true)}catch(ex){}width+=1+(outerWidth&&outerWidth>2&&outerWidth<100?outerWidth:elem.offsetWidth)}this._minHW=width}return width},_minWidth:function(){if(!this._minW){this._minW=this._minHeaderWidth()}return Math.max(this.options.minWidth,this._minW)},_fixCaption:function(elem){var width,widths,top,len,topi,j=0,i=-1,header=this._header,cap=this._headerText,minCss=this.css.headerTextMinimized;if(this._min){cap.css("width","").addClass(minCss);if(!elem){return}elem.css({height:"auto",width:"auto",display:"inline-block"});widths=_getPadding(header)+3;cap=header.children();len=cap.length;while(++i<len){widths+=cap[i].offsetWidth+_toPx($(cap[i]),"marginLeft")+_toPx($(cap[i]),"marginRight")}while(j++<2){elem.css("width",widths);widths+=2;i=len;while(i-- >0){topi=cap[i].offsetTop;if(i>0&&i<len-1&&Math.abs(top-topi)>4){break}top=topi}if(i<0){j=4}}return}cap.removeClass(minCss);try{width=header.innerWidth()-3}catch(ex){}if(!width||width>1e3){width=header[0].clientWidth-4}width=Math.max(1,width-this._minHeaderWidth());cap.css("width","auto");if(cap[0].offsetWidth*1.3>width){cap.css("width",width)}},_doMaxSize:function(elem){var html,old=this._oldHtml,elem0=this.element.children(".ui-igdialog-content"),rect=this._winRect(),paddingX=_getPadding(elem),paddingY=_getPadding(elem,1);html=rect.html;if(!old){this._oldHtml=old={html:html,scrollLeft:html.scrollLeft,scrollTop:html.scrollTop};html.scrollLeft=html.scrollTop=0;if(html.style){old.overflow=html.style.overflow;html.style.overflow="hidden";if(rect.maxWidth>rect.width||rect.maxHeight>rect.height){rect=this._winRect(1)}}}this._doSizePX(elem0,elem,rect.width-paddingX-1,rect.height-paddingY-1,0)},_winRect:function(sizeOnly){var size,docElem,width,height,widthOk,heightOk,maxWidth=0,maxHeight=0,big=999999,win=window,doc=win.document,body=doc.body,html=body;while(html&&html.nodeName!=="HTML"){html=html.parentNode}if(!html){html=body}docElem=doc.documentElement||html;size=doc.compatMode!=="CSS1Compat"&&$.ig.util.isIE?body:html;width=size.clientWidth;height=size.clientHeight;if(sizeOnly){return{width:width,height:height}}if(width&&width>50){maxWidth=width;maxHeight=height}else{width=height=big}widthOk=html.scrollWidth;heightOk=html.scrollHeight;if(widthOk&&heightOk){maxWidth=Math.max(maxWidth,widthOk);maxHeight=Math.max(maxHeight,heightOk)}maxWidth=Math.max(maxWidth,body.scrollWidth);maxHeight=Math.max(maxHeight,body.scrollHeight);widthOk=body.offsetWidth;heightOk=body.offsetHeight;maxWidth=Math.max(maxWidth,widthOk);maxHeight=Math.max(maxHeight,heightOk);return{width:width===big?widthOk:width,height:height===big?heightOk:height,maxWidth:maxWidth,maxHeight:maxHeight,html:html}},_doIframe:function(div,hide){var src="javascript";if(!_iframe){_iframe=_notab($("<iframe />").attr("frameBorder",0).attr("scrolling","no").attr("src",src+":''").css({position:"absolute",filter:"alpha(opacity=50)",opacity:0}))}if(_iframe.parent()[0]!==div.parent()[0]){_iframe.css({width:"1px",height:"1px",marginLeft:div.css("marginLeft"),marginTop:div.css("marginTop"),left:div.css("left"),top:div.css("top"),zIndex:div.attr("zIndex")-1}).insertBefore(div)}_iframe.css({width:hide?"1px":div.css("width"),height:hide?"1px":div.css("height")})},_doModal:function(zi){var i,on,obj,len=_modals.length,self=this,o=self.options,elem=self.element,div=self._modalDiv;on=o.modal&&!o.pinned&&!self._min&&self._opened;i=$.inArray(self,_modals);if(self._modal===on){if(zi&&div){div.css("zIndex",zi-1);self._onResize()}if(!on&&!_lastTop&&len>0){_modals[len-1].moveToTop()}return}if(i<0&&on){if(len>0){_modals[len-1]._modalDiv.hide()}_modals.push(self)}if(i>=0&&!on){if(i>0&&i+1===len){obj=_modals[i-1]}_modals.splice(i,1)}self._modal=on;if(on){self._modalDiv=div=_notab($("<div />").css({position:"fixed",left:0,top:0,bottom:0,right:0,zIndex:_maxZ-1}).addClass(self.css.overlay).mousedown(function(e){self._setFocus();_stopEvt(e)}).insertBefore(elem))}else{div.remove();_iframe.remove();delete self._modalDiv;if(obj){obj.moveToTop()}}},_setButtonAttributes:function(but,state){state=(state===MIN?"minimize":state===MAX?"maximize":state===RESTORE?"restore":state===CLOSE?"close":state===PIN?"pin":state===UNPIN?"unpin":"open")+"ButtonTitle";var val=this._getLocaleValue(state);but.attr({title:val,longdesc:val,"data-localeid":state,"data-dialog-button":true})},changeLocale:function(){var self=this;this._header.find("[data-dialog-button]").each(function(){var $button=$(this),value=self._getLocaleValue($button.attr("data-localeid"));$button.attr({title:value,longdesc:value})})},_setOption:function(key,val){var pos,size,drag,resize,elem=this.element,o=this.options,container=key==="container";if(key==="mainElement"||key==="imageClass"){throw new Error(this._getLoacleValue("setOptionError")+key)}if(!elem||!key||o[key]===val){return this}if(key==="state"){return this.state(val)}if(key==="pinned"){return this._pin()}if(container){if(o.draggable&&elem.draggable){elem.draggable("destroy");drag=true}if(o.resizable&&elem.resizable){elem.resizable("destroy");resize=true}}this._super(key,val);if(typeof val==="function"){return this}if(container){this._initContainer(val,1);if(drag){this._doDraggable()}if(resize){this._doResizable()}}if(key==="draggable"){if(val){this._doDraggable()}else if(elem.draggable){elem.draggable("destroy")}}if(key==="resizable"){if(val){this._doResizable()}else if(this._resize){this._resize=val;elem.resizable("destroy")}}if(key==="modal"){this._doModal()}if(key.indexOf("Button")>0||key==="image"||key==="headerText"||key==="showHeader"){this._doHeader();size=true}if(key.indexOf("ooter")>0){this._doFooter();size=true}if(key==="tabIndex"){elem.attr("tabIndex",val)}if(key==="zIndex"){elem.css("zIndex",val);this._save()}if(this._vis){pos=key==="position";if(container||size||pos||key.indexOf("idth")>0||key.indexOf("eight")>0){this._doSize(pos||container)}}if(key.indexOf("Foc")>0){this._header.removeClass(this.css.headerFocus);if(key==="trackFocus"&&val!==(this._focBind?true:false)){if(this._opened){this._doClose();this._open()}else{this._open();this._doClose()}}}return this}});$.extend($.ui.igDialog,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI jQuery Popover 21.2.12
 *
 * Copyright (c) 2013-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *  jquery.js
 *  jquery.ui.core.js
 *  jquery.ui.widget.js
 *	infragistics.util.js
 *  infragistics.util.jquery.js
 *  infragistics.ui.widget.js
 */
(function($){$.widget("ui.igPopover",$.ui.igWidget,{css:{baseClasses:"ui-widget ui-igpopover",arrowBaseClass:"ui-igpopover-arrow ui-igpopover-arrow-",closeButtonClass:"ui-icon ui-icon-closethick ui-igpopover-close-button",titleClass:"ui-igpopover-title"},options:{closeOnBlur:true,direction:"auto",directionPriority:["bottom","top","right","left"],position:"auto",width:null,height:null,minWidth:60,maxWidth:200,maxHeight:200,animationDuration:150,contentTemplate:null,selectors:null,headerTemplate:{closeButton:false,title:null},showOn:"mouseenter",containment:null,appendTo:"body"},events:{showing:"showing",shown:"shown",hiding:"hiding",hidden:"hidden"},_create:function(){this._target=this.options.selectors===null||this.options.selectors===undefined?this.element:null;this._arrowDir={bottom:"top",top:"bottom",right:"left",left:"right"};this._positions=["balanced","start","end"];this._visible=false;this._useDocumentBoundary=false;$(window).on("resize.popover",$.proxy(this._resizeHandler,this))},_createWidget:function(options,element){if(options&&options.directionPriority!==this.options.directionPriority){options.directionPriority=this._normalizePriority(options.directionPriority)}this._superApply(arguments);this.element=$(element);if(element&&element.nodeType!==undefined){this._renderPopover()}},_setOption:function(key,value){this._super(key,value);switch(key){case"direction":this._resizeHandler();break;case"directionPriority":this.options.directionPriority=this._normalizePriority(value);break;case"headerTemplate":case"selectors":case"width":case"height":case"maxWidth":case"maxHeight":case"minWidth":case"showOn":throw new Error(this._getLocaleValue("popoverOptionChangeNotSupported")+" "+key);default:break}},destroy:function(){this._detachEventsFromTarget();$(window).off("resize.popover",this._resizeHandler);this.popover.remove();this._superApply(arguments);return this},id:function(){return this.element[0].id},container:function(){return this.contentInner},show:function(trg,content){var target=trg||this._target;if(content){this._setNewContent(content)}if(target===null){throw new Error(this._getLocaleValue("popoverShowMethodWithoutTarget"))}this._openPopover(target,true)},hide:function(){this._closePopover(true)},getContent:function(){return this.contentInner.html()},setContent:function(newCnt){if(typeof newCnt==="string"){this._setNewContent(newCnt)}},target:function(){if(this._currentTarget){return this._currentTarget}return null},getCoordinates:function(){var currPosition={left:0,top:0};currPosition.left=this.popover.css("left");currPosition.top=this.popover.css("top");return currPosition},setCoordinates:function(pos){this.popover.css({top:pos.top,left:pos.left})},_renderPopover:function(){this.popover=$("<div></div>").addClass(this.css.baseClasses);if(this.id()){this.popover.attr("id",this.id()+"_popover")}if(this.options.direction!=="auto"){this.arrow=$("<div></div>").addClass(this.css.arrowBaseClass+this._arrowDir[this.options.direction]).appendTo(this.popover);if(this.id()){this.arrow.attr("id",this.id()+"_popover_arrow")}}this.popover.appendTo(this.options.appendTo);this._attachEventsToTarget();this._createContentDiv()},_createContentDiv:function(){var cnt,currContent,rightMargin,isTouchDeviceWithIE=this._isTouchDevice()&&$.ig.util.isIE;cnt=$("<div></div>").css("position","relative").css("max-width",this.options.maxWidth).css("max-height",this.options.maxHeight).css("min-width",this.options.minWidth).css("width",isTouchDeviceWithIE?"auto":this.options.width||"auto").css("height",isTouchDeviceWithIE?"auto":this.options.height||"auto").addClass("ui-widget-content ui-corner-all").appendTo(this.popover);if(this.id()){cnt.attr("id",this.id()+"_popover_contentFrame")}if(this.options.headerTemplate!==null){if(this.options.headerTemplate.closeButton){var closeBtn=$("<div></div>").addClass(this.css.closeButtonClass).bind("click.popover",$.proxy(this._closeBtnClick,this)).appendTo(cnt);if(this.id()){closeBtn.attr("id",this.id()+"_popover_closeBtn")}}if(this.options.headerTemplate.title!==null){var title=$("<div></div>").addClass(this.css.titleClass).html(this.options.headerTemplate.title).appendTo(cnt);if(this.id()){title.attr("id",this.id()+"_popover_title")}}}currContent=this.options.contentTemplate;if((typeof currContent==="string"||!currContent)&&this._target){currContent=this.options.contentTemplate||this._target[0].title||""}else if(this.options.selectors!==null&&!this._target&&!currContent){this.options.contentTemplate=function(){return $(this).attr("title")}}else if(typeof currContent==="function"&&this._target){currContent=this._getContentTemplate(this._target[0])}rightMargin=this.options.headerTemplate.closeButton&&(this.options.headerTemplate.title===null||this.options.headerTemplate.title==="")?$(".ui-icon").width():null;this.contentInner=$("<div></div>").css("position","relative").css("margin-right",rightMargin).html(currContent).appendTo(cnt);if(this.id()){this.contentInner.attr("id",this.id()+"_popover_contentInner")}$("<div></div>").css("clear","both").appendTo(cnt)},_updateArrowDiv:function(nDir,trg){var conDiv=this.contentInner.parent(),dims;if(!this.arrow){this.arrow=$("<div></div>").addClass(this.css.arrowBaseClass+this._arrowDir[nDir]).appendTo(this.popover);if(this.id()){this.arrow.attr("id",this.id()+"_popover_arrow")}}else{this.arrow.removeClass("ui-igpopover-arrow-left "+"ui-igpopover-arrow-right "+"ui-igpopover-arrow-bottom "+"ui-igpopover-arrow-top").addClass(this.css.arrowBaseClass+this._arrowDir[nDir])}dims=this._getHiddenElementsDimensions([this.arrow,conDiv],trg);switch(nDir){case"top":conDiv.css({left:"",top:dims[0].height*-1,"float":""});this.arrow.css({left:"",top:"","float":""});break;case"bottom":conDiv.css({left:"",top:dims[0].height,"float":""});this.arrow.css({left:"",top:"","float":""});break;case"left":conDiv.css({left:dims[0].width*-1,top:"","float":"left"});this.arrow.css({left:"",top:"","float":"left"});break;case"right":conDiv.css({left:dims[0].width,top:"","float":"left"});this.arrow.css({left:"",top:"","float":"left"});break}this.oDir=nDir},_targetMouseLeave:function(){this._hoveredTarget=null;if(this.options.closeOnBlur===true){this._closePopover()}},_targetMouseMove:function(trg){var self=this;if(this._target){this._openPopover($(this._target))}else{$(trg.currentTarget).addClass("is-hover");setTimeout(function(){if(self._hoveredTarget===trg.currentTarget){self._openPopover($(trg.currentTarget));$(trg.currentTarget).removeClass("is-hover")}},self.options.animationDuration);this._hoveredTarget=trg.currentTarget}},_targetClick:function(trg){var t=this._target||trg.currentTarget;if($(t).data("onFocus")&&this.container().is(":visible")){this._closePopover();$(t).data("onFocus",false)}else{this._openPopover($(t));$(t).focus();$(t).data("onFocus",true)}},_targetBlur:function(trg){var t=this._target||trg.currentTarget,self=this;setTimeout(function(){if($(t).data("onFocus")){if(self.options.closeOnBlur===true){self._closePopover();$(t).data("onFocus",false)}}},10)},_focusin:function(trg){var t=this._target||trg.currentTarget;this._openPopover($(t))},_focusout:function(){if(this.options.closeOnBlur===true){this._closePopover()}},_closeBtnClick:function(event){this._closePopover();event.stopPropagation()},_resizeHandler:function(){if(this._visible&&this._currentTarget){this._positionPopover(this._currentTarget)}},_attachEventsToTarget:function(){var self=this,t=this._target,showEvt,hideEvt,targetShowEvt,targetHideEvt;switch(this.options.showOn){case"click":showEvt="click.popover";hideEvt="blur.popover";targetShowEvt=self._targetClick;targetHideEvt=self._targetBlur;break;case"focus":showEvt="focusin.popover";hideEvt="focusout.popover";targetShowEvt=self._focusin;targetHideEvt=self._focusout;break;case"mouseenter":showEvt="mouseenter.popover";hideEvt="mouseleave.popover";targetShowEvt=self._targetMouseMove;targetHideEvt=self._targetMouseLeave;break;default:return}if(t&&(window.HTMLElement!==undefined&&(t instanceof HTMLElement||t instanceof $)&&showEvt||typeof t[0]==="object"&&t[0].nodeType===1&&typeof t[0].style==="object"&&typeof t[0].ownerDocument==="object")){$(t).unbind(showEvt).bind(showEvt,$.proxy(targetShowEvt,this));$(t).unbind(hideEvt).bind(hideEvt,$.proxy(targetHideEvt,this))}else if(this.options.selectors&&showEvt){this.element.find(self.options.selectors).addBack().each(function(){var target=$(this)[0];if(target===self.element[0]){return}$(target).unbind(showEvt).bind(showEvt,$.proxy(targetShowEvt,self));$(target).unbind(hideEvt).bind(hideEvt,$.proxy(targetHideEvt,self))})}},_detachEventsFromTarget:function(){var t=this._target,self=this;if(t&&(window.HTMLElement!==undefined&&(t instanceof HTMLElement||t instanceof $)||typeof t[0]==="object"&&t[0].nodeType===1&&typeof t[0].style==="object"&&typeof t[0].ownerDocument==="object")){$(t).unbind(".popover")}else if(this.options.selectors){this.element.find(self.options.selectors).addBack().each(function(){var target=$(this);$(target).unbind(".popover")})}},_positionPopover:function(trg){var i=0,fn,fnRes;if(this.options.direction==="auto"){do{this._updateArrowDiv(this.options.directionPriority[i],trg);fn="_"+this.options.directionPriority[i]+"Position";fnRes=this[fn](trg);i++}while(fnRes===false&&i<this.options.directionPriority.length);if(fnRes===false&&!this.options.containment){i=0;this._useDocumentBoundary=true;do{this._updateArrowDiv(this.options.directionPriority[i],trg);fn="_"+this.options.directionPriority[i]+"Position";fnRes=this[fn](trg);i++}while(fnRes===false&&i<this.options.directionPriority.length)}if(fnRes===false){return}}else{this._updateArrowDiv(this.options.direction,trg);fn="_"+this.options.direction+"Position";this[fn](trg)}},_findProperPosition:function(dir,x,trg){var fnRes,y,cDim,cPos,win=$(window),trgFDim,wScroll,boundary,countainmentBoundary,leftOffset,$containment,oParent=trg.offsetParent(),useParentOffset=false,rightOffset=$.ig.util.offset(trg).left+trg.outerWidth(),parentRightOffset=$.ig.util.offset(oParent).left+oParent.outerWidth();if(dir==="left"){cPos="left";cDim="outerWidth";wScroll=win.scrollLeft()}else{cPos="top";cDim="outerHeight";wScroll=win.scrollTop()}boundary=wScroll+(cDim==="outerWidth"?win.width():win.height());$containment=this.options.containment;if(this.options.containment){countainmentBoundary=$.ig.util.offset($containment)[cPos];if(cDim==="outerWidth"){countainmentBoundary=countainmentBoundary+$containment.outerWidth()}else{countainmentBoundary=countainmentBoundary+$containment.outerHeight()}if(boundary>countainmentBoundary){boundary=countainmentBoundary}}if($.ig.util.offset(trg)[cPos]+trg[cDim]()>boundary){trgFDim=boundary-$.ig.util.offset(trg)[cPos]}else if(cPos==="left"&&$.ig.util.offset(trg)[cPos]<$.ig.util.offset(oParent)[cPos]&&rightOffset>parentRightOffset){trgFDim=oParent[cDim]();useParentOffset=true}else if(cPos==="left"&&$.ig.util.offset(trg)[cPos]<parentRightOffset&&rightOffset>parentRightOffset){trgFDim=parentRightOffset-$.ig.util.offset(trg)[cPos]}else if(cPos==="left"&&$.ig.util.offset(trg)[cPos]<$.ig.util.offset(oParent)[cPos]&&$.ig.util.offset(oParent)[cPos]<rightOffset){trgFDim=rightOffset-$.ig.util.offset(oParent)[cPos];useParentOffset=true}else{trgFDim=trg[cDim]()}if(trgFDim>this.popover[cDim]()){leftOffset=useParentOffset?$.ig.util.offset(oParent)[cPos]:$.ig.util.offset(trg)[cPos];y=leftOffset+trgFDim/2-this.popover[cDim]()/2;fnRes=dir==="left"?this._checkCollision(x,y,trg,this.options.direction!=="auto",true):this._checkCollision(y,x,trg,this.options.direction!=="auto",true)}else{fnRes=this._cyclePossiblePositions(trg,dir,cPos,cDim,trgFDim,useParentOffset,x)}if(fnRes===true){this._adjustArrowPosition(trg,dir,cPos,cDim,trgFDim,useParentOffset)}return fnRes},_cyclePossiblePositions:function(trg,dir,cPos,cDim,trgFDim,useParentOffset,x){var i=0,y,tPos,fnRes;if(this.options.position==="auto"){do{tPos=this._positions[i];y=this._getCounterPosition(trg,trgFDim,tPos,cPos,cDim,useParentOffset);fnRes=dir==="left"?this._checkCollision(x,y,trg,false,false):this._checkCollision(y,x,trg,false,false)}while(fnRes===false&&++i<this._positions.length);if(!fnRes&&this.options.direction!=="auto"){tPos=this._positions[0];y=this._getCounterPosition(trg,trgFDim,tPos,cPos,cDim,useParentOffset);fnRes=dir==="left"?this._checkCollision(x,y,trg,false,true):this._checkCollision(y,x,trg,false,true)}}else{y=this._getCounterPosition(trg,trgFDim,this.options.position,cPos,cDim,useParentOffset);fnRes=dir==="left"?this._checkCollision(x,y,trg,true,false):this._checkCollision(y,x,trg,true,false)}return fnRes},_getCounterPosition:function(trg,trgFDim,tPos,cPos,cDim,useParentOffset){var y,offset=useParentOffset?$.ig.util.offset(trg.offsetParent())[cPos]:$.ig.util.offset(trg)[cPos];switch(tPos){case"balanced":y=offset+trgFDim/2-this.popover[cDim]()/2;break;case"start":y=offset;break;case"end":y=offset-this.popover[cDim]()+trgFDim;break}return y},_topPosition:function(trg){var top=$.ig.util.offset(trg).top-this.popover.outerHeight(),parentTop=$.ig.util.offset(trg.offsetParent()).top-this.popover.outerHeight();if(top<parentTop){top=parentTop}return this._findProperPosition("left",top,trg)},_bottomPosition:function(trg){var bottom=$.ig.util.offset(trg).top+trg.outerHeight(),parentBottom=$.ig.util.offset(trg.offsetParent()).top+trg.offsetParent().outerHeight();if(bottom>parentBottom){bottom=parentBottom}return this._findProperPosition("left",bottom,trg)},_leftPosition:function(trg){var left=$.ig.util.offset(trg).left-this.popover.outerWidth(),parentLeft=$.ig.util.offset(trg.offsetParent()).left-this.popover.outerWidth();if(left<parentLeft){left=parentLeft}return this._findProperPosition("top",left,trg)},_rightPosition:function(trg){var right=$.ig.util.offset(trg).left+trg.outerWidth(),parentRight=$.ig.util.offset(trg.offsetParent()).left+trg.offsetParent().outerWidth();if(right>parentRight){right=parentRight}return this._findProperPosition("top",right,trg)},_checkCollision:function(top,left,trg,allowOverlap,fromDirection){var tfullw=this.popover.outerWidth(),tfullh=this.popover.outerHeight(),win=$(window),wh,ww,os,$containment,rightBoundary,bottomBoundary,leftBoundary,topBoundary;ww=win.width()+win.scrollLeft();wh=win.height()+win.scrollTop();rightBoundary=ww;bottomBoundary=wh;leftBoundary=win.scrollLeft();topBoundary=win.scrollTop();$containment=this.options.containment;if($containment){if(leftBoundary<$.ig.util.offset($containment).left){leftBoundary=$.ig.util.offset($containment).left}if($.ig.util.offset($containment).left+$containment.outerWidth()<rightBoundary){rightBoundary=$.ig.util.offset($containment).left+$containment.outerWidth()}if(bottomBoundary>$.ig.util.offset($containment).top+$containment.outerHeight()){bottomBoundary=$.ig.util.offset($containment).top+$containment.outerHeight()}if(topBoundary<$.ig.util.offset($containment).top){topBoundary=$.ig.util.offset($containment).top}}if(this._useDocumentBoundary){leftBoundary=0;rightBoundary=$(document).width();bottomBoundary=$(document).height();topBoundary=0}if(allowOverlap){if(left<leftBoundary){left=leftBoundary}if(top<topBoundary){top=topBoundary}if(this.oDir==="right"&&$containment&&left+trg.outerWidth()>rightBoundary){left=rightBoundary-trg.outerWidth()}}if($.ig.util.offset(trg).left+tfullw/2>rightBoundary&&this.options.direction!=="right"){left=rightBoundary-tfullw}if($.ig.util.offset(trg).top+tfullh+this.arrow.height()>bottomBoundary&&this.oDir==="bottom"||$.ig.util.offset(trg).top-tfullh-this.arrow.height()<topBoundary&&this.oDir==="top"){if(this.options.selectors){return false}}if(left<leftBoundary||left+tfullw>rightBoundary||top<topBoundary||top+tfullh>bottomBoundary){if(!fromDirection||this.options.direction==="auto"){return false}}if(!$(this.options.appendTo).is("body")&&this._target){os=$.ig.util.getRelativeOffset(this.popover);top=top-os.top;left=left-os.left<0?0:left-os.left}this.popover.css({top:top,left:left});return true},_normalizePriority:function(priority){var dp=["bottom","top","right","left"],np=[],i;if(!$.isArray(priority)){return dp}for(i=0;i<priority.length;i++){if($.inArray(priority[i].toLowerCase(),dp)>-1){np.push(priority[i])}}return np.length?np:dp},_openPopover:function(trg,skipEvents){var args,noCancel,val=this.getContent(),self=this;args={element:trg,content:val,popover:this.popover,owner:this};$(this.popover).data("isAnimating",true);noCancel=skipEvents||this._trigger(this.events.showing,this,args);if(noCancel===true){self._restoreOriginalTitle(self._currentTarget);if(args.content!==val){this._setNewContent(args.content)}else if(typeof this.options.contentTemplate==="function"){args.content=this._getContentTemplate(trg[0]);this._setNewContent(args.content||"")}this._positionPopover(trg);this._currentTarget=trg;$(this.popover).data("isAnimating",false);this.popover.stop(true,true).fadeIn(this.options.animationDuration,function(){self.popover.css("display","block");if(!skipEvents){self._trigger(self.events.shown,self,args)}});this._visible=true;this._useDocumentBoundary=false;this._removeOriginalTitle(trg)}},_closePopover:function(skipEvents){var args,noCancel,self=this;args={element:this._currentTarget,content:this.getContent(),popover:this.popover,owner:this};$(this.popover).data("isAnimating",true);noCancel=skipEvents||this._trigger(this.events.hiding,this,args);if(noCancel===true){$(this.popover).data("isAnimating",false);this.popover.stop(true,true).fadeOut(this.options.animationDuration,function(){self.popover.css("display","none");if(!skipEvents){self._trigger(self.events.hidden,self,args)}});this._visible=false}},_mouseenter:function(e){this._removeOriginalTitle($(e._currentTarget))},_removeOriginalTitle:function(element){while(element.length&&!element.is("body")){if(element.attr("title")){element.data("popover-title",element.attr("title"));element.attr("title","")}element=element.parent()}},_restoreOriginalTitle:function(element){if(element&&element.data("popover-title")){element.attr("title",element.data("popover-title"));element.removeData("popover-title")}},_adjustArrowPosition:function(trg,dir,cPos,cDim,trgFDim,useParentOffset){var offset={left:0,top:0},left,leftOffset=useParentOffset?$.ig.util.offset(trg.offsetParent())[cPos]:$.ig.util.offset(trg)[cPos];if(!$(this.options.appendTo).is("body")&&this._target){offset=$.ig.util.getRelativeOffset(this.popover)}if(dir==="top"){this.arrow.css({top:$.ig.util.offset(trg)[cPos]-parseInt(this.popover.css(cPos),10)-offset.top+trgFDim/2-this.arrow.height()/2})}else{left=leftOffset-parseInt(this.popover.css(cPos),10)-offset.left+trgFDim/2;left=left<parseInt(this.arrow.css("border-left-width"),10)?parseInt(this.arrow.css("border-left-width"),10):left;this.arrow.css({left:left})}},_getHiddenElementsDimensions:function(elArr,trg){var dim=[],i,elem;if(this.options.containment===null){this.popover.css("left",trg.igPosition().left);this.popover.css("top",trg.igPosition().top)}if(!this._visible){this.popover.show()}for(i=0;i<elArr.length;i++){elem=elArr[i];dim.push({width:elem.outerWidth(),height:elem.outerHeight()})}if(!this._visible){this.popover.hide()}return dim},_getContentTemplate:function(target){var template="";if(target){template=this.options.contentTemplate.call(target)}return template},_setNewContent:function(nc){var newContent=nc;if(nc instanceof $){newContent=nc.html()}else if(typeof nc==="object"){newContent=nc.innerHTML}this.contentInner.html(newContent)},_isTouchDevice:function(){return"ontouchstart"in window||navigator.MaxTouchPoints>0||navigator.msMaxTouchPoints>0}});if(!$.fn.addBack){$.fn.addBack=function(selector){return this.add(selector===null||selector===undefined?this.prevObject:this.prevObject.filter(selector))}}$.extend($.ui.igPopover,{version:"21.2.12"})})($);/*!@license
* Infragistics.Web.ClientUI jQuery Notifier 21.2.12
*
* Copyright (c) 2013-2022 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on:
*  jquery.js
*  jquery.ui.core.js
*  jquery.ui.widget.js
*  infragistics.util.js
*  infragistics.util.jquery.js
*  infragistics.ui.widget.js
*  infragistics.ui.popover.js
*/
(function($){$.widget("ui.igNotifier",$.ui.igPopover,{css:{baseClasses:"ui-widget ui-igpopover ui-ignotify",contentInner:"ui-ignotify-content",inline:"ui-ignotify-inline",iconContainer:"ui-ignotify-icon-container",infoState:"ui-ignotify-info",infoIcon:"ui-icon ui-icon-info",successState:"ui-ignotify-success",successIcon:"ui-icon ui-icon-circle-check",warningState:"ui-ignotify-warn",warningIcon:"ui-icon ui-icon-alert",errorState:"ui-ignotify-error",errorIcon:"ui-icon ui-icon-circle-close"},options:{state:"info",notifyLevel:"success",appendTo:"body",mode:"auto",allowCSSOnTarget:true,showIcon:false,contentTemplate:"<span class='{0}'><span class='{1}'></span></span>{2}",headerTemplate:{closeButton:true,title:null},showOn:"manual",closeOnBlur:false,animationDuration:250,animationSlideDistance:5,selectors:null},inlineStates:["success","error"],_create:function(){this._super();this._setOption("directionPriority",["top","left","right","bottom"]);this._states=["success","info","warning","error"];this._modes=["auto","popover","inline"];this._currentText=this._getDefaultMessageByState(this.options.state)},_getDefaultMessageByState:function(state){return this._getLocaleValue(state+"Msg")},changeLocale:function(){if(this.contentInner.attr("data-default-locale")){this._currentText=this._getDefaultMessageByState(this.options.state);this._setNewContent(this._getTemplate())}},_setState:function(value,message){if($.inArray(value,this._states)===-1){throw new Error(this._getLocaleValue("notSupportedState"))}if(message!==undefined){this._currentText=message;this.contentInner.removeAttr("data-default-locale")}else{this.contentInner.attr("data-default-locale",true)}if(this.options.state!==value){this._currentText=message!==undefined?this._currentText:this._getDefaultMessageByState(value);this._previousState=this.options.state;this.options.state=value;if(this._visible){this._setTargetState()}if(this._isInline(value)!==this._isInline(this._previousState)){this._setMode(this.options.mode,true);return}}this.popover.removeClass(this.css[this._previousState+"State"]).addClass(this.css[this.options.state+"State"]);this._setNewContent(this._getTemplate())},_setTargetState:function(clean){this._target.removeClass(this.css[this._previousState+"State"]).removeClass(this.css[this.options.state+"State"]);if(this.options.allowCSSOnTarget&&!clean){this._target.addClass(this.css[this.options.state+"State"])}},_setOption:function(key,value){switch(key){case"state":this._setState(value);if(this._visible&&!this._isInline()){this._positionPopover(this._target);this._slide()}break;case"mode":if(typeof value==="string"){this._setMode(value)}break;case"contentTemplate":if(typeof value==="string"){this.options.contentTemplate=value;this._setNewContent(this._getTemplate())}break;case"allowCSSOnTarget":if(typeof value==="boolean"){this.options.allowCSSOnTarget=value;if(this._visible){this._setTargetState(!value)}}break;case"showIcon":this.options.showIcon=value;if(this._visible){this._setNewContent(this._getTemplate())}break;default:this._superApply(arguments)}},_setMode:function(value,force){if($.inArray(value,this._modes)===-1){throw new Error(this._getLocaleValue("notSupportedMode"))}if(this.options.mode!==value||force){this.popover.remove();delete this.arrow;this.options.mode=value;this._renderPopover();if(this._visible){if(!this._isInline()){this._positionPopover(this._target)}this.popover.show();this._slide()}}},_isInline:function(state){var target=state||this.options.state;if(this.options.mode==="inline"){return true}else{return this.options.mode==="auto"&&$.inArray(target,this.inlineStates)>-1}},notify:function(state,message){if($.inArray(state,this._states)>=$.inArray(this.options.notifyLevel,this._states)){if(!this._visible||this.options.state!==state||this._currentText!==message){this._setState(state,message);this.show()}}else{this.hide();this._setState(state,message)}},isVisible:function(){return this._visible},_renderPopover:function(){if(this._isInline()){this.popover=$("<div></div>").addClass(this.css.baseClasses).addClass(this.css.inline);this.contentInner=$("<div></div>").appendTo(this.popover);this.popover.insertAfter(this._target);this._attachEventsToTarget()}else{$.ui.igPopover.prototype._renderPopover.apply(this,arguments)}this._setState(this.options.state);this.contentInner.addClass(this.css.contentInner)},_openPopover:function(){var initialState=this._visible;if(this.popover.is(":animated")){this.popover.stop(true)}this._visible=false;$.ui.igPopover.prototype._openPopover.apply(this,arguments);if(this._visible){var change=this._visible!==initialState;this._slide(!change);if(change){this._setTargetState()}}else{this._visible=initialState}},_slide:function(quick){if(!this.options.animationSlideDistance||!this.oDir||this._isInline()){return}var slideAnimation;switch(this.oDir){case"top":slideAnimation={top:"-="+this.options.animationSlideDistance+"px"};break;case"bottom":slideAnimation={top:"+="+this.options.animationSlideDistance+"px"};break;case"left":slideAnimation={left:"-="+this.options.animationSlideDistance+"px"};break;case"right":slideAnimation={left:"+="+this.options.animationSlideDistance+"px"};break}this.popover.animate(slideAnimation,{queue:false,duration:quick?0:this.options.animationDuration})},_resizeHandler:function(event){if(this._visible&&this._currentTarget){this._positionPopover(this._currentTarget);this._slide(event)}},_attachEventsToTarget:function(){if(this.options.showOn!=="manual"){$.ui.igPopover.prototype._attachEventsToTarget.apply(this,arguments)}},_closePopover:function(){var initialState=this._visible;$.ui.igPopover.prototype._closePopover.apply(this,arguments);if(!this._visible&&this._visible!==initialState){this._setTargetState(true)}},_positionPopover:function(){if(!this._isInline()){$.ui.igPopover.prototype._positionPopover.apply(this,arguments)}},_getTemplate:function(){var currContent=this.options.contentTemplate;if(typeof currContent==="function"&&this._target){currContent=this._getContentTemplate(this._target[0])}return currContent},_getContentTemplate:function(target){var template="";if(target){template=this.options.contentTemplate.call(target,this.options.state)}return template},_setNewContent:function(nc){var newContent=nc,iconContainer=this.css.iconContainer,icon="";if(nc instanceof $){newContent=nc.html()}else if(typeof nc==="object"){newContent=nc.innerHTML}if(this.options.showIcon){icon=this.css[this.options.state+"Icon"]}else{iconContainer+=" hidden"}newContent=newContent.replace(/\{0\}/g,iconContainer).replace(/\{1\}/g,icon).replace(/\{2\}/g,this._currentText);this.contentInner.html(newContent)},destroy:function(){this._setTargetState(true);this._superApply(arguments);return this}});$.extend($.ui.igNotifier,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI Editors 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery.js
 *	jquery.ui-1.9.0.js
 *	infragistics.util.js
 *  infragistics.util.jquery.js
 *  infragistics.ui.widget.js
 *  infragistics.ui.popover.js
 *  infragistics.ui.notifier.js
 *	infragistics.ui.validator.js
 */
(function($){$.widget("ui.igBaseEditor",$.ui.igWidget,{localeWidgetName:"Editor",options:{width:null,height:null,value:null,tabIndex:null,allowNullValue:false,nullValue:null,inputName:null,readOnly:false,disabled:false,validatorOptions:null},css:{editor:"ui-igedit-input",container:"ui-igedit ui-igedit-container ui-widget ui-corner-all ui-state-default",hover:"ui-state-hover",active:"ui-state-active",focus:"ui-state-focus",disabled:"ui-state-disabled"},events:{rendering:"rendering",rendered:"rendered",mousedown:"mousedown",mouseup:"mouseup",mousemove:"mousemove",mouseover:"mouseover",mouseout:"mouseout",blur:"blur",focus:"focus",keydown:"keydown",keypress:"keypress",keyup:"keyup",valueChanging:"valueChanging",valueChanged:"valueChanged"},_createWidget:function(options){this._definedOptions=options;this._superApply(arguments)},_create:function(){this._initialize();this._readAttributes();this._saveDOMContent();this._render();this.localeContainer=this._editorContainer},_initialize:function(){this._timeouts=[]},_readAttributes:function(){this._saveAttributes();this._removeAttributesAndSetThemAsOptions()},_saveAttributes:function(){var i;var element=this.element[0],attr;this._initialAttributes=[];attr=element.attributes;for(i=0;i<attr.length;i++){if(attr[i].name!=="id"){this._initialAttributes.push({name:attr[i].name,attrValue:attr[i].value})}}},_removeAttributesAndSetThemAsOptions:function(){var element=this.element,name=element.attr("name"),value=element.attr("value"),disabled=element.attr("disabled"),readOnly=element.attr("readOnly");if(name){element.removeAttr("name");if(this.options.inputName===null){this.options.inputName=name}}if(value){element.removeAttr("value");if(this.options.value===null){this.options.value=value}}if(disabled){element.removeAttr("disabled");if(this._definedOptions===undefined||this._definedOptions.disabled===undefined){this.options.disabled=true}}if(readOnly){element.removeAttr("readonly");if(this._definedOptions===undefined||this._definedOptions.readOnly===undefined){this.options.readOnly=true}}delete this._definedOptions},_saveDOMContent:function(){if(this.element.children().length>0){this._initialDOMContent=this.element.children().clone(true);this.element.empty()}},_render:function(){throw new Error(this._getLocaleValue("renderErrMsg"))},_applyOptions:function(){if(this.options.tabIndex!==null){this._setTabIndex(this.options.tabIndex)}if(this.options.readOnly){this._setReadOnly(true)}if(this.options.disabled){this._setDisabled(true)}if(this.options.inputName){this.inputName(this.options.inputName)}if(this.options.validatorOptions){this._setupValidator()}},_attachEvents:function(){var self=this;this._editorContainer.on({"mousedown.editor":function(event){self._triggerMouseDown(event)},"mouseup.editor":function(event){self._triggerMouseUp(event)},"mousemove.editor":function(event){self._triggerMouseMove(event)},"mouseover.editor":function(event){self._triggerMouseOver(event)},"mouseout.editor":function(event){self._triggerMouseOut(event)}})},_setupValidator:function(){if(this.element.igValidator){var validatorOptions=$.extend({},{language:this.options.language,locale:this.options.locale},this.options.validatorOptions);this._validator=this.element.igValidator(validatorOptions).data("igValidator");this._validator.owner=this}},_destroyValidator:function(){if(this._validator&&this._validator.owner===this){this._validator.destroy();this._validator=null}},_applyAria:function(){var ariaLabeledBy=this.element.attr("aria-labelledby");if(ariaLabeledBy){this.element.removeAttr("aria-labelledby");this._editorInput.attr("aria-labelledby",ariaLabeledBy)}if(this._dropDownButton){this._editorInput.attr("role","combobox")}else{this._editorInput.attr("role","textbox")}},_triggerRendering:function(){var args={element:this.element,owner:this};return this._trigger(this.events.rendering,null,args)},_triggerRendered:function(){var args={element:this.element,owner:this};this._trigger(this.events.rendered,null,args)},_triggerMouseMove:function(event){var args={owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.mousemove,event,args)},_triggerMouseDown:function(event){this._editorContainer.addClass(this.css.active);var args={owner:this,element:event.target,editorInput:this._editorInput};return this._trigger(this.events.mousedown,event,args)},_triggerMouseUp:function(event){this._editorContainer.removeClass(this.css.active);var args={owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.mouseup,event,args)},_triggerMouseOver:function(event){this._editorContainer.addClass(this.css.hover);var args={originalEvent:event,owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.mouseover,event,args)},_triggerMouseOut:function(event){this._editorContainer.removeClass(this.css.hover);var args={originalEvent:event,owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.mouseout,event,args)},_triggerFocus:function(event){this._editorContainer.addClass(this.css.focus);var args={originalEvent:event,owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.focus,event,args)},_triggerBlur:function(event){this._editorContainer.removeClass(this.css.focus);this._editorContainer.removeClass(this.css.active);this._clearEditorNotifier();var args={owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.blur,event,args)},_setOption:function(option,value){var prevValue=this.options[option];if(prevValue===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"readOnly":this._setReadOnly(value);break;case"disabled":this._setDisabled(value);break;case"width":this._setWidth(value);break;case"height":this._setHeight(value);break;case"validatorOptions":this._setupValidator();break;case"tabIndex":this._setTabIndex(value);break;case"inputName":this._valueInput.attr("name",value);break;default:this.options[option]=prevValue;this._super(option,value);break}},_validateValue:function(val){return val?true:false},_updateValue:function(value){this._valueInput.val(value);this.options.value=value},_clearValue:function(textOnly){var newValue="";if(this.options.allowNullValue){newValue=this.options.nullValue}if(!this._validateValue(newValue)){newValue=""}if(textOnly){this._editorInput.val(newValue)}else{this._updateValue(newValue)}},_detachEvents:function(){if(this._detachButtonsEvents){this._detachButtonsEvents()}if(this._detachListEvents){this._detachListEvents()}if(this._editorContainer){this._editorContainer.off("mousedown.editor mouseup.editor mouseover.editor mouseout.editor")}},_detachButtonsEvents:function(){if(this._dropDownList){this._detachListEvents()}if(this._dropDownButton){this._detachButtonsEvents(this._dropDownButton)}if(this._clearButton){this._detachButtonsEvents(this._clearButton)}if(this._spinUpButton){this._detachButtonsEvents(this._spinUpButton)}if(this._spinDownButton){this._detachButtonsEvents(this._spinDownButton)}},_restoreDOMStructure:function(){this._removeDOM();this._removeAttributes();this._setPropsDefaults();this._recoverInitialAttributes();this._recoverInitialDOMContent()},_removeDOM:function(){this._removeList();this._removeClearButton();this._removeSpinButtons();this._removeContainer()},_removeContainer:function(){if(this._valueInput){this._valueInput.remove()}if(this.element.is("input")){this.element.unwrap().unwrap()}else if(this.element.is("div")){this.element.empty()}else if(this.element.is("span")){this.element.empty();this.element.unwrap().unwrap()}},_removeList:function(){if(this._dropDownList){this._deleteList();this._deleteDropDownButton()}},_removeClearButton:function(){if(this._clearButton){this._clearButton.remove();delete this._clearButton}},_removeSpinButtons:function(){if(this._spinUpButton){this._spinUpButton.remove();delete this._spinUpButton}if(this._spinDownButton){this._spinDownButton.remove();delete this._spinDownButton}},_removeAttributes:function(){var element=this.element,attr=element[0].attributes,concatenatedAttr="",i;for(i=0;i<attr.length;i++){if(attr[i].name!=="id"){concatenatedAttr+=attr[i].name+" "}}element.removeAttr(concatenatedAttr.trim())},_setPropsDefaults:function(){var element=this.element[0];element.disabled=false;element.readOnly=false;element.checked=false;element.value=null},_recoverInitialAttributes:function(){var i;if(this._initialAttributes){for(i=0;i<this._initialAttributes.length;i++){if(this._initialAttributes[i].name!=="id"){this.element.attr(this._initialAttributes[i].name,this._initialAttributes[i].attrValue);if(this._initialAttributes[i].name==="value"&&this.element.is("input")){$(this.element).val(this._initialAttributes[i].attrValue)}}}delete this._initialAttributes}},_recoverInitialDOMContent:function(){if(this._initialDOMContent){this._initialDOMContent.appendTo(this.element);delete this._initialDOMContent}},_clearStyling:function(){if(this._editorContainer){this._editorContainer.removeClass(this.css.container).removeClass(this.css.hover).removeClass(this.css.active)}if(this._editorInput){this._editorInput.removeClass(this.css.editor)}},_deleteInternalProperties:function(){delete this._editorInput;delete this._editorContainer;delete this._valueInput;if(this._timeouts){delete this._timeouts}},_clearTimeouts:function(){var i,timeouts=this._timeouts;if(timeouts&&timeouts instanceof Array){for(i=0;i<timeouts.length;i++){clearTimeout(timeouts[i])}this._timeouts=[]}},_disableEditor:function(applyDisabledClass){if(applyDisabledClass){this._editorContainer.addClass(this.css.disabled)}this._detachEvents()},_setEditableMode:function(){this._editorInput.prop("readonly",false);this._valueInput.prop("readonly",false);this._editorInput.prop("disabled",false);this._valueInput.prop("disabled",false);this._editorContainer.removeClass(this.css.disabled);this._attachEvents()},_setDisabled:function(activate){if(activate){this._editorInput.prop("disabled",true);this._valueInput.prop("disabled",true);this._disableEditor(true)}else{this._editorInput.prop("disabled",false);this._valueInput.prop("disabled",false);if(!this.options.readOnly){this._setEditableMode()}}},_setReadOnly:function(activate){if(activate){this._editorInput.prop("readonly",true);this._valueInput.prop("readonly",true);this._disableEditor()}else{this._editorInput.prop("readonly",false);this._valueInput.prop("readonly",false);if(!this.options.disabled){this._setEditableMode()}this._editorInput.off(".readonly")}},_setWidth:function(width){if(width){this._editorContainer.css("width",this.options.width)}},_setHeight:function(height){if(height){this._editorContainer.css("height",this.options.height)}},_setTabIndex:function(index){this._editorInput.attr("tabIndex",index)},_setFocusDelay:function(delay){var self=this;if(delay){this._timeouts.push(setTimeout(function(){self.field().focus()},delay))}else{this.field().focus()}},_setFocus:function(event){if(this._focused){return}this._focused=true;this._enterEditMode();if(event){this._triggerFocus(event)}},_setBlur:function(event){var newValue;if(this._cancelBlurOnInput){this._editorInput.focus();delete this._cancelBlurOnInput}else{this._triggerBlur(event);newValue=$(event.target).val();this._currentInputTextValue=this._editorInput.val();this._processValueChanging(newValue);this._processTextChanged();this._exitEditMode();if(this._dropDownList&&this._dropDownList.is(":visible")&&this._triggerDropDownClosing()){this._hideDropDownList()}this._focused=false;this._clearTimeouts();if(this._validator){this._validator._validateInternal(this.element,event,true)}if(this._inComposition===true){delete this._inComposition}}},inputName:function(newValue){if(newValue){this.options.inputName=newValue;this._valueInput.attr("name",newValue)}else{return this.options.inputName}},value:function(newValue){var listIndex;if(newValue!==undefined){this._clearEditorNotifier();if(this.options.maxLength){if(newValue&&newValue.toString().length>this.options.maxLength){newValue=newValue.toString().substring(0,this.options.maxLength);this._sendNotification("warning",{optName:"maxLengthErrMsg",arg:this.options.maxLength})}}if(this._validateValue(newValue)){if(this.options.toUpper){if(newValue){newValue=newValue.toLocaleUpperCase()}}else if(this.options.toLower){if(newValue){newValue=newValue.toLocaleLowerCase()}}if(this._dropDownList&&this.options.isLimitedToListValues&&(listIndex=this._valueIndexInList(newValue))!==-1){newValue=this.options.listItems[listIndex]}this._updateValue(newValue);this._editorInput.val(this._getDisplayValue())}else{this._clearValue();if(this._focused!==true){this._exitEditMode()}}}else{return this.options.value}this._checkClearButtonState()},field:function(){return this._editorInput},editorContainer:function(){return this._editorContainer},hasFocus:function(){return this._focused},setFocus:function(delay){this._setFocusDelay(delay)},hide:function(){this._editorContainer.hide()},show:function(){this._editorContainer.show()},validator:function(){return this._validator},isValid:function(){this._skipMessages=true;var valid=this._validateValue(this._editMode?this.field().val():this.value());this._skipMessages=false;return valid},validate:function(){if(this.options.validatorOptions){return this.validator().validate()}else{return this._validateValue(this.value())}},destroy:function(){this._destroyValidator();this._detachEvents();this._clearTimeouts();this._clearStyling();this._restoreDOMStructure();this._deleteInternalProperties();delete this.options;this._superApply(arguments);return this}});$.extend($.ui.igBaseEditor,{version:"21.2.12"});$.widget("ui.igTextEditor",$.ui.igBaseEditor,{options:{buttonType:"none",listItems:null,listWidth:0,listItemHoverDuration:0,dropDownAttachedToBody:false,dropDownAnimationDuration:300,visibleItemsCount:5,includeKeys:null,excludeKeys:null,textAlign:"left",placeHolder:null,selectionOnFocus:"selectAll",textMode:"text",spinWrapAround:false,isLimitedToListValues:false,revertIfNotValid:true,preventSubmitOnEnter:false,dropDownOrientation:"auto",maxLength:null,dropDownOnReadOnly:false,toUpper:false,toLower:false,suppressNotifications:false,suppressKeyboard:false},css:{editorInputContainer:"ui-igeditor-input-container ui-corner-all",spinButtonUpImage:"ui-igedit-spinupperimage ui-icon-carat-1-n ui-icon "+"ui-igedit-buttondefault ui-igedit-spinbutton ui-igedit-buttonimage",spinButtonDownImage:"ui-igedit-spinlowerimage ui-icon-carat-1-s ui-icon "+"ui-igedit-buttondefault ui-igedit-spinbutton ui-igedit-buttonimage",dropDownImage:"ui-icon ui-icon-triangle-1-s ui-igedit-buttonimage",dropDownButton:"ui-igedit-dropdown-button ",clearButtonImage:"ui-igedit-buttonimage ui-icon-circle-close "+"ui-icon ui-igedit-buttondefault",clearButton:"ui-igedit-cleararea ui-state-default",buttonCommon:"ui-igedit-button-common ui-unselectable "+"ui-igedit-button-ltr ui-state-default",dropDownList:"ui-igedit-dropdown ui-widget",listItem:"ui-igedit-listitem ui-state-default",listItemHover:"ui-igedit-listitemhover ui-state-hover",listItemActive:"ui-state-active ui-igedit-listitemactive",listItemSelected:"ui-igedit-listitemselected ui-state-highlight",buttonHover:"ui-igedit-buttonhover ui-state-hover",buttonPressed:"ui-igedit-buttonpressed ui-state-highlight",placeHolder:"ui-igedit-placeholder",textArea:"ui-igedit-textarea"},events:{dropDownListOpening:"dropDownListOpening",dropDownListOpened:"dropDownListOpened",dropDownListClosing:"dropDownListClosing",dropDownListClosed:"dropDownListClosed",dropDownItemSelecting:"dropDownItemSelecting",dropDownItemSelected:"dropDownItemSelected",textChanged:"textChanged"},_create:function(){$.ui.igBaseEditor.prototype._create.call(this)},_changeLocaleForNotifier:function(){var notifier=this._editorContainer.data("igNotifier"),message;if(notifier&&notifier.isVisible()){message=this._getMessageForNotifier(this._notifierMessage);notifier.notify(notifier.options.state,message)}},_changeLocaleForValidator:function(){if(this._validator){this._validator.options.locale=this.options.locale;this._validator.options.language=this.options.language}},changeLocale:function(){this._superApply(arguments);this._changeLocaleForNotifier();this._changeLocaleForValidator()},_setOption:function(option,value){var prevValue=this.options[option];if(prevValue===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"value":this.value(value);break;case"placeHolder":this._applyPlaceHolder();break;case"suppressNotifications":if(value){this._clearEditorNotifier()}break;case"listItems":if(prevValue!==null){this._deleteList()}this._createList();this._clearValue();break;case"listWidth":this._setDropDownListWidth();break;case"spinWrapAround":if(value){this._enableSpinButton(this._spinDownButton,"spinDown");this._enableSpinButton(this._spinUpButton,"spinUp")}else{this._setSpinButtonsState(this.value())}break;case"excludeKeys":if(value===""){this._excludeKeysArray=[]}else{this._excludeKeysArray=value.toString().split("")}break;case"includeKeys":if(value===""){this._includeKeysArray=[]}else{this._includeKeysArray=value.toString().split("")}break;case"textAlign":this._editorInput.css("text-align",value);break;case"dropDownOnReadOnly":case"visibleItemsCount":case"buttonType":case"dropDownAttachedToBody":this.options[option]=prevValue;throw new Error(this._getLocaleValue("setOptionError")+option);default:this.options[option]=prevValue;this._super(option,value);break}},_updateValue:function(value){if(value!==null&&value!==undefined){value=value.toString()}this._super(value);if(this._dropDownList){this._updateDropdownSelection(value)}},_applyOptions:function(){var initialValue;this._editMode=false;this._focused=false;this._super();if(this.options.includeKeys){this._includeKeysArray=this.options.includeKeys.toString().split("")}if(this.options.excludeKeys){this._excludeKeysArray=this.options.excludeKeys.toString().split("")}initialValue=this.options.value;if(this.options.allowNullValue&&initialValue===null){initialValue=this.options.nullValue}if(this.options.maxLength){if(initialValue&&initialValue.toString().length>this.options.maxLength){initialValue=initialValue.toString().substring(0,this.options.maxLength);this._sendNotification("warning",{optName:"maxLengthErrMsg",arg:this.options.maxLength})}}if(this._validateValue(initialValue)){this._setInitialValue(initialValue);this._editorInput.val(this._getDisplayValue())}else{this._setInitialValue("");this._editorInput.val(this._getDisplayValue())}this._applyPlaceHolder()},_render:function(){var editorElementWrapper,editorElement,tempTimeStamp;this._triggerRendering();if(this.element.attr("id")!==undefined){this.id=this.element.attr("id")}else{tempTimeStamp=new Date;this.id=tempTimeStamp.getTime()}if(this.element.is("div")||this.element.is("span")){if(this.options.textMode==="multiline"){editorElement=$("<textarea rows='4' cols='50'></textarea>");editorElement.addClass(this.css.textArea)}else if(this.options.textMode==="password"){editorElement=$("<input type='password' autocomplete='off'/>")}else{editorElement=$("<input type='text' />")}if(this.element.is("span")){editorElement=this.element.html(editorElement)}editorElementWrapper=editorElement.wrap($("<div></div>")).parent();editorElementWrapper.addClass(this.css.editorInputContainer);this._editorInputWrapper=editorElementWrapper;if(this.element.is("span")){this._editorInput=editorElement.children(0);this._editorContainer=editorElementWrapper.wrap($("<div></div>")).parent()}else{this._editorInput=editorElement;this._editorContainer=this.element}this._editorContainer.prepend(editorElementWrapper)}else if(this.element.is("input")){this._editorContainer=this.element.wrap($("<div></div>")).parent();this._editorInput=this.element;editorElementWrapper=this._editorInput.wrap($("<div></div>")).parent();editorElementWrapper.addClass(this.css.editorInputContainer);this._editorInputWrapper=editorElementWrapper}else if(this.element.is("textarea")){if(this.options.textMode!=="multiline"){throw new Error(this._getLocaleValue("multilineErrMsg"))}else{this._editorContainer=this.element.wrap($("<div></div>")).parent();this._editorInput=this.element;this._editorInput.addClass(this.css.textArea);editorElementWrapper=this._editorInput.wrap($("<div></div>")).parent();editorElementWrapper.addClass(this.css.editorInputContainer);this._editorInputWrapper=editorElementWrapper}}else{throw new Error(this._getLocaleValue("targetNotSupported"))}this._editorContainer.addClass(this.css.container);this._editorInput.addClass(this.css.editor);this._editorInput.css("height","100%");if((this.element.is("input")||this.element.is("textarea"))&&this._editorInput.attr("id")!==undefined){this._editorInputId=this._editorInput.attr("id")}else{this._editorInput.attr("id",this.id+"EditingInput");this._editorInputId=this.id+"EditingInput"}if(!$.ig.util.isIE8){if(this.options.textMode!=="multiline"){if(this.options.textMode==="password"){this._editorInput.attr("type","password");this._editorInput.attr("autocomplete","off")}else{this._editorInput.attr("type","text")}}}if(this.options.buttonType&&this.options.buttonType!=="none"&&this.options.textMode!=="multiline"&&this.options.textMode!=="password"){this._renderButtons()}if(this.options.width){this._editorContainer.css("width",this.options.width)}if(this.options.height){this._editorContainer.css("height",this.options.height)}if(this.options.textMode==="multiline"){this._valueInput=$("<textarea style='display:none'></textarea>")}else{this._valueInput=$("<input type='hidden'></input>")}this._editorInput.after(this._valueInput);this._editorInput.css("text-align",this.options.textAlign);this._createList();this._attachEvents();this._applyOptions();this._applyAria();this._checkClearButtonState();this._triggerRendered()},_applyAria:function(){this._super();this._applyInputAriaLabel()},_applyInputAriaLabel:function(){var ariaLabelText,localeid;switch(this.widgetName){case"igTextEditor":localeid="ariaTextEditorFieldLabel";break;case"igNumericEditor":localeid="ariaNumericEditorFieldLabel";break;case"igCurrencyEditor":localeid="ariaCurrencyEditorFieldLabel";break;case"igPercentEditor":localeid="ariaPercentEditorFieldLabel";break;case"igMaskEditor":localeid="ariaMaskEditorFieldLabel";break;case"igDateEditor":localeid="ariaDateEditorFieldLabel";break;case"igDatePicker":localeid="ariaDatePickerFieldLabel";break;case"igTimePicker":localeid="ariaTimePickerFieldLabel";break;default:{localeid="ariaTextEditorFieldLabel";break}}ariaLabelText=this._getLocaleValue(localeid);this._editorInput.attr({"aria-label":ariaLabelText,"data-localeid":localeid,"data-localeattr":"aria-label"})},_getMessageForNotifier:function(messageObj){var optName=messageObj.optName,message=this._getLocaleValue(optName),arg=messageObj.arg;return arg!==undefined?$.ig.util.stringFormat(message,arg):message},_sendNotification:function(state,messageObj){var message=this._getMessageForNotifier(messageObj);if(this.options.suppressNotifications||this._skipMessages){this._currentMessage=message;return}if(!this._editorContainer.data("igNotifier")){this._editorContainer.igNotifier()}this._notifierMessage=messageObj;this._editorContainer.igNotifier("notify",state,message)},_applyPlaceHolder:function(){if(this.options.placeHolder&&this.options.placeHolder!==""){this._editorInput.attr("placeholder",this.options.placeHolder);this._editorInput.addClass(this.css.placeHolder);if(this._placeHolderNotSupported()){throw new Error(this._getLocaleValue("placeHolderNotSupported"))}}else if(this._editorInput.attr("placeholder")){this._editorInput.removeAttr("placeholder")}},_placeHolderNotSupported:function(){return document.createElement("input").placeholder===undefined},_setInitialValue:function(value){this._updateValue(value)},_disableEditor:function(applyDisabledClass){if(this.options.dropDownOnReadOnly){if(applyDisabledClass){this._editorInput.addClass(this.css.disabled)}}else{if(applyDisabledClass){this._editorContainer.addClass(this.css.disabled)}this._detachEvents()}if(this._dropDownList&&!this.options.dropDownOnReadOnly){if(applyDisabledClass){this._dropDownList.addClass(this.css.disabled)}this._detachListEvents()}if(this._dropDownButton&&!this.options.dropDownOnReadOnly){this._dropDownButton.addClass(this.css.disabled);this._detachButtonsEvents(this._dropDownButton)}if(this._clearButton){this._clearButton.addClass(this.css.disabled);this._detachButtonsEvents(this._clearButton)}if(this._spinUpButton){this._spinUpButton.addClass(this.css.disabled);this._detachButtonsEvents(this._spinUpButton)}if(this._spinDownButton){this._spinDownButton.addClass(this.css.disabled);this._detachButtonsEvents(this._spinDownButton)}},_disableSpinButton:function(target){if(target&&!target.attr("disabled")&&!this.options.spinWrapAround){target.addClass(this.css.disabled);target.attr("disabled","disabled");target.prop("disabled",true);target.removeClass(this.css.buttonHover);if(target._pressed){delete target._pressed;target.removeClass(this.css.buttonPressed)}if(target._spinTimeOut){clearTimeout(target._spinTimeOut);delete this._spinUpButton._spinTimeOut}if(target._spinInterval){clearInterval(target._spinInterval);delete target._spinInterval}this._detachButtonsEvents(target)}},_enableSpinButton:function(target,type){if(target&&target.attr("disabled")){target.removeClass(this.css.disabled);target.removeAttr("disabled");target.prop("disabled",false);this._attachButtonsEvents(type,target)}},_exceedsMaxValue:function(){return this._dropDownList&&!this._getSpinItem("up").length},_lessThanMinValue:function(){return this._dropDownList&&!this._getSpinItem("down").length},_setSpinButtonsState:function(val){if(typeof val==="string"||val instanceof String){val=val.trim()}if(val===null){this._enableSpinButton(this._spinDownButton,"spinDown");this._enableSpinButton(this._spinUpButton,"spinUp");return}if(val!==""&&!this.options.spinWrapAround){if(this._exceedsMaxValue(val)){this._disableSpinButton(this._spinUpButton);this._enableSpinButton(this._spinDownButton,"spinDown")}else if(this._lessThanMinValue(val)){this._disableSpinButton(this._spinDownButton);this._enableSpinButton(this._spinUpButton,"spinUp")}else{this._enableSpinButton(this._spinDownButton,"spinDown");this._enableSpinButton(this._spinUpButton,"spinUp")}}},_replaceCharAt:function(stringValue,index,ch){if(stringValue!==undefined){return stringValue.substring(0,index)+ch+stringValue.substring(index+1)}},_getStringRange:function(stringValue,start,end){if(stringValue!==undefined){return stringValue.substring(start,end)}},_replaceStringRange:function(stringValue,replacementValue,indexStart,indexEnd){var i=0;while(indexStart<=indexEnd){stringValue=this._replaceCharAt(stringValue,indexStart,replacementValue.charAt(i));i++;indexStart++}return stringValue},_valueIndexInList:function(val){if(!val&&val!==0){return-1}var loweredItems=$.map(this.options.listItems,function(item){return item.toString().toLowerCase()});return $.inArray(val.toString().toLowerCase(),loweredItems)},_validateValue:function(val){var result;if(val===undefined){result=false}else if(val===null){if(this.options.allowNullValue){result=val===this.options.nullValue?true:false}else{result=false}}else if(this.options.isLimitedToListValues&&this._dropDownList){if(this._valueIndexInList(val)!==-1){result=true}else{this._sendNotification("warning",{optName:"allowedValuesMsg"});result=false}}else if(this.options.maxLength){if(val.toString().length<=this.options.maxLength){result=true}else{result=false}}else{result=true}return result},_setEditableMode:function(){this._super("_setEditableMode");if(this._dropDownList&&!this.options.dropDownOnReadOnly){this._dropDownList.removeClass(this.css.disabled);this._attachListEvents()}if(this._dropDownButton&&!this.options.dropDownOnReadOnly){this._dropDownButton.removeClass(this.css.disabled);this._attachButtonsEvents("dropdown",this._dropDownButton)}if(this._clearButton){this._clearButton.removeClass(this.css.disabled);this._attachButtonsEvents("clear",this._clearButton)}if(this._spinUpButton&&this.options.value!==this.options.maxValue){this._spinUpButton.removeClass(this.css.disabled);this._attachButtonsEvents("spinUp",this._spinUpButton)}if(this._spinDownButton&&this.options.value!==this.options.minValue){this._spinDownButton.removeClass(this.css.disabled);this._attachButtonsEvents("spinDown",this._spinDownButton)}},_calculateDropDownListOrientation:function(){var containerOffset=this._editorContainer.igOffset(),containerTop=containerOffset.top,containerHeight=parseFloat(this._editorContainer.css("height")),dropDownAndEditorHeight=parseInt(containerTop+containerHeight+this._listInitialHeight),windowHeight=$(window).height(),orientation;if(this.options.dropDownOrientation==="auto"){if(dropDownAndEditorHeight<windowHeight+$(window).scrollTop()){orientation="bottom"}else if(containerTop-this._listInitialHeight>0){orientation="top"}else{orientation="bottom"}}else{orientation=this.options.dropDownOrientation}return orientation},_positionDropDownList:function(){var containerOffset=this._editorContainer.igOffset(),containerTop=containerOffset.top,containerLeft=containerOffset.left,containerHeight=parseFloat(this._editorContainer.css("height")),orientation=this._calculateDropDownListOrientation();if(this.options.dropDownAttachedToBody){this._dropDownList.css("left",containerLeft);if(orientation==="bottom"){this._dropDownList.css("top",containerTop+containerHeight);this._dropDownListOrientation="down";this._dropDownList.removeClass("ui-igedit-dropdown-orientation-top");this._dropDownList.addClass("ui-igedit-dropdown-orientation-bottom")}else{this._dropDownList.css("top",containerTop-this._listInitialHeight);this._dropDownListOrientation="up";this._dropDownList.removeClass("ui-igedit-dropdown-orientation-bottom");this._dropDownList.addClass("ui-igedit-dropdown-orientation-top")}}else{this._dropDownList.css("left","");if(orientation==="bottom"){this._dropDownList.css("top","");this._dropDownListOrientation="down";this._dropDownList.removeClass("ui-igedit-dropdown-orientation-top");this._dropDownList.addClass("ui-igedit-dropdown-orientation-bottom")}else{this._dropDownList.css("top",-this._listInitialHeight);this._dropDownListOrientation="up";this._dropDownList.removeClass("ui-igedit-dropdown-orientation-bottom");this._dropDownList.addClass("ui-igedit-dropdown-orientation-top")}}this._setDropDownListWidth()},_createList:function(){if(Array.isArray(this.options.listItems)){this.options.listItems=this.options.listItems.filter(function(item){return item||item===0})}if(this.options.textMode!=="multiline"&&this.options.textMode!=="password"&&this.options.listItems&&this.options.listItems.length>0){if(this.options.buttonType.toString().indexOf("dropdown")===-1){this._renderDropDownButton()}this._renderList();this._positionDropDownList();this._attachListEvents()}},_renderList:function(){var i,list=this.options.listItems,itemValue,currentItem,itemHeight,dropdown,id=this.id,html,listBorderHeight;html="<div id='"+id+"_list"+"' tabindex='-1' class='"+this.css.dropDownList+"' role='listbox' aria-activedescendant='"+this._editorInputId+"'>";this._editorInput.attr("aria-owns",this.id+"_list");for(i=0;i<list.length;i++){itemValue=list[i]?this._getEditModeValue(list[i]):list[i];currentItem="<span id='"+id+"_item_"+(i+1)+"' tabindex='-1' role='option' aria-selected='false' aria-posinset='"+(i+1).toString()+"' class='"+this.css.listItem+"' title='"+itemValue+"'>"+itemValue+"</span>";html+=currentItem}html+="</div>";dropdown=$(html);if(this.options.dropDownAttachedToBody){$(document.body).append(dropdown)}else{this._editorContainer.append(dropdown)}itemHeight=dropdown.children().eq(0).outerHeight();if(itemHeight===0){itemHeight=23}if(this._calculateDropDownListOrientation()==="bottom"){listBorderHeight=parseInt(dropdown.css("borderBottomWidth"))}else{listBorderHeight=parseInt(dropdown.css("borderTopWidth"))}if(list.length<this.options.visibleItemsCount){dropdown.css("height",parseFloat(itemHeight*list.length+listBorderHeight));
this._listInitialHeight=parseFloat(itemHeight*list.length+listBorderHeight)}else{dropdown.css("height",parseFloat(itemHeight*this.options.visibleItemsCount)+listBorderHeight);this._listInitialHeight=parseFloat(itemHeight*this.options.visibleItemsCount)+listBorderHeight}this._dropDownList=dropdown;this._setDropDownListWidth();dropdown.hide();dropdown.visible=false},_setDropDownListWidth:function(){if(this.options.listWidth&&this.options.listWidth>0){this._dropDownList.css("width",this.options.listWidth)}else{this._dropDownList.css("width",this._editorContainer.css("width"))}},_attachListEvents:function(){var self=this;this._dropDownList.on({"mouseenter.editorList":function(event){var item=event.target;$(item).addClass(self.css.listItemHover,self.options.listItemHoverDuration);$(item).attr("data-hovered",true)},"mouseleave.editorList":function(event){var item=event.target;$(item).removeClass(self.css.listItemHover,self.options.listItemHoverDuration);$(item).removeAttr("data-hovered")},"click.editorList":function(event){self._triggerListItemClick(event.target)},"mousedown.editorList":function(event){event.preventDefault();if(!$.ig.util.isIE8){event.stopPropagation()}}},".ui-igedit-listitem");this._dropDownList.on("mousedown.editorList",function(event){self._listMouseDownHandler(event)})},_listMouseDownHandler:function(event){if($.ig.util.isIE||$.ig.util.isEdge){this._cancelBlurOnInput=true}else{event.preventDefault();event.stopPropagation()}},_deleteList:function(){this._detachListEvents();this._dropDownList.remove();delete this._dropDownList},_deleteDropDownButton:function(){this._detachButtonsEvents(this._dropDownButton);this._dropDownButton.remove();delete this._dropDownButton},_detachListEvents:function(){if(this._dropDownList){this._dropDownList.off("mouseenter.editorList mouseleave.editorList ");this._dropDownList.off("click.editorList mousedown.editorList")}},_renderDropDownButton:function(){var dropDownButton=$("<div></div>"),dropDownIcon=$("<div></div>");if(this._dropDownButton){return}dropDownButton.addClass(this.css.buttonCommon).attr({role:"button",tabindex:-1,id:this.id+"_dropDownButton",title:this._getLocaleValue("buttonTitle"),"data-localeid":"buttonTitle","data-localeattr":"title"});this._editorContainer.prepend(dropDownButton.addClass(this.css.dropDownButton).append(dropDownIcon.addClass(this.css.dropDownImage)));this._dropDownButton=dropDownButton;this._attachButtonsEvents("dropdown",dropDownButton)},_renderSpinButtons:function(){var spinButtonUp=$("<div></div>"),spinButtonUpImage=$("<div></div>"),spinButtonDown=$("<div></div>"),spinButtonDownImage=$("<div></div>");if(this._spinUpButton){return}spinButtonUp.addClass(this.css.buttonCommon).attr({title:this._getLocaleValue("spinUpperTitle"),role:"button",tabindex:-1,id:this.id+"_spinUpButton","data-localeid":"spinUpperTitle","data-localeattr":"title"}).append(spinButtonUpImage.addClass(this.css.spinButtonUpImage));spinButtonDown.addClass(this.css.buttonCommon).attr({title:this._getLocaleValue("spinLowerTitle"),role:"button",tabindex:-1,id:this.id+"_spinDownButton","data-localeid":"spinLowerTitle","data-localeattr":"title"}).append(spinButtonDownImage.addClass(this.css.spinButtonDownImage));this._editorContainer.prepend(spinButtonDown).prepend(spinButtonUp);this._attachButtonsEvents("spinDown",spinButtonDown);this._attachButtonsEvents("spinUp",spinButtonUp);this._spinUpButton=spinButtonUp;this._spinDownButton=spinButtonDown},_renderClearButton:function(){var clearButton=$("<div></div>"),buttonClearIcon=$("<div></div>");if(this._clearButton){return}clearButton.addClass(this.css.buttonCommon).attr({title:this._getLocaleValue("clearTitle"),role:"button",id:this.id+"_clearButton",tabindex:-1,"data-localeid":"clearTitle","data-localeattr":"title"}).append(buttonClearIcon.addClass(this.css.clearButtonImage));this._editorContainer.prepend(clearButton.addClass(this.css.clearButton));this._clearButton=clearButton;this._attachButtonsEvents("clear",clearButton)},_renderButtons:function(){var buttons=this.options.buttonType.toString().split(/[\s,]+/),buttonsCountRendered=0;if($.inArray("clear",buttons)!==-1){this._renderClearButton();buttonsCountRendered++}if($.inArray("spin",buttons)!==-1){if(this._numericType||this.options.listItems&&this.options.listItems!==null&&this.options.listItems.length>0){this._renderSpinButtons();buttonsCountRendered+=2}else if(this.options.listItems===null||this.options.listItems.length===0){throw new Error(this._getLocaleValue("noListItemsNoButton"))}}if($.inArray("dropdown",buttons)!==-1){if(this.options.listItems&&this.options.listItems!==null&&this.options.listItems.length>0){this._renderDropDownButton();buttonsCountRendered++}else if(this.options.listItems===null||this.options.listItems.length===0){throw new Error(this._getLocaleValue("noListItemsNoButton"))}}if(buttonsCountRendered===0){throw new Error(this._getLocaleValue("btnValueNotSupported"))}},_attachButtonsEvents:function(type,target){var self=this;if(!target){return}this._detachButtonsEvents(target);target.on({"mouseenter.button":function(){target.addClass(self.css.buttonHover)},"mouseleave.button":function(){target.removeClass(self.css.buttonHover);if(target._pressed){delete target._pressed;target.removeClass(self.css.buttonPressed)}if(target._spinTimeOut){clearTimeout(target._spinTimeOut);delete target._spinTimeOut}if(target._spinInterval){clearInterval(target._spinInterval);delete target._spinInterval}},"mousedown.button":function(event){if(event.button===0||event.button===1&&$.ig.util.isIE8){target.addClass(self.css.buttonPressed);target._pressed=true;event.preventDefault();if(type==="spinUp"||type==="spinDown"){self._handleSpinEvent(type,target)}}event.stopPropagation()},"mouseup.button":function(){target.removeClass(self.css.buttonPressed);delete target._pressed;if(target._spinTimeOut){clearTimeout(target._spinTimeOut);delete target._spinTimeOut}if(target._spinInterval){clearInterval(target._spinInterval);delete target._spinInterval}},"click.button":function(event){self._triggerButtonClick(event,type)}})},_detachButtonsEvents:function(target){if(target){target.off("mouseenter.button mouseleave.button mousedown.button mouseup.button click.button")}},_attachEvents:function(){var self=this;self._super();this._editorInput.on({"focus.editor":function(event){self._setFocus(event)},"input.editor":function(){if(!self._editMode){self._processTextChanged();self._processValueChanging(self._editorInput.val())}},"dragenter.editor":function(){if(!self._focused&&!self._editMode){self._dragging=true;self._enterEditMode()}},"dragleave.editor":function(e){if($.ig.util.isFF&&e.relatedTarget===this){return}if(self._dragging&&self._editMode){self._exitEditMode();delete self._dragging}},"blur.editor":function(event){self._setBlur(event)},"paste.editor":function(event){self._currentInputTextValue=self._editorInput.val();self._pasteHandler(event)},"drop.editor":function(event){self._focused=true;delete self._dragging;self._pasteHandler(event,true)},"keydown.editor":function(event){if((event.keyCode===8||event.keyCode===46)&&self._editorInput.val()!==self._currentInputTextValue){self._processTextChanged()}self._triggerKeyDown(event)},"keyup.editor":function(event){self._triggerKeyUp(event);self._processTextChanged()},"keypress.editor":function(event){self._triggerKeyPress(event)},"compositionstart.editor":function(){var widgetName=self.widgetName,cursorPosition=self._getCursorPosition();if(cursorPosition===-1){switch(widgetName){case"igMaskEditor":case"igDateEditor":case"igDatePicker":{self._editorInput.val(self._maskWithPrompts);self._setCursorPosition(0)}break;default:}}self._compositionStartValue=self._editorInput.val();self._compositionStartIndex=self._getCursorPosition();self._inComposition=true},"compositionend.editor":function(){setTimeout(function(){var value,widgetName=self.widgetName,cursorPosition=self._getCursorPosition(),selection={start:cursorPosition,end:cursorPosition};if(self._focused!==true){return}switch(widgetName){case"igMaskEditor":{value=self._replaceStringRange(self._compositionStartValue,self._currentCompositionValue,self._compositionStartIndex,self._compositionStartIndex+self._currentCompositionValue.length-1)}break;default:{value=self._editorInput.val()}}self._insert(value,self._compositionStartValue,selection);delete self._inComposition;delete self._compositionStartIndex;delete self._currentCompositionValue;delete self._compositionStartValue},0)},"compositionupdate.editor":function(evt){if(typeof self._compositionStartIndex==="undefined"){var startIndex=self._getCursorPosition();startIndex-=evt.originalEvent.data?evt.originalEvent.data.length:1;self._compositionStartIndex=startIndex;self._compositionStartValue=self._editorInput.val().substring(0,startIndex)}setTimeout(function(){self._currentCompositionValue=$(evt.target).val().toString().substring(self._compositionStartIndex,self._getCursorPosition())},0)}})},_detachEvents:function(){this._super();if(this._editorInput){this._editorInput.off("focus.editor input.editor blur.editor paste.editor");this._editorInput.off("dragenter.editor dragleave.editor drop.editor");this._editorInput.off("keydown.editor keyup.editor keypress.editor");this._editorInput.off("compositionstart.editor compositionend.editor compositionupdate.editor")}},_processValueChanging:function(value){if(value!==this.value()){if(!(this.value()===null&&value==="")){this._triggerInternalValueChange(value)}}},_triggerInternalValueChange:function(value){var noCancel=this._triggerValueChanging(value);if(noCancel){this._processInternalValueChanging(value);this._triggerValueChanged(value)}},_processInternalValueChanging:function(value){var listIndex;if(this.options.maxLength){if(value&&value.toString().length>this.options.maxLength){value=value.toString().substring(0,this.options.maxLength);this._sendNotification("warning",{optName:"maxLengthErrMsg",arg:this.options.maxLength})}}if(this._validateValue(value)){if(this._dropDownList&&this.options.isLimitedToListValues&&(listIndex=this._valueIndexInList(value))!==-1){value=this.options.listItems[listIndex]}this._updateValue(value)}else{if(this.options.revertIfNotValid){value=this._valueInput.val();this._updateValue(value)}else{this._clearValue();value=this._valueInput.val()}}},_triggerKeyDown:function(event){var e=event,noCancel,activeItem,args,currentInputVal,selection;args={owner:this,element:event.target,key:event.keyCode,editorInput:this._editorInput};noCancel=this._trigger(this.events.keydown,event,args);if(noCancel){this._clearEditorNotifier();if(e.keyCode===13){if(event.altKey&&this.options.textMode==="multiline"){this._carryOverNewLine(this._editorInput.val())}else{currentInputVal=this._editorInput.val();if(this._dropDownList&&this._dropDownList.is(":visible")){activeItem=this._dropDownList.children(".ui-igedit-listitem").filter("[data-active='true']");if(activeItem.length>0){this._triggerListItemClick(activeItem)}else{this._toggleDropDown();this._processValueChanging(currentInputVal);this._enterEditMode()}}else{this._processValueChanging(currentInputVal);if(this.options.textMode!=="multiline"){this._enterEditMode()}}}}else{if(this._dropDownList){if(e.keyCode===38){if(e.altKey&&this._dropDownList.is(":visible")){this._toggleDropDown()}else if(this._dropDownList.is(":visible")){activeItem=this._dropDownList.children(".ui-igedit-listitem").filter("[data-active='true']");if(activeItem.length>0&&!activeItem.is(":first-child")){this._hoverPreviousDropDownListItem()}else{this._toggleDropDown()}e.preventDefault()}}else if(e.keyCode===40||e.keyCode===38&&e.altKey){if(!this._dropDownList.is(":visible")){this._toggleDropDown()}else{this._hoverNextDropDownListItem()}e.preventDefault()}else if(e.keyCode===27&&this._dropDownList.is(":visible")){this._toggleDropDown()}}if(this.options.maxLength){currentInputVal=this._editorInput.val();if(currentInputVal.length===this.options.maxLength&&(e.keyCode>46||e.keyCode===32)&&!e.altKey&&!e.ctrlKey){selection=this._getSelection(this._editorInput[0]);if(selection.start===selection.end){e.preventDefault();this._sendNotification("warning",{optName:"maxLengthWarningMsg",arg:this.options.maxLength})}}}}}return noCancel},_triggerKeyUp:function(event){var args={originalEvent:event,owner:this,key:event.keyCode,element:event.target,editorInput:this._editorInput};this._trigger(this.events.keyup,event,args)},_validateNonCharacter:function(event){if($.ig.util.isFF){var e=event;if($.inArray(e.keyCode,[46,8,9,27,13,110,190])!==-1||e.which===97&&e.ctrlKey===true||e.which===99&&e.ctrlKey===true||e.which===120&&e.ctrlKey===true||e.which===118&&e.ctrlKey===true||e.which===122&&e.ctrlKey===true||e.which===121&&e.ctrlKey===true||e.keyCode>=35&&e.keyCode<=40){return true}}else{if(event.keyCode===13){return true}return false}},_triggerKeyPress:function(event){if(this._validateNonCharacter(event)||this._validateKey(event)){var args={owner:this,element:event.target,key:event.keyCode,originalEvent:event,editorInput:this._editorInput};if(this.options.preventSubmitOnEnter&&event.keyCode===13&&!event.shiftKey&&this.options.textMode!=="multiline"){event.preventDefault();event.stopPropagation()}if((this.options.toUpper||this.options.toLower)&&!this._validateNonCharacter(event)){var keyCode=event.which?event.which:event.keyCode;if(keyCode){var charStr,transformedChar,key,selection,val;charStr=String.fromCharCode(keyCode);if(this.options.toUpper){transformedChar=charStr.toLocaleUpperCase()}else{transformedChar=charStr.toLocaleLowerCase()}key=transformedChar.charCodeAt(0);args.key=key;selection=this._getSelection(this._editorInput[0]);val=this._editorInput.val();this._editorInput.val(val.slice(0,selection.start)+transformedChar+val.slice(selection.end));this._setCursorPosition(selection.start+1);event.preventDefault()}}return this._trigger(this.events.keypress,event,args)}else{event.preventDefault();event.stopPropagation()}},_triggerValueChanged:function(originalValue){var args={owner:this,editorInput:this._editorInput,newValue:this.options.value};if(originalValue){args.originalValue=originalValue}this._trigger(this.events.valueChanged,null,args)},_triggerValueChanging:function(newValue){var args={owner:this,editorInput:this._editorInput,oldValue:this.value(),newValue:newValue};return this._trigger(this.events.valueChanging,null,args)},_triggerListItemClick:function(item){var noCancel;noCancel=this._triggerDropDownItemSelecting(item);if(noCancel){this._setSelectedItemByIndex($(item).index());if(this._dropDownList.is(":visible")&&this._triggerDropDownClosing()){this._hideDropDownList()}this._currentInputTextValue=this._editorInput.val();this._processValueChanging($(item).text());if(this._editMode){this._enterEditMode()}else{this._editorInput.val(this._getDisplayValue());this._processTextChanged()}this._triggerDropDownItemSelected()}},_triggerButtonClick:function(event,buttonType){if(buttonType){switch(buttonType){case"dropdown":{this._toggleDropDown()}break;case"clear":{this._currentInputTextValue=this._editorInput.val();if(this._editorIsCleared()){if(!this.options.allowNullValue){this._clearValue()}return}if(!this._editMode){this._clearValue();this._processTextChanged();this._exitEditMode();this._triggerValueChanged()}else{this._clearValue(true);this._processTextChanged();this._positionCursor()}}break}}},_triggerDropDownClosing:function(){var args={editor:this._editorContainer,owner:this,editorInput:this._editorInput,list:this._dropDownList};return this._trigger(this.events.dropDownListClosing,null,args)},_triggerDropDownClosed:function(){var args={editor:this._editorContainer,owner:this,editorInput:this._editorInput,list:this._dropDownList};this._trigger(this.events.dropDownListClosed,null,args)},_triggerDropDownOpening:function(){var args={editor:this._editorContainer,owner:this,editorInput:this._editorInput,list:this._dropDownList};return this._trigger(this.events.dropDownListOpening,null,args)},_triggerDropDownOpened:function(){var args={owner:this,editorInput:this._editorInput,list:this._dropDownList};if(this._scrollTopDropDownPosition!==undefined){this._dropDownList.scrollTop(this._scrollTopDropDownPosition)}return this._trigger(this.events.dropDownListOpened,null,args)},_triggerDropDownItemSelecting:function(item){var args={editor:this._editorContainer,owner:this,editorInput:this._editorInput,list:this._dropDownList,item:item};return this._trigger(this.events.dropDownItemSelecting,null,args)},_triggerDropDownItemSelected:function(){var args={owner:this,editorInput:this._editorInput,list:this._dropDownList,item:this.getSelectedListItem()[0]};this._trigger(this.events.dropDownItemSelected,null,args)},_processTextChanged:function(){var currentVal=this._editorInput.val(),previousVal=this._currentInputTextValue;if(currentVal!==previousVal){if(previousVal===undefined){previousVal=""}this._triggerTextChanged(previousVal,currentVal);if(this._editMode&&this._dropDownList){this._updateDropdownSelection(this._valueFromText(currentVal))}if(this._validator){this._validator._validateInternal(this.element,null,false,this._editMode?this._valueFromText(currentVal):this.value())}this._currentInputTextValue=currentVal}this._checkClearButtonState();this._setSpinButtonsState(currentVal)},_triggerTextChanged:function(oldValue,newValue){var args={owner:this,text:newValue,oldText:oldValue?oldValue:""};this._trigger(this.events.textChanged,null,args)},_checkClearButtonState:function(){if(this._clearButton){if(this._editorIsCleared()){this._clearButton.hide()}else{this._clearButton.show()}}},_editorIsCleared:function(){var result=false,currentVal=this._editorInput.val();if(currentVal===""){result=true}return result},_elementPositionInViewport:function(el){var areaTop=Math.ceil(el.parent().igOffset().top),elementoffset=Math.ceil(el.igOffset().top),elementHeight=Math.ceil(el.outerHeight()),listVisibleHeight=el.parent().outerHeight(),result;if(elementoffset-areaTop<0){result="top"}else if(elementoffset+elementHeight-areaTop<listVisibleHeight){result="inside"}else if(elementoffset+elementHeight-areaTop>listVisibleHeight){result="bottom"}return result},_hoverPreviousDropDownListItem:function(){var newItem,position,currentItem=this._listItems().filter("[data-active='true']");newItem=this._getSpinItem("up",currentItem);if(newItem.length>0){position=this._elementPositionInViewport(newItem);if(position==="top"){this._dropDownList.scrollTop(this._dropDownList.scrollTop()-newItem.outerHeight())}else if(position==="bottom"){this._dropDownList.scrollTop(this._dropDownList.scrollTop()+newItem.igPosition().top)}currentItem.removeClass(this.css.listItemActive,this.options.listItemHoverDuration);currentItem.removeAttr("data-active");newItem.addClass(this.css.listItemActive,this.options.listItemHoverDuration);newItem.attr("data-active",true)}},_hoverNextDropDownListItem:function(){var newItem,position,currentItem=this._listItems().filter("[data-active='true']");newItem=this._getSpinItem("down",currentItem);if(newItem.length>0){position=this._elementPositionInViewport(newItem);if(position==="bottom"){this._dropDownList.scrollTop(this._dropDownList.scrollTop()+newItem.outerHeight())}else if(position==="top"){this._dropDownList.scrollTop(this._dropDownList.scrollTop()+newItem.igPosition().top)}currentItem.removeClass(this.css.listItemActive,this.options.listItemHoverDuration);currentItem.removeAttr("data-active");newItem.addClass(this.css.listItemActive,this.options.listItemHoverDuration);newItem.attr("data-active",true)}},_pasteHandler:function(e,drop){var self=this,previousValue=$(e.target).val(),newValue,selection;this._currentInputTextValue=this._editorInput.val();this._timeouts.push(setTimeout(function(){newValue=self._editorInput.val();selection=self._getSelection(self._editorInput[0]);self._insert(newValue,previousValue,selection);if(drop){if(self._editorInput.is(":focus")){self._triggerFocus(e)}else{self._processValueChanging(newValue);self._focused=false;self._exitEditMode()}}},10))},_insertHandler:function(string){var selection=this._getSelection(this.field()[0]),previousValue,newValue;if(string){if(this._editMode){previousValue=this._editorInput.val();newValue=this._replaceDisplayValue(selection,previousValue,string)}else{previousValue=this.value();newValue=string}this._insert(newValue,previousValue)}},_replaceDisplayValue:function(selection,previousValue,string){return previousValue.substring(0,selection.start)+string+previousValue.substring(selection.end,previousValue.length)},_insert:function(newValue,previousValue,selection){var i,ch;if(this.options.maxLength){if(newValue&&newValue.toString().length>this.options.maxLength){newValue=newValue.toString().substring(0,this.options.maxLength);this._sendNotification("warning",{optName:"maxLengthErrMsg",arg:this.options.maxLength})}}if(this._validateValue(newValue)){if(this.options.toUpper){if(newValue){newValue=newValue.toLocaleUpperCase()}}else if(this.options.toLower){if(newValue){newValue=newValue.toLocaleLowerCase()}}if(this.options.includeKeys!==null){for(i=0;i<newValue.length;i++){ch=newValue.charAt(i);if($.inArray(ch,this._includeKeysArray)!==-1){continue}else{newValue=this._replaceCharAt(newValue,i,"");i--}}}if(this.options.excludeKeys!==null){for(i=0;i<newValue.length;i++){ch=newValue.charAt(i);if($.inArray(ch,this._excludeKeysArray)!==-1){newValue=this._replaceCharAt(newValue,i,"");i--}}}if(this._editMode){this._editorInput.val(newValue);if(selection!==undefined){this._setSelectionRange(this._editorInput[0],selection.start,selection.end)}}else{this._processInternalValueChanging(newValue);this._exitEditMode()}this._processTextChanged()}else{this._editorInput.val(previousValue)}},_markDropDownHoverActiveItem:function(){var activeItem=this._dropDownList.children(".ui-igedit-listitem").filter(".ui-igedit-listitemselected");if(!activeItem.length){return}if(this._dropDownList.parent().hasClass("ui-effects-wrapper")){this._scrollTopDropDownPosition=this._dropDownList.scrollTop()+activeItem.position().top}if(this._elementPositionInViewport(activeItem)!=="inside"){this._dropDownList.scrollTop(this._dropDownList.scrollTop()+activeItem.igPosition().top)}activeItem.attr("data-active",true)},_clearDropDownHoverActiveItem:function(){var hoveredItem=this._dropDownList.children(".ui-igedit-listitem").filter("[data-hovered='true']"),activeItem=this._dropDownList.children(".ui-igedit-listitem").filter("[data-active='true']");if(hoveredItem.length>0){hoveredItem.removeClass(this.css.listItemHover);hoveredItem.removeAttr("data-hovered")}if(activeItem.length>0){activeItem.removeClass(this.css.listItemActive);activeItem.removeAttr("data-active")}},_showDropDownList:function(){var direction;this._positionDropDownList();if(this._dropDownListOrientation==="up"){direction="down"}else{direction="up"}try{$(this._dropDownList).show("blind",{direction:direction},this.options.dropDownAnimationDuration,$.proxy(this._triggerDropDownOpened,this))}catch(ex){$(this._dropDownList).show(this.options.dropDownAnimationDuration,$.proxy(this._triggerDropDownOpened,this))}this._editorInput.attr("aria-expanded",true);this._markDropDownHoverActiveItem()},_hideDropDownList:function(){var direction;if(this._dropDownListOrientation==="up"){direction="down"}else{direction="up"}try{$(this._dropDownList).hide("blind",{direction:direction},this.options.dropDownAnimationDuration,$.proxy(this._triggerDropDownClosed,this))}catch(ex){$(this._dropDownList).hide(this.options.dropDownAnimationDuration,$.proxy(this._triggerDropDownClosed,this))}this._editorInput.attr("aria-expanded",false);this._clearDropDownHoverActiveItem()},_toggleDropDown:function(){var noCancel;if(this._dropDownList.is(":visible")){noCancel=this._triggerDropDownClosing();if(noCancel){this._hideDropDownList()}}else{noCancel=this._triggerDropDownOpening();if(noCancel){if(!this._editMode&&!this.options.suppressKeyboard){this._editorInput.focus()}if(this._editMode&&this.options.suppressKeyboard){this._editorInput.blur()}this._showDropDownList()}}},_validateKey:function(event){var ch,result;if(this.options.excludeKeys){ch=String.fromCharCode(event.charCode||event.which);if($.inArray(ch,this._excludeKeysArray)!==-1){result=false}else{result=true}}else if(this.options.includeKeys){ch=String.fromCharCode(event.charCode||event.which);if($.inArray(ch,this._includeKeysArray)!==-1){result=true}else{result=false}}else{result=true}return result},_enterEditMode:function(){var val=this._valueInput.val(),selection=this._getSelection(this._editorInput[0]);this._editMode=true;this._currentInputTextValue=this._editorInput.val();this._editorInput.val(this._getEditModeValue(val));this._positionCursor(selection.start,selection.end);this._processTextChanged()},_getEditModeValue:function(val){return val},_exitEditMode:function(){if(this.options.textMode==="text"&&!$.ig.util.isIE8){this._editorInput.attr("type","text")}this._currentInputTextValue=this._editorInput.val();this._editorInput.val(this._getDisplayValue());this._editMode=false;this._processTextChanged()},_getDisplayValue:function(){return this._valueInput.val()},_valueFromText:function(text){return text},_setCursorPosition:function(positionIndex){this._setSelectionRange(this._editorInput[0],positionIndex,positionIndex)},_setSelectionRange:function(input,selectionStart,selectionEnd){if(input.setSelectionRange){if(!$.contains(document.documentElement,input)&&$.ig.util.isIE){return}input.setSelectionRange(selectionStart,selectionEnd)}else if(input.createTextRange){var range=input.createTextRange();range.collapse(true);range.moveEnd("character",selectionEnd);range.moveStart("character",selectionStart);range.select()}},_positionCursor:function(startPosition,endPosition){if(this._dragging){return}var currentValue=this._editorInput.val(),self=this;if(currentValue&&currentValue.length>0){switch(this.options.selectionOnFocus){case"selectAll":{if($.ig.util.isChrome||$.ig.util.isSafari){this._timeouts.push(setTimeout(function(){self._setSelectionRange(self._editorInput[0],0,currentValue.length)},100))}else{this._editorInput.select()}}break;case"atStart":{if($.ig.util.isChrome||$.ig.util.isSafari){this._timeouts.push(setTimeout(function(){self._setSelectionRange(self._editorInput[0],0,0)},100))}else{this._setSelectionRange(this._editorInput[0],0,0)}}break;case"atEnd":{if($.ig.util.isChrome||$.ig.util.isSafari){this._timeouts.push(setTimeout(function(){self._setSelectionRange(self._editorInput[0],currentValue.length,currentValue.length)},100))}else{this._setSelectionRange(this._editorInput[0],currentValue.length,currentValue.length)}}break;case"browserDefault":{if(startPosition>=0){if(endPosition){if(endPosition>currentValue.length){endPosition=currentValue.length}}else{endPosition=startPosition}if($.ig.util.isChrome||$.ig.util.isSafari){this._timeouts.push(setTimeout(function(){self._setSelectionRange(self._editorInput[0],startPosition,endPosition)},100))}else{this._setSelectionRange(this._editorInput[0],startPosition,endPosition)}}else{if($.ig.util.isChrome||$.ig.util.isSafari){this._timeouts.push(setTimeout(function(){self._setSelectionRange(self._editorInput[0],0,currentValue.length)},100))}else{this._editorInput.select()}}}break;default:break}}else{this._editorInput.select()}},_carryOverNewLine:function(value){var cursorPosition=this._getCursorPosition(),substrings=this._splitString(value,cursorPosition);this._editorInput.val(substrings.before+"\r\n"+substrings.after);this._setCursorPosition(cursorPosition+1)},_splitString:function(value,index){return{before:value.substring(0,index),after:value.substring(index)}},_spin:function(type,fireEvent){var nextItem;if(this._dropDownList){nextItem=this._getSpinItem(type);if(!nextItem.length){return}if(fireEvent&&!this._triggerDropDownItemSelecting(nextItem[0])){return}this._currentInputTextValue=this._editorInput.val();if(this._editMode){this._editorInput.val(nextItem.text());this._processTextChanged();this._editorInput.select()}else{this._processValueChanging(nextItem.text());this._editorInput.val(this._getDisplayValue());this._processTextChanged()}if(fireEvent){this._triggerDropDownItemSelected()}}},_getSpinItem:function(spinType,selected){var items=this._listItems(),newItem,currentItem;if(!items.length){return items}if(selected){currentItem=selected}else{currentItem=this.getSelectedListItem()}if(currentItem.length>0){newItem=currentItem[spinType==="up"?"prev":"next"]();if(!newItem.length&&this.options.spinWrapAround){newItem=items[spinType==="up"?"last":"first"]()}return newItem}else{return items.first()}},_handleSpinUpEvent:function(){this._spin("up",true)},_handleSpinDownEvent:function(){this._spin("down",true)},_handleSpinEvent:function(type,target){var self=this;if(type==="spinUp"){this._handleSpinUpEvent();if(!target.attr("disabled")&&!target._spinTimeOut){target._spinTimeOut=setTimeout(function(){target._spinInterval=setInterval(function(){self._handleSpinUpEvent()},75)},300)}}else if(type==="spinDown"){this._handleSpinDownEvent();if(!target.attr("disabled")&&!target._spinTimeOut){target._spinTimeOut=setTimeout(function(){target._spinInterval=setInterval(function(){self._handleSpinDownEvent()},75)},300)}}this._timeouts.push(target._spinTimeOut)},_clearValue:function(textOnly){this._super(textOnly)},_clearEditorNotifier:function(){var notifier=this._editorContainer.data("igNotifier");if(notifier&&notifier.options.state==="warning"&&notifier.isVisible()){notifier.hide()}},_getCursorPosition:function(){var selection=this._getSelection(this._editorInput[0]);if(selection.end-selection.start===this._editorInput.val().length&&this._editorInput.val().length>0){return-1}else{return selection.start}},_getSelection:function(editor){var startPosition=0,endPosition=0;if(editor.selectionStart!==undefined){startPosition=editor.selectionStart;endPosition=editor.selectionEnd}else if(document.selection){var globalSelection=document.selection.createRange(),range,rangeClone;if(globalSelection!==null){range=editor.createTextRange();rangeClone=range.duplicate();range.moveToBookmark(globalSelection.getBookmark());endPosition=range.text.length;rangeClone.setEndPoint("EndToStart",range);startPosition=rangeClone.text.length;endPosition+=startPosition}}return{start:startPosition,end:endPosition}},_listItems:function(){return this._dropDownList.children(".ui-igedit-listitem")},_getListItemByIndex:function(index){return this._listItems().eq(index)},_getSelectedItemIndex:function(){var items=this._listItems(),i;for(i=0;i<items.length;i++){if($(items[i]).hasClass(this.css.listItemSelected)){return i}}return-1},_setSelectedItemByIndex:function(index){var oldSelectedItem,newSelectedItem,position;if(this._getSelectedItemIndex()!==index){oldSelectedItem=this.getSelectedListItem();oldSelectedItem.removeClass(this.css.listItemSelected);oldSelectedItem.removeAttr("data-active");oldSelectedItem.attr("aria-selected",false);newSelectedItem=this._getListItemByIndex(index);newSelectedItem.addClass(this.css.listItemSelected);newSelectedItem.attr("aria-selected",true);if(this.dropDownVisible()){position=this._elementPositionInViewport(newSelectedItem);if(position!=="inside"){this._dropDownList.scrollTop(this._dropDownList.scrollTop()+newSelectedItem.igPosition().top)}this._clearDropDownHoverActiveItem();newSelectedItem.attr("data-active",true)}}},_updateDropdownSelection:function(currentVal){var current=this.getSelectedListItem().index(),selectedIndex=this._valueIndexInList(currentVal);if(current!==selectedIndex){if(selectedIndex>-1){this._setSelectedItemByIndex(selectedIndex)}else{this.getSelectedListItem().removeClass(this.css.listItemSelected).attr("aria-selected",false).removeAttr("data-active");if(this.dropDownVisible()){this._clearDropDownHoverActiveItem()}}}},displayValue:function(){return this._getDisplayValue()},dropDownContainer:function(){return this._dropDownList?this._dropDownList:null},showDropDown:function(){this._showDropDownList()},hideDropDown:function(){this._hideDropDownList()},dropDownButton:function(){return this._dropDownButton},dropDownVisible:function(){return this._dropDownList.is(":visible");
},clearButton:function(){return this._clearButton},findListItemIndex:function(text,matchType){var list=this.options.listItems,matchCase="i",index=-1,regString,regExp,i;if(!list||list.length===0){return-1}switch(matchType){case"startsWith":regString="^{pattern}";break;case"endsWith":regString="{pattern}$";break;case"exact":regString="^{pattern}$";matchCase=undefined;break;default:regString="{pattern}";break}regExp=new RegExp(regString.replace("{pattern}",$.ig.util.escapeRegExp(text)),matchCase);for(i=0;i<list.length;i++){if(regExp.test(list[i])){index=i}}return index},selectedListIndex:function(index){if(index!==undefined&&typeof this.options.listItems[index]!=="undefined"){this._processInternalValueChanging(this.options.listItems[index])}else{return this._getSelectedItemIndex()}},getSelectedListItem:function(){return this._listItems().filter(".ui-igedit-listitemselected")},getSelectedText:function(){var text=this._editMode?this._editorInput.val():this.displayValue(),startIndex=this.getSelectionStart(),endIndex=this.getSelectionEnd();if(startIndex===undefined||endIndex===undefined||startIndex===null||endIndex===null||startIndex===endIndex){return""}return text.substring(startIndex,endIndex)},getSelectionStart:function(){return this._getSelection(this._editorInput[0]).start},getSelectionEnd:function(){return this._getSelection(this._editorInput[0]).end},insert:function(string){this._insertHandler(string)},select:function(start,end){this._setSelectionRange(this._editorInput[0],start,end)},spinUp:function(){this._spin("up")},spinDown:function(){this._spin("down")},spinUpButton:function(){return this._spinUpButton},spinDownButton:function(){return this._spinDownButton}});$.extend($.ui.igTextEditor,{version:"21.2.12"});$.widget("ui.igNumericEditor",$.ui.igTextEditor,{options:{listItems:null,negativeSign:null,negativePattern:null,decimalSeparator:null,groupSeparator:null,groups:null,maxDecimals:null,minDecimals:null,roundDecimals:true,textAlign:"right",dataMode:"double",minValue:null,maxValue:null,allowNullValue:false,spinDelta:1,scientificFormat:null,spinWrapAround:false,isLimitedToListValues:false,maxLength:null,excludeKeys:null,includeKeys:null,toLower:null,toUpper:null,textMode:"text",value:null},events:{},css:{negative:"ui-igedit-negative"},_create:function(){$.ui.igTextEditor.prototype._create.call(this);if(!$.ig.util.isIE8){this._editorInput.attr("type","tel")}},_initialize:function(){this._super();this._setNumericType();this._validateDecimalSettings();this._validateRegionalSettings();this._applyDataModeSettings();var numericChars="0123456789",dataMode=this.options.dataMode;if(dataMode==="double"||dataMode==="float"){numericChars+=this._getOptionOrRegionalValue("decimalSeparator");if(this._getOptionOrRegionalValue("decimalSeparator")!=="."){numericChars+="."}}if(this._getScientificFormat()){numericChars+=this._getScientificFormat()}if(dataMode==="double"||dataMode==="float"||dataMode==="long"||dataMode==="int"||dataMode==="short"||dataMode==="sbyte"){numericChars+=this._getRegionalValue("negativeSign")}if(this.options.excludeKeys){this.options.excludeKeys=null}if(this._getOptionOrRegionalValue("decimalSeparator").toString().length>1){throw new Error(this._getLocaleValue("decimalSeparatorErrorMsg"))}this.options.includeKeys=numericChars;if(this._getOptionOrRegionalValue("decimalSeparator")===this._getOptionOrRegionalValue("groupSeparator")){throw new Error(this._getLocaleValue("decimalSeparatorEqualsGroupSeparatorErrorMsg"))}},_setNumericType:function(){this._numericType="numeric"},_getScientificFormat:function(){var result;if(this.options.scientificFormat){switch(this.options.scientificFormat){case"E":case"E+":{result="E"}break;case"e":case"e+":{result="e"}break;default:{result="e";throw new Error(this._getLocaleValue("scientificFormatErrMsg"))}}}else{result=null}return result},_validateRegionalSettings:$.noop,_getOptionOrRegionalValue:function(name){var regName;if(name==="negativeSign"||name==="percentSymbol"||name==="currencySymbol"||name==="displayFactor"){regName=name}else{regName=this._numericType+name.substr(0,1).toUpperCase()+name.substr(1)}return this.options[name]!==null?this.options[name]:this._getRegionalValue(regName)},_setInitialValue:function(value){value=this._getValueBetweenMinMax(value);this._super(value)},_applyOptions:function(){this._super();this._validateSpinSettings();if(this.options.maxLength!==null){this.options.maxLength=null}if(this.options.value<0){this._editorInput.addClass(this.css.negative)}},_validateSpinSettings:function(){var delta,fractional;if(this.options.buttonType==="spin"){this._setSpinButtonsState(this.options.value)}if(this.options.spinDelta!==1){delta=this.options.spinDelta;if(typeof delta!=="number"){this.options.spinDelta=1;throw new Error(this._getLocaleValue("spinDeltaIsOfTypeNumber"))}if(delta<0){this.options.spinDelta=1;throw new Error(this._getLocaleValue("spinDeltaCouldntBeNegative"))}if(this.options.dataMode==="float"||this.options.dataMode==="double"){if(delta%1!==0){fractional=delta.toString().substring(delta.toString().indexOf(".")+1);if(fractional.toString().length>this._getOptionOrRegionalValue("maxDecimals")){throw new Error($.ig.util.stringFormat(this._getLocaleValue("spinDeltaContainsExceedsMaxDecimals"),this._getOptionOrRegionalValue("maxDecimals")))}}}else{if(delta%1!==0){throw new Error(this._getLocaleValue("spinDeltaIncorrectFloatingPoint"))}}}if(this.options.scientificFormat){this.options.spinDelta=Number(this.options.spinDelta.toExponential())}},_validateDecimalSettings:function(){var minDecimalsName=this._numericType+"MinDecimals",maxDecimalsName=this._numericType+"MaxDecimals";if(this.options.minDecimals===null){this.options.minDecimals=this._getRegionalValue(minDecimalsName)}try{this._validateDecimalSetting("minDecimals",this.options.minDecimals)}catch(e){this.options.minDecimals=this._getRegionalValue(minDecimalsName);throw e}if(this.options.maxDecimals===null){this.options.maxDecimals=this._getRegionalValue(maxDecimalsName)}try{this._validateDecimalSetting("maxDecimals",this.options.maxDecimals)}catch(e){this.options.maxDecimals=this._getRegionalValue(maxDecimalsName);throw e}this._validateDecimalMinMax()},_validateDecimalSetting:function(name,value){var mode=this.options.dataMode,boundary;if(mode==="double"){boundary=15}else if(mode==="float"){boundary=7}if(value===""||isNaN(value)||!isNaN(value)&&(value<0||value>boundary)){throw new Error($.ig.util.stringFormat(this._getLocaleValue("decimalNumber"),mode,name,boundary))}},_validateDecimalMinMax:function(){if(this._getOptionOrRegionalValue("minDecimals")>this._getOptionOrRegionalValue("maxDecimals")){this.options.maxDecimals=this._getOptionOrRegionalValue("minDecimals")}},_getValueBetweenMinMax:function(value){if(!(this.options.allowNullValue&&value===this.options.nullValue)){if(!isNaN(this.options.minValue)&&this.options.minValue>value){value=this.options.minValue}else if(!isNaN(this.options.maxValue)&&this.options.maxValue<value){value=this.options.maxValue}}return value},_setOption:function(option,value){var prevValue=this.options[option];if(prevValue===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"scientificFormat":if(this._getScientificFormat()||value===null){if(prevValue){if(prevValue==="e+"||prevValue==="E+"){prevValue=prevValue.replace("+","")}this.options.includeKeys=this.options.includeKeys.replace(prevValue,"")}if(value===null){this._includeKeysArray=this.options.includeKeys.split("");break}var numericChars=this._getScientificFormat();this.options.includeKeys+=numericChars;this._includeKeysArray=this.options.includeKeys.split("")}break;case"spinDelta":if(typeof value!=="number"){this.options[option]=prevValue;throw new Error(this._getLocaleValue("spinDeltaIsOfTypeNumber"))}else if(value<0){this.options[option]=prevValue;throw new Error(this._getLocaleValue("spinDeltaCouldntBeNegative"))}else if(this.options.dataMode!=="float"&&this.options.dataMode!=="double"&&value%1!==0){this.options[option]=prevValue;throw new Error(this._getLocaleValue("spinDeltaIncorrectFloatingPoint"))}else if(this.options.scientificFormat){this.options[option]=Number(value.toExponential())}break;case"minValue":case"maxValue":if(isNaN(value)){this.options[option]=prevValue;return}if(value===null){this._applyDataModeSettings()}else{this._processInternalValueChanging(this.value());if(!this._editMode){this._editorInput.val(this._getDisplayValue())}}this._setSpinButtonsState(this.value());break;case"minDecimals":case"maxDecimals":try{this._validateDecimalSetting(option,value)}catch(e){this.options[option]=prevValue;throw e}if(this.options[option]!==prevValue){this._validateDecimalMinMax();this._processInternalValueChanging(this.value());if(!this._editMode){this._editorInput.val(this._getDisplayValue())}}break;case"decimalSeparator":if(value.toString().length>1){this.options[option]=prevValue;throw new Error(this._getLocaleValue("decimalSeparatorErrorMsg"))}if(this.options[option]===this._getOptionOrRegionalValue("groupSeparator")){throw new Error(this._getLocaleValue("decimalSeparatorEqualsGroupSeparatorErrorMsg"))}break;case"groupSeparator":if(this.options[option]===null){this.options[option]=this._getRegionalValue("numericGroupSeparator")}if(this.options[option]===this._getOptionOrRegionalValue("decimalSeparator")){throw new Error(this._getLocaleValue("decimalSeparatorEqualsGroupSeparatorErrorMsg"))}break;case"excludeKeys":case"includeKeys":this.options[option]=prevValue;throw new Error(this._getLocaleValue("numericEditorNoSuchOption"));default:this.options[option]=prevValue;this._super(option,value);break}},_processValueChanging:function(value){var displayFactor=this._getOptionOrRegionalValue("displayFactor");if(typeof value==="string"||value instanceof String){value=value.trim();value=this._parseNumericValueByMode(value,this._numericType,this.options.dataMode);if(value===""&&!this.options.allowNullValue){value=0}if(this._numericType==="percent"&&displayFactor){if(value!==""&&!isNaN(value)){value=this._divideWithPrecision(value,displayFactor)}}}this._super(value)},_processInternalValueChanging:function(value){value=this._parseNumericValueByMode(value,this._numericType,this.options.dataMode);if(value!==""&&!isNaN(value)){if(!isNaN(this.options.maxValue)&&value>this.options.maxValue){value=this.options.maxValue;this._sendNotification("warning",{optName:"maxValExceedSetErrMsg",arg:this.options.maxValue})}else if(!isNaN(this.options.minValue)&&value<this.options.minValue){value=this.options.minValue;this._sendNotification("warning",{optName:"minValExceedSetErrMsg",arg:this.options.minValue})}}if(!this._validateValue(value)){if(value!==""&&!isNaN(value)){if(this.options.revertIfNotValid){value=this._valueInput.val()}else if(this.options.isLimitedToListValues){value=""}}else{if(this.options.allowNullValue){value=this.options.nullValue}else{if(this.options.revertIfNotValid){value=this._valueInput.val()}else{value=0;if(this.options.minValue>0){value=this.options.minValue}else if(this.options.maxValue<0){value=this.options.maxValue}else{value=0}}}}}if(value!==this.value()){if(value===""&&this.options.allowNullValue&&this.options.nullValue===null){this._clearValue()}else{this._updateValue(value)}}this._setSpinButtonsState(value)},_triggerKeyDown:function(event){var e=event,noCancel,args,currentInputVal;args={owner:this,element:event.target,key:event.keyCode,editorInput:this._editorInput};noCancel=this._trigger(this.events.keydown,event,args);if(noCancel){this._clearEditorNotifier();if(e.keyCode===13){currentInputVal=this._editorInput.val();if(this._dropDownList&&this._dropDownList.is(":visible")){this._super(event)}else{this._processValueChanging(currentInputVal);this._enterEditMode()}}else if(e.keyCode===38){if(e.altKey&&this._dropDownList&&this._dropDownList.is(":visible")){this._toggleDropDown()}else if(this._dropDownList&&this._dropDownList.is(":visible")){this._hoverPreviousDropDownListItem()}else if(!this.options.readOnly||this.options.readOnly&&this.options.isLimitedToListValues){this._handleSpinUpEvent()}e.preventDefault()}else if(e.keyCode===40){if(e.altKey&&this._dropDownList&&!this._dropDownList.is(":visible")){this._toggleDropDown()}else if(this._dropDownList&&this._dropDownList.is(":visible")){this._hoverNextDropDownListItem()}else if(!this.options.readOnly||this.options.readOnly&&this.options.isLimitedToListValues){this._handleSpinDownEvent()}e.preventDefault()}else if(e.keyCode===27&&this._dropDownList&&this._dropDownList.is(":visible")){this._toggleDropDown()}}return noCancel},_applyDataModeSettings:function(){switch(this.options.dataMode){case"double":{this._setMinMaxValues(-Number.MAX_VALUE,Number.MAX_VALUE)}break;case"float":{var floatMinValue=-3.40282347e38,floatMaxValue=3.40282347e38;this._setMinMaxValues(floatMinValue,floatMaxValue)}break;case"long":{var longMinValue=-0x8000000000000000,longMaxValue=0x8000000000000000;this._setMinMaxValues(longMinValue,longMaxValue)}break;case"ulong":{var ulongMinValue=0,ulongMaxValue=0x10000000000000000;this._setMinMaxValues(ulongMinValue,ulongMaxValue)}break;case"int":{var intMinValue=-2147483647,intMaxValue=2147483647;this._setMinMaxValues(intMinValue,intMaxValue)}break;case"uint":{var uintMinValue=0,uintMaxValue=4294967295;this._setMinMaxValues(uintMinValue,uintMaxValue)}break;case"short":{var shortMinValue=-32768,shortMaxValue=32767;this._setMinMaxValues(shortMinValue,shortMaxValue)}break;case"ushort":{var ushortMinValue=0,ushortMaxValue=65535;this._setMinMaxValues(ushortMinValue,ushortMaxValue)}break;case"sbyte":{var sbyteMinValue=-127,sbyteMaxValue=127;this._setMinMaxValues(sbyteMinValue,sbyteMaxValue)}break;case"byte":{var byteMinValue=0,byteMaxValue=256;this._setMinMaxValues(byteMinValue,byteMaxValue)}break;default:{this.options.dataMode="double";this._setMinMaxValues(Number.MIN_VALUE,Number.MAX_VALUE)}}},_setMinMaxValues:function(typeMinValue,typeMaxValue){if(this.options.minValue===null||this.options.minValue<typeMinValue){this.options.minValue=typeMinValue}if(this.options.maxValue===null||this.options.maxValue>typeMaxValue){this.options.maxValue=typeMaxValue}},_parseNumericValueByMode:function(value,numericEditorType,dataMode){var val,stringValue,exponent,exponentIndex,decimalSeparator=this._getOptionOrRegionalValue("decimalSeparator"),groupSeparator=this._getOptionOrRegionalValue("groupSeparator"),maxDecimals=this._getOptionOrRegionalValue("maxDecimals");if(value===null||value===""){return value}if($.type(value)!=="number"){value=$.ig.util.IMEtoNumberString(value,$.ig.util.IMEtoENNumbersMapping());value=value.toString().replace(new RegExp($.ig.util.escapeRegExp(groupSeparator),"g"),"");if(this._getOptionOrRegionalValue("negativeSign")!=="-"){value=value.replace(this._getOptionOrRegionalValue("negativeSign"),"-")}if(numericEditorType==="percent"){value=value.replace(this._getOptionOrRegionalValue("percentSymbol"),"").trim()}else if(numericEditorType==="currency"){value=value.replace(this._getOptionOrRegionalValue("currencySymbol"),"").trim()}if(value.indexOf(decimalSeparator)!==-1){value=value.replace(decimalSeparator,".")}}if(dataMode==="double"||dataMode==="float"){stringValue=value.toString().toLowerCase();if(stringValue.indexOf("e")!==-1){val=value=Number(value);if(value<1){if(!this.options.scientificFormat){stringValue=value.toFixed(this._getOptionOrRegionalValue("maxDecimals")+1)}else{stringValue=value.toString().toLowerCase();exponentIndex=stringValue.indexOf("e");exponent=stringValue.substring(exponentIndex+1);stringValue=stringValue.substring(0,exponentIndex)}}else{return value}}if(stringValue.indexOf(".")!==-1){var integerDigits,fractionalDigits;decimalSeparator=".";fractionalDigits=stringValue.substring(stringValue.indexOf(decimalSeparator)+1);if(fractionalDigits.indexOf(decimalSeparator)>0){fractionalDigits=fractionalDigits.substring(0,fractionalDigits.indexOf(decimalSeparator))}if(fractionalDigits.length>maxDecimals){if(this.options.roundDecimals){stringValue=Math.round10(stringValue,-maxDecimals).toFixed(maxDecimals);if(stringValue.indexOf(decimalSeparator)>-1){fractionalDigits=stringValue.substring(stringValue.indexOf(decimalSeparator)+1)}else{fractionalDigits=""}}else{fractionalDigits=fractionalDigits.substring(0,maxDecimals)}}if(stringValue.indexOf(decimalSeparator)>-1){integerDigits=stringValue.substring(0,stringValue.indexOf(decimalSeparator))}else{integerDigits=stringValue}val=integerDigits+"."+fractionalDigits;if(exponent){val+="e"+exponent}val=val/1}else if(!exponent){val=parseInt(value)}}else{if(value.toString().toLowerCase().indexOf("e")!==-1){value=Number(value).toFixed()}if(this._numericType==="percent"&&this.options.displayFactor===100&&this.options.dataMode==="int"&&parseInt(value)!==parseInt(this._editorInput.val())){val=value}else{val=parseInt(value)}}return val},_multiplyWithPrecision:function(value1,value2,precision){var fractionalDigits,fractionalDigits2,result;if(!precision){fractionalDigits=value1.toString().indexOf(".")>0?value1.toString().substring(value1.toString().indexOf(".")+1):"";fractionalDigits2=value2.toString().indexOf(".")>0?value2.toString().substring(value2.toString().indexOf(".")+1):"";if(fractionalDigits2.length){fractionalDigits+=fractionalDigits2}precision=Math.pow(10,fractionalDigits.length)}value1*=precision;value2*=precision;result=value1*value2/(precision*precision);return result.toFixed(fractionalDigits.length)*1},_divideWithPrecision:function(value1,value2){var fractionalDigits,fractionalDigits2,precision;fractionalDigits=value1.toString().indexOf(".")>0?value1.toString().substring(value1.toString().indexOf(".")+1):"";fractionalDigits2=value2.toString().indexOf(".")>0?value2.toString().substring(value2.toString().indexOf(".")+1):"";if(fractionalDigits2.length>fractionalDigits.length){fractionalDigits=fractionalDigits2}precision=Math.pow(10,fractionalDigits.length);value1=this._multiplyWithPrecision(value1,precision);value2=this._multiplyWithPrecision(value2,precision);return value1/value2},_updateValue:function(value){var val=value,dataMode=this.options.dataMode;if(value===null){value=""}else{value=val=this._parseNumericValueByMode(value,this._numericType,dataMode)}this.options.value=val;this._valueInput.val(value);if(this._dropDownList){this._updateDropdownSelection(val)}},_validateKey:function(event){if(this._super(event)){var dataMode=this.options.dataMode,ch,val,negativeSign=this._getOptionOrRegionalValue("negativeSign"),nextCh,prevCh,leadPos=0,nextDirection=1,cursorPos=this._getCursorPosition(),isDecimal=event.which?event.which===46:false;ch=String.fromCharCode(event.charCode||event.which).toLowerCase();if(cursorPos===-1){return ch!=="e"}val=this._editorInput.val().toLowerCase();nextCh=val.substring(cursorPos,cursorPos+nextDirection);if(cursorPos===leadPos&&nextCh===negativeSign){return false}prevCh=val.substring(cursorPos-nextDirection,cursorPos);if(ch===negativeSign){return(cursorPos===leadPos||prevCh==="e")&&nextCh!==negativeSign}if(ch==="e"&&val.indexOf("e")!==-1){return false}if(dataMode==="double"||dataMode==="float"){var decimalSeparator=this._getOptionOrRegionalValue("decimalSeparator");if(decimalSeparator!=="."&&isDecimal&&(val.indexOf(".")!==-1||val.indexOf(decimalSeparator)!==-1)&&cursorPos!==-1){return false}if((ch===decimalSeparator||isDecimal)&&(val.indexOf(decimalSeparator)!==-1||val.indexOf(".")!==-1)&&cursorPos!==-1){return false}else{return true}}else{return true}}else{return false}},_validateValue:function(val){var result;if(this._super(val)&&!isNaN(val=this._parseNumericValueByMode(val,this._numericType,this.options.dataMode))){{result=true}}else{result=false}return result},_insert:function(newValue,previousValue,selection){var newLength=newValue.length,diff;if(!isNaN(newValue=this._parseNumericValueByMode(newValue,this._numericType,this.options.dataMode))){if(!isNaN(this.options.maxValue)&&newValue>this.options.maxValue){newValue=this.options.maxValue;this._sendNotification("warning",{optName:"maxValExceedSetErrMsg",arg:this.options.maxValue})}else if(!isNaN(this.options.minValue)&&newValue<this.options.minValue){newValue=this.options.minValue;this._sendNotification("warning",{optName:"minValExceedSetErrMsg",arg:this.options.minValue})}if(!this._validateValue(newValue)&&this.options.revertIfNotValid){newValue=previousValue}}else if(this.options.revertIfNotValid){newValue=previousValue}else{newValue=""}if(this._editMode){this._editorInput.val(this._getEditModeValue(newValue));if(selection!==undefined){diff=newLength-newValue.toString().length;selection.start-=diff;selection.end-=diff;this._setSelectionRange(this._editorInput[0],selection.start,selection.end)}}else{this._processInternalValueChanging(newValue);this._exitEditMode()}this._setSpinButtonsState(newValue);this._processTextChanged()},_clearValue:function(textOnly){var newValue=0;if(this.options.allowNullValue){newValue=this.options.nullValue}newValue=this._getValueBetweenMinMax(newValue);if(!this._validateValue(newValue)){newValue="";this._editorInput.val("")}else{this._editorInput.val(newValue)}if(!textOnly){this._updateValue(newValue)}},_convertScientificToNumeric:function(num){var stringValue=num.toString(),scientificPrecision=stringValue.substring(stringValue.toLowerCase().indexOf("e")+1);num=num/1;scientificPrecision=Math.abs(scientificPrecision);if(scientificPrecision<=20){if(scientificPrecision<this.options.minDecimals){scientificPrecision=this.options.minDecimals}stringValue=num.toFixed(scientificPrecision)}return stringValue},_getDisplayValue:function(){var value=this._valueInput.val(),decimalSeparator=this._getOptionOrRegionalValue("decimalSeparator"),decimalPoint=".",minDecimals=this._getOptionOrRegionalValue("minDecimals"),dataMode=this.options.dataMode,displayFactor=this._getOptionOrRegionalValue("displayFactor"),stringValue,displayValue,integerDigits,fractionalDigits,scientificValue,scientificExponent,negativeSign,positivePattern,negativePattern,groups,groupSeparator,symbol="";if(value===this.options.nullValue||value===""||isNaN(value)){if(isNaN(value)){this._valueInput.val("");return""}else{return value}}if(this._numericType!=="numeric"){positivePattern=this._getOptionOrRegionalValue("positivePattern");symbol=this._getOptionOrRegionalValue(this._numericType+"Symbol")}negativePattern=this._getOptionOrRegionalValue("negativePattern");var originalArray=this._getOptionOrRegionalValue("groups");groups=originalArray.filter(function(item){return item!==0});groupSeparator=this._getOptionOrRegionalValue("groupSeparator");if(this._numericType==="percent"&&displayFactor){value=this._multiplyWithPrecision(value,displayFactor);value=this._parseNumericValueByMode(value,this._numericType,this.options.dataMode)}stringValue=value.toString().toLowerCase();if(this.options.scientificFormat){if(stringValue.indexOf("e")===-1){stringValue=(stringValue/1).toExponential();scientificValue=stringValue.split("e")[0];scientificExponent=stringValue.split(/e\+?/).pop()}}else if(stringValue.indexOf("e")!==-1){stringValue=this._convertScientificToNumeric(stringValue)}displayValue=stringValue;if(dataMode==="double"||dataMode==="float"){if(stringValue.indexOf("e")!==-1){displayValue=stringValue}else{if(stringValue.indexOf(decimalPoint)!==-1){fractionalDigits=stringValue.substring(stringValue.indexOf(decimalPoint)+1);if(fractionalDigits.length<minDecimals){var missingDecimals=minDecimals-fractionalDigits.length;while(missingDecimals>0){fractionalDigits+="0";missingDecimals--}}integerDigits=stringValue.substring(0,stringValue.indexOf(decimalPoint))}else{integerDigits=stringValue;if(minDecimals>0){stringValue=parseInt(stringValue).toFixed(minDecimals);fractionalDigits=stringValue.substring(stringValue.indexOf(decimalPoint)+1)}}integerDigits=this._applyGroups(integerDigits,groups,groupSeparator);if(fractionalDigits&&fractionalDigits.length>0){displayValue=integerDigits+decimalSeparator+fractionalDigits}else{displayValue=integerDigits}}}else if(stringValue.indexOf("e")===-1){displayValue=this._applyGroups(value.toString(),groups,groupSeparator)}if(this.options.scientificFormat){if(scientificExponent>0){displayValue=scientificValue+this.options.scientificFormat+scientificExponent}else{displayValue=stringValue.replace("e",this._getScientificFormat())}displayValue=displayValue.replace(decimalPoint,decimalSeparator)}if(value<0){negativeSign=this._getOptionOrRegionalValue("negativeSign");displayValue=displayValue.replace("-","");displayValue=negativePattern.replace("n",displayValue).replace("$",symbol).replace("-",negativeSign)}else if(positivePattern){displayValue=positivePattern.replace("n",displayValue).replace("$",symbol)}return displayValue},_valueFromText:function(text){return this._parseNumericValueByMode(text,this._numericType,this.options.dataMode)},_applyGroups:function(integerDigits,groups,groupSeparator){var digitsPosition=integerDigits.length-1,br=1,l=groups.length,digitsLimit=0,group;group=groups.length>0?groups[0]:0;if(group>integerDigits.length||group===0){return integerDigits}if(parseFloat(integerDigits)<0){digitsLimit=1}for(digitsPosition;digitsPosition>digitsLimit;digitsPosition--){if(--group===0){integerDigits=integerDigits.substring(0,digitsPosition)+groupSeparator+integerDigits.substring(digitsPosition);if(br===l){group=groups[--br]}else{group=groups[br];br++}}}return integerDigits},_enterEditMode:function(){if(!$.ig.util.isIE8){this._editorInput.attr("type","tel")}if(this._valueInput.val()<0){this._editorInput.removeClass(this.css.negative)}this._super()},_getEditModeValue:function(val){if(this.options.scientificFormat){val=Number(val).toExponential().replace("e",this._getScientificFormat()).replace("+","")}else if(val.toString().indexOf("e")!==-1){val=this._convertScientificToNumeric(val).replace("+","")}if(this._getOptionOrRegionalValue("decimalSeparator")!=="."){val=val.toString().replace(".",this._getOptionOrRegionalValue("decimalSeparator"))}if(this._getOptionOrRegionalValue("negativeSign")!=="-"){val=val.toString().replace("-",this._getOptionOrRegionalValue("negativeSign"))}return val},_exitEditMode:function(){this._super();if(this.value()<0){this._editorInput.addClass(this.css.negative)}else{this._editorInput.removeClass(this.css.negative)}},_getSpinValue:function(spinType,currentValue,delta){var fractional,scientificPrecision,spinPrecision,valuePrecision,spinDelta,toFixedVal,precision,spinDeltaValue=this.options.spinDelta;if(delta){spinDeltaValue=Number(delta)}if(currentValue.toString().toLowerCase().indexOf("e")!==-1){currentValue=Number(currentValue);if(spinDeltaValue.toString().toLowerCase().indexOf("e")===-1){spinDelta=Number(spinDeltaValue.toExponential())}else{spinDelta=spinDeltaValue}if(spinType==="spinUp"){currentValue+=spinDelta}else{currentValue-=spinDelta}}else if(currentValue.toString().indexOf(".")!==-1){fractional=currentValue.substring(currentValue.toString().indexOf(".")+1);toFixedVal=fractional.toString().length;currentValue=currentValue/1;if(spinDeltaValue.toString().toLowerCase().indexOf("e")!==-1){currentValue=Number(currentValue.toExponential());scientificPrecision=spinDeltaValue.toString().toLowerCase().substring(spinDeltaValue.toString().toLowerCase().indexOf("e")+1);spinPrecision=Math.abs(scientificPrecision)}else{spinPrecision=spinDeltaValue.toString().toLowerCase().substring(spinDeltaValue.toString().toLowerCase().indexOf(".")+1).length;valuePrecision=currentValue.toString().substring(currentValue.toString().indexOf(".")+1).length;spinPrecision=valuePrecision>spinPrecision?valuePrecision:spinPrecision}precision=Math.pow(10,spinPrecision);if(spinType==="spinUp"){if(currentValue===0&&scientificPrecision){currentValue=spinDeltaValue.toFixed(spinPrecision)}else{currentValue=(Math.round(currentValue*precision)+Math.round(spinDeltaValue*precision))/precision}}else{if(currentValue===0&&scientificPrecision){currentValue=(-spinDeltaValue).toFixed(spinPrecision)}else{currentValue=(Math.round(currentValue*precision)-Math.round(spinDeltaValue*precision))/precision}}if(currentValue.toString().substring(currentValue.toString().indexOf(".")+1).length<fractional.length){currentValue=currentValue.toFixed(toFixedVal)}}else{currentValue=currentValue/1;if(spinDeltaValue%1===0){if(spinType==="spinUp"){currentValue+=spinDeltaValue}else{currentValue-=spinDeltaValue}}else{if(spinDeltaValue.toString().toLowerCase().indexOf("e")!==-1){scientificPrecision=spinDeltaValue.toString().toLowerCase().substring(spinDeltaValue.toString().toLowerCase().indexOf("e")+1);spinPrecision=Math.abs(scientificPrecision)}else{spinPrecision=spinDeltaValue.toString().toLowerCase().substring(spinDeltaValue.toString().toLowerCase().indexOf(".")+1).length}precision=Math.pow(10,spinPrecision);if(spinType==="spinUp"){if(currentValue===0){currentValue=spinDeltaValue.toFixed(spinPrecision)}else{currentValue=(Math.round(currentValue*precision)+Math.round(spinDeltaValue*precision))/precision}}else{if(currentValue===0){currentValue=(-spinDeltaValue).toFixed(spinPrecision)}else{currentValue=(Math.round(currentValue*precision)-Math.round(spinDeltaValue*precision))/precision}}}}return currentValue},_spinUp:function(delta){var currVal,noCancel;if(this._dropDownList&&this.options.isLimitedToListValues){this._spin("up");return}if(this._focused){currVal=this._valueFromText(this._editorInput.val()).toString()}else{if(this.value()||this.value()===0){currVal=this.value().toString()}else{currVal=""}}this._clearEditorNotifier();this._currentInputTextValue=this._editorInput.val();currVal=this._getSpinValue("spinUp",currVal,delta);if(currVal>this.options.maxValue&&this.options.spinWrapAround||currVal<this.options.minValue||this._currentInputTextValue===this.options.maxValue.toString()&&this.options.spinWrapAround){currVal=this.options.minValue;this._sendNotification("warning",{optName:"maxValExceededWrappedAroundErrMsg",arg:this.options.maxValue})}else if(currVal>=this.options.maxValue&&!this.options.spinWrapAround){currVal=this.options.maxValue;this._sendNotification("warning",{optName:"maxValErrMsg",arg:[this.options.maxValue]})}if(this._focused){currVal=this._getEditModeValue(currVal);this._editorInput.val(currVal);this._processTextChanged()}else{noCancel=this._triggerValueChanging(currVal);if(noCancel){this._updateValue(currVal);this._exitEditMode();this._triggerValueChanged(currVal)}}this._setSpinButtonsState(currVal)},_editorIsCleared:function(){var result=false,currentVal=this._editorInput.val();if(currentVal===""||currentVal==="0"){result=true}return result},_spinDown:function(delta){var currVal,noCancel;if(this._dropDownList&&this.options.isLimitedToListValues){this._spin("down");return}if(this._focused){currVal=this._valueFromText(this._editorInput.val()).toString()}else{if(this.value()||this.value()===0){currVal=this.value().toString()}else{currVal=""}}this._clearEditorNotifier();this._currentInputTextValue=this._editorInput.val();currVal=this._getSpinValue("spinDown",currVal,delta);if(currVal<this.options.minValue&&this.options.spinWrapAround||currVal>this.options.maxValue||this._currentInputTextValue===this.options.minValue.toString()&&this.options.spinWrapAround){currVal=this.options.maxValue;this._sendNotification("warning",{optName:"minValExceededWrappedAroundErrMsg",arg:this.options.minValue})}else if(currVal<=this.options.minValue&&!this.options.spinWrapAround){currVal=this.options.minValue;this._sendNotification("warning",{optName:"minValErrMsg",arg:this.options.minValue})}if(this._focused){currVal=this._getEditModeValue(currVal);this._editorInput.val(currVal);this._processTextChanged()}else{noCancel=this._triggerValueChanging(currVal);if(noCancel){this._updateValue(currVal);this._exitEditMode();this._triggerValueChanged(currVal)}}this._setSpinButtonsState(currVal)},_exceedsMaxValue:function(value){if(this.options.isLimitedToListValues){return this._super(value)}return this.options.maxValue!==null&&value>=this.options.maxValue},_lessThanMinValue:function(value){if(this.options.isLimitedToListValues){return this._super(value)}return this.options.minValue!==null&&value<=this.options.minValue;
},_handleSpinUpEvent:function(){if(this._dropDownList&&this.options.isLimitedToListValues){this._super()}else{this._spinUp();if(this._focused){this._editorInput.select()}}},_handleSpinDownEvent:function(){if(this._dropDownList&&this.options.isLimitedToListValues){this._super()}else{this._spinDown();if(this._focused){this._editorInput.select()}}},_setSpinButtonsState:function(val){val=this._valueFromText(val);this._super(val)},value:function(newValue){if(newValue!==undefined){this._clearEditorNotifier();if(newValue!==null&&!isNaN(this._parseNumericValueByMode(newValue,this._numericType,this.options.dataMode))){if(newValue!==""&&!isNaN(newValue)){if(!isNaN(this.options.maxValue)&&newValue>this.options.maxValue){newValue=this.options.maxValue;this._sendNotification("warning",{optName:"maxValExceedSetErrMsg",arg:this.options.maxValue})}else if(!isNaN(this.options.minValue)&&newValue<this.options.minValue){newValue=this.options.minValue;this._sendNotification("warning",{optName:"minValExceedSetErrMsg",arg:this.options.value})}}if(this._validateValue(newValue)){this._updateValue(newValue);if(!this._focused){this._editorInput.val(this._getDisplayValue())}else{this._enterEditMode()}}else{if(newValue<this.options.minValue){newValue=this.options.minValue}else if(newValue>this.options.maxValue){newValue=this.options.maxValue}this._updateValue(newValue);if(!this._focused){this._editorInput.val(this._getDisplayValue())}else{this._enterEditMode()}}this._setSpinButtonsState(newValue)}else{if(this.options.revertIfNotValid&&!(newValue===null&&this.options.allowNullValue)){newValue=this._valueInput.val();this._updateValue(newValue)}else{this._clearValue()}}if(newValue<0){this._editorInput.addClass(this.css.negative)}else{this._editorInput.removeClass(this.css.negative)}}else{return this.options.value}this._checkClearButtonState()},findListItemIndex:function(number){var list=this.options.listItems,i;for(i=0;i<list.length;i++){if(this._parseNumericValueByMode(list[i],this._numericType,this.options.dataMode)===number){return i}}return-1},getSelectedText:function(){throw new Error(this._getLocaleValue("numericEditorNoSuchMethod"))},getSelectionStart:function(){throw new Error(this._getLocaleValue("numericEditorNoSuchMethod"))},getSelectionEnd:function(){throw new Error(this._getLocaleValue("numericEditorNoSuchMethod"))},spinUp:function(delta){this._spinUp(delta)},spinDown:function(delta){this._spinDown(delta)},selectListIndexUp:function(){this._spinUp()},selectListIndexDown:function(){this._spinDown()},getRegionalOption:function(){return this._getRegionalValue()},changeRegional:function(){if(this._focused){this._enterEditMode()}else{this._editorInput.val(this._getDisplayValue())}}});$.extend($.ui.igNumericEditor,{version:"21.2.12"});$.widget("ui.igCurrencyEditor",$.ui.igNumericEditor,{options:{positivePattern:null,currencySymbol:null},events:{},_create:function(){$.ui.igNumericEditor.prototype._create.call(this)},_setNumericType:function(){this._numericType="currency"},currencySymbol:function(symbol){if(symbol){this.options.currencySymbol=symbol}else{return this._getOptionOrRegionalValue("currencySymbol")}}});$.extend($.ui.igCurrencyEditor,{version:"21.2.12"});$.widget("ui.igPercentEditor",$.ui.igNumericEditor,{options:{positivePattern:null,percentSymbol:null,displayFactor:100,dataMode:"float",spinDelta:.01},events:{},_create:function(){$.ui.igNumericEditor.prototype._create.call(this)},_setNumericType:function(){this._numericType="percent"},_insert:function(newValue,previousValue,selection){var newLength=newValue.length,displayFactor=this._getOptionOrRegionalValue("displayFactor"),diff;if(!isNaN(newValue=this._parseNumericValueByMode(newValue,this._numericType,this.options.dataMode))){if(!isNaN(this.options.maxValue)&&newValue/displayFactor>this.options.maxValue){newValue=this.options.maxValue*displayFactor;this._sendNotification("warning",{optName:"maxValExceedSetErrMsg",arg:this.options.maxValue})}else if(!isNaN(this.options.minValue)&&newValue/displayFactor<this.options.minValue){newValue=this.options.minValue*displayFactor;this._sendNotification("warning",{optName:"minValExceedSetErrMsg",arg:this.options.minValue})}if(!this._validateValue(newValue/displayFactor)&&this.options.revertIfNotValid){newValue=previousValue}}else if(this.options.revertIfNotValid){newValue=previousValue}else{newValue=""}if(this._editMode){this._editorInput.val(newValue);if(selection!==undefined){diff=newLength-newValue.toString().length;selection.start-=diff;selection.end-=diff;this._setSelectionRange(this._editorInput[0],selection.start,selection.end)}}else{newValue=this._divideWithPrecision(newValue,displayFactor);this._processInternalValueChanging(newValue);this._exitEditMode()}this._setSpinButtonsState(newValue/displayFactor);this._processTextChanged()},_validateRegionalSettings:function(){if(this.options.displayFactor!==null){if(typeof this._getOptionOrRegionalValue("displayFactor")!=="number"){throw new Error(this._getLocaleValue("displayFactorIsOfTypeNumber"))}else if(this._getOptionOrRegionalValue("displayFactor")!==1&&this._getOptionOrRegionalValue("displayFactor")!==100){throw new Error(this._getLocaleValue("displayFactorAllowedValue"))}}},_getOptionOrRegionalValue:function(name){var regionalValue=this._super(name);if(name==="maxDecimals"&&this.options.displayFactor===100){regionalValue+=2}return regionalValue},_setOption:function(option,value){var prevValue=this.options[option];if(prevValue===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"displayFactor":if(typeof value!=="number"){this.options[option]=prevValue;throw new Error(this._getLocaleValue("displayFactorIsOfTypeNumber"))}else if(value!==1&&value!==100){this.options[option]=prevValue;throw new Error(this._getLocaleValue("displayFactorAllowedValue"))}break;default:this.options[option]=prevValue;this._super(option,value);break}},_getEditModeValue:function(val){if(val!==""&&!isNaN(val)){val=this._multiplyWithPrecision(parseFloat(val),this._getOptionOrRegionalValue("displayFactor"))}return this._super(val)},_valueFromText:function(text){var val=this._parseNumericValueByMode(text,this._numericType,this.options.dataMode);return this._divideWithPrecision(val,this.options.displayFactor)},insert:function(string){this._insertHandler(string)},percentSymbol:function(symbol){if(symbol){this.options.percentSymbol=symbol}else{return this._getOptionOrRegionalValue("percentSymbol")}}});$.extend($.ui.igPercentEditor,{version:"21.2.12"});$.widget("ui.igMaskEditor",$.ui.igTextEditor,{options:{buttonType:"none",inputMask:"CCCCCCCCCC",dataMode:"allText",unfilledCharsPrompt:"_",padChar:" ",emptyChar:" ",includeKeys:null,excludeKeys:null,spinWrapAround:false,listItems:null,listWidth:0,listItemHoverDuration:0,isLimitedToListValues:false,dropDownOrientation:"auto",dropDownAttachedToBody:false,dropDownAnimationDuration:300,dropDownOnReadOnly:false,textMode:"text",visibleItemsCount:5,maxLength:null,value:null,suppressKeyboard:false},events:{dropDownListOpening:"dropDownListOpening",dropDownListOpened:"dropDownListOpened",dropDownListClosing:"dropDownListClosing",dropDownListClosed:"dropDownListClosed",dropDownItemSelecting:"dropDownItemSelecting",dropDownItemSelected:"dropDownItemSelected"},_create:function(){$.ui.igTextEditor.prototype._create.call(this)},_initialize:function(){this._super();if(this.options.maxLength){this.options.maxLength=null}if(this.options.listItems){this.options.listItems=null}if(this._maskFlagsArray){this._maskFlagsArray=$.merge(this._maskFlagsArray,["C","&","a","A","?","L","9","0","<",">","#"])}else{this._maskFlagsArray=["C","&","a","A","?","L","9","0","<",">","#"]}this._promptCharsIndices=[]},_applyOptions:function(){this._getMaskLiteralsAndRequiredPositions();this._super()},_getEditModeValue:function(){if(this._maskedValue===""){return this._maskWithPrompts}else{return this._maskedValue}},_insert:function(newValue,previousValue,selection){if(this.options.toUpper){if(newValue){newValue=newValue.toLocaleUpperCase()}}else if(this.options.toLower){if(newValue){newValue=newValue.toLocaleLowerCase()}}this._promptCharsIndices=[];if(this._editMode){this._insertEditMode(newValue,selection)}else if(newValue!==previousValue){this._insertDisplayMode(newValue)}this._processTextChanged()},_insertEditMode:function(newValue,selection){newValue=this._parseValueByMask(newValue);this._editorInput.val(newValue);if(selection!==undefined){this._setSelectionRange(this._editorInput[0],selection.start,selection.end)}},_insertDisplayMode:function(newValue){newValue=this._parseValueByMask(newValue);this._processInternalValueChanging(newValue);this._exitEditMode()},_pasteHandler:function(e,drop){var self=this,previousValue=$(e.target).val(),newValue,data,selection,dtObj=drop?e.originalEvent.dataTransfer:e.originalEvent&&e.originalEvent.clipboardData||window.clipboardData;data=dtObj&&dtObj.getData("Text");data=data.replace(/[\r\n]{1,2}$/g,"");this._currentInputTextValue=this._editorInput.val();this._timeouts.push(setTimeout(function(){selection=self._getSelection(e.target);if(selection.start===selection.end){selection.start-=data.length;newValue=self._replaceDisplayValue(selection,previousValue,data);selection.start=selection.end}else{newValue=self._replaceDisplayValue(selection,previousValue,data)}if(self._validateValueAgainstMask(newValue)){self._insert(newValue,previousValue,selection)}else{if(self.options.revertIfNotValid){newValue=self._valueInput.val();self._updateValue(newValue)}else{self._clearValue()}if(self._focused){self._enterEditMode()}}if(drop){if(self._editorInput.is(":focus")){self._triggerFocus(e)}else{self._processValueChanging(newValue);self._focused=false;self._exitEditMode()}}},10))},_replaceDisplayValue:function(selection,previousValue,newValue){var value=previousValue,i=selection.start,j=0,currentChar,newChar;newValue=newValue.toString();for(;i<previousValue.length&&j<newValue.length;i++,j++){currentChar=previousValue.charAt(i);newChar=newValue.charAt(j);if($.inArray(i,this._literalIndices)!==-1){if(currentChar!==newChar){selection.end++;j--}}else{value=value.substring(0,i)+newChar+value.substring(i+1,previousValue.length)}}return value},_attachEvents:function(){var self=this;self._super();this._editorInput.on({"dragend.editor":function(){self._handleDeleteKey(true)},"cut.editor":function(){self._handleDeleteKey(true)}})},_detachEvents:function(){this._super();if(this._editorInput){this._editorInput.off("cut.editor dragend.editor")}},_getMaskLiteralsAndRequiredPositions:function(){var mask,literalIndices=[],requiredFieldsIndices=[],maskFlagsArray=this._maskFlagsArray,output,maskChar,unescapedMask,i,j,isToLower=false,isToUpper=false,toLowerIndices=[],toUpperIndices=[];output=unescapedMask=mask=this.options.inputMask;for(i=0,j=0;i<mask.length;i++,j++){maskChar=mask.charAt(i);if($.inArray(maskChar,maskFlagsArray)!==-1){if(isToLower&&maskChar!=="9"&&maskChar!=="0"&&maskChar!=="#"){toLowerIndices.push(j)}else if(isToUpper&&maskChar!=="9"&&maskChar!=="0"&&maskChar!=="#"){toUpperIndices.push(j)}if(maskChar==="&"||maskChar==="A"||maskChar==="L"||maskChar==="0"){requiredFieldsIndices.push(j)}else if(maskChar===">"){if(!isToUpper){isToUpper=true;if(isToLower){isToLower=false;toLowerIndices.pop()}}else{isToUpper=false;toUpperIndices.pop()}unescapedMask=this._replaceCharAt(unescapedMask,j,"");j--}else if(maskChar==="<"){if(!isToLower){isToLower=true;if(isToUpper){isToUpper=false;toUpperIndices.pop()}}else{isToLower=false;toLowerIndices.pop()}unescapedMask=this._replaceCharAt(unescapedMask,j,"");j--}}else if(maskChar==="\\"){if($.inArray(mask.charAt(i+1),maskFlagsArray)!==-1){unescapedMask=this._replaceCharAt(unescapedMask,j,"");i++}literalIndices.push(j)}else{literalIndices.push(j)}}this._literalIndices=literalIndices;this._requiredIndices=requiredFieldsIndices;this._toLowerIndices=toLowerIndices;this._toUpperIndices=toUpperIndices;this._unescapedMask=unescapedMask},_validateValue:function(val){if(val===undefined||val===null){return this._super(val)}else{return this._validateValueAgainstMask(val)}},_parseValueByMask:function(value){var mask=this.options.inputMask,outputVal=mask,ch,maskFlagsArray=this._maskFlagsArray,length=mask.length,i,j,tempChar;value=value===0||value?value.toString():"";if(length&&length>0){if(value.indexOf(this.options.unfilledCharsPrompt!==-1)){i=225;tempChar=String.fromCharCode(i);while(mask.indexOf(tempChar)!==-1&&value.indexOf(tempChar)!==-1){i++}}for(i=0,j=0;i<length;i++,j++){ch=value.charAt(j);if(this._validateCharOnPosition(ch,i)===null){if(mask.charAt(i)==="\\"){var flags=["C","&","a","A","?","L","0","9","#"];if(flags.indexOf(ch)>-1){i++}else{i++;j--}}else if(mask.charAt(i)==="<"||mask.charAt(i)===">"){j--}else if($.inArray(i,this._literalIndices)!==-1){if(mask.charAt(i)!==ch){j--}}}else if(this._validateCharOnPosition(ch,i)===true){if(ch===this.options.unfilledCharsPrompt){outputVal=this._replaceCharAt(outputVal,i,tempChar)}else{outputVal=this._replaceCharAt(outputVal,i,ch)}}else{outputVal=this._replaceCharAt(outputVal,i,this.options.unfilledCharsPrompt)}}for(i=0;i<outputVal.length;i++){ch=outputVal.charAt(i);if(ch==="\\"&&$.inArray(outputVal.charAt(i+1),maskFlagsArray)!==-1){outputVal=this._replaceCharAt(outputVal,i,"")}else if(ch==="<"||ch===">"){outputVal=this._replaceCharAt(outputVal,i,"");i--}else if($.inArray(i,this._toLowerIndices)!==-1){if(ch===tempChar){outputVal=this._replaceCharAt(outputVal,i,this.options.unfilledCharsPrompt);this._promptCharsIndices.push(i)}outputVal=this._replaceCharAt(outputVal,i,outputVal.charAt(i).toLocaleLowerCase())}else if($.inArray(i,this._toUpperIndices)!==-1){outputVal=this._replaceCharAt(outputVal,i,outputVal.charAt(i).toLocaleUpperCase());if(ch===tempChar){outputVal=this._replaceCharAt(outputVal,i,this.options.unfilledCharsPrompt);this._promptCharsIndices.push(i)}}else if(ch===tempChar){outputVal=this._replaceCharAt(outputVal,i,this.options.unfilledCharsPrompt);this._promptCharsIndices.push(i)}}}return outputVal},_getValueByDataMode:function(maskedVal){var dataModeValue,regExpr,i,ch,index,tempChar,dataMode=this.options.dataMode;maskedVal=maskedVal!==undefined?maskedVal:this._maskedValue;if(this._promptCharsIndices.length>0){i=225;tempChar=String.fromCharCode(i);while(maskedVal.indexOf(tempChar)!==-1){i++}for(i=0;i<this._promptCharsIndices.length;i++){index=this._promptCharsIndices[i];maskedVal=this._replaceCharAt(maskedVal,index,tempChar)}}switch(dataMode){case"allText":{dataModeValue="";for(i=0;i<maskedVal.length;i++){ch=maskedVal.charAt(i);if(ch===this.options.unfilledCharsPrompt){if($.inArray(i,this._requiredIndices)!==-1){ch=this.options.emptyChar}else{ch=""}}dataModeValue+=ch}if(this._promptCharsIndices.length>0){regExpr=new RegExp($.ig.util.escapeRegExp(tempChar),"g");dataModeValue=dataModeValue.replace(regExpr,this.options.unfilledCharsPrompt)}}break;case"rawText":{dataModeValue="";for(i=0;i<maskedVal.length;i++){ch=maskedVal.charAt(i);if($.inArray(i,this._literalIndices)===-1&&ch!==this.options.unfilledCharsPrompt){if(this._promptCharsIndices.length>0&&ch===tempChar){dataModeValue+=this.options.unfilledCharsPrompt}else{dataModeValue+=ch}}}}break;case"rawTextWithRequiredPrompts":{dataModeValue="";for(i=0;i<maskedVal.length;i++){ch=maskedVal.charAt(i);if($.inArray(i,this._literalIndices)===-1){if(ch===this.options.unfilledCharsPrompt){if($.inArray(i,this._requiredIndices)!==-1){dataModeValue+=this.options.emptyChar}}else{if(this._promptCharsIndices.length>0&&ch===tempChar){dataModeValue+=this.options.unfilledCharsPrompt}else{dataModeValue+=ch}}}}}break;case"rawTextWithAllPrompts":{dataModeValue="";for(i=0;i<maskedVal.length;i++){ch=maskedVal.charAt(i);if($.inArray(i,this._literalIndices)===-1){if(ch===this.options.unfilledCharsPrompt){dataModeValue+=this.options.emptyChar}else{if(this._promptCharsIndices.length>0&&ch===tempChar){dataModeValue+=this.options.unfilledCharsPrompt}else{dataModeValue+=ch}}}}}break;case"rawTextWithLiterals":{dataModeValue="";for(i=0;i<maskedVal.length;i++){ch=maskedVal.charAt(i);if(ch!==this.options.unfilledCharsPrompt){if(this._promptCharsIndices.length>0&&ch===tempChar){dataModeValue+=this.options.unfilledCharsPrompt}else{dataModeValue+=ch}}}}break;case"rawTextWithRequiredPromptsAndLiterals":{dataModeValue="";for(i=0;i<maskedVal.length;i++){ch=maskedVal.charAt(i);if($.inArray(i,this._literalIndices)===-1){if(ch===this.options.unfilledCharsPrompt){if($.inArray(i,this._requiredIndices)!==-1){dataModeValue+=this.options.emptyChar}}else{if(this._promptCharsIndices.length>0&&ch===tempChar){dataModeValue+=this.options.unfilledCharsPrompt}else{dataModeValue+=ch}}}else{dataModeValue+=ch}}}break;default:{dataModeValue="";for(i=0;i<maskedVal.length;i++){ch=maskedVal.charAt(i);if(ch===this.options.unfilledCharsPrompt){if($.inArray(i,this._requiredIndices)!==-1){ch=this.options.emptyChar}else{ch=""}}dataModeValue+=ch}if(this._promptCharsIndices.length>0){regExpr=new RegExp($.ig.util.escapeRegExp(tempChar),"g");dataModeValue=dataModeValue.replace(regExpr,this.options.unfilledCharsPrompt)}}}return dataModeValue},_updateValue:function(value){if(value===""){this.options.value="";this._valueInput.val("");this._maskedValue=""}else if(value===null){if(this.options.allowNullValue){if(this.options.nullValue===null){this._maskedValue="";this._valueInput.val("");this.options.value=this.options.nullValue}else{this._maskedValue=this._parseValueByMask(this.options.nullValue);this.options.value=this._getValueByDataMode();this._valueInput.val(this.options.value)}}else{this.options.value="";this._valueInput.val("");this._maskedValue=""}}else{this._maskedValue=value;this.options.value=this._getValueByDataMode();this._valueInput.val(this.options.value)}},_clearValue:function(textOnly){var newValue="";if(this.options.allowNullValue){newValue=this.options.nullValue}if(this._validateValue(newValue)){this._editorInput.val(this._parseValueByMask(newValue))}else{newValue="";this._editorInput.val(this._maskWithPrompts)}if(!textOnly){this._updateValue(newValue)}if(this._editMode===false){this._exitEditMode()}},_getDisplayValue:function(){return this._replaceValueInMask(this.options.unfilledCharsPrompt,this.options.padChar)},_getMaskedValue:function(maskedValue){return this._replaceValueInMask(this.options.emptyChar,this.options.unfilledCharsPrompt,maskedValue)},_replaceValueInMask:function(oldChar,newChar,maskedValue){var result,maskedVal=maskedValue||this._maskedValue,i,j,p,maskChar,tempChar,index,regExpr,inputMask=this.options.inputMask,maskFlagsArray=this._maskFlagsArray;result=maskedVal;if(this._promptCharsIndices.length>0){i=225;tempChar=String.fromCharCode(i);while(maskedVal.indexOf(tempChar)!==-1){i++}for(i=0;i<this._promptCharsIndices.length;i++){index=this._promptCharsIndices[i];maskedVal=this._replaceCharAt(maskedVal,index,tempChar)}}for(i=0,j=0,p=0;i<maskedVal.length;i++,j++,p++){if(inputMask.charAt(j)==="<"||inputMask.charAt(j)===">"){j++}if(inputMask.charAt(j)==="\\"&&$.inArray(inputMask.charAt(j+1),maskFlagsArray)!==-1){j++;continue}if(maskedVal.charAt(i)===oldChar){maskChar=inputMask.charAt(j);if(maskChar==="&"||maskChar==="A"||maskChar==="L"||maskChar==="0"){result=this._replaceCharAt(result,p,newChar)}else if(maskChar!==" "){result=this._replaceCharAt(result,p,"");p--}}}if(this._promptCharsIndices.length>0){regExpr=new RegExp($.ig.util.escapeRegExp(tempChar),"g");result=result.replace(regExpr,oldChar)}return result},_valueFromText:function(text){return this._getValueByDataMode(text)},_editorIsCleared:function(){var result=false,currentVal=this._editorInput.val();if(currentVal===""||currentVal===this._maskWithPrompts){result=true}return result},_validateValueAgainstMask:function(value){var i,j,length=value.length,result=true,ch,mask=this._unescapedMask;if(length&&length>0){for(j=0,i=0;i<mask.length&&j<value.length;i++,j++){ch=value.charAt(j);if($.inArray(i,this._literalIndices)!==-1){if(mask.charAt(i)!==ch){j--}continue}if(!(this._focused&&ch===this.options.unfilledCharsPrompt)&&this._validateCharOnPosition(ch,i,mask)===false){return false}}}else{result=true}return result},_setInitialValue:function(value){this._maskWithPrompts=this._parseValueByMask("");this._getMaskLiteralsAndRequiredPositions();if(value===null||value===""){this._updateValue(value);this._maskedValue=""}else{this._maskedValue=this._parseValueByMask(value);this._updateValue(this._maskedValue)}this._checkClearButtonState()},_triggerInternalValueChange:function(value){var oldValue=this.options.value,message;if(value===this._maskWithPrompts&&this._promptCharsIndices.length===0){value=""}var noCancel=this._triggerValueChanging(value);if(noCancel){this._processInternalValueChanging(value);if(this.options.value!==oldValue){this._triggerValueChanged(value)}if(value!==""&&!this._validateRequiredPrompts(value)){if(this.options.revertIfNotValid){message="maskRevertMessage"}else{message="maskMessage"}this._sendNotification("warning",{optName:message})}}},_validateRequiredPrompts:function(value){var i;if(value===""){return true}for(i=0;i<this._requiredIndices.length;i++){var ch=value.charAt(this._requiredIndices[i]);if(ch===this.options.unfilledCharsPrompt){if(this._promptCharsIndices.length>0&&$.inArray(this._requiredIndices[i],this._promptCharsIndices)!==-1){continue}else{return false}}}return true},_processInternalValueChanging:function(value){if(this._validateValue(value)&&(this.options.revertIfNotValid&&this._validateRequiredPrompts(value)||!this.options.revertIfNotValid)){if(value.length&&value.length!==this._maskWithPrompts.length){value=this._parseValueByMask(value)}this._updateValue(value)}else{if(this.options.revertIfNotValid){value=this._getMaskedValue(this._maskedValue||this._valueInput.val().trim());this._updateValue(value);value=this._parseValueByMask(value.trim());this._editorInput.val(value)}else{this._clearValue();value=this._valueInput.val();if(this._focused){this._enterEditMode()}}}},_triggerKeyDown:function(event){var key=!event.charCode?event.which:event.charCode,cursorStartPosition=this._getSelection(this._editorInput[0]).start,ch,transformedChar,noCancel;noCancel=this._super(event);if(noCancel){if(key===8){this._handleBackSpaceKey();event.preventDefault()}else if(key===46){this._handleDeleteKey();event.preventDefault()}else if($.inArray(cursorStartPosition,this._toUpperIndices)!==-1&&this._inComposition!==true){if(!event.ctrlKey&&!event.altKey&&(key>46&&key<91||key>145)){if(!$.ig.util.isWebKit||key!==229){ch=String.fromCharCode(key);transformedChar=ch.toLocaleUpperCase();this._editorInput.val(this._replaceCharAt(this._editorInput.val(),cursorStartPosition,transformedChar));this._setCursorPosition(cursorStartPosition+1);event.preventDefault()}}}else if($.inArray(cursorStartPosition,this._toLowerIndices)!==-1&&this._inComposition!==true){if(!event.ctrlKey&&!event.altKey&&(key>46&&key<91||key>145)){if(!$.ig.util.isWebKit||key!==229){ch=String.fromCharCode(key);transformedChar=ch.toLocaleLowerCase();this._editorInput.val(this._replaceCharAt(this._editorInput.val(),cursorStartPosition,transformedChar));this._setCursorPosition(cursorStartPosition+1);event.preventDefault()}}}}return noCancel},_triggerKeyPress:function(event){var cursorPosition,key=!event.charCode?event.which:event.charCode,ch;if(this._super(event)){cursorPosition=this._getCursorPosition();if(key===46&&this._promptCharsIndices.length>0){if($.inArray(cursorPosition,this._promptCharsIndices)!==-1){this._promptCharsIndices=this._promptCharsIndices.splice($.inArray(cursorPosition,this._promptCharsIndices),1)}}else if(key===8&&this._promptCharsIndices.length>0){if($.inArray(cursorPosition-1,this._promptCharsIndices)!==-1){this._promptCharsIndices=this._promptCharsIndices.splice($.inArray(cursorPosition-1,this._promptCharsIndices),1)}}else{ch=String.fromCharCode(key);if(ch===this.options.unfilledCharsPrompt&&$.inArray(cursorPosition,this._promptCharsIndices)===-1){this._promptCharsIndices.push(cursorPosition)}}}},_validateKey:function(event){var result,ch,key,cursorPosition=this._getCursorPosition();if(this._super(event)&&this.options.inputMask){key=!event.charCode?event.which:event.charCode;if($.ig.util.isFF&&this._validateNonCharacter(event)){result=true}else if(key!==8&&key!==46){ch=String.fromCharCode(key);if(cursorPosition===-1){this._editSelectAllStarted=true;this._editorValueBeforeClear=this._editorInput.val();this._editorInput.val(this._maskWithPrompts);cursorPosition++}while($.inArray(cursorPosition,this._literalIndices)!==-1||cursorPosition===this._maskWithPrompts.length){cursorPosition++}result=this._validateKeyCharAgainstMask(ch,cursorPosition,this._unescapedMask);if(result===true){if($.ig.util.isFF&&event.keyCode===37){this._setSelectionRange(this._editorInput[0],cursorPosition,cursorPosition-1)}else{this._setSelectionRange(this._editorInput[0],cursorPosition,cursorPosition+1)}}}}else{result=false}if(result===false&&this._editSelectAllStarted){this._editorInput.val(this._editorValueBeforeClear);this._editorInput.select();delete this._editSelectAllStarted;delete this._editorValueBeforeClear}if(result===true&&this._editSelectAllStarted){delete this._editSelectAllStarted;delete this._editorValueBeforeClear}return result},_validateKeyCharAgainstMask:function(ch,cursorPosition,inputMask){var mask=inputMask||this.options.inputMask,isValid;if(cursorPosition>=this._maskWithPrompts.length){isValid=false}else{if(this._validateCharOnPosition(ch,cursorPosition,mask)===null){isValid=this._validateKeyCharAgainstMask(ch,cursorPosition+1)}else{isValid=this._validateCharOnPosition(ch,cursorPosition,mask)}}return isValid},_validateCharOnPosition:function(ch,position,inputMask){var maskSymbol,mask,isValid,regex,inputChar=ch,letterOrDigitRegEx="[\\d\\u00C0-\\u1FFF\\u2C00-\\uD7FFa-zA-Z]",letterRegEx="[\\u00C0-\\u1FFF\\u2C00-\\uD7FFa-zA-Z]",digitRegEx="[\\d]",digitSpecialRegEx="[\\d_\\+]";mask=inputMask||this.options.inputMask;maskSymbol=mask.charAt(position);switch(maskSymbol){case"C":case"&":{if(inputChar===""){isValid=false}else{isValid=true}}break;case"a":case"A":{regex=new RegExp(letterOrDigitRegEx);if(regex.test(inputChar)){isValid=true}else{isValid=false}}break;case"?":case"L":{regex=new RegExp(letterRegEx);if(regex.test(inputChar)){isValid=true}else{isValid=false}}break;case"0":case"9":{regex=new RegExp(digitRegEx);if(regex.test(inputChar)){isValid=true}else{isValid=false}}break;case"#":{regex=new RegExp(digitSpecialRegEx);if(regex.test(inputChar)){isValid=true}else{isValid=false}}break;default:{isValid=null}}return isValid},_setOption:function(option,value){var prevValue=this.options[option];if(prevValue===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"inputMask":this.options[option]=prevValue;throw new Error(this._getLocaleValue("setOptionError")+option);case"excludeKeys":case"includeKeys":case"unfilledCharsPrompt":this.options[option]=prevValue;throw new Error(this._getLocaleValue("setOptionError")+option);default:this.options[option]=prevValue;this._super(option,value);break}},_handleBackSpaceKey:function(){var selection=this._getSelection(this._editorInput[0]),startPosition=selection.start,endPosition=selection.end,index=endPosition;if(startPosition===endPosition){startPosition--}index--;for(index;index>startPosition-1;index--){while($.inArray(index,this._literalIndices)!==-1||index===-1){index--}if(index>-1){this._editorInput.val(this._replaceCharAt(this._editorInput.val(),index,this.options.unfilledCharsPrompt));this._setCursorPosition(index)}}},_handleDeleteKey:function(skipCursorPosition){var selection=this._getSelection(this._editorInput[0]),startPosition=selection.start,endPosition=selection.end,index=startPosition;if(startPosition===endPosition){endPosition++}for(index;index<endPosition;index++){while($.inArray(index,this._literalIndices)!==-1&&index<=this._maskWithPrompts.length){index++}if(index!==this._maskWithPrompts.length){this._editorInput.val(this._replaceCharAt(this._editorInput.val(),index,this.options.unfilledCharsPrompt));if(!skipCursorPosition){this._setCursorPosition(index+1)}}else{if(!skipCursorPosition){this._setCursorPosition(index)}}}},value:function(newValue){if(newValue!==undefined){this._clearEditorNotifier();if(newValue!==null){this._promptCharsIndices=[];newValue=this._parseValueByMask(newValue)}if(newValue===this._maskWithPrompts){newValue=""}this._updateValue(newValue);this._editorInput.val(this._editMode?this._maskedValue:this._getDisplayValue())}else{return this.options.value}this._checkClearButtonState()},dropDownContainer:function(){throw new Error(this._getLocaleValue("maskEditorNoSuchMethod"))},showDropDown:function(){throw new Error(this._getLocaleValue("maskEditorNoSuchMethod"))},hideDropDown:function(){throw new Error(this._getLocaleValue("maskEditorNoSuchMethod"))},dropDownButton:function(){throw new Error(this._getLocaleValue("maskEditorNoSuchMethod"))},spinUpButton:function(){throw new Error(this._getLocaleValue("maskEditorNoSuchMethod"))},spinDownButton:function(){throw new Error(this._getLocaleValue("maskEditorNoSuchMethod"))},dropDownVisible:function(){throw new Error(this._getLocaleValue("maskEditorNoSuchMethod"))},findListItemIndex:function(){throw new Error(this._getLocaleValue("maskEditorNoSuchMethod"))},selectedListIndex:function(){throw new Error(this._getLocaleValue("maskEditorNoSuchMethod"))},getSelectedListItem:function(){throw new Error(this._getLocaleValue("maskEditorNoSuchMethod"))},spinUp:function(){throw new Error(this._getLocaleValue("maskEditorNoSuchMethod"))},spinDown:function(){throw new Error(this._getLocaleValue("maskEditorNoSuchMethod"))},isValid:function(){var value,valid;this._skipMessages=true;if(this._editMode){value=this.field().val();valid=this._validateRequiredPrompts(value)}else{value=this.options.value;valid=this._validateValue(value);if(value!==""&&!this._validateRequiredPrompts(this._maskedValue)){valid=false;this._sendNotification("warning",{optName:"maskMessage"})}}this._skipMessages=false;return valid}});$.extend($.ui.igMaskEditor,{version:"21.2.12"});$.widget("ui.igDateEditor",$.ui.igMaskEditor,{options:{value:null,minValue:null,maxValue:null,dateDisplayFormat:null,dateInputFormat:null,dataMode:"date",displayTimeOffset:null,buttonType:"none",spinDelta:1,limitSpinToCurrentField:false,enableUTCDates:false,centuryThreshold:29,yearShift:0,nullValue:null,isLimitedToListValues:false,listItemHoverDuration:0,listItems:null,listWidth:0,dropDownAnimationDuration:0,dropDownAttachedToBody:false,dropDownOnReadOnly:false,inputMask:"CCCCCCCCCC",unfilledCharsPrompt:"_",padChar:" ",emptyChar:" ",toUpper:false,toLower:false,suppressKeyboard:false},events:{dropDownListOpening:"dropDownListOpening",dropDownListOpened:"dropDownListOpened",dropDownListClosing:"dropDownListClosing",dropDownListClosed:"dropDownListClosed",dropDownItemSelecting:"dropDownItemSelecting",dropDownItemSelected:"dropDownItemSelected"},_create:function(){$.ui.igMaskEditor.prototype._create.call(this)},_initialize:function(){var offset=this.options.displayTimeOffset;this._super();this._applyRegionalSettings();this.options.inputMask=this._convertDateMaskToDigitMask(this._inputFormat);this._setNumericType();this._mvcDateRegex=/^\/Date\((.*?)\)\/$/i;if(offset!==null&&(offset>840||offset<-720)){throw new Error(this._getLocaleValue("dateEditorOffsetRange"))}},_setNumericType:function(){this._numericType="datetime"},_setOption:function(option,value){var prevValue=this.options[option],date;if($.type(prevValue)==="date"){date=this._getDateObjectFromValue(value);if($.type(date)==="date"&&prevValue.getTime()===date.getTime()){return}}else if(prevValue===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"displayTimeOffset":if(this._editMode){this._updateMaskedValue();this._enterEditMode()}else{this._editorInput.val(this._getDisplayValue())}break;case"minValue":case"maxValue":if(!this._isValidDate(value)){this.options[option]=prevValue;return}if(value!==null){this.options[option]=this._getDateObjectFromValue(value);this._processInternalValueChanging(this.value());
if(!this._editMode){this._editorInput.val(this._getDisplayValue());this._currentInputTextValue=this._editorInput.val()}}this._setSpinButtonsState(this.value());break;case"listItems":case"dateInputFormat":this.options[option]=prevValue;throw new Error(this._getLocaleValue("setOptionError")+option);case"dateDisplayFormat":this._applyRegionalSettings();if(!this._editMode){this._editorInput.val(this._getDisplayValue())}break;case"spinDelta":try{this._validateSpinSettings()}catch(e){this.options[option]=prevValue;throw e}break;default:this.options[option]=prevValue;this._super(option,value);break}},_applyRegionalSettings:function(){var iFormat=this.options.dateInputFormat,dFormat=this.options.dateDisplayFormat;if(iFormat!==null){if(iFormat==="date"||iFormat==="dateLong"||iFormat==="dateTime"||iFormat==="time"||iFormat==="timeLong"){this._inputFormat=this._getRegionalValue(iFormat+"Pattern")}else{this._inputFormat=iFormat}}else{this._inputFormat=this._getRegionalValue("datePattern")}if(dFormat!==null){if(dFormat==="date"||dFormat==="dateLong"||dFormat==="dateTime"||dFormat==="time"||dFormat==="timeLong"){this._displayFormat=this._getRegionalValue(dFormat+"Pattern")}else{this._displayFormat=dFormat}}else{this._displayFormat=this._inputFormat}},changeRegional:function(){var timeouts=this._timeouts;this._initialize();this._timeouts=timeouts;this._setInitialValue(this._dateObjectValue);if(this._focused){this._enterEditMode()}},_setInitialValue:function(value){this._maskWithPrompts=this._parseValueByMask("");if(value===null||value===""){this._updateValue(value);this._maskedValue=""}else{if(this._validateValue(value)){this._updateValue(this._getDateObjectFromValue(value));this._updateMaskedValue()}this._editorInput.val(this._getDisplayValue())}this._checkClearButtonState();this._setSpinButtonsState(value)},_applyOptions:function(){this._validateSpinSettings();if(this.options.centuryThreshold>99||this.options.centuryThreshold<0){this.options.centuryThreshold=29;throw new Error(this._getLocaleValue("centuryThresholdValidValues"))}if(this.options.minValue){if(!this._isValidDate(new Date(this.options.minValue))){throw new Error(this._getLocaleValue("invalidDate"))}else{this.options.minValue=this._getDateObjectFromValue(this.options.minValue)}}if(this.options.maxValue){if(!this._isValidDate(new Date(this.options.maxValue))){throw new Error(this._getLocaleValue("invalidDate"))}else{this.options.maxValue=this._getDateObjectFromValue(this.options.maxValue)}}this.options.value=this._getValueBetweenMinMax(this.options.value);this._super()},_validateSpinSettings:function(){var delta=this.options.spinDelta,deltaRanges,key;if(typeof delta==="number"){if(delta<0){throw new Error(this._getLocaleValue("spinDeltaCouldntBeNegative"))}else{this.options.spinDelta=parseInt(delta,10)}}else if(typeof delta==="object"){deltaRanges={year:10,month:12,day:28,hours:this._dateIndices.hh24?24:12,minutes:60,seconds:60,milliseconds:1e3};for(key in deltaRanges){if(deltaRanges.hasOwnProperty(key)){this._validateSpinSettingsForTimePeriod(key,deltaRanges[key])}}}else{throw new Error(this._getLocaleValue("spinDeltaIsOfTypeNumberOrObject"))}},_validateSpinSettingsForTimePeriod:function(name,maxRange){var delta=this.options.spinDelta[name];if(delta===undefined){this.options.spinDelta[name]=1;return}if(typeof delta!=="number"){throw new Error($.ig.util.stringFormat(this._getLocaleValue("spinDeltaIsOfTypeNumberForPeriod"),name,0,maxRange))}else if(delta<0||delta>maxRange){throw new Error($.ig.util.stringFormat(this._getLocaleValue("spinDeltaShouldBeInRange"),name,0,maxRange))}else{this.options.spinDelta[name]=parseInt(delta,10)}},_triggerKeyDown:function(event){var key=!event.charCode?event.which:event.charCode,noCancel;noCancel=this._super(event);if(noCancel){if(key===38&&!(this instanceof $.ui.igDatePicker)){this._spinUpEditMode();event.preventDefault()}if(key===40&&!(this instanceof $.ui.igDatePicker)){this._spinDownEditMode();event.preventDefault()}if(key===13){this._enterEditMode()}}return noCancel},_exceedsMaxValue:function(value){if(!this._editMode){value=this.value()}return this.options.maxValue!==null&&this._getDateObjectFromValue(value).getTime()>=this._getDateObjectFromValue(this.options.maxValue).getTime()},_lessThanMinValue:function(value){if(!this._editMode){value=this.value()}return this.options.minValue!==null&&this._getDateObjectFromValue(value).getTime()<=this._getDateObjectFromValue(this.options.minValue).getTime()},_handleSpinUpEvent:function(){this._spin(this.options.spinDelta,true)},_handleSpinDownEvent:function(){this._spin(this._setNegativeDelta(this.options.spinDelta),true)},_setNegativeDelta:function(delta){var revDelta={},key;if(typeof delta==="object"){for(key in delta){if(delta.hasOwnProperty(key)){revDelta[key]=delta[key]*-1}}}else{revDelta=delta*-1}return revDelta},_getDelta:function(delta,name){return typeof delta==="object"?delta[name]:delta},_serializeDate:function(sDate){if(this.options.dataMode==="date"){if(this.options.enableUTCDates){sDate=sDate.toISOString()}else{sDate=$.ig.toLocalISOString(sDate)}}else{sDate=this.options.value}return sDate},_getDateField:function(flag,date){var shift=this.options.yearShift,value;if(!date||isNaN(date.getTime())){return null}value=date["get"+flag]();if(flag==="FullYear"&&shift){value+=shift}return value},_setDateField:function(flag,date,newValue){var shift=this.options.yearShift;if(!date){return}if(flag==="FullYear"&&shift){newValue-=shift}date["set"+flag](newValue)},_setNewDateMidnight:function(){var date=new Date;this._setDateField("Hours",date,0);this._setDateField("Minutes",date,0);this._setDateField("Seconds",date,0);this._setDateField("Milliseconds",date,0);return date},_getInternalMaskedValue:function(newDate){return this._updateMaskedValue(newDate,true)},_replaceDisplayValue:function(selection,previousValue,newValue){if(selection.start===0){newValue=this._formatDateString(newValue.toString())}return this._super(selection,previousValue,newValue)},_formatDateString:function(value){var dateMask,periodName,startIndex,endIndex,prompt=this.options.unfilledCharsPrompt;dateMask=this._parseValueByMask(value);if(dateMask.indexOf(prompt)>=0){for(periodName in this._dateIndices){startIndex=this._dateIndices[periodName];switch(periodName){case"fourDigitYear":case"ffLength":case"hh24":startIndex=null;break;case"yy":endIndex=startIndex+(this._dateIndices.fourDigitYear?4:2);break;case"ff":endIndex=startIndex+this._dateIndices.ffLength;break;default:endIndex=startIndex+2;break}if(startIndex!==null){dateMask=(startIndex>0?dateMask.substring(0,startIndex):"")+this._reverseMaskWithUnderscore(dateMask.substring(startIndex,endIndex))+(endIndex<dateMask.length?dateMask.substring(endIndex,dateMask.length):"")}}}return dateMask},_reverseMaskWithUnderscore:function(mask){var count,reg,match,reversedMask,regPrompt,prompt=this.options.unfilledCharsPrompt;reg=new RegExp("(\\d{1,3}\\"+prompt+"{1,3})","g");regPrompt=new RegExp("\\"+prompt,"g");match=reg.exec(mask);if(match&&match[0]){count=(mask.match(regPrompt)||[]).length;reversedMask=Array(count+1).join(prompt)+match[0].replace(regPrompt,"");mask=mask.replace(match[0],reversedMask)}return mask},_updateMaskedValue:function(newDate,returnValue){var currentMaskValue=this._maskWithPrompts?this._maskWithPrompts:this._parseValueByMask(""),regional=this.options.regional,dateObj,year,month,day,hours,minutes,seconds,milliseconds;dateObj=newDate?newDate:this._dateObjectValue;if(this.options.displayTimeOffset!==null){dateObj=this._getDateOffset(dateObj)}if(dateObj&&dateObj.getTime()===dateObj.getTime()){if(this._dateIndices.yy!==undefined){year=this._getDateField("FullYear",dateObj).toString();if(this._dateIndices.fourDigitYear){if(year.toString().length<4){while(year.toString().length<4){year="0"+year}}currentMaskValue=this._replaceStringRange(currentMaskValue,year,this._dateIndices.yy,this._dateIndices.yy+3)}else{year=year.substring(2);currentMaskValue=this._replaceStringRange(currentMaskValue,year,this._dateIndices.yy,this._dateIndices.yy+1)}}if(this._dateIndices.MM!==undefined){month=this._getDateField("Month",dateObj);month++;if(month<10){month="0"+month.toString()}else{month=month.toString()}currentMaskValue=this._replaceStringRange(currentMaskValue,month,this._dateIndices.MM,this._dateIndices.MM+1)}if(this._dateIndices.dd!==undefined){day=this._getDateField("Date",dateObj);if(day<10){day="0"+day.toString()}else{day=day.toString()}currentMaskValue=this._replaceStringRange(currentMaskValue,day,this._dateIndices.dd,this._dateIndices.dd+1)}if(this._dateIndices.hh!==undefined){hours=this._getDateField("Hours",dateObj);if(!this._dateIndices.hh24&&hours>12){hours-=12}if(!this._dateIndices.hh24&&hours===0){hours=12}if(hours<10){hours="0"+hours.toString()}else{hours=hours.toString()}currentMaskValue=this._replaceStringRange(currentMaskValue,hours,this._dateIndices.hh,this._dateIndices.hh+1)}if(this._dateIndices.mm!==undefined){minutes=this._getDateField("Minutes",dateObj);if(minutes<10){minutes="0"+minutes.toString()}else{minutes=minutes.toString()}currentMaskValue=this._replaceStringRange(currentMaskValue,minutes,this._dateIndices.mm,this._dateIndices.mm+1)}if(this._dateIndices.ss!==undefined){seconds=this._getDateField("Seconds",dateObj);if(seconds<10){seconds="0"+seconds.toString()}else{seconds=seconds.toString()}currentMaskValue=this._replaceStringRange(currentMaskValue,seconds,this._dateIndices.ss,this._dateIndices.ss+1)}if(this._dateIndices.tt!==undefined){hours=this._getDateField("Hours",dateObj);if(hours>=12&&hours<24){if(this._dateIndices._ttLength===1){currentMaskValue=this._replaceCharAt(currentMaskValue,this._dateIndices.tt,"P")}else{currentMaskValue=this._replaceStringRange(currentMaskValue,"PM",this._dateIndices.tt,this._dateIndices.tt+1)}}else{if(this._dateIndices._ttLength===1){currentMaskValue=this._replaceCharAt(currentMaskValue,this._dateIndices.tt,"A")}else{currentMaskValue=this._replaceStringRange(currentMaskValue,"AM",this._dateIndices.tt,this._dateIndices.tt+1)}}}if(this._dateIndices.ff!==undefined){milliseconds=this._getDateField("Milliseconds",dateObj);if(this._dateIndices.ffLength===1){currentMaskValue=this._replaceCharAt(currentMaskValue,this._dateIndices.ff,$.ig.millisecondsToString(milliseconds,"fff",regional).toString())}else if(this._dateIndices.ffLength===2){currentMaskValue=this._replaceStringRange(currentMaskValue,$.ig.millisecondsToString(milliseconds,"ff",regional).toString(),this._dateIndices.ff,this._dateIndices.ff+1)}else{currentMaskValue=this._replaceStringRange(currentMaskValue,$.ig.millisecondsToString(milliseconds,"f",regional).toString(),this._dateIndices.ff,this._dateIndices.ff+2)}}}if(returnValue===true){return currentMaskValue}else{this._maskedValue=currentMaskValue}},_convertDateMaskToDigitMask:function(mask){var x,i,j,flag=-1,txt="",maskVal=mask;this._dateIndices={};this._dateIndices.fourDigitYear=false;if(!maskVal){maskVal=""}maskVal=maskVal.replace("dddd","ddd").replace("ddd,","").replace("ddd ","").replace(" ddd","").replace("ddd","");maskVal=maskVal.replace(/\x08/g," ").replace(/\x09/g," ");maskVal=maskVal.replace(/\\f/g,"\x01").replace(/\\d/g,"\x02").replace(/\\s/g,"\x03").replace(/\\m/g,"\x04").replace(/\\t/g,"\x05").replace(/\\H/g,"\x06").replace(/\\h/g,"\x07").replace(/\\M/g,"\b").replace(/\\y/g,"\t");maskVal=maskVal.replace(/9/g,"\x11").replace(/0/g,"\x12");maskVal=maskVal.replace("fff","24").replace("ff","23").replace("f","22");maskVal=maskVal.replace("dddd","").replace("ddd","").replace("dd","09").replace("d","08").replace("ss","19").replace("s","18").replace("mm","17").replace("m","16");maskVal=maskVal.replace("tt","15").replace("t","14").replace("HH","13").replace("H","12").replace("hh","11").replace("h","10");maskVal=maskVal.replace("MMMM","MM").replace("MMM","MM").replace("MM","05").replace("M","04");maskVal=maskVal.replace("yyyy","03").replace("yy","02").replace("y","01");maskVal=maskVal.replace(/\x01/g,"g").replace(/\x02/g,"d").replace(/\x03/g,"s").replace(/\x04/g,"m").replace(/\x05/g,"t").replace(/\x06/g,"H").replace(/\x07/g,"h").replace(/\x08/g,"M").replace(/\x09/g,"y");for(i=0,j=0;i<maskVal.length;i++,j++){x=maskVal.charCodeAt(i);if(x<48||x>57){flag=maskVal.charAt(i);if(flag==="\\"&&i+1<maskVal.length&&$.inArray(maskVal.charAt(i+1),this._maskFlagsArray)!==-1||maskVal.charAt(i+1)==="\x11"||maskVal.charAt(i+1)==="\x12"){j--}txt+=maskVal.charAt(i);continue}flag=(x-48)*10+maskVal.charCodeAt(++i)-48;if(flag===14){txt+="L"}else if(flag===15){txt+="LL"}else if(flag===22){txt+="0"}else{txt+="90";if(flag===3){txt+="00"}if(flag===24){txt+="0"}}switch(flag){case 4:case 5:case 6:case 7:{if(this._dateIndices.MM){j++;break}else{this._dateIndices.MM=j;j++}}break;case 8:case 9:case 20:case 21:{if(this._dateIndices.dd){j++;break}else{this._dateIndices.dd=j;j++}}break;case 1:case 2:{if(this._dateIndices.yy){j++;break}else{this._dateIndices.yy=j;j++;this._dateIndices.fourDigitYear=false}}break;case 3:{if(this._dateIndices.yy){j+=3;break}else{this._dateIndices.yy=j;j+=3;this._dateIndices.fourDigitYear=true}}break;case 14:{if(this._dateIndices.tt){break}else{this._dateIndices.tt=j;j++;this._dateIndices._ttLength=1}}break;case 15:{if(this._dateIndices.tt){j++;break}else{this._dateIndices.tt=j;j++;this._dateIndices._ttLength=2}}break;case 10:case 11:{if(this._dateIndices.hh){j+=2;break}else{this._dateIndices.hh=j;this._dateIndices.hh24=false;j++}}break;case 12:case 13:{if(this._dateIndices.hh){j+=2;break}else{this._dateIndices.hh=j;this._dateIndices.hh24=true;j++}}break;case 16:case 17:{if(this._dateIndices.mm){j++;break}else{this._dateIndices.mm=j;j++}}break;case 18:case 19:{if(this._dateIndices.ss){j++;break}else{this._dateIndices.ss=j;j++}}break;case 22:{if(this._dateIndices.ff){break}else{this._dateIndices.ff=j;this._dateIndices.ffLength=1}}break;case 23:{if(this._dateIndices.ff){j++;break}else{this._dateIndices.ff=j;this._dateIndices.ffLength=2;j++}}break;case 24:{if(this._dateIndices.ff){j+=2;break}else{this._dateIndices.ff=j;this._dateIndices.ffLength=3;j+=2}}break;default:}}txt=txt.replace(/\x11/g,9).replace(/\x12/g,0);return txt},_validateKey:function(event){var result=true,ch,key,cursorPosition;if(this._super(event)===true){cursorPosition=this._getCursorPosition();if(cursorPosition===this._dateIndices.MM||cursorPosition-1===this._dateIndices.MM){result=this._validateMonthInput(event,cursorPosition)}else if(cursorPosition===this._dateIndices.dd||cursorPosition-1===this._dateIndices.dd){result=this._validateDayInput(event,cursorPosition)}else if(cursorPosition===this._dateIndices.hh||cursorPosition-1===this._dateIndices.hh){result=this._validateHoursInput(event,cursorPosition)}else if(cursorPosition===this._dateIndices.mm||cursorPosition-1===this._dateIndices.mm){result=this._validateMinutesInput(event,cursorPosition)}else if(cursorPosition===this._dateIndices.ss||cursorPosition-1===this._dateIndices.ss){result=this._validateSecondsInput(event,cursorPosition)}else if(cursorPosition===this._dateIndices.tt||cursorPosition-1===this._dateIndices.tt){result=this._validateMidDayInput(event,cursorPosition);if(result===true){key=!event.charCode?event.which:event.charCode;ch=String.fromCharCode(key);if(ch.toLocaleLowerCase()==="a"){this._editorInput.val(this._replaceCharAt(this._editorInput.val(),cursorPosition,"A"))}else{this._editorInput.val(this._replaceCharAt(this._editorInput.val(),cursorPosition,"P"))}if(this._dateIndices._ttLength===2){this._editorInput.val(this._replaceCharAt(this._editorInput.val(),++cursorPosition,"M"))}this._setCursorPosition(++cursorPosition);event.preventDefault()}}else{result=true}if(result===null){cursorPosition++;while($.inArray(cursorPosition,this._literalIndices)!==-1||cursorPosition===this._maskWithPrompts.length){cursorPosition++}this._setCursorPosition(cursorPosition);result=this._validateKey(event)}if(result===false){this._setCursorPosition(cursorPosition)}}else{result=false}return result},_setBlur:function(event){var newValue,oldVal,convertedDate;if(this._cancelBlurOnInput){this._editorInput.focus();delete this._cancelBlurOnInput}else{this._triggerBlur(event);newValue=$(event.target).val();oldVal=this._dateObjectValue;if(this._inComposition===true){newValue=$.ig.util.IMEtoNumberString(newValue,$.ig.util.IMEtoENNumbersMapping());newValue=this._parseValueByMask(newValue);if(newValue===this._maskWithPrompts&&this.options.revertIfNotValid){newValue=oldVal||""}}convertedDate=this._parseDateFromMaskedValue(newValue);if(newValue===this._maskWithPrompts){if(oldVal){this._processValueChanging(newValue)}}else if(!oldVal){this._processValueChanging(newValue)}else if(convertedDate!==""&&convertedDate-oldVal!==0){this._processValueChanging(newValue)}this._exitEditMode();this._focused=false;this._clearTimeouts();if(this._validator){this._validator._validateInternal(this.element,event,true)}}},_validateDayInput:function(event,position){var result=false,key=!event.charCode?event.which:event.charCode,ch=String.fromCharCode(key),num=parseInt(ch),charAtCurrentPosition=parseInt(this._editorInput.val().charAt(position)),charAtPreviousPosition,charAtNextPosition;if(position===this._dateIndices.dd){if(num<4){charAtNextPosition=parseInt(this._editorInput.val().charAt(position+1));if(!isNaN(charAtNextPosition)&&charAtNextPosition>1&&num===3){result=null}else{result=true}}else{if(!isNaN(charAtCurrentPosition)&&charAtCurrentPosition===3){result=null}else{this._setSelectionRange(this._editorInput[0],position+1,position+2);result=true}}}else{charAtPreviousPosition=parseInt(this._editorInput.val().charAt(position-1));if(!isNaN(charAtPreviousPosition)&&charAtPreviousPosition===3){if(num===0||num===1){result=true}else{this._setCursorPosition(position-1);this._handleDeleteKey();this._setSelectionRange(this._editorInput[0],position,position+1);result=true}}else{result=true}}return result},_validateMonthInput:function(event,position){var result=false,key=!event.charCode?event.which:event.charCode,ch=String.fromCharCode(key),num=parseInt(ch),charAtCurrentPosition=parseInt(this._editorInput.val().charAt(position)),charAtPreviousPosition,charAtNextPosition;position=position?position:this._getCursorPosition();if(position===this._dateIndices.MM){if(num<2){charAtNextPosition=parseInt(this._editorInput.val().charAt(position+1));if(!isNaN(charAtNextPosition)&&charAtNextPosition>2&&num===1){result=null}else{result=true}}else{if(!isNaN(charAtCurrentPosition)&&charAtCurrentPosition===1){if(num===2){result=true}else{result=null}}else if(this._editorInput.val().charAt(position)===this.options.unfilledCharsPrompt){if(num<2){result=true}else{result=null}}else{this._setSelectionRange(this._editorInput[0],position+1,position+2);result=true}}}else{charAtPreviousPosition=parseInt(this._editorInput.val().charAt(position-1));if(!isNaN(charAtPreviousPosition)&&charAtPreviousPosition===1){if(num===0||num===1||num===2){result=true}else{this._setCursorPosition(position-1);this._handleDeleteKey();this._setSelectionRange(this._editorInput[0],position,position+1);result=true}}else{result=true}}return result},_validateMidDayInput:function(event,position){var result=false,key=!event.charCode?event.which:event.charCode,ch=String.fromCharCode(key);position=position?position:this._getCursorPosition();if(position===this._dateIndices.tt){if(ch.toString().toLocaleLowerCase()==="a"||ch.toString().toLocaleLowerCase()==="p"){result=true}else{result=false}}else{result=null}return result},_validateHoursInput:function(event,position){var result=false,key=!event.charCode?event.which:event.charCode,ch=String.fromCharCode(key),num=parseInt(ch),charAtPreviousPosition,charAtNextPosition;position=position?position:this._getCursorPosition();if(position===this._dateIndices.hh){if(this._dateIndices.hh24){if(num===0||num===1){result=true}else if(num===2){charAtNextPosition=parseInt(this._editorInput.val().charAt(position+1));if(!isNaN(charAtNextPosition)&&charAtNextPosition>4){result=null}else{result=true}}else{result=null}}else{if(num===0){result=true}else if(num===1){charAtNextPosition=parseInt(this._editorInput.val().charAt(position+1));if(!isNaN(charAtNextPosition)&&charAtNextPosition>2){result=null}else{result=true}}else{result=null}}}else{charAtPreviousPosition=parseInt(this._editorInput.val().charAt(position-1));if(this._dateIndices.hh24){if(!isNaN(charAtPreviousPosition)&&charAtPreviousPosition===2){if(num<=4){result=true}else{result=true;this._setCursorPosition(position-1);this._handleDeleteKey();this._setSelectionRange(this._editorInput[0],position,position+1)}}else{result=true}}else{if(!isNaN(charAtPreviousPosition)&&charAtPreviousPosition===1){if(num<=2){result=true}else{this._setCursorPosition(position-1);this._handleDeleteKey();this._setSelectionRange(this._editorInput[0],position,position+1);result=true}}else{result=true}}}return result},_validateMinutesInput:function(event,position){var result=false,key=!event.charCode?event.which:event.charCode,ch=String.fromCharCode(key),num=parseInt(ch);position=position?position:this._getCursorPosition();if(position===this._dateIndices.mm){if(num<6){result=true}else{result=true;this._handleDeleteKey();this._setSelectionRange(this._editorInput[0],position+1,position+2)}}else{result=true}return result},_validateSecondsInput:function(event,position){var result=false,key=!event.charCode?event.which:event.charCode,ch=String.fromCharCode(key),num=parseInt(ch);position=position?position:this._getCursorPosition();if(position===this._dateIndices.ss){if(num<6){result=true}else{this._handleDeleteKey();this._setSelectionRange(this._editorInput[0],position+1,position+2);result=true}}else{result=true}return result},_fillCentury:function(year){if(!isNaN(year)){if(year>=0&&year<=this.options.centuryThreshold){year=2e3+year}else if(year<100){year=1900+year}}return year},_triggerInternalValueChange:function(value){if(value===this._maskWithPrompts){value=""}var noCancel=this._triggerValueChanging(value);if(noCancel){this._processInternalValueChanging(value);this._triggerValueChanged(value)}},_processInternalValueChanging:function(value){var parsedVal,cursorPosition;if(value===""){cursorPosition=this._getCursorPosition();this._clearValue();if(this._focused&&cursorPosition!==undefined){cursorPosition=cursorPosition===-1?cursorPosition++:cursorPosition;this._setCursorPosition(cursorPosition)}return}if($.type(value)==="date"){parsedVal=value}else{if(value.length!==this._maskWithPrompts.length){value=this._parseValueByMask(value)}parsedVal=this._parseDateFromMaskedValue(value)}parsedVal=this._getValueBetweenMinMax(parsedVal);if(this._validateValue(parsedVal)){this._updateValue(parsedVal)}else{if(this.options.revertIfNotValid){value=this._valueInput.val();this._updateValue(value)}else{this._clearValue();value=this._valueInput.val()}}},_insertEditMode:function(newValue,selection){newValue=$.ig.util.IMEtoNumberString(newValue,$.ig.util.IMEtoENNumbersMapping());newValue=this._parseValueByMask(newValue);if(newValue===this._maskWithPrompts&&this.options.revertIfNotValid){newValue=this._maskedValue;selection.start=0;selection.end=newValue.length}this._editorInput.val(newValue);if(selection!==undefined){this._setSelectionRange(this._editorInput[0],selection.start,selection.end)}},_isValidDate:function(date){date=this._getDateObjectFromValue(date);return date.getTime()===date.getTime()},_validateValue:function(val){var result,dateObj,minValue,maxValue;if(val===null||val===""){return this._super(val)}dateObj=this._getDateObjectFromValue(val);if(this.options.minValue){minValue=this._getDateObjectFromValue(this.options.minValue)}if(this.options.maxValue){maxValue=this._getDateObjectFromValue(this.options.maxValue)}if(this._isValidDate(dateObj)){if(this.options.maxValue&&this._isValidDate(maxValue)&&dateObj>maxValue){result=false}else if(this.options.minValue&&this._isValidDate(minValue)&&dateObj<minValue){result=false}else{result=true}}else{result=false}return result},_getValueBetweenMinMax:function(date){var validDate=date;if(date!==null&&this._isValidDate(date)){if(this.options.maxValue&&date>this.options.maxValue){validDate=this._getDateObjectFromValue(this.options.maxValue);this._sendNotification("warning",{optName:"maxValExceedSetErrMsg",arg:this._getDisplayValue(new Date(this.options.maxValue))})}else if(this.options.minValue&&date<this.options.minValue){validDate=this._getDateObjectFromValue(this.options.minValue);this._sendNotification("warning",{optName:"minValExceedSetErrMsg",arg:this._getDisplayValue(new Date(this.options.minValue))})}}return validDate},_updateValue:function(value){if(value===null){this._maskedValue=this._maskWithPrompts;this._valueInput.val("");this.options.value=this.options.allowNullValue?null:"";this._dateObjectValue=null}else if(value===""){this._maskedValue=this._maskWithPrompts;this._valueInput.val("");this.options.value="";this._dateObjectValue=null}else{this._dateObjectValue=this._getDateObjectFromValue(value);this._updateMaskedValue();this.options.value=this._getValueByDataMode();this._valueInput.val(this._serializeDate(this._dateObjectValue))}},_clearValue:function(textOnly){var newValue="",maskedValue=this._maskWithPrompts;if(this.options.allowNullValue){if(this._validateValue(this.options.nullValue)){newValue=this.options.nullValue;if(newValue!==null&&newValue!==""){newValue=this._getDateObjectFromValue(this.options.nullValue);maskedValue=this._updateMaskedValue(this.options.nullValue,true)}}}this._editorInput.val(maskedValue);if(!textOnly){this._updateValue(newValue)}if(this._editMode===false){this._exitEditMode()}},_getDateObjectFromValue:function(value){var date;if(this._mvcDateRegex.test(value)){date=new Date(parseInt(value.replace(this._mvcDateRegex,"$1"),10))}else if($.type(value)==="date"){date=new Date(value.getTime())}else{date=new Date(value)}return date},_getValueByDataMode:function(){var dataModeValue,maskedVal=this._maskedValue?this._maskedValue:this._maskWithPrompts,dataMode=this.options.dataMode;switch(dataMode){case"date":{dataModeValue=this._dateObjectValue}break;case"displayModeText":{dataModeValue=this._getDisplayValue()}break;case"editModeText":{dataModeValue=maskedVal}break;default:{dataModeValue=this._dateObjectValue}}return dataModeValue},_getDateOffset:function(date){var newDate,zoneOffset;if(!date){return date}newDate=new Date(date.getTime());zoneOffset=newDate.getTimezoneOffset();newDate.setUTCMinutes(newDate.getUTCMinutes()+zoneOffset+this.options.displayTimeOffset);if(zoneOffset!==newDate.getTimezoneOffset()){newDate.setUTCMinutes(newDate.getUTCMinutes()+newDate.getTimezoneOffset()-zoneOffset)}return newDate},_getYearShift:function(date){var newDate;newDate=new Date(date.getTime());newDate.setFullYear(date.getFullYear()+this.options.yearShift);return newDate},_clearDateOffset:function(date){date.setUTCMinutes(date.getUTCMinutes()-date.getTimezoneOffset()-this.options.displayTimeOffset)},_parseDateFromMaskedValue:function(value){var dateField,monthField,yearField,hourField,minutesField,secondsField,millisecondsField,midDayField,dateStartIndex=this._dateIndices.dd,regExpr,ffCount,lastDayOfMonth,monthStartIndex=this._dateIndices.MM,yearStartIndex=this._dateIndices.yy,hourStartIndex=this._dateIndices.hh,minuteStartIndex=this._dateIndices.mm,secondsStartIndex=this._dateIndices.ss,midDayStartIndex=this._dateIndices.tt,millisecondsStartIndex=this._dateIndices.ff,extractedDate="";if(value===""||value===null||$.type(value)==="date"){return extractedDate}if(dateStartIndex!==undefined&&dateStartIndex!==null){dateField=value.substring(dateStartIndex,dateStartIndex+2);if(dateField.indexOf(this.options.unfilledCharsPrompt)!==-1){regExpr=new RegExp($.ig.util.escapeRegExp(this.options.unfilledCharsPrompt),"g");dateField=dateField.replace(regExpr,"")}if(dateField!==""){dateField=parseInt(dateField,10);if(dateField<=0){dateField=null}}else{dateField=null}}if(monthStartIndex!==undefined&&monthStartIndex!==null){monthField=value.substring(monthStartIndex,monthStartIndex+2);if(monthField.indexOf(this.options.unfilledCharsPrompt)!==-1){regExpr=new RegExp($.ig.util.escapeRegExp(this.options.unfilledCharsPrompt),"g");monthField=monthField.replace(regExpr,"")}if(monthField!==""){monthField=parseInt(monthField,10);if(monthField<=0){monthField=null}else{monthField--}}else{monthField=null}}if(yearStartIndex!==undefined&&yearStartIndex!==null){if(this._dateIndices.fourDigitYear){yearField=value.substring(yearStartIndex,yearStartIndex+4)}else{yearField=value.substring(yearStartIndex,yearStartIndex+2)}if(yearField.indexOf(this.options.unfilledCharsPrompt)!==-1){regExpr=new RegExp($.ig.util.escapeRegExp(this.options.unfilledCharsPrompt),"g");yearField=yearField.replace(regExpr,"")}if(yearField!==""){yearField=parseInt(yearField,10);yearField=this._fillCentury(yearField)}else{yearField=null}}if(midDayStartIndex!==undefined&&midDayStartIndex!==null){midDayField=value.substring(midDayStartIndex,midDayStartIndex+1);if(midDayField===this.options.unfilledCharsPrompt){midDayField=null}else{midDayField=midDayField.toLocaleLowerCase()}}if(hourStartIndex!==undefined&&hourStartIndex!==null){hourField=value.substring(hourStartIndex,hourStartIndex+2);if(hourField.indexOf(this.options.unfilledCharsPrompt)!==-1){regExpr=new RegExp($.ig.util.escapeRegExp(this.options.unfilledCharsPrompt),"g");hourField=hourField.replace(regExpr,"")}if(hourField!==""){hourField=parseInt(hourField,10);if(this._dateIndices.hh24===false){if(midDayField&&midDayField==="p"){if(hourField!==12){hourField+=12}}else if(hourField===12){hourField=0}}}else{hourField=null}}if(minuteStartIndex!==undefined&&minuteStartIndex!==null){minutesField=value.substring(minuteStartIndex,minuteStartIndex+2);if(minutesField.indexOf(this.options.unfilledCharsPrompt)!==-1){regExpr=new RegExp($.ig.util.escapeRegExp(this.options.unfilledCharsPrompt),"g");minutesField=minutesField.replace(regExpr,"")}if(minutesField!==""){minutesField=parseInt(minutesField,10)}else{minutesField=null}}if(secondsStartIndex!==undefined&&secondsStartIndex!==null){secondsField=value.substring(secondsStartIndex,secondsStartIndex+2);if(secondsField.indexOf(this.options.unfilledCharsPrompt)!==-1){regExpr=new RegExp($.ig.util.escapeRegExp(this.options.unfilledCharsPrompt),"g");secondsField=secondsField.replace(regExpr,"")}if(secondsField!==""){secondsField=parseInt(secondsField,10)}else{secondsField=null}}if(millisecondsStartIndex!==undefined&&millisecondsStartIndex!==null){millisecondsField=value.substring(millisecondsStartIndex,millisecondsStartIndex+this._dateIndices.ffLength);if(millisecondsField.indexOf(this.options.unfilledCharsPrompt)!==-1){regExpr=new RegExp($.ig.util.escapeRegExp(this.options.unfilledCharsPrompt),"g");millisecondsField=millisecondsField.replace(regExpr,"")}if(millisecondsField!==""){if(millisecondsField.length<this._dateIndices.ffLength){ffCount=this._dateIndices.ffLength-millisecondsField.length;millisecondsField=parseInt(millisecondsField,10)*Math.pow(10,ffCount)}millisecondsField=parseInt(millisecondsField,10);if(this._dateIndices.ffLength===2){millisecondsField*=10}else if(this._dateIndices.ffLength===1){millisecondsField*=100}}else{millisecondsField=null}}if(!this._dateObjectValue){if(yearField!==null&&yearField!==undefined&&monthField!==null&&monthField!==undefined&&dateField!==null&&dateField!==undefined){extractedDate=new Date(yearField,monthField,dateField)}else{extractedDate=this._setNewDateMidnight();if(yearField!==null&&yearField!==undefined){this._setDateField("FullYear",extractedDate,yearField)}if(monthField!==null&&monthField!==undefined){this._setDateField("Month",extractedDate,monthField)}if(dateField!==null&&dateField!==undefined){lastDayOfMonth=this._lastDayOfMonth(this._getDateField("FullYear",extractedDate),this._getDateField("Month",extractedDate)+1);if(dateField>lastDayOfMonth){dateField=lastDayOfMonth}this._setDateField("Date",extractedDate,dateField)}}}else{if(this.options.displayTimeOffset!==null){extractedDate=this._getDateOffset(this._dateObjectValue)}else{extractedDate=new Date(this._dateObjectValue.getTime())}}if(yearField!==null&&yearField!==undefined){
this._setDateField("FullYear",extractedDate,yearField)}if(monthField!==null&&monthField!==undefined){if(dateField!==null&&dateField!==undefined){this._setDateField("Date",extractedDate,"15")}this._setDateField("Month",extractedDate,monthField)}if(dateField!==null&&dateField!==undefined){lastDayOfMonth=this._lastDayOfMonth(this._getDateField("FullYear",extractedDate),this._getDateField("Month",extractedDate)+1);if(dateField>lastDayOfMonth){dateField=lastDayOfMonth}this._setDateField("Date",extractedDate,dateField)}if(hourField!==null&&hourField!==undefined){this._setDateField("Hours",extractedDate,hourField)}if(minutesField!==null&&minutesField!==undefined){this._setDateField("Minutes",extractedDate,minutesField)}if(secondsField!==null&&secondsField!==undefined){this._setDateField("Seconds",extractedDate,secondsField)}if(millisecondsField!==null&&millisecondsField!==undefined){this._setDateField("Milliseconds",extractedDate,millisecondsField)}if(this.options.displayTimeOffset!==null){this._clearDateOffset(extractedDate)}return extractedDate},_getDisplayValue:function(date){var dateObject=date?date:this._dateObjectValue;if(!dateObject){return""}if(this.options.yearShift!==null){dateObject=this._getYearShift(dateObject)}if(this.options.displayTimeOffset!==null){dateObject=this._getDateOffset(dateObject)}return $.ig.formatDate(this._displayFormat,dateObject,this.options.regional)},_valueFromText:function(text){var dateFromText=this._parseDateFromMaskedValue(text),dataModeValue;switch(this.options.dataMode){case"date":{dataModeValue=dateFromText}break;case"displayModeText":{dataModeValue=this._getDisplayValue(dateFromText)}break;case"editModeText":{dataModeValue=this._getInternalMaskedValue(dateFromText)}break;default:{dataModeValue=dateFromText}}return dataModeValue},_handleBackSpaceKey:function(){var cursorPosition;this._super();cursorPosition=this._getSelection(this._editorInput[0]).start;if(cursorPosition===this._dateIndices.tt||cursorPosition-1===this._dateIndices.tt){if(this._dateIndices._ttLength===2){if(cursorPosition===this._dateIndices.tt){this._setCursorPosition(cursorPosition+1);$.ui.igMaskEditor.prototype._handleDeleteKey.call(this);this._setCursorPosition(cursorPosition)}else{this._super()}}}},_handleDeleteKey:function(skipCursorPosition){var cursorPosition=this._getSelection(this._editorInput[0]).start;if(cursorPosition===this._maskWithPrompts.length){return}this._super(skipCursorPosition);cursorPosition=this._getSelection(this._editorInput[0]).start;if(cursorPosition-2===this._dateIndices.tt||cursorPosition-1===this._dateIndices.tt){if(this._dateIndices._ttLength===2){if(cursorPosition-1===this._dateIndices.tt){this._super(skipCursorPosition)}else{if(!skipCursorPosition){this._setCursorPosition(cursorPosition-1)}$.ui.igMaskEditor.prototype._handleBackSpaceKey.call(this);if(!skipCursorPosition){this._setCursorPosition(cursorPosition)}}}}},_setMillisecondsEditMode:function(mask,time,currentMilliseconds,delta){var isLimited=this.options.limitSpinToCurrentField,newMilliseconds,secondsUpdateDelta=0,currentSecond,timeSecond,boundary;delta=this._getDelta(delta,"milliseconds");switch(this._dateIndices.ffLength){case 1:boundary=10;break;case 2:boundary=100;break;case 3:boundary=1e3;break}if(currentMilliseconds+delta>=boundary){if(isLimited){newMilliseconds=currentMilliseconds}else{newMilliseconds=currentMilliseconds+delta-boundary;secondsUpdateDelta=1}}else if(currentMilliseconds+delta<0){if(isLimited){newMilliseconds=currentMilliseconds}else{if(currentMilliseconds+delta===0){newMilliseconds=0}else{newMilliseconds=boundary+(currentMilliseconds+delta);secondsUpdateDelta=-1}}}else{newMilliseconds=currentMilliseconds+delta}mask=this._setTimeEditMode(mask,time,currentMilliseconds,newMilliseconds);if(secondsUpdateDelta!==undefined&&secondsUpdateDelta!==0){timeSecond=this._createSecondsPosition();if(timeSecond!==null){currentSecond=parseInt(this._getStringRange(mask,timeSecond.startPosition,timeSecond.endPosition),10);mask=this._setSecondsEditMode(mask,timeSecond,currentSecond,secondsUpdateDelta)}else{if(!isLimited){this._setDateField("Seconds",this._dateObjectValue,this._getDateField("Seconds",this._dateObjectValue)+secondsUpdateDelta)}}}return mask},_setSecondsEditMode:function(mask,time,currentSecond,delta){var isLimited=this.options.limitSpinToCurrentField,newSecond,minuteUpdateDelta=0,currentMinute,timeMinute;delta=this._getDelta(delta,"seconds");delta=delta%60;if(currentSecond+delta>=60){if(isLimited){newSecond=currentSecond}else{newSecond=currentSecond+delta-60;minuteUpdateDelta=1}}else if(currentSecond+delta<1){if(isLimited){newSecond=currentSecond}else{if(currentSecond+delta===0){newSecond=0}else{newSecond=60+(currentSecond+delta);minuteUpdateDelta=-1}}}else{newSecond=currentSecond+delta}mask=this._setTimeEditMode(mask,time,currentSecond,newSecond);if(minuteUpdateDelta!==undefined&&minuteUpdateDelta!==0){timeMinute=this._createMinutesPosition();if(timeMinute!==null){currentMinute=parseInt(this._getStringRange(mask,timeMinute.startPosition,timeMinute.endPosition),10);mask=this._setMinutesEditMode(mask,timeMinute,currentMinute,minuteUpdateDelta)}else{if(!isLimited){this._setDateField("Minutes",this._dateObjectValue,this._getDateField("Minutes",this._dateObjectValue)+minuteUpdateDelta)}}}return mask},_setMinutesEditMode:function(mask,time,currentMinute,delta){var isLimited=this.options.limitSpinToCurrentField,newMinute,hourUpdateDelta=0,currentHour,timeHour;delta=this._getDelta(delta,"minutes");delta=delta%60;if(currentMinute+delta>=60){if(isLimited){newMinute=currentMinute}else{newMinute=currentMinute+delta-60;hourUpdateDelta=1}}else if(currentMinute+delta<1){if(isLimited){newMinute=currentMinute}else{if(currentMinute+delta===0){newMinute=0}else{newMinute=60+(currentMinute+delta);hourUpdateDelta=-1}}}else{newMinute=currentMinute+delta}mask=this._setTimeEditMode(mask,time,currentMinute,newMinute);if(hourUpdateDelta!==undefined&&hourUpdateDelta!==0){timeHour=this._createHoursPosition();if(timeHour!==null){currentHour=parseInt(this._getStringRange(mask,timeHour.startPosition,timeHour.endPosition),10);mask=this._setHoursEditMode(mask,timeHour,currentHour,hourUpdateDelta)}else{if(!isLimited){this._setDateField("Hours",this._dateObjectValue,this._getDateField("Hours",this._dateObjectValue)+hourUpdateDelta)}}}return mask},_setHoursEditMode:function(mask,time,currentHour,delta){var isLimited=this.options.limitSpinToCurrentField,is24format=this._dateIndices.hh24,dayUpdateDelta=false,amPmUpdateDelta=false,newHour,hours,wrapUpHours,wrapDownHours,currentDay,currentAmPm,timeDay,timeAmPm,dayDelta;delta=this._getDelta(delta,"hours");if(is24format){hours=24;newHour=currentHour+(Math.abs(delta)===24?delta:delta%24);wrapUpHours=newHour>=hours;wrapDownHours=newHour<0}else{hours=12;newHour=currentHour+(Math.abs(delta)===12?delta:delta%12);wrapUpHours=newHour>hours;wrapDownHours=newHour<1;currentAmPm=mask.toLowerCase().indexOf(" pm")>=0?"pm":"am"}if(wrapUpHours){if(isLimited){newHour=currentHour}else{dayDelta=delta!==0?1:0;if(is24format){newHour-=hours;dayUpdateDelta=true}else{if(newHour>=13){if(newHour>13||delta>1){amPmUpdateDelta=true}if(currentAmPm==="pm"&&(currentHour<12||currentHour===12&&delta===12)){dayUpdateDelta=true}newHour=newHour-hours}}}}else if(wrapDownHours){if(isLimited){newHour=currentHour}else{dayDelta=delta!==0?-1:0;if(is24format){newHour+=hours;dayUpdateDelta=true}else{if(newHour<0||Math.abs(delta)===12){if(newHour<hours||delta<-1){amPmUpdateDelta=true}if(currentAmPm==="am"){dayUpdateDelta=true}}newHour=12+newHour}}}else{if(!is24format){if(delta>0&&newHour>=12&&newHour-delta<12){dayDelta=delta!==0?1:0;amPmUpdateDelta=true;if(currentAmPm==="pm"){dayUpdateDelta=true}}if(delta<0&&newHour<=12&&newHour-delta>=12){dayDelta=delta!==0?-1:0;amPmUpdateDelta=true;if(currentAmPm==="am"){dayUpdateDelta=true}}}}mask=this._setTimeEditMode(mask,time,currentHour,newHour);if(amPmUpdateDelta){timeAmPm=this._createAmOrPmPosition();if(timeAmPm!==null){mask=this._setAmOrPmEditMode(mask,timeAmPm,currentAmPm)}}if(dayUpdateDelta){timeDay=this._createDayPosition();if(timeDay!==null){currentDay=parseInt(this._getStringRange(mask,timeDay.startPosition,timeDay.endPosition),10);mask=this._setDayEditMode(mask,timeDay,currentDay,dayDelta)}else{if(!isLimited){this._setDateField("Date",this._dateObjectValue,this._getDateField("Date",this._dateObjectValue)+dayDelta)}}}return mask},_setAmOrPmEditMode:function(mask,time,currentAmOrPm,noSwap){var newAmOrPm;if(noSwap){newAmOrPm=currentAmOrPm}else{if(currentAmOrPm.toLocaleLowerCase()==="am"){newAmOrPm="PM"}else{newAmOrPm="AM"}}mask=this._setTimeEditMode(mask,time,currentAmOrPm,newAmOrPm);return mask},_lastDayOfMonth:function(year,month){var day;if(month===1||month===3||month===5||month===7||month===8||month===10||month===12){day=31}else if(month===4||month===6||month===9||month===11){day=30}else if(month===2&&year%4===0){day=29}else if(month===2&&year%4!==0){day=28}return day},_setDayEditMode:function(mask,time,currentDay,delta){var isLimited=this.options.limitSpinToCurrentField,currentYear,currentMonth,lastDayOfMonth,lastDayOfPreviousMonth,newDay,monthUpdateDelta,timeYear,timeMonth,today;delta=this._getDelta(delta,"day");today=new Date;timeYear=this._createYearPosition();if(timeYear===null){currentYear=today.getFullYear()}else{currentYear=parseInt(this._getStringRange(mask,timeYear.startPosition,timeYear.endPosition),10)}timeMonth=this._createMonthPosition();if(timeMonth===null){currentMonth=today.getMonth()+1}else{currentMonth=parseInt(this._getStringRange(mask,timeMonth.startPosition,timeMonth.endPosition),10)}lastDayOfMonth=this._lastDayOfMonth(currentYear,currentMonth);lastDayOfPreviousMonth=this._lastDayOfMonth(currentYear,currentMonth-1!==0?currentMonth-1:12);if(currentDay+delta>lastDayOfMonth){if(isLimited){newDay=currentDay}else{newDay=currentDay+delta-lastDayOfMonth;monthUpdateDelta=1}}else if(currentDay+delta<1){if(isLimited){newDay=currentDay}else{newDay=lastDayOfPreviousMonth+(currentDay+delta);monthUpdateDelta=-1}}else{newDay=currentDay+delta}mask=this._setTimeEditMode(mask,time,currentDay,newDay);if(monthUpdateDelta!==undefined&&monthUpdateDelta!==0){timeMonth=this._createMonthPosition();if(timeMonth!==null){currentMonth=parseInt(this._getStringRange(mask,timeMonth.startPosition,timeMonth.endPosition),10);mask=this._setMonthEditMode(mask,timeMonth,currentMonth,monthUpdateDelta)}else{if(!isLimited){this._setDateField("Month",this._dateObjectValue,this._getDateField("Month",this._dateObjectValue)+monthUpdateDelta)}}}return mask},_setMonthEditMode:function(mask,time,currentMonth,delta){var isLimited=this.options.limitSpinToCurrentField,newMonth,yearUpdateDelta=0,currentYear,timeYear;delta=this._getDelta(delta,"month");if(currentMonth+delta>12){if(isLimited){newMonth=currentMonth}else{newMonth=currentMonth+delta-12;yearUpdateDelta=1}}else if(currentMonth+delta<1){if(isLimited){newMonth=currentMonth}else{newMonth=12+(currentMonth+delta);yearUpdateDelta=-1}}else{newMonth=currentMonth+delta}mask=this._setTimeEditMode(mask,time,currentMonth,newMonth);if(yearUpdateDelta!==undefined&&yearUpdateDelta!==0){timeYear=this._createYearPosition();if(timeYear!==null){currentYear=parseInt(this._getStringRange(mask,timeYear.startPosition,timeYear.endPosition),10);mask=this._setYearEditMode(mask,timeYear,currentYear,yearUpdateDelta)}else{if(!isLimited){this._setDateField("FullYear",this._dateObjectValue,this._getDateField("FullYear",this._dateObjectValue)+yearUpdateDelta)}}}return mask},_setYearEditMode:function(mask,time,currentYear,delta){var newYear;delta=this._getDelta(delta,"year");if(currentYear+delta<0){newYear=currentYear}else{newYear=currentYear+delta}newYear=newYear.toString();if(!this._dateIndices.fourDigitYear){newYear=newYear.substring(newYear.length-2,newYear.length)}mask=this._setTimeEditMode(mask,time,currentYear,newYear);return mask},_setTimeEditMode:function(mask,time,currentValue,newValue){var newValueAsString;newValueAsString=newValue.toString();if(newValueAsString.length===1){if(!(time.name==="milliseconds"&&this._dateIndices.ffLength===1)){newValueAsString="0"+newValueAsString}if(time.name==="milliseconds"&&this._dateIndices.ffLength===3){newValueAsString="0"+newValueAsString}if(time.name==="year"&&this._dateIndices.fourDigitYear){newValueAsString="00"+newValueAsString}}else if(newValueAsString.length===2&&time.name==="year"&&this._dateIndices.fourDigitYear){newValueAsString="00"+newValueAsString}else if(newValueAsString.length===3&&time.name==="year"&&this._dateIndices.fourDigitYear){newValueAsString="0"+newValueAsString}mask=this._replaceStringRange(mask,newValueAsString,time.startPosition,time.endPosition-1);return mask},_createYearPosition:function(){var time=null;if(this._dateIndices.yy!==undefined){time={};time.name="year";time.startPosition=this._dateIndices.yy;time.length=this._dateIndices.fourDigitYear?4:2;time.endPosition=time.startPosition+time.length}return time},_createMonthPosition:function(){var time=null;if(this._dateIndices.MM!==undefined){time={};time.name="month";time.startPosition=this._dateIndices.MM;time.length=2;time.endPosition=time.startPosition+time.length}return time},_createDayPosition:function(){var time=null;if(this._dateIndices.dd!==undefined){time={};time.name="day";time.startPosition=this._dateIndices.dd;time.length=2;time.endPosition=time.startPosition+time.length}return time},_createAmOrPmPosition:function(){var time=null;if(this._dateIndices.tt!==undefined){time={};time.name="amOrPm";time.startPosition=this._dateIndices.tt;time.length=2;time.endPosition=time.startPosition+time.length}return time},_createHoursPosition:function(){var time=null;if(this._dateIndices.hh!==undefined){time={};time.name="hours";time.startPosition=this._dateIndices.hh;time.length=2;time.endPosition=time.startPosition+time.length}return time},_createMinutesPosition:function(){var time=null;if(this._dateIndices.mm!==undefined){time={};time.name="minutes";time.startPosition=this._dateIndices.mm;time.length=2;time.endPosition=time.startPosition+time.length}return time},_createSecondsPosition:function(){var time=null;if(this._dateIndices.ss!==undefined){time={};time.name="seconds";time.startPosition=this._dateIndices.ss;time.length=2;time.endPosition=time.startPosition+time.length}return time},_createMillisecondsPosition:function(){var time=null;if(this._dateIndices.ff!==undefined){time={};time.name="milliseconds";time.startPosition=this._dateIndices.ff;time.length=this._dateIndices.ffLength;time.endPosition=time.startPosition+time.length}return time},_getTimePosition:function(){var cursorPosition=this._getCursorPosition(),indices=this._dateIndices,time=null;if(cursorPosition<0){cursorPosition=0}if(cursorPosition>=indices.yy&&(indices.fourDigitYear&&cursorPosition<=indices.yy+4||(indices.fourDigitYear===undefined||indices.fourDigitYear===false)&&cursorPosition<=indices.yy+2)){time=this._createYearPosition()}else if(cursorPosition>=indices.MM&&cursorPosition<=indices.MM+2){time=this._createMonthPosition()}else if(cursorPosition>=indices.dd&&cursorPosition<=indices.dd+2){time=this._createDayPosition()}else if(cursorPosition>=indices.tt&&cursorPosition<=indices.tt+2){time=this._createAmOrPmPosition()}else if(cursorPosition>=indices.hh&&cursorPosition<=indices.hh+2){time=this._createHoursPosition()}else if(cursorPosition>=indices.mm&&cursorPosition<=indices.mm+2){time=this._createMinutesPosition()}else if(cursorPosition>=indices.ss&&cursorPosition<=indices.ss+2){time=this._createSecondsPosition()}else if(cursorPosition>=indices.ff&&cursorPosition<=indices.ff+indices.ffLength){time=this._createMillisecondsPosition()}return time},_updateTimeMask:function(mask,time,delta){var currentValueString,currentValue,range,index,unfilled=this.options.unfilledCharsPrompt;currentValueString=range=this._getStringRange(mask,time.startPosition,time.endPosition);for(index=0;index<range.length;index++){if(currentValueString.indexOf(unfilled)===index){currentValueString=currentValueString.replace(unfilled,"0")}else{break}}if(time.name!=="amOrPm"){currentValue=parseInt(currentValueString,10)}if(!this._dateObjectValue&&mask.indexOf(unfilled)>=0){mask=this._initEmptyMask(this._dateObjectValue,mask);mask=mask.substring(0,time.startPosition)+currentValueString+mask.substring(time.endPosition,mask.length)}switch(time.name){case"year":mask=this._setYearEditMode(mask,time,currentValue,delta);break;case"month":mask=this._setMonthEditMode(mask,time,currentValue,delta);break;case"day":mask=this._setDayEditMode(mask,time,currentValue,delta);break;case"amOrPm":currentValue=this._getStringRange(mask,time.startPosition,time.endPosition);mask=this._setAmOrPmEditMode(mask,time,currentValue);break;case"hours":mask=this._setHoursEditMode(mask,time,currentValue,delta);break;case"minutes":mask=this._setMinutesEditMode(mask,time,currentValue,delta);break;case"seconds":mask=this._setSecondsEditMode(mask,time,currentValue,delta);break;case"milliseconds":mask=this._setMillisecondsEditMode(mask,time,currentValue,delta);break}return mask},_initEmptyMask:function(date,mask){mask=mask||this._maskWithPrompts;var timeYear,timeMonth,timeDay,timeHours,timeAmOrPM,timeMinutes,timeSeconds,timeMilliseconds,year,month,day,hours,amPM,minutes,seconds,milliseconds;if(!date){date=this._parseDateFromMaskedValue(mask)}timeYear=this._createYearPosition();timeMonth=this._createMonthPosition();timeDay=this._createDayPosition();timeHours=this._createHoursPosition();timeAmOrPM=this._createAmOrPmPosition();timeMinutes=this._createMinutesPosition();timeSeconds=this._createSecondsPosition();timeMilliseconds=this._createMillisecondsPosition();year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();hours=date.getHours();amPM=!this._dateIndices.hh24&&hours>=12?"PM":"AM";hours=!this._dateIndices.hh24&&hours>12?hours-12:hours;minutes=date.getMinutes();seconds=date.getSeconds();milliseconds=date.getMilliseconds();if(timeYear){mask=this._setYearEditMode(mask,timeYear,year,0)}if(timeMonth){mask=this._setMonthEditMode(mask,timeMonth,month,0)}if(timeDay){mask=this._setDayEditMode(mask,timeDay,day,0)}if(timeHours){mask=this._setHoursEditMode(mask,timeHours,hours,0)}if(timeAmOrPM){mask=this._setAmOrPmEditMode(mask,timeAmOrPM,amPM,true)}if(timeMinutes){mask=this._setMinutesEditMode(mask,timeMinutes,minutes,0)}if(timeSeconds){mask=this._setSecondsEditMode(mask,timeSeconds,seconds,0)}if(timeMilliseconds){mask=this._setMillisecondsEditMode(mask,timeMilliseconds,milliseconds,0)}return mask},_spinEditMode:function(delta,userInteraction){var self=this,cursorPosition=this._getCursorPosition(),mask=this._editorInput.val(),time;time=this._getTimePosition();if(!time){return}if(mask===undefined){return}else if(mask===""||mask===this._maskWithPrompts){mask=this._initEmptyMask(this._dateObjectValue,mask)}else{mask=this._updateTimeMask(mask,time,delta)}this._editorInput.val(mask);if(userInteraction){this._processTextChanged()}self._setCursorPosition(cursorPosition)},_setTimePeriod:function(periodName,delta,userInteraction){var date,period,newPeriod;if(!this._dateObjectValue||!this._isValidDate(this._dateObjectValue)){date=this._setNewDateMidnight();delta=0}else{date=new Date(this._dateObjectValue)}period=this._getDateField(periodName,date);newPeriod=period+delta;if(!this._isNewPeriodLimited(periodName,newPeriod,delta,date)){this._setDateField(periodName,date,newPeriod);if(userInteraction){this._triggerInternalValueChange(date);this._editorInput.val(this._getDisplayValue());this._processTextChanged()}else{this._processInternalValueChanging(date);this._editorInput.val(this._getDisplayValue())}}},_isNewPeriodLimited:function(name,value,delta,date){var isLimited=false;if(this.options.limitSpinToCurrentField){if(delta<0){if(value<0){isLimited=true}}else if(name==="Month"&&value===13||name==="Month"&&value===this._lastDayOfMonth(date.getFullYear()&&date.getMonth())+1||(name==="Hours"||name==="Minutes"||name==="Seconds")&&value===60||name==="Milliseconds"&&value===1e3){isLimited=true}}return isLimited},_spinDisplayMode:function(delta,userInteraction){var indices=this._dateIndices,periodName;if(indices.dd!==undefined){periodName="Date";delta=this._getDelta(delta,"day")}else if(indices.ff!==undefined){periodName="Milliseconds";delta=this._getDelta(delta,"milliseconds");if(indices.ffLength===2){delta=delta*10}else if(indices.ffLength===1){delta=delta*100}}else if(indices.ss!==undefined){periodName="Seconds";delta=this._getDelta(delta,"seconds")}else if(indices.mm!==undefined){periodName="Minutes";delta=this._getDelta(delta,"minutes")}else if(indices.hh!==undefined){periodName="Hours";delta=this._getDelta(delta,"hours")}else if(indices.MM!==undefined){periodName="Month";delta=this._getDelta(delta,"month")}else{periodName="FullYear";delta=this._getDelta(delta,"year")}this._setTimePeriod(periodName,delta,userInteraction)},_spin:function(delta,userInteraction){if(!delta){return}this._clearEditorNotifier();this._currentInputTextValue=this._editorInput.val();if(this._editMode){this._spinEditMode(delta,userInteraction)}else{this._spinDisplayMode(delta,userInteraction)}},_spinUpEditMode:function(delta){this._spinEditMode(delta?delta:this.options.spinDelta)},_spinDownEditMode:function(delta){this._spinEditMode(delta!==undefined?this._setNegativeDelta(delta):this._setNegativeDelta(this.options.spinDelta))},value:function(newValue){var parsedVal;if(newValue!==undefined){this._clearEditorNotifier();parsedVal=this._getDateObjectFromValue(newValue);if(newValue!==null&&this._isValidDate(parsedVal)){if(this.options.maxValue&&parsedVal>this.options.maxValue){newValue=this._getDateObjectFromValue(this.options.maxValue);this._sendNotification("warning",{optName:"maxValExceedSetErrMsg",arg:this._getDisplayValue(new Date(this.options.maxValue))})}else if(this.options.minValue&&parsedVal<this.options.minValue){newValue=this._getDateObjectFromValue(this.options.minValue);this._sendNotification("warning",{optName:"minValExceedSetErrMsg",arg:this._getDisplayValue(new Date(this.options.minValue))})}}if(this._validateValue(newValue)){this._updateValue(newValue);this._updateMaskedValue()}else{if(this.options.revertIfNotValid&&!(newValue===null&&this.options.allowNullValue)){newValue=this._valueInput.val();this._updateValue(newValue)}else{this._clearValue()}}this._editorInput.val(this._editMode?this._maskedValue:this._getDisplayValue());this._setSpinButtonsState(newValue)}else{if(this.options.value){return this._getValueByDataMode()}else{return this.options.value}}this._checkClearButtonState()},getSelectedDate:function(){return new Date(this._dateObjectValue.getTime())},selectDate:function(date){this._updateValue(date);this._exitEditMode()},spinUp:function(delta){delta=parseInt(delta,10);this._spin(!isNaN(delta)&&delta>=0?delta:this.options.spinDelta)},spinDown:function(delta){delta=parseInt(delta,10);this._spin(!isNaN(delta)&&delta>=0?this._setNegativeDelta(delta):this._setNegativeDelta(this.options.spinDelta))},spinUpButton:function(){return $.ui.igTextEditor.prototype.spinUpButton.call(this)},spinDownButton:function(){return $.ui.igTextEditor.prototype.spinDownButton.call(this)},isValid:function(){var value,valid;value=this.field().val();this._skipMessages=true;if(this._editMode){if(value===this._maskWithPrompts){valid=false}else{valid=this._validateValue(this._parseDateFromMaskedValue(value))}}else{valid=this._validateValue(this._dateObjectValue);if(value!==""&&!valid){valid=false;this._sendNotification("warning",{optName:"dateMessage"})}}this._skipMessages=false;return valid},dropDownButton:function(){throw new Error(this._getLocaleValue("datePickerNoSuchMethodDropDownContainer"))},dropDownContainer:function(){throw new Error(this._getLocaleValue("datePickerNoSuchMethodDropDownContainer"))},dropDownVisible:function(){throw new Error(this._getLocaleValue("datePickerNoSuchMethodDropDownContainer"))},findListItemIndex:function(){throw new Error(this._getLocaleValue("datePickerEditorNoSuchMethod"))},getSelectedListItem:function(){throw new Error(this._getLocaleValue("datePickerEditorNoSuchMethod"))},selectedListIndex:function(){throw new Error(this._getLocaleValue("datePickerEditorNoSuchMethod"))}});$.extend($.ui.igDateEditor,{version:"21.2.12"});$.widget("ui.igDatePicker",$.ui.igDateEditor,{options:{buttonType:"dropdown",datepickerOptions:null,dropDownOnReadOnly:false,dropDownAttachedToBody:false,isLimitedToListValues:false,listItemHoverDuration:0,listItems:null,listWidth:0,suppressKeyboard:false},events:{dropDownListOpening:"dropDownListOpening",dropDownListOpened:"dropDownListOpened",dropDownListClosing:"dropDownListClosing",dropDownItemSelecting:"dropDownItemSelecting",dropDownListClosed:"dropDownListClosed",dropDownItemSelected:"dropDownItemSelected",itemSelected:"itemSelected"},_setDropDownListWidth:function(){},_listMouseDownHandler:function(){},_updateDropdownSelection:function(){var pickerInst,cursorPosition,parsedDate,val=this._editorInput.val();if(this._pickerOpen&&this._validateRequiredPrompts(val)){cursorPosition=this._getCursorPosition();pickerInst=$.data(this._editorInput[0],"datepicker");parsedDate=this._parseDateFromMaskedValue(val);if(this.options.displayTimeOffset!==null){parsedDate=this._getDateOffset(parsedDate)}this._editorInput.datepicker("setDate",parsedDate);this._editorInput.val(val);if(pickerInst){pickerInst.lastVal=val}this._setCursorPosition(cursorPosition)}},_disableEditor:function(applyDisabledClass){if(this.options.dropDownOnReadOnly){if(applyDisabledClass){this._editorInput.addClass(this.css.disabled)}this._detachEvents()}else{if(applyDisabledClass){this._editorContainer.addClass(this.css.disabled)}this._detachEvents()}if(this._dropDownButton&&!this.options.dropDownOnReadOnly){this._dropDownButton.addClass(this.css.disabled);this._detachButtonsEvents(this._dropDownButton)}if(this._clearButton){this._clearButton.addClass(this.css.disabled);this._detachButtonsEvents(this._clearButton)}if(this._spinUpButton){this._spinUpButton.addClass(this.css.disabled);this._detachButtonsEvents(this._spinUpButton)}if(this._spinDownButton){this._spinDownButton.addClass(this.css.disabled);this._detachButtonsEvents(this._spinDownButton)}},_setFocus:function(event){if(this._shouldNotFocusInput){event.target.blur();delete this._shouldNotFocusInput;event.preventDefault();return}this._super(event)},_setBlur:function(event){if(this._pickerOpen){return}else{this._super(event)}},_pickerDefaults:function(){var self=this,pickerDefaults;pickerDefaults={showOn:"",duration:self.options.dropDownAnimationDuration?self.options.dropDownAnimationDuration:"normal",onSelect:function(dateText,inst){var date,dateFromPicker=$(this).datepicker("getDate");if(self._dateObjectValue){if(self.options.displayTimeOffset!==null){date=self._getDateOffset(self._dateObjectValue)}else{date=new Date(self._dateObjectValue)}}else{date=self._setNewDateMidnight()}self._setDateField("FullYear",date,dateFromPicker.getFullYear());self._setDateField("Date",date,15);self._setDateField("Month",date,dateFromPicker.getMonth());self._setDateField("Date",date,dateFromPicker.getDate());if(self.options.displayTimeOffset!==null){self._clearDateOffset(date)}self._processValueChanging(date);inst.lastVal=self._getEditModeValue();self._editorInput.val(inst.lastVal);self._triggerItemSelected.call(self,inst.dpDiv.find(".ui-datepicker-calendar>tbody>tr>td .ui-state-hover"),dateFromPicker);self._processTextChanged();if(self.options.readOnly===true||self.options.disabled===true){self._exitEditMode()}else{self._focused=false;if(!self.options.suppressKeyboard){self._editorInput.focus()}}},beforeShow:function(){self._pickerOpen=true},onClose:function(){delete self._pickerOpen;if(!self._editorInput.is(document.activeElement)){self._editorInput.blur()}self._triggerDropDownClosed()}};return pickerDefaults},_renderList:function(){var self=this,options,regional;regional=$.extend({},self._dpRegion(),self.options.datepickerOptions)||{};options=$.extend(regional,this._pickerDefaults());if(regional.onSelect){var igOnSelect=regional.onSelect;options.onSelect=function(dateText,inst){igOnSelect.call(this,dateText,inst);if(self.options.datepickerOptions&&self.options.datepickerOptions.onSelect){self.options.datepickerOptions.onSelect.call(this,dateText,inst)}}}if(regional.onClose){var igOnClose=regional.onClose;options.onClose=function(dateText,inst){igOnClose.call(this);if(self.options.datepickerOptions&&self.options.datepickerOptions.onClose){self.options.datepickerOptions.onClose.call(this,dateText,inst)}}}if(self.options.datepickerOptions&&self.options.datepickerOptions.beforeShow){var isBeforeShow=regional.beforeShow;options.beforeShow=function(input){isBeforeShow.call(this);if(self.options.datepickerOptions&&self.options.datepickerOptions.beforeShow){self.options.datepickerOptions.beforeShow.call(this,input)}}}if(self.options.datepickerOptions&&self.options.datepickerOptions.onChangeMonthYear){var isOnChangeMonthYear=regional.onChangeMonthYear;options.onChangeMonthYear=function(year,month,date){isOnChangeMonthYear.call(this,year,month,date);if(self.options.suppressKeyboard){self._shouldNotFocusInput=true}}}else{options.onChangeMonthYear=function(){if(self.options.suppressKeyboard){self._shouldNotFocusInput=true}}}this._editorInput.datepicker(options);this._dropDownList=this._editorInput.datepicker("widget")},_renderDropDownButton:function(){var dropDownButton=$("<div></div>"),dropDownIcon=$("<div></div>");dropDownButton.addClass(this.css.buttonCommon).attr({title:this._getLocaleValue("datePickerButtonTitle"),role:"button",tabindex:-1,id:this.id+"_calendarButton","data-localeid":"datePickerButtonTitle","data-localeattr":"title"});this._editorContainer.prepend(dropDownButton.addClass(this.css.dropDownButton).append(dropDownIcon.addClass(this.css.dropDownImage)));this._dropDownButton=dropDownButton;this._attachButtonsEvents("dropdown",dropDownButton)},_dpRegion:function(){var reg=this.options.regional,lastRegional,regional=null,abbreviation="";if($.datepicker&&typeof reg==="string"){if(reg==="defaults"){if(typeof $.ig.util.regional==="string"&&$.ig.util.regional){abbreviation=$.ig.util.regional}}else{abbreviation=reg}regional=$.datepicker.regional[abbreviation]||$.datepicker.regional[""]}if(regional===null&&$.datepicker){for(lastRegional in $.datepicker.regional){}if($.datepicker.regional[lastRegional]){regional=$.datepicker.regional[lastRegional]}}return regional},_create:function(){$.ui.igDateEditor.prototype._create.call(this)},_initialize:function(){this._super();this.options.listItems=["datePicker"]},_applyOptions:function(){this._super();if(!this.options.minValue&&this.options.datepickerOptions&&this.options.datepickerOptions.minDate){if(this._isValidDate(this.options.datepickerOptions.minDate)){this.options.minValue=this.options.datepickerOptions.minDate;if(this.options.displayTimeOffset!==null){this._editorInput.datepicker("option","minDate",this._getDateOffset(this._getDateObjectFromValue(this.options.datepickerOptions.minDate)));this._editorInput.val(this._getDisplayValue())}}}if(!this.options.maxValue&&this.options.datepickerOptions&&this.options.datepickerOptions.maxDate){if(this._isValidDate(this.options.datepickerOptions.minDate)){this.options.maxValue=this.options.datepickerOptions.maxDate;if(this.options.displayTimeOffset!==null){this._editorInput.datepicker("option","maxDate",this._getDateOffset(this._getDateObjectFromValue(this.options.datepickerOptions.maxDate)));this._editorInput.val(this._getDisplayValue())}}}},_positionDropDownList:function(){},_setOption:function(option,value){var prevValue=this.options[option];if(prevValue===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"datepickerOptions":var pickerOptions=this._editorInput.data("datepicker").settings,settings,self=this,options;settings=$.extend(value,this._pickerDefaults());options=$.extend(pickerOptions,settings);if(settings.onSelect){var igOnSelect=settings.onSelect;options.onSelect=function(dateText,inst){igOnSelect.call(this,dateText,inst);
if(self.options.datepickerOptions&&self.options.datepickerOptions.onSelect){self.options.datepickerOptions.onSelect.call(this,dateText,inst)}}}if(settings.onClose){var igOnClose=settings.onClose;pickerOptions.onClose=function(dateText,inst){igOnClose.call(this);if(self.options.datepickerOptions&&self.options.datepickerOptions.onClose){self.options.datepickerOptions.onClose.call(this,dateText,inst)}}}this._editorInput.data("datepicker").settings=pickerOptions;if(value.minDate&&this._editorInput.data("datepicker").settings.minDate!==this.options.minValue){this._setOption("minValue",this._editorInput.data("datepicker").settings.minDate)}if(value.maxDate&&this._editorInput.data("datepicker").settings.maxDate!==this.options.maxValue){this._setOption("maxValue",this._editorInput.data("datepicker").settings.maxDate)}break;case"minValue":case"maxValue":this.options[option]=prevValue;this._super(option,value);this._editorInput.datepicker("option","minDate",this.options.minValue);this._editorInput.datepicker("option","maxDate",this.options.maxValue);this._editorInput.val(this._currentInputTextValue);break;default:this.options[option]=prevValue;this._super(option,value);break}},_triggerKeyDown:function(event){if(event.keyCode===38&&!event.altKey){if(!event.ctrlKey){this._spinUpEditMode();event.preventDefault()}}else if(event.keyCode===40&&!event.altKey){if(!event.ctrlKey){this._spinDownEditMode();event.preventDefault()}}else{this._super(event)}},_triggerDropDownOpened:function(){var args={owner:this,editorInput:this._editorInput,calendar:this._dropDownList};this._trigger(this.events.dropDownListOpened,null,args)},_triggerDropDownOpening:function(){var args={owner:this,editorInput:this._editorInput,calendar:this._dropDownList};return this._trigger(this.events.dropDownListOpening,null,args)},_triggerDropDownClosed:function(){var args={owner:this,editorInput:this._editorInput,calendar:this._dropDownList};this._trigger(this.events.dropDownListClosed,null,args)},_toggleDropDown:function(){var noCancel;if(this._dropDownList.is(":visible")&&(!!this._focused||this.options.readOnly)&&!!this._dropDownOpened){this._hideDropDownList()}else{noCancel=this._triggerDropDownOpening();if(noCancel){this._showDropDownList()}}},_triggerItemSelected:function(htmlItem,dateFromPicker){var args={owner:this,dateFromPicker:dateFromPicker,item:htmlItem,calendar:this._dropDownList};this._trigger(this.events.itemSelected,null,args)},_showDropDownList:function(){this._dropDownOpened=true;var self=this,direction,currentDate=this._dateObjectValue,currentInputValue,pickerInst;this._cancelBlurDatePickerOpen=true;this._positionDropDownList();if(this.options.dropDownOrientation==="top"){direction="up"}else{direction="down"}if(this._editMode&&this._editorInput.val()!==this._maskWithPrompts){currentDate=this._parseDateFromMaskedValue(this._editorInput.val())}if(currentDate){if(this.options.displayTimeOffset!==null){currentDate=this._getDateOffset(currentDate)}if(!this._editMode){this._enterEditMode()}currentInputValue=this._editorInput.val();$(this._editorInput).datepicker("setDate",currentDate)}if(currentInputValue===undefined){currentInputValue=this._editorInput.val()}pickerInst=$.data(this._editorInput[0],"datepicker");try{if(this.options.suppressKeyboard){if(this._focused){this._editorInput.blur()}this._shouldNotFocusInput=true}this._editorInput.datepicker("option","showOptions",{direction:direction});this._editorInput.datepicker("show");if(currentInputValue){this._editorInput.val(currentInputValue);if(pickerInst){pickerInst.lastVal=currentInputValue}}}catch(ex){this._editorInput.datepicker("show");if(currentInputValue){this._editorInput.val(currentInputValue)}}this._dropDownList.promise().done(function(){self._triggerDropDownOpened()})},_hideDropDownList:function(){this._dropDownOpened=false;this._editorInput.datepicker("hide");this._editorInput.attr("aria-expanded",false)},_deleteList:function(){this._detachListEvents();delete this._dropDownList},changeRegional:function(){var regional,opts=this.options.datepickerOptions;regional=$.extend({},this._dpRegion());if(opts&&typeof opts==="object"){for(var key in regional){if(regional.hasOwnProperty(key)){regional[key]=opts[key]||regional[key]}}}this._editorInput.datepicker("option",regional);this._super()},getCalendar:function(){return $.ui.igTextEditor.prototype.dropDownContainer.call(this)},dropDownContainer:function(){throw new Error(this._getLocaleValue("datePickerNoSuchMethodDropDownContainer"))},findListItemIndex:function(){throw new Error(this._getLocaleValue("datePickerEditorNoSuchMethod"))},getSelectedListItem:function(){throw new Error(this._getLocaleValue("datePickerEditorNoSuchMethod"))},selectedListIndex:function(){throw new Error(this._getLocaleValue("datePickerEditorNoSuchMethod"))},showDropDown:function(){$.ui.igTextEditor.prototype.showDropDown.call(this)},hideDropDown:function(){$.ui.igTextEditor.prototype.hideDropDown.call(this)},dropDownButton:function(){return $.ui.igTextEditor.prototype.dropDownButton.call(this)},dropDownVisible:function(){return $.ui.igTextEditor.prototype.dropDownVisible.call(this)},destroy:function(){if(this._editorInput){this._editorInput.datepicker("hide");this._editorInput.datepicker("destroy")}this._superApply(arguments);return this}});$.extend($.ui.igDatePicker,{version:"21.2.12"});$.widget("ui.igCheckboxEditor",$.ui.igBaseEditor,{options:{checked:false,size:"normal",iconClass:"ui-icon-check",tabIndex:0,readOnly:false,allowNullValue:false,nullValue:null},css:{container:"ui-state-default ui-corner-all ui-widget ui-checkbox-container ui-igcheckbox-normal",containerChecked:"ui-state-checkbox-checked",checkboxIcon:"ui-icon",iconCentered:"ui-icon-custom",checked:"ui-igcheckbox-normal-on",unchecked:"ui-igcheckbox-normal-off",checkboxInput:"ui-helper-hidden"},events:{valueChanging:"valueChanging",valueChanged:"valueChanged"},_triggerKeyUp:function(event){var args={originalEvent:event,owner:this,key:event.keyCode,element:event.target,editorInput:this._editorInput};this._trigger(this.events.keyup,event,args)},_triggerKeyPress:function(event){var args={originalEvent:event,owner:this,key:event.keyCode,element:event.target,editorInput:this._editorInput};this._trigger(this.events.keypress,event,args)},_triggerKeyDown:function(event){var args={originalEvent:event,owner:this,key:event.keyCode,element:event.target,editorInput:this._editorInput};this._trigger(this.events.keydown,event,args)},_create:function(){this._checkedClass=this.css.checked;this._uncheckedClass=this.css.unchecked;$.ui.igBaseEditor.prototype._create.call(this)},_render:function(){this._triggerRendering();if(this.element.is("div")){this._editorContainer=this.element;this._editorInput=$("<span></span>");this._valueInput=$("<input type='checkbox'></input>");this._editorContainer.prepend(this._editorInput);this._editorInput.after(this._valueInput)}else if(this.element.is("input")){this._valueInput=this.element;this._editorInput=$("<span></span>");this._editorContainer=this.element.wrap($("<div></div>")).parent();this._valueInput.before(this._editorInput)}else if(this.element.is("span")){this._editorInput=this.element;this._valueInput=$("<input type='checkbox'></input>");this._editorContainer=this.element.wrap($("<div></div>")).parent();this._editorInput.after(this._valueInput)}else{throw new Error(this._getLocaleValue("instantiateCheckBoxErrMsg"))}this._editorContainer.addClass(this.css.container).attr("role","checkbox");this._editorInput.addClass(this.css.checkboxIcon).addClass(this.options.iconClass).addClass(this.css.checked);this._valueInput.addClass(this.css.checkboxInput).attr("aria-hidden","true");if(!$.ig.util.isIE8&&this._valueInput.attr("type")!=="checkbox"){this._valueInput.attr("type","checkbox")}this._attachEvents();this._applyOptions();this._applyAria();this._triggerRendered()},_applyAria:function(){var ariaLabeledBy=this.element.attr("aria-labelledby");if(ariaLabeledBy){this.element.removeAttr("aria-labelledby");this._editorContainer.attr("aria-labelledby",ariaLabeledBy)}},_applyOptions:function(){var checked=this.options.checked;this._super();if(checked){this._initialState()}else{this.options.checked=false}if(this.options.value){this._inputValue=this.options.value;this.value(this.options.value)}this._size(this.options.size);this._setWidth(this.options.width);this._setHeight(this.options.height);this._updateState(checked&&checked!=="false"?true:false)},_setOption:function(option,value){var iconClass=this.options.iconClass;this._super(option,value);switch(option){case"checked":this._updateState(value&&value!=="false"?true:false);break;case"value":this._inputValue=value;this._updateState(this.options.checked);break;case"size":this._size(value);break;case"iconClass":this._setIconClass(iconClass,value);break;default:break}},_readAttributes:function(){var checked=this.element.attr("checked");this._super(this.element);if(checked){this.element.removeAttr("checked");this.options.checked=true}},_attachEvents:function(){var self=this;this._super();this._editorContainer.on({"click.editor":function(event){var internalChecked=self._inputValue!==undefined?self.options.checked:true;if(self._valueInput[0].checked!==internalChecked){self._valueInput[0].checked=internalChecked;this.focus()}self._toggleInternal(event)},"mousedown.editor":function(event){this.focus();event.preventDefault();return false},"focus.editor":function(event){self._setFocus(event,self._cancelFocusTrigger)},"blur.editor":function(event){self._setBlur(event)},"keyup.editor":function(event){var keyCode=event.keyCode||event.which||0;self._triggerKeyUp(event);if(keyCode===32){self._toggleInternal(event);event.preventDefault()}},"keydown.editor":function(event){self._triggerKeyDown(event)},"keypress.editor":function(event){var keyCode=event.keyCode||event.which||0;self._triggerKeyPress(event);if(keyCode===32){event.preventDefault()}}})},_triggerValueChanging:function(event,newState,newValue){var args={owner:this,element:event.target,editorInput:this._editorInput,oldState:this.options.checked,newState:newState,oldValue:this.value(),newValue:newValue};return this._trigger(this.events.valueChanging,event,args)},_triggerValueChanged:function(event){var args={owner:this,element:event.target,editorInput:this._editorInput,newState:this.options.checked,newValue:this.value()};this._trigger(this.events.valueChanged,event,args);this._trigger(this.options.checked?this.events.checked:this.events.unchecked,event,args)},_triggerFocus:function(event){var args={originalEvent:event,owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.focus,event,args)},_triggerBlur:function(event){var args={owner:this,element:event.target,editorInput:this._editorInput};this._trigger(this.events.blur,event,args)},_getState:function(){var state;if(this._inputValue!==undefined){state=this._valueInput[0].checked}else{var value=this._tryParseBool(this._valueInput[0].value);if(value.ret){state=value.p1}else{throw new Error(this._getLocaleValue("cannotParseNonBoolValue"))}}return state},_tryParseBool:function(value){if(typeof value==="boolean"){return{ret:true,p1:value}}else if(typeof value==="string"){return $.ig.Boolean.prototype.tryParse(value)}},_toggleInternal:function(event){var noCancel,newState,newVal;newState=!this._getState();newVal=this.value();if(this._inputValue===undefined){newVal=newState}noCancel=this._triggerValueChanging(event,newState,newVal);if(noCancel){this._updateState(newState);this._triggerValueChanged(event);if(this._validator){this._validator._validateInternal(this.element,event)}}},_initialState:function(){this._valueInput.attr("checked","checked")},_updateState:function(value){this.options.checked=value;this._editorContainer.attr("aria-checked",value);if(value){this._editorInput.removeClass(this._uncheckedClass);this._editorContainer.addClass(this.css.containerChecked)}else{this._editorInput.addClass(this._uncheckedClass);this._editorContainer.removeClass(this.css.containerChecked)}if(this._inputValue!==undefined){this._valueInput[0].checked=value;this._valueInput[0].value=this._inputValue}else{this._valueInput[0].checked=true;this._valueInput[0].value=value}},_removeDOM:function(){if(this.element.is("div")){this.element.empty()}else if(this.element.is("input")&&this._editorInput){this._editorInput.remove();this.element.unwrap()}else if(this.element.is("span")&&this._valueInput){this._valueInput.remove();this.element.unwrap()}},_detachEvents:function(){if(this._editorContainer){this._editorContainer.off("click.editor mousedown.editor focus.editor blur.editor keydown.editor")}this._super()},_clearStyling:function(){if(this._editorContainer){this._editorContainer.removeClass(this.css.checkboxContainer).removeClass(this.css.containerChecked).removeAttr("role")}if(this._editorInput){this._editorInput.removeClass(this._checkedClass).removeClass(this._uncheckedClass).removeClass(this.css.checkboxIcon).removeClass(this.options.iconClass)}if(this._valueInput){this._valueInput.removeClass(this.css.checkboxInput).removeAttr("aria-hidden")}this._super()},_deleteInternalProperties:function(){delete this._checkedClass;delete this._uncheckedClass;this._super()},_size:function(size){if(size){this._editorContainer.removeClass("ui-igcheckbox-verysmall ui-igcheckbox-small").removeClass("ui-igcheckbox-normal ui-igcheckbox-large");this._editorContainer.addClass("ui-igcheckbox-"+size);this._editorInput.removeClass(this._checkedClass).removeClass(this._uncheckedClass);this._checkedClass="ui-igcheckbox-"+size+"-on";this._uncheckedClass="ui-igcheckbox-"+size+"-off";this._editorInput.addClass(this._checkedClass)}},_setTabIndex:function(index){this._editorContainer.attr("tabIndex",index)},_setWidth:function(width){this._super(width);if(width){this._editorInput.addClass(this.css.iconCentered)}},_setHeight:function(height){this._super(height);if(height){this._editorInput.addClass(this.css.iconCentered)}},_setIconClass:function(oldIconClass,iconClass){this._editorInput.removeClass(oldIconClass).addClass(iconClass)},_setFocus:function(event,triggerEvent){this._editorContainer.addClass(this.css.focus);if(event&&!triggerEvent){this._triggerFocus(event)}else{delete this._cancelFocusTrigger}},_setFocusDelay:function(delay){var self=this;if(delay){this._timeouts.push(setTimeout(function(){self._cancelFocusTrigger=true;self._editorContainer.focus();self._setFocus()},delay))}else{this._cancelFocusTrigger=true;this._editorContainer.focus();this._setFocus()}},_setBlur:function(event){this._editorContainer.removeClass(this.css.focus);this._triggerBlur(event);if(this._validator){this._validator._validateInternal(this.element,event,true)}},isValid:function(){return true},value:function(newValue){if(newValue!==undefined){if(this._inputValue===undefined){var result=this._tryParseBool(newValue);if(result&&result.ret){this._updateState(result.p1)}else{throw new Error(this._getLocaleValue("cannotSetNonBoolValue"))}}else{this.options.value=newValue;this._inputValue=newValue;this._updateState(this._getState())}}else{if(this._inputValue===undefined){return this._getState()}return this.options.value}},toggle:function(){if(this._getState()){this._updateState(false)}else{this._updateState(true)}}});$.extend($.ui.igCheckboxEditor,{version:"21.2.12"});$.widget("ui.igTimePicker",$.ui.igDateEditor,{options:{itemsDelta:{hours:0,minutes:30},spinDelta:{hours:1,minutes:30},timeInputFormat:"time",timeDisplayFormat:null,isLimitedToListValues:false,suppressKeyboard:false,dropDownOrientation:"auto",visibleItemsCount:5,listWidth:0,listItemHoverDuration:0,dropDownAttachedToBody:false,dropDownAnimationDuration:300,buttonType:"dropdown",spinWrapAround:true,dateDisplayFormat:null,dateInputFormat:null,yearShift:null,displayTimeOffset:null},events:{dropDownListOpening:"dropDownListOpening",dropDownListOpened:"dropDownListOpened",dropDownListClosing:"dropDownListClosing",dropDownListClosed:"dropDownListClosed",dropDownItemSelecting:"dropDownItemSelecting",dropDownItemSelected:"dropDownItemSelected"},_initialize:function(){if(this.options.timeDisplayFormat){this.options.dateDisplayFormat=this._parseTimeMask(this.options.timeDisplayFormat)}this.options.dateInputFormat=this._parseTimeMask(this.options.timeInputFormat);this._super();if(this.options.minValue){this.options.minValue=this._parseDateFromMaskedValue(this.options.minValue)}if(this.options.maxValue){this.options.maxValue=this._parseDateFromMaskedValue(this.options.maxValue)}var buttons=this.options.buttonType.toString().split(/[\s,]+/);if($.inArray("dropdown",buttons)!==-1&&$.inArray("spin",buttons)===-1){this._populateDropDown(this.options.minValue,this.options.maxValue)}},getSelectedListItem:function(){return $.ui.igTextEditor.prototype.getSelectedListItem.call(this)},dropDownVisible:function(){return $.ui.igTextEditor.prototype.dropDownVisible.call(this)},dropDownButton:function(){return $.ui.igTextEditor.prototype.dropDownButton.call(this)},dropDownContainer:function(){return $.ui.igTextEditor.prototype.dropDownContainer.call(this)},findListItemIndex:function(text,matchType){return $.ui.igTextEditor.prototype.findListItemIndex.call(this,text,matchType)},selectedListIndex:function(index){return $.ui.igTextEditor.prototype.selectedListIndex.call(this,index)},_getEditModeValue:function(val){if($.type(val)==="date"){return this._updateMaskedValue(val,true)}else{return this._super()}},_populateDropDown:function(minValue,maxValue){if(minValue){minValue=minValue.getHours()*60+minValue.getMinutes()}else{minValue=0}if(maxValue){maxValue=maxValue.getHours()*60+maxValue.getMinutes()}else{maxValue=1440}var timeDeltaMinutes=this.options.itemsDelta.hours*60+this.options.itemsDelta.minutes;var startMinutes=minValue/timeDeltaMinutes;var dropDownItemsCount=0;if(timeDeltaMinutes>0&&timeDeltaMinutes<=1440){dropDownItemsCount=1440/timeDeltaMinutes}var initDate=new Date;initDate.setHours(0);initDate.setMinutes(0);initDate.setSeconds(0);this.options.listItems=[];this.options.timeItems=[];for(var i=startMinutes;i<dropDownItemsCount;i++){var date=new Date(initDate);date.setMinutes(timeDeltaMinutes*i);if(timeDeltaMinutes*i>=minValue&&timeDeltaMinutes*i<=maxValue){this.options.listItems.push(date);this.options.timeItems.push(date.toTimeString())}}},_parseTimeMask:function(mask){return mask.replace(/M/g,"\\M").replace(/d/g,"\\d").replace(/y/g,"\\y").replace(/s/g,"\\s").replace(/f/g,"\\f")},_validateValue:function(val){if(this._super(val)){return $.ui.igTextEditor.prototype._validateValue.call(this,val)}else{return false}},_setOption:function(option,value){var prevValue=this.options[option];if(prevValue===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"timeDisplayFormat":this._super("dateDisplayFormat",this._parseTimeMask(value));break;case"timeInputFormat":case"itemsDelta":case"minValue":case"maxValue":this.options[option]=prevValue;throw new Error(this._getLocaleValue("setOptionError")+option);default:this.options[option]=prevValue;this._super(option,value);break}},value:function(newValue){if(newValue===undefined||$.type(newValue)==="date"){return this._super(newValue)}else{return this._super(this._parseDateFromMaskedValue(newValue))}},_updateValue:function(value){this._super(value);if(this._dropDownList!==undefined){this._updateDropdownSelection(value)}},_updateDropdownSelection:function(currentVal){if($.type(currentVal)==="date"){this._super(currentVal)}else{if(this.options.dataMode==="displayModeText"){currentVal=this._parseValueByMask(currentVal)}this._super(this._parseDateFromMaskedValue(currentVal))}},_valueIndexInList:function(val){if(!val&&val!==0){return-1}return $.inArray(val.toTimeString(),this.options.timeItems)},_setBlur:function(event){this._super(event);if(this._dropDownList&&this._dropDownList.is(":visible")&&this._triggerDropDownClosing()){this._hideDropDownList()}},_applyOptions:function(){if($.type(this.options.value)!=="date"&&this.options.value!==null){var convertedValue=this._getDateObjectFromValue(this.options.value);if(!isNaN(convertedValue)){this.options.value=convertedValue}else{this.options.value=this._parseDateFromMaskedValue(this.options.value)}}this._super()},_triggerKeyDown:function(event){if(this._dropDownList){$.ui.igNumericEditor.prototype._triggerKeyDown.call(this,event)}else{this._super(event)}},_spin:function(type,fireEvent){if(this.options.isLimitedToListValues&&this._dropDownList){$.ui.igNumericEditor.prototype._spin.call(this,type,fireEvent)}else{this._super(type,fireEvent)}},_handleSpinUpEvent:function(){if(this.options.isLimitedToListValues&&this._dropDownList){$.ui.igNumericEditor.prototype._handleSpinUpEvent.call(this)}else{this._super()}},_handleSpinDownEvent:function(){if(this.options.isLimitedToListValues&&this._dropDownList){$.ui.igNumericEditor.prototype._handleSpinDownEvent.call(this)}else{this._super()}},selectDate:function(){throw new Error(this._getLocaleValue("timePickerNoSuchMethod"))}});$.extend($.ui.igTimePicker,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI Tree 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *  jquery.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	jquery.ui.mouse.js
 *	jquery.ui.draggable.js
 *	jquery.ui.droppable.js
 *	infragistics.templating.js
 *	infragistics.util.js
 *  infragistics.util.jquery.js
 *	infragistics.dataSource.js
 *  infragistics.ui.widget.js
 *	infragistics.ui.tree-en.js
 */
(function($){$.ui.keyCode.NUMPAD_ADD=$.ui.keyCode.NUMPAD_ADD||107;$.ui.keyCode.NUMPAD_SUBTRACT=$.ui.keyCode.NUMPAD_SUBTRACT||109;$.widget("ui.igTree",$.ui.igWidget,{_const:{dragCursorAt:{top:-10,left:-10}},css:{tree:"ui-widget ui-igtree",treeCollection:"ui-igtree-collection",treeNode:"ui-igtree-node",treeRoot:"ui-igtree-root ui-widget-content",treeRootNode:"ui-igtree-noderoot",nodeNoChildren:"ui-igtree-node-nochildren",parentNode:"ui-igtree-parentnode",collapseIcon:"ui-icon ui-icon-triangle-1-s",expandIcon:"ui-icon ui-icon-triangle-1-e",nodeAnchor:"ui-corner-all",nodeExpander:"ui-igtree-expander",nodeNormal:"ui-state-default",nodeHightlight:"ui-state-highlight",nodeHovered:"ui-state-hover",nodeSelected:"ui-state-active",nodeActive:"ui-state-focus",checkbox:"ui-state-default ui-corner-all ui-igcheckbox-normal",checkboxOff:"ui-icon ui-icon-check ui-igcheckbox-normal-off",checkboxOn:"ui-icon ui-icon-check ui-igcheckbox-normal-on",checkboxPartial:"ui-icon ui-icon-check ui-state-disabled ui-igcheckbox-normal-on",invalidDropIndicator:"ui-widget ui-igtree-dropindicator ui-state-error ui-corner-all",dropIndicator:"ui-widget ui-igtree-dropindicator ui-state-highlight ui-corner-all",moveMarkupIcon:"ui-icon ui-icon-arrowthick-1-e",invalidMoveMarkupIcon:"ui-icon ui-icon-cancel",copyMarkupIcon:"ui-icon ui-icon-plus",insertLine:"ui-state-default ui-igtree-insertline"},options:{width:null,height:null,checkboxMode:"off",singleBranchExpand:false,hotTracking:true,parentNodeImageUrl:null,parentNodeImageClass:null,parentNodeImageTooltip:null,leafNodeImageUrl:null,leafNodeImageClass:null,leafNodeImageTooltip:null,animationDuration:200,pathSeparator:"_",dataSource:null,dataSourceUrl:null,dataSourceType:null,responseDataKey:null,responseDataType:null,requestType:"GET",responseContentType:null,initialExpandDepth:-1,loadOnDemand:false,bindings:{textKey:"Text",textXPath:"@Text",valueKey:"Value",valueXPath:"@Value",imageUrlKey:"ImageUrl",imageUrlXPath:"@ImageUrl",navigateUrlKey:"NavigateUrl",navigateUrlXPath:"@NavigateUrl",targetKey:"Target",expandedKey:"__expanded__",checkedKey:"__checked__",primaryKey:null,nodeContentTemplate:null,childDataProperty:"Nodes",childDataXPath:"Children",searchFieldXPath:"Nodes",bindings:{}},defaultNodeTarget:"_self",dragAndDrop:false,updateUrl:null,dragAndDropSettings:{allowDrop:false,dragAndDropMode:"default",dragOpacity:.75,revert:true,revertDuration:500,zIndex:10,dragStartDelay:200,expandOnDragOver:true,expandDelay:1e3,helper:"default",customDropValidation:null,containment:false,invalidMoveToMarkup:"<div><p><span></span><strong>{0}</strong></p></div>",moveToMarkup:"<div><p><span></span><strong>Move to</strong> {0}</p></div>",moveBetweenMarkup:"<div><p><span></span><strong>Move between</strong> {0} and {1}</p></div>",moveAfterMarkup:"<div><p><span></span><strong>Move after</strong> {0}</p></div>",moveBeforeMarkup:"<div><p><span></span><strong>Move before</strong> {0}</p></div>",copyToMarkup:"<div><p><span></span><strong>Copy to</strong> {0}</p></div>",copyBetweenMarkup:"<div><p><span></span><strong>Copy between</strong> {0} and {1}</p></div>",copyAfterMarkup:"<div><p><span></span><strong>Copy after</strong> {0}</p></div>",copyBeforeMarkup:"<div><p><span></span><strong>Copy before</strong> {0}</p></div>"}},events:{dataBinding:"dataBinding",dataBound:"dataBound",rendering:"rendering",rendered:"rendered",selectionChanging:"selectionChanging",selectionChanged:"selectionChanged",nodeCheckstateChanging:"nodeCheckstateChanging",nodeCheckstateChanged:"nodeCheckstateChanged",nodePopulating:"nodePopulating",nodePopulated:"nodePopulated",nodeCollapsing:"nodeCollapsing",nodeCollapsed:"nodeCollapsed",nodeExpanding:"nodeExpanding",nodeExpanded:"nodeExpanded",nodeClick:"nodeClick",nodeDoubleClick:"nodeDoubleClick",dragStart:"dragStart",drag:"drag",dragStop:"dragStop",nodeDropping:"nodeDropping",nodeDropped:"nodeDropped"},_createWidget:function(options){this.options.bindings=null;if(options&&options.bindings){this._populateStateKeys(options.bindings)}if(options&&options.dragAndDrop){this.changeLocale()}this._superApply(arguments)},_create:function(){var opt=this.options;this._selectedNode=[{path:null,element:null,data:null,binding:null}];this.dataBind();this.element.addClass(this.css.tree);this._attachEvents();if(opt.width){this.element.css("width",opt.width)}if(opt.height){this.element.css("height",opt.height)}},_setOption:function(option,value){var css=this.css,elements,prevValue=this.options[option];this._super(option,value);switch(option){case"width":this.element.css("width",value);break;case"height":this.element.css("height",value);break;case"parentNodeImageUrl":elements=this.element.find("img[data-role=parent-node-image]");if(elements.length>0){elements.attr("src",value)}else{throw new Error(this._getLocaleValue("setOptionError")+option)}break;case"parentNodeImageTooltip":elements=this.element.find("img[data-role=parent-node-image]");if(elements.length<=0){elements=this.element.find("span[data-role=parent-node-image]")}if(elements.length>0){elements.attr("title",value)}else{throw new Error(this._getLocaleValue("setOptionError")+option)}break;case"parentNodeImageClass":elements=this.element.find("span[data-role=parent-node-image]");if(elements.length>0){elements.removeClass();elements.addClass(value)}else{throw new Error(this._getLocaleValue("setOptionError")+option)}break;case"leafNodeImageUrl":elements=this.element.find("img[data-role=leaf-node-image]");if(elements.length>0){elements.attr("src",value)}else{throw new Error(this._getLocaleValue("setOptionError")+option)}break;case"leafNodeImageTooltip":elements=this.element.find("img[data-role=leaf-node-image]");if(elements.length<=0){elements=this.element.find("span[data-role=leaf-node-image]")}if(elements.length>0){elements.attr("title",value)}else{throw new Error(this._getLocaleValue("setOptionError")+option)}break;case"leafNodeImageClass":elements=this.element.find("span[data-role=leaf-node-image]");if(elements.length>0){elements.removeClass();elements.addClass(value)}else{throw new Error(this._getLocaleValue("setOptionError")+option)}break;case"hotTracking":if(value){this.element.delegate("a",{mouseover:function(event){$(event.target).addClass(css.nodeHovered)},mouseout:function(event){$(event.target).removeClass(css.nodeHovered)}})}else{this.element.undelegate("a","mouseover");this.element.undelegate("a","mouseout")}break;case"checkboxMode":if(value.toLowerCase()==="off"){this._removeCheckboxes()}else if(prevValue==="off"){this._addCheckboxes()}break;case"dataSource":this.dataBind();break;case"dragAndDrop":if(value){this._initDragAndDrop()}else{this._destroyDragAndDrop()}break;case"updateUrl":this.options.dataSource.root().settings.updateUrl=value;break;case"bindings":case"loadOnDemand":case"pathSeparator":case"initialExpandDepth":case"defaultNodeTarget":throw new Error(this._getLocaleValue("setOptionError")+option);default:break}},changeLocale:function(){this.options.dragAndDropSettings.moveToMarkup="<div><p><span></span>"+this._getLocaleValue("moveTo")+"</p></div>";this.options.dragAndDropSettings.moveBetweenMarkup="<div><p><span></span>"+this._getLocaleValue("moveBetween")+"</p></div>";this.options.dragAndDropSettings.moveAfterMarkup="<div><p><span></span>"+this._getLocaleValue("moveAfter")+"</p></div>";this.options.dragAndDropSettings.moveBeforeMarkup="<div><p><span></span>"+this._getLocaleValue("moveBefore")+"</p></div>";this.options.dragAndDropSettings.copyToMarkup="<div><p><span></span>"+this._getLocaleValue("copyTo")+"</p></div>";this.options.dragAndDropSettings.copyBetweenMarkup="<div><p><span></span>"+this._getLocaleValue("copyBetween")+"</p></div>";this.options.dragAndDropSettings.copyAfterMarkup="<div><p><span></span>"+this._getLocaleValue("copyAfter")+"</p></div>";this.options.dragAndDropSettings.copyBeforeMarkup="<div><p><span></span>"+this._getLocaleValue("copyBefore")+"</p></div>"},_removeCheckboxes:function(){this.element.find("span[data-role=checkbox]").remove()},_addCheckboxes:function(){var self=this;this.element.find("li[data-role=node]").each(function(){var $this=$(this);if($this.children("span[data-role=expander]").length>0){$this.children("span[data-role=expander]").after(self._renderCheckbox())}else{$this.prepend(self._renderCheckbox())}})},_initDataOptions:function(){var dataOptions,ul,s;s=this._initDataSourceSchema();if(!this.options.dataSource&&!this.options.dataSourceUrl){if(!this.element.is("ul")){ul=this.element.children("ul");this.options.dataSource=ul[0]}else{this.options.dataSource=this.element[0]}}else if(!this.options.dataSource&&this.options.dataSourceUrl){this.options.dataSource=this.options.dataSourceUrl}else if($.type(this.options.dataSource)==="object"&&typeof this.options.dataSource._encodeHierarchicalUrlParams!=="function"&&typeof this.options.dataSource._xmlToArray!=="function"&&!this.options.dataSourceType){this.options.dataSource=[this.options.dataSource]}dataOptions={callback:this._constructFromData,callee:this,dataSource:this.options.dataSource,requestType:this.options.requestType,responseContentType:this.options.responseContentType,defaultChildrenDataProperty:this.options.bindings.childDataProperty,responseDataType:this.options.responseDataType,primaryKey:this.options.primaryKey,localSchemaTransform:this.options.dataSourceType&&this.options.dataSourceType==="xml"?true:false,schema:s,updateUrl:this.options.updateUrl};if(this.options.dataSourceType){dataOptions.type=this.options.dataSourceType}if(this.options.responseDataKey){dataOptions.responseDataKey=this.options.responseDataKey}return dataOptions},_initDataSourceSchema:function(){var schema={},opt=this.options,bindings=opt.bindings;if(bindings===null){opt.bindings={};schema.text={name:"Text",type:"string"};opt.bindings.textKey="Text";schema.value={name:"Value",type:"string"};opt.bindings.valueKey="Value";schema.imageUrl={name:"ImageUrl",type:"string"};opt.bindings.imageUrlKey="ImageUrl";schema.navigateUrl={name:"NavigateUrl",type:"string"};opt.bindings.navigateUrlKey="NavigateUrl";schema.childData={name:"Nodes",type:"object"};opt.bindings.childDataProperty="Nodes";schema.target={name:"Target",type:"string"};opt.bindings.targetKey="Target";opt.bindings.expandedKey="__expanded__";opt.bindings.checkedKey="__checked__";bindings=opt.bindings}else if(opt.dataSourceType==="xml"){if(bindings.searchFieldXPath){schema.searchField=bindings.searchFieldXPath}schema.fields=[];if(bindings.textKey){schema.fields.push({name:bindings.textKey,type:"string",xpath:bindings.textXPath});schema.textKey=bindings.textKey}if(bindings.valueKey){schema.fields.push({name:bindings.valueKey,type:"string",xpath:bindings.valueXPath});schema.valueKey=bindings.valueKey}if(bindings.navigateUrlKey){schema.fields.push({name:bindings.navigateUrlKey,type:"string",xpath:bindings.navigateUrlXPath});schema.navigateUrlKey=bindings.navigateUrlKey}if(bindings.imageUrlKey){schema.fields.push({name:bindings.imageUrlKey,type:"string",xpath:bindings.imageUrlXPath});schema.imageUrlKey=bindings.imageUrlKey}if(bindings.targetKey){schema.fields.push({name:bindings.targetKey,type:"string"});schema.targetKey=bindings.targetKey}if(bindings.expandedKey){schema.fields.push({name:bindings.expandedKey,type:"boolean"});schema.expandedKey=bindings.expandedKey}if(bindings.checkedKey){schema.fields.push({name:bindings.checkedKey,type:"string"});schema.checkedKey=bindings.checkedKey}if(bindings.primaryKey){schema.fields.push({name:bindings.primaryKey,type:"string"});schema.primaryKey=bindings.primaryKey}if(bindings.childDataProperty){schema.fields.push({name:bindings.childDataProperty,type:"object",xpath:bindings.childDataXPath});schema.childDataProperty=bindings.childDataProperty}}if(!schema.searchField&&opt.responseDataKey){schema.searchField=opt.responseDataKey}return schema},_initDataSource:function(dataOptions){var opt=this.options;if(!opt.dataSource||typeof opt.dataSource._encodeHierarchicalUrlParams!=="function"){opt.dataSource=new $.ig.HierarchicalDataSource(dataOptions)}},_helper:null,_insertLine:{html:null},_originalHelper:{html:null},_sourceNode:{data:null,element:null,owner:null},_validationObject:{valid:true,dropAfter:true,expandTimeout:null,target:null},_helperDirty:false,_dropAfter:true,_initDragOptions:function(){var self=this,dragAndDropSettings=self.options.dragAndDropSettings,helper=dragAndDropSettings.helper==="default"?function(event){var target=$(event.target).closest("li[data-role=node]"),markup=$(self.options.dragAndDropSettings.invalidMoveToMarkup.replace("{0}",target.children("a").html()));markup.addClass(self.css.invalidDropIndicator).find("span").eq(0).addClass(self.css.invalidMoveMarkupIcon);return markup}:dragAndDropSettings.helper,opt={revert:dragAndDropSettings.revert?"invalid":false,opacity:dragAndDropSettings.dragOpacity,zIndex:dragAndDropSettings.zIndex,cursorAt:this._const.dragCursorAt,helper:helper,revertDuration:dragAndDropSettings.revertDuration,appendTo:self.element,delay:dragAndDropSettings.dragStartDelay,containment:dragAndDropSettings.containment,start:function(event,ui){var node=self.nodeFromElement($(this)),noCancel;noCancel=self._triggerDragStart(event,ui,node.element);if(noCancel){self._originalHelper.html=ui.helper.html();self._sourceNode.data=$.extend(false,{},node.data);self._sourceNode.owner=self;self._sourceNode.element=node.element}else{return false}},drag:function(event,ui){var noCancel=self._triggerDrag(event,ui,self._sourceNode.element);if(noCancel){self._performDrag(event,ui)}else{self._resetSourceNode();self._resetValidationObject();return false}},stop:function(event,ui){self._triggerDragStop(event,ui);$(document).find("div[data-role=insert-line]").remove();self._helperDirty=false;self._resetSourceNode();self._resetValidationObject()}};return opt},_performDrag:function(event,ui){var target=$(event.originalEvent.target),markup,copy=event.ctrlKey&&this.options.dragAndDropSettings.dragAndDropMode==="default"||this.options.dragAndDropSettings.dragAndDropMode==="copy",targetTop,dragTop,self=this;if(target.is("div[data-role=insert-line]")){return}this._validationObject.valid=this._accept(this._sourceNode.element,target);$(document).find("div[data-role=insert-line]").remove();if(this.options.dragAndDropSettings.expandOnDragOver){if((target.is("a")||target.closest("a").parent().is("li[data-role=node]"))&&this._validationObject.target!==target.closest("li[data-role=node]")){clearTimeout(this._validationObject.expandTimeout);this._validationObject.target=target.closest("li[data-role=node]");if(this._validationObject.target.hasClass("ui-igtree-parentnode")){this._validationObject.expandTimeout=setTimeout(function(){self.expand(self._validationObject.target)},this.options.dragAndDropSettings.expandDelay)}}else{clearTimeout(this._validationObject.expandTimeout);this._validationObject.expandTimeout=null;this._validationObject.target=null}}if((target.is("a")||target.closest("a").parent().is("li[data-role=node]"))&&this._validationObject.valid){if(copy){markup=$(this.options.dragAndDropSettings.copyToMarkup.replace("{0}",target.html()));markup.find("span").eq(0).addClass(this.css.copyMarkupIcon)}else{markup=$(this.options.dragAndDropSettings.moveToMarkup.replace("{0}",target.html()));markup.find("span").eq(0).addClass(this.css.moveMarkupIcon)}this._helper=markup.html();ui.helper.removeClass(this.css.invalidDropIndicator).addClass(this.css.dropIndicator).html(this._helper);this._helperDirty=true}else if(target.is("li[data-role=node]")&&this._validationObject.valid){targetTop=target.igOffset().top+target.height()/2;dragTop=ui.offset.top+this._const.dragCursorAt.top;if(dragTop>targetTop){this._validationObject.dropAfter=true;if(copy){if(target.next("li[data-role=node]").length>0){markup=$(this.options.dragAndDropSettings.copyBetweenMarkup.replace("{0}",target.children("a").html()).replace("{1}",target.next("li[data-role=node]").children("a").html()));markup.find("span").eq(0).addClass(this.css.copyMarkupIcon)}else{markup=$(this.options.dragAndDropSettings.copyAfterMarkup.replace("{0}",target.children("a").html()));markup.find("span").eq(0).addClass(this.css.copyMarkupIcon)}}else{if(target.next("li[data-role=node]").length>0){markup=$(this.options.dragAndDropSettings.moveBetweenMarkup.replace("{0}",target.children("a").html()).replace("{1}",target.next("li[data-role=node]").children("a").html()));markup.find("span").eq(0).addClass(this.css.moveMarkupIcon)}else{markup=$(this.options.dragAndDropSettings.moveAfterMarkup.replace("{0}",target.children("a").html()));markup.find("span").eq(0).addClass(this.css.moveMarkupIcon)}}$(this._insertLine.html).appendTo(target);this._helper=markup.html();ui.helper.removeClass(this.css.invalidDropIndicator).addClass(this.css.dropIndicator).html(this._helper)}else{this._validationObject.dropAfter=false;if(copy){if(target.prev("li[data-role=node]").length>0){markup=$(this.options.dragAndDropSettings.copyBetweenMarkup.replace("{0}",target.children("a").html()).replace("{1}",target.prev("li[data-role=node]").children("a").html()));markup.find("span").eq(0).addClass(this.css.copyMarkupIcon)}else{markup=$(this.options.dragAndDropSettings.copyBeforeMarkup.replace("{0}",target.children("a").html()));markup.find("span").eq(0).addClass(this.css.copyMarkupIcon)}}else{if(target.prev("li[data-role=node]").length>0){markup=$(this.options.dragAndDropSettings.moveBetweenMarkup.replace("{0}",target.prev("li[data-role=node]").children("a").html()).replace("{1}",target.children("a").html()));markup.find("span").eq(0).addClass(this.css.moveMarkupIcon)}else{markup=$(this.options.dragAndDropSettings.moveBeforeMarkup.replace("{0}",target.children("a").html()));markup.find("span").eq(0).addClass(this.css.moveMarkupIcon)}}if(target.index()===0){$(this._insertLine.html).prependTo(target).css("padding-bottom","0.1em")}else{$(this._insertLine.html).appendTo(target.prev())}this._helper=markup.html();ui.helper.removeClass(this.css.invalidDropIndicator).addClass(this.css.dropIndicator).html(this._helper)}this._helperDirty=true}else if(target.is(":ui-igTree")&&target.data("igTree")!==this){if(copy){markup=$(this.options.dragAndDropSettings.copyToMarkup.replace("{0}",""));markup.find("span").eq(0).addClass(this.css.copyMarkupIcon)}else{markup=$(this.options.dragAndDropSettings.moveToMarkup.replace("{0}",""));markup.find("span").eq(0).addClass(this.css.moveMarkupIcon)}this._helper=markup.html();ui.helper.removeClass(this.css.invalidDropIndicator).addClass(this.css.dropIndicator).html(this._helper);this._helperDirty=true}else{$(document).find("div[data-role=insert-line]").remove();if(this._helperDirty){this._helper=null;ui.helper.removeClass(this.css.dropIndicator).addClass(this.css.invalidDropIndicator).html(this._originalHelper.html);this._helperDirty=false}}},_resetSourceNode:function(){this._originalHelper.html=null;this._sourceNode.data=null;this._sourceNode.owner=null;this._sourceNode.element=null},_resetValidationObject:function(){this._validationObject.valid=true;this._validationObject.dropAfter=true;clearTimeout(this._validationObject.expandTimeout);this._validationObject.expandTimeout=null;this._validationObject.target=null},_initDropOptions:function(){var self=this,opt={tolerance:"pointer",greedy:true,drop:function(event,ui){if(self._sourceNode.element===null&&self._sourceNode.owner===null){return false}return self._performDrop(event,ui)},accept:function(){return self._validationObject.valid}};return opt},_performDrop:function(event,ui){var parent,target=$(event.originalEvent.target),noCancel,dndmode=this._sourceNode.owner.options.dragAndDropSettings.dragAndDropMode;if(target.is("div[data-role=insert-line]")){target=target.closest("li[data-role=node]")}this.element.find("div[data-role=insert-line]").remove();noCancel=this._triggerNodeDropping(event,ui,target.closest("li[data-role=node]"),target.next("li[data-role=node]").length>0||!this._validationObject.dropAfter?target.index()+(this._validationObject.dropAfter?1:0):target.index());if(noCancel){if(target.is("a")||target.closest("a").parent().is("li[data-role=node]")){target=target.closest("li[data-role=node]");switch(dndmode){case"move":this.addNode(this._sourceNode.data,target);this._sourceNode.owner.removeAt(this._sourceNode.element.attr("data-path"));break;case"copy":this.addNode(this._sourceNode.data,target);break;default:if(!event.ctrlKey){this.addNode(this._sourceNode.data,target);this._sourceNode.owner.removeAt(this._sourceNode.element.attr("data-path"))}else{this.addNode(this._sourceNode.data,target)}break}}else if(target.is("li")){parent=this.parentNode(target);switch(dndmode){case"move":this.addNode(this._sourceNode.data,parent,target.next("li[data-role=node]").length>0||!this._validationObject.dropAfter?target.index()+(this._validationObject.dropAfter?1:0):null);this._sourceNode.element.attr("data-path",this._sourceNode.element.attr("data-path")+"_remove");this._sourceNode.owner.removeAt(this._sourceNode.element.attr("data-path"));break;case"copy":this.addNode(this._sourceNode.data,parent,target.next("li[data-role=node]").length>0||!this._validationObject.dropAfter?target.index()+(this._validationObject.dropAfter?1:0):null);break;default:if(!event.ctrlKey){this.addNode(this._sourceNode.data,parent,target.next("li[data-role=node]").length>0||!this._validationObject.dropAfter?target.index()+(this._validationObject.dropAfter?1:0):null);this._sourceNode.element.attr("data-path",this._sourceNode.element.attr("data-path")+"_remove");this._sourceNode.owner.removeAt(this._sourceNode.element.attr("data-path"))}else{this.addNode(this._sourceNode.data,parent,target.next("li[data-role=node]").length>0||!this._validationObject.dropAfter?target.index()+(this._validationObject.dropAfter?1:0):null)}break}}else if(target.is(":ui-igTree")){switch(dndmode){case"move":this.addNode(this._sourceNode.data);this._sourceNode.owner.removeAt(this._sourceNode.element.attr("data-path"));break;case"copy":this.addNode(this._sourceNode.data);break;default:if(!event.ctrlKey){this.addNode(this._sourceNode.data);this._sourceNode.owner.removeAt(this._sourceNode.element.attr("data-path"))}else{this.addNode(this._sourceNode.data)}break}}this._triggerNodeDropped(event,ui,target)}else{return false}},_accept:function(dropElem,target){var valid=true,node=target.closest("li[data-role=node]"),dropPath=dropElem.attr("data-path"),tree=target.closest(".ui-widget.ui-igtree"),sourceBinding=this._retrieveCurrentDepthBinding(parseInt(this._sourceNode.element.closest("ul").attr("data-depth"),10)),destinationBinding;if(target.is("a")&&target.parent().is("li[data-role=node]")||target.closest("a").parent().is("li[data-role=node]")){destinationBinding=tree.data("igTree")._retrieveCurrentDepthBinding(parseInt(target.closest("ul").attr("data-depth"),10)+1)}else{if(target.is("li[data-role=node]")){destinationBinding=tree.data("igTree")._retrieveCurrentDepthBinding(parseInt(target.closest("ul").attr("data-depth"),10))}else if(target.is(":ui-igTree")){destinationBinding=tree.data("igTree")._retrieveCurrentDepthBinding(0)}else{destinationBinding=false}}if(node.length>0&&(node.attr("data-path")===dropPath||node.attr("data-path").indexOf(dropPath+this.options.pathSeparator)===0)&&this===tree.data("igTree")){valid=false}else if(this!==tree.data("igTree")&&!tree.igTree("option","dragAndDropSettings").allowDrop){valid=false}else if(typeof tree.igTree("option","dragAndDropSettings").customDropValidation==="function"){valid=tree.igTree("option","dragAndDropSettings").customDropValidation.apply(target,[dropElem])}if(sourceBinding&&destinationBinding&&valid){valid=this._validateBindings(sourceBinding,destinationBinding,target)}return valid},_validateBindings:function(sourceBinding,destinationBinding,target){var valid=true;if(destinationBinding.hasOwnProperty("primaryKey")){if(!sourceBinding.hasOwnProperty("primaryKey")||sourceBinding.primaryKey!==destinationBinding.primaryKey){valid=false}else if(target.is("a")&&this._sourceNode.element.parent().closest("li[data-role=node]").is(target.closest("li[data-role=node]"))){valid=false}}if(destinationBinding.textKey!==sourceBinding.textKey){valid=false}if(destinationBinding.hasOwnProperty("valueKey")&&sourceBinding.hasOwnProperty("valueKey")&&destinationBinding.valueKey!==sourceBinding.valueKey){valid=false}if(destinationBinding.hasOwnProperty("childDataProperty")&&sourceBinding.hasOwnProperty("childDataProperty")&&destinationBinding.childDataProperty!==sourceBinding.childDataProperty){valid=false}return valid},_initDragAndDrop:function(element){var dragOptions=this._initDragOptions(),dropOptions=this._initDropOptions();if(!this._insertLine.html){this._insertLine.html="<div data-role='insert-line' class='"+this.css.insertLine+"'></div>"}if(!element){this.element.find("li[data-role=node]").draggable(dragOptions);this.element.droppable(dropOptions);this.element.delegate("a","mousedown",function(){$(this).focus()})}else{element.draggable(dragOptions);element.find("li[data-role=node]").draggable(dragOptions)}},_destroyDragAndDrop:function(){this.element.find("li[data-role=node]").draggable("destroy");this.element.droppable("destroy");this.element.undelegate("a","mousedown")},_constructFromData:function(){var ul,data=this.options.dataSource.root().data();this._triggerDataBound(data);this._triggerRendering(data);this.element.attr("data-scroll",true);if(this.element.is("ul")){this.element.empty();ul=this.element;ul.addClass(this.css.treeCollection).addClass(this.css.treeRoot).attr("data-depth",0);ul.html(this._initChildrenRecursively("",data));this._triggerRendered()}else{this.element.empty();ul="<ul class='"+this.css.treeCollection+" "+this.css.treeRoot+"' data-depth='0'>";ul+=this._initChildrenRecursively("",data);ul+="</ul>";$(ul).appendTo(this.element);this._triggerRendered()}if(this.options.dragAndDrop){this._initDragAndDrop();if(typeof this.options.dragAndDropSettings.customDropValidation==="string"){if(window[this.options.dragAndDropSettings.customDropValidation]&&typeof window[this.options.dragAndDropSettings.customDropValidation]==="function"){this.options.dragAndDropSettings.customDropValidation=window[this.options.dragAndDropSettings.customDropValidation]}}}},_attachEvents:function(){var self=this,css=this.css,noCancel,target;this.element.delegate("span[data-role=expander]","click",function(event){self.toggle($(event.target).closest("li[data-role=node]"),event)});this.element.delegate("a",{click:function(event){target=$(event.target).closest("a");noCancel=self._triggerNodeClick(event,target.parent());if(noCancel){self.select(target.parent(),event);if($.ig.util.isWebKit){target.focus()}}else{event.preventDefault()}},dblclick:function(event){event.preventDefault();self._triggerNodeDoubleClick(event,$(event.target.parentNode))},keydown:function(event){self._kbNavigation(event)},focus:function(event){self._focusNode(event)},blur:function(event){self._blurNode(event)}});if(this.options.hotTracking){this.element.delegate("a",{mouseover:function(event){$(event.target).addClass(css.nodeHovered)},mouseout:function(event){$(event.target).removeClass(css.nodeHovered)}})}this.element.delegate("span[data-role=checkbox] > span",{click:function(event){self.toggleCheckstate($(event.target).closest("li[data-role=node]"),event)},mouseover:function(event){$(event.target).closest("span[data-role=checkbox]").addClass(css.nodeHovered)},mouseout:function(event){$(event.target).closest("span[data-role=checkbox]").removeClass(css.nodeHovered)}})},_initChildrenRecursively:function(path,data,depth,indexFeed){var childUl,opt=this.options,childPath,binding,value,display,liStr=[],i=0,li,children;if(!indexFeed){indexFeed=0}if(!depth){depth=0}binding=this._retrieveCurrentDepthBinding(depth);if(!data.hasOwnProperty("length")&&data.hasOwnProperty(binding.textKey)){data=[data]}for(i;i<data.length;i++){childUl="";value="";if(path.length<=0){if(binding.hasOwnProperty("primaryKey")&&data[i].hasOwnProperty(binding.primaryKey)){childPath=typeof data[i][binding.primaryKey]==="function"?data[i][binding.primaryKey]():data[i][binding.primaryKey]}else{childPath=i+indexFeed}}else{if(binding.hasOwnProperty("primaryKey")&&data[i].hasOwnProperty(binding.primaryKey)){childPath=path+opt.pathSeparator+(typeof data[i][binding.primaryKey]==="function"?data[i][binding.primaryKey]():data[i][binding.primaryKey])}else{childPath=path+opt.pathSeparator+(i+indexFeed)}}if(binding.hasOwnProperty("valueKey")&&data[i].hasOwnProperty(binding.valueKey)){if(typeof data[i][binding.valueKey]==="function"){value=data[i][binding.valueKey]()}else{value=data[i][binding.valueKey]}}li="<li class='"+this._buildNodeCssString(data[i],depth,binding)+"' data-path='"+childPath+"' data-value=\""+value+"\" data-role='node'>";children=data[i][binding.childDataProperty];if(typeof children==="function"){children=children()}if(children&&children.length>0||children&&opt.loadOnDemand){if(depth<=opt.initialExpandDepth&&!opt.loadOnDemand||data[i].hasOwnProperty(binding.expandedKey)&&data[i][binding.expandedKey]){li+=this._renderExpanderImage(data[i][binding.expandedKey]=true);display="block"}else{li+=this._renderExpanderImage(data[i][binding.expandedKey]=false);display="none"}}if(opt.checkboxMode&&opt.checkboxMode.toLowerCase()!=="off"){if(typeof data[i][binding.checkedKey]!=="string"){data[i][binding.checkedKey]="off"}li+=this._renderCheckbox(data[i][binding.checkedKey])}li+=this._renderNodeImage(data[i],binding);if(!binding.nodeContentTemplate){li+=this._renderAnchor(data[i],binding)}else{li+=this._renderNodeTemplate(data[i],binding)}if(children&&children.length>0||children&&opt.loadOnDemand){childUl="<ul style='display: "+display+"' data-depth='"+(depth+1)+"'";if(children.length>0&&!opt.loadOnDemand){childUl+=">"+this._initChildrenRecursively(childPath,children,depth+1)}else{childUl+=" data-populated='false'>"}childUl+="</ul>"}li+=childUl;li+="</li>";liStr.push(li)}return liStr.join("")},_buildNodeCssString:function(data,depth,binding){var css=this.css,str=css.treeNode,children;if(depth===0){str+=" "+css.treeRootNode}children=data[binding.childDataProperty];if(typeof children==="function"){children=children()}if(children&&children.length>0||children&&this.options.loadOnDemand){str+=" "+css.parentNode}else{str+=" "+css.nodeNoChildren}return str},_retrieveCurrentDepthBinding:function(depth){var binding=this.options.bindings,i=0;for(i;i<depth;i++){if(binding.hasOwnProperty("bindings")){binding=binding.bindings}else{break}}return binding},_renderExpanderImage:function(expanded){var self=this,css=self.css,expander="";if(expanded){expander="<span data-role='expander' data-exp='true' class='"+css.collapseIcon+" "+css.nodeExpander+"'></span>"}else{expander="<span data-role='expander' data-exp='false' class='"+css.expandIcon+" "+css.nodeExpander+"'></span>"}return expander},_renderAnchor:function(data,binding){var href,target,text;if(binding.hasOwnProperty("navigateUrlKey")&&data[binding.navigateUrlKey]){if(typeof data[binding.navigateUrlKey]==="function"){href=data[binding.navigateUrlKey]()}else{href=data[binding.navigateUrlKey]}}else{href="#"}if(binding.targetKey&&binding.targetKey.length>0&&data.hasOwnProperty(binding.targetKey)){target=data[binding.targetKey]}else{target=this.options.defaultNodeTarget}if(typeof data[binding.textKey]==="function"){text=data[binding.textKey]()}else{text=data[binding.textKey]}text=$.ig.encode(text);return"<a href='"+href+"' target='"+target+"' class='"+this.css.nodeAnchor+"'>"+text+"</a>"},_renderNodeTemplate:function(data,binding){var div=$("<div></div>"),html,href,target,template=binding.nodeContentTemplate;if(binding.hasOwnProperty("navigateUrlKey")&&data[binding.navigateUrlKey]){if(typeof data[binding.navigateUrlKey]==="function"){href=data[binding.navigateUrlKey]()}else{href=data[binding.navigateUrlKey]}}else{href="#"}if(binding.targetKey&&binding.targetKey.length>0&&data.hasOwnProperty(binding.targetKey)){target=data[binding.targetKey]}else{target=this.options.defaultNodeTarget}div.html($.ig.tmpl(template,data));if(div.children("a").length<=0){html="<a href='"+href+"' target='"+target+"' class='"+this.css.nodeAnchor+"'>"+div.html()+"</a>";
}else if(!div.children("a").attr("href")){div.children("a").addClass(this.css.nodeAnchor).attr({href:href,target:target});html=div.html()}else{div.children("a").addClass(this.css.nodeAnchor);html=div.html()}return html},_renderCheckbox:function(checkstate){var css=this.css,stateClass;switch(checkstate){case"on":stateClass=css.checkboxOn;break;case"partial":stateClass=css.checkboxPartial;break;default:stateClass=css.checkboxOff;break}return"<span data-chk='"+checkstate+"' data-role='checkbox' class='"+css.checkbox+"'><span class='"+stateClass+"'></span></span>"},_renderNodeImage:function(data,binding){var opt=this.options,hasChildren,img="",src;hasChildren=data[binding.childDataProperty]&&data[binding.childDataProperty].length>0||data[binding.childDataProperty]&&opt.loadOnDemand;if(binding.hasOwnProperty("imageUrlKey")&&data.hasOwnProperty(binding.imageUrlKey)){if(typeof data[binding.imageUrlKey]==="function"){src=data[binding.imageUrlKey]();if(src&&src.length>0){img="<img src='"+src+"' alt='error' data-role='node-image' />"}}else if(data[binding.imageUrlKey].length>0){img="<img src='"+data[binding.imageUrlKey]+"' alt='error' data-role='node-image' />"}}if(opt.parentNodeImageUrl&&hasChildren){img+="<img src='"+opt.parentNodeImageUrl+"' alt='error' title='"+(opt.parentNodeImageTooltip!==null?opt.parentNodeImageTooltip:"")+"' data-role='parent-node-image' />"}else if(opt.parentNodeImageClass&&hasChildren){img+="<span title='"+(opt.parentNodeImageTooltip!==null?opt.parentNodeImageTooltip:"")+"' class='"+opt.parentNodeImageClass+"' data-role='parent-node-image'></span>"}else if(!hasChildren&&opt.leafNodeImageUrl){img+="<img src='"+opt.leafNodeImageUrl+"' alt='error' title='"+(opt.leafNodeImageTooltip!==null?opt.leafNodeImageTooltip:"")+"' data-role='leaf-node-image' />"}else if(!hasChildren&&opt.leafNodeImageClass){img+="<span title='"+(opt.leafNodeImageTooltip!==null?opt.leafNodeImageTooltip:"")+"' class='"+opt.leafNodeImageClass+"' data-role='leaf-node-image'></span>"}return img},_focusNode:function(event){$(event.target).addClass(this.css.nodeActive)},_blurNode:function(event){$(event.target).removeClass(this.css.nodeActive)},_kbNavigation:function(event){var opt=this.options,css=this.css,li=$(event.target.parentNode),nextLi,seq=li.index(),expander;if(event.keyCode===$.ui.keyCode.UP){nextLi=this._nextVisibleNodeUp(li);if(!nextLi){return}if(event.ctrlKey){li.children("a").blur();nextLi.children("a").focus()}else{li.children("a").blur();nextLi.children("a").focus();this.select(nextLi,null)}event.preventDefault()}else if(event.keyCode===$.ui.keyCode.DOWN){nextLi=this._nextVisibleNodeDown(li,seq);if(!nextLi){return}if(event.ctrlKey){li.children("a").blur();nextLi.children("a").focus()}else{li.children("a").blur();nextLi.children("a").focus();this.select(nextLi,null)}event.preventDefault()}else if(event.keyCode===$.ui.keyCode.RIGHT){if(li.children("ul").length>0){expander=li.children("."+css.nodeExpander);if(!expander.attr("data-exp")||expander.attr("data-exp")==="false"){this.toggle(li,null)}else{nextLi=li.find("ul > li:first");if(nextLi.length>0){if(event.ctrlKey){li.children("a").blur();nextLi.children("a").focus()}else{li.children("a").blur();nextLi.children("a").focus();this.select(nextLi,null)}}}}}else if(event.keyCode===$.ui.keyCode.LEFT){expander=li.children("."+css.nodeExpander);if(expander.attr("data-exp")&&expander.attr("data-exp")!=="false"){this.toggle(li,null)}else if(li.parent().parent().is("li")){nextLi=li.parent().parent();if(event.ctrlKey){li.children("a").blur();nextLi.children("a").focus()}else{li.children("a").blur();nextLi.children("a").focus();this.select(nextLi,null)}}}else if(event.keyCode===$.ui.keyCode.NUMPAD_ADD){if(li.children("ul").length>0){expander=li.children("."+css.nodeExpander);if(!expander.attr("data-exp")||expander.attr("data-exp")==="false"){this.toggle(li,null)}}}else if(event.keyCode===$.ui.keyCode.NUMPAD_SUBTRACT){if(li.children("ul").length>0){expander=li.children("."+css.nodeExpander);if(expander.attr("data-exp")&&expander.attr("data-exp")!=="false"){this.toggle(li,null)}}}else if(event.keyCode===$.ui.keyCode.SPACE){if(opt.checkboxMode&&opt.checkboxMode.toLowerCase()!=="off"){this.toggleCheckstate(li,null);event.preventDefault();event.stopPropagation()}}else if(event.keyCode===$.ui.keyCode.HOME){li.children("a").blur();li=this.element.find("li:first");if(li.length>0){li.children("a").focus();this.select(li)}event.preventDefault()}else if(event.keyCode===$.ui.keyCode.END){li.children("a").blur();li=this._lastVisibleNode();if(li){li.children("a").focus();this.select(li)}event.preventDefault()}},_nextVisibleNodeDown:function(node,nodeSeq){var expander=node.children("."+this.css.nodeExpander),parentLi,seq=nodeSeq,result=null;if(expander.length>0&&expander.attr("data-exp")&&expander.attr("data-exp")!=="false"&&node.children("ul").children("li:first").length>0){return node.children("ul").children("li:first")}if(seq===node.siblings().length){parentLi=node.parent().parent();while(parentLi.is("li")){seq=parentLi.index();if(seq!==parentLi.siblings().length){result=parentLi.next();break}parentLi=parentLi.parent().parent()}}else{result=node.next()}return result},_nextVisibleNodeUp:function(node){var li=node.prev(),expander,result=null;if(li.length<=0){if(node.parent().parent().is("li")){result=node.parent().parent()}}else{while(li.length>0){expander=li.children("."+this.css.nodeExpander);if(li.children("ul").children("li").length<=0||!expander.attr("data-exp")||expander.attr("data-exp")==="false"){result=li;break}li=li.children("ul").children("li:last")}}return result},_lastVisibleNode:function(){var li=this.element.is("ul")?this.element.children("li:last"):this.element.children("ul").children("li:last"),expander,result;if(li.length<=0){result=null}else{while(li.length>0){expander=li.children("."+this.css.nodeExpander);if(li.children("ul").children("li").length<=0||!expander.attr("data-exp")||expander.attr("data-exp")==="false"){result=li;break}li=li.children("ul").children("li:last")}}return result},_populateStateKeys:function(bindings){if(bindings&&!bindings.hasOwnProperty("expandedKey")){bindings.expandedKey="__expanded__"}if(bindings&&!bindings.hasOwnProperty("checkedKey")){bindings.checkedKey="__checked__"}if(bindings.bindings){this._populateStateKeys(bindings.bindings)}},_populateCheckedStates:function(data,bindings,state){for(var i=0;i<data.length;i++){data[i][bindings.checkedKey]=state}},_populatingNode:null,_populateNodeData:function(success,msg,data){if(!success){throw new Error(this._getLocaleValue("errorOnRequest")+msg)}var ul=this._populatingNode.ul,node=this._populatingNode.node,path=node.attr("data-path"),originalData=this.nodeDataFor(path),depth=parseInt(ul.attr("data-depth"),10),binding=this._retrieveCurrentDepthBinding(depth-1),newData=data.data();if(this.options.checkboxMode.toLowerCase()==="tristate"){if(this.isChecked(node)){this._populateCheckedStates(newData,binding.bindings||binding,"on")}}ul.children("li[data-role='loading']").remove();if(!originalData[binding.childDataProperty]||!originalData[binding.childDataProperty].length){originalData[binding.childDataProperty]=newData}else{originalData[binding.childDataProperty]=originalData[binding.childDataProperty].concat(newData)}this._triggerNodePopulated(null,node);this._triggerRendering(newData);ul.append(this._initChildrenRecursively(path,newData,depth));ul.attr("data-populated",true);if(this.options.dragAndDrop){this._initDragAndDrop(ul)}this._triggerRendered();this._populatingNode.indicator.hide();this._populatingNode.indicator.destroy();this._populatingNode=null;this.toggle(node,true);this._loadRequest()},_prepareRequest:function(node,event){var opt=this.options,pathKeyArr,path,key,data,binding,parentBinding,noCancel;if(this._populatingNode!==null){return}noCancel=this._triggerNodePopulating(event,node);if(noCancel){pathKeyArr=this._buildRequestString(node);binding=this._retrieveCurrentDepthBinding(parseInt(node.children("ul").attr("data-depth"),10));if(!pathKeyArr){return}path=pathKeyArr[0];key=pathKeyArr[1];data=this.nodeDataFor(node.attr("data-path"));parentBinding=this._retrieveCurrentDepthBinding(parseInt(node.children("ul").attr("data-depth"),10)-1);if(data.hasOwnProperty(parentBinding.childDataProperty)){data=data[parentBinding.childDataProperty]}if(data&&data.__deferred&&data.__deferred.uri){this._executeODataRequest(node,data)}else if(data&&data.length>0&&!opt.dataSourceUrl){this._renderOnDemand(node,data)}else{this._executeUrlRequest(node,binding,path,key)}}},_executeODataRequest:function(node,data){var dataSource,ul,indicator,opt=this.options,li;dataSource=new $.ig.JSONPDataSource({dataSource:data.__deferred.uri+"?$format=json&$callback=?",responseDataKey:opt.responseDataKey});ul=node.children("ul");li=$("<li style='width: 20px' data-role='loading'>&nbsp;</li>").appendTo(ul);ul.show();indicator=li.igLoading({includeVerticalOffset:false}).data("igLoading").indicator();indicator.show();this._populatingNode={ul:ul,node:node,indicator:indicator};dataSource.dataBind(this._populateNodeData,this)},_renderOnDemand:function(node,data){var ul,bindings,depth;ul=node.children("ul");depth=parseInt(ul.attr("data-depth"),10);if(this.options.checkboxMode.toLowerCase()==="tristate"){if(this.isChecked(node)){bindings=this._retrieveCurrentDepthBinding(depth);this._populateCheckedStates(data,bindings,"on")}}this._triggerNodePopulated(null,node);this._triggerRendering(data);ul.html(this._initChildrenRecursively(node.attr("data-path"),data,depth));ul.attr("data-populated",true);if(this.options.dragAndDrop){this._initDragAndDrop(ul)}this._triggerRendered();this.toggle(node,true);this._loadRequest()},_executeUrlRequest:function(node,binding,path,key){var opt=this.options,ul,indicator,dataSource,li;if(opt.dataSourceUrl&&opt.dataSourceUrl.lastIndexOf("?")===-1){opt.dataSourceUrl+="?"}else if(!opt.dataSourceUrl){throw new Error(this._getLocaleValue("noDataSourceUrl"))}dataSource=new $.ig.DataSource({dataSource:opt.dataSourceUrl+"&"+this._encodeUrlPath(path,key)+"&"+this._encodeBinding(binding)+"&depth="+node.parent().attr("data-depth"),dataSourceType:"remoteUrl",responseDataKey:opt.responseDataKey});ul=node.children("ul");li=$('<li style="width: 20px" data-role="loading">&nbsp;</li>').appendTo(ul);ul.show();indicator=li.igLoading({includeVerticalOffset:false}).data("igLoading").indicator();indicator.show();this._populatingNode={ul:ul,node:node,indicator:indicator};dataSource.dataBind(this._populateNodeData,this)},_buildRequestString:function(node){var nodePath,key="",path="",binding=this.options.bindings,i,result;nodePath=node.attr("data-path").split(this.options.pathSeparator);for(i=0;i<nodePath.length;i++){if(key.length>0){key+="/"}key+=binding.childDataProperty;if(path.length>0){path+="/"}path+=(binding.primaryKey?binding.primaryKey+":":"")+nodePath[i];if(binding.bindings){binding=binding.bindings}}if(path.length<=0){result=null}else{result=[path,key]}return result},_encodeBinding:function(binding){var temp="binding=",item;for(item in binding){if(binding.hasOwnProperty(item)&&item!=="bindings"&&item!=="nodeContentTemplate"){temp+=item.toString()+":"+binding[item]+","}}temp=temp.substr(0,temp.length-1);return temp},_encodeUrlPath:function(path,key){var result;if(path.lastIndexOf("/")===-1){path+="/@"+key;result="path="+path}else{result="path="+path.substr(path.lastIndexOf("/")+1,path.length)+"/@"+key.substr(key.lastIndexOf("/")+1,key.length)}return result},_updateParentState:function(parent){var expander=parent.children("span[ data-role=expander ]");if(expander.length<=0){parent.removeClass(this.css.nodeNoChildren).addClass(this.css.parentNode);$(this._renderExpanderImage(false)).prependTo(parent)}else if(parent.children("ul").children("li").length<=0){parent.removeClass(this.css.parentNode).addClass(this.css.nodeNoChildren);parent.children("ul").remove();expander.remove()}this._updateImage(parent)},_updateParentCheckbox:function(parent){var checkbox=parent.children("span[data-role=checkbox]"),checkIcon=checkbox.children("span"),checkState=checkbox.attr("data-chk"),shouldBe,checkCount=0,css=this.css;parent.children("ul").children("li").each(function(){if($(this).children("span[data-role=checkbox]").attr("data-chk")==="on"){checkCount++}});if(checkCount===0){shouldBe="off"}else if(checkCount===parent.children("ul").children("li").length){shouldBe="on"}else{shouldBe="partial"}if(checkState!==shouldBe){checkbox.attr("data-chk",shouldBe);switch(shouldBe){case"partial":checkIcon.removeClass(css.checkboxOn).removeClass(css.checkboxOff).addClass(css.checkboxPartial);break;case"on":checkIcon.removeClass(css.checkboxPartial).removeClass(css.checkboxOff).addClass(css.checkboxOn);break;default:checkIcon.removeClass(css.checkboxOn).removeClass(css.checkboxPartial).addClass(css.checkboxOff);break}parent=this.parentNode(parent);if(parent){this._updateParentCheckbox(parent)}}},_updateImage:function(parent){var hasChildren=parent.children("ul").children("li").length>0,opt=this.options,img;if(!hasChildren){if(opt.leafNodeImageUrl){img=parent.children("img[data-role=parent-node-image]");if(img.length>0){img.attr({title:opt.leafNodeImageTooltip!==null?opt.leafNodeImageTooltip:"",src:opt.leafNodeImageUrl,"data-role":"leaf-node-image"})}}else if(opt.leafNodeImageClass){img=parent.children("span[data-role=parent-node-image]");if(img.length>0){img.attr({title:opt.leafNodeImageTooltip!==null?opt.leafNodeImageTooltip:"","data-role":"leaf-node-image"});img.removeClass(opt.parentNodeImageClass).addClass(opt.leafNodeImageClass)}}}else{if(opt.parentNodeImageUrl){img=parent.children("img[data-role=leaf-node-image]");if(img.length>0){img.attr({title:opt.parentNodeImageTooltip!==null?opt.parentNodeImageTooltip:"",src:opt.parentNodeImageUrl,"data-role":"parent-node-image"})}}else if(opt.parentNodeImageClass){img=parent.children("span[data-role=leaf-node-image]");if(img.length>0){img.attr({title:opt.parentNodeImageTooltip!==null?opt.parentNodeImageTooltip:"","data-role":"parent-node-image"});img.removeClass(opt.leafNodeImageClass).addClass(opt.parentNodeImageClass)}}}},_addData:function(data,path,depth,dataIndex){var originalData=this.nodeDataFor(path),binding=this._retrieveCurrentDepthBinding(depth),temp,i;if(!binding.hasOwnProperty("primaryKey")){if(!originalData){if(this.options.dataSource.root()._data.length<=this.element.find(".ui-igtree-noderoot").length||this.element.find(".ui-igtree-noderoot").length<=0){if(dataIndex===0){if($.type(data)==="array"){this.options.dataSource.root()._data=data.concat(this.options.dataSource.root()._data)}else{this.options.dataSource.root()._data=[data].concat(this.options.dataSource.root()._data)}}else if(!dataIndex){if($.type(data)==="array"){for(i=0;i<data.length;i++){this.options.dataSource.root()._data.push(data[i])}}else{this.options.dataSource.root()._data.push(data)}}else{this.options.dataSource.root()._data.splice(dataIndex,0,data)}}}else{if(typeof originalData[binding.childDataProperty]!=="function"){if(!originalData.hasOwnProperty(binding.childDataProperty)||$.type(originalData[binding.childDataProperty])!=="array"){originalData[binding.childDataProperty]=[]}if(dataIndex===0){if($.type(data)==="array"){originalData[binding.childDataProperty]=data.concat(originalData[binding.childDataProperty])}else{originalData[binding.childDataProperty]=[data].concat(originalData[binding.childDataProperty])}}else if(!dataIndex){originalData[binding.childDataProperty]=originalData[binding.childDataProperty].concat(data)}else{temp=originalData[binding.childDataProperty].slice(0,dataIndex);temp=temp.concat(data);originalData[binding.childDataProperty]=temp.concat(originalData[binding.childDataProperty].slice(dataIndex))}}else{if(originalData[binding.childDataProperty]().length<=this.nodeByPath(path).children("ul").children("li").length){if(dataIndex===0){temp=$("<li></li>").appendTo(this.nodeByPath(path).children("ul"));originalData[binding.childDataProperty].unshift(data);temp.remove()}else if(!dataIndex){temp=$("<li></li>").appendTo(this.nodeByPath(path).children("ul"));originalData[binding.childDataProperty].push(data);temp.remove()}else{temp=$("<li></li>").appendTo(this.nodeByPath(path).children("ul"));originalData[binding.childDataProperty]().splice(dataIndex,0,data);temp.remove()}}}}}else{if(!originalData){if(this.options.dataSource.root()._data.length<=this.element.find(".ui-igtree-noderoot").length||this.element.find(".ui-igtree-noderoot").length<=0){if($.type(data)==="array"){for(i=0;i<data.length;i++){this.options.dataSource.root()._data.push(data[i])}}else{this.options.dataSource.root()._data.push(data)}}}else{if(typeof originalData[binding.childDataProperty]!=="function"){if(!originalData.hasOwnProperty(binding.childDataProperty)||$.type(originalData[binding.childDataProperty])!=="array"){originalData[binding.childDataProperty]=[]}originalData[binding.childDataProperty]=originalData[binding.childDataProperty].concat(data)}else{if(originalData[binding.childDataProperty]().length<=this.nodeByPath(path).children("ul").children("li").length){temp=$("<li></li>").appendTo(this.nodeByPath(path).children("ul"));originalData[binding.childDataProperty].push(data);temp.remove()}}}}},_removeData:function(path){var splitPath=path.split(this.options.pathSeparator),data=this.options.dataSource.root().data(),i,j,binding=this.options.bindings,key;if(splitPath.length===1){if(!binding.hasOwnProperty("primaryKey")){data.splice(parseInt(splitPath[0],10),1)}else{for(j=0;j<data.length;j++){if(data[j].hasOwnProperty(binding.primaryKey)){key=typeof data[j][binding.primaryKey]==="function"?data[j][binding.primaryKey]():data[j][binding.primaryKey];if(key.toString()===splitPath[0].toString()){data.splice(j,1);break}}}}return}for(i=0;i<splitPath.length-1;i++){if(!binding.hasOwnProperty("primaryKey")){data=data[parseInt(splitPath[i],10)]}else{for(j=0;j<data.length;j++){if(data[j].hasOwnProperty(binding.primaryKey)){key=typeof data[j][binding.primaryKey]==="function"?data[j][binding.primaryKey]():data[j][binding.primaryKey];if(key.toString()===splitPath[i].toString()){data=data[j];break}}}}if(i<splitPath.length-2){if(data[binding.childDataProperty]&&typeof data[binding.childDataProperty]==="function"){data=data[binding.childDataProperty]()}else{data=data[binding.childDataProperty]}}if(binding.hasOwnProperty("bindings")&&i<splitPath.length-2){binding=binding.bindings}}if(data[binding.childDataProperty]&&typeof data[binding.childDataProperty]!=="function"){if(data[binding.childDataProperty]&&data[binding.childDataProperty].length<=1){delete data[binding.childDataProperty]}else{data=data[binding.childDataProperty];if(binding.hasOwnProperty("bindings")){binding=binding.bindings}if(!binding.hasOwnProperty("primaryKey")&&data.length){data.splice(parseInt(splitPath[splitPath.length-1],10),1)}else{for(j=0;j<data.length;j++){if(data[j].hasOwnProperty(binding.primaryKey)&&data[j][binding.primaryKey].toString()===splitPath[i].toString()){data.splice(j,1);break}}}}}else{data=data[binding.childDataProperty]();if(binding.hasOwnProperty("bindings")){binding=binding.bindings}if(!binding.hasOwnProperty("primaryKey")&&data.length){data.splice(parseInt(splitPath[splitPath.length-1],10),1)}else{for(j=0;j<data.length;j++){if(data[j].hasOwnProperty(binding.primaryKey)){key=typeof data[j][binding.primaryKey]==="function"?data[j][binding.primaryKey]():data[j][binding.primaryKey];if(key.toString()===splitPath[splitPath.length-1].toString()){data.splice(j,1);break}}}}}},_recalculatePaths:function(path){var splitPath=path.split(this.options.pathSeparator),index=path.length>0?splitPath[splitPath.length-1]:0,node,parentPath,newPath,ul,child;if(splitPath.length>1){splitPath.splice(splitPath.length-1,1);parentPath=splitPath.join(this.options.pathSeparator);node=this.nodeByPath(parentPath);for(index;index<node.children("ul").children("li").length;index++){newPath=parentPath+this.options.pathSeparator+index;child=$(node.children("ul").children("li")[index]);child.attr("data-path",newPath);if(child.children("ul").length>0&&child.children("ul").children("li").length>0){this._recalculatePaths(newPath+this.options.pathSeparator+"0")}}}else{ul=this.element.is("ul")?this.element:this.element.children("ul");for(index;index<ul.children("li").length;index++){child=$(ul.children("li")[index]);child.attr("data-path",index);if(child.children("ul").length>0&&child.children("ul").children("li").length>0){this._recalculatePaths(index+this.options.pathSeparator+"0")}}}},_loadQueue:null,_toSelect:false,_triggerChainRequest:function(path,toSelect){var list=path.split(this.options.pathSeparator),i,newPath="";if(this._loadQueue===null){this._loadQueue=[]}if(toSelect){this._toSelect=true}for(i=0;i<list.length;i++){newPath+=list[i];this._loadQueue.push(newPath);newPath+=this.options.pathSeparator}this._loadRequest()},_loadRequest:function(){var node;if(this._populatingNode===null){if(this._loadQueue&&this._loadQueue.length>0){node=this.nodeByPath(this._loadQueue.shift());if(this._loadQueue.length>0){if(!this.isExpanded(node)){this.toggle(node)}else{this._loadRequest()}}else if(this._toSelect){this.select(node);this._toSelect=false}}}},_replaceUIValue:function(node,data,item){var element=node.element,binding=this._retrieveCurrentDepthBinding(parseInt(element.parent().attr("data-depth"),10)),value,isFocused,anchor;switch(item){case binding.textKey:if(!binding.nodeContentTemplate){value=typeof data[item]==="function"?data[item]():data[item];element.children("a").text(value)}else{anchor=element.children("a");if(anchor.hasClass(this.css.nodeActive)){isFocused=true}anchor.replaceWith(this._renderNodeTemplate(data,binding));if(this.isSelected(element)){element.children("a").addClass(this.css.nodeSelected);this._selectedNode[0]=this.nodeFromElement(element)}if(isFocused){element.children("a").focus()}}break;case binding.valueKey:value=typeof data[item]==="function"?data[item]():data[item];element.attr("data-value",value);break;case binding.navigateUrlKey:value=typeof data[item]==="function"?data[item]():data[item];element.children("a").attr("href",value);break;case binding.imageUrlKey:value=typeof data[item]==="function"?data[item]():data[item];element.children("img[data-role=node-image]").attr("src",value);break;case binding.expandedKey:value=typeof data[item]==="function"?data[item]():data[item];if(value){this.expand(element)}else{this.collapse(element)}break;case binding.checkedKey:value=typeof data[item]==="function"?data[item]():data[item];switch(value){case"on":this.checkNode(node);break;case"partial":this.partiallyCheckNode(node);break;default:this.uncheckNode(node);break}break;default:break}},_cascadeUncheck:function(nodeObj,cascadeDir){var children=nodeObj.element.find("li[data-role=node]"),self=this,parent;if(!cascadeDir||cascadeDir==="down"){children.each(function(){self.uncheckNode(self._constructNodeObject($(this)),"down")})}if(!cascadeDir||cascadeDir==="up"){parent=this.parentNode(nodeObj.element);if(parent){if(parent.find("ul > li > span[data-chk=on]").length<=0){this.uncheckNode(this._constructNodeObject(parent),"up")}else{this.partiallyCheckNode(this._constructNodeObject(parent),"up")}}}},_cascadeCheck:function(nodeObj,cascadeDir){var children=nodeObj.element.find("li[data-role=node]"),self=this,parent;if(!cascadeDir||cascadeDir==="down"){children.each(function(){self.checkNode(self._constructNodeObject($(this)),"down")})}if(!cascadeDir||cascadeDir==="up"){parent=this.parentNode(nodeObj.element);if(parent){if(parent.find("ul > li > span[data-chk=on]").length===parent.find("ul > li").length){this.checkNode(this._constructNodeObject(parent),"up")}else{this.partiallyCheckNode(this._constructNodeObject(parent),"up")}}}},dataBind:function(){this._triggerDataBinding();var dataOpt=this._initDataOptions();this._initDataSource(dataOpt);this.options.dataSource.dataBind(this._constructFromData,this)},toggleCheckstate:function(node,event){var self=this,opt=self.options,state,noCancel=true,nodeObject;if(!node){throw new Error(this._getLocaleValue("incorrectNodeObject"))}if(!opt.checkboxMode||opt.checkboxMode.toLowerCase()==="off"){return}nodeObject=this._constructNodeObject(node);if(event){noCancel=this._triggerNodeCheckstateChanging(event,nodeObject)}if(noCancel){state=nodeObject.data[nodeObject.binding.checkedKey];if(state==="on"||state==="partial"){this.uncheckNode(nodeObject)}else{this.checkNode(nodeObject)}if(event){this._triggerNodeCheckstateChanged(event,nodeObject)}}},checkNode:function(nodeObj,cascadeDir){var opt=this.options,css=this.css,checkbox=nodeObj.element.children("span[data-role=checkbox]"),checkIcon=checkbox.children("span");if(!opt.checkboxMode||opt.checkboxMode.toLowerCase()==="off"){return}checkbox.attr("data-chk","on");checkIcon.removeClass(css.checkboxOff).removeClass(css.checkboxPartial).addClass(css.checkboxOn);nodeObj.data[nodeObj.binding.checkedKey]="on";if(opt.checkboxMode.toLowerCase()==="tristate"){this._cascadeCheck(nodeObj,cascadeDir)}},uncheckNode:function(nodeObj,cascadeDir){var opt=this.options,css=this.css,checkbox=nodeObj.element.children("span[data-role=checkbox]"),checkIcon=checkbox.children("span");if(!opt.checkboxMode||opt.checkboxMode.toLowerCase()==="off"){return}checkbox.attr("data-chk","off");checkIcon.removeClass(css.checkboxOn).removeClass(css.checkboxPartial).addClass(css.checkboxOff);nodeObj.data[nodeObj.binding.checkedKey]="off";if(opt.checkboxMode.toLowerCase()==="tristate"){this._cascadeUncheck(nodeObj,cascadeDir)}},partiallyCheckNode:function(nodeObj,cascadeDir){var opt=this.options,css=this.css,checkbox=nodeObj.element.children("span[data-role=checkbox]"),checkIcon=checkbox.children("span"),parentNode;if(!opt.checkboxMode||opt.checkboxMode.toLowerCase()==="off"){return}checkbox.attr("data-chk","partial");checkIcon.removeClass(css.checkboxOn).removeClass(css.checkboxOff).addClass(css.checkboxPartial);nodeObj.data[nodeObj.binding.checkedKey]="partial";if(opt.checkboxMode.toLowerCase()==="tristate"||cascadeDir){parentNode=this.parentNode(nodeObj.element);if(parentNode){this.partiallyCheckNode(this._constructNodeObject(parentNode),"up")}}},toggle:function(node,event){if(this.isExpanded(node)){this.collapse(node,event)}else{this.expand(node,event)}},expandToNode:function(node,toSelect){var parentNode,cachedanimationDuration;if(node&&node.length>0){if(typeof node==="string"&&this.nodeByPath(node).length>0){node=this.nodeByPath(node)}if(typeof node==="string"&&this.options.loadOnDemand){this._triggerChainRequest(node,toSelect);return}if(toSelect){this.select(node)}parentNode=this.parentNode(node);cachedanimationDuration=this.options.animationDuration;this.options.animationDuration=0;while(parentNode){this.expand(parentNode);parentNode=this.parentNode(parentNode)}this.options.animationDuration=cachedanimationDuration}},expand:function(node,event){var self=this,opt=self.options,css=self.css,i=0,expander,nodeObject,noCancel=true,siblings;if(!node||node.length<=0){throw new Error(this._getLocaleValue("incorrectNodeObject"))}if(node.children("ul").attr("data-populated")&&node.children("ul").attr("data-populated")==="false"){this._prepareRequest(node);return}nodeObject=this._constructNodeObject(node);expander=node.children("."+css.nodeExpander);if(!this.isExpanded(node)){if(opt.singleBranchExpand){siblings=node.siblings();for(i;i<siblings.length;i++){this.collapse($(siblings[i]),event)}}if(event){noCancel=this._triggerNodeExpanding(event,nodeObject)}if(noCancel){node.children("ul").show(opt.animationDuration,function(){if(event){self._triggerNodeExpanded(event,nodeObject)}});expander.removeClass(css.expandIcon).addClass(css.collapseIcon).attr("data-exp",true);nodeObject.data[nodeObject.binding.expandedKey]=true}}},collapse:function(node,event){var self=this,opt=self.options,css=self.css,expander,nodeObject,noCancel=true;if(!node||node.length<=0){throw new Error(this._getLocaleValue("incorrectNodeObject"))}nodeObject=this._constructNodeObject(node);expander=node.children("."+css.nodeExpander);if(this.isExpanded(node)){if(event){noCancel=this._triggerNodeCollapsing(event,nodeObject)}if(noCancel){$(node).children("ul").hide(opt.animationDuration,function(){if(event){self._triggerNodeCollapsed(event,nodeObject)}});expander.removeClass(css.collapseIcon).addClass(css.expandIcon).attr("data-exp",false);nodeObject.data[nodeObject.binding.expandedKey]=false}}},parentNode:function(node){if(!node){throw new Error(this._getLocaleValue("incorrectNodeObject"))}var parent=node.parent().closest("li[data-role=node]");return parent.length>0?parent:null},nodeByPath:function(nodePath){return this.element.find("li[data-path='"+nodePath+"']")},nodesByValue:function(value){return this.element.find("li[data-value='"+value+"']")},checkedNodes:function(){var elements=this.element.find("span[data-chk=on]").parent(),i=0,collection=[];if(elements.length>0){for(i;i<elements.length;i++){collection.push(this.nodeFromElement($(elements[i])))}}return collection},uncheckedNodes:function(){var elements=this.element.find("span[data-chk=off]").parent(),i=0,collection=[];if(elements.length>0){for(i;i<elements.length;i++){collection.push(this.nodeFromElement($(elements[i])))}}return collection},partiallyCheckedNodes:function(){var elements=this.element.find("span[data-chk=partial]").parent(),i=0,collection=[];if(elements.length>0){for(i;i<elements.length;i++){collection.push(this.nodeFromElement($(elements[i])))}}return collection},select:function(node,event){if(!node||node.length<=0){throw new Error(this._getLocaleValue("incorrectNodeObject"))}var css=this.css,nodeId=node.attr("data-path"),noCancel,prevent=false;if(event&&(node.children("a").attr("href")==="#"||node.children("a").attr("href")===document.URLUnencoded+"#")){prevent=true}if(this._selectedNode[0].path!==null){if(this._selectedNode[0].path!==nodeId){noCancel=this._triggerSelectionChanging(event,node);if(noCancel){this._selectedNode[0].element.children("a").removeClass(css.nodeSelected);node.children("a").addClass(css.nodeSelected);this._selectedNode[0]=this.nodeFromElement(node);this._triggerSelectionChanged(event)}else if(event){prevent=true}}}else{noCancel=this._triggerSelectionChanging(event,node);if(noCancel){node.children("a").addClass(css.nodeSelected);this._selectedNode[0]=this.nodeFromElement(node);this._triggerSelectionChanged(event)}else if(event){prevent=true}}if(prevent){event.preventDefault()}},deselect:function(node){if(!node){throw new Error(this._getLocaleValue("incorrectNodeObject"))}var css=this.css,nodeId=node.attr("data-path");if(this._selectedNode[0].path!==null){if(this._selectedNode[0].path===nodeId){node.children("a").removeClass(css.nodeSelected);this._selectedNode[0].path=null;this._selectedNode[0].element=null;this._selectedNode[0].data=null;this._selectedNode[0].binding=null}}},clearSelection:function(){var css=this.css,i=0;if(this._selectedNode&&this._selectedNode[0].path!==null){for(i;i<this._selectedNode.length;i++){this._selectedNode[i].element.children("a").removeClass(css.nodeSelected)}this._selectedNode=[{path:null,element:null,data:null,binding:null}]}},selectedNode:function(){return this._selectedNode[0]},findNodesByText:function(text,parent){var collection=[],nodes,self=this;nodes=parent?parent.find("li > a:contains('"+text+"')"):this.element.find("li > a:contains('"+text+"')");nodes.each(function(){collection.push(self.nodeFromElement($(this).closest("li[data-role=node]")))});return collection},findImmediateNodesByText:function(text,parent){var collection=[],nodes,self=this;nodes=parent?parent.children("ul").children("li").children("a:contains('"+text+"')"):this.element.is("ul")?this.element.children("li").children("a:contains('"+text+"')"):this.element.children("ul").children("li").children("a:contains('"+text+"')");nodes.each(function(){collection.push(self.nodeFromElement($(this).closest("li[data-role=node]")))});return collection},nodeByIndex:function(index,parent){var node;if(!parent){if(this.element.is("ul")){node=this.element.children().eq(index)}else{node=this.element.children("ul").children().eq(index);
}}else{node=parent.children("ul").children().eq(index)}return node},nodeFromElement:function(element){if(element.length>0){var nodeElement={path:element.attr("data-path"),element:element,data:this.nodeDataFor(element.attr("data-path")),binding:this._retrieveCurrentDepthBinding(element.parent().attr("data-depth"))};return nodeElement}},children:function(parent){var children=[],self=this,child,ul;if(parent&&parent.length>0){ul=parent.children("ul");if(ul.length>0){ul.children("li").each(function(){child=$(this);children.push(self.nodeFromElement(child))})}return children}throw new Error(this._getLocaleValue("incorrectNodeObject"))},childrenByPath:function(path){var node=this.nodeByPath(path),children=[],self=this,child,ul;if(node.length>0){ul=node.children("ul");if(ul.length>0){ul.children("li").each(function(){child=$(this);children.push(self.nodeFromElement(child))})}return children}throw new Error(this._getLocaleValue("incorrectPath")+path)},isSelected:function(node){if(node&&node.length>0){return this._selectedNode[0].path===node.attr("data-path")}throw new Error(this._getLocaleValue("incorrectNodeObject"))},isExpanded:function(node){if(node&&node.length>0){var expander=node.children("span[data-role=expander]");if(expander.length>0){return expander.attr("data-exp")==="true"}return false}else{throw new Error(this._getLocaleValue("incorrectNodeObject"))}},isChecked:function(node){if(node&&node.length>0){var checkbox=node.children("span[data-role=checkbox]");if(checkbox.length>0){return checkbox.attr("data-chk")==="on"}return false}else{throw new Error(this._getLocaleValue("incorrectNodeObject"))}},checkState:function(node){if(node&&node.length>0){var checkbox=node.children("span[data-role=checkbox]");if(checkbox.length>0){return checkbox.attr("data-chk")}}else{throw new Error(this._getLocaleValue("incorrectNodeObject"))}},addNode:function(node,parent,nodeIndex){if(!nodeIndex&&typeof parent==="number"){nodeIndex=parent;parent=null}if(!node||node.length<=0){if(parent&&parent.length>0){this._updateParentState(parent)}return}var ul,path,isLi,li,isEmpty,r,binding,depth;if(!parent){parent=this.element.is("ul")?this.element:this.element.children("ul");if(parent.children().length<=0){this._addData(node,"",0);this._triggerRendering(node);r=$(this._initChildrenRecursively("",node)).appendTo(parent);if(this.options.dragAndDrop){this._initDragAndDrop(r)}this._triggerRendered();this.options.dataSource.root().addNode({data:node,parentPath:"",path:r.attr("data-path")});return}}isLi=parent.is("li");ul=isLi?parent.children("ul"):parent;if(ul.length<=0){ul=$("<ul data-depth='"+(parseInt(parent.parent().attr("data-depth"),10)+1)+"' style='display: none'></ul>").appendTo(parent)}depth=parseInt(ul.attr("data-depth"),10);path=isLi?parent.attr("data-path"):"";binding=this._retrieveCurrentDepthBinding(depth);if(this.options.checkboxMode.toLowerCase()==="tristate"){if(this.isChecked(parent)){this._populateCheckedStates($.isArray(node)?node:[node],binding,"on")}}this._addData(node,path,parseInt(ul.attr("data-depth"),10)-1,nodeIndex);this._triggerRendering(node);isEmpty=ul.children("li").length<=0;if(nodeIndex===0){li=$(this._initChildrenRecursively(path,node,depth,ul.children("li").length)).prependTo(ul);if(!binding.hasOwnProperty("primaryKey")){this._recalculatePaths(path)}}else if(!nodeIndex){li=$(this._initChildrenRecursively(path,node,depth,ul.children("li").length)).appendTo(ul)}else{li=$(this._initChildrenRecursively(path,node,depth,ul.children("li").length)).insertBefore(ul.children("li:eq("+nodeIndex+")"));if(!binding.hasOwnProperty("primaryKey")){this._recalculatePaths(path)}}if(isLi&&isEmpty){this._updateParentState(parent)}if(this.options.dragAndDrop){this._initDragAndDrop(li)}this._triggerRendered();r=[];li.each(function(){r.push($(this).attr("data-path"))});this.options.dataSource.root().addNode({data:node,parentPath:path,path:r});this._trigger("nodeAdded",null,{owner:this,element:li,data:node,index:nodeIndex,binding:binding})},removeAt:function(path){var node=this.nodeByPath(path),depth=parseInt(node.parent().attr("data-depth"),10),binding,parent=this.parentNode(node),data;if(node.length<=0){return}if(path.indexOf("_remove")!==-1){path=path.replace("_remove","")}binding=this._retrieveCurrentDepthBinding(depth);data={data:$.extend(false,{},this.nodeDataFor(path)),path:path};this._removeData(path,binding);node.remove();if(!binding.hasOwnProperty("primaryKey")){this._recalculatePaths(path)}if(parent&&parent.children("ul").children("li").length<=0){this._updateParentState(parent)}if(this.options.checkboxMode.toLowerCase()==="tristate"&&parent){this._updateParentCheckbox(parent)}this.options.dataSource.root().removeNode(data);this._trigger("nodeDeleted",null,{owner:this,data:data.data,path:path})},removeNodesByValue:function(value){var nodes=this.nodesByValue(value),self=this;nodes.each(function(){self.removeAt($(this).attr("data-path"))})},applyChangesToNode:function(element,data){var node=this.nodeFromElement(element),item;for(item in node.data){if(node.data.hasOwnProperty(item)){this._replaceUIValue(node,data,item)}}},transactionLog:function(){return this.options.dataSource.root().pendingTransactions()},_triggerSelectionChanging:function(event,node){var args={owner:this,selectedNodes:this._selectedNode,newNodes:[this._constructNodeObject(node)]};return this._trigger(this.events.selectionChanging,event,args)},_triggerSelectionChanged:function(event){var args={owner:this,selectedNodes:this._selectedNode,newNodes:this._selectedNode};this._trigger(this.events.selectionChanged,event,args)},_triggerNodeCollapsing:function(event,nodeObj){var args={owner:this,node:nodeObj};return this._trigger(this.events.nodeCollapsing,event,args)},_triggerNodeCollapsed:function(event,nodeObj){var args={owner:this,node:nodeObj};this._trigger(this.events.nodeCollapsed,event,args)},_triggerNodeExpanding:function(event,nodeObj){var args={owner:this,node:nodeObj};return this._trigger(this.events.nodeExpanding,event,args)},_triggerNodeExpanded:function(event,nodeObj){var args={owner:this,node:nodeObj};this._trigger(this.events.nodeExpanded,event,args)},_triggerNodePopulating:function(event,node){var args=this._constructNodeObject(node);return this._trigger(this.events.nodePopulating,event,args)},_triggerNodePopulated:function(event,node){var args=this._constructNodeObject(node);this._trigger(this.events.nodePopulated,event,args)},_triggerNodeCheckstateChanging:function(event,nodeObj){var state=nodeObj.data[nodeObj.binding.checkedKey],args={owner:this,node:nodeObj,currentState:state,newState:state==="off"?"on":"off",currentCheckedNodes:this.checkedNodes()};return this._trigger(this.events.nodeCheckstateChanging,event,args)},_triggerNodeCheckstateChanged:function(event,nodeObj){var state=nodeObj.data[nodeObj.binding.checkedKey],args={owner:this,node:nodeObj,newState:state,newCheckedNodes:this.checkedNodes(),newPartiallyCheckedNodes:this.partiallyCheckedNodes()};return this._trigger(this.events.nodeCheckstateChanged,event,args)},_triggerNodeClick:function(event,node){var args={owner:this,node:this._constructNodeObject(node)};return this._trigger(this.events.nodeClick,event,args)},_triggerNodeDoubleClick:function(event,node){var args=this._constructNodeObject(node);return this._trigger(this.events.nodeDoubleClick,event,args)},_triggerDataBinding:function(){var args={owner:this};this._trigger(this.events.dataBinding,null,args)},_triggerDataBound:function(dataView){var args={owner:this,dataView:dataView};this._trigger(this.events.dataBound,null,args)},_triggerRendering:function(dataView){var args={owner:this,dataView:dataView};this._trigger(this.events.rendering,null,args)},_triggerRendered:function(){var args={owner:this};this._trigger(this.events.rendered,null,args)},_triggerDragStart:function(event,ui,node){var obj=this._constructNodeObject(node),args=$.extend(false,obj,ui);args.owner=this;return this._trigger(this.events.dragStart,event,args)},_triggerDrag:function(event,ui,node){var obj=this._constructNodeObject(node),args=$.extend(false,obj,ui);args.owner=this;return this._trigger(this.events.drag,event,args)},_triggerDragStop:function(event,ui){var args=$.extend({owner:this},ui);this._trigger(this.events.dragStop,event,args)},_triggerNodeDropping:function(event,ui,node,targetIndex){var obj=this._constructNodeObject(node),args,indexDecrement;obj.targetIndex=targetIndex;obj.originalIndex=ui.draggable.index();indexDecrement=this._sourceNode.element.parent().attr("data-depth")===node.parent().attr("data-depth")&&obj.targetIndex>obj.originalIndex?-1:0;obj.targetIndex+=indexDecrement;args=$.extend(false,obj,ui);args.owner=this;args.sourceNode=this._sourceNode;return this._trigger(this.events.nodeDropping,event,args)},_triggerNodeDropped:function(event,ui,node){var obj=this._constructNodeObject(node),args=$.extend(false,obj,ui);args.owner=this;args.sourceNode=this._sourceNode;this._trigger(this.events.nodeDropped,event,args)},_constructNodeObject:function(node){var nodeData=this.nodeDataFor(node!==null?node.attr("data-path"):null),nodeObject={path:node!==null?node.attr("data-path"):null,element:node!==null?node:null,data:nodeData,binding:node!==null?this._retrieveCurrentDepthBinding(parseInt(node.parent().attr("data-depth"),10)):null};return nodeObject},nodeDataFor:function(path){if(!path){return}var splitPath=path.split(this.options.pathSeparator),data=this.options.dataSource.root().data(),i,j,binding=this.options.bindings,temp;for(i=0;i<splitPath.length-1;i++){if(!binding.hasOwnProperty("primaryKey")){if(data[parseInt(splitPath[i],10)]){if(typeof data[parseInt(splitPath[i],10)][binding.childDataProperty]==="function"){data=data[parseInt(splitPath[i],10)][binding.childDataProperty]()}else{data=data[parseInt(splitPath[i],10)][binding.childDataProperty]}}}else{for(j=0;j<data.length;j++){if(data[j].hasOwnProperty(binding.primaryKey)){temp=typeof data[j][binding.primaryKey]==="function"?data[j][binding.primaryKey]():data[j][binding.primaryKey];if(temp.toString()===splitPath[i].toString()){data=typeof data[j][binding.childDataProperty]==="function"?data[j][binding.childDataProperty]():data[j][binding.childDataProperty];break}}}}if(binding.hasOwnProperty("bindings")){binding=binding.bindings}}if(!binding.hasOwnProperty("primaryKey")&&data.length){data=data[parseInt(splitPath[splitPath.length-1],10)]}else{for(j=0;j<data.length;j++){if(data[j].hasOwnProperty(binding.primaryKey)){temp=typeof data[j][binding.primaryKey]==="function"?data[j][binding.primaryKey]():data[j][binding.primaryKey];if(temp.toString()===splitPath[i].toString()){data=data[j];break}}}}if(typeof data==="function"){data=data()}return data},destroy:function(){this._superApply(arguments);this.element.undelegate();this.element.removeClass(this.css.tree);this.element.removeClass(this.css.treeCollection);this.element.removeClass(this.css.treeRoot);if(this.options.width){this.element.css("width","")}if(this.options.height){this.element.css("height","")}if(this.options.dragAndDrop){this._destroyDragAndDrop()}this.element.removeAttr("data-depth");this.element.removeAttr("data-scroll");this.element.empty();return this}});$.extend($.ui.igTree,{version:"21.2.12"})})($);/*!@license
* Infragistics.Web.ClientUI Grid 21.2.12
*
* Copyright (c) 2011-2022 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on:
*	jquery-1.9.1.js
*	jquery.ui.core.js
*	jquery.ui.widget.js
*	infragistics.dataSource.js
*	infragistics.ui.widget.js
*	infragistics.ui.shared.js
*	infragistics.templating.js
*	infragistics.util.js
*/
(function($){var _hovTR,_aNull=function(val){return val===null||val===undefined};$.widget("ui.igGrid",$.ui.igWidget,{css:{baseClass:"ui-widget ui-helper-clearfix ui-corner-all",baseContentClass:"ui-widget-content",gridClasses:"ui-iggrid",recordClass:"ui-ig-record ui-iggrid-record",recordAltClass:"ui-ig-altrecord ui-iggrid-altrecord",headerClass:"ui-iggrid-header ui-widget-header",headerTextClass:"ui-iggrid-headertext",headerCellFeatureEnabledClass:"ui-iggrid-headercell-featureenabled",baseHeaderClass:"ui-widget-header",gridTableClass:"ui-iggrid-table ui-widget-content",mrlGridTableClass:"ui-iggrid-table-mrl ui-widget-content",mrlGridHeaderScrollableTableClass:"ui-iggrid-headertable-mrl-scrollable",gridHeaderTableClass:"ui-iggrid-headertable",mrlGridHeaderTableClass:"ui-iggrid-headertable-mrl",gridFooterTableClass:"ui-iggrid-footertable ui-widget-footer",gridFooterClass:"",gridHeaderCaptionClass:"ui-iggrid-headercaption ui-widget-header ui-corner-top",gridTableBodyClass:"ui-iggrid-tablebody",gridScrollDivClass:"ui-iggrid-scrolldiv ui-widget-content",gridVirtualScrollDivClass:"ui-iggrid-virtualscrolldiv",deletedRecord:"ui-iggrid-deletedrecord",modifiedRecord:"ui-iggrid-modifiedrecord",rtl:"ui-iggrid-rtl",gridScrollbarsWrapper:"iggrid-scrollbars-wrapper",gridMeasurementContainerClass:"ui-iggrid-measurement-container"},options:{locale:null,width:null,height:null,autoAdjustHeight:true,avgRowHeight:25,avgColumnWidth:null,defaultColumnWidth:null,autoGenerateColumns:true,virtualization:false,virtualizationMode:"fixed",rowVirtualization:false,columnVirtualization:false,virtualizationMouseWheelStep:null,adjustVirtualHeights:false,templatingEngine:"infragistics",columns:[{headerText:null,key:null,formatter:null,format:null,dataType:"string",width:null,hidden:false,template:null,unbound:false,groupOptions:{expanded:true,allowGroupCollapsing:false,hidden:"never"},group:[],dateDisplayType:"local",rowspan:0,formula:null,unboundValues:null,headerCssClass:null,columnCssClass:null,mapper:null,rowIndex:null,columnIndex:null,navigationIndex:null,colSpan:1,rowSpan:1}],dataSource:null,dataSourceUrl:null,dataSourceType:null,responseDataKey:null,responseTotalRecCountKey:null,requestType:"GET",responseContentType:"application/json; charset=utf-8",showHeader:true,showFooter:true,fixedHeaders:true,fixedFooters:true,caption:null,features:[{name:null}],tabIndex:0,localSchemaTransform:true,primaryKey:null,serializeTransactionLog:true,autoCommit:false,aggregateTransactions:false,autoFormat:"date",renderCheckboxes:false,updateUrl:null,restSettings:{create:{url:null,template:null,batch:false},update:{url:null,template:null,batch:false},remove:{url:null,template:null,batch:false},encodeRemoveInRequestUri:true,contentSerializer:null,contentType:"application/json; charset=utf-8"},alternateRowStyles:true,autofitLastColumn:true,enableHoverStyles:true,enableUTCDates:false,mergeUnboundColumns:false,jsonpRequest:false,enableResizeContainerCheck:true,featureChooserIconDisplay:"desktopOnly",scrollSettings:{scrollTop:0,scrollLeft:0,wheelStep:50,smoothing:false,smoothingStep:1,smoothingDuration:1,inertiaStep:1,inertiaDuration:1}},events:{cellClick:"cellClick",cellRightClick:"cellRightClick",dataBinding:"dataBinding",dataBound:"dataBound",rendering:"rendering",rendered:"rendered",dataRendering:"dataRendering",dataRendered:"dataRendered",headerRendering:"headerRendering",headerRendered:"headerRendered",captionRendering:"captionRendering",captionRendered:"captionRendered",footerRendering:"footerRendering",footerRendered:"footerRendered",headerCellRendered:"headerCellRendered",rowsRendering:"rowsRendering",rowsRendered:"rowsRendered",schemaGenerated:"schemaGenerated",columnsCollectionModified:"columnsCollectionModified",requestError:"requestError",created:"igcontrolcreated",destroyed:"igcontroldestroyed"},resizeTimeout:300,maxScrollContainerHeight:10737418,cloneChildElements:false,widget:function(){return this.element},_persistVirtualScrollTop:false,_createWidget:function(options){var cols;this.options.columns=null;this.options.features=null;if(options){if(options.dataSource&&($.type(options.dataSource)==="array"||$.type(options.dataSource)==="object")){this.tmpDataSource=options.dataSource;options.dataSource=null;this._originalOptions=options}if(options.autoGenerateColumns===undefined){cols=options.columns;if($.type(cols)==="array"&&cols.length){options.autoGenerateColumns=false}}}this._superApply(arguments)},_execSetOptionCallbacks:function(key,value){var callbacks=this._setOptionCallbacks||[],i,len=callbacks.length;for(i=0;i<len;i++){callbacks[i].func(key,value)}},_showHideHeader:function(show){var header=this.headersTable(),fHeader=this.hasFixedColumns()?this.fixedHeadersTable():$();if(!header.length||!header.is("table")||header.find("tbody").length){header=this.element.find("thead tr");fHeader=fHeader.find("thead>tr")}if(show){header.show();fHeader.show()}else{header.hide();fHeader.hide()}},_setOptionsForFeatures:function(options){var i,f,features=this.options.features,featureInstance,fc;for(i=0;i<features.length;i++){f=features[i];if(f&&f.name){featureInstance=this.element.data("igGrid"+f.name);featureInstance._setOptions(options)}}fc=this.element.data("igGridFeatureChooser");if(fc){fc._setOptions(options)}},_getAllFormattedColumns:function(){return this.options.columns.filter(function(col){if(col.formatted){return col}})},_getRenderedDataRecords:function(dataView){dataView=dataView||this._getDataView()||[];var o=this.options,endIndex,$tr;if(o.virtualization||o.rowVirtualization){if(o.virtualizationMode==="continuous"){$tr=this.element.find(">tbody>tr[data-row-idx]").last();endIndex=$tr.attr("data-row-idx");endIndex=parseInt(endIndex,10)}else{endIndex=this._startRowIndex+this.element.find(">tbody>tr").length-1}if(!endIndex){return[]}dataView=dataView.slice(this._startRowIndex,endIndex+1)}dataView=dataView.filter(function(record){return!record.__gbRecord&&!record.__gbSummaryRecord});return dataView},changeRegional:function(){var dataRecords=this._getRenderedDataRecords();if(!dataRecords.length){return}this._setOptionsForFeatures({regional:this.options.regional});this._getAllFormattedColumns().forEach(function(column){this._renderColumnData(column.key,dataRecords)},this)},_changeLanguage:function(language){this.options.language=language;this._setOptionsForFeatures({language:language})},_setOption:function(key,value){var isScrolling,caption,tmp,cval,t=$.type(value),hasVirtualization=this.options.virtualization||this.options.rowVirtualization||this.options.columnVirtualization;if(value===this.options[key]&&t!=="array"&&t!=="object"){return}cval=this.options[key];isScrolling=this.options.height!==null||this.options.width!==null;if(key==="columns"){this.renderMultiColumnHeader(value);return}else if(key==="scrollSettings"){value=$.extend(this.options.scrollSettings,value)}if(key==="language"){this._changeLanguage(value);return this}this._super(key,value);if(key==="virtualization"||key==="autoGenerateColumns"||key==="rowVirtualization"||key==="columnVirtualization"||key==="fixedHeaders"||key==="scrollbars"){throw new Error(this._getLocaleValue("optionChangeNotSupported").replace("{optionName}",key))}this._execSetOptionCallbacks(key,value);if(key==="width"){if(isScrolling===true){if(typeof cval==="string"&&cval.indexOf("%")!==-1&&this._gridHasWidthInPixels()){throw new Error(this._getLocaleValue("widthChangeFromPercentagesToPixelsNotSupported"))}else if(!(typeof cval==="string"&&cval.indexOf("%")!==-1)&&this._gridHasWidthInPercent()){throw new Error(this._getLocaleValue("widthChangeFromPixelsToPercentagesNotSupported"))}this._setGridWidth(value);this._fireInternalEvent("_gridWidthChanged");if((this.options.virtualization===true||this.options.rowVirtualization===true||this.options.columnVirtualization)&&this._vdisplaycontainer().data("igScroll")&&typeof this._vdisplaycontainer().data("igScroll")._onElementMutation==="function"){this._vdisplaycontainer().data("igScroll")._onElementMutation([{attributeName:"style"}])}else if(this.scrollContainer().data("igScroll")&&typeof this.scrollContainer().data("igScroll")._onElementMutation==="function"){this.scrollContainer().data("igScroll")._onElementMutation([{attributeName:"style"}])}}else{throw new Error(this._getLocaleValue("optionChangeNotScrollingGrid").replace("{optionName}",key))}}else if(key==="height"){if(isScrolling===true){this.scrollContainer().css("overflow-y","auto");if(this.options.autoAdjustHeight){this.container().css("height",value);this._virtualHeightReset=true;if(hasVirtualization&&this.options.virtualizationMode!=="fixed"){this._saveFirstVisibleTRIndex()}this._initializeHeights()}else{if(this.options.virtualization===true||this.options.columnVirtualization===true||this.options.rowVirtualization===true){this._vdisplaycontainer().css("height",value);this._scrollContainer().css("height",value);this.element.height(value)}else{this.scrollContainer().css("height",value)}}if(hasVirtualization){if(this.options.virtualizationMode==="fixed"){this._buildVirtualDom();this.virtualScrollTo(this._startRowIndex)}else{tmp=this._persistVirtualScrollTop;this._persistVirtualScrollTop=true;this._renderVirtualRecords();this._persistVirtualScrollTop=tmp}}this._fireInternalEvent("_heightChanged")}else{throw new Error(this._getLocaleValue("optionChangeNotScrollingGrid").replace("{optionName}",key))}}else if(key==="dataSource"){this.options.dataSource=value;this.dataBind();if(this._inferOpType()!=="remote"){this.autoSizeColumns()}}else if(key==="showHeader"){this._showHideHeader(value)}else if(key==="caption"){caption=this._caption();if(caption.length===0){this._renderCaption();if(this.options.autoAdjustHeight){this._initializeHeights()}}else{caption.html(value)}}else if(key==="alternateRowStyles"){this._renderData()}else if(key==="scrollSettings"){if(this.options.virtualization===true||this.options.rowVirtualization===true||this.options.columnVirtualization){this._vdisplaycontainer().igScroll("option",value)}else{this.scrollContainer().igScroll("option",value)}}},_initialized:false,_headersInitialized:false,_footerInitialized:false,_mouseClickEventHandler:function(event,eventToTrigger){var $et=$(event.target),row=$et.closest("tr"),key=row.attr("data-id"),describedBy,colKey,$td,res,currGrid,colIndex=$et.closest("td").index(),rowIndex=row.index(),grid=this,i;if(grid.element.closest(".ui-iggrid-root").data("igGrid")){currGrid=$et.closest(this._isMultiRowGrid()?".ui-iggrid-table-mrl":".ui-iggrid-table").data("igGrid");if(currGrid&&grid.id()!==currGrid.id()){return}}if(key===""||key===null||key===undefined){key=rowIndex}$td=$(event.target);if(!$td.is("td")){$td=$(event.target).closest("td")}describedBy=$td.attr("aria-describedBy");if(describedBy===null||describedBy===undefined){return}describedBy=describedBy.split(" ");for(i=0;i<describedBy.length;i++){if(describedBy[i].startsWith(this.id()+"_")){colKey=describedBy[i].slice(describedBy[i].indexOf(this.id()+"_")+this.id().length+1)}}if(colKey===null||colKey===undefined){return}if(this._isMultiRowGrid()){colIndex=this.columnByKey(colKey).columnIndex}if(grid.hasFixedColumns()){if($td.length===1){res=grid.getColumnByTD($td);if(res!==null){colKey=res.column.key;colIndex=res.index}}}if(!$et.closest("tr").parent().is("thead")&&($et.is("td")||$et.closest("td").length===1&&$et.closest("td").parent().attr("data-container")!=="true")){if(!row.is("[data-summaryrow]")){key=grid._fixPKValue(key)}if(grid.hasFixedColumns()){row=grid._isFixedElement(row)?row.add(this.rowAt(rowIndex)):row.add(this.fixedRowAt(rowIndex))}grid._trigger(eventToTrigger,event,{rowIndex:rowIndex,rowKey:key,row:row,colIndex:colIndex,colKey:colKey,cellElement:$td[0],owner:grid})}},_create:function(){var grid=this,i,container,attr;this._mouseClickEventHandlers={click:function(event){grid._mouseClickEventHandler(event,grid.events.cellClick)},contextmenu:function(event){grid._mouseClickEventHandler(event,grid.events.cellRightClick)}};this._isHierarchicalGrid=false;this._hasUnboundColumns=false;this.requiresDataBinding=true;if(this.options._isHierarchicalGrid===true){this._isHierarchicalGrid=true}if(this.cloneChildElements&&this.element.is("table")&&this.element.children().length>0){this._initialChildren=this.element.children().clone(true)}this._initialAttributes=[];attr=this.element[0].attributes;for(i=0;i<attr.length;i++){if(attr[i].name!=="id"){this._initialAttributes.push({name:attr[i].name,value:attr[i].value})}}this._rtl=this.element[0].style.direction==="rtl";this._padding=this._rtl?"padding-left":"padding-right";if(this.tmpDataSource!==null&&this.tmpDataSource!==undefined){this.options.dataSource=this.tmpDataSource;this._originalOptions.dataSource=this.tmpDataSource}this._testInnerHtml();this._setOptionCallbacks=[];this._headerInitCallbacks=[];this._footerInitCallbacks=[];this._cellStyleSubscribers=[];this._firstBind=true;this._isMultiColumnGrid=false;this._unboundValues={};if(!this.options.columns){this.options.columns=[]}if(!this.options.features){this.options.features=[]}if(this._isMultiColumnHeader()===true){this._isMultiColumnGrid=true;this._generateColumnFlatStructure(this.options.columns);this._headerCells=[]}if(this.options.rowVirtualization===true&&this.options.virtualizationMode==="continuous"){this.options.virtualization=true}if(this.options.columnVirtualization===true){this.options.virtualization=true;if(this.options.virtualizationMode==="continuous"){throw new Error(this._getLocaleValue("colVirtualizationDenied"))}this.options.virtualizationMode="fixed"}else if(this.options.virtualization&&this.options.virtualizationMode==="continuous"){this.options.rowVirtualization=true}if(this.options.virtualization===true||this.options.columnVirtualization===true||this.options.rowVirtualization===true){if(this.options.virtualizationMode===undefined||this.options.virtualizationMode===""){this.options.virtualizationMode="fixed"}if(this.options.virtualizationMode==="fixed"){this.options.fixedHeaders=true;this.options.fixedFooters=true}}if(this.options.virtualization===true||this.options.rowVirtualization===true){if(this.options.defaultColumnWidth==="*"){throw new Error(this._getLocaleValue("virtualizationNotSupportedWithAutoSizeCols"))}for(i=0;i<this.options.columns.length;i++){if(this.options.columns[i].width==="*"){throw new Error(this._getLocaleValue("virtualizationNotSupportedWithAutoSizeCols"))}}}if(this.options.virtualization===true&&this.options.virtualizationMode==="continuous"){this.options.fixedHeaders=true}if((this.options.height===null||parseInt(this.options.height,10)<=0)&&this.options.fixedHeaders===true){this.options.fixedHeaders=false}if((this.options.height===null||parseInt(this.options.height,10)<=0)&&this.options.fixedFooters===true){this.options.fixedFooters=false}this._analyzeMultiRowLayout();this.dataBind(true);this.element.bind(this._mouseClickEventHandlers);if(this.options.enableResizeContainerCheck&&(this.options.height!==null&&this.options.height.indexOf&&this.options.height.indexOf("%")!==-1||this.options.width!==null&&this.options.width.indexOf&&this.options.width.indexOf("%")!==-1||!this.element.is(":visible"))){if(!this.element.is(":visible")){this._recheckVisibility=true}if($.ig.util.isIE){container=this.container();if(container.length>0&&container[0].attachEvent){this._resizeContainerHandler=$.proxy(this.resizeContainer,this);container[0].attachEvent("onresize",this._resizeContainerHandler)}}if(!this._resizeContainerHandler){this._resId=setInterval($.proxy(this.resizeContainer,this),this.resizeTimeout)}}for(i=0;i<this.options.columns.length;i++){if(this.options.columns[i].hidden===undefined){this.options.columns[i].hidden=false}}this._uiSoftDirtyHandler=$.proxy(this._onFeaturesSoftDirty,this);this.element.bind("iggriduisoftdirty",this._uiSoftDirtyHandler);this._oldScrollTop=0;this.element.trigger(this.events.created,{owner:this});if(this._rtl){this.container().addClass(this.css.rtl)}},_getSortingExpressionsManager:function(){if(this._seMngr){return this._seMngr}this._seMngr=new $.ig.SortingExpressionsManager({grid:this});return this._seMngr},_fixPKValue:function(val){var col,data,pk=this.options.primaryKey;if(_aNull(val)){return null}if(pk){col=this.columnByKey(pk);if(col&&col.dataType){if(col.dataType==="number"||col.dataType==="numeric"){val=parseInt(val,10)}}else{data=this.dataSource._data;if(data&&data.length>0){if(typeof data[0][pk]==="number"){val=parseInt(val,10)}}}}else{data=this.dataSource._data;if(data&&data.length>0){if(typeof data[0].ig_pk==="number"){val=parseInt(val,10)}}}return val},hasFixedDataSkippedColumns:function(){return!!this._hasFixedDataSkippedColumns},hasFixedColumns:function(){return this._hasFixedColumns},fixingDirection:function(){return this._fixingDirection},isFixedColumn:function(colKey){var isFixed=false,typeColKey=$.type(colKey),cols;if(!this.hasFixedColumns()){return false}if(typeColKey==="string"){$.each(this._fixedColumns,function(ind,c){if(c.key===colKey){isFixed=true;return false}})}else if(typeColKey==="number"){cols=this._visibleColumns();if(colKey<0||colKey>=cols.length){return false}isFixed=cols[colKey].fixed===true}return isFixed},_onFixedColumnsChanged:function(obj){this._fireInternalEvent("_fixedColumnsChanged",obj)},_onGroupedColumnsChanging:function(groupedColumns){this._fireInternalEvent("_groupedColumnsChanging",{groupedColumns:groupedColumns})},_onGroupedColumnsChanged:function(groupedColumns){this._fireInternalEvent("_groupedColumnsChanged",{groupedColumns:groupedColumns})},_testInnerHtml:function(){var t=document.createElement("table");try{t.innerHTML="<tr><td> t </td></tr>";this._canreplaceinner=true}catch(e){this._canreplaceinner=false}},resizeContainer:function(){var scrollContainerWidth,o=this.options,visibilityChanged=false,v=o.virtualization===true||o.rowVirtualization===true||o.columnVirtualization===true;if(this._recheckVisibility&&this.element.is(":visible")){this._prevContainerHeight=0;visibilityChanged=true;this._recheckVisibility=false;if(this._resId&&!(this.options.height!==null&&this.options.height.indexOf&&this.options.height.indexOf("%")!==-1||this.options.width!==null&&this.options.width.indexOf&&this.options.width.indexOf("%")!==-1)){clearInterval(this._resId)}}if(o.autoAdjustHeight&&this.container().height()!==this._prevContainerHeight){this._initializeHeights();if(v&&visibilityChanged){this._avgRowHeight=null;if(!this.container().find("#"+this.id()+" > tbody > tr:not([data-container]):visible:first").length){delete this._virtualDom;this._renderVirtualRecords()}this._updateVirtualScrollContainer();this._onVirtualVerticalScroll()}}if(o.width!==null&&o.height!==null){if(v===false){scrollContainerWidth=this.scrollContainer().width()}else{scrollContainerWidth=this._vdisplaycontainer().width()+this._scrollbarWidth()}if(!scrollContainerWidth){return}if(this._gridInnerWidth!==scrollContainerWidth&&(this._gridInnerWidth>0||scrollContainerWidth>0)){this._gridInnerWidth=scrollContainerWidth;this._updateHScrollbarVisibility()}if(v===false&&this.scrollContainer().get(0).scrollHeight>this.scrollContainer().get(0).clientHeight!==this._hasVerticalScrollbar){this._adjustLastColumnWidth()}}},_isMultiColumnHeader:function(){var cols=this.options.columns,i;for(i=0;i<cols.length;i++){if(cols[i].group!==undefined&&cols[i].group!==null){return true}}return false},isGroupHeader:function(colKey){if(this._isMultiColumnGrid&&!this.columnByKey(colKey)){return true}return false},_analyzeColumnByKey:function(key){if(_aNull(key)){return null}var res,isGroupHeader=this.isGroupHeader(key),children=isGroupHeader?this._getMultiHeaderColumnById(key).children:[this.columnByKey(key)],colInfo=this._getColumnInfo(children[0].key,this.options.columns),colMCHInfo=this._isMultiColumnGrid?this._getColumnInfo(key):null;res={key:key,vIndex:this.getVisibleIndexByKey(children[0].key,true),vIndexNonDataCols:this.getVisibleIndexByKey(children[0].key,false),dIndex:colInfo.index,children:children,colObj:colInfo.column};if(colMCHInfo){res=$.extend(res,{dMCHIndex:colMCHInfo.index,colMCHObj:colMCHInfo.column,isGroupHeader:isGroupHeader})}return res},_analyzeColumnMovingObjects:function(colKey,targetKey,after,isToFix){var isMCH=this._isMultiColumnGrid,i,fCols,cols=this.options.columns,hiddenAndFixedColumns,at={dIndex:-1,dMCHIndex:-1,vIndex:-1},fdLeft=this.fixingDirection()==="left",target=this._analyzeColumnByKey(targetKey),resObj={from:this._analyzeColumnByKey(colKey),at:at,target:target};if(target){at.dIndex=after?target.dIndex+target.children.length:target.dIndex;at.vIndex=after?target.vIndex+target.children.length:target.dIndex;if(isMCH){at.dMCHIndex=after?target.dMCHIndex+1:target.dMCHIndex}}else{hiddenAndFixedColumns=cols.filter(function(col){return col.hidden&&col.fixed})||[];fCols=this._fixedColumns||[];if(isToFix){at.dIndex=fdLeft?fCols.length+hiddenAndFixedColumns.length:cols.length;at.vIndex=this.getVisibleIndexByKey(cols[at.dIndex],true);if(isMCH){for(i=0;i<this._oldCols.length;i++){at.dMCHIndex=i;if(!this._oldCols[i].fixed&&fdLeft||this._oldCols[i].fixed&&!fdLeft){at.dMCHIndex=i;break}}at.dMCHIndex=fdLeft?at.dMCHIndex:at.dMCHIndex+1}}else{at.dIndex=fdLeft?fCols.length-resObj.from.children.length-1:0;at.vIndex=this.getVisibleIndexByKey(cols[at.dIndex],true);if(isMCH){for(i=0;i<this._oldCols.length;i++){if(!this._oldCols[i].fixed&&fdLeft||this._oldCols[i].fixed&&!fdLeft){at.dMCHIndex=i-1;break}}}}}return resObj},_analyzeMultiColumnHeaders:function(cols,newCols,level,oldCols,children,isHidden){var i,j,res,colsLength=cols.length,colspan=0,ind=[],groupChildren=[],identifier,hidden;for(i=0;i<colsLength;i++){if(cols[i].group!==undefined&&cols[i].group!==null){if(cols[i].key!==undefined&&cols[i].key!==null){identifier=cols[i].key.toString()}else{identifier=(this._multiColumnIdentifier++).toString()}if(!cols[i].identifier){cols[i].identifier=identifier}groupChildren=[];hidden=false;if(isHidden===true||cols[i].hidden===true){hidden=true}res=this._analyzeMultiColumnHeaders(cols[i].group,newCols,level+1,oldCols[i].group,groupChildren,hidden);oldCols[i].colspan=res.colspan;oldCols[i].children=groupChildren;for(j=0;j<groupChildren.length;j++){children.push(groupChildren[j])}ind.push(i);colspan+=res.colspan}else{colspan++;oldCols[i].level=0;oldCols[i].level0=true;if(isHidden===true){cols[i].hidden=true}children.push(cols[i]);newCols.push(cols[i])}}for(j=0;j<ind.length;j++){oldCols[ind[j]].level=this._maxLevel-level}return{colspan:colspan}},_analyzeMultiRowLayout:function(){var i,j,k,cols=this.options.columns,ri,ci,col,t,res,hasWidths=false,nv,ni;if(!cols.length){return}for(i=0;i<cols.length;i++){ri=cols[i].rowIndex;ci=cols[i].columnIndex;if(ci===null||ri===null||isNaN(ri-0)||isNaN(ci-0)){return}}this._rlm=[];for(i=0;i<cols.length;i++){this._addColumnToLayout(cols[i]);if(cols[i].width){hasWidths=true}}this._mrl=$.extend(true,[],this._rlm);t=this._mrl;for(i=0;i<t.length;i++){for(j=0;j<t[i].length;j++){if(!t[i][j]){throw new Error(this._getLocaleValue("multiRowLayoutNotComplete"))}}}if(hasWidths){this._analyzeMCLWidths()}this._rlp=[];for(i=0;i<t.length;i++){this._rlp.push([]);for(j=0;j<t[i].length;j++){if(t[i][j]&&$.type(t[i][j])==="string"){col=this.columnByKey(t[i][j]);res=this._getSizeOfMultiSpanCol(i,j,t);this._rlp[i].push({col:col,rs:res.rs,cs:res.cs})}}}this._maxCols=this._rlm[0].length;nv=Array.apply(null,new Array(cols.length)).map(function(){return null});for(i=0;i<this._rlp.length;i++){for(j=0;j<this._rlp[i].length;j++){ni=this._rlp[i][j].col.navigationIndex;if($.type(ni)==="number"&&ni<nv.length&&ni>=0){if(!nv[ni]){nv[ni]=1}else{delete this._rlp[i][j].col.navigationIndex}}}}k=0;for(i=0;i<this._rlp.length;i++){for(j=0;j<this._rlp[i].length;j++){ni=this._rlp[i][j].col.navigationIndex;if($.type(ni)!=="number"||!nv[ni]){while(nv[k]&&k<nv.length){k++}this._rlp[i][j].col.navigationIndex=k++}}}},_analyzeMCLWidths:function(){var t=this._rlm,i,j,col,colKey,minColSpan,colSpan,isPercentage=false;this._colGroupWidths=[];isPercentage=this._checkForPercentageWidths();for(i=0;i<t.length;i++){for(j=0;j<t[i].length;j++){colKey=t[i][j];col=this.columnByKey(colKey);if(col.width===undefined){col.width=this._resolveWidth(col)}colSpan=col.colSpan?col.colSpan:1;if(colSpan===1){this._colGroupWidths[col.columnIndex]=col.width}}}if(isPercentage){$(this.options.columns).each(function(){if(this.width&&(typeof this.width!=="string"||!this.width.contains("%"))){this.width=parseInt(this.width)+"%"}})}for(j=0;j<t[0].length;j++){if(!this._colGroupWidths[j]){for(i=0;i<t.length;i++){col=this.columnByKey(t[i][j]);if(col.width&&(minColSpan===undefined||minColSpan<col.colSpan)){this._colGroupWidths[j]=parseInt(col.width)/col.colSpan}}}if(isPercentage&&this._colGroupWidths[j]&&(typeof this._colGroupWidths[j]!=="string"||!this._colGroupWidths[j].contains("%"))){this._colGroupWidths[j]=parseInt(this._colGroupWidths[j])+"%"}}},_checkForPercentageWidths:function(){var isPercentage=false,isPixels=false;$(this.options.columns).each(function(){if(this.width){if(typeof this.width==="string"&&this.width.contains("%")){isPercentage=true}else if(this.width&&typeof this.width==="number"||this.width.contains("px")){isPixels=true}}});if(isPixels&&isPercentage){throw new Error(this._getLocaleValue("multiRowLayoutMixedWidths"))}return isPercentage},_resolveWidthMultiCol:function(col,resolveCol){var subCol,subColsWidths=[],currCol,t=this._rlm,sum,cInd,rInd,ind,nullWidths,currSum,nullInd;for(cInd=0;cInd<col.colSpan;cInd++){for(rInd=0;rInd<t.length;rInd++){if(rInd===col.rowIndex){continue}currCol=this.columnByKey(t[rInd][col.columnIndex+cInd]);if(!currCol.width||resolveCol===currCol.key){continue}if(this._colGroupWidths[col.columnIndex+cInd]){subColsWidths[cInd]=this._colGroupWidths[col.columnIndex+cInd]}else{if(currCol.colSpan===1){subColsWidths[cInd]=parseInt(currCol.width);this._colGroupWidths[col.columnIndex+cInd]=subColsWidths[cInd];break}sum=0;for(ind=currCol.columnIndex;ind<currCol.columnIndex+currCol.colSpan;ind++){if(ind===col.columnIndex+cInd){continue}subCol={key:currCol.key+ind,rowIndex:currCol.rowIndex,columnIndex:ind,colSpan:1};subCol.width=this._resolveWidth(subCol,col.key);if(subCol.width){sum+=parseInt(subCol.width)}else{sum=0;subColsWidths[cInd]=null;break}}if(sum>0){this._colGroupWidths[col.columnIndex+cInd]=parseInt(currCol.width)-sum;subColsWidths[cInd]=this._colGroupWidths[col.columnIndex+cInd]}else{subColsWidths[cInd]=null}}}if(subColsWidths[cInd]===undefined){subColsWidths[cInd]=null}}nullWidths=$(subColsWidths).filter(function(index){return subColsWidths[index]===null||subColsWidths[index]===undefined});if(nullWidths.length===1){currSum=0;$(subColsWidths).each(function(index){if(subColsWidths[index]!==undefined&&subColsWidths[index]!==null){currSum+=parseInt(subColsWidths[index])}else{nullInd=index}});subColsWidths[nullInd]=parseInt(col.width)-currSum;this._colGroupWidths[col.columnIndex+nullInd]=subColsWidths[nullInd]}return subColsWidths},_resolveWidth:function(col,resolveCol){var t=this._rlm,colSpan=col.colSpan===undefined||col.colSpan===null?1:col.colSpan,columnIndex=col.columnIndex,rowIndex=col.rowIndex,rInd=0,cInd=0,currWidth,sum,subPartsCount=0,currCol,relColumn,commonPart,width=null;if(col.width!==undefined){return col.width}if(col.colSpan===1&&this._colGroupWidths[col.columnIndex]){return this._colGroupWidths[col.columnIndex]}for(rInd=0;rInd<t.length;rInd++){if(rInd===rowIndex){continue}currCol=this.columnByKey(t[rInd][columnIndex]);currCol.colSpan=currCol.colSpan===undefined||currCol.colSpan===null?1:currCol.colSpan;if(!currCol.width||resolveCol===currCol.key){continue}commonPart=this._getCommonColIndexes(col,currCol);if(currCol.colSpan===colSpan&&commonPart.length===currCol.colSpan){width=currCol.width;break}else if(commonPart.length<currCol.colSpan&&commonPart.length===colSpan){sum=0;for(cInd=currCol.columnIndex;cInd<currCol.columnIndex+currCol.colSpan;cInd++){if(t[rowIndex][cInd]!==col.key){relColumn=this.columnByKey(t[rowIndex][cInd]);relColumn.colSpan=relColumn.colSpan===undefined||relColumn.colSpan===null?1:relColumn.colSpan;currWidth=relColumn.width;if(!currWidth){if(resolveCol===relColumn.key){return null}currWidth=this._resolveWidth(relColumn,col.key);if(!currWidth){return null}relColumn.width=currWidth}if(relColumn.colSpan){cInd+=relColumn.colSpan-1}commonPart=this._getCommonColIndexes(currCol,relColumn);if(commonPart.length!==relColumn.colSpan&&commonPart.length>0){currWidth=this._calcCommonPartSum(relColumn,commonPart,resolveCol);if(!currWidth){return null}subPartsCount+=this._getCommonColIndexes(col,currCol).length}else{subPartsCount+=this._getCommonColIndexes(col,currCol).length}if(!currWidth){break}sum+=parseInt(currWidth,10)}}if(sum!==0&&subPartsCount===currCol.colSpan-commonPart.length){width=parseInt(currCol.width)-sum;break}}else if(commonPart.length<colSpan&&currCol.colSpan===commonPart.length){sum=0;subPartsCount=0;for(cInd=col.columnIndex;cInd<col.columnIndex+col.colSpan;cInd++){relColumn=this.columnByKey(t[currCol.rowIndex][cInd]);relColumn.colSpan=relColumn.colSpan===undefined||relColumn.colSpan===null?1:relColumn.colSpan;currWidth=relColumn.width;if(!currWidth){currWidth=this._resolveWidth(relColumn,col.key);if(!currWidth){continue}relColumn.width=currWidth}if(relColumn.colSpan){cInd+=relColumn.colSpan-1}commonPart=this._getCommonColIndexes(col,relColumn);if(commonPart.length!==relColumn.colSpan&&commonPart.length>0){if(resolveCol!==currCol.key&&resolveCol!==relColumn.key){currWidth=this._calcCommonPartSum(relColumn,commonPart,resolveCol);if(!currWidth){break}subPartsCount+=commonPart.length}else{break}}else{subPartsCount+=relColumn.colSpan}if(!currWidth){break}sum+=parseInt(currWidth,10)}if(sum!==0&&subPartsCount===colSpan){width=sum;break}}else if(commonPart.length<colSpan&&commonPart.length<currCol.colSpan){subPartsCount=0;sum=this._calcCommonPartSum(currCol,commonPart,resolveCol);if(!sum){return null}subPartsCount+=commonPart.length;for(cInd=col.columnIndex;cInd<col.columnIndex+col.colSpan;cInd++){relColumn=this.columnByKey(t[currCol.rowIndex][cInd]);relColumn.colSpan=relColumn.colSpan===undefined||relColumn.colSpan===null?1:relColumn.colSpan;if(relColumn.key===currCol.key){continue}currWidth=relColumn.width;if(!currWidth){currWidth=this._resolveWidth(relColumn,col.key);if(!currWidth){continue}relColumn.width=currWidth}commonPart=this._getCommonColIndexes(col,relColumn);if(commonPart.length!==relColumn.colSpan&&commonPart.length>0){if(resolveCol!==currCol.key&&resolveCol!==relColumn.key){currWidth=this._calcCommonPartSum(relColumn,commonPart,resolveCol);if(currWidth===null){return null}subPartsCount+=commonPart.length}else{break}}else{subPartsCount+=relColumn.colSpan}if(!currWidth){break}sum+=parseInt(currWidth,10);if(sum!==0&&subPartsCount===colSpan){width=sum;break}}}}return width},_getCommonColIndexes:function(col1,col2){var t=this._rlm,indexes=[],i;if(col1.colSpan===1&&t[col2.rowIndex][col1.columnIndex]===col2.key){indexes[0]=col1.columnIndex;return indexes}for(i=0;i<t[col1.rowIndex].length;i++){if(t[col1.rowIndex][i]===col1.key&&t[col2.rowIndex][i]===col2.key){indexes.push(i)}}return indexes},_calcCommonPartSum:function(relColumn,commonPart,resolveCol){var currSum=0,ind,w,hasNulls=false,widthDistribution=this._resolveWidthMultiCol(relColumn,resolveCol);if(widthDistribution.length!==relColumn.colSpan){return null}for(ind=0;ind<commonPart.length;ind++){w=widthDistribution[commonPart[ind]-relColumn.columnIndex];if(w){currSum+=parseInt(w,10)}else{currSum=0;hasNulls=true;break}}if(hasNulls){currSum=0;for(ind=0;ind<widthDistribution.length;ind++){if(!commonPart.contains(ind+relColumn.columnIndex)){currSum+=widthDistribution[ind]}}if(currSum){currSum=relColumn.width-currSum}}return currSum},_addColumnToLayout:function(col){var t=this._rlm,x,y,colLen,totalWidth,totalHeight,colSpan,rowSpan;colLen=t.length?t[0].length:0;colSpan=col.colSpan?col.colSpan:1;rowSpan=col.rowSpan?col.rowSpan:1;totalWidth=col.columnIndex+colSpan-1;totalHeight=col.rowIndex+rowSpan-1;if(totalHeight>=t.length){x=t.length-1;while(++x<=totalHeight){t.push(Array.apply(null,new Array(colLen)).map(function(){
return null}))}}if(totalWidth>=colLen){for(x=0;x<t.length;x++){for(y=colLen;y<=totalWidth;y++){t[x].push(null)}}}for(x=col.rowIndex;x<=totalHeight;x++){for(y=col.columnIndex;y<=totalWidth;y++){if(t[x][y]){throw new Error(this._getLocaleValue("multiRowLayoutColumnError").replace("{key1}",col.key).replace("{key2}",t[x][y]))}t[x][y]=col.key}}return true},_isMultiRowGrid:function(){return!!this._rlm},_multiRowLayoutRenderingHelper:function(fixed){return this._rlp},getElementInfo:function(elem){var column=null,rowId=null,rowIndex=null,recordIndex=null;if(!(elem instanceof $)){elem=$(elem)}if(elem.is("td")){column=this.getColumnByTD(elem).column;rowIndex=elem.parent("tr").index()+(this._startRowIndex||0);recordIndex=parseInt(rowIndex/this._recordVerticalSize(),10);if(this.options.primaryKey){rowId=this.dataSource.getCellValue(this.options.primaryKey,this._getDataView()[recordIndex])}}else if(elem.is("tr")){rowIndex=elem.index()+(this._startRowIndex||0)-elem.prevAll("[data-container='true']").length;recordIndex=parseInt(rowIndex/this._recordVerticalSize(),10);if(this.options.primaryKey){rowId=this.dataSource.getCellValue(this.options.primaryKey,this._getDataView()[recordIndex])}}return{column:column,rowId:rowId,rowIndex:rowIndex,recordIndex:recordIndex}},_recordHorizontalSize:function(){return this._rlm&&this._rlm.length?this._rlm[0].length:this._visibleColumns().length},_recordVerticalSize:function(){return this._rlm?this._rlm.length:1},_getRowsByRecordIndex:function(recIndex){var rows=[],i,tbody=this.element.find("tbody")[0];for(i=0;i<this._recordVerticalSize();i++){rows.push(tbody.rows[recIndex*this._recordVerticalSize()+i])}return $(rows)},_getSizeOfMultiSpanCol:function(x,y,rlm){var w=1,h=1,i=x+1,j=y+1,t=rlm,key=t[x][y];while(j<t[x].length&&t[x][j]===key){t[x][j]=-1;w++;j++}while(i<t.length&&t[i][y]===key){t[i][y]=-1;h++;i++}for(i=x+1;i<x+h;i++){for(j=y+1;j<y+w;j++){t[i][j]=-1}}return{cs:w,rs:h}},_getMultiHeaderColumnById:function(id,level,cols){var i,colsLength,res=null;if(cols===null||cols===undefined){if(this._oldCols===null||this._oldCols===undefined){return null}cols=this._oldCols}colsLength=cols.length;for(i=0;i<colsLength;i++){if(cols[i].identifier===id&&(level===undefined||cols[i].level===level)){return cols[i]}if(cols[i].group!==null&&cols[i].group!==undefined){res=this._getMultiHeaderColumnById(id,level,cols[i].group);if(res!==null){return res}}}return null},_getMaxLevelRecursive:function(level,cols){var i,colsLength=cols.length,ml=level,l,rowspan;for(i=0;i<colsLength;i++){rowspan=cols[i].rowspan||cols[i].rowSpan||1;if(cols[i].group!==undefined&&cols[i].group!==null){l=this._getMaxLevelRecursive(level+rowspan,cols[i].group);if(l>ml){ml=l}}else if(rowspan>0){l=level+rowspan-1;if(l>ml){ml=l}}}return ml},_headerInit:function(tr,colgroup,prepend){var i;for(i=0;i<this._headerInitCallbacks.length;i++){this._headerInitCallbacks[i].func(tr,colgroup,prepend)}},_footerInit:function(tr,colgroup,prepend,cssClass){var i;for(i=0;i<this._footerInitCallbacks.length;i++){this._footerInitCallbacks[i].func(tr,colgroup,prepend,cssClass)}},id:function(){return this.element[0].id},_caption:function(){if(!this._captionContainer||this._captionContainer.length===0){this._captionContainer=this.container().find("#"+this.id()+"_caption")}return this._captionContainer},_rootContainer:function(){var rootElement;if(!this._rContainer||this._rContainer.length===0){rootElement=this.element.closest(".ui-iggrid-root");this._rContainer=rootElement.length===1?rootElement.data("igGrid").container():this.container()}return this._rContainer},container:function(){if(!this._container||this._container.length===0){this._container=this.element.closest("div[id="+this.id()+"_container]")}return this._container},headersTable:function(){if(this.options.fixedHeaders===true&&this.options.height!==null){return this.container().find("#"+this.id()+"_headers")}return this.element},footersTable:function(){if(this.options.fixedFooters===true&&this.options.height!==null){return this.container().find("#"+this.id()+"_footers")}return this.element},scrollContainer:function(){return this.container().children("#"+this.id()+"_scroll")},fixedContainer:function(){return this.container().find("#"+this.id()+"_mainFixedContainer")},fixedBodyContainer:function(){return this.container().find("#"+this.id()+"_fixedBodyContainer")},fixedFooterContainer:function(){return this.container().find("#"+this.id()+"_fixedFooterContainer")},fixedHeaderContainer:function(){return this.container().find("#"+this.id()+"_fixedHeaderContainer")},fixedHeadersTable:function(){if(this.options.fixedHeaders===true&&this.options.height!==null){return this.container().find("#"+this.id()+"_headers_fixed")}return this.container().find("#"+this.id()+"_fixed")},fixedFootersTable:function(){if(this.options.fixedFooters===true&&this.options.height!==null){return this.container().find("#"+this.id()+"_footers_fixed")}return this.container().find("#"+this.id()+"_fixed")},_vdisplaycontainer:function(){return this.container().find("#"+this.id()+"_displayContainer")},_virtualcontainer:function(){return this.container().find("#"+this.id()+"_virtualContainer")},_vhorizontalcontainer:function(){return this.container().find("#"+this.id()+"_horizontalScrollContainer")},_fixedfooters:function(){return this.container().find("#"+this.id()+"_footer_container")},cellAt:function(x,y,isFixed){var i,row,colKey,recDataIndex;if(x===undefined||y===undefined){return null}if(this.table===undefined){this.table=this.element[0]}if(this._isMultiRowGrid()){colKey=this._rlm[y%this._recordVerticalSize()][x];recDataIndex=parseInt(y/this._recordVerticalSize(),10);return this._getCellsByColKey(this._getRowsByRecordIndex(recDataIndex),colKey)[0]}i=this._dataRowIndex(y);if(isFixed===true){if(this._fixedTable===undefined){this._fixedTable=this.element}return this._fixedTable[0].rows[i].cells[x]}row=this.table.rows[i];if(!row){return null}return row.cells[x]},cellById:function(rowId,columnKey){var colIndex,i,rows,isFixed=this.isFixedColumn(columnKey);if(_aNull(rowId)||_aNull(columnKey)){return null}if(this.table===undefined){this.table=this.element[0]}if(isFixed){rows=this.fixedBodyContainer().find("tbody").first().children("[data-id='"+rowId+"']")}else{rows=this.element.children("tbody").children("[data-id='"+rowId+"']")}return this._getCellsByColKey(rows,columnKey)},_getCellsByColKey:function(container,colKey){return container.find("td[aria-describedby~='"+this.id()+"_"+colKey+"']")},fixedTable:function(){if(this._fixedTable===undefined){this._fixedTable=this.element}return this._fixedTable},_calculateHeaderFooterRows:function(){var theadCount=0,tfootCount=0;theadCount=this.element.children("thead").children("tr").length;if($.ig.util.isOpera){tfootCount=this.element.children("tfoot").children("tr").length}return theadCount+tfootCount},_dataRowIndex:function(i){var extrahr,j;if(this.table===undefined){this.table=this.element[0]}if(this._additionalTrCount===undefined||this._additionalTrCount===null){this._additionalTrCount=this._calculateHeaderFooterRows()}if(this._hc===true){extrahr=this.element.children("tbody").children("tr[data-container]");for(j=0;j<extrahr.length;j++){if($(extrahr[j]).index()<=i){i+=1}}}i=i+this._additionalTrCount;if(i>=this.table.rows.length){i=this.table.rows.length-1}else if(i<0){i=0}return i},immediateChildrenWidgets:function(){return this.element.children("tbody").children("tr").children(".ui-iggrid-childarea").children("div").children("div").map(function(){if($(this).children(".ui-iggrid-scrolldiv").length>0){return $(this).children(".ui-iggrid-scrolldiv").children(".ui-iggrid-table").data("igGrid")}return $(this).children(".ui-iggrid-table").data("igGrid")})},childrenWidgets:function(){return this.element.find("tbody > tr > .ui-iggrid-childarea").find(".ui-iggrid-table").map(function(){return $(this).data("igGrid")})},children:function(){return this.element.find("tbody > tr > .ui-iggrid-childarea").find(".ui-iggrid-table")},immediateChildren:function(){return this.element.children("tbody").children("tr").children(".ui-iggrid-childarea").children("div").children("div").map(function(){if($(this).children(".ui-iggrid-scrolldiv").length>0){return $(this).children(".ui-iggrid-scrolldiv").children(".ui-iggrid-table")}return $(this).children(".ui-iggrid-table")})},rowAt:function(i){i=this._dataRowIndex(i);return this.table.rows[i]},rowById:function(rowId,isFixed){if(_aNull(rowId)){return null}if(isFixed){return this.fixedBodyContainer().find("tbody").first().children("[data-id='"+rowId+"']")}return this.element.children("tbody").children("[data-id='"+rowId+"']")},fixedRowAt:function(i){var rows=this.fixedBodyContainer().find("tbody>tr");if(rows.length>0){return rows[i]}return null},fixedRows:function(){return this.fixedBodyContainer().find("tbody>tr")},rows:function(){return this.element.children("tbody").children("tr")},allFixedRows:function(){return this.fixedBodyContainer().find("tbody tr")},allRows:function(){return this.element.find("tbody tr")},_getColumnInfo:function(id,cols){var aCols=cols||this._oldCols||this.options.columns,i;for(i=0;i<aCols.length;i++){if(aCols[i].key===id||aCols[i].identifier===id){return{column:aCols[i],index:i}}}return null},columnByKey:function(key){var cols=this.options.columns,i;for(i=0;i<cols.length;i++){if(String(cols[i].key)===String(key)){return cols[i]}}return null},columnByText:function(text){var cols=this.options.columns,i;for(i=0;i<cols.length;i++){if(cols[i].headerText===text){return cols[i]}}return null},selectedCells:function(){if(this._selection.settings.owner!==this){return[]}return this._selection.settings.multipleSelection?this._selection.selectedCells():null},selectedRows:function(){if(this._selection.settings.owner!==this){return[]}return this._selection.settings.multipleSelection?this._selection.selectedRows():null},selectedCell:function(){var selectedCells;if(this._selection.settings.owner!==this){return null}selectedCells=this._selection.selectedCells();return this._selection.settings.multipleSelection?null:selectedCells.length===1?selectedCells[0]:null},selectedRow:function(){var selectedRows;if(this._selection.settings.owner!==this){return null}selectedRows=this._selection.selectedRows();return this._selection.settings.multipleSelection?null:selectedRows.length===1?selectedRows[0]:null},activeCell:function(){if(this._selection instanceof $.ig.SelectedRowsCollection){return null}if(this._selection.settings.owner!==this){return null}return this._selection.activeCell()},activeRow:function(){if(this._selection instanceof $.ig.SelectedCellsCollection){return null}if(this._selection.settings.owner!==this){return null}return this._selection.activeRow()},getCellValue:function(rowId,colKey){var id=parseInt(rowId,10),i,cols=this.options.columns,colFound=false,rec,primaryKeyCol,tx;tx=this.dataSource.pendingTransactions();if(this.options.autoCommit===false&&tx.length>0){for(i=0;i<tx.length;i++){if(tx[i].rowId===rowId){if(tx[i].type==="cell"&&tx[i].col===colKey){rec=$.extend(true,{},this.dataSource.findRecordByKey(rowId));rec[colKey]=tx[i].value;return this.dataSource.getCellValue(colKey,rec)}if(tx[i].type==="row"||tx[i].type==="newrow"){return this.dataSource.getCellValue(colKey,tx[i].row)}}}}if($.type(colKey)==="string"){for(i=0;i<cols.length;i++){if(cols[i].key===colKey){colFound=true;break}}if(colFound===false){throw new Error(this._getLocaleValue("noSuchColumnDefined"))}}if(this.options.primaryKey!==null){primaryKeyCol=this.columnByKey(this.options.primaryKey);if(primaryKeyCol.dataType==="number"||primaryKeyCol.dataType==="numeric"){rec=this.dataSource.findRecordByKey(parseInt(rowId,10))}else{rec=this.dataSource.findRecordByKey(rowId)}if(rec===null||rec===undefined){throw new Error(this._getLocaleValue("recordNotFound").replace("{id}",rowId))}return this.dataSource.getCellValue(colKey,rec)}if(id>=this._getDataView().length){throw new Error(this._getLocaleValue("indexOutOfRange").replace("{max}",this._getDataView().length))}if($.type(colKey)==="string"){return this.dataSource.getCellValue(colKey,this._getDataView()[id])}if(cols.length<=colKey){throw new Error(this._getLocaleValue("columnIndexOutOfRange").replace("{max}",cols.length))}return this.dataSource.getCellValue(colKey,this._getDataView()[id])},getCellText:function(rowId,colKey){var colIndex;if($.type(colKey)==="string"){if(this.columnByKey(colKey)===null){throw new Error(this._getLocaleValue("columnNotFound").replace("{key}",colKey))}if(this.options.primaryKey!==null){return this._getCellsByColKey(this.element.find("tr[data-id='"+rowId+"']"),colKey).text()}else{return this._getCellsByColKey(this._getRowsByRecordIndex(rowId),colKey).text()}}else{if(this._isMultiRowGrid()){return null}colIndex=colKey}if(colIndex===undefined){throw new Error(this._getLocaleValue("columnNotFound").replace("{key}",colKey))}if(this.options.primaryKey!==null){return this.element.find("tr[data-id='"+rowId+"']>td:nth-child("+(colIndex+1)+")").text()}return $(this.cellAt(colIndex,parseInt(rowId,10))).text()},setColumnTemplate:function(col,tmpl,render){var colIdx=this._getColIdxById(this.options.columns,col);if(colIdx===null||colIdx===undefined){return}col=this.options.columns[colIdx];col.template=tmpl;render=render===null||render===undefined?true:render;if(render&&!col.hidden){this._renderData()}},commit:function(rowId){var key=this._normalizedKey(rowId),row,idx,oldScrollTop=this._getIgScrollPositionTop(),self=this;this.dataSource.commit(key);if(this._fireInternalEvent("_gridCommit")){return}this._isToSetUnboundColumns=true;if(this.options.virtualization||this.options.rowVirtualization||this.options.columnVirtualization){if(this.options.virtualizationMode==="continuous"){this._renderVirtualRecords()}else{this._buildVirtualDom();this.virtualScrollTo(this._startRowIndex)}}else if(key!==null){row=this.rowById(key);if(row&&row.length){if(row.hasClass(this.css.deletedRecord)){idx=row.index();row.remove();this._reapplyZebraStyle(idx)}else{row.removeClass(this.css.modifiedRecord)}}}else{this._renderData()}this._setIgScrollPositionTop(oldScrollTop)},rollback:function(rowId,updateUI){var key=this._normalizedKey(rowId),transactions=this.dataSource.rollback(key),i,funcUpdateUI,fCols=this.hasFixedColumns(),grid=this;if(updateUI===true){funcUpdateUI=function(transaction,fixed){var $tbl=fixed?grid.fixedTable():grid.element,tr=$tbl.find("tr[data-id='"+transaction.rowId+"']"),content,tridx,rec,td,index,col;switch(transaction.type){case"newrow":tridx=grid.element.children("tbody").children("tr:not([data-container],[data-grouprow],[data-summaryrow])").index(tr);tr.remove();grid._reapplyZebraStyle(tridx);break;case"deleterow":tr.removeClass(grid.css.deletedRecord);break;case"cell":col=grid.columnByKey(transaction.col);tr.removeClass(grid.css.modifiedRecord);td=grid.cellById(transaction.rowId,transaction.col);rec=grid.dataSource.findRecordByKey(transaction.rowId);if(col.template&&col.template.length){content=grid._renderTemplatedCell(rec,col);index=content.indexOf(">");content=content.substring(index+1,content.length);td.html(content)}else{td.html(String(grid._renderCell(rec[transaction.col],col,rec)))}break;case"row":tr.removeClass(grid.css.modifiedRecord);rec=grid.dataSource.findRecordByKey(transaction.rowId);grid._renderRow(rec,tr[0],rec[grid.options.primaryKey]);break}};if(!_aNull(rowId)){if(transactions.length===0){return}i=transactions.length;while(i-- >0){funcUpdateUI(transactions[i]);if(fCols){funcUpdateUI(transactions[i],true)}}this._fireInternalEvent("_rollbackApplied")}else{this.dataBind()}return transactions}},findRecordByKey:function(key){return this.dataSource.findRecordByKey(key)},getDetachedRecord:function(t){return this.dataSource.getDetachedRecord(t)},pendingTransactions:function(){return this.dataSource.pendingTransactions()},allTransactions:function(){return this.dataSource.allTransactions()},transactionsAsString:function(){return this.dataSource.transactionsAsString()},_normalizedKey:function(id){var key,primaryKeyCol;if(id===undefined||id===null){return null}key=id;if(this.options.primaryKey!==null){primaryKeyCol=this.columnByKey(this.options.primaryKey);if(primaryKeyCol.dataType==="number"||primaryKeyCol.dataType==="numeric"){key=parseInt(id,10)}}else{key=parseInt(id,10)}return key},saveChanges:function(success,error){this.dataSource.saveChanges(success,error)},_renderRow:function(rec,tr){var i,td,cols,col,cs,cl,content,cv=this._isColumnVirtualizationEnabled();tr=$(tr);cols=this._visibleColumns();cs=this._startColIndex||0;cl=cv?this._virtualColumnCount+cs:cols.length;for(i=cs;i<cl;i++){col=cols[i];td=this._getCellsByColKey(tr,col.key);if(col.template&&col.template.length){content=this._renderTemplatedCell(rec,col);if(content.indexOf("<td")===0){td.html($(content).html())}else{td.html(content)}}else{td.html(String(this._renderCell(rec[col.key],col,rec)))}}return tr},renderNewRow:function(rec){var tbody=this.element.children("tbody"),index,self=this,virt=this.options.virtualization===true||this.options.rowVirtualization===true,fv=this.options.virtualizationMode==="fixed";if(virt){this._trigger("virtualrendering");if(fv){this._buildVirtualDom()}else{this._renderVirtualRecordsContinuous();this._startRowIndex=0}this.virtualScrollTo(this._totalRowCount)}else{index=tbody.children('[data-container!="true"]').length;MSApp.execUnsafeLocalFunction(function(){if(self._isMultiRowGrid()){tbody.append(self._renderRecordFromLayout(rec,Math.floor(index/self._rlp.length)))}else{tbody.append(self._renderRecord(rec,index))}})}},_findTableRowByKey:function(key){var primaryKeyIndex,cols=this.options.columns,r,i;if(this.options.primaryKey!==null){for(i=0;i<cols.length;i++){if(cols[i].key===this.options.primaryKey){primaryKeyIndex=i;break}}if(primaryKeyIndex===undefined){throw new Error(this._getLocaleValue("columnNotFound").replace("{key}",this.options.primaryKey))}r=this.element.find("td:nth-child('"+(primaryKeyIndex+1)+"'):contains('"+key+"')").parent();return r.length===0?null:r[0]}return this.rowAt(parseInt(key,10))},dataSourceObject:function(dataSource){if(dataSource!==undefined){this.options.dataSource=dataSource}else{return this.options.dataSource}},totalRecordsCount:function(){return this.dataSource.totalRecordsCount()},_wrapElementDiv:function(){this._isWrapped=true;this.element=$("<table role='grid'></table>").appendTo(this.element).attr("id",this.id()+"_table");this.element.data("igGrid",this)},dataBind:function(internal){var dataOptions,i,noCancel=true,noCancelRendering=true,customFunc,dataSource;if(!this._initialized){noCancelRendering=this._trigger(this.events.rendering,null,{owner:this})}if(noCancelRendering){dataOptions=this._generateDataSourceOptions(this.options);dataSource=this._createDataSource(dataOptions);noCancel=this._trigger(this.events.dataBinding,null,{owner:this,dataSource:dataSource});this.requiresDataBinding=internal===undefined?true:this.requiresDataBinding;if(noCancel){if(this.requiresDataBinding){if(this._hasUnboundColumns){this._rebindUnboundColumns=true}this._dataOptions=dataOptions;this.dataSource=dataSource;if(!this._initialized&&this.options.autoGenerateColumns){this.dataSource.settings.localSchemaTransform=false}if(!this._initialized){if(this.element.is("div")){this._wrapElementDiv()}for(i=0;i<this.options.features.length;i++){this._initFeature(this.options.features[i],dataOptions)}if(this.options.autoGenerateColumns!==true){this._captureInitiallyHiddenColumns()}this._visibleColumnsArray=undefined}else{this._isDataBoundCalled=true;this.element.trigger("iggriduidirty",{owner:this});for(i=0;i<this.options.features.length;i++){this._initFeatureSettings(this.options.features[i])}}this._renderGrid();if(this._loadingIndicator===undefined){this._initLoadingIndicator()}if(this._loadingIndicator){this._loadingIndicator.show()}this.dataSource.dataBind();this.requiresDataBinding=false}else{this._renderGrid()}}}else{this._cancelRendering=true}},_mergeUnboundValues:function(){var i,primaryKeyCol,metadataUC,rec,ucLength,primaryKeyColIsNumber,col,schema,type,dataLength,data,key,val,j,pk=this.options.primaryKey,metadata=this.dataSource.metadata("unboundValues"),self=this,hasPrimaryKey=pk!==null&&pk!==undefined,metaDataMergeFunction;if(metadata===undefined||metadata===null||metadata.length===0||!this._unboundColumns){return}if(hasPrimaryKey){metaDataMergeFunction=function(ind,val){if(primaryKeyColIsNumber){rec=self.dataSource.findRecordByKey(parseInt(ind,10))}else{rec=self.dataSource.findRecordByKey(ind)}if(rec===null||rec===undefined){return true}if(schema!==undefined&&schema!==null){val=schema._convertType(type,val,rec[pk],key)}self._addUnboundColumnValue(key,val);rec[key]=val};primaryKeyCol=this.columnByKey(pk);primaryKeyColIsNumber=primaryKeyCol.dataType==="number"}ucLength=this._unboundColumns.length;schema=this.dataSource.schema();for(i=0;i<ucLength;i++){key=this._unboundColumns[i].key;metadataUC=metadata[key];if(metadataUC===null||metadataUC===undefined){continue}col=this.getUnboundColumnByKey(key);type=null;if(col!==null&&col.dataType){type=col.dataType}if(hasPrimaryKey){$.each(metadataUC,metaDataMergeFunction)}else{self._renderUnboundValues(metadataUC,key)}if(type==="bool"||type==="boolean"){data=this.dataSource.data();val=schema._convertType(type,undefined);dataLength=data.length;if(dataLength<=metadataUC.length){continue}for(j=0;j<dataLength;j++){if(data[j][key]===undefined){data[j][key]=val}}}}},_generateDataSourceOptions:function(){var schema,dataOptions,t,headers,i,instanceOfDs;if(!this.options.dataSource&&!this.options.dataSourceUrl&&this.element.is("table")&&this.element.find("tbody").children().length>0){this.options.dataSource=this.element[0]}if(this.options.dataSource){if(this.options.dataSource.tagName&&this.options.dataSource.nodeType){t=$(this.options.dataSource)}else if($.type(this.options.dataSource.type)==="function"&&this.options.dataSource.type()==="htmlTableString"&&$.type(this.options.dataSource.dataSource)==="function"){t=$(this.options.dataSource.dataSource())}if(t&&t.is("table")&&t.find("thead th").length>0){headers=t.find("thead tr th");this._tb_h=true;this._tb_h_arr=[];for(i=0;i<headers.length;i++){this._tb_h_arr.push($(headers[i]).text())}}}instanceOfDs=this.options.dataSource&&typeof this.options.dataSource._xmlToArray==="function"&&typeof this.options.dataSource._encodePkParams==="function";dataOptions={callback:$.proxy(this._renderData,this),callee:this,responseDataKey:this.options.responseDataKey,responseTotalRecCountKey:this.options.responseTotalRecCountKey,dataSource:this.options.dataSource,requestType:instanceOfDs&&this.options.dataSource.settings.requestType?this.options.dataSource.settings.requestType:this.options.requestType,responseContentType:instanceOfDs&&this.options.dataSource.settings.responseContentType?this.options.dataSource.settings.responseContentType:this.options.responseContentType,primaryKey:this.options.primaryKey,localSchemaTransform:this.options.localSchemaTransform,autoCommit:this.options.autoCommit,aggregateTransactions:this.options.aggregateTransactions,serializeTransactionLog:this.options.serializeTransactionLog,updateUrl:this.options.updateUrl,restSettings:this.options.restSettings,enableUTCDates:this.options.enableUTCDates};if(this.options.dataSourceType!==null){dataOptions.type=this.options.dataSourceType}if(!this.options.dataSource||!this.options.dataSource.schema||!this.options.dataSource.schema()||this.options.dataSource.schema()._type!=="xml"){schema=this._generateDataSourceSchema()}if(instanceOfDs&&(this.options.dataSource.settings.schema===null||!this.options.dataSource.settings.schema.fields||this.options.dataSource.settings.schema.fields&&this.options.dataSource.settings.schema.fields.length>=0)||!instanceOfDs){dataOptions=$.extend(dataOptions,{schema:schema})}return dataOptions},_insertUnboundColumn:function(column){if(this._unboundColumns===null||this._unboundColumns===undefined){this._unboundColumns=[]}this._unboundColumns.push(column);if(column.key&&(this._unboundValues[column.key]===null||this._unboundValues[column.key]===undefined)){this._unboundValues[column.key]=[]}if(column.unboundValues&&column.unboundValues.length>0){this._isToSetUnboundColumns=true}this._hasUnboundColumns=true},_addUnboundColumnValue:function(key,value,index){if(this._unboundValues[key]===null||this._unboundValues[key]===undefined){this._unboundValues[key]=[]}if(index!==undefined&&index!==null){this._unboundValues[key][index]=value}else{this._unboundValues[key].push(value)}},_generateDataSourceSchema:function(){var schema,schemaType,dsSchema,i,rec,prop,count=0,cols=this.options.columns,ds=this.options.dataSource,cl,counter=0,colLayoutFilter=function(elem){return elem.key===prop};if(ds&&typeof ds._xmlToArray==="function"&&typeof ds._encodePkParams==="function"){dsSchema=ds.schema();if(dsSchema&&$.type(dsSchema)==="object"&&typeof dsSchema.schema==="object"&&typeof dsSchema.isObjEmpty==="function"&&dsSchema._type){schemaType=dsSchema._type;if(schemaType&&schemaType!==ds.settings.type){ds.settings.type=schemaType}}else{dsSchema=null}if($.type(ds.settings.dataSource)==="array"||$.type(ds.settings.dataSource)==="object"){ds=ds.settings.dataSource}else if($.type(ds.settings.dataSource)!=="string"){ds=ds.data()}else{ds=[]}}if($.type(ds)==="string"&&this.dataSource){ds=this.dataSource.data()}if($.type(ds)==="object"&&this.options.responseDataKey){ds=$.ig.findPath(ds,this.options.responseDataKey)}schema={};schema.fields=[];schema.searchField=this.options.responseDataKey;this._unboundColumns=null;if(cols.length>0){for(i=0;i<cols.length;i++){if(cols[i].unbound===true||cols[i].unboundDS===true){this._insertUnboundColumn(cols[i]);if(cols[i].unbound===true){continue}}schema.fields[counter]={};schema.fields[counter].name=cols[i].key;schema.fields[counter].type=cols[i].dataType;schema.fields[counter].mapper=cols[i].mapper;counter++}cl=this.options.columnLayouts;if(cl&&cl.length&&cl.length>0){for(i=0;i<cl.length;i++){if(cl[i].key===undefined){continue}schema.fields.push({name:cl[i].key})}}}else if(this.options.autoGenerateColumns){if(ds&&ds.tagName&&$(ds).is("table")&&$(ds).find("tbody tr").length>0){rec=$(ds).find("tbody tr")[0];$(rec).find("td").each(function(){if(cols.length>count){schema.fields.push({name:cols[count].key||count+1,type:cols[count].dataType||"string"})}else{schema.fields.push({name:count+1,type:"string"})}count++})}else if(ds&&ds.length&&ds.length>0&&$.type(ds)==="array"){for(i=0;i<ds.length;i++){rec=ds[i];for(prop in rec){if(rec.hasOwnProperty(prop)){if(this.columnByKey(prop)===null&&!this._fieldExists(prop,schema)&&$.type(rec[prop])!=="object"&&$.type(rec[prop])!=="array"){schema.fields.push({name:prop,type:$.ig.getColType(rec[prop])})}else if(this.options.columnLayouts&&this.options.columnLayouts.filter(colLayoutFilter).length>0){schema.fields.push({name:prop})}else if(this.columnByKey(prop)!==null){schema.fields.push({name:prop,type:this.columnByKey(prop).dataType})}count++}}if(!this.options._recurseSchema){break}}}else if(dsSchema&&dsSchema.fields().length){schema.fields=dsSchema.fields()}for(i=0;i<cols.length;i++){if(cols[i].unbound===true||cols[i].unboundDS===true){this._insertUnboundColumn(cols[i])}}}this._trigger(this.events.schemaGenerated,null,{owner:this,schema:schema,dataSource:ds});return schema},_fieldExists:function(prop,schema){var i;for(i=0;i<schema.fields.length;i++){if(schema.fields[i].name===prop){return true}}return false},_createDataSource:function(dataOptions){var callee,dataSource;if(!this.options.dataSource||typeof this.options.dataSource._xmlToArray!=="function"||typeof this.options.dataSource._encodePkParams!=="function"){if($.type(dataOptions.dataSource)==="string"&&(this.options.jsonpRequest||$.ig.util.isJsonpUrl(dataOptions.dataSource))){dataSource=new $.ig.JSONPDataSource(dataOptions)}else if(this.options.restSettings.update.url!==null||this.options.restSettings.update.template!==null||this.options.restSettings.create.url!==null||this.options.restSettings.create.template!==null||this.options.restSettings.remove.url!==null||this.options.restSettings.remove.template!==null){dataSource=new $.ig.RESTDataSource(dataOptions)}else{dataSource=new $.ig.DataSource(dataOptions)}}else{dataSource=this.options.dataSource;if(dataSource.settings.responseDataKey!==null){delete dataOptions.responseDataKey;if(dataOptions.schema){dataOptions.schema.searchField=dataSource.settings.responseDataKey}}if(dataOptions.responseTotalRecCountKey===null&&dataSource.settings.responseTotalRecCountKey!==null){delete dataOptions.responseTotalRecCountKey}this._tds=dataSource.settings.dataSource;dataSource.settings.dataSource=null;if($.ig.util.isIE8&&dataOptions.callee){callee=dataOptions.callee;dataOptions.callee=null}dataSource.settings=$.extend(true,{},dataSource.settings,dataOptions);if($.ig.util.isIE8&&callee){dataSource.settings.callee=callee}dataSource.settings.dataSource=this._tds;this._tds=null;if(dataOptions.schema){dataSource._initSchema()}}if(dataSource&&dataSource.settings){dataSource.settings.key=this.options.key}return dataSource},_generateColumns:function(){var r,key,i,c,cols,hasHeaders=false,len,col,isTable=false,arr=[],ds=this.options.dataSource,cdp=this.options.childrenDataProperty,newDs,colType,dsHtmlTableString=false;if(ds&&typeof ds._xmlToArray==="function"&&typeof ds._encodePkParams==="function"){if(this.options.dataSource.type()==="htmlTableString"&&this.options.autoGenerateColumns){dsHtmlTableString=true}ds=ds.data()}else if(typeof ds==="string"){ds=this.dataSource.data()}if($.type(ds)==="object"&&this.options.responseDataKey){newDs=$.ig.findPath(ds,this.options.responseDataKey);if($.type(newDs)==="array"){ds=newDs}}if(ds&&ds.tagName&&$(ds).is("table")){len=$(ds).find("tbody tr").length;isTable=true}else if(ds&&ds.length){len=ds.length}if(ds&&len&&len===0&&this.options.columns.length===0){throw new Error(this._getLocaleValue("autoGenerateColumnsNoRecords"))}if(ds&&len&&len>0){if(isTable){r=$(ds).find("tbody tr")[0]}else{r=ds[0]}if($.type(r)==="array"||isTable){hasHeaders=this._tb_h;if(isTable){$(r).find("td").each(function(){arr.push($(this).text())});r=arr}for(i=0;i<r.length;i++){if(this.columnByKey(i+1)===null&&$.ig.getColType(r[i])!=="object"){col={headerText:hasHeaders?this._tb_h_arr[i]:this._getLocaleValue("colPrefix")+(i+1),key:String(i+1),dataType:$.ig.getColType(r[i]),hidden:false};if(dsHtmlTableString){col.key=String(i)}col.headerText=(col.headerText||"").toString().trim();if(this._isMultiColumnGrid){col.level0=true;col.level=0;this._oldCols.push(col)}this.options.columns.push(col);this._visibleColumnsArray=undefined}else if(hasHeaders&&!this.columnByKey(i+1).headerText){this.columnByKey(i+1).headerText=this._tb_h_arr[i]}}}else{for(key in r){if(r.hasOwnProperty(key)){c=this.columnByKey(key);if(c===null){colType=$.ig.getColType(r[key]);if((cdp&&cdp!==key||!cdp)&&(colType!=="object"||r[key]===null)&&key!=="ig_pk"){col={headerText:key,key:key,dataType:$.ig.getColType(r[key]),hidden:false};this.options.columns.push(col);if(this._isMultiColumnGrid){col.level0=true;col.level=0;this._oldCols.push(col)}this._visibleColumnsArray=undefined}}else if(c.headerText===undefined){c.headerText=c.key}}}}}else{cols=this.options.columns;for(i=0;i<cols.length;i++){cols[i].headerText=cols[i].headerText===undefined?cols[i].key:cols[i].headerText}}this._trigger("_columnsgenerated",null,{owner:this,key:this.options.key});if(this.dataSource.schema()===null||this.dataSource.schema().fields().length===0||this.dataSource.settings.localSchemaTransform!==this.options.localSchemaTransform){this.dataSource.settings.schema=this._generateDataSourceSchema();this.dataSource._initSchema();this.dataSource.settings.localSchemaTransform=this.options.localSchemaTransform;this.dataSource._applySchema()}if(this.options.width===null){this._setContainerWidth(this.container())}this._trigger("columnsgenerated",null,{owner:this,key:this.options.key})},_renderGrid:function(){var gridElement=this.element[0],containerId,containerDiv,tbody=this.element.children("tbody");this._cancelRendering=false;
if(!this._initialized){this.element.attr("role","grid");if(this.options.virtualization===true||this.options.rowVirtualization===true||this.options.columnVirtualization===true){if(this.options.height===undefined||this.options.height===null){throw new Error(this._getLocaleValue("virtualizationRequiresHeight"))}if(this._isColumnVirtualizationEnabled()&&(this.options.width.indexOf&&this.options.width.indexOf("%")>0)){throw new Error(this._getLocaleValue("columnVirtualizationNotSupportedWithPercentageWidth"))}if(this._isMultiRowGrid()&&(this.options.virtualization===true||this.options.rowVirtualization===true)&&this.options.virtualizationMode!=="continuous"){throw new Error(this._getLocaleValue("featureNotSupportedWithMRL").replace("{featureName}","Fixed Virtualization"))}this._createVirtualGrid()}else if(this.options.height!==null||this.options.width!==null){this._createScrollingGrid()}else{containerId=gridElement.id+"_container";containerDiv='<div id="'+containerId+'" class="'+this.css.gridClasses+" "+this.css.baseClass+'" style="position: relative"> </div>';this.element.wrap(containerDiv);this.element.addClass(this._isMultiRowGrid()?this.css.mrlGridTableClass:this.css.gridTableClass);this.element.attr("aria-describedby",_aNull(this.options.caption)?containerId:this.id()+"_caption");this._setContainerWidth(this.container());this.container().attr("tabIndex",this.options.tabIndex);if(this.options.height!==null){this.container().css("overflow-y","hidden")}}this._touch();if(this.options.columns.length>0&&(this.options.virtualization!==true&&this.options.rowVirtualization!==true&&this.options.columnVirtualization!==true)&&this.options.autogenerateColumns===false&&this.options.columns.length>0){this._renderColgroup(this.element[0],false,false,this.options.autofitLastColumn)}$(gridElement).attr("cellpadding","0");$(gridElement).attr("cellspacing","0");$(gridElement).attr("border","0");$(gridElement).css("table-layout","fixed");$(gridElement).addClass(this._isMultiRowGrid()?this.css.mrlGridTableClass:this.css.gridTableClass);if(this.options.autoGenerateColumns===false&&!this._autoDetectColTypes()&&this.options.columns.length>0&&this._headerRenderCancel!==true){this._renderHeader()}this._renderCaption();if(this.options.autoAdjustHeight){this._initializeHeights()}}if(tbody.length===0){tbody=$('<tbody role="rowgroup"></tbody>').appendTo(gridElement).addClass(this.css.baseContentClass).addClass(this.css.gridTableBodyClass).addClass(this.css.recordClass)}if(this.dataSource.type()!=="htmlTableDom"&&this.dataSource.type()!=="htmlTableId"){tbody.attr("role","rowgroup").empty();if(this.hasFixedColumns()){this.fixedBodyContainer().children("table").children("tbody").attr("role","rowgroup").empty()}}},_autoDetectColTypes:function(){var i,cols=this.options.columns;for(i=0;i<cols.length;i++){if(!cols[i].dataType||cols[i].mapper){return true}}return false},_setContainerWidth:function(element,rendered){var cols=this._visibleColumns(),i,w,width=0,inPerc;if(cols.length>0){inPerc=false;for(i=0;i<cols.length;i++){w=cols[i].width;if(w!==0&&w!=="0"){w=w||this.options.defaultColumnWidth}if(_aNull(w)||w&&w.indexOf&&w.indexOf("%")>0){inPerc=true}else{inPerc=false;break}}if(inPerc){return}this._scrollWidthAddedToContainerWidth=this.hasVerticalScrollbar();width=this._calculateContainerWidth(this._scrollWidthAddedToContainerWidth);if(width>0){if(rendered){width=0;this.container().find(".ui-iggrid-header").each(function(){width+=$(this).outerWidth()});element.width(width)}else{width+=this._calculateSpecialColumnsWidth();element.css("width",width)}}}else if(this.options.width!==null){element.css("width",this.options.width)}},_calculateContainerWidth:function(addScrollWidth){var width=0,cols=this.options.columns,i;for(i=0;i<cols.length;i++){if(cols[i].hidden!==true&&cols[i].fixed!==true&&(this._initialHiddenColumns===undefined||$.inArray(cols[i],this._initialHiddenColumns)===-1)){width+=cols[i].width?parseInt(cols[i].width,10):this.options.defaultColumnWidth===null?0:parseInt(this.options.defaultColumnWidth,10)}}if(this.options.height!==null&&width>0&&addScrollWidth===true){width+=this._scrollbarWidth()}return width},_createScrollingGrid:function(){var self=this,id=this.id()+"_scroll",dataContainer,scrollDiv='<div id="'+id+'"></div>';this.element.wrap(scrollDiv);dataContainer=this.element.parent();this.element.attr("aria-describedby",_aNull(this.options.caption)?id:this.id()+"_caption");dataContainer.addClass(this.css.gridScrollDivClass).wrap('<div id="'+this.id()+'_container"></div>');if($.ig.util.isIE7){dataContainer.css("padding-bottom",this._scrollbarWidth())}this.container().attr("tabIndex",this.options.tabIndex).addClass(this.css.baseClass).addClass(this.css.gridClasses);if(this.options.width!==null){this.container().css("width",this.options.width);if(this.options.width.indexOf&&this.options.width.indexOf("%")!==-1){this.element.css("width","100%")}if(this.options.height!==null){this._addHorizontalScrollBar(dataContainer);this.scrollContainer().css("overflow-x","hidden")}}else{this._setContainerWidth(this.container());this.scrollContainer().css("overflow-x","hidden")}this.container().css("position","relative");if(this.options.height!==null){this.scrollContainer().css("overflow-y","auto");if(this.options.autoAdjustHeight){this.container().css("height",this.options.height)}else{this.scrollContainer().css("height",this.options.height)}}if(this._persistVirtualScrollTop){this.scrollContainer().bind({scroll:function(){self._prevFirstVisibleTROffset=self.scrollContainer().scrollTop()}})}this.scrollContainer().bind({wheel:function(event){self._hscrollbarcontent().scrollLeft(self._hscrollbarcontent().scrollLeft()+event.originalEvent.deltaX)}})},_igScrollCreated:function(evt){var div,id=this.id(),self=this,scrollSettings=this.options.scrollSettings;if(this.options.virtualization===true||this.options.rowVirtualization===true||this.options.columnVirtualization){div=this._vdisplaycontainer();if(!div.data("igScroll")._bMixedEnvironment&&$.ig.util.isTouchDevice()){div.css("overflow","hidden")}div.igScroll("option","scrollOnlyVBar",true);if(this.options.showHeader&&this.headersTable().length){div.igScroll("option","syncedElemsH",[this.headersTable()])}div.igScroll("option","scrollbarV",this._scrollContainer());if(this.options.virtualizationMode==="fixed"&&!this.options.columnVirtualization&&!this.options.virtualization&&this._hscrollbarcontent().length){div.igScroll("option","scrollbarH",this._hscrollbarcontent())}else if(this._vhorizontalcontainer().length){div.igScroll("option","scrollbarH",this._vhorizontalcontainer())}div.data("igScroll")._bMixedEnvironment=true;div.data("igScroll")._content=this._scrollContainer().children(":first-child");div.data("igScroll")._contentX=this.element;div.igScroll("refresh");div.igScroll("option","scrollWidth",this._calculateContainerWidth());if(this.options.columnVirtualization){div.igScroll("option","scrollOnlyHBar",true)}this._enableVirtualTouchScrollbars();div.igScroll("option",scrollSettings);div.on("iggridrendered",function(evt,ui){if(self.id()===ui.owner.id()){self._enableVirtualTouchScrollbars();div.igScroll("option",scrollSettings)}})}else{div=this.scrollContainer();if(!div.data("igScroll")._bMixedEnvironment&&$.ig.util.isTouchDevice()){div.css("overflow","hidden")}div.data("igScroll")._content=this.element;div.igScroll("refresh");div.igScroll("option","scrollOnlyVBar",false);if($(".ui-widget-footer table",this.container()).length>0){div.igScroll("option","syncedElemsH",[$(".ui-widget-footer table",this.container())])}if(this.options.showHeader&&this.options.fixedHeaders&&this.headersTable().length){if($(".ui-widget-footer table",this.container()).length>0){div.igScroll("option","syncedElemsH",[$(".ui-widget-footer table",this.container()),this.headersTable()])}else{div.igScroll("option","syncedElemsH",[this.headersTable()])}}this._enableTouchScrollbars();div.igScroll("option",scrollSettings);div.on("iggridrendered",function(evt,ui){if(self.id()===ui.owner.id()){self._enableTouchScrollbars();div.igScroll("option",scrollSettings)}});this.element.on("iggrid_heightchanged",$.proxy(this._enableTouchScrollbars,this));div.on("iggridrowsrendered",$.proxy(this._enableTouchScrollbars,this))}div.on("igscrollresized",$.proxy(this._igScrollResized,this));div.on("iggriddatarendered",function(){self._refreshIgScrollBars()});evt.stopPropagation()},_igScrollResized:function(){var scrollContainer;if(this.options.virtualization||this.options.rowVirtualization||this.options.columnVirtualization){scrollContainer=this._vdisplaycontainer();scrollContainer.igScroll("refresh");scrollContainer.igScroll("option","scrollWidth",this._calculateContainerWidth())}else{scrollContainer=this.scrollContainer();scrollContainer.igScroll("refresh")}},_enableTouchScrollbars:function(){var div=this.scrollContainer(),scrollbarsWrapper=$("#"+this.element[0].id+"_igscrolls_container",this.container());if(div.data("igScroll")===undefined||!$.ig.util.isTouchDevice()){return}if(!scrollbarsWrapper.length){scrollbarsWrapper=$('<div id="'+this.element[0].id+"_igscrolls_container"+'"/>').css("position","relative").css("height","0px").insertAfter(div);$(".ui-iggrid-pager",this.container()).css("overflow","hidden")}div.igScroll("option","scrollbarType","none");div.igScroll("refresh");div.igScroll("option","scrollbarHParent",scrollbarsWrapper);div.igScroll("option","scrollbarVParent",scrollbarsWrapper);if($.ig.util.isSafari){div.igScroll("option","scrollbarType","custom");if($(".igscroll-vcontainer",this.container()).length>0){$(".igscroll-vcontainer",this.container()).css("top",-div.height()+"px")}}else if($.ig.util.getScrollWidth()===0){div.igScroll("option","scrollbarType","native");if(div.data("igScroll")._vBarContainer){div.data("igScroll")._vBarContainer.css("top",-div.height()+"px").css("height",div.height()+"px").css("z-index",2).attr("touch-bar","true")}if(div.data("igScroll")._hBarContainer){div.data("igScroll")._hBarContainer.css("z-index",2).attr("touch-bar","true")}}if(this.fixedBodyContainer().length){if($(".igscroll-hcontainer",this.container()).length>0&&this.fixingDirection()==="left"){$(".igscroll-hcontainer",this.container()).css("left",this.fixedBodyContainer().width())}else if($(".igscroll-hcontainer",this.container()).length>0&&this.fixingDirection()==="right"){$(".igscroll-hcontainer",this.container()).css("right",this.fixedBodyContainer().width())}if($(".igscroll-hnative-outer",this.container()).length>0&&this.fixingDirection()==="left"){$(".igscroll-hnative-outer",this.container()).css("left",this.fixedBodyContainer().width())}else if($(".igscroll-hnative-outer",this.container()).length>0&&this.fixingDirection()==="right"){$(".igscroll-hnative-outer",this.container()).css("right",this.fixedBodyContainer().width())}}},_refreshIgScrollBars:function(){var $scrollContainer=this.scrollContainer();if(!$scrollContainer.length||$scrollContainer.data("igScroll")===undefined){return}$scrollContainer.igScroll("refresh");if($(".igscroll-vcontainer",this.container())){$(".igscroll-vcontainer",this.container()).css("top",-$scrollContainer.height()+"px")}if($(".igscroll-vnative-outer",this.container())){$(".igscroll-vnative-outer",this.container()).css("top",-$scrollContainer.height()+"px").css("z-index",2)}},_enableVirtualTouchScrollbars:function(){var div=this._vdisplaycontainer(),scrollbarsWrapper,vericalScrollContainer;if($.ig.util.getScrollWidth()===0){scrollbarsWrapper=div.parent().find("."+this.css.gridScrollbarsWrapper);if(scrollbarsWrapper.length){scrollbarsWrapper.remove()}div.parent().css("position","relative");scrollbarsWrapper=$("<div/>").appendTo(div.parent());scrollbarsWrapper.addClass(this.css.gridScrollbarsWrapper).css("position","absolute").css("top","0px").css("bottom","0px").css("left","0px").css("right","0px");div.igScroll("refresh");div.igScroll("option","scrollWidth",this._calculateContainerWidth());div.igScroll("option","scrollbarHParent",scrollbarsWrapper);div.igScroll("option","scrollbarVParent",scrollbarsWrapper);div.igScroll("option","scrollbarType","custom")}},_getIgScrollPositionTop:function(){var sl,scrollTop;if(this.options.virtualization||this.options.rowVirtualization||this.options.columnVirtualization){scrollTop=this._scrollContainer().scrollTop()}else{sl=this.scrollContainer().data("igScroll");scrollTop=sl?sl.option("scrollTop"):this.scrollContainer().scrollTop()}return scrollTop},_setIgScrollPositionTop:function(inScrollTop){var sl;if(this.options.virtualization||this.options.rowVirtualization||this.options.columnVirtualization){sl=this._vdisplaycontainer().data("igScroll")}else{sl=this.scrollContainer().data("igScroll")}if(sl){sl.option("scrollTop",inScrollTop)}},_touch:function(){var id=this.id(),div=this.scrollContainer();if(div.length!==1){div=this._vdisplaycontainer()}if(div.length){div.attr("data-scroll","true").attr("data-oneDirection","true");if(this._hscrollbarcontent()[0]){div.attr("data-xScroller","#"+id+"_hscroller")}else if(this._vhorizontalcontainer()[0]){div.attr("data-xScroller","#"+id+"_horizontalScrollContainer")}if(this._scrollContainer()[0]){div.attr("data-yScroller","#"+id+"_scrollContainer")}div.bind("igscrollrendered",$.proxy(this._igScrollCreated,this));if($.ig.util.isTouchDevice()&&$.ig.util.getScrollWidth()===0&&this.element.igScroll!==undefined){this._scrollbarWidthResolved=0}}},_createVirtualGrid:function(){var id=this.id(),$vCont,evnts,$vDsplCntnr,grid,newW,funcOnScroll,percWidthStr=$.ig.util.isWebKit?"width=100%":"",totalWidth,scrollContainerInner,scrollbarWidth,w=0,virtualGridMarkup='<div id="'+id+'_container" style="margin:0px; border:0px; '+'padding:0px;position:relative;"><table border="0" cellspacing="0" cellpadding="0" '+'class="ui-iggrid-layout-helper" style="border-spacing:0px" id="'+id+'_virtualContainer" ><tbody role="rowgroup"><tr><td colspan="2" '+'style="border-width:0px"><div id="'+id+'_headers_v" '+'style="overflow:hidden;"></div></td></tr><tr><td style="border-width:0px;"><div id="'+id+'_displayContainer"></td>$verticalMarkup$</tr>$horizontalMarkup$</tbody></table></div>',verticalMarkup,horizontalMarkup='<tr><td colspan="2" style="border-width: 0px"><div id="'+id+'_horizontalScrollContainer"></div></td></tr>';scrollbarWidth=this._scrollbarWidth();if($.ig.util.isIE){scrollbarWidth+=1}if(parseInt(this.options.height,10)>0){verticalMarkup='<td style="border-width: 0px;"><div id="'+id+'_scrollContainer" style="overflow:scroll; overflow-x:hidden; width: '+scrollbarWidth+"px; height:"+this.options.height+';"></div></td>'}else{verticalMarkup='<td style="border-width: 0px;"><div id="'+id+'_scrollContainer" style="overflow:scroll; overflow-x:hidden; width: '+scrollbarWidth+'px;"></div></td>'}if(this.options.virtualization===true){virtualGridMarkup=virtualGridMarkup.replace("$verticalMarkup$",verticalMarkup).replace("$horizontalMarkup$",horizontalMarkup)}else if(this.options.rowVirtualization===true){virtualGridMarkup=virtualGridMarkup.replace("$verticalMarkup$",verticalMarkup).replace("$horizontalMarkup$","")}else if(this.options.columnVirtualization===true){virtualGridMarkup=virtualGridMarkup.replace("$horizontalMarkup$",horizontalMarkup).replace("$verticalMarkup$","")}if(this.options.virtualization===true||this.options.columnVirtualization===true){this.element.css("width","100%")}this.element.wrap(virtualGridMarkup);this.container().attr("tabIndex",this.options.tabIndex).addClass(this.css.baseClass).addClass(this.css.gridClasses);if(this.options.width!==null){this.container().width(this.options.width)}else{this._setContainerWidth(this.container())}this._vdisplaycontainer().addClass(this.css.gridScrollDivClass).addClass(this.css.gridVirtualScrollDivClass).append(this.element[0]);grid=this;totalWidth=this._calculateContainerWidth(false);if(this.options.width!==null){w=parseInt(this.options.width,10)}else{w=totalWidth}if(this.options.height!==null&&this.options.width!==null){w-=this._scrollbarWidth()}if(w<=0){w=undefined}if(w>0&&this.options.expandColWidth&&!this.options.width){w+=this.options.expandColWidth}$("<colgroup><col "+(this._gridHasWidthInPercent()?"":w<=0?percWidthStr:'width="'+w+'"')+'></col><col width="'+this._scrollbarWidth()+'"></col></colgroup>').prependTo(this._virtualcontainer());newW=this.options.width;if(newW&&newW.indexOf&&newW.indexOf("%")!==-1){newW="100%"}this._virtualcontainer().css("width",newW).css("max-width",newW);scrollContainerInner='<div style="width:1px; overflow:hidden; height:'+this._totalRowCount*parseInt(this.options.avgRowHeight,10)+'px;"></div>';this._scrollContainer().append(scrollContainerInner);if($.ig.util.isFF&&this.options.virtualizationMode==="fixed"){this._scrollContainer().height(0)}if((this.options.virtualization===true||this.options.rowVirtualization===true)&&this.options.width&&this.options.width.indexOf&&this.options.width.indexOf("%")>0){this._addHorizontalScrollBar(this._virtualcontainer());this._virtualcontainer().css("table-layout","fixed")}else if((this.options.virtualization===true||this.options.columnVirtualization===true)&&this.options.width&&totalWidth>parseInt(this.options.width,10)){this._renderHorizontalScrollContainer(totalWidth)}if(parseInt(this.options.height,10)>0){this._vdisplaycontainer().css("height",this.options.height).css("vertical-align","top")}this._vdisplaycontainer().css("position","relative").css("width",w).css("maxWidth",w);if(this.options.virtualization===true){this.container().find("#"+id+"_headers_v").append('<a href="#" id="'+id+'_displayContainer_a" tabindex="-1" '+'style="position:absolute;top:-100px;left:-100px">&nbsp;</a>')}if(this.options.width&&this.options.virtualization===false&&this.options.columnVirtualization===false){this._vdisplaycontainer().css({"overflow-y":"hidden","overflow-x":"auto"})}else{this._vdisplaycontainer().css("overflow","hidden")}this._vdisplaycontainer().parent().bind({mouseenter:function(){grid._isMouseOverVirtualTable=true},mouseleave:function(){grid._isMouseOverVirtualTable=false}});this._documentEvents={DOMMouseScroll:function(event){var dir="down",delta,step,deltaX,oldScrollX,scrolledX=0,scrolledY=0,avgRowHeight=grid.options.avgRowHeight!==null?parseInt(grid.options.avgRowHeight,10):0;step=grid.options.virtualizationMouseWheelStep===null?avgRowHeight:grid.options.virtualizationMouseWheelStep;delta=-event.originalEvent.detail/3;if(delta>0){dir="up"}if(grid._isMouseOverVirtualTable&&!event.ctrlKey){if(event.originalEvent.axis===2){scrolledY=grid._onVirtualVerticalScroll(event,step,dir)}deltaX=event.originalEvent.offsetX;oldScrollX=grid._vdisplaycontainer().scrollLeft();if(event.originalEvent.axis===1){grid._vdisplaycontainer().scrollLeft(grid._vdisplaycontainer().scrollLeft()-delta)}scrolledX=grid._vdisplaycontainer().scrollLeft()-oldScrollX;if(scrolledY!==0||scrolledX!==0){event.preventDefault()}}},mousewheel:function(event){var dir="down",delta,step,oldScrollX,scrolledX=0,scrolledY=0,avgRowHeight=grid.options.avgRowHeight!==null?parseInt(grid.options.avgRowHeight,10):0;step=grid.options.virtualizationMouseWheelStep===null?avgRowHeight:grid.options.virtualizationMouseWheelStep;delta=(event.originalEvent.wheelDeltaY===undefined?event.originalEvent.wheelDelta:event.originalEvent.wheelDeltaY)/120;if(delta>0){dir="up"}if(grid._isMouseOverVirtualTable&&!event.ctrlKey){if(delta!==0){scrolledY=grid._onVirtualVerticalScroll(event,step,dir)}oldScrollX=grid._vdisplaycontainer().scrollLeft();grid._vdisplaycontainer().scrollLeft(grid._vdisplaycontainer().scrollLeft()-(event.originalEvent.wheelDeltaX||0));scrolledX=grid._vdisplaycontainer().scrollLeft()-oldScrollX;if(scrolledY!==0||scrolledX!==0){event.preventDefault()}}},wheel:function(event){var dir="down",step,delta,oldScrollX,scrolledX=0,scrolledY=0,avgRowHeight=grid.options.avgRowHeight!==null?parseInt(grid.options.avgRowHeight,10):0;step=grid.options.virtualizationMouseWheelStep===null?avgRowHeight:grid.options.virtualizationMouseWheelStep;delta=-event.originalEvent.deltaY;if(delta>0){dir="up"}if(grid._isMouseOverVirtualTable&&!event.ctrlKey){if(delta!==0){scrolledY=grid._onVirtualVerticalScroll(event,step,dir)}oldScrollX=grid._vdisplaycontainer().scrollLeft();grid._vdisplaycontainer().scrollLeft(grid._vdisplaycontainer().scrollLeft()+event.originalEvent.deltaX);scrolledX=grid._vdisplaycontainer().scrollLeft()-oldScrollX;if(scrolledY!==0||scrolledX!==0){event.preventDefault()}}}};evnts={};$vDsplCntnr=this._vdisplaycontainer();if(this.options.virtualizationMode==="fixed"){evnts["keydown.virtualizationEvents"]=function(e){if(e.keyCode===$.ui.keyCode.TAB){grid._syncScrollOnTabFixedVirt(e,e.shiftKey?"up":"down",$vDsplCntnr)}}}else{evnts["keydown.virtualizationEvents"]=function(e){if(e.keyCode===$.ui.keyCode.TAB){grid._syncScrollOnTab(e,e.shiftKey?"up":"down",$vDsplCntnr)}}}$vDsplCntnr.bind(evnts);this._documentEvents["keydown."+this.id()]=function(event){var keyCode=event.keyCode,$sc,dir=null,step;if(grid._isMouseOverVirtualTable){if(keyCode===$.ui.keyCode.DOWN){dir=1}else if(keyCode===$.ui.keyCode.UP){dir=-1}if(dir&&grid._isMouseOverVirtualTable){step=grid.options.virtualizationMouseWheelStep===null?parseInt(grid.options.avgRowHeight,10):grid.options.virtualizationMouseWheelStep;$sc=grid._scrollContainer();$sc.scrollTop($sc.scrollTop()+step*dir)}}};$(document).bind(this._documentEvents);if(this.options.virtualization===true||this.options.rowVirtualization===true){this._scrollContainer().bind({scroll:function(event){grid._onVirtualVerticalScroll(event);grid._virtualScrollMouseDown=false},mousedown:function(){grid._virtualScrollMouseDown=true}})}if(this.options.virtualization===true||this.options.columnVirtualization===true){$vCont=this._vhorizontalcontainer();$vCont.data("containerName","vScrollbar").bind({scroll:function(event){grid._onVirtualHorizontalScroll(event)}});if(this.options.virtualizationMode==="continuous"){this._registerScrllCntnrToSync($vCont)}}if(this._vhorizontalcontainer().length===0&&this.options.width!==null){if(!this.options.width.indexOf||this.options.width.indexOf("%")===-1){this._addHorizontalScrollBar(this._virtualcontainer())}this._vdisplaycontainer().css("overflow-x","hidden")}this.element.height(this._scrollContainer().height());if(this.options.width&&this.options.width.indexOf&&this.options.width.indexOf("%")!==-1){this.container().find("#"+id+"_virtualContainer > colgroup > col:first").css("width","100%");this._vhorizontalcontainer().css("width","100%");this._vdisplaycontainer().css("width","100%").css("max-width","100%")}},_syncScrollOnTabFixedVirt:function(e,dir,$vDsplCntnr){$vDsplCntnr=$vDsplCntnr||this._vdisplaycontainer();var $ae=$(document.activeElement),$next,isDown=dir==="down",scrlTop,$scrlCntnr,h,selFirstLastChild=isDown?":last-child":":first-child";$next=isDown?$ae.closest("tr").next():$ae.closest("tr").prev();if(!$ae.is("td, th")||!$ae.is(selFirstLastChild)||$next.length){return}$scrlCntnr=this._scrollContainer();scrlTop=$scrlCntnr.scrollTop();h=parseInt(this.options.avgRowHeight,10);scrlTop+=isDown?h:-h;$scrlCntnr.scrollTop(scrlTop);if(scrlTop<=0||scrlTop+$vDsplCntnr.outerHeight()>=$scrlCntnr.children("div").outerHeight()){return}e.preventDefault()},_syncScrollOnTab:function(e,dir,$vDsplCntnr){$vDsplCntnr=$vDsplCntnr||this._vdisplaycontainer();var $ae=$(document.activeElement),$next,$currTr,$scCntnr,scrTop,id,isDown=dir==="down",selFirstLastChild=isDown?":last-child":":first-child";if(!$ae.is("td, th")||!$ae.is(selFirstLastChild)){return}$currTr=$ae.closest("tr");$next=isDown?$currTr.next():$currTr.prev();this._focusDataRowIndex=null;if(!$next.length){$scCntnr=this._scrollContainer();scrTop=$scCntnr.scrollTop();if(isDown){if($scCntnr[0].scrollHeight-scrTop===$scCntnr.outerHeight()){this._focusDataRowIndex=0}else{$scCntnr.scrollTop(scrTop+2);id=parseInt($currTr.attr("data-row-idx"),10);this._focusDataRowIndex=!isNaN(id)&&id-1>0?id-1:null}return}else if(!isDown){if(!scrTop){this._focusDataRowIndex=this._getTotalRowsCount()-1;return}else{$scCntnr.scrollTop(scrTop-2);id=parseInt($currTr.attr("data-row-idx"),10);this._focusDataRowIndex=!isNaN(id)&&id-1>0?id-1:null}}e.preventDefault();return}this._focusDataRowIndex=parseInt($next.attr("data-row-idx"),10);this._onVirtualVerticalScroll(e,$next.outerHeight(),dir)},_renderHorizontalScrollContainer:function(totalWidth){var horizontalScrollContainerInner,w=this.options.width,$vhc=this._vhorizontalcontainer();if(w&&w.indexOf&&w.indexOf("%")!==-1&&(this.options.virtualization===true||this.options.rowVirtualization===true)){return}$vhc.css("height",this._scrollbarWidth()+"px").css("overflow","scroll");w=this.hasFixedColumns()?parseFloat(w)-this.fixedBodyContainer().outerWidth():w;if($.ig.util.isIE||$.ig.util.isEdge){$vhc.css("width",parseInt(w,10)+1).css("height",$vhc.outerHeight()+1+"px")}else{if($.ig.util.isFF&&($.type(w)==="number"||w&&w.indexOf&&w.indexOf("px")>0)){w=parseFloat(w)-this._scrollbarWidth()}$vhc.css("width",w)}horizontalScrollContainerInner='<div style="width:'+totalWidth+'px;height:1px;"></div>';$vhc.append(horizontalScrollContainerInner)},_suppressVirtVertScroll:function(suppress){this._virtVertScrollSuppressed=suppress},_isVirtVertScrollSuppressed:function(){if(this._virtVertScrollSuppressed){return true}return false},_correctVirtVertScrollTop:function(oldScrollTop,oldScrollContHeight){this._suppressVirtVertScroll();this._setScrollContainerScrollTop(oldScrollTop/oldScrollContHeight*this._getScrollContainerHeight());this._suppressVirtVertScroll(false)},_onVirtualVerticalScroll:function(event,offset,dir){this._isHorizontal=false;if(this._isVirtVertScrollSuppressed()){return}var newSri,scrollContainer=this._scrollContainer(),scrollTopDiff,isIE=$.ig.util.isIE,scrollerHeight,avgRowHeight=parseInt(this.options.avgRowHeight,10),current=scrollContainer.scrollTop(),mode=this.options.virtualizationMode;if(offset!==undefined){if(dir==="down"){scrollContainer.scrollTop(current+offset)}else{scrollContainer.scrollTop(current-offset)}current=scrollContainer.scrollTop()}scrollTopDiff=scrollContainer.scrollTop()-this._oldScrollTop;if(Math.abs(scrollTopDiff)<5&&$.ig.util.isFF&&!isIE){return scrollTopDiff}if(mode===undefined||mode===""){mode="continuous"}if(mode==="fixed"){newSri=Math.ceil(scrollContainer.scrollTop()/avgRowHeight);if($.ig.util.isIE){scrollerHeight=this._getScrollContainerHeight();if(this._totalRowCount*avgRowHeight>=scrollerHeight+2){if(current+5>scrollerHeight-scrollContainer.innerHeight()){newSri=this._getDataView().length-this._virtualRowCount}else{newSri=Math.ceil(current/scrollerHeight*this._totalRowCount)}}}else if(newSri===this._startRowIndex&&this._virtualScrollMouseDown){if(scrollTopDiff>0&&scrollTopDiff<avgRowHeight){newSri++;scrollContainer.scrollTop(scrollContainer.scrollTop()-scrollTopDiff+avgRowHeight)}else if(scrollTopDiff<0&&Math.abs(scrollTopDiff)<avgRowHeight){newSri--;scrollContainer.scrollTop(scrollContainer.scrollTop()-scrollTopDiff-avgRowHeight)}}if(newSri>this._totalRowCount-this._virtualRowCount){newSri=this._totalRowCount-this._virtualRowCount}if(newSri<0){newSri=0}if(newSri!==this._startRowIndex){this._startRowIndex=newSri;this._renderVirtualRecords()}}else if(mode==="continuous"){this._virtualScrollToInternal(current)}this._oldScrollTop=scrollContainer.scrollTop();this._oldDisplayContainerScrollTop=this._vdisplaycontainer().scrollTop();if(this._persistVirtualScrollTop){this._saveFirstVisibleTRIndex()}return scrollTopDiff},_scrollContainer:function(){if(!this._scrollContainerObj||this._scrollContainerObj.length===0){this._scrollContainerObj=this.container().find("#"+this.id()+"_scrollContainer")}return this._scrollContainerObj},_onVirtualHorizontalScroll:function(event){var newSci,internallyTriggered=event===undefined,horizontalScrollContainer=this._vhorizontalcontainer(),scrollLeft=horizontalScrollContainer.scrollLeft(),hiddenContentWidth=horizontalScrollContainer[0].scrollWidth-horizontalScrollContainer[0].offsetWidth;if(this.options.virtualization===true&&this.options.virtualizationMode==="continuous"){this._onScrollContainer(event);return}this._isHorizontal=true;if(hiddenContentWidth>0){newSci=Math.ceil(scrollLeft*this._totalColumnCount/hiddenContentWidth);newSci=Math.min(newSci,this._totalColumnCount-this._virtualColumnCount)}else{newSci=0}if(internallyTriggered||newSci!==this._startColIndex){this._startColIndex=newSci;this._renderVirtualRecords();this._trigger("virtualhorizontalscroll",null,{startColIndex:this._startColIndex,endColIndex:this._startColIndex+this._virtualColumnCount-1})}},_initLoadingIndicator:function(){var widget;if(this.container().data("igLoading")){this._loadingIndicator=this.container().data("igLoading").indicator()}else{widget=this.container().igLoading().data("igLoading");if(widget){this._loadingIndicator=widget.indicator()}}},_addHorizontalScrollBar:function(parent){this._outerHScrollbar=true;var sb=$('<div id="'+this.id()+'_hscroller_container" ></div>').css("height",this._scrollbarWidth()+"px").css("position","relative").css("display","none").css("overflow","hidden").append($('<div id="'+this.id()+'_hscroller" ></div>').data("containerName","hScrollbar").css("width","100%").css("position","absolute").css("bottom","0px").css("overflow-x","scroll").css("overflow-y","scroll").append($("<div id='"+this.id()+"_hscroller_inner' ></div>").css("height","1px")).bind("scroll",$.proxy(this._onScrollContainerHandler,this)));if(parent){sb.insertAfter(parent)}this._registerScrllCntnrToSync($("#"+this.id()+"_hscroller"))},_updateVirtualHorizontalScrollbar:function(){var horizontalScrollContainerInner,horizontalScrollContainer,isVisible;horizontalScrollContainerInner=this.container().find("#"+this.id()+"_horizontalScrollContainer div");horizontalScrollContainerInner.css("width",this._calculateContainerWidth(false));horizontalScrollContainer=this._vhorizontalcontainer();isVisible=horizontalScrollContainer.is(":visible");if(horizontalScrollContainer.width()>horizontalScrollContainerInner.width()){horizontalScrollContainer.css("display","none")}else{horizontalScrollContainer.css("display","")}if(isVisible!==horizontalScrollContainer.is(":visible")){this._initializeHeights()}},_generateColumnFlatStructure:function(treeStructure){var cols,oldCols,newCols=[];cols=treeStructure.slice(0);oldCols=treeStructure.slice(0);this._multiColumnIdentifier=0;this._maxLevel=this._getMaxLevelRecursive(0,cols);this._hiddenColumns={};this._analyzeMultiColumnHeaders(cols,newCols,0,oldCols,[]);this._oldCols=oldCols;this.options.columns=newCols},moveColumn:function(column,target,after,inDom,callback){var grid=this,found,nColArray,movingParams,hcPreserve,isFixed,cCols=this._oldCols?$.extend(true,[],this._oldCols):$.extend(true,[],this.options.columns);after=after===null||after===undefined?true:after;inDom=inDom===null||inDom===undefined?true:inDom;movingParams={column:column,target:target,after:after};if(this._oldCols){found=this._performInternalMove(movingParams,this._oldCols);hcPreserve=$.extend(true,{},this._hiddenColumns);this._generateColumnFlatStructure(this._oldCols);this._hiddenColumns=hcPreserve;this._preserveColspans(this._oldCols)}else{found=this._performInternalMove(movingParams,this.options.columns)}if(found===false){throw new Error(this._getLocaleValue("movingNotAllowedOrIncompatible"))}if(movingParams.columnFixed===movingParams.targetFixed){nColArray=this._buildColumnLayoutArray(cCols,movingParams.columnFixed)}else{return movingParams}column=movingParams.column;target=movingParams.target;after=movingParams.after;isFixed=movingParams.columnFixed;if(inDom===true){this._loadingIndicator.show();setTimeout(function(){grid._columnMovingResets();grid._performDomColumnMove(column,target,after,nColArray,isFixed);grid._updateVerticalScrollbarCellPadding(true);grid._loadingIndicator.hide();if(callback){$.ig.util.invokeCallback(callback,[grid.options.columns])}},0)}else{this._columnMovingResets();this._performColumnMove(column,target,after,nColArray,isFixed);if(callback){$.ig.util.invokeCallback(callback,[grid.options.columns])}}},_columnMovingResets:function(){var i,$th;this._updateHeaderColumnIndexes();
delete this._virtualDom;delete this._visibleColumnsArray;this._headerCells=[];for(i=0;i<this.options.columns.length;i++){$th=this.container().find("#"+this.id()+"_"+this.options.columns[i].key).data("columnIndex",i);$th.data("data-mch-order",i);if($th.length&&$th[0].style.display!=="none"&&$th[0].style.visibility!=="hidden"&&$th.parent().is("tr")){this._headerCells.push($th)}}},_preserveColspans:function(cols){var i,cs=0,col,res;for(i=0;i<cols.length;i++){col=cols[i];if(col.group!==undefined&&col.group!==null){res=this._preserveColspans(col.group);col.colspan=res;cs+=res}else{if(col.hidden!==true){cs++}}}return cs},_columnVisible:function(col){return!col.hidden},_buildColumnLayoutArray:function(cCols,fixed){var i=0,j=0,col,id,colrs,l,x=0,nCols,level=0,colgrp=fixed?this.fixedBodyContainer().find("colgroup:first"):this.element.find("colgroup:first"),width=colgrp.children("col:not([data-skip=true])").length,htbl=fixed?this.fixedHeadersTable():this.headersTable(),height=htbl.find("thead tr").length,array=[];if(height===0&&this.options.showHeader===false){height=1}for(i=0;i<width;i++){array[i]=[]}i=0;while(level<height){nCols=[];while(i<cCols.length){col=cCols[i];if(col.hidden===true||this._isSubsetFixed(col)!==fixed){i++;continue}colrs=col.rowspan||1;id=this._getColMarkForLevel(col);l=col.colspan||1;for(j=0;j<l;j++){array[x+j][level]=id}if(col.crs===colrs&&col.group){nCols.push.apply(nCols,$.grep(col.group,$.proxy(this._columnVisible,this)).slice(0))}else{nCols.push(col)}x+=l;i++}cCols=nCols;level++;x=0;i=0}return array},_getColMarkForLevel:function(col){if(!col.crs){col.crs=0}col.crs++;if(col.crs>1){return-1}return col.key||col.identifier},_performInternalMove:function(movingParams,subset){var i=0,j,success=true;i=this._getColIdxById(subset,movingParams.column);if(typeof movingParams.column==="number"){movingParams.column=subset[i].key||subset[i].identifier}if(i||i===0){movingParams.columnFixed=this._isSubsetFixed(subset[i]);j=this._getColIdxById(subset,movingParams.target);if(typeof movingParams.target==="number"){movingParams.target=subset[j].key||subset[j].identifier;movingParams.after=j>=i}if(j||j===0){movingParams.targetFixed=this._isSubsetFixed(subset[j]);delete subset[i].oWidth;delete subset[j].oWidth;success=success&&this._rearrangeArray(subset,i,1,movingParams.after===true?j+1:j);success=success||movingParams.targetFixed!==movingParams.columnFixed;return success}return false}for(i=0;i<subset.length;i++){if(subset[i].group){if(this._performInternalMove(movingParams,subset[i].group)===true){return true}}}return false},_getColIdxById:function(array,id){var i,col;if(typeof id==="number"){return id}for(i=0;i<array.length;i++){col=array[i];if(col.key){if(col.key===id){return i}}else if(col.identifier){if(col.identifier===id){return i}}}},_isSubsetFixed:function(subset){var mchc;if(subset.group){mchc=this._getMultiHeaderColumnById(subset.identifier);return!!mchc.children[0].fixed}return!!subset.fixed},_getCellIndexByColumnKey:function(key){var i=this.getVisibleIndexByKey(key);return i===-1?i:i+this.element.find("tbody>tr:not([data-grouprow='true'],[data-summaryrow='true']):first").children("th,td[data-skip='true'],td[data-parent]").length},_findColAreaInLayout:function(col,nColArray,depth){var i,j,res={};for(i=0;i<nColArray.length;i++){if(nColArray[i][depth]===col){res.start=i;for(j=i;j<nColArray.length;j++){if(nColArray[j][depth]!==col){break}}res.length=j-i;return res}}return null},_rearrangeArray:function(array,start,length,at){var col,targetAfter=start<at,n;if(start===at||start<0||at<0||start>=array.length||at>array.length){return false}col=array.splice(start,length);for(n=0;n<col.length;n++){array.splice(targetAfter?at-length+n:at+n,0,col[n])}return true},_moveColumnInHeader:function(column,target,after,nColArray,fixed){var rmil,movedColumn,targetColumn,targetIndex,targetObject,spStart,spEnd,i,j,cols,n,header;if(fixed){header=this.fixedHeadersTable().children("thead")}else{header=this.headersTable().children("thead")}for(j=0;j<nColArray[0].length;j++){movedColumn=this._findColAreaInLayout(column,nColArray,j);if(movedColumn){targetColumn=this._findColAreaInLayout(target,nColArray,j);if(targetColumn){break}}}rmil=[movedColumn,targetColumn];if(!movedColumn||!targetColumn){return rmil}if(this.options.showHeader===false){return rmil}this._moveThs({from:header},column,target,after);while(++j<nColArray[0].length){cols=[];n=null;for(i=movedColumn.start;i<movedColumn.start+movedColumn.length;i++){if(nColArray[i][j]===-1){continue}if(nColArray[i][j]!==n){n=nColArray[i][j];cols.push(n)}}targetIndex=after===true?targetColumn.start+targetColumn.length-1:targetColumn.start;if(nColArray[targetIndex][j]!==-1){this._moveThs({from:header},cols,nColArray[targetIndex][j],after);continue}if(after===true){spStart=targetColumn.start+targetColumn.length;spEnd=movedColumn.start>targetColumn.start+targetColumn.length-1?movedColumn.start:nColArray.length;targetObject=this._findTargetRight(spStart,spEnd,j,nColArray);if(!targetObject){spStart=targetColumn.start+targetColumn.length-2;spEnd=movedColumn.start>targetColumn.start+targetColumn.length-1?-1:movedColumn.start+movedColumn.length;targetObject=this._findTargetLeft(spStart,spEnd,j,nColArray)}}else{spStart=targetColumn.start-1;spEnd=movedColumn.start>targetColumn.start+targetColumn.length-1?-1:movedColumn.start+movedColumn.length;targetObject=this._findTargetLeft(spStart,spEnd,j,nColArray);if(!targetObject){spStart=targetColumn.start+1;spEnd=movedColumn.start>targetColumn.start+targetColumn.length-1?movedColumn.start:nColArray.length;targetObject=this._findTargetRight(spStart,spEnd,j,nColArray)}}if(targetObject&&targetObject.pos&&targetObject.left!==undefined&&targetObject.left!==null){this._moveThs({from:header},cols,nColArray[targetObject.pos][j],targetObject.left)}}return rmil},_moveColumnInBodyFooter:function(area,movedColumn,targetColumn,after){var i,j,trs,$tr,tds,tar,skip=0,trsTo,$trTo,children,len,areaFrom=area.from||area;trs=area.trsFrom||areaFrom.find(">tr:not([data-container='true'],[data-grouprow='true'])");if(area.to||area.trsTo){trsTo=area.trsTo||area.to.find(">tr:not([data-container='true'],[data-grouprow='true'])")}if(trs.length>0&&!area.ignoreDataSkip){skip=trs.eq(0).find("[data-parent],[data-skip='true'],th").length}len=trs.length;for(j=0;j<len;j++){tds=$();$tr=trs.eq(j);$trTo=trsTo?trsTo.eq(j):$tr;children=$tr.children();for(i=movedColumn.start;i<movedColumn.start+movedColumn.length;i++){tds=tds.add(children.eq(i+skip))}if(targetColumn.start===-1){tds.appendTo($trTo);continue}if(after===true){tar=$trTo.children().eq(targetColumn.start+targetColumn.length+skip-1);tds.insertAfter(tar)}else{tar=$trTo.children().eq(targetColumn.start+skip);tds.insertBefore(tar)}}},_findTargetRight:function(start,end,level,nColArray){var i,colFound={};for(i=start;i>=0&&i<end&&i<nColArray.length;i++){if(nColArray[i][level]!==-1){colFound.pos=i;colFound.left=false;return colFound}}},_findTargetLeft:function(start,end,level,nColArray){var i,colFound={};for(i=start;i>=0&&i>end&&i<nColArray.length;i--){if(nColArray[i][level]!==-1){colFound.pos=i;colFound.left=true;return colFound}}},_moveCols:function(area,movedColumn,targetColumn,after){var i,cols=$(),tCol,areaFrom=area.from||area,areaTo=area.to||areaFrom,skip=!area.ignoreDataSkip?areaFrom.children("[data-skip='true']").length:0;for(i=movedColumn.start;i<movedColumn.start+movedColumn.length;i++){cols=cols.add(areaFrom.children().eq(i+skip))}if(targetColumn.start===-1){cols.detach().appendTo(areaTo);return}if(after===true){tCol=areaTo.children().eq(targetColumn.start+targetColumn.length+skip-1);cols.detach().insertAfter(tCol)}else{tCol=areaTo.children().eq(targetColumn.start+skip);cols.detach().insertBefore(tCol)}},_moveThs:function(header,ids,tar,after){var $tar,$ids=$(),$id,i,$pid,headerFrom=header.from||header,headerTo=header.to||headerFrom;$tar=headerTo.find("th[data-mch-id='"+tar+"'],th[id='"+this.id()+"_"+tar+"']");if(typeof ids==="object"){for(i=0;i<ids.length;i++){$id=headerFrom.find("th[data-mch-id='"+ids[i]+"'],th[id='"+this.id()+"_"+ids[i]+"']");if($id.attr("data-vscr-padding-icrement")){$pid=$id}$ids=$ids.add($id)}}else{$ids=headerFrom.find("th[data-mch-id='"+ids+"'],th[id='"+this.id()+"_"+ids+"']");if($ids.attr("data-vscr-padding-icrement")){$pid=$ids}}$ids.detach();if(after){$ids.insertAfter($tar)}else{$ids.insertBefore($tar)}if($tar.attr("data-vscr-padding-icrement")&&after===true){$ids.last().css(this._padding,$tar.css(this._padding)).attr("data-vscr-padding-icrement",$tar.attr("data-vscr-padding-icrement"));$tar.css(this._padding,"");$tar.removeAttr("data-vscr-padding-icrement")}else if($pid){$pid.parent().children(":last").css(this._padding,$pid.css(this._padding)).attr("data-vscr-padding-icrement",$pid.attr("data-vscr-padding-icrement"));$pid.css(this._padding,"");$pid.removeAttr("data-vscr-padding-icrement")}},_moveSpecialThs:function(movedColumn,targetColumn,after,fixed){var i,j,spTrs,header,skip,ths,$tr,tar;if(fixed){header=this.fixedHeadersTable().children("thead")}else{header=this.headersTable().children("thead")}spTrs=header.find(">tr[data-role]");if(spTrs.length>0){skip=spTrs.eq(0).find("[data-parent],[data-skip='true']").length}for(j=0;j<spTrs.length;j++){ths=$();$tr=$(spTrs[j]);for(i=movedColumn.start;i<movedColumn.start+movedColumn.length;i++){ths=ths.add($tr.children("td,th").eq(i+skip))}if(after===true){tar=$tr.children().eq(targetColumn.start+targetColumn.length+skip-1);ths.detach().insertAfter(tar)}else{tar=$tr.children().eq(targetColumn.start+skip);ths.detach().insertBefore(tar)}}},_performDomColumnMove:function(column,target,after,nColArray,fixed){var rmil=this._moveColumnInHeader(column,target,after,nColArray,fixed),movedColumn=rmil[0],targetColumn=rmil[1],body,footer,indexMod=0;if(!movedColumn||!targetColumn){this._trigger("_columnsmoved",null,{owner:this});return}this._moveSpecialThs(movedColumn,targetColumn,after,fixed);if(this.options.fixedHeaders===true){this._moveCols({from:fixed?this.fixedHeadersTable().children("colgroup"):this.headersTable().children("colgroup")},movedColumn,targetColumn,after)}if(fixed){body=this.fixedBodyContainer().children("table")}else{body=this.element}this._moveColumnInBodyFooter({from:body.children("tbody")},movedColumn,targetColumn,after);this._moveCols({from:body.children("colgroup")},movedColumn,targetColumn,after);if(this.options.fixedFooters===true){footer=fixed?this.fixedFootersTable():this.footersTable();this._moveColumnInBodyFooter({from:footer.children("tfoot")},movedColumn,targetColumn,after);this._moveCols({from:footer.children("colgroup")},movedColumn,targetColumn,after)}else{this._moveColumnInBodyFooter({from:body.children("tfoot")},movedColumn,targetColumn,after)}if(!fixed&&this.fixingDirection()==="left"||fixed&&this.fixingDirection()==="right"){indexMod=this._fixedColumns?this._fixedColumns.length:0}this._trigger("_columnsmoved",null,{owner:this,start:movedColumn.start+indexMod,len:movedColumn.length,index:after===true?targetColumn.start+targetColumn.length+indexMod:targetColumn.start+indexMod,isFixed:fixed})},_performColumnMove:function(column,target,after,nColArray,fixed){var rmil=this._moveColumnInHeader(column,target,after,nColArray,fixed),movedColumn=rmil[0],targetColumn=rmil[1],indexMod=0,footer,body;if(this.options.fixedHeaders===true){this._moveCols({from:fixed?this.fixedHeadersTable().children("colgroup"):this.headersTable().children("colgroup")},movedColumn,targetColumn,after)}this._moveSpecialThs(movedColumn,targetColumn,after,fixed);this._renderData();if(fixed){body=this.fixedBodyContainer().children("table")}else{body=this.element}this._rerenderColgroups();if(!fixed&&this.fixingDirection()==="left"||fixed&&this.fixingDirection()==="right"){indexMod=this._fixedColumns?this._fixedColumns.length:0}this._trigger("_columnsmoved",null,{owner:this,start:movedColumn.start+indexMod,len:movedColumn.length,index:after===true?targetColumn.start+targetColumn.length+indexMod:targetColumn.start+indexMod,isFixed:fixed})},showColumn:function(column,callback){var grid=this,i,colToShow,len,arrIds=[];this._loadingIndicator.show();if(!this._isShowingAllowed([column])){return false}if(this.isGroupHeader(column)){colToShow=grid._getMultiHeaderColumnById(column);if(colToShow===null){return}len=colToShow.children.length;for(i=0;i<len;i++){arrIds.push(colToShow.children[i].key)}this._setHiddenMultipleColumns(arrIds,[],callback);colToShow.hidden=false;colToShow.colspan=len}else{setTimeout(function(){var col;col=grid._setHidden(column,false);grid._loadingIndicator.hide();if(callback){$.ig.util.invokeCallback(callback,[[col],false])}},0)}return true},hideColumn:function(column,callback){var grid=this,i,colToHide,len,arrIds=[];if(!this._isHidingAllowed([column])){return false}if(grid._visibleColumns().length===1){return false}this._loadingIndicator.show();if(this.isGroupHeader(column)){colToHide=grid._getMultiHeaderColumnById(column);if(colToHide===null){return}len=colToHide.children.length;for(i=0;i<len;i++){arrIds.push(colToHide.children[i].key)}this._setHiddenMultipleColumns([],arrIds,callback);colToHide.hidden=true;colToHide.colspan=0}else{setTimeout(function(){var col;col=grid._setHidden(column,true);grid._loadingIndicator.hide();if(callback){$.ig.util.invokeCallback(callback,[[col],true])}},0)}return true},_setHiddenMultipleColumns:function(columnsToShow,columnsToHide,callback){var grid=this,columnKey,columnIndex;grid._loadingIndicator.show();setTimeout(function(){var i,column,cols=[],c;for(i=0;i<columnsToShow.length;i++){column=columnsToShow[i];if(typeof column==="number"){columnIndex=column}else{columnKey=column}c=grid._setHidden(column,false);if(c){cols.push(c)}}for(i=0;i<columnsToHide.length;i++){column=columnsToHide[i];if(grid._visibleColumns().length===1){break}if(typeof column==="number"){columnIndex=column}else{columnKey=column}c=grid._setHidden(column,true);if(c){cols.push(c)}}if(!grid._allColumnWidthsInPixels&&$.ig.util.isFF){grid._refreshUI()}grid._loadingIndicator.hide();if(callback){$.ig.util.invokeCallback(callback,[cols,columnsToShow.length===0])}},0)},_setHidden:function(column,hidden){var col,applied=false;if(typeof column==="number"){col=this.options.columns[column]}else{col=this.columnByKey(column)}if(col&&col.hidden!==hidden){this._setHiddenColumns([col],hidden,false);if(this.element.igScroll!==undefined){if(this._vdisplaycontainer().data("igScroll")&&(this.options.virtualization===true||this.options.rowVirtualization===true)){this._vdisplaycontainer().igScroll("refresh");this._vdisplaycontainer().igScroll("option","scrollWidth",this._calculateContainerWidth())}else if(this.scrollContainer().data("igScroll")){this.scrollContainer().igScroll("refresh")}}if(!hidden&&col._initiallyHidden&&col._shouldAutoSize){this.autoSizeColumns();delete col._shouldAutoSize}applied=true}if(applied){return col}return null},_visibleAreaWidth:function(w){if(w!==undefined){this._minVAreaWidth=w}else{return this._minVAreaWidth}},_isShowingAllowed:function(columns){if(!this.hasFixedColumns()){return true}var i,columnsLength=columns.length,totalW=0,w,gridW,colType,col;for(i=0;i<columnsLength;i++){colType=typeof columns[i];if(colType==="string"){col=this.columnByKey(columns[i])}else if(colType==="number"){col=this.options.columns[columns[i]]}else{col=columns[i]}if(!col||!col.hidden){continue}if(col.fixed&&(col.width||col.oWidth)){w=col.width||col.oWidth;w=parseInt(w,10);totalW+=w}}if(totalW!==0){gridW=this.container().outerWidth();if(gridW-parseInt(this.fixedContainer().outerWidth(),10)-totalW<this._visibleAreaWidth()){return false}}return true},_isHidingAllowed:function(columns){if(!this.hasFixedColumns()){return true}var i,columnsLength=columns.length,col,colType,fixed=[],unfixed=[];for(i=0;i<columnsLength;i++){colType=typeof columns[i];if(colType==="string"){col=this.columnByKey(columns[i])}else if(colType==="number"){col=this.options.columns[columns[i]]}else{col=columns[i]}if(!col||col.hidden){continue}if(col.fixed){fixed.push(col)}else{unfixed.push(col)}}if(fixed.length!==0&&this._visibleColumns(true).length<=fixed.length||this._visibleColumns(false).length<=unfixed.length){return false}return true},_setHiddenColumns:function(columns,hidden,initial){var columnNumberChanged=false,visibleColumnsWithWidthLength,gridWidth,self=this,inPerc,visibleColumnsLength,hasVirtualization=this.options.virtualization===true||this.options.columnVirtualization===true||this.options.rowVirtualization===true,hasColumnVirtualization=this.options.virtualizationMode!=="continuous"&&(this.options.virtualization===true&&this.options.width||this.options.columnVirtualization===true),isContinuos=false;if(columns.length===0){return}this._fireInternalEvent("_hidingFinishing",{columns:columns,hidden:hidden});if(hasVirtualization){isContinuos=this.options.virtualizationMode==="continuous";self._updateVirtColCounters();if(!isContinuos){$.each(columns,function(index,col){var oldVirtualColumnCount=self._virtualColumnCount;col.hidden=hidden;self._visibleColumnsArray=undefined;self._updateVirtColCounters();if(self._virtualColumnCount!==oldVirtualColumnCount){if(self._virtualColumnCount<oldVirtualColumnCount){self._detachColumn(col)}else if(self._virtualColumnCount>oldVirtualColumnCount){self._attachColumn(col)}columnNumberChanged=true;self._resetVirtualDom()}});if(hasColumnVirtualization){this._vheaders=undefined;this._updateVirtualHorizontalScrollbar();this._onVirtualHorizontalScroll();if(!this._initialized){this._adjustLastColumnWidth(true)}}this._renderVirtualRecords()}}if(!hasVirtualization||isContinuos){$.each(columns,function(index,col){var pos;col.hidden=hidden;self._visibleColumnsArray=undefined;if(col.hidden){pos=self._detachColumn(col);self.element.find("colgroup>col").not("[data-skip]").eq(pos).attr("data-hiding",true)}else{self._attachColumn(col);$('<col data-showing="true">').width(col.width).appendTo(self.element.find("colgroup"))}});if(this._isHierarchicalGrid){this.element.children("tbody").children("tr[data-container]").children().remove()}this._cleanupTBody();if(this.hasFixedColumns()){this._rerenderColgroups()}columnNumberChanged=true;if(hasVirtualization){this._updateVirtColCounters();if(this._initialized){this._renderVirtualRecords()}}else{this._renderRecords()}self.element.find("colgroup>col[data-showing]").remove();self.element.find("colgroup>col[data-hiding]").removeAttr("data-hiding")}if(columnNumberChanged){if(!this._initialized){if(this._visibleColumns().length===0){throw new Error(this._getLocaleValue("allColumnsHiddenOnInitialization"))}this._rerenderColgroups(initial);this._adjustLastColumnWidth(true);if(hasVirtualization){this._renderVirtualRecords()}}else{if(this._visibleColumns().length>0){this._rerenderColgroups(initial);this._adjustLastColumnWidth(true);visibleColumnsLength=this._visibleColumns().length;visibleColumnsWithWidthLength=$.grep(this._visibleColumns(),function(col){return col.width}).length;if(visibleColumnsWithWidthLength===visibleColumnsLength){if(this.options.width&&parseInt(this.options.width,10)>0){this._updateGridContentWidth()}else{this._setContainerWidth(this.container());if(hasVirtualization){gridWidth=this._calculateContainerWidth(true);if(this.options.height!==null){gridWidth-=this._scrollbarWidth()}this._vdisplaycontainer().css("width",gridWidth).css("max-width",gridWidth)}}}}}}this.element.trigger("iggriduisoftdirty",{owner:this});this._trigger(this.events.columnsCollectionModified,null,{owner:this});if(columnNumberChanged&&hasVirtualization&&this._visibleColumns().length>0&&visibleColumnsWithWidthLength===visibleColumnsLength){if(this.options.virtualizationMode==="continuous"){if(!isNaN(gridWidth)){gridWidth+=this._calculateSpecialColumnsWidth();this._vdisplaycontainer().css("width",gridWidth).css("max-width",gridWidth)}}if(!isNaN(gridWidth)){this.container().find("#"+this.id()+"_virtualContainer>colgroup col").eq(0).attr("width",gridWidth)}if(this.options.width===null||this.options.width===undefined){this._setContainerWidth(this.container().find("#"+this.id()+"_headers_v"))}}this._origWidth=parseInt(this.container().css("width"),10);if(columnNumberChanged&&$.ig.util.isSafari&&this.options.showHeader){self.headersTable().find("[data-header-row]").hide();self.fixedHeadersTable().find("[data-header-row]").hide();setTimeout(function(){self.headersTable().find("[data-header-row]").show();self.fixedHeadersTable().find("[data-header-row]").show();if(self.options.height){self._initializeHeights()}},0)}if(columnNumberChanged&&($.ig.util.isFF||$.ig.util.isIE8)){inPerc=this.options.width===null||typeof this.options.width==="string"&&this.options.width.indexOf("%")!==-1;if(inPerc){if($.ig.util.isIE8){this._refreshUI()}this._refreshTableUI(this.element);if(this.options.showHeader){this._refreshTableUI(this.headersTable())}if(this.options.fixedFooters===true&&this.options.height!==null){this._refreshTableUI(this.footersTable())}}}if(columnNumberChanged){this._checkAndReinitializeContainersHeights()}this._fireInternalEvent("_hidingFinished",{columns:columns,hidden:hidden})},_refreshTableUI:function($tbl){if(!$tbl.length){return}var overflow;overflow=$tbl[0].style.overflow;$tbl[0].style.overflow="hidden";setTimeout(function(){$tbl[0].style.overflow=overflow},0)},_checkAndReinitializeContainersHeights:function(initH){var c;if(_aNull(this.options.height)||!this.options.height||$.type(this.options.height)==="string"&&this.options.height.indexOf("%")>0){return}c=this.container();if(!c.length){return}if(_aNull(initH)){initH=c.height()}if(c[0].scrollHeight-initH>1){this._initializeHeights()}},_calculateSpecialColumnsWidth:function(){var width=0,cols=$();if(this.hasFixedColumns()&&this.fixingDirection()==="left"){cols=this.fixedHeadersTable().find("> colgroup > col[data-skip=true]")}this.headersTable().find("> colgroup > col[data-skip=true]").each(function(){cols=cols.add(this)});cols.each(function(){var colWidth=this.style.width;if(colWidth){width+=parseInt(colWidth,10)}});return width},_allSpecialColumnsInPercentage:function(){var specCols=this.headersTable().find("> colgroup > col[data-skip=true]"),i;for(i=0;i<specCols.length;i++){if(!specCols[i].style.width.endsWith("%")){return false}}return true},_synchronizeHScroll:function(){var hasFixedHeaders=this.options.showHeader&&this.options.fixedHeaders===true&&this.options.height!==null,hasFixedFooters=this.options.showFooter&&this.options.fixedFooters===true&&this.options.height!==null,scroller=this._hscrollbarcontent(),scrollContainer=this.scrollContainer(),$vContainer,horizontalScrollContainer,scrLeft=scroller.scrollLeft(),headers,footers;if(scroller.length===0){horizontalScrollContainer=$("#"+this.id()+"_horizontalScrollContainer");if(horizontalScrollContainer.length===1){scrLeft=horizontalScrollContainer.scrollLeft();this._vdisplaycontainer().scrollLeft(scrLeft)}else{return}}else if(scrollContainer.length>0){scrollContainer.scrollLeft(scrLeft);if(scrollContainer.scrollLeft()!==0||this.element.height()!==0){scrLeft=scrollContainer.scrollLeft();scroller.scrollLeft(scrLeft)}}else{$vContainer=this._vdisplaycontainer();if($vContainer.length){$vContainer.scrollLeft(scrLeft)}}if(hasFixedHeaders){headers=this.headersTable().parent();headers.scrollLeft(scrLeft)}if(hasFixedFooters){footers=this._fixedfooters();footers.scrollLeft(scrLeft)}},_updateGridContentWidth:function(){var gridWidth=0,hasWidthInPixels=this._gridHasWidthInPixels(),scroller,scrLeft,hasFixedHeader=this.options.height!==null&&this.options.fixedHeaders===true&&this.options.showHeader&&this._headerParent,colBreadth=this._isMultiRowGrid()&&this._rlp.length?this._rlp[0]:this._visibleColumns();$.each(colBreadth,function(index,e){var col=e.col||e;if(col.fixed===true){return true}if(gridWidth!==undefined&&col.width&&!(col.width.charAt&&col.width.endsWith("%"))){gridWidth+=parseInt(col.width,10)}else{gridWidth=undefined}});if(gridWidth===undefined){return}gridWidth+=this._calculateSpecialColumnsWidth();if(!hasFixedHeader&&this._hasVerticalScrollbar&&(!hasWidthInPixels||hasWidthInPixels&&gridWidth<=parseInt(this.options.width,10))){gridWidth-=this._scrollbarWidth()}if(this.options.width!==null&&this.options.height!==null){scroller=this._hscrollbarcontent();scrLeft=scroller.scrollLeft()}this._setGridContentWidth(gridWidth);if(this.options.height!==null&&this.options.width!==null&&!this.options.virtualization&&!this.options.rowVirtualization&&!this.options.columnVirtualization){this._updateVerticalScrollbarCellPadding()}if(this.options.width!==null&&this.options.height!==null){scroller.scrollLeft(scrLeft);this._synchronizeHScroll()}},_updateVerticalScrollbarCellPadding:function(skipHeaderFooters){var o=this.options,hasFixedHeaders=o.showHeader&&o.fixedHeaders===true&&o.height!==null,hasFixedFooters=o.showFooter&&o.fixedFooters===true&&o.height!==null,hasVirtualization=o.virtualization===true||o.columnVirtualization===true||o.rowVirtualization===true,skipCheck=!hasVirtualization&&o.height&&(!hasFixedFooters||!hasFixedHeaders)&&this.hasFixedColumns()&&this.fixingDirection()==="right",emptySpace,paddingIncrement;if(o.height===null){return}if(this._gridInnerWidth===undefined||this._gridContentWidth===undefined){emptySpace=0}else{emptySpace=this.element.closest("div").width()-this.element.width()}if(this._hasVerticalScrollbar||(o.virtualization||o.rowVirtualization)&&(typeof o.width==="string"&&o.width.indexOf("%")>0)){paddingIncrement=this._scrollbarWidth()}else{paddingIncrement=0}if(hasVirtualization||!skipCheck&&!hasFixedHeaders&&!hasFixedFooters&&!(emptySpace>=0&&emptySpace<paddingIncrement)){return}paddingIncrement-=emptySpace>=0?emptySpace:0;paddingIncrement=paddingIncrement<0?0:paddingIncrement;this._updateVScrollbarCellPaddingHelper(paddingIncrement,skipHeaderFooters);return paddingIncrement},_updateVScrollbarCellPaddingHelper:function(paddingIncrement,skipHeaderFooters){var hasFixedFooters=this.options.showFooter&&this.options.fixedFooters===true&&this.options.height!==null;if(!skipHeaderFooters){if(this.options.showHeader&&this.options.height!==null){if(!this.options.fixedHeaders){this._increaseLastCellVScrollbarPadding(this.element,"thead","th",paddingIncrement)}else{this._increaseLastHeaderCellVScrollbarPadding(this.headersTable(),paddingIncrement)}}if(hasFixedFooters){this._increaseLastCellVScrollbarPadding(this.footersTable(),"tfoot","td",paddingIncrement)}else{this._increaseLastCellVScrollbarPadding(this.element,"tfoot","td",paddingIncrement)}}this._increaseLastCellVScrollbarPadding(this.element,"tbody","td",paddingIncrement)},_getLastCellsInMCH:function(headerTable){var $thead,ml=this._maxLevel,$tr,lastCells=$(),i,$th,rowspan;if(!headerTable){headerTable=this.headersTable()}$thead=headerTable.find("thead");if(!ml||!$thead.length){return lastCells}for(i=ml;i>=0;i--){$tr=$thead.children("tr[data-mch-level="+i+"]");if(!$tr.length){continue}$th=$tr.children("th:last-child").not("[data-skip=true]");lastCells=lastCells.add($th);rowspan=parseInt($th.attr("rowspan"),10);if(!isNaN(rowspan)&&rowspan>1){i-=rowspan-1}}lastCells=lastCells.add($thead.children("tr:not([data-mch-level])").not("[data-skip=true]").children("th:last-child").not("[data-skip=true]"));return lastCells},_increaseLastHeaderCellVScrollbarPadding:function(table,paddingIncrement){var lastCells,currIncrement,paddingValue,selector="",i=0,updateNonPaddedInd=false;if(this._isMultiColumnGrid){updateNonPaddedInd=true;lastCells=this._getLastCellsInMCH(table)}else if(this._isMultiRowGrid()){for(i=0;i<this._rlm.length;i++){selector+="#"+this.id()+"_"+this._rlm[i][this._maxCols-1]+", "}selector=selector.slice(0,selector.lastIndexOf(", "));lastCells=table.find(selector)}else{updateNonPaddedInd=true;lastCells=table.children("thead").children("tr").not("[data-skip=true]").children("th:last-child").not("[data-skip=true]")}currIncrement=parseInt(lastCells.first().attr("data-vscr-padding-icrement"),10);paddingValue=parseInt(lastCells.first().css(this._padding),10);if(currIncrement){paddingValue-=currIncrement}this._removeHeaderCellPadding(table);lastCells.css(this._padding,paddingValue+paddingIncrement);lastCells.first().attr("data-vscr-padding-icrement",paddingIncrement);if(updateNonPaddedInd){lastCells.find("[data-nonpaddedindicator=right]").css(this._rtl?"margin-left":"margin-right",-parseInt(lastCells.css(this._padding),10)+"px")}},_removeHeaderCellPadding:function(table,removeAllPaddings){var withoutLastCell=":not(:last)";if(removeAllPaddings===true){withoutLastCell=""}table.find("thead > tr > th"+withoutLastCell+"[data-vscr-padding-icrement],thead > tr > td:not(:last)[data-vscr-padding-icrement]").removeAttr("data-vscr-padding-icrement").css(this._padding,"")},_removeCellPadding:function(table,tableGroup,rowElement,removeAllPaddings){var i,$cell,cells,withoutLastCell=":not(:last)";if(removeAllPaddings===true){withoutLastCell=""}cells=table.find(" > "+tableGroup+" > tr:first > "+rowElement+withoutLastCell+"[data-vscr-padding-icrement]");for(i=0;i<cells.length;i++){$cell=$(cells[i]);$cell.removeAttr("data-vscr-padding-icrement");table.find(" > "+tableGroup+" > tr > "+rowElement+":nth-child("+($cell.index()+1)+")").css(this._padding,"")}},_increaseLastCellVScrollbarPadding:function(table,tableGroup,rowElement,paddingIncrement){var paddingValue,lastCells=table.find(" > "+tableGroup+" > tr > "+rowElement+":last-child"),currIncrement=parseInt(lastCells.first().attr("data-vscr-padding-icrement"),10),i=0,cell;if(this._isMultiRowGrid()){lastCells=[];for(i=0;i<this._rlm.length;i++){cell=this._getCellsByColKey(table,this._rlm[i][this._maxCols-1]);if(cell.length>0){lastCells=lastCells.concat(cell.toArray())}}lastCells=$(lastCells);currIncrement=parseInt(lastCells.first().attr("data-vscr-padding-icrement"),10)}this._removeCellPadding(table,tableGroup,rowElement);paddingValue=parseInt(lastCells.first().css(this._padding),10);paddingValue=paddingValue||0;if(currIncrement){paddingValue-=currIncrement}lastCells.css(this._padding,paddingValue+paddingIncrement);lastCells.first().attr("data-vscr-padding-icrement",paddingIncrement)},_updateHScrollbarVisibility:function(){var o=this.options,hasColVirt=o.columnVirtualization===true,$hScrollCntnrInner=this._getHScrollContainerInner(),scrollerContainer=this._hscrollbar(),visibleScroller=scrollerContainer.is(":visible"),gridW=this._gridInnerWidth,contW=this._gridContentWidth,shouldInitHeights=false,self=this;if(!scrollerContainer.length&&(hasColVirt||o.virtualizationMode==="continuous")){scrollerContainer=this._vhorizontalcontainer();visibleScroller=scrollerContainer.is(":visible")}scrollerContainer.css("display","");if(!scrollerContainer.is(":visible")&&scrollerContainer.length>0){scrollerContainer.css("display","none");return}if(o.rowVirtualization||o.virtualization){gridW=this.element.parent().width();if($.ig.util.isIE&&this._allColumnWidthsInPixels){contW=0;this.element.find(">colgroup>col").each(function(i,col){var w=col.width||col.style.width;if(w&&w.indexOf("px")>0){contW+=parseInt(w,10)}else{contW=self.element.width();return false}})}else{contW=this.element.width()}}if(gridW<contW){if(o.virtualizationMode==="continuous"&&(scrollerContainer.length===0||$hScrollCntnrInner.length===0)){this._vhorizontalcontainer().empty();this._renderHorizontalScrollContainer(this._calculateContainerWidth(false));shouldInitHeights=true}else if(o.virtualization||o.rowVirtualization){if((!o.width||o.width.indexOf&&o.width.indexOf("%")>0)&&!this._allColumnWidthsInPercentage&&!this._allColumnWidthsInPixels){scrollerContainer.css("display","none")}}}else{if(o.virtualizationMode==="continuous"&&scrollerContainer.length===0&&$hScrollCntnrInner.length){this._vhorizontalcontainer().empty().attr("style","");shouldInitHeights=true}scrollerContainer.css("display","none")}if(hasColVirt){scrollerContainer.css("display","");shouldInitHeights=!visibleScroller}shouldInitHeights=shouldInitHeights||scrollerContainer.is(":visible")!==visibleScroller;if(o.autoAdjustHeight&&shouldInitHeights){this._initializeHeights()}},_applyAutofitLastColInVirtGrid:function(gridContentWidth){var o=this.options,widthInPerc,widthInPx;
if(!o.rowVirtualization||o.columnVirtualization||o.autofitLastColumn){return true}gridContentWidth=gridContentWidth||this._gridContentWidth;widthInPx=this._gridHasWidthInPixels()&&gridContentWidth<parseFloat(o.width)&&gridContentWidth;widthInPerc=this._allColumnWidthsInPixels&&this._gridHasWidthInPercent();return!(widthInPx||widthInPerc)},_setGridWidthVirtGrid:function(width){var widthUnfixedContainer=width,id=this.id(),cols,$col,scrlbWidth=this._scrollbarWidth(),hasFixedCols=this.hasFixedColumns(),widthInPerc=typeof width==="string"&&width.indexOf("%")>0,wWithoutScrlbr=width,hScrollbarVisible=this._hscrollbar().length?this._hscrollbar().is(":visible"):this._vhorizontalcontainer().is(":visible");if(hasFixedCols&&!widthInPerc){widthUnfixedContainer=parseInt(width,10)-this.fixedBodyContainer().outerWidth()}wWithoutScrlbr=widthInPerc?width:parseInt(widthUnfixedContainer,10)-scrlbWidth;this.container().css("width",width);this.element.css("width",widthInPerc?"100%":wWithoutScrlbr);if(this.options.fixedHeaders){this.headersTable().css("width",widthInPerc?"100%":widthUnfixedContainer)}this.container().find("#"+id+"_headers_v").css("max-width","").css("width",widthInPerc?"100%":widthUnfixedContainer);this._vdisplaycontainer().css("max-width","").css("width",widthInPerc?"100%":wWithoutScrlbr);this._virtualcontainer().css("width",widthInPerc?"100%":widthUnfixedContainer);cols=this._virtualcontainer().find("> colgroup > col");$col=hasFixedCols&&this.fixingDirection()==="left"?cols.eq(1):cols.first();$col.attr("width",widthInPerc?"100%":wWithoutScrlbr);this.container().find("#"+id+"_footer_container").css("max-width","").css("width",widthInPerc?"100%":widthUnfixedContainer);this.container().find("#"+id+"_footers").css("max-width","").css("width",widthInPerc?"100%":widthUnfixedContainer);this._vhorizontalcontainer().css("width",widthInPerc?"100%":$.ig.util.isFF?parseFloat(widthUnfixedContainer)-scrlbWidth:widthUnfixedContainer);if(this.options.autofitLastColumn&&!(hasFixedCols&&this.fixingDirection()==="right")){this._rerenderColgroups();this._adjustLastColumnWidth(true)}this._gridInnerWidth=this._vdisplaycontainer().width();if(this._allColumnWidthsInPixels&&widthInPerc){if(this.options.fixedHeaders){this.headersTable().css("max-width",this._gridInnerWidth)}this.element.css("max-width",this._gridInnerWidth);if(this.options.fixedFooters){this.footersTable().css("max-width",this._gridInnerWidth)}}this._updateGridContentWidth();if(hScrollbarVisible!==this._vhorizontalcontainer().is(":visible")){this._rerenderColgroups();this._updateGridContentWidth()}},_setGridWidth:function(width){if(this.options.virtualization===true||this.options.columnVirtualization===true||this.options.rowVirtualization===true){return this._setGridWidthVirtGrid(width)}var widthUnfixedContainer=width,hasFixedCols=this.hasFixedColumns(),widthInPerc=typeof width==="string"&&width.indexOf("%")>0;if(hasFixedCols&&width&&!widthInPerc){widthUnfixedContainer=parseInt(width,10)-this.fixedBodyContainer().outerWidth()}else if(widthInPerc){widthUnfixedContainer="100%"}this.container().css("width",width);this.element.css("width",widthUnfixedContainer);if(this.options.fixedHeaders){this.headersTable().css("width",widthInPerc?"100%":width)}if(this.options.fixedFooters){this.footersTable().css("width",widthInPerc?"100%":width)}if(!this._allColumnWidthsInPercentage||!widthInPerc){this._gridInnerWidth=this.scrollContainer().width()}if(this.options.autofitLastColumn&&!(hasFixedCols&&this.fixingDirection()==="right")){this._rerenderColgroups();this._adjustLastColumnWidth(true)}if(this.options.width!==null||this.options.height!==null){this._updateGridContentWidth()}},_setGridContentWidth:function(gridContentWidth){var o=this.options,w,$hscrlbar,$parent,oAvgRowHeight,fixedCols=this.hasFixedColumns(),fixedDirRight=this.fixingDirection()==="right",v=o.virtualization===true||o.rowVirtualization===true||o.columnVirtualization===true;if(v===false||o.rowVirtualization&&!this._applyAutofitLastColInVirtGrid(gridContentWidth)){this._setGridTablesWidth(gridContentWidth);if(v){this._avgRowHeight=this._calculateAvgRowHeight();if(oAvgRowHeight!==this._avgRowHeight){this._trigger("avgRowHeightChanged",null,{owner:this,oAvgRowHeight:null,avgRowHeight:this._avgRowHeight})}}}else{this._checkAndSetTableWidths()}if(this.options.height!==null){this._gridContentWidth=gridContentWidth||this._gridContentWidth;if(this._gridContentWidth){w=(this._hasVerticalScrollbar||this.options.rowVirtualization||this.options.virtualizationMode==="continuous"&&this.options.virtualization)&&!($.ig.util.isFF&&v)&&!(fixedCols&&fixedDirRight)&&this.options.fixedHeaders?this._gridContentWidth-this._scrollbarWidth():this._gridContentWidth;$hscrlbar=this._getHScrollContainerInner();if(!v&&!$hscrlbar.length){$parent=this.element.parent();this._addHorizontalScrollBar($parent);if($parent.css("overflow-x")!=="hidden"){$parent.css("overflow-x","hidden")}$hscrlbar=this._getHScrollContainerInner()}w=v&&!$.ig.util.isIE&&!this.hasFixedColumns()?this.element.width()||w:w;$hscrlbar.css("width",w)}this._updateHScrollbarVisibility()}},_checkAndSetTableWidths:function(){var o=this.options,w,func;func=function(tbl,w){if(!tbl.length){return}var tblw=tbl[0].style.width;if(!tblw||tblw.indexOf("%")>0){return null}if(!w){w=0;tbl.find(">colgroup>col").each(function(ind,col){var cw=col.width||col.style.width;if(!cw||cw.indexOf&&cw.indexOf("%")>0){w=0;return false}w+=parseInt(cw,10)})}if(w){tbl[0].style.width=w+"px"}return w};if(o.showHeader&&o.fixedHeaders&&o.height!==null){w=func(this.headersTable())}func(this.element,w);if(o.showFooter&&o.fixedFooters===true&&o.height!==null){func(this.footersTable(),w)}},_setGridTablesWidth:function(width){var hasFixedHeaders=this.options.showHeader&&this.options.fixedHeaders===true&&this.options.height!==null,hasFixedFooters=this.options.showFooter&&this.options.fixedFooters===true&&this.options.height!==null;this.element.css("width",width);if(hasFixedHeaders){this.headersTable().css("width",width)}if(hasFixedFooters){this.footersTable().css("width",width)}},_detachHiddenColumns:function(){var col,i;for(i=0;i<this.options.columns.length;i++){col=this.options.columns[i];if(col.hidden){this._detachColumn(col)}}},_rerenderColgroups:function(){var hasFixedHeader=this.options.height!==null&&this.options.fixedHeaders===true&&this.options.showHeader,hasFixedFooter=this.options.height!==null&&this.options.fixedFooters===true&&this.options.showFooter,initial=this.options.autofitLastColumn;if(hasFixedHeader){this.headersTable().children("colgroup").remove();this._renderColgroup(this.headersTable()[0],true,false,initial)}if(hasFixedFooter){this.footersTable().children("colgroup").remove();this._renderColgroup(this.footersTable()[0],false,true,initial)}this.element.children("colgroup").remove();this._renderColgroup(this.element[0],false,false,initial);this._fireInternalEvent("_colgroupsRerendered")},_detachColumn:function(col){var position,cols,headerCells,isMultiColumnGrid=this._isMultiColumnGrid;col.hidden=false;this._visibleColumnsArray=undefined;cols=this._visibleColumns();position=$.inArray(col,cols);col.hidden=true;this._visibleColumnsArray=undefined;this._initializeDetachedContainers();headerCells=this.headersTable().children("thead").children("tr").not("[data-skip=true]");if(isMultiColumnGrid){this._hideMultiHeaderCells(this._headerCells,col.key);headerCells=this.headersTable().children("thead").children("tr:not([data-mch-level])").not("[data-skip=true]");this._detachCells(headerCells,function(row){return row.filter(":not([data-new-row],[data-add-row])").children("th, td").not("[data-skip=true]")},position,this._detachedHeaderCells,col.key)}else{this._detachCells(headerCells,function(row){return row.filter(":not([data-new-row],[data-add-row])").children("th, td").not("[data-skip=true]")},position,this._detachedHeaderCells,col.key)}this._detachCells(this.footersTable().children("tfoot").children("tr"),function(row){return row.children("td").not("[data-skip=true]")},position,this._detachedFooterCells,col.key);return position},_attachColumn:function(col){var headerCells,visibleCols=this._visibleColumns(),position=$.inArray(col,visibleCols);this._initializeDetachedContainers();if(this._isMultiColumnGrid){this._showMultiHeaderCells(col.key);headerCells=this.headersTable().children("thead").children("tr:not([data-mch-level])").not("[data-skip=true]");this._attachCells(headerCells,function(row){return row.children("th, td").not("[data-skip=true]")},position,this._detachedHeaderCells,col.key);delete this._detachedHeaderCells[col.key]}else{this._attachCells(this.headersTable().children("thead").children("tr").not("[data-skip=true]"),function(row){return row.children("th, td").not("[data-skip=true]")},position,this._detachedHeaderCells,col.key)}this._attachCells(this.footersTable().children("tfoot").children("tr"),function(row){return row.children("td").not("[data-skip=true]")},position,this._detachedFooterCells,col.key);return position},_initializeDetachedContainers:function(){if(!this._detachedContainersInitialized){this._detachedHeaderCells={};this._detachedFooterCells={};this._detachedContainersInitialized=true}},_getParentsMultiHeader:function(key){var i,cols=this._oldCols,colsLength=cols.length,arr=[];for(i=0;i<colsLength;i++){if(cols[i].key===key||cols[i].identifier===key){arr.push(cols[i]);break}if(cols[i].group){if(this._getParentsMultiHeaderRecursive(key,cols[i].group,arr)===true){arr.push(cols[i]);break}}}return arr},_getParentsMultiHeaderRecursive:function(key,arr,resArr){var i,cols=arr,colsLength=arr.length,res=false;for(i=0;i<colsLength;i++){if(cols[i].key===key||cols[i].identifier===key){resArr.push(cols[i]);res=true;break}if(cols[i].group&&this._getParentsMultiHeaderRecursive(key,cols[i].group,resArr)===true){resArr.push(cols[i]);res=true;break}}return res},_hideMultiHeaderCells:function(headerCells,key){var i,currentCell,parents=this._getParentsMultiHeader(key),parent,colspan,$th,headersTable=this.headersTable().find("thead > tr"),$tr,position=-1,cells=[];for(i=0;i<headerCells.length;i++){if(this.id()+"_"+key===headerCells[i].attr("id")){position=i;break}}if(position===-1){currentCell=$("#"+this.id()+"_"+key);if(!currentCell.length||!currentCell.parent().is("tr")){return}}else{currentCell=headerCells[position];this._headerCells.splice(position,1)}$tr=currentCell.closest("tr");if($tr[0].style.height===""){$tr[0].style.height=$tr.outerHeight()+"px"}currentCell.css("display","none");this._hiddenColumns[key]=currentCell;cells.push(currentCell);this._detachedHeaderCells[key]=cells;if(parents.length>0){for(i=0;i<parents.length;i++){parent=parents[i];if(parent.level===0){continue}$th=headersTable.find("th[data-mch-id="+parent.identifier+"]");if($th.length===0){$th=this.fixedHeadersTable().find("thead > tr").find("th[data-mch-id="+parent.identifier+"]")}colspan=parseInt($th.attr("colspan"),10);if(colspan>1){$th.attr("colspan",--colspan);parent.colspan=colspan}else{$tr=$th.closest("tr");if($tr[0].style.height===""){$tr[0].style.height=$tr.outerHeight()+"px"}$th.attr("ishidden",1);$th.css("display","none");parent.hidden=true;parent.colspan=0}}}},_detachCells:function(rows,cellSelectorFunction,position,container,key){var detachedCells=[],i,cells,currentCell;if(rows.length>0){for(i=0;i<rows.length;i++){cells=cellSelectorFunction(rows.eq(i));currentCell=cells.eq(position);if(cells.length===1){currentCell.after($("<"+currentCell[0].tagName+"></"+currentCell[0].tagName+">").attr("data-hiddenreplacement","true").css("height",currentCell.height()).attr("class",currentCell.attr("class")))}detachedCells.push(currentCell.detach())}container[key]=detachedCells}},_showMultiHeaderCells:function(key){var i,currentCell=this._hiddenColumns[key],parents=this._getParentsMultiHeader(key),parent,colspan,$th,currentOrder,order,headerCellsLength=this._headerCells.length,headersTable=this.headersTable().find("thead > tr"),isHidden,targetIndex,indexInParent,after,visibleChildren;if(currentCell===null||currentCell===undefined){return}currentOrder=currentCell.data("data-mch-order");for(i=0;i<headerCellsLength;i++){order=this._headerCells[i].data("data-mch-order");if(currentOrder<order){this._headerCells.splice(i,0,currentCell);break}}if(i===headerCellsLength){this._headerCells.push(currentCell)}currentCell.css("display","");currentCell.removeAttr("ishidden");if(parents.length>0){for(i=0;i<parents.length;i++){parent=parents[i];if(parent.level===0){continue}$th=headersTable.find("th[data-mch-id="+parent.identifier+"]");if($th.length===0){$th=this.fixedHeadersTable().find("thead > tr").find("th[data-mch-id="+parent.identifier+"]")}isHidden=$th.attr("ishidden")==="1";colspan=parseInt($th.attr("colspan"),10);if(!isHidden){$th.attr("colspan",++colspan);parent.colspan=colspan;visibleChildren=parent.children.filter($.proxy(this._columnVisible,this));indexInParent=visibleChildren.indexOf(this.columnByKey(key));targetIndex=indexInParent===0?1:indexInParent-1;after=indexInParent>targetIndex;this._moveThs({from:headersTable},key,visibleChildren[targetIndex].key,after)}else{$th.removeAttr("ishidden");$th.css("display","");parent.hidden=false;parent.colspan=1}}}},_attachCells:function(rows,cellSelectorFunction,position,container,key){var detachedCells,i,cells,replacementCell,storedKey;if(rows.length>0){if(this.options.virtualization===true||this.options.columnVirtualization===true){detachedCells=container[key];if(detachedCells===null||detachedCells===undefined){for(storedKey in container){if(container.hasOwnProperty(storedKey)){detachedCells=container[storedKey];delete container[storedKey];break}}}else{delete container[key]}}else{detachedCells=container[key];delete container[key]}if(detachedCells===undefined||detachedCells===null){return}for(i=0;i<rows.length;i++){cells=cellSelectorFunction(rows.eq(i)).not("[data-hiddenreplacement=true]");if(position===0){if(cells.length===0){replacementCell=rows.eq(i).find("[data-hiddenreplacement=true]");replacementCell.after(detachedCells[i]);replacementCell.remove()}else{cells.eq(0).before(detachedCells[i])}}else{cells.eq(position-1).after(detachedCells[i])}}}},_cleanupTBody:function(){this._fireInternalEvent("_cleanupTBody");return this.element.children("tbody").empty()},_captureInitiallyHiddenColumns:function(){this._initialHiddenColumns=$.grep(this.options.columns,function(column){var hidden=column.hidden;column.hidden=false;return hidden})},getUnboundValues:function(key){var res;if(key===undefined||key===null){return this._unboundValues}res=this._unboundValues[key];if(res===undefined||res===null){if(this.getUnboundColumnByKey(key)!==null){res=[]}else{res=null}}return res},setUnboundValues:function(key,values,removeOldValues){var i,column=this.getUnboundColumnByKey(key),uVals,data,len,reRenderData=false;if(column&&!column.formula){uVals=column.unboundValues;if(removeOldValues){column.unboundValues=values;data=this.dataSource.data();len=data.length;for(i=0;i<len;i++){if(data[i][key]!==null&&data[i][key]!==undefined){reRenderData=true;delete data[i][key]}}if(reRenderData){this._renderData()}}else{len=values.length;if(uVals&&uVals.length>len){for(i=0;i<len;i++){column.unboundValues[i]=values[i]}}else{column.unboundValues=values}}}if(!this._hasInitialUnboundValues){this._hasInitialUnboundValues={}}this._hasInitialUnboundValues[key]=true;this._renderUnboundValues(values,key)},setUnboundValueByPK:function(col,rowId,val,notToRender){var data=this.dataSource.data(),pkCol,rec,tr,f,pk=this.options.primaryKey,colKey,pkVal;if($.type(col)==="string"){colKey=col;col=this.columnByKey(colKey)}else{colKey=col.key}if(!col||!col.unbound){return false}if(pk===null){pkVal=parseInt(rowId,10);rec=data[pkVal]}else{pkCol=this.columnByKey(this.options.primaryKey);if(pkCol){pkVal=rowId;if(pkCol.dataType==="number"||pkCol.dataType==="numeric"){pkVal=parseInt(rowId,10);rec=this.dataSource.findRecordByKey(rowId)}else{rec=this.dataSource.findRecordByKey(rowId)}}else{return false}}if(!rec){return false}if(val===undefined){if(col.formula){f=this._getUnboundColumnFormula(col);if(f){val=f.apply(col,[rec,this.element])}}}if(this.dataSource&&this.dataSource.schema){rec[colKey]=this.dataSource.schema()._convertType(col.type,val,pkVal,colKey)}else{rec[colKey]=val}if(!notToRender){tr=this.rowById(rowId,col.isFixed);if(tr.length){this._renderRow(rec,tr[0])}}return rec},_getUnboundColumnFormula:function(col){if(!col){return null}var f=null,colType=typeof col;if(colType==="string"){col=this.getUnboundColumnByKey(col);if(!col){return null}colType=typeof col}if(!col.formula||colType!=="object"){return null}f=col.formula;if(typeof f==="function"){return f}else if(window[f]&&typeof window[f]==="function"){return window[f]}return null},_renderUnboundValues:function(values,key,notToRender){var i,data=this.dataSource.data(),dataLength=data.length,valuesLength=values.length,isToConvert=false,type="string",pk=this.options.primaryKey,col,schema,pkVal;if(valuesLength===0){return}col=this.getUnboundColumnByKey(key);if(col===null){return}if(this.dataSource&&this.dataSource.schema){if(col.dataType){type=col.dataType;isToConvert=true;schema=this.dataSource.schema()}}if(pk===undefined){pk=null}for(i=0;i<valuesLength;i++){if(data[i]===undefined||data[i]===null){break}if(isToConvert){if(pk===null){pkVal=i}else{pkVal=data[i][pk]}values[i]=schema._convertType(type,values[i],pkVal,key)}data[i][key]=values[i];this._addUnboundColumnValue(key,values[i],i)}if((type==="bool"||type==="boolean")&&valuesLength<dataLength){for(i=valuesLength;i<dataLength;i++){data[i][key]=schema._convertType(type,null,pkVal,key)}}if(this.options.virtualization===true||this.options.rowVirtualization===true&&this._persistVirtualScrollTop){this._scrollTo(0)}if(notToRender!==true){this._renderColumnData(key,this._getDataView())}},getUnboundColumnByKey:function(key){if(this._unboundColumns===undefined||this._unboundColumns===null||this._unboundColumns.length===0||key===null||key===undefined){return null}var column=null;$.each(this._unboundColumns,function(ind,col){if(col.key===key){column=col;return false}});return column},_renderColumnData:function(key,data){data=data||this._getRenderedDataRecords();if(data.length===0){return}var column=this.columnByKey(key),grid=this,$table,hasTemplate,$tds,temp;if(!column||!this._columnVisible(column)){return}$table=column.fixed?$("#"+this.id()+"_fixed"):this.element;hasTemplate=column.template&&column.template.length>0;$tds=this._getCellsByColKey($table.find("tbody"),key);$tds.slice(0,data.length).each(function(index){var record=data[index],html;if(!record){return true}if(hasTemplate){temp=grid._renderTemplatedCell(record,column);if(temp.indexOf("<td")===0){html=$(temp).html()}else{html=temp}}else{html=grid._renderCell(record[key],column,record)}$(this).html(html)})},_renderData:function(success,errmsg,response){if(success!==undefined||!this._isDataBoundCalled){this._trigger(this.events.dataBound,null,{owner:this,dataSource:this.dataSource});this._isDataBoundCalled=false}var gridElement=this.element,div,self=this,noCancel=true,sum=0,cols,colsToUnbound,colsLength,data,key,j,i,f,w,diff=0,isTable=false,noCancelError=true,isRemoteDS=this._inferOpType()==="remote",ucFormulaFunction,tbody,newW,totalWidth,isToRefreshUI=false,jsrnd=String(this.options.templatingEngine).toLowerCase()==="jsrender",displayCont,scrollTop=this._getIgScrollPositionTop();if(!this._initialized&&this.options.autoGenerateColumns===true){this._generateColumns()}if((this.requiresDataBinding===true||this._isToSetUnboundColumns===true||isRemoteDS)&&this._hasUnboundColumns){this._isToSetUnboundColumns=false;if(this._hasInitialUnboundValues===null||this._hasInitialUnboundValues===undefined){this._hasInitialUnboundValues={}}cols=this.options.columns;colsLength=cols.length;data=this.dataSource.data();ucFormulaFunction=function(data,f,col){$.each(data,function(ind,val){val[key]=f.apply(col,[val,gridElement]);self._addUnboundColumnValue(key,val[key],ind)})};colsToUnbound=[];if(isRemoteDS){this._unboundValues={}}for(i=0;i<colsLength;i++){if(cols[i].unbound===true){key=cols[i].key;if(cols[i].unboundValues!==null&&cols[i].unboundValues!==undefined&&$.type(cols[i].unboundValues)==="array"){if(this._rebindUnboundColumns===true||cols[i].unboundValues.length>0&&this._hasInitialUnboundValues[key]===undefined){this._hasInitialUnboundValues[key]=true;this._renderUnboundValues(cols[i].unboundValues,key,true)}}else if(cols[i].formula!==null&&cols[i].formula!==undefined){f=this._getUnboundColumnFormula(cols[i]);if(f){ucFormulaFunction(data,f,cols[i])}}else if(this._unboundValues[key]&&this._unboundValues[key].length>0){colsToUnbound.push(key)}}}this._rebindUnboundColumns=false;if(this.options.localSchemaTransform===true&&colsToUnbound.length>0&&data.length>0){for(i=0;i<colsToUnbound.length;i++){key=colsToUnbound[i];if(data[0][key]===undefined){this._renderUnboundValues(this._unboundValues[key],key)}}}if(this.options.mergeUnboundColumns===false){this._mergeUnboundValues()}}if(success===false){noCancelError=this._trigger(this.events.requestError,null,{owner:this,message:errmsg,response:response});if(noCancelError){throw new Error(errmsg)}}if(this._cancelRendering===true){this._cancelRendering=false;return}this.element.trigger("iggriduisoftdirty",{owner:this});if(!this._initialized){if(this.options.autoGenerateColumns===true){if((this.options.virtualization===true||this.options.columnVirtualization===true)&&this.options.width){totalWidth=this._calculateContainerWidth(false);if(totalWidth>parseInt(this.options.width,10)&&$("#"+this.id()+"_horizontalScrollContainer").children().length===0){this._renderHorizontalScrollContainer(totalWidth)}}for(i=0;i<this.options.features.length;i++){this._initFeature(this.options.features[i],this._dataOptions)}}else{cols=this.options.columns;for(i=0;i<cols.length;i++){if(cols[i].headerText===undefined){cols[i].headerText=cols[i].key}if(!cols[i].dataType&&this.dataSource.data().length>0){cols[i].dataType=$.ig.getColType(this.dataSource.data()[0][cols[i].key])}else if(!cols[i].dataType&&this.dataSource.data().length===0){cols[i].dataType="string"}}}}tbody=gridElement.children("tbody");noCancel=this._trigger(this.events.dataRendering,null,{owner:this,tbody:tbody});if(noCancel){if(!(this.options.dataSource&&this.options.dataSource.tagName&&$(this.options.dataSource).is("table"))){tbody=this._cleanupTBody()}else{isTable=true}this._resetVirtualDom();if(!this._initialized){if(this.options.autoGenerateColumns===true){this._captureInitiallyHiddenColumns();this._visibleColumnsArray=undefined;this._updateVirtColCounters()}if(isTable){tbody.empty()}if(this._renderHeaderCalled!==true){this._renderHeader();this._renderCaption()}else{if(this.options.width!==null&&this.options.height===null){this.scrollContainer().css("overflow-y","hidden").css("overflow-x","auto")}}if(this._rmvClgrpOnInitRenderData&&!this.element.find("colgroup[data-cols-injected]").length){this.element.find("colgroup").remove()}if(this.element.find("colgroup").length===0||this.element.find("colgroup").children().length===0){this._renderColgroup(this.element[0],false,false,this.options.autofitLastColumn)}this._renderFooter();div=this.scrollContainer();if(!div.length){div=this._vdisplaycontainer()}div.data("containerName","dataContainer").bind("scroll.syncScrollContainers",$.proxy(this._onScrollContainer,this));this._registerScrllCntnrToSync(div);if((this.options.virtualization===true||this.options.columnVirtualization===true)&&this._allColumnWidthsInPixels&&this._gridHasWidthInPercent){w=0;this.element.find(">colgroup>col").each(function(ind,col){var cw=col.width||col.style.width;if(!cw||cw.indexOf&&cw.indexOf("%")>0){w=0;return false}w+=parseInt(cw,10)});if(w){if(this.options.fixedHeaders){this.headersTable().css("max-width",w)}this.element.css("max-width",w);if(this.options.fixedFooters){this.footersTable().css("max-width",w)}}}if(this.options.virtualization&&this.options.virtualizationMode==="continuous"){this.element.bind("iggridvirtualrecordsrender.setFocusElement",function(){if(_aNull(self._focusDataRowIndex)){return}var $tbody=self.container().find("#"+self.id()+" > tbody"),fe=self._focusDataRowIndex;if(fe===0){$tbody.find("> tr[data-row-idx="+fe+"]").focus()}else{$tbody.find("> tr[data-row-idx="+fe+"] > td:visible:last").focus()}self._focusDataRowIndex=null})}}this._trigger("dataEmpty",null,{owner:this,tbody:tbody});if(this.options.autoGenerateColumns===false&&(this.options.columns&&this.options.columns.length===0||!this.options.columns)){throw new Error(this._getLocaleValue("noColumnsButAutoGenerateTrue"))}this._tmplWrappers=jsrnd?$.render:{};this._setTemplateDefinition(jsrnd);if(this._initialHiddenColumns===undefined||this._initialHiddenColumns.length===0){if(this.options.columns.length>0){if(this.options.virtualization===true||this.options.rowVirtualization===true||this.options.columnVirtualization===true){if(!this._persistVirtualScrollTop){this._scrollContainer()[0].scrollTop=0}this._renderVirtualRecords()}else{this._renderRecords()}if(this._initialized){this._adjustLastColumnWidth(false);if(this.options.width!==null&&this.options.height!==null){this._synchronizeHScroll()}}else{if(this.options.height!==null&&this.options.autoAdjustHeight){this._initializeHeights()}this._adjustLastColumnWidth(true)}}}if(!this._initialized&&this.options.autoAdjustHeight){this._initializeHeights()}if(this._initialHiddenColumns!==undefined&&this._initialHiddenColumns.length>0){if(this._isMultiRowGrid()){throw new Error(this._getLocaleValue("multiRowLayoutHidingNotSupported"))}this._setHiddenColumns(this._initialHiddenColumns,true,true);if(this._initialHiddenCells!==undefined&&this._initialHiddenCells.length>0){$.each(this._initialHiddenCells,function(index,cell){cell.css("display","")})}$.each(this._initialHiddenColumns,function(index,column){column._initiallyHidden=true;column._shouldAutoSize=true});this._initialHiddenCells=undefined;this._initialHiddenColumns=undefined;this._visibleColumnsArray=undefined;if($.ig.util.isFF){isToRefreshUI=true}}if(!this._initialized){this._trigger("_gridContainersRendered",null,{owner:this,tbody:tbody})}this._registerAdditionalEvents();this._updateVirtualScrollContainer();this._fireInternalEvent("_dataRendered");if(!this._initialized){this.autoSizeColumns()}this._trigger(this.events.dataRendered,null,{owner:this});if(this._loadingIndicator===undefined){this._initLoadingIndicator()}this._loadingIndicator.hide()}if(this._fixScrollY){this.scrollContainer().css("overflow-y",this.rows().length>1?"hidden":"visible")}if($.ig.util.isTouchDevice()){this._setIgScrollPositionTop(scrollTop)}if(this.options.width===null){this._updateContainersWidthOnGridWidthNull()}if(this.options.dataSourceUrl!==null&&this._firstBind){this.options.dataSource=this.options.dataSourceUrl;this.dataSource.settings.dataSource=this.options.dataSourceUrl;this.dataSource.settings.type="remoteUrl";this.dataSource._runtimeType=this.dataSource.analyzeDataSource();this._firstBind=false}if(!this._initialized){this._initialized=true;this._trigger(this.events.rendered,null,{owner:this});this._hc=this.container().find(".ui-iggrid-expandheadercell").length>0;if(document.documentMode===7||$.ig.util.isIE7){$.each($("#"+this.id()+"_container colgroup col"),function(){var $col=$(this),styleWidth=parseInt(this.style.width,10),width=$col.outerWidth();if(styleWidth&&styleWidth<width){$col.width(2*styleWidth-width)}})}}this._fireInternalEvent("_gridRendered",this.container());if(this._isMultiRowGrid()&&this.scrollContainer()&&this.scrollContainer().height()===0){throw new Error(this._getLocaleValue("scrollableGridAreaNotVisible"))}if(isToRefreshUI){this._refreshUI()}},_updateContainersWidthOnGridWidthNull:function(){var $cntnr=this.container(),sum=0,j,cols,diff,displayCont,scw=this._scrollbarWidth();if(this.options.width===null&&$cntnr[0]&&$cntnr[0].style.width){cols=this.element.find("colgroup > col");if(cols.length){for(j=0;j<cols.length;j++){sum+=parseInt(cols[j].style.width,10)||0}}else{sum=parseInt($cntnr[0].style.width,10)-scw}displayCont=this._vdisplaycontainer();if(displayCont.length>0){$cntnr.css("width",sum);$cntnr.find("#"+this.id()+"_headers_v").css("width",sum+scw);$cntnr.css("width",sum+scw);displayCont.css("width",sum).css("max-width",sum);this._fixedfooters().css("width",sum+scw);this._virtualcontainer().find(">colgroup>col:first").attr("width",sum)}else{$cntnr.css("width",sum+=this.hasVerticalScrollbar()?scw:0)}}},_refreshUI:function(){var self=this;self.container().hide();setTimeout(function(){self.container().show()},0)},_updateVirtualScrollContainer:function(){var h,e=this.element;this._totalRowCount=this._getTotalRowCount();if((this.options.virtualization||this.options.rowVirtualization)&&this._totalRowCount){if(this._avgRowHeight===undefined||this._avgRowHeight===null){this._avgRowHeight=this._calculateAvgRowHeight()}h=this._totalRowCount*this._avgRowHeight;if(this._scrollContainer().height()>=h){e.height("");if(this.options.virtualizationMode==="fixed"){e.find(".ui-iggrid-virtualrow").height(this._avgRowHeight)}this._setScrollContainerHeight(h)}else{if(this.options.virtualizationMode==="continuous"){e.height("");this._setScrollContainerHeight(h)}else{e.height(this._initialVirtualHeight)}}}},_hasColumnTemplates:function(){var i,hasTemplates=false,t;for(i=0;i<this.options.columns.length;i++){t=this.options.columns[i].template;if(t!==null&&t!==undefined&&t!==""&&t.length>0){hasTemplates=true;break}}return hasTemplates},_gridHasWidthInPixels:function(){if(typeof this.options.width==="string"&&this.options.width.indexOf("%")!==-1){return false}return parseInt(this.options.width,10)>0},_gridHasWidthInPercent:function(){if(typeof this.options.width==="string"&&this.options.width.indexOf("%")!==-1){return true}return false},_isColumnVirtualizationEnabled:function(){var i,w,o=this.options,cols,allColsInPercentage=true;if(!o.virtualization||o.virtualizationMode==="continuous"||o.width===null){return false}if(o.columnVirtualization){return true}cols=o.columns;for(i=0;i<cols.length;i++){if(cols[i].width){w=cols[i].width}w=_aNull(w)?o.defaultColumnWidth:w;if(!_aNull(w)&&($.type(w)!=="string"||!w.endsWith("%"))){allColsInPercentage=false;break}}if(!allColsInPercentage){return true}return false},hasVerticalScrollbar:function(){if(this.options.height===null||this.options.height===undefined){return false}var hasVScrollbar,tbody=this.element.children("tbody");hasVScrollbar=this.options.autoAdjustHeight&&this.element.outerHeight()<=this.scrollContainer().height()||!this.options.autoAdjustHeight&&tbody.innerHeight()<parseInt(this.options.height,10);return!hasVScrollbar},_adjustLastColumnWidth:function(colgroupsRerendered,specialWidth){var grid=this,calcGridWidth,fixedCols=this.hasFixedColumns(),hasFixedHeader=this.options.height!==null&&this.options.fixedHeaders===true&&this.options.showHeader&&this._headerParent,hasFixedFooter=this.options.height!==null&&this.options.fixedFooters===true&&this.options.showFooter&&this._footerParent,hasHeight=this.options.height&&parseInt(this.options.height,10)>0,hasWidthInPixels=this._gridHasWidthInPixels(),hasWidthInPercent=this._gridHasWidthInPercent(),hasVirtualization=this.options.virtualization===true||this.options.columnVirtualization===true||this.options.rowVirtualization===true,gridWidth,specialColumnsWidth;if(hasHeight&&!hasVirtualization){if(this.hasVerticalScrollbar()){this._hasVerticalScrollbar=true}else{this._hasVerticalScrollbar=false;if(this._scrollWidthAddedToContainerWidth){this.container().width(this._calculateContainerWidth(false))}}}if(colgroupsRerendered){if(hasVirtualization){if(hasFixedHeader){if(this._isMultiRowGrid()){this._headerParent.addClass(this.css.mrlGridHeaderScrollableTableClass)}this._headerParent.css(this._padding,this._scrollbarWidth())}if(hasFixedFooter){this._footerParent.css(this._padding,this._scrollbarWidth())}}if(hasWidthInPixels||hasWidthInPercent){if(this._allColumnWidthsInPixels){gridWidth=this._totalColPixelWidth;if(fixedCols&&!this._initialized){gridWidth=0;
$.each(this.options.columns,function(ind,col){gridWidth+=col.fixed||col.hidden?0:parseInt(col.width,10)||0})}specialColumnsWidth=specialWidth||this._calculateSpecialColumnsWidth();if(specialColumnsWidth>0){if(this._autoadjustedColumn&&this._lastColPixelWidth){if(this._autoadjustedColumn.difference<specialColumnsWidth){this._lastColPixelWidth-=this._autoadjustedColumn.difference;gridWidth-=this._autoadjustedColumn.difference-specialColumnsWidth}else{this._lastColPixelWidth-=specialColumnsWidth}this._autoadjustedColumn.width=this._lastColPixelWidth;if(hasFixedHeader){this._lastHeaderCol.css("width",this._lastColPixelWidth+"px")}if(hasFixedFooter){this._lastFooterCol.css("width",this._lastColPixelWidth+"px")}this._lastDataCol.css("width",this._lastColPixelWidth+"px")}else{gridWidth+=specialColumnsWidth}}if(!hasFixedHeader&&this._gridWidthGTColWidth&&this._hasVerticalScrollbar){gridWidth-=this._scrollbarWidth();this._lastColPixelWidth-=this._scrollbarWidth();if(this._lastDataCol){this._lastDataCol.css("width",this._lastColPixelWidth+"px")}}}else if(this._allColumnWidthsInPercentage){gridWidth=this.container().width();specialColumnsWidth=specialWidth||this._calculateSpecialColumnsWidth();if(this._allSpecialColumnsInPercentage()===true&&specialColumnsWidth>0){this._lastColPercentWidth=this._lastColPercentWidth-specialColumnsWidth}if(this._lastDataCol){this._lastDataCol.css("width",this._lastColPercentWidth+"%")}if(hasFixedHeader){this._lastHeaderCol.css("width",this._lastColPercentWidth+"%")}if(hasFixedFooter){this._lastFooterCol.css("width",this._lastColPercentWidth+"%")}}else if(hasWidthInPixels){calcGridWidth=this._calculateContainerWidth(false);gridWidth=parseInt(grid.options.width,10);if(calcGridWidth>gridWidth){gridWidth=calcGridWidth}}else if(hasWidthInPercent){gridWidth=this.container().width()}if(!this._allColumnWidthsInPercentage||!hasWidthInPercent){if(hasVirtualization===false){this._gridInnerWidth=this.scrollContainer().width()}else{this._gridInnerWidth=this._vdisplaycontainer().width()+this._scrollbarWidth()}grid._setGridContentWidth(gridWidth);if(!this._hasVerticalScrollbar&&this.hasVerticalScrollbar()&&hasHeight&&!hasVirtualization){this._hasVerticalScrollbar=true;grid._setGridContentWidth(gridWidth)}}}}else{this._setGridContentWidth()}if(hasHeight&&!hasVirtualization){if(this.options.width!==null&&this.options.height!==null){if(this._hasVerticalScrollbar){this._hscrollbarcontent().css("overflow-y","scroll")}else{this._hscrollbarcontent().css("overflow-y","hidden")}}if(this._allColumnWidthsInPercentage&&hasWidthInPercent||!(hasWidthInPixels||hasWidthInPercent)){if(this._hasVerticalScrollbar){if(hasFixedHeader){if(this._isMultiRowGrid()){this._headerParent.css("width","calc(100% - "+this._scrollbarWidth()+"px)")}else{this._headerParent.css(this._padding,this._scrollbarWidth())}}if(hasFixedFooter){this._footerParent.css(this._padding,this._scrollbarWidth())}}else{if(hasFixedHeader){this._headerParent.css(this._padding,"")}if(hasFixedFooter){this._footerParent.css(this._padding,"")}}}else{this._updateVerticalScrollbarCellPadding()}}this._trigger("_lastColumnWidthAutoAdjusted",null,{specialColumnsWidth:specialColumnsWidth})},_initializeHeights:function(){if(this.options.height===null||this.options.height===undefined){return}if(this.options.height.indexOf&&this.options.height.indexOf("%")!==-1){if(this._isWrapped&&!this._initialized){this.container().parent().height(this.options.height);this.container().height("100%")}}else if(!this.hasFixedColumns()){this.scrollContainer().height(parseInt(this.options.height,10))}this._initializeHeightsInternal()},_initializeHeightsInternal:function(){var children,height,i,$child,ch,heightChanged=false,dc=this._vdisplaycontainer(),vhcntnr,sc=this._scrollContainer(),hasFixedHeader=this.options.height!==null&&this.options.fixedHeaders===true&&this.options.showHeader;ch=Math.round(this.container().outerHeight());this._prevContainerHeight=ch;if(this.options.height!==null){children=this.container().children(":visible");if(!hasFixedHeader&&this._headerParent){children.push(this._headerParent.find(">thead"))}height=0;for(i=0;i<children.length;i++){$child=$(children[i]);if(($child.attr("id")!==undefined&&!$child.attr("id").endsWith("_scroll")&&!$child.attr("data-fixed-container")&&!$child.attr("id").endsWith("_virtualContainer")&&!$child.attr("id").endsWith("_loading")||!$child.attr("id"))&&$child.is(":visible")&&$child.data("efh")!=="1"&&$child.attr("touch-bar")!=="true"){if($child.is("table")&&$child.children().first().is("caption")){height+=$child.children().first().outerHeight()}else{if($child.css("position")!=="absolute"){height+=$child.outerHeight()}}}}if(height>0){this._trigger("_heightChanging",null,{ch:ch,h:height});this.scrollContainer().outerHeight(ch-height);heightChanged=true}if(this.options.virtualization||this.options.rowVirtualization){if($.type(this.options.height)==="string"&&this.options.height.indexOf("%")!==-1||ch!==parseInt(this.options.height,10)){this.container().height(this.options.height);if($.type(this.options.height)==="string"&&this.options.height.indexOf("%")!==-1){ch=parseInt(this.container().height()||0,10)}}height+=this.container().find("#"+this.id()+"_headers_v").outerHeight()||0;height+=this.container().find("#"+this.id()+"_footers_v").outerHeight()||0;height+=this._fixedfooters().outerHeight()||0;vhcntnr=this._vhorizontalcontainer();height+=vhcntnr.is(":visible")?vhcntnr.outerHeight():0;if(!this._virtualHeightReset){height=height*2;this._virtualHeightReset=true}if(height>0&&dc.height()!==ch-height){if(!heightChanged){this._trigger("_heightChanging",null,{ch:ch,h:height})}dc.height(ch-height);sc.height(ch-height);if(!(this.options.virtualization||this.options.rowVirtualization)){this.element.height(ch-height)}this._initialVirtualHeight=ch-height;heightChanged=true}}if(heightChanged){this._prevContainerHeight=this.container().height();this._trigger("_heightChanged",null,{ch:ch,h:height})}}},_registerAdditionalEvents:function(){if(this._hovEvts){return}var self=this;if(this.options.enableHoverStyles){this._hovEvts={mousemove:function(e){var par,tag,tr=e.target;while(tr){par=tr.parentNode;tag=tr.nodeName;if(tag==="TR"&&par.nodeName==="TBODY"){break}tr=tag==="TABLE"?null:par}self._mousemoveTr(tr,e)},mouseleave:function(){self._mouseleaveTr()}};this.element.bind(this._hovEvts)}},_mousemoveTr:function(tr,e){var css="ui-state-hover",topmostGrid,$tr=$(tr);if(_hovTR!==tr){if(_hovTR&&$(_hovTR).attr("data-container")!=="true"){$("td,th",_hovTR).removeClass(css)}if(tr&&$tr.attr("data-container")!=="true"&&e.target.id.indexOf("_scrollContainer")===-1&&e.target.parentNode.id.indexOf("_scrollContainer")===-1){topmostGrid=this.element.closest(".ui-iggrid-root").data("igGrid")||this;tr=$tr.add($tr.siblings("[data-id='"+$tr.attr("data-id")+"']"));if(!topmostGrid._cancelHoveringEffects){$("td,th",tr).addClass(css)}}_hovTR=tr}},_mouseleaveTr:function(){var css="ui-state-hover";if(_hovTR){$("td,th",_hovTR).removeClass(css);_hovTR=null}},_renderColgroup:function(table,isHeader,isFooter,autofitLastColumn,md){var colgroup,hasFixedColumns=this.hasFixedColumns(),i,lc,fixed=!!(md&&md.fixed),f,cols=this._visibleColumns(),col,defWidth=this.options.defaultColumnWidth,totalColWidth=0,totalGridWidth,hasWidthInPixels=this._gridHasWidthInPixels(),hasWidthInPercent=this._gridHasWidthInPercent(),hasWidth=hasWidthInPixels||hasWidthInPercent,hasVirtualization=this.options.virtualization===true||this.options.columnVirtualization===true||this.options.rowVirtualization===true,hasColumnVirtualization=this.options.virtualization===true&&this.options.virtualizationMode==="fixed"||this.options.columnVirtualization===true,hasColumnsWithNoWidth=false,isPercentage=true,desiredColWidth,desiredColWidthNumber,lastCol,lastColWidth,difference;colgroup=$(table).find(">colgroup");if(colgroup.length===0){colgroup=$("<colgroup></colgroup>").prependTo(table)}if(hasVirtualization&&this.options.virtualizationMode==="fixed"||hasColumnVirtualization){this._updateVirtColCounters();cols=cols.slice(0,this._virtualColumnCount)}for(i=0;i<cols.length;i++){if(this._isMultiRowGrid()){col=$.extend(true,{},cols[i])}else{col=cols[i]}f=!!col.fixed;if(f!==fixed){continue}if(this._rlp&&i>=this._maxCols){break}if(this._colGroupWidths){col.width=this._colGroupWidths[i]}if(col.width||col.width===0){if(col.oWidth){desiredColWidth=col.oWidth}else{desiredColWidth=col.width}}else{desiredColWidth=defWidth;col.width=defWidth}if(desiredColWidth||desiredColWidth===0){if(!desiredColWidth.charAt||!desiredColWidth.endsWith("%")){isPercentage=false}desiredColWidthNumber=parseInt(desiredColWidth,10);if(desiredColWidthNumber<0||isNaN(desiredColWidthNumber)){desiredColWidthNumber=undefined}}else{desiredColWidthNumber=undefined;isPercentage=false}if(!_aNull(desiredColWidthNumber)){lastCol=$("<col></col>").appendTo(colgroup).css("width",desiredColWidth);lastColWidth=desiredColWidthNumber;totalColWidth+=desiredColWidthNumber;if($.type(col.width)==="string"&&col.width.endsWith("px")){col.width=desiredColWidthNumber+"px"}else{col.width=desiredColWidthNumber}if(desiredColWidth&&desiredColWidth.charAt&&desiredColWidth.endsWith("%")){col.width=col.width+"%"}}else{lastCol=$("<col></col>").appendTo(colgroup);lastColWidth=undefined;hasColumnsWithNoWidth=true}lc=col}if((!hasColumnVirtualization||this._vhorizontalcontainer().find("div").length===0)&&autofitLastColumn&&hasWidth&&!hasColumnsWithNoWidth&&lastColWidth){if(isPercentage){if(totalColWidth<100){lastColWidth+=100-totalColWidth;lastCol.css("width",lastColWidth+"%");this._autoadjustedColumn=cols.slice(-1)[0];if(!this._autoadjustedColumn.oWidth){this._autoadjustedColumn.oWidth=this._autoadjustedColumn.width}this._autoadjustedColumn.width=lastColWidth+"%";lc.width=lastColWidth+"%"}}else{if(hasWidthInPixels){totalGridWidth=parseInt(this.options.width,10)}else if(hasWidthInPercent){totalGridWidth=parseInt(this.container()[0].getBoundingClientRect().width,10)}if(hasFixedColumns&&totalGridWidth){if(hasWidthInPercent&&this.element[0].style.width.indexOf("px")>0){totalGridWidth=parseInt(this.element[0].style.width,10)}else{for(i=0;i<cols.length;i++){if(cols[i].fixed&&cols[i].width&&!cols[i].hidden){totalGridWidth-=parseInt(cols[i].width,10)}}}totalGridWidth-=hasVirtualization&&this.fixingDirection()==="right"&&!fixed?parseFloat(this._virtualcontainer().children("colgroup").children().last().css("width")):0}this._gridWidthGTColWidth=false;if(totalGridWidth&&totalGridWidth>totalColWidth){difference=totalGridWidth-totalColWidth;lastColWidth+=difference;totalColWidth+=difference;lastCol.css("width",lastColWidth+"px");this._autoadjustedColumn=lc;if(!this._autoadjustedColumn.oWidth){this._autoadjustedColumn.oWidth=this._autoadjustedColumn.width}this._autoadjustedColumn.width=lastColWidth+"px";this._autoadjustedColumn.difference=difference;lc.width=lastColWidth+"px";this._gridWidthGTColWidth=true}else{this._autoadjustedColumn=undefined}}}else{this._autoadjustedColumn=undefined}this._allColumnWidthsInPercentage=isPercentage&&!hasColumnsWithNoWidth&&cols.length>0;this._allColumnWidthsInPixels=!isPercentage&&!hasColumnsWithNoWidth&&cols.length>0;if(hasWidth&&hasVirtualization&&!hasColumnsWithNoWidth&&lastColWidth){if(!isPercentage&&(!hasFixedColumns||!fixed&&this.fixingDirection()==="left")){if(this.options.autofitLastColumn||!this.options.rowVirtualization||this._applyAutofitLastColInVirtGrid(totalColWidth)){lastColWidth-=this._scrollbarWidth();lastCol.css("width",lastColWidth+"px");if(this._autoadjustedColumn){lc.width=lastColWidth+"px"}}}}if(isHeader){this._lastHeaderCol=lastCol}if(isFooter){this._lastFooterCol=lastCol}if(!isHeader&&!isFooter){this._lastDataCol=lastCol}if(this._allColumnWidthsInPixels){this._lastColPixelWidth=lastColWidth;this._totalColPixelWidth=totalColWidth}else if(this._allColumnWidthsInPercentage){this._lastColPercentWidth=lastColWidth;this._totalColPixelWidth=undefined}else{this._lastColPixelWidth=undefined;this._totalColPixelWidth=undefined}},_renderRecordsForTable:function(start,end,table,tbody,isFixed){var i,d="",ds=this._getDataView(),grid=this,tbodytmp,ph,rrFunc;if(this._rlp){rrFunc=grid._renderRecordFromLayout}else{rrFunc=grid._renderRecord}tbody=tbody||table.children("tbody");if(!tbody.length){return}for(i=start;i<=end;i++){d+=rrFunc.apply(this,[ds[i],i,isFixed])}tbody.empty();if(!this._canreplaceinner){tbody.unbind();ph=document.createElement("div");ph.innerHTML="<table><tbody class='"+this.css.baseContentClass+" "+this.css.gridTableBodyClass+" "+this.css.recordClass+"' role='rowgroup'>"+d+"</tbody></table>";tbodytmp=ph.firstChild.firstChild;table[0].replaceChild(tbodytmp,tbody[0])}else if(this._canreplaceinner){MSApp.execUnsafeLocalFunction(function(){tbody[0].innerHTML=d})}d=""},_renderRecords:function(start,end){var tbody=this.element.children("tbody"),noCancelInternal=true,ds=this._getDataView(),noCancel=true;noCancelInternal=this._trigger("_rowsRendering",null,{owner:this,tbody:tbody,vrtWnd:{start:start,end:end}});if(noCancelInternal){noCancel=this._trigger(this.events.rowsRendering,null,{owner:this,tbody:tbody,vrtWnd:{start:start,end:end}});if(start===undefined){start=0;end=ds.length-1}if(start!==undefined&&end===undefined){end=start;if(end>ds.length-1){end=ds.length-1}start=0}if(start<0){start=0}if(end>ds.length-1){end=ds.length-1}if(noCancel){this._renderRecordsForTable(start,end,this.element);this._buildVirtualDomForContinuousVirtualization();this._trigger(this.events.rowsRendered,null,{owner:this,tbody:tbody});if((this.options.virtualization===false||this.options.rowVirtualization===false)&&this._persistVirtualScrollTop&&this._prevFirstVisibleTROffset&&this.scrollContainer().length>0){this.scrollContainer()[0].scrollTop=this._prevFirstVisibleTROffset}}}},autoSizeColumns:function(){var cols=this._visibleColumns(),fCols=[],ufCols=[],self=this;$.each(cols,function(ind,col){var colObj;if((col.width==="*"||col._oWidth==="*")&&!col.hidden){colObj={column:col,visibleIndex:self.getVisibleIndexByKey(col.key)};if(col.fixed){fCols.push(colObj)}else{ufCols.push(colObj)}}});if(fCols.length||ufCols.length){this._calculateAutoResizableWidths(ufCols);this._calculateAutoResizableWidths(fCols,true);this._rerenderColgroups(false);this._adjustLastColumnWidth(true);this._updateGridContentWidth()}},_calculateAutoResizableWidths:function(columns,fixed){if(!columns||!columns.length){return[]}var id=this.id(),rowsContainer=fixed?$("#"+id+"_fixed"):this.element,$parentDiv,col,cell,w,clientRect,$trs,i,$firstRowCells,$table,$measureDiv,html,$thead,$tfoot;$parentDiv=rowsContainer.closest("div");html=$parentDiv.html();$measureDiv=$("<div></div>").attr("style",$parentDiv.attr("style")).attr("class",$parentDiv.attr("class")+" "+this.container().attr("class")+" "+this.css.gridMeasurementContainerClass);$measureDiv.css({position:"absolute",resize:"both",visibility:"hidden",height:"auto",width:"auto",left:-6e3,top:-6e3}).appendTo(this.container());$measureDiv[0].innerHTML=html;$table=$measureDiv.find(">table");if(this._initialized){$table.find(">colgroup>col:not([data-skip])").each(function(ind,c){c.style.width="";c.width=""})}if(this.options.showHeader){$thead=fixed?this.fixedHeadersTable():this.headersTable();$table.find(">thead").remove();$trs=$thead.find(">thead").find(">tr[data-header-row],>tr[data-mch-level]");if($trs.length){html="";$trs.each(function(ind,tr){html+=tr.outerHTML});$("<thead>"+html+"</thead>").appendTo($table);$trs=$table.find(">thead>tr");$trs.children("th,td").css("width","");if($.ig.util.isSafari){$trs.each(function(ind,tr){tr.style.display=""})}}}if(this.options.showFooter){$tfoot=fixed?this.fixedFootersTable():this.footersTable();$table.find(">tfoot").remove();$tfoot=$tfoot.find(">tfoot");if($tfoot.length){$($tfoot[0].outerHTML).appendTo($table);$table.find(">tfoot>tr").children("td").css("width","")}}$table.css("width","auto").attr("id",$table.attr("id")+"__");$firstRowCells=$table.find(">tbody>tr:not([data-grouprow='true']):first").children("td:not([data-skip]):not([data-parent])");if(!$firstRowCells.length){$firstRowCells=$table.find("tr:visible:not([data-grouprow='true']):first").children("th:not([data-skip]):not([data-parent]), td:not([data-skip]):not([data-parent])")}if(!$firstRowCells.length){return}for(i=0;i<columns.length;i++){col=columns[i].column;cell=$firstRowCells.filter("[aria-describedby='"+id+"_"+col.key+"']").first()[0];if(!cell){continue}clientRect=cell.getBoundingClientRect();w=clientRect.width;if(w!==undefined){col.width=Math.ceil(w)}else{col.width=Math.ceil(clientRect.right-clientRect.left)}col._oWidth="*"}$measureDiv.remove();return columns},calculateAutoFitColumnWidth:function(columnIndex){var res,col=this._visibleColumns()[columnIndex];if(!col){return-1}res=this._calculateAutoResizableWidths([{column:$.extend(true,{},col),visibleIndex:this.getVisibleIndexByKey(col.key)}],!!col.fixed);return res[0].column.width},_reapplyZebraStyle:function(from){var funcApplyStyles,funcApplyStylesMRL,getEvenRowsInMRLScenario,getOddRowsInMRLScenario,grid=this,dataRows,fDataRows;if(!this.options.alternateRowStyles){return}dataRows=this.element.children("tbody").children("tr:not([data-container],[data-grouprow],[data-summaryrow])");from=from||0;dataRows=dataRows.slice(from);if(this.hasFixedColumns()){fDataRows=this.fixedBodyContainer().children("table").children("tbody").children("tr:not([data-container],[data-grouprow],[data-summaryrow])");fDataRows=fDataRows.slice(from)}getEvenRowsInMRLScenario=function(rows){return rows.filter(function(index){return Math.floor(index/grid._rlp.length)%2===0})};getOddRowsInMRLScenario=function(rows){return rows.filter(function(index){return Math.floor(index/grid._rlp.length)%2!==0})};funcApplyStylesMRL=function(toChange){if(from/grid._rlp.length%2!==0){getEvenRowsInMRLScenario(toChange).addClass(grid.css.recordAltClass);getOddRowsInMRLScenario(toChange).removeClass(grid.css.recordAltClass)}else{getOddRowsInMRLScenario(toChange).addClass(grid.css.recordAltClass);getEvenRowsInMRLScenario(toChange).removeClass(grid.css.recordAltClass)}};funcApplyStyles=function(toChange){toChange.filter(from%2===0?":odd":":even").addClass(grid.css.recordAltClass);toChange.filter(from%2===0?":even":":odd").removeClass(grid.css.recordAltClass)};if(!grid._isMultiRowGrid()){funcApplyStyles(dataRows);if(this.hasFixedColumns()){funcApplyStyles(fDataRows)}}else{funcApplyStylesMRL(dataRows)}},_buildFormatters:function(){var i,cols=this.options.columns,ret={};for(i=0;i<cols.length;i++){if(cols[i].formatter!==undefined){if($.type(cols[i].formatter)==="function"){ret[cols[i].key+"Formatter"]=cols[i].formatter}else if(window[cols[i].formatter]&&typeof window[cols[i].formatter]==="function"){ret[cols[i].key+"Formatter"]=window[cols[i].formatter]}}}return ret},getVisibleIndexByKey:function(columnKey,includeDataSkip){var hasFixedColumns=this.hasFixedColumns(),fixedCounters,unfixedCounters,prevColumn,cols=this._visibleColumns(),index=-1,fixed=false,$colgroup;if(hasFixedColumns){fixedCounters=0;unfixedCounters=0;prevColumn=null;$.each(cols,function(ind,value){var isFixed=value.fixed===true,prevColumnFixed=prevColumn&&prevColumn.fixed===true;if(prevColumn===null||prevColumnFixed!==isFixed){if(value.fixed===true){fixedCounters=0}else{unfixedCounters=0}}prevColumn=value;if(value.hidden){return true}if(isFixed!==true){unfixedCounters++}else{fixedCounters++}if(value.key===columnKey){if(isFixed){fixed=true;index=fixedCounters-1}else{index=unfixedCounters-1}if(index===-1){index=0}return false}})}else{$.each(cols,function(ind,value){if(value.key===columnKey){index=ind;return false}})}if(index===-1){return-1}if(includeDataSkip){if(fixed){$colgroup=$("#"+this.id()+"_fixed").find("colgroup:first")}else{$colgroup=this.element.find("colgroup:first")}index+=$colgroup.children("col[data-skip]").length}return index},_isColumnHidden:function(columnKey){var cols=this.options.columns,i=cols.length;while(i-- >=0){if(cols[i].key===columnKey){return cols[i].hidden||false}}return true},_visibleColumns:function(isFixed,cols){cols=cols||this.options.columns;if(isFixed!==undefined){return $.grep(cols,function(col){var fixed=col.fixed===true;return!col.hidden&&fixed===isFixed})}if(this._visibleColumnsArray===undefined){this._visibleColumnsArray=$.grep(cols,function(col){return!col.hidden})}return this._visibleColumnsArray},_visibleMchColumns:function(curLvl){var vmch=[],cl=curLvl||this._oldCols,self=this;if(!cl){return null}$.each(cl,function(){if(!this.hidden||this.hidden===false){vmch.push($.extend({},this));if(this.group){vmch[vmch.length-1].group=self._visibleMchColumns(this.group)}}});return vmch},_renderVirtualRecordsFixed:function(){var noVirtualDom=this._virtualDom===null||this._virtualDom===undefined;if(this.hasFixedColumns()){this._updateVirtColCounters(true);this._renderVirtualRecordsFixedInternal(true);this._updateVirtColCounters(false)}this._renderVirtualRecordsFixedInternal(false);this._trigger("virtualrecordsrender",null,{owner:this,tbody:this.element.children("tbody"),dom:this._virtualDom,isBuiltVirtualDom:!noVirtualDom})},_renderVirtualRecordsFixedInternal:function(isFixed){var i,j,row,c,headerText,vheaderNode,trs,k,htmlRow,indexCell=-1,iRow,tr,ds=this.dataSource,data=this._getDataView(),key=this.options.primaryKey,vd=this._getVirtualDom(isFixed),col,delimiter="__delimiter__",noVirtualDom=vd===null||vd===undefined,visibleCols=this._visibleColumns(isFixed);if(this._startRowIndex===undefined||this._startRowIndex===null){this._startRowIndex=0}if(this._startColIndex===undefined||this._startColIndex===null){this._startColIndex=0}if(noVirtualDom){if(!this._persistVirtualScrollTop&&!this._startRowIndex){this._scrollTo(0,true)}this._buildVirtualDom();if(this._startRowIndex){this._updateVirtColCounters(isFixed)}vd=this._getVirtualDom(isFixed);if(this.options.adjustVirtualHeights===true){this._adjustVirtualHeights()}}if(!noVirtualDom||noVirtualDom&&this._startRowIndex>0){if(this._virtualColumnCount){if(vd&&vd[0]){indexCell=$(vd[0].row).children("th,td[data-skip]").length}for(i=0;i<this._virtualRowCount&&i<this._totalRowCount&&this._startRowIndex+i<data.length;i++){if($.type(data[i])==="array"){row=$(this._renderRecord([data[this._startRowIndex+i]],i,isFixed))}else{row=$(this._renderRecord(data[this._startRowIndex+i],i,isFixed))}c=row.children();for(j=0;j<this._virtualColumnCount;j++){vd[i][j].innerHTML=c[j+this._startColIndex].innerHTML;vd[i][j].className=c[j+this._startColIndex].className;vd[i][j].setAttribute("aria-describedby",c[j+this._startColIndex].getAttribute("aria-describedby"));vd[i][j].setAttribute("aria-readonly",c[j+this._startColIndex].getAttribute("aria-readonly"))}iRow=this._startRowIndex+i;tr=vd[i][0].parentNode;tr.className=this.options.alternateRowStyles&&iRow%2?"ui-iggrid-virtualrow ui-ig-altrecord":"ui-iggrid-virtualrow";if(data[iRow]){if(!_aNull(key)){tr.setAttribute("data-id",this._kval_from_key(key,data[iRow]))}else if(!_aNull(data[iRow].ig_pk)){tr.setAttribute("data-id",data[iRow].ig_pk)}}}}else if(isFixed){trs=this.fixedBodyContainer().find("tbody>tr");for(i=0;i<this._virtualRowCount&&i<this._totalRowCount&&this._startRowIndex+i<data.length;i++){iRow=this._startRowIndex+i;tr=trs.eq(i)[0];if(_aNull(tr)){continue}tr.className=this.options.alternateRowStyles&&iRow%2?"ui-iggrid-virtualrow ui-ig-altrecord":"ui-iggrid-virtualrow";if(data[iRow]){if(!_aNull(key)){tr.setAttribute("data-id",this._kval_from_key(key,data[iRow]))}else if(!_aNull(data[iRow].ig_pk)){tr.setAttribute("data-id",data[iRow].ig_pk)}}}}}if(this._isHorizontal){this._isHorizontal=false;if((this.options.virtualization===true||this.options.columnVirtualization===true)&&parseInt(this.options.width,10)>0){if(!this._vheaders){this._vheaders=this.headersTable().find("thead > tr > th > span.ui-iggrid-headertext")}for(i=0;i<visibleCols.length;i++){col=visibleCols[i];if(col.headerCssClass){this.headersTable().find("th."+col.headerCssClass).removeClass(col.headerCssClass)}}for(j=0;j<this._virtualColumnCount;j++){headerText=visibleCols[j+this._startColIndex].headerText;vheaderNode=$(this._vheaders[j]);vheaderNode.closest("th").attr("id",this.element[0].id+"_"+visibleCols[j+this._startColIndex].key);vheaderNode.parent().addClass(visibleCols[j+this._startColIndex].headerCssClass||"");vheaderNode.html(headerText)}}}},_updateVirtColCounters:function(isFixed){var visibleColsLength=this._visibleColumns(isFixed).length;if(this.options.columns){this._totalColumnCount=visibleColsLength;this._maxVirtualColumnCount=this.options.columns.length}else{this._totalColumnCount=this._getDataView()[0].length;this._maxVirtualColumnCount=this._totalColumnCount}if(this.options.columnVirtualization===false&&this.options.virtualization===false){this._virtualColumnCount=visibleColsLength}else{if(this.options.width===null){this._virtualColumnCount=this._totalColumnCount}else{this._virtualColumnCount=Math.ceil(parseInt(this.options.width,10)/this._avgColumnWidth());this._maxVirtualColumnCount=Math.min(this._maxVirtualColumnCount,this._virtualColumnCount);this._virtualColumnCount=Math.min(this._totalColumnCount,this._virtualColumnCount);this._vhorizontalcontainer().children().first().css("width",this._calculateContainerWidth(false))}}if(this.options.virtualizationMode==="continuous"){this._virtualColumnCount=undefined}},_getVirtualDom:function(isFixed){if(!isFixed){return this._virtualDom}return this._fixedVirtualDom},_resetVirtualDom:function(){this._virtualDom=null;this._fixedVirtualDom=null},_buildVirtualDom:function(){var fixed,trs,fixedTrs;if(this.hasFixedColumns()){fixedTrs=this._buildVirtualDomInternal(true);fixed=false}trs=this._buildVirtualDomInternal(fixed);this._trigger("virtualdombuilt",null,{rows:trs,fixedRows:fixedTrs})},_buildVirtualDomInternal:function(isFixed){var grid=this,markup="",row,i,j,dataLinkFn,vdh,$vcont,shouldHide=false,$tbody,visibleCols=this._visibleColumns(isFixed),key=this.options.primaryKey,data=this._getDataView(),temp,vd=this._getVirtualDom(isFixed),startIndex=0,cellClass;if(this._startRowIndex===undefined||this._startRowIndex===null){this._startRowIndex=0;this._startColIndex=0}vd=[];if(!isFixed){this._virtualDom=vd}else{this._fixedVirtualDom=vd}this._totalRowCount=data.length;if(this.options.height===null){this._virtualRowCount=this._totalRowCount}else{$vcont=this._vdisplaycontainer();vdh=$vcont.innerHeight();if(!vdh&&$vcont.is(":visible")){this._virtualHeightReset=true;this._initializeHeights();this.element.height("");vdh=$vcont.innerHeight()}this._virtualRowCount=Math.floor(vdh/parseInt(this.options.avgRowHeight,10))}this._updateVirtColCounters(isFixed);if(this.options.height!==null){this._setScrollContainerHeight(this._totalRowCount*parseInt(this.options.avgRowHeight,10))}dataLinkFn=function(row,i,vc){for(j=0;j<vc;j++){vd[i].row=row[0];if(j<grid._totalColumnCount){vd[i][j]=row[0].cells[j]}}};if(this._persistVirtualScrollTop){if(this._startRowIndex>this._getDataView().length-this._virtualRowCount){if(this._getDataView().length-this._virtualRowCount>0){this._startRowIndex=this._getDataView().length-this._virtualRowCount}else{this._startRowIndex=0}}startIndex=this._startRowIndex}if(isFixed){this.element.children("tbody").empty();$tbody=this.fixedBodyContainer().find("tbody")}else{$tbody=this.element.children("tbody")}$tbody.empty();for(i=0;i<this._virtualRowCount;i++){shouldHide=false;cellClass=false;vd[i]=[];markup="";for(j=this._startColIndex;j<this._virtualColumnCount+this._startColIndex;j++){if(j>=this._totalColumnCount){break}markup+='<td role="gridcell" aria-readonly="'+!!visibleCols[j].readOnly+'" aria-describedby="'+this.id()+"_"+visibleCols[j].key+'" tabindex="'+this.options.tabIndex+'"';if(!data[startIndex+i]){shouldHide=true;markup+="></td>"}else{if(this.options.autoFormat!==false){if(visibleCols[j].template&&visibleCols[j].template.length){temp=this._renderTemplatedCell(data[startIndex+i],visibleCols[j]);if(temp.indexOf("<td")===0){markup+=temp.substring(3)}else{markup+=">"+temp;cellClass=true}markup=grid._editCellStyle(markup,data[startIndex+i],visibleCols[j].key||j,visibleCols[j],cellClass)}else{markup+=grid._addCellStyle(data[startIndex+i],visibleCols[j].key||j,visibleCols[j])+">"+this._renderCell(data[startIndex+i][visibleCols[j].key],visibleCols[j],data[startIndex+i])}}else{markup+=grid._addCellStyle(data[startIndex+i],visibleCols[j].key,visibleCols[j])+">"+data[i][visibleCols[j].key]}markup+="</td>"}}row=$("<tr>"+markup+"</tr>").appendTo($tbody);if(shouldHide){row.css("visibility","hidden")}if(i%2!==0&&this.options.alternateRowStyles){row.addClass("ui-ig-altrecord")}row.addClass("ui-iggrid-virtualrow");row.attr("role","row");row.attr("tabindex",this.options.tabIndex);if(data[i+startIndex]){if(!_aNull(key)){row.attr("data-id",this._kval_from_key(key,data[i+startIndex]))}else if(!_aNull(data[i+startIndex].ig_pk)){row.attr("data-id",data[i+startIndex].ig_pk)}}dataLinkFn(row,i,this._virtualColumnCount);if(i===data.length-1){break}}this._updateVirtualScrollContainer();return $tbody.children("tr")},_adjustVirtualHeights:function(){var c=this._vdisplaycontainer(),tbody=c.find("tbody"),h=tbody.children().first().height();if(this.options.height===null){return}if(this.options.avgRowHeight!==h){this.options.avgRowHeight=h;this._buildVirtualDom()}},_verticalScroller:function(){if(!this._verticalScrollerObj||this._verticalScrollerObj.length===0){this._verticalScrollerObj=this._scrollContainer().children().first()}return this._verticalScrollerObj},_hscrollbar:function(){return this.container().find("#"+this.id()+"_hscroller_container")},_hscrollbarcontent:function(){return this.container().find("#"+this.id()+"_hscroller")},_hscrollbarinner:function(){return this.container().find("#"+this.id()+"_hscroller_inner")},_avgColumnWidth:function(){var width=0,cols=this.options.columns,count=cols.length,def=this.options.defaultColumnWidth,i;if(this.options.avgColumnWidth!==null){return parseInt(this.options.avgColumnWidth,10)}for(i=0;i<count;i++){width+=parseInt(cols[i].width,10)}if((count===0||isNaN(width))&&def){return parseInt(def,10)}if(count>0&&this.options.autoGenerateColumns&&isNaN(width)){if(this.options.width===null||this.options.width===undefined){throw new Error(this._getLocaleValue("columnVirtualizationRequiresWidth"))}return parseInt(this.options.width,10)/count}if(width===0||width<def){return def}if(isNaN(width)){width=100}return width/count},_registerScrllCntnrToSync:function($container){var name=$container.data("containerName");this._scrllCntrsToSync=this._scrllCntrsToSync||{};this._scrllCntrsToSync[name]=$container},_syncScrollLeft:function(scrLeft,ignoreContainer){var name,$container,containers=this._scrllCntrsToSync;for(name in containers){if(containers.hasOwnProperty(name)){if(name===ignoreContainer){continue}$container=containers[name];$container.scrollLeft(scrLeft)}}},_onScrollContainerHandler:function(event){if(this._vdisplaycontainer().length&&(this._vdisplaycontainer().data("igScroll")===undefined||this._vdisplaycontainer().data("igScroll")._bMixedEnvironment)||this.scrollContainer().length&&(this.scrollContainer().data("igScroll")===undefined||this.scrollContainer().data("igScroll")._bMixedEnvironment)){this._onScrollContainer(event)}},_onScrollContainer:function(event){var $container=$(event.target),containerName,$hScrollBar,scrLeft=$container.scrollLeft(),scrTop=$(event.target).scrollTop();if($container.data("ignoreScroll")){return}containerName=$container.data("containerName");if(scrLeft!==this._scrollLeft){this._syncScrollLeft(scrLeft,containerName);if($.ig.util.isIE&&containerName!=="hScrollbar"&&containerName!=="vScrollbar"){$hScrollBar=this._scrllCntrsToSync.vScrollbar||this._scrllCntrsToSync.hScrollbar;if($hScrollBar&&$hScrollBar.scrollLeft()!==scrLeft){this._synchronizeHScroll();return}}this._scrollLeft=scrLeft}if(this._oldDisplayContainerScrollTop===undefined){this._oldDisplayContainerScrollTop=0}if(scrTop!==this._oldDisplayContainerScrollTop&&containerName==="dataContainer"){if($container[0].scrollHeight-scrTop===$container.outerHeight()){this._focusDataRowIndex=this._getTotalRowsCount()-1;
this._scrollContainer().scrollTop(this._scrollContainer().children().first().outerHeight())}else if(scrTop===0){this._focusDataRowIndex=0;this._scrollContainer().scrollTop(0);$hScrollBar=this._scrllCntrsToSync.vScrollbar||this._scrllCntrsToSync.hScrollbar;if($hScrollBar){$hScrollBar.scrollLeft(0)}}}},_renderCaption:function(){var scrollc=this.scrollContainer(),noCancel,captionContainer,caption=this.options.caption;if(!_aNull(caption)){if(this._caption().length>0){return}noCancel=this._trigger(this.events.captionRendering,null,{owner:this});if(noCancel){captionContainer=$("<div></div>").prependTo(this.container()).html(caption).attr("id",this.id()+"_caption").addClass(this.css.gridHeaderCaptionClass);this._trigger(this.events.captionRendered,null,{owner:this,captionContainer:captionContainer})}}},_createHeaderColumnMarkup:function(column,index){column.headerText=column.headerText===undefined?column.key:column.headerText;var headerClass=this.css.headerClass,customClass=column.headerCssClass?column.headerCssClass:"",headerText=$("<span>"+column.headerText+"</span>").addClass(this.css.headerTextClass),markup="<th></th>";return $(markup).append(headerText).attr({id:this.id()+"_"+column.key,role:"columnheader","aria-label":column.headerText,"data-navindex":column.navigationIndex,tabIndex:this.options.tabIndex}).addClass(headerClass).addClass(customClass).data("columnIndex",index)},_updateHeaderColumnIndexes:function(){var grid=this,cols=this.options.columns;if(this.options.virtualization===true&&this.options.virtualizationMode==="fixed"||this.options.columnVirtualization===true){cols=cols.slice(0,this._maxVirtualColumnCount)}grid._initialHiddenCells=this._initialized?[]:grid._initialHiddenCells;$(cols).each(function(i){grid.container().find("#"+grid.id()+"_"+this.key).data("columnIndex",i)})},_renderHeaderColumns:function(header){var grid=this,cols=this.options.columns;if(this.options.virtualization===true&&this.options.virtualizationMode==="fixed"||this.options.columnVirtualization===true){cols=cols.slice(0,this._maxVirtualColumnCount)}grid._initialHiddenCells=[];$(cols).each(function(i){var headerCell,key=this.key;if(key){headerCell=grid._createHeaderColumnMarkup(this,i);header.append(headerCell);grid._trigger(grid.events.headerCellRendered,null,{owner:grid,th:headerCell,columnKey:this.key});$.each(grid._initialHiddenColumns,function(){if(this.key===key){grid._initialHiddenCells.push(headerCell);headerCell.css("display","none");return false}})}})},renderMultiColumnHeader:function(cols){var topmostGrid,layout;this._clearPersistenceData();this.destroy(true);this.options.columns=cols;this._container=null;this._rContainer=null;this._prevContainerHeight=null;this._virtualHeightReset=null;this._scrollContainerObj=null;this._initialized=false;this._rlm=undefined;this._mrl=undefined;this._rlp=undefined;this.requiresDataBinding=true;this._renderHeaderCalled=false;this.persistenceData={};if(this._isHierarchicalGrid){topmostGrid=this.element.closest(".ui-iggrid-root").data("igHierarchicalGrid");if(topmostGrid){if(topmostGrid.element[0].id!==this.element[0].id&&this.options.key){layout=topmostGrid._findLayout(topmostGrid.options.columnLayouts,this.options.key);layout.columns=cols;topmostGrid._setOption("columnLayouts",topmostGrid.options.columnLayouts)}topmostGrid.persistenceData={};topmostGrid._clearVariablesAndEvents();topmostGrid._create();return}}this._create()},_renderHeaderLayout:function(thead){var i,j,t=this._rlp,l,cell,hrow,col,headerCell;thead.empty();for(i=0;i<t.length;i++){l=t[i];hrow=$("<tr></tr>").attr("data-header-row",true).attr("role","row").appendTo(thead);for(j=0;j<l.length;j++){cell=l[j];if(cell.col){col=cell.col}else{col=this.columnByKey(cell.key);cell.col=col}headerCell=this._createHeaderColumnMarkup(col,i*j+j).attr("colspan",cell.cs).attr("rowspan",cell.rs);hrow.append(headerCell);this._trigger(this.events.headerCellRendered,null,{owner:this,th:headerCell,columnKey:col.key})}}},_renderHeader:function(){var w,header,id,headerDom,headerMarkup="",scrollc=this.scrollContainer(),noCancel=true,fHeader=false,headerParent=this.element[0],width,headerScrollDiv,existingHeader,o=this.options,v=o.virtualization===true||o.rowVirtualization===true||o.columnVirtualization===true;this._renderHeaderCalled=true;if(this.options.showHeader){noCancel=this._trigger(this.events.headerRendering,null,{owner:this});if(noCancel){this._rmvClgrpOnInitRenderData=true;id=this.id();headerMarkup='<thead role="rowgroup"><tr data-header-row role="row"></tr></thead>';headerParent=this.container();width=scrollc.css("width");if(this.options.fixedHeaders&&this.options.height!==null){if(v===false){if(headerParent.length===0){scrollc.removeClass(this.css.gridClasses).removeClass(this.css.baseClasses).css("width","").wrap("<div id='"+id+"_container'></div>");headerParent=this.container().addClass(this.css.baseClasses).addClass(this.css.gridClasses).css("width",width);this._isWrapped=true}}else{width=this.element.parents(".ui-widget").css("width");headerParent=this.container().find("#"+id+"_headers_v");if(o.width!==null){w=o.width;w=w.indexOf&&w.indexOf("%")!==-1?"100%":w;headerParent.css("width",w).css("max-width",w).css("overflow-x","hidden")}}headerParent=$('<table id="'+id+'_headers"></table>').prependTo(headerParent).addClass(this._isMultiRowGrid()?this.css.mrlGridHeaderTableClass:this.css.gridHeaderTableClass).attr("cellpadding",0).attr("cellspacing",0).attr("border","0");if(v===false){headerScrollDiv=$("<div></div>").prependTo(headerParent.parent());headerScrollDiv.css("overflow","hidden").css("position","relative").css("white-space","nowrap");headerScrollDiv.addClass("ui-widget-header ui-helper-reset");headerScrollDiv.append(headerParent);if(headerScrollDiv.next().hasClass("ui-iggrid-headercaption")){headerScrollDiv.insertAfter(this._caption())}}else if(this.options.rowVirtualization===true){headerParent.addClass("ui-widget-header ui-helper-reset")}this.headersTable().parent().data("containerName","headerContainer").bind("scroll.syncScrollContainers",$.proxy(this._onScrollContainer,this));this._registerScrllCntnrToSync(this.headersTable().parent());fHeader=true;this._rmvClgrpOnInitRenderData=false}else if(this.options.fixedHeaders!==true){headerParent=this.element}if(this.options.width===null&&this.options.height===null){headerParent=this.element}if(this.options.width!==null&&this.options.height===null){this._fixScrollY=1;scrollc.css("overflow-y","hidden").css("overflow-x","auto");headerParent=this.element}if(!headerParent.find("colgroup").length){this._renderColgroup(headerParent,fHeader,false,this.options.autofitLastColumn)}if(this._isMultiColumnGrid===true){this._headerParent=headerParent;this._fireInternalEvent("_renderingMultiColumnHeader");if(this.options.virtualization===true||this.options.rowVirtualization===true){this.container().find("#"+id+"_headers_v").css("position","relative").addClass("ui-widget-header ui-helper-reset").addClass(this.css.baseClasses);headerParent.addClass(this._isMultiRowGrid()?this.css.mrlGridHeaderTableClass:this.css.gridHeaderTableClass).attr("cellpadding",0).attr("cellspacing",0).attr("border","0")}}else{if(this.options.headerTemplate===null||this.options.headerTemplate===undefined){if(this.options.virtualization===true||this.options.rowVirtualization===true){this.container().find("#"+id+"_headers_v").css("position","relative").addClass("ui-widget-header ui-helper-reset").addClass(this.css.baseClasses);headerParent.addClass(this._isMultiRowGrid()?this.css.mrlGridHeaderTableClass:this.css.gridHeaderTableClass).attr("cellpadding",0).attr("cellspacing",0).attr("border","0")}this.element.find(">thead").remove();existingHeader=headerParent.find(">thead");if(existingHeader.length===0){header=$(headerMarkup).appendTo(headerParent).children().first()}else{existingHeader.empty();header=$('<tr data-header-row role="row"></tr>').appendTo(existingHeader)}if(this._rlp){this._renderHeaderLayout(header.parent())}else{this._renderHeaderColumns(header)}}else{headerDom=this.options.headerTemplate;if(this.options.virtualization===true||this.options.rowVirtualization===true){$(headerDom).children().each(function(){this.appendTo(this.container().find("#"+id+"_headers"))});header=this.headersTable().addClass(this.css.gridClasses)}else{header=$(headerMarkup).appendTo(headerParent).append(headerDom)}}this._headerParent=headerParent;this._trigger(this.events.headerRendered,null,{owner:this,table:this.headersTable()});this._headerRenderCancel=false}}else{this._headerRenderCancel=true}}this._renderCaption();this._trigger("headerRenderedInternal",null,{owner:this,table:this.headersTable()})},_renderFooter:function(){var gridId=this.id(),w,o=this.options,elemParent,footerId=gridId+"_footer_container",footerMarkup='<tfoot role="rowgroup" class="'+this.css.gridFooterClass+'"></tfoot>',$footer=this.container().find("#"+footerId),$table,width,noCancel,tableGrid=this.element,$tableGridContainer;if(tableGrid.length===0){return}if($footer.length===0&&o.showFooter){noCancel=this._trigger(this.events.footerRendering,null,{owner:this});if(noCancel){if((o.virtualization===true||o.rowVirtualization===true||o.columnVirtualization===true)&&(o.height!==null&&o.height!==undefined||o.width!==null&&o.width!==undefined)){$tableGridContainer=this._vdisplaycontainer();this.options.fixedFooters=true;w=o.width;if(w&&w.indexOf&&w.indexOf("%")!==-1){w="100%"}$tableGridContainer=$('<tr><td colspan="2" style="border-width: 0px;"></td></tr>').insertAfter($tableGridContainer.closest("tr"));$footer=$("<div></div>").attr("id",footerId).css({overflow:"hidden",position:"relative"}).addClass("ui-widget-footer").addClass(this.css.footerContainer).width(w).appendTo($tableGridContainer.find("td"));$table=$("<table></table>").attr("cellpadding",0).attr("cellspacing",0).attr("border",0).appendTo($footer).addClass(this.css.gridFooterTableClass).width(w).attr("id",gridId+"_footers");this._renderColgroup($table,false,true,this.options.autofitLastColumn);$(footerMarkup).appendTo($table);if(this.options.showFooter&&this.options.fixedFooters===true&&this.options.height!==null){elemParent=this.element.parents(".ui-widget:first");if(elemParent.length===1&&elemParent[0].style){width=elemParent[0].style.width;if(width&&(!width.indexOf||width.indexOf("%")===-1)){$footer.css("width",width)}}}if(o.expandColWidth&&!o.width){$footer.css("width",parseInt($footer.width(),10)+o.expandColWidth+"px")}}else if(o.fixedFooters===true&&o.height!==null){if(o.width!==null){$tableGridContainer=this._hscrollbar()}else{$tableGridContainer=this.scrollContainer()}if($tableGridContainer.length===0){$tableGridContainer=tableGrid}$footer=$("<div></div>").attr("id",footerId).css({overflow:"hidden",position:"relative","white-space":"nowrap"}).addClass(this.css.footerContainer).addClass("ui-widget-footer").insertAfter($tableGridContainer);$table=$("<table></table>").attr("cellpadding",0).attr("cellspacing",0).attr("border",0).appendTo($footer).addClass(this.css.gridFooterTableClass).attr("id",gridId+"_footers");this._renderColgroup($table,false,true,this.options.autofitLastColumn);$(footerMarkup).appendTo($table)}else{$tableGridContainer=tableGrid;$footer=$(footerMarkup).attr("id",footerId).insertAfter($tableGridContainer.find("tbody:eq(0)"))}$footer.data("containerName","footerContainer").bind("scroll.syncScrollContainers",$.proxy(this._onScrollContainer,this));this._registerScrllCntnrToSync($footer);$footer.css("display","none");this._footer=$footer;this._footerParent=$table;this._trigger(this.events.footerRendered,null,{owner:this,table:this.footersTable()})}}return $footer},_renderRecord:function(data,rowIndex,isFixed,dataIndex,delimiter){var key=this.options.primaryKey,gridId=this.id(),cellClass,grid=this,dstr="",cols=this.options.columns,noVisibleColumns,temp;delimiter=delimiter||"";dstr+="<tr";dataIndex=isNaN(dataIndex)?rowIndex:dataIndex;if(dataIndex%2!==0&&this.options.alternateRowStyles){dstr+=' class="'+grid.css.recordAltClass+'"'}if(!_aNull(key)){dstr+=' data-id="'+this._kval_from_key(key,data)+'"'}else if(!_aNull(data.ig_pk)){dstr+=' data-id="'+data.ig_pk+'"'}if(this.options.virtualization&&this.options.virtualizationMode==="continuous"){dstr+=' data-row-idx="'+rowIndex+'"'}dstr+=' role="row" tabindex="'+this.options.tabIndex+'">';noVisibleColumns=true;isFixed=!!isFixed;$(cols).each(function(colIndex){var col=cols[colIndex],f=!!col.fixed;cellClass=false;if(col.hidden||f!==isFixed){return}noVisibleColumns=false;dstr+=delimiter;dstr+='<td role="gridcell" aria-readonly="'+!!this.readOnly+'" aria-describedby="'+gridId+"_"+this.key+'" tabindex="'+grid.options.tabIndex+'"';if(col.template&&col.template.length){temp=grid._renderTemplatedCell(data,this);if(temp.indexOf("<td")===0){dstr+=temp.substring(3)}else{dstr+=">"+temp;cellClass=true}dstr=grid._editCellStyle(dstr,data,this.key,col,cellClass)}else{dstr+=grid._addCellStyle(data,this.key||colIndex,col)+">"+grid._renderCell(data[this.key||colIndex],this,data)}dstr+="</td>"});if(noVisibleColumns&&!isFixed){dstr+=delimiter+'<td role="gridcell"></td>'}dstr+=delimiter;dstr+="</tr>";return dstr},_renderRecordFromLayout:function(data,rowIndex,isFixed){var t=this._rlp,l,cell,key=this.options.primaryKey,dstr="",col,noVisibleColumns,temp,i,j,cellClass,alt=rowIndex%2!==0&&this.options.alternateRowStyles;for(i=0;i<t.length;i++){l=t[i];dstr+="<tr"+(alt?' class="'+this.css.recordAltClass+'"':"");if(!_aNull(key)){dstr+=' data-id="'+this._kval_from_key(key,data)+'"'}else if(!_aNull(data.ig_pk)){dstr+=' data-id="'+data.ig_pk+'"'}if(this.options.virtualization&&this.options.virtualizationMode==="continuous"){dstr+=' data-row-idx="'+rowIndex+'"'}dstr+=' role="row" tabindex="'+this.options.tabIndex+'">';noVisibleColumns=true;for(j=0;j<l.length;j++){cell=l[j];cellClass=false;if(cell.col){col=cell.col}else{col=this.columnByKey(cell.key);cell.col=col}if(col.hidden||col.fixed===true&&!isFixed||col.fixed!==true&&isFixed){return}noVisibleColumns=false;dstr+='<td role="gridcell" aria-readonly="'+!!col.readOnly+'" '+(cell.cs>0?'colspan="'+cell.cs+'" ':"")+(cell.rs>0?'rowspan="'+cell.rs+'" ':"")+'aria-describedby="'+this.id()+"_"+col.key+'" tabindex="'+this.options.tabIndex+'" data-navindex="'+col.navigationIndex+'"';if(col.template&&col.template.length){temp=this._renderTemplatedCell(data,col);if(temp.indexOf("<td")===0){dstr+=temp.substring(3)}else{dstr+=">"+temp;cellClass=true}dstr=this._editCellStyle(dstr,data,col.key,col,cellClass)}else{dstr+=this._addCellStyle(data,col.key,col)+">"+this._renderCell(data[col.key],col,data)}dstr+="</td>"}if(noVisibleColumns){dstr+='<td role="gridcell"></td>'}dstr+="</tr>"}return dstr},_editCellStyle:function(dstr,data,colId,col,addCellClass,isFixed){var lastCellIdx,lastCellClose,lastCellClass,start,end,nc="",i,hasSubs=this._cellStyleSubscribers&&this._cellStyleSubscribers.length,hasColClasses=col?col.columnCssClass:false;if(hasSubs){for(i=0;i<this._cellStyleSubscribers.length;i++){nc+=this._cellStyleSubscribers[i](data,colId,isFixed)+" "}}if(hasColClasses&&addCellClass){nc+=col.columnCssClass}nc=nc.trim();if(nc.length===0){return dstr}lastCellIdx=dstr.lastIndexOf("<td");lastCellClose=dstr.indexOf(">",lastCellIdx);if(lastCellClose>0){lastCellClass=dstr.substring(lastCellIdx,lastCellClose).indexOf("class");if(lastCellClass>0){lastCellClass+=lastCellIdx}}else{lastCellClass=dstr.indexOf("class",lastCellIdx)}if(lastCellClass>0){start=dstr.substring(0,lastCellClass+7);end=dstr.substring(lastCellClass+7);dstr=start+nc+" "+end}else{start=dstr.substring(0,lastCellIdx+3);end=dstr.substring(lastCellIdx+3);dstr=start+' class="'+nc+'"'+end}return dstr},_addCellStyle:function(data,colId,col,isFixed){var dstr="",i,hasSubs=this._cellStyleSubscribers&&this._cellStyleSubscribers.length,hasColClasses=col?col.columnCssClass:false;if(hasSubs){for(i=0;i<this._cellStyleSubscribers.length;i++){dstr+=this._cellStyleSubscribers[i](data,colId,isFixed)+" "}}if(hasColClasses){dstr+=col.columnCssClass}dstr=dstr.trim();return dstr.length>0?' class="'+dstr+'"':dstr},_getCellStyle:function(data,col,isFixed){var dstr="",i;if(!this._cellStyleSubscribers||this._cellStyleSubscribers.length===0){return dstr}for(i=0;i<this._cellStyleSubscribers.length;i++){dstr+=this._cellStyleSubscribers[i](data,col,isFixed)+" "}return dstr.trim()},_enableHeaderCellFeature:function(th){var $th;if($.type(th)==="string"){$th=this.container().find("#"+this.id()+"_"+th)}else{$th=th}$th.addClass(this.css.headerCellFeatureEnabledClass)},_fixDate:function(val,col){var d,i;if(!col||!val){return val}if((col.dataType==="date"||col.dataType==="time")&&!val.getTime){i=val.indexOf?val.indexOf("ate("):-1;if(i>0){d=val.substring(i+4);i=d.indexOf(")");if(i>0){d=parseInt(d.substring(0,i),10);if(!isNaN(d)){val=new Date(d)}}}}return val},_renderCell:function(val,col,record,displayStyle,returnObject){var type=col.dataType,format=col.format,o=this.options,auto=o.autoFormat;if(record&&!returnObject){val=this.dataSource.getCellValue(col.key,record)}val=this._fixDate(val,col);if(col.formatter){return col.formatter(val,record)}if(!format&&type==="bool"&&o.renderCheckboxes){format="checkbox"}if(format==="checkbox"&&type!=="bool"){format=null}if(!format&&type==="time"){format="time"}type=type==="date"||type==="number"||type==="time"?type:"";if(format||(auto===true||auto==="dateandnumber")&&type||auto&&auto===type){col.formatted=true;return $.ig.formatter(val,type,format,true,col.dateDisplayType==="utc",this._getOffsetForCol(record,col),displayStyle,col.headerText,this.options.tabIndex,col.regional||this.options.regional)}if(returnObject){return val}return val||val===0||val===false?val.toString():"&nbsp;"},_renderTemplatedCell:function(val,col){var v,d=$.extend({},val);if(val===undefined||val===null||val[col.key]===undefined){if(col.unbound===true){v="&nbsp;"}else{v=this._renderCell(val,col,val,null,true)}}else{v=this._renderCell(val[col.key],col,val,null,true)}v=v==="&nbsp;"?null:v;d[col.key]=v;return this._tmplWrappers[this.id()+"_"+col.key](d,this._jsrnd?undefined:col.template)},_defaultTemplateFunc:function(d,tmpl){return $.ig.tmpl(tmpl,d)},_setTemplateDefinition:function(jsrnd){var i,key;for(i=0;i<this.options.columns.length;i++){if(this.options.columns[i].template&&this.options.columns[i].template.length){key=this.id()+"_"+this.options.columns[i].key;if(jsrnd){$.templates(key,this.options.columns[i].template);this._jsrnd=true}else{this._tmplWrappers[key]=this._defaultTemplateFunc}}}},_scrollbarWidth:function(){this._scrollbarWidthResolved=_aNull(this._scrollbarWidthResolved)?$.ig.util.getScrollWidth():this._scrollbarWidthResolved;return this._scrollbarWidthResolved},_fireInternalEvent:function(name,args){var i,f,featureName,feature;for(i=0;i<this.options.features.length;i++){f=this.options.features[i];if(f!==undefined&&f!==null&&f.name!==undefined){featureName="igGrid"+f.name;feature=this.element.data(featureName);if(feature!==null&&feature!==undefined&&feature[name]){if(args){feature[name](args)}else{feature[name]()}}}}},_initFeature:function(featureObject){var widget,featureNotSupportedWithMrl=["Hiding","ColumnMoving","GroupBy","CellMerging","AppendRowsOnDemand","MultiColumnHeaders","ColumnFixing","Resizing","Responsive","RowSelectors","Selection","Summaries","Tooltips"];if(!featureObject){return}if(featureObject.name===undefined){return}if(this._isMultiRowGrid()&&featureNotSupportedWithMrl.indexOf(featureObject.name)>-1){throw new Error(this._getLocaleValue("featureNotSupportedWithMRL").replace("{featureName}",featureObject.name))}widget="igGrid"+featureObject.name;if($.type(this.element[widget])!=="function"){throw new Error(this._getLocaleValue("noSuchWidget").replace("{featureName}",widget))}if(this.element.data(widget)){this.element[widget]("destroy")}featureObject.language=this.options.language;this.element[widget](featureObject);this.element.data(widget)._injectGrid(this)},_initFeatureSettings:function(featureObject){if(!featureObject){return}if(featureObject.name===undefined){return}var widget="igGrid"+featureObject.name;if($.type(this.element[widget])!=="function"){throw new Error(this._getLocaleValue("noSuchWidget").replace("{featureName}",widget))}if(this.element.data(widget)){this.element.data(widget)._injectGrid(this,true)}},_onFeaturesSoftDirty:function(e,args){var i,feature;if(args.owner.options.type!=="remote"){return}for(i=0;i<this.options.features.length;i++){feature=this.element.data("igGrid"+this.options.features[i].name);if(feature&&feature!==args.owner&&feature.options&&feature.options.type==="local"){if(feature._onUIDirty&&$.type(feature._onUIDirty)==="function"){feature._onUIDirty(e,args)}}}},_kval_from_key:function(key,data){var k,k_val="",i;if(key.indexOf(",")!==-1){k=key.split(",");for(i=0;i<k.length;i++){k_val+=data[k[i]];if(i<k.length-1){k_val+=","}}}else{k_val=data[key]}return k_val},_rowId:function(rec,index){var key=this.options.primaryKey;key=key?this._kval_from_key(key,rec):null;if(!key){key=index;if(key!==0){key=this.rows().length-1}}return key},_inferOpType:function(){if(this.options.dataSourceUrl||this.dataSource.type()==="remoteUrl"){return"remote"}return"local"},_calcOffsetForCol:function(record,col,noBias){var offset=this._getOffsetForCol(record,col);if(offset!==null||col.dateDisplayType==="utc"){return noBias?Math.floor(offset/(60*1e3)):0}else{return null}},_getOffsetForCol:function(record,col){var prop="igoffset_"+col.key,d;if(!record){d=this.dataSource.data();if(!d.length){return null}record=d[0]}if(record.hasOwnProperty(prop)){return record[prop]}return null},_renderVirtualRecords:function(){var mode=this.options.virtualizationMode;this._trigger("virtualrendering");if(mode===undefined||mode===""){mode="continuous"}if(mode==="fixed"||this.options.columnVirtualization===true){if(this._persistVirtualScrollTop){this._startRowIndex=Math.ceil(this._scrollContainer().scrollTop()/parseInt(this.options.avgRowHeight,10));if(this._startRowIndex>this._getDataView().length-this._virtualRowCount){if(this._getDataView().length-this._virtualRowCount>0){this._startRowIndex=this._getDataView().length-this._virtualRowCount}else{this._startRowIndex=0}}}this._renderVirtualRecordsFixed()}else if(mode==="continuous"){this._renderVirtualRecordsContinuous();this._trigger("virtualrecordsrender",null,{owner:this,dom:this._virtualDom})}},_getHScrollContainerInner:function(){var ret=this._hscrollbarinner();if(ret.length===0&&this.options.virtualizationMode==="continuous"){ret=this.container().find("#"+this.id()+"_horizontalScrollContainer div")}return ret},_getScrollContainerHeight:function(){if($.ig.util.isIE){return this._scrollContainer().children(":first-child")[0].clientHeight}return this._scrollContainer().children(":first-child").height()},_getDisplayContainerHeight:function(){return this._vdisplaycontainer().height()},_getDisplayContainerWidth:function(){return this._vdisplaycontainer().width()},_setDisplayContainerWidth:function(width){if(width===undefined){return}this._vdisplaycontainer().css("max-width",width);this._vdisplaycontainer().width(width)},_getVHeadersWidth:function(){return this.container().find("#"+this.id()+"_headers_v").width()},_setVHeadersWidth:function(width){if(width===undefined){return}this.container().find("#"+this.id()+"_headers_v").width(width)},_setScrollContainerHeight:function(height){var sc=this._scrollContainer();if(height===undefined){return}if($.ig.util.isIE&&height>this.maxScrollContainerHeight){this._setMaxHeightForScrollCntnr=true;height=this.maxScrollContainerHeight}sc.children(":first-child").height(height)},_setScrollContainerScrollTop:function(top){if(top===undefined){return}this._scrollContainer().scrollTop(top)},_getScrollContainerScrollTop:function(){return this._scrollContainer().scrollTop()},_setDisplayContainerScrollTop:function(top){if(top===undefined){return}this._vdisplaycontainer().scrollTop(top)},_getDisplayContainerScrollTop:function(){return this._vdisplaycontainer().scrollTop()},_setDisplayContainerScrollLeft:function(left){if(left===undefined){return}this._vdisplaycontainer().scrollLeft(left)},_getDisplayContainerScrollLeft:function(){return this._vdisplaycontainer().scrollLeft()},_calculateAvgRowHeight:function(){var rowHeightSum=this.container().find("#"+this.id()+" > tbody").height();if(rowHeightSum===0){rowHeightSum=parseInt(this.options.height,10)}if(this.options.virtualizationMode==="fixed"){if(this._fixedAvgRowHeight){return this._fixedAvgRowHeight}this._fixedAvgRowHeight=rowHeightSum/this._virtualRowCount}return rowHeightSum/this._virtualRowCount},_getDisplayContainerVisibleArea:function(){var scrollTop=this._getDisplayContainerScrollTop(),height=this._getDisplayContainerHeight();return{top:scrollTop,bottom:scrollTop+height}},virtualScrollTo:function(scrollerPosition){var avgRowHeight,$scrollContainer=this._scrollContainer(),pos=parseInt(scrollerPosition,10);if($.type(scrollerPosition)!=="string"){if(this.options.virtualizationMode==="fixed"){avgRowHeight=parseInt(this.options.avgRowHeight,10)}else{if(this._avgRowHeight){avgRowHeight=this._avgRowHeight}else{avgRowHeight=this._calculateAvgRowHeight()}}scrollerPosition--;pos=avgRowHeight*scrollerPosition;pos=Math.ceil(pos);this._virtualScrollToIndex=scrollerPosition}$scrollContainer.scrollTop(pos)},_virtualScrollToInternal:function(virtualScrollerY){var tableId,firstRow,lastRow,scrollData,scrollResult;if(virtualScrollerY===this._oldScrollTop){return}tableId="#"+this.id();firstRow=this.container().find(tableId+" > tbody > tr:not([data-container]):visible:first");lastRow=this.container().find(tableId+" > tbody > tr:not([data-container]):visible:last");if(firstRow.length===0||lastRow.length===0){return}scrollData={virtualScrollerY:this._getScrollContainerScrollTop(),deltaScroll:virtualScrollerY-this._oldScrollTop,firstRow:firstRow,lastRow:lastRow,firstRowDataIndex:parseInt(firstRow.attr("data-row-idx"),0),lastRowDataIndex:parseInt(lastRow.attr("data-row-idx"),0),visibleArea:this._getDisplayContainerVisibleArea()};scrollResult={action:"SA_INITIAL"};if(!this._tryScroll(scrollData,scrollResult)){this._trigger("virtualrendering");this._rebuildVirtualRows(scrollData,scrollResult)}this._correctScrollPosition(this._getTotalRowsCount())},_getTotalRowsCount:function(){return this._getDataView().length},_tryScroll:function(scrollData,scrollResult){var deltaScroll,firstRow,lastRow,displayContainerHeight,displayContainerScrollTop;if(scrollResult===undefined){throw new Error("scrollResult parameter should be provided")}deltaScroll=scrollData.deltaScroll;firstRow=scrollData.firstRow;lastRow=scrollData.lastRow;displayContainerHeight=this._getDisplayContainerHeight();displayContainerScrollTop=this._getDisplayContainerScrollTop();if(this._rlp&&this._isScrolledToBottomInVirtGrid()&&scrollData.lastRowDataIndex<this._totalRowCount){scrollResult.action="SA_NEED_LAST_PAGE";return false}if(deltaScroll>0){if(lastRow[0].offsetTop+lastRow.outerHeight()>=displayContainerScrollTop+deltaScroll+displayContainerHeight||isNaN(scrollData.lastRowDataIndex)||scrollData.lastRowDataIndex>=this._getLastVisibleDataRecordIndex()){this._setDisplayContainerScrollTop(displayContainerScrollTop+deltaScroll);scrollResult.action="SA_SUCCESSFUL";return true}if(deltaScroll<=this._avgRowHeight*this._virtualRowCount){if(deltaScroll+displayContainerHeight>this._avgRowHeight*this._virtualRowCount){scrollResult.action="SA_NEED_SOME_PAGE";return false}scrollResult.action="SA_NEED_NEXT_PAGE";return false}}if(deltaScroll<0){if(firstRow[0].offsetTop<=displayContainerScrollTop+deltaScroll||scrollData.firstRowDataIndex===0){this._setDisplayContainerScrollTop(displayContainerScrollTop+deltaScroll);scrollResult.action="SA_SUCCESSFUL";return true}if(Math.abs(deltaScroll)<=this._avgRowHeight*this._virtualRowCount){scrollResult.action="SA_NEED_PREV_PAGE";return false}}scrollResult.action="SA_NEED_SOME_PAGE";return false},_getDataView:function(){return this.dataSource.dataView()},_isScrolledToBottomInVirtGrid:function(){var scrlCntnr=this._scrollContainer();return this._getScrollContainerScrollTop()+5>=scrlCntnr[0].scrollHeight-scrlCntnr.innerHeight()},_rebuildVirtualRows:function(scrollData,scrollResult){var noCancel,virtualScrollerY,deltaScroll,tableId,visibleArea,tbody,scrlCntnr,oAvgRowHeight,expandedRowsHeight,trs,i,scrollerHeight,firstVisibleTR,firstVisibleTRRelativeOffset,startIndexToBeLoaded,newFirstVisibleRow,displayContainerScrollTop,maxScrollPos,avgRowHeight,tr,lastVisibleTR,lastVisibleTRIndex,firstVisibleTRIndex,endIndexToBeLoaded,dataRowIndexToBeFirst,hasOverflow;noCancel=this._trigger("rebuildingvirtualrows",null,{owner:this,scrollData:scrollData,scrollResult:scrollResult});if(noCancel===false){return}virtualScrollerY=scrollData.virtualScrollerY;deltaScroll=scrollData.deltaScroll;tableId="#"+this.id();visibleArea=scrollData.visibleArea;tbody=this.container().find(tableId+" > tbody");expandedRowsHeight=0;trs=this.container().find(tableId+' > tbody > tr[data-container="true"]');for(i=0;i<trs.length;i++){expandedRowsHeight+=$(trs[i]).outerHeight()}if(expandedRowsHeight>0){scrollerHeight=this._getScrollContainerHeight();this._setScrollContainerHeight(scrollerHeight-expandedRowsHeight)}if(deltaScroll>0&&scrollResult.action==="SA_NEED_LAST_PAGE"){startIndexToBeLoaded=this._getDataView().length-this._virtualRowCount;endIndexToBeLoaded=startIndexToBeLoaded+this._virtualRowCount-1;tbody.empty();this._startRowIndex=startIndexToBeLoaded;this._startColIndex=0;this._renderRecords(startIndexToBeLoaded,endIndexToBeLoaded);if(!this._persistVirtualScrollTop){this._setDisplayContainerScrollTop(1e4)}}if(deltaScroll>0&&scrollResult.action==="SA_NEED_NEXT_PAGE"){firstVisibleTR=this._getFirstVisibleTR(visibleArea);firstVisibleTRRelativeOffset=Math.abs(firstVisibleTR[0].offsetTop-visibleArea.top);startIndexToBeLoaded=parseInt(firstVisibleTR.attr("data-row-idx"),0);dataRowIndexToBeFirst=startIndexToBeLoaded;endIndexToBeLoaded=parseInt(this._virtualRowCount,0)+startIndexToBeLoaded-1;hasOverflow=false;if(endIndexToBeLoaded>this._getDataView().length-1){endIndexToBeLoaded=this._getDataView().length-1;startIndexToBeLoaded=endIndexToBeLoaded-this._virtualRowCount+1;hasOverflow=true}tbody.empty();this._startRowIndex=startIndexToBeLoaded;this._startColIndex=0;this._renderRecords(startIndexToBeLoaded,endIndexToBeLoaded);if(hasOverflow){tr=this.container().find(tableId+" > tbody > tr[data-row-idx='"+dataRowIndexToBeFirst+"']");firstVisibleTRRelativeOffset=tr[0].offsetTop+firstVisibleTRRelativeOffset}this._setDisplayContainerScrollTop(firstVisibleTRRelativeOffset+deltaScroll)}if(deltaScroll<0&&scrollResult.action==="SA_NEED_PREV_PAGE"){lastVisibleTR=this._getLastVisibleTR(visibleArea);lastVisibleTRIndex=parseInt(lastVisibleTR.attr("data-row-idx"),0);firstVisibleTR=this._getFirstVisibleTR(visibleArea);firstVisibleTRIndex=parseInt(firstVisibleTR.attr("data-row-idx"),0);endIndexToBeLoaded=lastVisibleTRIndex;startIndexToBeLoaded=endIndexToBeLoaded-parseInt(this._virtualRowCount,0)+1;if(startIndexToBeLoaded>=scrollData.firstRowDataIndex){startIndexToBeLoaded=scrollData.firstRowDataIndex-parseInt(this._virtualRowCount,0)+1}if(startIndexToBeLoaded<0||!virtualScrollerY){startIndexToBeLoaded=0;endIndexToBeLoaded=startIndexToBeLoaded+this._virtualRowCount-1}tbody.empty();this._startRowIndex=startIndexToBeLoaded;this._renderRecords(startIndexToBeLoaded,endIndexToBeLoaded);tableId="#"+this.id();newFirstVisibleRow=this.container().find(tableId+' > tbody > tr[data-row-idx="'+firstVisibleTRIndex+'"]');this._setDisplayContainerScrollTop(newFirstVisibleRow[0].offsetTop+deltaScroll)}if(scrollResult.action==="SA_NEED_SOME_PAGE"){startIndexToBeLoaded=Math.floor(virtualScrollerY/this._avgRowHeight);scrollerHeight=this._getScrollContainerHeight();if(($.ig.util.isIE||this._setMaxHeightForScrollCntnr||this._rlp)&&this._totalRowCount*this._avgRowHeight>=scrollerHeight+2){if(this._isScrolledToBottomInVirtGrid()){startIndexToBeLoaded=this._getDataView().length-this._virtualRowCount}else{startIndexToBeLoaded=Math.ceil(virtualScrollerY/scrollerHeight*this._totalRowCount);
}}endIndexToBeLoaded=startIndexToBeLoaded+this._virtualRowCount-1;if(startIndexToBeLoaded<0){startIndexToBeLoaded=0;endIndexToBeLoaded=startIndexToBeLoaded+this._virtualRowCount-1}if(endIndexToBeLoaded>=this._getDataView().length-1){endIndexToBeLoaded=this._getDataView().length-1;startIndexToBeLoaded=endIndexToBeLoaded-this._virtualRowCount+1}tbody.empty();this._startRowIndex=startIndexToBeLoaded;this._renderRecords(startIndexToBeLoaded,endIndexToBeLoaded);displayContainerScrollTop=0;maxScrollPos=scrollerHeight-this._getDisplayContainerHeight();if(maxScrollPos-3<=virtualScrollerY&&virtualScrollerY<=maxScrollPos+3){displayContainerScrollTop=1e4}if(!this._persistVirtualScrollTop){this._setDisplayContainerScrollTop(displayContainerScrollTop)}}avgRowHeight=this._calculateAvgRowHeight();if(avgRowHeight>this._avgRowHeight){oAvgRowHeight=this._avgRowHeight;this._avgRowHeight=avgRowHeight;this._trigger("avgRowHeightChanged",null,{owner:this,oAvgRowHeight:oAvgRowHeight,avgRowHeight:this._avgRowHeight})}this._trigger("virtualrecordsrender",null,{owner:this,tbody:tbody,dom:this._virtualDom})},_correctScrollPosition:function(totalRowCount){var scrollTop,maxScrollPos,tableId,firstRow,firstRowDataIndex,lastRow,lastRowDataIndex,visibleArea,tbody,rowsLeft,displayContainerScrollTop,targetRow,delta;scrollTop=this._getScrollContainerScrollTop();maxScrollPos=this._getScrollContainerHeight()-this._getDisplayContainerHeight();tableId="#"+this.id();firstRow=this.container().find(tableId+" > tbody > tr:first");firstRowDataIndex=parseInt(firstRow.attr("data-row-idx"),0);lastRow=this.container().find(tableId+" > tbody > tr:last");lastRowDataIndex=parseInt(lastRow.attr("data-row-idx"),0);visibleArea=this._getDisplayContainerVisibleArea();tbody=this.container().find(tableId+" > tbody");if(scrollTop===0){if(visibleArea.top>0){this._scrollTo(visibleArea.top,true)}else if(firstRowDataIndex>0){this._scrollTo(firstRowDataIndex*this._avgRowHeight,true)}}else if(scrollTop>=maxScrollPos-3&&scrollTop<=maxScrollPos+3){if(visibleArea.bottom<tbody.height()&&lastRowDataIndex===totalRowCount-1){this._scrollTo(this._getScrollContainerScrollTop()-(tbody.height()-visibleArea.bottom),true)}else if(lastRowDataIndex<totalRowCount-1){rowsLeft=totalRowCount-lastRowDataIndex;this._setScrollContainerHeight(this._getScrollContainerHeight()+rowsLeft*this._avgRowHeight)}}displayContainerScrollTop=this._getDisplayContainerScrollTop();if(displayContainerScrollTop===0&&firstRowDataIndex===0&&this._getScrollContainerScrollTop()!==0){this._scrollTo(0)}if(Math.abs(displayContainerScrollTop-(tbody.height()-this._getDisplayContainerHeight()))<=1&&lastRowDataIndex===totalRowCount-1){this._scrollTo(this._getScrollContainerHeight(),true)}if(this._virtualScrollToIndex!==undefined&&this._virtualScrollToIndex!==null){targetRow=this.container().find(tableId+" > tbody > tr[data-row-idx="+this._virtualScrollToIndex+"]");delta=0;if(targetRow.length===1&&firstRowDataIndex!==this._virtualScrollToIndex){delta=targetRow.igOffset().top-firstRow.igOffset().top}this._virtualScrollToIndex=null;if(delta>0){this._vdisplaycontainer().scrollTop(delta)}}},_scrollTo:function(scrollTop,suppressScrollEvent){if(suppressScrollEvent){this._suppressScroll=true}this._setScrollContainerScrollTop(scrollTop)},_getFirstVisibleTR:function(visibleArea){var tableId="#"+this.element[0].id,firstVisibleTR,visibleAreaTop=visibleArea.top;$(tableId+" > tbody > tr:visible").each(function(){firstVisibleTR=$(this);if(this.offsetTop+firstVisibleTR.height()>visibleAreaTop){return false}});return firstVisibleTR},_getLastVisibleTR:function(visibleArea){var tableId="#"+this.id(),lastVisibleTR;lastVisibleTR=this.container().find(tableId+" > tbody > tr:visible").filter(function(){return this.offsetTop<visibleArea.bottom}).last();return lastVisibleTR},_renderRecordsForVirtRowCount:function(ds,rowNumber,rrFunc){var i,rows="";for(i=0;i<rowNumber;i++){rows+=rrFunc.apply(this,[ds[i],i])}return rows},_determineVirtualRowCount:function(){var div,rowNumber=10,ds,rows="",html,i,height,rrFunc,avgRowHeight,displayContainerHeight,rowsPerPage,pageMultiplier,result,$colgroup;this._fireInternalEvent("_virtRowCountDetermining");ds=this._getDataView();if(rowNumber>ds.length){rowNumber=ds.length}div=$('<div class="'+this.css.gridClasses+" "+this.css.baseClass+'"></div>)').appendTo("body").css({position:"absolute",top:-1800,left:-1800,visibility:"hidden"});if(this._rlp){rrFunc=this._renderRecordFromLayout}else{rrFunc=this._renderRecord}rows=this._renderRecordsForVirtRowCount(ds,rowNumber,rrFunc);html='<table cellpadding="0" cellspacing="0" border="0" style="width:'+this.element.width()+'px; table-layout: fixed;" class="'+(this._isMultiRowGrid()?this.css.mrlGridTableClass:this.css.gridTableClass)+'">';$colgroup=this.element.children("colgroup");if($colgroup.length){html+=$colgroup[0].outerHTML}html+='<tbody role="rowgroup">'+rows+"</tbody></table>";div.html(html);height=div.height();avgRowHeight=height/rowNumber;displayContainerHeight=this._getDisplayContainerHeight();rowsPerPage=displayContainerHeight/avgRowHeight;pageMultiplier=this._getPageMultiplier(this.options.columns.length);result=Math.ceil(rowsPerPage*pageMultiplier);div.remove();this._fireInternalEvent("_virtRowCountDetermined",result);return result},_getTotalRowCount:function(){return this._getDataView().length},_getPageMultiplier:function(colsCount){var clampCount=Math.max(10,Math.min(100,colsCount));return-.03*clampCount+5},_renderVirtualRecordsContinuous:function(){var dvLen,firstVisibleTRIndex,oAvgRowHeight,endIndexToBeLoaded,lastVisibleRow,isScrolledToBottom;this._totalRowCount=this._getTotalRowCount();this._oldScrollTop=0;if(this._totalRowCount===0){this._setScrollContainerHeight(0);this._virtualDom=[]}this._virtualRowCount=this._determineVirtualRowCount();if(this._virtualRowCount>this._totalRowCount){this._virtualRowCount=this._totalRowCount}if(!this._persistVirtualScrollTop){this._scrollTo(0,true);this._startRowIndex=0;this._renderRecords(this._virtualRowCount-1);oAvgRowHeight=this._avgRowHeight;this._avgRowHeight=this._calculateAvgRowHeight();if(this._avgRowHeight!==oAvgRowHeight){this._trigger("avgRowHeightChanged",null,{owner:this,oAvgRowHeight:oAvgRowHeight,avgRowHeight:this._avgRowHeight})}this._setScrollContainerHeight(this._totalRowCount*this._avgRowHeight)}else{dvLen=this._getDataView().length;if(this._prevFirstVisibleTRIndex||this._prevFirstVisibleTRIndex===0){firstVisibleTRIndex=this._prevFirstVisibleTRIndex}else{firstVisibleTRIndex=0}if(firstVisibleTRIndex>=dvLen-1){endIndexToBeLoaded=dvLen-1;firstVisibleTRIndex=dvLen-this._virtualRowCount-1}else{endIndexToBeLoaded=parseInt(this._virtualRowCount,0)+firstVisibleTRIndex}if(endIndexToBeLoaded>dvLen-1){endIndexToBeLoaded=dvLen-1;firstVisibleTRIndex=dvLen-this._virtualRowCount-1}if(firstVisibleTRIndex<0){firstVisibleTRIndex=0}this._renderRecords(firstVisibleTRIndex,endIndexToBeLoaded);this._avgRowHeight=this._calculateAvgRowHeight();this._updateVirtualScrollContainer();this._startRowIndex=firstVisibleTRIndex;lastVisibleRow=this.container().find("#"+this.id()+" > tbody > tr:visible:last");isScrolledToBottom=this._getScrollContainerScrollTop()+5>this._scrollContainer()[0].scrollHeight-this._scrollContainer().innerHeight();if(endIndexToBeLoaded===dvLen-1&&isScrolledToBottom){this._setDisplayContainerScrollTop(lastVisibleRow.length?lastVisibleRow[0].offsetTop:0)}else{this._setDisplayContainerScrollTop(this._prevFirstVisibleTROffset)}this._oldScrollTop=this._scrollContainer().scrollTop()}},_rerenderVirtualRecordsContinuous:function(){var tableId="#"+this.id(),lastRow,lastRowDataIndex;lastRow=this.container().find(tableId+" > tbody > tr:last");lastRowDataIndex=parseInt(lastRow.attr("data-row-idx"),0);this._focusDataRowIndex=null;this._startRowIndex=this._startRowIndex||0;this._renderRecords(this._startRowIndex,lastRowDataIndex);this._trigger("virtualrecordsrender",null,{owner:this,tbody:this.element.children("tbody"),dom:this._virtualDom})},_buildVirtualDomForContinuousVirtualization:function(){var rows,cells,i,j;if(this.options.virtualization===true&&this.options.virtualizationMode==="continuous"){this._virtualDom=[];rows=this.container().find("#"+this.id()+" > tbody > tr");for(i=0;i<rows.length;i++){this._virtualDom[i]=[];cells=rows[i].children;for(j=0;j<cells.length;j++){this._virtualDom[i][j]=cells[j]}}this._updateVirtualScrollContainer()}},_isFixedElement:function($td){if(this.hasFixedColumns()&&$td.closest("div").attr("data-fixed-container")!==undefined){return true}return false},getColumnByTD:function($td){if(!($td instanceof $)){$td=$($td)}var $tr=$td.closest("tr"),describedBy=$td.attr("aria-describedBy"),column,res={},visibleInd,i;if($tr.length===0){return null}if($td.attr("data-parent")||$td.attr("data-skip")){return null}if(!describedBy){return{column:this._visibleColumns()[0],index:0}}describedBy=describedBy.split(" ");for(i=0;i<describedBy.length;i++){column=describedBy[i].trim();if(column.startsWith(this.id()+"_")){column=this.columnByKey(column.slice(column.indexOf(this.id()+"_")+this.id().length+1));break}}visibleInd=this.getVisibleIndexByKey(column.key,true);res={column:column,index:visibleInd};return res},_clearPersistenceData:function(){var topmostGrid=this.element.closest(".ui-iggrid-root").data("igGrid")||this;delete topmostGrid.persistenceData},_savePersistenceData:function(data,feature,layout){var topmostGrid=this,featureId=feature;if($.type(layout)==="string"&&layout.length>0){topmostGrid=this.element.closest(".ui-iggrid-root").data("igGrid")||this;if(layout!==topmostGrid.element[0].id){featureId=feature+"_"+layout}}topmostGrid.persistenceData=topmostGrid.persistenceData||{};topmostGrid.persistenceData[featureId]=data},_getPersistenceData:function(feature,layout){var topmostGrid=this,featureId=feature;if($.type(layout)==="string"&&layout.length>0){topmostGrid=this.element.closest(".ui-iggrid-root").data("igGrid")||this;if(layout!==topmostGrid.element[0].id){featureId=feature+"_"+layout}}topmostGrid.persistenceData=topmostGrid.persistenceData||{};return topmostGrid.persistenceData[featureId]},_saveFirstVisibleTRIndex:function(){var fvtr=this._getFirstVisibleTR(this._getDisplayContainerVisibleArea());if(fvtr&&fvtr.length){this._prevFirstVisibleTRIndex=parseInt(fvtr.attr("data-row-idx"),10);this._prevFirstVisibleTROffset=this._getDisplayContainerScrollTop()-fvtr[0].offsetTop}},_getLastVisibleDataRecordIndex:function(){return this._getDataView().length-1},_revertToInitialState:function(){var i,a,attr;if(this.element.is("table")&&this._initialChildren){this._initialChildren.appendTo(this.element)}attr=this.element[0].attributes;a=[];for(i=0;i<attr.length;i++){if(attr[i].name!=="id"){a.push(attr[i].name)}}for(i=0;i<a.length;i++){this.element.removeAttr(a[i])}for(i=0;i<this._initialAttributes.length;i++){if(this._initialAttributes[i].name!=="id"){this.element.attr(this._initialAttributes[i].name,this._initialAttributes[i].value)}}},_removeDetachedDOM:function(container){if(!container){return}var colKey,arr,i;for(colKey in container){if(container.hasOwnProperty(colKey)){arr=container[colKey];for(i=0;i<arr.length;i++){if(arr[i]&&arr[i].length){arr[i].remove()}}}}},_detachEvents:function(){var container;if(this._cellClickHandler){this.element.unbind({click:this._cellClickHandler});this._cellClickHandler=null}if(this._mouseClickEventHandlers){this.element.unbind(this._mouseClickEventHandlers);delete this._mouseClickEventHandlers}if(this._uiSoftDirtyHandler){this.element.unbind("iggriduisoftdirty",this._uiSoftDirtyHandler);this._uiSoftDirtyHandler=null}if(this._hovEvts){this.element.unbind(this._hovEvts);this._hovEvts=null}if(this._documentEvents){$(document).unbind(this._documentEvents);this._documentEvents=null}container=this.scrollContainer();if(!container.length){container=this._vdisplaycontainer()}container.unbind(".syncScrollContainers");this.headersTable().parent().unbind(".syncScrollContainers");container=this.footersTable().closest("div");container.unbind(".syncScrollContainers");this.element.unbind(".setFocusElement")},_destroyFeatures:function(){var i,features=this.options.features,e=this.element;if(this._internalFeatures&&this._internalFeatures.length){features=features.concat(this._internalFeatures)}for(i=0;i<features.length;i++){if(features[i]&&e.data("igGrid"+features[i].name)){e["igGrid"+features[i].name]("destroy")}}},destroy:function(notToCallDestroy){var prev=this.container().prev(),prepend=false;if(this._scrollHeader&&this._hscrollbarcontent().length>0){this._hscrollbarcontent().unbind("scroll",$.proxy(this._scrollHeader,this))}if(this.scrollContainer()){this.scrollContainer().unbind("scroll");this.scrollContainer().unbind("wheel")}if(this.dataSource._ajaxRequest&&this.dataSource._ajaxRequest.readyState!==4){this.dataSource._ajaxRequest.abort()}this._headerInitCallbacks=[];this._footerInitCallbacks=[];this.tmpDataSource=null;if(this._resId){clearInterval(this._resId)}this._destroyed=true;this._destroyFeatures();if(this._detachedContainersInitialized){this._removeDetachedDOM(this._detachedHeaderCells);delete this._detachedHeaderCells;this._removeDetachedDOM(this._detachedFooterCells);delete this._detachedFooterCells;delete this._detachedContainersInitialized}this._detachEvents();if(this._isWrapped&&this.container().parent().data("igGrid")){this.element=this.container().parent();this.element.empty();if(notToCallDestroy!==true){this._superApply(arguments)}this._revertToInitialState();this.element.trigger(this.events.destroyed,{owner:this});return this}if(prev.length===0){prev=this.container().parent();prepend=true}this.element.empty();if(prepend){prev.prepend(this.element)}else{this.element.insertAfter(prev)}if(notToCallDestroy!==true){this._superApply(arguments)}this.container().remove();this._captionContainer=null;this._container=null;this._revertToInitialState();if(notToCallDestroy===true){return this}this.element.trigger(this.events.destroyed,{owner:this});return this}});$.extend($.ui.igGrid,{version:"21.2.12"})})($);(function($){$.widget("ui.igGridModalDialog",$.ui.igWidget,{options:{modalDialogWidth:250,modalDialogHeight:"",renderFooterButtons:true,animationDuration:200,buttonApplyDisabled:false,closeModalDialogOnEnter:false,tabIndex:null},css:{modalDialog:"ui-dialog ui-draggable ui-resizable ui-iggrid-dialog ui-widget ui-widget-content ui-corner-all",modalDialogHeaderCaption:"ui-dialog-titlebar ui-widget-header ui-corner-top ui-helper-reset ui-corner-all ui-helper-clearfix",modalDialogHeaderCaptionTitle:"ui-dialog-title",modalDialogContent:"ui-dialog-content ui-widget-content",modalDialogHandleBar:"",captionButtonContainer:"ui-iggrid-modaldialog-caption-buttoncontainer",modalDialogFooter:"ui-dialog-buttonpane ui-widget-content ui-helper-clearfix",buttonset:"ui-dialog-buttonset",blockArea:"ui-widget-overlay ui-iggrid-blockarea"},events:{modalDialogOpening:"modalDialogOpening",modalDialogOpened:"modalDialogOpened",modalDialogMoving:"modalDialogMoving",modalDialogClosing:"modalDialogClosing",modalDialogClosed:"modalDialogClosed",modalDialogContentsRendering:"modalDialogContentsRendering",modalDialogContentsRendered:"modalDialogContentsRendered",buttonOKClick:"buttonOKClick",buttonCancelClick:"buttonCancelClick"},_createWidget:function(options){this.gridContainer=options.gridContainer;this.containment=options.containment||options.gridContainer;this._superApply(arguments)},_create:function(){this._setGridWidthHeight();this._renderModalDialog()},_setGridWidthHeight:function(){this.element.css("width",this.options.modalDialogWidth).css("height",this.options.modalDialogHeight)},_checkModalDialogFocus:function(){var self=this;self.gridContainer.unbind("keydown.focusChecker");self.gridContainer.bind("keydown.focusChecker",function(e){var target,gridContainer,tabElems;if(e.keyCode===$.ui.keyCode.TAB){target=document.activeElement;gridContainer=self.gridContainer[0];if(!target||!gridContainer){return}if(target===gridContainer||$.contains(gridContainer,target)&&!$.contains(self.element[0],target)){tabElems=$(":tabbable",self.element);tabElems.first().focus();return}}})},openModalDialog:function(){var maxZ=1e4,rOffset,self=this,scrollLeft,scrollTop,pageLeft,pageTop,pageRight,pageBottom,pos,h,w,bh,bw,mdW,mdH,caption,content,footer,buttonSet,modalDialogTop,modalDialogLeft,noCancel=true,modalDialog=this.element,block,animationDuration=this._getAnimationDuration(),blockId=this._id("_modaldialog_block"),ti=this.options.tabIndex;if(this._modalDialogOpened){return}noCancel=this._trigger(this.events.modalDialogOpening,null,{modalDialog:modalDialog,owner:this});if(noCancel){this._checkModalDialogFocus();$("#"+blockId).remove();this._setGridWidthHeight();pos=$.ig.util.offset(this.gridContainer);w=this.gridContainer.outerWidth();h=this.gridContainer.outerHeight();scrollLeft=$(window).scrollLeft();scrollTop=$(window).scrollTop();pageLeft=pos.left-scrollLeft;pageTop=pos.top-scrollTop;pageRight=pageLeft+w;pageBottom=pageTop+h;if(typeof this.options.modalDialogWidth==="number"){mdW=parseInt(this.options.modalDialogWidth,10)}else{if(this.options.modalDialogWidth.indexOf("%")>0){var percentW=parseInt(this.options.modalDialogWidth,10)/100;if(this.options.containment instanceof $){mdW=this.options.containment.width()*percentW}if(typeof this.options.containment==="string"){mdW=$(window).width()*percentW}}if(this.options.modalDialogWidth.indexOf("px")>0){mdW=parseInt(this.options.modalDialogWidth,10)}}if(typeof this.options.modalDialogHeight==="number"){mdH=parseInt(this.options.modalDialogHeight,10)}else{if(this.options.modalDialogHeight.indexOf("%")>0){var percentH=parseInt(this.options.modalDialogHeight,10)/100;if(this.options.containment instanceof $){mdH=this.options.containment.height()*percentH}if(typeof this.options.containment==="string"){mdH=$(window).height()*percentH}}if(this.options.modalDialogHeight.indexOf("px")>0){mdH=parseInt(this.options.modalDialogHeight,10)}}block=$("<div></div>").appendTo(this.gridContainer).attr("id",blockId).css("position","absolute").addClass(this.css.blockArea).hide();if(block.outerWidth()!==this.gridContainer.outerWidth()){block.css("width",this.gridContainer.outerWidth())}if(block.outerHeight()!==this.gridContainer.outerHeight()){block.css("height",this.gridContainer.outerHeight())}rOffset=$.ig.util.getRelativeOffset(block);block.css({left:pos.left-rOffset.left,top:pos.top-rOffset.top}).fadeToggle(animationDuration);if(!mdW){mdW=this.element.width()}if(!mdH){mdH=this.element.height()}if(pageLeft<0){pageLeft=0}if(pageTop<0){pageTop=0}bw=$(window).width();bh=$(window).height();if(pageRight>bw){pageRight=bw}if(pageBottom>bh){pageBottom=bh}modalDialogTop=pageTop+scrollTop+(pageBottom-pageTop)/2-mdH/2;modalDialogLeft=pageLeft+scrollLeft+(pageRight-pageLeft)/2-mdW/2;if(modalDialogTop<0){modalDialogTop=pageTop}if(modalDialogLeft<0){modalDialogLeft=pageLeft}maxZ=$.ig.getMaxZIndex(this.element[0].id);rOffset=$.ig.util.getRelativeOffset(modalDialog);modalDialog.css({left:modalDialogLeft-rOffset.left,top:modalDialogTop-rOffset.top,zIndex:maxZ+2}).fadeToggle(animationDuration,function(){var args={modalDialogElement:modalDialog,owner:self,shouldFocus:true};self._modalDialogOpened=true;self._trigger(self.events.modalDialogOpened,null,args);if(args.shouldFocus){modalDialog.focus()}});block.css({zIndex:maxZ+1});caption=modalDialog.children("div.ui-dialog-titlebar");content=modalDialog.children("div.ui-dialog-content");footer=modalDialog.children("div.ui-dialog-buttonpane");buttonSet=footer.children(".ui-dialog-buttonset");content.css("height",modalDialog.height()-caption.outerHeight()-(content.outerHeight()-content.height())-footer.outerHeight());this.element.find("#"+this._id("content")).attr("tabIndex",$.type(ti)==="number"?ti:0).css({width:""});if(!$.ig.util.isTouch){modalDialog.resizable({minHeight:modalDialog.outerHeight()/2,minWidth:buttonSet.width()+(content.outerWidth()-content.width())})}}},_getAnimationDuration:function(){var animationDuration=this.options.animationDuration;if(animationDuration===null||animationDuration===undefined){animationDuration=200}return animationDuration},changeLocale:function(){this.element.find("#"+this._id("footer_buttonok")).igButton("option",{labelText:this._getLocaleValue("buttonApplyText"),title:this._getLocaleValue("buttonApplyTitle")});this.element.find("#"+this._id("footer_buttoncancel")).igButton("option",{labelText:this._getLocaleValue("buttonCancelText"),title:this._getLocaleValue("buttonCancelTitle")});this.element.find("span.ui-dialog-title:eq(0)").html(this._getLocaleValue("modalDialogCaptionText"))},_registerWidget:$.noop,_unregisterWidget:$.noop,_setOption:function(key,value){this._superApply(arguments);switch(key){case"buttonApplyDisabled":this.element.find("#"+this._id("footer_buttonok")).igButton("option","disabled",value);break;case"modalDialogWidth":this.element.css("width",value);break;case"modalDialogHeight":this.element.css("height",value);break;case"renderFooterButtons":if(this.element.is(":visible")){this.closeModalDialog()}this.element.empty();this._renderModalDialog();break;default:break}},closeModalDialog:function(accepted,e){var noCancel=true,self=this,modalDialog=this.element,animationDuration=this._getAnimationDuration();if(!this._modalDialogOpened){return}noCancel=this._trigger(this.events.modalDialogClosing,e||null,{modalDialog:modalDialog,owner:this,accepted:!!accepted,raiseEvents:!!e});if(noCancel){this.gridContainer.unbind("keydown.focusChecker");$("#"+this._id("_modaldialog_block")).fadeToggle(animationDuration);modalDialog.fadeToggle(animationDuration,null,function(){self._trigger(self.events.modalDialogClosed,e||null,{modalDialog:modalDialog,owner:self,accepted:!!accepted,raiseEvents:!!e})});self._modalDialogOpened=false}},_modalDialogMove:function(e,ui){var oPos=ui.originalPosition,pos=ui.position;this._trigger(this.events.modalDialogMoving,null,{modalDialog:e.target,owner:this,originalPosition:oPos,position:pos})},getCaptionButtonContainer:function(){return this.element.find("#"+this._id("caption_button_container"))},getFooter:function(){return this.element.find("#"+this._id("footer"))},getContent:function(){return this.element.find("#"+this._id("content"))},_renderModalDialog:function(){var self=this,css=this.css,modalDialog=this.element,caption,containment,modalDialogContent,footer,o=this.options,$buttonSet,$buttonOK,$buttonCancel,noCancel=true,ti=this.options.tabIndex;modalDialog.css("position","absolute").addClass(this.css.modalDialog).hide();noCancel=this._trigger(this.events.modalDialogContentsRendering,null,{modalDialog:modalDialog,owner:this});if(noCancel){caption=$("<div></div>").addClass(this.css.modalDialogHeaderCaption).appendTo(modalDialog);$("<span></span>").text(this._getLocaleValue("modalDialogCaptionText")).addClass(this.css.modalDialogHeaderCaptionTitle).appendTo(caption);$("<div></div>").attr("id",this._id("caption_button_container")).addClass(css.captionButtonContainer).appendTo(caption);modalDialogContent=$("<div></div>").css("overflow","auto").addClass(this.css.modalDialogContent).attr("id",this._id("content")).appendTo(modalDialog);if(o.renderFooterButtons===true){footer=$("<div></div>").addClass(this.css.modalDialogFooter).attr("id",this._id("footer")).appendTo(modalDialog);$buttonSet=$("<div></div>").addClass(this.css.buttonset).appendTo(footer);$buttonOK=$("<button type='button'></button>").attr("id",this._id("footer_buttonok")).appendTo($buttonSet);if($.type(ti)){$buttonOK.attr("tabIndex",ti)}$buttonOK.igButton({labelText:this._getLocaleValue("buttonApplyText"),title:this._getLocaleValue("buttonApplyTitle"),disabled:o.buttonApplyDisabled});$buttonCancel=$("<button type='button'></button>").attr("id",this._id("footer_buttoncancel")).appendTo($buttonSet);if($.type(ti)){$buttonCancel.attr("tabIndex",ti)}$buttonCancel.igButton({labelText:this._getLocaleValue("buttonCancelText"),title:this._getLocaleValue("buttonCancelTitle")});$buttonCancel.bind({click:function(e){noCancel=self._trigger(self.events.buttonCancelClick,e,{modalDialog:modalDialog,owner:self});if(noCancel){self.closeModalDialog(false,e);e.preventDefault();e.stopPropagation()}}});$buttonOK.bind({click:function(e){var arg={modalDialog:modalDialog,owner:self,toClose:false};self._trigger(self.events.buttonOKClick,e,arg);if(arg.toClose){self.closeModalDialog(true,e);e.preventDefault();e.stopPropagation()}}})}containment=this.containment;if(containment==="window"){containment="document"}modalDialog.bind({keydown:function(e){var tabElems,first,last;if(e.keyCode===$.ui.keyCode.ESCAPE){self.closeModalDialog(false,e);return}if(e.keyCode===$.ui.keyCode.ENTER&&self.options.closeModalDialogOnEnter&&!self.options.buttonApplyDisabled){self.closeModalDialog(true,e);return}if(e.keyCode!==$.ui.keyCode.TAB){return}tabElems=$(":tabbable",this);first=tabElems.first();last=tabElems.last();if(e.target===last[0]&&!e.shiftKey){first.focus();return false}if(e.target===first[0]&&e.shiftKey){last.focus();return false}}}).draggable({containment:containment,handle:caption,drag:$.proxy(this._modalDialogMove,this)}).attr("role","dialog").attr("tabIndex",-1);if(!$.ig.util.isTouch){modalDialog.resizable({alsoResize:modalDialogContent});if(this.containment!=="window"){modalDialog.resizable("option","containment","parent")}}this._trigger(this.events.modalDialogContentsRendered,null,{modalDialog:modalDialog,owner:this})}},_id:function(){var i,ar=arguments,res=this.element[0].id;for(i=0;i<ar.length;i++){res+="_"+ar[i]}return res},destroy:function(){$("#"+this._id("_modaldialog_block")).remove();if(this.gridContainer){this.gridContainer.unbind("keydown.focusChecker")}this._superApply(arguments);return this}});$.extend($.ui.igGridModalDialog,{version:"21.2.12"});$.widget("ui.igEditorFilter",{setFocus:function(delay,toggle){var provider=this.options.provider;if(delay&&$.type(delay)==="number"&&delay>0){setTimeout(function(){provider.setFocus(toggle)},delay)}else{provider.setFocus(toggle)}},remove:function(){if(!this.options.provider.removeFromParent()){var p,e=this.element;p=e[0].parentNode;if(p&&p.tagName){p.removeChild(e[0])}e=this.validator();if(e){e.hide()}}},exitEditMode:function(){var editor=this.options.provider.editor;if(editor&&editor._exitEditMode&&$.type(editor._exitEditMode)==="function"){editor._exitEditMode()}},validator:function(){return this.options.provider.validator()},hasInvalidMessage:function(){var validator=this.validator();return validator?validator.getErrorMessages().length>0:false},destroy:function(){this.options.provider.destroy();this._superApply(arguments)},_setLanguage:function(lang){var editor=this.options.provider.editor;editor.option("language",lang)},_setRegional:function(regional){var editor=this.options.provider.editor;editor.option("regional",regional)}});$.extend($.ui.igEditorFilter,{version:"21.2.12"});$.ig.EditorProvider=$.ig.EditorProvider||Class.extend({createEditor:function(callbacks,key,editorOptions,tabIndex,format,element){this.handlers={};this.userHandlers={};this.options=editorOptions||{};this.callbacks=callbacks;this.columnKey=key;this.handlers.keyDownHandler=$.proxy(this.keyDown,this);if(this.options.keydown){this.userHandlers.keyDown=this.options.keydown}this.options.keydown=this.handlers.keyDownHandler},keyDown:function(evt,ui){if(this.callbacks&&typeof this.callbacks.keyDown==="function"){this.callbacks.keyDown(evt,ui,this.columnKey)}if(this.userHandlers.keyDown){this.userHandlers.keyDown.apply(this.editor,[evt,ui])}},attachErrorEvents:function(errorShowing,errorShown,errorHidden){this.editor.element.bind({"igvalidatorerrorhidden.updating":errorHidden,"igvalidatorerrorshowing.updating":errorShowing,"igvalidatorerrorshown.updating":errorShown})},getEditor:function(){return this.editor},refreshValue:function(){return true},getValue:function(){return this.editor.value()},setValue:function(val){this.editor.value(val)},setFocus:function(toggle){return null},setSize:function(width,height){return null},removeFromParent:function(){return false},destroy:function(){this.editor.destroy()},validator:function(){return null},validate:function(){var validator=this.validator();return validator?validator.isValid():true},requestValidate:function(evt){var validator=this.validator(),valid=true;if(validator){validator._forceValidation=true;valid=validator._validate(null,evt);validator._forceValidation=false}return valid},isValid:function(){return true}});$.ig.EditorProviderBase=$.ig.EditorProviderBase||$.ig.EditorProvider.extend({createEditor:function(callbacks,key,editorOptions,tabIndex,format,element){this._super(callbacks,key,editorOptions,tabIndex,format,element);this.handlers.textChangeHandler=$.proxy(this.textChanged,this);if(this.options.textChanged){this.userHandlers.textChanged=this.options.textChanged}this.options.textChanged=this.handlers.textChangeHandler;this.options.tabIndex=tabIndex},textChanged:function(evt,ui){if(this.callbacks&&typeof this.callbacks.textChanged==="function"){this.callbacks.textChanged(evt,ui,this.columnKey)}if(this.userHandlers.textChanged){this.userHandlers.textChanged.apply(this.editor,[evt,ui])}},setSize:function(width,height){if(width!==undefined){this.editor._setOption("width",width)}if(height!==undefined){this.editor._setOption("height",height)}},setFocus:function(){this.editor._focused=false;this.editor.setFocus()},removeFromParent:function(){var v=this.validator();if(v){v.hide()}this.editor._focused=false;this.editor._exitEditMode();this.editor._clearEditorNotifier();this.editor.editorContainer().removeClass("ui-state-focus");return this.editor.editorContainer().detach()},destroy:function(){this.editor.element.unbind(".updating");this.editor.destroy()},refreshValue:function(){if(this.editor._editorInput.is(":focus")){this.editor._processValueChanging(this.editor._editorInput.val())}},validator:function(){if($.type(this.editor.validator)==="function"){return this.editor.validator()}return null},isValid:function(){return this.editor.isValid()}});$.ig.EditorProviderText=$.ig.EditorProviderText||$.ig.EditorProviderBase.extend({createEditor:function(callbacks,key,editorOptions,tabIndex,format,element){element=element||$("<span />");if(!element.igTextEditor){throw new Error($.ig.GridUpdating.locale.igTextEditorException)}this._super(callbacks,key,editorOptions,tabIndex,format,element);element.igTextEditor(this.options);this.editor=element.data("igTextEditor");return this.editor.editorContainer()},keyDown:function(evt,ui){if(ui.key===$.ui.keyCode.ENTER&&this.editor.dropDownContainer()&&this.editor.dropDownVisible()){return}if(this.callbacks&&typeof this.callbacks.keyDown==="function"){if(!(ui.key===$.ui.keyCode.ENTER&&evt.originalEvent.altKey)||!ui.editorInput.is("textarea")){this.callbacks.keyDown(evt,ui,this.columnKey)}else{evt.originalEvent.stopPropagation();evt.originalEvent.preventDefault()}}if(this.userHandlers.keyDown){this.userHandlers.keyDown.apply(this.editor,[evt,ui])}}});$.ig.EditorProviderNumeric=$.ig.EditorProviderNumeric||$.ig.EditorProviderBase.extend({createEditor:function(callbacks,key,editorOptions,tabIndex,format,element){element=element||$("<span />");if(!element.igNumericEditor){throw new Error($.ig.GridUpdating.locale.igNumericEditorException)}this._super(callbacks,key,editorOptions,tabIndex,format,element);if(format==="int"){this.options.maxDecimals=0}else if(format==="double"&&!this.options.maxDecimals){this.options.maxDecimals=100}this.options.allowNullValue=true;element.igNumericEditor(this.options);this.editor=element.data("igNumericEditor");return this.editor.editorContainer()},getValue:function(){var val=this.editor.value();return isNaN(val)?null:val}});$.ig.EditorProviderCurrency=$.ig.EditorProviderCurrency||$.ig.EditorProviderBase.extend({createEditor:function(callbacks,key,editorOptions,tabIndex,format,element){element=element||$("<span />");if(!element.igCurrencyEditor){throw new Error($.ig.GridUpdating.locale.igCurrencyEditorException)}this._super(callbacks,key,editorOptions,tabIndex,format,element);this.options.displayFactor=this.options.displayFactor||1;
this.options.allowNullValue=true;element.igCurrencyEditor(this.options);this.editor=element.data("igCurrencyEditor");return this.editor.editorContainer()}});$.ig.EditorProviderPercent=$.ig.EditorProviderPercent||$.ig.EditorProviderBase.extend({createEditor:function(callbacks,key,editorOptions,tabIndex,format,element){element=element||$("<span />");if(!element.igPercentEditor){throw new Error($.ig.GridUpdating.locale.igPercentEditorException)}this._super(callbacks,key,editorOptions,tabIndex,format,element);this.options.allowNullValue=true;element.igPercentEditor(this.options);this.editor=element.data("igPercentEditor");return this.editor.editorContainer()}});$.ig.EditorProviderMask=$.ig.EditorProviderMask||$.ig.EditorProviderBase.extend({createEditor:function(callbacks,key,editorOptions,tabIndex,format,element){element=element||$("<span />");if(!element.igMaskEditor){throw new Error($.ig.GridUpdating.locale.igMaskEditorException)}this._super(callbacks,key,editorOptions,tabIndex,format,element);element.igMaskEditor(this.options);this.editor=element.data("igMaskEditor");return this.editor.editorContainer()}});$.ig.EditorProviderDate=$.ig.EditorProviderDate||$.ig.EditorProviderBase.extend({createEditor:function(callbacks,key,editorOptions,tabIndex,format,element,offset){element=element||$("<span />");if(!element.igDateEditor){throw new Error($.ig.GridUpdating.locale.igDateEditorException)}this._super(callbacks,key,editorOptions,tabIndex,format,element);if(format&&!this.options.dateInputFormat){this.options.dateInputFormat=format}this.options.allowNullValue=true;this.options.displayTimeOffset=offset;element.igDateEditor(this.options);this.editor=element.data("igDateEditor");return this.editor.editorContainer()},setValue:function(value,fe,newOffset){if(newOffset!==undefined){this.editor._setOption("displayTimeOffset",newOffset)}this._super(value)}});$.ig.EditorProviderDatePicker=$.ig.EditorProviderDatePicker||$.ig.EditorProviderBase.extend({createEditor:function(callbacks,key,editorOptions,tabIndex,format,element,offset){element=element||$("<span />");if(!element.igDatePicker){throw new Error($.ig.GridUpdating.locale.igDatePickerException)}this._super(callbacks,key,editorOptions,tabIndex,format,element);if(format&&!this.options.dateInputFormat){this.options.dateInputFormat=format}this.options.allowNullValue=true;this.options.displayTimeOffset=offset;element.igDatePicker(this.options);this.editor=element.data("igDatePicker");return this.editor.editorContainer()},removeFromParent:function(){if(this.editor.dropDownVisible()){$("#ui-datepicker-div").hide()}this._super()},setValue:function(value,fe,newOffset){if(newOffset!==undefined){this.editor._setOption("displayTimeOffset",newOffset)}this._super(value)}});$.ig.EditorProviderTimePicker=$.ig.EditorProviderTimePicker||$.ig.EditorProviderBase.extend({createEditor:function(callbacks,key,editorOptions,tabIndex,format,element,offset){element=element||$("<span />");if(!element.igTimePicker){throw new Error($.ig.GridUpdating.locale.igTimePickerException)}this._super(callbacks,key,editorOptions,tabIndex,format,element);if(!this.options.timeInputFormat){this.options.timeInputFormat=format?format:"time"}this.options.allowNullValue=true;this.options.displayTimeOffset=offset;this.options.buttonType=editorOptions.buttonType||"spin";this.options.spinDelta=editorOptions.spinDelta||{hours:1,minutes:1};element.igTimePicker(this.options);this.editor=element.data("igTimePicker");return this.editor.editorContainer()},setValue:function(value,fe,newOffset){if(newOffset!==undefined){this.editor._setOption("displayTimeOffset",newOffset)}this._super(value)}});$.ig.EditorProviderBoolean=$.ig.EditorProviderBoolean||$.ig.EditorProviderBase.extend({createEditor:function(callbacks,key,editorOptions,tabIndex,format,element){var requiresWrapper;if(!this.renderFormat){this.renderFormat="checkbox"}this._super(callbacks,key,editorOptions,tabIndex,format,element);this.handlers.valueChanged=$.proxy(this.valueChanged,this);if(this.options.valueChanged){this.userHandlers.valueChanged=this.options.valueChanged}this.options.valueChanged=this.handlers.valueChanged;switch(this.renderFormat){case"checkbox":requiresWrapper=!element;element=element||$("<input />");if(!element.igCheckboxEditor){throw new Error($.ig.GridUpdating.locale.igCheckboxEditorException)}element.igCheckboxEditor(this.options);this.editor=element.data("igCheckboxEditor");if(requiresWrapper){this.outerContainer=$("<div />").css({background:"rgb(255, 255, 255)",outline:"0px","text-align":"center",overflow:"hidden"}).addClass("ui-igedit ui-igedit-container ui-state-default ui-iggrid-editor");this.outerContainer.append(this.editor.editorContainer());return this.outerContainer}return this.editor.editorContainer();case"dropdown":this.options.listItems=["true","false"];this.options.dropDownAttachToBody=true;this.options.button="dropdown";this.options.isLimitedToListValues=this.options.isLimitedToListValues!==undefined&&this.options.isLimitedToListValues!==null?this.options.isLimitedToListValues:true;this.options.dropDownAttachedToBody=true;element=element||$("<span />");if(!element.igTextEditor){throw new Error($.ig.GridUpdating.locale.igTextEditorException)}element.igTextEditor(this.options);this.editor=element.data("igTextEditor");return this.editor.editorContainer()}},keyDown:function(evt,ui){if(ui.key===$.ui.keyCode.ENTER&&this.renderFormat==="dropdown"&&this.editor.dropDownContainer()&&this.editor.dropDownVisible()){return}if(this.callbacks&&typeof this.callbacks.keyDown==="function"){this.callbacks.keyDown(evt,ui,this.columnKey)}if(this.userHandlers.keyDown){this.userHandlers.keyDown.apply(this.editor,[evt,ui])}},valueChanged:function(evt,ui){if(this.callbacks&&typeof this.callbacks.textChanged==="function"){this.callbacks.textChanged(evt,ui,this.columnKey)}if(this.userHandlers.valueChanged){this.userHandlers.valueChanged.apply(this.editor,[evt,ui])}},refreshValue:function(){return false},getValue:function(){var editorValue=this.editor.value();if(this.renderFormat==="checkbox"){return editorValue}if(this.options.allowNullValue&&!this.options.isLimitedToListValues&&editorValue===null){return null}return editorValue&&editorValue.toLowerCase()==="true"},setValue:function(val){if(this.renderFormat==="checkbox"){this.editor.value(val!==null?val:false)}else if(this.options.allowNullValue&&!this.options.isLimitedToListValues){this.editor.value(val!==null?String(val):null)}else{this.editor.value(val!==null?String(val):"false")}},setSize:function(width,height){var cont,chb,defChb;if(this.renderFormat==="checkbox"&&this.outerContainer){cont=this.outerContainer;chb=cont.children().first();cont.css("width",width);cont.css("height",height);chb.css({"margin-top":cont.height()/2-chb.height()/2});defChb=cont.siblings().first().children().first();width=defChb.width();height=defChb.height()}this._super(width,height)},removeFromParent:function(){if(this.renderFormat==="checkbox"&&this.outerContainer){return this.outerContainer.detach()}return this._super()},destroy:function(){this.editor.element.unbind(".updating");if(this.outerContainer&&this.outerContainer instanceof $){this.outerContainer.empty()}}});$.ig.EditorProviderCombo=$.ig.EditorProviderCombo||$.ig.EditorProvider.extend({createEditor:function(callbacks,key,editorOptions,tabIndex,format,element){element=element||$("<span />");if(!element.igCombo){throw new Error($.ig.GridUpdating.locale.igComboException)}this._super(callbacks,key,editorOptions,tabIndex,format,element);this.handlers.selectionChangedHandler=$.proxy(this.selectionChanged,this);if(this.options.selectionChanged){this.userHandlers.selectionChanged=this.options.selectionChanged}this.options.selectionChanged=this.handlers.selectionChangedHandler;this.options.tabIndex=tabIndex;if(this.options.id){element.attr("id",this.options.id)}element.igCombo(this.options);this.editor=element.data("igCombo");this.editor.textInput().bind("keydown.updating",this.handlers.keyDownHandler);if(this.editor._options.internalSelChangeSubs&&$.type(this.editor._options.internalSelChangeSubs)==="array"){this.handlers.internalSelectionChangedHandler=$.proxy(this.internalSelectionChanged,this);this.editor._options.internalSelChangeSubs.push(this.handlers.internalSelectionChangedHandler)}return element},keyDown:function(evt,ui){if(evt.keyCode===$.ui.keyCode.TAB){this.editor.closeDropDown()}if(this.callbacks&&typeof this.callbacks.keyDown==="function"){if(evt.keyCode!==$.ui.keyCode.ENTER||!this.editor.dropDownOpened()){this.callbacks.keyDown(evt,ui||{owner:this.editor},this.columnKey)}}if(this.editor.options.allowCustomValue){this.internalSelectionChanged(evt,ui)}if(this.userHandlers.keyDown){this.userHandlers.keyDown.apply(this.editor,[evt,ui])}},internalSelectionChanged:function(evt,ui){if(this.callbacks&&typeof this.callbacks.textChanged==="function"){this.callbacks.textChanged(evt,ui,this.columnKey)}},selectionChanged:function(evt,ui){this.internalSelectionChanged(evt,ui);if(this.userHandlers.selectionChanged){this.userHandlers.selectionChanged.apply(this.editor,[evt,ui])}},refreshValue:function(){this.editor.refreshValue()},getValue:function(){var val=this.editor.value();if($.type(val)==="array"){return val.length?val[0]:null}return val},setValue:function(val,fire){this.editor.value(val,null,fire)},setSize:function(width,height){this.editor.element.igCombo({width:width,height:height})},setFocus:function(){this.editor.textInput().focus()},removeFromParent:function(){this.editor.closeDropDown();if(this.validator()){this.validator().hide()}return this.editor.element.closest(".ui-igcombo-wrapper").detach()},validator:function(){return this.editor.validator()},destroy:function(){this.editor.textInput().unbind("keydown.updating");this.editor.element.unbind(".updating");this.editor.destroy()},isValid:function(){return true}});$.ig.EditorProviderObjectCombo=$.ig.EditorProviderObjectCombo||$.ig.EditorProviderCombo.extend({getValue:function(){var val=null,arr=[];if(this.editor.selectedItems()!==null){if(this.editor.options.multiSelection&&this.editor.options.multiSelection.enabled){$(this.editor.selectedItems()).each(function(){arr.push(this.data)});val=arr}else{val=this.editor.selectedItems()[0].data}}return val},setValue:function(val,fire){var arr=[],editor=this.editor;editor.deselectAll();if(val){if(editor.options.multiSelection&&editor.options.multiSelection.enabled){$(val).each(function(){arr.push(this[editor.options.valueKey])});editor.value(arr,null,fire)}else{editor.value(val[this.editor.options.valueKey],null,fire)}}}});$.ig.EditorProviderRating=$.ig.EditorProviderRating||$.ig.EditorProvider.extend({createEditor:function(callbacks,key,editorOptions,tabIndex,format,element){element=element||$("<div />");if(!element.igRating){throw new Error($.ig.GridUpdating.locale.igRatingException)}this._super(callbacks,key,editorOptions,tabIndex,format,element);this.handlers.valueChange=$.proxy(this.valueChange,this);if(this.options.valueChange){this.userHandlers.valueChange=this.options.valueChange}this.options.valueChange=this.handlers.valueChange;if(this.options.id){element.attr("id",this.options.id)}element.igRating(this.options);this.editor=element.data("igRating");this.handlers.internalValueChange=$.proxy(this.internalValueChange,this);this.editor._internalChanged=this.handlers.internalValueChange;if(this.editor._foc){this.editor._foc.attr("tabIndex",tabIndex);this.editor._foc.keydown(this.handlers.keyDown)}return element},internalValueChange:function(evt,ui){if(this.callbacks&&typeof this.callbacks.textChanged==="function"){this.callbacks.textChanged(evt,ui,this.columnKey)}},valueChange:function(evt,ui){this.internalValueChange(evt,ui);if(this.userHandlers.valueChange){this.userHandlers.valueChange.apply(this.editor,[evt,ui])}},setValue:function(val){return this.editor.value(val||0)},setSize:function(width,height){if(!this._once){this.editor._doVotes(this.editor.options)}this._once=1;var back=this.editor.element.parent().css("backgroundColor");this.editor.element.css({width:width,height:height,backgroundColor:back})},setFocus:function(){this.editor.focus()},validator:function(){return this.editor.validator()},destroy:function(){this.editor.element.unbind(".updating");this.editor.destroy()},isValid:function(){return true}});$.ig.SortingExpressionsManager=$.ig.SortingExpressionsManager||Class.extend({init:function(options){if(options){this.grid=options.grid}},setGridInstance:function(grid){this.grid=grid},addSortingExpression:function(se,expr,feature){var i,seLength=se.length,found,cs,isGB=!!expr.isGroupBy,layout=expr.layout,key=expr.fieldName;for(i=0;i<seLength;i++){if(se[i].fieldName===key&&(!layout&&!se[i].layout||layout&&layout===se[i].layout)){if(!!se[i].isGroupBy===isGB){se[i]=expr;return se}else if(!isGB){return se}se.splice(i,1);break}}if(feature&&feature._getColumnSettingByKey){cs=feature._getColumnSettingByKey(key);if(cs&&cs.compareFunc){if($.type(cs.compareFunc)==="function"){expr.compareFunc=cs.compareFunc}else if(typeof cs.compareFunc==="string"&&typeof window[cs.compareFunc]==="function"){expr.compareFunc=window[cs.compareFunc]}}}if(isGB){seLength=se.length;found=-1;expr.isGroupBy=true;for(i=0;i<seLength;i++){if(se[i].isGroupBy===true){found=i}else{break}}if(found===-1){se.unshift(expr)}else{se.splice(found+1,0,expr)}return se}expr.isSorting=true;if(feature.options.mode==="single"&&se.length&&!se[se.length-1].isGroupBy){se[se.length-1]=expr;return se}se.push(expr);return se},setFormattersForSortingExprs:function(exprs,grid){exprs=exprs||[];grid=grid||this.grid;var i,len=exprs.length,expr,col,format,formatterFunc;formatterFunc=$.proxy(function(val,colKey){var col=this.columnByKey(colKey),o=this.options,rowTemplate=!o.rowTemplate||o.rowTemplate.length<=0;return new Date("January 01, 2000 "+$.ig.formatter(val,"date",col.format,rowTemplate,o.enableUTCDates))},grid);for(i=0;i<len;i++){expr=exprs[i];if(expr.formatter){continue}col=grid.columnByKey(expr.fieldName);if(!col){continue}format=col.format;if(format&&(format==="time"||format==="timeLong"||format==="h:mm:ss tt")){expr.formatter=formatterFunc}}return exprs}});$.ig.GetEditorProvider=function(grid,column,editorType){var provider,dataType=column.dataType,format=column.format,value,ds;if(editorType==="checkbox"||!editorType&&(dataType==="bool"||dataType==="boolean")){provider=new $.ig.EditorProviderBoolean;if(format==="checkbox"||!format&&grid.options.renderCheckboxes||editorType==="checkbox"){provider.renderFormat="checkbox"}else{provider.renderFormat="dropdown"}}else if(editorType==="combo"&&dataType==="object"){provider=new $.ig.EditorProviderObjectCombo}else if(editorType==="combo"&&dataType!=="object"){provider=new $.ig.EditorProviderCombo}else if(editorType==="rating"){provider=new $.ig.EditorProviderRating}else if(editorType==="mask"){provider=new $.ig.EditorProviderMask}else if((editorType||format)==="currency"){provider=new $.ig.EditorProviderCurrency}else if((editorType||format)==="percent"){provider=new $.ig.EditorProviderPercent}else if(editorType==="numeric"||dataType==="number"){provider=new $.ig.EditorProviderNumeric}else if(editorType==="text"||dataType==="string"){provider=new $.ig.EditorProviderText}else if(editorType==="datepicker"){provider=new $.ig.EditorProviderDatePicker}else if((editorType||dataType)==="date"){provider=new $.ig.EditorProviderDate}else if(editorType==="timepicker"||dataType==="time"){provider=new $.ig.EditorProviderTimePicker}else{ds=grid.dataSource;if(ds&&ds.data()&&ds.data().length){value=ds.getCellValue(column.key,ds.data()[0]);switch($.type(value)){case"number":return new $.ig.EditorProviderNumeric;case"string":return new $.ig.EditorProviderText;case"date":return new $.ig.EditorProviderDate;case"boolean":provider=new $.ig.EditorProviderBoolean;if(format==="checkbox"||!format&&grid.options.renderCheckboxes){provider.renderFormat="checkbox"}else{provider.renderFormat="dropdown"}return provider}}throw new Error(grid._getLocaleValue("editorTypeCannotBeDetermined")+column.key)}return provider}})($);/*!@license
 * Infragistics.Web.ClientUI Grid Multi Headers 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.util.js
 *	infragistics.ui.widget.js
 *	infragistics.dataSource.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.shared.js
 */
(function($){var _aNull=function(val){return val===null||val===undefined};$.widget("ui.igGridColumnFixing",$.ui.igWidget,{renderInFeatureChooser:true,localeWidgetName:"ColumnFixing",events:{columnFixing:"columnFixing",columnFixed:"columnFixed",columnUnfixing:"columnUnfixing",columnUnfixed:"columnUnfixed",columnFixingRefused:"columnFixingRefused",columnUnfixingRefused:"columnUnfixingRefused"},css:{fixedContainer:"ui-iggrid-fixedcontainer",headerButtonIconContainer:"ui-iggrid-fixcolumn-headerbuttoncontainer",leftFixedContainer:"ui-iggrid-fixedcontainer-left",rightFixedContainer:"ui-iggrid-fixedcontainer-right",headerButtonIcon:"ui-icon ui-corner-all ui-icon-pin-w",headerButtonIconHover:"",headerButtonUnfixIcon:"ui-icon ui-corner-all ui-icon-pin-s",featureChooserIconClassFixed:"ui-icon ui-iggrid-icon-unfix",featureChooserIconClassUnfixed:"ui-icon ui-iggrid-icon-fix",unfixedTableLeft:"ui-iggrid-unfixed-table-left",unfixedTableRight:"ui-iggrid-unfixed-table-right"},options:{headerFixButtonText:undefined,headerUnfixButtonText:undefined,featureChooserTextFixedColumn:undefined,featureChooserTextUnfixedColumn:undefined,locale:{headerFixButtonText:undefined,headerUnfixButtonText:undefined,featureChooserTextFixedColumn:undefined,featureChooserTextUnfixedColumn:undefined},showFixButtons:true,syncRowHeights:true,scrollDelta:40,fixingDirection:"left",columnSettings:[{columnKey:null,columnIndex:null,allowFixing:true,isFixed:false}],minimalVisibleAreaWidth:30,fixNondataColumns:true,populateDataRowsAttributes:true},scrollContainerCheckValue:2,_createWidget:function(){this._fcData={};this._tds={};this._containers={};this._colgroups={};this._isInitFC=false;this._isFunctionsOverriden=false;$.Widget.prototype._createWidget.apply(this,arguments)},changeGlobalLanguage:function(){},changeGlobalRegional:function(){},_unfixColumnInternal:function(colKey,target,after){var noCancel,res={error:true},grid=this.grid,isGroupHeader=this.isGroupHeader(colKey);noCancel=this._trigger(this.events.columnUnfixing,null,{columnIdentifier:colKey,isGroupHeader:isGroupHeader,owner:grid});if(noCancel){res=this.unfixColumn(colKey,target,after);if(res.result===false){this._trigger(this.events.columnUnfixingRefused,null,{columnIdentifier:colKey,isGroupHeader:isGroupHeader,errorMessage:res.error,owner:grid})}else{this._trigger(this.events.columnUnfixed,null,{columnIdentifier:colKey,isGroupHeader:isGroupHeader,owner:grid})}}return res},unfixColumn:function(colIdentifier,target,after){if($.type(arguments[1])==="boolean"){target=arguments[2];after=arguments[3]}var col,res,children,isGroupHeader,colKey,mch,grid=this.grid,cols,aObj,scrollContainer=this._containers.body.unfixedContainer;isGroupHeader=this.isGroupHeader(colIdentifier);res={error:this._getLocaleValue("noneError"),result:true,col:null,isGroupHeader:isGroupHeader};if(!isGroupHeader){col=this._getColById(colIdentifier);res.col=col;if(!col){res.result=false;res.error=this._getLocaleValue("notValidIdentifierError");return res}res.col=col;colKey=col.key;children=[col];res.id=colKey}else{colKey=colIdentifier;res.id=colKey;mch=grid._getMultiHeaderColumnById(colIdentifier);if(!mch){res.result=false;res.error=this._getLocaleValue("notValidIdentifierError");return res}res.col=mch;children=mch.children}res.children=children;res=this._couldPerformUnfixing(res,target);if(!res.result){return res}if(!target){cols=grid._isMultiColumnGrid?grid._oldCols:grid.options.columns;$.each(cols,function(i,c){if(c.fixed!==true&&!!!c.hidden){target=c.key||c.identifier;return false}});after=false}this._performDomColumnMove(res,target,after,false);aObj=this._rearrangeColumns(colKey,target,after,false);grid._hasFixedColumns=!!grid._fixedColumns.length||grid.hasFixedDataSkippedColumns();this._refreshDOMOnUnfixing(res);grid._onFixedColumnsChanged({isToFix:false,id:colIdentifier,colWidth:res.colWidth,children:res.children,isGroupHeader:isGroupHeader,start:aObj.from.dIndex,length:aObj.from.children.length,at:aObj.at.dIndex});if(grid._fixedColumns.length===0&&(this._getDataSkippedColumnsLength(true)&&!this.options.fixNondataColumns)){this.unfixNonDataColumns()}if(scrollContainer.data("igScroll")!==undefined){scrollContainer.igScroll("refresh");if(this.grid.options.virtualization===true||this.grid.options.rowVirtualization===true){scrollContainer.igScroll("option","scrollWidth",this.grid._calculateContainerWidth())}scrollContainer.igScroll("option","scrollTop",0);scrollContainer.igScroll("option","scrollLeft",0)}if($(".igscroll-hnative-outer",this.grid.container()).length){if(this.grid.fixedBodyContainer().length){if(this.grid.fixingDirection()==="left"){$(".igscroll-hnative-outer",this.grid.container()).css("left",this.grid.fixedBodyContainer().width())}else if(this.grid.fixingDirection()==="right"){$(".igscroll-hnative-outer",this.grid.container()).css("right",this.grid.fixedBodyContainer().width())}}else{if(this.grid.fixingDirection()==="left"){$(".igscroll-hnative-outer",this.grid.container()).css("left","")}else if(this.grid.fixingDirection()==="right"){$(".igscroll-hnative-outer",this.grid.container()).css("right","")}}}else if($(".igscroll-hcontainer",this.grid.container()).length&&!this.grid._vdisplaycontainer().length){if(this.grid.fixedBodyContainer().length){if(this.grid.fixingDirection("left")){$(".igscroll-hcontainer",this.grid.container()).css("left",this.grid.fixedBodyContainer().width())}else if(this.grid.fixingDirection("right")){$(".igscroll-hcontainer",this.grid.container()).css("right",this.grid.fixedBodyContainer().width())}}else{if(this.grid.fixingDirection("left")){$(".igscroll-hcontainer",this.grid.container()).css("left","")}else if(this.grid.fixingDirection("right")){$(".igscroll-hcontainer",this.grid.container()).css("right","")}}}return res},checkAndSyncHeights:function(){this.syncHeights(true)},syncHeights:function(check,clearRowsHeights){if(!this.grid.hasFixedColumns()){return}if(!this._containers||!this._containers.body){this._populateContainers()}var c=this._containers,hTbl=c.header||c.body,fTbl=c.footer||c.body;this._checkAndSyncHeightsForTables(hTbl.fixedTable,hTbl.unfixedTable,"thead",check,clearRowsHeights);this._checkAndSyncHeightsForTables(c.body.fixedTable,c.body.unfixedTable,"tbody",check,clearRowsHeights);this._checkAndSyncHeightsForTables(fTbl.fixedTable,fTbl.unfixedTable,"tfoot",check,clearRowsHeights)},_checkAndSyncHeightsForTables:function($fTbl,$ufTbl,selector,check,clearRowsHeights){selector=selector||"tbody";var h,fH,ufH,uftblH,$fTrs=$fTbl.children(selector).children("tr"),$ufTrs=$ufTbl.children(selector).children("tr"),$fLastTr=$fTrs.last(),$ufLastTr=$ufTrs.last();uftblH=$ufTbl[0].style.height;$fTbl.height("");$ufTbl.height("");if(clearRowsHeights){this._removeRowsHeights($fTrs,true);this._removeRowsHeights($ufTrs,true)}if(!check||$fLastTr.length>0&&(Math.abs($fTbl.outerHeight()-$ufTbl.outerHeight())>1||Math.abs($fLastTr.igOffset().top-$ufLastTr.igOffset().top)>1)){this.syncRowsHeights($fTrs,$ufTrs);fH=$fTbl.height();ufH=$ufTbl.height();h=ufH;if(fH>ufH){h=fH}$fTbl.height(h);$ufTbl.height(h)}else if(uftblH){$ufTbl[0].style.height=uftblH;$fTbl[0].style.height=uftblH}},_syncTableHeights:function(){$("#"+this.grid.id()+"_fixed").height(this.grid.element.height())},_getKeyByVisibleIndex:function(index,isFixed){var col;isFixed=!!isFixed;index-=this._getDataSkippedColumnsLength(isFixed);col=this.grid._visibleColumns(isFixed)[index];return col?col.key:undefined},changeLocale:function(){var fc=this.grid.element.data("igGridFeatureChooser"),$container=this.grid.container(),self=this;if(fc&&this.renderInFeatureChooser){fc._removeFeature("ColumnFixing")}this._initFC();$container.find("th").find("[data-fixed]").each(function(){self._changeLocaleForElement($(this))})},_registerWidget:$.noop,_unregisterWidget:$.noop,_setOption:function(key,value){if(value===this.options[key]){return}this._superApply(arguments);if(key==="minimalVisibleAreaWidth"){this.grid._visibleAreaWidth(value)}},_gridSetOption:function(key,value){var w=value,grid=this.grid,fcw;if(!grid.hasFixedColumns()){return}if(key==="width"){if(typeof value==="string"&&value.indexOf("%")>0){grid.container().css("width",value);w=grid.container().outerWidth()}else{w=parseInt(value,10)}fcw=grid.fixedContainer().outerWidth();if(fcw===null){fcw=grid.fixedBodyContainer().outerWidth()}if(w-fcw<parseInt(this.options.minimalVisibleAreaWidth,10)){throw new Error(this._getLocaleValue("setOptionGridWidthException"))}}},_gridWidthChanged:function(){var grid=this.grid;if(!grid.hasFixedColumns()){return}if(this._isVirtualGrid()){this._recalcTableWidths();if(this.options.fixingDirection==="right"){this._adjustVirtWidthOnFixingRight(false)}}},isGroupHeader:function(colKey){if(this.grid._isMultiColumnGrid&&!this.grid.columnByKey(colKey)){return true}return false},_fixColumnInternal:function(colKey,target,after){var noCancel,res={error:true},grid=this.grid,isGroupHeader=this.isGroupHeader(colKey);noCancel=this._trigger(this.events.columnFixing,null,{columnIdentifier:colKey,isGroupHeader:isGroupHeader,owner:grid});if(noCancel){res=this.fixColumn(colKey,target,after);if(res.error===this._getLocaleValue("fixingRefusedError")||res.result===false){this._trigger(this.events.columnFixingRefused,null,{columnIdentifier:colKey,isGroupHeader:isGroupHeader,errorMessage:res.error,owner:grid})}else{this._trigger(this.events.columnFixed,null,{columnIdentifier:colKey,isGroupHeader:isGroupHeader,owner:grid})}}return res},_isVirtualGrid:function(){var gridOptions=this.grid.options;return gridOptions.virtualization===true||gridOptions.rowVirtualization===true},_isContinuousVirtualization:function(){return this._isVirtualGrid()&&this.grid.options.virtualizationMode==="continuous"},_getColById:function(colId){if($.type(colId)==="string"){return this.grid.columnByKey(colId)}return this.grid.options.columns[colId]},_updateWidths:function(colWidth){var $fArea,$ufArea,grid=this.grid,v=this._isVirtualGrid(),$fCntnr=this._mainFixedCntnr,w,width=0;if(grid.options.fixedHeaders&&grid.options.showHeader){$fArea=this._containers.header.fixedTable;$ufArea=this._containers.header.unfixedTable;this._updateTblWidths($fArea,$ufArea,colWidth);if(this._isVirtualGrid()){$ufArea.find(">colgroup>col").each(function(ind,col){width+=parseInt(col.style.width,10)||0});width-=colWidth;$ufArea[0].style.width=width+this.grid._scrollbarWidth()+"px"}}$fArea=this._containers.body.fixedTable;$ufArea=grid.element;if(this._isVirtualGrid()&&grid._gridHasWidthInPercent()){$ufArea.width(this.grid.options.width);this._containers.header.unfixedTable.width(this.grid.options.width);this._containers.header.unfixedTable.css("max-width",width+this.grid._scrollbarWidth());$ufArea.css("max-width",width)}this._updateTblWidths($fArea,$ufArea,colWidth);if(grid.options.fixedFooters&&this._containers.footer){$fArea=this._containers.footer.fixedTable;$ufArea=this._containers.footer.unfixedTable;this._updateTblWidths($fArea,$ufArea,colWidth)}if(v){this._updateVirtualDOMWidth(colWidth);return}w=parseFloat($fCntnr[0].style.width||0);$fCntnr[0].style.width=w+colWidth+"px"},_calcTblWidth:function($tbl,delta){var styleWidth=$tbl[0].style.width,w;if($.type(styleWidth)==="string"&&styleWidth.indexOf("%")>-1){return styleWidth}w=parseInt(styleWidth,10)||0;if(w===0){$tbl.find(">colgroup>col").each(function(ind,col){w+=parseInt(col.style.width,10)||0})}return w+delta+"px"},_updateTblWidths:function($fixedTbl,$unfixedTbl,colWidth){var fW,ufW,fTbl=$fixedTbl[0],ufTbl=$unfixedTbl[0];ufW=this._calcTblWidth($unfixedTbl,-colWidth);fW=this._calcTblWidth($fixedTbl,colWidth);fTbl.style.width=fW;ufTbl.style.width=ufW;if(this._isVirtualGrid()){$fixedTbl.closest("div")[0].style.width=fW}},_updateVirtualDOMWidth:function(colWidth){var grid=this.grid,w,$col,$cntnr,widthInPerc=grid._gridHasWidthInPercent(),$displCntnr=grid._vdisplaycontainer(),$virtTbl=grid._virtualcontainer(),$virtColgroup=$virtTbl.children("colgroup");$col=$virtColgroup.children("col[data-fixed-col]");w=parseInt($col.attr("width"),10)||0;$col.attr("width",w+colWidth+"px");if(!widthInPerc){$col=$virtColgroup.children("col:not([data-fixed-col])").first();w=parseInt($col.attr("width"),10)||0;$col.attr("width",w-colWidth+"px");if(grid.options.showHeader){$cntnr=$("#"+grid.id()+"_headers_v");$cntnr.width($cntnr.width()-colWidth)}if(grid.options.showFooter){$cntnr=grid._fixedfooters();$cntnr.width($cntnr.width()-colWidth)}$displCntnr.width($displCntnr.width()-colWidth)}},_recalcTableWidths:function(){var c=this._containers;if(c.header){c.header.unfixedTable.width("")}if(c.footer){c.footer.unfixedTable.width("")}this.grid.element.width("");this._updateWidths(0)},_swapElements:function(area){var swap=area.from;area.from=area.to;area.to=swap;return area},_analyzeFixingObjects:function(colObj,target){var grid=this.grid,tObj,j,movedCol={start:-1,length:colObj.children.length},targetCol={start:-1,length:1},vIndFrom,vIndTo;vIndFrom=this.grid.getVisibleIndexByKey(colObj.children[0].key,true);if($.type(target)==="string"){tObj=grid._analyzeColumnByKey(target)}if(_aNull(target)){vIndTo=-1}else{targetCol.length=tObj.children.length;for(j=0;j<tObj.children.length;++j){if(!tObj.children[j].hidden){vIndTo=grid.getVisibleIndexByKey(tObj.children[j].key,true);break}}}movedCol.start=vIndFrom;targetCol.start=vIndTo;return{movedCol:movedCol,targetCol:targetCol}},_performDomColumnMove:function(col,target,after,isToFix){var grid=this.grid,oCols,aObj,nW,afc=this._analyzeFixingObjects(col,target),movedCol=afc.movedCol,targetCol=afc.targetCol;movedCol.width=col.colWidth;movedCol.id=col.id;if(grid._isMultiColumnGrid){oCols=$.extend(true,[],grid._oldCols);aObj=grid._analyzeColumnMovingObjects(col.id,target,after,isToFix);grid._rearrangeArray(oCols,aObj.from.dMCHIndex,1,aObj.at.dMCHIndex);movedCol.oCols=oCols;if(movedCol.length>1){nW=0;movedCol.length=$.grep(aObj.from.children,function(col){var v=!col.hidden;nW+=v?parseFloat(col.width):0;return v}).length;movedCol.width=nW}}this._performDomColumnMoveByIndexes(movedCol,targetCol,after,isToFix)},_performDomColumnMoveByIndexes:function(movedCol,targetCol,after,isToFix){var grid=this.grid,area={},$fTbl,$ufTbl,w=isToFix?movedCol.width:-movedCol.width;this._updateWidths(w);$fTbl=grid.fixedHeadersTable();$ufTbl=grid.headersTable();area.from=$fTbl;area.to=$ufTbl;if(isToFix){area=this._swapElements(area)}if(grid.options.fixedHeaders===true){grid._moveCols({from:area.from.children("colgroup"),to:area.to.children("colgroup"),ignoreDataSkip:true},movedCol,targetCol,after)}if(grid._isMultiColumnGrid){if(!movedCol.nonData){this._fixUnfixMCHColumn(movedCol.id,{fixedThead:$fTbl.children("thead"),unfixedThead:$ufTbl.children("thead"),isToFix:isToFix,after:after},movedCol.oCols)}else{grid._moveColumnInBodyFooter({trsFrom:area.from.find("thead").children("tr[data-mch-level="+grid._maxLevel+"]"),trsTo:area.to.find("thead").children("tr[data-mch-level="+grid._maxLevel+"]"),ignoreDataSkip:true},movedCol,targetCol,after)}}grid._moveColumnInBodyFooter({trsFrom:area.from.find("thead").children("tr:not([data-mch-level])"),trsTo:area.to.find("thead").children("tr:not([data-mch-level])"),ignoreDataSkip:true},movedCol,targetCol,after);area.from=grid.fixedBodyContainer().children("table");area.to=grid.element;if(isToFix){area=this._swapElements(area)}grid._moveColumnInBodyFooter({trsFrom:area.from.children("tbody").children("tr"),trsTo:area.to.children("tbody").children("tr"),ignoreDataSkip:true},movedCol,targetCol,after);grid._moveCols({from:area.from.children("colgroup"),to:area.to.children("colgroup"),ignoreDataSkip:true},movedCol,targetCol,after);area.from=grid.fixedFootersTable();area.to=grid.footersTable();if(isToFix){area=this._swapElements(area)}if(grid.options.fixedFooters===true){grid._moveCols({from:area.from.children("colgroup"),to:area.to.children("colgroup"),ignoreDataSkip:true},movedCol,targetCol,after)}grid._moveColumnInBodyFooter({trsFrom:area.from.children("tfoot").children("tr"),trsTo:area.to.children("tfoot").children("tr"),ignoreDataSkip:true},movedCol,targetCol,after);this._updateHScrollbarWidth(w)},_getColumnWidth:function(col,$th){var w,grid=this.grid,$tbl,$col,funcGetWidth=function(){$th=$th||this._getTH(col.key);return $th.length===1&&$th.is(":visible")?$th.outerWidth():col.width||0};if(grid._isMultiColumnGrid){return funcGetWidth()}$tbl=col.fixed?grid.fixedBodyContainer().children("table"):this.element;$col=$tbl.find(">colgroup>col").eq(grid.getVisibleIndexByKey(col.key,true));w=$col.length?parseInt($col.width(),10):0;return w||parseInt(col.width,10)||funcGetWidth()},_updateGridWidth:function(){var grid=this.grid;grid._gridContentWidth=grid.element.width();if(!this._isVirtualGrid()){grid._gridInnerWidth=grid.scrollContainer().width();if(grid.options.height){grid._gridInnerWidth+=grid._scrollbarWidth()}}else{grid._gridInnerWidth=grid._vdisplaycontainer().width()+grid._scrollbarWidth()}},_refreshDOMOnUnfixing:function(colObj){var grid=this.grid,fDirRight=this.options.fixingDirection==="right";this._populateContainers();if($.ig.util.isIE10){grid._hscrollbar().width("")}this._updateGridWidth();grid._columnMovingResets();grid._hscrollbarcontent().scrollLeft(0);if(!colObj.nonData){this._changeStyleHeaderButton(colObj.id,false,colObj.isGroupHeader)}if(this._isVirtualGrid()){grid._scrollContainer().scrollTop(0);this._updateHScrollbarWidth();grid._resetVirtualDom();if(this._isContinuousVirtualization()){grid._setScrollContainerScrollTop(0)}if(fDirRight){this._adjustVirtWidthOnFixingRight(false)}}else{this._containers.body.unfixedContainer.scrollTop(0)}if(grid._fixedColumns.length===0&&(!this._getDataSkippedColumnsLength(true)||fDirRight)){this._removeFixedContainer();if(fDirRight&&!grid.options.fixedHeaders){grid._hscrollbarcontent().css("overflow-y","scroll")}}else if(this.options.syncRowHeights){this.checkAndSyncHeights()}if(fDirRight){this._removeCellPaddingForAllColumns(false)}if(grid._gridHasWidthInPercent()){this._setMinWidthForGridContainer()}grid._updateVerticalScrollbarCellPadding()},_refreshDOMOnFixing:function(id,isInit){var grid=this.grid,fDir=this.options.fixingDirection,v=this._isVirtualGrid();this._updateGridWidth();if(isInit){if(this._containers&&this._containers.body){if(fDir==="left"){this._containers.body.unfixedTable.addClass(this.css.unfixedTableLeft)}else{this._containers.body.unfixedTable.addClass(this.css.unfixedTableRight);this._adjustWidthOnFixingRight()}}}grid._columnMovingResets();if(!_aNull(id)){this._changeStyleHeaderButton(id,true)}this._containers.body.unfixedContainer.scrollTop(0);if(v){grid._scrollContainer().scrollTop(0);this._updateHScrollbarWidth();grid._resetVirtualDom();if(isInit){this._attachVirtualizationEvents()}if(this._isContinuousVirtualization()){this._containers.body.fixedContainer.scrollTop(this._containers.body.unfixedContainer.scrollTop())}if(!grid._outerHScrollbar){grid._hscrollbarcontent().css("overflow-y","hidden")}if(fDir==="right"){this._adjustVirtWidthOnFixingRight(true)}}if(grid._gridHasWidthInPercent()){this._setMinWidthForGridContainer();if(isInit&&v){grid._updateHScrollbarVisibility()}}this._checkAndRenderHScrlbarCntnr();grid._hscrollbarcontent().scrollLeft(0);if(grid._initialized){grid._updateVerticalScrollbarCellPadding()}if(this.options.syncRowHeights){this.checkAndSyncHeights()}},_setMinWidthForGridContainer:function(w){var $fc=this._mainFixedCntnr||this._containers.body.fixedContainer,$gc=this.grid.container();if(this.grid.hasFixedColumns()&&$fc.length){w=w||parseFloat($fc[0].style.width)||$fc.outerWidth();w+=parseFloat(this.options.minimalVisibleAreaWidth);$gc.css("min-width",w+"px")}else{$gc.css("min-width","")}},_couldPerformUnfixing:function(colObj,target){var grid=this.grid,mchLevel,$th,tCol;if(!!colObj.col.fixed===false){colObj.result=false;colObj.error=this._getLocaleValue("alreadyUnfixedError");return colObj}if(colObj.col.hidden){colObj.result=false;colObj.error=this._getLocaleValue("alreadyHiddenError");return colObj}if(!_aNull(target)){tCol=grid.columnByKey(target);if(!tCol){colObj.result=false;colObj.error=this._getLocaleValue("targetNotFoundError").replace("{key}",target);return colObj}if(tCol.fixed){colObj.result=false;colObj.error=this._getLocaleValue("unfixingRefusedError");return colObj}}$th=this._getTH(colObj.id);if(grid._isMultiColumnGrid){mchLevel=$th.closest("tr").attr("data-mch-level");if(mchLevel&&parseInt(mchLevel,10)!==grid._maxLevel){colObj.result=false;colObj.error=this._getLocaleValue("ActionNotAllowedForChildHeaderColumnError");return colObj}}colObj.colWidth=this._getColumnWidth(colObj.col,$th);if(!this.checkUnfixingAllowed(colObj.children)){colObj.result=false;colObj.error=this._getLocaleValue("unfixingRefusedError");return colObj}return colObj},_couldPerformFixing:function(colObj,target){var grid=this.grid,gridWidth,mchLevel,widthFixedCntr,$th,colWidth,tCol,vScrlBarW;if(colObj.col.fixed){colObj.result=false;colObj.error=this._getLocaleValue("alreadyFixedError");return colObj}if(colObj.col.hidden||!grid._initialized&&$.inArray(colObj.col,grid._initialHiddenColumns)>-1){colObj.result=false;colObj.error=this._getLocaleValue("alreadyHiddenError");return colObj}if(!_aNull(target)){tCol=grid.columnByKey(target)||this.grid._getMultiHeaderColumnById(target);if(!tCol){colObj.result=false;colObj.error=this._getLocaleValue("targetNotFoundError").replace("{key}",target);return colObj}if(!tCol.fixed){colObj.result=false;colObj.error=this._getLocaleValue("fixingRefusedError");return colObj}}gridWidth=grid.container().outerWidth();$th=this._getTH(colObj.id);if(grid._isMultiColumnGrid){mchLevel=$th.closest("tr").attr("data-mch-level");if(mchLevel&&parseInt(mchLevel,10)!==grid._maxLevel){colObj.result=false;colObj.error=this._getLocaleValue("ActionNotAllowedForChildHeaderColumnError");return colObj}}if(!this.checkFixingAllowed(colObj.children,colObj.isGroupHeader)){colObj.result=false;colObj.error=this._getLocaleValue("fixingRefusedError");return colObj}if(grid.hasFixedColumns()){widthFixedCntr=this._containers.body.fixedContainer.outerWidth()}if(isNaN(widthFixedCntr)){widthFixedCntr=0}colWidth=this._getColumnWidth(colObj.col,$th);colObj.colWidth=colWidth;vScrlBarW=this._isVirtualGrid()||grid._initialized&&grid.hasVerticalScrollbar()||grid.options.height?grid._scrollbarWidth():0;if(colWidth+widthFixedCntr+vScrlBarW>=gridWidth-parseInt(this.options.minimalVisibleAreaWidth,10)){colObj.result=false;colObj.error=this._getLocaleValue("fixingRefusedMinVisibleAreaWidthError");return colObj}return colObj},checkFixingAllowed:function(columns){var i,visibleColumnsCount=0;for(i=0;i<columns.length;i++){if(!columns[i].hidden){visibleColumnsCount++}}if(this.grid._visibleColumns(false).length-visibleColumnsCount<1){return false}return this._isFixingUnfixingAllowed(columns,true)},checkUnfixingAllowed:function(columns){return this._isFixingUnfixingAllowed(columns,false)},_isFixingUnfixingAllowed:function(columns,isToFix){var i,columnsLength=columns.length,j,col,columnsInArea=[],oCols=this.grid.options.columns,oColsLength=oCols.length;for(i=0;i<oColsLength;i++){if(!isToFix&&oCols[i].fixed||isToFix&&!oCols[i].fixed){for(j=0;j<columnsLength;j++){col=columns[j];if(col.key===oCols[i].key){break}}if(j===columnsLength){columnsInArea.push(oCols[i])}}}if(columnsInArea.length===0){return true}for(i=0;i<columnsInArea.length;i++){if(!columnsInArea[i].hidden){return true}}return false},_rearrangeColumns:function(colKey,targetKey,after,isToFix){var grid=this.grid,targetColInfo,tInd,aObj=grid._analyzeColumnMovingObjects(colKey,targetKey,after,isToFix),children;grid._rearrangeArray(grid.options.columns,aObj.from.dIndex,aObj.from.children.length,aObj.at.dIndex);if(aObj.at.dMCHIndex>-1){grid._rearrangeArray(grid._oldCols,aObj.from.dMCHIndex,1,aObj.at.dMCHIndex)}this._setFixingStateByCol(aObj.from.colMCHObj||aObj.from.colObj,isToFix);children=aObj.from.children.filter(function(col){return col.hidden===false});if(isToFix){targetColInfo=!_aNull(targetKey)?grid._getColumnInfo(targetKey,grid._fixedColumns):null;tInd=!_aNull(targetColInfo)?targetColInfo.index:grid._fixedColumns.length;grid._fixedColumns.insertRange(tInd,children)}else{grid._fixedColumns.splice(grid._getColumnInfo(children[0].key,grid._fixedColumns).index,children.length)}grid._columnMovingResets();return aObj},fixColumn:function(colIdentifier,target,after){if($.type(arguments[1])==="boolean"){target=arguments[2];after=arguments[3]}var col,res,children,isGroupHeader,colKey,aObj,grid=this.grid,mch,fixedCols=grid._fixedColumns,isInit=fixedCols.length===0;isGroupHeader=this.isGroupHeader(colIdentifier);res={error:this._getLocaleValue("noneError"),result:true,col:null,isInit:isInit,isGroupHeader:isGroupHeader};if(!isGroupHeader){col=this._getColById(colIdentifier);res.col=col;if(!col){res.result=false;res.error=this._getLocaleValue("notValidIdentifierError");return res}res.col=col;colKey=col.key;children=[col];res.id=colKey;delete col.oWidth}else{colKey=colIdentifier;res.id=colKey;mch=this.grid._getMultiHeaderColumnById(colIdentifier);if(!mch){res.result=false;res.error=this._getLocaleValue("notValidIdentifierError");return res}res.col=mch;children=mch.children}res.children=children;res=this._couldPerformFixing(res,target);if(!res.result){return res}if(res.colWidth!==parseFloat(res.col.width)){res.col.width=res.colWidth}after=$.type(after)==="boolean"?after:true;if(isInit&&!this.element.data("fixingApplied")){this._renderMainFixedContainer();this.fixNonDataColumns()}if(!this._containers||!this._containers.body){this._populateContainers()}this._performDomColumnMove(res,target,after,true);aObj=this._rearrangeColumns(colKey,target,after,true);grid._hasFixedColumns=true;this._refreshDOMOnFixing(res.id,res.isInit);grid._onFixedColumnsChanged({isToFix:true,id:colIdentifier,colWidth:res.colWidth,children:res.children,isGroupHeader:isGroupHeader,isInit:isInit,start:aObj.from.dIndex,length:aObj.from.children.length,at:aObj.at.dIndex});if(grid.element.igScroll!==undefined){this._updateIgScroll(true)}return res},_updateIgScroll:function(applySettings){var grid=this.grid,scrollContainer=this._containers.body.unfixedContainer,fixedContainer=this._containers.body.fixedContainer,scrollSettings=grid.options.scrollSettings;scrollSettings.scrollTop=0;scrollSettings.scrollLeft=0;if(scrollContainer.data("igScroll")){scrollContainer.igScroll("refresh");if(this._containers.body.fixedTable.length>0){scrollContainer.igScroll("option","syncedElemsV",[this._containers.body.fixedTable])}if(grid.options.virtualization===true||grid.options.rowVirtualization===true){scrollContainer.igScroll("option","scrollWidth",grid._calculateContainerWidth());scrollContainer.on("iggridrendered",function(){if(applySettings){scrollContainer.igScroll("option",scrollSettings)}grid._enableVirtualTouchScrollbars(scrollContainer)})}else{if(applySettings){scrollContainer.igScroll("option",scrollSettings)}if($(".igscroll-hnative-outer",grid.container()).length&&grid.fixingDirection()==="left"){$(".igscroll-hnative-outer",grid.container()).css("left",fixedContainer.width())}else if($(".igscroll-hcontainer",grid.container()).length&&grid.fixingDirection()==="left"){$(".igscroll-hcontainer",grid.container()).css("left",fixedContainer.width())}if($(".igscroll-hnative-outer",grid.container()).length&&grid.fixingDirection()==="right"){$(".igscroll-hnative-outer",grid.container()).css("right",fixedContainer.width())}else if($(".igscroll-hcontainer",grid.container()).length&&grid.fixingDirection()==="right"){$(".igscroll-hcontainer",grid.container()).css("right",fixedContainer.width())}}}else{scrollContainer.bind("igscrollrendered",$.proxy(this._onIgScrollCreated,this))}if(fixedContainer.data("igScroll")){fixedContainer.igScroll("refresh");if(grid.options.virtualization===true||grid.options.rowVirtualization===true){fixedContainer.igScroll("option","scrollOnlyVBar",true);fixedContainer.igScroll("option","scrollbarV",grid._scrollContainer());fixedContainer.data("igScroll")._content=grid._scrollContainer().children(":first-child")}else{fixedContainer.igScroll("option","syncedElemsV",[this._containers.body.unfixedTable])}if(applySettings){fixedContainer.igScroll("option",scrollSettings)}}else{fixedContainer.bind("igscrollrendered",$.proxy(this._onIgScrollCreated,this))}},_onIgScrollCreated:function(){this._updateIgScroll()},_attachVirtualizationEvents:function(){var grid=this.grid;grid.fixedBodyContainer().bind({mouseenter:function(){grid._isMouseOverVirtualTable=true},mouseleave:function(){grid._isMouseOverVirtualTable=false}})},fixNonDataColumns:function(){var grid=this.grid,cols=this._getDataSkippedCols(),w=this._getDataSkippedWidth(false,cols),len=cols.length;if(this.options.fixingDirection==="left"&&len){if(!$("#"+grid.id()+"_mainFixedContainer").length&&!this.element.data("fixingApplied")){this._renderMainFixedContainer()}grid._hasFixedDataSkippedColumns=true;grid._hasFixedColumns=!!grid._fixedColumns.length||grid.hasFixedDataSkippedColumns();this._performDomColumnMoveByIndexes({start:0,length:len,width:w,nonData:true},{start:-1,length:0},false,true);this._refreshDOMOnFixing(null,true);if(this.options.syncRowHeights){this.checkAndSyncHeights()}if(this._isVirtualGrid()){this.grid._hscrollbarcontent().css("overflow-y","hidden")}this._checkAndRenderHScrlbarCntnr();grid._hasFixedColumns=true;this.grid._onFixedColumnsChanged({isToFix:true,nonData:true,isInit:true,length:len})}},fixDataSkippedColumns:function(){this.fixNonDataColumns()},unfixNonDataColumns:function(){var w,cols=this._getDataSkippedCols(true),len=cols.length;if(this.options.fixingDirection==="left"&&len){w=this._getDataSkippedWidth(true,cols);this._performDomColumnMoveByIndexes({start:0,length:len,width:w,nonData:true},{start:0,length:0},false,false);this.grid._hasFixedColumns=!!this.grid._fixedColumns.length;this.grid._hasFixedDataSkippedColumns=false;this._refreshDOMOnUnfixing({nonData:true,width:w});this.grid._onFixedColumnsChanged({isToFix:false,nonData:true,length:len})}},unfixDataSkippedColumns:function(){this.unfixNonDataColumns()},_getDataSkippedWidth:function(isFixed,cols){var w=0;cols=cols||this._getDataSkippedCols(isFixed);cols.each(function(i,c){w+=parseFloat(c.style.width)});return w},_getDataSkippedCols:function(isFixed){if(!this._containers||!this._containers.body){this._populateContainers()}var $table=isFixed?this._containers.body.fixedTable:this._containers.body.unfixedTable;return $table.find("colgroup col[data-skip]")},_getDataSkippedColumnsLength:function(isFixed){return this._getDataSkippedCols(isFixed).length},unfixAllColumns:function(){if(!this.grid.hasFixedColumns()){return}var i,self=this,colsToUnfix=[];if(this.grid._isMultiColumnGrid){this.grid.fixedHeadersTable().children("thead").children("tr[data-mch-level]:nth-child(1)").children("th:not([data-skip])").each(function(index,th){var $th=$(th),id;id=$th.attr("data-mch-id");id=id||$th.attr("id").replace(self.grid.id()+"_","");colsToUnfix.push(id)})}else{colsToUnfix=$.map(this.grid._fixedColumns,function(c){return c.key})}if(colsToUnfix.length>0){for(i=colsToUnfix.length-1;i>=0;i--){this.unfixColumn(colsToUnfix[i])}}},_removeFixedContainer:function(){this.element.data("fixingApplied",false);var grid=this.grid,scrollContainer,v=this._isVirtualGrid();if(v){this._removeFixedContainerVirtualization()}if(!this._containers){this._populateContainers()}scrollContainer=this._containers.body.unfixedContainer;scrollContainer.unbind(".columnFixing");this.element.unbind(".columnFixing");if(this._containers&&this._containers.body){this._containers.body.unfixedTable.removeClass(this.css.unfixedTableLeft).removeClass(this.css.unfixedTableRight);if(!v){this._containers.body.unfixedTable.css("height","")}}if(!_aNull(this._DOMMouseScroll)){scrollContainer.unbind({DOMMouseScroll:this._DOMMouseScroll});this._DOMMouseScroll=null}grid.fixedContainer().remove();if(this.options.fixingDirection==="right"&&!v){scrollContainer.css({"overflow-y":"auto"});this.grid._hscrollbarcontent().css({"overflow-y":"scroll"})}if(!grid._outerHScrollbar){grid._hscrollbar().css({width:"100%",left:0})}if(grid.options.width===null&&grid.container()[0].style.width===""){
grid.container().css("width","")}if(grid.options.enableHoverStyles){this._dettachHoverEvents()}$("#"+grid.id()+"_floatCompensate").remove()},_removeFixedContainerVirtualization:function(){var $virtCntnr=this.grid._virtualcontainer();$virtCntnr.children("colgroup").children("col[data-fixed-col]").remove();$virtCntnr.children("tbody").children("tr").children("td[data-fixed-container]").remove()},_getRowsHtml:function($unfixedArea,type){var html="",attrs,i,j,len,tr,a,h,av,an,synch=this.options.syncRowHeights,trs=$unfixedArea.children("tr");this._heights=this._heights||{};this._heights[type]=[];len=trs.length;for(i=0;i<len;i++){tr=trs[i];attrs=tr.attributes;html+="<tr";for(j=0;j<attrs.length;j++){a=attrs[j];av=a.value;an=a.name;if(an==="id"||an==="ID"){av+="_fixed"}html+=" "+an+'="'+av+'"'}if(synch){h=$.ig.util.isIE?tr.getBoundingClientRect().height:tr.offsetHeight;this._heights[type].push({h:h,tr:tr});html+=' height="'+h+'px"'}html+="></tr>"}return html},_renderContainerInVirtGrid:function($tr,$table,type){var $cntnr,$td=$('<td data-fixed-container="'+type+'" style="border-width: 0px;"></td>'),cssClass=this.options.fixingDirection==="left"?this.css.leftFixedContainer:this.css.rightFixedContainer;if(this.options.fixingDirection==="left"){$td.prependTo($tr)}else{$tr.children("td:first").removeAttr("colspan");if(type==="body"){$td.insertBefore($tr.children("td:last"))}else{$td.attr("colspan",2);$td.appendTo($tr)}}$cntnr=this._renderContainer($td,$table,type);$cntnr.addClass(cssClass);this._containers[type].fixedContainer.width(0);this._containers[type].fixedTable.width(0);return $cntnr},_renderContainer:function($mainFixedCntr,$table,type){var fixedContainerId,$fixedContainer,$fixedTable,html;switch(type){case"header":fixedContainerId=this.grid.id()+"_fixedHeaderContainer";html="<thead></thead>";break;case"footer":fixedContainerId=this.grid.id()+"_fixedFooterContainer";html='<tfoot role="rowgroup"></tfoot>';break;default:fixedContainerId=this.grid.id()+"_fixedBodyContainer";html='<tbody class="'+this.grid.css.recordClass+'">'+this._getRowsHtml($table.children("tbody"),type)+"</tbody>";break}$fixedContainer=$('<div id="'+fixedContainerId+'" data-fixed-container="true"></div>').appendTo($mainFixedCntr);if(type==="body"){$fixedContainer.attr("data-scroll","true")}$fixedTable=$('<table id="'+$table.attr("id")+'_fixed"'+' class="'+$table.attr("class")+'" '+' style="table-layout:fixed;" '+" border=0 cellpadding=0 cellspacing=0><colgroup />"+html+"</table>");$fixedTable.appendTo($fixedContainer);this._containers[type]=this._containers[type]||{};this._containers[type].fixedContainer=$fixedContainer;this._containers[type].fixedTable=$fixedTable;this._containers[type].unfixedContainer=$table.closest("div");this._containers[type].unfixedTable=$table;$fixedContainer.css({overflow:"hidden",position:"relative"});if(type==="header"){this._containers.header.fixedContainer.addClass(this._containers.header.unfixedContainer.attr("class"))}return $fixedContainer},_scrollTopFixedContainer:function(direction){var fC=this._scrollContainers.fCntnr,ufC=this._scrollContainers.ufCntnr,scrollTop=fC.scrollTop();direction=direction||0;scrollTop-=direction*this.options.scrollDelta;scrollTop=scrollTop<0?0:scrollTop;fC.scrollTop(scrollTop);ufC.scrollTop(scrollTop)},_syncScrollTopContainers:function($cntnr,$cntnrToScroll){$cntnrToScroll.scrollTop($cntnr.scrollTop())},_bindEvents:function(){var grid=this.grid,self=this,fc=this._scrollContainers.fCntnr,ufc=this._scrollContainers.ufCntnr;if(grid.options.enableHoverStyles){this._attachHoverEvents()}if(this._isContinuousVirtualization()){ufc.bind({scroll:function(){self._syncScrollTopContainers($(this),fc)}})}fc.delegate("tr, td",{focus:function(){if($.ig.util.isIE){setTimeout(function(){self._syncScrollTopContainers(fc,ufc)},0)}else{self._syncScrollTopContainers(fc,ufc)}}});if(grid.element.igScroll!==undefined){if((grid.options.virtualization||grid.options.rowVirtualization)&&!ufc.data("igScroll")){ufc.igScroll({modifyDOM:false,scrollbarType:"none"});ufc.data("igScroll")._bKeyboardNavigation=false;ufc.data("igScroll")._bMixedEnvironment=true}fc.igScroll({modifyDOM:false,scrollbarType:"none"});fc.data("igScroll")._bKeyboardNavigation=false;if(grid.options.virtualization||grid.options.rowVirtualization){fc.data("igScroll")._bMixedEnvironment=true}fc.css("-ms-touch-action","none");ufc.on("iggriddatarendered",$.proxy(this._onIgScrollCreated,this))}if(this._isVirtualGrid()){return}this._onMouseWheelHandler=function(event){var evt,direction,w,d,st;evt=event.originalEvent;w=evt.wheelDelta;d=evt.detail;if(d){if(w){direction=w/d/40*d>0?1:-1}else{direction=-d/3}}else{direction=w/120}st=fc.scrollTop();self._scrollTopFixedContainer(direction);if(grid.options.height===null||st===fc.scrollTop()){return true}return false};this._DOMMouseScroll=function(event){var dir=-1,delta;delta=-event.originalEvent.detail/3;if(delta>0){dir=1}self._scrollTopFixedContainer(dir);if(grid.options.height===null){return true}event.preventDefault()};if(this.options.fixingDirection==="right"){this._bindEventsToContainers(fc,ufc);this.element.bind({"mousewheel.columnFixing":this._onMouseWheelHandler,"DOMMouseScroll.columnFixing":this._DOMMouseScroll});ufc.bind({"scroll.columnFixing":function(){self._syncScrollTopContainers($(this),fc)}})}else{this._bindEventsToContainers(ufc,fc)}},_bindEventsToContainers:function($scrollable,$hiddenScroll){var self=this,selection=this.grid.element.data("igGridSelection");$scrollable.bind({"scroll.columnFixing":function(){self._syncScrollTopContainers($(this),$hiddenScroll)}});if($.ig.util.isIE){$scrollable.bind({"mousewheel.columnFixing":function(e){self._onMouseWheelHandler(e)}})}$hiddenScroll.bind({"mousewheel.columnFixing":this._onMouseWheelHandler,"DOMMouseScroll.columnFixing":this._DOMMouseScroll,"keydown.columnFixing":function(e){if(!selection){if(e.keyCode===$.ui.keyCode.UP){self._scrollTopFixedContainer(1)}else if(e.keyCode===$.ui.keyCode.DOWN){self._scrollTopFixedContainer(-1)}}}})},_renderMainFixedContainerInVirtGrid:function(){this._populateContainers();var grid=this.grid,$col,$pScrlbar,html,$colgroup,$hscrlbar=grid._vhorizontalcontainer(),$td,$vContainer=grid._virtualcontainer(),fixedBodyContainer,scrollContainer,scrollContainerHeight;$colgroup=$vContainer.children("colgroup:first");scrollContainer=this._containers.body.unfixedContainer;$col=$("<col />").attr("data-fixed-col",this.options.fixingDirection);if(this.options.fixingDirection==="left"){$col.prependTo($colgroup)}else{$col.insertBefore($colgroup.children("col:last"))}fixedBodyContainer=this._renderContainerInVirtGrid(this._containers.body.unfixedContainer.closest("tr"),this._containers.body.unfixedTable,"body");fixedBodyContainer.addClass(grid.css.gridVirtualScrollDivClass).addClass(grid.css.gridScrollDivClass);if($.ig.util.isIE){fixedBodyContainer.children("table").height(scrollContainer.children("table").height())}scrollContainerHeight=scrollContainer.height();fixedBodyContainer.height(scrollContainerHeight);fixedBodyContainer.bind(grid._mouseClickEventHandlers);if(grid.options.showHeader){this._renderContainerInVirtGrid(this._containers.header.unfixedContainer.closest("tr"),this._containers.header.unfixedTable,"header");html=this._getRowsHtml(this._containers.header.unfixedTable.children("thead"),"header");this._containers.header.fixedTable.children("thead").html(html)}if(grid.options.showFooter&&this._containers.footer){this._renderContainerInVirtGrid(this._containers.footer.unfixedContainer.closest("tr"),this._containers.footer.unfixedTable,"footer");if(grid.options.fixedFooters){this._containers.footer.fixedContainer.bind(grid._mouseClickEventHandlers)}html=this._getRowsHtml(grid.footersTable().children("tfoot"),"footer");grid.fixedFootersTable().children("tfoot").html(html)}grid._fixedTable=fixedBodyContainer.children("table");if(!$hscrlbar.length){$hscrlbar=grid._hscrollbar()}$pScrlbar=$hscrlbar.parent();if($pScrlbar.is("td")){$td=$('<td data-fixed-container="scrollbar"></td>');if(this.options.fixingDirection==="left"){$td.insertBefore($hscrlbar.closest("td"))}else{$td.attr("colspan",2).insertAfter($hscrlbar.closest("td").removeAttr("colspan"))}}this._scrollContainers={fCntnr:fixedBodyContainer,ufCntnr:scrollContainer};this._bindEvents()},_renderMainFixedContainer:function(){this.element.data("fixingApplied",true);if(this._isVirtualGrid()){return this._renderMainFixedContainerInVirtGrid()}var grid=this.grid,gridId=grid.id(),html,fDir=this.options.fixingDirection,scrCntnrTbl,fixedBodyTable,fixedHeaderContainer,fixedFooterContainer,scrollContainer,$mainFixedContainer,fixedBodyContainer,mainFixedContainerId=grid.id()+"_mainFixedContainer",scrollContainerHeight;$mainFixedContainer=$('<div id="'+mainFixedContainerId+'" data-fixed-container="true"></div>');this._mainFixedCntnr=$mainFixedContainer;$mainFixedContainer.css({width:"0px",overflow:"hidden",position:"relative"});scrollContainer=grid.scrollContainer();if(scrollContainer.length){scrCntnrTbl=scrollContainer.children("table")}else{scrollContainer=grid.element;scrCntnrTbl=grid.element}$mainFixedContainer.addClass(this.css.fixedContainer);$mainFixedContainer.insertBefore(grid.options.fixedHeaders&&grid.options.showHeader?grid.headersTable().closest("div"):scrollContainer);if(fDir==="left"){$mainFixedContainer.css({"float":"left",left:0});$mainFixedContainer.addClass(this.css.leftFixedContainer)}else{$mainFixedContainer.css({"float":"right",right:0});$mainFixedContainer.addClass(this.css.rightFixedContainer)}$mainFixedContainer.attr("data-fixing-direction",fDir);$mainFixedContainer.bind(this.grid._mouseClickEventHandlers);fixedBodyContainer=this._renderContainer($mainFixedContainer,scrCntnrTbl,"body");fixedBodyContainer.attr("data-fixing-direction",fDir);if(grid.options.height!==null&&$.ig.util.isIE){fixedBodyContainer.find("table").height(scrCntnrTbl.height())}if(grid.options.height!==null){scrollContainerHeight=scrollContainer.height();if(this.grid._hscrollbar().is(":visible")){scrollContainerHeight+=this.grid._hscrollbar().outerHeight()}}fixedBodyContainer.height(scrollContainerHeight);fixedBodyTable=fixedBodyContainer.find("table");if(grid.options.showHeader){if(grid.options.fixedHeaders&&grid.options.height!==null){fixedHeaderContainer=this._renderContainer($mainFixedContainer,grid.headersTable(),"header");fixedHeaderContainer.prependTo($mainFixedContainer)}else{if(grid.element.find("thead").next().is("tbody")){$("<thead />").insertBefore(fixedBodyContainer.find("tbody"))}else{if(grid.element.find("thead").prev().is("colgroup")){$("<thead />").insertAfter(fixedBodyContainer.find("colgroup"))}else{$("<thead />").insertAfter(fixedBodyContainer.find("tbody"))}}}}if(grid.options.showFooter){if(grid.options.fixedFooters&&grid.options.height!==null){fixedFooterContainer=this._renderContainer($mainFixedContainer,grid.footersTable(),"footer");this._containers.footer.fixedTable.css("whiteSpace",this._containers.footer.unfixedTable.css("whiteSpace"));fixedFooterContainer.appendTo($mainFixedContainer)}else{$('<tfoot role="rowgroup" />').insertAfter(fixedBodyContainer.find("tbody"))}}html=this._getRowsHtml(grid.headersTable().children("thead"),"header");grid.fixedHeadersTable().children("thead").html(html);html=this._getRowsHtml(grid.footersTable().children("tfoot"),"footer");grid.fixedFootersTable().children("tfoot").html(html);if(this.options.syncRowHeights){this._setRowHeights("header");this._setRowHeights("body");this._setRowHeights("footer")}grid._fixedTable=fixedBodyTable;if(fDir==="right"){fixedBodyContainer.css({"overflow-y":"auto"});scrollContainer.css({"overflow-y":"hidden"});this.grid._hscrollbarcontent().css({overflow:"","overflow-y":"hidden"})}this._scrollContainers={fCntnr:fixedBodyContainer,ufCntnr:scrollContainer};this._bindEvents();$('<div style="clear:both" id="'+gridId+'_floatCompensate"></div>').insertAfter(grid.container())},_setRowHeights:function(type){var i,heights=this._heights[type],heightsLength=heights.length;for(i=0;i<heightsLength;i++){heights[i].tr.style.height=heights[i].h+"px"}},_syncRowStyles:function(){var i,fRow,ufRow,container=this._containers.body,$unfixedTable=container.unfixedTable,$fixedTable=container.fixedTable,fixedRows=$fixedTable.children("tbody").children("tr"),unfixedRows=$unfixedTable.children("tbody").children("tr"),rLen=fixedRows.length;for(i=0;i<rLen;i++){fRow=fixedRows[i];ufRow=unfixedRows[i];fRow.setAttribute("style",ufRow.getAttribute("style"));fRow.setAttribute("class",ufRow.getAttribute("class"))}},_populateContainers:function(){var gridId=this.grid.id(),grid=this.grid,self=this,virtualization=this._isVirtualGrid(),$unfixedHeaders=this.grid.container().find("#"+gridId+"_headers"),$unfixedFooters=this.grid.container().find("#"+gridId+"_footer_container"),$fixedBodyContainer=this.grid.container().find("#"+gridId+"_fixedBodyContainer"),functionPopulateContainers,scrollContainer;if(virtualization){scrollContainer=this.grid._vdisplaycontainer()}else{scrollContainer=this.grid.scrollContainer()}if(scrollContainer.length===0){scrollContainer=this.grid.element}this._containers={};functionPopulateContainers=function($unfixedContainer,$fixedContainer,type){var $unfixedTable=$unfixedContainer.find("table"),$fixedTable=grid.container().find("#"+$unfixedTable.attr("id")+"_fixed");if($unfixedTable.length===0){$unfixedTable=$unfixedContainer;$fixedTable=grid.container().find("#"+$unfixedTable.attr("id")+"_fixed")}self._containers[type]={fixedContainer:$fixedContainer,unfixedContainer:$unfixedContainer,fixedTable:$fixedTable,unfixedTable:$unfixedTable}};if($unfixedHeaders.length>0){functionPopulateContainers($unfixedHeaders.parent("div"),grid.fixedHeaderContainer(),"header")}functionPopulateContainers(scrollContainer,$fixedBodyContainer,"body");if($unfixedFooters.length>0&&$unfixedFooters[0].nodeName!=="TFOOT"){functionPopulateContainers($unfixedFooters,grid.fixedFooterContainer(),"footer")}},_fixUnfixMCHColumn:function(colId,fixingParams,oCols){var i,grid=this.grid,col,fixedThead=fixingParams.fixedThead,unfixedThead=fixingParams.unfixedThead,isToFix=fixingParams.isToFix,after=fixingParams.after,area=isToFix?fixedThead:unfixedThead,mchInstance=grid.element.data("igGridMultiColumnHeaders");oCols=oCols||grid._oldCols;if(!mchInstance){return}for(i=0;i<oCols.length;i++){if(oCols[i].identifier===colId||oCols[i].key===colId){col=oCols[i];break}}if(i===oCols.length){return}mchInstance._rows={};mchInstance._analyzeRowspanRows(oCols,0);this._fixUnfixMCHColumnRecursive([col],mchInstance._rows,area,isToFix,after)},_fixUnfixMCHColumnRecursive:function(cols,rows,area,isToFix,after){var i,grid=this.grid,$th,id,domLevel,cells,$ths=$(),ind,tCell,col,$targetTh,$tr;for(i=0;i<cols.length;i++){col=cols[i];if(col.level===0){id=!i?col.key:id;$th=grid.container().find("#"+this.grid.id()+"_"+col.key)}else{id=!i?col.identifier:id;$th=this._getTH(col.identifier)}if(_aNull(domLevel)){domLevel=parseInt($th.closest("tr").attr("data-mch-level"),10)}$th.detach();$ths=$ths.add($th)}cells=rows[domLevel];if(cells){$tr=area.find("tr[data-mch-level="+domLevel+"]");if(!$tr.find(">th:not([data-skip])").length||!cells.length){$ths.appendTo($tr)}else{for(i=0;i<cells.length;i++){if(cells[i].identifier===id||cells[i].key===id){ind=i;if(isToFix){tCell=i>0?cells[i-1]:null}else{for(i+=cols.length;i<cells.length;i++){if(!cells[i].fixed){tCell=cells[i];break}}}for(i=ind;i<ind+cols.length;i++){cells[i].fixed=isToFix}break}}if(tCell){$targetTh=this._getTH(_aNull(tCell.key)?tCell.identifier:tCell.key);if(after){$ths.insertAfter($targetTh)}else{$ths.insertBefore($targetTh)}}else{if(after){$ths.appendTo($tr)}else{$ths.prependTo($tr)}}}}for(i=0;i<cols.length;i++){if(!cols[i].group){continue}after=isToFix;this._fixUnfixMCHColumnRecursive(cols[i].group,rows,area,isToFix,after);cols[i].fixed=isToFix}},_dettachHoverEvents:function(){this._populateContainers();var container=this._containers.body,$unfixedTable=container.unfixedTable,$fixedTable=container.fixedTable;$fixedTable.undelegate("tbody",".hoverColumnFixing");$unfixedTable.undelegate("tbody",".hoverColumnFixing")},_attachHoverEvents:function(){this._populateContainers();var container=this._containers.body,$unfixedTable=container.unfixedTable,$fixedTable=container.fixedTable;this._mouseOverHandler=$.proxy(this._mouseOver,this);this._mouseLeaveHandler=$.proxy(this._mouseLeave,this);$fixedTable.delegate("tbody",{"mousemove.hoverColumnFixing":this._mouseOverHandler,"mouseleave.hoverColumnFixing":this._mouseLeaveHandler});$unfixedTable.delegate("tbody",{"mousemove.hoverColumnFixing":this._mouseOverHandler,"mouseleave.hoverColumnFixing":this._mouseLeaveHandler})},_mouseOver:function(event){var css="ui-state-hover",grid=this.grid,$tr=$(event.target).closest("tr");if(grid._isFixedElement($tr)){grid._mousemoveTr(grid.element.find("tbody tr:nth-child("+($tr.index()+1)+")")[0],event)}if(this._hoverTr){this._hoverTr.find("td,th").removeClass(css)}this._hoverTr=grid.fixedTable().find("tbody").children("tr:nth-child("+($tr.index()+1)+")");this._hoverTr.children("td,th").addClass(css)},_mouseLeave:function(event){var css="ui-state-hover",$tr=$(event.target).closest("tr"),grid=this.grid;if(grid._isFixedElement($tr)){grid._mouseleaveTr(grid.element.find("tbody").children("tr:nth-child("+($tr.index()+1)+")")[0],event)}if(this._hoverTr){this._hoverTr.children("td,th").removeClass(css)}},_checkAndRenderHScrlbarCntnr:function(){var grid=this.grid,scroller=grid._hscrollbarcontent(),hscrollbar=grid._hscrollbar(),fixedControllerScrollerId=grid.id()+"_fixedContainerScroller",$fixedScroller=grid.container().find("#"+fixedControllerScrollerId);if($fixedScroller.length===0&&(this._isContinuousVirtualization()||$.ig.util.hasHorizontalScroll(grid.scrollContainer())||scroller.length===1&&hscrollbar.is(":visible"))){$('<div style="height:'+(hscrollbar.height()||$.ig.util.getScrollHeight())+'px" id="'+fixedControllerScrollerId+'"></div>').appendTo(this._containers.body.fixedContainer)}else if($fixedScroller.length===1&&hscrollbar.length===1){if(hscrollbar.is(":visible")){$fixedScroller.show()}else{$fixedScroller.hide()}}},syncRowsHeights:function($trs,$anotherRows){var i,len=$trs.length,hToSync,h,heights=[];for(i=0;i<len;i++){h=$.ig.util.isIE?$trs[i].getBoundingClientRect().height:$trs[i].offsetHeight;hToSync=$.ig.util.isIE?$anotherRows[i].getBoundingClientRect().height:$anotherRows[i].offsetHeight;hToSync=h>hToSync?h:hToSync;heights.push(hToSync)}for(i=0;i<len;i++){$trs[i].style.height=heights[i]+"px";$anotherRows[i].style.height=heights[i]+"px"}},_checkSyncTablesHeights:function(){if(!this._containers||!this._containers.body){this._populateContainers()}var h,fH,ufH,$fixedTable=this._containers.body.fixedTable,$unfixedTable=this._containers.body.unfixedTable,$fTRs=$fixedTable.children("tbody").children("tr"),$ufTRs=$unfixedTable.children("tbody").children("tr"),$lastTr=$ufTRs.last();if($lastTr.length>0&&(Math.abs($fixedTable.outerHeight()-$unfixedTable.outerHeight())>1||Math.abs($lastTr.igOffset().top-$fTRs.last().igOffset().top)>1)){this.syncRowsHeights($fTRs,$ufTRs);fH=$fixedTable.height();ufH=$unfixedTable.height();h=fH>ufH?fH:ufH;$fixedTable.height(h);$unfixedTable.height(h)}},_syncContainerHeights:function(){var $fixedTable,$unfixedTable,containers=this._containers;if(containers&&containers.body){$fixedTable=containers.body.fixedTable;$unfixedTable=containers.body.unfixedTable;if($fixedTable.height()!==$unfixedTable.height()){$fixedTable.height($unfixedTable.height())}}},_adjustWidthOnFixingRight:function(){if(this.options.fixingDirection!=="right"||this.grid._gridHasWidthInPercent()||this._isVirtualGrid()){return}var $mfc,grid=this.grid,c=this._containers.body;if(c.unfixedContainer.width()-c.unfixedTable.width()>=0){$mfc=this._mainFixedCntnr||this._containers.body.fixedContainer;if($mfc.length){$mfc[0].style.width=parseFloat(grid.options.width)-grid.element.width()+"px"}}},_adjustVirtWidthOnFixingRight:function(isToFix){if(this.options.fixingDirection!=="right"){return}var grid=this.grid,w,$tblHeaders,stw,$colgroup=grid._virtualcontainer().children("colgroup"),$colFixed=$colgroup.children("col[data-fixed-col]"),$colUnfixed=$colgroup.children("col:not(:last):not([data-fixed-col])");if($colUnfixed.length){w=$colUnfixed[0].width;this._containers.header.unfixedContainer.width(w);this._containers.footer.unfixedContainer.width(w)}if(grid.options.showHeader&&$colFixed.length){this._containers.header.fixedContainer.width(this._containers.header.fixedContainer.width()+grid._scrollbarWidth()+"px")}if(!isToFix&&!grid._fixedColumns.length){$tblHeaders=$("#"+grid.id()+"_headers_v");stw=$tblHeaders[0].style.width;if(stw&&stw.indexOf("%")===-1){$tblHeaders.width($tblHeaders.width()+grid._scrollbarWidth()+"px")}$tblHeaders.closest("td").attr("colspan",2)}grid._vhorizontalcontainer().css("overflow-y","hidden");this._updateHScrollbarTblWidthsInFixedVirtRight()},_updateFixedColgroupVirt:function(colWidthDelta){var w,$colFixed,$colUnfixed,$colgroup;$colgroup=this.grid._virtualcontainer().children("colgroup");$colFixed=$colgroup.children("col[data-fixed-col]");$colUnfixed=$colgroup.children("col:not(:last):not([data-fixed-col])");w=parseInt($colFixed.attr("width"),10);$colFixed.attr("width",w+colWidthDelta);w=parseInt($colUnfixed.attr("width"),10);$colUnfixed.attr("width",w-colWidthDelta)},getWidthOfFixedColumns:function(fCols,excludeNonDataColumns,includeHidden){var $fTable,w=0,i;if(!this._containers||!this._containers.body){this._populateContainers()}$fTable=this._containers.body.fixedTable;if(excludeNonDataColumns){$fTable.children("colgroup").children("col[data-skip]").each(function(){w+=parseInt($(this).css("width"),10)})}fCols=fCols||this.grid._fixedColumns;if(!fCols||!fCols.length){return w}for(i=0;i<fCols.length;i++){if(!includeHidden&&fCols[i].hidden){continue}w+=parseFloat(fCols[i].width)}return w},_updateHScrollbarWidthVirt:function(){var grid=this.grid,$hScrlbar,scrollbarWidth=grid._scrollbarWidth(),$hScrollerContainer=grid._vhorizontalcontainer(),fixedTableWidth=parseInt(this._containers.body.fixedTable[0].style.width,10),fdirLeft=this.options.fixingDirection==="left",gridWidth=parseInt(grid.options.width,10);if(grid._outerHScrollbar){$hScrlbar=grid._hscrollbar();if(this.options.fixingDirection==="left"){$hScrlbar.css("margin-left",fixedTableWidth)}else{$hScrlbar.css("margin-right",fixedTableWidth+scrollbarWidth)}if(grid._gridHasWidthInPercent()){grid._updateGridContentWidth();grid._updateVirtualHorizontalScrollbar()}else{grid._getHScrollContainerInner().css("width",grid.element.width())}return}if(this._isContinuousVirtualization()){if(fixedTableWidth===0){$hScrollerContainer.css({position:""})}else if(fdirLeft){$hScrollerContainer.css({position:"relative"})}if(!fdirLeft){gridWidth-=scrollbarWidth}$hScrollerContainer.width(gridWidth-fixedTableWidth+"px");grid._updateVirtualHorizontalScrollbar()}},_updateHScrollbarWidth:function(delta){if(this._isVirtualGrid()){return this._updateHScrollbarWidthVirt(delta)}var scrollContainer,grid=this.grid,$hScrollerContainer,scW,fdirLeft=this.options.fixingDirection==="left",oTableWidth=this._containers.body.unfixedTable.outerWidth();scrollContainer=this._containers.body.unfixedContainer;if(oTableWidth>0){$hScrollerContainer=grid._hscrollbar();if(scrollContainer.is(":visible")){scW=scrollContainer.width()}else{scW=parseInt(grid.options.width,10)-this.getWidthOfFixedColumns()}$hScrollerContainer.css({left:0});grid._hscrollbarinner().css({width:(grid._hasVerticalScrollbar&&grid.options.fixedHeaders&&fdirLeft?oTableWidth-grid._scrollbarWidth():oTableWidth)+"px",left:0})}},_headerRendered:function(sender,args){if(args.owner.element.attr("id")!==this.grid.element.attr("id")){return}if(this.options.showFixButtons===false){return}var i,j,cs,columnKey,ths,children,isFixed=false,allowFixing=true,grid=this.grid,self=this,cols=grid.options.columns,colsLength=cols.length;if(grid._isMultiColumnGrid){ths=grid.headersTable().children("thead").children("tr[data-mch-level="+grid._maxLevel+"]").children("th");ths.each(function(){var $th=$(this);if($th.attr("data-mch-id")){columnKey=$th.attr("data-mch-id");allowFixing=true;cs=self._getColumnSettingByKey(columnKey);if(cs&&cs.allowFixing===false){return true}for(j=0;j<grid._oldCols.length;j++){if(grid._oldCols[j].identifier===columnKey){children=grid._oldCols[j].children;for(i=0;i<children.length;i++){cs=self._getColumnSettingByKey(children[i].key,i);if(cs&&cs.allowFixing===false){allowFixing=false;break}}break}}if(!allowFixing){return true}self._renderHeaderCellButton(columnKey,isFixed,true,$th)}else{if($th.attr("data-skip")){return true}columnKey=$th.attr("id").replace(grid.id()+"_","");cs=self._getColumnSettingByKey(columnKey);if(cs&&cs.allowFixing===false){return true}if(self._fcData[columnKey]!==true){self._renderHeaderCellButton(columnKey,isFixed,false,$th)}}})}else{for(i=0;i<colsLength;i++){columnKey=cols[i].key;cs=this._getColumnSettingByKey(columnKey,i);isFixed=false;if(cs!==null){if(cs.allowFixing===false){continue}if(cs.isFixed===true){isFixed=true}}if(this._fcData[columnKey]!==true){this._renderHeaderCellButton(columnKey,isFixed)}}}},_headerRendering:function(){var i;for(i=0;i<this.grid.options.features.length;i++){if(this.grid.options.features[i].name==="Hiding"){this._hiding=this.grid.element.data("igGridHiding");break}}},_columnsMoved:function(e,ui){var start=ui.start,len=ui.len,idx=ui.index;if(!ui.isFixed||!start&&!len&&!idx||ui.owner.id()!==this.grid.id()){return}this.grid._rearrangeArray(this.grid._fixedColumns,start,len,idx)},_getColumnSettingByKey:function(key,colIndex){var i,cs=this.options.columnSettings,csLength=cs.length,res=null;for(i=0;i<csLength;i++){if(cs[i].columnKey!==null&&cs[i].columnKey!==undefined){if(cs[i].columnKey===key){res=cs[i];break}}else if(cs[i].columnIndex!==null&&cs[i].columnIndex!==undefined){if(cs[i].columnIndex===colIndex){res=cs[i];break}}}return res},_id:function(){var i,res=this.grid.id(),argumentsLength=arguments.length;if(argumentsLength===0){return null}for(i=0;i<argumentsLength;i++){res+="_"+arguments[i]}return res},_renderHeaderCellButton:function(columnKey,isFixed,isGroupHeader,$th){var self=this,css=self.css,buttonId,gridId=this.grid.id(),$button,$divHeaderButtonContainer,$columnFixingHeaderIconContainer;if($th===undefined){$th=this.grid.container().find("#"+gridId+"_"+columnKey)}buttonId=this._id("header_cell","fixing",columnKey);if($th.length===0){return}this.grid._enableHeaderCellFeature($th);$columnFixingHeaderIconContainer=$th.find(".ui-iggrid-indicatorcontainer");if($columnFixingHeaderIconContainer.length===0){$columnFixingHeaderIconContainer=$('<div class="ui-iggrid-indicatorcontainer"></div>').appendTo($th)}$button=this.grid.container().find("#"+buttonId);if($button.length===0){$button=$("<a></a>").attr("href","#").attr("data-fixing-indicator","true").attr("id",buttonId);$divHeaderButtonContainer=$columnFixingHeaderIconContainer.find(".ui-iggrid-fixcolumn-headerbuttoncontainer");if($divHeaderButtonContainer.length===0){$divHeaderButtonContainer=$("<div></div>").addClass(css.headerButtonIconContainer).appendTo($columnFixingHeaderIconContainer)}$button.appendTo($divHeaderButtonContainer);$("<span></span>").appendTo($button);$button.bind({mousedown:function(){$(this).trigger("mouseout")},click:function(event){event.preventDefault();event.stopPropagation();if($button.attr("data-fixed")==="true"){self._unfixColumnInternal(columnKey)}else{self._fixColumnInternal(columnKey)}}})}this._changeStyleHeaderButton(columnKey,isFixed)},_getTH:function(id){return this.grid.container().find('th[data-mch-id="'+id+'"],th[id="'+this.grid.id()+"_"+id+'"]')},_changeStyleHeaderButton:function(columnKey,isFixed){var css=this.css,fc,attrVal="true",titleOption="headerFixButtonText",$button=this.grid.container().find("#"+this._id("header_cell","fixing",columnKey)),$span;$span=$button.find("span");if(isFixed){$span.removeClass(css.headerButtonIcon);$span.addClass(css.headerButtonUnfixIcon);titleOption="headerUnfixButtonText"}else{attrVal="false";$span.removeClass(css.headerButtonUnfixIcon);$span.addClass(css.headerButtonIcon)}$button.attr({title:this._getLocaleValue(titleOption),"data-localeid":titleOption,"data-localeattr":"title","data-fixed":attrVal});fc=this.grid.element.data("igGridFeatureChooser");if(fc){fc._setSelectedState("ColumnFixing",columnKey,isFixed,false)}},_dataRendering:function(event,ui){if(ui===undefined){return}if(this.grid.id()!==ui.owner.id()){return}if(this.grid.options.height===null&&this.grid.hasFixedColumns()&&$.ig.util.isIE&&$.ig.util.browserVersion>=9){$("#"+this.grid.id()+"_fixed").height("")}},_dataRendered:function(event,ui){if(ui===undefined||this.grid.id()!==ui.owner.id()){return}var grid=this.grid,fixedContainer,scrollContainer;if(grid.hasFixedColumns()){if(this.options.syncRowHeights){this.checkAndSyncHeights();if(this._isVirtualGrid()&&grid._virtualcontainer().outerHeight()>parseInt(grid.options.height)){grid._initializeHeights()}if($.ig.util.isIE){scrollContainer=this._containers.body.unfixedContainer;fixedContainer=this._containers.body.fixedContainer;this._syncScrollTopContainers(fixedContainer,scrollContainer)}}}},_colCollectionModified:function(){var i=0;this.grid._fixedColumns=[];for(i=0;i<this.grid.options.columns.length;i++){if(this.grid.options.columns[i].fixed&&!this.grid.options.columns[i].hidden){this.grid._fixedColumns.push(this.grid.options.columns[i])}}},_gridContainersRendered:function(){var i,j,cs=this.options.columnSettings,csLength=cs.length,columnKeys=[],hasColumnKey,hasColumnIndex,res,cols=this.grid.options.columns,col,countHidden=0,colsLength=cols.length;for(i=0;i<csLength;i++){if(cs[i].isFixed!==true){continue}hasColumnKey=cs[i].columnKey!==null&&cs[i].columnKey!==undefined;hasColumnIndex=cs[i].columnIndex!==null&&cs[i].columnIndex!==undefined;if(!hasColumnKey){if(!hasColumnIndex){continue}if(cs[i].columnIndex>=0&&cs[i].columnIndex<colsLength){columnKeys.push(cols[cs[i].columnIndex].key);if(cols[cs[i].columnIndex].hidden){countHidden++}}}else{columnKeys.push(cs[i].columnKey);col=this.grid.columnByKey(cs[i].columnKey);if(col&&col.hidden){countHidden++}}}if(countHidden>0){throw new Error($.ig.util.stringFormat(this._getLocaleValue("initialFixingNotApplied"),columnKeys[0],this._getLocaleValue("alreadyHiddenError")))}for(j=0;j<columnKeys.length;j++){res=this.fixColumn(columnKeys[j])}if(this.options.fixNondataColumns){this.fixDataSkippedColumns()}},_detachEvents:function(){if(this._headerRenderedHandler){this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler)}if(this._headerCellRenderedHandler){this.grid.element.unbind("iggridheadercellrendered",this._headerCellRenderedHandler)}if(this._headerRenderingHandler){this.grid.element.unbind("iggridheaderrendering",this._headerRenderingHandler)}if(this._columnsMovedHandler){this.grid.element.unbind("iggrid_columnsmoved",this._columnsMovedHandler)}if(this._gridHeightChangingHandler){this.grid.element.unbind("iggrid_heightchanging",this._gridHeightChangingHandler)}if(this._dataRenderingHandler){this.grid.element.unbind("iggriddatarendering",this._dataRenderingHandler)}if(this._dataRenderedHandler){this.grid.element.unbind("iggriddatarendered",this._dataRenderedHandler)}if(this._virtualrecordsrenderHandler){this.grid.element.unbind("iggridvirtualrecordsrender",this._virtualrecordsrenderHandler)}if(this._gridContainerHeightHandler){this.grid.element.unbind("iggrid_heightchanged",this._gridContainerHeightHandler)}if(this._gridContainersRenderedHandler){this.grid.element.unbind("iggrid_gridcontainersrendered",this._gridContainersRenderedHandler)}if(this._gridColCollectionModified){this.grid.element.unbind("iggridcolumnscollectionmodified",this.gridColCollectionModified)}if(this._lastColumnWidthAutoAdjustedHandler){this.grid.element.unbind("iggrid_lastcolumnwidthautoadjusted",this._lastColumnWidthAutoAdjustedHandler)}},destroy:function(){var fc;if(this.grid._fixedColumns&&this.grid._fixedColumns.length>0){this.unfixAllColumns()}if(this.grid.hasFixedDataSkippedColumns()){
this.unfixNonDataColumns()}this.grid._hasFixedDataSkippedColumns=false;this.grid._hasFixedColumns=false;this.element.data("fixingApplied",false);this.grid.headersTable().find("thead > tr > th").not("[data-skip=true]").each(function(){var th=$(this);th.find("a[data-fixing-indicator=true]").parent().remove()});this._detachEvents();if(this._gridRenderRowHandler!==undefined){this.grid._renderRow=this._gridRenderRowHandler}if(this._gridRenderRecordsForTableHandler){this.grid._renderRecordsForTable=this._gridRenderRecordsForTableHandler}if(this._gridRenderNewRowHandler){this.grid.renderNewRow=this._gridRenderNewRowHandler}if(this._gridDetachColumnHandler){this.grid._detachColumn=this._gridDetachColumnHandler}if(this._gridAttachColumnHandler){this.grid._attachColumn=this._gridAttachColumnHandler}if(this._gridRerenderColgroupsHandler){this.grid._rerenderColgroups=this._gridRerenderColgroupsHandler}if(this._gridRenderColgroupHandler){this.grid._renderColgroup=this._gridRenderColgroupHandler}if(this._gridUpdatePaddingHandler){this.grid._updateVScrollbarCellPaddingHelper=this._gridUpdatePaddingHandler}fc=this.grid.element.data("igGridFeatureChooser");if(fc&&this.renderInFeatureChooser){fc._removeFeature("ColumnFixing")}this._unregisterSetOptionCallback();this._superApply(arguments);return this},_headerCellRendered:function(event,ui){if(ui.owner.element.attr("id")!==this.grid.element.attr("id")){return}if(this._isInitFC!==true){this._initFC()}},_setFixedBodyCntnrHeight:function(scrollContainer,fixedBodyContainer){if(!this._containers||!this._containers.body){this._populateContainers()}var grid=this.grid,hScrlbar,scrollContainerHeight,wperc,v;fixedBodyContainer=fixedBodyContainer||this._containers.body.fixedContainer;scrollContainer=scrollContainer||this._containers.body.unfixedContainer;if(grid.options.height!==null){scrollContainerHeight=scrollContainer.height();hScrlbar=grid._hscrollbar();wperc=grid._gridHasWidthInPercent();v=this._isVirtualGrid();if(hScrlbar.is(":visible")&&(!v||!wperc&&v&&this._isContinuousVirtualization())){scrollContainerHeight+=this.grid._hscrollbar().outerHeight()}}fixedBodyContainer.height(scrollContainerHeight)},_summariesHeightsAdjusting:function(){var $fTbl,$ufTbl,grid=this.grid;if(!grid._initialized){if(grid.options.showFooter&&!grid.options.fixedFooters){grid._updateVerticalScrollbarCellPadding()}return}if(!this._containers||!this._containers.footer){this._populateContainers()}if(grid.options.showFooter&&grid.options.fixedFooters){$fTbl=this._containers.footer.fixedTable;$ufTbl=this._containers.footer.unfixedTable;this._syncHeightsForTables($fTbl,$ufTbl)}},_heightChanged:function(){var grid=this.grid;if(!grid.hasFixedColumns()){return}this._syncTableHeights();this._setFixedBodyCntnrHeight();this._checkAndRenderHScrlbarCntnr();if(this.options.syncRowHeights){this.checkAndSyncHeights()}},_lastColumnWidthAutoAdjusted:function(e,args){var grid=this.grid;if(grid.hasFixedColumns()){if(this.options.fixingDirection==="right"&&!grid._initialized){grid._hscrollbarcontent().css("overflow-y","hidden");this._updateHScrollbarWidth();this._adjustWidthOnFixingRight()}if(args&&args.specialColumnsWidth){this._recalcTableWidths();this._updateHScrollbarWidth();this._updateGridWidth();grid._updateHScrollbarVisibility()}}},_gridHeightChanging:function(e,arg){if(!this._containers.body){return}if(this._isVirtualGrid()){return}var scrollContainerHeight,diff,pc=this.grid._prevContainerHeight,$fixedBodyContainer=this.grid.fixedBodyContainer();if($fixedBodyContainer.length===0){return}scrollContainerHeight=arg.ch-arg.h;if(this.grid._hscrollbar().is(":visible")){scrollContainerHeight+=this.grid._hscrollbar().outerHeight()}$fixedBodyContainer.height(scrollContainerHeight);diff=Math.abs(pc-this.grid.container().height());$fixedBodyContainer.height(scrollContainerHeight-diff)},_initFC:function(){var i,fc,isMCH=this.grid._isMultiColumnGrid,o=this.options,cols=this.grid.options.columns,colsLength=cols.length,cs,columnKey;this._isInitFC=true;fc=this.grid.element.data("igGridFeatureChooser");if(fc!==null&&fc!==undefined&&this.renderInFeatureChooser&&o.showFixButtons){if(isMCH){cols=this.grid._oldCols;colsLength=cols.length}for(i=0;i<colsLength;i++){columnKey=cols[i].key;this._fcData[columnKey]=false;if(isMCH&&cols[i].level!==0){continue}cs=this._getColumnSettingByKey(columnKey,i);if(cs&&cs.allowFixing===false){continue}if(fc._shouldRenderInFeatureChooser(columnKey)===true){fc._renderInFeatureChooser(columnKey,{name:"ColumnFixing",text:this._getLocaleValue("featureChooserTextUnfixedColumn"),textHide:this._getLocaleValue("featureChooserTextFixedColumn"),iconClass:this.css.featureChooserIconClassFixed,iconClassOff:this.css.featureChooserIconClassUnfixed,isSelected:cs&&cs.isFixed===true,method:$.proxy(this._togglefromfc,this),updateOnClickAll:false,order:3,groupName:"toggle",groupOrder:1,type:"toggle",state:"hide"});this._fcData[columnKey]=true}}}},_togglefromfc:function(event,columnKey){var i,cols=this.grid.options.columns,colsLength=cols.length,col,ret;for(i=0;i<colsLength;i++){col=cols[i];if(col.key===columnKey){ret=col.fixed===true?this._unfixColumnInternal(columnKey):this._fixColumnInternal(columnKey);break}}return ret.error===undefined},_columnMap:function(){var i,j,isMCH=this.grid._isMultiColumnGrid,cs,columnKey,elem,result=[],cols=this.grid.options.columns,colsLength=cols.length;if(this.options.showFixButtons===false){return false}for(i=0;i<colsLength;i++){columnKey=cols[i].key;elem={columnKey:columnKey,enabled:true};cs=this._getColumnSettingByKey(columnKey,i);if(cs&&cs.allowFixing===false){elem.enabled=false}else if(isMCH){for(j=0;j<this.grid._oldCols.length;j++){if(this.grid._oldCols[j].key===columnKey){break}}if(j===this.grid._oldCols.length){elem.enabled=false}}result.push(elem)}return result},_cleanupTBody:function(){if(this.grid.hasFixedColumns()){if(!this._containers||!this._containers.body){this._populateContainers()}this._containers.body.fixedTable.children("tbody").empty()}},_renderRow:function(rec,tr,rowId){if(!this.grid.hasFixedColumns()){return this._gridRenderRowHandler(rec,tr,rowId)}var i,col,content,$fixedRow,$unfixedRow,fixedCells,unfixedCells,counterFixed=0,counterUnfixed=0,$td,$tr=$(tr),grid=this.grid,cols=grid.options.columns,colsLength=cols.length,isFixedRow=this.grid._isFixedElement($tr);if(isFixedRow){$fixedRow=$tr;$unfixedRow=grid.element.find("tbody tr:nth-child("+($tr.index()+1)+")")}else{$unfixedRow=$tr;$fixedRow=this.grid.fixedTable().find("tbody tr:nth-child("+($tr.index()+1)+")")}fixedCells=$fixedRow.find(">td:not([data-skip])");unfixedCells=$unfixedRow.find(">td:not([data-skip])");for(i=0;i<colsLength;i++){col=cols[i];if(col.hidden===true){continue}if(col.fixed===true){$td=fixedCells.eq(counterFixed++)}else{$td=unfixedCells.eq(counterUnfixed++)}if(col.template&&col.template.length){content=grid._renderTemplatedCell(rec,col);if(content.indexOf("<td")===0){$td.html($(content).html())}else{$td.html(content)}}else{$td.html(String(grid._renderCell(rec[col.key],col,rec)))}}return tr},_renderRecordsForTable:function(start,end){var $fTable;if(this.grid.hasFixedColumns()){$fTable=this._containers.body.fixedTable;if($fTable.length){this._gridRenderRecordsForTableHandler.call(this.grid,start,end,$fTable,$fTable.children("tbody"),true)}}this._gridRenderRecordsForTableHandler.apply(this.grid,arguments);if($fTable&&this.options.syncRowHeights&&this._applySyncRowHeights!==false){this._syncHeightsForTables($fTable,this.grid.element)}},_renderNewRow:function(rec){var grid=this.grid,tbody=this.grid.element.children("tbody"),index=tbody.children('[data-container!="true"]').length,virt=grid.options.virtualization===true||grid.options.rowVirtualization===true;this._gridRenderNewRowHandler.apply(this.grid,arguments);if(!virt){if(grid.hasFixedColumns()){MSApp.execUnsafeLocalFunction(function(){grid.fixedTable().children("tbody").append(grid._renderRecord(rec,index,true))})}}},_removeCellPaddingForAllColumns:function(rmvInFixedCntnr){var grid=this.grid;grid._removeHeaderCellPadding(!rmvInFixedCntnr?grid.fixedHeadersTable():grid.headersTable(),true);grid._removeCellPadding(!rmvInFixedCntnr?grid.fixedBodyContainer():grid.element,"tbody","td",true);grid._removeCellPadding(!rmvInFixedCntnr?grid.fixedFootersTable():grid.footersTable(),"tfoot","td",true)},_updateVScrollbarCellPaddingHelper:function(paddingIncrement,skipHeaderFooters){if(!this.grid.hasFixedColumns()){this._gridUpdatePaddingHandler(paddingIncrement,skipHeaderFooters);return}var grid=this.grid,gridOpts=grid.options,fTable,hTable,container,fDirRight=this.options.fixingDirection==="right",c=this._containers;if(!gridOpts.height){return}if(!skipHeaderFooters){if(grid._initialized){this._removeCellPaddingForAllColumns(fDirRight)}if(fDirRight){paddingIncrement-=c.body.fixedContainer.width()-c.body.fixedTable.width();if(paddingIncrement<=0){return}}if(gridOpts.showHeader){hTable=!fDirRight?grid.headersTable():grid.fixedHeadersTable();grid._increaseLastHeaderCellVScrollbarPadding(hTable,paddingIncrement)}if(gridOpts.showFooter){fTable=!fDirRight?grid.footersTable():grid.fixedFootersTable();grid._increaseLastCellVScrollbarPadding(fTable,"tfoot","td",paddingIncrement)}}container=!fDirRight?grid.element:grid.fixedTable();grid._increaseLastCellVScrollbarPadding(container,"tbody","td",paddingIncrement)},_syncHeightsForTables:function($fixedTable,$unfixedTable,resetHeights){var h,fH,ufH;resetHeights=resetHeights||$unfixedTable.length&&$unfixedTable[0].style.height!=="";$fixedTable.css("height","");$unfixedTable.css("height","");if(this.options.syncRowHeights){this.syncRowsHeights($fixedTable.children("tbody").children("tr"),$unfixedTable.children("tbody").children("tr"))}if(resetHeights){fH=$fixedTable.height();ufH=$unfixedTable.height();h=fH>ufH?fH:ufH;$fixedTable.height(h);$unfixedTable.height(h)}},_detachColumn:function(col){if(!this.grid.hasFixedColumns()){return this._gridDetachColumnHandler(col)}var pos,fixed,headerCells,grid=this.grid,$tbl,footerCells;fixed=col.fixed;col.hidden=false;grid._visibleColumnsArray=undefined;pos=grid.getVisibleIndexByKey(col.key);col.hidden=true;grid._visibleColumnsArray=undefined;grid._initializeDetachedContainers();if(grid._isMultiColumnGrid){grid._hideMultiHeaderCells(grid._headerCells,col.key)}$tbl=fixed?grid.fixedHeadersTable():grid.headersTable();headerCells=grid._isMultiColumnGrid?$tbl.children("thead").children("tr:not([data-mch-level])").not("[data-skip=true]"):$tbl.children("thead").children("tr").not("[data-skip=true]");grid._detachCells(headerCells,function(row){return row.filter(":not([data-new-row],[data-add-row])").children("th, td").not("[data-skip=true]")},pos,grid._detachedHeaderCells,col.key);$tbl=fixed?grid.fixedFootersTable():grid.footersTable();footerCells=$tbl.children("tfoot").children("tr");grid._detachCells(footerCells,function(row){return row.children("td").not("[data-skip=true]")},pos,grid._detachedFooterCells,col.key)},_attachColumn:function(col){if(!this.grid.hasFixedColumns()){this._gridAttachColumnHandler(col);return}var headerCells,footerCells,fixed=col.fixed,$tbl,grid=this.grid,pos=grid.getVisibleIndexByKey(col.key);grid._initializeDetachedContainers();if(grid._isMultiColumnGrid){grid._showMultiHeaderCells(col.key)}$tbl=fixed?grid.fixedHeadersTable():grid.headersTable();headerCells=grid._isMultiColumnGrid?$tbl.children("thead").children("tr:not([data-mch-level])").not("[data-skip=true]"):$tbl.children("thead").children("tr").not("[data-skip=true]");grid._attachCells(headerCells,function(row){return row.children("th, td").not("[data-skip=true]")},pos,grid._detachedHeaderCells,col.key);$tbl=fixed?grid.fixedFootersTable():grid.footersTable();footerCells=$tbl.children("tfoot").children("tr");grid._attachCells(footerCells,function(row){return row.children("td").not("[data-skip=true]")},pos,grid._detachedFooterCells,col.key)},_rerenderColgroups:function(){var grid=this.grid,c=this._containers,fc=grid.hasFixedColumns();if(fc){if(this._isVirtualGrid()){c.body.fixedTable.children("colgroup").remove();c.header.fixedTable.children("colgroup").remove();c.footer.fixedTable.children("colgroup").remove()}else{grid.fixedContainer().find("colgroup").remove()}}this._gridRerenderColgroupsHandler.apply(this.grid,arguments)},_renderColgroup:function(table,isHeader,isFooter,autofitLastColumn){var fc=this.grid.hasFixedColumns();if(fc){this._gridRenderColgroupHandler(document.getElementById(table.id+"_fixed"),isHeader,isFooter,false,{fixed:true})}this._gridRenderColgroupHandler(table,isHeader,isFooter,autofitLastColumn)},_resizeEl:function($e,delta){var w=this._calcTblWidth($e,delta);$e[0].style.width=w;return w},_containerResized:function(isFixed,deltaWidth){if(!this.grid.hasFixedColumns()){return}var grid=this.grid,w,v=this._isVirtualGrid();if(!this._containers||!this._containers.body){this._populateContainers()}if(isFixed){deltaWidth=-deltaWidth||0;w=this._resizeEl(this._containers.body.fixedTable,deltaWidth);if(grid.options.fixedHeaders&&grid.options.showHeader){w=this._resizeEl(this._containers.header.fixedTable,deltaWidth)}if(grid.options.fixedFooters&&grid.options.showFooter){w=this._resizeEl(this._containers.footer.fixedTable,deltaWidth)}if(v){this._resizeEl(this._containers.body.fixedContainer,deltaWidth);if(grid.options.fixedHeaders&&grid.options.showHeader){w=this._resizeEl(this._containers.header.fixedContainer,deltaWidth)}if(grid.options.fixedFooters&&grid.options.showFooter){w=this._resizeEl(this._containers.footer.fixedContainer,deltaWidth)}this._updateVirtualDOMWidth(deltaWidth)}else{this._mainFixedCntnr[0].style.width=w}this._updateHScrollbarWidth();this._updateGridWidth();grid._updateHScrollbarVisibility()}if(grid._gridHasWidthInPercent()){this._setMinWidthForGridContainer()}if(this.options.syncRowHeights){this.checkAndSyncHeights()}},_checkGridSupportedFeatures:function(){var self=this;if(this.grid.options._isHierarchicalGrid){throw new Error(this._getLocaleValue("hierarchicalGridNotSupported"))}var i,featureName,gridOptions=this.grid.options,cols=gridOptions.columns,dW=gridOptions.defaultColumnWidth,features=gridOptions.features,featuresLength=features.length;if(gridOptions.width===null||gridOptions.width===""){throw new Error(this._getLocaleValue("noGridWidthNotSupported"))}if(dW){if($.type(dW)==="string"&&dW.indexOf("%")>0){throw new Error(this._getLocaleValue("defaultColumnWidthInPercentageNotSupported"))}}$.each(cols,function(ind,col){var w=col.width;if(!w&&!dW||$.type(w)==="string"&&w.indexOf("%")>0){throw new Error(self._getLocaleValue("columnsWidthShouldBeSetInPixels").replace("{key}",col.key))}});$.each(cols,function(ind,col){if(col.unbound){throw new Error(self._getLocaleValue("unboundColumnsNotSupported"))}});if(gridOptions.columnVirtualization===true){throw new Error(this._getLocaleValue("columnVirtualizationNotSupported"))}if(gridOptions.width===null||gridOptions.width===""){throw new Error(this._getLocaleValue("noGridWidthNotSupported"))}if(gridOptions.virtualization&&gridOptions.virtualizationMode!=="continuous"){throw new Error(this._getLocaleValue("virtualizationNotSupported"))}if(featuresLength===1){return}for(i=0;i<featuresLength;i++){featureName=features[i].name;if(!featureName){continue}featureName=featureName.toLowerCase();switch(featureName){case"groupby":throw new Error(this._getLocaleValue("groupByNotSupported"));case"responsive":throw new Error(this._getLocaleValue("responsiveNotSupported"))}}},_updateWidthsOnHiding:function(width,fixed){var $bodyTbl,$headerTbl,$footerTbl,funcUpdateTbl,$bodyContainer,$headerContainer,$footerContainer;this._populateContainers();$bodyTbl=fixed?this._containers.body.fixedTable:this._containers.body.unfixedTable;$bodyContainer=fixed?this._containers.body.fixedContainer:this._containers.body.unfixedContainer;if(this._containers.header){$headerTbl=fixed?this._containers.header.fixedTable:this._containers.header.unfixedTable;$headerContainer=fixed?this._containers.header.fixedContainer:this._containers.header.unfixedContainer}if(this._containers.footer){$footerTbl=fixed?this._containers.footer.fixedTable:this._containers.footer.unfixedTable;$footerContainer=fixed?this._containers.footer.fixedContainer:this._containers.footer.unfixedContainer}funcUpdateTbl=function(nW,$tbl){if(!$tbl||!$tbl.length){return}var w=$tbl[0].style.width;if($.type(w)==="string"&&(w.indexOf("%")!==-1||w==="")){return}w=parseInt($tbl[0].style.width,10);if(isNaN(w)){w=$tbl.outerWidth()}w+=nW;$tbl[0].style.width=w+"px"};funcUpdateTbl(width,$bodyTbl);funcUpdateTbl(width,$headerTbl);funcUpdateTbl(width,$footerTbl);if(fixed&&this._mainFixedCntnr){this._mainFixedCntnr.css("width",parseFloat(this._mainFixedCntnr[0].style.width)+width+"px")}if(this._isVirtualGrid()){if(fixed){this._updateFixedColgroupVirt(width);if(!this.grid._gridHasWidthInPercent()){funcUpdateTbl(-width,this._containers.body.unfixedContainer);if(this.grid.options.showHeader){funcUpdateTbl(-width,this._containers.header.unfixedContainer)}if(this.grid.options.showFooter){funcUpdateTbl(-width,this._containers.footer.unfixedContainer)}}this._updateHScrollbarWidthVirt()}funcUpdateTbl(width,$bodyContainer);funcUpdateTbl(width,$headerContainer);funcUpdateTbl(width,$footerContainer)}},_hidingFinishing:function(args){if(!this.grid.hasFixedColumns()){return}var i,grid=this.grid,cols=args.columns,w,col;for(i=0;i<cols.length;i++){col=cols[i];if(col.fixed){w=parseInt(col.width,10);this._updateWidthsOnHiding(args.hidden?-w:w,true)}}this._populateContainers();grid._columnMovingResets()},_hidingFinished:function(args){if(!this.grid.hasFixedColumns()){return}var $trs,virt=this._isVirtualGrid(),c=this._containers;this._populateContainers();if(virt){this._recalcTableWidths();if(this.options.fixingDirection==="right"){this._adjustVirtWidthOnFixingRight(false)}}if(this.options.syncRowHeights){if(!args.hidden){$trs=c.body.fixedTable.children("tbody").find(">tr");$trs=$trs.add(c.body.unfixedTable.children("tbody").find(">tr"));$trs.each(function(ind,tr){tr.style.height=""})}if(virt&&!this._isContinuousVirtualization()){if(this.options.syncRowHeights){this.syncRowsHeights(this.grid.fixedTable().children("tbody").children("tr"),this.grid.element.children("tbody").children("tr"))}}else{this._syncHeightsForTables(this.grid.fixedTable(),this.grid.element)}if(this.grid.options.showFooter){if(c.footer){this.syncRowsHeights(c.footer.fixedTable.children("tfoot").children("tr"),c.footer.unfixedTable.children("tfoot").children("tr"))}}}if(this.grid._gridHasWidthInPercent()){this._setMinWidthForGridContainer()}this._applySyncRowHeights=true},_syncRowsOnAddEdit:function(rowId){if(!this.options.syncRowHeights||!this.grid.hasFixedColumns()){return}var h,c=this._containers,$fRow=this.grid.rowById(rowId,true),$ufRow=this.grid.rowById(rowId);if(!$fRow||!$ufRow){return}if(!c||!c.body){this._populateContainers()}h=c.body.fixedTable.height();c.body.fixedTable.height("");c.body.unfixedTable.height("");$fRow.height("");$ufRow.height("");this.syncRowsHeights($fRow,$ufRow);c.body.fixedTable.height(h);c.body.unfixedTable.height(h);this.checkAndSyncHeights()},_internalRowDeleted:function(){if(!this.options.syncRowHeights||!this.grid.hasFixedColumns()){return}var c=this._containers;if(!c||!c.body){this._populateContainers()}if(!this._isVirtualGrid()){c.body.fixedTable.height("");c.body.unfixedTable.height("")}this.checkAndSyncHeights()},_internalRowAdded:function(args){if(!this.grid.hasFixedColumns()){return}this._syncRowsOnAddEdit(args.row.attr("data-id"))},_internalCellUpdated:function(args){if(!this.grid.hasFixedColumns()){return}this._syncRowsOnAddEdit(args.rowID)},_internalRowUpdated:function(args){if(!this.grid.hasFixedColumns()){return}this._syncRowsOnAddEdit(args.rowID)},_removeRowsHeights:function($rows,removeAttr){var i,len=$rows.length;for(i=0;i<len;i++){$rows[i].style.height="";if(removeAttr){$rows[i].removeAttribute("height")}}},_virtualrecordsrender:function(){var grid=this.grid,fnRemoveHeigths,h,$fixedTable,$unfixedTable,fc,ufc,$fRows,$ufRows,cvirt=this._isContinuousVirtualization();if(!grid.hasFixedColumns()||!this.options.syncRowHeights){return}$fixedTable=this._containers.body.fixedTable;$unfixedTable=this._containers.body.unfixedTable;h=$unfixedTable[0].style.height;$fixedTable.height("");$unfixedTable.height("");if(cvirt){this._checkSyncTablesHeights();if(!$.ig.util.isIE){fc=this._scrollContainers.fCntnr;ufc=this._scrollContainers.ufCntnr;fc.scrollTop(ufc.scrollTop())}return}fnRemoveHeigths=function($rows){var i,len=$rows.length;for(i=0;i<len;i++){$rows[i].style.height=""}};$ufRows=$unfixedTable.children("tbody").children("tr");$fRows=$fixedTable.children("tbody").children("tr");this._removeRowsHeights($ufRows);this._removeRowsHeights($fRows);this.syncRowsHeights($ufRows,$fRows);$fixedTable.height(h);$unfixedTable.height(h)},_setFixingStateByCol:function(col,isFixed){var i,len;col.fixed=isFixed;if(col.group){len=col.group.length;for(i=0;i<len;i++){this._setFixingStateByCol(col.group[i],isFixed)}}},_unregisterSetOptionCallback:function(){var callbacks=this.grid._setOptionCallbacks,i,len=callbacks.length;for(i=0;i<len;i++){if(callbacks[i].type==="ColumnFixing"){$.ig.removeFromArray(callbacks,i);break}}},_registerSetOptionCallback:function(){var callbacks=this.grid._setOptionCallbacks,i,len=callbacks.length;for(i=0;i<len;i++){if(callbacks[i].type==="ColumnFixing"){break}}if(i===len){callbacks.push({type:"ColumnFixing",func:$.proxy(this._gridSetOption,this)})}},_updateHScrollbarTblWidthsInFixedVirtRight:function(){var $hScrlBar,$hScrlBarInner;$hScrlBarInner=this.grid._getHScrollContainerInner();$hScrlBar=$hScrlBarInner.parent();if(!this.grid._gridHasWidthInPercent){$hScrlBar.width(this._containers.body.unfixedContainer.width())}$hScrlBarInner.width(this._containers.body.unfixedTable.width());$hScrlBar.css("overflow-y","hidden");if(this._containers.header){this._containers.header.unfixedTable.css("width","");this._containers.header.unfixedTable.css("width",this._calcTblWidth(this._containers.header.unfixedTable,0))}if(this._containers.footer){this._containers.footer.unfixedTable.css("width","");this._containers.footer.unfixedTable.css("width",this._calcTblWidth(this._containers.footer.unfixedTable,0))}this._updateGridWidth();this.grid._updateHScrollbarVisibility()},_rollbackApplied:function(){if(!this._containers||!this._containers.body){this._populateContainers()}this._containers.body.fixedTable.height("");this._containers.body.unfixedTable.height("");if(this.options.syncRowHeights){this.checkAndSyncHeights()}},_gridRendered:function(){if(this.options.fixingDirection==="right"&&this._isVirtualGrid()&&this.grid.hasFixedColumns()){this._updateHScrollbarTblWidthsInFixedVirtRight()}},_injectGrid:function(gridInstance,isRebind){this.grid=gridInstance;if(isRebind===true){return}this.grid._fixedColumns=this.grid._fixedColumns||[];this.grid._fixingDirection=this.options.fixingDirection;this._checkGridSupportedFeatures();this._registerSetOptionCallback();this._detachEvents();this._headerCellRenderedHandler=$.proxy(this._headerCellRendered,this);this.grid.element.bind("iggridheadercellrendered",this._headerCellRenderedHandler);this._headerRenderedHandler=$.proxy(this._headerRendered,this);this.grid.element.bind("iggridheaderrendered",this._headerRenderedHandler);this._headerRenderingHandler=$.proxy(this._headerRendering,this);this.grid.element.bind("iggridheaderrendering",this._headerRenderingHandler);this._columnsMovedHandler=$.proxy(this._columnsMoved,this);this.grid.element.bind("iggrid_columnsmoved",this._columnsMovedHandler);if(this._isVirtualGrid()&&this.options.syncRowHeights){this._virtualrecordsrenderHandler=$.proxy(this._virtualrecordsrender,this);this.grid.element.bind("iggridvirtualrecordsrender",this._virtualrecordsrenderHandler)}this._gridContainerHeightHandler=$.proxy(this._heightChanged,this);this.grid.element.bind("iggrid_heightchanged",this._gridContainerHeightHandler);this._gridHeightChangingHandler=$.proxy(this._gridHeightChanging,this);this.grid.element.bind("iggrid_heightchanging",this._gridHeightChangingHandler);this._gridContainersRenderedHandler=$.proxy(this._gridContainersRendered,this);this.grid.element.bind("iggrid_gridcontainersrendered",this._gridContainersRenderedHandler);if(this.grid._columns===undefined||this.grid._columns===null){this.grid._columns=this.grid.options.columns.clone()}if(this.grid._fixedColumns===undefined){this.grid._fixedColumns=[]}if(this.grid.options.height===null&&$.ig.util.isIE&&$.ig.util.browserVersion>=9){this._dataRenderingHandler=$.proxy(this._dataRendering,this);this.grid.element.bind("iggriddatarendering",this._dataRenderingHandler)}this._dataRenderedHandler=$.proxy(this._dataRendered,this);this.grid.element.bind("iggriddatarendered",this._dataRenderedHandler);this._lastColumnWidthAutoAdjustedHandler=$.proxy(this._lastColumnWidthAutoAdjusted,this);this.grid.element.bind("iggrid_lastcolumnwidthautoadjusted",this._lastColumnWidthAutoAdjustedHandler);this._gridColCollectionModified=$.proxy(this._colCollectionModified,this);this.grid.element.bind("iggridcolumnscollectionmodified",this._gridColCollectionModified);if(!this._isFunctionsOverriden){this.grid._visibleAreaWidth(this.options.minimalVisibleAreaWidth);this._gridRenderRowHandler=$.proxy(this.grid._renderRow,this.grid);this._renderRowHandler=$.proxy(this._renderRow,this);this.grid._renderRow=this._renderRowHandler;this._gridRenderRecordsForTableHandler=$.proxy(this.grid._renderRecordsForTable,this.grid);this._renderRecordsForTableHandler=$.proxy(this._renderRecordsForTable,this);this.grid._renderRecordsForTable=this._renderRecordsForTableHandler;this._gridRenderNewRowHandler=$.proxy(this.grid.renderNewRow,this.grid);this._renderNewRowHandler=$.proxy(this._renderNewRow,this);this.grid.renderNewRow=this._renderNewRowHandler;this._gridDetachColumnHandler=$.proxy(this.grid._detachColumn,this.grid);this._detachColumnHandler=$.proxy(this._detachColumn,this);this.grid._detachColumn=this._detachColumnHandler;this._gridAttachColumnHandler=$.proxy(this.grid._attachColumn,this.grid);this._attachColumnHandler=$.proxy(this._attachColumn,this);this.grid._attachColumn=this._attachColumnHandler;this._gridRerenderColgroupsHandler=$.proxy(this.grid._rerenderColgroups,this.grid);this._rerenderColgroupsHndlr=$.proxy(this._rerenderColgroups,this);this.grid._rerenderColgroups=this._rerenderColgroupsHndlr;this._gridRenderColgroupHandler=$.proxy(this.grid._renderColgroup,this.grid);this._renderColgroupHandler=$.proxy(this._renderColgroup,this);this.grid._renderColgroup=this._renderColgroupHandler;this._gridUpdatePaddingHandler=$.proxy(this.grid._updateVScrollbarCellPaddingHelper,this.grid);this._updateVScrollbarCellPaddingHelperHandler=$.proxy(this._updateVScrollbarCellPaddingHelper,this);this.grid._updateVScrollbarCellPaddingHelper=this._updateVScrollbarCellPaddingHelperHandler;this._isFunctionsOverriden=true}}});$.extend($.ui.igGridColumnFixing,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI Grid Column Moving 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	jquery.ui.mouse.js
 *	jquery.ui.draggable.js
 *	infragistics.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.tree.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 *	infragistics.ui.grid.shared.js
 *	infragistics.ui.grid.featurechooser.js
 */
(function($){$.widget("ui.igGridColumnMoving",$.ui.igWidget,{localeWidgetName:"ColumnMoving",renderInFeatureChooser:true,options:{columnSettings:[{columnKey:null,columnIndex:null,allowMoving:true}],mode:"immediate",moveType:"dom",addMovingDropdown:true,movingDialogWidth:400,movingDialogHeight:"",movingDialogAnimationDuration:200,movingAcceptanceTolerance:20,movingScrollTolerance:20,scrollSpeedMultiplier:2,scrollDelta:2,hideHeaderContentsDuringDrag:true,dragHelperOpacity:1,movingDialogCaptionButtonDesc:undefined,movingDialogCaptionButtonAsc:undefined,movingDialogCaptionText:undefined,movingDialogDisplayText:undefined,movingDialogDropTooltipText:undefined,dropDownMoveLeftText:undefined,dropDownMoveRightText:undefined,dropDownMoveFirstText:undefined,dropDownMoveLastText:undefined,movingToolTipMove:undefined,featureChooserSubmenuText:undefined,locale:{movingDialogButtonApplyText:undefined,movingDialogButtonCancelText:undefined,movingDialogCaptionButtonDesc:undefined,movingDialogCaptionButtonAsc:undefined,movingDialogCaptionText:undefined,movingDialogDisplayText:undefined,movingDialogDropTooltipText:undefined,movingDialogCloseButtonTitle:undefined,dropDownMoveLeftText:undefined,dropDownMoveRightText:undefined,dropDownMoveFirstText:undefined,dropDownMoveLastText:undefined,movingToolTipMove:undefined,featureChooserSubmenuText:undefined},movingDialogDropTooltipMarkup:"<div><p><span></span><strong>{text}</strong></p></div>",columnMovingDialogContainment:"owner",dialogWidget:"igGridModalDialog",inherit:false},css:{headerCellMouseOver:"ui-state-hover",dropDownButton:"ui-iggrid-moving-indicator",dropDownIndicatorContainer:"ui-iggrid-indicatorcontainer",dragIndicatorTop:"ui-iggrid-columnmoving-dragtop ui-icon ui-icon-triangle-1-s",dragIndicatorBottom:"ui-iggrid-columnmoving-dragbottom ui-icon ui-icon-triangle-1-n",dragIndicatorLeft:"ui-iggrid-columnmoving-dragleft",dragIndicatorRight:"ui-iggrid-columnmoving-dragright",dropDownIconContainer:"ui-iggrid-columnmovingiconcontainer",featureChooserMovingDialogIcon:"ui-icon ui-iggrid-icon-move",featureChooserLeftIcon:"ui-iggrid-featurechooser-li-iconcontainer ui-icon ui-iggrid-icon-left",featureChooserRightIcon:"ui-iggrid-featurechooser-li-iconcontainer ui-icon ui-iggrid-icon-right",featureChooserFirstIcon:"ui-iggrid-featurechooser-li-iconcontainer ui-icon ui-iggrid-icon-first",featureChooserLastIcon:"ui-iggrid-featurechooser-li-iconcontainer ui-icon ui-iggrid-icon-last",featureChooserSubmenu:"ui-iggrid-featurechooser-list-submenu ui-menu ui-widget ui-widget-content ui-corner-all",featureChooserSubmenuItem:"ui-iggrid-featurechooser-list-submenu-item ui-state-default",featureChooserSubmenuItemMouserOver:"ui-state-hover",columnMovingDropDown:"ui-iggrid-columnmoving-dropdown-dialog ui-widget ui-widget-content ui-corner-all",columnMovingDropDownList:"ui-iggrid-columnmoving-dropdown-list ui-menu",columnMovingDropDownItem:"ui-iggrid-columnmoving-dropdown-ddlistitemicons ui-state-default",columnMovingDropDownItemHover:"ui-iggrid-columnmoving-dropdown-listitem-hover ui-state-active ui-state-hover",columnMovingDropDownItemText:"ui-iggrid-columnmoving-dropdown-ddlistitemtext",columnMovingIndicatorSelected:"ui-iggrid-hiding-indicator-selected",movingDialogItemList:"ui-iggrid-moving-dialog-columns",movingDialogListItem:"ui-widget-content",movingDialogListItemArrowUp:"ui-icon-arrowthick-1-n ui-button-icon-primary ui-icon",movingDialogListItemArrowDown:"ui-icon-arrowthick-1-s ui-button-icon-primary ui-icon",movingDialogListItemArrowButton:"ui-button ui-corner-all ui-button-icon-only ig-sorting-indicator",movingDialogListItemText:"ui-iggrid-dialog-text",movingDialogCloseButton:"ui-icon ui-icon-close"},events:{columnDragStart:"columnDragStart",columnDragEnd:"columnDragEnd",columnDragCanceled:"columnDragCanceled",columnMoving:"columnMoving",columnMoved:"columnMoved",movingDialogOpening:"movingDialogOpening",movingDialogOpened:"movingDialogOpened",movingDialogDragged:"movingDialogDragged",movingDialogClosing:"movingDialogClosing",movingDialogClosed:"movingDialogClosed",movingDialogContentsRendering:"movingDialogContentsRendering",movingDialogContentsRendered:"movingDialogContentsRendered",movingDialogMoveUpButtonPressed:"movingDialogMoveUpButtonPressed",movingDialogMoveDownButtonPressed:"movingDialogMoveDownButtonPressed",movingDialogDragColumnMoving:"movingDialogDragColumnMoving",movingDialogDragColumnMoved:"movingDialogDragColumnMoved"},_createWidget:function(){this.options.columnSettings=[];$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){this._cache={};this._cKey="";this._cIdx=-1;this._tKey="";this._tIdx=-1;this._oTh=null;this._cmib=null;this._cmit=null;this._movingDialog=null;this._groupBy=null;this._ddButtons={first:{text:this._getLocaleValue("dropDownMoveFirstText"),optionName:"dropDownMoveFirstText",func:$.proxy(this._moveFirst,this),icon:this.css.featureChooserFirstIcon},left:{text:this._getLocaleValue("dropDownMoveLeftText"),optionName:"dropDownMoveLeftText",func:$.proxy(this._moveLeft,this),icon:this.css.featureChooserLeftIcon},right:{text:this._getLocaleValue("dropDownMoveRightText"),optionName:"dropDownMoveRightText",func:$.proxy(this._moveRight,this),icon:this.css.featureChooserRightIcon},last:{text:this._getLocaleValue("dropDownMoveLastText"),optionName:"dropDownMoveLastText",func:$.proxy(this._moveLast,this),icon:this.css.featureChooserLastIcon}};this._hscroller=null;this._scroller={on:false,delay:-1};if(this.options.mode!=="immediate"&&this.options.mode!=="deferred"){this.options.mode="immediate"}if(this.options.mode==="immediate"&&this.options.moveType==="render"){this.options.moveType="dom"}if(this.options.addMovingDropdown===false){this.renderInFeatureChooser=false}},changeGlobalLanguage:function(){},changeGlobalRegional:function(){},_changeLocaleForMovingDialog:function(){var md=this._movingDialog;if(md){md[this.options.dialogWidget]("option",{locale:{modalDialogCaptionText:this._getLocaleValue("movingDialogCaptionText")}});$("#"+this.grid.id()+"_moving_movingDialog_closeButton").igButton("option","title",this._getLocaleValue("movingDialogCloseButtonTitle"));$.ui.igWidget.prototype.changeLocale.call(this,$("#"+this.grid.id()+"_dialog_tree"))}},_changeLocaleForFeatureChooser:function(){var i,cols=this.grid.options.columns,id=this.grid.id(),fc=this.grid.element.data("igGridFeatureChooser");this.grid.container().find("th[data-moving-dd-indicator]").remove();if(this.renderInFeatureChooser&&fc){fc._removeFeature("ColumnMovingDropDown",true);for(i=0;i<cols.length;i++){this._renderFeatureChooser(cols[i].key,$("#"+id+"_"+cols[i].key))}}},_changeLocaleForMovingDropdown:function(){var $button=$("#"+this.grid.id()+"_moving_dd_button"),$dropdown=this.grid.container().find("[data-moving-inddropdown='"+this.grid.id()+"']");if($dropdown.length){$.ui.igWidget.prototype.changeLocale.call(this,$dropdown);if($button.length){$button.igButton("option","labelText",this._getLocaleValue("movingDialogCaptionText"))}}},changeLocale:function(){this._changeLocaleForMovingDialog();this._changeLocaleForFeatureChooser();this._changeLocaleForMovingDropdown()},_registerWidget:$.noop,_unregisterWidget:$.noop,_setOption:function(key){if(key==="mode"||key==="columnSettings"||key==="addMovingDropdown"){throw new Error(this._getLocaleValue("optionChangeNotSupported").replace("{optionName}",key))}this._superApply(arguments)},destroy:function(){this.grid.moveColumn=this._gridMoveColumn;this._unregisterEvents();this._removeMoving();this._superApply(arguments);return this},moveColumn:function(column,target,after,inDom,callback){this._moveColumn(column,target,after,inDom,true,callback)},_headerCellRendered:function(event,args){if(this.grid.id()!==args.owner.id()){return}this._thRendered(args.th)},_headerRendering:function(){var i;for(i=0;i<this.grid.options.features.length;i++){if(this.grid.options.features[i].name==="GroupBy"){this._groupBy=this.grid.element.data("igGridGroupBy");break}}},_headerRendered:function(event,args){if(this.grid.id()!==args.owner.id()){return}this._thsRendered(args.table)},_gridFullyRendered:function(){this.grid.scrollContainer().bind("scroll",this._containerScrolledHandler);this._updateLayout()},_containerScrolled:function(event,args,fromParent){var grids,i,cmi;if(!this._autoScrolled){if(this.options.mode==="deferred"){this._adjustIndicators(event.originalEvent.detail,fromParent)}}grids=this.grid.element.find(".ui-iggrid-table");for(i=0;i<grids.length;i++){cmi=grids.eq(i).data("igGridColumnMoving");if(cmi){cmi._containerScrolled(event,args,true)}}},_fixedColumnsChanged:function(){this._updateLayout()},_headerPicked:function(event,args){var $th=$(event.target).closest("th"),id=this._getIdOfTh($th),noCancel=true;args={columnKey:id,columnIndex:$th.index(),owner:this,header:$th,helper:args.helper};noCancel=this._trigger(this.events.columnDragStart,event,args);if(noCancel){if(this.grid._focusedElement){this.grid._focusedElement.blur()}this._thPicked($th,id)}return noCancel},_headerDragged:function(event,args){var left;if(this._oPos){if(this._oPos.left===args.position.left){return}left=this._oPos.left>args.position.left}else{left=args.originalPosition.left>args.position.left}this._oPos={left:args.position.left};if(this.options.mode==="deferred"){this._thDragedDeferred(args.helper,args.offset,left)}else if(this._thDragged(args.helper,args.offset,left)){args.originalPosition.left=args.position.left}},_headerDropped:function(event,args){var $th=$(event.target).closest("th"),id=this._getIdOfTh($th),noCancel=true;args={columnKey:id,columnIndex:$th.index(),owner:this,header:$th,helper:args.helper};noCancel=this._trigger(this.events.columnDragEnd,event,args);if(noCancel){this._thDropped()}else{this._trigger(this.events.columnDragCanceled,event,args)}return noCancel},_dialogUpPressed:function(event){var tar=$(event.target),item=tar.closest("li"),parent=item.parent(),idx=item.index(),iItem=idx===0?item.parent().children().last().attr("data-value"):item.prev().attr("data-value"),iDir=idx===0?true:false,col=tar.closest("span").attr("datakey"),a,oc;a={owner:this,movingDialog:this._movingDialog,columnKey:col,columnIndex:idx,targetIndex:idx===0?parent.children().length-1:idx-1};this._cKey=col;this._cIdx=a.columnIndex;this._tIdx=a.targetIndex;if(this._cIdx===this._tIdx){return}oc=this._moveColumn(col,iItem,iDir,this.options.moveType==="dom",false);if(!oc){return false}if(idx===0){item.detach().insertAfter(parent.children("li:last"))}else{item.detach().insertBefore(parent.children("li:eq("+(idx-1)+")"))}this._trigger(this.events.movingDialogMoveUpButtonPressed,event,a)},_dialogDownPressed:function(event){var tar=$(event.target),item=tar.closest("li"),parent=item.parent(),idx=item.index(),iItem=idx===item.siblings().length?item.parent().children().first().attr("data-value"):item.next().attr("data-value"),iDir=idx===item.siblings().length?false:true,col=tar.closest("span").attr("datakey"),a,oc;a={owner:this,movingDialog:this._movingDialog,columnKey:col,columnIndex:idx,targetIndex:idx===parent.children().length-1?0:idx+1};this._cKey=col;this._cIdx=a.columnIndex;this._tIdx=a.targetIndex;if(this._cIdx===this._tIdx){return}oc=this._moveColumn(col,iItem,iDir,this.options.moveType==="dom",false);if(!oc){return false}if(idx===item.parent().children().length-1){item.detach().insertBefore(parent.children("li:first"))}else{item.detach().insertAfter(parent.children("li:eq("+idx+")"))}this._trigger(this.events.movingDialogMoveDownButtonPressed,event,a)},_dialogRearranging:function(event,args){var noCancel,a,oc,column=$(args.draggable),target=$(args.element),cid=column.attr("data-value"),tid=target.attr("data-value"),aft=$(args.element).closest("ul[data-depth=0]").data("igTree")._validationObject.dropAfter,cix=column.index(),tix=target.index();tix=tix>cix?aft?tix:tix-1:aft?tix+1:tix;a={owner:this,movingDialog:this._movingDialog,columnKey:cid,columnIndex:cix,targetIndex:tix};if(cix===tix){return false}noCancel=this._trigger(this.events.movingDialogDragColumnMoving,event,a);if(noCancel){this._cKey=cid;this._cIdx=a.columnIndex;this._tIdx=a.targetIndex;oc=this._moveColumn(cid,tid,aft,this.options.moveType==="dom",false);if(!oc){return false}a.movingDialog.find("div.ui-state-highlight").remove();this._trigger(this.events.movingDialogDragColumnMoved,event,a);return true}return false},_dialogRearranged:function(event,args){this._bindUpDownDialogButtons(args.element.parent())},_dialogDragged:function(event,args){this._trigger(this.events.movingDialogDragged,null,{movingDialogElement:event.target,owner:this,originalPosition:args.originalPosition,position:args.position})},_dialogOpening:function(event,args){var noCancel;noCancel=this._trigger(this.events.movingDialogOpening,null,{movingDialogElement:event.target,owner:this});if(noCancel){this._renderMovingDialogContent(event,args);this._trigger(this.events.movingDialogOpened,null,{movingDialogElement:event.target,owner:this})}return noCancel},_dialogClosing:function(event){return this._trigger(this.events.movingDialogClosing,null,{movingDialogElement:event.target,owner:this})},_dialogClosed:function(event){this._trigger(this.events.movingDialogClosed,null,{movingDialogElement:event.target,owner:this})},_dropDownMouseDown:function(event){var ind=$(event.target);this._toggleDropDown(ind,$("div[data-moving-inddropdown='"+this.grid.id()+"']"));this._cancelEvent(event)},_dropDownKeyDown:function(event){var sItem,nItem,nItemB,dropdown=$("div[data-moving-inddropdown='"+this.grid.id()+"']");if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){sItem=dropdown.find("ul .ui-state-hover:first");if(dropdown.is(":visible")&&sItem.length>0){sItem.trigger("mousedown")}this._toggleDropDown($(event.target),dropdown,false);this._cancelEvent(event)}else if(event.keyCode===$.ui.keyCode.ESCAPE){this._toggleDropDown($(event.target),dropdown,false);this._cancelEvent(event)}else if(event.keyCode===$.ui.keyCode.DOWN||event.keyCode===$.ui.keyCode.UP){if(dropdown.is(":visible")){sItem=dropdown.find("ul .ui-state-hover:first").closest("li");if(sItem.length===0){nItem=dropdown.find("ul li:eq(0)")}else{if(sItem.index()===0&&event.keyCode===$.ui.keyCode.UP){nItem=sItem.parent().children(":last")}else{nItem=event.keyCode===$.ui.keyCode.DOWN?sItem.next():sItem.prev()}}dropdown.find("ul .ui-state-hover").removeClass(this.css.columnMovingDropDownItemHover);nItemB=nItem.find("[role='button']");if(nItemB.length>0){nItem=nItemB}nItem.addClass(this.css.columnMovingDropDownItemHover)}this._cancelEvent(event)}},_dropDownButtonMouseOver:function(event){$(event.currentTarget).addClass(this.css.columnMovingDropDownItemHover)},_dropDownButtonMouseOut:function(event){$(event.currentTarget).removeClass(this.css.columnMovingDropDownItemHover)},_moveLeft:function(event,args){var sib=this._getAllSiblings(args),cid,tid,i;for(i=0;i<sib.length;i++){cid=sib[i].key||sib[i].identifier;if(cid===args){if(i>0){this._cKey=args;this._cIdx=i;this._tIdx=i-1;tid=sib[i-1].key||sib[i-1].identifier;this._moveColumn(cid,tid,false,this.options.moveType==="dom",false)}break}}},_moveRight:function(event,args){var sib=this._getAllSiblings(args),cid,tid,i;for(i=0;i<sib.length;i++){cid=sib[i].key||sib[i].identifier;if(cid===args){if(i<sib.length-1){this._cKey=args;this._cIdx=i;this._tIdx=i+1;tid=sib[i+1].key||sib[i+1].identifier;this._moveColumn(cid,tid,true,this.options.moveType==="dom",false)}break}}},_moveFirst:function(event,args){var sib=this._getAllSiblings(args),cid,tid,i;for(i=0;i<sib.length;i++){cid=sib[i].key||sib[i].identifier;if(cid===args){if(i!==0){this._cKey=args;this._cIdx=i;this._tIdx=0;tid=sib[0].key||sib[0].identifier;this._moveColumn(cid,tid,false,this.options.moveType==="dom",false)}break}}},_moveLast:function(event,args){var sib=this._getAllSiblings(args),cid,tid,i;for(i=0;i<sib.length;i++){cid=sib[i].key||sib[i].identifier;if(cid===args){if(i!==sib.length-1){this._cKey=args;this._cIdx=i;this._tIdx=sib.length-1;tid=sib[sib.length-1].key||sib[sib.length-1].identifier;this._moveColumn(cid,tid,true,this.options.moveType==="dom",false)}break}}},_headerMouseOver:function(event){$(event.target).closest("th").addClass(this.css.headerCellMouseOver)},_headerMouseOut:function(event){$(event.target).closest("th").removeClass(this.css.headerCellMouseOver)},_renderHelpers:function(){var existingBottomIndicator=this.grid._rootContainer().children("[id$='_moving_indicator_bottom']"),existingTopIndicator=this.grid._rootContainer().children("[id$='_moving_indicator_top']");if(existingBottomIndicator.length>0&&existingTopIndicator.length>0){this._cmib=existingBottomIndicator;this._cmib.data("users",this._cmib.data("users")+1);this._cmit=existingTopIndicator;this._cmit.data("users",this._cmit.data("users")+1)}else{this._cmib=$("<div>&nbsp;</div>").attr("id",this.grid.id()+"_moving_indicator_bottom").addClass(this.css.dragIndicatorBottom).css({position:"absolute","z-index":"1000000",width:"16px",height:"16px",display:"none"}).appendTo(this.grid._rootContainer());this._cmit=$("<div>&nbsp;</div>").attr("id",this.grid.id()+"_moving_indicator_top").addClass(this.css.dragIndicatorTop).css({position:"absolute","z-index":"1000000",width:"16px",height:"16px",display:"none"}).appendTo(this.grid._rootContainer())}},_renderFeatureChooser:function(col,th){var fc=this.grid.element.data("igGridFeatureChooser");if(fc&&this.renderInFeatureChooser){if(fc._shouldRenderInFeatureChooser(col)===true){this._addMoveButtonsInFeatureChooser(fc,col)}else{this._renderMovingDropDownIndicator(th,col);this.grid._enableHeaderCellFeature(th)}}},_renderMovingDropDownIndicator:function(th,col){var $button,$anchor,$container,self=this;$button=$("<span></span>").addClass(this.css.dropDownButton);th.attr("th-remove-focus","");$anchor=$("<a></a>").attr({href:"#","data-moving-dd-indicator":true,"data-localeid":"movingToolTipMove","data-localeattr":"title",title:this._getLocaleValue("movingToolTipMove"),id:this.grid.id()+"_moving_headerButton_"+col}).bind({keydown:this._dropDownKeyHandler,blur:function(e){self._toggleDropDown($(e.target),$("div[data-moving-inddropdown='"+self.grid.id()+"']"),true)},mousedown:this._dropDownButtonHandler,mouseup:this._cancelEventHandler,click:this._cancelEventHandler});$container=th.find(".ui-iggrid-indicatorcontainer");$container=$container.length?$container:$("<div></div>").addClass(this.css.dropDownIndicatorContainer).appendTo(th);$button.appendTo($anchor);$anchor.appendTo($container);this._needToRenderDropDown=true},_renderMovingDialogContent:function(){var $content=this._movingDialog[this.options.dialogWidget]("getContent"),movingDialog=this._movingDialog,$tree=$content.find("#"+this.grid.id()+"_dialog_tree"),noCancel;noCancel=this._trigger(this.events.movingDialogContentsRendering,null,{movingDialogElement:movingDialog,owner:this});if(noCancel){if($tree.length>0){$tree.igTree("option","dataSource",this._getClonedDataSource(this.grid._visibleMchColumns()||this.grid._visibleColumns()))}else{$tree=this._initializeTree($content)}this._bindUpDownDialogButtons($tree);this._trigger(this.events.movingDialogContentsRendered,null,{movingDialogElement:movingDialog,owner:this})}},_initializeTree:function(content){var self=this,markup=self.options.movingDialogDropTooltipMarkup.replace("{text}",this._getLocaleValue("movingDialogDropTooltipText"));return $("<ul id='"+this.grid.id()+"_dialog_tree'></ul>").appendTo(content).igTree({dataSourceType:"json",pathSeparator:"/",dataSource:this._getClonedDataSource(this.grid._visibleMchColumns()||this.grid._visibleColumns()),bindings:{primaryKey:"key",textKey:"headerText",valueKey:"key",childDataProperty:"group",nodeContentTemplate:this._getTreeTemplate()},dragAndDrop:true,dragAndDropSettings:{dragAndDropMode:"move",revert:true,zIndex:1000001,moveBetweenMarkup:markup,customDropValidation:function(col){var context=$(this),$col=$(col);if(self._isColumnMovable($col.attr("data-value"))){if(context.is("li")&&context.parent()[0]===$col.parent()[0]){return true}}return false},containment:false},nodeDropping:this._dialogRearrangingHandler,nodeDropped:this._dialogRearrangedHandler,selectionChanging:function(){return false}})},_getClonedDataSource:function(ds){return $.extend(true,[],ds,this._cloneMovable(ds))},_cloneMovable:function(ds){var self=this,movableClone=[],idx=0;$.each(ds,function(){if(this.group){movableClone.push({movable:self._isColumnMovable(this.key,idx++),group:self._cloneMovable(this.group),key:this.key||this.identifier||idx})}else{movableClone.push({movable:self._isColumnMovable(this.key,idx++),key:this.key||idx})}});return movableClone},_getTreeTemplate:function(){var tmpl="",up,down,wrapper,data;data="<span>${headerText}</span>";wrapper="<span class='"+this.css.movingDialogListItemArrowButton+"'>";up=wrapper+"<span id='"+this.grid.id()+"_moving_dialog_${key}_up' title='"+this._getLocaleValue("movingDialogCaptionButtonAsc")+"' role='button' datakey='${key}' class='"+this.css.movingDialogListItemArrowUp+"' style='"+"margin-top:-10px;' "+"data-localeattr='title' data-localeid='movingDialogCaptionButtonAsc'"+"></span></span>";down=wrapper+"<span id='"+this.grid.id()+"_moving_dialog_${key}_down' title='"+this._getLocaleValue("movingDialogCaptionButtonDesc")+"' role='button' datakey='${key}' class='"+this.css.movingDialogListItemArrowDown+"' style='margin-top:-10px;' "+"data-localeattr='title' data-localeid='movingDialogCaptionButtonDesc'"+"></span></span>";wrapper+="</span>";tmpl+="{{if ${movable} }}";tmpl+=up+down+data;tmpl+="{{else}}";tmpl+=wrapper+wrapper+data;tmpl+="{{/if}}";return tmpl},_renderMovingDialog:function(){var containment,o=this.options,$captionButtonContainer,$closeButton,movingDialog;if(this.options.columnMovingDialogContainment==="owner"){containment=this.grid.container()}else{containment="window"}movingDialog=$("<div></div>").appendTo(this.grid._rootContainer()).attr("id",this.grid.id()+"_moving_movingDialog");this._movingDialog=movingDialog;movingDialog[this.options.dialogWidget]({containment:containment,renderFooterButtons:false,locale:{modalDialogCaptionText:this._getLocaleValue("movingDialogCaptionText")},modalDialogWidth:o.movingDialogWidth,modalDialogHeight:o.movingDialogHeight,animationDuration:o.movingDialogAnimationDuration,gridContainer:this.grid.container(),modalDialogOpening:this._dialogOpeningHandler,modalDialogMoving:this._dialogDraggedHandler,modalDialogClosing:this._dialogClosingHandler,modalDialogClosed:this._dialogClosedHandler});$captionButtonContainer=movingDialog[this.options.dialogWidget]("getCaptionButtonContainer");$closeButton=$("<button type='button'></button>").attr({id:this.grid.id()+"_moving_movingDialog_closeButton","data-localeid":"movingDialogCloseButtonTitle","data-localeattr":"title"}).appendTo($captionButtonContainer);$closeButton.igButton({onlyIcons:true,icons:{primary:this.css.movingDialogCloseButton},width:"20px",height:"20px",click:this._dialogCloseButtonHandler,title:this._getLocaleValue("movingDialogCloseButtonTitle")})},_renderDropDown:function(element){var self=this,dropDown,list,gridId=this.grid.id();dropDown=$("<div data-moving-inddropdown='"+gridId+"'></div>").css("position","absolute").css("display","none").addClass(this.css.columnMovingDropDown).appendTo(this.grid._rootContainer());list=$('<ul tabindex="0"></ul>').addClass(this.css.columnMovingDropDownList).appendTo(dropDown);$.each(this._ddButtons,function(key,val){$("<li></li>").addClass(self.css.columnMovingDropDownItem).attr("data-key",key).bind({mouseover:self._dropDownButtonMouseOverHandler,mouseout:self._dropDownButtonMouseOutHandler}).append($("<span></span>").addClass(self.css.dropDownIconContainer).append($("<span></span>").addClass(val.icon))).append($("<span></span>").attr({"data-localeid":val.optionName}).addClass(self.css.columnMovingDropDownItemText).text(val.text)).appendTo(list)});$("<a></a>").attr("id",gridId+"_moving_dd_button").appendTo($("<li></li>").appendTo(list)).igButton({labelText:this._getLocaleValue("movingDialogCaptionText"),mousedown:function(event){if(event.target){setTimeout(function(){$(event.target).removeClass("ui-state-active")},0)}self._toggleDropDown(element,dropDown,true);self._openMovingDialog(element,dropDown,true)}});return dropDown},_toggleDropDown:function(element,dropDown,isCalledFromBlur){var th,id,isLast,offset,rOffset,left,isVisible=dropDown.is(":visible")===true,nth=element?element.closest("th"):null,nid=nth?nth.attr("id")||nth.attr("data-mch-id"):null,self=this;if(dropDown.data("isAnimating")===true||nid!==null&&this._currentlyToggled!==nid&&isCalledFromBlur===true||isVisible===false&&isCalledFromBlur===true){return}if(!isVisible){th=nth;th.find("a[data-moving-dd-indicator]").focus();isLast=th.parent().children().length-th.index()<=2;offset=$.ig.util.offset(th);if(isLast){left=offset.left+th.outerWidth()-dropDown.outerWidth()}else{left=offset.left}rOffset=$.ig.util.getRelativeOffset(dropDown);left=Math.max(0,left-rOffset.left);dropDown.css("top",offset.top+th.outerHeight()-rOffset.top);dropDown.css("left",left);$.each(this._ddButtons,function(key,value){dropDown.find("li[data-key='"+key+"']").bind("mousedown.temp",function(event){self._toggleDropDown(element,dropDown,true);id=th.attr("id");if(id){id=id.replace(self.grid.id()+"_","")}else{id=th.attr("data-mch-id")}value.func(null,id);event.stopPropagation();event.preventDefault()})});this._currentlyToggled=th.attr("id")||th.attr("data-mch-id")}else{$.each(this._ddButtons,function(key){dropDown.find("li[data-key='"+key+"']").unbind("mousedown.temp")})}dropDown.data("isAnimating",true);dropDown.toggle(200,function(){if(dropDown.is(":visible")===true){if(element){element.addClass(self.css.columnMovingIndicatorSelected);element.attr("data-indicator-selected","true")}}else{if(element){element.removeClass(self.css.columnMovingIndicatorSelected);element.removeAttr("data-indicator-selected")}}dropDown.data("isAnimating",false)})},_renderSubmenuFC:function(columnKey,$submenu){var $ul,moveColumns,moveLeft,moveRight,moveFirst,moveLast;$ul=$('<ul class="'+this.css.featureChooserSubmenu+'"></ul>').appendTo($submenu);moveColumns={name:"ColumnMovingDialog",text:this._getLocaleValue("movingDialogDisplayText"),iconClass:this.css.featureChooserMovingDialogIcon,method:this._openMovingDialogHandler};moveLeft={name:"Left",text:this._getLocaleValue("dropDownMoveLeftText"),iconClass:this.css.featureChooserLeftIcon,method:$.proxy(this._moveLeft,this)};moveRight={name:"Right",text:this._getLocaleValue("dropDownMoveRightText"),iconClass:this.css.featureChooserRightIcon,method:$.proxy(this._moveRight,this)};moveFirst={name:"First",text:this._getLocaleValue("dropDownMoveFirstText"),iconClass:this.css.featureChooserFirstIcon,method:$.proxy(this._moveFirst,this)};moveLast={name:"Last",text:this._getLocaleValue("dropDownMoveLastText"),iconClass:this.css.featureChooserLastIcon,method:$.proxy(this._moveLast,this)};this._renderSubmenuFCItem(moveColumns,$ul,columnKey,$submenu);this._renderSubmenuFCItem(moveFirst,$ul,columnKey,$submenu);this._renderSubmenuFCItem(moveLeft,$ul,columnKey,$submenu);this._renderSubmenuFCItem(moveRight,$ul,columnKey,$submenu);this._renderSubmenuFCItem(moveLast,$ul,columnKey,$submenu)},_renderSubmenuFCItem:function(obj,$ul,columnKey,$submenu){var $li,text=obj.text,html,fnBlur,$next,css=this.css,id=this.grid.id()+"_featurechooser_dd_li_"+columnKey+"_"+obj.name,method=obj.method;fnBlur=function($e){$e.blur()};html='<li tabindex="0" data-fc-item="1" class="'+this.css.featureChooserSubmenuItem+'" id="'+id+'" title="'+text+'">'+text+"</li>";$li=$(html).appendTo($ul);$li.bind({keydown:function(event){var keyCode=event.keyCode;switch(keyCode){case $.ui.keyCode.ENTER:case $.ui.keyCode.SPACE:method(event,columnKey);fnBlur($(event.target));break;case $.ui.keyCode.DOWN:$next=$li.next();if($next.length===0){$ul.find("li:first").focus()}else{$next.focus()}break;case $.ui.keyCode.UP:$li.prev().focus();if($li.prev().length===0){$("#"+$submenu.data("buttonId")).focus()}break;case $.ui.keyCode.ESCAPE:fnBlur($(event.target));break}},mousedown:function(e){method(e,columnKey);fnBlur($(e.target));e.preventDefault()},mouseover:function(){$(this).addClass(css.featureChooserSubmenuItemMouserOver)},mouseleave:function(){$(this).removeClass(css.featureChooserSubmenuItemMouserOver)}})},_addMoveButtonsInFeatureChooser:function(fc,key){fc._renderInFeatureChooser(key,{name:"ColumnMovingDropDown",text:this._getLocaleValue("featureChooserSubmenuText"),iconClass:"ui-iggrid-featurechooser-li-iconcontainer ui-icon ui-iggrid-icon-move",methodRenderSubmenu:$.proxy(this._renderSubmenuFC,this),order:1,groupName:"dropdown",groupOrder:4,type:"dropdown",state:"hide"})},_moveColumn:function(column,target,after,inDom,fromApi,callback){var noCancel=true,args;if(fromApi===false){args={columnKey:this._cKey,columnIndex:this._cIdx,targetIndex:this._tIdx,owner:this};noCancel=this._trigger(this.events.columnMoving,null,args)}if(noCancel){this._movingDirty=true;this.grid.moveColumn(column,target,after,inDom,callback);if(fromApi===false){delete args.columnIndex;delete args.targetIndex;args.oldIndex=this._cIdx;args.newIndex=this._tIdx;this._triggerColumnMovedAsync(args)}return true}return false},_moveColumnOverwrite:function(column,target,after,inDom,callback){var mp,fixing,isgh,i,hcPreserve;this._oldColsSave=this.grid._oldCols?$.extend(true,[],this.grid._oldCols):null;this._colsSave=this.grid.options.columns?$.extend(true,[],this.grid.options.columns):null;mp=this._gridMoveColumn.apply(this.grid,[column,target,after,inDom,callback]);if(mp){this.grid._oldCols=this._oldColsSave;if(this.grid._oldCols){hcPreserve=$.extend(true,{},this.grid._hiddenColumns);this.grid._generateColumnFlatStructure(this.grid._oldCols);this.grid._hiddenColumns=hcPreserve;this.grid._preserveColspans(this.grid._oldCols)}else{this.grid.options.columns=this._colsSave}fixing=this.grid.element.data("igGridColumnFixing");isgh=!!this.grid._getMultiHeaderColumnById(mp.column);this.grid._columnMovingResets();if(mp.columnFixed){fixing._unfixColumnInternal(mp.column,mp.target,mp.after)}if(mp.targetFixed){fixing._fixColumnInternal(mp.column,mp.target,mp.after)}this.grid._fixedColumns=[];for(i=0;i<this.grid.options.columns.length;i++){if(this.grid.options.columns[i].fixed&&!this.grid.options.columns[i].hidden){this.grid._fixedColumns.push(this.grid.options.columns[i])}}this._updateLayout();if(callback){$.ig.util.invokeCallback(callback,[this.grid.options.columns])}}},_getAllSiblings:function(col){var fixing=this.grid.hasFixedColumns(),fixingDir=this.grid.fixingDirection(),sib=this._cache.siblings[col],fsib=fixing?this._cache.fixedSiblings[col]:null;if(fixing&&fsib&&fsib.length>0){if(fixingDir==="left"){return fsib.concat(sib)}return sib.concat(fsib)}return sib},_fixingFilter:function(cols,fixed){if(fixed){return $.grep(cols,$.proxy(this._isColFixed,this))}return $.grep(cols,$.proxy(this._isColUnfixed,this))},_isColFixed:function(col){return col.fixed},_isColUnfixed:function(col){return!col.fixed},_thRendered:function(th){var cid=this._getIdOfTh(th),cix=this.grid.getVisibleIndexByKey(cid,false);if(this._isColumnMovable(cid,cix)===true){this._markForMoving(th);if(this.options.addMovingDropdown===true){this._renderFeatureChooser(cid,th)}}},_thsRendered:function(){if(this.options.mode==="deferred"){this._renderHelpers()}if(this.options.addMovingDropdown===true){if(!this._movingDialog||this._movingDialog instanceof $&&this._movingDialog.length===0){this._renderMovingDialog()}if($("div[data-moving-inddropdown='"+this.grid.id()+"']").length===0){this._renderDropDown()}}},_thPicked:function(th,id){this._cKey=id;this._cIdx=th.index();this._currentlyDraggedFixed=this.grid._isFixedElement(th);this._updateLayout();if(this.options.mode==="immediate"){if(this.options.hideHeaderContentsDuringDrag===true){th.children().not("div[data-hiddencolindicator]").hide()}this._oTh=th}},_thDragedDeferred:function(helper,pos,left){var movingOpts=this._moArrays[this._cKey],mo,targetLeft,targetPosition,scrollLeft=0,dragX,i;if(this._hscroller.length>0){scrollLeft=this._hscroller.scrollLeft();
}dragX=left===true?pos.left:pos.left+helper.width();dragX+=this._getAbsoluteScroll(this.grid.headersTable());if(!this._gridReady()||this._movingDirty){return}for(i=0;i<movingOpts.length;i++){mo=movingOpts[i];if(this._movingOptionNotVisible(mo)){continue}targetLeft=mo.position;if(dragX>targetLeft-this.options.movingAcceptanceTolerance&&dragX<targetLeft+this.options.movingAcceptanceTolerance){this._activeMO=mo;if(dragX-targetLeft>0){this._tKey=mo.after||mo.before;this._aft=mo.after?false:true;targetPosition=this._cache.columns[this._tKey];this._showIndicators(targetLeft-this._getAbsoluteScroll(this.grid.headersTable()),targetPosition.element.igOffset().top,targetPosition.dimensions,mo.fixing?"right":null)}else{this._tKey=mo.before||mo.after;this._aft=mo.before?true:false;targetPosition=this._cache.columns[this._tKey];this._showIndicators(targetLeft-this._getAbsoluteScroll(this.grid.headersTable()),targetPosition.element.igOffset().top,targetPosition.dimensions,mo.fixing?"left":null)}break}}if(this._hscroller.length>0){this._checkScroll(scrollLeft,dragX,left)}return false},_thDragged:function(helper,pos,left){var movingOpts=this._moArrays[this._cKey],mo,targetLeft,scrollLeft=0,dragX,i,after,updateEvent=false;if(this._hscroller.length>0){scrollLeft=this._hscroller.scrollLeft()}dragX=left===true?pos.left:pos.left+helper.width();if(!this._gridReady()||this._movingDirty){return}for(i=0;i<movingOpts.length;i++){mo=movingOpts[i];targetLeft=!mo.scrollAdded?mo.position:mo.position-this._hscroller.scrollLeft();if(dragX>targetLeft-this.options.movingAcceptanceTolerance&&dragX<targetLeft+this.options.movingAcceptanceTolerance){this._activeMO=mo;after=dragX-targetLeft<=0&&mo.before!==null;if(!mo.fixing&&(mo.after===this._cKey&&after||mo.before===this._cKey&&!after)){continue}this._tKey=after?mo.before:mo.after;if(this._cKey!==this._tKey&&this._cKey!==this._activeMO.after||this._activeMO.fixing===true&&this._tKey!==this._cKey){if(mo.fixing&&(mo.after===this._cKey||mo.before===this._cKey)){if(Math.abs(dragX-targetLeft)<this._cache.columns[this._tKey].dimensions.width/3){continue}}if(this._cKey&&this._tKey){this._tIdx=this.grid.getVisibleIndexByKey(this._tKey);this._moveColumn(this._cKey,this._tKey,after,true,false)}updateEvent=true;break}}}if(this._hscroller.length>0){this._checkScroll(scrollLeft,dragX+this._getAbsoluteScroll(this.grid.headersTable()),left)}return updateEvent},_thDropped:function(){if(this.options.mode==="immediate"){if(this.options.hideHeaderContentsDuringDrag===true){this._oTh.children().show()}this._scroller.on=false;return}this._hideIndicators();if(this._activeMO&&(this._cKey!==this._tKey&&this._cKey!==this._activeMO.after||this._activeMO.fixing===true&&this._tKey!==this._cKey)){this._moveColumn(this._cKey,this._tKey,this._aft,this.options.moveType==="dom",false)}delete this._cKey;delete this._tKey;delete this._aft;delete this._activeMO;$(".ui-draggable-dragging").hide();this._scroller.on=false},_isColumnMovable:function(col,idx){var i,cs;for(i=0;i<this.options.columnSettings.length;i++){cs=this.options.columnSettings[i];if(cs.columnIndex!==undefined&&cs.columnIndex!==null&&cs.columnIndex===idx){return cs.allowMoving}if(cs.columnKey){if(col===cs.columnKey){return cs.allowMoving}}}return true},_isColumnGroupable:function(col){var gbColumnSetting=this._groupBy._getColumnSettingByKey(this._getIdOfTh(col));return gbColumnSetting&&gbColumnSetting.allowGrouping},_getIdOfTh:function(th){var mchid=th.attr("data-mch-id");if(mchid){return mchid}return th.attr("id").replace(this.grid.id()+"_","")},_getThById:function(id){return $("th[data-mch-id='"+id+"'],th[id='"+this.grid.id()+"_"+id+"']")},_adjustIndicators:function(delta,fromParent){var newl=parseInt(this._cmib.css("left"),10)-delta,fhr,fhrt;this._cmib.css("left",newl);this._cmit.css("left",newl);if(fromParent){fhr=this.grid.headersTable().find("tr").first();fhrt=fhr.igOffset().top;this._cmib.css("top",fhrt-16-$.ig.util.getRelativeOffset(this._cmib).top);this._cmit.css("top",fhrt+fhr.height()-$.ig.util.getRelativeOffset(this._cmit).top)}},_showIndicators:function(left,top,dim,tilt){if(tilt==="left"){this._cmib.removeClass(this.css.dragIndicatorRight).addClass(this.css.dragIndicatorLeft);this._cmit.removeClass(this.css.dragIndicatorRight).addClass(this.css.dragIndicatorLeft);this._cmit.css("left",left-12-$.ig.util.getRelativeOffset(this._cmib).left).show();this._cmit.css("top",top-14-$.ig.util.getRelativeOffset(this._cmib).top);this._cmib.css("left",left-12-$.ig.util.getRelativeOffset(this._cmit).left).show();this._cmib.css("top",top+dim.height-2-$.ig.util.getRelativeOffset(this._cmit).top)}else if(tilt==="right"){this._cmib.removeClass(this.css.dragIndicatorLeft).addClass(this.css.dragIndicatorRight);this._cmit.removeClass(this.css.dragIndicatorLeft).addClass(this.css.dragIndicatorRight);this._cmit.css("left",left-4-$.ig.util.getRelativeOffset(this._cmib).left).show();this._cmit.css("top",top-14-$.ig.util.getRelativeOffset(this._cmib).top);this._cmib.css("left",left-4-$.ig.util.getRelativeOffset(this._cmit).left).show();this._cmib.css("top",top+dim.height-2-$.ig.util.getRelativeOffset(this._cmit).top)}else{this._cmib.removeClass(this.css.dragIndicatorRight).removeClass(this.css.dragIndicatorLeft);this._cmit.removeClass(this.css.dragIndicatorRight).removeClass(this.css.dragIndicatorLeft);this._cmit.css("left",left-8-$.ig.util.getRelativeOffset(this._cmib).left).show();this._cmit.css("top",top-16-$.ig.util.getRelativeOffset(this._cmib).top);this._cmib.css("left",left-8-$.ig.util.getRelativeOffset(this._cmit).left).show();this._cmib.css("top",top+dim.height-$.ig.util.getRelativeOffset(this._cmit).top)}},_hideIndicators:function(){this._cmib.hide();this._cmit.hide()},_markForMoving:function(col){if(col.data("draggable")||this._groupBy){if(this._isColumnGroupable(col)){col.bind("drag",this._moveHandler);col.bind("dragstop",this._dropHandler);col.bind("dragstart",this._dragHandler);return}col.attr("groupby-disabled","true")}col.draggable({containment:this.grid._rootContainer(),appendTo:this.grid.container(),distance:5,scroll:false,revert:"valid",helper:function(event){var th,clone;th=$(event.target).closest("th");clone=th.clone().css("overflow","hidden").css("z-index",1e4).width(th.width()).height(th.height()).attr("data-mch-id",null).attr("id",null).addClass("ui-widget ui-iggrid").wrap($('<div class="ui-iggrid-dragMarkup"></div>').width(th.outerWidth()).height(th.outerHeight())).parent();clone.find("div[data-hiddencolindicator]").remove();return clone},opacity:this.options.dragHelperOpacity,drag:this._moveHandler,stop:this._dropHandler,start:this._dragHandler});col.unbind("mouseover.moving").bind("mouseover.moving",this._headerMouseOverHandler);col.unbind("mouseout.moving").bind("mouseout.moving",this._headerMouseOutHandler)},_updateLayout:function(){var cols,self=this;if(!this._gridReady()){setTimeout(function(){self._updateLayout()},50);return}if(this.grid._oldCols){cols=$.grep(this.grid._oldCols,$.proxy(this.grid._columnVisible,this))}else{cols=this.grid._visibleColumns()}this._hscroller=this.grid._hscrollbarcontent();this._hscroller=this._hscroller.length>0?this._hscroller:this.grid.scrollContainer();this._cache.columns={};this._cache.siblings={};this._cache.fixedSiblings={};this._updateLayoutPerLevel(cols,true);this._createMovingOptions();delete this._movingDirty},_updateLayoutPerLevel:function(cols,firstLevel){var i,id,$th,os;for(i=0;i<cols.length;i++){id=cols[i].key||cols[i].identifier;$th=this._getThById(id);os=$th.igOffset();if(!os||$.type(os.left)!=="number"){os={left:0,top:0}}os.left=os.left+this._getAbsoluteScroll($th);this._cache.columns[id]={};this._cache.columns[id].element=$th;this._cache.columns[id].offset=os;this._cache.columns[id].dimensions={width:$th.outerWidth(),height:$th.outerHeight()};this._cache.columns[id].isFixed=!!cols[i].fixed;if(firstLevel){this._cache.fixedSiblings[id]=this._fixingFilter(cols,true);this._cache.siblings[id]=this._fixingFilter(cols,false)}else{this._cache.siblings[id]=cols}}for(i=0;i<cols.length;i++){if(cols[i].group&&cols[i].hidden!==true){this._updateLayoutPerLevel($.grep(cols[i].group,$.proxy(this.grid._columnVisible,this)))}}},_createMovingOptions:function(){var col,us=this._cache.siblings,fs=this._cache.fixedSiblings,fixingDir=this.grid.fixingDirection(),umo,fmo,mo;this._moArrays={};for(col in us){if(us.hasOwnProperty(col)){umo=this._movingOptsForSiblings(us[col]);if(fs.hasOwnProperty(col)){fmo=this._movingOptsForSiblings(fs[col])}else{fmo=[]}if(umo.length&&fmo.length){mo=this._combineMovingOptions(umo,fmo,fixingDir)}else if(umo.length){mo=umo}this._moArrays[col]=mo}}for(col in fs){if(fs.hasOwnProperty(col)&&!this._moArrays[col]){fmo=this._movingOptsForSiblings(fs[col]);this._moArrays[col]=fmo}}},_movingOptsForSiblings:function(siblings){var mo=[],pkey,ckey,i,cols=this._cache.columns;if(siblings&&siblings.length){pkey=siblings[0].key||siblings[0].identifier;mo.push({before:null,after:pkey,position:this._cache.columns[pkey].offset.left,fixing:false,scrollAdded:!cols[pkey].isFixed});for(i=1;i<siblings.length;i++){ckey=siblings[i].key||siblings[i].identifier;mo.push({before:pkey,after:ckey,position:this._cache.columns[ckey].offset.left,fixing:false,scrollAdded:!(cols[pkey].isFixed&&cols[ckey].isFixed)});pkey=ckey}mo.push({before:pkey,after:null,position:this._cache.columns[pkey].offset.left+this._cache.columns[pkey].dimensions.width,fixing:false,scrollAdded:!cols[pkey].isFixed})}return mo},_combineMovingOptions:function(umo,fmo,fixingDir){var combined,left,right;if(fixingDir==="left"){left=fmo;right=umo}else{left=umo;right=fmo}combined=left.slice(0,left.length-1);combined.push({before:left[left.length-1].before,after:right[0].after,position:right[0].position,fixing:true});combined=combined.concat(right.slice(1,right.length));return combined},_getAbsoluteScroll:function(el){var cel=el,abs=0;while(cel.length>0&&cel.attr("id")!==this.grid._rootContainer().attr("id")){abs+=cel.scrollLeft();cel=cel.parent()}return abs},_openMovingDialog:function(){this._movingDialog[this.options.dialogWidget]("openModalDialog")},_closeMovingDialog:function(e){this._movingDialog[this.options.dialogWidget]("closeModalDialog",null,e);if(e){e.preventDefault()}},_triggerColumnMovedAsync:function(args){var self=this;if(!this._gridReady()){setTimeout(function(){self._triggerColumnMovedAsync(args)},50);return}this._trigger(this.events.columnMoved,null,args)},_gridReady:function(){return!(this.grid._loadingIndicator&&this.grid._loadingIndicator._indicator.is(":visible"))},_bindUpDownDialogButtons:function(list){list.find("span[class='"+this.css.movingDialogListItemArrowDown+"']").unbind("mousedown",this._dialogDownHandler).bind("mousedown",this._dialogDownHandler);list.find("span[class='"+this.css.movingDialogListItemArrowUp+"']").unbind("mousedown",this._dialogUpHandler).bind("mousedown",this._dialogUpHandler)},_checkScroll:function(scrollLeft,dragX,left){var sbw=this._verticalScrollBarWidth();if(this._currentlyDraggedFixed){return}dragX-=this._hscroller.igOffset().left;if(scrollLeft>0&&left===true&&Math.abs(dragX-scrollLeft)<this.options.movingScrollTolerance){this._updateScroller(true,dragX-scrollLeft+1)}else if(scrollLeft<this._hscroller[0].scrollWidth+sbw-this._hscroller.outerWidth()&&left===false&&dragX-scrollLeft>this._hscroller.outerWidth()-this.options.movingScrollTolerance&&dragX-scrollLeft<this._hscroller.outerWidth()+this.options.movingScrollTolerance){this._updateScroller(false,this._hscroller.outerWidth()-dragX+scrollLeft)}else{this._stopScroller()}},_startScroller:function(left,delta){this._scroller.on=true;this._scroller.delay=delta*this.options.scrollSpeedMultiplier;this._scroller.direction=left===true?"left":"right";this._autoScroll()},_updateScroller:function(left,delta){if(this._scroller.on===false){this._startScroller(left,delta);return}this._scroller.delay=delta},_stopScroller:function(){this._scroller.on=false},_scrollGrid:function(){var sl=this._hscroller.scrollLeft(),delta,res,sbw;delta=this._scroller.direction==="left"?this.options.scrollDelta*-1:this.options.scrollDelta;res=sl+delta;sbw=this._verticalScrollBarWidth();this._hscroller.scrollLeft(res);if(res<=0&&delta<0||res>=this._hscroller[0].scrollWidth+sbw-this._hscroller.outerWidth()&&delta>0){this._stopScroller()}if(this._hscroller[0].id.indexOf("_hscroller")>0){this.grid._synchronizeHScroll()}if(this.options.mode==="deferred"){if(this._activeMO&&this._movingOptionNotVisible(this._activeMO)){this._hideIndicators()}else{this._adjustIndicators(delta)}}if(this._scroller.on===true){setTimeout(this._autoScroll,this._scroller.delay)}},_cancelEvent:function(e){e.stopPropagation();e.preventDefault()},_columnMap:function(){return $.map(this.grid.options.columns,function(col){return{columnKey:col.key,enabled:true}})},_movingOptionNotVisible:function(mo){var fdir,sAdjLeft,fbodyL,fbodyW,sl,scW,scL;if(!this.grid.hasFixedColumns()||this.grid.isFixedColumn(mo.before)||this.grid.isFixedColumn(mo.after)||!this._hscroller.is(":visible")){return false}fdir=this.grid.fixingDirection();sl=this._hscroller.scrollLeft();sAdjLeft=mo.position-sl;fbodyL=this.grid.fixedBodyContainer().igOffset().left;fbodyW=this.grid.fixedBodyContainer().outerWidth();scL=this._hscroller.igOffset().left;scW=this._hscroller.outerWidth();return fdir==="left"&&(sAdjLeft-fbodyL<fbodyW||sAdjLeft>scW+scL)||fdir==="right"&&(sAdjLeft<scL||sAdjLeft-scL>scW)},_verticalScrollBarWidth:function(){return this.grid._hasVerticalScrollbar===true?this.grid._scrollbarWidth():0},_checkForColumnVirtualization:function(){return this.grid.options.virtualizationMode!=="continuous"&&(this.grid.options.virtualization===true&&this.grid.options.width||this.grid.options.columnVirtualization===true)},_removeMoving:function(){var ths=this.grid.headersTable().find(">thead th"),i,th,mdl,removeContainer,fc;if(this._cmit&&this._cmit.length>0){if(this._cmit.data("users")===1){this._cmit.remove()}else{this._cmit.data("users",this._cmit.data("users")-1)}}if(this._cmib&&this._cmib.length>0){if(this._cmib.data("users")===1){this._cmib.remove()}else{this._cmib.data("users",this._cmib.data("users")-1)}}if(this.options.addMovingDropdown===true){mdl=this._movingDialog;if(mdl&&mdl instanceof $&&mdl.data()[this.options.dialogWidget]){mdl[this.options.dialogWidget]("destroy");mdl.remove()}$("div[data-moving-inddropdown='"+this.grid.id()+"']").remove()}fc=this.grid.element.data("igGridFeatureChooser");removeContainer=true;if(this.renderInFeatureChooser&&fc){fc._removeFeature("ColumnMovingDropDown",true);removeContainer=false}for(i=0;i<ths.length;++i){th=$(ths[i]);if(removeContainer){th.find(">div").find("span").unbind("mousedown",this._dropDownButtonHandler);th.find(">div").remove()}th.unbind("mouseover.moving",this._headerMouseOverHandler);th.unbind("mouseout.moving",this._headerMouseOutHandler);if(!this._grpByEnabled){if(th.data&&th.data("draggable")){th.draggable("destroy")}}else{th.unbind("draggabledrag",this._moveHandler);th.unbind("draggablestop",this._dropHandler);th.unbind("draggablestart",this._dragHandler)}}},_unregisterEvents:function(){this.grid.element.unbind("iggridheadercellrendered",this._headerCellRenderedHandler);this.grid.element.unbind("iggridheaderrendering",this._headerRenderingHandler);this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.unbind("iggridrendered",this._gridFullyRenderedHandler);this.grid.element.unbind("iggridresizingcolumnresized",this._columnStateChanged);this.grid.element.unbind("iggridcolumnscollectionmodified",this._columnStateChanged);this.grid.element.unbind("iggridpagingpagingdropdownrendered",this._columnStateChanged);this.grid.element.unbind("iggrid_columnsmoved",this._columnStateChanged);this.grid.headersTable().find("th").unbind("moving")},_registerEvents:function(){this.grid.element.bind("iggridheadercellrendered",this._headerCellRenderedHandler);this.grid.element.bind("iggridheaderrendering",this._headerRenderingHandler);this.grid.element.bind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.bind("iggridrendered",this._gridFullyRenderedHandler);this.grid.element.bind("iggridresizingcolumnresized",this._columnStateChanged);this.grid.element.bind("iggridcolumnscollectionmodified",this._columnStateChanged);this.grid.element.bind("iggridpagingpagingdropdownrendered",this._columnStateChanged);this.grid.element.bind("iggrid_columnsmoved",this._columnStateChanged)},_createHandlers:function(){this._headerCellRenderedHandler=$.proxy(this._headerCellRendered,this);this._headerRenderingHandler=$.proxy(this._headerRendering,this);this._headerRenderedHandler=$.proxy(this._headerRendered,this);this._gridFullyRenderedHandler=$.proxy(this._gridFullyRendered,this);this._dragHandler=$.proxy(this._headerPicked,this);this._moveHandler=$.proxy(this._headerDragged,this);this._dropHandler=$.proxy(this._headerDropped,this);this._headerMouseOverHandler=$.proxy(this._headerMouseOver,this);this._headerMouseOutHandler=$.proxy(this._headerMouseOut,this);this._dropDownButtonHandler=$.proxy(this._dropDownMouseDown,this);this._dropDownKeyHandler=$.proxy(this._dropDownKeyDown,this);this._openMovingDialogHandler=$.proxy(this._openMovingDialog,this);this._dropDownButtonMouseOverHandler=$.proxy(this._dropDownButtonMouseOver,this);this._dropDownButtonMouseOutHandler=$.proxy(this._dropDownButtonMouseOut,this);this._dialogOpeningHandler=$.proxy(this._dialogOpening,this);this._dialogDraggedHandler=$.proxy(this._dialogDragged,this);this._dialogClosingHandler=$.proxy(this._dialogClosing,this);this._dialogClosedHandler=$.proxy(this._dialogClosed,this);this._dialogCloseButtonHandler=$.proxy(this._closeMovingDialog,this);this._dialogUpHandler=$.proxy(this._dialogUpPressed,this);this._dialogDownHandler=$.proxy(this._dialogDownPressed,this);this._dialogRearrangingHandler=$.proxy(this._dialogRearranging,this);this._dialogRearrangedHandler=$.proxy(this._dialogRearranged,this);this._columnStateChanged=$.proxy(this._updateLayout,this);this._cancelEventHandler=$.proxy(this._cancelEvent,this);this._autoScroll=$.proxy(this._scrollGrid,this);this._containerScrolledHandler=$.proxy(this._containerScrolled,this)},_injectGrid:function(gridInstance,isRebind){this.grid=gridInstance;if(isRebind===true){return}if(this.grid.element.igGridFeatureChooser!==undefined){this.grid.element.igGridFeatureChooser()}else{throw new Error(this._getLocaleValue("featureChooserNotReferenced"))}if(this._checkForColumnVirtualization()){throw new Error(this._getLocaleValue("columnVirtualizationEnabled"))}this._gridMoveColumn=this.grid.moveColumn;this.grid.moveColumn=$.proxy(this._moveColumnOverwrite,this);this._createHandlers();this._unregisterEvents();this._registerEvents()}});$.extend($.ui.igGridColumnMoving,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI Grid Feature Chooser 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	jquery.ui.mouse.js
 *	jquery.ui.draggable.js
 *	jquery.ui.resizable.js
 *	infragistics.ui.popover.js
 *	infragistics.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.grid.shared.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 */
(function($){$.widget("ui.igGridFeatureChooserPopover",$.ui.igPopover,{options:{gridId:"",targetButton:null,closeOnBlur:true,containment:null},_create:function(){$.extend($.ui.igGridFeatureChooserPopover.prototype.options,$.ui.igPopover.prototype.options);$.extend($.ui.igGridFeatureChooserPopover.prototype.css,$.ui.igPopover.prototype.css);$.ui.igPopover.prototype._create.apply(this)},isShown:function(){return this.container().is(":visible")},_setFCElementFocus:function(focus,$target){if($target===undefined||$target===null){$target=this.options.targetButton}this.options.targetButton.data("onFocus",focus);if(focus){$target.focus()}},registerElements:function(elements){var events,$targetButton=this.options.targetButton,self=this;events={focus:function(){$targetButton.data("onFocus",true)},blur:function(){$targetButton.data("onFocus",false);if(self._timeoutId){clearTimeout(self._timeoutId)}self._timeoutId=setTimeout(function(){if(!$targetButton.data("onFocus")&&self.isShown()){self._closePopover()}},1)}};elements.bind(events)},_createWidget:function(){var self=this,$targetButton;this._attachedToBody=true;this.options.content="";$.Widget.prototype._createWidget.apply(this,arguments);$.ui.igPopover.prototype._createWidget.apply(this,arguments);this._detachEventsFromTarget();$targetButton=this.options.targetButton;if(this.options.closeOnBlur){$targetButton.attr("tabindex","0");this._eventsFC={iggridfeaturechooserpopovershown:function(){self._setFCElementFocus(true)},iggridfeaturechooserpopoverhidden:function(){self._setFCElementFocus(false);self.popover.width("");self.popover.css({left:""})},mousedown:function(){setTimeout(function(){self._setFCElementFocus(true)},1)},touchstart:function(){setTimeout(function(){self._setFCElementFocus(true)},1)}};this.element.bind(this._eventsFC);this.registerElements($targetButton)}},_removeOriginalTitle:function(){},_positionPopover:function(){var $popover,availableWidth,mw=this.options.maxWidth,$containment=this.options.containment,$window=$(window);if(mw&&$.type(mw)==="string"){mw=parseInt(mw,10)}$popover=this.popover;if($popover){if($containment.igOffset().left>=$window.scrollLeft()){availableWidth=$window.width()+$window.scrollLeft()-$containment.igOffset().left}else{availableWidth=$window.width()}if(mw&&$.type(mw)==="number"&&mw<availableWidth){availableWidth=mw}this.popover.css("max-width",availableWidth)}$.ui.igPopover.prototype._positionPopover.apply(this,arguments)},destroy:function(){var $targetButton;if(this._eventsFCTargetButton){$targetButton=this.options.targetButton;$targetButton.unbind(this._eventsFCTargetButton)}if(this._eventsFC){this.element.unbind(this._eventsFC)}$.ui.igPopover.prototype.destroy.apply(this,arguments)}});$.extend($.ui.igGridFeatureChooserPopover,{version:"21.2.12"});$.ig=$.ig||{};$.ig.GridFeatureChooserSections=$.ig.GridFeatureChooserSections||{click:"click",toggle:"toggle",modalDialog:"modalDialog"};$.widget("ui.igGridFeatureChooser",$.ui.igWidget,{css:{featureChooserDropDown:"",headerButtonIcon:"ui-iggrid-featurechooserbutton ui-icon ui-icon-gear",headerButtonIconMouseOver:"ui-iggrid-header-icon-mouseover",headerButtonIconSelected:"ui-iggrid-header-icon-selected",listClass:"ui-iggrid-featurechooser-list ui-menu ui-widget ui-widget-content ui-corner-all",listItemClass:"ui-iggrid-featurechooserddlistitemicons ui-state-default",listItemContainer:"ui-iggrid-featurechooser-li-container",listItemIconContainer:"ui-iggrid-featurechooser-li-iconcontainer",itemSecondaryIconContainer:"ui-iggrid-featurechooser-secondaryicon-container",separator:"ui-iggrid-featurechooser-separator",listItemText:"ui-iggrid-featurechooserddlistitemtext",itemSelected:"item-selected",dropDownListItemHover:"ui-iggrid-featurechooser-listitem-hover ui-state-active ui-state-hover",dropDownButtonClasses:"ui-igbutton",dropDownButtonHoverClasses:"",dropDownButtonActiveClasses:"",dropDownButtonFocusClasses:"",dropDownButtonLabelClass:"",containerDelimiter:"ui-iggrid-featurechooser-container-delimiter",containerSection:"ui-iggrid-featurechooser-container-section",itemNoIcon:"ui-iggrid-featurechooserbutton ui-icon ui-icon-close",submenu:"ui-iggrid-featurechooser-submenu ui-widget-content ui-corner-all",submenuIcon:"ui-iggrid-featurechooser-submenuicon ui-icon ui-icon-triangle-1-s"},options:{dropDownWidth:null,animationDuration:400},events:{featureChooserRendering:"featureChooserRendering",featureChooserRendered:"featureChooserRendered",featureChooserDropDownOpening:"featureChooserDropDownOpening",featureChooserDropDownOpened:"featureChooserDropDownOpened",menuToggling:"menuToggling",featureToggling:"featureToggling",featureToggled:"featureToggled"},_createWidget:function(){$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){var i;this.analyzedData={};this.data={};this._features=[];this._isFeaturesAnalyzed=false;this.isInitialized=false;this.grid=this.element.data("igGrid");this.gridId=this.element[0].id;this.grid._internalFeatures=this.grid._internalFeatures||[];for(i=0;i<this.grid._internalFeatures.length;i++){if(this.grid._internalFeatures[i].name==="FeatureChooser"){break}}if(i===this.grid._internalFeatures.length){this.grid._internalFeatures.push({name:"FeatureChooser"})}this._analyzeGridFeaturesOptions();this._countRenderedFeatures=0;if(this._headerRenderedHandler){this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler)}this._headerRenderedHandler=$.proxy(this._headerRendered,this);this.grid.element.bind("iggridheaderrendered",this._headerRenderedHandler);if(this._gridDestroyedHandler){this.grid.element.unbind("igcontroldestroyed",this._gridDestroyedHandler)}this._gridDestroyedHandler=$.proxy(this.destroy,this);this.grid.element.bind("igcontroldestroyed",this._gridDestroyedHandler);if(this._virtualHorizontalScrollHandler){this.grid.element.unbind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler)}this._virtualHorizontalScrollHandler=$.proxy(this._virtualHorizontalScroll,this);this.grid.element.bind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler)},_analyzeGridFeaturesOptions:function(){var i,features=this.grid.options.features,featuresLength=features.length;for(i=0;i<featuresLength;i++){this._features.push(features[i].name)}},shouldShowFeatureIcon:function(key){if(this.analyzedData[key]!==undefined&&this.analyzedData[key]!==null){return this.analyzedData[key].length<=1}return true},changeLocale:function(){var self=this;this.grid.container().find("[data-fc-button]").each(function(){self._changeLocaleForElement($(this))});this._renderFCForAllColumns()},_registerWidget:$.noop,_unregisterWidget:$.noop,_setOption:function(){this._superApply(arguments)},_id:function(name,suffix){var res=this.gridId+"_"+name;if(suffix!==undefined&&suffix!==null&&$.type(suffix)==="string"){res+="_"+suffix}return res},_isMetroIE:function(){return!$.ig.util.isIEOld&&$.ig.util.isIE&&(window.hasOwnProperty("ontouchstart")||navigator.MaxTouchPoints>0||navigator.msMaxTouchPoints>0)},_isTouchDevice:function(){var fcIconDisplay;if(this._isTouch===undefined){fcIconDisplay=this.grid.options.featureChooserIconDisplay;if(fcIconDisplay==="none"){this._isTouch=true}else if(fcIconDisplay==="always"){this._isTouch=false}else{this._isTouch=$.ig.util.isTouch||this._isMetroIE()}}return this._isTouch},_callFeatureMethod:function(feature,isSelected,columnKey,event){var method,returnType=true,methodType=$.type(feature.method),featureData=this.grid.element.data("igGrid"+feature.name);if(methodType==="string"){if(featureData===undefined||featureData===null){return false}method=featureData[feature.method]}else if(methodType==="function"){method=feature.method}if(method===undefined||method===null){return false}if($.type(feature.method)==="string"){returnType=featureData[feature.method](event,columnKey,isSelected,feature.methodData)}else{returnType=feature.method(event,columnKey,isSelected,feature.methodData)}return returnType},_getFeatureByKeyName:function(columnKey,featureName){var i,feature=null,columnData=this.data[columnKey],columnDataLength;if(!columnData){return feature}columnDataLength=columnData.length;for(i=0;i<columnDataLength;i++){if(columnData[i].name===featureName){feature=columnData[i];break}}return feature},_clickFeature:function(event){var i,j,$target=$(event.target).data("data")!==undefined?$(event.target):$(event.currentTarget),d=$target.data("data"),self=this,isSelected=null,type=d.type,columnKey=d.columnKey,featureName=d.featureName,columnData=this.data[columnKey],columnDataLength=columnData.length,feature=null;feature=this._getFeatureByKeyName(columnKey,featureName);if(feature===null||feature===undefined){return}if(type==="toggle"){isSelected=!feature.isSelected}if(this._trigger(this.events.featureToggling,null,{target:$target,columnKey:columnKey,isToSelect:isSelected,featureName:"igGrid"+feature.name})===false){return}if(this._callFeatureMethod(feature,isSelected,columnKey,event)===false){return}if(type==="toggle"){feature.isSelected=isSelected;self._setSelectedItem(columnKey,isSelected,$("#"+self._id("featurechooser_dd_li_"+columnKey,featureName)));if(feature.updateOnClickAll===true){$.each(self.data,function(index,value){if(index!==columnKey){for(j=0;j<value.length;j++){if(value[j].name===featureName){break}}if(j===value.length){return true}columnData=self.data[index];if(columnData===null||columnData===undefined){return true}columnDataLength=columnData.length;for(i=0;i<columnDataLength;i++){if(columnData[i].name===featureName){columnData[i].isSelected=isSelected;break}}self._setSelectedItem(index,isSelected,$("#"+self._id("featurechooser_dd_li_"+index,value[j].name)))}})}}},_setListItemText:function(columnKey,featureName,text){$("#"+this._id("featurechooser_dd_li_"+columnKey,featureName)+" span.ui-iggrid-featurechooserddlistitemtext").text(text)},_analyzeFeatures:function(){if(this._isFeaturesAnalyzed===true){return}var i,k,cs=this.grid.options.columns,csLength=cs.length,featureName,featuresLength=this._features.length,features=this._features,newFeatures=[],columnsFeature,columnsFeatureLength,featureInstance,columnKey;for(i=0;i<featuresLength;i++){featureName=features[i];featureInstance=this.grid.element.data("igGrid"+featureName);if(featureInstance===undefined||featureInstance===null){continue}if(featureInstance.renderInFeatureChooser!==true){continue}if(featureInstance._columnMap===undefined||featureInstance._columnMap===null){continue}columnsFeature=featureInstance._columnMap();if(columnsFeature===false||columnsFeature===null||columnsFeature===undefined){continue}columnsFeatureLength=columnsFeature.length;if(columnsFeatureLength===0){for(k=0;k<csLength;k++){columnKey=cs[k].key;if(this.analyzedData[columnKey]===undefined||this.analyzedData[columnKey]===null){this.analyzedData[columnKey]=[]}if(this._isFeatureExistByColumnKey(featureName,columnKey)===true){continue}this.analyzedData[columnKey].push({name:featureName,method:null,text:null,iconClass:null,isSelected:false,columnCell:null,isActive:false})}}else{for(k=0;k<columnsFeatureLength;k++){columnKey=columnsFeature[k].columnKey;if(this.analyzedData[columnKey]===undefined||this.analyzedData[columnKey]===null){this.analyzedData[columnKey]=[]}if(columnsFeature[k].enabled!==true||this._isFeatureExistByColumnKey(featureName,columnKey)===true){continue}this.analyzedData[columnKey].push({name:featureName,method:null,text:null,iconClass:null,isSelected:false,columnCell:null,isActive:false})}}newFeatures.push({name:featureName,instance:featureInstance})}this._features=newFeatures;this._isFeaturesAnalyzed=true},_isFeatureExistByColumnKey:function(featureName,columnKey){var aData=this.analyzedData[columnKey],ret=false;if(aData===null||aData===undefined){return true}$.each(aData,function(index,value){if(value.name===featureName){ret=true;return false}});return ret},_shouldRenderInFeatureChooser:function(columnKey){this._analyzeFeatures();if(this.analyzedData[columnKey]!==undefined&&this.analyzedData[columnKey]!==null){return this.analyzedData[columnKey].length>1}return false},_headerRendered:function(sender,args){if(args.owner.element.attr("id")!==this.grid.element.attr("id")){return}if(sender.target.id!==this.grid.element[0].id){return}this._renderFCForAllColumns()},_renderFCForAllColumns:function(){var self=this;$.each(this.data,function(columnKey,elem){self._initFC(columnKey,elem)})},_touchStart:function(e,columnKey){if($(e.target).attr("data-skip-event")){return e}this.toggleDropDown(columnKey);e.preventDefault();e.stopPropagation()},_initFC:function(columnKey,elem){var self=this,thead=this.grid.container().find("thead"),$columnCell,$theadCell,buttonId,cancelFunc,$button,$headerContainer;$columnCell=this.grid.container().find("#"+self.grid.element[0].id+"_"+columnKey);buttonId=self._id("featureChooser_headerButton",columnKey);if(!$columnCell.length){return}$columnCell.find("[ data-fc-button ]").remove();this.grid.container().find("#"+buttonId).remove();cancelFunc=function(e){e.preventDefault();e.stopPropagation()};if(elem.isCancelledRendering!==false&&self._trigger(self.events.featureChooserRendering,null,{owner:self.grid,columnKey:columnKey,columnCell:$columnCell})===false){elem.isCancelledRendering=true;return}elem.isCancelledRendering=false;if(this._isTouchDevice()){$columnCell.bind({click:function(e){self._touchStart(e,columnKey)}})}else{$theadCell=thead.find("#"+self.grid.element[0].id+"_"+columnKey);this.grid._enableHeaderCellFeature($theadCell);$headerContainer=$theadCell.find(".ui-iggrid-indicatorcontainer");if($headerContainer.length===0){$headerContainer=$("<div></div>").appendTo($theadCell).addClass("ui-iggrid-indicatorcontainer")}$button=$("<span></span>").prependTo($headerContainer).addClass(self.css.headerButtonIcon);$button.wrap("<a id='"+buttonId+"' role='button' tabindex='"+self.grid.options.tabIndex+"' data-fc-button='"+columnKey+"' href='#' title='"+this._getLocaleValue("featureChooserTooltip")+"' "+"data-localeattr='title' data-localeid='featureChooserTooltip'"+"></a>");$button.parent().attr("th-remove-focus","").bind({keydown:function(event){var $item,$nextPrevItem,$dialog=$("#"+self._id("featureChooser_dd",columnKey));if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){$item=$dialog.find("ul li.ui-iggrid-featurechooser-listitem-hover");if($dialog.is(":visible")&&$item.length>0){if($item.find("*[ role='button' ]").length){event.target=$item.find("*[ role='button' ]:eq(0)")}else{event.target=$item[0]}self._clickFeature(event)}self.toggleDropDown(columnKey);cancelFunc(event)}else if(event.keyCode===$.ui.keyCode.DOWN||event.keyCode===$.ui.keyCode.UP){if($dialog.is(":visible")){$item=$dialog.find("ul li.ui-iggrid-featurechooser-listitem-hover");if($item.length>1){$.each($item,function(index,value){self._removeCssSelectionListItem($(value))})}$nextPrevItem=event.keyCode===$.ui.keyCode.DOWN?$item.next():$item.prev();if($nextPrevItem.attr("data-fc-separator")){$nextPrevItem=event.keyCode===$.ui.keyCode.DOWN?$nextPrevItem.next():$nextPrevItem.prev()}if($item.length===0){self._addCssSelectionListItem($dialog.find("ul li:eq(0)"))}else if($nextPrevItem.length>0&&$nextPrevItem.is("li")){self._removeCssSelectionListItem($item);self._addCssSelectionListItem($nextPrevItem)}cancelFunc(event)}}},mousedown:function(event){self.toggleDropDown(columnKey);cancelFunc(event)},mouseover:function(){if($button.hasClass(self.css.headerButtonIconSelected)===false){$button.addClass(self.css.headerButtonIconMouseOver)}},mouseout:function(){$button.removeClass(self.css.headerButtonIconMouseOver)},mouseup:cancelFunc,click:cancelFunc});this.grid.container().find("#"+this._id("featureChooser_dd",columnKey)).remove()}self._trigger(self.events.featureChooserRendered,null,{owner:self.grid,columnKey:columnKey,columnCell:$columnCell})},_renderInFeatureChooser:function(columnKey,data){var i,columnData=this.analyzedData[columnKey],columnDataLength;if(columnData===undefined||columnData===null){return}columnDataLength=columnData.length;if(columnData.isCancelledRendering===true){return}for(i=0;i<columnDataLength;i++){if(columnData[i].name.toLowerCase()===data.name.toLowerCase()){this.analyzedData[columnKey][i]=data;break}}if(i===columnDataLength){this.analyzedData[columnKey].push(data)}if(this.data[columnKey]===null||this.data[columnKey]===undefined){this.data[columnKey]=[]}if($.type(this.data[columnKey].order)!=="number"){this.data[columnKey].order=0}for(i=0;i<this.data[columnKey].length;i++){if(this.data[columnKey][i].name===data.name&&data.name!==undefined){return}}this.data[columnKey].push(data)},_renderMenu:function(columnKey){var i,data,self=this,listItems,popoverInstance,$targetButton,$headerCell=$("#"+this.grid.id()+"_"+columnKey),dropDownId=this._id("featureChooser_dd",columnKey),$dropDown=$("#"+dropDownId),rootContainer=this.grid._rootContainer();if($dropDown.length>0){return}$dropDown=$("<div tabindex='0'></div>").attr("id",dropDownId).appendTo(rootContainer);$targetButton=$("#"+this._id("featureChooser_headerButton",columnKey)).find("span");if($targetButton.length===0){$targetButton=$headerCell}$dropDown.igGridFeatureChooserPopover({position:"auto",targetButton:$targetButton,maxWidth:this.grid.container().width(),direction:"bottom",maxHeight:null,containment:rootContainer,appendTo:rootContainer});popoverInstance=$dropDown.data("igGridFeatureChooserPopover");$dropDown.bind("iggridfeaturechooserpopovershown",function(){self._visiblePopover=dropDownId});$dropDown.bind("iggridfeaturechooserpopoverhiding",function(){if(self._activeSubmenuId){$("#"+self._activeSubmenuId).hide();self._activeSubmenuId=null}});data=this.data[columnKey];if(data){for(i=0;i<data.length;i++){this._renderDropDownItem(columnKey,data[i])}listItems=popoverInstance.container().find("li[ data-fc-order ]");$dropDown.igGridFeatureChooserPopover("registerElements",listItems);$targetButton.bind({keydown:function(e){if(e.keyCode===$.ui.keyCode.ESCAPE){popoverInstance._closePopover();e.stopPropagation()}else if(e.keyCode===$.ui.keyCode.TAB&&!e.shiftKey&&popoverInstance.isShown()){popoverInstance.popover.find("li[ data-fc-order ]:first").focus();e.stopPropagation();e.preventDefault()}}});listItems.bind({keydown:function(e){var $elem,keyCode=e.keyCode;switch(keyCode){case $.ui.keyCode.ESCAPE:$targetButton.data("onFocus",false).focus();popoverInstance._closePopover();break;case $.ui.keyCode.TAB:$elem=$(this);if(!e.shiftKey){if($elem.is(":last-child")){$elem.closest("ul").find("li:first-child").focus();e.preventDefault()}}else{if($elem.is(":first-child")){$elem.closest("ul").find("li:last-child").focus();e.preventDefault()}}break;case $.ui.keyCode.RIGHT:$elem=$(this);$elem=$elem.nextAll("li[ data-fc-order ]").eq(0);if($elem.length===0){$elem=$(this).closest("ul").find("li:first-child")}$elem.focus();e.preventDefault();break;case $.ui.keyCode.LEFT:$elem=$(this);$elem=$elem.prevAll("li[ data-fc-order ]").eq(0);if($elem.length===0){$elem=$(this).closest("ul").find("li:last-child")}$elem.focus();e.preventDefault();break}}})}$dropDown.bind({keydown:function(event){if(event.keyCode===$.ui.keyCode.ESCAPE&&popoverInstance.container().is(":visible")){self.toggleDropDown(columnKey);popoverInstance.container().blur()}}})},_removeFeature:function(featureName,submenu){var self=this,cols=this.grid.options.columns;$.each(cols,function(index,col){self._removeDropDownItem(col.key,featureName);if(submenu){$("#"+self._id("featurechooser_submenu_"+col.key,featureName)).remove()}})},_removeDropDownItem:function(columnKey,featureName){var index=-1,data,$dropDown=$("#"+this._id("featureChooser_dd",columnKey)),$dropDownList=$("#"+this._id("featurechooser_dd_list",columnKey)),$item=$("#"+this._id("featurechooser_dd_li_"+columnKey,featureName));data=this.data[columnKey];if(data){$.each(data,function(i,dataItem){if(dataItem.name===featureName){index=i;return false}});if(index>-1){data.splice(index,1);if(data.length===0){this._removeFC(columnKey)}}}if($dropDown.length!==0&&$item.length>0){$item.remove();if($dropDownList.find("li:not([ data-fc-separator ])").length===0){this._removeFC(columnKey)}else{this._removeSeparatorItem(columnKey)}}},_removeFC:function(columnKey){var $dropDown=$("#"+this._id("featureChooser_dd",columnKey));$dropDown.igGridFeatureChooserPopover("destroy");$dropDown.remove();$("#"+this._id("featureChooser_headerButton",columnKey)).remove()},_removeSeparatorItem:function(columnKey){var listLiSeparator=$("#"+this._id("featurechooser_dd_list",columnKey)).find("[ data-fc-separator ]");listLiSeparator.each(function(){var $li=$(this),$prevLi=$li.prev(),$nextLi=$li.next();if($prevLi.length===0||$prevLi.attr("data-fc-separator")!==undefined||$nextLi.length===0||$nextLi.attr("data-fc-separator")!==undefined){$li.remove();return false}})},_renderDropDownItem:function(columnKey,data){var dropDownId=this._id("featureChooser_dd",columnKey),$dropDownContainer=$("#"+dropDownId).igGridFeatureChooserPopover("container"),$li,listId,$list,funcClickOnFeature,$iconContainer,$span,cssClassIcon="",self=this,isSelected=data.isSelected,featureName=data.name,innerData,liId=this._id("featurechooser_dd_li_"+columnKey,featureName),groupName=data.groupName,groupOrder=data.groupOrder,listItemsGroup,insertElementObj,labelText;if($("#"+liId).length>0){return}if(groupName===undefined||groupName===null){groupName="click"}listId=this._id("featurechooser_dd_list",columnKey);$list=$("#"+listId);if($list.length===0){$dropDownContainer.html("");$list=$("<ul></ul>").attr("id",listId).addClass(this.css.listClass).appendTo($dropDownContainer)}if(isSelected===undefined||isSelected===null){isSelected=false}$li=$("<li tabindex='0'></li>").addClass(this.css.listItemClass).attr("id",liId).attr("data-fc-order",data.order);if(groupName!==undefined&&groupName!==null){$li.attr("data-fc-groupname",groupName)}if(groupOrder!==undefined&&groupOrder!==null){$li.attr("data-fc-grouporder",groupOrder)}innerData={columnKey:columnKey,featureName:featureName,updateOnClickAll:data.updateOnClickAll,iconClass:data.iconClass,iconClassOff:data.iconClassOff,groupName:groupName,groupOrder:groupOrder,type:data.type,textHide:data.textHide,state:data.state,text:data.text};$li.data("data",innerData);funcClickOnFeature=function(event){var submenuId=self._id("featurechooser_submenu_"+columnKey,featureName),e=event,fcp,$submenu,keyCode=event.keyCode;if(data.type!=="dropdown"){if(!keyCode||keyCode===$.ui.keyCode.ENTER||keyCode===$.ui.keyCode.SPACE){if(event.target===undefined){e.target=event.srcElement}self._clickFeature(event);self.hideDropDown(columnKey)}}if(self._visiblePopover){if(!keyCode){self._toggleSubmenu(columnKey,featureName,data);setTimeout(function(){fcp=$("#"+self._visiblePopover).data("igGridFeatureChooserPopover");if(fcp){fcp._setFCElementFocus(true)}},5)}else{if(keyCode===$.ui.keyCode.DOWN){$submenu=$("#"+submenuId);if($submenu.is(":visible")){$submenu.find("[ data-fc-item ]:first").focus()}else{self._toggleSubmenu(columnKey,featureName,data)}}else if(keyCode===$.ui.keyCode.ENTER||keyCode===$.ui.keyCode.SPACE){self._toggleSubmenu(columnKey,featureName,data)}else if(keyCode===$.ui.keyCode.UP){$submenu=$("#"+submenuId);if($submenu.is(":visible")){self._toggleSubmenu(columnKey,featureName,data)}}}}if(event.preventDefault){event.preventDefault()}};$li.bind({keydown:funcClickOnFeature,mousedown:funcClickOnFeature});if(data.iconClass!==null&&data.iconClass!==undefined&&data.iconClass!==""){if(data.iconClassOff&&data.isSelected===false){cssClassIcon=data.iconClassOff}else{cssClassIcon=data.iconClass}}$iconContainer=$("<div></div>").addClass(this.css.listItemContainer).appendTo($li);$span=$("<span></span>").addClass(this.css.listItemIconContainer).appendTo($iconContainer);if(cssClassIcon!==""){$span.addClass(cssClassIcon)}else{$span.addClass(this.css.itemNoIcon)}labelText=data.text;$li.attr("title",labelText);$("<span></span>").text(data.text).addClass(this.css.listItemText).appendTo($iconContainer);listItemsGroup=$("#"+listId+" li[ data-fc-groupName = "+groupName+" ]");if(listItemsGroup.length===0){listItemsGroup=$("#"+listId+" li[ data-fc-groupName ]");insertElementObj=this._getInsertElement(listItemsGroup,groupOrder,"data-fc-grouporder");if(insertElementObj.item!==null){$list=listItemsGroup}this._insertElement(insertElementObj,$list,$li,groupName)}else{insertElementObj=this._getInsertElement(listItemsGroup,data.order,"data-fc-order");this._insertElement(insertElementObj,listItemsGroup,$li,groupName)}if(data.type==="toggle"){this._setSelectedItem(columnKey,data.isSelected,$li)}if(data.type==="dropdown"){$("<span class='"+this.css.submenuIcon+"' data-submenu-arrow='true'></span>").appendTo($iconContainer);self._renderSubmenu(columnKey,featureName,data)}},_renderSubmenu:function(columnKey,featureName,data){var submenuId=this._id("featurechooser_submenu_"+columnKey,featureName),$submenu;if($("#"+submenuId).length>0){$("#"+submenuId).remove()}if(this._submenus===null||this._submenus===undefined){this._submenus=[]}this._submenus.push(submenuId);$submenu=$("<div id='"+submenuId+"' style='position:absolute' class='"+this.css.submenu+"'></div>").appendTo(this.grid._rootContainer());$submenu.data("buttonId",this._id("featurechooser_dd_li_"+columnKey,featureName));$submenu.hide();if(data.methodRenderSubmenu){data.methodRenderSubmenu(columnKey,$submenu);$("#"+this._id("featureChooser_dd",columnKey)).igGridFeatureChooserPopover("registerElements",$submenu.find("[ data-fc-item ]"))}},_toggleSubmenu:function(columnKey,featureName,data){var rOffset,$li=$("#"+this._id("featurechooser_dd_li_"+columnKey,featureName)),$innerDiv=$li.find("div:nth-child(1)"),targetWidth=$innerDiv.outerWidth(),targetLeft=$innerDiv.igOffset().left,submenuId=this._id("featurechooser_submenu_"+columnKey,featureName),$submenu=$("#"+submenuId),left=targetLeft-Math.abs($submenu.outerWidth()-targetWidth)/2,top=$innerDiv.igOffset().top+$innerDiv.outerHeight();rOffset=$.ig.util.getRelativeOffset($submenu);$submenu.css({left:left-rOffset.left,top:top-rOffset.top});if(data.methodToggleSubmenu){data.methodToggleSubmenu(columnKey,!$submenu.is(":visible"),$submenu)}if(this._activeSubmenuId&&this._activeSubmenuId!==submenuId){$("#"+this._activeSubmenuId).hide()}this._activeSubmenuId=submenuId;$submenu.toggle("slide",{duration:150,direction:"up"})},_getSeparatorItem:function(){return $("<li data-fc-separator='1' class='"+this.css.separator+"'></li>")},_insertElement:function(insertElementObj,$list,$li,groupName){var $insertElement=insertElementObj.item,insertElementPosition=insertElementObj.position,$prevElement;if($insertElement===null){$li.appendTo($list);$prevElement=$li.prev();if($prevElement!==undefined&&$prevElement.length>0&&$prevElement.attr("data-fc-separator")!=="1"&&$prevElement.attr("data-fc-groupname")!==undefined&&$prevElement.attr("data-fc-groupname")!==groupName){this._getSeparatorItem().insertBefore($li)}}else{if(insertElementPosition==="after"){$li.insertAfter($insertElement);if($insertElement!==undefined&&$insertElement.length>0&&$insertElement.attr("data-fc-separator")!=="1"&&$insertElement.attr("data-fc-groupname")!==undefined&&$insertElement.attr("data-fc-groupname")!==groupName){this._getSeparatorItem().insertBefore($li)}}else{$li.insertBefore($insertElement);$prevElement=$li.prev();if($prevElement!==undefined&&$prevElement.length>0&&$prevElement.attr("data-fc-separator")!=="1"&&$prevElement.attr("data-fc-groupname")!==undefined&&$prevElement.attr("data-fc-groupname")!==groupName){this._getSeparatorItem().insertBefore($li)}else if($insertElement!==undefined&&$insertElement.length>0&&$insertElement.attr("data-fc-separator")!=="1"&&$insertElement.attr("data-fc-groupname")!==undefined&&$insertElement.attr("data-fc-groupname")!==groupName){this._getSeparatorItem().insertAfter($li)}}}},_getInsertElement:function(listItems,targetOrder,attr){var $item=null,itemOrder,at,i;for(i=0;i<listItems.length;i++){$item=$(listItems[i]);at=$item.attr(attr);if(at===undefined){continue}itemOrder=parseInt(at,10);if(itemOrder>targetOrder){return{item:$item,position:"before"}}}return{item:$item,position:"after"}},_setSelectedState:function(featureName,columnKey,isSelected,executeCallback){var data=this.data[columnKey],$listItem,self=this;if(data===undefined||data===null){return false}$.each(data,function(index,value){if(value.name.toLowerCase()===featureName.toLowerCase()){$listItem=$("#"+self._id("featurechooser_dd_li_"+columnKey,value.name));self._setSelectedItem(columnKey,isSelected,$listItem);self.data[columnKey][index].isSelected=!isSelected;if(executeCallback===true){self._callFeatureMethod(value,isSelected,columnKey,null)}value.isSelected=isSelected;return false}})},_setSelectedItem:function(columnKey,isSelected,$listItem){if($listItem===null||$listItem===undefined||$listItem.length===0){return}var innerData=$listItem.data("data"),textShow,textHide,labelText,$label=null;if(innerData!==undefined&&innerData!==null){textShow=innerData.text;textHide=innerData.textHide;$label=$listItem.find("span.ui-iggrid-featurechooserddlistitemtext")}$listItem.attr("data-fc-selected",isSelected);if(isSelected===true){$listItem.addClass(this.css.itemSelected);labelText=textShow;if($label!==null&&textShow!==null&&textShow!==undefined){$label.text(labelText)}if(innerData.iconClassOff){$listItem.find("span.ui-iggrid-featurechooser-li-iconcontainer").removeClass(innerData.iconClassOff).addClass(innerData.iconClass)}}else{$listItem.removeClass(this.css.itemSelected);labelText=textHide;if($label!==null&&textHide!==null&&textHide!==undefined){$label.text(labelText)}if(innerData.iconClassOff){$listItem.find("span.ui-iggrid-featurechooser-li-iconcontainer").removeClass(innerData.iconClass).addClass(innerData.iconClassOff)}}$listItem.attr("title",labelText)},_toggleSelectedItems:function(featureName,selected){var i,$li,columnKey,cols=this.grid.options.columns,colsLength=cols.length,isSelected,feature;if(selected!==undefined){isSelected=selected}for(i=0;i<colsLength;i++){columnKey=cols[i].key;if($("#"+this._id("featureChooser_dd",columnKey)).length===0){feature=this._getFeatureByKeyName(columnKey,featureName);if(feature===null||feature===undefined){continue}if(isSelected===undefined){isSelected=feature.isSelected}}else{$li=$("#"+this._id("featurechooser_dd_li_"+columnKey,featureName));if($li.data("data")===null||$li.data("data")===undefined){continue}if(selected===undefined){isSelected=$li.attr("data-fc-selected")==="true"}}this._setSelectedState(featureName,columnKey,!isSelected)}},showDropDown:function(columnKey){var $targetButton,dropDownId=this._id("featureChooser_dd",columnKey),$dropDown=this.getDropDownByColumnKey(columnKey),fcp;this.grid._focusedElement=$("#"+this._id("featureChooser_headerButton",columnKey)).find("span");$targetButton=$("#"+this._id("featureChooser_headerButton",columnKey)).find("span");if($targetButton.length===0){$targetButton=$("#"+this.grid.id()+"_"+columnKey)}if(this._visiblePopover&&dropDownId!==this._visiblePopover){fcp=$("#"+this._visiblePopover).data("igGridFeatureChooserPopover");if(fcp){fcp._closePopover()}setTimeout(function(){$dropDown.data("igGridFeatureChooserPopover")._openPopover($targetButton,false)},100)}else{$dropDown.data("igGridFeatureChooserPopover")._openPopover($targetButton,false)}},hideDropDown:function(columnKey){var $dropDown=this.getDropDownByColumnKey(columnKey);$dropDown.igGridFeatureChooserPopover("hide");this.grid._focusedElement=null},getDropDownByColumnKey:function(columnKey){var dropDownId=this._id("featureChooser_dd",columnKey),$dropDown=$("#"+dropDownId);if($dropDown.length===0){this._renderMenu(columnKey);$dropDown=$("#"+dropDownId)}return $dropDown},toggleDropDown:function(columnKey){var $dropDown=this.getDropDownByColumnKey(columnKey),isVisible=$dropDown.igGridFeatureChooserPopover("isShown");this._trigger(this.events.menuToggling,null,{isVisible:isVisible,columnKey:columnKey,owner:this});if(isVisible){this.hideDropDown(columnKey)}else{this.showDropDown(columnKey)}},_mouseOverDropDownItem:function(event){this._addCssSelectionListItem($(event.currentTarget))},_mouseOutDropDownItem:function(event){
this._removeCssSelectionListItem($(event.currentTarget))},_addCssSelectionListItem:function($listItem){$listItem.addClass(this.css.dropDownListItemHover)},_removeCssSelectionListItem:function($listItem){$listItem.removeClass(this.css.dropDownListItemHover)},_virtualHorizontalScroll:function(){this._renderFCForAllColumns()},destroy:function(e,args){var i,l,self=this,sbm=this._submenus,grid;if(args&&args.owner){grid=args.owner;if(grid&&grid.id()!==this.gridId){return}}this.data=null;$.each(this.grid.options.columns,function(ind,column){var $dd=$("#"+self._id("featureChooser_dd",column.key));if($dd.length>0){$dd.igGridFeatureChooserPopover("destroy");$dd.remove()}});if(sbm){l=sbm.length;for(i=0;i<l;i++){$("#"+sbm[i]).remove()}}if(this._headerRenderedHandler){this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler)}if(this._gridDestroyedHandler){this.grid.element.unbind("igcontroldestroyed",this._gridDestroyedHandler)}if(this._gridRenderedHandler){this.grid.element.unbind("iggridrendered",this._gridRenderedHandler)}if(this._virtualHorizontalScrollHandler){this.grid.element.unbind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler)}delete this._gridRenderedHandler;delete this._headerRenderedHandler;delete this._gridDestroyedHandler;delete this._virtualHorizontalScrollHandler;this._superApply(arguments);return this}});$.extend($.ui.igGridFeatureChooser,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI Grid Sorting 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.grid.shared.js
 *	infragistics.ui.grid.featurechooser.js
 *	infragistics.ui.editors.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.templating.js
 *	infragistics.util.js
 */
(function($){$.widget("ui.igGridFiltering",$.ui.igWidget,{renderInFeatureChooser:true,options:{caseSensitive:false,filterSummaryAlwaysVisible:true,renderFC:true,filterSummaryTemplate:undefined,filterDropDownAnimations:"linear",filterDropDownAnimationDuration:500,filterDropDownWidth:0,filterDropDownHeight:0,filterExprUrlKey:null,filterDropDownItemIcons:true,columnSettings:[{columnKey:null,editorType:null,editorProvider:null,editorOptions:null,columnIndex:null,allowFiltering:true,condition:null,conditionList:[],defaultExpressions:[],customConditions:null}],type:null,filterDelay:500,mode:null,advancedModeEditorsVisible:false,advancedModeHeaderButtonLocation:"left",filterDialogWidth:500,filterDialogHeight:340,filterDialogFilterDropDownDefaultWidth:150,filterDialogExprInputDefaultWidth:100,filterDialogColumnDropDownDefaultWidth:null,renderFilterButton:true,filterButtonLocation:"left",nullTexts:{startsWith:undefined,endsWith:undefined,contains:undefined,doesNotContain:undefined,equals:undefined,doesNotEqual:undefined,greaterThan:undefined,lessThan:undefined,greaterThanOrEqualTo:undefined,lessThanOrEqualTo:undefined,on:undefined,notOn:undefined,after:undefined,before:undefined,thisMonth:undefined,lastMonth:undefined,nextMonth:undefined,thisYear:undefined,lastYear:undefined,nextYear:undefined,empty:undefined,notEmpty:undefined,"null":undefined,notNull:undefined},labels:{noFilter:undefined,clear:undefined,startsWith:undefined,endsWith:undefined,contains:undefined,doesNotContain:undefined,equals:undefined,doesNotEqual:undefined,greaterThan:undefined,lessThan:undefined,greaterThanOrEqualTo:undefined,lessThanOrEqualTo:undefined,trueLabel:undefined,falseLabel:undefined,after:undefined,before:undefined,today:undefined,yesterday:undefined,thisMonth:undefined,lastMonth:undefined,nextMonth:undefined,thisYear:undefined,lastYear:undefined,nextYear:undefined,on:undefined,notOn:undefined,advancedButtonLabel:undefined,filterDialogCaptionLabel:undefined,filterDialogConditionLabel1:undefined,filterDialogConditionLabel2:undefined,filterDialogOkLabel:undefined,filterDialogCancelLabel:undefined,filterDialogAnyLabel:undefined,filterDialogAllLabel:undefined,filterDialogAddLabel:undefined,filterDialogErrorLabel:undefined,filterSummaryTitleLabel:undefined,filterDialogClearAllLabel:undefined,empty:undefined,notEmpty:undefined,nullLabel:undefined,notNull:undefined,"true":undefined,"false":undefined},tooltipTemplate:undefined,featureChooserText:undefined,featureChooserTextHide:undefined,featureChooserTextAdvancedFilter:undefined,locale:{startsWithNullText:undefined,endsWithNullText:undefined,containsNullText:undefined,doesNotContainNullText:undefined,equalsNullText:undefined,doesNotEqualNullText:undefined,greaterThanNullText:undefined,lessThanNullText:undefined,greaterThanOrEqualToNullText:undefined,lessThanOrEqualToNullText:undefined,onNullText:undefined,notOnNullText:undefined,afterNullText:undefined,beforeNullText:undefined,emptyNullText:undefined,notEmptyNullText:undefined,nullNullText:undefined,notNullNullText:undefined,startsWithLabel:undefined,endsWithLabel:undefined,containsLabel:undefined,doesNotContainLabel:undefined,equalsLabel:undefined,doesNotEqualLabel:undefined,greaterThanLabel:undefined,lessThanLabel:undefined,greaterThanOrEqualToLabel:undefined,lessThanOrEqualToLabel:undefined,trueLabel:undefined,falseLabel:undefined,afterLabel:undefined,beforeLabel:undefined,todayLabel:undefined,yesterdayLabel:undefined,thisMonthLabel:undefined,lastMonthLabel:undefined,nextMonthLabel:undefined,thisYearLabel:undefined,lastYearLabel:undefined,nextYearLabel:undefined,atLabel:undefined,notAtLabel:undefined,atBeforeLabel:undefined,atAfterLabel:undefined,clearLabel:undefined,noFilterLabel:undefined,onLabel:undefined,notOnLabel:undefined,advancedButtonLabel:undefined,filterDialogCaptionLabel:undefined,filterDialogConditionLabel1:undefined,filterDialogConditionLabel2:undefined,filterDialogConditionDropDownLabel:undefined,filterDialogOkLabel:undefined,filterDialogCancelLabel:undefined,filterDialogAnyLabel:undefined,filterDialogAllLabel:undefined,filterDialogAddLabel:undefined,filterDialogErrorLabel:undefined,filterDialogCloseLabel:undefined,filterSummaryTitleLabel:undefined,filterSummaryTemplate:undefined,filterDialogClearAllLabel:undefined,tooltipTemplate:undefined,featureChooserText:undefined,featureChooserTextHide:undefined,featureChooserTextAdvancedFilter:undefined},filterDialogAddConditionTemplate:null,filterDialogAddConditionDropDownTemplate:null,filterDialogFilterTemplate:null,filterDialogFilterConditionTemplate:null,filterDialogAddButtonWidth:100,filterDialogOkCancelButtonWidth:120,filterDialogMaxFilterCount:5,filterDialogContainment:"owner",showEmptyConditions:false,showNullConditions:false,dialogWidget:"igGridModalDialog",persist:true,inherit:false},css:{filterRow:"ui-iggrid-filterrow ui-widget",filterCell:"ui-iggrid-filtercell",filterCellEditor:"ui-iggrid-filtereditor",filterDropDownList:"ui-menu ui-widget ui-widget-content ui-iggrid-filterddlist ui-corner-all",filterDropDown:"ui-iggrid-filterdd",filterDropDownListItemTextContainer:"ui-iggrid-filterddlistitemcontainer",filterDropDownListItem:"ui-iggrid-filterddlistitem",filterDropDownListItemAdvanced:"ui-iggrid-filterddlistitemadvanced",filterDropDownListItemWithIcons:"ui-iggrid-filterddlistitemicons ui-state-default",filterDropDownListItemClear:"ui-iggrid-filterddlistitemclear",filterDropDownListItemHover:"ui-iggrid-filterddlistitemhover ui-state-hover",filterDropDownListItemActive:"ui-iggrid-filterddlistitemactive ui-state-active",filterDateCell:"",filterTextCell:"",filterNumberCell:"",filterBoolCell:"",filterButton:"ui-iggrid-filterbutton ui-corner-all ui-icon ui-icon-triangle-1-s",filterButtonAdvanced:"ui-iggrid-filterbutton ui-iggrid-filterbuttonadvanced ui-icon ui-icon-search",filterButtonAdvancedRight:"ui-iggrid-filterbuttonright ui-iggrid-filterbuttonadvanced ui-icon ui-icon-search",filterButtonSimpleRight:"ui-iggrid-filterbuttonright",filterButtonHover:"ui-iggrid-filterbuttonhover ui-state-hover",filterButtonActive:"ui-iggrid-filterbuttonactive ui-state-active",filterButtonFocus:"ui-iggrid-filterbuttonfocus ui-state-focus",filterButtonDisabled:"ui-iggrid-filterbuttondisabled ui-state-disabled",filterButtonDate:"ui-iggrid-filterbuttondate",filterButtonString:"ui-iggrid-filterbuttonstring",filterButtonNumber:"ui-iggrid-filterbuttonnumber",filterButtonBoolean:"ui-iggrid-filterbuttonbool",filterButtonAdvancedHover:"ui-iggrid-filterbuttonadvancedhover ui-state-hover",filterButtonAdvancedActive:"ui-iggrid-filterbuttonadvancedactive ui-state-active",filterButtonAdvancedFocus:"ui-iggrid-filterbuttonadvancedfocus ui-state-focus",filterButtonAdvancedDisabled:"ui-iggrid-filterbuttonadvanceddisabled ui-state-disabled",filterItemIcon:"ui-iggrid-filtericon",filterItemIconContainer:"ui-iggrid-filtericoncontainer",filterItemIconStartsWith:"ui-iggrid-filtericonstartswith",filterItemIconEndsWith:"ui-iggrid-filtericonendswith",filterItemIconContains:"ui-iggrid-filtericoncontains",filterItemIconEquals:"ui-iggrid-filtericonequals",filterItemIconDoesNotEqual:"ui-iggrid-filtericondoesnotequal",filterItemIconDoesNotContain:"ui-iggrid-filtericondoesnotcontain",filterItemIconGreaterThan:"ui-iggrid-filtericongreaterthan",filterItemIconLessThan:"ui-iggrid-filtericonlessthan",filterItemIconGreaterThanOrEqualTo:"ui-iggrid-filtericongreaterthanorequalto",filterItemIconLessThanOrEqualTo:"ui-iggrid-filtericonlessthanorequalto",filterItemIconTrue:"ui-iggrid-filtericontrue",filterItemIconFalse:"ui-iggrid-filtericonfalse",filterItemIconAfter:"ui-iggrid-filtericonafter",filterItemIconBefore:"ui-iggrid-filtericonbefore",filterItemIconToday:"ui-iggrid-filtericontoday",filterItemIconYesterday:"ui-iggrid-filtericonyesterday",filterItemIconThisMonth:"ui-iggrid-filtericonthismonth",filterItemIconLastMonth:"ui-iggrid-filtericonlastmonth",filterItemIconNextMonth:"ui-iggrid-filtericonnextmonth",filterItemIconThisYear:"ui-iggrid-filtericonthisyear",filterItemIconLastYear:"ui-iggrid-filtericonlastyear",filterItemIconNextYear:"ui-iggrid-filtericonnextyear",filterItemIconOn:"ui-iggrid-filtericonon",filterItemIconNotOn:"ui-iggrid-filtericonnoton",filterItemIconClear:"ui-iggrid-filtericonclear",blockArea:"ui-widget-overlay ui-iggrid-blockarea",filterDialog:"ui-dialog ui-draggable ui-resizable ui-iggrid-dialog ui-widget ui-widget-content ui-corner-all",filterDialogHeaderCaption:"ui-dialog-titlebar ui-iggrid-filterdialogcaption ui-widget-header ui-corner-all ui-helper-reset ui-helper-clearfix",filterDialogHeaderCaptionTitle:"ui-dialog-title",filterDialogAddCondition:"ui-iggrid-filterdialogaddcondition",filterDialogAddConditionDropDown:"ui-iggrid-filterdialogaddconditionlist",filterDialogAddButton:"ui-iggrid-filterdialogaddbuttoncontainer ui-helper-reset",filterDialogOkCancelButton:"ui-dialog-buttonpane ui-widget-content ui-helper-clearfix ui-iggrid-filterdialogokcancelbuttoncontainer",filterDialogFiltersTable:"ui-iggrid-filtertable ui-helper-reset",filterDialogFilterRemoveButton:"ui-icon ui-icon-closethick",filterDialogClearAllButton:"ui-iggrid-filterdialogclearall",featureChooserModalDialogIcon:"ui-icon ui-iggrid-icon-advanced-filter",customEditorInputContainerDiv:"ui-igeditor-input-container ui-corner-all",customEditorParentDiv:"ui-igedit ui-igedit-container ui-widget ui-corner-all ui-state-default"},events:{dataFiltering:"dataFiltering",dataFiltered:"dataFiltered",dropDownOpening:"dropDownOpening",dropDownOpened:"dropDownOpened",dropDownClosing:"dropDownClosing",dropDownClosed:"dropDownClosed",filterDialogOpening:"filterDialogOpening",filterDialogOpened:"filterDialogOpened",filterDialogMoving:"filterDialogMoving",filterDialogFilterAdding:"filterDialogFilterAdding",filterDialogFilterAdded:"filterDialogFilterAdded",filterDialogClosing:"filterDialogClosing",filterDialogClosed:"filterDialogClosed",filterDialogContentsRendering:"filterDialogContentsRendering",filterDialogContentsRendered:"filterDialogContentsRendered",filterDialogFiltering:"filterDialogFiltering"},_createWidget:function(){this.options.columnSettings=[];$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){this._editorProviders=[];this._filteringRequestCount=0;if(!$.fn.fadeToggle){$.fn.fadeToggle=$.fn.toggle}this._fcData={};this._isInitFC=false;this._dsTransformedCustomConditions=null;if(this.options.filterDropDownAnimations==="none"){this.options.filterDropDownAnimationDuration=1;this.options.filterDropDownAnimations="linear"}},changeGlobalLanguage:function(){},changeGlobalRegional:function(){},_getLabelTextByCondition:function(condition){return this._getLocaleValue(condition+"Label")},_getNullTextByCondition:function(condition){var nullText=this._getLocaleValue(condition+"NullText");return nullText===""?this._getLabelTextByCondition(condition):nullText},_changeLocaleForFeatureChooser:function(){var fc=this.grid.element.data("igGridFeatureChooser");if(fc&&this.renderInFeatureChooser){fc._removeFeature("Filtering");fc._removeFeature("AdvancedFiltering")}this._initFC()},_changeLocaleForFilterDialog:function(){var $filterDialog=this._getFilterDialog(),rows,$row,condEditor,exprEditorProvider,self=this;$.ui.igWidget.prototype.changeLocale.call(this,$filterDialog);$filterDialog[this.options.dialogWidget]("option",{locale:{modalDialogCaptionText:this._getLocaleValue("filterDialogCaptionLabel"),buttonApplyText:this._getLocaleValue("filterDialogOkLabel"),buttonCancelText:this._getLocaleValue("filterDialogCancelLabel")}});$filterDialog.find("[data-af-clear-all-button]").igButton("option","labelText",this._getLocaleValue("filterDialogClearAllLabel"));rows=$filterDialog.find("[data-af-row]");rows.each(function(){$row=$(this);condEditor=self._getDialogColSelByRow($row);exprEditorProvider=self._getDialogExprSelByRow($row).data("provider");condEditor.data("igTextEditor").option("language",self.grid.options.language);self._setEditorOption(exprEditorProvider.getEditor(),"language",self.grid.options.language)})},changeLocale:function(){var self=this,$container=this.grid._rootContainer(),$summaryContainer=$container.find("[data-filter-summary-template]"),$filterDialog=this._getFilterDialog(),i;this._setNullTextsInFilteringEditors();this._changeLocaleForFeatureChooser();$container.find("[data-filter-dropdown]").each(function(){self._super($(this))});this._updateTooltips(this.grid.dataSource.settings.filtering.expressions);if($filterDialog.length){this._changeLocaleForFilterDialog()}if(this._editorProviders&&this._editorProviders.length>0){for(i=0;i<this._editorProviders.length;i++){if(!this._hasEditor(this._editorProviders[i])){continue}this._setEditorOption(this._editorProviders[i].getEditor(),"language",this.grid.options.language)}}if($summaryContainer.length){this._changeLocaleForElement($summaryContainer);$summaryContainer.text(this._getLocaleValue("filterSummaryTemplate").replace("${matches}",$summaryContainer.attr("data-filter-summary-template")))}},changeRegional:function(){var regional=this.grid.options.regional,colKey,i;if(this._editorProviders&&this._editorProviders.length>0){for(i=0;i<this._editorProviders.length;i++){if(!this._hasEditor(this._editorProviders[i])){continue}colKey=this._editorProviders[i].getEditor().element.data("colKey");if(!this.grid.columnByKey(colKey).regional){this._setEditorOption(this._editorProviders[i].getEditor(),"regional",regional)}}}},_registerWidget:$.noop,_unregisterWidget:$.noop,_setOption:function(key,value){this._super(key,value);if(key==="mode"||key==="renderFilterButton"||key==="filterButtonLocation"||key==="type"){throw new Error(this._getLocaleValue("optionChangeNotSupported").replace("{optionName}",key))}if(key==="filterDropDownWidth"){this.grid._rootContainer().find("div ul").parent().css("width",value)}else if(key==="filterDropDownHeight"){this.grid._rootContainer().find("div ul").parent().css("height",value)}else if(key==="filterDialogWidth"){this._getFilterDialog().css("width",value)}else if(key==="filterDialogHeight"){this._getFilterDialog().css("height",value)}else if(key==="columnSettings"){this._initDefaultSettings()}},_isBool:function(val){return val==="bool"||val==="boolean"?true:false},_setEditorOption:function(editor,optionName,optionValue){if(editor._setOption){editor._setOption(optionName,optionValue)}else{if(optionName==="width"){editor.element.width(optionValue)}else if(optionName==="readOnly"){editor.element.prop("readonly",optionValue)}}},destroy:function(){var fc,gridId=this.grid.id(),cols=this.grid.options.columns,i,rootContainer=this.grid._rootContainer(),block=rootContainer.find("#"+gridId+"_container_block"),dialog=rootContainer.find("#"+gridId+"_container_dialog");this._destroyAllEditors();this.grid.container().find(".ui-iggrid-filterrow, .ui-iggrid-filterdd").remove();if(this.element.closest(".ui-iggrid-root").length){rootContainer.find("#"+gridId+"filtering_dd").remove()}if(this.options&&this.options.advancedModeEditorsVisible===false&&this.options.mode==="advanced"&&this.options.renderFilterButton===true){for(i=0;i<cols.length;i++){rootContainer.find("#"+gridId+"_dd_"+cols[i].key+"_button").remove()}}block.remove();dialog.remove();rootContainer.unbind("keydown.focusChecker");this.grid.element.unbind("iggridheadercellrendered",this._headerCellRenderedHandler);this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.unbind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler);this.grid.element.unbind("iggridresizingcolumnresized",this._columnResizedHandler);this.grid.element.unbind("iggridheaderextracellsmodified",this._headerInitHandler);this.grid.element.unbind("iggriddatabound",this._dataBoundHandler);this.grid.element.unbind("iggrid_columnsmoved",this._columnsAlteredHandler);this.grid.element.unbind("iggriduidirty",this._onUIDirtyHandler);delete this._headerRenderedHandler;delete this._virtualHorizontalScrollHandler;delete this._columnResizedHandler;delete this._headerInitHandler;delete this._onUIDirtyHandler;delete this._columnsAlteredHandler;this._fcData=null;this.options=null;if(this._loadingIndicator){delete this._loadingIndicator}if(this._filterInternal){delete this._filterInternal}if(this._toggleFilterRowHandler){delete this._toggleFilterRowHandler}if(this._openFilterDialogFromFCHandler){delete this._openFilterDialogFromFCHandler}fc=this.grid.element.data("igGridFeatureChooser");if(fc&&this.renderInFeatureChooser){fc._removeFeature("Filtering");fc._removeFeature("AdvancedFiltering")}this._superApply(arguments);return this},_destroyAllEditors:function(){var key;for(key in this._editorProviders){if(this._editorProviders.hasOwnProperty(key)&&this._editorProviders[key].destroy){this._editorProviders[key].getEditor().element.remove()}}this._editorProviders=null},_initLoadingIndicator:function(){this._loadingIndicator=this.grid._rootContainer().length>0?this.grid._rootContainer().igLoading().data("igLoading"):this.grid.element.igLoading().data("igLoading").indicator()},_setNullTextsInFilteringEditors:function(){var i,condition,cs=this.options.columnSettings,editorProviders=this._editorProviders,cols=this.grid.options.columns;if(editorProviders){for(i=0;i<editorProviders.length;i++){if(cs[i]&&cs[i].allowFiltering!==false){if(editorProviders[i].getValue()===null){editorProviders[i].setValue(null)}condition=this._getNullTextByCondition(this._findColumnSetting(cs[i].columnKey).condition);if(condition===null||condition===undefined){condition=this._getNullTextByCondition(this._getDefaultCondition(this._getColType(cols[i].key)))}this._setEditorOption(editorProviders[i].getEditor(),"placeHolder",condition)}}}},_onUIDirty:function(e,args){if(this.options.persist&&this.options.type==="remote"){return}var i,cols=this.grid.options.columns;if(args.owner===this||args.owner.element[0].id!==this.element[0].id){return}this._filterDialogClearAll();this._setNullTextsInFilteringEditors();for(i=0;i<cols.length;i++){this.grid._rootContainer().find("#"+this.grid.id()+"filtering_dd").find("li").removeClass("ui-iggrid-filterddlistitemactive ui-state-active")}$(".ui-iggrid-filterbutton",this.grid._rootContainer()).parent().attr("title",this._getLocaleValue("tooltipTemplate").replace("${condition}",this._getLocaleValue("noFilterLabel")));this.grid.dataSource.settings.filtering.expressions=[]},getFilteringMatchesCount:function(){var o=this.options,ds=this.grid.dataSource,matches;if(o.type==="local"||o.type==="remote"&&ds.hasTotalRecordsCount()===false){if(ds._filter){matches=ds._filteredData.length}else{matches=ds._data.length}}else{matches=ds.totalRecordsCount()}return matches},_dataRendered:function(){var w,fCntnr,defExpr,expr,matches=0,grid=this.grid,summary=grid.container().find(".ui-iggrid-footer .ui-iggrid-results").eq(0),footer=summary.parent(),shouldInitHeights=false,isInitiallyFiltered=false,i,isFiltering=false,exprs,reInitHeights=false,paging=grid.element.data("igGridPaging");if(!this._loadingIndicator){this._initLoadingIndicator()}if(this._hiddenCells&&this._hiddenCells.length>0){for(i=0;i<this._hiddenCells.length;i++){this._hiddenCells[i].show()}this._hiddenCells=undefined}if(this._defaultExpressions&&this._defaultExpressions.length>0){defExpr=this._defaultExpressions;this._defaultExpressions=[];this._updateFiltersUI(defExpr,false);isInitiallyFiltered=true;this._filteringRequestCount++}if(this._shouldFireDataFiltered){exprs=this._getDataColumnFilteringExpressions(grid.dataSource.settings.filtering.expressions);this._shouldFireDataFiltered=false;this._trigger(this.events.dataFiltered,null,{columnKey:this._curColKey,columnIndex:this._curColIndex,owner:this,expressions:exprs})}if(!summary.is(":visible")){shouldInitHeights=true}if(this._filteringRequestCount>0){if(this.options.filterSummaryAlwaysVisible===true&&summary.length===0){footer=$("<div></div>").appendTo(grid.container()).addClass("ui-widget ui-helper-clearfix ui-corner-bottom ui-widget-header ui-iggrid-footer");if(grid.hasFixedColumns()){footer.css("clear","both");reInitHeights=$.ig.util.isChrome&&footer.height()>grid._rootContainer().height()}summary=$("<span></span>").appendTo(footer).addClass("ui-iggrid-results");if(isInitiallyFiltered&&paging){footer.attr("id",grid.element[0].id+"_pager").addClass("ui-iggrid-pager");summary.attr("id",grid.element[0].id+"_pager_label").addClass("ui-iggrid-pagerrecordslabel")}shouldInitHeights=true}matches=this.getFilteringMatchesCount();if(!summary.parent().is(":visible")){summary.parent().show();shouldInitHeights=true}summary.text(this._getLocaleValue("filterSummaryTemplate").replace("${matches}",matches)).attr({title:this._getLocaleValue("filterSummaryTitleLabel"),"data-filter-summary-template":matches,"data-localeid":"filterSummaryTitleLabel","data-localeattr":"title"});summary.show();isFiltering=true;this._filteringRequestCount--}else if(this._filteringRequestCount<=0){expr=grid.dataSource.settings.filtering.expressions||[];if(summary.data("hideflag")!==false&&expr.length===0&&!(paging&&paging._plabel())){isFiltering=true;summary.hide();if(summary.parent().children().length===1){summary.parent().hide()}}else{summary.data("hideflag",true)}shouldInitHeights=true}this._loadingIndicator.hide();if(shouldInitHeights){if(grid.hasFixedColumns()){fCntnr=grid.fixedContainer()[0];if(fCntnr){w=fCntnr.style.width;fCntnr.style.width=""}}grid._initializeHeights();if(w){fCntnr.style.width=w}if(reInitHeights){grid._initializeHeights()}if(isFiltering&&(grid.options.virtualization||grid.options.rowVirtualization)){grid._updateVirtualScrollContainer();grid._virtualDom=null;grid._renderVirtualRecords()}}this._setEditorsWidth()},_initFC:function(){var columnKey,i,fc=this.grid.element.data("igGridFeatureChooser"),o=this.options,cs=this.options.columnSettings,showAdvancedButton=o.mode==="advanced"&&o.advancedModeEditorsVisible===true,isAdvanced=o.mode!=="simple"&&o.advancedModeEditorsVisible===false;this._isInitFC=true;if(o.renderFC===false){return}if(fc&&this.renderInFeatureChooser){if(this._toggleFilterRowHandler===null||this._toggleFilterRowHandler===undefined){this._toggleFilterRowHandler=$.proxy(this.toggleFilterRowByFeatureChooser,this)}if(this._openFilterDialogFromFCHandler===null||this._openFilterDialogFromFCHandler===undefined){this._openFilterDialogFromFCHandler=$.proxy(this._openFilterDialogFromFC,this)}for(i=0;i<cs.length;i++){columnKey=cs[i].columnKey;if(columnKey&&cs[i].allowFiltering===true&&fc._shouldRenderInFeatureChooser(columnKey)===true){this._filterRowShown=true;this._fcData[columnKey]=true;if(isAdvanced||showAdvancedButton){fc._renderInFeatureChooser(columnKey,{name:"AdvancedFiltering",text:this._getLocaleValue("featureChooserTextAdvancedFilter"),iconClass:this.css.featureChooserModalDialogIcon,isSelected:true,method:this._openFilterDialogFromFCHandler,updateOnClickAll:true,groupName:"modaldialog",groupOrder:3,order:3})}if(!isAdvanced){fc._renderInFeatureChooser(columnKey,{name:"Filtering",text:this._getLocaleValue("featureChooserText"),textHide:this._getLocaleValue("featureChooserTextHide"),iconClass:this.css.featureChooserModalDialogIcon,isSelected:true,method:this._toggleFilterRowHandler,updateOnClickAll:true,groupName:"toggle",groupOrder:1,order:2,type:"toggle",state:"hide"})}}}}},_columnResized:function(){if(this._filterRowShown!==false){this._setEditorsWidth()}},_setEditorsWidth:function(){if(this.options.mode!=="simple"&&this.options.advancedModeEditorsVisible!==true){return}var cs=this.options.columnSettings,cols=this.grid._visibleColumns(),cells=this.grid.headersTable().find("thead tr[data-role=filterrow]").first().find("td").not("[data-skip=true]"),cellWidth,i,j,skipColumn,editorProvider;for(i=0;i<cols.length;i++){for(j=0;j<cs.length;j++){if(cs[j].columnKey===cols[i].key&&cs[j].allowFiltering===false){skipColumn=true;break}}if(skipColumn){skipColumn=false;continue}if(!$.ig.util.isOpera&&(this.grid.options.height&&this.grid.options.fixedHeaders===true||$.ig.util.isWebKit)){cellWidth=cells.eq(i).innerWidth()}else{cellWidth=cells.eq(i).width()}cellWidth-=cells.eq(i).data("buttonWidth");editorProvider=cells.eq(i).find("span[data-filter-editor]").first().data("provider");if(!editorProvider){editorProvider=this._editorProviders[i]}if(editorProvider.getEditor){this._setEditorOption(editorProvider.getEditor(),"width",cellWidth);this._setEditorInputWidth(editorProvider)}}},_setEditorInputWidth:function(editorProvider){if(!editorProvider.getEditor()._editorContainer){return}var editorWidth,editorInputElement,buttonWidth,padding=2,editorButtons=editorProvider.getEditor()._editorContainer.find("div.ui-igedit-button-common");if(editorButtons.length>0){editorInputElement=editorProvider.getEditor()._editorContainer.find("div.ui-igeditor-input-container").first();if(editorInputElement.length>0){editorWidth=editorProvider.getEditor()._editorContainer.width();buttonWidth=editorButtons.first().outerWidth();editorInputElement.width(editorWidth-editorButtons.length*buttonWidth-padding)}}},_headerRendered:function(sender){var thead,filterrow,i=0,cell,w,button,cols=this.grid.options.columns,thCell,id,j,cs=this.options.columnSettings,skipColumn=false,buttonCss,showAdvancedInHeader=false,indicatorContainer,cancelFunc,ci,buttonWidth,isSimpleMode=this.options.mode==="simple"||this.options.advancedModeEditorsVisible===true,isToCheck=this.grid._initialHiddenColumns&&this.grid._initialHiddenColumns.length>0,cond;if(sender.target.id!==this.grid.element[0].id){return}thead=this.grid.container().find("thead");if(this.options.mode==="simple"||this.options.advancedModeEditorsVisible===true){filterrow=$("<tr></tr>").appendTo(thead).addClass(this.css.filterRow).attr("data-role","filterrow");this.grid._headerInit(filterrow)}else{filterrow=thead.find("tr:first")}cancelFunc=function(e){e.preventDefault();e.stopPropagation()};if(isToCheck){this._hiddenCells=[]}ci=i+filterrow.find("[data-skip=true]").length;if(this.options.advancedModeEditorsVisible===true||this.options.mode!=="advanced"){this._renderDropDownElement(this.grid.id()+"_filtering_dd",cols[0].key)}for(i=0;i<cols.length;i++,ci++){var colSettings=this._findColumnSetting(cols[i].key);cond=colSettings.defaultExpressions?colSettings.defaultExpressions[0].cond:colSettings.condition;colSettings.condition=cond?cond:this._getDefaultCondition(this._getColType(cols[i].key));if(isSimpleMode===true){cell=$("<td></td>").appendTo(filterrow).addClass(this.css.filterCell);if(isToCheck&&this._hiddenCells.length<this.grid._initialHiddenColumns.length){for(j=this.grid._initialHiddenColumns.length-1;j>=0;j--){if(this.grid._initialHiddenColumns[j].key===cols[i].key){cell.hide();this._hiddenCells.push(cell);break}}}cell.attr("aria-describedBy",this.grid.id()+"_"+cols[i].key)}else{cell=this.grid.container().find("#"+this.grid.id()+"_"+cols[i].key);if(cell.children().first().is("a")){cell.children().first().css("display","inline");cell.css("cursor","pointer")}cell.data("colName",cols[i].key);cell.attr("aria-describedBy",this.grid.id()+"_"+cols[i].key)}if(this.grid._isMultiColumnGrid!==true||isSimpleMode===true){if(i===cols.length-1&&this.grid.options.height&&parseInt(this.grid.options.height,10)>0){cell.css("width",parseInt(cols[i].width,10)+this.grid._scrollbarWidth())}else{cell.css("width",cols[i].width)}}for(j=0;j<cs.length;j++){if(cs[j].columnKey===cols[i].key&&cs[j].allowFiltering===false){if(this.options.advancedModeEditorsVisible===true||this.options.mode!=="advanced"){this._editorProviders.push({})}skipColumn=true;break}}if(skipColumn){skipColumn=false;continue}thCell=thead.children().first().find("th:nth-child("+(ci+1)+")");if($.ig.util.isWebKit&&thCell.length>0){w=thCell[0].offsetWidth}else if(this.grid.options.height&&this.grid.options.fixedHeaders===true||$.ig.util.isWebKit){w=thCell.innerWidth()}else{w=thCell.width()}showAdvancedInHeader=this.options.advancedModeEditorsVisible===false&&this.options.mode==="advanced"&&this.options.renderFilterButton===true;if(this.options.renderFilterButton===true&&!showAdvancedInHeader||showAdvancedInHeader&&this._renderFCFor(cols[i].key)===false){id=this.grid.element.attr("id")+"_dd_"+cols[i].key;buttonCss=this.options.mode==="advanced"?this.css.filterButtonAdvanced:this.css.filterButton;if(showAdvancedInHeader&&this.options.advancedModeHeaderButtonLocation==="right"){buttonCss=this.css.filterButtonAdvancedRight;button=$("<span></span>").appendTo(cell).addClass(buttonCss).data("colIndex",i)}else{button=$("<span></span>").prependTo(cell).addClass(buttonCss).data("colIndex",i)}if(this.options.mode==="advanced"){if(!cell.hasClass(this.grid.css.headerCellFeatureEnabledClass)){cell.addClass(this.grid.css.headerCellFeatureEnabledClass)}}if(this.options.mode==="simple"||this.options.mode==="advanced"&&this.options.advancedModeEditorsVisible===true){button.wrap('<a id="'+id+'_button" data-col-key="'+cols[i].key+'" href="#" title="'+this._getLocaleValue("tooltipTemplate").replace("${condition}",this._getLocaleValue("noFilterLabel"))+'" ></a>')}else{button.wrap('<a id="'+id+'_button" data-col-key="'+cols[i].key+'" href="#" title="'+this._getLocaleValue("tooltipTemplate").replace("${condition}",this._getLocaleValue("noFilterLabel"))+'" style="display:inline;"></a>')}indicatorContainer=cell.find(".ui-iggrid-indicatorcontainer");if(indicatorContainer.length===0){indicatorContainer=$("<div></div>").appendTo(cell).addClass("ui-iggrid-indicatorcontainer")}indicatorContainer.append(button.parent());w=parseInt(w,10);if(this.grid.options.height===null&&$.ig.util.isFF){buttonWidth=button.outerWidth(true)}else{buttonWidth=button.outerWidth(false)}w-=buttonWidth;cell.data("buttonWidth",buttonWidth)}if(this.options.renderFilterButton===true){if(this.options.advancedModeEditorsVisible===true||this.options.mode!=="advanced"){button.parent().bind({mousedown:$.proxy(this._toggleDropDown,this),mouseup:cancelFunc,click:cancelFunc,blur:$.proxy(this._deactivateButton,this),keydown:$.proxy(this._toggleDropDownKeyboard,this),mouseover:$.proxy(this._hoverButton,this),mouseout:$.proxy(this._unhoverButton,this),focus:$.proxy(this._activateButton,this)});if($.ig.util.isIE){button.parent().bind({focusout:$.proxy(this._deactivateButton,this)})}}else if(this._renderFCFor(cols[i].key)===false){button.parent().bind({click:$.proxy(this._openFilterDialog,this),keydown:$.proxy(this._openFilterDialogFromKeyboard,this),focus:$.proxy(this._activateButton,this),blur:$.proxy(this._deactivateButton,this)})}}if(this.options.advancedModeEditorsVisible===true||this.options.mode!=="advanced"){this._createEditor(cell,w,i,cols[i])}}if(this._getFilterDialog().length>0){this._getFilterDialog().remove()}this._renderFilterDialog()},_renderFCFor:function(columnKey){return!(this._fcData===null||this._fcData===undefined||this.options.renderFC===false||this._fcData[columnKey]!==true)},_columnMap:function(){var o=this.options,i,elem,cs=o.columnSettings,csLength=cs.length,result=[];if(o.renderFC===false){return false}for(i=0;i<csLength;i++){elem={columnKey:cs[i].columnKey,enabled:true};if(cs[i].allowFiltering===false){elem.enabled=false}result.push(elem)}return result},_headerCellRendered:function(){if(this._isInitFC!==true){this._initFC()}},_dataBound:function(){var i,editorProvider,editor;for(i=0;i<this._editorProviders.length||0;i++){editorProvider=this._editorProviders[i];editor=editorProvider.getEditor?editorProvider.getEditor():null;if(editor&&editor.widgetName&&(editor.widgetName==="igDateEditor"||editor.widgetName==="igDatePicker"||editor.widgetName==="igTimePicker")&&$.contains(document.documentElement,editor.element)){this._setEditorOption(editor,"displayTimeOffset",this.grid._calcOffsetForCol(null,this.grid.getColumnByTD(editor.element.closest("td")).column))}}},_openFilterDialogFromFC:function(event,columnKey){this._openFilterDialog(event,columnKey)},toggleFilterRowByFeatureChooser:function(event){var fc,$filterRow,o=this.options,isShown=this._filterRowShown,$thead=this.grid._rootContainer().find("thead"),isAdvanced=!(o.mode==="simple"||o.advancedModeEditorsVisible===true);if(isShown===null||isShown===undefined){this._filterRowShown=true;
isShown=this._filterRowShown}if(isAdvanced===false||isAdvanced&&o.advancedModeEditorsVisible){$filterRow=$thead.find('tr[data-role="filterrow"]');if(isShown===true){$filterRow.hide();if(document.documentMode===7||$.ig.util.isIE7){$filterRow.children().hide()}isShown=false}else{$filterRow.show();if(document.documentMode===7||$.ig.util.isIE7){$filterRow.children().show()}this._setEditorsWidth();isShown=true}if(event===null||event===undefined){fc=this.grid.element.data("igGridFeatureChooser");if(fc){fc._toggleSelectedItems("Filtering")}}this._filterRowShown=isShown;this.grid._initializeHeights();if(this.grid.options.autofitLastColumn&&this.grid.options.height&&this.grid.hasVerticalScrollbar()!==this.grid._hasVerticalScrollbar){this.grid._adjustLastColumnWidth()}}},_getEditorVal:function(editorProvider){if(Object.keys(editorProvider).length===0){return null}var editor=editorProvider.getEditor();if(editor._focused&&editor.widgetName!=="igDatePicker"){var newValue=editor._editorInput.val();if(newValue===editor._maskWithPrompts){newValue=""}editor._processInternalValueChanging(newValue)}return editorProvider.getValue()},_createEditor:function(parent,w,colIndex,col){var $editor,colType,colKey,self=this,editorType,buttonType,colSetting,isReadOnly=false,cond,provider,editorOptions,editorContainer,placeHolderText,editorCallbacks={keyDown:$.noop,textChanged:$.noop};colType=col.dataType;colKey=col.key;if(colType==="object"){colType=this._getColType(colKey)}colSetting=this._findColumnSetting(colKey);cond=colSetting.condition;placeHolderText=this._getNullTextByCondition(cond);editorOptions=colSetting?colSetting.editorOptions||{}:{};editorType=colSetting?this._getEditorProviderType(colType,colSetting.editorType):null;provider=colSetting?colSetting.editorProvider:null;if(!provider){try{provider=$.ig.GetEditorProvider(this.grid,col,editorType)}catch(err){this._editorProviders.push({});return}$editor=$("<span />").attr("data-filter-editor",true);if(this.options.filterButtonLocation==="left"){$editor.appendTo(parent)}else{$editor.prependTo(parent)}}if(this._isBool(colType)){isReadOnly=true;placeHolderText=""}if(colSetting.defaultExpressions&&colSetting.defaultExpressions.length>0){$(colSetting.defaultExpressions).each(function(){if(colSetting.customConditions&&colSetting.customConditions.hasOwnProperty(this.cond)){cond=colKey+"_"+this.cond;placeHolderText=this.cond}else{cond=this.cond;placeHolderText=self._getNullTextByCondition(cond)}isReadOnly=!self.requiresFilteringExpression(cond)})}if(editorType==="datepicker"){buttonType="dropdown,clear"}else if(editorOptions.buttonType){buttonType=editorOptions.buttonType}else{buttonType=editorType==="timepicker"||colType==="time"?"spin,clear":"clear"}editorOptions=$.extend({},{width:w,language:this.grid.options.language,regional:col.regional||this.grid.options.regional,preventSubmitOnEnter:editorOptions.preventSubmitOnEnter||true,suppressNotifications:editorOptions.suppressNotifications||true,readOnly:isReadOnly,textAlign:editorOptions.textAlign||"left",buttonType:buttonType,displayTimeOffset:this.grid._calcOffsetForCol(null,col),revertIfNotValid:editorOptions.revertIfNotValid||false,placeHolder:placeHolderText,allowNullValue:editorOptions.allowNullValue||true,tabIndex:this.grid.options.tabIndex,rendered:function(e,args){var edtr=args.owner,$edtrCont,$indCont;if(edtr.editorContainer){$edtrCont=edtr.editorContainer()}else{$edtrCont=edtr.element}if($edtrCont){$indCont=parent.find(".ui-iggrid-indicatorcontainer");if(self.options.filterButtonLocation==="left"){$indCont.prependTo($edtrCont)}else{$indCont.appendTo($edtrCont)}}if(!self.options.renderFilterButton){args.owner.element.on({mousedown:function(e){if(edtr.options.readOnly){self._toggleDropDown(e)}},blur:$.proxy(self._closeDropDown,self),keydown:$.proxy(self._toggleDropDownKeyboard,self)})}}},editorOptions);if(colType==="date"||colType==="datetime"||colType==="time"){editorOptions=$.extend({},editorOptions,{enableUTCDates:this.options.type==="remote"?true:this.grid.options.enableUTCDates,displayTimeOffset:this.options.type==="remote"?0:this.grid._calcOffsetForCol(null,col),valueChanged:$.proxy(this._filter,this),revertIfNotValid:false});editorCallbacks=$.extend(editorCallbacks,{valueChanged:$.proxy(this._filter,this)});if(col.format){editorOptions.dateInputFormat=col.format}}else{editorCallbacks=$.extend(editorCallbacks,{textChanged:$.proxy(this._filter,this)})}if(this._isBool(colType)){editorOptions=$.extend({},editorOptions,{isLimitedToListValues:false,allowNullValue:true})}editorContainer=provider.createEditor(editorCallbacks,colKey,editorOptions,this.grid.options.tabIndex,col.format,$editor,this.options.type==="remote"?0:this.grid._calcOffsetForCol(null,col));if(!$editor){$editor=editorContainer;var $indCont=parent.find(".ui-iggrid-indicatorcontainer");var parentDiv=$("<div />").addClass(this.css.customEditorParentDiv);var wrapperDiv=$("<div />").addClass(this.css.customEditorInputContainerDiv);var wrapperSpan=$("<span />").attr("data-filter-editor",true);$editor.appendTo(wrapperSpan);wrapperSpan.appendTo(wrapperDiv);if(self.options.filterButtonLocation==="left"){wrapperDiv.appendTo(parentDiv);$indCont.prependTo(parentDiv)}else{wrapperDiv.prependTo(parentDiv);$indCont.appendTo(parentDiv)}parentDiv.appendTo(parent);provider.setSize(parentDiv.width(),parentDiv.height())}$editor.data("colIndex",colIndex).data("colKey",colKey).data("provider",provider);this._editorProviders.push(provider);if($editor.is("input")){$editor.addClass(this.css.filterCellEditor)}else{$editor.find("input").addClass(this.css.filterCellEditor)}},_fixedColumnsChanged:function(args){var i,start=args.start,$edtr,len=args.length,at=args.at;this.grid._rearrangeArray(this.options.columnSettings,start,len,at);this.grid._rearrangeArray(this._editorProviders,start,len,at);for(i=0;i<this._editorProviders.length;i++){if(!this._hasEditor(this._editorProviders[i])){continue}$edtr=$(this._editorProviders[i].getEditor().element);$edtr.data("colIndex",i);$edtr.closest("td").find("span.ui-iggrid-filterbutton").data("colIndex",i)}},_columnsAltered:function(event,args){var i,cs,start=args.start,len=args.len,idx=args.index;if(args.owner.id()!==this.grid.id()||!start&&!len&&!idx){return}for(i=0;i<this.options.columnSettings.length;i++){cs=this.options.columnSettings[i];if(this.grid._isColumnHidden(cs.columnKey)===true){start+=i<=start?1:0;len+=i>=start&&i<start+len?1:0;idx+=i<=idx?1:0}}this.grid._rearrangeArray(this.options.columnSettings,start,len,idx);this.grid._rearrangeArray(this._editorProviders,start,len,idx);for(i=0;i<this._editorProviders.length;i++){if(!this._hasEditor(this._editorProviders[i])){continue}$(this._editorProviders[i].getEditor().element).data("colIndex",i);$(this._editorProviders[i].getEditor().element).closest("td").find("span.ui-iggrid-filterbutton").data("colIndex",i)}},_findColumnSetting:function(key){var i;for(i=0;i<this.options.columnSettings.length;i++){if(this.options.columnSettings[i].columnKey===key){return this.options.columnSettings[i]}}},filter:function(expressions,updateUI,addedFromAdvanced){var i,cond;this._loadingIndicator.show();if(expressions===undefined||expressions===null||expressions.length===0){for(i=0;i<this.options.columnSettings.length;i++){cond=this.options.columnSettings[i].condition;if(!this.requiresFilteringExpression(cond)){this.options.columnSettings[i].condition=null}}}if(!addedFromAdvanced){this._filterDataSource(expressions,true);this._updateFiltersUI([],false)}else{this._filterDataSource(expressions)}if(updateUI===undefined||updateUI===true){this._updateFiltersUI(expressions===undefined?this._generateExpressions():expressions,addedFromAdvanced)}},_filter:function(ui,args){clearTimeout(this._timeoutId);this._ui=ui;this._args=args;if(parseInt(this.options.filterDelay,10)===0){this._filterInternal()}else{this._timeoutId=setTimeout($.proxy(this._filterInternal,this),this.options.filterDelay)}},_filterInternal:function(colIndex,colKey){var args=this._args,_colIndex,_colKey,noCancel,editorProvider,exprs;if(args!==undefined){_colIndex=$(args.owner.element).data("colIndex");_colKey=$(args.owner.element).data("colKey")}else{_colIndex=colIndex;_colKey=colKey}exprs=this._generateExpressions(true);noCancel=this._trigger(this.events.dataFiltering,null,{columnKey:_colKey,columnIndex:_colIndex,owner:this,newExpressions:exprs});if(noCancel){this._loadingIndicator.show();editorProvider=this._editorProviders?this._editorProviders[_colIndex]:null;if(editorProvider){editorProvider._addedFromAdvanced=false}this._curColKey=_colKey;this._curColIndex=_colIndex;this._filterDataSource(exprs,false,true)}},_filterDataSource:function(expressions,apiCall,updateUI){var exprs,i,j,expr,col,button,cols=this.grid.options.columns,found=false,defaultTooltip,noCancel;defaultTooltip=this._getLocaleValue("tooltipTemplate").replace("${condition}",this._getLocaleValue("noFilterLabel"));if(apiCall){if($.type(expressions)==="array"&&expressions.length){for(i=0;i<expressions.length;i++){expr=expressions[i];if(expr.dataType){continue}col=this.grid.columnByKey(expr.fieldName);if(col){if(col.dataType){expr.dataType=col.dataType}else{expr.dataType="string"}}}}}if(expressions!==undefined&&!updateUI){if(apiCall===true){this.grid.dataSource.settings.filtering.expressions=expressions;if(this.options.mode==="advanced"){this._filterDialogClearAll();for(i=0;i<expressions.length;i++){this._addFilterFromDialog(null,expressions[i])}}}else{this.grid.dataSource.settings.filtering.expressions=expressions}}else{if(expressions!==undefined&&updateUI){exprs=expressions}else{exprs=this._generateExpressions(true)}for(i=0;i<cols.length;i++){found=false;button=this.grid._rootContainer().find("#"+this.grid.element[0].id+"_dd_"+cols[i].key+"_button");for(j=0;j<exprs.length;j++){if(cols[i].key===exprs[j].fieldName){found=true;if((exprs[j].expr===undefined||exprs[j].expr===null||exprs[j].expr==="")&&this.requiresFilteringExpression(exprs[j].cond)){button.attr("title",defaultTooltip)}else{button.attr("title",this._getLocaleValue("tooltipTemplate").replace("${condition}",this._getLabelTextByCondition(exprs[j].cond)))}break}}if(!found){button.attr("title",defaultTooltip)}}this.grid.dataSource.settings.filtering.expressions=exprs}if(this.options.persist){this._saveFilteringExpressions()}if(this.grid._hasUnboundColumns){this.grid._rebindUnboundColumns=true}this.grid.element.trigger("iggriduisoftdirty",{owner:this});noCancel=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid,dataSource:this.grid.dataSource});if(noCancel){exprs=this.grid.dataSource.settings.filtering.expressions;if(this.options.type==="remote"){this.grid.dataSource.settings.paging.pageIndex=0;this.grid._shouldResetPaging=true}else if(this.grid.container().find(".ui-iggrid-footer .ui-iggrid-results").length>0){this.grid.container().find(".ui-iggrid-footer .ui-iggrid-results").data("overrideLabel",exprs.length)}this._filteringRequestCount++;this._preserveSorting();if(exprs.length===0){if(!apiCall){this._shouldFireDataFiltered=true}if(this.options.type==="remote"){this._filteringRequestCount=0;this.grid.dataSource.dataBind()}else{this.grid.dataSource.settings.filtering.type="local";this._filteringRequestCount=0;this.grid.dataSource.clearLocalFilter();this.grid._renderData()}}else{if(this.options.type==="remote"){if(!apiCall){this._shouldFireDataFiltered=true}this.grid.dataSource.dataBind()}else{this.grid.dataSource.settings.filtering.type="local";this.grid.dataSource.filter(exprs);this.grid._renderData();if(!apiCall){this._trigger(this.events.dataFiltered,null,{columnKey:this._curColKey,columnIndex:this._curColIndex,owner:this,expressions:exprs})}}}}},_filterDataSourceClear:function(colKey,colIndex){var i,exprs=this.grid.dataSource.settings.filtering.expressions,noCancel,noCancelFiltering,clearFiltering=false;for(i=0;i<exprs.length;i++){if(exprs[i].fieldName===colKey){clearFiltering=true;$.ig.removeFromArray(exprs,i);break}}if(!clearFiltering){return}this.grid.dataSource.settings.filtering.expressions=exprs;if(this.options.persist){this._saveFilteringExpressions()}if(!this._curColKey||colKey){this._curColKey=colKey;this._curColIndex=colIndex}noCancelFiltering=this._trigger(this.events.dataFiltering,null,{columnKey:this._curColKey,columnIndex:this._curColIndex,owner:this,newExpressions:exprs});if(noCancelFiltering){noCancel=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid,dataSource:this.grid.dataSource});if(noCancel){this.grid.dataSource.settings.paging.pageIndex=0;this._preserveSorting();this.grid._shouldResetPaging=true;this._loadingIndicator.show();if(this.options.type==="remote"){if(exprs.length>0){this._shouldFireDataFiltered=true;this._filteringRequestCount++}else{this._filteringRequestCount=0;this._shouldFireDataFiltered=true}this.grid.dataSource.dataBind()}else{this.grid.dataSource.settings.filtering.type="local";if(this.grid.container().find(".ui-iggrid-footer .ui-iggrid-results").length>0){this.grid.container().find(".ui-iggrid-footer .ui-iggrid-results").data("overrideLabel",exprs.length)}if(exprs.length>0){this._filteringRequestCount++;this.grid.dataSource.filter(exprs)}else{this._filteringRequestCount=0;this.grid.dataSource.clearLocalFilter()}this.grid._renderData();this._trigger(this.events.dataFiltered,null,{columnKey:this._curColKey,columnIndex:this._curColIndex,owner:this,expressions:exprs})}}}},_preserveSorting:function(){var hasGroupedCols=false,groupBy=this.grid.element.data("igGridGroupBy"),sortSettings=this.grid.dataSource.settings.sorting;if(groupBy&&groupBy.options&&groupBy.options.groupedColumns&&groupBy.options.groupedColumns.length>0){hasGroupedCols=true}if(sortSettings.expressions.length>0&&hasGroupedCols){sortSettings.defaultFields=sortSettings.expressions}},_getDataColumnFilteringExpressions:function(fe){if(!this.grid._hasUnboundColumns){return fe}var grid=this.grid,newFE;newFE=$.grep(fe,function(s){var col=grid.columnByKey(s.fieldName);return!col||col.unbound!==true});return newFE},_saveFilteringExpressions:function(){var fe=this._getDataColumnFilteringExpressions(this.grid.dataSource.settings.filtering.expressions);if(this.element.closest(".ui-iggrid-root").data("igGrid")){this.grid._savePersistenceData(fe,"filtering",this.grid.element[0].id)}this._filteringExpressions=fe},_preserveFiltering:function(){var fe=this._filteringExpressions||this.grid._getPersistenceData("filtering",this.grid.element[0].id);if(fe){if(this.grid._hasUnboundColumns){this._updateFiltersUI([],false)}this.grid.dataSource.settings.filtering.expressions=fe;this.grid.dataSource.settings.filtering.defaultFields=fe;this._defaultExpressions=fe}},_updateFiltersUI:function(expressions){var i,editorProvider,condName,$li,exprLen=expressions.length,clearButton;if(this._editorProviders){for(i=0;i<this._editorProviders.length;i++){if(this.options.columnSettings[i].allowFiltering!==false&&this._editorProviders[i].setValue){this._editorProviders[i].setValue(null)}}}if(this.options.showEmptyConditions&&!exprLen){for(i=0;i<this.options.columnSettings.length;i++){condName=this.options.columnSettings[i].condition;if(condName==="empty"||condName==="notEmpty"||condName==="null"||condName==="notNull"){$li=this.grid._rootContainer().find("#"+this.grid.element[0].id+"_filtering_dd").find("ul").children().first();if($li.length){this._selectDropDownItem({currentTarget:$li},null)}}}}this._updateFilterSelectionUI(expressions);for(i=0;i<exprLen;i++){condName=this._resolveConditionNameFromExpression(expressions[i]);editorProvider=this._editorProviders[this._columnIndexFromKey(expressions[i].fieldName)];if(editorProvider!==undefined&&editorProvider!==null&&editorProvider.getEditor){if(this.requiresFilteringExpression(condName)){editorProvider.setValue(expressions[i].expr)}else{this._editorValueForCondition(condName,editorProvider);if(editorProvider.renderFormat!=="checkbox"){clearButton=editorProvider.editor.clearButton();if(clearButton!==undefined&&clearButton.attr("id")&&clearButton.attr("id").indexOf("clearButton")!==-1){clearButton.hide()}}}editorProvider._addedFromAdvanced=true}}this._updateTooltips(expressions)},_updateFilterSelectionUI:function(expression){var j,condName,filterList,items;filterList=this.grid._rootContainer().find("#"+this.grid.element[0].id+"_filtering_dd").find("ul");items=filterList.children();condName=this._resolveConditionNameFromExpression(expression);for(j=0;j<items.length;j++){if($(items[j]).attr("data-cond")===condName||$(items[j]).attr("data-cond")===""&&condName===undefined){this._selectDropDownItem({currentTarget:items[j]},null,expression);break}}},_updateTooltips:function(expressions){var button,title,found,titleText,tempTooltipExpr,condName,conditionLabel,i,j,expressionFieldName,cols=this.grid.options.columns,colsLength=cols.length,isSimpleMode=this.options.mode==="simple"||this.options.advancedModeEditorsVisible===true;titleText=this._getLocaleValue("tooltipTemplate").replace("${condition}",this._getLocaleValue("noFilterLabel"));title="";for(i=0;i<expressions.length;i++){button=this.grid._rootContainer().find("#"+this.grid.element[0].id+"_dd_"+expressions[i].fieldName+"_button");if(!this.requiresFilteringExpression(expressions[i].cond)||expressions[i].expr===undefined||expressions[i].expr===null){tempTooltipExpr=""}else{tempTooltipExpr=expressions[i].expr;if(expressions[i].type==="date"||expressions[i].type==="time"){if($.type(tempTooltipExpr)==="number"){tempTooltipExpr=new Date(tempTooltipExpr)}if(expressions[i].type==="time"){tempTooltipExpr=tempTooltipExpr.toTimeString?tempTooltipExpr.toTimeString():tempTooltipExpr}else if(this.grid.options.enableUTCDates&&$.type(tempTooltipExpr)==="date"&&tempTooltipExpr.toUTCString){tempTooltipExpr=tempTooltipExpr.toUTCString()}}}expressionFieldName=expressions[i].fieldName;for(j=0;j<colsLength;j++){if(cols[j].key===expressionFieldName){expressionFieldName=cols[j].headerText;break}}condName=this._resolveConditionNameFromExpression(expressions[i]);conditionLabel=this._getLabelTextByCondition(condName);if(isSimpleMode){button.attr("title",this._getLocaleValue("tooltipTemplate").replace("${condition}",conditionLabel));continue}if(i===0){button.attr("title",expressionFieldName+" "+conditionLabel+" "+tempTooltipExpr+" ")}else{button.attr("title",title+expressions[i].logic+" "+expressionFieldName+" "+conditionLabel+" "+tempTooltipExpr+" ")}title=button.attr("title")}for(i=0;i<colsLength;i++){found=false;for(j=0;j<expressions.length;j++){if(expressions[j].fieldName===cols[i].key){found=true;break}}if(!found){this.grid._rootContainer().find("#"+this.grid.element[0].id+"_dd_"+cols[i].key+"_button").attr("title",titleText)}}},_resolveConditionNameFromExpression:function(expression){var expressionFieldName,custConds=this._dsTransformedCustomConditions;expressionFieldName=expression.fieldName;if(custConds&&custConds[expressionFieldName+"_"+expression.cond]){return expressionFieldName+"_"+expression.cond}else{return expression.cond}},_columnIndexFromKey:function(key){var i,cols=this.grid.options.columns;for(i=0;i<cols.length;i++){if(cols[i].key===key){return i}}},_generateExpressions:function(filterRowTrigger){var exprs=[],cols=this.grid.options.columns,expr,i,currentCondition,requiresEntry,isExprAdded,dt,isDateObject,defExpr,precise,format,preciseInd;for(i=0;i<cols.length;i++){if(this._editorProviders&&this._editorProviders[i]&&this._editorProviders[i]._addedFromAdvanced&&!filterRowTrigger){continue}if(this.options.columnSettings[i].allowFiltering!==true){defExpr=this.options.columnSettings[i].defaultExpressions;if(defExpr&&defExpr.length){expr=defExpr[0].expr;currentCondition=defExpr[0].cond}else{continue}}else{expr=this._getEditorVal(this._editorProviders[i]);currentCondition=this.options.columnSettings[i].condition}requiresEntry=this.requiresFilteringExpression(currentCondition);if(currentCondition===undefined||currentCondition===null||currentCondition===""){continue}if((expr===undefined||expr===null||expr==="")&&requiresEntry){continue}precise="";dt=cols[i].dataType;isDateObject=dt==="date"||dt==="time";if(isDateObject&&expr){if(this.options.type==="remote"&&this.options.filterExprUrlKey!==null&&this.options.filterExprUrlKey!==undefined){expr=Date.UTC(expr.getUTCFullYear(),expr.getUTCMonth(),expr.getUTCDate(),expr.getUTCHours(),expr.getUTCMinutes())}else{format=cols[i].format;if(format&&format.indexOf){preciseInd=format.toLowerCase().indexOf("h");if(preciseInd===-1){preciseInd=format.indexOf("m")}if(preciseInd===-1){preciseInd=format.indexOf("s")}if(preciseInd>-1){precise=format.substr(preciseInd)}}if($.type(expr)==="date"){expr=new Date(expr.valueOf());if(precise===""&&currentCondition==="after"){expr.setHours(23);expr.setMinutes(59);expr.setSeconds(59);expr.setMilliseconds(999)}}}}isExprAdded=false;if(!isDateObject||isDateObject&&expr!==null&&expr!==undefined&&currentCondition!=="empty"&&currentCondition!=="notEmpty"&&currentCondition!=="null"&&currentCondition!=="notNull"||isDateObject&&!this.requiresFilteringExpression(currentCondition)){if(expr!==""&&!this._isBool(dt)&&!this.options.filterExprUrlKey){isExprAdded=true;this._addExpressions(exprs,cols[i].key,currentCondition,expr)}else if(this._isBool(dt)&&expr!==""&&expr!==null||!this._isBool(dt)&&(this.options.filterExprUrlKey!==undefined&&this.options.filterExprUrlKey!==null||this.options.type==="local")){isExprAdded=true;this._addExpressions(exprs,cols[i].key,currentCondition,expr)}else if(this._isBool(dt)&&(expr===""||expr===null)&&(currentCondition==="null"||currentCondition==="notNull"||currentCondition==="empty"||currentCondition==="notEmpty")){isExprAdded=true;this._addExpressions(exprs,cols[i].key,currentCondition,expr)}if(isExprAdded){if(dt===undefined&&$.type(expr)==="string"){exprs[exprs.length-1].dataType="string"}if(cols[i].unbound){exprs[exprs.length-1].dataType=dt}if(precise){exprs[exprs.length-1].preciseDateFormat=precise}}}}return exprs},_addExpressions:function(expressionsList,fieldName,condition,expressionValue){if($.type(expressionValue)==="array"){var i;for(i=0;i<expressionValue.length;i++){expressionsList.push({fieldName:fieldName,cond:condition,expr:expressionValue[i],logic:"OR"})}}else{expressionsList.push({fieldName:fieldName,cond:condition,expr:expressionValue})}},_getDefaultCondition:function(type){var result="equals";if(type===undefined||type===null||type==="string"){result="contains"}else if(type==="number"){result="equals"}else if(type==="date"){result="on"}else if(type==="time"){result="at"}else if(this._isBool(type)){result="true"}else if(type==="object"){result=""}return result},_initDefaultSettings:function(){var settings=[],key,de,cs=this.options.columnSettings,i,j,k,l,cols=this.grid.options.columns,allowFiltering,defExpr,isToCheckUnboundColumns=this.grid._hasUnboundColumns===true&&this.options.type==="remote",conditionIsValid,conds,custConds;this._defaultExpressions=this.grid.dataSource.settings.filtering.expressions||[];if(cols&&cols.length>0){for(i=0;i<cols.length;i++){allowFiltering=true;if(isToCheckUnboundColumns&&this.grid.getUnboundColumnByKey(cols[i].key)!==null){allowFiltering=false}settings[i]={columnIndex:i,columnKey:cols[i].key,allowFiltering:allowFiltering}}}if(settings.length===0&&this.grid.options.autoGenerateColumns&&cs.length>0){for(i=0;i<cs.length;i++){if(!cs[i].columnKey){continue}conds=this._populateConditionsList(cs[i].columnKey,this._getColType(cs[i].columnKey));defExpr=cs[i].defaultExpressions;custConds=cs[i].customConditions;if(defExpr&&defExpr.length>0){for(k=0;k<defExpr.length;k++){conditionIsValid=false;for(l=0;l<conds.length;++l){for(key in custConds){if(custConds.hasOwnProperty(key)){if(conds[l].condition===cs[i].columnKey+"_"+defExpr[k].cond){conditionIsValid=true;break}}}if(conditionIsValid){break}if(conds[l].condition===defExpr[k].cond){conditionIsValid=true;break}}if(!conditionIsValid){throw new Error($.ig.util.stringFormat(this._getLocaleValue("defaultConditionContainsInvalidCondition"),cs[i].columnKey))}de={fieldName:cs[i].columnKey,expr:defExpr[k].expr,cond:defExpr[k].cond};if(defExpr[k].logic){de.logic=defExpr[k].logic}this._defaultExpressions.push(de)}}}}else{for(i=0;i<cs.length;i++){for(j=0;j<settings.length;j++){if(settings[j].columnKey===cs[i].columnKey||cs[i].columnKey===undefined&&settings[j].columnIndex===cs[i].columnIndex){cs[i].columnKey=settings[j].columnKey;break}}if(j===settings.length){continue}conds=this._populateConditionsList(cs[i].columnKey,this._getColType(cs[i].columnKey));for(key in cs[i]){if(cs[i].hasOwnProperty(key)){if(key!=="columnKey"&&key!=="columnIndex"){settings[j][key]=cs[i][key]}if(key==="defaultExpressions"&&cs[i][key]){defExpr=cs[i][key];custConds=cs[i].customConditions;for(k=0;k<defExpr.length;k++){conditionIsValid=false;for(l=0;l<conds.length;++l){for(key in custConds){if(custConds.hasOwnProperty(key)){if(conds[l].condition===cs[i].columnKey+"_"+defExpr[k].cond){conditionIsValid=true;break}}}if(conditionIsValid){break}if(conds[l].condition===defExpr[k].cond){conditionIsValid=true;break}}if(!conditionIsValid){throw new Error($.ig.util.stringFormat(this._getLocaleValue("defaultConditionContainsInvalidCondition"),cs[i].columnKey))}de={fieldName:cs[i].columnKey,expr:defExpr[k].expr,cond:defExpr[k].cond};if(defExpr[k].logic){de.logic=defExpr[k].logic}this._defaultExpressions.push(de)}}}}}}this.options.columnSettings=settings;this.grid.dataSource.settings.filtering.expressions=this._defaultExpressions;this.grid.dataSource.settings.filtering.defaultFields=this._defaultExpressions},_transformCustomConditionsForDataSource:function(){var i,cs=this.options.columnSettings,curCS,custConds,curCond,newCond,key,keyCond;for(i=0;i<cs.length;++i){curCS=cs[i];custConds=curCS.customConditions;if(custConds){this._dsTransformedCustomConditions=this._dsTransformedCustomConditions||{};for(key in custConds){if(custConds.hasOwnProperty(key)){curCond=custConds[key];keyCond=curCS.columnKey+"_"+key;newCond={requireExpr:!!curCond.requireExpr,filterFunc:curCond.filterFunc,expressionText:curCond.expressionText||key};if(!this._getLabelTextByCondition(keyCond)){this.options.locale=this.options.locale||{};this.options.locale[keyCond+"Label"]=curCond.labelText;this.options.locale[keyCond+"NullText"]=curCond.labelText}this._dsTransformedCustomConditions[keyCond]=newCond}}}}this.grid.dataSource.settings.filtering.customConditions=this._dsTransformedCustomConditions},_renderDropDown:function(type,id,colName){var ul,i,item,obj,conds,cs=this.options.columnSettings,self=this,liHtml="",dsExpr;if($("#"+this.grid.id()+"_filtering_dd").length){ul=$("#"+this.grid.id()+"_filtering_dd").find("ul")}else{ul=this._renderDropDownElement(id,colName)}conds=this._populateConditionsList(colName,this._getColType(colName));if(this.options.filterDropDownItemIcons!==true&&conds.length>0){liHtml+="<li tabindex='"+this.grid.options.tabIndex+"' class='"+this.css.filterDropDownListItem+" "+this.css.filterDropDownListItemClear+"'> <a  class='ui-corner-all'>"+this._getLocaleValue("clearLabel")+"</a> </li>";for(i=0;i<conds.length;++i){liHtml+="<li tabindex='"+this.grid.options.tabIndex+"' class='"+this.css.filterDropDownListItem+"' data-cond='"+(conds[i].condition===undefined?"":conds[i].condition)+"' >"+"<a  class='ui-corner-all'>"+conds[i].text+"</a> </li>"}ul.append(liHtml)}else if(this.options.filterDropDownItemIcons===true&&conds.length>0){obj={itemClass:this.css.filterDropDownListItemWithIcons,imgContainerClass:this.css.filterItemIconContainer,textClass:this.css.filterDropDownListItemTextContainer};this._renderDropDownToList(obj,[{text:this._getLocaleValue("clearLabel"),localeId:"clearLabel",imgClass:this.css.filterItemIconClear,itemClass:this.css.filterDropDownListItemClear}],ul);this._renderDropDownToList(obj,conds,ul)}ul.parent().bind({mousedown:function(){self._cancelNextBlur=true}});ul.children().bind({focus:function(evt){$(evt.target).parent().data("focussed",true)},blur:function(evt){$(evt.target).parent().data("focussed",false);setTimeout(function(){self._checkCloseDropDown(evt)},10)},keydown:$.proxy(this._changeSelectionKeyboard,this)});if(this.options.mode==="advanced"){this._renderAdvancedButton(ul)}for(i=0;i<this.grid.dataSource.settings.filtering.expressions.length;i++){if(this.grid.dataSource.settings.filtering.expressions[i].fieldName===colName){dsExpr=this.grid.dataSource.settings.filtering.expressions[i]}}for(i=0;i<cs.length;i++){if(cs[i].columnKey===colName){if(cs[i].condition==="null"){item=ul.find(':contains("'+this._getLabelTextByCondition("null")+'")')}else if(!this.requiresFilteringExpression(cs[i].condition)&&!dsExpr){continue}else{item=ul.find(':contains("'+this._getLabelTextByCondition(cs[i].condition)+'")')}item=item.children().first().closest("li");item.addClass(this.css.filterDropDownListItemActive).parent().data("selectedItem",$("li",item.parent()).index(item))}}if(dsExpr){this._updateFilterSelectionUI(dsExpr)}},_renderAdvancedButton:function(ul){var li;li=$("<li></li>").appendTo(ul).addClass(this.css.filterDropDownListItemAdvanced);this._currentButton=$(toStaticHTML('<input type="button"></input>'));this._currentButton.igButton({labelText:this._getLocaleValue("advancedButtonLabel")}).attr({"data-localeid":"advancedButtonLabel","data-localeattr":"value"}).bind({mousedown:$.proxy(this._openFilterDialog,this)});li.append(this._currentButton)},_openFilterDialogFromKeyboard:function(event){if(event.keyCode===$.ui.keyCode.ENTER){this._openFilterDialog(event)}},_checkModalDialogFocus:function(){var $dialog=this._getFilterDialog(),$container=this.grid._rootContainer();$container.unbind("keydown.focusChecker");$container.bind("keydown.focusChecker",function(e){var tabElems,target,gridContainer=$container[0];if(e.keyCode===$.ui.keyCode.TAB){target=document.activeElement;if(!target||!gridContainer){return}if(target===gridContainer||$.contains(gridContainer,target)&&!$.contains($dialog[0],target)){tabElems=$(":tabbable",$dialog);tabElems.first().focus();return}}})},_removeFilterDialog:function(){this._getFilterDialog().remove();this._filterDialog=null},_getFilterDialog:function(){this._filterDialog=this._filterDialog&&this._filterDialog.length?this._filterDialog:this.grid._rootContainer().find("#"+this.grid.container().attr("id")+"_dialog");return this._filterDialog},_filterDialogOkClicked:function(event,ui){var noCancel=this._trigger(this.events.filterDialogFiltering,null,{dialog:this._getFilterDialog(),owner:this});if(noCancel){ui.toClose=true}},_openFilterDialog:function(event,columnKey){var $target=$(event.target),dialog=this._getFilterDialog();this._dialogCurrentColumn=$target.closest("ul").data("colName");if(this._dialogCurrentColumn===undefined||this._dialogCurrentColumn===null){if(columnKey!==null&&columnKey!==undefined){this._dialogCurrentColumn=columnKey}else{this._dialogCurrentColumn=$target.closest("th").data("colName")}}if(this._dialogCurrentColumn===undefined||this._dialogCurrentColumn===null){this._dialogCurrentColumn=$target.attr("data-col-key")}dialog[this.options.dialogWidget]("openModalDialog");event.preventDefault();event.stopPropagation()},_filterDialogOpening:function(event){var maxZ,left,top,pos,h,w,bh,dh,dw,bw,addDefault=true,noCancel=true,block=this.grid._rootContainer().find("#"+this.grid.container().attr("id")+"_block"),dialog=this._getFilterDialog(),rOffset,i,expressions=this.grid.dataSource.settings.filtering.expressions;this._checkModalDialogFocus();maxZ=$.ig.getMaxZIndex(this.grid.container().attr("id")+"_dialog");block.css("zIndex",maxZ+1);dialog.css("zIndex",maxZ+2);if(this.options.filterDialogContainment==="owner"){dialog.draggable("option","containment",this.grid._rootContainer())}else{dialog.draggable("option","containment","document")}dialog.find(".ui-iggrid-filtertable tbody tr").remove();this._dialogCurrentType=this.grid.columnByKey(this._dialogCurrentColumn).dataType;dialog.find(".ui-iggrd-filtertable tbody tr").remove();if(expressions&&expressions.length>0){addDefault=true;for(i=0;i<expressions.length;i++){if(!addDefault||expressions[i].fieldName===this._dialogCurrentColumn){
addDefault=false}this._addFilterFromDialog(null,expressions[i])}if(addDefault){this._addFilterFromDialog()}this._setFilteringConditions(expressions,dialog)}else{this._addFilterFromDialog()}noCancel=this._trigger(this.events.filterDialogOpening,null,{dialog:dialog,owner:this});if(noCancel){pos=$.ig.util.offset(this.grid._rootContainer());left=pos.left;top=pos.top;if(block.outerWidth()!==this.grid._rootContainer().outerWidth()){block.css("width",this.grid._rootContainer().outerWidth())}if(block.outerHeight()!==this.grid._rootContainer().outerHeight()){block.css("height",this.grid._rootContainer().outerHeight())}this.grid._rootContainer().find("#"+this.grid.container().attr("id")+"_dialog_error").hide();rOffset=$.ig.util.getRelativeOffset(block);block.css({left:left-rOffset.left,top:top-rOffset.top}).fadeToggle();w=this.grid._rootContainer().outerWidth();h=this.grid._rootContainer().outerHeight();bw=$(window).width();bh=$(window).height();if(w+left>bw){w=w-(w+left-bw)}if(w<=0){w=this.grid._rootContainer().outerWidth()}if(h+top>bh){h=h-(h+top-bh)}if(h<=0){h=this.grid._rootContainer().outerHeight()}dh=parseInt(this.options.filterDialogHeight,10);dw=parseInt(this.options.filterDialogWidth,10);if(isNaN(dh)||dh<=0){dh=dialog.outerHeight()}if(isNaN(dw)||dw<=0){dw=dialog.outerWidth()}top=top+parseInt(h/2,10)-dh/2;left=left+parseInt(w/2,10)-dw/2;top=top<0?pos.top:top;left=left<0?pos.left:left;rOffset=$.ig.util.getRelativeOffset(dialog);dialog.focus();if(!(this.options.mode==="advanced"&&this.options.advancedModeEditorsVisible===false)&&this._currentTarget!==null&&this._currentTarget!==undefined){this._toggleDropDown({currentTarget:this._currentTarget},true)}}else{event.preventDefault();event.stopPropagation()}},_filterDialogOpened:function(){var dialog=this._getFilterDialog();this._trigger(this.events.filterDialogOpened,null,{dialog:dialog,owner:this})},_closeFilterDialog:function(event){var dialog=this._getFilterDialog();dialog[this.options.dialogWidget]("closeModalDialog",false,event);event.preventDefault();event.stopPropagation()},_setFilteringConditions:function(filtExpr,dialog){var boolLogicDropDown=dialog.find("div."+this.css.filterDialogAddConditionDropDown+" input:first");if(filtExpr.length>0){if(filtExpr[0].logic==="AND"){boolLogicDropDown.val(this._getLocaleValue("filterDialogAllLabel"))}else{boolLogicDropDown.val(this._getLocaleValue("filterDialogAnyLabel"))}}},_filterDialogClosing:function(evt,ui){var noCancel=this._trigger(this.events.filterDialogClosing,null,{owner:this});if(!noCancel){ui.toClose=false;evt.preventDefault();evt.stopPropagation()}else{ui.toClose=true}},_filterDialogClosed:function(evt,ui){this._trigger(this.events.filterDialogClosed,null,{owner:this});if(ui.accepted){this._searchFilterDialog()}},_getColumnCondByText:function(text,colKey){var conds=this._populateConditionsList(colKey,this._getColType(colKey));var cond=conds.filter(function(cond){return cond.text===text});return cond.length!==0?cond[0].condition:""},_searchFilterDialog:function(){var expressions=[],rows,boolLogic,filterLogic,i,type,exprObj,$row,selectedCol,expr,noCancelFiltering=true,cond,col,$input,hrs,mins,sec,ms,provider;rows=this._getFilterDialog().find("[data-af-row]");if(!rows.length){rows=this.grid._rootContainer().find("#"+this.grid.container().attr("id")+"_dialog table tbody").children()}boolLogic="and";filterLogic=this.grid._rootContainer().find("#"+this.grid.container().attr("id")+"_dialog input:first");if(filterLogic.length>0){boolLogic=this.grid._rootContainer().find("#"+this.grid.container().attr("id")+"_dialog input:first")[0].value===this._getLocaleValue("filterDialogAllLabel")?"AND":"OR"}for(i=0;i<rows.length;i++){$row=$(rows[i]);$input=this._getDialogColSelByRow($row);selectedCol=$input.data("igTextEditor").getSelectedListItem().data("colKey");if(selectedCol!==undefined){col=this.grid.columnByKey(selectedCol)}if(!col){col=this.grid.columnByText($input[0].value)}if(!col){continue}type=col.dataType;provider=this._getDialogExprSelByRow($row).data("provider");expr=provider.getValue();expr=!expr&&type==="string"?"":expr;cond=this._getColumnCondByText(this._getDialogCondSelByRow($row)[0].value,col.key);if($.type(expr)==="date"){if(this.options.type==="local"&&(!col.format||col.format==="date")){if(cond==="after"){hrs=23;mins=59;sec=59;ms=999}else{hrs=0;mins=0;sec=0;ms=0}}if(provider.editor&&provider.editor.options.enableUTCDates){if(hrs===undefined){hrs=expr.getUTCHours();mins=expr.getUTCMinutes()}expr=Date.UTC(expr.getUTCFullYear(),expr.getUTCMonth(),expr.getUTCDate(),hrs,mins)}else if(hrs!==undefined){expr.setHours(hrs);expr.setMinutes(mins);expr.setSeconds(sec);expr.setMilliseconds(ms)}}exprObj={fieldName:col.key,cond:cond,expr:expr,logic:boolLogic,type:type};if(col.unbound&&type){exprObj.dataType=type}else if(type===undefined&&$.type(expr)==="string"){exprObj.dataType="string"}expressions.push(exprObj)}this._currentAdvancedExpressions=expressions;noCancelFiltering=this._trigger(this.events.dataFiltering,null,{owner:this,newExpressions:expressions});if(noCancelFiltering){this.filter(expressions,true,true)}},_filterDialogStartMove:function(){this._isFilterDialogMouseDown=true},_filterDialogStopMove:function(){this._isFilterDialogMouseDown=false;this._dialogClientX=undefined;this._dialogClientY=undefined},_filterDialogMove:function(e,ui){$(e.target).find(".ui-igedit-fieldincontainer").igTextEditor("hideDropDown");this._trigger(this.events.filterDialogMoving,null,{dialog:e.target,owner:this,originalPosition:ui.originalPosition,position:ui.position})},_renderFilterDialog:function(){var dialog,condObj,dropDownData,condElement,condDropDown,closeButton,f=this,opts=this.options,id=this.grid.container().attr("id"),captionsContainer,dialogContent,noCancel=true,addClearButtons,limit,container,containment,titleLabel=this._getLocaleValue("filterDialogCaptionLabel"),searchButtonLabel=this._getLocaleValue("filterDialogOkLabel"),cancelButtonLabel=this._getLocaleValue("filterDialogCancelLabel");container=this.grid._rootContainer();if(this.options.filterDialogContainment==="owner"){containment=this.grid._rootContainer()}else{containment="window"}dialog=$("<div></div>").appendTo(container).attr("id",id+"_dialog");dialog[this.options.dialogWidget]({containment:containment,locale:{modalDialogCaptionText:titleLabel,buttonApplyText:searchButtonLabel,buttonCancelText:cancelButtonLabel},modalDialogWidth:opts.filterDialogWidth,modalDialogHeight:opts.filterDialogHeight,gridContainer:this.grid._rootContainer(),modalDialogOpening:$.proxy(this._filterDialogOpening,this),modalDialogOpened:$.proxy(this._filterDialogOpened,this),modalDialogMoving:$.proxy(this._filterDialogMove,this),modalDialogClosing:$.proxy(this._filterDialogClosing,this),modalDialogClosed:$.proxy(this._filterDialogClosed,this),buttonOKClick:$.proxy(this._filterDialogOkClicked,this),tabIndex:this._getNextTabIndex()});captionsContainer=dialog[this.options.dialogWidget]("getCaptionButtonContainer");closeButton=$("<span></span>").appendTo($("<a></a>").appendTo(captionsContainer).attr({href:"#",role:"button","data-localeid":"filterDialogCloseLabel","data-localeattr":"title",title:this._getLocaleValue("filterDialogCloseLabel"),tabindex:this._getNextTabIndex()}).bind({click:$.proxy(this._closeFilterDialog,this)}).addClass("ui-dialog-titlebar-close ui-corner-all")).addClass("ui-icon ui-icon-closethick");noCancel=this._trigger(this.events.filterDialogContentsRendering,null,{dialogElement:dialog,owner:this});if(noCancel){dialogContent=dialog[this.options.dialogWidget]("getContent");condObj={label1:this._getLocaleValue("filterDialogConditionLabel1"),label2:this._getLocaleValue("filterDialogConditionLabel2")};dropDownData=[{text:this._getLocaleValue("filterDialogAllLabel"),dataLocale:"filterDialogAllLabel",value:"all"},{text:this._getLocaleValue("filterDialogAnyLabel"),dataLocale:"filterDialogAnyLabel",value:"any"}];if(this.options.filterDialogAddConditionTemplate&&typeof this.options.filterDialogAddConditionTemplate==="string"){condElement=$(this._fTmplWrappers[this.grid.id()+"_filterDialogAddConditionTemplate"](condObj))}else{condElement=$("<div><span data-localeid='filterDialogConditionLabel1'>"+condObj.label1+"</span><div><input tabindex='"+this._getNextTabIndex()+"' "+"data-localeattr='title' "+"data-localeid='filterDialogConditionDropDownLabel' "+" title='"+this._getLocaleValue("filterDialogConditionDropDownLabel")+"'/></div><span data-localeid='filterDialogConditionLabel2'>"+condObj.label2+"</span></div>")}condElement.appendTo(dialogContent).addClass(this.css.filterDialogAddCondition);if(this.options.filterDialogAddConditionDropDownTemplate&&typeof this.options.filterDialogAddConditionDropDownTemplate==="string"){condDropDown=$(this._fTmplWrappers[this.grid.id()+"_filterDialogAddConditionDropDownTemplate"](dropDownData));condDropDown.appendTo(condElement.find("div").addClass(this.css.filterDialogAddConditionDropDown).find("select"))}else{condElement.find("div").addClass(this.css.filterDialogAddConditionDropDown).find("input").igTextEditor({language:this.grid.options.language,preventSubmitOnEnter:true,listItems:[dropDownData[0].text,dropDownData[1].text],button:"dropdown",isLimitedToListValues:true,allowNullValue:false,buttonType:"dropdown",height:24,width:"80px",value:dropDownData[0].text,dropDownAttachedToBody:true})}addClearButtons=$("<div></div>").appendTo(dialogContent);$(toStaticHTML('<input type="button"></input>')).attr({tabindex:this._getNextTabIndex(),"data-af-add-button":true,"data-localeid":"filterDialogAddLabel","data-localeattr":"value"}).appendTo($("<span></span>").appendTo(addClearButtons).addClass(this.css.filterDialogAddButton)).igButton({labelText:this._getLocaleValue("filterDialogAddLabel"),width:this.options.filterDialogAddButtonWidth,tabindex:this._getNextTabIndex()}).bind({click:$.proxy(this._addFilterFromDialog,this)});$("<button type='button' />").attr({id:id+"_afd_clearall",tabindex:this._getNextTabIndex(),"data-af-clear-all-button":true}).appendTo(addClearButtons).css("float","right").igButton({labelText:this._getLocaleValue("filterDialogClearAllLabel"),click:$.proxy(this._filterDialogClearAll,this),css:{buttonClasses:this.css.filterDialogClearAllButton,buttonHoverClasses:"",buttonActiveClasses:"",buttonFocusClasses:"",buttonLabelClass:""}});$("<label></label>").appendTo(dialogContent).attr("id",dialog.attr("id")+"_error").hide().text(this._getLocaleValue("filterDialogErrorLabel")).addClass("ui-widget ui-state-error ui-igvalidator-label");$("<table><tbody></tbody></table>").appendTo(dialogContent).addClass(this.css.filterDialogFiltersTable).css("width","100%").css("border-collapse","collapse").css("border-spacing",0);if(this._hc===true){limit=this.grid._rootContainer().find("#"+this.grid.element[0].id.split("_")[0]+"_container")}else{limit=this.grid._rootContainer()}dialog.bind({keydown:function(e){var tabElems,first,last;if(e.keyCode===$.ui.keyCode.ESCAPE){f._closeFilterDialog(e)}if(e.keyCode!==$.ui.keyCode.TAB){return}tabElems=$(":tabbable",dialog);first=tabElems.first();last=tabElems.last();if(e.target===last[0]&&!e.shiftKey){first.focus();return false}if(e.target===first[0]&&e.shiftKey){last.focus();return false}},drag:function(){dialog.find("input[data-af-col]").igTextEditor("hideDropDown")}});dialog.find(".ui-dialog-content").bind({scroll:function(){dialog.find("input[data-af-col]").igTextEditor("hideDropDown")}});this._trigger(this.events.filterDialogContentsRendered,null,{dialogElement:dialog,owner:this})}},_setResizableEnv:function(){var initH,e=this._getFilterDialog(),rCont=e.find(">.ui-dialog-content"),hCont=e.find(">.ui-dialog-titlebar"),bCont=e.find(">.ui-dialog-buttonpane");if(!this._resizeCont){this._resizeCont=rCont;initH=e.height()-hCont.outerHeight()-(rCont.outerHeight()-rCont.height())-bCont.outerHeight();this._setFilterDialogContentHeight(initH)}this._resizeCont=rCont;if(e[0].style.height===""){e.css("height",e.height())}this._trigger(this.events.filterDialogOpened,null,{dialog:e,owner:this})},_resizeHandler:function(event,ui){var u=ui.originalElement,heightDifference,e=this._getFilterDialog(),rCont=e.find(">.ui-dialog-content"),hCont=e.find(">.ui-dialog-titlebar"),bCont=e.find(">.ui-dialog-buttonpane"),pad=rCont.outerHeight()-rCont.height();heightDifference=hCont.outerHeight(true)+bCont.outerHeight(true)+pad;this._setFilterDialogContentHeight(u.height()-heightDifference)},_setFilterDialogContentHeight:function(height){this._resizeCont.css({height:height+"px"})},_changeFilterCondition:function(e){var editor,condition,$target=$(e.target),$row=$target.closest("[data-af-row]");if(!$row.length){$row=$target.closest("tr")}condition=this._getColumnCondByText(e.target.value,this._dialogCurrentColumn);editor=this._getDialogExprSelByRow($row);this._setFilterDialogInput(editor,condition)},_setFilterDialogInput:function(editor,condition){var editorProvider=editor.data("provider"),requiresEntry=this.requiresFilteringExpression(condition);if(!editorProvider){return}this._setEditorOption(editorProvider.getEditor(),"readOnly",!requiresEntry);if(!requiresEntry){this._editorValueForCondition(condition,editorProvider)}},_getDialogColSelByRow:function($frow){var $elem=$frow.find("[data-af-col]");if(!$elem.length){$elem=$frow.find("td:first").find("input").first()}return $elem},_getDialogCondSelByRow:function($frow){var $elem=$frow.find("[data-af-cond]");if(!$elem.length){$elem=$frow.find("td:nth-child(2)").find("input").first()}return $elem},_getDialogExprSelByRow:function($frow){var $elem=$frow.find("[data-af-expr]");if(!$elem.length){$elem=$frow.find("td:nth-child(3)").find("input").first()}return $elem},_getDialogRmvBtnByRow:function($frow){var $elem=$frow.find("[data-af-rmv]");if(!$elem.length){$elem=$frow.find("td:last").find("span")}return $elem},_getNextTabIndex:function(){var gti=this.grid.options.tabIndex;return gti+1},_getIntialConditionForCol:function(colSettings,key){var colSetting=colSettings.filter(function(obj){return obj.columnKey===key})[0],cond=colSetting.condition,condList=this._populateConditionsList(key,this._getColType(key)).map(function(obj){return obj.condition});if(colSetting.customConditions&&colSetting.customConditions.hasOwnProperty(cond)){cond=key+"_"+cond}if(condList&&cond){if(condList.indexOf(cond)!==-1){return condList[condList.indexOf(cond)]}else{if(cond===this._getDefaultCondition(this._getColType(key))){return condList[0]}else{throw new Error($.ig.util.stringFormat(this._getLocaleValue("initialConditionIsNotInTheConditionsListArrayOrIsNotInTheDefaultConditions"),key))}}}return this._getDefaultCondition(this._getColType(key))},_addFilterFromDialog:function(e,expression){var tableBody=this.grid._rootContainer().find("#"+this.grid.container().attr("id")+"_dialog table tbody"),cs=this.options.columnSettings,rows,filterObj={},filterRow,colKeys,colTexts,i,noCancel=true,field,type,cnd,defaultValue,condition,col,conds,shouldDisable=false,input,matchingConditions,owner=this,editorWidth=this.options.filterDialogFilterDropDownDefaultWidth||120;noCancel=this._trigger(this.events.filterDialogFilterAdding,null,{filtersTableBody:tableBody,owner:this});if(noCancel){rows=this._getFilterDialog().find("[data-af-row]");if(!rows.length){rows=tableBody.children()}if(rows.length>=this.options.filterDialogMaxFilterCount){this.grid._rootContainer().find("#"+this.grid.container().attr("id")+"_dialog_error").show();return}if(expression===undefined){col=this.grid.columnByKey(this._dialogCurrentColumn);field=col.headerText;if(this._dialogCurrentType==="object"){this._dialogCurrentType=this._getColType(this._dialogCurrentColumn)}type=this._dialogCurrentType}else{col=this.grid.columnByKey(expression.fieldName);if(col!==null){field=col.headerText;if(col.dataType==="object"){type=this._getColType(expression.fieldName)}else{type=col.dataType}}condition=this._resolveConditionNameFromExpression(expression);defaultValue=expression.expr;if((type==="date"||type==="time")&&$.type(defaultValue)==="number"&&this.grid.options.enableUTCDates){defaultValue=new Date(defaultValue)}}if(this.options.filterDialogFilterTemplate&&typeof this.options.filterDialogFilterTemplate==="string"){filterRow=$(this._fTmplWrappers[this.grid.id()+"_filterDialogFilterTemplate"](filterObj))}else{filterRow=$("<tr data-af-row><td><input data-af-col/></td>"+"<td><input data-af-cond tabindex='"+this._getNextTabIndex()+"' title='"+this._getLocaleValue("filterDialogConditionDropDownLabel")+"' data-localeid='filterDialogConditionDropDownLabel' "+"data-localeattr='title' "+"/></td><td><input data-af-expr /> "+"</td><td><span data-af-rmv></span></td></tr>")}filterRow.appendTo(tableBody);colKeys=[];colTexts=[];for(i=0;i<cs.length;i++){if(cs[i].columnKey===col.key&&cs[i].allowFiltering===false){shouldDisable=true}else if(cs[i].allowFiltering===true){colTexts.push(this.grid.columnByKey(cs[i].columnKey).headerText);colKeys.push(cs[i].columnKey)}}cnd=this._getDialogCondSelByRow(filterRow);this._getDialogColSelByRow(filterRow).igTextEditor({language:this.grid.options.language,preventSubmitOnEnter:true,listItems:colTexts,disabled:shouldDisable,button:"dropdown",isLimitedToListValues:true,allowNullValue:false,buttonType:"dropdown",width:editorWidth,valueChanged:$.proxy(this._polulateFilterConditionDropDown,this),dropDownAttachedToBody:true,value:field,tabIndex:this._getNextTabIndex(),validatorOptions:{notificationOptions:{appendTo:"#"+this.grid.container().attr("id")+"_dialog",maxWidth:editorWidth}},rendering:function(evt,ui){ui.owner._updateDropdownSelection=$.proxy(owner._updateDropdownSelection,ui.owner,ui.owner._updateDropdownSelection)},rendered:function(evt,ui){$.each(ui.owner._listItems(),function(index,item){$(item).data("colKey",colKeys[index]);if(colKeys[index]===col.key){ui.owner._setSelectedItemByIndex(index)}})}});conds=this._populateConditionsList(col.key,this._getColType(col.key));this._renderAdvancedConditionsDropDown(cnd,conds,this._getIntialConditionForCol(cs,col.key));if(condition!==undefined&&cnd.length>0){matchingConditions=conds.filter(function(c){return c.condition===condition});cnd.igTextEditor("value",matchingConditions.length>0?matchingConditions[0].text:condition)}cnd.attr("disabled",shouldDisable);cnd.bind("igtexteditordropdownitemselected",$.proxy(this._changeFilterCondition,this));input=this._getDialogExprSelByRow(filterRow);this._populateFilterDialogInput(input,type,defaultValue,col,condition,shouldDisable);input.attr("disabled",shouldDisable);if(cnd.length&&!this.requiresFilteringExpression(condition)){this._dialogCurrentColumn=this._dialogCurrentColumn||col.key;this._changeFilterCondition({target:cnd[0],initCond:this._getIntialConditionForCol(cs,col.key)})}this._getDialogRmvBtnByRow(filterRow).attr("tabindex",this._getNextTabIndex()).addClass(this.css.filterDialogFilterRemoveButton).bind({mousedown:$.proxy(this._removeFilterFromDialog,this)});this._trigger(this.events.filterDialogFilterAdded,null,{filter:filterRow,owner:this})}},_updateDropdownSelection:function(origHandler,value){var current=this.getSelectedListItem(),currentValue=current.text();if(currentValue!==""&&currentValue!==value){origHandler.call(this,value)}},_filterDialogClearAll:function(e){var tableBody=this.grid._rootContainer().find("#"+this.grid.container().attr("id")+"_dialog table tbody");tableBody.empty();this.grid._rootContainer().find("#"+this.grid.container().attr("id")+"_dialog_error").hide();if(e){e.preventDefault()}},_polulateFilterConditionDropDown:function(e,args){var selectedColName=args.newValue,conditionListElem,cols=this.grid.options.columns,type,input,i,col,conds,$tr,$target=$(e.target),cs=this.options.columnSettings;$tr=$target.closest("[data-af-row]");if(!$tr.length){$tr=$target.closest("tr")}conditionListElem=this._getDialogCondSelByRow($tr);input=this._getDialogExprSelByRow($tr);for(i=0;i<cols.length;i++){if(cols[i].headerText===selectedColName){type=cols[i].dataType;col=cols[i];break}}if(type==="object"){type=this._getColType(col.key)}if(type===undefined){return}conds=this._populateConditionsList(col.key,type);this._renderAdvancedConditionsDropDown(conditionListElem,conds,this._getIntialConditionForCol(cs,col.key));this._populateFilterDialogInput(input,type,undefined,col,conds[0].condition)},_populateFilterDialogInput:function(input,type,defaultValue,col,condition){var options,provider,oldInputProvider,isCustomProvider=true,editorCallbacks={keyDown:$.noop,textChanged:$.noop,valueChanged:$.noop},colSetting=this._findColumnSetting(col.key),editorOptions=colSetting?colSetting.editorOptions||{}:{},editorType=colSetting?this._getEditorProviderType(col.dataType,colSetting.editorType):null;provider=colSetting?colSetting.editorProvider:null;if(!provider){provider=$.ig.GetEditorProvider(this.grid,col,editorType);isCustomProvider=false}options=$.extend({},editorOptions,{language:this.grid.options.language,regional:col.regional||this.grid.options.regional,preventSubmitOnEnter:true,suppressNotifications:true,tabIndex:this._getNextTabIndex(),buttonHidden:type!=="date",button:"dropdown",readOnly:this._isBool(type),maxDecimals:12,textAlign:type==="number"?"right":"left",width:this.options.filterDialogExprInputDefaultWidth,value:defaultValue,enableUTCDates:this.options.type==="remote"?true:this.grid.options.enableUTCDates});if(type==="date"||type==="time"){if(col&&col.format){options.dateInputFormat=col.format}options.displayTimeOffset=this.options.type==="remote"?0:this.grid._calcOffsetForCol(null,col)}if(!input.is("input")){input=input.find("INPUT").eq(0)}oldInputProvider=input.data("provider");if(oldInputProvider){oldInputProvider.destroy()}provider.createEditor(editorCallbacks,col.key,options,this._getNextTabIndex(),col.format,input,this.options.type==="remote"?0:this.grid._calcOffsetForCol(null,col));input.data("provider",provider);input.data("colKey",col.key);if(isCustomProvider){provider.setValue(defaultValue)}if(condition){this._setFilterDialogInput(input,condition)}},_getEditorProviderType:function(colType,editorType){if(!editorType&&colType==="date"){editorType="datepicker"}if(colType==="time"&&editorType!=="timepicker"&&editorType!=="date"){editorType="timepicker"}if(!editorType&&(colType==="bool"||colType==="boolean")){editorType="text"}return editorType},_populateConditionsList:function(selectedColKey,type){var conditions=[],i,j,cs=this.options.columnSettings,css=this.css,validConditions=[],matchingCondition,custConds,curCond,newCond,key;if(type==="number"){validConditions.push({condition:"equals",text:this._getLocaleValue("equalsLabel"),imgClass:css.filterItemIconEquals});validConditions.push({condition:"doesNotEqual",text:this._getLocaleValue("doesNotEqualLabel"),imgClass:css.filterItemIconDoesNotEqual});validConditions.push({condition:"greaterThan",text:this._getLocaleValue("greaterThanLabel"),imgClass:css.filterItemIconGreaterThan});validConditions.push({condition:"lessThan",text:this._getLocaleValue("lessThanLabel"),imgClass:css.filterItemIconLessThan});validConditions.push({condition:"greaterThanOrEqualTo",text:this._getLocaleValue("greaterThanOrEqualToLabel"),imgClass:css.filterItemIconGreaterThanOrEqualTo});validConditions.push({condition:"lessThanOrEqualTo",text:this._getLocaleValue("lessThanOrEqualToLabel"),imgClass:css.filterItemIconLessThanOrEqualTo})}else if(this._isBool(type)){validConditions.push({condition:"true",text:this._getLocaleValue("trueLabel"),imgClass:css.filterItemIconTrue});validConditions.push({condition:"false",text:this._getLocaleValue("falseLabel"),imgClass:css.filterItemIconFalse})}else if(type==="date"){validConditions.push({condition:"on",text:this._getLocaleValue("onLabel"),imgClass:css.filterItemIconOn});validConditions.push({condition:"notOn",text:this._getLocaleValue("notOnLabel"),imgClass:css.filterItemIconNotOn});validConditions.push({condition:"after",text:this._getLocaleValue("afterLabel"),imgClass:css.filterItemIconAfter});validConditions.push({condition:"before",text:this._getLocaleValue("beforeLabel"),imgClass:css.filterItemIconBefore});validConditions.push({condition:"today",text:this._getLocaleValue("todayLabel"),imgClass:css.filterItemIconToday});validConditions.push({condition:"yesterday",text:this._getLocaleValue("yesterdayLabel"),imgClass:css.filterItemIconYesterday});validConditions.push({condition:"thisMonth",text:this._getLocaleValue("thisMonthLabel"),imgClass:css.filterItemIconThisMonth});validConditions.push({condition:"lastMonth",text:this._getLocaleValue("lastMonthLabel"),imgClass:css.filterItemIconLastMonth});validConditions.push({condition:"nextMonth",text:this._getLocaleValue("nextMonthLabel"),imgClass:css.filterItemIconNextMonth});validConditions.push({condition:"thisYear",text:this._getLocaleValue("thisYearLabel"),imgClass:css.filterItemIconThisYear});validConditions.push({condition:"lastYear",text:this._getLocaleValue("lastYearLabel"),imgClass:css.filterItemIconLastYear});validConditions.push({condition:"nextYear",text:this._getLocaleValue("nextYearLabel"),imgClass:css.filterItemIconNextYear})}else if(type==="time"){validConditions.push({condition:"at",text:this._getLocaleValue("atLabel"),imgClass:css.filterItemIconOn});validConditions.push({condition:"notAt",text:this._getLocaleValue("notAtLabel"),imgClass:css.filterItemIconNotOn});validConditions.push({condition:"before",text:this._getLocaleValue("beforeLabel"),imgClass:css.filterItemIconBefore});validConditions.push({condition:"after",text:this._getLocaleValue("afterLabel"),imgClass:css.filterItemIconAfter});validConditions.push({condition:"atBefore",text:this._getLocaleValue("atBeforeLabel"),imgClass:css.filterItemIconToday});validConditions.push({condition:"atAfter",text:this._getLocaleValue("atAfterLabel"),imgClass:css.filterItemIconYesterday})}else if(type==="string"){validConditions.push({condition:"startsWith",text:this._getLocaleValue("startsWithLabel"),imgClass:css.filterItemIconStartsWith});validConditions.push({condition:"endsWith",text:this._getLocaleValue("endsWithLabel"),imgClass:css.filterItemIconEndsWith});validConditions.push({condition:"contains",text:this._getLocaleValue("containsLabel"),imgClass:css.filterItemIconContains});validConditions.push({condition:"doesNotContain",text:this._getLocaleValue("doesNotContainLabel"),imgClass:css.filterItemIconDoesNotContain});validConditions.push({condition:"equals",text:this._getLocaleValue("equalsLabel"),imgClass:css.filterItemIconEquals});validConditions.push({condition:"doesNotEqual",text:this._getLocaleValue("doesNotEqualLabel"),imgClass:css.filterItemIconDoesNotEqual})}if(this.options.showEmptyConditions){validConditions.push({condition:"empty",text:this._getLocaleValue("emptyLabel"),imgClass:css.filterItemIcon});validConditions.push({condition:"notEmpty",text:this._getLocaleValue("notEmptyLabel"),imgClass:css.filterItemIcon})}if(this.options.showNullConditions){validConditions.push({condition:"null",text:this._getLocaleValue("nullLabel"),imgClass:css.filterItemIcon});validConditions.push({condition:"notNull",text:this._getLocaleValue("notNullLabel"),imgClass:css.filterItemIcon})}for(i=0;i<cs.length;++i){if(cs[i].columnKey===selectedColKey){cs=cs[i];break}}custConds=cs.customConditions;for(key in custConds){if(custConds.hasOwnProperty(key)){curCond=custConds[key];newCond={condition:cs.columnKey+"_"+key,text:curCond.labelText,imgClass:curCond.filterImgIcon};validConditions.push(newCond)}}if(cs.conditionList&&cs.conditionList.length>0){for(i=0;i<cs.conditionList.length;++i){matchingCondition=null;for(j=0;j<validConditions.length;++j){if(validConditions[j].condition===cs.conditionList[i]||validConditions[j].condition===cs.columnKey+"_"+cs.conditionList[i]){matchingCondition=validConditions[j];break}}if(!matchingCondition){throw new Error($.ig.util.stringFormat(this._getLocaleValue("conditionNotValidForColumnType"),cs.conditionList[i],type))}conditions.push(matchingCondition)}}else{for(i=0;i<validConditions.length;++i){conditions.push(validConditions[i])}}return conditions},_renderAdvancedConditionsDropDown:function(conditionListElem,conditions,initCond){var i,condList=[],editorWidth=this.options.filterDialogFilterDropDownDefaultWidth||120,cond=conditions.filter(function(obj){return obj.condition===initCond});if(cond.length!==0){cond=cond[0].text}else{cond=conditions[0].text}conditionListElem.empty();if(this.options.filterDialogFilterConditionTemplate&&typeof this.options.filterDialogFilterConditionTemplate==="string"){condList=$(this._fTmplWrappers[this.grid.id()+"_filterDialogFilterConditionTemplate"](conditions));condList.appendTo(conditionListElem)}else{for(i=0;i<conditions.length;i++){condList.push(conditions[i].text)}conditionListElem.igTextEditor({language:this.grid.options.language,preventSubmitOnEnter:true,listItems:condList,button:"dropdown",isLimitedToListValues:true,allowNullValue:false,buttonType:"dropdown",width:editorWidth,dropDownAttachedToBody:true,value:cond,validatorOptions:{notificationOptions:{appendTo:"#"+this.grid.container().attr("id")+"_dialog",maxWidth:editorWidth}}})}},_removeFilterFromDialog:function(e){var filterR,$target=$(e.target),$tr=$target.closest("[data-af-row]");if(!$tr.length){$target.closest("tr").remove();filterR=this._getFilterDialog().find("tr")}else{$tr.remove();filterR=this._getFilterDialog().find("[data-af-row]")}if(filterR.length<this.options.filterDialogMaxFilterCount){this.grid._rootContainer().find("#"+this.grid.container().attr("id")+"_dialog_error").hide()}},_renderDropDownToList:function(obj,list,ul){var i,cond,classes,liHtml="",c;for(i=0;i<list.length;i++){classes=list[i].itemClass!==undefined?obj.itemClass+" "+list[i].itemClass:obj.itemClass;c=list[i].condition;cond="<li class='"+classes+"' tabindex='"+this.grid.options.tabIndex+"' data-cond='"+(c||"")+"'><span class='"+obj.imgContainerClass+"'>"+"<span class='"+this.css.filterItemIcon+" "+list[i].imgClass+"'></span></span>"+"<span class='"+obj.textClass+"' "+"data-localeid='"+(c?c+"Label":list[i].localeId)+"'>"+list[i].text+"</span></li>";liHtml+=cond}ul.append(liHtml)},_checkCloseDropDown:function(evt){var colKey=$(evt.target).closest("ul").parent().attr("aria-describedby"),colIndex;if(!$(evt.target).closest("ul").data("focussed")&&!this._cancelNextBlur&&this.options){$.each(this.options.columnSettings,function(index,col){if(col.columnKey===colKey){colIndex=index;return false}});this._closeDropDown({target:this._editorProviders[colIndex].getEditor().element,currentTarget:this._editorProviders[colIndex].getEditor().element})}else if(this._cancelNextBlur){this.grid._rootContainer().find("#"+this.grid.id()+"_dd_"+colKey+"_button").focus();this._cancelNextBlur=false}},_renderDropDownElement:function(id,colName){var ul,container;ul=$("<ul></ul>").appendTo(this.grid._rootContainer()).addClass(this.css.filterDropDownList);container=$("<div></div>").appendTo(this.grid._rootContainer()).attr({id:id,"data-filter-dropdown":true,"aria-describedBy":colName}).addClass(this.css.filterDropDown).css("overflow","hidden").css("position","absolute").hide();if(!$.ig.util.isIE){container.css("overflow-y","auto")}container.remove();if(this.options.filterDropDownWidth>0){ul.css("width",this.options.filterDropDownWidth)}if(this.options.filterDropDownHeight>0){container.css("height",this.options.filterDropDownHeight)}ul.data("colName",colName);ul.wrap(container);ul.parent().data("efh","1");this.grid._rootContainer().find("#"+id).delegate("li",{mousedown:$.proxy(this._selectDropDownItem,this),mouseover:$.proxy(this._hoverDropDownItem,this),mouseout:$.proxy(this._unhoverDropDownItem,this)});return ul},_hoverButton:function(event){var $target=$(event.currentTarget).find("span");if(this.options.mode==="advanced"){$target.addClass(this.css.filterButtonAdvancedHover)}else{$target.addClass(this.css.filterButtonHover)}},_unhoverButton:function(event){var $target=$(event.currentTarget).find("span");if(this.options.mode==="advanced"){$target.removeClass(this.css.filterButtonAdvancedHover)}else{$target.removeClass(this.css.filterButtonHover)}},_activateButton:function(event){var $target=$(event.currentTarget).find("span"),dd=this.grid._rootContainer().find("#"+this.grid.id()+"_filtering_dd");
dd.data("focussed",true);if(this._dontApplyStyles){this._dontApplyStyles=false;return}if(this.options.mode==="advanced"){$target.addClass(this.css.filterButtonAdvancedActive)}else{$target.addClass(this.css.filterButtonActive)}},_deactivateButton:function(event){var target=$(event.target).find("span"),self=this,id=$(event.target).attr("id")||$(event.currentTarget).attr("id"),ddId,dd,closeOnBlurTO,colKey,index;if(this.options.mode==="advanced"&&!this.options.advancedModeEditorsVisible){target.removeClass(this.css.filterButtonAdvancedActive)}else{ddId=this.grid.id()+"_filtering_dd";dd=this.grid._rootContainer().find("#"+ddId).find("ul");index=(this.grid.id()+"_dd_").length;colKey=id.substring(index,id.lastIndexOf("_button"));dd.data("focussed",false);closeOnBlurTO=this._animating&&colKey===this._animatingId?this.options.filterDropDownAnimationDuration:0;if(colKey===this._animatingId){setTimeout(function(){self._checkCloseDropDown({target:dd,currentTarget:dd})},closeOnBlurTO)}target.removeClass(this.css.filterButtonActive)}},_toggleDropDown:function(event,close,dontFocus){var $target=$(event.currentTarget),colKey=this.grid.getColumnByTD($target.closest("td")).column.key,id=this.grid.id()+"_filtering_dd",maxZ,dd,left,top,noCancel=true,button=$target,rOffset,block=this.grid._rootContainer().find("#"+this.grid.container().attr("id")+"_block"),dialog=this._getFilterDialog();if(this._animating&&(id===this._animatingId||colKey===this._animatingId)){return}maxZ=$.ig.getMaxZIndex(this.grid.container().attr("id")+"_dialog");block.css("zIndex",maxZ+1);dialog.css("zIndex",maxZ+2);dd=this.grid._rootContainer().find("#"+id);this._isClosing=false;if(dd.attr("aria-describedby")===colKey&&dd.is(":visible")){this._isClosing=true}dd.attr("aria-describedby",colKey);if(!this._isClosing&&noCancel){$(dd.children()[0]).empty();this._renderDropDown(this._getColType(colKey),this.grid.id()+"_dd_filtering",colKey);if(!close){noCancel=this._trigger(this.events.dropDownOpening,null,{dropDown:dd,owner:this})}}if(dd.is(":visible")){noCancel=this._trigger(this.events.dropDownClosing,null,{dropDown:dd,owner:this})}dd.css("zIndex",maxZ+3);if(!(!dd.is(":visible")&&close===true)){this._animating=true;this._animatingId=colKey}if(this._openingAnimation!==true){this._dontFocus=dontFocus}else{this._dontFocus=null}if(dd.find("ul > li").length===0){return}if(noCancel){left=$.ig.util.offset(button).left;top=$.ig.util.offset(button).top+button.outerHeight();if(dd.igOffset().left!==left||dd.igOffset().top!==top){rOffset=$.ig.util.getRelativeOffset(dd);left-=rOffset.left;top-=rOffset.top;dd.css("left",left).css("top",top)}this._currentTarget=$target;this._dd=dd;if(!this._isClosing){this._opendd=dd}if($.ig.util.isIE){dd.css("overflow-x","hidden");dd.css("overflow-y","hidden")}if(close!==undefined&&close===true){if(dd.is(":visible")){if(this.options.filterDropDownAnimations!=="none"){dd.hide(this.options.filterDropDownAnimationDuration,$.proxy(this._animationEnd,this))}else{dd.hide();this._trigger(this.events.dropDownClosed,null,{dropDown:dd,owner:this})}}}else{if(this.options.filterDropDownAnimations!=="none"){if(dd.is(":visible")&&!this._isClosing){if(noCancel){dd.hide();this._trigger(this.events.dropDownClosed,null,{dropDown:dd,owner:this})}else{return}}this._openingTarget=this._currentTarget;this._openingAnimation=true;dd.toggle(this.options.filterDropDownAnimationDuration,$.proxy(this._animationEnd,this))}else{dd.toggle();if(this._isClosing){this._trigger(this.events.dropDownClosed,null,{dropDown:dd,owner:this})}else{this._trigger(this.events.dropDownOpened,null,{dropDown:dd,owner:this});dd.scrollTop(0)}if(dontFocus!==true){this._dontApplyStyles=true;$target.focus()}}}}if($.type(event.stopPropagation)==="function"){event.stopPropagation()}},_animationEnd:function(){if(this.options===null){return}if(this._isClosing===true){this._trigger(this.events.dropDownClosed,null,{dropDown:this._dd,owner:this})}else{this._trigger(this.events.dropDownOpened,null,{dropDown:this._opendd,owner:this});this._openingAnimation=false;this._dd.scrollTop(0)}if(this._dd&&$.ig.util.isIE){this._dd.css("overflow-y","auto")}this._isClosing=null;if(this._dontFocus!==true){this._dontApplyStyles=true}this._animating=false},_toggleDropDownKeyboard:function(event){var parent,selectedItem,$target=$(event.target),ddVisible,dd=$("#"+this.grid.id()+"_filtering_dd").find("ul");if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){if(!$target.is("input")){event.stopPropagation();event.preventDefault()}parent=dd;if(parent.data("selectedItem")||parent.data("selectedItem")===0){selectedItem=parent.find("li:nth-child("+(parent.data("selectedItem")+1)+")");ddVisible=$("#"+this.grid.id()+"_filtering_dd").find("ul").is(":visible");if($(selectedItem).hasClass("ui-iggrid-filterddlistitemadvanced")&&ddVisible){this._openFilterDialog(event)}}if(selectedItem&&ddVisible){event.currentTarget=selectedItem;this._selectDropDownItem(event)}else{this._toggleDropDown(event)}}else if(event.keyCode===$.ui.keyCode.DOWN||event.keyCode===$.ui.keyCode.UP){this._handleKeyboardNavigation(event)}else if($.ui.keyCode.TAB){this._toggleDropDown(event,true)}},_handleKeyboardNavigation:function(event){var $target=$(event.target),dd,colKey;if($target.is("a")||$target.is("input")){colKey=this.grid.getColumnByTD($target.closest("td")).column.key;dd=$("#"+this.grid.id()+"_filtering_dd").find("ul");$target=dd.find("li.ui-iggrid-filterddlistitemactive").length>0?dd.find("li.ui-iggrid-filterddlistitemactive"):dd}event.stopPropagation();event.preventDefault();if(event.keyCode===$.ui.keyCode.DOWN){this._selectDropDownItem({currentTarget:$target},"next")}else if(event.keyCode===$.ui.keyCode.UP){this._selectDropDownItem({currentTarget:$target},"prev")}},_changeSelectionKeyboard:function(event){var buttonId,$target,prevElem;if(event.keyCode===$.ui.keyCode.DOWN||event.keyCode===$.ui.keyCode.UP){this._handleKeyboardNavigation(event)}else if(event.keyCode===$.ui.keyCode.ENTER){event.stopPropagation();event.preventDefault();this._selectDropDownItem(event)}else if(event.keyCode===$.ui.keyCode.TAB){event.stopPropagation();event.preventDefault();buttonId=this.grid.id()+"_dd_"+$(event.target).closest("div").attr("aria-describedby")+"_button";$target=this.grid.container().find("#"+buttonId);if(!event.shiftKey){$target.closest("td").find("input:tabbable").focus()}else{prevElem=$target.closest("td").prev("td");if(prevElem.length===0){prevElem=$target.closest("tr").prev()}prevElem.find(":tabbable").last().focus()}}},_closeDropDown:function(event){var curTarget=$(event.currentTarget),id=this.grid.id()+"_filtering_dd",closestUL=curTarget.closest("ul"),$target=curTarget.find("span"),dd;if(this._openingTarget&&event.target.id===this._openingTarget.attr("id")&&this._openingAnimation===true){return}dd=closestUL.length!==0?closestUL.closest("ul"):this.grid._rootContainer().find("#"+id);if(dd&&!dd.is(":visible")){$target.removeClass(this.css.filterButtonActive);return}this._toggleDropDown({currentTarget:event.currentTarget},true,true);if(this._dontApplyStyles){this._dontApplyStyles=false;return}if(this.options.mode==="advanced"){$target.removeClass(this.css.filterButtonAdvancedActive)}else{$target.removeClass(this.css.filterButtonActive)}},_getColType:function(colkey){var type=this.grid.dataSource._getFieldTypeFromSchema(colkey);if(type===undefined){type=this.grid.columnByKey(colkey).dataType}return type},_hasEditor:function(editorProvider){return $.type(editorProvider.getEditor)==="function"},_selectDropDownItem:function(event,nav,expr){var $target=$(event.currentTarget),filterCondition,colIndex,sel,parent,requiresEntry,button,currentCond,targetParent,evtArgs,focT,type,colKey,colType,currEditorProvider,editor,clearButton;if($target.find("input").length>0&&this.options.mode==="advanced"&&!this.options.advancedModeEditorsVisible){return}if(nav==="next"||nav==="prev"){parent=$target.parent()}if(nav==="next"){if(parent.data("selectedItem")===undefined){$target=parent.find("li:first")}else{$target=parent.find("li:nth-child("+(parent.data("selectedItem")+1)+")");if($target.next().length===0){$target=parent.find("li:first")}else{$target=$target.next()}}}if(nav==="prev"){if(parent.data("selectedItem")===undefined){$target=parent.find("li:last")}else{$target=parent.find("li:nth-child("+(parent.data("selectedItem")+1)+")");if($target.prev().length===0){$target=parent.find("li:last")}else{$target=$target.prev()}}}filterCondition=$target.attr("data-cond");colKey=$target.closest("div").attr("aria-describedBy");button=this.grid._rootContainer().find("#"+this.grid.id()+"_dd_"+colKey+"_button");if($target.attr("data-cond")===""||$target.attr("data-cond")===undefined){button.attr("title",this._getLocaleValue("tooltipTemplate").replace("${condition}",this._getLocaleValue("noFilterLabel")))}$.each(this.options.columnSettings,function(index,col){if(col.columnKey===colKey){colIndex=index;return false}});if(!colIndex&&expr){$.each(this.options.columnSettings,function(index,col){if(col.columnKey===expr.fieldName){colIndex=index;return false}})}currentCond=this.options.columnSettings[parseInt(colIndex,10)].condition;targetParent=$target.parent();sel=targetParent.data("selectedItem");type=this._getColType(this.grid.options.columns[colIndex].key);requiresEntry=this.requiresFilteringExpression(filterCondition);if($target[0]!==document.activeElement){$target.parent().data("focussed",true);$target.focus()}if(filterCondition!==undefined&&filterCondition!==""){this.options.columnSettings[parseInt(colIndex,10)].condition=filterCondition;if(sel!==undefined){targetParent.find("li:nth-child("+(sel+1)+")").removeClass(this.css.filterDropDownListItemActive)}$target.addClass(this.css.filterDropDownListItemActive);targetParent.data("selectedItem",$("li",targetParent).index($target));this._setEditorOption(this._editorProviders[colIndex].getEditor(),"placeHolder",this._getNullTextByCondition(filterCondition))}else if(currentCond==="empty"||currentCond==="notEmpty"||currentCond==="null"||currentCond==="notNull"||!this.requiresFilteringExpression(currentCond)){this.options.columnSettings[parseInt(colIndex,10)].condition=this._getDefaultCondition(type);if(sel!==undefined){targetParent.find("li:nth-child("+(sel+1)+")").removeClass(this.css.filterDropDownListItemActive);targetParent.data("selectedItem",null);if(this._isBool(this.grid.options.columns[colIndex].dataType)){this._setEditorOption(this._editorProviders[colIndex].getEditor(),"placeHolder","")}else{this._setEditorOption(this._editorProviders[colIndex].getEditor(),"placeHolder",this._getNullTextByCondition(this._getDefaultCondition(type)))}}if(currentCond==="null"||this.grid.options.columns[colIndex].dataType==="date"||this.grid.options.columns[colIndex].dataType==="time"){this._setEditorOption(this._editorProviders[colIndex].getEditor(),"placeHolder",this._getNullTextByCondition(this._getDefaultCondition(type)))}}if($target.hasClass("ui-iggrid-filterddlistitemclear")){if(sel!==undefined){targetParent.find("li:nth-child("+(sel+1)+")").removeClass(this.css.filterDropDownListItemActive)}$target.addClass(this.css.filterDropDownListItemActive);targetParent.data("selectedItem",$("li",targetParent).index($target))}currEditorProvider=this._editorProviders[colIndex];editor=currEditorProvider.getEditor();if(nav===undefined||event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){if($target.hasClass("ui-iggrid-filterddlistitemclear")||this.options.filterDropDownItemIcons===true&&$target.find(".ui-iggrid-filtericonclear").length>0){if(!requiresEntry||filterCondition===undefined||filterCondition===""){colType=this._getColType(this.grid.options.columns[colIndex].key);this._setEditorOption(editor,"readOnly",this._isBool(colType))}currEditorProvider.setValue(null);this._filterDataSourceClear(this.grid.options.columns[colIndex].key,colIndex);this._toggleDropDown({currentTarget:editor.element},true);button.focus()}else{if(!requiresEntry&&!expr){this._setEditorOption(editor,"readOnly",true);this._editorValueForCondition(filterCondition,currEditorProvider);clearButton=this._editorProviders[colIndex].editor.clearButton();if(clearButton.attr("id")&&clearButton.attr("id").indexOf("clearButton")!==-1){clearButton.hide()}this._args=undefined;this._filterInternal(colIndex,this.grid.options.columns[colIndex].key);button.focus()}else{var editorValue=this._getEditorVal(currEditorProvider);if(editorValue!==""&&editorValue!==null){if(editor.setFocus){editor.setFocus(true)}else if(editor.element.focus){editor.element.focus()}var editorDisplayValue=editor.displayValue?editor.displayValue():editorValue;evtArgs={owner:editor,text:editorDisplayValue};this._filter(event,evtArgs)}}if(requiresEntry){this._setEditorOption(editor,"readOnly",false);if(nav===undefined&&filterCondition!==undefined){focT=$.ig.util.isTouchDevice()?this.options.filterDropDownAnimationDuration:-1;if(editor.setFocus){editor.setFocus(focT)}else if(editor.element.focus){if(focT>0){setTimeout(function(){editor.element.focus()},focT)}else{editor.element.focus()}}}}}this._toggleDropDown({currentTarget:editor.element},true);$target.parent().data("focussed",false)}},requiresFilteringExpression:function(filterCondition){var custConds=this._dsTransformedCustomConditions;if(this.grid.dataSource._isFilteringExprNotReq(filterCondition)){return false}if(custConds&&custConds[filterCondition]){return custConds[filterCondition].requireExpr}if(filterCondition===undefined||filterCondition===null){return false}return true},_editorValueForCondition:function(filterCondition,editorProvider){var date=new Date,custConds=this._dsTransformedCustomConditions,colKey;if(filterCondition==="true"){editorProvider.setValue(this._getLocaleValue("trueLabel"))}else if(filterCondition==="false"){editorProvider.setValue(this._getLocaleValue("falseLabel"))}else if(filterCondition==="today"){colKey=editorProvider.getEditor().element.data("colKey");if(this.grid.columnByKey(colKey).dateDisplayType==="utc"){editorProvider.setValue(new Date(Date.UTC(date.getFullYear(),date.getMonth(),date.getDate(),0,0,0,0)))}else{editorProvider.setValue(date)}}else if(filterCondition==="yesterday"){colKey=editorProvider.getEditor().element.data("colKey");if(this.grid.columnByKey(colKey).dateDisplayType==="utc"){editorProvider.setValue(new Date(Date.UTC(date.getFullYear(),date.getMonth(),date.getDate()-1,0,0,0,0)))}else{editorProvider.setValue(new Date(date.getFullYear(),date.getMonth(),date.getDate()-1,0,0,0,0))}}else if(custConds&&custConds[filterCondition]){editorProvider.setValue(custConds[filterCondition].expressionText)}else{editorProvider.setValue(null)}},_assignTemplates:function(){var self=this,opts=self.options,gId=this.grid.id();this._fTmplWrappers={};this._fTmplWrappers[gId+"_filterDialogFilterTemplate"]=function(d){return $.ig.tmpl(opts.filterDialogFilterTemplate,d)};this._fTmplWrappers[gId+"_filterDialogAddConditionTemplate"]=function(d){return $.ig.tmpl(opts.filterDialogAddConditionTemplate,d)};this._fTmplWrappers[gId+"_filterDialogAddConditionDropDownTemplate"]=function(d){return $.ig.tmpl(opts.filterDialogAddConditionDropDownTemplate,d)};this._fTmplWrappers[gId+"_filterDialogFilterConditionTemplate"]=function(d){return $.ig.tmpl(opts.filterDialogFilterConditionTemplate,d)};if(String(this.grid.options.templatingEngine).toLowerCase()==="jsrender"){this._jsr=true;$.templates(gId+"_filterDialogFilterTemplate",opts.filterDialogFilterTemplate);$.templates(gId+"_filterDialogAddConditionTemplate",opts.filterDialogAddConditionTemplate);$.templates(gId+"_filterDialogAddConditionDropDownTemplate",opts.filterDialogAddConditionDropDownTemplate);$.templates(gId+"_filterDialogFilterConditionTemplate",opts.filterDialogFilterConditionTemplate);this._fTmplWrappers=$.render}},_hoverDropDownItem:function(event){if($(event.currentTarget).find("input").length===0){$(event.currentTarget).addClass(this.css.filterDropDownListItemHover)}},_unhoverDropDownItem:function(event){$(event.currentTarget).removeClass(this.css.filterDropDownListItemHover)},_virtualHorizontalScroll:function(event,args){var start=args.startColIndex,i,headers=this.grid.headersTable().find("th"),columnKey;if(this._currentTarget){this._toggleDropDown({currentTarget:this._currentTarget},true)}if(this.options.mode==="advanced"&&this.options.advancedModeEditorsVisible!==true){for(i=0;i<this.grid._virtualColumnCount;i++){columnKey=this.grid.options.columns[i+start].key;$(headers[i]).data("colName",columnKey);if(this._fcData[columnKey]===true){continue}$(headers[i]).find("a").attr("data-col-key",columnKey).attr("id",this.grid.element[0].id+"_dd_"+columnKey+"_button")}this._updateTooltips(this._currentAdvancedExpressions||[])}else{throw new Error(this._getLocaleValue("virtualizationSimpleFilteringNotAllowed"))}},_headerInit:function(owner,args){var filterrow;if(this.options.mode!=="simple"&&this.options.advancedModeEditorsVisible!==true||this.grid.element.attr("id")!==args.owner.element.attr("id")){return}filterrow=this.grid.headersTable().children("thead").find("[data-role=filterrow]");filterrow.find("[data-skip=true]").remove();this.grid._headerInit(filterrow,null,true)},_injectGrid:function(gridInstance){var topmostGrid=null;this.grid=gridInstance;if(this.options.type===null){this.options.type=this.grid._inferOpType()}if(this.options.persist&&this.options.type==="remote"){topmostGrid=this.element.closest(".ui-iggrid-root").data("igGrid");if(topmostGrid&&topmostGrid.element.attr("id")!==this.grid.element[0].id&&topmostGrid.options.initialDataBindDepth===-1){this.options.persist=false}}if(this.options.type){this.grid.dataSource.settings.filtering.type=this.options.type}else{this.grid.dataSource.settings.filtering.type="remote"}if(this.options.filterExprUrlKey){this.grid.dataSource.settings.filtering.filterExprUrlKey=this.options.filterExprUrlKey}this.grid.dataSource.settings.filtering.caseSensitive=this.options.caseSensitive;if(this._headerCellRenderedHandler!==null&&this._headerCellRenderedHandler!==undefined){this.grid.element.unbind("iggridheadercellrendered",this._headerCellRenderedHandler)}this._headerCellRenderedHandler=$.proxy(this._headerCellRendered,this);this.grid.element.bind("iggridheadercellrendered",this._headerCellRenderedHandler);if(this._headerRenderedHandler!==null&&this._headerRenderedHandler!==undefined){this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler)}this._headerRenderedHandler=$.proxy(this._headerRendered,this);this.grid.element.bind("iggridheaderrendered",this._headerRenderedHandler);if(this._columnResizedHandler!==null&&this._columnResizedHandler!==undefined){this.grid.element.unbind("iggridresizingcolumnresized",this._columnResizedHandler)}this._columnResizedHandler=$.proxy(this._columnResized,this);this.grid.element.bind("iggridresizingcolumnresized",this._columnResizedHandler);if(this._columnsAlteredHandler!==null&&this._columnsAlteredHandler!==undefined){this.grid.element.unbind("iggrid_columnsmoved",this._columnsAlteredHandler)}this._columnsAlteredHandler=$.proxy(this._columnsAltered,this);this.grid.element.bind("iggrid_columnsmoved",this._columnsAlteredHandler);this._transformCustomConditionsForDataSource();this._initDefaultSettings();if(this._onUIDirtyHandler!==null&&this._onUIDirtyHandler!==undefined){this.grid.element.unbind("iggriduidirty",this._onUIDirtyHandler)}this._onUIDirtyHandler=$.proxy(this._onUIDirty,this);this.grid.element.bind("iggriduidirty",this._onUIDirtyHandler);if(this._virtualHorizontalScrollHandler!==null&&this._virtualHorizontalScrollHandler!==undefined){this.grid.element.unbind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler)}this._virtualHorizontalScrollHandler=$.proxy(this._virtualHorizontalScroll,this);this.grid.element.bind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler);if((this.grid.options.virtualization===true&&this.grid.options.width!==null||this.grid.options.columnVirtualization===true)&&this.options.mode===null){this.options.mode="advanced"}else if((this.grid.options.virtualization===false||this.grid.options.virtualization===true&&!this.grid._isColumnVirtualizationEnabled())&&(this.options.mode===null||this.options.mode==="simple")){this.options.mode="simple"}else if(this.options.mode==="simple"&&(this.grid.options.virtualization===true||this.grid.options.columnVirtualization===true)){throw new Error(this._getLocaleValue("virtualizationSimpleFilteringNotAllowed"))}if(this.grid._rlp&&(this.options.mode==="simple"||!this.options.mode)){throw new Error(this._getLocaleValue("multiRowLayoutSimpleFilteringNotAllowed"))}if(this._headerInitHandler!==null&&this._headerInitHandler!==undefined){this.grid.element.unbind("iggridheaderextracellsmodified",this._headerInitHandler)}this._headerInitHandler=$.proxy(this._headerInit,this);this.grid.element.bind("iggridheaderextracellsmodified",this._headerInitHandler);if(this._dataBoundHandler!==null&&this._dataBoundHandler!==undefined){this.grid.element.unbind("iggriddatabound",this._dataBoundHandler)}this._dataBoundHandler=$.proxy(this._dataBound,this);this.grid.element.bind("iggriddatabound",this._dataBoundHandler);if(this.grid.element.igGridFeatureChooser!==undefined){this.grid.element.igGridFeatureChooser()}else{throw new Error(this._getLocaleValue("featureChooserNotReferenced"))}this._assignTemplates();if(this.options.persist){this._preserveFiltering()}}});$.extend($.ui.igGridFiltering,{version:"21.2.12"})})($);/*!@license
* Infragistics.Web.ClientUI Outlook GroupBy feature 21.2.12
*
* Copyright (c) 2011-2022 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on:
*	jquery-1.9.1.js
*	jquery.ui.core.js
*	jquery.ui.widget.js
*	jquery.ui.mouse.js
*	jquery.ui.draggable.js
*	jquery.ui.droppable.js
*	infragistics.ui.widget.js
*	infragistics.ui.grid.framework.js
*	infragistics.ui.grid.shared.js
*	infragistics.ui.grid.featurechooser.js
*/
(function($){$.widget("ui.igGridGroupBy",$.ui.igWidget,{css:{dragMarkup:"ui-iggrid-dragMarkup",groupByArea:"ui-iggrid-groupbyarea",groupByAreaText:"ui-iggrid-groupbyareatext",groupedRow:"ui-iggrid-groupedrow",summaryRow:"ui-iggrid-summaryrow",expandHeaderCellGroupBy:"ui-iggrid-header ui-widget-header",groupByExpandCellExpanded:"ui-icon ui-iggrid-expandbutton ui-iggrid-expandbuttonexpanded ui-icon-minus",groupBySummaryIcon:"ui-icon ui-icon-calculator ui-iggrid-groupsummary-icon",groupByExpandCellCollapsed:"ui-icon ui-iggrid-expandbutton ui-icon-plus",groupByAreaDropHover:"ui-iggrid-groupbyareahover",groupByExpandColumn:"ui-iggrid-expandcolumn",groupBySummaryColumn:"ui-iggrid-summarycolumn",groupBySummaryIconColumn:"ui-iggrid-summaryiconcolumn",groupBySummaryEmptyCellColumn:"ui-iggrid-summaryemptycellcolumn",nonGroupRowEmptyCell:"ui-iggrid-nongrouprowemptycell",groupedColumnLabel:"ui-iggrid-groupedcolumnlabel ui-state-default",groupedColumnLabelText:"ui-iggrid-groupedcolumnlabeltext",groupByRemoveButton:"ui-icon ui-icon-circle-close ui-iggrid-groupbyremovebutton",groupedColumnLabelRightEdgeEnd:"ui-iggrid-groupbylabelrightedgeend",groupedColumnLabelRightEdge:"ui-iggrid-groupbylabelrightedge",groupedColumnLayoutLabel:"ui-iggrid-groupbylayoutlabel",headerExtraCell:"ui-iggrid-expandheadercellgb",footerExtraCell:"ui-widget-content ui-iggrid-footerextracell",featureChooserIconClass:"ui-icon ui-iggrid-icon-groupby",dialogGroupedColumns:"ui-iggrid-groupby-dialog-groupedcolumns",dialogUnroupedColumns:"ui-iggrid-groupby-dialog-ungroupedcolumns",dialogGroupedItem:"ui-widget-content",dialogUngroupedItem:"ui-widget-content",dialogUngroupedColumnsGroupByButton:"ui-iggrid-dialog-groupby-button",dialogUngroupedColumnsText:"ui-iggrid-dialog-text",dialogButtonAsc:"ui-button ui-corner-all ui-button-icon-only ig-sorting-indicator",dialogButtonAscIcon:"ui-button-icon-primary ui-icon ui-icon-arrowthick-1-n",dialogButtonDesc:"ui-button ui-corner-all ui-button-icon-only ig-sorting-indicator",dialogButtonDescIcon:"ui-button-icon-primary ui-icon ui-icon-arrowthick-1-s",dialogButtonUngroup:"ui-iggrid-dialog-groupedbuttons ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only ui-igbutton ui-widget-content ui-igbutton-remove",dialogButtonUngroupContainer:"ui-button-icon-primary ui-icon ui-icon-circle-close",dialogGroupedColumnTextContainer:"ui-iggrid-dialog-text",dialogListGroupedColumns:"ui-iggrid-dialog-list-groupedcolumns",dialogListUngroupedColumns:"ui-iggrid-dialog-list-ungroupedcolumns",dialogLayoutsDDButton:"ui-icon ui-icon-triangle-1-s ui-iggrid-dialog-layouts-dd-button",dropDownLayoutsContainer:"ui-iggrid-featurechooser-dropdown-dialog ui-widget ui-widget-content ui-corner-all",dialogLayoutsDDField:"ui-iggrid-dialog-layouts-dd-field",dialogLayoutsDD:"ui-iggrid-dialog-layouts-dd ui-widget-content ui-corner-all ig-combo-icon-container",modalDialogTreeContainer:"ui-iggrid-groupby-dialog-tree",modalDialogLayoutsContainer:"ui-iggrid-groupby-dialog-layoutscontainer",dialogButtonsHover:"ui-state-hover",groupByLastEmptyCell:"ui-iggrid-last-emptycell"},renderInFeatureChooser:false,options:{groupByAreaVisibility:"top",initialExpand:true,pagingMode:"allRecords",expansionIndicatorVisibility:true,groupByLabelWidth:null,labelDragHelperOpacity:.5,indentation:30,defaultSortingDirection:"asc",groupedColumns:[{key:null,dir:"asc",layout:null,col:null}],resultResponseKey:null,groupedRowTextTemplate:"${key}: ${val} (${count})",type:null,groupByUrlKey:null,groupByUrlKeyAscValue:null,groupByUrlKeyDescValue:null,summarySettings:{multiSummaryDelimiter:",",summaryFormat:"#.00"},columnSettings:[{allowGrouping:true,isGroupBy:false,compareFunc:null,groupComparerFunction:null,groupLabelFormatter:null,dir:"asc",summaries:[{summaryFunction:"avg",text:null,customSummary:null}],groupSummaries:[{summaryFunction:null,label:"",summaryTemplate:"{label}{result}",format:null}]}],expandTooltip:undefined,collapseTooltip:undefined,removeButtonTooltip:undefined,modalDialogGroupByButtonText:undefined,modalDialogCaptionButtonDesc:undefined,modalDialogCaptionButtonAsc:undefined,modalDialogCaptionButtonUngroup:undefined,modalDialogCaptionText:undefined,modalDialogDropDownLabel:undefined,modalDialogRootLevelHierarchicalGrid:undefined,modalDialogDropDownButtonCaption:undefined,modalDialogClearAllButtonLabel:undefined,emptyGroupByAreaContentSelectColumnsCaption:undefined,modalDialogButtonApplyText:undefined,modalDialogButtonCancelText:undefined,locale:{emptyGroupByAreaContent:undefined,emptyGroupByAreaContentSelectColumns:undefined,emptyGroupByAreaContentSelectColumnsCaption:undefined,expandTooltip:undefined,collapseTooltip:undefined,removeButtonTooltip:undefined,modalDialogCaptionButtonDesc:undefined,modalDialogCaptionButtonAsc:undefined,modalDialogCaptionButtonUngroup:undefined,modalDialogGroupByButtonText:undefined,modalDialogCaptionText:undefined,modalDialogDropDownLabel:undefined,modalDialogClearAllButtonLabel:undefined,modalDialogRootLevelHierarchicalGrid:undefined,modalDialogDropDownButtonCaption:undefined,modalDialogButtonApplyText:undefined,modalDialogButtonCancelText:undefined,summaryRowTitle:undefined,summaryIconTitle:undefined},modalDialogGroupByOnClick:false,modalDialogDropDownWidth:200,modalDialogDropDownAreaWidth:null,modalDialogAnimationDuration:200,modalDialogWidth:400,modalDialogHeight:"",useGridColumnFormatter:true,persist:true,groupByDialogContainment:"owner",dialogWidget:"igGridModalDialog",inherit:false,groupSummaries:[{summaryFunction:"",label:"",summaryTemplate:"{label}{value}",format:null}],groupSummariesPosition:"bottom"},events:{groupedColumnsChanging:"groupedColumnsChanging",groupedColumnsChanged:"groupedColumnsChanged",modalDialogMoving:"modalDialogMoving",modalDialogClosing:"modalDialogClosing",modalDialogClosed:"modalDialogClosed",modalDialogOpening:"modalDialogOpening",modalDialogOpened:"modalDialogOpened",modalDialogContentsRendering:"modalDialogContentsRendering",modalDialogContentsRendered:"modalDialogContentsRendered",modalDialogButtonApplyClick:"modalDialogButtonApplyClick",modalDialogButtonResetClick:"modalDialogButtonResetClick",modalDialogGroupingColumn:"modalDialogGroupingColumn",modalDialogGroupColumn:"modalDialogGroupColumn",modalDialogUngroupingColumn:"modalDialogUngroupingColumn",modalDialogUngroupColumn:"modalDialogUngroupColumn",modalDialogSortGroupedColumn:"modalDialogSortGroupedColumn"},_create:function(){this._orderedGroupedCols=[]},_createWidget:function(){this.options.columnSettings=[];this.options.groupedColumns=[];this.options.groupSummaries=false;this._tempSortingExpr=[];this._tempGroupedColumns=[];this._tempOrderedGroupedCols=[];this._tempOptions={};this._currentTreeLayer=null;this._isInitFC=false;this._modalSelectedLayout=null;$.Widget.prototype._createWidget.apply(this,arguments)},_getModalDialog:function(){return this.grid._rootContainer().find("#"+this.grid.id()+"_groupby_modalDialog")},changeGlobalLanguage:function(){},changeGlobalRegional:function(){},changeLocale:function(){var $dialog=this._getModalDialog(),self=this,colHeaderText;this._setGroupAreaTextContent($(".ui-iggrid-groupbyarea .ui-iggrid-groupbyareatext",this.grid.container()));this._super($(".ui-iggrid-grouparealist",this.grid.container()));this._super($("tbody>tr.ui-iggrid-groupedrow",this.grid.container()));this.grid.container().find("tr.ui-iggrid-summaryrow>td[gbsummaryiconcell]").each(function(){$(this).attr("title",self._getSummaryIconTitle($(this).data("colheader"),$(this).data("groupval")))});if($dialog.length){$dialog[this.options.dialogWidget]("option","locale",{modalDialogCaptionText:this._getLocaleValue("modalDialogCaptionText"),buttonApplyText:this._getLocaleValue("modalDialogButtonApplyText"),buttonCancelText:this._getLocaleValue("modalDialogButtonCancelText")});this._super($dialog);$dialog.find("a[data-localeid='modalDialogGroupByButtonText']").each(function(){colHeaderText=$(this).parent().next("span.ui-iggrid-dialog-text").text();$(this).attr("aria-label",self._getLocaleValue("modalDialogGroupByButtonText")+" "+colHeaderText)});$dialog.find("button[data-localeid='modalDialogCaptionButtonUngroup']").each(function(){colHeaderText=$(this).prev("span.ui-iggrid-dialog-text").text();$(this).attr("aria-label",self._getLocaleValue("modalDialogCaptionButtonUngroup")+" "+colHeaderText)})}},_registerWidget:$.noop,_unregisterWidget:$.noop,changeRegional:function(){var html;if(this.options.groupedColumns.length>0){html=this._generateGroupByRowsMarkup(this._getDataView(),this._startRowIndex,this._endRowIndex);this.grid.element.find(">tbody").empty().html(html)}},_setOption:function(key,value){var modalDialog=this._getModalDialog();this._super(key,value);if(key==="expansionIndicatorVisibility"){throw new Error(this._getLocaleValue("optionChangeNotSupported").replace("{optionName}",key))}switch(key){case"modalDialogGroupByOnClick":this._getModalDialog().remove();this._renderGroupByDialog();break;case"modalDialogAnimationDuration":modalDialog[this.options.dialogWidget]("option","animationDuration",value);break;case"modalDialogWidth":modalDialog[this.options.dialogWidget]("option","modalDialogWidth",value);break;case"modalDialogHeight":modalDialog[this.options.dialogWidget]("option","modalDialogHeight",value);break;case"groupByAreaVisibility":this._setGroupByAreaVisibility(value);break;default:break}},_setGroupByAreaVisibility:function(groupByAreaVisibility){var groupby=this,$footer,caption,groupbyarea=$("#"+this.grid.element.attr("id")+"_groupbyarea"),init=this.grid._initialized,$cntnr=this.grid.container();groupbyarea.remove();if(groupByAreaVisibility==="top"){caption=this.grid._caption();groupbyarea=caption.length?$("<div></div>").insertAfter(caption):$("<div></div>").prependTo($cntnr)}else if(groupByAreaVisibility==="bottom"){$footer=$cntnr.find(".ui-iggrid-footer").last();if(init&&$footer.length&&$footer.is(":visible")){groupbyarea=$("<div></div>").insertBefore($footer)}else{groupbyarea=$("<div></div>").appendTo($cntnr)}}else if(groupByAreaVisibility==="hidden"){if(init){this.grid._initializeHeights()}return}groupbyarea.attr("id",this.grid.element.attr("id")+"_groupbyarea").addClass(this.css.groupByArea);this._setGroupAreaTextContent($("<span></span>").appendTo(groupbyarea).addClass(this.css.groupByAreaText));groupbyarea.droppable({accept:"th:not([ groupby-disabled ])",hoverClass:groupby.css.groupByAreaDropHover,drop:function(event,ui){var accepted,isdescendant;isdescendant=ui.draggable.closest(".ui-iggrid-root").attr("id")===groupby.grid.id()||ui.draggable.closest(".ui-iggrid").find(".ui-iggrid-root").length>0;if(!groupby.grid.element.hasClass("ui-iggrid-root")){isdescendant=true}accepted=ui.draggable.hasClass("ui-iggrid-header")&&isdescendant;if(accepted){groupby._groupBy(event,ui.draggable)}}});if(this.grid._isMultiColumnGrid){groupbyarea.droppable("option","tolerance","touch")}if(init){this.grid._initializeHeights();this._groupAreaList()}},_headerRendered:function(event,args){if(args.owner.id()!==this.grid.id()){return}if(args.owner.element.attr("data-childgrid")){return}this._renderGroupByDialog();this._setGroupByAreaVisibility(this.options.groupByAreaVisibility)},_renderGroupByDialog:function(){var $buttonOK,containment,self=this,o=this.options,$captionButtonContainer,modalDialog;if(this.options.groupByDialogContainment==="owner"){containment=this.grid.container()}else{containment="window"}modalDialog=$("<div></div>").appendTo(this.grid._rootContainer()).attr("id",this.grid.id()+"_groupby_modalDialog");modalDialog[this.options.dialogWidget]({renderFooterButtons:!o.modalDialogGroupByOnClick,modalDialogWidth:o.modalDialogWidth,modalDialogHeight:o.modalDialogHeight,animationDuration:o.modalDialogAnimationDuration,locale:{modalDialogCaptionText:self._getLocaleValue("modalDialogCaptionText"),buttonApplyText:self._getLocaleValue("modalDialogButtonApplyText"),buttonCancelText:self._getLocaleValue("modalDialogButtonCancelText")},containment:containment,gridContainer:this.grid.container(),modalDialogOpening:function(event,args){return self._groupByDialogOpening(event,args)},modalDialogOpened:function(){self._trigger(self.events.modalDialogOpened,null,{modalDialogElement:modalDialog,owner:self})},modalDialogMoving:function(e,ui){self._trigger(self.events.modalDialogMoving,null,{modalDialogElement:e.target,owner:self,originalPosition:ui.originalPosition,position:ui.position})},modalDialogClosing:function(){return self._trigger(self.events.modalDialogClosing,null,{modalDialogElement:modalDialog,owner:self})},modalDialogClosed:function(){self._trigger(self.events.modalDialogClosed,null,{modalDialogElement:modalDialog,owner:self})}});if(o.modalDialogGroupByOnClick){$captionButtonContainer=modalDialog[this.options.dialogWidget]("getCaptionButtonContainer");$("<span></span>").addClass("ui-icon ui-icon-closethick").appendTo($("<a></a>").appendTo($captionButtonContainer).attr({title:this._getLocaleValue("columnChooserCloseButtonTooltip"),href:"#",role:"button","data-localeid":"columnChooserCloseButtonTooltip","data-localeattr":"title"}).bind("click.hiding",function(event){modalDialog[o.dialogWidget]("closeModalDialog",true,event);event.preventDefault();event.stopPropagation();return false}).addClass("ui-dialog-titlebar-close ui-corner-all"))}else{$captionButtonContainer=modalDialog[this.options.dialogWidget]("getCaptionButtonContainer");$buttonOK=this.grid.container().find("#"+this.grid.id()+"_groupby_modalDialog_footer_buttonok");$buttonOK.bind("igbuttonclick",function(e){self._groupByDialogButtonOKClick(e)})}},openGroupByDialog:function(){var modalDialog=this._getModalDialog();modalDialog[this.options.dialogWidget]("openModalDialog")},closeGroupByDialog:function(){var modalDialog=this._getModalDialog();modalDialog[this.options.dialogWidget]("closeModalDialog")},_groupByDialogOpening:function(){var noCancel,modalDialog=this._getModalDialog();noCancel=this._trigger(this.events.modalDialogOpening,null,{modalDialogElement:modalDialog,owner:this});if(noCancel){this.renderGroupByModalDialog()}return noCancel},renderGroupByModalDialog:function(){var $content,i,self=this,o=this.options,css=this.css,modalDialog=this._getModalDialog(),noCancel,$groupedColumns,$ungroupedColumns;noCancel=this._trigger(this.events.modalDialogContentsRendering,null,{modalDialogElement:modalDialog,owner:this});if(noCancel){$content=modalDialog[this.options.dialogWidget]("getContent");$content.empty();self._tempGroupedColumns=o.groupedColumns.slice(0);self._tempOrderedGroupedCols=self._orderedGroupedCols.slice(0);self._tempSortingExpr=self.grid.dataSource.settings.sorting.expressions.slice(0);self._tempOptions={columnLayouts:[]};if(this.grid.options.columnLayouts&&this.grid.options.columnLayouts.length>0){for(i=0;i<this.grid.options.columnLayouts.length;i++){self._tempOptions.columnLayouts.push($.extend(true,{},this.grid.options.columnLayouts[i]))}this._renderLayoutsDropDown()}$groupedColumns=$("<div></div>").attr("id",this.grid.id()+"_groupby_modalDialog_groupedcolumns").addClass(css.dialogGroupedColumns).appendTo($content);$ungroupedColumns=$("<div></div>").attr("id",this.grid.id()+"_groupby_modalDialog_ungroupedcolumns").addClass(css.dialogUnroupedColumns).appendTo($content);$("<ul></ul>").addClass(css.dialogListGroupedColumns).appendTo($groupedColumns);$("<ul></ul>").addClass(css.dialogListUngroupedColumns).appendTo($ungroupedColumns);this._renderColumnsDialog(this.grid.options.columns);this._currentTreeLayer=null;if(this._isToRenderClearAllButton()){this._renderDialogButtonClearAll()}else{this.grid.container().find("#"+this.grid.id()+"_groupbydialog_reset_button").remove()}this._trigger(this.events.modalDialogContentsRendered,null,{modalDialogElement:modalDialog,owner:this})}},_renderLayoutsDropDown:function(){var o=this.options,fn,w,dW,$ddField,self=this,css=this.css,modalDialog=this._getModalDialog(),$content=modalDialog[this.options.dialogWidget]("getContent"),cancelFunc,htmlLayouts,$buttonDD,$dropDown,$tree,dropDownId=this.grid.id()+"_groupby_modalDialog_layoutsDD",modalDialogDropDownAreaWidth=o.modalDialogDropDownAreaWidth||o.modalDialogDropDownWidth,columnLayoutsData=this.grid.options.columnLayouts.slice(0),$layoutsContainer;$layoutsContainer=$("<div></div>").attr("id",this.grid.id()+"_groupby_modalDialog_layoutsContainer").addClass(css.modalDialogLayoutsContainer).appendTo($content);htmlLayouts="<div style='float: left;'>"+this._getLocaleValue("modalDialogDropDownLabel")+"</div>"+"<div class='"+css.dialogLayoutsDD+"'>"+"\t<div id='"+this.grid.id()+"_groupby_modalDialog_layoutsDDField' class='"+css.dialogLayoutsDDField+"'>"+this._getLocaleValue("modalDialogRootLevelHierarchicalGrid")+"</div>"+"\t<span id='"+this.grid.id()+"_groupby_modalDialog_layoutsDDButton' style='float:right;'>^</span>"+"\t<div style='clear: both;'></div>"+"</div>"+"<div style='clear: both;'></div>";$layoutsContainer.html(htmlLayouts);$buttonDD=this.grid.container().find("#"+this.grid.id()+"_groupby_modalDialog_layoutsDDButton");$buttonDD.wrap("<a href='#' title='"+this._getLocaleValue("modalDialogDropDownButtonCaption")+" '></a>");cancelFunc=function(e){e.preventDefault();e.stopPropagation()};$buttonDD.closest("div").bind({mousedown:function(event){self._toggleDropDown(event,false)},mouseup:cancelFunc,click:cancelFunc});$buttonDD.addClass(css.dialogLayoutsDDButton);if(this._checkIsGroupByInherit(this.grid.options)===false){columnLayoutsData=this._getEnabledGroupByLayouts(columnLayoutsData)}if(columnLayoutsData.length>0||this._checkIsGroupByEnabled(this.grid.options)){$dropDown=this.grid.container().find("#"+dropDownId);$dropDown.remove();$dropDown=$("<div></div>");$dropDown.attr("id",dropDownId).css({position:"absolute",display:"none","z-index":"1000"}).addClass(this.css.dropDownLayoutsContainer).appendTo(this.grid.container().find("#"+this.grid.id()+"_groupby_modalDialog_content")).bind({mousedown:function(){clearTimeout(self._dropDownTimeout);setTimeout(function(){$buttonDD.closest("a").focus()},10)}});if(o.modalDialogDropDownWidth){$buttonDD.closest("div").width(o.modalDialogDropDownWidth)}if(modalDialogDropDownAreaWidth){$dropDown.width(modalDialogDropDownAreaWidth)}if(o.modalDialogDropDownWidth&&(!o.modalDialogDropDownWidth.indexOf||o.modalDialogDropDownWidth.indexOf("%")===-1)){w=$buttonDD.closest("div").width()-$buttonDD.outerWidth();$ddField=this.grid.container().find("#"+this.grid.id()+"_groupby_modalDialog_layoutsDDField");$ddField.width(w);dW=$ddField.outerWidth()-w;if(dW>0){w-=dW;$ddField.width(w-2)}}$tree=$("<div></div>").attr("id",this.grid.id()+"_groupby_modal_treeLayouts").addClass(css.modalDialogTreeContainer);$tree.appendTo($dropDown);columnLayoutsData=[{key:"Root",columnLayouts:columnLayoutsData,isRoot:true}];$tree.igTree({dataSourceType:"json",pathSeparator:"/",dataSource:columnLayoutsData,initialExpandDepth:1e6,bindings:{textKey:"key",childDataProperty:"columnLayouts"},nodeClick:function(event,args){var data=args.node.data,keyLayout=data.key,$groupedUL=self.grid.container().find("#"+self.grid.id()+"_groupby_modalDialog_groupedcolumns ul"),$ungroupedUL=self.grid.container().find("#"+self.grid.id()+"_groupby_modalDialog_ungroupedcolumns ul");if(data.dislabledGroupBy===true){return}$groupedUL.empty();$ungroupedUL.empty();self.grid.container().find("#"+self.grid.id()+"_groupby_modalDialog_layoutsDDField").text(keyLayout);if(args.node.path.length===1){self._renderColumnsDialog(self.grid.options.columns);self._currentTreeLayer=null}else{self._currentTreeLayer=keyLayout;self._renderColumnsDialog(data.columns,keyLayout)}self._toggleDropDown()}});fn=function(){self._dropDownTimeout=setTimeout(function(){self.closeDropDown()},200)};$buttonDD.closest("a").bind({focus:function(){self._igTreeHasFocus=true;clearTimeout(self._dropDownTimeout)},blur:function(){self._igTreeHasFocus=false;fn()}});$tree.find("a").bind({focus:function(){clearTimeout(self._dropDownTimeout)},blur:function(){fn()}});$tree.find("span.ui-igtree-expander.ui-icon").bind({click:function(){clearTimeout(self._dropDownTimeout);setTimeout(function(){$buttonDD.closest("a").focus()},10)}})}},openDropDown:function(){var $dropDown=this.grid.container().find("#"+this.grid.id()+"_groupby_modalDialog_layoutsDD");if($dropDown.is(":visible")===false){this._toggleDropDown()}},closeDropDown:function(){var $dropDown=this.grid.container().find("#"+this.grid.id()+"_groupby_modalDialog_layoutsDD");if($dropDown.is(":visible")===true){this._toggleDropDown()}},_getEnabledGroupByLayouts:function(layouts){var resultLayouts=[],i,tempChildLayouts,layout;if(layouts){for(i=0;i<layouts.length;i++){tempChildLayouts=null;layout=$.extend(true,{},layouts[i]);if(layout.columnLayouts&&this._checkIsGroupByInherit(layout)===false){tempChildLayouts=this._getEnabledGroupByLayouts(layout.columnLayouts);if(tempChildLayouts&&tempChildLayouts.length>0){layout.columnLayouts=tempChildLayouts}else{layout.columnLayouts=null}}if(this._checkIsGroupByEnabled(layout)){resultLayouts.push(layout)}else if(layout.columnLayouts!==null&&layout.columnLayouts!==undefined){layout.dislabledGroupBy=true;resultLayouts.push(layout)}}}return resultLayouts},_checkIsGroupByInherit:function(layout){var i;if(layout&&layout.features){for(i=0;i<layout.features.length;i++){if(layout.features[i].name==="GroupBy"&&layout.features[i].inherit===true){return true}}}return false},_checkIsGroupByEnabled:function(layout){var i;if(layout&&layout.features){for(i=0;i<layout.features.length;i++){if(layout.features[i].name==="GroupBy"){return true}}}return false},_toggleDropDown:function(){var $button=this.grid.container().find("#"+this.grid.id()+"_groupby_modalDialog_layoutsDDButton").parent(),$modalDialogContent=this.grid.container().find("#"+this.grid.id()+"_groupby_modalDialog_content"),$layoutsDDField=this.grid.container().find("#"+this.grid.id()+"_groupby_modalDialog_layoutsDDField").parent(),left=0,top=0,$dropDown=this.grid.container().find("#"+this.grid.id()+"_groupby_modalDialog_layoutsDD"),isVisible=$dropDown.is(":visible")===true,self=this;if($dropDown.data("isAnimating")===true){return}if(!isVisible){top=$layoutsDDField.igOffset().top-$modalDialogContent.igOffset().top+$layoutsDDField.height()+1;left=$layoutsDDField.igOffset().left-$modalDialogContent.igOffset().left;$dropDown.css({top:top,left:left})}$dropDown.data("isAnimating",true);$dropDown.slideToggle(400,function(){var $layoutsDD=self.grid.container().find("#"+self.grid.id()+"_groupby_modalDialog_layoutsDD"),$tree=self.grid.container().find("#"+self.grid.id()+"_groupby_modal_treeLayouts");if($dropDown.is(":visible")===true){$button.focus();self._activeDropdown=$dropDown;if(!self.options.modalDialogDropDownAreaWidth&&!self.options.modalDialogDropDownWidth){if($layoutsDD.width()!==$tree.width()){$layoutsDD.width($tree.width())}}}else{self._activeDropdown=null}$dropDown.data("isAnimating",false)})},_groupByDialogButtonOKClick:function(e){var noCancel,noCancelGroupBy,i,j,len,tempGroupedCol,copy,o=this.options,$hTable,modalDialog=this._getModalDialog(),isToCallGroupedColumnsChanged=false;this._tempGroupedColumns=this._tempGroupedColumns||[];noCancel=this._trigger(this.events.modalDialogButtonApplyClick,null,{modalDialogElement:modalDialog,owner:this,groupedColumns:this._tempGroupedColumns,groupedColumnLayouts:this._tempOptions.columnLayouts,sortingExpr:this._tempSortingExpr});if(noCancel){noCancelGroupBy=this._trigger(this.events.groupedColumnsChanging,e,{owner:this,groupedColumns:o.groupedColumns,newGroupedColumns:{columns:this._tempGroupedColumns,layouts:this._tempOptions.columnLayouts},triggeredBy:"modalDialog"});if(noCancelGroupBy){if(this._orderedGroupedCols.length!==this._tempOrderedGroupedCols.length){isToCallGroupedColumnsChanged=true}else{len=this._orderedGroupedCols.length;for(i=0;i<len;i++){tempGroupedCol=this._tempOrderedGroupedCols[i];for(j=0;j<len;j++){if(tempGroupedCol.key===this._orderedGroupedCols[j].key&&tempGroupedCol.layout===this._orderedGroupedCols[j].layout){break}}if(j===len){isToCallGroupedColumnsChanged=true;break}}}this._orderedGroupedCols=this._tempOrderedGroupedCols;if(o.groupedColumns){o.groupedColumns=this._tempGroupedColumns}if(this.grid.options.columnLayouts){this.grid.options.columnLayouts=this._tempOptions.columnLayouts}if(this.grid.dataSource.settings.sorting.expressions){this.grid.dataSource.settings.sorting.expressions=!this.grid._isHierarchicalGrid||this.options.type==="remote"&&!this.grid.options.odata?this._tempSortingExpr:this._filterExpressionsByLayout(this._tempSortingExpr)}this._setExprFormatter(this.grid.dataSource.settings.sorting.expressions);if(this._isToRenderClearAllButton()===false){if($(".ui-iggrid-groupbyarea",this.grid.container()).find("ul li").length===0){this._isgroup=null}else{this._isgroup=false}}else{this._isgroup=true}$hTable=this.grid.headersTable();if(o.groupedColumns.length===0&&$hTable.find("thead tr").children().first().hasClass("ui-iggrid-expandheadercellgb")){if($.ig.util.isIE){this.grid.element.children("tbody").hide();$hTable.hide()}this.grid.element.find("colgroup").children().first().remove();if(this.grid.options.fixedHeaders){$hTable.find("colgroup").children().first().remove()}if(this.grid.options.fixedFooters&&this.grid.options.height!==null){this.grid.footersTable().find("colgroup").children().first().remove()}$hTable.find("thead tr").children("[ data-skip ]").first().remove()}copy=this._orderedGroupedCols.slice(0);this._orderedGroupedCols=[];this._ensureLabelsOrder(copy,this._orderedGroupedCols,this.grid.options);this._rebind();this._clearSortingSettings(this._tempGroupedColumns);if($.ig.util.isIE&&!$hTable.is(":visible")){$hTable.show()}if(this.grid.options.width!==null&&this.grid.options.width!==undefined){this.grid._updateGridContentWidth()}this.grid._trigger("headerExtraCellsModified",null,{owner:this});if(isToCallGroupedColumnsChanged===true){this.grid._onGroupedColumnsChanged(this._tempGroupedColumns);this._trigger(this.events.groupedColumnsChanged,e,{owner:this,groupedColumns:this._tempGroupedColumns,triggeredBy:"modalDialog"})}}e.preventDefault();e.stopPropagation();modalDialog[this.options.dialogWidget]("closeModalDialog",null,e)}},_clearSortingSettings:function(keys){if(!keys||!keys.length){return}var i,key,sorting=this.grid.element.data("igGridSorting");if(sorting){for(i=0;i<keys.length;i++){key=$.type(keys[i])!=="object"?keys[i]:keys[i].key;sorting._clearSortStateByColKey(key,true)}sorting._clearActiveHeader();sorting._curColKey=null;sorting._currentActiveHeader=null;sorting._saveSortingExpressions()}},_setSortingTempExpr:function(key,dir,layout){var i,layouts,found=-1,j,gc=this._tempGroupedColumns,gcTemp,sexpr,s=this._tempSortingExpr,settings,lobj;sexpr={fieldName:key,dir:dir,layout:layout,isGroupBy:true};for(j=0;j<s.length;j++){if(s[j].fieldName===key&&(s[j].layout===layout||!layout&&!s[j].layout)){found=j;break}}if(dir===""){if(found>-1){s.splice(found,1)}return}else{if(found>-1){if(s[found].isGroupBy){s[found]=sexpr}else{s.splice(found,1);this._addSortingExpression(s,sexpr)}}else{this._addSortingExpression(s,sexpr)}}if(gc.length===0&&!layout){gcTemp=this._tempGroupedColumns.slice(0);this._allGroupedCols(gcTemp);gc=gcTemp.slice(0)}for(i=0;i<this._tempOrderedGroupedCols.length;i++){if(this._tempOrderedGroupedCols[i].key===key&&(this._tempOrderedGroupedCols.layout&&this._tempOrderedGroupedCols.layout===layout||!this._tempOrderedGroupedCols.layout&&!layout)){this._tempOrderedGroupedCols[i].dir=dir;break}}if(layout){layouts=[];this._findLayout(layout,this._tempOptions,layouts);lobj=layouts[0];for(i=0;lobj.features&&i<lobj.features.length;i++){if(lobj.features[i].name==="GroupBy"){settings=lobj.features[i].columnSettings;for(j=0;j<settings.length;j++){if(settings[j].columnKey===key){settings[j].dir=dir;break}}break}}}},_setGroupByTempExpr:function(key,isGroupBy,dir,layout){var i,gexpr,expr,lobj,c,fcs,setting,layouts;if(layout){layouts=[];this._findLayout(layout,this._tempOptions,layouts);lobj=layouts[0];c=this._getColumnByLayoutKey(key,lobj.columns)}else{lobj=this.grid.options;c=this.grid.columnByKey(key)}if(layout){if(!lobj.features){lobj.features=[];lobj.features.push({name:"GroupBy",columnSettings:[]});fcs=lobj.features[0].columnSettings}else{for(i=0;i<lobj.features.length;i++){if(lobj.features[i].name==="GroupBy"){fcs=lobj.features[i].columnSettings;if(!fcs){lobj.features[i].columnSettings=[];fcs=lobj.features[i].columnSettings}break}}}for(i=0;i<fcs.length;i++){if(fcs[i].columnKey===key){if(!isGroupBy){fcs.splice(i,1)}else{setting=fcs[i]}break}}if(isGroupBy){if(!setting){fcs.push({columnKey:key,isGroupBy:isGroupBy,dir:dir})}else{setting.isGroupBy=isGroupBy;setting.dir=dir}}}gexpr={key:key,dir:dir,layout:layout,col:c,isGroupBy:isGroupBy};if(!layout){expr=this._tempGroupedColumns;for(i=0;i<expr.length;i++){if(expr[i].key===key){expr.splice(i,1);break}}if(isGroupBy){expr=expr.concat(gexpr)}this._tempGroupedColumns=expr}if(isGroupBy){this._tempOrderedGroupedCols.push(gexpr)}else{for(i=0;i<this._tempOrderedGroupedCols.length;i++){if(this._tempOrderedGroupedCols[i].key===key&&(this._tempOrderedGroupedCols.layout&&this._tempOrderedGroupedCols.layout===layout||!this._tempOrderedGroupedCols.layout)){$.ig.removeFromArray(this._tempOrderedGroupedCols,i);break}}}this._setSortingTempExpr(key,dir,layout)},_checkColumnIsGroupedInternal:function(key,layout,groupedColumns,options){var isGrouped=false,i,j,layouts,lobj,fcs;if(!layout){for(i=0;i<groupedColumns.length;i++){if(groupedColumns[i].key===key){isGrouped=true;break}}}else{layouts=[];this._findLayout(layout,options,layouts);lobj=layouts[0];if(lobj&&lobj.features){for(i=0;i<lobj.features.length;i++){if(lobj.features[i].name==="GroupBy"){fcs=lobj.features[i].columnSettings;if(fcs){for(j=0;j<fcs.length;j++){if(fcs[j].columnKey===key){if(fcs[j].isGroupBy){isGrouped=true}break}}}break}}}}return isGrouped},checkColumnIsGrouped:function(key,layout){return this._checkColumnIsGroupedInternal(key,layout,this.options.groupedColumns,this.grid.options)},_getAllColumns:function(columns,columnsRes){var i,columnsLength=columns.length;for(i=0;i<columnsLength;i++){if(columns[i].group){this._getAllColumns(columns[i].group,columnsRes)}else{columnsRes.push(columns[i])}}},_renderColumnsDialog:function(columns,layout){var self=this,columnsRes=[],groupedCols;if(this.grid._isMultiColumnGrid){this._getAllColumns(columns,columnsRes)}else{columnsRes=columns}groupedCols=(self._tempOrderedGroupedCols||[]).filter(function(col){if(col.layout===layout||!col.layout&&!layout){self._renderDialogGroupedColumn(col.col,layout);return true}});columnsRes.forEach(function(col){var cs,colKey=col.key,i,gcLength=groupedCols.length;for(i=0;i<gcLength;i++){if(groupedCols[i].key===colKey){return true}}if(self.options.type==="remote"&&(col.unboundDS===true||col.unbound===true)){return true}cs=self._getColumnSettingByKey(col.key);if(!cs||cs.allowGrouping){self._renderDialogUngroupedColumn(col,layout)}})},_clearAllGroupedColumns:function(){this._tempGroupedColumns=[];this._clearAllGroupedColumnsLayout(this._tempOptions)},_clearAllGroupedColumnsLayout:function(layout){var i,fcs;if(layout!==null&&layout.features){for(i=0;i<layout.features.length;i++){if(layout.features[i].name==="GroupBy"){fcs=layout.features[i].columnSettings;if(fcs){layout.features[i].columnSettings=[]}}}}for(i=0;layout.columnLayouts&&i<layout.columnLayouts.length;i++){this._clearAllGroupedColumnsLayout(layout.columnLayouts[i])}},_isToRenderClearAllButton:function(){if(this.options.modalDialogGroupByOnClick||this._tempGroupedColumns.length>0||this._checkRenderLayoutsClearAll(this.grid.options)){return true}return false},_checkRenderLayoutsClearAll:function(layout){var i,j,fcs;if(layout!==null&&layout.features){for(i=0;i<layout.features.length;i++){if(layout.features[i].name==="GroupBy"){fcs=layout.features[i].columnSettings;if(fcs){for(j=0;j<fcs.length;j++){if(fcs[j].isGroupBy){return true}}}}}}for(i=0;layout.columnLayouts&&i<layout.columnLayouts.length;i++){if(this._checkRenderLayoutsClearAll(layout.columnLayouts[i])===true){return true}}return false},_renderDialogGroupedColumn:function(column,layout){
var i,j,s,$li,liHTML,$buttonUngroup,o=this.options,self=this,css=this.css,key=column.key,$ul=this.grid.container().find("#"+this.grid.id()+"_groupby_modalDialog_groupedcolumns ul"),buttonAscDescId=this.grid.id()+"_"+key+"_groupbydialog_groupedcolumns_buttonascdesc",buttonUngroupId=this.grid.id()+"_"+key+"_groupbydialog_groupedcolumns_buttonungroup",dir="asc",gc=null;this.grid.container().find("#"+this.grid.id()+"_groupby_modalDialog").css("width");if(!layout){for(i=0;i<self._tempGroupedColumns.length;i++){if(self._tempGroupedColumns[i].key===key){gc=self._tempGroupedColumns[i];dir=gc.dir;break}}}else{s=self._tempSortingExpr;for(j=0;j<s.length;j++){if(s[j].fieldName===key&&(s[j].layout===layout||!layout&&!s[j].layout)){dir=s[j].dir;break}}}$li=$("<li tabIndex='0'></li>").attr("id",self.grid.id()+"_"+key+"_groupbydialog_grouped_li").addClass(css.dialogGroupedItem);$li.appendTo($ul);liHTML="<span id='"+buttonAscDescId+"' class='"+css.dialogButtonAsc+"' role='button' title='"+self._getLocaleValue("modalDialogCaptionButtonAsc")+"'"+" data-localeid='modalDialogCaptionButtonAsc' data-localeattr='title'>"+"\t<span class='"+css.dialogButtonAscIcon+"'></span>"+"</span>"+"<span class='"+css.dialogGroupedColumnTextContainer+"'>"+column.headerText+"</span>"+"<button type='button' id='"+buttonUngroupId+"' class='"+css.dialogButtonUngroup+"' role='button' title='"+self._getLocaleValue("modalDialogCaptionButtonUngroup")+"'"+" data-localeid='modalDialogCaptionButtonUngroup' data-localeattr='title' aria-label='"+self._getLocaleValue("modalDialogCaptionButtonUngroup")+" "+column.headerText+"' >"+"\t<span class='"+css.dialogButtonUngroupContainer+"'></span>"+"\t<span class='ui-button-text' data-localeid='modalDialogCaptionButtonUngroup'>"+self._getLocaleValue("modalDialogCaptionButtonUngroup")+"</span>"+"</button>";$li.html(liHTML);$buttonUngroup=this.grid.container().find("#"+buttonUngroupId);self._setDialogButtonAscDesc(dir==="asc",key);$li.bind({keydown:function(e){if(e.keyCode===$.ui.keyCode.ENTER||e.keyCode===$.ui.keyCode.SPACE){$li.click();e.preventDefault();e.stopPropagation()}},click:function(){self._dialogButtonAscDescClick(key,layout)}});$buttonUngroup.bind({keydown:function(e){if(e.keyCode===$.ui.keyCode.ENTER||e.keyCode===$.ui.keyCode.SPACE){e.target.click();e.preventDefault();e.stopPropagation()}},click:function(e){var noCancel,$nextLi;noCancel=self._trigger(self.events.modalDialogUngroupingColumn,e,{key:key,layout:layout,owner:self});if(noCancel){$li.remove();if(o.modalDialogGroupByOnClick===true){self.ungroupByColumn(key,layout)}else{self._setGroupByTempExpr(key,false,"",layout)}$nextLi=self._renderDialogUngroupedColumn(column,layout);$nextLi.find(":focusable").first().focus();if(self.grid.container().find("#"+self.grid.id()+"_groupby_modalDialog_groupedcolumns ul li").length===0&&self._isToRenderClearAllButton()===false){self.grid.container().find("#"+self.grid.id()+"_groupbydialog_reset_button").remove()}self._trigger(self.events.modalDialogUngroupColumn,e,{key:key,layout:layout,owner:self,groupedColumns:self._tempGroupedColumns})}e.preventDefault();e.stopPropagation()},mouseover:function(){if(!$(this).hasClass(css.dialogButtonsHover)){$(this).addClass(css.dialogButtonsHover)}},mouseout:function(){if($(this).hasClass(css.dialogButtonsHover)){$(this).removeClass(css.dialogButtonsHover)}}});return $li},_dialogButtonAscDescClick:function(key,layout){var o=this.options,noCancel,$buttonAscDesc=this.grid.container().find("#"+this.grid.id()+"_"+key+"_groupbydialog_groupedcolumns_buttonascdesc"),modalDialog=this._getModalDialog(),isAsc=$buttonAscDesc.data("isAsc"),dir=isAsc?"desc":"asc";noCancel=this._trigger(this.events.modalDialogSortGroupedColumn,null,{modalDialogElement:modalDialog,owner:this,key:key,isAsc:!isAsc,layout:layout});if(noCancel){if(o.modalDialogGroupByOnClick===true){this._setSortingTempExpr(key,dir,layout);this.grid.dataSource.settings.sorting.expressions=this._filterExpressionsByLayout(this._tempSortingExpr);this._setExprFormatter(this.grid.dataSource.settings.sorting.expressions);this._rebind()}else{this._setSortingTempExpr(key,dir,layout)}this._setDialogButtonAscDesc(!isAsc,key)}},_setDialogButtonAscDesc:function(isAsc,key){var css=this.css,$buttonAscDesc=this.grid.container().find("#"+this.grid.id()+"_"+key+"_groupbydialog_groupedcolumns_buttonascdesc"),$spanIcon=$buttonAscDesc.find("span:eq(0)"),caption,localeAttrId;if(isAsc===true){$buttonAscDesc.removeClass(css.dialogButtonDesc).addClass(css.dialogButtonAsc);$spanIcon.removeClass(css.dialogButtonDescIcon).addClass(css.dialogButtonAscIcon);caption=this._getLocaleValue("modalDialogCaptionButtonAsc");localeAttrId="modalDialogCaptionButtonAsc"}else{$buttonAscDesc.removeClass(css.dialogButtonAsc).addClass(css.dialogButtonDesc);$spanIcon.removeClass(css.dialogButtonAscIcon).addClass(css.dialogButtonDescIcon);caption=this._getLocaleValue("modalDialogCaptionButtonDesc");localeAttrId="modalDialogCaptionButtonDesc"}$buttonAscDesc.data("isAsc",isAsc).attr("title",caption).attr("data-localeid",localeAttrId)},_renderDialogButtonClearAll:function(){if(this.options.modalDialogGroupByOnClick===true){return}var self=this,resetButtonId=self.grid.id()+"_groupbydialog_reset_button",modalDialog=this._getModalDialog(),$captionButtonContainer,$resetButton;if(this.grid.container().find("#"+resetButtonId).length===0){$captionButtonContainer=modalDialog[this.options.dialogWidget]("getCaptionButtonContainer");$resetButton=$("<button type='button'></button>").attr("id",resetButtonId).attr("data-localeid","modalDialogClearAllButtonLabel").appendTo($captionButtonContainer);$resetButton.igButton({labelText:self._getLocaleValue("modalDialogClearAllButtonLabel"),click:function(e){var noCancel,$groupedUL,$ungroupedUL,layouts=[];noCancel=self._trigger(self.events.modalDialogButtonResetClick,e,{modalDialogElement:modalDialog,owner:self});if(noCancel){self._clearAllGroupedColumns();self._tempSortingExpr=self.grid.dataSource.settings.sorting.expressions.slice(0);$groupedUL=self.grid.container().find("#"+self.grid.id()+"_groupby_modalDialog_groupedcolumns ul");$ungroupedUL=self.grid.container().find("#"+self.grid.id()+"_groupby_modalDialog_ungroupedcolumns ul");$groupedUL.empty();$ungroupedUL.empty();self._tempSortingExpr=[];self._tempOrderedGroupedCols=[];if(!self._currentTreeLayer){self._renderColumnsDialog(self.grid.options.columns)}else{self._findLayout(self._currentTreeLayer,self._tempOptions,layouts);if(layouts.length>0){self._renderColumnsDialog(layouts[0].columns,self._currentTreeLayer)}}$(this).remove()}}})}},_renderDialogUngroupedColumn:function(column,layout){var self=this,$li,$a,key=column.key,o=this.options,css=this.css,$ul=this.grid.container().find("#"+this.grid.id()+"_groupby_modalDialog_ungroupedcolumns ul");$li=$("<li></li>").attr("id",self.grid.id()+"_"+key+"_groupbydialog_grouped_li").addClass(css.dialogUngroupedItem).append("<span class='"+css.dialogUngroupedColumnsGroupByButton+"'><a href='#'></a></span> <span class='"+css.dialogUngroupedColumnsText+"'>"+column.headerText+"</span>");$li.appendTo($ul);$a=$li.find("a:first");$a.addClass(css.modalDialogSortByColumn);$a.html(self._getLocaleValue("modalDialogGroupByButtonText"));$a.attr("data-localeid","modalDialogGroupByButtonText");$a.attr("aria-label",self._getLocaleValue("modalDialogGroupByButtonText")+" "+column.headerText);$li.bind({click:function(e){var noCancel,$nextLi;noCancel=self._trigger(self.events.modalDialogGroupingColumn,e,{key:key,layout:layout,owner:self});if(noCancel){$li.remove();if(o.modalDialogGroupByOnClick){self.groupByColumn(key,layout)}else{self._setGroupByTempExpr(key,true,o.defaultSortingDirection,layout)}self._renderDialogButtonClearAll();$nextLi=self._renderDialogGroupedColumn(column,layout);$nextLi.find(":focusable").first().focus();self._renderDialogButtonClearAll();self._trigger(self.events.modalDialogGroupColumn,e,{key:key,layout:layout,owner:self,groupedColumns:self._tempGroupedColumns})}e.preventDefault();e.stopPropagation()}});return $li},_setGroupAreaTextContent:function($area){var text=this._getLocaleValue("emptyGroupByAreaContent"),linkText=this._getLocaleValue("emptyGroupByAreaContentSelectColumns"),linkTextCaption=this._getLocaleValue("emptyGroupByAreaContentSelectColumnsCaption"),$a,self=this;text=text.replace("{0}","<a href='#' id='"+this.grid.id()+"_link_selectcolumns' title='"+linkTextCaption+"' data-localeid='emptyGroupByAreaContentSelectColumns' data-localeattr='title'>"+linkText+"</a>");$area.html(text);$a=this.grid.container().find("#"+this.grid.id()+"_link_selectcolumns");$a.bind({click:function(e){self.openGroupByDialog();e.preventDefault();e.stopPropagation()}})},_headerCellDragCancel:function(){return false},_headerCellRendered:function(event,args){var groupby=this,cs,hg,hgTemp,isMultiColumnHeaderGrid=this.grid._isMultiColumnGrid;if(args.owner.id()!==this.grid.id()){return}if(args.isMultiColumnHeader===true){return}hg=groupby.grid.element.hasClass("ui-iggrid-root")?groupby.grid.container():groupby.grid.element.closest(".ui-iggrid-root");if(hg.length===0){hg=groupby.grid.container()}else{hgTemp=hg.closest(".ui-widget");if(hgTemp.length>0){hg=hgTemp}}cs=this._getColumnSettingByKey(args.columnKey);if(!$.ig.util.isIE||$.ig.util.browserVersion>=9){args.th.find(".ui-iggrid-headertext").css("width","100%")}if(cs&&cs.allowGrouping||!cs){args.th.draggable({containment:hg,appendTo:hg,distance:5,revert:"invalid",scroll:false,cancel:"div.ui-iggrid-indicatorcontainer",helper:function(event){var th,helperDOM;if($(event.target).is("span")){groupby._spanDragging=true}else{groupby._spanDragging=false}th=$(event.target).closest("th");helperDOM=th.clone().css("overflow","hidden").width(th.width()).addClass("ui-widget ui-iggrid").wrap($("<div class='"+groupby.css.dragMarkup+"'/>").width(th.outerWidth()));if(isMultiColumnHeaderGrid){helperDOM.height(th.height())}return helperDOM.parent()},opacity:groupby.options.labelDragHelperOpacity,drag:function(event,ui){var groupbyarea;groupby._isDragging=true;groupbyarea=$(".ui-iggrid-groupbyarea",hg);if(!groupbyarea.hasClass("ui-iggrid-groupbyareahover")&&!groupby._movingEnabled){if(groupby._spanDragging){ui.helper.find("span").css("cursor","no-drop")}else{ui.helper.css("cursor","no-drop")}}else{if(groupby._spanDragging){ui.helper.find("span").css("cursor","move")}else{ui.helper.css("cursor","move")}}},stop:function(){groupby._isDragging=false}}).bind({mouseover:groupby._headerMouseOverHandler,mouseout:groupby._headerMouseOutHandler});if(args.owner.element.attr("data-childgrid")){args.th.attr("data-layout",args.owner.options.key).attr("data-grid-id",args.owner.element.attr("id"))}}},_getColumnSettingByKey:function(key){var i;for(i=0;i<this.options.columnSettings.length;i++){if(this.options.columnSettings[i].columnKey===key){return this.options.columnSettings[i]}}},_renderRecords:function(ui,args){if(args.owner.id()!==this.grid.id()){return}if(this.options.groupedColumns.length>0){this._renderRecordsInternal(args)}else{return true}return false},_recordsRendered:function(ui,args){var currentScrollTop=$(window).scrollTop();if(!args.tbody.is(":visible")){args.tbody.css("display","")}if(this._scrolltop!==0&&currentScrollTop!==0&&this._scrolltop!==currentScrollTop){$(window).scrollTop(this._scrolltop)}},_generateGroupByRowsMarkup:function(ds,start,end){var i,html="",dsRow,rowHtml,idx,pre,app,grid=this.grid,dataRecCount=0;for(i=start;i<=end;i++){dsRow=ds[i];if(!dsRow.__gbRecord&&!dsRow.__gbSummaryRecord){rowHtml=grid._renderRecord(dsRow,i,false,dataRecCount);dataRecCount++;idx=rowHtml.indexOf(">")+1;pre=rowHtml.substring(0,idx);app=rowHtml.substring(idx);html+=pre+'<td class="'+this.css.nonGroupRowEmptyCell+'" data-skip="true" tabindex="'+this.grid.options.tabIndex+'"></td>'+app}else if(!dsRow.__gbRecord){html+=this._renderSummaryRecord(dsRow,i)}else{html+=this._renderGroupRow(dsRow,i)}}return html},_renderRecordsInternal:function(args){var grid=this.grid,ds,noCancel=true,dataSkipWidth=0,scrollContainer,start,end,vrtWnd,tbody=grid.element.children("tbody"),html,$thDataSkip;noCancel=grid._trigger(grid.events.rowsRendering,null,args);if(noCancel){ds=this._getDataView();if(this._colspan===undefined||this._colspan===null){this._determineColspan()}if(!grid.headersTable().find("thead tr th").hasClass("ui-iggrid-expandheadercellgb")){$thDataSkip=$("<th></th>").prependTo(grid.headersTable().find("thead tr:nth-child(1)")).addClass(this.css.expandHeaderCellGroupBy).addClass(this.css.headerExtraCell).attr("data-skip",true);if(grid._isMultiColumnGrid){$thDataSkip.attr("rowspan",grid._maxLevel+1)}}tbody.show();if(this.grid.options.virtualization){vrtWnd=args.vrtWnd;start=vrtWnd.start;end=vrtWnd.end;if(start===undefined){start=0;end=ds.length-1}if(start!==undefined&&end===undefined){end=start;if(end>ds.length-1){end=ds.length-1}start=0}if(start<0||start>ds.length-1){start=0;grid._startRowIndex=0}if(!start){grid._virtualRowCount=grid._determineVirtualRowCount();if(grid._virtualRowCount>ds.length){grid._virtualRowCount=ds.length}end=grid._virtualRowCount}else if(start>=end){grid._virtualRowCount=grid._determineVirtualRowCount();end=start+grid._virtualRowCount}if(end>ds.length-1){end=ds.length-1}if(!start&&!end&&ds.length){grid._virtualRowCount=grid._determineVirtualRowCount();grid._totalRowCount=grid._getTotalRowCount();if(grid._virtualRowCount>grid._totalRowCount){grid._virtualRowCount=grid._totalRowCount}end=grid._virtualRowCount-1}}else{start=0;end=ds.length-1}this._startRowIndex=start;this._endRowIndex=end;html=this._generateGroupByRowsMarkup(ds,start,end);this._expandedRowCount=0;if(window.MSApp===undefined){tbody.html(html)}else{MSApp.execUnsafeLocalFunction(function(){tbody.html(html)})}if(grid.options.width===null){grid._setContainerWidth(grid.container())}else{grid._updateGridContentWidth()}if(grid._persistVirtualScrollTop&&grid._prevFirstVisibleTROffset){if(grid.options.virtualization!==true&&grid.options.rowVirtualization!==true){grid.scrollContainer()[0].scrollTop=grid._prevFirstVisibleTROffset}}scrollContainer=grid._virtualcontainer().length>0?grid._virtualcontainer():grid.scrollContainer();if(this.options.groupedColumns.length>0&&scrollContainer.length>0&&grid.element.width()>scrollContainer.width()&&(grid.options.virtualization===true||grid.options.rowVirtualization===true)){$(grid.element).find(">colgroup>col[ data-skip=true ]").each(function(){dataSkipWidth+=parseInt(this.style.width,10)});grid._setGridContentWidth(grid._calculateContainerWidth(false)+dataSkipWidth)}tbody.find("[data-id='"+this._focusCellId+"']").find(">td[gbexpandcell]").focus();this._focusCellId=null;grid._buildVirtualDomForContinuousVirtualization();this.grid._trigger(this.grid.events.rowsRendered,null,{owner:this.grid,tbody:tbody})}},_encodeSummaryParams:function(owner,params){var cs=this.options.columnSettings,i,j,key;for(i=0;i<cs.length;i++){if(cs[i].summaries&&cs[i].summaries.length>0){for(j=0;j<cs[i].summaries.length;j++){key="gs("+cs[i].columnKey+")";if(params.extraParams[key]){params.extraParams[key]=params.extraParams[key]+","+cs[i].summaries[j].summaryFunction}else{params.extraParams[key]=cs[i].summaries[j].summaryFunction}}}}},_getCountFromMetadata:function(contents,gcval,idval){var n,mdata=this.grid.dataSource.metadata(this.options.resultResponseKey),k,nVal,mul=1,t;if(mdata&&mdata[gcval]){k=mdata[gcval];for(n in k){if(k.hasOwnProperty(n)){t=this.grid.columnByKey(gcval).dataType;nVal=n;if($.type(n)==="string"){if(t==="bool"){nVal=n.toLowerCase()==="true"?true:false}else if(t==="number"){nVal=mul*n}}if(idval!==null&&idval!==undefined&&!idval.length&&idval===nVal*mul||nVal===idval){contents=contents.replace(new RegExp("__sum__","g"),k[n])}}}}return contents},_calcRealSummary:function(contents,gcval,idval,subdata,allGroupData){var n,k,i,cs,j,mdata=this.grid.dataSource.metadata(this.options.resultResponseKey),o,str=contents,val,found=false,mul=1,t,kVal;n=this.grid.dataSource.data();if(mdata){str=this._getCountFromMetadata(str,gcval,idval);cs=this.options.columnSettings;for(i=0;i<cs.length;i++){for(j=0;j<cs[i].summaries.length;j++){o=mdata[cs[i].columnKey+"_"+cs[i].summaries[j].summaryFunction];for(k in o){if(o.hasOwnProperty(k)){t=this.grid.columnByKey(gcval).dataType;if(t==="bool"&&$.type(k)==="string"){kVal=k.toLowerCase()==="true"?true:false}else if(t==="number"&&$.type(k)==="string"){kVal=mul*k}else{kVal=k}if(idval!==null&&!idval.length&&idval===kVal*mul||kVal===idval){val=o[k];val=$.ig.formatter(val,"number",this.options.summarySettings.summaryFormat);if(cs[i].summaries[j].customSummary===undefined||cs[i].summaries[j].customSummary===null){str=str.replace(cs[i].columnKey+cs[i].summaries[j].summaryFunction+"$$value$$",val)}}}}}}}if(!found||this.grid._getDataView().length<n.length){return this._summaries(str,subdata,gcval,allGroupData)}},getGroupedData:function(data,colKey,idval){var i,len,res,ds=this.grid.dataSource,gbData=ds.groupByData(),vgbData=ds.visibleGroupByData();res=ds._generateGroupByData(data,[{fieldName:colKey,isGroupBy:true}]);if(idval!==undefined){len=res.length;for(i=0;i<len;i++){if(res[i].val===idval){res=res[i].recs;break}}}this._gbData=gbData;this._vgbData=vgbData;return res},_settingFromKey:function(key){var cs,j;for(j=0;j<this.options.columnSettings.length;j++){if(this.options.columnSettings[j].columnKey===key){cs=this.options.columnSettings[j]}}return cs},_renderGroupRow:function(gbRec,rowInd){var expcell,textcell,col,tr,val=gbRec.val,classAttr=this.grid._addCellStyle(gbRec),collapsed=gbRec.collapsed,field=gbRec.fieldName,indent=gbRec.level,colCustomSetting=this._settingFromKey(field),customName=colCustomSetting.customGroupName,margin=indent>0?parseInt(this.options.indentation,10)*indent:0,cscol,htext,text,state,css,i,cs=this.options.columnSettings,shtml="",tmpl,title,j,hide=false;if(!collapsed){css=this.css.groupByExpandCellExpanded;title=this._getLocaleValue("collapseTooltip")}else{css=this.css.groupByExpandCellCollapsed;title=this._getLocaleValue("expandTooltip");if(indent>0&&!this.grid.options.virtualization){hide=true}}if(this.options.expansionIndicatorVisibility){expcell="<td class='"+this.css.groupByExpandColumn+classAttr.replace(/class=\"/,"").replace(/\"/,"")+"' gbexpandcell='1'"+" tabindex='"+this.grid.options.tabIndex+"'><span class='ui-iggrid-expandbuttoncontainer-group-by' style='margin-left:"+margin+"px;'><span class='"+css+"' title='"+title+"'"+"data-localeid='"+(collapsed?"expandTooltip":"collapseTooltip")+"'"+"data-localeattr='title'"+"></span></span></td>"}else{expcell="<td class='"+this.css.groupByExpandColumn+classAttr.replace(/class=\"/,"").replace(/\"/,"")+"' gbexpandcell='1'></td>"}tmpl=this.options.groupedRowTextTemplate;col=this.grid.columnByKey(field);if(colCustomSetting&&colCustomSetting.groupLabelFormatter){if(typeof colCustomSetting.groupLabelFormatter==="function"){val=colCustomSetting.groupLabelFormatter(val)}else{val=window[colCustomSetting.groupLabelFormatter](val)}}else if(this.options.useGridColumnFormatter===true){val=this.grid._renderCell(val,col,gbRec.recs&&gbRec.recs.length?gbRec.recs[0]:null," ")}tmpl=tmpl.replace(new RegExp("\\$\\{key\\}","g"),col.headerText);if(customName){text=tmpl.replace(new RegExp("\\$\\{val\\}","g"),customName).replace(new RegExp("\\$\\{count\\}","g"),"__sum__")}else{text=tmpl.replace(new RegExp("\\$\\{val\\}","g"),val).replace(new RegExp("\\$\\{count\\}","g"),"__sum__")}if(!collapsed){state="expanded"}else{state="collapsed"}for(i=0;i<cs.length;i++){if(cs[i].columnKey!==field){cscol=this.grid.columnByKey(cs[i].columnKey);htext=cscol?cscol.headerText:cs[i].columnKey}else{htext=col.headerText}for(j=0;j<cs[i].summaries.length;j++){shtml+=" "+htext+" "+(cs[i].summaries[j].text||cs[i].summaries[j].summaryFunction)+" "+cs[i].columnKey+cs[i].summaries[j].summaryFunction+"$$value$$";if(j!==cs[i].summaries.length-1){shtml+=this.options.summarySettings.multiSummaryDelimiter}}}text+=shtml;textcell="<td data-gbsummary='true' colspan='"+this._colspan+"' tabindex='"+this.grid.options.tabIndex+"'"+classAttr+">"+text+"</td>";tr="<tr class='"+this.grid.css.recordClass+" "+this.css.groupedRow+"' data-grouprow='true' data-state='"+state+"' data-glevel='"+indent+"'"+" aria-expanded='"+(!collapsed?"true":"false")+"'"+" aria-describedby='"+this.grid.id()+"_"+col.key+"'"+" title='"+this._getLocaleValue("summaryRowTitle")+"'"+" data-localeid='summaryRowTitle'"+" data-localeattr='title'"+" data-id='"+gbRec.id+"'"+" data-row-idx='"+rowInd+"'"+" tabindex='"+this.grid.options.tabIndex+"' >"+expcell+textcell+"</tr>";tr=this._calcRealSummary(tr,gbRec.fieldName,gbRec.val,gbRec.recs,gbRec.recs);tr=tr.replace(new RegExp("__sum__","g"),gbRec.recs.length);return tr},_getSummaryIconTitle:function(colHeader,groupVal){return this._getLocaleValue("summaryIconTitle").replace("{0}",colHeader).replace("{1}",groupVal)},_renderSummaryRecord:function(gbRec,rowInd){var grid=this.grid,cols=grid.options.columns,indent=gbRec.level-1,margin=indent>0?parseInt(this.options.indentation,10)*indent:0,tr="",groupVal=gbRec.groupValue,colIndex,summIndex,summLabel,summValue,colSetting,i,emptyCells,compareFunc,col,cscol,colKey,colHeader,summaryIconTitle;tr+="<tr class='"+this.grid.css.recordClass+" "+this.css.summaryRow+"'"+" role='row'"+" aria-describedby='"+this.grid.id()+"_"+gbRec.id.split(":")[indent*2]+"'"+" aria-label='summaryrow"+"'"+" data-summaryrow='true' "+" data-glevel='"+(gbRec.level-1)+"'"+" data-id='"+gbRec.id+"_"+gbRec.position+"Summary"+"'"+" data-row-idx='"+rowInd+"'"+" tabindex='"+grid.options.tabIndex+"'"+">";colKey=gbRec.id.split(":")[indent*2];cscol=this.grid.columnByKey(colKey);colHeader=cscol?cscol.headerText:colKey;if(cscol&&(cscol.dataType==="date"||cscol.dataType==="time")){groupVal=new Date(parseInt(groupVal,10))}groupVal=this.grid._renderCell(groupVal,cscol);summaryIconTitle=this._getSummaryIconTitle(colHeader,groupVal);tr+="<td class='"+this.css.groupBySummaryIconColumn+"'"+" gbsummaryiconcell='1"+"'"+" tabindex='"+this.grid.options.tabIndex+"'"+" title='"+summaryIconTitle+"'"+" data-skip='true'"+" data-colheader='"+colHeader+"'"+" data-groupval='"+groupVal+"'"+">"+"<span class='ui-iggrid-summaryiconcontainer-group-by'>"+"<span class='"+this.css.groupBySummaryIcon+"' style='margin-left:"+margin+"px;'>"+"</span>"+"</span>"+"</td>";emptyCells=this.grid.headersTable().find("colgroup").children("[ data-skip ]").length-1;for(i=0;i<emptyCells;i++){tr+="<td class='"+this.css.groupBySummaryEmptyCellColumn+"'"+" gbsummaryemptycell='1'"+" tabindex='"+this.grid.options.tabIndex+"'></td>"}compareFunc=function(target){return target.columnKey===col.key};for(colIndex=0;colIndex<cols.length;colIndex++){col=cols[colIndex];if(col.hidden){continue}tr+="<td class='"+this.css.groupBySummaryColumn+"'"+" role='gridcell'"+" aria-describedby='"+this.grid.id()+"_"+cols[colIndex].key+"'"+" gbsummarycell='1'"+" tabindex='"+grid.options.tabIndex+"'>";if(!gbRec.summaries[col.key]){tr+="</td>";continue}for(summIndex=0;summIndex<gbRec.summaries[col.key].length;summIndex++){colSetting=this.options.columnSettings.filter(compareFunc);summValue=gbRec.summaries[col.key][summIndex];summLabel=colSetting[0].groupSummaries[summIndex].label;if((col.dataType==="date"||col.dataType==="time")&&colSetting[0].groupSummaries[summIndex].applyFormat){summValue=new Date(parseInt(summValue,10))}if(colSetting[0].groupSummaries[summIndex].applyFormat&&!colSetting[0].groupSummaries[summIndex].format){summValue=this.grid._renderCell(summValue,col)}else if(colSetting[0].groupSummaries[summIndex].applyFormat&&colSetting[0].groupSummaries[summIndex].format){summValue=$.ig.formatter(summValue,col.dataType,colSetting[0].groupSummaries[summIndex].format)}tr+="<div style='margin: 0'>"+colSetting[0].groupSummaries[summIndex].summaryTemplate.replace("{label}",summLabel).replace("{value}",summValue)+"</div>"}tr+="</td>"}tr+="</tr>";return tr},_renderNewRow:function(rec){var tbody=this.grid.element.children("tbody"),dataRows=tbody.children("tr:not([ data-container='true' ],[ data-grouprow='true' ])"),index=dataRows.length,row;row=$(this.grid._renderRecord(rec,index));dataRows.last().find("td."+this.css.nonGroupRowEmptyCell).removeClass(this.css.groupByLastEmptyCell);if(this.groupByColumns().length>0){$("<td></td>").addClass(this.css.nonGroupRowEmptyCell).addClass(this.css.groupByLastEmptyCell).attr("tabindex",this.grid.options.tabIndex).attr("data-skip",true).prependTo(row)}if(this.grid.options.virtualization){this.grid._buildVirtualDomForContinuousVirtualization()}MSApp.execUnsafeLocalFunction(function(){tbody.append(row)})},_summaries:function(contents,data,gcval,allGroupData){var i,j,cs=this.options.columnSettings,s,ret=contents,arr,val,argsData,format;if(contents&&contents.indexOf&&contents.indexOf("$$value$$")===-1){return contents}for(i=0;i<cs.length;i++){s=cs[i].summaries;if(s.length>0){arr=this._arr(cs[i].columnKey,data);for(j=0;j<s.length;j++){if(s[j].summaryFunction==="custom"){argsData={dataRecords:data,array:arr,key:gcval,allGroupData:allGroupData}}else{argsData=arr}val=$.ig.calcSummaries(s[j].summaryFunction,argsData,s[j].customSummary);var dType=this.grid.columnByKey(gcval).dataType;if((dType==="date"||dType==="time")&&(s[j].summaryFunction==="min"||s[j].summaryFunction==="max")){format=dType==="date"?$.ig.regional.defaults.datePattern:$.ig.regional.defaults.timePattern;val=$.ig.formatter(new Date(val),"date",format)}else{val=$.ig.formatter(val,"number",this.options.summarySettings.summaryFormat)}ret=ret.replace(cs[i].columnKey+s[j].summaryFunction+"$$value$$",val)}}}return ret},_arr:function(key,data){var arr=[],i;for(i=0;i<data.length;i++){arr.push(data[i][key])}return arr},_dataEmpty:function(event,args){var indent=0,indentation=parseInt(this.options.indentation,10),$cntnr,gcols=this.options.groupedColumns;if(args.owner.id()!==this.grid.id()){return}if(gcols.length>0){indent+=indentation*this.options.groupedColumns.length;if(this.options.indentation&&this.options.indentation.indexOf&&this.options.indentation.indexOf("%")>=0){indent=this.options.indentation}this._indent=indent;this._addOrUpdateDataSkipCol(indent)}$cntnr=this.grid.container();if(this._isgroup!==null&&this._isgroup!==undefined&&$cntnr.length&&$cntnr[0].style.width&&!this.grid.options.width){if(this._isgroup===true){if(this.grid.options.virtualization!==true){$cntnr.width(parseInt($cntnr.width(),10)+indentation)}}else{$cntnr.width(parseInt($cntnr.width(),10)-indentation);indentation*=-1}if(this.grid.options.virtualization===true&&this.grid.options.virtualizationMode==="continuous"){this.grid._setDisplayContainerWidth(this.grid._getDisplayContainerWidth()+indentation);this.grid._setVHeadersWidth(this.grid._getVHeadersWidth()+indentation)}this._isgroup=null}this._tbody=args.tbody;if(!this._isgroup&&this.groupByColumns().length>0){this._groupAreaList()}event.stopPropagation()},_checkGroupExists:function(key){var exists=false,i;for(i=0;i<this.options.groupedColumns.length;i++){if(this.options.groupedColumns[i].key===key){exists=true;break}}return exists},_groupBy:function(event,th){var noCancel,key,layout,cgrid,eArgs,exists=false;layout=th.attr("data-layout");if(layout){cgrid=this.grid.container().find("#"+th.attr("data-grid-id")).data("igGrid");key=cgrid.options.columns[th.data("columnIndex")].key}else{if(th.data("columnIndex")===null||th.data("columnIndex")===undefined){return}key=this.grid.options.columns[th.data("columnIndex")].key;cgrid=this.grid}if(!layout){exists=this._checkGroupExists(key)}if(exists){return}eArgs={owner:this,groupedColumns:this.options.groupedColumns,key:key,layout:layout,grid:cgrid,triggeredBy:"dragAndDrop"};noCancel=this._trigger(this.events.groupedColumnsChanging,event,eArgs);if(noCancel){this.groupByColumn(key,layout);this._trigger(this.events.groupedColumnsChanged,event,eArgs)}},groupByColumns:function(){var gc=[];if(this._hierarchical){gc=this._orderedGroupedCols}else{gc=this.options.groupedColumns}return gc},_ensureLabelsOrder:function(from,to,layout){var i,key=layout?layout.key:null;for(i=0;i<from.length;i++){if((from[i].layout===key||!from[i].layout&&!key)&&!this._exists(to,from[i])){to.push(from[i])}}for(i=0;layout.columnLayouts&&i<layout.columnLayouts.length;i++){this._ensureLabelsOrder(from,to,layout.columnLayouts[i])}},_exists:function(arr,layout){var i;for(i=0;i<arr.length;i++){if((arr[i].layout===layout.layout||!arr[i].layout&&!layout.layout)&&arr[i].key===layout.key){return true}}return false},_findLayout:function(layout,opts,layouts){var i;if(opts.key===layout){layouts.push(opts)}else if(!layout){layouts.push(this.grid.options)}else{for(i=0;opts.columnLayouts&&i<opts.columnLayouts.length;i++){this._findLayout(layout,opts.columnLayouts[i],layouts)}}},_isGroupColumn:function(key,layout,gc){var i,gcLen=gc.length;for(i=0;i<gcLen;i++){if(gc[i].key===key&&gc[i].layout===layout){return true}}return false},_allGroupedCols:function(gc){var i,j,key,layout,isToAdd;for(i=0;i<this.options.groupedColumns.length;i++){key=this.options.groupedColumns[i].key;layout=this.options.groupedColumns[i].layout;isToAdd=true;for(j=0;j<gc.length;j++){if(key===gc[j].key&&layout===gc[j].layout){this.options.groupedColumns[i]=gc[j];isToAdd=false;break}}if(isToAdd){gc.push(this.options.groupedColumns[i])}}this._addGroupsRecursive(gc,this.grid.options.columnLayouts)},_addGroupsRecursive:function(gc,layouts){var i,j,gb,col,k,persist;if(!layouts){return}for(i=0;i<layouts.length;i++){for(j=0;layouts[i].features&&j<layouts[i].features.length;j++){if(layouts[i].features[j].name==="GroupBy"){gb=layouts[i].features[j];break}}if(gb){persist=gb.persist||this.options.persist;for(j=0;gb.columnSettings&&gb.columnSettings.length&&j<gb.columnSettings.length;j++){if(gb.columnSettings[j].isGroupBy){if(persist&&gb.columnSettings[j].columnKey){if(this._isGroupColumn(gb.columnSettings[j].columnKey,layouts[i].key,gc)){continue}}for(k=0;k<layouts[i].columns.length;k++){if(layouts[i].columns[k].key===gb.columnSettings[j].columnKey||gb.columnSettings[j].columnIndex===k){col=layouts[i].columns[k];break}}gc.push({key:gb.columnSettings[j].columnKey||col.key,layout:layouts[i].key,dir:gb.columnSettings[j].dir,col:col})}}}gb=null;this._addGroupsRecursive(gc,layouts[i].columnLayouts)}},_getColumnByLayoutKey:function(key,columns){var c,i;if(this.grid._isMultiColumnGrid){for(i=0;i<columns.length;i++){if(columns[i].key===key){c=columns[i];break}if(columns[i].group!==undefined&&columns[i].group!==null){c=this._getColumnByLayoutKey(key,columns[i].group);if(c!==undefined&&c!==null){break}}}}else{for(i=0;i<columns.length;i++){if(columns[i].key===key){c=columns[i];break}}}return c},groupByColumn:function(key,layout,sortingDirection){var i,expr,gexpr,lobj,c,fcs,setting,layouts,exists=this._checkGroupExists(key),copy,dir="asc";this.grid._onGroupedColumnsChanging(this.options.groupedColumns);if(sortingDirection!==undefined&&sortingDirection!==null){dir=sortingDirection}else if(this.options.defaultSortingDirection!==undefined){dir=this.options.defaultSortingDirection}if(!layout&&exists){return}if(layout){layouts=[];this._findLayout(layout,this.grid.options,layouts);lobj=layouts[0];c=this._getColumnByLayoutKey(key,lobj.columns)}else{lobj=this.grid.options;c=this.grid.columnByKey(key)}if(layout){if(!lobj.features){lobj.features=[];lobj.features.push({name:"GroupBy",columnSettings:[]});fcs=lobj.features[0].columnSettings}else{for(i=0;i<lobj.features.length;i++){if(lobj.features[i].name==="GroupBy"){fcs=lobj.features[i].columnSettings;if(!fcs){lobj.features[i].columnSettings=[];fcs=lobj.features[i].columnSettings}break}}}for(i=0;i<fcs.length;i++){if(fcs[i].columnKey===key){if(fcs[i].isGroupBy){return}setting=fcs[i];break}}if(!setting){fcs.push({columnKey:key,isGroupBy:true,dir:dir})}else{setting.isGroupBy=true}}expr={fieldName:key,dir:dir,layout:layout,isGroupBy:true};gexpr={key:key,dir:dir,layout:layout,col:c};if(!layout){this.options.groupedColumns.push(gexpr)}this._orderedGroupedCols.push(gexpr);copy=this._orderedGroupedCols.slice(0);this._orderedGroupedCols=[];this._ensureLabelsOrder(copy,this._orderedGroupedCols,this.grid.options);
this.grid._trigger("headerExtraCellsModified",null,{owner:this});if(!layout||this.options.type==="remote"&&!this.grid.options.odata){this._addSortingExpression(this.grid.dataSource.settings.sorting.expressions,expr)}if(!layout){this._clearSortingSettings([key]);this._isgroup=true}this._setExprFormatter(this.grid.dataSource.settings.sorting.expressions);this._rebind();this.grid._onGroupedColumnsChanged(this.options.groupedColumns)},_setExprFormatter:function(exprs){this.grid._getSortingExpressionsManager().setFormattersForSortingExprs(exprs,this.grid)},_addSortingExpression:function(se,expr){return this.grid._getSortingExpressionsManager().addSortingExpression(se,expr,this)},ungroupByColumn:function(key,layout){var i,j,self=this,fcs,lobj,layouts=[],exprs=this.grid.dataSource.settings.sorting.expressions,exists=this._checkGroupExists(key),copy;if(!layout&&!exists){return}this.grid._onGroupedColumnsChanging(this.options.groupedColumns);if(!layout){for(i=0;i<this.options.groupedColumns.length;i++){if(this.options.groupedColumns[i].key===key){$.ig.removeFromArray(this.options.groupedColumns,i);break}}}else{this._findLayout(layout,this.grid.options,layouts);lobj=layouts[0];if(lobj){lobj.features=lobj.features||[];for(i=0;i<lobj.features.length;i++){if(lobj.features[i].name==="GroupBy"){fcs=lobj.features[i].columnSettings||[];for(j=0;j<fcs.length;j++){if(fcs[j].columnKey===key){$.ig.removeFromArray(fcs,j);break}}break}}}}for(i=0;i<this._orderedGroupedCols.length;i++){if(this._orderedGroupedCols[i].key===key&&(this._orderedGroupedCols[i].layout&&this._orderedGroupedCols[i].layout===layout||!this._orderedGroupedCols[i].layout&&(layout===""||layout===undefined))){$.ig.removeFromArray(this._orderedGroupedCols,i);break}}for(i=0;i<exprs.length;i++){if(exprs[i].fieldName===key&&(!layout||layout&&layout===exprs[i].layout)){if(exprs[i].isSorting){exprs[i].isGroupBy=undefined}else{$.ig.removeFromArray(exprs,i)}}}copy=this._orderedGroupedCols.slice(0);this._orderedGroupedCols=[];this._ensureLabelsOrder(copy,this._orderedGroupedCols,this.grid.options);this.grid._trigger("headerExtraCellsModified",null,{owner:this});this.grid.element.children("tbody").hide();if(document.documentMode===8){this.grid.element.hide();this.grid.headersTable().hide()}if(!layout&&this.options.groupedColumns.length===0){this.grid.element.find("colgroup").children().first().remove();if(this.grid.options.fixedHeaders){this.grid.headersTable().find("colgroup").children().first().remove()}if(this.grid.options.fixedFooters&&this.grid.options.height!==null){this.grid.footersTable().find("colgroup").children().first().remove()}this.grid.headersTable().find("thead tr").children("[ data-skip ]").first().remove()}if(!layout){this._isgroup=false}this._rebind();if(document.documentMode===8){this.grid.headersTable().show();this.grid.element.show()}if(this.options.groupedColumns.length===0){if(window.mozInnerScreenX!==undefined&&self.grid.options.fixedFooters===true){self.grid.footersTable().hide();setTimeout(function(){self.grid.footersTable().show()},0)}this._setGroupAreaTextContent($(".ui-iggrid-groupbyarea .ui-iggrid-groupbyareatext",this.grid.container()));if(this.grid.options.width!==null&&this.grid.options.width!==undefined){this.grid._updateGridContentWidth()}}this.grid._onGroupedColumnsChanged(this.options.groupedColumns)},_clearSettings:function(layouts){var i,j,cs,k;for(i=0;i<layouts.length;i++){if(layouts[i].features&&layouts[i].features.length){for(j=0;j<layouts[i].features.length;j++){if(layouts[i].features[j].name==="GroupBy"){cs=layouts[i].features[j].columnSettings;if(cs){for(k=0;k<cs.length;k++){cs[k].isGroupBy=false}}}}}if(layouts[i].columnLayouts){this._clearSettings(layouts[i].columnLayouts)}}},expand:function(rowId){this._expandCollapseRow(rowId,true)},collapse:function(rowId){this._expandCollapseRow(rowId,false)},ungroupAll:function(){var indent=0,i,layouts=this.grid.options.columnLayouts,cols=this.groupByColumns(),hasRoot=false;if(cols.length===0){return}this.grid._onGroupedColumnsChanging(this.options.groupedColumns);for(i=1;i<this.options.groupedColumns.length;i++){indent+=parseInt(this.options.indentation,10)}if(parseInt(this.grid.container().width(),10)>0&&!this.grid.options.width){this.grid.container().width(parseInt(this.grid.container().width(),10)-indent)}this.grid.dataSource.settings.sorting.expressions=[];this.options.groupedColumns=[];this._orderedGroupedCols=[];if(!this._hierarchical){cols=[]}else{for(i=0;i<cols.length;i++){if(!cols[i].layout){hasRoot=true;break}}if(hasRoot){cols=[]}}if(layouts){this._clearSettings(layouts)}if(this.options.groupedColumns.length===0&&cols.length===0){this.grid.element.find("colgroup").children().first().remove();if(this.grid.options.fixedHeaders){this.grid.headersTable().find("colgroup").each(function(){$(this).children("[ data-skip ]").first().remove()})}if(this.grid.options.fixedFooters){this.grid.footersTable().find("colgroup").each(function(){$(this).children("[ data-skip ]").first().remove()})}this.grid.headersTable().find("thead tr").each(function(){$(this).children("[ data-skip ]").first().remove()});this.grid.footersTable().find("tfoot tr").each(function(){$(this).children("[ data-skip ]").first().remove()})}this._isgroup=false;this._rebind();if(this.options.groupedColumns.length===0){if(this.grid.options.width!==null&&this.grid.options.width!==undefined){this.grid._updateGridContentWidth()}}this.grid._onGroupedColumnsChanged([])},_regroup:function(){var items=$(".ui-iggrid-groupbyarea",this.grid.container()).find("ul li"),groupby=this,i,copy,gbObj,eArgs,noCancel,sExprs=[],gbExprs=[];this.options.groupedColumns=[];this.grid.dataSource.settings.sorting.expressions=[];copy=this._orderedGroupedCols.slice(0);this._orderedGroupedCols=[];items.each(function(){var direction,k,layout,c,lobj,layouts=[],sExpr;k=$(this).attr("data-key");layout=$(this).attr("data-layout");direction=$(this).find(".ui-iggrid-asc").length>0?"asc":"desc";if(layout){groupby._findLayout(layout,groupby.grid.options,layouts);lobj=layouts[0];for(i=0;lobj&&i<lobj.columns.length;i++){if(lobj.columns[i].key===k){c=lobj.columns[i];break}}}else{c=groupby.grid.columnByKey(k)}gbObj={key:k,dir:direction,col:c,layout:layout};sExpr={fieldName:k,dir:direction,isGroupBy:true};if(layout){sExpr.layout=layout}gbExprs.push(gbObj);sExprs.push(sExpr)});eArgs={owner:this,groupedColumns:gbExprs,triggeredBy:"regroup"};noCancel=this._trigger(this.events.groupedColumnsChanging,null,eArgs);if(noCancel){for(i=0;i<gbExprs.length;i++){groupby._addSortingExpression(groupby.grid.dataSource.settings.sorting.expressions,sExprs[i]);groupby._orderedGroupedCols.push(gbExprs[i]);if(!gbExprs[i].layout){groupby.options.groupedColumns.push(gbExprs[i])}}groupby._setExprFormatter(groupby.grid.dataSource.settings.sorting.expressions);groupby._ensureLabelsOrder(copy,groupby._orderedGroupedCols,groupby.grid.options);this.grid._loadingIndicator.show();this._saveSortingExpressions();this._rebindDataSource();this._trigger(this.events.groupedColumnsChanged,null,eArgs)}},_rebind:function(){this._scrolltop=$(window).scrollTop();this.grid._loadingIndicator.show();this._saveSortingExpressions();this._rebindDataSource();this._groupAreaList()},_rebindDataSource:function(){var ds=this.grid.dataSource,root,gb,cols,layout=this.grid.options.key;if(this.options.groupedColumns&&this.options.groupedColumns.length){ds.settings.groupby.defaultCollapseState=!this.options.initialExpand}if(this.options.type==="remote"){ds.dataBind()}else{if(ds.settings.sorting.expressions.length===0){if(layout){root=this.element.closest(".ui-iggrid-root");if(root&&root.data("igGridGroupBy")){gb=root.data("igGridGroupBy");cols=$.map(gb._orderedGroupedCols||[],function(e){return e.layout===layout});if(cols.length){return}}}ds._resetGroupByCollapseStates();this._saveCollapseStates();this.grid.dataBind()}else{ds.sort(ds.settings.sorting.expressions);this.grid._renderData()}}},_onKeyDownGroup:function(event){var $target;if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){$target=$(event.target);this._toggleGroup(event);event.preventDefault();event.stopPropagation();$target.focus()}},_hidingFinishing:function(){this._colspan=null},_expandCollapseRow:function(rowId,exp,grid,$row){grid=grid||this.grid;var $scrCntnr,scrTop,avgRowHeight;this._scrolltop=$(window).scrollTop();if($row&&$row.length){if(!exp){$row.attr("data-state","collapsed").attr("aria-expanded","false").find(".ui-iggrid-expandbutton").attr("title",this._getLocaleValue("expandTooltip")).removeClass(this.css.groupByExpandCellExpanded).addClass(this.css.groupByExpandCellCollapsed)}else{$row.attr("data-state","expanded").attr("aria-expanded","true").find(".ui-iggrid-expandbutton").attr("title",this._getLocaleValue("collapseTooltip")).removeClass(this.css.groupByExpandCellCollapsed).addClass(this.css.groupByExpandCellExpanded)}}grid.container().find(".ui-iggrid-footer .ui-iggrid-results").data("overrideLabel",0);grid.dataSource.toggleGroupByRecord(rowId,!exp);if(grid.options.virtualization){avgRowHeight=grid._avgRowHeight;grid._avgRowHeight=null;grid._rerenderVirtualRecordsContinuous();grid._updateVirtualScrollContainer();grid._oldScrollTop=grid._scrollContainer().scrollTop();if(avgRowHeight>grid._avgRowHeight){grid._avgRowHeight=avgRowHeight;grid._updateVirtualScrollContainer()}}else{$scrCntnr=grid.scrollContainer();scrTop=$scrCntnr.scrollTop();grid._renderData();$scrCntnr.scrollTop(scrTop)}this.grid._adjustLastColumnWidth(false);this._saveCollapseStates(grid)},_toggleGroup:function(event){var parentrow=$(event.target).closest("tr"),grid,exp=parentrow.attr("data-state")!=="expanded";if(this._hierarchical){grid=parentrow.closest(".ui-iggrid-table").data("igGrid")}else{grid=this.grid}this._focusCellId=parentrow.attr("data-id");this._expandCollapseRow(parentrow.attr("data-id"),exp,grid,parentrow);event.stopPropagation()},_groupAreaList:function(){var area=$(".ui-iggrid-groupbyarea",this.grid.container()),layout,allgrouped=[],dropFunc,mousedownFunc,list=area.find("ul"),i,groupby=this,css,key,item,itemEdge,helperFunc,overFunc,outFunc,text;allgrouped=this.groupByColumns();if(list.length>0){list.empty()}else{list=$("<ul></ul>").appendTo(area).addClass("ui-iggrid-grouparealist")}helperFunc=function(event){var li=null;if($(event.target).is("li")){li=$(event.target)}else{li=$(event.target).closest("li")}li=li.clone();li.find(".ui-iggrid-groupbylabelrightedgeend").remove();li.find(".ui-iggrid-groupbylabelrightedge").remove();li.find(".ui-iggrid-groupbyremovebutton").remove();li.attr("data-dragging",true);return li};overFunc=function(event,ui){var $li;if(!ui.draggable.hasClass("ui-iggrid-groupedcolumnlabel")){return false}if(ui.draggable.attr("data-key")===$(this).attr("data-key")){return false}if(groupby._thOver){$li=ui.draggable.closest("ul").find("li[ data-key="+groupby._thOver+" ]");if($li.length>0&&$li.hasClass("ui-iggrid-groupbydroppableedge")){$li.removeClass("ui-iggrid-groupbydroppableedge")}}groupby._thOver=$(event.target).attr("data-key");$(event.target).addClass("ui-iggrid-groupbydroppableedge")};outFunc=function(event,ui){if(!ui.draggable.hasClass("ui-iggrid-groupedcolumnlabel")){return false}if(ui.draggable.attr("data-key")===$(this).attr("data-key")){return false}$(event.target).removeClass("ui-iggrid-groupbydroppableedge")};dropFunc=function(event,ui){var parent,$dragged,$target;$(this).removeClass("ui-iggrid-groupbydroppableedge");if(!ui.draggable.hasClass("ui-iggrid-groupedcolumnlabel")){return}if(ui.draggable.attr("data-key")!==$(this).attr("data-key")){parent=$(this).closest("ul");$target=$(this);$dragged=ui.draggable;if($dragged.index()>$target.index()){$dragged.insertBefore($target)}else{$dragged.insertAfter($target)}parent.find("li[ data-dragging=true ]").remove();parent.find("li").removeClass("ui-iggrid-groupbydroppableedge");groupby._regroup();groupby._groupAreaList();event.preventDefault();event.stopPropagation();return false}return};mousedownFunc=function(event){event.preventDefault();event.stopPropagation();return false};for(i=0;i<allgrouped.length;i++){key=allgrouped[i].key;layout=allgrouped[i].layout;text=allgrouped[i].col.headerText;if(allgrouped[i].dir==="asc"){css="ui-iggrid-asc ui-icon ui-icon-arrowthick-1-n"}else{css="ui-iggrid-desc ui-icon ui-icon-arrowthick-1-s"}item=$("<li></li>").appendTo(list).addClass(this.css.groupedColumnLabel).css("float","left").attr("data-key",key).attr("data-layout",layout||"").bind({mouseup:$.proxy(this._changeSortState,this)}).draggable({containment:"body",appendTo:"parent",distance:5,revert:"invalid",helper:helperFunc}).droppable({accept:"li",tolerance:"touch",over:overFunc,out:outFunc,drop:dropFunc});if(this.options.groupByLabelWidth!==null){item.width(this.options.groupByLabelWidth)}itemEdge=$("<span></span>").appendTo(item).css({"float":"right"}).addClass(this.css.groupedColumnLabel).addClass(this.css.groupedColumnLabelRightEdgeEnd);itemEdge.attr("data-marker","edge");item.prev().find("span[ data-marker ]").removeClass(this.css.groupedColumnLabelRightEdgeEnd).addClass(this.css.groupedColumnLabelRightEdge);if(layout){$("<span>"+text+"</span>").appendTo(item).addClass(this.css.groupedColumnLabelText);$("<span>"+layout+"</span>").prependTo(item).addClass(this.css.groupedColumnLayoutLabel)}else{$("<span>"+text+"</span>").appendTo(item)}$("<span></span>").appendTo(item).addClass(css);if(!$.ig.util.isTouch){$("<span></span>").appendTo(item).addClass("ui-iggrid-groupbyremovebutton").attr("data-localeid","removeButtonTooltip").attr("data-localeattr","title").attr("title",groupby._getLocaleValue("removeButtonTooltip")).bind({mouseup:$.proxy(groupby._removeButtonClick,groupby),mousedown:mousedownFunc})}if($.ig.util.isIE7&&item.width()>300){item.width(260)}else{item.width(Math.ceil(item.width())+22)}}list.children().bind({mouseover:$.proxy(this._showRemoveButton,this),mouseout:$.proxy(this._hideRemoveButton,this)})},_changeSortState:function(event){var li=$(event.target).closest("li"),key=li.attr("data-key"),i,layout=li.attr("data-layout"),layouts,eArgs,j,gc=this._orderedGroupedCols,s=this.grid.dataSource.settings.sorting.expressions,settings,lobj,noCancel;for(i=0;i<gc.length;i++){if(gc[i].key===key&&(layout&&layout===gc[i].layout||!layout)){if(gc[i].dir==="asc"){gc[i].dir="desc"}else{gc[i].dir="asc"}for(j=0;j<s.length;j++){if(s[j].fieldName===key&&(layout&&layout===s[j].layout||!layout)){s[j].dir=gc[i].dir;break}}eArgs={owner:this,groupedColumns:gc,key:gc[i].key,triggeredBy:"sortStateChanged"};noCancel=this._trigger(this.events.groupedColumnsChanging,event,eArgs);if(noCancel){this._rebind();this._trigger(this.events.groupedColumnsChanged,event,eArgs)}break}}if(layout){layouts=[];this._findLayout(layout,this.grid.options,layouts);lobj=layouts[0];for(i=0;lobj.features&&i<lobj.features.length;i++){if(lobj.features[i].name==="GroupBy"){settings=lobj.features[i].columnSettings;for(j=0;j<settings.length;j++){if(settings[j].columnKey===key){settings[j].dir=settings[j].dir==="asc"?"desc":"asc";break}}break}}}},_showRemoveButton:function(event){var button=$(event.target).closest("li").find(".ui-iggrid-groupbyremovebutton"),key=$(event.target).closest("li").attr("data-key"),layout=$(event.target).closest("li").attr("data-layout");if(!key){return}button.attr("data-key",key).attr("data-layout",layout).addClass("ui-icon ui-icon-circle-close")},_hideRemoveButton:function(event){var button=$(event.target).closest("li").find(".ui-iggrid-groupbyremovebutton");button.removeClass("ui-icon ui-icon-circle-close");$(event.target).closest("li").removeClass("ui-state-hover")},_removeButtonClick:function(event){var key=$(event.target).attr("data-key"),noCancel,layout,eArgs;if(this._isDragging){return}eArgs={owner:this,groupedColumns:this.options.groupedColumns,key:key,triggeredBy:"removeButton"};noCancel=this._trigger(this.events.groupedColumnsChanging,event,eArgs);if(noCancel){layout=$(event.target).attr("data-layout");this.ungroupByColumn(key,layout);this._trigger(this.events.groupedColumnsChanged,event,eArgs)}event.preventDefault();event.stopPropagation();return false},destroy:function(){var modalDialog=this._getModalDialog();this.grid.container().find(".ui-iggrid-groupbyarea").remove();this._removeInitCallbacks();if(this.grid._initialized&&!this.grid._destroyed){this.ungroupAll()}this._detachEvents(true);modalDialog[this.options.dialogWidget]("getCaptionButtonContainer");modalDialog.remove();this._removeOverridenFunctions();this._superApply(arguments);return this},_detachEvents:function(isDestroyDraggable){var ths=this.grid.headersTable().find("th"),i;if(isDestroyDraggable===true){for(i=0;i<ths.length;++i){if($(ths[i]).data().draggable){$(ths[i]).draggable("destroy")}}}ths.unbind("mouseover",this._headerMouseOverHandler).unbind("mouseout",this._headerMouseOutHandler);$(document).undelegate("#"+this.grid.id()+"_container td[ gbexpandcell=1 ]","mouseup",this._toggleGroupHandler);$(document).undelegate("#"+this.grid.id()+"_container td[ gbexpandcell=1 ]","keydown",this._onKeyDownGroupHandler);this.grid.element.unbind("iggridheaderrenderedinternal",this._headerRenderedHandler);this.grid.element.unbind("iggriddataempty",this._dataRenderingHandler);this.grid.element.unbind("iggrid_rowsrendering",this._rowsRenderingHandler);this.grid.element.unbind("iggridrowsrendered",this._rowsRenderedHandler);this.grid.element.unbind("iggridheadercellrendered",this._headerCellRenderedHandler);this.grid.element.unbind("iggridheadercelldragcancel",this._headerDragCancelHandler);this.grid.element.unbind("iggriduidirty",this._uiDirtyHandler);this.grid.element.unbind("iggriddatabound",this._dataBoundHandler);if(this._columnsCollectionModifiedHandler){this.grid.element.unbind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler)}if(isDestroyDraggable===true){delete this._dataRenderingHandler;delete this._rowsRenderingHandler;delete this._rowsRenderedHandler;delete this._headerCellRenderedHandler;delete this._headerDragCancelHandler;delete this._uiDirtyHandler;delete this._columnsCollectionModifiedHandler}},_initDefaultSettings:function(){var settings=[],key,cs=this.options.columnSettings,i,j,allowGroupBy,isToCheckUnboundColumns=this.grid._hasUnboundColumns===true&&this.options.type==="remote";this._orderedColumnSettings=[];if(this.grid.options.columns&&this.grid.options.columns.length>0){for(i=0;i<this.grid.options.columns.length;i++){allowGroupBy=true;if(isToCheckUnboundColumns&&this.grid.getUnboundColumnByKey(this.grid.options.columns[i].key)!==null){allowGroupBy=false}settings[i]={columnIndex:i,columnKey:this.grid.options.columns[i].key,allowGrouping:allowGroupBy,summaries:[],groupSummaries:null,isGroupBy:false}}}if(settings.length===0&&this.grid.options.autoGenerateColumns&&cs.length>0){for(i=0;i<cs.length;i++){if(!cs[i].columnKey){continue}if(!cs[i].dir){cs[i].dir=this.options.defaultSortingDirection||"asc"}this._orderedColumnSettings.push(cs[i])}}else{for(i=0;i<cs.length;i++){for(j=0;j<settings.length;j++){if(settings[j].columnKey===cs[i].columnKey||settings[j].columnIndex===cs[i].columnIndex){break}}if(j===settings.length){continue}for(key in cs[i]){if(cs[i].hasOwnProperty(key)&&key!=="columnKey"&&key!=="columnIndex"){settings[j][key]=cs[i][key]}}if(settings[j].dir===undefined&&this.options.defaultSortingDirection){settings[j].dir=this.options.defaultSortingDirection}this._orderedColumnSettings.push(settings[j])}}this.options.columnSettings=settings},_renderExtraFooterCells:function(row,colgroup,prepend){if(this.options.groupedColumns.length>0){if(prepend===true){$("<td></td>").addClass(this.css.footerExtraCell).prependTo(row).attr("data-skip",true)}else{$("<td></td>").addClass(this.css.footerExtraCell).appendTo(row).attr("data-skip",true)}}},_renderExtraHeaderCells:function(row,colgroup,prepend){if(this.options.groupedColumns.length>0){if(prepend===true){$("<td></td>").prependTo(row).addClass(this.css.headerExtraCell).attr("data-skip",true);if(colgroup){$("<col />").prependTo(colgroup).attr("data-skip",true).css("width",this.options.indentation)}}else{$("<td></td>").appendTo(row).addClass(this.css.headerExtraCell).attr("data-skip",true);if(colgroup){$("<col />").appendTo(colgroup).attr("data-skip",true).css("width",this.options.indentation)}}}},_addOrUpdateDataSkipCol:function(width){var $colgroup,attrs,$col,$htbl=this.grid.headersTable(),$ftbl=this.grid.footersTable();$colgroup=this.grid.element.children("colgroup");$col=$colgroup.children("[data-groupby-col]");if(!$col.length){attrs={"data-skip":"true","data-groupby-col":"true"};$("<col />").prependTo($colgroup).attr(attrs).width(width);if($htbl.attr("id")!==this.grid.element.attr("id")){$("<col />").prependTo($htbl.children("colgroup")).attr(attrs).width(width)}if($ftbl.attr("id")!==this.grid.element.attr("id")){$("<col />").prependTo($ftbl.children("colgroup")).attr(attrs).width(width)}}else{$col.width(width);$htbl.find(">colgroup>col[data-groupby-col]").width(width);$ftbl.find(">colgroup>col[data-groupby-col]").width(width)}},_columnsCollectionModified:function(event,args){if(args.owner.id()!==this.grid.id()){return}args.tbody=this.grid.element.children("tbody");if(this.options.groupedColumns.length>0){this._addOrUpdateDataSkipCol(this._indent);if(this.grid.options.width===null){this.grid._setContainerWidth(this.grid.container())}else{this.grid._updateGridContentWidth()}}this._dataEmpty(event,args)},_onUIDirty:function(){if(this.options.persist){return}this.ungroupAll()},_saveSortingExpressions:function(){if(this.options.persist){this.grid._savePersistenceData(this.grid.dataSource.settings.sorting.expressions,"sorting");this._groupedColumns=this._orderedGroupedCols;this._optionsGC=this.options.groupedColumns}this.grid._fireInternalEvent("_sortedColumnsChanging",this.grid.dataSource.settings.sorting.expressions)},_saveCollapseStates:function(grid){grid=grid||this.grid;grid._savePersistenceData(grid.dataSource._gbCollapsed,"gbCollapsed",grid.element[0].id)},_getSortingExpressions:function(){return this.grid._getPersistenceData("sorting")},_restoreGroupBy:function(){var se=this._getSortingExpressions(),col,layouts,lobj,i,key,nse=[];this.grid.dataSource._gbCollapsed=this.grid._getPersistenceData("gbCollapsed",this.grid.element[0].id);if(this._groupedColumns){this._orderedGroupedCols=this._groupedColumns}if(this._optionsGC){this.grid.dataSource.settings.sorting.expressions=se;this.grid.dataSource.settings.sorting.defaultFields=se;this.options.groupedColumns=this._optionsGC;if(this.grid._hasUnboundColumns&&this.options.type==="local"){nse=[];for(i=0;i<se.length;i++){if(se[i].layout){layouts=[];this._findLayout(se[i].layout,this.grid.options,layouts);lobj=layouts[0];col=this._getColumnByLayoutKey(se[i].fieldName,lobj.columns)}else{col=this.grid.columnByKey(se[i].fieldName)}if(col&&!col.unbound){nse.push(se[i])}}se=nse;this.grid.dataSource.settings.sorting.expressions=se;this.grid.dataSource.settings.sorting.defaultFields=se;for(i=0;i<this._optionsGC.length;i++){key=this._optionsGC[i].key;if(this._optionsGC[i].layout){layouts=[];this._findLayout(this._optionsGC[i].layout,this.grid.options,layouts);lobj=layouts[0];col=this._getColumnByLayoutKey(key,lobj.columns)}else{col=this.grid.columnByKey(key)}if(col&&col.unbound){this.ungroupByColumn(key,this._optionsGC[i].layout)}}}}if(se){this.grid.dataSource.settings.sorting.expressions=se;this.grid.dataSource.settings.sorting.defaultFields=se}},_onDataBound:function(){if(this.options.groupedColumns.length>0&&this.grid._isDataBoundCalled){this.grid._trigger("headerExtraCellsModified",null,{owner:this})}},_filterExpressionsByLayout:function(exprs,layout){exprs=exprs||[];layout=!layout||layout===""?null:layout;var i,len=exprs.length,res=[];for(i=0;i<len;i++){exprs[i].layout=exprs[i].layout===""?null:exprs[i].layout;if(exprs[i].layout===layout||!layout&&!exprs[i].layout){res.push(exprs[i])}}return res},_determineColspan:function(){if(this.grid._isMultiColumnGrid){this._colspan=this.grid.container().find("#"+this.grid.id()+" colgroup:first>col:not([ data-hiding ])").length-1}else{if(this.grid.options.showHeader){this._colspan=this.grid.headersTable().find("thead > tr:first").children("th:not(.ui-iggrid-expandheadercellgb)").length}else{this._colspan=this.grid.container().find("#"+this.grid.id()+" colgroup:first>col").length-1}}},_removeOverridenFunctions:function(){if(this._getDataViewHandler){this.grid._getDataView=this._getDataViewHandler}if(this._renderRecordsForVirtRowCountHandler){this.grid._renderRecordsForVirtRowCount=this._renderRecordsForVirtRowCountHandler}if(this._renderNewRowHandler){this.grid.renderNewRow=this._renderNewRowHandler}},_overrideFunctions:function(){if(!this._getDataViewHandler){this._getDataViewHandler=$.proxy(this.grid._getDataView,this.grid);this.grid._getDataView=$.proxy(this._getDataView,this)}if(!this._renderRecordsForVirtRowCountHandler){this._renderRecordsForVirtRowCountHandler=$.proxy(this.grid._renderRecordsForVirtRowCount,this.grid);this.grid._renderRecordsForVirtRowCount=$.proxy(this._renderRecordsForVirtRowCount,this)}if(!this._renderNewRowHandler){this._renderNewRowHandler=$.proxy(this.grid.renderNewRow,this.grid);this.grid.renderNewRow=$.proxy(this._renderNewRow,this)}},_renderRecordsForVirtRowCount:function(ds,rowNumber,rrFunc){var data=ds.slice(0,rowNumber),html;if(this.options.groupedColumns.length>0){if(this._colspan===undefined||this._colspan===null){this._determineColspan()}html=this._generateGroupByRowsMarkup(data,0,data.length-1)}else{html=this._renderRecordsForVirtRowCountHandler.call(this,ds,rowNumber,rrFunc)}return html},_getDataView:function(){if(this.options.groupedColumns.length>0){return this.grid.dataSource.groupByDataView()}return this._getDataViewHandler()},_removeInitCallbacks:function(){var i;for(i=0;this.grid._headerInitCallbacks&&i<this.grid._headerInitCallbacks.length;i++){if(this.grid._headerInitCallbacks[i].type==="GroupBy"){$.ig.removeFromArray(this.grid._headerInitCallbacks,i);break}}for(i=0;this.grid._footerInitCallbacks&&i<this.grid._footerInitCallbacks.length;i++){if(this.grid._footerInitCallbacks[i].type==="GroupBy"){$.ig.removeFromArray(this.grid._footerInitCallbacks,i);break}}},_addInitCallbacks:function(){this._removeInitCallbacks();this.grid._headerInitCallbacks.push({type:"GroupBy",func:$.proxy(this._renderExtraHeaderCells,this)});this.grid._footerInitCallbacks.push({type:"GroupBy",func:$.proxy(this._renderExtraFooterCells,this)})},_getDefaultSummaries:function(colType,defaultSummaries){var i,summaryFunctions=[];for(i=0;i<defaultSummaries.length;i++){if(defaultSummaries[i].active&&(defaultSummaries[i].dataType==="any"||defaultSummaries[i].dataType.indexOf(colType)!==-1)){summaryFunctions.push({summaryFunction:defaultSummaries[i].summaryFunction,label:defaultSummaries[i].label,summaryTemplate:"{label}{value}",applyFormat:defaultSummaries[i].applyFormat})}}return summaryFunctions},_getApplicableSummaries:function(colType,summaries,defaultSummaries){var i,defaultSummary,defaultSummarySetting,customSummarySetting,getDefaultSummaryByName,summaryFunctions=[];getDefaultSummaryByName=function(name){return defaultSummaries.filter(function(target){return target.name.toLowerCase()===name.toLowerCase()})};for(i=0;i<summaries.length;i++){if(typeof summaries[i].summaryFunction==="function"){customSummarySetting={summaryFunction:summaries[i].summaryFunction,label:"Custom = ",summaryTemplate:"{label}{value}",applyFormat:false};summaryFunctions.push($.extend(customSummarySetting,summaries[i]))}else if(typeof summaries[i].summaryFunction==="string"){defaultSummary=getDefaultSummaryByName(summaries[i].summaryFunction);if(!defaultSummary.length){customSummarySetting={label:"Custom = ",summaryTemplate:"{label}{value}",applyFormat:false};customSummarySetting=$.extend(customSummarySetting,summaries[i]);customSummarySetting.summaryFunction=window[summaries[i].summaryFunction];summaryFunctions.push(customSummarySetting)}else if(defaultSummary[0].dataType==="any"||defaultSummary[0].dataType.indexOf(colType)!==-1){defaultSummarySetting={label:defaultSummary[0].label,summaryTemplate:"{label}{value}",applyFormat:defaultSummary[0].applyFormat};defaultSummarySetting=$.extend(defaultSummarySetting,summaries[i]);defaultSummarySetting.summaryFunction=defaultSummary[0].summaryFunction;summaryFunctions.push(defaultSummarySetting)}}}return summaryFunctions},_generateSummariesSettings:function(){var i,columnDefault,columnSetting,summaries,resSummariesSettings,getColSettingsByKey,bEmptySummaries=true,cols=this.grid.options.columns,colSettings=this.options.columnSettings?this.options.columnSettings:[],defaultSummaries=$.ig.util.defaultSummaryMethods;defaultSummaries.sort(function(a,b){return a.order-b.order});resSummariesSettings={};for(i=0;i<cols.length;i++){columnDefault={groupSummaries:[]};if(this.options.groupSummaries===true){bEmptySummaries=false;summaries=this._getDefaultSummaries(cols[i].dataType,defaultSummaries);columnDefault.groupSummaries=summaries}else if($.isArray(this.options.groupSummaries)&&this.options.groupSummaries.length>0){bEmptySummaries=false;summaries=this._getApplicableSummaries(cols[i].dataType,this.options.groupSummaries,defaultSummaries);columnDefault.groupSummaries.push.apply(columnDefault.groupSummaries,summaries)}resSummariesSettings[cols[i].key]=columnDefault}getColSettingsByKey=function(colKey){return colSettings.filter(function(target){return target.columnKey===colKey})};for(i=0;i<cols.length;i++){columnSetting=getColSettingsByKey(cols[i].key);if(!columnSetting.length){continue}columnSetting=columnSetting[0];if(columnSetting.groupSummaries===true){bEmptySummaries=false;summaries=this._getDefaultSummaries(cols[i].dataType,defaultSummaries);resSummariesSettings[cols[i].key].groupSummaries=summaries}else if(columnSetting.groupSummaries===false){resSummariesSettings[cols[i].key].groupSummaries=[]}else if($.isArray(columnSetting.groupSummaries)&&columnSetting.groupSummaries.length>0){bEmptySummaries=false;summaries=this._getApplicableSummaries(cols[i].dataType,columnSetting.groupSummaries,defaultSummaries);resSummariesSettings[cols[i].key].groupSummaries=summaries}else if($.isArray(columnSetting.groupSummaries)){resSummariesSettings[cols[i].key].groupSummaries=[]}}for(i=0;i<this.options.columnSettings.length;i++){this.options.columnSettings[i].groupSummaries=resSummariesSettings[this.options.columnSettings[i].columnKey].groupSummaries}return bEmptySummaries},_initGroupSummaries:function(){var i,j,noSummaries,columnRes,colSettings,summariesRes=[],ds=this.grid.dataSource;noSummaries=this._generateSummariesSettings();if(noSummaries){return}colSettings=this.options.columnSettings;for(i=0;i<colSettings.length;i++){columnRes={field:colSettings[i].columnKey,summaryFunctions:[]};if(colSettings[i].groupSummaries&&colSettings[i].groupSummaries.length>0){for(j=0;j<colSettings[i].groupSummaries.length;j++){if(typeof colSettings[i].groupSummaries[j].summaryFunction==="string"){columnRes.summaryFunctions.push(colSettings[i].groupSummaries[j].summaryFunction)}else{columnRes.summaryFunctions.push(colSettings[i].groupSummaries[j].summaryFunction)}}}summariesRes.push(columnRes)}ds.settings.groupby.summaries=summariesRes;ds.settings.groupby.summariesPosition=this.options.groupSummariesPosition;if(this.grid.options.autoGenerateColumns){ds._generateGroupByData(ds._filter?ds._filteredData:ds._data,ds.settings.sorting.expressions)}},_injectGrid:function(gridInstance){var i,gc,gcsort,s,root=null,orderedGrouped=null,layoutGrouped=null;this.grid=gridInstance;this._checkGridNotSupportedFeatures();if(this.options.type===null){this.options.type=this.grid._inferOpType()}root=this.element.closest(".ui-iggrid-root");if(this.options.persist&&this.options.type==="remote"&&root.data("igGrid")){this.options.persist=false}if(root.is("div")){root=root.find("#"+root.attr("id")+"_table")}root=root.data("igGridGroupBy");if(root){orderedGrouped=root._orderedGroupedCols;if(orderedGrouped&&orderedGrouped.length>0&&this.grid.options.key){layoutGrouped=[];for(i=0;i<orderedGrouped.length;i++){
if(this.grid.options.key===orderedGrouped[i].layout){layoutGrouped.push(orderedGrouped[i])}}}}for(i=0;i<this.grid.options.features.length;i++){if(this.grid.options.features[i].name==="ColumnMoving"){this._movingEnabled=true;break}}this._dataBoundHandler=$.proxy(this._onDataBound,this);this._headerRenderedHandler=$.proxy(this._headerRendered,this);this._dataRenderingHandler=$.proxy(this._dataEmpty,this);this._toggleGroupHandler=$.proxy(this._toggleGroup,this);this._onKeyDownGroupHandler=$.proxy(this._onKeyDownGroup,this);this._rowsRenderingHandler=$.proxy(this._renderRecords,this);this._rowsRenderedHandler=$.proxy(this._recordsRendered,this);this._headerCellRenderedHandler=$.proxy(this._headerCellRendered,this);this._headerDragCancelHandler=$.proxy(this._headerCellDragCancel,this);this._detachEvents();this.grid.element.bind("iggridheaderrenderedinternal",this._headerRenderedHandler);this.grid.element.bind("iggriddataempty",this._dataRenderingHandler);this.grid.element.bind("iggrid_rowsrendering",this._rowsRenderingHandler);this.grid.element.bind("iggridrowsrendered",this._rowsRenderedHandler);this.grid.element.bind("iggridheadercellrendered",this._headerCellRenderedHandler);this.grid.element.bind("iggriddatabound",this._dataBoundHandler);this.grid.element.bind("iggridheadercelldragcancel",this._headerDragCancelHandler);this._headerMouseOverHandler=function(event){$(event.currentTarget).addClass("ui-state-hover")};this._headerMouseOutHandler=function(event){$(event.currentTarget).removeClass("ui-state-hover")};this._overrideFunctions();this.grid.dataSource.settings.sorting.sortUrlKey=this.options.groupByUrlKey;this.grid.dataSource.settings.sorting.sortUrlAscValueKey=this.options.groupByUrlKeyAscValue;this.grid.dataSource.settings.sorting.sortUrlDescValueKey=this.options.groupByUrlKeyDescValue;this.grid.dataSource.settings.sorting.enabled=true;this.grid.dataSource.settings.sorting.type=this.options.type||"remote";this.grid.dataSource.settings.encodeExtraParams=$.proxy(this._encodeSummaryParams,this);this.grid.dataSource.settings.groupby.defaultCollapseState=!this.options.initialExpand;this.grid.dataSource.settings.groupby.pagingMode=this.options.pagingMode;if(!this.grid._initialized){this._addInitCallbacks();this._initDefaultSettings();this.options.groupedColumns=[];if(!this.grid.options.key&&(layoutGrouped===null||layoutGrouped.length===0)){for(i=0;i<this._orderedColumnSettings.length;i++){if(this._orderedColumnSettings[i].isGroupBy){s=this._orderedColumnSettings[i];gc={key:s.columnKey,dir:s.dir||"asc",col:this.grid.columnByKey(s.columnKey)};this.options.groupedColumns.push(gc);gcsort={fieldName:s.columnKey,dir:s.dir||"asc",layout:this.grid.options.key||null,isGroupBy:true};if(this.options.type==="local"){this._addSortingExpression(this.grid.dataSource.settings.sorting.defaultFields,gcsort)}this._addSortingExpression(this.grid.dataSource.settings.sorting.expressions,gcsort)}}}else{for(i=0;layoutGrouped!==null&&i<layoutGrouped.length;i++){this.options.groupedColumns.push(layoutGrouped[i]);gcsort={fieldName:layoutGrouped[i].key,dir:layoutGrouped[i].dir||"asc",layout:this.grid.options.key||null,isGroupBy:true};if(this.options.type==="local"){this._addSortingExpression(this.grid.dataSource.settings.sorting.defaultFields,gcsort)}this._addSortingExpression(this.grid.dataSource.settings.sorting.expressions,gcsort)}}this._saveSortingExpressions()}this._initGroupSummaries();if(this.options.expansionIndicatorVisibility&&(this.grid.element.closest(".ui-iggrid-root").length===0||this.grid.element.hasClass("ui-iggrid-root")||this.grid._isWrapped)){$(document).delegate("#"+this.grid.id()+"_container td[ gbexpandcell=1 ]","mouseup",this._toggleGroupHandler);$(document).delegate("#"+this.grid.id()+"_container td[ gbexpandcell=1 ]","keydown",this._onKeyDownGroupHandler)}this._columnsCollectionModifiedHandler=$.proxy(this._columnsCollectionModified,this);this.grid.element.bind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler);this._uiDirtyHandler=$.proxy(this._onUIDirty,this);this.grid.element.bind("iggriduidirty",this._uiDirtyHandler);if(this.grid.element.igGridFeatureChooser!==undefined){this.grid.element.igGridFeatureChooser()}this._hierarchical=this.grid._isHierarchicalGrid;if(this.options.persist){this._restoreGroupBy()}this._indent=this.options.indentation;this._allGroupedCols(this._orderedGroupedCols)},_colgroupsRerendered:function(){if(this.options.groupedColumns.length>0){this._addOrUpdateDataSkipCol(this._indent)}},_checkGridNotSupportedFeatures:function(){var gridOptions=this.grid.options;if((gridOptions.virtualization===true||gridOptions.rowVirtualization===true||gridOptions.columnVirtualization===true)&&gridOptions.virtualizationMode==="fixed"){throw new Error(this._getLocaleValue("fixedVirualizationNotSupported"))}}});$.extend($.ui.igGridGroupBy,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI Grid Column Hiding 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 *	infragistics.ui.grid.shared.js
 *	infragistics.ui.grid.featurechooser.js
 */
(function($){$.widget("ui.igGridHiding",$.ui.igWidget,{options:{columnSettings:[{columnKey:null,columnIndex:null,allowHiding:true,hidden:false}],hiddenColumnIndicatorHeaderWidth:7,columnChooserContainment:"owner",columnChooserWidth:350,columnChooserHeight:"",dropDownAnimationDuration:500,columnChooserCaptionText:undefined,columnChooserDisplayText:undefined,hiddenColumnIndicatorTooltipText:undefined,columnHideText:undefined,columnChooserShowText:undefined,columnChooserHideText:undefined,columnChooserResetButtonLabel:undefined,columnChooserButtonApplyText:undefined,columnChooserButtonCancelText:undefined,locale:{columnChooserDisplayText:undefined,hiddenColumnIndicatorTooltipText:undefined,columnHideText:undefined,columnChooserCaptionLabel:undefined,columnChooserCloseButtonTooltip:undefined,hideColumnIconTooltip:undefined,columnChooserShowText:undefined,columnChooserHideText:undefined,columnChooserResetButtonLabel:undefined,columnChooserButtonApplyText:undefined,columnChooserButtonCancelText:undefined},columnChooserHideOnClick:false,columnChooserAnimationDuration:200,dialogWidget:"igGridModalDialog",inherit:false},css:{columnChooser:"ui-dialog ui-draggable ui-resizable ui-iggrid-dialog ui-widget ui-widget-content ui-corner-all",columnChooserHeaderCaption:"ui-dialog-titlebar ui-iggrid-columnchooser-caption ui-widget-header ui-corner-top ui-helper-reset ui-helper-clearfix",columnChooserHeaderCaptionTitle:"ui-dialog-title ui-iggrid-columnchooser-caption-title",columnChooserContent:"ui-dialog-content ui-iggrid-columnchooser-content",hidingHeaderIndicator:"ui-iggrid-hiding-indicator",columnChooserHandleBar:"ui-iggrid-columnchooser-handlebar",hiddenColumnIndicator:"ui-iggrid-hiding-hiddencolumnindicator",hiddenColumnIndicatorSelected:"ui-iggrid-hiding-indicator-selected",hiddenColumnIndicatorMouseOver:"ui-iggrid-hiding-indicator-mouseover",hiddenColumnsDropDown:"ui-iggrid-hiding-dropdown-dialog ui-widget ui-widget-content ui-corner-all",hiddenColumnsDropDownList:"ui-iggrid-hiding-dropdown-list ui-menu",hiddenColumnsDropDownItem:"ui-iggrid-hiding-dropdown-ddlistitemicons ui-state-default",hiddenColumnsDropDownItemHover:"ui-iggrid-hiding-dropdown-listitem-hover ui-state-active ui-state-hover",hiddenColumnsDropDownItemText:"ui-iggrid-hiding-dropdown-ddlistitemtext",columnChooserListItems:"ui-iggrid-columnchooser-listitems",columnChooserItem:"ui-iggrid-columnchooser-item ui-widget-content",columnChooserItemHidden:"ui-iggrid-columnchooser-itemhidden",columnChooserHideButton:"ui-iggrid-columnchooser-hidebutton",columnChooserItemText:"ui-iggrid-dialog-text",featureChooserHidingIcon:"ui-icon ui-iggrid-icon-hide",featureChooserModalDialogIcon:"ui-icon ui-iggrid-icon-column-chooser"},events:{columnHiding:"columnHiding",columnHidingRefused:"columnHidingRefused",columnShowingRefused:"columnShowingRefused",multiColumnHiding:"multiColumnHiding",columnHidden:"columnHidden",columnShowing:"columnShowing",columnShown:"columnShown",columnChooserOpening:"columnChooserOpening",columnChooserOpened:"columnChooserOpened",columnChooserMoving:"columnChooserMoving",columnChooserClosing:"columnChooserClosing",columnChooserClosed:"columnChooserClosed",columnChooserContentsRendering:"columnChooserContentsRendering",columnChooserContentsRendered:"columnChooserContentsRendered",columnChooserButtonApplyClick:"columnChooserButtonApplyClick",columnChooserButtonResetClick:"columnChooserButtonResetClick"},renderInFeatureChooser:true,_headerHashDataKey:"igGrid-hiding-hash",_createWidget:function(){this.options.columnSettings=[];$.Widget.prototype._createWidget.apply(this,arguments)},_getModalDialog:function(){return this.grid._rootContainer().find("#"+this.grid.id()+"_hiding_modalDialog")},_changeLocaleForHidingDialog:function(){var $dialog=this._getModalDialog(),$buttonReset;if($dialog.length){$dialog[this.options.dialogWidget]("option",{locale:{modalDialogCaptionText:this._getLocaleValue("columnChooserCaptionLabel"),buttonApplyText:this._getLocaleValue("columnChooserButtonApplyText"),buttonCancelText:this._getLocaleValue("columnChooserButtonCancelText")}});$.ui.igWidget.prototype.changeLocale.call(this,$dialog);$buttonReset=$("#"+this.grid.id()+"_hiding_modalDialog_reset_button");$buttonReset.igButton("option","labelText",this._getLocaleValue("columnChooserResetButtonLabel"))}},_changeLocaleForFeatureChooser:function(){var fc=this.grid.element.data("igGridFeatureChooser");if(fc&&this.renderInFeatureChooser){fc._removeFeature("Hiding");fc._removeFeature("ColumnChooser");this._initFeatureChooser()}},changeLocale:function(){var btnLabel=this._getLocaleValue("columnChooserDisplayText"),$container=this.grid.container(),self=this;this._changeLocaleForHidingDialog();this._changeLocaleForFeatureChooser();$container.find("[data-hiddencolumn-indicator-container],"+"[data-hiddencolumn-indicator],"+"[data-hiding-indicator]").each(function(){self._changeLocaleForElement($(this))});btnLabel=this._getLocaleValue("columnChooserDisplayText");$container.children("div[data-hiding-inddropdown='"+this.grid.id()+"']").find("[data-button-show-column-chooser]").each(function(){$(this).igButton("option","labelText",btnLabel)})},_registerWidget:$.noop,_unregisterWidget:$.noop,_setOption:function(key){switch(key){case"language":case"locale":case"regional":this._superApply(arguments);break;default:throw new Error(this._getLocaleValue("optionChangeNotSupported").replace("{optionName}",key))}},changeGlobalLanguage:function(){},changeGlobalRegional:function(){},destroy:function(){var fc,self=this,modalDialog=this._getModalDialog();this.grid.element.unbind(".hiding");this.grid.headersTable().find("> thead > tr > th").not("[data-skip=true]").each(function(){var th=$(this);th.find("a[data-hiding-indicator=true]").remove();self._clearHiddenColumnIndicator(true,th);self._clearHiddenColumnIndicator(false,th)});$("div[data-hiding-inddropdown='"+this.grid.id()+"']").remove();this._detachEvents();modalDialog[this.options.dialogWidget]("getCaptionButtonContainer");modalDialog.remove();fc=this.grid.element.data("igGridFeatureChooser");if(fc&&this.renderInFeatureChooser){fc._removeFeature("Hiding");fc._removeFeature("ColumnChooser")}this._superApply(arguments);return this},showColumnChooser:function(){this._openColumnChooser(false)},hideColumnChooser:function(){this._closeColumnChooser(false)},showColumn:function(column,callback){this.grid.showColumn(column,callback)},hideColumn:function(column,callback){this.grid.hideColumn(column,callback)},hideMultiColumns:function(columns,callback){columns=this._getDataColumns(columns);this.grid._setHiddenMultipleColumns([],columns,callback)},showMultiColumns:function(columns,callback){columns=this._getDataColumns(columns);this.grid._setHiddenMultipleColumns(columns,[],callback)},_getDataColumns:function(columns){var cols=[],col,i,currColumn,len,grid=this.grid;for(i=0;i<columns.length;i++){col=columns[i];if(grid.isGroupHeader(col)){currColumn=grid._getMultiHeaderColumnById(col);if(currColumn===null){return}len=currColumn.children.length;for(i=0;i<len;i++){cols.push(currColumn.children[i].key)}}else{cols.push(col)}}return cols},_showColumnFromUI:function(column){var columnKey,columnIndex,noCancel,self=this;if(typeof column==="number"){columnIndex=column}else{columnKey=column}noCancel=this._trigger(this.events.columnShowing,null,{owner:this,columnKey:columnKey,columnIndex:columnIndex});if(!this.grid._isShowingAllowed([column])){this._trigger(this.events.columnShowingRefused,null,{owner:this,columnKeys:[columnKey]});return false}if(noCancel){self.grid._loadingIndicator.show();setTimeout(function(){self.grid._setHidden(column,false);self._trigger(self.events.columnShown,null,{owner:self,columnKey:columnKey,columnIndex:columnIndex});self.grid._loadingIndicator.hide()},0)}return noCancel},_setHiddenMultipleColumns:function(columnsToShow,columnsToHide,callEvents,callback){var self=this,grid=self.grid,columnKey,columnIndex;grid._loadingIndicator.show();setTimeout(function(){var i,column,noCancel,cols=[],c;for(i=0;i<columnsToShow.length;i++){column=columnsToShow[i];if(typeof column==="number"){columnIndex=column}else{columnKey=column}noCancel=true;if(callEvents){noCancel=self._trigger(self.events.columnShowing,null,{owner:self,columnKey:columnKey,columnIndex:columnIndex})}if(noCancel){c=self.grid._setHidden(column,false);if(callEvents){self._trigger(self.events.columnShown,null,{owner:self,columnKey:columnKey,columnIndex:columnIndex})}if(c){cols.push(c)}}}for(i=0;i<columnsToHide.length;i++){column=columnsToHide[i];if(grid._visibleColumns().length===1){break}if(typeof column==="number"){columnIndex=column}else{columnKey=column}noCancel=true;if(callEvents){noCancel=self._trigger(self.events.columnHiding,null,{owner:self,columnKey:columnKey,columnIndex:columnIndex})}if(noCancel){c=grid._setHidden(column,true);if(callEvents){self._trigger(self.events.columnHidden,null,{owner:self,columnKey:columnKey,columnIndex:columnIndex})}if(c){cols.push(c)}}}if(!grid._allColumnWidthsInPixels&&$.ig.util.isFF){grid._refreshUI()}grid._loadingIndicator.hide();if(callback){$.ig.util.invokeCallback(callback,[cols,columnsToShow.length===0])}},0)},_hideMultiColumnFromUI:function(id){var i,self=this,grid=this.grid,column,children,columnKey,childrenLength,noCancel,visibleChildrenLength=0,columnKeysToHide=[],columnKeysHidden=[];if(grid._visibleColumns().length===1){return false}column=grid._getMultiHeaderColumnById(id);if(column===null){return}children=column.children;childrenLength=children.length;for(i=0;i<childrenLength;i++){if(!children[i].hidden){visibleChildrenLength++}}if(grid._visibleColumns().length-visibleChildrenLength<1){return false}for(i=0;i<childrenLength;i++){columnKeysToHide.push(children[i].key)}if(!grid._isHidingAllowed(columnKeysToHide)){this._trigger(this.events.columnHidingRefused,null,{owner:this,columnKeys:columnKeysToHide});return false}noCancel=this._trigger(this.events.multiColumnHiding,null,{owner:this,columnKeys:columnKeysToHide});if(noCancel){grid._loadingIndicator.show();setTimeout(function(){for(i=0;i<childrenLength;i++){columnKey=columnKeysToHide[i];noCancel=self._trigger(self.events.columnHiding,null,{owner:self,columnKey:columnKey,columnIndex:undefined});if(noCancel){if(children[i].allowHiding&&!children[i].hidden){grid._setHidden(columnKey,true);columnKeysHidden.push(columnKey);self._trigger(self.events.columnHidden,null,{owner:self,columnKey:columnKey,columnIndex:undefined})}}}if(!grid._allColumnWidthsInPixels&&$.ig.util.isFF){grid._refreshUI()}column.hidden=true;column.colspan=0;grid._loadingIndicator.hide();self._trigger(self.events.multiColumnHidden,null,{owner:self,columnKeys:columnKeysHidden})},0)}},_fixedColumnsChanged:function(){this._renderHiddenColumnIndicators()},_hideColumnFromUI:function(column){var self=this,columnKey,columnIndex,noCancel;if(self.grid._visibleColumns().length===1){return false}if(typeof column==="number"){columnIndex=column}else{columnKey=column}if(!this.grid._isHidingAllowed([column])){this._trigger(this.events.columnHidingRefused,null,{owner:this,columnKeys:[columnKey]});return}noCancel=this._trigger(this.events.columnHiding,null,{owner:this,columnKey:columnKey,columnIndex:columnIndex});if(noCancel){self.grid._loadingIndicator.show();setTimeout(function(){self.grid._setHidden(column,true);self._trigger(self.events.columnHidden,null,{owner:self,columnKey:columnKey,columnIndex:columnIndex});if(!self.grid._allColumnWidthsInPixels&&$.ig.util.isFF){self.grid._refreshUI()}self.grid._loadingIndicator.hide()},0)}return noCancel},_initFeatureChooser:function(){var i,col,cols=this.grid.options.columns,hideText=this._getLocaleValue("columnHideText"),columnChooserDisplayText=this._getLocaleValue("columnChooserDisplayText"),featureChooserInstance=this.grid.element.data("igGridFeatureChooser");if(this._featureChooserInitialized&&!featureChooserInstance){return}this._featureChooserInitialized=true;this._hidingIconColumnKeys=[];for(i=0;i<cols.length;i++){col=cols[i];if(this._getColumnSettingsByIndex(i).allowHiding){if(featureChooserInstance._shouldRenderInFeatureChooser(col.key)===true){featureChooserInstance._renderInFeatureChooser(col.key,{name:"Hiding",text:hideText,iconClass:this.css.featureChooserHidingIcon,isSelectable:false,isSelected:false,method:$.proxy(this._featureChooserHide,this),updateOnClickAll:false,groupName:"click",groupOrder:2,order:2});featureChooserInstance._renderInFeatureChooser(col.key,{name:"ColumnChooser",text:columnChooserDisplayText,iconClass:this.css.featureChooserModalDialogIcon,method:$.proxy(this._featureChooserColumnChooser,this),groupName:"modaldialog",groupOrder:3,order:1})}else{this._hidingIconColumnKeys.push(col.key)}}}},_headerCellRendered:function(event,ui){if(ui.owner.element.attr("id")!==this.grid.element.attr("id")){return}if(!ui.isMultiColumnHeader&&this.renderInFeatureChooser){this._initFeatureChooser()}},_featureChooserHide:function(event,columnKey){this._closeColumnChooser(event);this._hideColumnFromUI(columnKey)},_featureChooserColumnChooser:function(){this._openColumnChooser(true)},_columnMap:function(){var self=this;return $.map(this.grid.options.columns,function(col,index){return{columnKey:col.key,enabled:self._getColumnSettingsByIndex(index).allowHiding}})},_renderHidingColumnIcon:function(th,columnKey,isMultiColumnHeader){var self=this,$a,indicatorContainer=th.find(".ui-iggrid-indicatorcontainer");if(indicatorContainer.length===0){indicatorContainer=$("<div></div>").addClass("ui-iggrid-indicatorcontainer").appendTo(th)}$a=$("<a></a>").css("display","inline").attr({"data-hiding-indicator":"true",href:"#","data-localeid":"hideColumnIconTooltip","data-localeattr":"title",title:this._getLocaleValue("hideColumnIconTooltip")}).bind("keydown.hiding",function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){if(isMultiColumnHeader){self._hideMultiColumnFromUI(th.attr("data-mch-id"))}else{self._hideColumnFromUI(columnKey)}event.preventDefault();event.stopPropagation()}}).appendTo(indicatorContainer);$("<span>&laquo;</span>").addClass(this.css.hidingHeaderIndicator).appendTo($a).bind("click.hiding",function(event){$(this).parent().mouseout();self._closeColumnChooser(event);if(isMultiColumnHeader){self._hideMultiColumnFromUI(th.attr("data-mch-id"))}else{self._hideColumnFromUI(columnKey)}event.preventDefault();event.stopPropagation()});this.grid._enableHeaderCellFeature(th)},_populateMultiColumnHeadersLevel0:function(){var i,j,self=this,cols=this.grid._oldCols,colsLength=cols.length,ths=$(this.grid._headerCells),level0=[],level0Length,visibleColumns=this.grid._visibleColumns();for(i=0;i<colsLength;i++){if(cols[i].level===0){level0.push(cols[i])}else{for(j=0;j<cols[i].children.length;j++){level0.push(cols[i].children[j])}}}level0Length=level0.length;ths.each(function(index){var th=$(this),col=visibleColumns[index],cs;if(col===null||col===undefined){return true}cs=self._getColumnSettingsByKey(col.key);if(cs.allowHiding){for(i=0;i<level0.length;i++){if(level0[i].key===col.key){break}}if(i<level0Length){level0[i].allowHiding=true;level0[i].visibleIndex=index;level0[i].settings=cs}th.col=level0[i]}})},_renderHidingIcons:function(){var thsMultiHeader,self=this,ths;if(self.grid._isMultiColumnGrid===true){thsMultiHeader=this.grid.headersTable().find("> thead > tr th").not("[data-skip=true]").not("[data-isheadercell=true]");this._populateMultiColumnHeadersLevel0();thsMultiHeader.each(function(){var th=$(this),id=th.attr("id"),col,allowHiding=true;if(id){id=id.replace(self.grid.id()+"_","");if(id){col=self._getColumnSettings(null,id);if(col&&col.allowHiding===false){allowHiding=false}}}if(allowHiding){self._renderHidingColumnIcon(th,null,true)}});ths=$(this.grid._headerCells)}else{ths=this.grid.headersTable().find("> thead > tr > th").not("[data-skip=true]")}ths.find("a[data-hiding-indicator=true]").remove();ths.each(function(index){var th=$(this),visibleColumns=self.grid._visibleColumns(),visibleIndex,columnKey;if(self.grid.options.virtualizationMode==="fixed"&&(self.grid.options.virtualization===true||self.grid.options.columnVirtualization===true)){visibleIndex=(self.grid._startColIndex||0)+index}else{visibleIndex=index}columnKey=visibleColumns[visibleIndex].key;if($.inArray(columnKey,self._hidingIconColumnKeys)!==-1){self._renderHidingColumnIcon(th,columnKey)}})},_headerRendered:function(event,ui){if(ui.owner.element.attr("id")!==this.grid.element.attr("id")){return}this._renderHidingIcons();this._renderColumnChooser()},_columnChooserButtonOKClick:function(){var self=this,changedColumns=self._columnsToHide,columnsToHide=[],columnsToShow=[],noCancel,modalDialog=this._getModalDialog();$.each(this.grid.options.columns,function(columnIndex,column){var cs,columnIdentifier,col;cs=self._getColumnSettingsByIndex(columnIndex);if(!cs.allowHiding){return}columnIdentifier=cs.columnKey||cs.columnIndex||column.key;col=changedColumns[columnIdentifier];if(col!==null&&col!==undefined){if(col){if(column.hidden===false){columnsToHide.push(columnIdentifier)}}else{if(column.hidden===true){columnsToShow.push(columnIdentifier)}}}});noCancel=this._trigger(this.events.columnChooserButtonApplyClick,null,{columnChooserElement:modalDialog,owner:this,columnsToHide:columnsToHide,columnsToShow:columnsToShow});if(!this.grid._isHidingAllowed(columnsToHide)){this._trigger(this.events.columnHidingRefused,null,{owner:this,columnKeys:columnsToHide});return}if(!this.grid._isShowingAllowed(columnsToShow)){this._trigger(this.events.columnShowingRefused,null,{owner:this,columnKeys:columnsToShow});return}if(noCancel){self._setHiddenMultipleColumns(columnsToShow,columnsToHide,true);self._getModalDialog()[this.options.dialogWidget]("closeModalDialog",true)}},isToRenderButtonReset:function(){var self=this,columnsToHide=self._columnsToHide,result=false;$.each(this.grid.options.columns,function(columnIndex,column){var cs,columnIdentifier,col,isHidden;cs=self._getColumnSettingsByIndex(columnIndex);if(cs&&!cs.allowHiding){return true}columnIdentifier=cs.columnKey||cs.columnIndex||column.key;col=columnsToHide[columnIdentifier];if(column._initiallyHidden===true){isHidden=true}else{isHidden=cs.hidden}if(col!==null&&col!==undefined){if(col!==isHidden){result=true;return false}}});return result},_isVisibleColumnsNotAllowHiding:function(){var self=this,res=false;$.each(this.grid.options.columns,function(columnIndex,column){var cs;cs=self._getColumnSettingsByIndex(columnIndex);if(cs&&!cs.allowHiding&&!column.hidden){res=true;return false}});return res},_columnChooserOpening:function(){var $ul,noCancel,$content,self=this,o=this.options,css=this.css,countColumnsAllowHiding=0,modalDialog=this._getModalDialog();noCancel=this._trigger(this.events.columnChooserOpening,null,{columnChooserElement:modalDialog,owner:this});if(noCancel){noCancel=this._trigger(this.events.columnChooserContentsRendering,null,{columnChooserElement:modalDialog,owner:this});if(noCancel){this.removeColumnChooserResetButton();$content=modalDialog[this.options.dialogWidget]("getContent");$content.empty();$ul=$("<ul></ul>").addClass(css.columnChooserListItems).appendTo($content);this._columnsToHide={};$.each(this.grid.options.columns,function(columnIndex,column){var cs,columnIdentifier,$a,$li;cs=self._getColumnSettingsByIndex(columnIndex);if(!cs.allowHiding){return}countColumnsAllowHiding++;columnIdentifier=cs.columnKey||cs.columnIndex||column.key;$li=$("<li></li>").attr("id",self.grid.element[0].id+"_"+columnIdentifier+"_columnchooser_li").addClass(css.columnChooserItem).append("<span class='"+css.columnChooserHideButton+"'><a href='#'></a></span><span class='"+css.columnChooserItemText+"'>"+column.headerText+"</span>");$li.appendTo($ul);$a=$li.find("a:first");if(o.columnChooserHideOnClick===true){$li.bind("click.hiding",function(event){var isHidden;if($a.attr("ishidden")==="1"){noCancel=self._showColumnFromUI(columnIdentifier);isHidden=false}else{noCancel=self._hideColumnFromUI(columnIdentifier);isHidden=true}if(noCancel){self._renderColumnChooserHideButton($a,isHidden)}event.preventDefault();event.stopPropagation();return false})}else{$li.bind("click.hiding",function(event){var isHidden,key,c;event.preventDefault();event.stopPropagation();if($a.attr("ishidden")==="1"){isHidden=false}else{isHidden=true}if(isHidden&&self.grid.hasFixedColumns()){c=[];for(key in self._columnsToHide){if(self._columnsToHide.hasOwnProperty(key)&&self._columnsToHide[key]){c.push(key)}}c.push(columnIdentifier);if(!self.grid._isHidingAllowed(c)){return}}if(isHidden&&!self._isVisibleColumnsNotAllowHiding()&&$ul.find("a[ishidden=1]").length===countColumnsAllowHiding-1){return}self._columnsToHide[columnIdentifier]=isHidden;self._renderColumnChooserHideButton($a,isHidden);if(self.isToRenderButtonReset()){self.renderColumnChooserResetButton()}else{self.removeColumnChooserResetButton()}return false})}self._columnsToHide[columnIdentifier]=column.hidden;self._renderColumnChooserHideButton($a,column.hidden)});this._trigger(this.events.columnChooserContentsRendered,null,{columnChooserElement:modalDialog,owner:this});if(o.columnChooserHideOnClick===false&&self.isToRenderButtonReset()){self.renderColumnChooserResetButton()}}this._trigger(this.events.columnChooserOpened,null,{columnChooserElement:modalDialog,owner:this})}return noCancel},resetHidingColumnChooser:function(){var self=this;$.each(this.grid.options.columns,function(columnIndex,column){var cs,columnIdentifier,isToHide;cs=self._getColumnSettingsByIndex(columnIndex);if(!cs){return true}if(!cs.allowHiding){return true}isToHide=cs.hidden;if(column._initiallyHidden===true){isToHide=true}columnIdentifier=cs.columnKey||cs.columnIndex||column.key;self._columnsToHide[columnIdentifier]=isToHide;self._renderColumnChooserHideButton(self.grid._rootContainer().find("#"+self.grid.id()+"_"+columnIdentifier+"_columnchooser_li a:first"),isToHide)});self.removeColumnChooserResetButton()},renderColumnChooserResetButton:function(){var self=this,resetButtonId=this.grid.id()+"_hiding_modalDialog_reset_button",modalDialog=this.grid._rootContainer().find("#"+this.grid.id()+"_hiding_modalDialog"),$captionButtonContainer,$resetButton;if(this.grid._rootContainer().find("#"+resetButtonId).length===0){$captionButtonContainer=modalDialog[this.options.dialogWidget]("getCaptionButtonContainer");$resetButton=$("<button type='button'></button>").attr("id",resetButtonId).appendTo($captionButtonContainer);$resetButton.igButton({labelText:this._getLocaleValue("columnChooserResetButtonLabel"),click:function(e){self._trigger(self.events.columnChooserButtonResetClick,e,{columnChooserElement:modalDialog,owner:self});self.resetHidingColumnChooser()}})}},removeColumnChooserResetButton:function(){this.grid._rootContainer().find("#"+this.grid.id()+"_hiding_modalDialog_reset_button").remove()},_renderColumnChooserHideButton:function($a,isHidden){var attrIsHidden,css=this.css,$li=$a.closest("li"),localeId;if(isHidden===false){attrIsHidden="0";localeId="columnChooserHideText";$li.removeClass(css.columnChooserItemHidden)}else{attrIsHidden="1";localeId="columnChooserShowText";$li.addClass(css.columnChooserItemHidden)}$a.attr({ishidden:attrIsHidden,"data-localeid":localeId}).text(this._getLocaleValue(localeId))},_renderColumnChooser:function(){this._getModalDialog().remove();var $buttonOK,self=this,o=this.options,$captionButtonContainer,containment=this.grid._rootContainer(),modalDialog;if(this.options.columnChooserContainment!=="owner"){containment="window"}modalDialog=$("<div></div>").appendTo(this.grid._rootContainer()).attr("id",this.grid.id()+"_hiding_modalDialog");modalDialog[this.options.dialogWidget]({modalDialogWidth:o.columnChooserWidth,modalDialogHeight:o.columnChooserHeight,locale:{modalDialogCaptionText:this._getLocaleValue("columnChooserCaptionLabel"),buttonApplyText:this._getLocaleValue("columnChooserButtonApplyText"),buttonCancelText:this._getLocaleValue("columnChooserButtonCancelText")},containment:containment,gridContainer:this.grid.container(),renderFooterButtons:!o.columnChooserHideOnClick,animationDuration:o.columnChooserAnimationDuration,modalDialogOpening:function(event,args){return self._columnChooserOpening(event,args)},modalDialogMoving:function(e,ui){self._trigger(self.events.columnChooserMoving,null,{columnChooserElement:$(e.target),owner:self,originalPosition:ui.originalPosition,position:ui.position})},modalDialogClosing:function(){return self._trigger(self.events.columnChooserClosing,null,{columnChooserElement:modalDialog,owner:self})},modalDialogClosed:function(){self._trigger(self.events.columnChooserClosed,null,{columnChooserElement:modalDialog,owner:self})}});if(!o.columnChooserHideOnClick){$buttonOK=this.grid._rootContainer().find("#"+this.grid.id()+"_hiding_modalDialog_footer_buttonok");$buttonOK.bind("igbuttonclick",function(e){self._columnChooserButtonOKClick(e);e.preventDefault()})}else{$captionButtonContainer=modalDialog[this.options.dialogWidget]("getCaptionButtonContainer");$("<span></span>").addClass("ui-icon ui-icon-closethick").appendTo($("<a></a>").appendTo($captionButtonContainer).attr("title",this._getLocaleValue("columnChooserCloseButtonTooltip")).attr("href","#").attr("role","button").addClass("ui-dialog-titlebar-close ui-corner-all").bind("click.hiding",function(event){modalDialog[self.options.dialogWidget]("closeModalDialog",true);event.preventDefault();event.stopPropagation();return false}))}},_hidingFinished:function(){if(this.options.virtualization===true&&this.options.virtualizationMode==="fixed"){return}if(this.options.columnVirtualization===true){return}this._renderHiddenColumnIndicators()},_virtualHorizontalScroll:function(){this._renderHiddenColumnIndicators();this._renderHidingIcons()},_getIndicators:function(indicators,isFixed){var i,col,columns=this.grid.options.columns,columnsLength=columns.length,visibleIndex=0,fixed;for(i=0;i<columnsLength;i++){col=columns[i];fixed=col.fixed===true;if(fixed!==isFixed){continue}if(col.hidden){if(this._getColumnSettingsByIndex(i).allowHiding){if(indicators[visibleIndex]===undefined){indicators[visibleIndex]=[]}indicators[visibleIndex].push(col.key)}}else{visibleIndex++}}return visibleIndex},_renderHiddenColumnIndicators:function(){var self=this,ths,visibleIndex=0,indicators=[],oldDropDowns,fHCells,ufHCells,hasFixedColumns=this.grid.hasFixedColumns(),fixedIndicators=[];visibleIndex=this._getIndicators(indicators,false);if(hasFixedColumns){this._getIndicators(fixedIndicators,true)}oldDropDowns=this.grid.container().children("div[data-hiding-inddropdown='"+self.grid.id()+"']");if(oldDropDowns.length){setTimeout(function(){oldDropDowns.remove()},this.options.dropDownAnimationDuration*2+1)}if(visibleIndex===0){this.grid.headersTable().find("> thead > tr > th[data-hiddenreplacement=true]").each(function(){var a=self._renderHiddenColumnIndicator(true,$(this));self._bindDropDownToIndicator(a.find("span"),indicators[0])})}else{ths=this.grid._isMultiColumnGrid?$(this.grid._headerCells):this.grid.headersTable().find("> thead > tr > th").not("[data-skip=true]");if(hasFixedColumns){if(this.grid._isMultiColumnGrid){fHCells=$();ufHCells=$();$.each(this.grid._headerCells,function(index,cell){if(self.grid._isFixedElement(cell)){fHCells.push(cell)}else{ufHCells.push(cell)}});this._renderHiddenColumnIndicatorsHelper(ufHCells,indicators,false);this._renderHiddenColumnIndicatorsHelper(fHCells,fixedIndicators,true)}else{this._renderHiddenColumnIndicatorsHelper(ths,indicators,false);ths=this.grid.fixedHeadersTable().find("thead > tr > th").not("[data-skip=true]");this._renderHiddenColumnIndicatorsHelper(ths,fixedIndicators,true)}}else{this._renderHiddenColumnIndicatorsHelper(ths,indicators)}}},_renderHiddenColumnIndicatorsHelper:function(ths,indicators,isFixed){var self=this;ths.each(function(index){var th=$(this),div,visibleIndex;if(self.grid.options.virtualization===true&&self.grid.options.virtualizationMode==="fixed"||self.grid.options.columnVirtualization===true){visibleIndex=self.grid._startColIndex+index}else{visibleIndex=index}self._clearHiddenColumnIndicator(true,th);self._clearHiddenColumnIndicator(false,th);if(indicators[visibleIndex]!==undefined){div=self._renderHiddenColumnIndicator(true,th);self._bindDropDownToIndicator(div.find("span"),indicators[visibleIndex])}if(visibleIndex===self.grid._visibleColumns(isFixed).length-1){if(indicators[visibleIndex+1]!==undefined){div=self._renderHiddenColumnIndicator(false,th);self._bindDropDownToIndicator(div.find("span"),indicators[visibleIndex+1])}}});this.grid._fireInternalEvent("_hiddenColumnIndicatorsRendered",ths)},_renderHiddenColumnIndicator:function(left,th){var padding,margin,nonPaddedIndicatorsAttr,position,indicatorMarkup,spanMarkup,paddingValue,div,span;if(left){padding="padding-left";margin="margin-left";position="left";indicatorMarkup="<div data-hiddencolindicator='left' />";spanMarkup="<span data-nonpaddedindicator='left'></span>";nonPaddedIndicatorsAttr="[data-nonpaddedindicator=left]"}else{padding="padding-right";margin="margin-right";position="right";indicatorMarkup="<div data-hiddencolindicator='right' />";spanMarkup="<span data-nonpaddedindicator='right'></span>";nonPaddedIndicatorsAttr="[data-nonpaddedindicator=right]"}paddingValue=parseInt(th.css(padding),10)+this.options.hiddenColumnIndicatorHeaderWidth;th.css(padding,paddingValue+"px");th.find(nonPaddedIndicatorsAttr).css(margin,-paddingValue+"px");div=$(indicatorMarkup).attr({"data-hiddencolumn-indicator-container":true,"data-localeid":"hiddenColumnIndicatorTooltipText","data-localeattr":"title",tabindex:this.grid.options.tabIndex,title:this._getLocaleValue("hiddenColumnIndicatorTooltipText")}).css("position","relative").css("width","100%").css("height","0px").css("top","0px").css("left","0px").prependTo(th);span=$(spanMarkup).attr({"data-hiddencolumn-indicator":true,"data-localeid":"hiddenColumnIndicatorTooltipText","data-localeattr":"title",title:this._getLocaleValue("hiddenColumnIndicatorTooltipText"),"data-skip-event":"true"}).css("position","absolute").css(margin,-paddingValue+"px").css(position,"0px").css("width",this.options.hiddenColumnIndicatorHeaderWidth+"px").addClass(this.css.hiddenColumnIndicator).appendTo(div);if($.ig.util.isIE7){span.css({top:-parseInt(th.css("padding-top"),10),height:th.innerHeight()})}return div},_clearHiddenColumnIndicator:function(left,th){var padding,paddingValue,indicatorSelector,indicator;if(left){padding="padding-left";indicatorSelector="div[data-hiddencolindicator=left]"}else{padding="padding-right";indicatorSelector="div[data-hiddencolindicator=right]"}indicator=th.find(indicatorSelector);if(indicator.length!==0){indicator.remove();paddingValue=parseInt(th.css(padding),10);th.css(padding,paddingValue-this.options.hiddenColumnIndicatorHeaderWidth+"px")}},_onBlurDDElement:function(e,button,dropDown){var self=this;self._activeDD=null;clearTimeout(self._blurTimeout);self._blurTimeout=setTimeout(function(){if(!self._activeDD||self._activeDD!==dropDown){self._toggleDropDown(button,dropDown,true)}},1)},_onFocusDDElement:function(e,button,dropDown){this._activeDD=dropDown},_bindDropDownToIndicator:function(button,columnKeys){var self=this,$hInd=button.closest("[data-hiddencolindicator]"),dropDown=this._renderDropDown(button,columnKeys);dropDown.find("ul,[tabindex],a").bind({blur:function(e){self._onBlurDDElement(e,button,dropDown)},focus:function(e){self._onFocusDDElement(e,button,dropDown)}});dropDown.bind({keydown:function(e){var $li,keyCode=e.keyCode,$target=$(e.target);switch(keyCode){case $.ui.keyCode.ESCAPE:self._toggleDropDown(button,dropDown,true);$hInd.focus();break;case $.ui.keyCode.ENTER:case $.ui.keyCode.SPACE:if($target.is("li")){$target.mousedown();e.preventDefault()}break;case $.ui.keyCode.TAB:$li=$target;if(!$li.is("li")){$li=$target.closest("li")}if(!e.shiftKey){if($li.is(":last-child")){$li.closest("ul").find("li:first-child").focus();e.preventDefault()}}else{if($li.is(":first-child")){$li.closest("ul").find("li:last-child").focus();e.preventDefault()}}break}}});$hInd.bind({keydown:function(e){if(e.keyCode===$.ui.keyCode.ENTER||e.keyCode===$.ui.keyCode.SPACE){
self._toggleDropDown(button,dropDown,false);e.preventDefault();e.stopPropagation()}}});button.parent().bind({mousedown:function(e){self._toggleDropDown(button,dropDown,false);e.preventDefault();e.stopPropagation()},mouseover:function(){if(button.attr("data-indicator-selected")!=="true"){button.addClass(self.css.hiddenColumnIndicatorMouseOver)}},mouseout:function(){button.removeClass(self.css.hiddenColumnIndicatorMouseOver)},mouseup:function(e){e.preventDefault();e.stopPropagation()},click:function(e){e.preventDefault();e.stopPropagation()}})},_renderDropDown:function(button,columnKeys){var self=this,dropDown,list;dropDown=$("<div data-hiding-inddropdown='"+this.grid.id()+"'></div>").css("position","absolute").css("display","none").addClass(this.css.hiddenColumnsDropDown).appendTo(this.grid._rootContainer());list=$("<ul tabindex='0'></ul>").addClass(this.css.hiddenColumnsDropDownList).appendTo(dropDown);$.each(columnKeys,function(index,columnKey){$("<li tabindex='0'></li>").addClass(self.css.hiddenColumnsDropDownItem).bind({mouseover:function(e){$(e.currentTarget).addClass(self.css.hiddenColumnsDropDownItemHover)},mouseout:function(e){$(e.currentTarget).removeClass(self.css.hiddenColumnsDropDownItemHover)},mousedown:function(e){self._closeColumnChooser(e);self._showColumnFromUI(columnKey);self._toggleDropDown(button,dropDown,true)}}).append($("<span></span>").addClass(self.css.hiddenColumnsDropDownItemText).html(self.grid.columnByKey(columnKey).headerText)).appendTo(list)});$("<a tabindex='0' data-button-show-column-chooser></a>").appendTo($("<li></li>").appendTo(list)).igButton({labelText:this._getLocaleValue("columnChooserDisplayText"),mousedown:function(event){if(event.target){setTimeout(function(){$(event.target).removeClass("ui-state-active")},0)}self._openColumnChooser(true);self._toggleDropDown(button,dropDown,true)},keydown:function(e){if(e.keyCode===$.ui.keyCode.ENTER||e.keyCode===$.ui.keyCode.SPACE){$(e.target).mousedown();e.preventDefault()}}});return dropDown},_toggleDropDown:function(button,dropDown,isCalledFromBlur){var th,rOffset,isLast,offset,left,self=this,isVisible=dropDown.is(":visible")===true;if(dropDown.data("isAnimating")===true||isVisible===false&&isCalledFromBlur===true){return}if(!isVisible){th=button.closest("th");isLast=button.closest("div").attr("data-hiddencolindicator")==="right";offset=$.ig.util.offset(th);if(isLast){left=offset.left+th.outerWidth()-dropDown.outerWidth()}else{left=th.closest("div").outerWidth()-th.igPosition().left<dropDown.outerWidth()?button.outerWidth()+offset.left-dropDown.outerWidth():offset.left}left=Math.max(0,left);rOffset=$.ig.util.getRelativeOffset(dropDown);dropDown.css("top",offset.top+th.outerHeight()-rOffset.top);dropDown.css("left",left-rOffset.left)}dropDown.data("isAnimating",true);dropDown.toggle(this.options.dropDownAnimationDuration,function(){if(dropDown.is(":visible")===true){dropDown.find("ul").focus();button.addClass(self.css.hiddenColumnIndicatorSelected);button.attr("data-indicator-selected","true")}else{button.removeClass(self.css.hiddenColumnIndicatorSelected);button.removeAttr("data-indicator-selected")}dropDown.data("isAnimating",false)})},_openColumnChooser:function(){this._getModalDialog()[this.options.dialogWidget]("openModalDialog")},_closeColumnChooser:function(e){this._getModalDialog()[this.options.dialogWidget]("closeModalDialog",null,e||null)},_columnChooserMove:function(e,ui){this._trigger(this.events.columnChooserMoving,null,{columnChooserElement:e.target,owner:this,originalPosition:ui.originalPosition,position:ui.position})},_getColumnSettings:function(index,key){var i,foundByIndex;for(i=0;i<this.options.columnSettings.length;i++){if(this.options.columnSettings[i].columnKey===key){return this._mergeColumnSettingsDefaults(this.options.columnSettings[i])}if(this.options.columnSettings[i].columnIndex===index){foundByIndex=this.options.columnSettings[i]}}return this._mergeColumnSettingsDefaults(foundByIndex)},_getColumnSettingsByIndex:function(index){var key=this.grid.options.columns[index].key;return this._getColumnSettings(index,key)},_getColumnSettingsByKey:function(key){var i;for(i=0;i<this.grid.options.columns.length;i++){if(this.grid.options.columns[i].key===key){return this._getColumnSettings(i,key)}}},_mergeColumnSettingsDefaults:function(columnSettings){var defaults={allowHiding:true,hidden:false},copy=$.extend({},columnSettings),key;for(key in defaults){if(defaults.hasOwnProperty(key)&&typeof copy[key]!=="boolean"){copy[key]=defaults[key]}}return copy},_columnsMoved:function(){var self=this;this.grid.headersTable().find("> thead > tr > th").not("[data-skip=true]").each(function(){var th=$(this);self._clearHiddenColumnIndicator(true,th);self._clearHiddenColumnIndicator(false,th)});this._renderHiddenColumnIndicators()},_detachEvents:function(){if(this._headerCellRenderedHandler!==null&&this._headerCellRenderedHandler!==undefined){this.grid.element.unbind("iggridheadercellrendered",this._headerCellRenderedHandler)}if(this._headerRenderedHandler!==null&&this._headerRenderedHandler!==undefined){this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler)}if(this._virtualHorizontalScrollHandler!==null&&this._virtualHorizontalScrollHandler!==undefined){this.grid.element.unbind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler)}if(this._columnsMovedHandler!==null&&this._columnsMovedHandler!==undefined){this.grid.element.unbind("iggrid_columnsmoved",this._columnsMovedHandler)}},_injectGrid:function(gridInstance){var i,j,cs,col,children;this.grid=gridInstance;this._detachEvents();this._headerRenderedHandler=$.proxy(this._headerRendered,this);this._headerCellRenderedHandler=$.proxy(this._headerCellRendered,this);this._virtualHorizontalScrollHandler=$.proxy(this._virtualHorizontalScroll,this);this._columnsMovedHandler=$.proxy(this._columnsMoved,this);this.grid.element.bind("iggridheadercellrendered",this._headerCellRenderedHandler);this.grid.element.bind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.bind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler);this.grid.element.bind("iggrid_columnsmoved",this._columnsMovedHandler);if(this.grid.element.igGridFeatureChooser!==undefined){this.grid.element.igGridFeatureChooser()}else{throw new Error(this._getLocaleValue("featureChooserNotReferenced"))}for(i=0;i<this.options.columnSettings.length;i++){cs=this.options.columnSettings[i];if(typeof cs.hidden==="boolean"){if(typeof cs.columnKey==="string"){col=this.grid.columnByKey(cs.columnKey)}else if(typeof cs.columnIndex==="number"){col=this.grid.options.columns[cs.columnIndex]}if(col!==undefined&&col!==null){if(col.hidden===undefined||cs.hidden===true&&col.hidden!==col._initiallyHidden&&col._initiallyHidden!==true){col.hidden=cs.hidden}}else if(this.grid._isMultiColumnGrid===true&&cs.columnKey!==null&&cs.columnKey!==undefined){col=this.grid._getMultiHeaderColumnById(cs.columnKey);if(col!==undefined&&col!==null&&col.children){children=col.children;for(j=0;j<children.length;j++){if(children[j].hidden===undefined||cs.hidden===true&&children[j].hidden!==children[j]._initiallyHidden&&children[j]._initiallyHidden!==true){children[j].hidden=cs.hidden}}}}}}}});$.extend($.ui.igGridHiding,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI Hierarchical Grid 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.widget.js
 *	infragistics.dataSource.js
 *	infragistics.ui.shared.js
 *	infragistics.util.js
 *	infragistics.ui.grid.framework.js
 */
(function($){$.widget("ui.igHierarchicalGrid",$.ui.igWidget,{css:{expandColumn:"ui-iggrid-expandcolumn",expandColumnExpanded:"ui-iggrid-expandcolumn-expanded",expandButton:"ui-iggrid-expandbutton ui-icon-plus",expandButtonHover:"ui-iggrid-expandbuttonhover ui-icon-plus ui-state-hover",expandButtonExpandedHover:"ui-iggrid-expandbuttonexpandedhover ui-icon-plus ui-state-hover",expandButtonExpanded:"ui-iggrid-expandbutton ui-iggrid-expandbuttonexpanded ui-icon-minus",expandButtonClick:"ui-iggrid-expandbuttonclick ui-icon-plus",childGridArea:"ui-iggrid-childarea",childGridAreaCollapsed:"ui-iggrid-childarea-collapsed",expandHeaderCell:"ui-iggrid-expandheadercell ui-iggrid-header ui-widget-header",expandHeaderCellTriangle:"ui-icon ui-icon-triangle-1-se",root:"ui-iggrid-root",childGridSeparator:"ui-iggrid-childgridseparator"},options:{initialDataBindDepth:-1,initialExpandDepth:-1,odata:false,rest:false,maxDataBindDepth:-1,defaultChildrenDataProperty:"children",autoGenerateLayouts:false,expandCollapseAnimations:true,expandColWidth:30,pathSeparator:"/",animationDuration:500,expandTooltip:undefined,collapseTooltip:undefined,locale:{expandTooltip:undefined,collapseTooltip:undefined},columnLayouts:[{key:null,primaryKey:null,foreignKey:null}],width:null,height:null,autoAdjustHeight:true,avgRowHeight:25,avgColumnWidth:null,defaultColumnWidth:null,autoGenerateColumns:true,virtualization:false,virtualizationMode:"fixed",rowVirtualization:false,columnVirtualization:false,virtualizationMouseWheelStep:null,adjustVirtualHeights:false,templatingEngine:"infragistics",columns:[{headerText:null,key:null,formatter:null,format:null,dataType:"string",width:null,hidden:false,template:null,unbound:false,groupOptions:{expanded:true,allowGroupCollapsing:false,hidden:"never"},group:[],dateDisplayType:"local",rowspan:0,formula:null,unboundValues:null,headerCssClass:null,columnCssClass:null,mapper:null,rowIndex:null,columnIndex:null,navigationIndex:null,colSpan:1,rowSpan:1}],dataSource:null,dataSourceUrl:null,dataSourceType:null,responseDataKey:null,responseTotalRecCountKey:null,requestType:"GET",responseContentType:"application/json; charset=utf-8",showHeader:true,showFooter:true,fixedHeaders:true,fixedFooters:true,caption:null,features:[{name:null}],tabIndex:0,localSchemaTransform:true,primaryKey:null,serializeTransactionLog:true,autoCommit:false,aggregateTransactions:false,autoFormat:"date",renderCheckboxes:false,updateUrl:null,restSettings:{create:{url:null,template:null,batch:false},update:{url:null,template:null,batch:false},remove:{url:null,template:null,batch:false},encodeRemoveInRequestUri:true,contentSerializer:null,contentType:"application/json; charset=utf-8"},alternateRowStyles:true,autofitLastColumn:true,enableHoverStyles:true,enableUTCDates:false,mergeUnboundColumns:false,jsonpRequest:false,enableResizeContainerCheck:true,featureChooserIconDisplay:"desktopOnly",scrollSettings:{scrollTop:0,scrollLeft:0,wheelStep:50,smoothing:false,smoothingStep:1,smoothingDuration:1,inertiaStep:1,inertiaDuration:1}},events:{rowExpanding:"rowExpanding",rowExpanded:"rowExpanded",rowCollapsing:"rowCollapsing",rowCollapsed:"rowCollapsed",childrenPopulating:"childrenPopulating",childrenPopulated:"childrenPopulated",childGridRendered:"childGridRendered",childGridCreating:"igchildgridcreating",childGridCreated:"igchildgridcreated",cellClick:"cellClick",cellRightClick:"cellRightClick",dataBinding:"dataBinding",dataBound:"dataBound",rendering:"rendering",rendered:"rendered",dataRendering:"dataRendering",dataRendered:"dataRendered",headerRendering:"headerRendering",headerRendered:"headerRendered",captionRendering:"captionRendering",captionRendered:"captionRendered",footerRendering:"footerRendering",footerRendered:"footerRendered",headerCellRendered:"headerCellRendered",rowsRendering:"rowsRendering",rowsRendered:"rowsRendered",schemaGenerated:"schemaGenerated",columnsCollectionModified:"columnsCollectionModified",requestError:"requestError",created:"igcontrolcreated",destroyed:"igcontroldestroyed"},_changeLanguage:function(language){var rootWidget=this.rootWidget();if(rootWidget){rootWidget._setOption("language",language);this.allChildren().each(function(){$(this).igGrid("option","language",language)})}},changeLocale:function(){var self=this,rootWidget=this.rootWidget();if(rootWidget){rootWidget.container().find("[data-toggle-button]").each(function(){self._changeLocaleForElement($(this))})}},changeRegional:function(){var rootWidget=this.rootWidget(),regional=this.options.regional;if(rootWidget){rootWidget._setOption("regional",regional);this.allChildren().each(function(){$(this).igGrid("option","regional",regional)})}},_setOption:function(key,value){var rootWidget=this.rootWidget();switch(key){case"dataSource":this.options.dataSource=value;this.dataBind();break;case"initialDataBindDepth":case"initialExpandDepth":case"expandColWidth":throw new Error(this._getLocaleValue("optionChangeNotSupported").replace("{optionName}",key));case"odata":case"defaultChildrenDataProperty":case"autoGenerateLayouts":case"expandCollapseAnimations":case"animationDuration":this._superApply(arguments);break;case"regional":this._superApply(arguments);break;case"locale":rootWidget._setOption(key,value);this._superApply(arguments);break;case"language":if(this.options.language!==value){this._superApply(arguments);this._changeLanguage(value)}break;default:if(rootWidget){rootWidget._setOption(key,value)}break}},_create:function(){this._regevents(this.element,this);$.ui.igGrid.prototype.options.columns=[];$.ui.igGrid.prototype.options.features=[];this.options=$.extend(true,{},$.ui.igGrid.prototype.options,this.options);if(this.tmpDataSource!==null&&this.tmpDataSource!==undefined){this.options.dataSource=this.tmpDataSource;this._originalOptions.dataSource=this.tmpDataSource}if(this.options.virtualization===true||this.options.rowVirtualization===true){this.options.virtualizationMode="continuous"}this._eventQueue=[];this._animationQueue=[];this._firstBind=true;this.dataBind();this.rootWidget()._isMultiColumnGrid=this._checkIsMultiColumnHeader(this.options)},_createWidget:function(options){this.options.columns=[];this.options.features=[];this.options.columnLayouts=[];if(options.dataSource&&($.type(options.dataSource)==="array"||$.type(options.dataSource)==="object")){this.tmpDataSource=options.dataSource;options.dataSource=null;this._originalOptions=options}this._superApply(arguments)},dataBind:function(){var hds,hdsoptions,rootds,opts;if(this.options.autoGenerateLayouts){this._generateLayouts()}hdsoptions=this._hdsoptions();hds=new $.ig.HierarchicalDataSource(hdsoptions);this._hds=hds;rootds=this._hds.root();this._tmpds=this.options.dataSource;this.options.dataSource=null;opts=$.extend(true,{},this.options);this.options.dataSource=this._tmpds;this._tmpds=null;opts.dataSource=rootds;if($.type(hdsoptions.dataSource)==="string"){opts.dataSourceUrl=hdsoptions.dataSource}if(!this._columnsGeneratedHandler){this._columnsGeneratedHandler=$.proxy(this._columnsGenerated,this)}else{this.element.unbind("iggridcolumnsgenerated.hierarchicalgrid",this._columnsGeneratedHandler)}this.element.bind("iggridcolumnsgenerated.hierarchicalgrid",this._columnsGeneratedHandler);if(this.options.autoGenerateLayouts===true){if(!this._databoundHandler){this._databoundHandler=$.proxy(this._layouts,this)}else{this.element.unbind("iggridcolumnsgenerated.hierarchicalgrid",this._databoundHandler)}this.element.bind("iggriddatarendering.hierarchicalgrid",this._databoundHandler)}this.element.addClass(this.css.root);this.element.attr("data-level",0);opts._isHierarchicalGrid=true;if(this._root){this._root.igGrid("option","dataSource",opts.dataSource)}else{if(this.options.autoGenerateLayouts===true){opts._recurseSchema=true}this._root=this.element;this.element.igGrid(opts);if(this.options.dataSourceUrl!==null&&this._firstBind){this.options.dataSource=this.options.dataSourceUrl;this._firstBind=false}}if(this.rootWidget().container().data("igLoading")){this.indicator=this.rootWidget().container().data("igLoading").indicator()}else{this.indicator=this.rootWidget().container().igLoading().data("igLoading").indicator()}this._regToggleEvent(this.element,this)},_generateLayouts:function(){var rec,i,ds=this.options.dataSource;if($.type(ds)!=="array"&&$.type(ds)!=="object"||ds.length===0){return}if($.type(ds)==="object"&&this.options.responseDataKey){ds=ds[this.options.responseDataKey]||ds}for(i=0;i<ds.length;i++){rec=ds[i];this._generateLayout(rec,this.options)}},_generateLayout:function(record,options){var name,layout,tmpLayout,i,rec,hasRespKey=false;for(name in record){if(record.hasOwnProperty(name)&&($.type(record[name])==="array"||$.type(record[name])==="object"&&options.responseDataKey&&$.type(record[name][options.responseDataKey])==="array")){rec=record[name];if(options.responseDataKey&&$.type(rec)==="object"){if(rec[options.responseDataKey]&&$.type(rec[options.responseDataKey])==="array"){rec=rec[options.responseDataKey];hasRespKey=true}else{continue}}layout={key:name,childrenDataProperty:name,columnLayouts:[]};if(hasRespKey){layout.responseDataKey=options.responseDataKey}tmpLayout=this._layoutExistsRecursive(this.options,name);if(!tmpLayout){if(options.columnLayouts===undefined||options.columnLayouts===null){options.columnLayouts=[]}options.columnLayouts.push(layout)}else{layout=tmpLayout}if(rec.length>0){for(i=0;i<rec.length;i++){this._generateLayout(rec[i],layout)}}}}},_layoutExistsRecursive:function(options,key){var i,tmpLayout=null;tmpLayout=options.key===key?options:tmpLayout;if(!tmpLayout){for(i=0;options.columnLayouts&&i<options.columnLayouts.length;i++){tmpLayout=this._layoutExistsRecursive(options.columnLayouts[i],key);if(tmpLayout){break}}}return tmpLayout},root:function(){return this._root},rootWidget:function(){return this.root().data("igGrid")},allChildrenWidgets:function(){return this.root().find(".ui-iggrid-table").map(function(){return $(this).data("igGrid")})},allChildren:function(){return this.root().find("table[data-childgrid='true']")},toggle:function(element,callback){this._toggleInternal({target:$(element).find(".ui-iggrid-expandcolumn")},true,callback)},expand:function(id,callback){if(!this.populated(id)){this._toggleInternal({target:$(id).find(".ui-iggrid-expandcolumn")},true,callback)}else{this._expand(id,true,callback)}},_expand:function(id,suppressEvents,callback){var tr=$(id),c,noCancel=true,handler,rootgrid;if(this.expanded(tr)){return}if(!suppressEvents){noCancel=this._trigger(this.events.rowExpanding,null,{owner:this,parentrow:tr})}if(this.expanded(tr)){return}rootgrid=this._rootgrid||this.element.closest(".ui-iggrid-root").data("igHierarchicalGrid");if(noCancel){if(this.options.expandCollapseAnimations){if(rootgrid._animationQueue[tr.attr("data-id")+"_"+tr.index()]===true){return}rootgrid._animationQueue[tr.attr("data-id")+"_"+tr.index()]=true}c=tr.find(".ui-iggrid-expandcolumn");tr.next().css("display","").css("visibility","visible");if(this.options.expandCollapseAnimations){if(!suppressEvents){handler=this._expandend}else{handler=this._expandendnoevents}tr.next().find("> td > div").slideDown(this.options.animationDuration,function(ctx){handler.apply(this,[ctx,callback])})}else{tr.next().find("> td > div").show();c.addClass(this.css.expandColumnExpanded).find(".ui-iggrid-expandbutton").removeClass(this.css.expandButton).addClass(this.css.expandButtonExpanded).attr({title:this._getLocaleValue("collapseTooltip"),"data-localeid":"collapseTooltip","data-localeattr":"title"})}tr.attr("state","e");tr.attr("aria-expanded",true);tr.next().children().first().removeClass(this.css.childGridAreaCollapsed).addClass(this.css.childGridArea);if(!this.options.expandCollapseAnimations){this._rowExpanded({owner:this,parentrow:tr});if(!suppressEvents){this._trigger(this.events.rowExpanded,null,{owner:this,parentrow:tr})}else if(callback){$.ig.util.invokeCallback(callback,[this,tr])}}}},expanded:function(element){var $e=element.length!==undefined?element:$(element);if($e===null||$e===undefined){return false}if($e.attr("state")!=="e"||$e.attr("state")===undefined){return false}return true},_expandendnoevents:function(ctx,callback){var expcell,expcellspan,rootgrid,$this=ctx?$(ctx):$(this),prow=$this.closest("tr[data-container]").prev();rootgrid=this._rootgrid||$this.closest(".ui-iggrid-root").data("igHierarchicalGrid");expcell=$this.closest("[data-container=true]").prev().find(".ui-iggrid-expandcolumn");expcellspan=expcell.find(".ui-iggrid-expandbutton");expcell.addClass(rootgrid.css.expandColumnExpanded);expcellspan.removeClass(rootgrid.css.expandButton).addClass(rootgrid.css.expandButtonExpanded).attr({title:rootgrid._getLocaleValue("collapseTooltip"),"data-localeid":"collapseTooltip","data-localeattr":"title"});rootgrid._rowExpanded({owner:rootgrid,parentrow:prow});if(rootgrid._animationQueue[prow.attr("data-id")+"_"+prow.index()]===true){delete rootgrid._animationQueue[prow.attr("data-id")+"_"+prow.index()]}if(callback){$.ig.util.invokeCallback(callback,[rootgrid,prow])}},_expandend:function(){var $this=$(this),rootgrid,prow=$this.closest("tr[data-container]").prev(),parentGrid=prow.closest(".ui-iggrid-table").data("igGrid");rootgrid=this._rootgrid||$this.closest(".ui-iggrid-root").data("igHierarchicalGrid");rootgrid._expandendnoevents(this);parentGrid._adjustLastColumnWidth(false);rootgrid._trigger(rootgrid.events.rowExpanded,null,{owner:rootgrid,parentrow:prow})},_collapseendnoevents:function(ctx,callback){var expcell,expcellspan,rootgrid,$this=ctx?$(ctx):$(this),ctd=$this.closest(".ui-iggrid-childarea"),prow=$this.closest("tr[data-container]").prev();rootgrid=this._rootgrid||$this.closest(".ui-iggrid-root").data("igHierarchicalGrid");ctd.removeClass(rootgrid.css.childGridArea).addClass(rootgrid.css.childGridAreaCollapsed);ctd.closest("tr").css("display","none").css("visibility","hidden");expcell=$this.closest("[data-container=true]").prev().find(".ui-iggrid-expandcolumn");expcellspan=expcell.find(".ui-iggrid-expandbutton");expcell.removeClass(rootgrid.css.expandColumnExpanded);expcellspan.removeClass(rootgrid.css.expandButtonExpanded).addClass(rootgrid.css.expandButton).attr({title:rootgrid._getLocaleValue("expandTooltip"),"data-localeid":"expandTooltip","data-localeattr":"title"});if(rootgrid._animationQueue[prow.attr("data-id")+"_"+prow.index()]===true){delete rootgrid._animationQueue[prow.attr("data-id")+"_"+prow.index()]}if(callback){$.ig.util.invokeCallback(callback,[rootgrid,prow])}},_collapseend:function(){var $this=$(this),rootgrid,prow=$this.closest("tr[data-container]").prev(),parentGrid=prow.closest(".ui-iggrid-table").data("igGrid");rootgrid=this._rootgrid||$this.closest(".ui-iggrid-root").data("igHierarchicalGrid");rootgrid._collapseendnoevents(this);parentGrid._adjustLastColumnWidth(false);rootgrid._trigger(rootgrid.events.rowCollapsed,null,{owner:rootgrid,parentrow:prow})},collapse:function(id,callback){this._collapse(id,true,callback)},_collapse:function(id,suppressEvents,callback){var tr=$(id),c,noCancel=true,handler,rootgrid;if(this.collapsed(tr)){return}if(!suppressEvents){noCancel=this._trigger(this.events.rowCollapsing,null,{owner:this,parentrow:tr})}rootgrid=this._rootgrid||this.element.closest(".ui-iggrid-root").data("igHierarchicalGrid");if(noCancel){if(this.options.expandCollapseAnimations){if(rootgrid._animationQueue[tr.attr("data-id")+"_"+tr.index()]===true){return}rootgrid._animationQueue[tr.attr("data-id")+"_"+tr.index()]=true}c=tr.find(".ui-iggrid-expandcolumn");if(this.options.expandCollapseAnimations){if(!suppressEvents){handler=this._collapseend}else{handler=this._collapseendnoevents}this._rowCollapsed({owner:this,parentrow:tr});tr.next().find("> td > div").slideUp(this.options.animationDuration,function(ctx){handler.apply(this,[ctx,callback])})}else{this._rowCollapsed({owner:this,parentrow:tr});tr.next().find("> td > div").hide();tr.next().children().first().removeClass(this.css.childGridArea).addClass(this.css.childGridAreaCollapsed);tr.next().css("display","none").css("visibility","hidden");c.find(".ui-iggrid-expandbutton").removeClass(this.css.expandButtonExpanded).addClass(this.css.expandButton).attr({title:this._getLocaleValue("expandTooltip"),"data-localeid":"expandTooltip","data-localeattr":"title"});if(!suppressEvents){this._trigger(this.events.rowCollapsed,null,{owner:this,parentrow:tr})}else if(callback){$.ig.util.invokeCallback(callback,[this,tr])}}tr.attr("state","c");tr.attr("aria-expanded",false)}},collapsed:function(element){var $e=element.length!==undefined?element:$(element);if($e===null||$e===undefined){return true}if($e.attr("state")==="c"||$e.attr("state")===undefined){return true}return false},populated:function(element){var $e=element.length!==undefined?element:$(element);if($e===null||$e===undefined){return false}if($e.attr("c")==="true"){return true}return false},_mouseOver:function(event){$(event.target).addClass(this.css.expandButtonHover)},_mouseOut:function(event){$(event.target).removeClass(this.css.expandButtonHover).addClass(this.css.expandButton)},_toggleInternalWithDelay:function(event){var self=this;setTimeout(function(){self._toggleInternal(event)},0);event.stopImmediatePropagation()},_toggleInternal:function(event,suppressEvents,callback){var created=$(event.target).closest("tr").attr("c"),tr=$(event.target).closest("tr"),p=tr.find(".ui-iggrid-expandcolumn"),hgrid=this,isExpand,expandTout=this.options.virtualization===true?50:0;isExpand=$(event.target).hasClass("ui-iggrid-expandbutton")||$(event.target).children(".ui-iggrid-expandbutton").length>0;if(!created&&this.options.initialDataBindDepth===-1&&isExpand){this.indicator.refreshPos();if(!$.ig.util.isWebKit){p.find(".ui-iggrid-expandbutton").css("visibility","hidden");this.indicator.show(false)}else{this.indicator.show(false)}setTimeout(function(){hgrid._toggleInternalAsync(event,suppressEvents,callback)},expandTout)}else{hgrid._toggleInternalAsync(event,suppressEvents,callback)}if(!suppressEvents){if(event.originalEvent&&typeof event.originalEvent.cancelBubble==="unknown"){event.originalEvent={}}event.stopImmediatePropagation()}},_toggleInternalAsync:function(event,suppressEvents,callback){var $td=$(event.target),parentrow=$td.closest("tr"),rowid="",keyspath="",keyspathvar="",pgridp,level=-1,sp=false,restSettingsSet,childds,created=parentrow.attr("c"),childrow,childgrids=[],ds,opts=[],id,k,isHierarchical,tmpkey,pki,key,pgInstance,cs,popts,i,j,h,parentLevel=0,tmpgrid,state=parentrow.attr("state"),animatec,noCancel=true,noCancelChild=true,pid,instanceOfDs,eArgs,currPathVar,paths,ids,childGrid,createdChildGrids=[];if($td.is("td")&&$td.attr("data-parent")!=="true"||$td.closest("td").attr("data-parent")!=="true"){return}if(state===undefined){state="c"}restSettingsSet=this.options.restSettings.update.url!==null||this.options.restSettings.update.template!==null||this.options.restSettings.create.url!==null||this.options.restSettings.create.template!==null||this.options.restSettings.remove.url!==null||this.options.restSettings.remove.template!==null;if(!created&&state==="c"){parentrow.after("<tr></tr>");childrow=parentrow.next();childrow.attr("data-container",true);popts=parentrow.closest("table").data("igGrid").options;opts=this._optsFor(popts);pgridp=parentrow.closest(".ui-iggrid-table");keyspath+=pgridp.attr("data-path")||"";rowid+=pgridp.attr("data-ids")||"";k=parentrow.closest("table").data("igGrid").options.primaryKey;if(rowid===""){rowid=k+":"+parentrow.attr("data-id")}else{rowid+=this.options.pathSeparator+k+":"+parentrow.attr("data-id")}cs=parentrow.find("td,th").length;animatec=$("<div></div>").appendTo($("<td></td>").appendTo(childrow).addClass(this.css.childGridArea).attr("colspan",cs));for(i=0;i<opts.length;i++){keyspathvar="";childgrids.push($("<table></table>").appendTo(animatec).attr("data-childgrid",true));key=opts[i].key!==undefined?opts[i].key:opts[i].childrenDataProperty;childgrids[i].attr("id",this.root()[0].id+"_"+parentrow.attr("data-id")+"_"+key+"_child");parentLevel=parseInt(parentrow.closest("table").attr("data-level"),10);childgrids[i].attr("id",childgrids[i].attr("id").replace(",","-")).attr("data-level",parentLevel+1);if(keyspath===""){keyspathvar=opts[i].childrenDataProperty===undefined?opts[i].key:opts[i].childrenDataProperty}else{keyspathvar=this.options.pathSeparator+(opts[i].childrenDataProperty===undefined?opts[i].key:opts[i].childrenDataProperty)}childds=this._hds.dataAt(rowid,keyspath+keyspathvar);if(childds===null||childds===undefined){childds=[]}else if($.type(childds)!=="array"&&!opts[i].responseDataKey&&childds!==undefined){childds=[childds]}isHierarchical=false;if(opts[i].columnLayouts&&opts[i].columnLayouts.length>0){isHierarchical=true}if(isHierarchical){this._regevents(childgrids[i],this)}level=rowid.split(this.options.pathSeparator).length;if(level>this.options.initialDataBindDepth&&this.options.initialDataBindDepth!==-1){sp=true}ds=this._hdsoptions().dataSource;eArgs={owner:this,options:opts[i],element:childgrids[i],id:rowid,path:keyspath+keyspathvar};if(!sp){opts[i].dataSource=childds;if($.type(ds)==="string"&&this.options.rest!==true&&!opts[i].dataSourceUrl){opts[i].dataSourceUrl=ds}if(opts[i].dataSourceUrl&&$.type(opts[i].dataSourceUrl)==="string"){if(!this.options.odata){opts[i].dataSourceUrl=$.ig.util.appendToQueryString(opts[i].dataSourceUrl,this._hds._encodeUrlPath(rowid,opts[i].key))}else{opts[i].dataSourceUrl=this._getOdataChildUrl(parentrow,keyspathvar,opts[i])}}if(this.options.autoGenerateLayouts===true){opts[i]._recurseSchema=true}noCancelChild=$.event.trigger(this.events.childGridCreating,eArgs,childgrids[i][0]);noCancelChild=childgrids[i].attr("data-create")!=="false"&&noCancelChild!==false;if(noCancelChild){if((this.options.rest||this.options.odata)&&restSettingsSet===true){this._inheritRestSettings(null,parentrow.attr("data-id"),keyspathvar.toLowerCase(),popts,opts[i])}if(isHierarchical){opts[i]._isHierarchicalGrid=true}opts[i].layoutPath=keyspath+keyspathvar;pgInstance=parentrow.closest(".ui-iggrid-table").data("igGrid");if(pgInstance){opts[i].foreignKeyValue=pgInstance._fixPKValue(parentrow.data("id"))}else{opts[i].foreignKeyValue=parentrow.data("id")}h=$.proxy(this._childRendered,this);childgrids[i].bind("iggridrendered.hierarchicalgrid",h);childgrids[i].igGrid(opts[i]);childgrids[i].attr("data-path",keyspath+keyspathvar);childgrids[i].attr("data-ids",rowid);if(opts[i].dataSourceUrl&&$.type(opts[i].dataSourceUrl)==="string"&&this.options.odata){childGrid=childgrids[i].data("igGrid");childGrid.options.responseDataKey=this.options.responseDataKey;childGrid.dataSource.schema().schema.searchField=this.options.responseDataKey}if(isHierarchical){this._regToggleEvent(childgrids[i],this)}childgrids[i].trigger(this.events.childGridCreated,{owner:this,element:childgrids[i]});createdChildGrids.push(childgrids[i])}if(opts[i].primaryKey===null||opts[i].primaryKey===undefined){if(opts[i].dataSource&&typeof opts[i].dataSource._xmlToArray==="function"&&typeof opts[i].dataSource._encodePkParams==="function"){throw new Error(this._getLocaleValue("noPrimaryKey"))}tmpgrid=childgrids[i].data("igGrid");tmpkey=tmpgrid.dataSource.schema().schema.searchField;if(tmpkey!==null){for(pki=0;pki<opts[i].dataSource[tmpkey].length;pki++){opts[i].dataSource[tmpkey][pki].ig_pk=tmpgrid.dataSource.data()[pki].ig_pk}}else{for(pki=0;pki<opts[i].dataSource.length;pki++){if(opts[i].dataSource[pki]){opts[i].dataSource[pki].ig_pk=tmpgrid.dataSource.data()[pki].ig_pk}}}}}else{instanceOfDs=ds&&typeof ds._xmlToArray==="function"&&typeof ds._encodePkParams==="function";if(this.options.odata){opts[i].dataSource=this._getOdataChildUrl(parentrow,keyspathvar,opts[i]);if(restSettingsSet===true){this._inheritRestSettings(null,parentrow.attr("data-id"),keyspathvar.toLowerCase(),popts,opts[i])}}else if(this.options.rest===true){if(ds.substr(ds.length-1)!=="/"){ds+="/"}currPathVar=keyspathvar;if(currPathVar.substr(0,1)!=="/"){currPathVar="/"+currPathVar}if(pgridp.attr("data-path")!==undefined&&pgridp.attr("data-ids")!==undefined){paths=pgridp.attr("data-path").split(this.options.pathSeparator);ids=pgridp.attr("data-ids").split(this.options.pathSeparator);for(j=0;j<paths.length;j++){ds+=ids[j].split(":")[1]+"/"+paths[j]+"/"}}pid=parentrow.attr("data-id");opts[i].dataSource=ds+pid+currPathVar.toLowerCase();if(restSettingsSet===true){this._inheritRestSettings(opts[i].dataSource,pid,keyspathvar.toLowerCase(),popts,opts[i])}}else if(instanceOfDs){opts[i].dataSource=ds.settings.dataSource+this._hds._encodeUrlPath(rowid,opts[i].key)}else{if(opts[i].dataSource){opts[i].dataSource=$.ig.util.appendToQueryString(opts[i].dataSource,this._hds._encodeUrlPath(rowid,opts[i].key));opts[i].dataSourceType="remoteUrl"}else{if($.type(ds)!=="string"){if($.type(opts[i].dataSource)==="string"){opts[i].dataSource=$.ig.util.appendToQueryString(opts[i].dataSource,this._hds._encodeUrlPath(rowid,opts[i].key));opts[i].dataSourceType="remoteUrl"}else if($.type(childds)==="array"){opts[i].dataSource=childds}}else{opts[i].dataSource=$.ig.util.appendToQueryString(ds,this._hds._encodeUrlPath(rowid,opts[i].key))}}if($.type(opts[i].dataSource)==="string"){opts[i].dataSourceUrl=opts[i].dataSource}}}}if(sp){noCancel=this._trigger(this.events.childrenPopulating,null,{owner:this,parentrow:parentrow,id:rowid});if(noCancel){for(i=0;i<opts.length;i++){id=parentrow.attr("data-id");if(!this._eventQueue["id"+id]||!this._eventQueue["id"+id].length){this._eventQueue["id"+id]=[]}h=$.proxy(this._childRendered,this);this._eventQueue["id"+id].push({grid:childgrids[i],handler:h,parentrow:parentrow,id:rowid});childgrids[i].bind("iggridrendered",h);if(this.options.autoGenerateLayouts===true){opts[i]._recurseSchema=true}if(isHierarchical){opts[i]._isHierarchicalGrid=true}pgInstance=parentrow.closest(".ui-iggrid-table").data("igGrid");if(pgInstance){opts[i].foreignKeyValue=pgInstance._fixPKValue(parentrow.data("id"))}else{opts[i].foreignKeyValue=parentrow.data("id")}eArgs={owner:this,options:opts[i],element:childgrids[i],id:rowid,path:keyspath+keyspathvar};noCancelChild=$.event.trigger(this.events.childGridCreating,eArgs,childgrids[i][0]);noCancelChild=childgrids[i].attr("data-create")!=="false"&&noCancelChild!==false;if(noCancelChild){childgrids[i].igGrid(opts[i]);childgrids[i].attr("data-path",keyspath+keyspathvar);childgrids[i].attr("data-ids",rowid);childgrids[i].trigger(this.events.childGridCreated,{owner:this,element:childgrids[i]});createdChildGrids.push(childgrids[i]);if(isHierarchical){this._regToggleEvent(childgrids[i],this)}}}}}animatec.attr("id","ac_"+parentrow.attr("data-id"));parentrow.attr("c",true);parentrow.next().hide();animatec.hide();this._expand(parentrow,suppressEvents,callback)}else{if(state==="e"){this._collapse(parentrow,suppressEvents,callback)}else if(state==="c"){this._expand(parentrow,suppressEvents,callback)}}if(this.indicator){this.indicator.hide()}parentrow.find(".ui-iggrid-expandbutton").css("visibility","visible");for(i=1;i<createdChildGrids.length;i++){tmpgrid=createdChildGrids[i].data("igGrid");if(tmpgrid){$("<div></div>").insertBefore(tmpgrid.container()).addClass(this.css.childGridSeparator)}}},_getOdataChildUrl:function(parentrow,keyspathvar,childGridOpts){var popts=parentrow.closest("table").data("igGrid").options,ds=this._hdsoptions().dataSource,instanceOfDs=ds&&typeof ds._xmlToArray==="function"&&typeof ds._encodePkParams==="function",dsobj=instanceOfDs?ds.settings.dataSource:ds,dsString=popts.dataSource&&typeof popts.dataSource._xmlToArray==="function"&&typeof popts.dataSource._encodePkParams==="function"?popts.dataSource.settings.dataSource:popts.dataSource,childds=parentrow.closest("table").data("igGrid").dataSource.data(),tmpkey=parentrow.attr("data-id"),k=popts.primaryKey,dsURL,pki,pid,currPathVar;if(parentrow.closest("table").data("igGrid").columnByKey(k).dataType==="number"){tmpkey=parseInt(tmpkey,10)}pid=typeof tmpkey==="string"?"'"+tmpkey+"'":tmpkey;for(pki=0;pki<childds.length;pki++){if(childds[pki][parentrow.closest("table").data("igGrid").options.primaryKey]===tmpkey){childds=childds[pki][childGridOpts.key];break}}if(!childds){if(dsString.substr(dsString.length-1)==="/"){dsString=dsString.substring(0,dsString.length-1)}currPathVar=keyspathvar;if(currPathVar.charAt(0)!=="/"){currPathVar="/"+currPathVar}if($.type(dsobj)==="string"&&dsobj!==dsString){dsString=dsobj.substring(0,dsobj.lastIndexOf("/"))+dsString.substring(dsString.lastIndexOf("/"))}dsURL=dsString.indexOf("?")!==-1?$.ig.util.prependToQueryString(dsString,"("+pid+")"+currPathVar):dsString+"("+pid+")"+currPathVar}else{if(childds.__deferred&&childds.__deferred.uri){dsURL=childds.__deferred.uri;if(dsobj.indexOf("$callback=?")!==-1){dsURL=$.ig.util.appendToQueryString(dsobj,"$callback=?")}if(dsobj.indexOf("$format=")!==-1&&dsURL.indexOf("$format=json")===-1){if(dsobj.indexOf("$format=json")!==-1){dsURL=$.ig.util.appendToQueryString(dsURL,"$format=json")}else{dsURL=$.ig.util.appendToQueryString(dsURL,"$format=atom")}}}else{dsURL=$.ig.util.prependToQueryString(childGridOpts.dataSourceUrl,"("+pid+")/"+keyspathvar)}}return dsURL},_layouts:function(){this.element.unbind("iggriddatarendering",this._databoundHandler)},_columnsGenerated:function(event,args){var layoutKey=args.key,layout;if(!layoutKey){return}layout=this._findLayout(this.rootWidget().options.columnLayouts,layoutKey);if(layout.columns&&layout.columns.length&&layout.columns.length>0){return}layout.columns=args.owner.options.columns},_findLayout:function(layouts,key){var i,layout;for(i=0;layouts&&i<layouts.length;i++){if(layouts[i].key===key){layout=layouts[i];break}if(!layout&&layouts[i].columnLayouts){layout=this._findLayout(layouts[i].columnLayouts,key)}}return layout},_hdsoptions:function(){var opts,schema,instanceOfHds;opts={responseDataKey:this.options.responseDataKey,responseTotalRecCountKey:this.options.responseTotalRecCountKey,dataSource:this.options.dataSource,primaryKey:this.options.primaryKey,localSchemaTransform:this.options.localSchemaTransform,autoCommit:this.options.autoCommit,odata:this.options.odata,serializeTransactionLog:this.options.serializeTransactionLog,updateUrl:this.options.updateUrl,restSettings:this.options.restSettings,initialDataBindDepth:this.options.initialDataBindDepth,requestType:this.options.requestType};if(this.options.dataSourceType!==null){opts.type=this.options.dataSourceType}schema=this._hschema();instanceOfHds=this.options.dataSource&&typeof this.options.dataSource._encodeHierarchicalUrlParams==="function"&&this.options.dataSource.settings&&this.options.dataSource.settings.hasOwnProperty&&this.options.dataSource.settings.hasOwnProperty("initialDataBindDepth");if(instanceOfHds&&this.options.dataSource.settings.schema===null||!instanceOfHds){opts=$.extend(opts,{schema:schema})}return opts},_getDataColumns:function(cols){var i,j,res=[],colsLength=cols.length,dCols;for(i=0;i<colsLength;i++){if(cols[i].group!==undefined&&cols[i].group!==null){dCols=this._getDataColumns(this._getDataColumns(cols[i].group));for(j=0;j<dCols.length;j++){res.push(dCols[j])}}else{res.push(cols[i])}}return res},_hschema:function(){var schema,i,j,rec,prop,cols=this._getDataColumns(this.options.columns),encodedLayouts=[],k,c;if(cols.length>0&&!this.options.autoGenerateColumns){schema={};schema.fields=[];j=0;for(i=0;i<cols.length;i++){if(cols[i].unbound===true){continue}schema.fields[j]={};schema.fields[j].name=cols[i].key;schema.fields[j].type=cols[i].dataType;j++}schema.searchField=this.options.responseDataKey}else if(this.options.autoGenerateColumns){schema={};schema.fields=[];if(this.options.dataSource&&this.options.dataSource.length&&this.options.dataSource.length>0&&$.type(this.options.dataSource)==="array"){rec=this.options.dataSource[0];for(prop in rec){if(rec.hasOwnProperty(prop)){for(k=0;k<cols;k++){if(cols[k].key===prop){c=cols[k];break}}if(c===null||c===undefined){schema.fields.push({name:prop,type:$.ig.getColType(rec[prop])})}else{if(c.unbound===true){continue}schema.fields.push({name:prop,type:c.dataType})}}}}}if(this.options.columnLayouts&&this.options.columnLayouts.length>0){
for(j=0;j<this.options.columnLayouts.length;j++){schema.fields.push({name:this.options.columnLayouts[j].childrenDataProperty===undefined?this.options.columnLayouts[j].key:this.options.columnLayouts[j].childrenDataProperty})}}this._parseLayouts(encodedLayouts,"",this.options);schema.layouts=encodedLayouts;return schema},_parseLayouts:function(layouts,cpath,options){var j,layout,p,cdp=null;if(options.columnLayouts&&options.columnLayouts.length!==undefined&&options.columnLayouts.length>0){for(j=0;j<options.columnLayouts.length;j++){layout=options.columnLayouts[j];cdp=layout.childrenDataProperty===undefined?layout.key:layout.childrenDataProperty;if(!cdp){cdp=this.options.defaultChildrenDataProperty}p=cpath+this.options.pathSeparator+cdp+":"+layout.primaryKey;layouts[p]=layout;this._parseLayouts(layouts,p,layout)}}},_batchExpand:function(){var crows=[],tmpanim,hgrid;hgrid=this.element.closest(".ui-iggrid-root").data("igHierarchicalGrid");if(!hgrid){hgrid=this.element.data("igHierarchicalGrid")}tmpanim=hgrid.options.expandCollapseAnimations;hgrid.options.expandCollapseAnimations=false;crows=this.element.find("tr[data-id]");hgrid._batchExpandLevel(crows);hgrid.options.expandCollapseAnimations=tmpanim},_batchExpandLevel:function(rows){var i;for(i=0;i<rows.length;i++){this.toggle(rows[i])}},_renderExtraHeaderCell:function(row,colgroup,prepend){if(prepend===true){$("<td></td>").prependTo(row).css("border-width",0).attr("data-skip",true)}else{$("<td></td>").appendTo(row).css("border-width",0).attr("data-skip",true)}},_renderExtraFooterCell:function(row,colgroup,prepend,cssClass){if(prepend===true){$("<td></td>").addClass(cssClass).prependTo(row).attr("data-skip",true)}else{$("<td></td>").addClass(cssClass).appendTo(row).attr("data-skip",true)}},_dataBound:function(sender,args){var senderId=sender.currentTarget.id,ownerId=args.owner.element[0].id,o=args.owner.options;if(ownerId!==senderId&&ownerId!==senderId+"_table"){return}if(o.primaryKey===null||o.primaryKey===undefined){this._generatePrimaryKeyValues(args.dataSource.data());o.primaryKey="ig_pk"}},_headerrenderedinternal:function(sender,args){if(args.owner.element[0].id!==sender.currentTarget.id&&args.owner.element[0].id!==sender.currentTarget.id+"_table"){return}var self=this,flatRenderColgroup=args.owner._renderColgroup,tmpid,$thDataSkip;args.owner._cleanupTBody=function(){var $tbody=this.element.children("tbody");this._fireInternalEvent("_cleanupTBody");$tbody.children("tr").remove();return $tbody};args.owner._renderRecord=$.proxy(this._hierarchicalRenderRecord,args.owner);args.owner._getFirstVisibleTR=$.proxy(this._hierarchicalGetFirstVisibleTR,args.owner);args.owner._getLastVisibleTR=$.proxy(this._hierarchicalGetLastVisibleTR,args.owner);args.owner._renderColgroup=function(){self._hierarchicalRenderColgroup.apply(args.owner,$.merge([flatRenderColgroup,self],arguments))};args.owner._headerInitCallbacks.push({type:"HierarchicalGrid",func:$.proxy(this._renderExtraHeaderCell,this)});args.owner._footerInitCallbacks.push({type:"HierarchicalGrid",func:$.proxy(this._renderExtraFooterCell,this)});args.owner._trigger("headerextracellsmodified",null,{owner:args.owner});if(args.table.attr("id")!==args.owner.element.attr("id")&&$(args.table).find("colgroup col[data-expander]").length===0){$("<col></col>").attr("data-skip","true").attr("data-expander",true).prependTo(args.table.find("colgroup")).width(this.options.expandColWidth)}$thDataSkip=$("<th></th>");$("<span></span>").appendTo($thDataSkip.prependTo(args.table.find("thead tr:first")).addClass(this.css.expandHeaderCell).attr("data-skip",true)).addClass(this.css.expandHeaderCellTriangle);if(args.owner._isMultiColumnGrid){$thDataSkip.attr("rowspan",args.owner._maxLevel+1)}if(args.owner._isWrapped){tmpid=args.owner.element.attr("id").substring(0,args.owner.element.attr("id").indexOf("_table"));args.owner.container().find("#"+tmpid).unbind("iggridheaderrenderedinternal",args.owner.element.data("hr"));args.owner.container().find("#"+tmpid).removeData("hr")}else{args.owner.element.unbind("iggridheaderrenderedinternal",args.owner.element.data("hr"));args.owner.element.removeData("hr")}},_checkIsMultiColumnHeader:function(lobj){var i,cols=lobj.columns,colsLength;if(cols){colsLength=cols.length;for(i=0;i<colsLength;i++){if(cols[i].group!==undefined&&cols[i].group!==null){return true}}}return false},_hierarchicalRenderRecord:function(data,rowIndex){var i,grid=this,lod,hg,childprop,dstr="",val,markup="",layouts,hasChildren,noVisibleColumns,layout,temp,cellClass;if(rowIndex%2!==0&&this.options.alternateRowStyles){dstr+="<tr class='"+grid.css.recordAltClass+"'"}else{dstr+="<tr"}dstr+=" data-row-idx='"+rowIndex+"'";if(!this._hg){hg=this.element.closest(".ui-iggrid-root").data("igHierarchicalGrid");if(!hg){hg=this.element.hasClass(".ui-iggrid-root")?this.element:undefined}this._hg=hg}else{hg=this._hg}if(this.options.foreignKey){dstr+=" data-id-fk='"+this._kval_from_key(this.options.foreignKey,data)+"'"}else{if(this.options.primaryKey===null||this.options.primaryKey===undefined){this.options.primaryKey="ig_pk";val=hg._getVal(data);dstr+=" data-id-fk='"+val+"'"}else if(this.options.primaryKey==="ig_pk"){val=hg._getVal(data);dstr+=" data-id-fk='"+val+"'"}else{dstr+=" data-id-fk='"+this._kval_from_key(this.options.primaryKey,data)+"'"}}if(this.options.primaryKey===null||this.options.primaryKey===undefined){this.options.primaryKey="ig_pk";val=hg._getVal(data);dstr+=" data-id='"+val+"'"}else if(this.options.primaryKey==="ig_pk"){val=hg._getVal(data);dstr+=" data-id='"+val+"'"}else{dstr+=" data-id='"+this._kval_from_key(this.options.primaryKey,data)+"'"}dstr+=" role='row' aria-expanded='false' tabindex='"+this.options.tabIndex+"'>";layouts=this.options.columnLayouts;hasChildren=false;lod=hg?hg.options.initialDataBindDepth>-1:false;if(!lod){for(i=0;layouts&&i<layouts.length;i++){if(data[layouts[i].key]){childprop=layouts[i].key;layout=layouts[i]}else{childprop=layouts[i].childrenDataProperty}childprop=childprop||this.options.defaultChildrenDataProperty;if(childprop){if(layout&&layout.responseDataKey){if(data[childprop]&&data[childprop][layout.responseDataKey]&&data[childprop][layout.responseDataKey].length!==undefined&&(data[childprop][layout.responseDataKey].length>0||this._shouldAlwaysRenderChildIndicator)){hasChildren=true;break}}else{if(data[childprop]){if(data[childprop].length!==undefined&&(data[childprop].length>0||this._shouldAlwaysRenderChildIndicator)){hasChildren=true;break}if(this.options.responseDataKey&&data[childprop][this.options.responseDataKey]&&data[childprop][this.options.responseDataKey].length!==undefined&&(data[childprop][this.options.responseDataKey].length>0||this._shouldAlwaysRenderChildIndicator)){hasChildren=true;break}}}}}}else{hasChildren=true}if(hasChildren){markup="<span class='ui-iggrid-expandbuttoncontainer'>"+"<span class='ui-iggrid-expandbutton ui-icon ui-icon-plus' "+"data-toggle-button='true' "+"data-localeid='expandTooltip' data-localeattr='title' "+"title='"+hg._getLocaleValue("expandTooltip")+"'></span></span>"}dstr+="<td tabindex='0' class='ui-iggrid-expandcolumn"+grid._addCellStyle(data,-1).replace(/class=\"/,"").replace(/\"/,"")+"' data-parent='"+hasChildren+"'>"+markup+"</td>";noVisibleColumns=true;$(this.options.columns).each(function(colIndex){var col=grid.options.columns[colIndex];cellClass=false;if(col.hidden){return}noVisibleColumns=false;dstr+="<td role='gridcell'  aria-readonly="+!!this.readOnly+" aria-describedby='"+grid.id()+"_"+this.key+"' tabindex='"+grid.options.tabIndex+"'";if(data[this.key]===undefined){if(this.template&&this.template.length){if(col.unbound){temp=grid._renderTemplatedCell(data,this)}else{temp=grid._renderTemplatedCell(data[colIndex],this)}if(temp.indexOf("<td")===0){dstr+=temp.substring(3)}else{dstr+=">"+temp;cellClass=true}dstr=grid._editCellStyle(dstr,data,colIndex,col,cellClass)}else{dstr+=grid._addCellStyle(data,colIndex,col)+">"+grid._renderCell(data[colIndex],this,data)}dstr+="</td>"}else{if(this.template&&this.template.length){temp=grid._renderTemplatedCell(data,this);if(temp.indexOf("<td")===0){dstr+=temp.substring(3)}else{dstr+=">"+temp;cellClass=true}dstr=grid._editCellStyle(dstr,data,this.key,col,cellClass)}else{dstr+=grid._addCellStyle(data,this.key,col)+">"+grid._renderCell(data[this.key],this,data)}dstr+="</td>"}});if(noVisibleColumns){dstr+="<td role='gridcell'></td>"}dstr+="</tr>";return dstr},_generatePrimaryKeyValues:function(ds){ds=ds||[];var i,len=ds.length;for(i=0;i<len;i++){ds[i].ig_pk=ds[i].ig_pk||$.ig.util.getCheckSumForObject(ds[i])}},_getVal:function(rec){rec.ig_pk=rec.ig_pk||$.ig.util.getCheckSumForObject(rec);return rec.ig_pk},_hierarchicalRenderColgroup:function(flatRenderColgroup,hierarchicalGrid,table,isHeader,isFooter,autofitLastColumn){var $colgroup;flatRenderColgroup.apply(this,[table,isHeader,isFooter,autofitLastColumn]);$colgroup=$(table).find(">colgroup");if($colgroup.find(">col[data-expander]").length>0){return}$("<col></col>").prependTo($colgroup).css("width",hierarchicalGrid.options.expandColWidth).attr("data-skip","true").attr("data-expander",true)},_schemaGenerated:function(event,args){var hg,i,rec,schema=args.schema,ds=args.dataSource,$this=args.owner,prop;hg=$this.element.closest(".ui-iggrid-root").data("igHierarchicalGrid");if(!hg){hg=$this.element.hasClass(".ui-iggrid-root")?$this.element:undefined}if(!hg||hg.options.initialDataBindDepth>-1){return}for(i=0;ds&&ds.length&&$.type(ds)==="array"&&i<ds.length;i++){rec=ds[i];for(prop in rec){if(rec.hasOwnProperty(prop)){if(!$this._fieldExists(prop,schema)&&($.type(rec[prop])==="array"||$.type(rec[prop])==="object")){schema.fields.push({name:prop,type:$.ig.getColType(rec[prop])})}}}}},_childRendered:function(sender,args){var ptr=args.owner.element.closest("tr").prev(),pid="id"+ptr.attr("data-id"),e=this._eventQueue[pid],i,fire=true;this._trigger(this.events.childGridRendered,null,{owner:this,parentrow:ptr,childgrid:args.owner});if(!e){args.owner.element.unbind("iggridrendered.hierarchicalgrid");return}for(i=0;e.length!==undefined&&i<e.length;i++){if(e[i].grid.attr("id")===args.owner.element.attr("id")){e[i].done=true;e[i].grid.unbind("iggridrendered",e[i].handler);break}}for(i=0;e.length!==undefined&&i<e.length;i++){if(!e[i].done){fire=false;break}}if(fire){this._trigger(this.events.childrenPopulated,null,{owner:this,parentrow:ptr,id:e[0].id});delete this._eventQueue[pid]}},_optsFor:function(popts){var i,j,o=[],layouts;if(popts.columnLayouts&&popts.columnLayouts.length>0&&$.type(popts.columnLayouts)==="array"){layouts=popts.columnLayouts;for(j=0;j<layouts.length;j++){this._inherit(popts,layouts[j]);o.push($.extend(true,{},$.ui.igGrid.prototype.options,{language:popts.language,locale:popts.locale,regional:popts.regional},layouts[j]))}}for(i=0;i<o.length;i++){if(!o[i].dataSource){o[i].dataSourceUrl=popts.dataSourceUrl}else{if(String(popts.initialDataBindDepth)==="-1"||popts.initialDataBindDepth===undefined){o[i].dataSourceUrl=o[i].dataSource}}}return o},_inherit:function(parent,child){var i,f,j,nowrite;if(parent.dataSourceType){child.dataSourceType=parent.dataSourceType}if(!parent.features||parent.features.length===undefined||parent.features.length===0){return}if(!child.features||child.features.length===undefined){child.features=[]}for(i=0;i<parent.features.length;i++){if(parent.features[i].inherit===true){f=null;for(j=0;j<child.features.length;j++){if(child.features[j].name===parent.features[i].name){f=child.features[j];break}}if(f===null||f===undefined){child.features.push($.extend(true,{},parent.features[i]));child.features[child.features.length-1].columnSettings=[]}else{nowrite=false;if(child.features[j].columnSettings&&child.features[j].columnSettings.length>0){nowrite=true}child.features[j]=$.extend(true,{},parent.features[i],f);if(!nowrite){child.features[j].columnSettings=[]}}}}},_regevents:function(e,context){var headerRenderedInternal,datarendered,schemaGenerated,columnStateChanged;headerRenderedInternal=$.proxy(context._headerrenderedinternal,context);datarendered=$.proxy(this._handleBatchExpandRender,context);schemaGenerated=$.proxy(this._schemaGenerated,context);columnStateChanged=$.proxy(this._columnStateChanged,context);e.bind("iggridheaderrenderedinternal.hierarchicalgrid",headerRenderedInternal);e.bind("iggriddatarendered.hierarchicalgrid",datarendered);e.bind("iggridschemagenerated.hierarchicalgrid",schemaGenerated);e.bind("iggriddatabound.hierarchicalgrid",$.proxy(this._dataBound,this));e.bind("iggridcolumnscollectionmodified.hierarchicalgrid",columnStateChanged);e.data("hr",headerRenderedInternal)},_regToggleEvent:function(e,context){var toggle;toggle=$.proxy(context._toggleInternalWithDelay,context);e.undelegate(".ui-iggrid-expandcolumn > .ui-iggrid-expandbuttoncontainer","mousedown");e.delegate(".ui-iggrid-expandcolumn > .ui-iggrid-expandbuttoncontainer","mousedown",toggle)},commit:function(){var elem=this.element;elem.find(".ui-iggrid-table").each(function(){$(this).igGrid("commit")});elem.igGrid("commit")},rollback:function(rebind){var elem=this.element;elem.find(".ui-iggrid-table").each(function(){$(this).igGrid("rollback",null,rebind)});elem.igGrid("rollback",null,rebind)},_addToLog:function(elem,taLog,child){var grid=elem.data("igGrid"),ds=grid?grid.dataSource:null,gridLog=ds?ds.allTransactions():[],i;if(!gridLog.length){return}this._dsLog=this._dsLog||[];this._dsLog.push(ds);for(i=0;i<gridLog.length;i++){taLog.push($.extend(true,child?{layoutKey:grid.options.key}:{},gridLog[i]))}},saveChanges:function(success,error){var self=this,opts,elem=self.element,url=self.options.updateUrl,taLog=[];if((this.options.rest||this.options.odata)&&this.options.restSettings){this._saveChangesForEachGrid();return}if(!url||!elem){return}delete self._dsLog;self._addToLog(elem,taLog);self.allChildren().each(function(){self._addToLog($(this),taLog,true)});opts={type:"POST",url:url,data:{ig_transactions:JSON.stringify(taLog)},success:function(data,textStatus,jqXHR){var logs=self._dsLog,i=logs?logs.length:0;while(i-- >0){logs[i]._saveChangesSuccess(data,textStatus,jqXHR)}if(success){success(data,textStatus,jqXHR)}},error:function(jqXHR,textStatus,errorThrown){var logs=self._dsLog,i=logs?logs.length:0;while(i-- >0){logs[i]._saveChangesError(jqXHR,textStatus,errorThrown)}if(error){error(jqXHR,textStatus,errorThrown)}}};$.ajax(opts)},_saveChangesForEachGrid:function(success,error){this.rootWidget().saveChanges(success,error);$.each(this.allChildrenWidgets(),function(){this.saveChanges(success,error)})},_handleBatchExpandRender:function(sender,args){var level=0,grid=args.owner,keyspath,ds,hdsData,rowid,popts,pgridp,parentRow,k,gridId=grid.element[0].id,tId=sender.currentTarget.id;if(gridId!==tId&&gridId!==tId+"_table"){return}level=parseInt(grid.element.attr("data-level"),10);if(isNaN(level)){level=0;grid.element.attr("data-level",level)}if(level>0&&this.options.initialDataBindDepth===-1&&this._hds.settings.type==="json"&&$.type(grid.options.dataSource)==="string"){keyspath="";rowid="";popts=grid.options;parentRow=grid.element.closest("tr[data-container]").prev("tr");pgridp=parentRow.closest(".ui-iggrid-table");keyspath+=pgridp.attr("data-path")||"";rowid+=pgridp.attr("data-ids")||"";k=pgridp.data("igGrid").options.primaryKey;if(rowid===""){rowid=k+":"+parentRow.attr("data-id")}else{rowid+=this.options.pathSeparator+k+":"+parentRow.attr("data-id")}if(popts.childrenDataProperty===undefined){if(popts.key){keyspath+=popts.key}}else{keyspath+=popts.childrenDataProperty}hdsData=this._hds.dataAt(rowid,keyspath);ds=grid.dataSource;if(hdsData[popts.responseDataKey]){hdsData[popts.responseDataKey]=ds._dataView;hdsData.Metadata=ds.metadata()}}if(level>this.options.initialExpandDepth){return}if((this.options.initialDataBindDepth===-1||this.options.initialDataBindDepth>=this.options.initialExpandDepth)&&this.options.initialExpandDepth!==-1){setTimeout($.proxy(this._batchExpand,args.owner),1)}},_columnStateChanged:function(sender,args){if(args.owner._initialized){this._handleBatchExpandRender(sender,args)}},_inheritRestSettings:function(path,pid,layout,popts,copts){var crest=copts.restSettings,prest=popts.restSettings,rs,ptmpl,fullpath;if(!path){if(prest.update.template||prest.remove.template){path=prest.update.template||prest.remove.template;path=path.replace("${id}",pid)}else{path=prest.create.url||prest.update.url||prest.remove.url;if(path.substr(path.length-1)!=="/"){path+="/"}path+=pid}if(layout.substr(0,1)==="/"){layout=layout.substr(1)}if(path.substr(path.length-1)!=="/"){path+="/"}fullpath=path+layout}else{fullpath=path}rs={update:{url:fullpath},create:{url:fullpath},remove:{url:fullpath}};if(crest.create.template&&prest.create.template){ptmpl=prest.create.template.replace("${id}",pid);crest.create.template=ptmpl+"/"+crest.create.template}if(crest.remove.template&&prest.remove.template){ptmpl=prest.remove.template.replace("${id}",pid);crest.remove.template=ptmpl+"/"+crest.remove.template}if(crest.update.template&&prest.update.template){ptmpl=prest.update.template.replace("${id}",pid);crest.update.template=ptmpl+"/"+crest.update.template}crest=$.extend(true,crest,rs)},_rowExpanded:function(args){var rowExpansion,rowHeight,parentGrid,currentHeight,rootGrid;rowExpansion=args.parentrow.next();if(rowExpansion.length===0||!rowExpansion.is("tr[data-container='true']")){return}rowHeight=rowExpansion.outerHeight();parentGrid=args.parentrow.closest(".ui-iggrid-table").data("igGrid");if((parentGrid.options.virtualization||parentGrid.options.rowVirtualization)&&parentGrid.options.virtualizationMode==="continuous"){currentHeight=parentGrid._getScrollContainerHeight();parentGrid._setScrollContainerHeight(currentHeight+rowHeight)}rootGrid=this.element.closest(".ui-iggrid-root").data("igGrid");if(rootGrid.options.rowVirtualization&&!parentGrid.options.height&&rootGrid.options.height){currentHeight=rootGrid._getScrollContainerHeight();rootGrid._setScrollContainerHeight(currentHeight+rowHeight)}},_rowCollapsed:function(args){var rowExpansion=args.parentrow.next(),rowHeight,parentGrid,currentHeight,rootGrid;if(rowExpansion.length===0||!rowExpansion.is("tr[data-container='true']")){return}rowHeight=rowExpansion.outerHeight();parentGrid=args.parentrow.closest(".ui-iggrid-table").data("igGrid");if((parentGrid.options.virtualization||parentGrid.options.rowVirtualization)&&parentGrid.options.virtualizationMode==="continuous"){currentHeight=parentGrid._getScrollContainerHeight();parentGrid._setScrollContainerHeight(currentHeight-rowHeight)}rootGrid=this.element.closest(".ui-iggrid-root").data("igGrid");if(rootGrid.options.rowVirtualization&&!parentGrid.options.height&&rootGrid.options.height){currentHeight=rootGrid._getScrollContainerHeight();rootGrid._setScrollContainerHeight(currentHeight-rowHeight)}},_hierarchicalGetFirstVisibleTR:function(visibleArea){var tableId="#"+this.element[0].id,firstVisibleTR;firstVisibleTR=$(tableId+" > tbody > tr:not([data-container='true'])").filter(function(){return this.offsetTop+$(this).height()>visibleArea.top}).first();return firstVisibleTR},_hierarchicalGetLastVisibleTR:function(visibleArea){var tableId="#"+this.element[0].id,lastVisibleTR;lastVisibleTR=$(tableId+" > tbody > tr:not([data-container='true'])").filter(function(){return this.offsetTop<visibleArea.bottom}).last();return lastVisibleTR},_clearVariablesAndEvents:function(){this.tmpDataSource=null;this._rootgrid=null;this.element.unbind(".hierarchicalgrid")},destroy:function(){this._clearVariablesAndEvents();this.rootWidget().destroy();this._superApply(arguments)}});$.extend($.ui.igHierarchicalGrid,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI Grid Merged Cells 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.util.js
 *	infragistics.ui.widget.js
 *	infragistics.dataSource.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.shared.js
 */
(function($){$.widget("ui.igGridCellMerging",$.ui.igWidget,{localeWidgetName:"CellMerging",css:{mergedCellsTop:"ui-iggrid-mergedcellstop",mergedCellsBottom:"ui-iggrid-mergedcellsbottom",mergedCell:"ui-iggrid-mergedcell",physicallyMergedCell:"ui-iggrid-physicalmergedcell"},options:{mergeType:"visual",mergeOn:"sorting",mergeStrategy:"duplicate",rowMergeStrategy:"duplicate",mergeRows:false,columnSettings:[{columnIndex:-1,columnKey:null,mergeOn:"sorting",mergeStrategy:"duplicate"}],inherit:false},events:{cellsMerging:"cellsMerging",cellsMerged:"cellsMerged"},_createWidget:function(){this.options.columnSettings=[];$.Widget.prototype._createWidget.apply(this,arguments)},_setOption:function(opt){if(opt==="mergeType"){throw new Error(this._getLocaleValue("optionChangeNotSupported").replace("{optionName}",opt))}$.Widget.prototype._setOption.apply(this,arguments);switch(opt){case"mergeOn":case"mergeStrategy":case"columnSettings":this._unmergeColumns();this._initColumnSettings();this._createModel();this._mergeColumns();break;case"mergeRows":this._createRowMergeModel();this.grid.dataBind();break}},changeGlobalLanguage:function(){},changeGlobalRegional:function(){},destroy:function(){this._unmergeRows();this._unmergeColumns();this._unregisterEvents();this._superApply(arguments);return this},mergeColumn:function(column,raiseEvents){var key=this._normalizeColumnId(column);if(!this.isMerged(key)){this._mergeColumn(key,raiseEvents)}return this.element},unmergeColumn:function(column){var key=this._normalizeColumnId(column);if(this.isMerged(key)){this._unmergeColumn(key);this._mergingModel[key].merged=false}return this.element},isMerged:function(column){return this._mergingModel[this._normalizeColumnId(column)].merged},mergeRow:function(id,fireEvents){var pkProp=this.grid.options.primaryKey,dv=this.grid._getDataView(),sri=this.grid._startRowIndex||0,tbody=this.grid.element.children("tbody"),row;if(!tbody){tbody=this.grid.fixedTable().children("tbody")}if(pkProp===null){var index=parseInt(id);if(!isNaN(index)){if(index-sri>=0){row=tbody.find("tr").eq(index-sri);this._mergeRow(index,row,fireEvents)}this._rowMergingModel[index]=true;return}}var rowIndex=-1;for(var i=0;i<dv.length;i++){if(dv[i][pkProp]===id){rowIndex=i;break}}row=tbody.find("tr[data-id='"+id+"']").eq(0);this._mergeRow(rowIndex,row,fireEvents);this._rowMergingModel[rowIndex]=true},unmergeRow:function(id,index){var pkProp=this.grid.options.primaryKey,dv=this.grid._getDataView(),sri=this.grid._startRowIndex||0,tbody=this.grid.element.children("tbody");if(!tbody){tbody=this.grid.fixedTable().children("tbody")}var row=null;if(id===null&&index!==null&&!isNaN(parseInt(index))){if(index-sri>=0){row=tbody.find("tr").eq(index-sri);this._unmergeRow(row)}this._rowMergingModel[index]=false;return}row=tbody.find("tr[data-id='"+id+"']").eq(0);this._unmergeRow(row);for(var i=0;i<dv.length;i++){if(dv[i][pkProp]===id){this._rowMergingModel[i]=false;break}}},_gridRendered:function(){this._mergeColumns();this._rowMergingModel=null;this._mergeRows()},_rrn:function(){this._mergeColumns();this._unmergeRows();this._mergeRows()},_rcn:function(){this._mergeColumns();this._unmergeRows();this._mergeRows()},_columnsCollectionModified:function(){this._mergeColumns();this._mergeRows()},_sortedColumnsChanging:function(expressions){var key,settings=this._columnSettings,model=this._mergingModel,prevColumns=this._prevSortedColumns,sortedColumns=this._getSortedColumns(expressions);for(key in sortedColumns){if(sortedColumns.hasOwnProperty(key)&&!prevColumns[key]&&settings[key].mergeOn==="sorting"){model[key].merged=true}}for(key in prevColumns){if(prevColumns.hasOwnProperty(key)&&!sortedColumns[key]&&settings[key].mergeOn==="sorting"){model[key].merged=false}}this._prevSortedColumns=sortedColumns},_internalRowAdded:function(){this._unmergeRows();this._unmergeColumns();this._mergeColumns();this._mergeRows()},_internalRowDeleted:function(){this._unmergeRows();this._unmergeColumns();this._mergeColumns();this._mergeRows()},_internalCellUpdated:function(args){var column=this.grid.getColumnByTD(args.cell);if(column&&column.column){this._unmergeColumn(column.column.key);if(this._mergingModel[column.column.key].merged){this._mergeColumn(column.column.key,true)}}},_internalRowUpdated:function(){this._unmergeRows();this._unmergeColumns();this._mergeColumns();this._mergeRows()},_rowExpanded:function(){this._unmergeRows();this._unmergeColumns();this._mergeColumns();this._mergeRows()},_rowCollapsed:function(){this._unmergeRows();this._unmergeColumns();this._mergeColumns();this._mergeRows()},_createModel:function(){var cols=this.grid.options.columns,key,colSetting,columnModel,i,mergingModel=this._mergingModel={},sortedColumns=this._getSortedColumns();for(i=0;i<cols.length;i++){key=cols[i].key;columnModel=mergingModel[key]={};colSetting=this._columnSettings[key];if(colSetting.mergeOn==="always"||colSetting.mergeOn==="sorting"&&sortedColumns[key]){columnModel.merged=true}else{columnModel.merged=false}if($.type(colSetting.mergeStrategy)==="function"){columnModel.fn=colSetting.mergeStrategy}else{switch(colSetting.mergeStrategy){case"duplicate":columnModel.fn=this._mergeDuplicate;break;case"null":columnModel.fn=this._mergeNull;break;default:if($.type(window[colSetting.mergeStrategy])==="function"){columnModel.fn=$.proxy(window[colSetting.mergeStrategy],this);break}throw new Error(this._getLocaleValue("mergeStrategyNotAFunction"))}}}},_createRowMergeModel:function(){var dv=this.grid._getDataView(),i;this._rowMergingModel=[];for(i=0;i<dv.length;i++){this._rowMergingModel[i]=this.options.mergeRows}},_initColumnSettings:function(){var i,columns,columnSettings,columnSetting,settings,setting,o=this.options;columns=this.grid.options.columns;columnSettings=o.columnSettings;settings=this._columnSettings={};for(i=0;i<columns.length;i++){settings[columns[i].key]={mergeStrategy:o.mergeStrategy,mergeOn:o.mergeOn}}for(i=0;i<columnSettings.length;i++){columnSetting=columnSettings[i];if(columnSetting.columnKey){setting=settings[columnSetting.columnKey]}else if($.type(columnSetting.columnIndex)){setting=settings[columns[columnSetting.columnIndex].key]}else{continue}setting.mergeOn=columnSetting.mergeOn||setting.mergeOn;setting.mergeStrategy=columnSetting.mergeStrategy||setting.mergeStrategy}},_getSortedColumns:function(expressions){var i,sExp=expressions||this.grid.dataSource.settings.sorting.expressions,sortedColumns={};for(i=0;i<sExp.length;i++){sortedColumns[sExp[i].fieldName]=true}return sortedColumns},_normalizeColumnId:function(column){return $.type(column)==="number"?this.grid.options.columns[column].key:column},_hasVirtualization:function(){return this.grid.options.virtualization||this.grid.options.rowVirtualization||this.grid.options.columnVirtualization},_hasGroupedColumns:function(){var groupBy=this.grid.element.data("igGridGroupBy");return groupBy&&groupBy.options&&groupBy.options.groupedColumns&&groupBy.options.groupedColumns.length>0},_dataRows:function(fixed,both){var table;if(both){table=this.grid.element.add(this.grid.fixedTable())}else{table=fixed?this.grid.fixedTable():this.grid.element}return table.children("tbody").children("tr:not([data-container='true'],[data-grouprow='true'],[data-summaryrow='true'])")},_addDummyGroupElements:function(dv,elements){var i,startIndex=this.grid._startRowIndex||0,endIndex=startIndex+this.grid._virtualRowCount||dv.length,visibleDv=dv.slice(startIndex,endIndex);for(i=0;i<visibleDv.length;i++){if(visibleDv[i].__gbRecord||visibleDv[i].__gbSummaryRecord){elements.splice(i,0,$())}}},_addDummyChildGridElements:function(tbody,dv,elements){var childGridContainerRows=tbody.children("tr[data-container]:visible"),i,row,index,allVisibleRows=tbody.children("tr:visible");for(i=0;i<childGridContainerRows.length;i++){row=childGridContainerRows.eq(i);index=allVisibleRows.index(row);elements.splice(index,0,$());dv.splice(index,0,$())}},_mergeDuplicate:function(prevRec,curRec,columnKey){if($.type(prevRec[columnKey])==="string"&&$.type(curRec[columnKey])==="string"&&this.grid.dataSource.settings.sorting.caseSensitive===false){return prevRec[columnKey].toLowerCase()===curRec[columnKey].toLowerCase()}var column=this.grid.columnByKey(columnKey);if(column.dataType==="time"){return this._mergeDuplicateTime(prevRec,curRec,columnKey)}return prevRec[columnKey]===curRec[columnKey]},_mergeDuplicateTime:function(prevRec,curRec,columnKey){var dataSourcePrimaryKey=this.grid.options.primaryKey,prevRecCellText=this.grid.getCellText(prevRec[dataSourcePrimaryKey],columnKey),curRecCellText=this.grid.getCellText(curRec[dataSourcePrimaryKey],columnKey);return prevRecCellText===curRecCellText},_mergeNull:function(prevRec,curRec,columnKey){return curRec[columnKey]===null},_rowMergeDuplicate:function(columnKey1,columnKey2,record){if(!record){return false}if($.type(record[columnKey1])==="string"&&$.type(record[columnKey2])==="string"&&this.grid.dataSource.settings.sorting.caseSensitive===false){return record[columnKey1].toLowerCase()===record[columnKey2].toLowerCase()}return record[columnKey1]===record[columnKey2]},_rowMergeNull:function(columnKey1,columnKey2,record){return record[columnKey2]===null},_isCellVerticallyMerged:function(cell){return cell.hasClass(this.css.mergedCellsTop)||cell.hasClass(this.css.mergedCellsBottom)||cell.hasClass(this.css.mergedCell)||cell.hasClass(this.css.physicallyMergedCell)},_mergeRows:function(){var sri=this.grid._startRowIndex||0,frows,rows,i;if(!this.options.mergeRows){return}if(!this._rowMergingModel){this._createRowMergeModel()}rows=this._dataRows(false);frows=this._dataRows(true);for(i=0;i<rows.length;i++){if(this._rowMergingModel[i+sri]){this._mergeRow(i,rows.eq(i),true);if(frows.length){this._mergeRow(i,frows.eq(i),true)}}}},_mergeRow:function(i,row,fireEvents){var curRec,noCancel,rms,pkProp=this.grid.options.primaryKey,dv=this.grid._getDataView(),sri=this.grid._startRowIndex||0,visibleColumns=this.grid._visibleColumns(),colspan,cellsToMerge;switch(this.options.rowMergeStrategy){case"duplicate":rms=this._rowMergeDuplicate;break;case"null":rms=this._rowMergeNull;break;default:if(typeof this.options.rowMergeStrategy==="function"){rms=this.options.rowMergeStrategy;break}throw new Error(this._getLocaleValue("mergeStrategyNotAFunction"))}var cells=$(row).find("td:not([data-skip='true'],td[data-parent])");for(var j=0;j<cells.length-1;j++){var currentCell=cells.eq(j);var nextCell=cells.eq(j+1);colspan=1;cellsToMerge=[];curRec=dv[i+sri];if(rms.apply(this,[visibleColumns[j].key,visibleColumns[j+colspan].key,curRec])&&nextCell.css("display")!=="none"&&!this._isCellVerticallyMerged(currentCell)&&!this._isCellVerticallyMerged(nextCell)){while(j+colspan<visibleColumns.length&&rms.apply(this,[visibleColumns[j].key,visibleColumns[j+colspan].key,curRec])&&currentCell.css("display")!=="none"&&nextCell.css("display")!=="none"&&!this._isCellVerticallyMerged(currentCell)&&!this._isCellVerticallyMerged(nextCell)){cellsToMerge.push(nextCell);colspan++;nextCell=cells.eq(j+colspan)}var args={orientation:"horizontal",owner:this,row:currentCell.parent(),rowIndex:i,rowId:pkProp?curRec[pkProp]:null,firstColumnKey:visibleColumns[j].key,columnKey:visibleColumns[j+colspan-1].key,record:curRec};if(fireEvents){noCancel=this._trigger(this.events.cellsMerging,null,args)}if(noCancel===false){continue}for(var k=0;k<cellsToMerge.length;k++){cellsToMerge[k].attr("aria-rowmerged","true");cellsToMerge[k].css("display","none")}currentCell.attr("colspan",colspan);if(fireEvents){args.count=colspan;this._trigger(this.events.cellsMerged,null,args)}}}},_unmergeRows:function(){var rows=this._dataRows(null,true),i;for(i=0;i<rows.length;i++){this._unmergeRow(rows.eq(i))}},_unmergeRow:function(row){var cells=row.find("td");cells.each(function(i,c){var cell=$(c);if(typeof cell.attr("colspan")!=="undefined"){cell.removeAttr("colspan");return}if(typeof cell.attr("aria-rowmerged")!=="undefined"){cell.removeAttr("aria-rowmerged");cell.css("display","table-cell")}})},_mergeColumns:function(){var i,key,visibleColumns=this.grid._visibleColumns();if(this.options.mergeType==="physical"&&this._hasVirtualization()&&this.grid.options.virtualizationMode==="fixed"){this._unmergeColumns()}for(i=0;i<visibleColumns.length;i++){key=visibleColumns[i].key;if(this._mergingModel[key].merged){this._mergeColumn(key,true)}}},_mergeColumn:function(key,raiseEvents){var cellAria=this.grid.id()+"_"+key,dv=this.grid._getDataView(),cells,startCell,merging=false,count=0,i,tbody,args,noCancel,prevRec,curRec,prevCell,curCell,pkProp=this.grid.options.primaryKey,sri=this.grid._startRowIndex||0,vrc=this.grid._virtualRowCount||dv.length;if(this.grid.hasFixedColumns()&&this.grid.isFixedColumn(key)){tbody=this.grid.fixedTable().children("tbody")}else{tbody=this.grid.element.children("tbody")}cells=tbody.find("tr>td[aria-describedby='"+cellAria+"']:not([gbsummarycell])");if(this._hasGroupedColumns()){this._addDummyGroupElements(dv,cells)}if(this.grid._isHierarchicalGrid){dv=dv.slice(0);this._addDummyChildGridElements(tbody,dv,cells)}i=sri>0?sri-1:0;prevCell=this.options.mergeType==="visual"?i-sri<0?$():cells.eq(i-sri):cells.eq(0);prevRec=dv[i++];for(i;i<dv.length&&i<sri+vrc+1;i++){curRec=dv[i];curCell=cells.eq(i-sri);if(this._mergingModel[key].fn.apply(this,[prevRec,curRec,key])){if(!merging){args={orientation:"vertical",owner:this,row:prevCell.parent(),rowIndex:i-sri,rowId:pkProp?prevRec[pkProp]:null,columnKey:key,firstRecord:prevRec,record:curRec};if(raiseEvents){noCancel=this._trigger(this.events.cellsMerging,null,args)}if(noCancel===false){prevCell=curCell;prevRec=curRec;continue}if(this.options.mergeType==="visual"&&prevCell.length){prevCell.addClass(this.css.mergedCellsTop)}if(prevCell[0]===curCell[0]){count=0}else{count=1}startCell=prevCell}prevCell=curCell;prevRec=curRec;count++;merging=true;if(this.options.mergeType==="visual"){curCell.addClass(this.css.mergedCell)}else if(this.options.mergeType==="physical"){curCell.css("display","none")}if(i<dv.length-1&&i<sri+vrc){continue}}if(merging){args.count=count;args.record=prevRec;if(raiseEvents){this._trigger(this.events.cellsMerged,null,args)}if(this.options.mergeType==="visual"){prevCell.addClass(this.css.mergedCellsBottom)}else if(this.options.mergeType==="physical"){startCell.css("display","");startCell.attr("rowspan",count);startCell.addClass(this.css.physicallyMergedCell)}merging=false}prevRec=curRec;prevCell=curCell}},_unmergeColumn:function(key){var dataRows,cells;dataRows=this._dataRows(this.grid.hasFixedColumns()&&this.grid.isFixedColumn(key));cells=dataRows.children("td[aria-describedby='"+this.grid.id()+"_"+key+"']:not([gbsummarycell])");this._removeMergingFromCells(cells)},_unmergeColumns:function(){var dataRows,cells;dataRows=this._dataRows(null,true);cells=dataRows.children("td:not([gbsummarycell])");this._removeMergingFromCells(cells)},_removeMergingFromCells:function(cells){if(this.options.mergeType==="physical"){cells.removeAttr("rowspan").removeClass(this.css.physicallyMergedCell).css("display","table-cell")}else{cells.removeClass(this.css.mergedCellsTop).removeClass(this.css.mergedCell).removeClass(this.css.mergedCellsBottom)}},_createHandlers:function(){this._virtualRowsHandler=$.proxy(this._rrn,this);this._virtualColumnsHandler=$.proxy(this._rcn,this);this._columnsCollectionModifiedHandler=$.proxy(this._columnsCollectionModified,this);this._rowExpandedHandler=$.proxy(this._rowExpanded,this);this._rowCollapsedHandler=$.proxy(this._rowCollapsed,this)},_registerEvents:function(){this.grid.element.on({"iggridvirtualrecordsrender.cellmerging":this._virtualRowsHandler,"iggridvirtualhorizontalscroll.cellmerging":this._virtualColumnsHandler,"iggridcolumnscollectionmodified.cellmerging":this._columnsCollectionModifiedHandler,"ighierarchicalgridrowexpanded.cellmerging":this._rowExpandedHandler,"ighierarchicalgridrowcollapsed.cellmerging":this._rowCollapsedHandler})},_unregisterEvents:function(){this.grid.element.off(".cellmerging")},_injectGrid:function(gridInstance){this.grid=gridInstance;this._v=this.grid.options.virtualization===true||this.grid.options.rowVirtualization===true;this._createHandlers();this._unregisterEvents();this._registerEvents();this._initColumnSettings();this._createModel();this._prevSortedColumns=this._getSortedColumns()}});$.extend($.ui.igGridCellMerging,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI Grid AppendRowsOnDemand 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.shared.js
 *	infragistics.util.js
 */
(function($){$.widget("ui.igGridAppendRowsOnDemand",$.ui.igWidget,{options:{type:null,chunkSize:25,recordCountKey:null,chunkSizeUrlKey:null,chunkIndexUrlKey:null,defaultChunkIndex:0,currentChunkIndex:0,loadTrigger:"auto",loadMoreDataButtonText:undefined,locale:{loadMoreDataButtonText:undefined}},events:{rowsRequesting:"rowsRequesting",rowsRequested:"rowsRequested"},_loadingIndicator:null,_persistLocalSorting:true,_persistLocalFiltering:true,_recalcLocalSummaries:true,_keepCurrentChunkIndex:true,_callDataRendered:true,_initialProbeForChunkIndex:true,_injectGrid:function(gridInstance){this.grid=gridInstance;this._checkNotSupportedScenarios();this.options.currentChunkIndex=this.options.defaultChunkIndex;if(this.options.type===null){this.options.type=this.grid._inferOpType()}this.grid.dataSource.settings.paging.type=this.options.type||"remote";this._defaultChunkSize=parseInt(this.options.chunkSize,10)*(this.options.defaultChunkIndex+1);this.grid.dataSource.settings.paging.pageSize=this._defaultChunkSize;if(this.options.chunkSizeUrlKey!==null&&this.options.chunkIndexUrlKey){this.grid.dataSource.settings.paging.pageSizeUrlKey=this.options.chunkSizeUrlKey;this.grid.dataSource.settings.paging.pageIndexUrlKey=this.options.chunkIndexUrlKey}if(this.options.recordCountKey!==null){this.grid.dataSource.settings.responseTotalRecCountKey=this.options.recordCountKey}this.grid.dataSource.settings.paging.enabled=true;if(this.options.loadTrigger==="auto"){this._verticalScrollHandler=$.proxy(this._probeForNextChunk,this)}this._appendRecordsHandler=$.proxy(this._appendRecords,this);this._columnSortingHandler=$.proxy(this._columnSorting,this);this._syncCurrentChunkIndexHandler=$.proxy(this._syncCurrentChunkIndex,this);this.grid.element.bind("iggridsortinginternalcolumnsorting",this._columnSortingHandler);this.grid.element.bind("iggriduisoftdirty iggriduidirty",this._syncCurrentChunkIndexHandler)},_dataRendered:function(){var buttonId,container;if(!this._callDataRendered){return}this._keepCurrentChunkIndex=false;this.grid.scrollContainer().css("background-color","white");this.grid.dataSource.settings.paging.pageSize=this.options.chunkSize;this._originalDataSourceCallback=this.grid.dataSource.settings.callback;this._initLoadingIndicator();if(this.options.loadTrigger==="auto"){this.grid.scrollContainer().unbind("scroll",this._verticalScrollHandler);this.grid.scrollContainer().bind("scroll",this._verticalScrollHandler);this.grid.scrollContainer().bind("igscrollscrolling",this._verticalScrollHandler);if(this._initialProbeForChunkIndex||this.options.type==="local"){this._probeForNextChunk()}}this._requestPending=false;this._triggerEvents=true;if(this.options.loadTrigger==="button"){if(!this._buttonRow){buttonId=this.grid.id()+"_loadMoreButton";container=this.grid.options.height?this.grid.scrollContainer():this.grid.container();this._buttonRow=container.append("<div class='ui-iggrid-loadmorebutton'><input type='button' id='"+buttonId+"'></input></div>");this.grid.container().find("#"+buttonId).attr({"data-localeid":"loadMoreDataButtonText","data-localeattr":"value"}).igButton({labelText:this._getLocaleValue("loadMoreDataButtonText"),click:$.proxy(this._nextChunk,this),width:"100%"});if(this.grid.scrollContainer().data("igScroll")!==undefined){this._onIgScrollRendered()}else{this._onIgScrollRenderedHandler=$.proxy(this._onIgScrollRendered,this);this.grid.scrollContainer().on("igscrollrendered",this._onIgScrollRenderedHandler)}}}if(this._loadingIndicator){this._hideLoading()}},_onIgScrollRendered:function(){var loadMoreButton=$(".ui-iggrid-loadmorebutton",this.grid.scrollContainer());if(loadMoreButton.length>0){this.grid.scrollContainer().igScroll("option","syncedElemsV",[loadMoreButton]);this._igScrollUpdateHeightWithButton()}},_igScrollUpdateHeightWithButton:function(){var loadMoreButton=$(".ui-iggrid-loadmorebutton",this.grid.scrollContainer()),scrollHeight=this.grid.element.outerHeight()+loadMoreButton.outerHeight();this.grid.scrollContainer().igScroll("option","scrollHeight",scrollHeight);this.grid.scrollContainer().igScroll("refresh");if(!$.ig.util.isSafari&&$.ig.util.getScrollWidth()===0&&this.grid.scrollContainer().data("igScroll")._vBarContainer){this.grid.scrollContainer().data("igScroll")._vBarContainer.css("z-index",2)}},_checkNotSupportedScenarios:function(){if(this.options.loadTrigger==="auto"&&!this.grid.options.height){throw new Error(this._getLocaleValue("appendRowsOnDemandRequiresHeight"))}if(this.grid.options.virtualization||this.grid.options.rowVirtualization||this.grid.options.columnVirtualization){throw new Error(this._getLocaleValue("virtualizationNotSupported"))}var i,featureName,features=this.grid.options.features,featuresLength=features.length;if(featuresLength===1){return}for(i=0;i<featuresLength;i++){featureName=features[i].name;if(!featureName){continue}featureName=featureName.toLowerCase();switch(featureName){case"groupby":throw new Error(this._getLocaleValue("groupByNotSupported"));case"paging":throw new Error(this._getLocaleValue("pagingNotSupported"));case"cellmerging":throw new Error(this._getLocaleValue("cellMergingNotSupported"))}}},_setOption:function(key,value){this._super(key,value);if(key==="defaultChunkIndex"){throw new Error(this._getLocaleValue("optionChangeNotSupported").replace("{optionName}",key))}if(key==="currentChunkIndex"||key==="chunkSize"){this._keepCurrentChunkIndex=true;this.grid.dataSource.settings.paging.pageSize=(this.options.currentChunkIndex+1)*this.options.chunkSize;this.grid.dataSource.dataBind()}},_registerWidget:$.noop,_unregisterWidget:$.noop,_initLoadingIndicator:function(){this._loadingIndicator=this.grid.container().igLoading().data("igLoading").indicator()},_nextChunk:function(){var noCancel=true;if(this.options.currentChunkIndex>=this.grid.dataSource.pageCount()-1){return}if(this._triggerEvents){noCancel=this._trigger(this.events.rowsRequesting,null,{owner:this,chunkIndex:this.options.currentChunkIndex+1,chunkSize:this.options.chunkSize})}if(noCancel){this._showLoading();this.grid.dataSource.settings.paging.pageSize=this.options.chunkSize;this.grid.dataSource.settings.paging.pageIndex=this.options.currentChunkIndex;this.grid.dataSource.settings.paging.appendPage=true;this._originalDataSourceCallback=this.grid.dataSource.settings.callback;this.grid.dataSource.settings.callback=this._appendRecordsHandler;this._requestPending=true;this.grid.dataSource.nextPage()}},_showLoading:function(){this._loadingIndicator.show()},_hideLoading:function(){this._loadingIndicator.hide()},destroy:function(){var buttonId=this.grid.id()+"_loadMoreButton",container=this.grid.options.height?this.grid.scrollContainer():this.grid.container(),button=container.find("div.ui-iggrid-loadmorebutton");this.grid.container().find("#"+buttonId).igButton("destroy");if(button){button.remove()}this.grid.element.unbind("iggridsortinginternalcolumnsorting",this._columnSortingHandler);this.grid.element.unbind("iggriduisoftdirty iggriduidirty",this._syncCurrentChunkIndexHandler);this.grid.scrollContainer().unbind("scroll",this._verticalScrollHandler);this.grid.scrollContainer().unbind("igscrollscrolling",this._verticalScrollHandler);if(this._onIgScrollRenderedHandler){this.grid.scrollContainer().unbind("igscrollrendered",this._onIgScrollRenderedHandler)}this._superApply(arguments);return this},_appendRecords:function(success,errmsg){var i,currentPage=[],noCancelError,sorting=this.grid.element.data("igGridSorting"),filtering=this.grid.element.data("igGridFiltering"),summaries=this.grid.element.data("igGridSummaries"),selection=this.grid.element.data("igGridSelection");if(success===true){currentPage=this.grid.dataSource.dataView().slice(this.grid.allRows().length-this.grid.pendingTransactions().length)}this._requestPending=false;this.grid.dataSource.settings.paging.pageIndex=0;this.grid.dataSource.settings.paging.appendPage=false;this.grid.dataSource.settings.callback=this._originalDataSourceCallback;for(i=0;i<currentPage.length;i++){if(selection){if(!this.grid.options.primaryKey&&selection.options.persist){selection._createUidForData()}}this.grid.renderNewRow(currentPage[i])}if(sorting){this._keepCurrentChunkIndex=true;if(this.options.type==="remote"&&this.grid.dataSource.settings.sorting.type==="local"){if(!this._persistLocalSorting){this.grid.dataSource.settings.sorting.expressions=[]}else{if(this.grid.dataSource.settings.sorting.expressions.length>0){this._callDataRendered=false;sorting.sortMultiple();this._callDataRendered=true}}}else{sorting._dataRendered()}this._keepCurrentChunkIndex=false}if(filtering){this._keepCurrentChunkIndex=true;if(this.options.type==="remote"&&this.grid.dataSource.settings.filtering.type==="local"){if(!this._persistLocalFiltering){this.grid.dataSource.settings.filtering.expressions=[]}this._callDataRendered=false;filtering.filter(this.grid.dataSource.settings.filtering.expressions,true);this._callDataRendered=true}this._keepCurrentChunkIndex=false}if(summaries){if(this.options.type==="remote"&&this.grid.dataSource.settings.summaries.type==="local"){if(this._recalcLocalSummaries){summaries.calculateSummaries()}}}if(this.grid.scrollContainer().data("igScroll")!==undefined){if(this.options.loadTrigger==="auto"){this.grid.scrollContainer().igScroll("refresh")}else{this._igScrollUpdateHeightWithButton()}}this._hideLoading();if(success===false){noCancelError=this._trigger(this.grid.events.requestError,null,{owner:this,message:errmsg});if(noCancelError){throw new Error(errmsg)}}this.options.currentChunkIndex++;this._keepCurrentChunkIndex=false;if(this._triggerEvents){this._trigger(this.events.rowsRequested,null,{owner:this,chunkIndex:this.options.currentChunkIndex,chunkSize:this.options.chunkSize,rows:currentPage})}this._triggerEvents=true;if(this._initialProbeForChunkIndex||this.options.type==="local"){this._probeForNextChunk()}},_probeForNextChunk:function(){if(this.options.loadTrigger!=="auto"){return}var delta,scrollTop;if(this.grid.scrollContainer().data("igScroll")!==undefined){scrollTop=this.grid.scrollContainer().igScroll("option","scrollTop")}else{scrollTop=this.grid.scrollContainer().scrollTop()}delta=Math.ceil(scrollTop+this.grid.scrollContainer().height())/$(this.grid.element).height();if(delta>=1&&!this._requestPending){this._nextChunk()}else{this._initialProbeForChunkIndex=false}},_columnSorting:function(){this.grid.dataSource.settings.paging.pageSize=this.options.chunkSize*(this.options.currentChunkIndex+1);this._keepCurrentChunkIndex=true},_hidingFinishing:function(){this._keepCurrentChunkIndex=true},_gridCommit:function(){this._keepCurrentChunkIndex=true;this.grid.dataSource._dataView=this.grid.dataSource.data().slice(0,(this.options.currentChunkIndex+1)*this.options.chunkSize)},_internalRowDeleted:function(){var record=this.grid.dataSource.data()[this.grid.dataSource.dataView().length];if(this.options.type==="remote"){return}if(record){this._pushRecordIntoView(record)}this.options.currentChunkIndex=Math.min(this.options.currentChunkIndex,Math.max(Math.ceil(this.grid.dataSource.data().length/this.options.chunkSize)-1,0))},_internalRowAdded:function(row){var updating=this.grid.element.data("igGridUpdating");if(this.grid.options.autoCommit===true){if(this.grid.dataSource.dataView().length>this.options.chunkSize&&this.grid.dataSource.dataView().length%this.options.chunkSize!==0){this.grid.dataSource.dataView().pop();row=updating._combineRowElements(row.row);row.remove()}}},_syncCurrentChunkIndex:function(){if(this.options.type==="remote"&&this.grid.dataSource.settings.filtering.type==="local"){return}if(!this._keepCurrentChunkIndex){if(this.grid.dataSource.settings.paging.pageIndex!==this.options.currentChunkIndex){this.options.currentChunkIndex=this.grid.dataSource.settings.paging.pageIndex}this._keepCurrentChunkIndex=true}},_pushRecordIntoView:function(record){this.grid.renderNewRow(record);this.grid.dataSource.dataView().push(record)},nextChunk:function(){this._triggerEvents=false;this._nextChunk()}});$.extend($.ui.igGridAppendRowsOnDemand,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI Grid Multi Headers 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 */
(function($){$.widget("ui.igGridMultiColumnHeaders",$.ui.igWidget,{localeWidgetName:"igGridMultiColumnHeaders",css:{multiHeaderCell:"ui-iggrid-multiheader-cell",expandedHeaderIndicator:"ui-iggrid-multiheader-expanded",collapsedHeaderIndicator:"ui-iggrid-multiheader-collapsed",collapsibleIndicatorContainer:"ui-iggrid-indicatorcontainer ui-iggrid-collapsibleindicatorcontainer"},options:{inherit:false},events:{groupCollapsing:"groupCollapsing",groupCollapsed:"groupCollapsed",groupExpanding:"groupExpanding",groupExpanded:"groupExpanded"},_createWidget:function(){$.Widget.prototype._createWidget.apply(this,arguments)},changeLocale:function(){var self=this;this.grid.container().find("[data-expanded-state]").each(function(){self._changeLocaleForElement($(this))})},_registerWidget:$.noop,_unregisterWidget:$.noop,_renderingMultiColumnHeader:function(){this._renderHeaderColumns(this.grid._headerParent);this.grid._trigger(this.grid.events.headerRendered,null,{owner:this.grid,table:this.grid.headersTable()});this.grid._headerRenderCancel=false},_analyzeRowspanRows:function(oldCols,level){var i,col,groups=[],ml=this.grid._maxLevel-level,rowspan;for(i=0;i<oldCols.length;i++){rowspan=1;col=oldCols[i];col.rowspan=col.rowspan||col.rowSpan;if($.type(col.rowspan)==="string"){col.rowspan=parseInt(col.rowspan,10)}if(col.rowspan>0){rowspan=col.rowspan}if(col.group!==undefined&&col.group!==null){groups.push({group:col.group,level:level+rowspan})}else{if(col.level===0){if(col.rowspan===null||col.rowspan===undefined||isNaN(col.rowspan)){if(ml+1-col.level>0){col.rowspan=ml+1-col.level}}}}if(this._rows[ml]===undefined||this._rows[ml]===null){this._rows[ml]=[]}this._rows[ml].push(col)}for(i=0;i<groups.length;i++){this._analyzeRowspanRows(groups[i].group,groups[i].level)}},_renderRow:function(headerContainer,row,level){var col,i,$headerCell,$tr=$('<tr data-mch-level="'+level+'" role="row"></tr>').appendTo(headerContainer);for(i=0;i<row.length;i++){col=row[i];$headerCell=this._createHeaderColumnMarkup(col);$headerCell.appendTo($tr)}},_renderHeaderColumns:function($container){var $th,i,j,k,oldCols,parents,key,headersTable,parentCol,mchElement,$col,cols=this.grid.options.columns,mchChildren,isToHide,colsLength=cols.length,initHiddenCols=this.grid._initialHiddenColumns,gridId=this.grid.id(),$thead;this._arrayTargetRowspan=[];this._totalColumnsLength=$container.find("colgroup col").length;$thead=$container.find("thead");if($thead.length>0){$container=$thead.empty().attr("role","rowgroup")}else{$container=$('<thead role="rowgroup"></thead>').appendTo($container)}this._tr={};oldCols=this.grid._oldCols;this._rows={};this._analyzeRowspanRows(oldCols,0);for(i=this.grid._maxLevel;i>=0;i--){if(this._rows[i]!==null&&this._rows[i]!==undefined){this._renderRow($container,this._rows[i],i)}}for(i=0;i<colsLength;i++){$th=this.grid.container().find("#"+gridId+"_"+cols[i].key).data("columnIndex",i);$th.data("data-mch-order",i);this.grid._headerCells.push($th)}if(initHiddenCols){headersTable=this.grid.headersTable().find("thead");for(i=0;i<initHiddenCols.length;i++){key=initHiddenCols[i].key;this.grid.container().find("#"+gridId+"_"+key).css("display","none");$col=this.grid.headersTable().find(">colgroup>col").eq(this.grid.getVisibleIndexByKey(key,true));$col.remove();parents=this.grid._getParentsMultiHeader(key);for(j=0;j<parents.length;j++){parentCol=parents[j];if(parentCol.level>0){mchElement=this.grid._getMultiHeaderColumnById(parentCol.identifier);if(mchElement&&mchElement.children){mchChildren=mchElement.children;isToHide=true;if(mchElement.hidden!==true){for(k=0;k<mchChildren.length;k++){if(mchChildren[k].level===0){$th=this.grid.container().find("#"+gridId+"_"+mchChildren[k].key)}else{$th=headersTable.find("th[data-mch-id="+mchChildren[k].identifier+"]")}if(!$th.is(":visible")){isToHide=false;break}}}if(isToHide){headersTable.find("th[data-mch-id="+parentCol.identifier+"]").css("display","none")}}}}}}},_createHeaderColumnMarkup:function(col){var grid=this.grid,id,isMultiColumnHeader=true,headerClass=grid.css.headerClass,customClass=col.headerCssClass||"",$th=$("<th></th>"),$headerCell,childIds="",i,length;if(col.group){length=col.group.length;for(i=0;i<length;i++){childIds+=this.grid.element[0].id+"_"+col.group[i].key+(i===length-1?"":" ")}}else if(col.headerText===undefined){col.headerText=col.key}this._renderCollapsibleHeaderIndicator($th,col);$headerCell=$th.append('<span class="'+grid.css.headerTextClass+'">'+col.headerText+"</span>").attr({role:"columnheader","aria-label":col.headerText,tabIndex:grid.options.tabIndex}).addClass(headerClass).addClass(customClass);if(col.colspan>1){$th.attr("colspan",col.colspan)}if(col.rowspan>1){$headerCell.attr("rowspan",col.rowspan)}if(col.key){$headerCell.attr("id",this.grid.element[0].id+"_"+col.key)}if(col.level===0){id=col.key;isMultiColumnHeader=false;$headerCell.attr("data-isheadercell",true)}else{id=col.identifier;$headerCell.addClass(this.css.multiHeaderCell);$headerCell.attr("data-mch-id",col.identifier);if(childIds){$headerCell.attr("aria-owns",childIds)}}grid._trigger(grid.events.headerCellRendered,null,{owner:grid,th:$headerCell,columnKey:id,isMultiColumnHeader:isMultiColumnHeader});return $headerCell},_renderCollapsibleHeaderIndicator:function($th,col){var $container,$anchor,$button,self=this,shouldExpand=false,title;if(col&&col.groupOptions&&col.groupOptions.allowGroupCollapsing===true){shouldExpand=col.groupOptions.expanded===true;$container=$("<div></div>").addClass(self.css.collapsibleIndicatorContainer);title=shouldExpand?this._getLocaleValue("expandedColumnIconTooltip"):this._getLocaleValue("collapsedColumnIconTooltip");$anchor=$("<a></a>").attr("href","#").attr({title:title,"data-expanded-state":shouldExpand,"data-localeid":shouldExpand?"expandedColumnIconTooltip":"collapsedColumnIconTooltip","data-localeattr":"title"}).attr("tabindex",0).on({keydown:function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){self._headerIndicatorClick(event)}}}).appendTo($container);$button=$("<span></span>").addClass(shouldExpand?this.css.expandedHeaderIndicator:this.css.collapsedHeaderIndicator).on({click:this._headerIndicatorClickHandler}).appendTo($anchor);$container.appendTo($th)}},expandGroup:function(groupKey,callback){this._setExpanded(groupKey,true,null,false,callback)},collapseGroup:function(groupKey,callback){this._setExpanded(groupKey,false,null,false,callback)},toggleGroup:function(groupKey,callback){this._setExpanded(groupKey,null,null,false,callback)},_setToggleButtonTooltip:function($button,expanded){var localeId=expanded?"expandedColumnIconTooltip":"collapsedColumnIconTooltip";$button.attr({title:this._getLocaleValue(localeId),"data-localeid":localeId,"data-expanded-state":expanded})},_setExpanded:function(groupKey,expanded,event,throwEvents,callback){var self=this,i,column,isExpanded,th,headerRows=self.grid.headersTable().find("thead > tr"),groupColumnsLength,noCancel,totalMchWidth=0,isFixedHeader=false,cw=this.grid.container().width(),fixing=this.grid.element.data("igGridColumnFixing");column=self.grid._getMultiHeaderColumnById(groupKey);if(!column||!column.groupOptions||column.groupOptions.allowGroupCollapsing===false||!column.group){return}isExpanded=column.groupOptions.expanded===true;if(isExpanded===expanded){return}if(this.grid.hasFixedColumns()){isFixedHeader=this.grid.fixedTable().find("th[data-mch-id='"+groupKey+"']").length?true:false;for(i=0;i<column.group.length;i++){totalMchWidth+=parseInt(column.group[i].width,10)}if(isFixedHeader){if(totalMchWidth>cw-fixing.options.minimalVisibleAreaWidth){throw new Error(this._getLocaleValue("cannotExpandMultiColumnHeader"))}}}if(expanded!==true&&expanded!==false){expanded=!isExpanded}th=headerRows.find("th[data-mch-id="+groupKey+"]");if(throwEvents===true){noCancel=self._trigger(expanded?self.events.groupExpanding:self.events.groupCollapsing,event,{owner:self,column:column,element:th});if(noCancel===false){return}}groupColumnsLength=column.group.length;self.grid._loadingIndicator.show();setTimeout(function(){column.groupOptions.expanded=!column.groupOptions.expanded;for(i=0;i<groupColumnsLength;i++){self._refreshMultiColumnHierarchyVisibility(column.group[i],column)}if(column.groupOptions.expanded){th.find("."+self.css.collapsedHeaderIndicator).removeClass(self.css.collapsedHeaderIndicator).addClass(self.css.expandedHeaderIndicator);self._setToggleButtonTooltip(th.find("[data-expanded-state]"),true)}else{th.find("."+self.css.expandedHeaderIndicator).removeClass(self.css.expandedHeaderIndicator).addClass(self.css.collapsedHeaderIndicator);self._setToggleButtonTooltip(th.find("[data-expanded-state]"),false)}self._updateHiddenColumns();if(throwEvents===true){self._trigger(column.groupOptions.expanded?self.events.groupExpanded:self.events.groupCollapsed,event,{owner:self,column:column,element:th})}self.grid._loadingIndicator.hide();if(callback){$.ig.util.invokeCallback(callback)}},0)},_headerIndicatorClick:function(event){var target=$(event.target),columnId=target.closest("th").attr("data-mch-id");this._setExpanded(columnId,null,event,true);event.preventDefault();event.stopPropagation()},_refreshMultiColumnHierarchyVisibility:function(col,parentCol){var i,parentAlowsGroupCollapsing=false,parentColExpanded=false,shouldHide=false;if(parentCol){parentAlowsGroupCollapsing=parentCol.groupOptions&&parentCol.groupOptions.allowGroupCollapsing===true;if(parentCol.groupOptions&&parentCol.groupOptions.expanded===false){parentColExpanded=false}else{parentColExpanded=true}}shouldHide=col.groupOptions&&(parentColExpanded===true&&(col.groupOptions.hidden==="always"||col.groupOptions.hidden==="parentexpanded")||parentColExpanded===false&&(col.groupOptions.hidden==="always"||col.groupOptions.hidden==="parentcollapsed"));if(parentCol&&parentAlowsGroupCollapsing&&shouldHide){if(col.group){for(i=0;i<col.children.length;i++){if(!col.children[i].hidden){this._colsToHide.push(col.children[i])}}}else{if(!col.hidden){this._colsToHide.push(col)}}}else{if(col.group){for(i=0;i<col.group.length;i++){this._refreshMultiColumnHierarchyVisibility(col.group[i],col)}}else{if(parentAlowsGroupCollapsing&&col.hidden){this._colsToShow.push(col)}}}},_validateGroup:function(col){var i,colsCountWhenExpanded,colsCountWhenCollapsed;if(!col.group){return}if(col.groupOptions&&col.groupOptions.allowGroupCollapsing===true){colsCountWhenExpanded=colsCountWhenCollapsed=0;for(i=0;i<col.group.length;i++){if(!col.group[i].groupOptions||col.group[i].groupOptions.hidden!=="always"&&col.group[i].groupOptions.hidden!=="parentexpanded"){colsCountWhenExpanded++}if(!col.group[i].groupOptions||col.group[i].groupOptions.hidden!=="always"&&col.group[i].groupOptions.hidden!=="parentcollapsed"){colsCountWhenCollapsed++}}if(colsCountWhenCollapsed===0||colsCountWhenExpanded===0){throw new Error(this._getLocaleValue("atLeastOneColumnShouldBeShownWhenCollapseOrExpand"))}}for(i=0;i<col.group.length;i++){this._validateGroup(col.group[i],col)}},_updateHiddenColumns:function(){this.grid._setHiddenColumns(this._colsToHide,true,false);this.grid._setHiddenColumns(this._colsToShow,false,false);this._colsToHide=[];this._colsToShow=[]},_gridRendered:function(){var i;if(!this.grid._oldCols){return}for(i=0;i<this.grid._oldCols.length;i++){this._validateGroup(this.grid._oldCols[i])}for(i=0;i<this.grid._oldCols.length;i++){this._refreshMultiColumnHierarchyVisibility(this.grid._oldCols[i],null)}this._updateHiddenColumns()},getMultiColumnHeaders:function(){return this.grid._oldCols},_createHandlers:function(){this._headerIndicatorClickHandler=$.proxy(this._headerIndicatorClick,this)},_injectGrid:function(gridInstance){this.grid=gridInstance;this._createHandlers();this._colsToHide=this._colsToHide||[];this._colsToShow=this._colsToShow||[];if(this.grid.options.virtualizationMode!=="continuous"&&(this.grid.options.virtualization===true&&this.grid.options.width||this.grid.options.columnVirtualization===true)){throw new Error(this._getLocaleValue("multiColumnHeadersNotSupportedWithColumnVirtualization"))}},destroy:function(){var collapsibleHeaderIcons=this.grid.headersTable().find("div."+this.css.collapsibleIndicatorContainer.split(" ").join("."));if(collapsibleHeaderIcons.length>0){collapsibleHeaderIcons.find("> a").off("keydown").find("> span").off("click");collapsibleHeaderIcons.remove()}this._superApply(arguments);return this}});$.extend($.ui.igGridMultiColumnHeaders,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI Grid Paging 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.editors.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 */
(function($){$.widget("ui.igGridPaging",$.ui.igWidget,{css:{pagerClass:"ui-widget ui-iggrid-pager ui-helper-clearfix ui-corner-bottom ui-widget-header ui-iggrid-footer",pageLink:"ui-iggrid-pagelink ui-helper-reset",page:"ui-iggrid-page ui-state-default ui-corner-all",pageHover:"ui-iggrid-page-hover ui-state-hover",pageList:"ui-helper-reset ui-iggrid-pagelist ui-iggrid-paging-item",pageLinkCurrent:"ui-iggrid-pagelinkcurrent",pageCurrent:"ui-iggrid-pagecurrent ui-state-active ui-corner-all",pageFocused:"ui-iggrid-pagefocused ui-state-focus",nextPage:"ui-iggrid-nextpage ui-iggrid-paging-item ui-state-default",prevPage:"ui-iggrid-prevpage ui-iggrid-paging-item ui-state-default",firstPage:"ui-iggrid-firstpage ui-iggrid-paging-item ui-state-default ui-corner-left",lastPage:"ui-iggrid-lastpage ui-iggrid-paging-item ui-state-default ui-corner-right",nextPageLabel:"ui-iggrid-nextpagelabel",prevPageLabel:"ui-iggrid-prevpagelabel",firstPageLabel:"ui-iggrid-firstpagelabel",lastPageLabel:"ui-iggrid-lastpagelabel",nextPageLabelDisabled:"ui-iggrid-nextpagelabeldisabled ui-state-disabled",prevPageLabelDisabled:"ui-iggrid-prevpagelabeldisabled ui-state-disabled",firstPageLabelDisabled:"ui-iggrid-firstpagelabeldisabled ui-state-disabled",lastPageLabelDisabled:"ui-iggrid-lastpagelabeldisabled ui-state-disabled",nextPageImage:"ui-iggrid-pageimg ui-iggrid-nextpageimg ui-icon ui-icon-triangle-1-e",prevPageImage:"ui-iggrid-pageimg ui-iggrid-prevpageimg ui-icon ui-icon-triangle-1-w",firstPageImage:"ui-iggrid-pageimg ui-iggrid-firstpageimg ui-icon ui-icon-arrowstop-1-w",lastPageImage:"ui-iggrid-pageimg ui-iggrid-lastpageimg ui-icon ui-icon-arrowstop-1-e",nextPageImageDisabled:"ui-iggrid-pageimg ui-iggrid-nextpageimgdisabled ui-icon ui-state-disabled ui-icon-triangle-1-e",prevPageImageDisabled:"ui-iggrid-pageimg ui-iggrid-prevpageimgdisabled ui-icon ui-state-disabled ui-icon-triangle-1-w",firstPageImageDisabled:"ui-iggrid-pageimg ui-iggrid-firstpageimgdisabled ui-icon ui-state-disabled ui-icon-arrowstop-1-w",lastPageImageDisabled:"ui-iggrid-pageimg ui-iggrid-lastpageimgdisabled ui-icon ui-state-disabled ui-icon-arrowstop-1-e",pagerRecordsLabel:"ui-iggrid-pagerrecordslabel ui-iggrid-results",pageSizeLabel:"ui-iggrid-pagesizelabel",pageSizeDropDown:"ui-iggrid-pagesizedropdown",pageSizeDropDownContainer:"ui-helper-clearfix ui-iggrid-pagesizedropdowncontainer",pageSizeDropDownContainerAbove:"ui-widget ui-helper-clearfix ui-iggrid-pagesizedropdowncontainerabove ui-iggrid-toolbar ui-widget-header and ui-corner-top",pageDropDownContainer:"ui-iggrid-pagedropdowncontainer",pageDropDownLabels:"ui-iggrid-pagedropdownlabels",pageDropDown:"ui-iggrid-pagedropdown",pagerRightAreaContainer:"ui-iggrid-paging",pagingResults:"ui-iggrid-results"},options:{pageSize:25,recordCountKey:null,pageSizeUrlKey:null,pageIndexUrlKey:null,currentPageIndex:0,type:null,showPageSizeDropDown:true,pageSizeDropDownLabel:undefined,pageSizeDropDownTrailingLabel:undefined,pagerRecordsLabelTemplate:undefined,nextPageLabelText:undefined,prevPageLabelText:undefined,firstPageLabelText:undefined,lastPageLabelText:undefined,currentPageDropDownLeadingLabel:undefined,currentPageDropDownTrailingLabel:undefined,currentPageDropDownTooltip:undefined,pageSizeDropDownTooltip:undefined,pagerRecordsLabelTooltip:undefined,prevPageTooltip:undefined,nextPageTooltip:undefined,firstPageTooltip:undefined,lastPageTooltip:undefined,pageTooltipFormat:undefined,locale:{pageSizeDropDownLabel:undefined,pageSizeDropDownTrailingLabel:undefined,nextPageLabelText:undefined,prevPageLabelText:undefined,firstPageLabelText:undefined,lastPageLabelText:undefined,currentPageDropDownLeadingLabel:undefined,currentPageDropDownTrailingLabel:undefined,currentPageDropDownTooltip:undefined,pageSizeDropDownTooltip:undefined,pagerRecordsLabelTooltip:undefined,prevPageTooltip:undefined,nextPageTooltip:undefined,firstPageTooltip:undefined,lastPageTooltip:undefined,pageTooltipFormat:undefined,pagerRecordsLabelTemplate:undefined},pageSizeDropDownLocation:"above",showPagerRecordsLabel:true,showFirstLastPages:true,showPrevNextPages:true,pageSizeList:[5,10,20,25,50,75,100],pageCountLimit:10,visiblePageCount:5,defaultDropDownWidth:70,delayOnPageChanged:350,persist:true,inherit:false},events:{pageIndexChanging:"pageIndexChanging",pageIndexChanged:"pageIndexChanged",pageSizeChanging:"pageSizeChanging",pageSizeChanged:"pageSizeChanged",pagerRendering:"pagerRendering",pagerRendered:"pagerRendered"},dropDownVisibleItemsCount:10,_loadingIndicator:null,_isPaging:false,_onVirtRecordsRender:function(){this._dataRendered()},_create:function(){this._oPageIndex=this.options.currentPageIndex;this._oPageSize=this.options.pageSize},changeGlobalLanguage:function(){},changeGlobalRegional:function(){},_changeLocaleForPager:function(){var $pager=this._pager(),$e,self=this,$plabel=this._plabel(),$container=this.grid.container(),gridId=this.grid.id();$.ui.igWidget.prototype.changeLocale.call(this,$pager);$pager.find("[data-page-list-item]").each(function(){var $e=$(this);$e.attr("title",self._getLocaleValue("pageTooltipFormat").replace("${index}",$e.attr("data-pageTooltipFormat")))});$e=$container.find("[data-dd-container-label='"+gridId+"']");if($e.length){$e.text(this._getLocaleValue("currentPageDropDownTrailingLabel").replace("${count}",$e.attr("data-currentPageDropDownTrailingLabel")))}if($plabel.length){$plabel.text(this._getLocaleValue("pagerRecordsLabelTemplate").replace("${startRecord}",$plabel.attr("data-startRecord")).replace("${endRecord}",$plabel.attr("data-endRecord")).replace("${recordCount}",$plabel.attr("data-recordCount")))}},changeLocale:function(){this._changeLocaleForPager();this._super(this.grid.container().find("[data-pagesize-dd-container='"+this.grid.id()+"']"));this._superApply(arguments)},_registerWidget:$.noop,_unregisterWidget:$.noop,_setOption:function(key,value){var items,pager;pager=this._pager();this._super(key,value);if(key==="type"||key==="showPageSizeDropDown"||key==="pageSizeDropDownLocation"||key==="showPagerRecordsLabel"||key==="visiblePageCount"){throw new Error(this._getLocaleValue("optionChangeNotSupported").replace("{optionName}",key))}if(key==="pageSize"){this.pageSize(value)}else if(key==="currentPageIndex"){this.pageIndex(value)}else if(key==="showFirstLastPages"){if(value===true){pager.find(".ui-iggrid-firstpage").show();pager.find(".ui-iggrid-lastpage").show()}else{pager.find(".ui-iggrid-firstpage").hide();pager.find(".ui-iggrid-lastpage").hide()}}else if(key==="showPrevNextPages"){if(value===true){pager.find(".ui-iggrid-prevpage").show();pager.find(".ui-iggrid-nextpage").show()}else{pager.find(".ui-iggrid-prevpage").hide();pager.find(".ui-iggrid-nextpage").hide()}}else if(key==="pageSizeList"){if($.type(value)==="string"){items=value.split(",")}else{items=value}if(this._pageSizeDD){this._pageSizeDD.igNumericEditor("option","listItems",items)}}},pageIndex:function(index){if(index!==null&&index!==undefined){if(index<0||index>=this.grid.dataSource.pageCount()){throw new Error(this._getLocaleValue("invalidPageIndex"))}this._overrideLabel=true;this.options.currentPageIndex=index;this.grid.element.trigger("iggriduisoftdirty",{owner:this})}if(this.grid._hasUnboundColumns&&this.options.type==="remote"){this.grid._rebindUnboundColumns=true}this._savePagingData();return this.grid.dataSource.pageIndex(index)},pageSize:function(size){var noCancel=true;if(size){this.grid.dataSource.settings.paging.pageIndex=0;this.options.currentPageIndex=0;noCancel=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid,dataSource:this.grid.dataSource});if(noCancel){this._showLoading();if(this.grid._hasUnboundColumns&&this.options.type==="remote"){this.grid._rebindUnboundColumns=true}this._overrideLabel=true;this.options.pageSize=size;this._savePagingData();this.grid.dataSource.pageSize(size)}if(this._pageSizeDD){this._pageSizeDD.igNumericEditor("value",size)}}else{return this.grid.dataSource.pageSize()}},_savePagingData:function(){if(!this.options.persist){return}var pagingData;if(this.element.closest(".ui-iggrid-root").data("igGrid")){pagingData={pageIndex:this.options.currentPageIndex,pageSize:this.options.pageSize};this.grid._savePersistenceData(pagingData,"paging",this.grid.element[0].id)}},_loadPagingData:function(){var pagingData;if(this.element.closest(".ui-iggrid-root").data("igGrid")){pagingData=this.grid._getPersistenceData("paging",this.grid.element[0].id);if(!pagingData){return}this.grid.dataSource.settings.paging.pageIndex=pagingData.pageIndex;this.options.currentPageIndex=pagingData.pageIndex;this.options.pageSize=pagingData.pageSize}},_initLoadingIndicator:function(){this._loadingIndicator=this.grid.container().igLoading().data("igLoading").indicator()},_nextPage:function(event){var noCancel=true,noCancelBinding=true;noCancel=this._trigger(this.events.pageIndexChanging,null,{newPageIndex:this.options.currentPageIndex+1,currentPageIndex:this.options.currentPageIndex,owner:this});if(noCancel){if(this.options.currentPageIndex>=this.grid.dataSource.pageCount()-1){return}this.options.currentPageIndex=this.options.currentPageIndex+1;noCancelBinding=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid,dataSource:this.grid.dataSource});this._shouldFirePageIndexChanged=true;if(noCancelBinding){this._showLoading();this._overrideLabel=true;this.grid.element.trigger("iggriduisoftdirty",{owner:this});if(this.grid._hasUnboundColumns&&this.options.type==="remote"){this.grid._rebindUnboundColumns=true}this._savePagingData();this.grid.dataSource.nextPage()}}if(event){event.stopPropagation();event.preventDefault()}},_prevPage:function(event){var noCancel=true,noCancelBinding=true;noCancel=this._trigger(this.events.pageIndexChanging,null,{newPageIndex:this.options.currentPageIndex-1,currentPageIndex:this.options.currentPageIndex,owner:this});if(noCancel){if(this.options.currentPageIndex===0){return}this.options.currentPageIndex=this.options.currentPageIndex-1;noCancelBinding=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid,dataSource:this.grid.dataSource});this._shouldFirePageIndexChanged=true;if(noCancelBinding){this._showLoading();this._overrideLabel=true;this.grid.element.trigger("iggriduisoftdirty",{owner:this});if(this.grid._hasUnboundColumns&&this.options.type==="remote"){this.grid._rebindUnboundColumns=true}this._savePagingData();this.grid.dataSource.prevPage()}}if(event){event.stopPropagation();event.preventDefault()}},_firstPage:function(event){var noCancel=true,noCancelBinding=true;noCancel=this._trigger(this.events.pageIndexChanging,null,{newPageIndex:0,currentPageIndex:this.options.currentPageIndex,owner:this});if(noCancel){noCancelBinding=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid,dataSource:this.grid.dataSource});this._shouldFirePageIndexChanged=true;if(noCancelBinding){this._showLoading();this.pageIndex(0)}}if(event){event.stopPropagation();event.preventDefault()}},_lastPage:function(event){var noCancel=true,noCancelBinding=true;noCancel=this._trigger(this.events.pageIndexChanging,null,{newPageIndex:this.grid.dataSource.pageCount()-1,currentPageIndex:this.options.currentPageIndex,owner:this});if(noCancel){noCancelBinding=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid,dataSource:this.grid.dataSource});this._shouldFirePageIndexChanged=true;if(noCancelBinding){this._showLoading();this.pageIndex(this.grid.dataSource.pageCount()-1)}}if(event){event.stopPropagation();event.preventDefault()}},_showLoading:function(){this._loadingIndicator.show()},_hideLoading:function(){this._loadingIndicator.hide()},_bindEvents:function(){var paging=this,grid=this.grid,noCancel=true,id,noCancelBinding=true;id="#"+grid.element[0].id+"_pager";$(id+" li").bind({mousedown:function(event){var $eventTarget=$(event.target),newIndex=$eventTarget.data("pageIndex");if(newIndex===undefined){newIndex=$eventTarget.parent().data("pageIndex")}if($.type(newIndex)==="number"&&newIndex!==paging.options.currentPageIndex){noCancel=paging._trigger(paging.events.pageIndexChanging,event,{newPageIndex:newIndex,currentPageIndex:paging.options.currentPageIndex,owner:paging});paging._shouldFirePageIndexChanged=true;if(noCancel){noCancelBinding=paging.grid._trigger(paging.grid.events.dataBinding,null,{owner:paging.grid,dataSource:paging.grid.dataSource});if(noCancelBinding){paging._showLoading(grid.element.children("tbody"));paging.pageIndex(newIndex)}}}}});$(id+" li, "+id+" div.ui-iggrid-paging-item").bind({mouseover:function(event){if(!$(event.currentTarget).find("span").first().hasClass("ui-state-disabled")){$(event.currentTarget).addClass(paging.css.pageHover)}},mouseout:function(event){$(event.currentTarget).removeClass(paging.css.pageHover)}})},_fixedColumnsChanged:function(args){if(args.isInit){this._pager().css("clear","both")}},_gridRendered:function(gridContainer){var self=this,caption=this.grid._caption();if(this.options.showPageSizeDropDown===true&&this.options.pageSizeDropDownLocation==="above"&&!this._pageSizeDropDownRendered){if(caption.length){self._renderPageSizeDropDown(caption,null,true)}else{self._renderPageSizeDropDown(gridContainer,true)}}if(this.grid.options.autoAdjustHeight){this.grid._initializeHeights();this.grid._adjustLastColumnWidth()}if(this.grid.options.caption!==null&&!($.ig.util.isIE&&$.ig.util.browserVersion>=8)){caption.removeClass("ui-corner-top")}},_rowDeleted:function(){if(this.options.type==="remote"){return}var currentPageIndex=this.options.currentPageIndex,pageCount=this.grid.dataSource.pageCount();if(currentPageIndex>0&&currentPageIndex+1>pageCount){currentPageIndex--}this.pageIndex(currentPageIndex)},_rowAdded:function(){if(this.options.type==="remote"){return}var currentPageIndex=this.options.currentPageIndex,pageCount=this.grid.dataSource.pageCount();if(currentPageIndex<pageCount-1&&this.grid.options.autoCommit){this.pageIndex(pageCount-1)}else{this._dataRendered()}},_gridCommit:function(){if(this.options.type==="remote"){return}if(this.options.currentPageIndex>this.grid.dataSource.pageCount()-1){this.pageIndex(this.grid.dataSource.pageCount()-1)}else{this.pageIndex(this.options.currentPageIndex)}return true},_plabel:function(){return this._pager().find(".ui-iggrid-pagerrecordslabel")},_pager:function(){return this.grid.container().find(".ui-iggrid-pager")},_getDSLocalRecordsCount:function(){var ds=this.grid.dataSource;if(ds._filter){if(ds.isGroupByApplied()&&ds.settings.groupby.pagingMode==="allRecords"){return ds.totalLocalRecordsCount()}return ds._filteredData.length}return ds.totalLocalRecordsCount()},_dataRendered:function(){var id=this.grid.element[0].id,filtering,tmpl,kbrdNavEvents,edtrOpts,i,html,pager=null,pageList,pagesArray,dropDownContainer,pageCount,startRecord=0,endRecord=0,recordsCount=0,localRecordsCount=0,noCancel=true,startPageIndex=0,endPageIndex=0,pagerHtml=toStaticHTML('<div id="'+id+'_pager"></div>'),pageLinkHtml=toStaticHTML('<li class="${pageClass}" tabIndex="0">'+'<a class="${pageLinkClass}" href="javascript:void(0);" '+'tabIndex="-1">${page}</a></li>'),template=this._getLocaleValue("pagerRecordsLabelTemplate"),self=this,pagerRight=null,vpc=this.options.visiblePageCount,val=0,recordsLabel=null;this._deleteOld();this._initLoadingIndicator();noCancel=this._trigger(this.events.pagerRendering,null,{dataSource:this.grid.dataSource,owner:this});if(noCancel){if(this.grid._shouldResetPaging){this.options.currentPageIndex=0;this.grid._shouldResetPaging=false}if(this._plabel().length>0){this._pager().find(".ui-iggrid-paging").remove()}else{this._pager().empty()}if(this.grid.dataSource.pageSizeDirty()){this.options.currentPageIndex=this.grid.dataSource.pageIndex();this.grid.dataSource.pageSizeDirty(false)}if(this._pager().length===0){id=this.grid.element[0].id;pager=$(pagerHtml).appendTo(this.grid.container())}else{pager=this._pager()}if(this.grid.hasFixedColumns()){pager.css("clear","both")}pager.addClass(this.css.pagerClass);if(this.options.showPagerRecordsLabel){recordsCount=this.grid.dataSource.totalRecordsCount()>0?this.grid.dataSource.totalRecordsCount():this.grid.dataSource.totalLocalRecordsCount();startRecord=this.options.currentPageIndex===0?1:this.options.currentPageIndex*this.pageSize()+1;localRecordsCount=this._getDSLocalRecordsCount();if(this.grid.dataSource._filter){recordsCount=localRecordsCount;filtering=this.grid.element.data("igTreeGridFiltering");if(filtering){tmpl=filtering._getFilterSummaryPagerTemplate();if(tmpl!==undefined&&tmpl!==null){template=tmpl}}}if(startRecord>recordsCount){startRecord=this.grid.dataSource.pageIndex()*this.pageSize()+1;this.options.currentPageIndex=this.grid.dataSource.pageIndex()}endRecord=this.options.currentPageIndex===0&&this.pageSize()<=recordsCount?this.pageSize():startRecord+this.pageSize()>recordsCount?recordsCount:startRecord-1+this.pageSize();if(this.grid.dataSource.totalLocalRecordsCount()===0){startRecord=0;endRecord=0}if(endRecord>localRecordsCount&&this.options.type==="local"){endRecord=localRecordsCount}if(this.grid.container().find(".ui-iggrid-footer .ui-iggrid-results").data("overrideLabel")===0||this._overrideLabel||!this.grid.dataSource._filter){this._plabel().remove();template=template.replace("${startRecord}",startRecord).replace("${endRecord}",endRecord).replace("${recordCount}",recordsCount);recordsLabel=$("<span>"+template+"</span>").appendTo(pager).attr({id:pager[0].id+"_label",title:this._getLocaleValue("pagerRecordsLabelTooltip"),"data-localeid":"pagerRecordsLabelTooltip","data-localeattr":"title","data-startRecord":startRecord,"data-endRecord":endRecord,"data-recordCount":recordsCount}).addClass(this.css.pagerRecordsLabel).show()}else if(this._plabel().length===0){recordsLabel=$("<span></span>").appendTo(pager).attr("id",pager[0].id+"_label").addClass(this.css.pagerRecordsLabel).attr({title:this._getLocaleValue("pagerRecordsLabelTooltip"),"data-localeid":"pagerRecordsLabelTooltip","data-localeattr":"title"}).show()}if(recordsLabel){recordsLabel.data("hideflag",false)}this._plabel().show();this._overrideLabel=false}pageCount=this.grid.dataSource.pageCount();pagerRight=$("<div></div>").appendTo(pager).addClass(this.css.pagerRightAreaContainer);if(this.options.showFirstLastPages===true){this._renderFirstPage(pagerRight)}if(this.options.showPrevNextPages===true){this._renderPrevPage(pagerRight)}if(this.grid.dataSource.pageCount()<=this.options.pageCountLimit){pageList=$("<ul></ul>").appendTo(pagerRight).addClass(this.css.pageList);if(!this._pagerEvents){this._pagerEvents={keydown:function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){var noCancel=true,noCancelBinding=true,newIndex=$(event.currentTarget).closest("li").data("pageIndex");if(newIndex!==self.options.currentPageIndex){noCancel=self._trigger(self.events.pageIndexChanging,null,{newPageIndex:newIndex,currentPageIndex:self.options.currentPageIndex,owner:self});self._shouldFirePageIndexChanged=true;if(noCancel){noCancelBinding=self.grid._trigger(self.grid.events.dataBinding,null,{owner:self.grid,dataSource:self.grid.dataSource});if(noCancelBinding){self._showLoading();self.pageIndex(newIndex)}}}event.stopPropagation();event.preventDefault()}},focus:function(event){$(event.currentTarget).closest("li").addClass(self.css.pageFocused)},blur:function(event){$(event.currentTarget).closest("li").removeClass(self.css.pageFocused)}}}else{this._pager().undelegate("li",this._pagerEvents)}this._pager().delegate("li",this._pagerEvents);val=Math.floor(parseInt(vpc,10)/2);startPageIndex=this.options.currentPageIndex-val;if(startPageIndex<0){startPageIndex=0}endPageIndex=this.options.currentPageIndex+val;if(this.options.currentPageIndex-startPageIndex<val){endPageIndex+=val-(this.options.currentPageIndex-startPageIndex)}if(this.grid.dataSource.pageCount()-(this.options.currentPageIndex+1)<val&&vpc%2!==0){startPageIndex=startPageIndex-(val-(this.grid.dataSource.pageCount()-(this.options.currentPageIndex+1)))}if(endPageIndex>=this.grid.dataSource.pageCount()){endPageIndex=this.grid.dataSource.pageCount()-1}if(startPageIndex<0){startPageIndex=0}if(vpc%2===0&&endPageIndex-startPageIndex<vpc-1){startPageIndex-=vpc-1-(endPageIndex-startPageIndex)}if(startPageIndex<0){startPageIndex=0}for(i=startPageIndex;i<=endPageIndex&&i-startPageIndex<vpc;i++){html=pageLinkHtml.replace("${page}",i+1).replace("${pageLinkClass}",i===this.options.currentPageIndex?this.css.pageLinkCurrent:this.css.pageLink);html=html.replace("${pageClass}",i===this.options.currentPageIndex?this.css.pageCurrent:this.css.page);$(html).appendTo(pageList).attr({"data-page-list-item":true,title:this._getLocaleValue("pageTooltipFormat").replace("${index}",i+1),"data-pageTooltipFormat":i+1}).data("pageIndex",i)}}else{pagesArray=[];for(i=1;i<=pageCount;i++){pagesArray.push(i.toString())}dropDownContainer=$("<div></div>").appendTo(pagerRight).addClass(this.css.pageDropDownContainer).attr({title:this._getLocaleValue("currentPageDropDownTooltip"),"data-localeid":"currentPageDropDownTooltip","data-localeattr":"title"});$("<span></span>").appendTo(dropDownContainer).text(this._getLocaleValue("currentPageDropDownLeadingLabel")).attr("data-localeid","currentPageDropDownLeadingLabel").addClass(this.css.pageDropDownLabels);kbrdNavEvents=this._getEditorKeyboardNavigation();edtrOpts={language:this.grid.options.language,listItems:pagesArray,dropDownAttachedToBody:true,visibleItemsCount:this.dropDownVisibleItemsCount,suppressNotifications:true,isLimitedToListValues:true,width:this.options.defaultDropDownWidth,allowNullValue:false,buttonType:"dropdown",value:this.options.currentPageIndex+1,minValue:1,maxValue:pagesArray[pagesArray.length-1],dropDownListOpened:$.proxy(this._onSelectDropDownOpened,this),textChanged:$.proxy(this._onSelectDropDownPageIndex,this)};edtrOpts=$.extend(edtrOpts,kbrdNavEvents);this._curPageDD=$("<span />").appendTo(dropDownContainer).addClass(this.css.pageDropDownContainer).igNumericEditor(edtrOpts);this._curPageDD.igNumericEditor("selectedListIndex",this.options.currentPageIndex);$("<span></span>").appendTo(dropDownContainer).attr({"data-dd-container-label":id,"data-currentPageDropDownTrailingLabel":this.grid.dataSource.pageCount()}).text(this._getLocaleValue("currentPageDropDownTrailingLabel").replace("${count}",this.grid.dataSource.pageCount())).addClass(this.css.pageDropDownLabels)}if(this.options.showPrevNextPages===true){this._renderNextPage(pagerRight)}if(this.options.showFirstLastPages===true){this._renderLastPage(pagerRight)}if(this.options.showPageSizeDropDown&&this.options.pageSizeDropDownLocation==="inpager"){this._renderPageSizeDropDown(pagerRight)}this._bindEvents(pager);this._hideLoading(this.grid.element.children("tbody"));pager.show();if(this._shouldFirePageSizeChanged){this._shouldFirePageSizeChanged=false;this._trigger(this.events.pageSizeChanged,null,{pageSize:this.pageSize(),owner:this})}this._trigger(this.events.pagerRendered,null,{dataSource:this.grid.dataSource,owner:this});if(this._shouldFirePageIndexChanged){this._shouldFirePageIndexChanged=false;this._trigger(this.events.pageIndexChanged,null,{pageIndex:this.options.currentPageIndex,owner:this})}}},_getEditorKeyboardNavigation:function(){return{focus:function(e,args){var edtr=args.owner;if(edtr._dropDownList&&!edtr._dropDownList.is(":visible")){edtr.showDropDown()}},keydown:function(e,args){var edtr=args.owner,$activeItem;if(edtr._dropDownList&&edtr._dropDownList.is(":visible")){if(e.keyCode===$.ui.keyCode.DOWN){edtr._hoverNextDropDownListItem();e.preventDefault()}else if(e.keyCode===$.ui.keyCode.UP){edtr._hoverPreviousDropDownListItem();e.preventDefault()}else if(e.keyCode===$.ui.keyCode.ENTER){$activeItem=edtr._dropDownList.children(".ui-igedit-listitem").filter('[data-active="true"]');if($activeItem.length&&$activeItem.is(edtr.getSelectedListItem())&&$activeItem.text()!==edtr.field().val()){edtr.selectedListIndex(parseInt(edtr.field().val())-1);e.preventDefault()}}}}}},_onSelectDropDownOpened:function(event,args){var dd=args.owner,$ddCont=dd.dropDownContainer(),$selItem=dd.getSelectedListItem();if(!$selItem.length){return}$ddCont.scrollTop($selItem.igPosition().top-(this.dropDownVisibleItemsCount-1)*$selItem.outerHeight())},_onSelectDropDownPageIndex:function(event,args){var self=this;if(this._timeoutId!==undefined){clearTimeout(this._timeoutId)}if(parseInt(this.options.delayOnPageChanged,10)===0||event&&event.originalEvent&&event.originalEvent.type!=="keypress"){this._dropDownPageIndex(event,args)}else{this._timeoutId=setTimeout(function(){self._dropDownPageIndex(event,args)},this.options.delayOnPageChanged)}},_dropDownPageIndex:function(event,args){var noCancel=true,noCancelBinding=true,parsedString,editor=args.owner,val=args.text,pageInd=parseInt(val,10),mapping={"\uff11":"1","\uff12":"2","\uff13":"3","\uff14":"4","\uff15":"5","\uff16":"6","\uff17":"7","\uff18":"8","\uff19":"9","\uff10":"0"};if(val===""){return}if(isNaN(pageInd)){parsedString=val;$.each(mapping,function(jpVal,engVal){parsedString=parsedString.replace(new RegExp(jpVal,"g"),engVal)});pageInd=parseInt(parsedString,10);if(isNaN(pageInd)){editor.value(this.options.currentPageIndex+1);return}}if(pageInd<=0||pageInd>this.grid.dataSource.pageCount()){editor.hideDropDown();editor.value(this.options.currentPageIndex+1);return}if(pageInd-1===this.options.currentPageIndex){editor.hideDropDown();return}noCancel=this._trigger(this.events.pageIndexChanging,null,{newPageIndex:pageInd-1,currentPageIndex:this.options.currentPageIndex,owner:this});if(noCancel){noCancelBinding=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid,dataSource:this.grid.dataSource});if(noCancelBinding){editor.selectedListIndex(pageInd-1);this._shouldFirePageIndexChanged=true;if(!isNaN(pageInd)){this._showLoading();this.pageIndex(pageInd-1)}}}},_renderPrevPage:function(pager){var prev,self=this,imgspan;prev=$("<div></div>").appendTo(pager).addClass(this.css.prevPage).attr({title:this._getLocaleValue("prevPageTooltip"),"data-localeid":"prevPageTooltip","data-localeattr":"title"});if(this.options.currentPageIndex===0){$("<span></span>").appendTo(prev).addClass(this.css.prevPageImageDisabled);$("<span></span>").appendTo(prev).addClass(this.css.prevPageLabelDisabled).attr("data-localeid","prevPageLabelText").append(this._getLocaleValue("prevPageLabelText"))}else{prev.bind("mousedown",$.proxy(this._prevPage,this));imgspan=$("<span></span>").appendTo(prev).addClass(this.css.prevPageImage);$("<span></span>").appendTo(prev).addClass(this.css.prevPageLabel).attr("data-localeid","prevPageLabelText").append(this._getLocaleValue("prevPageLabelText"));imgspan.wrap(toStaticHTML('<a href="javascript:void(0);" tabIndex="-1"></a>'));prev.attr("tabIndex","0").bind({keydown:function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){self._prevPage();event.stopPropagation();event.preventDefault()}},focus:function(event){$(event.currentTarget).closest("div").removeClass("ui-state-default").addClass("ui-state-focus")},blur:function(event){$(event.currentTarget).closest("div").removeClass("ui-state-focus").addClass("ui-state-default")}})}},_renderNextPage:function(pager){var next,self=this,imgspan;next=$("<div></div>").appendTo(pager).addClass(this.css.nextPage).attr({title:this._getLocaleValue("nextPageTooltip"),"data-localeid":"nextPageTooltip","data-localeattr":"title"});if(this.options.currentPageIndex===this.grid.dataSource.pageCount()-1){$("<span></span>").appendTo(next).addClass(this.css.nextPageLabelDisabled).attr("data-localeid","nextPageLabelText").append(this._getLocaleValue("nextPageLabelText"));$("<span></span>").appendTo(next).addClass(this.css.nextPageImageDisabled)}else{next.bind("mousedown",$.proxy(this._nextPage,this));$("<span></span>").appendTo(next).addClass(this.css.nextPageLabel).attr("data-localeid","nextPageLabelText").append(this._getLocaleValue("nextPageLabelText"));imgspan=$("<span></span>").appendTo(next).addClass(this.css.nextPageImage);imgspan.wrap(toStaticHTML('<a href="javascript:void(0);" tabIndex="-1"></a>'));next.attr("tabIndex","0").bind({keydown:function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){self._nextPage();event.stopPropagation();event.preventDefault()}},focus:function(event){$(event.currentTarget).closest("div").removeClass("ui-state-default").addClass("ui-state-focus")},blur:function(event){$(event.currentTarget).closest("div").removeClass("ui-state-focus").addClass("ui-state-default")}})}},_renderFirstPage:function(pager){var first,self=this,imgspan;first=$("<div></div>").appendTo(pager).addClass(this.css.firstPage).attr({title:this._getLocaleValue("firstPageTooltip"),"data-localeid":"firstPageTooltip","data-localeattr":"title"});if(this.options.currentPageIndex===0){$("<span></span>").appendTo(first).addClass(this.css.firstPageImageDisabled);$("<span></span>").appendTo(first).addClass(this.css.firstPageLabelDisabled).attr("data-localeid","firstPageLabelText").append(this._getLocaleValue("firstPageLabelText"))}else{first.bind("mousedown",$.proxy(this._firstPage,this));imgspan=$("<span></span>").appendTo(first).addClass(this.css.firstPageImage);$("<span></span>").appendTo(first).addClass(this.css.firstPageLabel).attr("data-localeid","firstPageLabelText").append(this._getLocaleValue("firstPageLabelText"));imgspan.wrap(toStaticHTML('<a href="javascript:void(0);" tabIndex="-1"></a>'));first.attr("tabIndex","0").bind({keydown:function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){self._firstPage();event.stopPropagation();event.preventDefault()}},focus:function(event){$(event.currentTarget).closest("div").removeClass("ui-state-default").addClass("ui-state-focus")},blur:function(event){$(event.currentTarget).closest("div").removeClass("ui-state-focus").addClass("ui-state-default")}})}},_renderLastPage:function(pager){var last,self=this,imgspan;last=$("<div></div>").appendTo(pager).addClass(this.css.lastPage).attr({title:this._getLocaleValue("lastPageTooltip"),"data-localeid":"lastPageTooltip","data-localeattr":"title"});if(this.options.currentPageIndex===this.grid.dataSource.pageCount()-1){$("<span></span>").appendTo(last).addClass(this.css.lastPageLabelDisabled).attr("data-localeid","lastPageLabelText").append(this._getLocaleValue("lastPageLabelText"));$("<span></span>").appendTo(last).addClass(this.css.lastPageImageDisabled)}else{last.bind("mousedown",$.proxy(this._lastPage,this));$("<span></span>").appendTo(last).addClass(this.css.lastPageLabel).attr("data-localeid","lastPageLabelText").append(this._getLocaleValue("lastPageLabelText"));imgspan=$("<span></span>").appendTo(last).addClass(this.css.lastPageImage);imgspan.wrap(toStaticHTML('<a href="javascript:void(0);" tabIndex="-1"></a>'));last.attr("tabIndex","0").bind({keydown:function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){self._lastPage();event.stopPropagation();event.preventDefault()}},focus:function(event){$(event.currentTarget).closest("div").removeClass("ui-state-default").addClass("ui-state-focus")},blur:function(event){$(event.currentTarget).closest("div").removeClass("ui-state-focus").addClass("ui-state-default")}})}},_renderPageSizeDropDown:function(parent,prepend,insertAfter){var i,ps,editorId=this.grid.id()+"_editor",cClass,items,self=this,edtrOpts,kbrdNavEvents;cClass=this.options.pageSizeDropDownLocation==="above"?this.css.pageSizeDropDownContainerAbove:this.css.pageSizeDropDownContainer;if(insertAfter){parent=$("<div></div>").insertAfter(parent).addClass(cClass)}else{if(prepend){parent=$("<div></div>").prependTo(parent).addClass(cClass)}else{parent=$("<div></div>").appendTo(parent).addClass(cClass)}}parent.attr({"data-pagesize-dd-container":this.grid.id(),title:this._getLocaleValue("pageSizeDropDownTooltip"),"data-localeid":"pageSizeDropDownTooltip","data-localeattr":"title"});parent=$("<div></div>").appendTo(parent).addClass(this.css.pagingResults);if(prepend){$("<span>"+this._getLocaleValue("pageSizeDropDownTrailingLabel")+"</span>").attr("data-localeid","pageSizeDropDownTrailingLabel").prependTo(parent).addClass(this.css.pageSizeLabel);
$("<span></span>").prependTo(parent).attr("id",editorId);$("<span>"+this._getLocaleValue("pageSizeDropDownLabel")+"</span>").attr("data-localeid","pageSizeDropDownLabel").prependTo(parent).addClass(this.css.pageSizeLabel)}else{$("<span>"+this._getLocaleValue("pageSizeDropDownLabel")+"</span>").attr("data-localeid","pageSizeDropDownLabel").appendTo(parent).addClass(this.css.pageSizeLabel);$("<span></span>").appendTo(parent).attr("id",editorId).addClass(this.css.pageSizeDropDown);$("<span>"+this._getLocaleValue("pageSizeDropDownTrailingLabel")+"</span>").attr("data-localeid","pageSizeDropDownTrailingLabel").appendTo(parent).addClass(this.css.pageSizeLabel)}items=this.options.pageSizeList===null||this.options.pageSizeList.length===0?[5,10,20,25,50,75,100]:this.options.pageSizeList;if($.type(items)==="string"){items=items.split(",")}ps=this.pageSize();kbrdNavEvents=this._getEditorKeyboardNavigation();edtrOpts={language:this.grid.options.language,width:this.options.defaultDropDownWidth,dropDownAttachedToBody:true,suppressNotifications:true,buttonType:"dropdown",dropDownOnReadOnly:true,listItems:items,allowNullValue:false,readOnly:true,textAlign:"left",value:ps,valueChanged:function(e,args){if(self.options.pageSizeDropDownLocation==="inpager"){setTimeout(function(){self._changePageSize(e,args)},0)}else{self._changePageSize(e,args)}},rendered:function(e,args){var edtr=args.owner;edtr.editorContainer().addClass(self.css.pageSizeDropDown);edtr.field().removeClass("ui-state-disabled");edtr.editorContainer().removeClass("ui-state-disabled")}};edtrOpts=$.extend(edtrOpts,kbrdNavEvents);this._pageSizeDD=this.grid.container().find("#"+editorId).igNumericEditor(edtrOpts);for(i=0;i<items.length;i++){if(items[i]===ps){this._pageSizeDD.igNumericEditor("selectedListIndex",i);break}}if($.ig.util.isIE8===true&&this.grid.options._isHierarchicalGrid&&this.grid.options.fixedHeaders){$("<col></col>").appendTo(this.grid.headersTable().find("colgroup")).remove()}this._pageSizeDropDownRendered=true;this._trigger("pagingdropdownrendered")},_changePageSize:function(event,args){var noCancel=true,size=args.owner.value();noCancel=this._trigger(this.events.pageSizeChanging,null,{currentPageSize:this.pageSize(),newPageSize:size,owner:this});if(noCancel){if(this.options.type==="remote"){this.grid.element.trigger("iggriduidirty",{owner:this})}else{this.grid.element.trigger("iggriduisoftdirty",{owner:this})}this.pageSize(size);if(this.options.type==="remote"){this._shouldFirePageSizeChanged=true}else{this._trigger(this.events.pageSizeChanged,null,{pageSize:size,owner:this})}}else{args.owner.value(this.pageSize())}},_deleteOld:function(destroy){if(this._curPageDD){this._curPageDD.igNumericEditor("destroy");delete this._curPageDD}if(destroy&&this._pageSizeDD&&this._pageSizeDD.data("igNumericEditor")&&this._pageSizeDD.closest("body").length>0){this._pageSizeDD.igNumericEditor("destroy");delete this._pageSizeDD}},destroy:function(){var pager=this._pager(),container=this.grid.container();this.pageSize(0);this._deleteOld(true);this.grid.element.off(".paging");if(this.options.showPageSizeDropDown===true&&this.options.pageSizeDropDownLocation==="above"&&container.length>0){$("#"+container.id+" .ui-iggrid-pagesizedropdowncontainerabove").remove()}pager.remove();if(this._loadingIndicator){delete this._loadingIndicator}this._superApply(arguments);return this},_injectGrid:function(gridInstance,isRebind){this.grid=gridInstance;if(this.options.type===null){this.options.type=this.grid._inferOpType()}if(!this.options.persist){if(isRebind){this.options.currentPageIndex=this._oPageIndex;this.options.pageSize=this._oPageSize}}else{this._loadPagingData()}this.grid.dataSource.settings.paging.type=this.options.type||"remote";this.grid.dataSource.settings.paging.pageIndex=this.options.currentPageIndex;if(this.options.type==="local"){this.grid.dataSource.persistedPageIndex(this.grid.dataSource.settings.paging.pageIndex)}this.grid.dataSource.settings.paging.pageSize=parseInt(this.options.pageSize,10);if(this.options.pageSizeUrlKey!==null&&this.options.pageIndexUrlKey){this.grid.dataSource.settings.paging.pageSizeUrlKey=this.options.pageSizeUrlKey;this.grid.dataSource.settings.paging.pageIndexUrlKey=this.options.pageIndexUrlKey}if(this.options.recordCountKey!==null){this.grid.dataSource.settings.responseTotalRecCountKey=this.options.recordCountKey}this.grid.dataSource.settings.paging.enabled=true;if(this._pageSizeDD){this._pageSizeDD.igNumericEditor("option","value",this.options.pageSize)}this.grid.element.off(".paging").on("iggridvirtualrecordsrender.paging",$.proxy(this._onVirtRecordsRender,this))}});$.extend($.ui.igGridPaging,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI Grid Column Resizing 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 *	infragistics.ui.grid.shared.js
 *	infragistics.ui.grid.featurechooser.js
 */
(function($){$.widget("ui.igGridResizing",$.ui.igWidget,{options:{allowDoubleClickToResize:true,deferredResizing:false,columnSettings:[{columnKey:null,columnIndex:null,allowResizing:true,minimumWidth:20,maximumWidth:null}],handleThreshold:5,inherit:false},css:{columnResizeLine:"ui-iggrid-resize-line",resizingHandleCursor:"ui-iggrid-resizing-handle-cursor",resizingHandle:"ui-iggrid-resizing-handle"},events:{columnResizing:"columnResizing",columnResizingRefused:"columnResizingRefused",columnResized:"columnResized"},_createWidget:function(){this.options.columnSettings=[];$.Widget.prototype._createWidget.apply(this,arguments)},_registerWidget:$.noop,_unregisterWidget:$.noop,_setOption:function(key,value){switch(key){case"locale":case"language":case"regional":this._super(key,value);break;default:throw new Error(this._getLocaleValue("optionChangeNotSupported").replace("{optionName}",key))}},changeGlobalLanguage:function(){},changeGlobalRegional:function(){},destroy:function(){this._clearResizingHandles();this.grid.element.unbind(".resizing");this._superApply(arguments);return this},resize:function(column,width){var columnIndex,gridWidth;if(typeof column==="number"){columnIndex=column}else{$.each(this.grid._visibleColumns(),function(index,col){if(col.key===column){columnIndex=index}});if(columnIndex===undefined){throw new Error(this._getLocaleValue("noSuchVisibleColumn"))}}if(width===undefined||width===null||width==="*"){this._autoResize(columnIndex,false,null)}else{if($.type(width)==="string"&&width.indexOf("%")>0){gridWidth=this.grid.element.width();width=parseInt(width,10)*gridWidth/100}this._resizeColumn(columnIndex,width,false,null)}},_headerRendered:function(){if(this.grid.element.igGridColumnFixing!==undefined){this._columnFixing=this.grid.element.data("igGridColumnFixing")}this._renderResizingHandles()},_columnsCollectionModified:function(){this._renderResizingHandles()},_columnsMoved:function(e,args){var ths,grid=this.grid,len=args.len,startIndex=args.start,endIndex=args.index,ind,after=endIndex-startIndex>0,$th;if(args.owner.id()!==this.grid.id()||!startIndex&&!len&&!endIndex){return}this._populateMultiColumnHeadersLevel0();if(after){endIndex-=len}if(grid._isMultiColumnGrid){ths=$(grid._headerCells)}else{if(grid.options.virtualization===true||grid.options.rowVirtualization===true){ths=grid.headersTable().find("> thead > tr").eq(0).children("th").not("[data-skip=true]")}else{ths=grid.headersTable().find("> thead > tr[data-header-row]").eq(0).children("th").not("[data-skip=true]")}}function funcCalibrateResizingHandle(ind){if(ths&&ths[ind]){$th=$(ths[ind]);$th.find('span[data-nonpaddedindicator="right"]').css("margin-right",-parseInt($th.css("padding-right"),10)+"px")}}if(after){ind=endIndex-1}else{ind=startIndex+len-1}funcCalibrateResizingHandle(ind);funcCalibrateResizingHandle(endIndex+len-1)},_hiddenColumnIndicatorsRendered:function(ths){if(this.grid._isMultiColumnGrid&&ths.length){ths=ths[0].closest("thead").find(">tr>th").not("[data-skip=true]")}ths.find('span[data-nonpaddedindicator="right"]').each(function(ind,span){var $span=$(span),$th=$span.closest("th");$span.css("margin-right",-parseInt($th.css("padding-right"),10)+"px")})},_fixedColumnsChanged:function(){this._renderResizingHandles()},_renderResizingHandles:function(){var self=this,i,ths,visibleColumns=this.grid._visibleColumns(),thsMultiHeader,gridId=this.grid.element.attr("id"),hasFixedColumns=this.grid.hasFixedColumns();this._clearResizingHandles();if(visibleColumns.length===0){return}if(this.grid._isMultiColumnGrid){thsMultiHeader=this.grid.headersTable().find("> thead > tr th").not("[data-skip=true]").not("[data-isheadercell=true]");if(hasFixedColumns){$.each(this.grid.fixedHeadersTable().find("> thead > tr th").not("[data-skip=true]").not("[data-isheadercell=true]"),function(index,th){thsMultiHeader.push($(th))})}this._populateMultiColumnHeadersLevel0();thsMultiHeader.each(function(){var a,th=$(this),mchId=th.data("mchId"),i,cs=self._oColumnSettings;for(i=0;i<cs.length;i++){if(cs[i].columnKey===mchId&&cs[i].allowResizing===false){return true}}a=self._renderResizingHandle(th);self._bindMultipleResizingHandle(th,a.find("span"))});ths=$(this.grid._headerCells)}else{if(this.grid.options.virtualization===true||this.grid.options.rowVirtualization===true){if(hasFixedColumns){ths=$();for(i=0;i<visibleColumns.length;i++){ths.push($("#"+gridId+"_"+visibleColumns[i].key))}}else{ths=this.grid.headersTable().find("> thead > tr").eq(0).children("th").not("[data-skip=true]")}}else{if(hasFixedColumns){ths=$();for(i=0;i<visibleColumns.length;i++){ths.push($("#"+gridId+"_"+visibleColumns[i].key))}}else{ths=this.grid.headersTable().find("> thead > tr[data-header-row]").eq(0).children("th").not("[data-skip=true]")}}}ths.each(function(index){var a,cs,th=$(this),col=visibleColumns[index];if(col===null||col===undefined){return true}cs=self._findColumnSettingsByKey(col.key);if(cs.allowResizing){a=self._renderResizingHandle(th);self._bindResizingHandle(th,a.find("span"),col)}})},_renderResizingHandle:function(th){var div,a;if(!this._resizingHandles){this._resizingHandles=[]}div=$('<div data-resizinghandle="true" />').css("position","relative").css("width","100%").css("height","0px").css("top","0px").css("left","0px").prependTo(th);a=$("<a />").attr("title","").prependTo(div);if($.ig.util.isIE9){a.addClass(this.css.resizingHandleCursor)}$('<span data-nonpaddedindicator="right"></span>').attr("title","").css("position","absolute").css("margin-right",-parseInt(th.css("padding-right"),10)+"px").css("right","0px").css("width",this.options.handleThreshold+"px").addClass(this.css.resizingHandleCursor).addClass(this.css.resizingHandle).appendTo(a);this._resizingHandles.push(div);return a},_populateMultiColumnHeadersLevel0:function(){var i,j,self=this,cols=this.grid._oldCols||[],colsLength=cols.length,ths=$(this.grid._headerCells),level0=[],level0Length,visibleColumns=this.grid._visibleColumns();for(i=0;i<colsLength;i++){if(cols[i].level===0){level0.push(cols[i])}else{for(j=0;j<cols[i].children.length;j++){level0.push(cols[i].children[j])}}}level0Length=level0.length;ths.each(function(index){var th=$(this),col=visibleColumns[index],cs;if(col===null||col===undefined){return true}cs=self._findColumnSettingsByKey(col.key);if(cs.allowResizing){for(i=0;i<level0.length;i++){if(level0[i].key===col.key){break}}if(i<level0Length){level0[i].allowResizing=true;level0[i].visibleIndex=index;level0[i].settings=cs}th.col=level0[i]}})},_bindMultipleResizingHandle:function($th,button){var self=this,id=$th.attr("data-mch-id"),column;column=this.grid._getMultiHeaderColumnById(id);button.mouseWrapper({distance:5,start:function(){return self._startResizing($th)},drag:function(event){return self._doResizingMultiColumnHeader(event.originalEvent,$th,column)},stop:function(event){return self._stopResizingMiltiColumnHeader(event.originalEvent,$th,column)}}).bind("dblclick.resizing",function(event){self._handleMouseMultiColumnHeaderDbClick(event,$th,column)}).bind("click.resizing",function(event){event.preventDefault();event.stopPropagation()})},_bindResizingHandle:function(th,button,column){var self=this;button.mouseWrapper({distance:5,start:function(){return self._startResizing(th)},drag:function(event){return self._doResizing(event.originalEvent,th,column)},stop:function(event){return self._stopResizing(event.originalEvent,th,column)}}).bind("dblclick.resizing",function(event){self._handleMouseDbClick(event,th,column)}).bind("click.resizing",function(event){event.preventDefault();event.stopPropagation()})},_clearResizingHandles:function(){var i;if(this._resizingHandles){for(i=0;i<this._resizingHandles.length;i++){this._resizingHandles[i].remove()}this._resizingHandles=[]}},_handleMouseDbClick:function(event,th,column){if(!this.options.allowDoubleClickToResize){return}this._autoResize($.inArray(column,this.grid._visibleColumns()),true,event)},_handleMouseMultiColumnHeaderDbClick:function(event,$th,column){var i,children=column.children,childrenLength=children.length;if(!this.options.allowDoubleClickToResize){return}for(i=0;i<childrenLength;i++){if(children[i].allowResizing===true){this._autoResize(children[i].visibleIndex,true,event)}}},_autoResize:function(columnIndex,fireEvents,event){var maxWidth=this.grid.calculateAutoFitColumnWidth(columnIndex);if(maxWidth>-1){return this._resizeColumn(columnIndex,maxWidth,fireEvents,event)}},_cancelHoveringEffects:function(cancel){var topmostGrid=this.grid.element.closest(".ui-iggrid-root").data("igGrid");if(topmostGrid===undefined||topmostGrid===null){topmostGrid=this.grid}topmostGrid._cancelHoveringEffects=cancel},_startResizing:function(th){var body=$(document.body),resizeLineTop,heightOffset;this._resizing=true;this._cancelHoveringEffects(true);if(!$.ig.util.isIE10){$(document.activeElement).blur()}else{body.focus()}body.addClass(this.css.resizingHandleCursor);if(this.grid._isMultiColumnGrid){heightOffset=th.igOffset().top-this._gridContainerPositioningOffset().top}resizeLineTop=th.igOffset().top+this._gridContainerPositioningOffset().top;if(this.grid.options.height!==null&&this.grid.options.showHeader===true&&this.grid.options.fixedHeaders===false){resizeLineTop+=this.grid.scrollContainer().scrollTop()}this._resizeLine=$("<div></div>").addClass(this.css.columnResizeLine).data("efh","1").css({height:this._calculateGridResizableHeight(heightOffset),top:resizeLineTop,visibility:"hidden"}).appendTo(this.grid.container());if($.ig.util.isIE8){this.grid.container().attr("tabIndex",this.grid.container().attr("tabIndex"))}return true},_doResizingMultiColumnHeader:function(event,$th,column){var i,width,resizeCellRange,resizeResult,range,vI,offsetLeft,offsetHeight,children=column.children,childrenLength=children.length,child=null,cellToResize;width=event.pageX-$th.igOffset().left;if(width<0){width=0}offsetHeight=$th.igOffset().top-this.grid.headersTable().igOffset().top;if(!this.options.deferredResizing){for(i=childrenLength-1;i>=0;i--){if(children[i].allowResizing&&!children[i].hidden){child=children[i];child.resized=!child.resized;if(child.resized){break}}}if(child!==null&&!child.hidden){cellToResize=$("#"+this.grid.element[0].id+"_"+child.key);vI=$.inArray(child,this.grid._visibleColumns());width=cellToResize[0].offsetWidth-$th[0].offsetWidth+width;resizeResult=this._resizeColumn(vI,width,true,event,vI)}if(!resizeResult){return true}if(!resizeResult.canceled){this._resizeLine.css("height",this._calculateGridResizableHeight(offsetHeight));this._resizeLine.css({left:$th.igOffset().left+$th.outerWidth()+this._gridContainerPositioningOffset().left,visibility:"visible"})}}else{offsetLeft=$th.igOffset().left;range={min:offsetLeft,max:offsetLeft};for(i=0;i<childrenLength;i++){child=children[i];if(child.hidden){continue}if(child.allowResizing){resizeCellRange=this._getRange(this.options.columnSettings[child.visibleIndex]);range.min+=resizeCellRange.min;if(resizeCellRange.max===Infinity){range.max=Infinity}else if(range.max!==Infinity){range.max+=resizeCellRange.max}}else{range.min+=$("#"+this.grid.element[0].id+"_"+child.key)[0].offsetWidth}}this._resizeLine.css("height",this._calculateGridResizableHeight(offsetHeight));this._resizeLine.css({left:this._coerceRange(range,event.pageX)+this._gridContainerPositioningOffset().left,visibility:"visible"})}return true},_doResizing:function(event,th,column){var width,resizeResult,columnIndex=$.inArray(column,this.grid._visibleColumns()),range,offsetLeft,offsetHeight;if(!this.options.deferredResizing){width=event.pageX-th.igOffset().left;if(width<0){width=0}if(this.grid._isMultiColumnGrid){offsetHeight=th.igOffset().top-this.grid.headersTable().igOffset().top}resizeResult=this._resizeColumn(columnIndex,width,true,event);if(!resizeResult.canceled){this._resizeLine.css("height",this._calculateGridResizableHeight(offsetHeight));this._resizeLine.css({left:th.igOffset().left+th.outerWidth()+this._gridContainerPositioningOffset().left,visibility:"visible"})}}else{range=this._getRange(this.options.columnSettings[columnIndex]);offsetLeft=th.igOffset().left;range.min+=offsetLeft;range.max+=offsetLeft;this._resizeLine.css({left:this._coerceRange(range,event.pageX)+this._gridContainerPositioningOffset().left,visibility:"visible"})}return true},_stopResizingMiltiColumnHeader:function(event,th,column){var i,width,cs,columnKey,self=this,children,childrenLength,childrenLengthAllowResizing=0,childrenToResize;if(this.options.deferredResizing){width=event.pageX-th.igOffset().left;children=column.children;childrenLength=children.length;childrenToResize=[];for(i=0;i<childrenLength;i++){columnKey=children[i].key;cs=this._findColumnSettingsByKey(columnKey);if(children[i].allowResizing===false||cs&&cs.allowResizing===false){width-=$("#"+this.grid.element[0].id+"_"+columnKey)[0].offsetWidth;continue}childrenToResize.push(children[i]);childrenLengthAllowResizing++}if(childrenLengthAllowResizing>0){this._resizeMCHDeffered(width,childrenToResize)}}$("body").removeClass(this.css.resizingHandleCursor);setTimeout(function(){self._resizing=false},0);this._cancelHoveringEffects(false);this._resizeLine.remove();this._resizeLine=undefined;return true},_resizeMCHDeffered:function(width,columns){var i,column,columnIndex,columnsLength=columns.length,visibleColumns=[],gridVC=this.grid._visibleColumns(),resizeInfo,newWidth=width,newColumnsToResize=[],avgWidth;if(columnsLength===0){return}for(i=0;i<columnsLength;i++){columnIndex=$.inArray(columns[i],gridVC);if(columnIndex===-1||this.options.columnSettings[columnIndex].allowResizing===false){continue}visibleColumns.push({column:column,columnIndex:columnIndex})}columnsLength=visibleColumns.length;if(columnsLength>0){avgWidth=parseInt(width/columnsLength,10);for(i=0;i<columnsLength;i++){column=visibleColumns[i].column;columnIndex=visibleColumns[i].columnIndex;resizeInfo=this._resizeColumn(columnIndex,avgWidth,true);if(resizeInfo.newWidth!==avgWidth){newWidth-=resizeInfo.newWidth}else{newColumnsToResize.push(column)}}}if(newWidth>5&&newWidth!==width&&newColumnsToResize.length>0){this._resizeMCHDeffered(newWidth,newColumnsToResize)}},_stopResizing:function(event,th,column){var width,self=this,columnIndex=$.inArray(column,this.grid._visibleColumns());if(this.options.deferredResizing){width=event.pageX-th.igOffset().left;width=this._coerceRange(this._getRange(this.options.columnSettings[columnIndex]),width);this._resizeColumn(columnIndex,width,true,event)}$("body").removeClass(this.css.resizingHandleCursor);setTimeout(function(){self._resizing=false},0);this._cancelHoveringEffects(false);this._resizeLine.remove();this._resizeLine=undefined;return true},_resizeColumn:function(columnIndex,width,fireEvents,originalEvent,startIndex){var gridWidth,minimalVisibleAreaWidth=0,widthFixedContainer,visibleColumns=this.grid._visibleColumns(),columnKey=visibleColumns[columnIndex].key,typeW,hasWidthPx,w,tmpW,visibleIndex=columnIndex,headersTable=this.grid.options.showHeader?this.grid.headersTable():this.grid.element,cs,isFixed,headers,headerWidth,headerColumns,columnSettings=this.options.columnSettings,hasFixedCols=this.grid.hasFixedColumns(),columnsLength,headerColStyleWidth,hasPercentageWidth,actualColumnStyleWidths=[],actualColumnWidths=[],requiredColumnPercentageWidths=[],newColumnStyleWidths=[],i,widthToDistribute,shrinkColumns,widthDistributed,widthUsed,coercedWidth,widthPerColumn,range,totalWidth,readyColumns,readyColumnsCount,finalPixelWidth,allColumnsHaveWidth,noCancel,containerWidth,isResized=true,columnWithAllowedResizing,currColSettings;delete visibleColumns[columnIndex].oWidth;if(hasFixedCols){visibleIndex=this.grid.getVisibleIndexByKey(columnKey);isFixed=visibleColumns[columnIndex].fixed===true;if(isFixed){headersTable=this.grid.fixedHeadersTable()}}if(this.grid._isMultiColumnGrid){headers=$(this.grid._headerCells);headerWidth=headers.length>0?$(headers[columnIndex])[0].offsetWidth:headerWidth}else{if(this.grid.options.virtualization===true||this.grid.options.rowVirtualization===true){headers=headersTable.find("> thead > tr").first().children("th").not("[data-skip=true]")}else{headers=headersTable.find("> thead > tr[data-header-row]").first().children("th").not("[data-skip=true]")}if(!this.grid.options.showHeader){headers=headersTable.find("tbody>tr:not([data-container='true'],[data-grouprow='true']):first").children("td").not("[data-skip=true]")}headerWidth=headers.length>0?headers.get(visibleIndex).offsetWidth:headerWidth}headerColumns=headersTable.find("> colgroup > col").not("[data-skip=true]");columnSettings=this.options.columnSettings;columnsLength=headerColumns.length;columnWithAllowedResizing=headerColumns.length;headerColStyleWidth=headerColumns[visibleIndex].style.width;hasPercentageWidth=/%$/.test(headerColStyleWidth);$(headerColumns).each(function(ind){if(!columnSettings[ind].allowResizing){columnWithAllowedResizing--}});if(headerColStyleWidth===""){hasPercentageWidth=true;headerColumns.each(function(ind,col){if(col.style.width!==""){hasPercentageWidth=false;return false}})}if(fireEvents){noCancel=this._trigger(this.events.columnResizing,originalEvent,{owner:this,columnIndex:columnIndex,columnKey:columnKey,desiredWidth:width});if(!noCancel){return{canceled:true,originalWidth:width,newWidth:width}}}this.grid._fireInternalEvent("_internalColumnResized");if(columnKey!==undefined){cs=this._findColumnSettingsByKey(columnKey)}else{cs=columnSettings[columnIndex]}range=this._getRange(cs);width=this._coerceRange(range,width);width=Math.floor(width);if(width===range.min||width===range.max){isResized=false}if(isFixed){widthToDistribute=headerWidth-width;gridWidth=parseInt(this.grid.options.width,10);if(isNaN(gridWidth)||this.grid._gridHasWidthInPercent()){gridWidth=this.grid.container().outerWidth()}if(widthToDistribute<0){minimalVisibleAreaWidth=this._columnFixing.options.minimalVisibleAreaWidth;if(this._columnFixing._isVirtualGrid()){widthFixedContainer=this.grid._virtualcontainer().find("colgroup:first>col[data-fixed-col]").width()}else{widthFixedContainer=this.grid.fixedContainer().outerWidth()}if(widthFixedContainer-widthToDistribute>gridWidth-this.grid._scrollbarWidth()-minimalVisibleAreaWidth){if(fireEvents){this._trigger(this.events.columnResizingRefused,originalEvent,{owner:this,columnIndex:columnIndex,columnKey:columnKey,desiredWidth:width})}return{canceled:true,originalWidth:width,newWidth:width}}}}if($.ig.util.isWebKit&&hasPercentageWidth){totalWidth=headersTable[0].offsetWidth;for(i=0;i<columnsLength;i++){w=headerColumns[i].style.width;if(w===""){actualColumnWidths[i]=parseFloat(this.grid._isMultiColumnGrid?headers[i][0].offsetWidth:headers[i].offsetWidth)}else{actualColumnWidths[i]=w.indexOf("%")>0?parseFloat(w)/100*totalWidth:parseFloat(w)}}}else if(headers.length>0){for(i=0;i<columnsLength;i++){actualColumnStyleWidths[i]=headerColumns[i].style.width;actualColumnWidths[i]=this.grid._isMultiColumnGrid?headers[i][0].offsetWidth:headers[i].offsetWidth}}if(hasPercentageWidth){widthToDistribute=headerWidth-width;shrinkColumns=widthToDistribute<0;readyColumns=[];readyColumnsCount=0;widthDistributed=0;if(startIndex===undefined||startIndex===null){startIndex=0}while(readyColumnsCount<columnsLength-1-startIndex&&(shrinkColumns&&widthToDistribute<-.05||!shrinkColumns&&widthToDistribute>.05)){widthPerColumn=widthToDistribute/(columnWithAllowedResizing-1);for(i=startIndex;i<columnsLength;i++){if(i!==columnIndex&&!readyColumns[i]){currColSettings=this._findColumnSettingsByKey(this.grid._visibleColumns()[i].key);if(!currColSettings.allowResizing){readyColumnsCount++;continue}if(shrinkColumns){widthUsed=Math.max(widthPerColumn,widthToDistribute)}else{widthUsed=Math.min(widthPerColumn,widthToDistribute)}actualColumnWidths[i]+=widthUsed;range=this._getRange(currColSettings);coercedWidth=this._coerceRange(range,actualColumnWidths[i]);if(Math.abs(actualColumnWidths[i]-coercedWidth)>5e-6){widthUsed-=actualColumnWidths[i]-coercedWidth;actualColumnWidths[i]=coercedWidth;readyColumns[i]=true;readyColumnsCount++}widthDistributed+=widthUsed;widthToDistribute-=widthUsed}}}actualColumnWidths[columnIndex]-=widthDistributed;totalWidth=0;for(i=0;i<columnsLength;i++){totalWidth+=actualColumnWidths[i]}for(i=0;i<columnsLength;i++){requiredColumnPercentageWidths[i]=100*actualColumnWidths[i]/totalWidth}for(i=0;i<columnsLength;i++){newColumnStyleWidths[i]=requiredColumnPercentageWidths[i]+"%";visibleColumns[i].width=newColumnStyleWidths[i]}finalPixelWidth=actualColumnWidths[columnIndex];this._applyToEachGridCOL(function(index,col){col.css("width",newColumnStyleWidths[index])},isFixed)}else{allColumnsHaveWidth=true;for(i=0;i<columnsLength;i++){if(i===visibleIndex){newColumnStyleWidths[i]=width+"px";finalPixelWidth=width;typeW=$.type(visibleColumns[columnIndex].width);hasWidthPx=typeW==="string"&&visibleColumns[columnIndex].width.indexOf("px")>0;if(typeW==="number"){visibleColumns[columnIndex].width=width}else if(typeW==="string"){if(!hasWidthPx){visibleColumns[columnIndex].width=String(width)}else{visibleColumns[columnIndex].width=newColumnStyleWidths[i]}}else{visibleColumns[columnIndex].width=newColumnStyleWidths[i]}}else{newColumnStyleWidths[i]=actualColumnStyleWidths[i];allColumnsHaveWidth=allColumnsHaveWidth&&parseInt(actualColumnStyleWidths[i],10)>=0}}this._applyToEachGridCOL(function(index,col){col.css("width",newColumnStyleWidths[index])},isFixed);containerWidth=this.grid._calculateContainerWidth(false);if(allColumnsHaveWidth){if(this.grid.options.width&&parseInt(this.grid.options.width,10)>0){if(!isFixed){this.grid._updateGridContentWidth()}if(this.grid.options.virtualization===true||this.grid.options.rowVirtualization===true){this.grid._oldScrollLeft=$("#"+this.grid.id()+"_horizontalScrollContainer").scrollLeft()}if(this.grid.options.rowVirtualization||this.grid.options.virtualization===true){tmpW=containerWidth-this.grid._scrollbarWidth();$("#"+this.grid.element[0].id+"_headers").css("width",containerWidth).css("max-width",containerWidth);this.grid.element.css("width",tmpW).css("max-width",tmpW);$("#"+this.grid.id()+"_footers").css("width",containerWidth).css("max-width",containerWidth)}}else{if(hasFixedCols&&!isFixed){this.grid._updateGridContentWidth()}this.grid._setContainerWidth($("#"+this.grid.id()+"_container"));if(this.grid.options.rowVirtualization||this.grid.options.virtualization===true){tmpW=containerWidth+this.grid._scrollbarWidth();$("#"+this.grid.element[0].id+"_headers_v").css("width",tmpW).css("max-width",tmpW);$("#"+this.grid.element[0].id+"_displayContainer").css("width",containerWidth).css("max-width",containerWidth);$("#"+this.grid.element[0].id+"_virtualContainer > colgroup > col").first().attr("width",containerWidth);$("#"+this.grid.id()+"_footer_container").css("width",tmpW).css("max-width",tmpW)}}}}if(hasFixedCols){this._columnFixing._containerResized(isFixed,widthToDistribute)}if(fireEvents){this._trigger(this.events.columnResized,originalEvent,{owner:this,columnIndex:columnIndex,columnKey:columnKey,originalWidth:headerWidth,newWidth:finalPixelWidth})}return{canceled:false,originalWidth:headerWidth,newWidth:finalPixelWidth,isResized:isResized}},_applyToEachGridCOL:function(appliedFunction,isFixed){var headersTable,footersTable;if(this.grid.options.showHeader){if(isFixed){headersTable=this.grid.fixedHeadersTable()}else{headersTable=this.grid.headersTable()}headersTable.find("> colgroup > col").not("[data-skip=true]").each(function(i){appliedFunction(i,$(this))})}if(this.grid.options.fixedHeaders===true&&this.grid.options.height!==null||this.grid.options.showHeader===false){if(isFixed){$("#"+this.grid.id()+"_fixed").find("> colgroup > col").not("[data-skip=true]").each(function(i){appliedFunction(i,$(this))})}else{this.grid.element.find("> colgroup > col").not("[data-skip=true]").each(function(i){appliedFunction(i,$(this))})}}if(this.grid.options.fixedFooters===true&&this.grid.options.height!==null){if(isFixed){footersTable=this.grid.fixedFootersTable()}else{footersTable=this.grid.footersTable()}footersTable.find("> colgroup > col").not("[data-skip=true]").each(function(i){appliedFunction(i,$(this))})}},_getRange:function(column){var min=column.minimumWidth,max=column.maximumWidth,gridWidth;if($.type(min)==="string"&&min.indexOf("%")>0){gridWidth=this.grid.element.width();min=parseInt(min,10)*gridWidth/100}if($.type(max)==="string"&&max.indexOf("%")>0){gridWidth=this.grid.element.width();max=parseInt(max,10)*gridWidth/100}min=isNaN(min)?0:min;min=Math.max(0,min);max=isNaN(max)?Infinity:max;return{min:min,max:max}},_coerceRange:function(range,value){value=Math.max(range.min,value);value=Math.min(range.max,value);return value},_gridContainerPositioningOffset:function(){var gridContainer=this.grid.container(),containerPosition=gridContainer.css("position"),gridContainerOffsetParent=gridContainer.offsetParent(),gridContainerPosition=gridContainer.igPosition(),gridContainerOffset=gridContainer.igOffset(),offsetParentScrollTop,offsetParentScrollLeft;if(containerPosition==="relative"||containerPosition==="absolute"){return{top:-gridContainerOffset.top,left:-gridContainerOffset.left}}if(gridContainerOffsetParent.is("body")){offsetParentScrollTop=0;offsetParentScrollLeft=0}else{offsetParentScrollTop=gridContainerOffsetParent.scrollTop();offsetParentScrollLeft=gridContainerOffsetParent.scrollLeft()}return{top:offsetParentScrollTop+gridContainerPosition.top-gridContainerOffset.top,left:offsetParentScrollLeft+gridContainerPosition.left-gridContainerOffset.left}},_calculateGridResizableHeight:function(heightOffset){var height,caption,headersTable,footersTable,scrollerContainer,hasVirtualization=this.grid.options.virtualization===true||this.grid.options.rowVirtualization===true||this.grid.options.columnVirtualization===true,hasWidthOrHeight=this.grid.options.height!==null||this.grid.options.width!==null;if(hasVirtualization){height=$("#"+this.grid.element[0].id+"_displayContainer").height()}else if(hasWidthOrHeight){height=this.grid.scrollContainer().height()}else{height=this.grid.element.height()}if(hasVirtualization||hasWidthOrHeight){headersTable=this.grid.headersTable();footersTable=this.grid.footersTable();if(this.grid.options.fixedHeaders===true&&this.grid.options.showHeader===true){if(headersTable.length!==0&&this.grid.element[0].id!==headersTable[0].id){height+=headersTable.height()}caption=headersTable.children("#"+this.grid.element[0].id+"_caption");if(caption.length!==0){if(!$.ig.util.isFF){height-=caption.outerHeight(true)}}}scrollerContainer=$("#"+this.element[0].id+"_hscroller_container");if(scrollerContainer.is(":visible")){height+=scrollerContainer.height()}if(this.grid.options.fixedFooters===true&&this.grid.options.showFooter===true&&footersTable.length!==0&&this.grid.element[0].id!==footersTable[0].id){height+=footersTable.height()}}if(heightOffset){height-=heightOffset}return height},_findColumnSettingsByKey:function(key,settings){var i;if(!settings){settings=this.options.columnSettings}for(i=0;i<settings.length;i++){if(settings[i].columnKey===key){return settings[i]}}},_initDefaultSettings:function(){var settings=[],key,cs=this.options.columnSettings,i,j,mch,s;if(this.grid.options.columns&&this.grid.options.columns.length>0){for(i=0;i<this.grid.options.columns.length;i++){settings[i]={columnIndex:i,columnKey:this.grid.options.columns[i].key,allowResizing:true,minimumWidth:20}}}for(i=0;i<cs.length;i++){for(j=0;j<settings.length;j++){if(settings[j].columnKey===cs[i].columnKey||settings[j].columnIndex===cs[i].columnIndex){break}}if(j===settings.length){if(this.grid._isMultiColumnGrid&&cs[i].allowResizing===false){mch=this.grid._getMultiHeaderColumnById(cs[i].columnKey);if(mch&&mch.children){mch.allowResizing=false;for(j=0;j<mch.children.length;j++){s=this._findColumnSettingsByKey(mch.children[j].key,settings);if(s){s.allowResizing=false}mch.children[j].allowResizing=false}}}continue}for(key in cs[i]){if(cs[i].hasOwnProperty(key)&&key!=="columnIndex"&&key!=="columnKey"){settings[j][key]=cs[i][key]}}}this._oColumnSettings=this.options.columnSettings;this.options.columnSettings=settings},_injectGrid:function(gridInstance){this.grid=gridInstance;this._checkGridNotSupportedFeatures();this.grid.element.unbind(".resizing");this._initDefaultSettings();this.grid.element.bind("iggridheaderrendered.resizing",$.proxy(this._headerRendered,this));this.grid.element.bind("iggridcolumnscollectionmodified.resizing",$.proxy(this._columnsCollectionModified,this));this.grid.element.bind("iggrid_columnsmoved.resizing",$.proxy(this._columnsMoved,this))},_checkGridNotSupportedFeatures:function(){var gridOptions=this.grid.options;if((gridOptions.virtualization===true||gridOptions.columnVirtualization===true)&&gridOptions.virtualizationMode==="fixed"){throw new Error(this._getLocaleValue("resizingAndFixedVirtualizationNotSupported"))}}});$.extend($.ui.igGridResizing,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI Grid Responsive 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.tree.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 */
(function($){$.widget("ui.igGridResponsive",$.ui.igWidget,{localeWidgetName:"igGridResponsive",options:{columnSettings:[{columnKey:null,columnIndex:null,classes:"",configuration:null}],reactOnContainerWidthChanges:true,forceResponsiveGridWidth:true,responsiveSensitivity:20,responsiveModes:null,enableVerticalRendering:true,windowWidthToRenderVertically:null,propertiesColumnWidth:"50%",valuesColumnWidth:"50%",allowedColumnWidthPerType:{string:120,number:50,bool:50,date:80,object:150},singleColumnTemplate:null,inherit:false},events:{responsiveColumnHiding:"responsiveColumnHiding",responsiveColumnHidden:"responsiveColumnHidden",responsiveColumnShowing:"responsiveColumnShowing",responsiveColumnShown:"responsiveColumnShown",responsiveModeChanged:"responsiveModeChanged"},css:{verticalContainerCssClass:"ui-iggrid-responsive-vertical"},_createWidget:function(){this.options.columnSettings=[];$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){this._callBackId=null;this._responsive=null;this._exclusiveContainer=false;this._mode="";this._modes=this.options.responsiveModes||{desktop:"infragistics",tablet:"infragistics",phone:"infragistics"};this._modes=this._initializeModeRecognizers(this._modes);this._hiddenByClass=this._flagClassConfiguration();this._defaultColumnTemplates=null;this._defaultColumnFormatters=null;this._footersDisplacement=.1;this._originalRenderRecord=null;this._newRenderRecord=null;this._vrw=typeof this.options.windowWidthToRenderVertically==="string"?parseInt(this.options.windowWidthToRenderVertically,10):this.options.windowWidthToRenderVertically;this._vr=null},_registerWidget:$.noop,_unregisterWidget:$.noop,_setOption:function(key,value){switch(key){case"propertiesColumnWidth":case"valuesColumnWidth":throw new Error(this._getLocaleValue("optionChangeNotSupported").replace("{optionName}",key));case"responsiveModes":this._modes=value;this._modes=this._initializeModeRecognizers(this._modes);break;case"reactOnContainerWidthChanges":if(value===true){this._activateContainer()}else{this._deactivateContainer()}break;case"enableVerticalRendering":this.options.enableVerticalRendering=value;if(this._shouldRenderVertically()){if(!this._vr){this._enableNoHeaderLayout(true,false)}}else{if(this._vr){this._disableNoHeaderLayout()}}break;case"windowWidthToRenderVertically":this._vrw=typeof value==="string"?parseInt(value,10):value;break}$.Widget.prototype._setOption.apply(this,arguments);this._hiddenByClass=this._flagClassConfiguration()},destroy:function(){this._deactivateContainer();if(this._initialGridRenderedHandler){this.grid.element.unbind("iggridrendered",this._initialGridRenderedHandler);this.grid.element.unbind("iggridheaderrendering",this._gridHeaderRenderingHandler)}this.grid.element.unbind("iggrid_heightchanged",this._gridContainerHeightHandler);$("#"+this.grid.element[0].id+"_responsive_test_container").remove();this.grid._renderRecord=this._originalRenderRecord;this.grid._renderColgroup=this._originalRenderColgroup;this.grid._renderCell=this._originalRenderCell;this.grid.renderNewRow=this._originalRenderNewRow;this._superApply(arguments);return this},getCurrentResponsiveMode:function(){return this._mode},_activateContainer:function(){if(!this._responsive||typeof this._responsive.addCallback!=="function"){this._responsive=this.grid.element.closest(".ui-widget").igResponsiveContainer().data("igResponsiveContainer");this._exclusiveContainer=true}this._callBackId=this._responsive.addCallback(this._containerResized,this,this.options.responsiveSensitivity,"x")},_deactivateContainer:function(){if(typeof this._callBackId==="number"){this._responsive.removeCallback(this._callBackId);this._callBackId=null}if(this._exclusiveContainer===true){this._responsive.destroy();delete this._responsive;this._exclusiveContainer=false}},_renderTestElement:function(){$("<div></div>").attr("id",this.grid.element[0].id+"_responsive_test_container").css("position","fixed").css("height","0px").css("top","-100px").text("&nbsp;").appendTo(this.grid.container())},_initializeModeRecognizers:function(){var self=this,transformed={},nval;$.each(this._modes,function(key,value){if(typeof value==="string"){nval=value.substring(0,1).toUpperCase()+value.substring(1);nval=new $.ig[nval+"Mode"]({key:key,visibilityTester:$.proxy(self._checkVisibilityByClass,self)})}else if(typeof value==="object"&&!value.isActive){nval=new $.ig.ResponsiveMode({minWidth:value.minWidth||-1,maxWidth:value.maxWidth||Number.MAX_VALUE,minHeight:value.minHeight||-1,maxHeight:value.maxHeight||Number.MAX_VALUE})}else{nval=value}transformed[key]=nval});return transformed},_flagClassConfiguration:function(){var byClass=false;$.each(this.options.columnSettings,function(){if(this.classes){byClass=true;return false}});return byClass},_getDefaultColumnTemplates:function(){var cache={},col,i;for(i=0;i<this.grid.options.columns.length;i++){col=this.grid.options.columns[i];if(col.template){if(col.key){cache[col.key]=col.template}else{cache[i]=col.template}}}return cache},_getDefaultColumnFormatters:function(){var cache={},col,i;for(i=0;i<this.grid.options.columns.length;i++){col=this.grid.options.columns[i];if(col.formatter){if(col.key){cache[col.key]=col.formatter}else{cache[i]=col.formatter}}}return cache},_checkVisibilityByClass:function(classes){var testContainer=$("#"+this.grid.element[0].id+"_responsive_test_container");testContainer.removeClass();testContainer.addClass(classes);return testContainer.is(":visible")},_gridReady:function(){return!(this.grid._loadingIndicator&&this.grid._loadingIndicator._indicator.is(":visible"))},_shouldRenderVertically:function(){if(!this.options.enableVerticalRendering){return false}if(this._vrw===null||this._vrw===undefined){return this._shouldRenderVerticallyByDefault()}if($(window).width()<this._vrw){return true}if($(window).width()>=this._vrw){return false}return false},_shouldRenderVerticallyByDefault:function(){var i,gw=this.grid.element.width(),gp=100,cw,cols=[],col,tcocww=0,p,aw;for(i=0;i<this.grid._visibleColumns().length;i++){col=this.grid._visibleColumns()[i];if(col.width){cw=-1;if(typeof col.width==="string"){if(col.width.endsWith("%")){cw=parseInt(col.width,10);gp-=cw}else{gw-=parseInt(col.width,10)}}else{gw-=col.width}if(cw!==-1){cols.push({key:col.key||i,width:cw,type:col.dataType})}continue}tcocww++;cols.push({key:col.key||i,width:-1,type:col.dataType})}for(i=0;i<cols.length;i++){p=cols[i].width===-1?gp/tcocww:cols[i].width;aw=p/100*gw;if(aw<=this.options.allowedColumnWidthPerType[cols[i].type]){return true}}return false},_isSingleColumn:function(){if(this.options.singleColumnTemplate&&this.options.singleColumnTemplate[this._mode]){return true}},_updateGridSync:function(initial,full){var self=this;if(!this._gridReady()){setTimeout(function(){self._updateGridSync(initial,full)},50);return}return self._updateGrid(initial,full)},_updateGrid:function(initial,full){var result=[],applyTemplatesFormatters=false,colsToShow,colsToHide,self=this,i;this._vr=this._vr===null?this._shouldRenderVertically():this._vr;delete this.grid._visibleColumnsArray;if(this._vr){this.grid.element.addClass(this.css.verticalContainerCssClass)}if(this._hiddenByClass===true){result=this._updateColumnsByClass()}if(full===true){if(this._hiddenByClass===false){result=this._updateColumns()}applyTemplatesFormatters=this._updateTemplatesFormatters()}colsToShow=result[0]||[];colsToHide=result[1]||[];if(colsToShow.length===0&&colsToHide.length===0){if(applyTemplatesFormatters===true&&initial===false){return true}return}if(initial===false){this.grid._loadingIndicator.show();setTimeout(function(){self.grid._setHiddenColumns(colsToShow,false,initial);for(i=0;i<colsToShow.length;i++){self._trigger(self.events.responsiveColumnShown,null,self._getArgsByColumn(colsToShow[i]))}self.grid._setHiddenColumns(colsToHide,true,initial);for(i=0;i<colsToHide.length;i++){self._trigger(self.events.responsiveColumnHidden,null,self._getArgsByColumn(colsToHide[i]))}if(initial===false){self.grid._loadingIndicator.hide()}self._setMaxWidthOnGrid()},0)}else{$.each(colsToShow,function(){this.hidden=false});$.each(colsToHide,function(){this.hidden=true})}},_updateColumnsByClass:function(){var i,cs=this.options.columnSettings,col,colsToHide=[],colsToShow=[],noCancel,hidden,visible;for(i=0;i<cs.length;i++){if(cs[i].classes){col=this._getGridColumnBySetting(cs[i]);if(!col){continue}hidden=col.hidden||false;visible=this._checkVisibilityByClass(cs[i].classes);if(hidden===true&&visible===true){noCancel=this._trigger(this.events.responsiveColumnShowing,null,this._getArgsByColumnSetting(cs[i]));if(noCancel){colsToShow.push(col)}}if(hidden===false&&visible===false){noCancel=this._trigger(this.events.responsiveColumnHiding,null,this._getArgsByColumnSetting(cs[i]));if(noCancel){colsToHide.push(col)}}}}return[colsToShow,colsToHide]},_updateColumns:function(){var i,cs=this.options.columnSettings,col,colsToHide=[],colsToShow=[],noCancel,m=this._mode,hidden,visible;for(i=0;i<cs.length;i++){if(cs[i].configuration){col=this._getGridColumnBySetting(cs[i]);if(!col){continue}hidden=col.hidden||false;visible=!(cs[i].configuration[m]&&cs[i].configuration[m].hidden);if(hidden===true&&visible===true){noCancel=this._trigger(this.events.responsiveColumnShowing,null,this._getArgsByColumnSetting(cs[i]));if(noCancel){colsToShow.push(col)}}if(hidden===false&&visible===false){noCancel=this._trigger(this.events.responsiveColumnHiding,null,this._getArgsByColumnSetting(cs[i]));if(noCancel){colsToHide.push(col)}}}}return[colsToShow,colsToHide]},_updateTemplatesFormatters:function(){var i,cs=this.options.columnSettings,nt,nf,updated=false,col,m=this._mode,jsRndr=String(this.grid.options.templatingEngine).toLowerCase()==="jsrender";for(i=0;i<cs.length;i++){col=this._getGridColumnBySetting(cs[i]);if(!col){continue}if(cs[i].configuration&&cs[i].configuration[m]&&cs[i].configuration[m].template){nt=cs[i].configuration[m].template}else{nt=col.key?this._defaultColumnTemplates[col.key]:this._defaultColumnTemplates[$.inArray(col,this.grid.options.columns)]}if(cs[i].configuration&&cs[i].configuration[m]&&cs[i].configuration[m].formatter){nf=cs[i].configuration[m].formatter;nf=$.type(nf)==="string"?window[nf]:nf}else{nf=col.key?this._defaultColumnFormatters[col.key]:this._defaultColumnFormatters[$.inArray(col,this.grid.options.columns)]}if(col.template!==nt){col.template=nt;updated=true}if(col.formatter!==nf){col.formatter=nf;updated=true}}if(updated===true){if(!this.grid._tmplWrappers){this.grid._tmplWrappers=jsRndr?$.render:{}}this.grid._setTemplateDefinition(jsRndr)}return updated},_executeTemplate:function(data){if(this._jsr){return $.render[this.grid.id()+"_responsiveSct_"+this._mode](data).replace("<td","").replace("</td>","")}return $.ig.tmpl(this.options.singleColumnTemplate[this._mode],data).replace("<td","").replace("</td>","")},_renderRecord:function(data,index){if(this._vr){return this._renderRecordVerticalGrid(data,index)}if(this._scr){return this._renderRecordSingleColumnGrid(data,index)}return this._originalRenderRecord(data,index)},_renderRecordVerticalGrid:function(data,index){var i=0,str="",tstr,alt,vc=this.grid._visibleColumns(),key=this.grid.options.primaryKey;alt=index%2!==0&&this.grid.options.alternateRowStyles;for(i=0;i<vc.length;i++){str+="<tr";if(alt){str+=' class="'+this.grid.css.recordAltClass+'"'}if(key!==undefined&&key!==null&&data[key]!==null&&data[key]!==undefined){str+=' data-id="'+data[key]+'"'}str+=' data-col-key="'+vc[i].key+'"';str+="><td>";str+=vc[i].headerText+"</td>";str+='<td aria-readonly="true"';if(vc[i].template&&vc[i].template.length){tstr=this.grid._renderTemplatedCell(data,vc[i]);if(tstr.indexOf("<td")===0){str+=tstr.substring(3)}else{str+=">"+tstr}}else{str+=' aria-describedby="'+this.grid.id()+"_"+vc[i].key+'">'+this.grid._renderCell(data[vc[i].key],vc[i])}str+="</td></tr>"}return str},_renderRecordSingleColumnGrid:function(data,index){var str="<tr",pk=this.grid.options.primaryKey,formattedData,key,tmplRes,dtype;if(index%2!==0&&this.options.alternateRowStyles){str+=' class="'+this.grid.css.recordAltClass+'"'}if(pk!==null&&pk!==undefined){str+=' data-id="'+this.grid._kval_from_key(pk,data)+'"'}else if(data.ig_pk!==null&&pk!==undefined){str+=' data-id="'+data.ig_pk+'"'}str+='><td aria-readonly="true"';formattedData=$.extend(true,{},data);for(key in formattedData){if(formattedData.hasOwnProperty(key)){dtype=$.type(data[key]);formattedData[key]=this.grid._renderCell(data[key],this.grid.columnByKey(key)||{},formattedData,null,dtype==="object"||dtype==="array")}}tmplRes=this._executeTemplate(formattedData);if(tmplRes.indexOf("<td")===0){str+=tmplRes.substring(3)}else{str+=">"+tmplRes}str+="</td></tr>";return str},_renderNewRow:function(rec){var tbody,go,index,virt;if(this._vr){tbody=this.element.children("tbody");go=this.grid.options;virt=go.virtualization===true||go.rowVirtualization===true;if(virt){this._renderVirtualRecordsContinuous();this._startRowIndex=0;this.virtualScrollTo(this._totalRowCount)}else{index=this.grid._getDataView().length-1;tbody.append(this.grid._renderRecord(rec,index))}}else{this._originalRenderNewRow(rec)}},_renderCell:function(val,col,record,displayStyle,returnObject){var type=col.dataType,format=col.format,o=this.grid.options,auto=o.autoFormat;if(record){val=this.grid.dataSource.getCellValue(col.key,record)}val=this.grid._fixDate(val,col);if(col.formatter){return col.formatter(val,record,this._mode)}if(!format&&type==="bool"&&o.renderCheckboxes){format="checkbox"}if(format==="checkbox"&&type!=="bool"){format=null}type=type==="date"||type==="number"?type:"";if(format||(auto===true||auto==="dateandnumber")&&type||auto&&auto===type){return $.ig.formatter(val,type,format,true,col.dateDisplayType==="utc",this.grid._getOffsetForCol(record,col),displayStyle,col.headerText,this.grid.options.tabIndex)}if(returnObject){return val}return val||val===0||val===false?val.toString():"&nbsp;"},_renderColgroup:function(table,isHeader,isFooter,autofitLastColumn){var colgroup,fcw,scw;this._vr=this._vr===null?this._shouldRenderVertically():this._vr;this._scr=this._scr===undefined||this._scr===null?this._isSingleColumn():this._scr;if(!this._vr&&!this._scr){this._originalRenderColgroup(table,isHeader,isFooter,autofitLastColumn);return}colgroup=$(table).find("colgroup");if(colgroup.length===0){colgroup=$("<colgroup></colgroup>").prependTo(table)}colgroup.empty();if(this._vr){fcw=typeof this.options.propertiesColumnWidth==="string"?parseInt(this.options.propertiesColumnWidth,10):this.options.propertiesColumnWidth;scw=typeof this.options.valuesColumnWidth==="string"?parseInt(this.options.valuesColumnWidth,10):this.options.valuesColumnWidth;colgroup.append('<col width="'+fcw+'%"></col><col width="'+scw+'%"></col>')}else if(this._scr){colgroup.append('<col width="100%"></col>')}},_enableNoHeaderLayout:function(vr,scr){this.grid.element.addClass(this.css.verticalContainerCssClass);if(!this.grid.options.showHeader||!this.grid.options.fixedHeaders||this.grid.options.height===null){this.grid.headersTable().children("thead").css("display","none")}else{this.grid.headersTable().css("position","absolute");this.grid.headersTable().css("top","-100px")}this._vr=vr;this._scr=scr;this._modifySortingStyles();this._disableUpdating();this.grid._rerenderColgroups();this.grid._renderData()},_disableNoHeaderLayout:function(){this.grid.element.removeClass(this.css.verticalContainerCssClass);if(!this.grid.options.showHeader||!this.grid.options.fixedHeaders||this.grid.options.height===null){this.grid.headersTable().children("thead").css("display","")}else{this.grid.headersTable().css("position","");this.grid.headersTable().css("top","")}this._scr=false;this._vr=false;this._modifySortingStyles(true);this._enableUpdating();this.grid._rerenderColgroups();this.grid._renderData()},_disableUpdating:function(){if(this.grid.element.data("igGridUpdating")){this._em=this.grid.element.igGridUpdating("option","editMode");this._dm=this.grid.element.igGridUpdating("option","enableDeleteRow");this.grid.element.igGridUpdating("option","editMode","none");this.grid.element.igGridUpdating("option","enableDeleteRow",false)}},_enableUpdating:function(){if(this.grid.element.data("igGridUpdating")){if(this._em){this.grid.element.igGridUpdating("option","editMode",this._em)}if(this._dm){this.grid.element.igGridUpdating("option","enableDeleteRow",true)}}},_getGridColumnBySetting:function(cs){var col;if(cs.columnKey&&typeof cs.columnKey==="string"){col=this.grid.columnByKey(cs.columnKey)}else if(cs.columnIndex!==null&&cs.columnIndex!==undefined&&typeof cs.columnIndex==="number"&&cs.columnIndex>=0&&cs.columnIndex<this.grid.options.columns.length){col=this.grid.options.columns[cs.columnIndex]}return col},_getArgsByColumnSetting:function(cs){return{owner:this,columnIndex:cs.columnIndex||null,columnKey:cs.columnKey||null}},_getArgsByColumn:function(col){return{owner:this,columnIndex:$.inArray(col,this.grid.options.columns),columnKey:col.key||null}},_getCurrentMode:function(){var env;$.each(this._modes,function(key){if(this.isActive()===true){env=key;return false}});return env},_containerResized:function(nw,nh){var mode=this._getCurrentMode(),prevMode,shouldUpdate=false,shouldRerender=false;if(nw<=0&&nh<=0){return}this._setMaxWidthOnGrid();if(mode&&mode!==this._mode){prevMode=this._mode;this._mode=mode;this._trigger(this.events.responsiveModeChanged,null,{owner:this,previousMode:prevMode,mode:mode});shouldUpdate=true}if(shouldUpdate||this._hiddenByClass){shouldRerender=this._updateGridSync(false,shouldUpdate)}if(this._isSingleColumn()){if(!this._scr){this._enableNoHeaderLayout(false,true)}else if(shouldUpdate){this.grid._renderData()}}else{if(this._scr){this._disableNoHeaderLayout();this._scr=false}else if(shouldRerender){this.grid._renderData()}}if(this._shouldRenderVertically()){if(!this._vr){this._enableNoHeaderLayout(true,false)}}else{if(this._vr){this._disableNoHeaderLayout();this._vr=false}else if(shouldRerender){this.grid._renderData()}}},_gridHeaderRendering:function(evt,ui){var i;if(ui.owner.id()!==this.grid.id()){return}this._renderTestElement();this._mode=this._getCurrentMode();this._defaultColumnTemplates=this._getDefaultColumnTemplates();this._defaultColumnFormatters=this._getDefaultColumnFormatters();if($.isArray(this.grid._initialHiddenColumns)){for(i=0;i<this.grid._initialHiddenColumns.length;i++){this.grid._initialHiddenColumns[i].hidden=true}}this._updateGrid(true,true);this.grid._captureInitiallyHiddenColumns()},_initialGridRendered:function(){if(this.options.reactOnContainerWidthChanges){this._activateContainer()}if(this._vr||this._scr){if(!this.grid.options.showHeader||!this.grid.options.fixedHeaders||this.grid.options.height===null){this.grid.headersTable().children("thead").css("display","none")}else{this.grid.headersTable().css("position","absolute");this.grid.headersTable().css("top","-100px")}this._disableUpdating();this._modifySortingStyles()}this._alreadyRendered=true;this._setMaxWidthOnGrid()},_dataRendered:function(){this._setMaxWidthOnGrid()},_modifySortingStyles:function(restore){var sorting=this.grid.element.data("igGridSorting");if(sorting){if(restore){sorting.options.applySortedColumnCss=this._srs}else{this._srs=sorting.options.applySortedColumnCss;sorting.options.applySortedColumnCss=false}}},_heightChanged:function(){var newHeight=$("#"+this.grid.element[0].id+"_scroll").height();if(this._height!==newHeight){this._height=newHeight;this.grid._adjustLastColumnWidth(false);this._setMaxWidthOnGrid()}},_setMaxWidthOnGrid:function(){var sbw=this.grid._hasVerticalScrollbar===true?this.grid._scrollbarWidth():0,npw;if(this.options.forceResponsiveGridWidth){this.grid._gridContentWidth=0;this.grid.element.css("width","100%");if(!this.grid._allColumnWidthsInPercentage){npw=100-sbw/this.grid.container().width()*100;if(this.grid.options.fixedHeaders===true){this.grid.headersTable().css("width",npw+"%")}if(this.grid.options.fixedFooters===true){this.grid.footersTable().css("width",npw+this._footersDisplacement+"%")}}}},_createHandlers:function(){this._gridHeaderRenderingHandler=$.proxy(this._gridHeaderRendering,this);this._initialGridRenderedHandler=$.proxy(this._initialGridRendered,this);this._gridContainerHeightHandler=$.proxy(this._heightChanged,this)},_injectGrid:function(gridInstance,isRebind){var key,sct;if(isRebind===true){return}this.grid=gridInstance;this._checkGridNotSupportedFeatures();this._createHandlers();if(this.options.forceResponsiveGridWidth===true){this.grid.options.width=typeof this.grid.options.width==="string"&&this.grid.options.width.endsWith("%")?this.grid.options.width:"100%";this.grid.options.autoFitLastColumn=false}this.grid.element.bind("iggridheaderrendering",this._gridHeaderRenderingHandler);this.grid.element.bind("iggridrendered",this._initialGridRenderedHandler);if(this.grid.options.height!==null&&this.grid.options.height.indexOf&&this.grid.options.height.indexOf("%")!==-1){this.grid.element.bind("iggrid_heightchanged",this._gridContainerHeightHandler)}this._originalRenderRecord=$.proxy(this.grid._renderRecord,this.grid);this._newRenderRecord=$.proxy(this._renderRecord,this);this._originalRenderColgroup=$.proxy(this.grid._renderColgroup,this.grid);this._newRenderColgroup=$.proxy(this._renderColgroup,this);this._originalRenderCell=this.grid._renderCell;this._newRenderCell=$.proxy(this._renderCell,this);this._originalRenderNewRow=$.proxy(this.grid.renderNewRow,this.grid);this._newRenderNewRow=$.proxy(this._renderNewRow,this);this.grid._renderRecord=this._newRenderRecord;this.grid._renderColgroup=this._newRenderColgroup;this.grid._renderCell=this._newRenderCell;this.grid.renderNewRow=this._newRenderNewRow;if(String(this.grid.options.templatingEngine).toLowerCase()==="jsrender"){this._jsr=true;sct=this.options.singleColumnTemplate;if(sct&&typeof sct==="object"){for(key in sct){if(sct.hasOwnProperty(key)){$.templates(this.grid.id()+"_responsiveSct_"+key,sct[key])}}}}},_checkGridNotSupportedFeatures:function(){var gridOptions=this.grid.options;if((gridOptions.virtualization===true||gridOptions.rowVirtualization===true||gridOptions.columnVirtualization===true)&&gridOptions.virtualizationMode==="fixed"){throw new Error(this._getLocaleValue("fixedVirualizationNotSupported"))}}});$.extend($.ui.igGridResponsive,{version:"21.2.12"});$.ig=$.ig||{};$.ig.ResponsiveMode=$.ig.ResponsiveMode||Class.extend({settings:{minWidth:-1,maxWidth:Number.MAX_VALUE,minHeight:-1,maxHeight:Number.MAX_VALUE},init:function(options){if(options){this.settings=$.extend(true,{},$.ig.ResponsiveMode.prototype.settings,options)}return this},isActive:function(){return window.innerWidth>=this.settings.minWidth&&window.innerWidth<=this.settings.maxWidth&&window.innerHeight>=this.settings.minHeight&&window.innerHeight<=this.settings.maxHeight}});$.ig.InfragisticsMode=$.ig.InfragisticsMode||$.ig.ResponsiveMode.extend({settings:{key:"",visibilityTester:null},init:function(options){this._hc="ui-hidden-"+options.key;this._vc="ui-visible-"+options.key;this._super(options);return this},isActive:function(){if(typeof this.settings.visibilityTester==="function"){return this.settings.visibilityTester(this._hc)===false&&this.settings.visibilityTester(this._vc)===true}return this._super()}});$.ig.BootstrapMode=$.ig.BootstrapMode||$.ig.ResponsiveMode.extend({settings:{key:"",visibilityTester:null},init:function(options){this._hc="hidden-"+options.key;this._vc="visible-"+options.key;this._super(options);return this},isActive:function(){if(typeof this.settings.visibilityTester==="function"){return this.settings.visibilityTester(this._hc)===false&&this.settings.visibilityTester(this._vc)===true}return this._super()}})})($);/*!@license
 * Infragistics.Web.ClientUI Grid Tooltips 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.editors.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 */
(function($){$.widget("ui.igGridRowSelectors",$.ui.igWidget,{options:{enableRowNumbering:true,enableCheckBoxes:false,rowNumberingSeed:0,rowSelectorColumnWidth:null,requireSelection:true,showCheckBoxesOnFocus:false,inherit:false,enableSelectAllForPaging:true,selectAllForPagingTemplate:null,deselectAllForPagingTemplate:null,locale:{selectedRecordsText:undefined,deselectedRecordsText:undefined,selectAllText:undefined,deselectAllText:undefined}},css:{rowSelector:"ui-iggrid-rowselector-class",rowSelectorSelected:"ui-iggrid-selectedcell ui-state-active",rowSelectorActivated:"ui-iggrid-activecell ui-state-focus",headerRowSelector:"ui-iggrid-rowselector-header",footerRowSelector:"ui-iggrid-rowselector-footer",checkBox:"ui-state-default ui-corner-all ui-igcheckbox-normal",checkBoxOff:"ui-icon ui-icon-check ui-igcheckbox-normal-off",checkBoxOn:"ui-icon ui-icon-check ui-igcheckbox-normal-on",nodeHovered:"ui-state-hover"},events:{rowSelectorClicked:"rowSelectorClicked",checkBoxStateChanging:"checkBoxStateChanging",checkBoxStateChanged:"checkBoxStateChanged"},_createWidget:function(){$.Widget.prototype._createWidget.apply(this,arguments);if(this.options.rowSelectorColumnWidth===null){this.options.rowSelectorColumnWidth=55;if(this.options.enableCheckBoxes===true&&this.options.enableRowNumbering===true){this.options.rowSelectorColumnWidth+=15}}},_create:function(){this._cIdx=0;this._functionsRedirected=false;this._hovTR=null;this._gridRenderRecord=null;this._checkBoxesShown=false;this._v=false;this._ms=false},destroy:function(){this._unregisterEvents();this._unregisterRowSelectorEvents();this._unregisterSelectAllEvents();if(this._gridRenderRecordHandler!==undefined){this.grid._renderRecord=this._gridRenderRecordHandler}if(this._gridRenderColgroupHandler&&this.grid._renderColgroup===this._renderColgroupHandler){this.grid._renderColgroup=this._gridRenderColgroupHandler}this._cleanInterface(false);if(this.grid._selection){this.grid._selection.removeSubscriber(this._subId,this.grid.id())}this._superApply(arguments);return this},_shouldRenderHeaderCheckBoxes:function(){return this.options.enableCheckBoxes===true&&this._ms},_renderHeaderRowSelectors:function(owner){var rows,i,cell,header,$thDataSkip;if(owner.id()!==this.grid.id()){return}rows=this.grid.headersTable().children("thead").children();if(rows.length>0){cell=rows.eq(0).find("th.ui-iggrid-expandheadercell").first();if(cell.length===0){this._index=0}else{this._index=cell.index()+1}if(this.grid._isMultiColumnGrid){$thDataSkip=$("<th></th>").prependTo(this.grid.headersTable().find("thead tr:nth-child(1)")).addClass(this.css.headerRowSelector).addClass(this.grid.css.headerClass).attr("data-role","rs").attr("data-skip","true");$thDataSkip.attr("rowspan",this.grid._maxLevel+1);if(this._shouldRenderHeaderCheckBoxes()){$(this._getCheckBox(true)).appendTo($thDataSkip)}}else{for(i=0;i<rows.length;i++){header=rows.eq(i).find("th[data-role='rs']");if(!rows.eq(i).find("th[data-role='rs']").length){header=$("<th>"+($.ig.util.isIE7?"&nbsp;":"")+"</th>").addClass(this.css.headerRowSelector).addClass(i===0?this.grid.css.headerClass:"").attr("data-role","rs").attr("data-skip","true").insertBefore(rows.eq(i).children().eq(this._index))}if(this._shouldRenderHeaderCheckBoxes()&&i===0&&!header.children().length){$(this._getCheckBox(true)).appendTo(header)}}}}},_renderFooterRowSelectors:function(owner){var rows,i;if(owner.id()!==this.grid.id()){return}rows=this.grid.footersTable().children("tfoot").children();if(rows.length>0){for(i=0;i<rows.length;i++){if(rows.eq(i).find("td[data-role='rs']").length>0){continue}$("<td>"+($.ig.util.isIE7?"&nbsp;":"")+"</td>").addClass(this.css.footerRowSelector).attr("data-role","rs").attr("data-skip","true").insertBefore(rows.eq(i).children().eq(this._index))}}},_headerRendered:function(event,ui){this._ms=!this._skipRefresh&&this._getSelectionInstance().options.multipleSelection===true;this._renderHeaderRowSelectors(ui.owner);this._getColumnFixingInstance()},_footerRendered:function(event,ui){this._renderFooterRowSelectors(ui.owner)},_getColumnFixingInstance:function(){if(!this._columnFixing&&this.grid.element.data("igGridColumnFixing")){this._columnFixing=this.grid.element.data("igGridColumnFixing")}return this._columnFixing},_getSelectionInstance:function(){if(!this._selection&&this.grid.element.data("igGridSelection")){this._selection=this.grid.element.data("igGridSelection")}return this._selection},_recordsRendering:function(event,ui){var i,vs,ds=this.grid.dataSource,data=ds._filteredData||ds.data(),gbIsApplied=ds.isGroupByApplied(),gbData=ds._gbData;if(this.grid.id()!==ui.owner.id()){return}vs=ui.vrtWnd.start&&ui.vrtWnd.end?ui.vrtWnd.start:0;vs+=this.grid.dataSource.pageIndex()*this.grid.dataSource.pageSize();if(gbIsApplied&&gbData&&gbData.length&&(ds.settings.groupby.pagingMode==="allRecords"||ds.settings.groupby.pagingMode==="dataRecordsOnly"&&!this.grid.element.data("igGridPaging"))){for(;vs<gbData.length;vs++){if(!gbData[vs].__gbRecord){break}}for(i=0;i<data.length;i++){if(data[i]===gbData[vs]){vs=i;break}}}this._cIdx=this._pIdx=vs;this._redirectFunctions();this._bindToSelectionCollection()},_virtRowCountDetermined:function(){this._cIdx=this._pIdx},_virtRowCountDetermining:function(){this._redirectFunctions()},_redirectFunctions:function(){if(this._functionsRedirected===false){this._renderRecordHandler=$.proxy(this._rsRenderRecord,this);this._gridRenderRecordHandler=$.proxy(this.grid._renderRecord,this.grid);this._gridRenderRecord=this._gridRenderRecordHandler;this.grid._renderRecord=this._renderRecordHandler}this._functionsRedirected=true},_recordsRendered:function(event,ui){if(this.grid.id()!==ui.owner.id()){return}if(this.options.enableCheckBoxes===true){this._updateHeader()}},_gridRendered:function(event,ui){if(ui===undefined){return}if(this.grid.id()!==ui.owner.id()){return}this._ms=!this._skipRefresh&&this._getSelectionInstance().options.multipleSelection===true;this._registerRowSelectorEvents()},_rsRenderColgroup:function(frc,rs,table,isHeader,isFooter,autofitLastColumn,md){var fdLeft,fixed,id=table.id;frc.apply(this,[table,isHeader,isFooter,autofitLastColumn,md]);if(rs.grid.hasFixedColumns()){fdLeft=this.fixingDirection()==="left";fixed=!!(md&&md.fixed);id=fdLeft&&fixed||!fdLeft&&!fixed?id:id+"_fixed";table=document.getElementById(id)}rs._rsRenderColgroupHelper(table)},rsRenderColgroup:function(){this._rsRenderColgroup.apply(this.grid,$.merge([this._gridRenderColgroupHandler,this],arguments))},_rsRenderColgroupHelper:function(table){var cgrp;cgrp=$(table).find("colgroup");if(cgrp.find("col[data-role='rs']").length===0){$("<col></col>").prependTo(cgrp).css("width",this.options.rowSelectorColumnWidth).attr("data-skip","true").attr("data-role","rs")}},_rsRenderRecord:function(data,rowIndex,isFixed){var markup=this._gridRenderRecord.apply(this,arguments),pre,app,idx,fCols=this.grid.hasFixedColumns(),fdLeft=this.grid.fixingDirection()==="left",rs;if(fCols&&!(isFixed&&fdLeft||!isFixed&&!fdLeft)){return markup}rs=this._getRowSelectorCellMarkup(isFixed&&!this.grid._fixedColumns.length?this._rowHasSelection(data):markup.indexOf("ui-iggrid-selectedcell")!==-1,data);idx=markup.indexOf("ui-iggrid-expandcolumn");if(idx>=0){app=markup.substr(idx);idx=idx+app.indexOf("</td>")+4;pre=markup.substring(0,idx+1);app=markup.substring(idx+1)}else{idx=markup.indexOf(">")+1;pre=markup.substring(0,idx);app=markup.substring(idx)}markup=pre+rs+app;return markup},_renderExtraHeaderCells:function(row,colgroup,prepend){this._renderExtraCells(row,colgroup,prepend,true)},_renderExtraFooterCells:function(row,colgroup,prepend,cssClass){this._renderExtraCells(row,colgroup,prepend,false,cssClass)},_renderExtraCells:function(row,colgroup,prepend,header,cssClass){var rHeader,rCol,index,cell;if(row.find("[data-role='rs']").length>0){return}if(header===true){rHeader=$("<th>"+($.ig.util.isIE7?"&nbsp;":"")+"</th>").addClass(this.css.headerRowSelector).attr("data-role","rs").attr("data-skip","true")}else{rHeader=$("<td>"+($.ig.util.isIE7?"&nbsp;":"")+"</td>").addClass(this.css.footerRowSelector).addClass(cssClass).attr("data-role","rs").attr("data-skip","true")}cell=row.find("th.ui-iggrid-expandheadercell,td.ui-iggrid-expandheadercellgb");if(cell.length===0){cell=row.children().first();index=0}else{index=cell.last().index()+1}if(index===0){rHeader.prependTo(row)}else{rHeader.insertBefore(row.children().eq(index))}if(colgroup){rCol=$("<col></col>").attr("data-skip","true").attr("data-role","rs").css("width",this.options.rowSelectorColumnWidth);rCol.insertBefore(colgroup.children().eq(index))}},_registerRowSelectorEvents:function(){this._unregisterRowSelectorEvents();this._allTables().on("click.rowselectors","th."+this.css.rowSelector,this._rsClickHandler);this._allTables().on({"click.rowselectors":this._checkboxClickHandler,"keydown.rowselectors":this._checkboxClickHandler,"mouseover.rowselectors":this._checkboxMouseOverHandler,"mouseout.rowselectors":this._checkboxMouseOutHandler},"th."+this.css.rowSelector+" span[name='chk']");this._allHeaderTables().on({"click.rowselectors":this._hCheckboxClickHandler,"keydown.rowselectors":this._hCheckboxClickHandler,"mouseover.rowselectors":this._checkboxMouseOverHandler,"mouseout.rowselectors":this._checkboxMouseOutHandler},"th."+this.css.headerRowSelector+" span[name='hchk']")},_unregisterRowSelectorEvents:function(){this._allHeaderTables().off(".rowselectors");this._allTables().off(".rowselectors")},_allTables:function(){var ft=this.grid.fixedTable();return ft.add(this.grid.element)},_allHeaderTables:function(){var fht=this.grid.fixedHeadersTable();return fht.add(this.grid.headersTable())},_checkboxMouseOver:function(event){$(event.target).closest("span[data-role='checkbox']").addClass(this.css.nodeHovered)},_checkboxMouseOut:function(event){$(event.target).closest("span[data-role='checkbox']").removeClass(this.css.nodeHovered)},_checkBoxClicked:function(event){if(event.type==="keydown"&&event.keyCode!==$.ui.keyCode.ENTER&&event.keyCode!==$.ui.keyCode.SPACE){return}var trg=$(event.target).closest("span[name='chk']"),rCell=trg.parent(),rRow=rCell.parent(),args,rIdx=this._getVisibleRowIndex(rRow),rKey=rRow.attr("data-id"),noCancel,state=trg.attr("data-chk");if(rKey===""||rKey===null||rKey===undefined){rKey=rIdx}args={row:rRow,rowIndex:rIdx,rowKey:rKey,rowSelector:rCell,owner:this,grid:this.grid,currentState:state,newState:state==="off"?"on":"off",isHeader:false};noCancel=this._triggerCheckingEvent(event,args);if(noCancel===true){this._handleCheck(trg);delete args.currentState;args.state=args.newState;delete args.newState;this._triggerCheckedEvent(event,args)}event.preventDefault();event.stopPropagation()},_headerCheckBoxClicked:function(event){var trg=$(event.target).closest("span[name='hchk']"),args,noCancel,state=trg.attr("data-chk");if(event.type==="keydown"&&event.keyCode!==$.ui.keyCode.ENTER&&event.keyCode!==$.ui.keyCode.SPACE){return}args={owner:this,grid:this.grid,currentState:state,newState:state==="off"?"on":"off",isHeader:true};noCancel=this._triggerCheckingEvent(event,args);if(noCancel===true){this._handleHeaderCheck(trg);delete args.currentState;args.state=args.newState;delete args.newState;this._triggerCheckedEvent(event,args)}event.stopPropagation();event.preventDefault()},_handleCheck:function(checkbox){var row,rowId,upd,sel,offset;if(!checkbox){return}upd=this.grid.element.data("igGridUpdating");sel=this._getSelectionInstance();offset=this._v?this.grid._startRowIndex:0;row=checkbox.parent().parent();if(this.grid.hasFixedColumns()&&sel){row=row.add(sel._getRowByIndex(row.index(),!this.grid._isFixedElement(row)))}rowId=this.grid._fixPKValue(row.attr("data-id"));if(rowId===null||rowId===undefined){rowId=row.closest("tbody").children("tr:not([data-container])").index(row)+offset}if(this.grid._selection.settings.owner!==this.grid){this.grid._selection.changeOwner(this.grid)}if(checkbox.attr("data-chk")==="off"){if(sel.options.activation){this.grid._selection.activate(rowId,row)}this.grid._selection.select(rowId,true,{element:row,checkbox:checkbox})}else{this.grid._selection.deselect(rowId,{element:row,checkbox:checkbox})}if(sel&&sel._suspend){if(upd){if(upd.findInvalid()){return}upd._endEdit(null,true)}else{return}}},_handleHeaderCheck:function(checkbox){var sel,go=this.grid.options,v=go.virtualization||go.rowVirtualization,toCheck=checkbox.attr("data-chk")==="off";sel=this._getSelectionInstance();if(this.grid._selection.settings.owner!==this.grid){this.grid._selection.changeOwner(this.grid)}if(toCheck){if(v||this.grid.dataSource.isGroupByApplied()){this._selectAllVirtualRows(sel)}else{this._selectAllRows(sel)}this._alterCheckbox(checkbox,true)}else{if(v||this.grid.dataSource.isGroupByApplied()){this._deselectAllVirtualRows(sel)}else{this._deselectAllRows(sel)}this._alterCheckbox(checkbox,false)}if(this.options.enableSelectAllForPaging&&this.grid.element.data("igGridPaging")){this._renderOverlayByCheckstate(toCheck)}},changeLocale:function(){var $overlay=this.grid.container().find("[data-rs-overlay]").first();if($overlay.length){$overlay.remove();this._renderOverlayByCheckstate($overlay.attr("data-rs-overlay")==="true")}},_registerWidget:$.noop,_unregisterWidget:$.noop,_renderOverlayByCheckstate:function(toCheck){var dataViewLength=this._getDataView().length,allCheckedRecs=this._getSelectionInstance().selectedRows().length,templateData=[{checked:dataViewLength,unchecked:dataViewLength,allCheckedRecords:allCheckedRecs,totalRecordsCount:this._getDSLocalRecords().length}];this._renderOverlay(templateData,toCheck)},_getDSLocalRecords:function(){var ds=this.grid.dataSource,trecCount=ds.totalLocalRecordsCount();if(ds._filteredData&&ds._filteredData.length>=trecCount){return ds._filteredData}return this._getAllData()},_renderOverlay:function(templateData,toCheck){var hTable=this.grid.headersTable(),overlay;if(toCheck){overlay=this._getSelectAllOverlay(templateData)}else{overlay=this._getDeselectAllOverlay(templateData)}if(overlay){overlay.css({"z-index":"1000",width:"100%",position:"absolute",top:(this.grid.options.height||this.grid.options.width?hTable.parent().igPosition().top:hTable.igPosition().top)+hTable.find("thead:first").outerHeight()});overlay.children("div:first").css("padding-left",this.options.rowSelectorColumnWidth);overlay.appendTo(this.grid.container());this._registerSelectAllEvents(overlay)}},_getSelectAllOverlay:function(templateData){var ti=this.grid.options.tabIndex,overlay,selectAllTemplate;if(templateData[0].allCheckedRecords>=templateData[0].totalRecordsCount){return null}if(this.options.selectAllForPagingTemplate){overlay=this._jsr?$($.render([this.grid.id()+"_selectAllForPagingTemplate"](templateData))):$($.ig.tmpl(this.options.selectAllForPagingTemplate,templateData))}else{selectAllTemplate=this._getLocaleValue("selectedRecordsText").replace("${checked}",templateData[0].checked)+" <a href='#' data-rs-select-all tabindex='"+ti+"'>"+this._getLocaleValue("selectAllText").replace("${totalRecordsCount}",templateData[0].totalRecordsCount)+"</a>";overlay=this._getDefaultOverlay(selectAllTemplate,true)}return overlay},_getDeselectAllOverlay:function(templateData){var ti=this.grid.options.tabIndex,overlay,deselectAllTemplate;if(templateData[0].allCheckedRecords===0){return null}if(this.options.deselectAllForPagingTemplate){overlay=this._jsr?$($.render([this.grid.id()+"_deselectAllForPagingTemplate"](templateData))):$($.ig.tmpl(this.options.deselectAllForPagingTemplate,templateData))}else{deselectAllTemplate=this._getLocaleValue("deselectedRecordsText").replace("${unchecked}",templateData[0].unchecked)+" <a href='#' data-rs-deselect-all tabindex='"+ti+"'>"+this._getLocaleValue("deselectAllText").replace("${totalRecordsCount}",templateData[0].totalRecordsCount)+"</a>";overlay=this._getDefaultOverlay(deselectAllTemplate,false)}return overlay},_getDefaultOverlay:function(template,toCheck){var ti=this.grid.options.tabIndex;return $("<div>").attr({"class":"ui-widget-header ui-priority-secondary","data-rs-overlay":!!toCheck,tabIndex:ti,id:this.grid.id()+(toCheck?"_":"_de")+"select_all_overlay"}).append($("<div>").html(template).append($("<div>").css("float","right").append($("<span>").addClass("ui-icon-close").addClass("ui-icon").addClass("ui-button").attr("data-rs-close-all","").attr("tabindex",ti))))},_registerSelectAllEvents:function(overlay){var self=this,overlayId=overlay.attr("id");this.grid.container().bind("mouseup.containerselectall",function(event){if(event.type==="mouseup"&&$(event.target).closest("#"+overlayId).length===0){$(this).unbind(".containerselectall");if($(overlay)){overlay.remove()}}});overlay.bind("blur.containerselectall",function(event){$(this).unbind(".containerselectall");if($(overlay)&&$(event.target).closest("#"+overlayId).length===0){overlay.remove()}});overlay.find("[data-rs-select-all]").bind("mouseup",function(event){self._selectAllFromOverlay();event.stopPropagation();overlay.remove()});overlay.find("[data-rs-deselect-all]").bind("mouseup",function(event){self._deselectAllFromOverlay();event.stopPropagation();overlay.remove()});overlay.find("[data-rs-select-all]").bind("keydown",function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){self._selectAllFromOverlay();overlay.remove()}});overlay.find("[data-rs-deselect-all]").bind("keydown",function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){self._deselectAllFromOverlay();overlay.remove()}});overlay.find("[data-rs-close-all]").bind("mouseup",function(event){event.stopPropagation();overlay.remove()});overlay.find("[data-rs-close-all]").bind("keydown",function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){overlay.remove()}})},_selectAllFromOverlay:function(){this._changeCheckStateForAllRecords(this._getSelectionInstance(),true)},_deselectAllFromOverlay:function(){this._changeCheckStateForAllRecords(this._getSelectionInstance(),false)},_unregisterSelectAllEvents:function(){if(this.grid.element.data("igGridPaging")&&this.options.enableSelectAllForPaging){this.grid.container().unbind(".containerselectall");$(this.grid.id()+"_select_all_overlay").remove();$(this.grid.id()+"_deselect_all_overlay").remove()}},_updateHeader:function(){var dv=this._getDataView(),dvl=dv.length,sl,i,check=!!dvl,selection=this._getSelectionInstance(),pk=selection._pkProp;if(this.grid.element.data("igGridPaging")){for(i=0;i<dvl;i++){if(!this.grid._selection.isSelected(pk!==null?dv[i][pk]:i,this.grid)){check=false;break}}}else{sl=this.grid._selection?this.grid._selection.selectionLength():0;if(this.grid.dataSource.isGroupByApplied()){if(sl<dvl){check=false}else{sl=this.grid._selection.selectedDataRows().length;check=sl===dvl}}else{check=sl===dvl&&this._isFirstRowSelected()}}this._alterCheckbox(this._headerCheckbox(),check)},_alterCheckbox:function(checkbox,check){var inner=checkbox.children().first();if(checkbox.length>0&&inner.length>0){if(check===true){checkbox.attr("data-chk","on");inner.removeClass(this.css.checkBoxOff).addClass(this.css.checkBoxOn)}else{checkbox.attr("data-chk","off");inner.removeClass(this.css.checkBoxOn).addClass(this.css.checkBoxOff)}}},_getRowSelectorCellMarkup:function(selected){var markup="";markup+='<th role="rowheader" tabindex="'+this.grid.options.tabIndex+'" class="'+this.css.rowSelector;if(selected){markup+=" "+this.css.rowSelectorSelected}markup+='"><span class="ui-icon ui-icon-triangle-1-e" style="margin-left: -5px"></span>';if(this.options.enableRowNumbering){markup+=this._getCurrentNumber()}if(this.options.enableCheckBoxes){markup+=this._getCheckBox(false,selected)}markup+="</th>";return markup},_getCheckBox:function(header,checked){var markup="";markup+='<span name="'+(header===true?"hchk":"chk")+'" ';markup+='data-chk="'+(checked?"on":"off")+'" ';markup+='data-role="checkbox" class="'+this.css.checkBox+' "';markup+='tabindex="'+this.grid.options.tabIndex+' "';if(this.options.showCheckBoxesOnFocus===true&&this._checkBoxesShown===false){markup+=' style="visibility: hidden;"'}markup+='><span class="'+(checked?this.css.checkBoxOn:this.css.checkBoxOff)+'">';markup+="</span></span>";return markup},_getCurrentNumber:function(){return'<span class="ui-iggrid-rowselector-row-number">'+(++this._cIdx+this.options.rowNumberingSeed)+"</span>"},_selectAllRows:function(selection){var checkboxes=this._allCheckboxes(),i,range=[],row,rowId;if(checkboxes.length===0){return}for(i=0;i<checkboxes.length;i++){row=checkboxes.eq(i).parent().parent();if(this.grid.hasFixedColumns()){if(this.grid.fixedBodyContainer().attr("data-fixing-direction")==="left"){row=row.add(this.grid.element.find("tbody > tr").eq(row.index()))}else{row=row.add(this.grid.fixedBodyContainer().find("tbody > tr").eq(row.index()))}}rowId=selection._pkProp?this.grid._fixPKValue(row.attr("data-id")):i;range.push({id:rowId,element:row,checkbox:checkboxes.eq(i)})}this._suspendHeader=true;this.grid._selection.rangeSelect(range,true,null,false,false);this._suspendHeader=false},_selectAllVirtualRows:function(selection){var dv=this._getDataView(),fr,lr,rangeStats;if(dv.length===0){return}if(selection._pkProp){fr=dv[0].__gbRecord?dv[0].id:dv[0][selection._pkProp];lr=dv[dv.length-1].__gbRecord?dv[dv.length-1].id:dv[dv.length-1][selection._pkProp]}else{fr=0;lr=dv.length-1}rangeStats=selection._getRecordRange(fr,lr,dv);this._suspendHeader=true;this.grid._selection.rangeSelect(rangeStats.range,true,null,false,false);if(this.grid.options.virtualizationMode==="continuous"){this.grid._correctScrollPosition(this.grid._getTotalRowsCount())}this._suspendHeader=false},_changeCheckStateForAllRecords:function(selection,toCheck){var dv=this._getDSLocalRecords(),fr,lr,rangeStats;if(dv.length===0){return}if(selection._pkProp){fr=dv[0][selection._pkProp];lr=dv[dv.length-1][selection._pkProp]}else{fr=0;lr=dv.length-1}rangeStats=selection._getRecordRange(fr,lr,dv);this._suspendHeader=true;if(toCheck){this.grid._selection.rangeSelect(rangeStats.range,true,null,rangeStats,false)}else{this.grid._selection.rangeDeselect(rangeStats.range,rangeStats,false)}this._suspendHeader=false},_deselectAllRows:function(selection){var checkboxes=this._allCheckboxes(),i,row,rowId,range=[];if(checkboxes.length===0){return}if(this.grid.element.data("igGridPaging")){for(i=0;i<checkboxes.length;i++){row=checkboxes.eq(i).parent().parent();if(this.grid.hasFixedColumns()){row=row.add(this.grid.scrollContainer().find("tbody > tr").eq(i))}rowId=selection._pkProp?this.grid._fixPKValue(row.attr("data-id")):i;range.push({id:rowId,element:row,checkbox:checkboxes.eq(i)})}this._suspendHeader=true;this.grid._selection.rangeDeselect(range,false,false);this._suspendHeader=false}else{this.grid._selection.deselectAll(false)}},_deselectAllVirtualRows:function(selection){var dv=this._getDataView(),rangeStats,fr,lr;if(dv.length===0){return}if(this.grid.element.data("igGridPaging")){if(selection._pkProp){fr=dv[0][selection._pkProp];lr=dv[dv.length-1][selection._pkProp]}else{fr=0;lr=dv.length-1}rangeStats=selection._getRecordRange(fr,lr,dv);this._suspendHeader=true;this.grid._selection.rangeDeselect(rangeStats.range,false,false);this._suspendHeader=false}else{this.grid._selection.deselectAll(false)}},_isFirstRowSelected:function(){var row=this.grid.element.find("tbody > tr:not([data-grouprow='true'],[data-summaryrow='true']):first"),rowId=row.attr("data-id");rowId=rowId!==null&&rowId!==undefined?this.grid._fixPKValue(rowId):this.grid.dataSource.pageIndex()*this.grid.dataSource.pageSize();return this.grid._selection.isSelected(rowId,this.grid)},_rowHasSelection:function(data){var sel=this._getSelectionInstance(),rowId=data[this.grid.options.primaryKey||"ig_pk"];if(!sel||rowId===null||rowId===undefined){return false}if(sel.options.mode==="cell"){return this.grid._selection.atLeastOneSelected(rowId,sel)}return this.grid._selection.isSelected(rowId,this.grid)},_rsRenderVirtualRecords:function(event,ui){var i=0,rs,rows,rowsLen;this._cIdx=0;if(this.grid.hasFixedColumns()&&this._getColumnFixingInstance().options.fixingDirection==="left"){rows=ui.fixedRows}else{rows=ui.rows}rowsLen=rows.length;for(i;i<rowsLen;i++){rs=$(this._getRowSelectorCellMarkup());rs.prependTo(rows.eq(i))}this._bindToSelectionCollection()},_rrn:function(){var rs=this._allRowSelectorCells(),cb=this._allCheckboxes(),cbx,i=0,self=this,sri=this.grid._startRowIndex||0,row,rowId;if(this.grid.options.virtualizationMode==="fixed"){for(i=0;i<rs.length;i++){rs.eq(i).removeClass(this.css.nodeHovered);if(this.options.enableRowNumbering===true){rs.eq(i).children("span.ui-iggrid-rowselector-row-number").text(sri+i+this.options.rowNumberingSeed+1)}}}if(!this._skipRefresh){rs.removeClass(this.css.rowSelectorSelected);cb.map(function(){self._alterCheckbox($(this),false)});for(i=0;i<rs.length;i++){row=rs.eq(i).closest("tr");rowId=this.grid._fixPKValue(row.attr("data-id"));if(rowId===null||rowId===undefined){rowId=i+sri}if(this.grid._selection.selection[rowId]!==undefined){rs.eq(i).addClass(this.css.rowSelectorSelected);cbx=cb.eq(i);if(cbx.length===1){this._alterCheckbox(cbx,true)}}}}},_bindToSelectionCollection:function(){if(this.grid._selection&&!this._subId){this._subId=this.grid._selection.addSubscriber(this,this.grid.id())}},_select:function(info){var res;info.element=info.element||this.grid._selection.elementFromIdentifier(info.id);res=this._rowSelectorFromSelection(info);if(!res){return}res.rowSelector.addClass(this.css.rowSelectorSelected);if(this.options.enableCheckBoxes){this._alterCheckbox(res.checkbox,true);if(this._ms&&!this._suspendHeader){this._updateHeader()}}},_deselect:function(info){var res,shouldDeselect;info.element=info.element||this.grid._selection.elementFromIdentifier(info.id);res=this._rowSelectorFromSelection(info);if(!res||!res.rowSelector.length){return}shouldDeselect=this.grid._selection instanceof $.ig.SelectedRowsCollection||!this.grid._selection.atLeastOneSelected(this.grid._fixPKValue(info.element.parent().attr("data-id")));if(shouldDeselect){res.rowSelector.removeClass(this.css.rowSelectorSelected);if(this.options.enableCheckBoxes){this._alterCheckbox(res.checkbox,false);if(this._ms&&!this._suspendHeader){this._updateHeader()}}}},_activate:function(element){if(element.is("th")){element.addClass(this.css.rowSelectorActivated)}},_deactivate:function(){if(this.grid.hasFixedColumns()){this.grid.fixedBodyContainer().find("tbody").find("th.ui-iggrid-activecell").removeClass(this.css.rowSelectorActivated)}this.grid.element.find("tbody").find("th.ui-iggrid-activecell").removeClass(this.css.rowSelectorActivated)},_clearSelection:function(){var rsCells,self=this;if(this.grid.hasFixedColumns()&&this.grid.fixingDirection()==="left"){rsCells=this.grid.fixedBodyContainer().find("tbody").find("th.ui-iggrid-selectedcell").removeClass(this.css.rowSelectorSelected)}else{rsCells=this.grid.element.children("tbody").find("th.ui-iggrid-selectedcell").removeClass(this.css.rowSelectorSelected)}if(this.options.enableCheckBoxes){$.each(rsCells,function(){self._alterCheckbox($(this).children("span:last"),false)});this._alterCheckbox(this._headerCheckbox(),false)}},_cellClick:function(event){var args,target=$(event.target),fRow,rCell=target.closest("th"),rRow=rCell.parent(),rIdx=this._getVisibleRowIndex(rRow),rKey=rRow.attr("data-id"),fdCell,gridContainer,sel=this._getSelectionInstance();if(this.options.showCheckBoxesOnFocus===true&&this._checkBoxesShown===false){this._animateCheckboxes(true)}if(!sel){return}if(target.is("span")&&target.attr("unselectable")){return}if(rKey===""||rKey===null||rKey===undefined){rKey=rIdx}if(this.grid.hasFixedColumns()){if(this.grid._isFixedElement(rCell)){if(this.grid.options.virtualization||this.grid.options.rowVirtualization){gridContainer=this.grid._vdisplaycontainer()}else{gridContainer=this.grid.scrollContainer()}fRow=rRow;rRow=gridContainer.find("tbody > tr").eq(fRow.index())}else{fRow=this.grid.fixedBodyContainer().find("tbody > tr").eq(rRow.index())}}fdCell=this._getFirstDataCell(rRow,fRow);if(event.shiftKey&&this._ms){sel._shiftSelectChange(fdCell)}else{sel._singleSelectChange(fdCell,event.ctrlKey||event.metaKey)}args={row:rRow,fixedRow:fRow,rowIndex:rIdx,rowKey:rKey,rowSelector:rCell,owner:this,grid:this.grid};this._triggerClickEvent(event,args)},_getFirstDataCell:function(row,frow){if(frow&&frow.length>0){frow.children("td").not("[data-skip='true'],[data-parent='true']").first()}return row.children("td").not("[data-skip='true'],[data-parent='true']").first()},_mouseHoverRow:function(event){var par,tag,tr=event.target;while(tr){par=tr.parentNode;tag=tr.nodeName;if(tag==="TR"&&par.nodeName==="TBODY"){break}tr=tag==="TABLE"?null:par}if(this._hovTR!==tr){this._mouseHoverRowHelper(this._hovTR,tr);if(this.grid.hasFixedColumns()){this._mouseHoverFixedRow($(this._hovTR),$(tr))}this._hovTR=tr}},_mouseHoverRowHelper:function(hovTr,tr){if(hovTr&&$(hovTr).attr("data-container")!=="true"){$("th."+this.css.rowSelector,hovTr).removeClass(this.css.nodeHovered)}if(tr&&$(tr).attr("data-container")!=="true"){$("th."+this.css.rowSelector,tr).addClass(this.css.nodeHovered)}},_mouseHoverFixedRow:function($hovTR,$tr){var $fHTR,$fTR,ind;ind=$hovTR.index();$fHTR=this.grid.fixedBodyContainer().find("tr:nth-child("+(ind+1)+")");ind=$tr.index();$fTR=this.grid.fixedBodyContainer().find("tr:nth-child("+(ind+1)+")");this._mouseHoverRowHelper($fHTR,$fTR)},_mouseLeaveRow:function(){var ind,$fHTR;if(this._hovTR){$("th",this._hovTR).removeClass(this.css.nodeHovered);if(this.grid.hasFixedColumns()){ind=$(this._hovTR).index();$fHTR=this.grid.fixedBodyContainer().find("tr:nth-child("+(ind+1)+")");$fHTR.find("th").removeClass(this.css.nodeHovered)}this._hovTR=null}},_triggerClickEvent:function(event,args){this._trigger(this.events.rowSelectorClicked,event,args)},_triggerCheckingEvent:function(event,args){return this._trigger(this.events.checkBoxStateChanging,event,args)},_triggerCheckedEvent:function(event,args){this._trigger(this.events.checkBoxStateChanged,event,args)},_getVisibleRowIndex:function(row){return row.closest("tbody").children("tr:not([data-container='true'],[data-grouprow='true'],[data-summaryrow='true'])").index(row)},_getVisibleHRowIndex:function(row){return row.closest("tbody").children("tr:not([data-container='true'])").index(row)},_animateCheckboxes:function(trans){var h=this._headerCheckbox(),c=this._allCheckboxes(),all=h.add(c);if(trans===true){all.css("visibility","visible").css("opacity",0).animate({opacity:1},1e3)}else{all.css("opacity",1e3).animate({opacity:0},1e3,function(){$(this).css("visibility","hidden")})}this._checkBoxesShown=trans},_cleanInterface:function(isRebind){var header,footer,cols,rsCells,w;if(isRebind===true){this._alterCheckbox(this._headerCheckbox(),false);return}cols=this.grid.element.children("colgroup").children("[data-role='rs']");cols=cols.add(this.grid.fixedBodyContainer().find("colgroup").children("[data-role='rs']"));if(this.grid.options.fixedHeaders===true){cols=cols.add(this.grid.headersTable().children("colgroup").children("[data-role='rs']"));cols=cols.add(this.grid.fixedHeadersTable().children("colgroup").children("[data-role='rs']"))}if(this.grid.options.fixedFooters===true){cols=cols.add(this.grid.footersTable().children("colgroup").children("[data-role='rs']"));cols=cols.add(this.grid.fixedFootersTable().children("colgroup").children("[data-role='rs']"))}footer=this._footerRowSelectorCells();header=this._headerRowSelectorCells();rsCells=this._allRowSelectorCells();if(!this.grid.options.width&&this._functionsRedirected){w=this.grid.container().css("width");if(w&&!w.endsWith("%")){this.grid.container().css("width",parseInt(w,10)-this.options.rowSelectorColumnWidth)}}cols.remove();footer.remove();header.remove();rsCells.remove()},_allRowSelectorCells:function(){var rowSelectors,grid=this.grid;if(grid.hasFixedColumns()&&this._getColumnFixingInstance().options.fixingDirection==="left"){if(grid.options.virtualization||grid.options.rowVirtualization){rowSelectors=grid.fixedBodyContainer().find("tbody > tr > th."+this.css.rowSelector);
}else{rowSelectors=grid.fixedBodyContainer().find("tbody > tr > th."+this.css.rowSelector)}}else{rowSelectors=grid.element.children("tbody").children("tr").children("th."+this.css.rowSelector)}return rowSelectors},_headerRowSelectorCells:function(){var headerCells=this.grid.headersTable().children("thead").find("th[data-role='rs']");if(headerCells.length===0&&this.grid.hasFixedColumns()){headerCells=this.grid.fixedHeadersTable().children("thead").find("th[data-role='rs']")}return headerCells},_footerRowSelectorCells:function(){var footerCells=this.grid.footersTable().children("tfoot").find("td[data-role='rs']");if(footerCells.length===0&&this.grid.hasFixedColumns()){footerCells=this.grid.fixedFootersTable().children("tfoot").find("td[data-role='rs']")}return footerCells},_allCheckboxes:function(){var checkboxes=this.grid.element.children("tbody").children("tr").children("th").find("span[name='chk']");if(checkboxes.length===0&&this.grid.hasFixedColumns()&&this._getColumnFixingInstance().options.fixingDirection==="left"){checkboxes=this.grid.fixedBodyContainer().find("tbody > tr > th span[name='chk']")}return checkboxes},_headerCheckbox:function(){var checkbox=this.grid.headersTable().children("thead").find("tr > th span[name='hchk']");if(checkbox.length===0&&this.grid.hasFixedColumns()&&this._getColumnFixingInstance().options.fixingDirection==="left"){checkbox=this.grid.fixedHeadersTable().children("thead").find("tr > th span[name='hchk']")}return checkbox},_rowSelectorFromSelection:function(info){var element=info.element,rs,checkbox=info.checkbox,fixingDir;if(element.is("th")){return}if(checkbox){rs=checkbox.parent()}else{if(element.is("tr")||element.length===2){rs=element.children("th:first")}else if(this.grid.hasFixedColumns()){fixingDir=this.grid.fixedBodyContainer().attr("data-fixing-direction");if(fixingDir==="left"&&!this.grid._isFixedElement(element)){rs=this.grid.fixedBodyContainer().find("tbody > tr").eq(element.closest("tr").index()).children("th:first")}else if(fixingDir==="right"&&this.grid._isFixedElement(element)){rs=this.grid.element.find("tbody > tr").eq(element.closest("tr").index()).children("th:first")}}if(!rs){rs=element.closest("tr").children("th:first")}checkbox=this.options.enableCheckBoxes?rs.children("span:last"):null}return{rowSelector:rs,checkbox:checkbox}},_checkForSelection:function(){var i,isSelection=false;for(i=0;i<this.grid.options.features.length;i++){if(this.grid.options.features[i].name==="Selection"){isSelection=true;if(this.options.enableCheckBoxes===true){this.grid.options.features[i].mode="row"}break}}if(isSelection===false){if(this.options.requireSelection===true){throw new Error(this._getLocaleValue("selectionNotLoaded"))}this._skipRefresh=true}},_checkForColumnVirtualization:function(){return this.grid.options.virtualizationMode!=="continuous"&&(this.grid.options.virtualization===true&&this.grid.options.width||this.grid.options.columnVirtualization===true)},_checkForRequireSelectionWithCheckboxes:function(){return this.options.requireSelection===false&&this.options.enableCheckBoxes===true},_createHandlers:function(){this._headerRenderedHandler=$.proxy(this._headerRendered,this);this._footerRenderedHandler=$.proxy(this._footerRendered,this);this._recordsRenderingHandler=$.proxy(this._recordsRendering,this);this._recordsRenderedHandler=$.proxy(this._recordsRendered,this);this._gridRenderedHandler=$.proxy(this._gridRendered,this);this._virtualDomBuiltHandler=$.proxy(this._rsRenderVirtualRecords,this);this._virtualRowsHandler=$.proxy(this._rrn,this);this._renderExtraHeaderCellHandler=$.proxy(this._renderExtraHeaderCells,this);this._renderExtraFooterCellHandler=$.proxy(this._renderExtraFooterCells,this);this._rsClickHandler=$.proxy(this._cellClick,this);this._rrHoverHandler=$.proxy(this._mouseHoverRow,this);this._rrLeaveHandler=$.proxy(this._mouseLeaveRow,this);this._checkboxMouseOverHandler=$.proxy(this._checkboxMouseOver,this);this._checkboxMouseOutHandler=$.proxy(this._checkboxMouseOut,this);this._checkboxClickHandler=$.proxy(this._checkBoxClicked,this);this._hCheckboxClickHandler=$.proxy(this._headerCheckBoxClicked,this)},_registerEvents:function(){this.grid.element.bind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.bind("iggridfooterrendered",this._footerRenderedHandler);this.grid.element.bind("iggridrowsrendering ",this._recordsRenderingHandler);this.grid.element.bind("iggridrowsrendered",this._recordsRenderedHandler);this.grid.element.bind("iggriddatarendered",this._gridRenderedHandler);this.grid.element.bind("iggridvirtualdombuilt",this._virtualDomBuiltHandler);this.grid.element.bind("iggridvirtualrecordsrender",this._virtualRowsHandler)},_unregisterEvents:function(){this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.unbind("iggridfooterrendered",this._footerRenderedHandler);this.grid.element.unbind("iggridrowsrendering ",this._recordsRenderingHandler);this.grid.element.unbind("iggridrowsrendered",this._recordsRenderedHandler);this.grid.element.unbind("iggriddatarendered",this._gridRenderedHandler);this.grid.element.unbind("iggridvirtualdombuilt",this._virtualDomBuiltHandler);this.grid.element.unbind("iggridvirtualrecordsrender",this._virtualRowsHandler)},_injectGrid:function(gridInstance,isRebind){if(isRebind===true){this._cleanInterface(true);return}this.grid=gridInstance;this._v=this.grid.options.virtualization===true||this.grid.options.rowVirtualization===true;this._gridRenderColgroupHandler=$.proxy(this.grid._renderColgroup,this.grid);this._renderColgroupHandler=$.proxy(this.rsRenderColgroup,this);this._createHandlers();this.grid._headerInitCallbacks.push({type:"RowSelectors",func:this._renderExtraHeaderCellHandler});this.grid._footerInitCallbacks.push({type:"RowSelectors",func:this._renderExtraFooterCellHandler});this._registerEvents();this.grid._renderColgroup=this._renderColgroupHandler;this._checkForSelection();if(this._checkForColumnVirtualization()){throw new Error(this._getLocaleValue("columnVirtualizationEnabled"))}if(this._checkForRequireSelectionWithCheckboxes()){throw new Error(this._getLocaleValue("requireSelectionWithCheckboxes"))}if(String(this.grid.options.templatingEngine).toLowerCase()==="jsrender"){this._jsr=true;if(this.options.selectAllForPagingTemplate&&typeof this.options.selectAllForPagingTemplate==="string"){$.templates(this.grid.id()+"_selectAllForPagingTemplate",this.options.selectAllForPagingTemplate)}if(this.options.deselectAllForPagingTemplate&&typeof this.options.deselectAllForPagingTemplate==="string"){$.templates(this.grid.id()+"_deselectAllForPagingTemplate",this.options.deselectAllForPagingTemplate)}}},_getAllData:function(){return this.grid.dataSource.data()},_getDataView:function(){if(this.grid.dataSource.isGroupByApplied()){return this.grid.dataSource.dataView()}return this.grid._getDataView()}});$.extend($.ui.igGridRowSelectors,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI Grid Selection (and Keyboard navigation) 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 */
(function($){$.widget("ui.igGridSelection",$.ui.igWidget,{css:{selectedCell:"ui-iggrid-selectedcell ui-state-active",selectedRow:"ui-iggrid-selectedrow ui-state-active",activeCell:"ui-iggrid-activecell ui-state-focus",activeRow:"ui-iggrid-activerow ui-state-focus"},options:{multipleSelection:false,mouseDragSelect:true,mode:"row",activation:true,wrapAround:true,skipChildren:true,multipleCellSelectOnClick:false,touchDragSelect:true,persist:true,allowMultipleRangeSelection:true},events:{rowSelectionChanging:"rowSelectionChanging",rowSelectionChanged:"rowSelectionChanged",cellSelectionChanging:"cellSelectionChanging",cellSelectionChanged:"cellSelectionChanged",activeCellChanging:"activeCellChanging",activeCellChanged:"activeCellChanged",activeRowChanging:"activeRowChanging",activeRowChanged:"activeRowChanged"},_create:function(){this._isMouseDown=false;this._pkProp=null;this._rsCellKey="##ROWSEL##";this._gbExpandCellKey="##GBXCEL##";this._gbSummaryCellKey="##GBSCEL##";this._gbEmptyCellKey="##GBECEL##";this._gbGroupSummaryIconCellKey="##GBGSICEL##";this._gbGroupSummaryEmptyCellKey="##GBGSECEL##";this._gbGroupSummaryCellKey="##GBGSCEL_{col}##";this._hgCellKey="##HIEGRD##";this._tgExpandKey="##TGXCEL##";this.element.attr("aria-multiselectable",this.options.multipleSelection)},destroy:function(){this.grid.element.unbind({iggriddatarendering:this._dataRenderingHandler,iggridvirtualrendering:this._virtualRecordsRenderingHandler,igtreegridvirtualrendering:this._virtualRecordsRenderingHandler,iggridvirtualrecordsrender:this._virtualRecordsRendererHandler,igtreegridvirtualrecordsrender:this._virtualRecordsRendererHandler,iggridcolumnscollectionmodified:this._columnsCollectionModifiedHandler});this.clearSelection();this._unregisterEvents();this._selection.removeSubscriber(this._subId,this.grid.id());this._superApply(arguments);return this},_registerWidget:$.noop,_unregisterWidget:$.noop,_setOption:function(key,value){var rs;$.Widget.prototype._setOption.apply(this,arguments);if(key==="mode"){throw new Error(this._getLocaleValue("optionChangeNotSupported").replace("{optionName}",key))}if(key==="multipleSelection"){this._selection.settings.multipleSelection=value;rs=this.grid.element.data("igGridRowSelectors");if(rs){if(value){rs._renderHeaderRowSelectors(this.grid)}else{rs._headerCheckbox().remove()}}}},_dataRendering:function(event,ui){var tbody;if(ui.owner.id()!==this.grid.id()){return}tbody=this.grid.element.find("tbody").add(this.grid.fixedBodyContainer().find("tbody"));if(this._tbodyBinding){tbody.unbind(this._tbodyBinding)}this._pkProp=this.grid.options.primaryKey;if(this.options.persist&&!this.grid.options.primaryKey){this._createUidForData();this._pkProp="ig_pk"}},_dataRendered:function(){this._unregisterEvents();this._registerEvents();if(this._hc===undefined){this._hc=this.grid.container().closest(".ui-iggrid-root").length>0;if(this._hc===false){this._hc=this.grid.element.hasClass("ui-iggrid-root")}}this.grid._startRowIndex=this.grid._startRowIndex||0;this._defaultAttributes();if(this.options.persist){this._paintActive();this._renderAttributes();this._selection.invalid=true}else{this.clearSelection()}},_fixedColumnsChanged:function(args){if(args.isToFix&&args.isInit){this._unregisterEvents();this._registerEvents();this._selection.invalid=true}},_virtualRecordsRendering:function(){this._storedActiveElement=this.activeCell()||this.activeRow();if(this._storedActiveElement){this._storedActiveElement.element.blur()}},_virtualRecordsRender:function(evt,ui){var ae;if(ui.owner.id()!==this.grid.id()){return}this._selection.invalid=true;$(document).unbind("keydown."+this.grid.id());if(this.grid.options.virtualization===true&&this.grid.options.virtualizationMode==="continuous"){this._unregisterEvents();this._registerEvents()}this._paintActive();this._renderAttributes();if(this.options.mode==="cell"){ae=this.activeCell()}else{ae=this.activeRow()}if(ae&&ae.element instanceof $){ae.element.focus()}else if(this._storedActiveElement){if(this.options.mode==="cell"){this._getCellByIdentifier(this._storedActiveElement).focus()}else{this._getRowsByIdentifier(this._storedActiveElement.id).focus()}}},_columnsCollectionModified:function(evt,ui){if(ui.owner.id()===this.grid.id()){this._unregisterEvents();this._registerEvents();this._selection.invalid=true;this._paintActive()}},_hidingFinished:function(){if(this.options.persist){this._paintActive();this._selection.invalid=true}},_rowDeleted:function(rowId){var cellsForRow,colKey,cellId;this._selection.invalid=true;if(this.options.mode==="cell"){if(this._selection.settings.owner===this.grid){if(this._selection.activeElement&&this._selection.activeElement.id===rowId){this._selection.deactivate()}cellsForRow=this._selection.selection[rowId];for(colKey in cellsForRow){if(cellsForRow.hasOwnProperty(colKey)){cellId={id:rowId,columnKey:colKey};this._selection.deselect(cellId,null,false)}}}}else{if(this._selection.isActive(rowId,this.grid)){this._selection.deactivate()}if(this._selection.isSelected(rowId,this.grid)){this._selection.deselect(rowId,null,false)}}},_mouseDown:function(event){var target,targetGrid,gOpts=this.grid.options,re=new RegExp("^"+this.grid.id()+"(_fixed)?$"),hasVirtualization=gOpts.virtualization||gOpts.rowVirtualization||gOpts.columnVirtualization,scrollCont=hasVirtualization?this.grid._vdisplaycontainer():this.grid.scrollContainer();if(event&&event.which!==1){return}target=event&&event.target?$(event.target):null;this._mouseDownTarget=target;this._mouseDownScroll=scrollCont.length?scrollCont.scrollTop():0;this._prevDragTar=target[0];this._previousRangeCache=event.ctrlKey||event.metaKey?[]:null;if(this.options.allowMultipleRangeSelection&&this.options.mode==="cell"){this._selection._lockSelection()}targetGrid=target?target.closest(".ui-iggrid-table"):null;if(target&&target.hasClass("ui-iggrid-scrolldiv")){return}if(targetGrid&&targetGrid.length>0&&!targetGrid.attr("id").match(re)){return}this._isMouseDown=true;if(this.options.mouseDragSelect===false||this.options.multipleSelection===false||this.options.mode==="row"){return}this._firstDragCell=target},_mouseMove:function(event){var target=event&&event.target?$(event.target):null,fdc=this._firstDragCell,re,$tbl;if(event&&this._suspend){return}if(this.options.mode!=="cell"||!this.options.mouseDragSelect||!this._isMouseDown){return}target=target.closest("td,th");if(fdc&&fdc.length>0){$tbl=fdc.closest(".ui-iggrid-table");re=new RegExp("^"+this.grid.id()+"(_fixed)?$");if(target[0]!==this._prevDragTar&&target.closest(".ui-iggrid-table").attr("id").match(re)&&$tbl.length&&$tbl.attr("id").match(re)&&!(target.is("th")||target.attr("data-skip"))){this._selection.rangeSelectStart=this._identifierForTarget(fdc);this._dragSelect=true;this._prevDragTar=target[0];this._shiftSelectChange(target,false);this._storedActiveIndex=target.closest("td").index()}}},_mouseUp:function(event){var gOpts=this.grid.options,hasVirtualization=gOpts.virtualization||gOpts.rowVirtualization||gOpts.columnVirtualization,scrollCont=hasVirtualization?this.grid._vdisplaycontainer():this.grid.scrollContainer(),target=event&&event.target?$(event.target):null,targetGrid=target?target.closest(".ui-iggrid-table"):null,re=new RegExp("^"+this.grid.id()+"(_fixed)?$"),shouldCancel,self=this,ctrl;if(targetGrid&&targetGrid.length>0&&!targetGrid.attr("id").match(re)){return}this._isMouseDown=false;if(!target||this._dragSelect||this._suspend||!this._mouseDownTarget||this._mouseDownTarget[0]!==target[0]||event.which>1||$.ig.util.isTouch&&(scrollCont.length?scrollCont.scrollTop():0)!==this._mouseDownScroll){this._dragSelect=false;this._prevDragTar=null;this._firstDragCell=null;this._mouseDownTarget=null;return}if(target.closest(".ui-iggrid-rowselector-class").length===1||target.hasClass("ui-iggrid-childarea")||target.parent().hasClass("ui-iggrid-childarea")||target.hasClass("ui-widget-header")){return}if(this._hc){target.parents("tr[data-container]").each(function(){if($(this).closest(".ui-iggrid-table").attr("id")===self.grid.element.attr("id")){shouldCancel=true;return false}});if(shouldCancel){return}}if(event.shiftKey&&this.options.multipleSelection){this._shiftSelectChange(target,true)}else{ctrl=event.ctrlKey||event.metaKey||this.options.mode==="cell"&&this.options.multipleCellSelectOnClick;this._singleSelectChange(target,ctrl)}this._maxHistoryLength=this.grid.options.columns.length;this._selectionHistory=[{elem:target,elemIndex:target.index(),rowOfElem:target.closest("tr"),prevSelected:null,keyCode:null}]},_touchStart:function(event){event.target=$(document.elementFromPoint(event.originalEvent.touches[0].clientX,event.originalEvent.touches[0].clientY));event.which=1;if(event.target.hasClass("ui-iggrid-selectedcell")&&event.target.hasClass("ui-state-focus")){this._canDrag=true}else{this._canDrag=false}this._mouseDown(event)},_touchEnd:function(event){event.target=$(document.elementFromPoint(event.originalEvent.changedTouches[0].clientX,event.originalEvent.changedTouches[0].clientY));this._canDrag=false;this._mouseUp(event)},_touchMove:function(event){if(!this._isMouseDown||!this._canDrag){return true}event.preventDefault();event.target=$(document.elementFromPoint(event.originalEvent.touches[0].clientX,event.originalEvent.touches[0].clientY));this._mouseMove(event)},_pointerDown:function(event){this.grid.element.css("-ms-touch-action","none");this._mouseDown(event)},_pointerMove:function(event){this._mouseMove(event)},_pointerUp:function(event){this.grid.element.css("-ms-touch-action","auto");this._mouseUp(event)},_keyDown:function(event){var target,tId,targetGrid,re=new RegExp("^"+this.grid.id()+"(_fixed)?$"),el;if(event&&this._suspend){return}if(this.grid!==this._selection.settings.owner){return}if(this._isMouseDown===true){return}if(this.options.activation!==true){return}if(event.keyCode!==$.ui.keyCode.ENTER&&event.keyCode!==$.ui.keyCode.SPACE&&event.keyCode!==$.ui.keyCode.UP&&event.keyCode!==$.ui.keyCode.DOWN&&event.keyCode!==$.ui.keyCode.LEFT&&event.keyCode!==$.ui.keyCode.RIGHT){return}target=event&&event.target?$(event.target):null;tId=target?this._identifierForTarget(target):null;targetGrid=target?target.closest(".ui-iggrid-table"):null;if(targetGrid&&targetGrid.length>0&&!targetGrid.attr("id").match(re)){return}if(this._selection.activeElement===null||this._selection.activeElement===undefined){if(this.options.mode==="cell"){el=target.children("td:not([data-skip='true']):first");if(!el.length){return}this._singleSelectChange(el,false,false);if(event.keyCode===$.ui.keyCode.SPACE){event.preventDefault()}return}el=target.closest("tr");if(!el.length){return}this._selection.activate(this._identifierForRow(el),el)}event.preventDefault();if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){if(this._suppressKey(event.keyCode)){return}if(!this._isDataElement(this._selection.activeElement)||!this._canBeSelected(tId,target)){this._handleToggle(event.ctrlKey||event.metaKey)}else{this._selection.toggle()}return}this._navigate(event.keyCode,event.ctrlKey||event.metaKey,event.shiftKey)},_selectStart:function(event){var re=new RegExp("^"+this.grid.id()+"(_fixed)?$"),target=event.target?$(event.target):null,targetGrid=target?target.closest(".ui-iggrid-table"):$();if(targetGrid.length>0&&!targetGrid.attr("id").match(re)){return}if(event&&this._suspend){return}if(this.options.mouseDragSelect===false||this.options.multipleSelection===false){return false}event.preventDefault()},_selectStartContainer:function(event){if(event.target&&$(event.target).hasClass("ui-iggrid-fixedcontainer")){event.preventDefault()}},_tbodyFocusIn:function(event){var target=event&&event.target?$(event.target):null,targetGrid=target?target.closest(".ui-iggrid-table"):null,re=new RegExp("^"+this.grid.id()+"(_fixed)?$"),reo;if(target.is("[data-rs-select-all]")||target.is("[data-rs-deselect-all]")){targetGrid=target?target.closest(".ui-iggrid").find(".ui-iggrid-table"):null}if(this._selection.settings.owner){reo=new RegExp("^"+this._selection.settings.owner.id()+"(_fixed)?$")}if(targetGrid&&targetGrid.length>0){if(!targetGrid.attr("id").match(re)){return}if(reo&&!targetGrid.attr("id").match(reo)){this._selection.changeOwner(this.grid)}}if(this.options.mode==="row"){if(target.is("tr")){this._selection.activate(this._identifierForRow(target),target)}}else{if(target.is("td")){this._selection.activate(this._identifierForTarget(target),target);if(!target.attr("data-gbsummary")){this._storedActiveIndex=target.index()}}}},_tbodyFocusOut:function(event){var target=event&&event.target?$(event.target):null,targetGrid=target?target.closest(".ui-iggrid-table"):null,re=new RegExp("^"+this.grid.id()+"(_fixed)?$"),id;if(targetGrid&&targetGrid.length>0&&!targetGrid.attr("id").match(re)){return}if(this.options.mode==="row"){if(target.is("tr")){id=this._identifierForRow(target);if(this._selection.isActive(id)){this._selection.deactivate()}}}else{if(target.is("td")){id=this._identifierForTarget(target);if(this._selection.isActive(id)){this._selection.deactivate()}}}},_preventDefault:function(event){if($(event.target).is("td")){event.preventDefault()}},_releaseMouse:function(){this._dragSelect=false;this._firstDragCell=null;this._isMouseDown=false;this._mouseDownTarget=null},_applyCellStyle:function(data,col){var identifier={id:data[this._pkProp],columnKey:col};return this._selection.isSelected(identifier,this.grid)?this.css.selectedCell:""},_applyRowStyle:function(data){var id=data.__gbRecord?data.id:data[this._pkProp];return this._selection.isSelected(id,this.grid)?this.css.selectedCell:""},_paintActive:function(){if(this._selection.activeElement&&this._selection.settings.owner===this.grid){if(this.options.mode==="row"){this._getRowsByIdentifier(this._selection.activeElement).addClass(this.css.activeRow)}else{this._getCellByIdentifier(this._selection.activeElement).addClass(this.css.activeCell)}}},_renderAttributes:function(){if(this._selection.selectionLength()){if(this.options.mode==="row"){this.grid.element.children("tbody").find("td.ui-iggrid-selectedcell").closest("tr").attr("aria-selected",true);this.grid.fixedBodyContainer().find("tbody").find("td.ui-iggrid-selectedcell").closest("tr").attr("aria-selected",true)}else{this.grid.element.children("tbody").find("td.ui-iggrid-selectedcell").attr("aria-selected",true);this.grid.fixedBodyContainer().find("tbody").find("td.ui-iggrid-selectedcell").attr("aria-selected",true)}}else{if(this.options.mode==="row"){this.grid.element.children("tbody").find("td:not('.ui-iggrid-selectedcell')").closest("tr").attr("aria-selected",false);this.grid.fixedBodyContainer().find("tbody").find("td:not('.ui-iggrid-selectedcell')").closest("tr").attr("aria-selected",false)}else{this.grid.element.children("tbody").find("td:not('.ui-iggrid-selectedcell')").attr("aria-selected",false);this.grid.fixedBodyContainer().find("tbody").find("td:not('.ui-iggrid-selectedcell')").attr("aria-selected",false)}}},_defaultAttributes:function(){if(this.options.mode==="row"){this.grid.element.children("tbody").children("tr").attr("aria-selected",false);this.grid.fixedBodyContainer().find("tbody").children("tr").attr("aria-selected",false)}else{this.grid.element.children("tbody").find("td").attr("aria-selected",false);this.grid.fixedBodyContainer().find("tbody").find("td").attr("aria-selected",false)}},clearSelection:function(){this._selection.cleanAll(this.grid)},selectCell:function(row,col,isFixed){var rowElement,cellId,cellElement,record;if(this.options.mode==="row"){return}if(this._isOutOfView(row,col)){record=this.grid._getDataView()[row];if(!record){return}if(this.grid._visibleColumns().length<col||col<0){return}cellId={id:this._pkProp?row[this._pkProp]:row,columnKey:this.grid._visibleColumns()[col].key};cellElement=$()}else{row-=this.grid._startRowIndex||0;col-=this.grid._startColIndex||0;rowElement=this._getRowByIndex(row,isFixed);cellId=this._identifierForCell(this._getCellByIndex(col,rowElement));cellElement=this._getCellByIdentifier(cellId)}if(this._selection.settings.owner!==this.grid){this._selection.changeOwner(this.grid)}if(this.options.activation){if($.ig.util.isTouchDevice()){this.grid._setIgScrollPositionTop(0)}this._selection.activate(cellId,cellElement)}if(!this._selection.isSelected(cellId,this.grid)){this._selection.select(cellId,true,{element:cellElement},true)}},selectCellById:function(id,colKey){var identifier={id:id,columnKey:colKey};if(this.options.mode==="row"){return}if(!this._selection.isSelected(identifier,this.grid)){if(this._selection.settings.owner!==this.grid){this._selection.changeOwner(this.grid)}this._selection.select(identifier,true,{element:this._getCellByIdentifier(identifier)},true)}},deselectCell:function(row,col,isFixed){var rowElement,cellId,cellElement;row-=this.grid._startRowIndex||0;col-=this.grid._startColIndex||0;rowElement=this._getRowByIndex(row,isFixed);cellId=this._identifierForCell(this._getCellByIndex(col,rowElement));cellElement=this._getCellByIdentifier(cellId);if(this.options.mode==="row"){return}if(this._selection.isSelected(cellId,this.grid)){this._selection.deselect(cellId,{element:cellElement},true)}},deselectCellById:function(id,colKey){var identifier={id:id,columnKey:colKey};if(this.options.mode==="row"){return}if(this._selection.isSelected(identifier,this.grid)){this._selection.deselect(identifier,{element:this._getCellByIdentifier(identifier)},true)}},selectRow:function(index){var row,rowId;if(this.options.mode==="cell"){return}if(this._isOutOfView(index)){row=this.grid._getDataView()[index];if(!row){return}rowId=this._pkProp?row[this._pkProp]:index;row=$()}else{index-=this.grid._startRowIndex||0;row=this._getRowByIndex(index,false).add(this._getRowByIndex(index,true));rowId=this._identifierForRow(row.eq(0))}if(this._selection.settings.owner!==this.grid){this._selection.changeOwner(this.grid)}if(this.options.activation){if($.ig.util.isTouchDevice()){this.grid._setIgScrollPositionTop(0)}this._selection.activate(rowId,row)}if(!this._selection.isSelected(rowId,this.grid)){this._selection.select(rowId,true,{element:row},true)}},selectRowById:function(id){if(this.options.mode==="cell"){return}if(!this._selection.isSelected(id,this.grid)){if(this._selection.settings.owner!==this.grid){this._selection.changeOwner(this.grid)}this._selection.select(id,true,{element:this._getRowsByIdentifier(id)},true)}},deselectRow:function(index){var row,rowId;index-=this.grid._startRowIndex||0;row=this._getRowByIndex(index,false).add(this._getRowByIndex(index,true));rowId=this._identifierForRow(row.eq(0));if(this.options.mode==="cell"){return}if(this._selection.isSelected(rowId,this.grid)){this._selection.deselect(rowId,{element:row},true)}},deselectRowById:function(id){if(this.options.mode==="cell"){return}if(this._selection.isSelected(id,this.grid)){this._selection.deselect(id,{element:this._getRowsByIdentifier(id)},true)}},selectedCells:function(){if(this._selection.settings.owner!==this.grid){return[]}return this.options.multipleSelection?this._selection.selectedCells():null},selectedRows:function(){if(this._selection.settings.owner!==this.grid){return[]}return this.options.multipleSelection?this._selection.selectedRows():null},selectedCell:function(){var selectedCells;if(this._selection.settings.owner!==this.grid){return null}selectedCells=this._selection.selectedCells();return this.options.multipleSelection?null:selectedCells.length===1?selectedCells[0]:null},selectedRow:function(){var selectedRows;if(this._selection.settings.owner!==this.grid){return null}selectedRows=this._selection.selectedRows();return this.options.multipleSelection?null:selectedRows.length===1?selectedRows[0]:null},activeCell:function(){if(this.options.mode==="row"){return null}if(this._selection.settings.owner!==this.grid){return null}return this._selection.activeCell()},activeRow:function(){if(this.options.mode==="cell"){return null}if(this._selection.settings.owner!==this.grid){return null}return this._selection.activeRow()},_singleSelectChange:function(target,ctrlKey){var tId,tIdx,oldT=target;if(this.options.mode==="row"){target=target.closest("tr");target.addClass("initially-focused");if(this.grid.hasFixedColumns()){tIdx=target.index();target=target.add(this._getRowByIndex(tIdx,!this.grid._isFixedElement(target)))}}else{target=target.closest("td")}if(this._selection.settings.owner!==this.grid){this._selection.changeOwner(this.grid)}tId=this._identifierForTarget(target);if(this.options.activation&&(oldT.is("tr")||oldT.is("td"))){this._selection.activate(tId,target)}if(this._canBeSelected(tId,target)){this._selection.select(tId,ctrlKey,{element:target})}},_shiftSelectChange:function(target){var tId,rangeStats,keep=this.options.mode==="cell"&&this.options.allowMultipleRangeSelection,v=this.grid.options.virtualization||this.grid.options.rowVirtualization||this.grid.options.columnVirtualization;target=this.options.mode==="row"?target.closest("tr"):target.closest("td");if(this._selection.settings.owner!==this.grid){this._selection.changeOwner(this.grid)}tId=this._identifierForTarget(target);if(!this._canBeSelected(tId,target)){return}if(this._selection.rangeSelectStart===null||this._selection.rangeSelectStart===undefined){this._selection.rangeSelectStart=tId;this._selection.rangeSelectEnd=null}else if(this._selection.rangeSelectEnd===tId||this._selection.rangeSelectStart===this._selection.rangeSelectEnd&&this._selection.rangeSelectStart===tId){return}else{this._selection.rangeSelectEnd=tId}if(v){rangeStats=this._getRecordRange(this._selection.rangeSelectStart,tId)}else{rangeStats=this._getElementRange(this._selection.rangeSelectStart,tId)}if(!rangeStats.range||!rangeStats.range.length){return}if(keep){this._selection.rangeSelect(rangeStats.range,false,this._previousRangeCache,rangeStats,false);this._previousRangeCache=rangeStats.range}else{this._selection.rangeSelect(rangeStats.range,false,null,rangeStats,false)}},_navigate:function(code,ctrlKey,shiftKey,prevElementOverride){var prevActiveElement=prevElementOverride||this._selection.activeElement,nextActiveElementParent,childSelection,nextActiveElement=this._getNextActiveElement(code,!shiftKey&&this.options.wrapAround,prevActiveElement);if(!nextActiveElement||nextActiveElement.length===0){return}nextActiveElementParent=nextActiveElement.closest(".ui-iggrid-table");if(nextActiveElementParent.attr("id")!==this.grid.id()&&nextActiveElement.closest(".ui-iggrid").attr("id")!==this.grid.container().attr("id")){childSelection=nextActiveElementParent.data("igGridSelection");this._selection.changeOwner(childSelection.grid);nextActiveElementParent.closest(".ui-iggrid").focus();childSelection._storedActiveIndex=null;childSelection._navigateOwn(nextActiveElement,prevActiveElement,code,ctrlKey,shiftKey)}else{this._navigateOwn(nextActiveElement,prevActiveElement,code,ctrlKey,shiftKey)}},_navigateOwn:function(nextActiveElement,prevActiveElement,code,ctrlKey,shiftKey){var nextId=this._identifierForTarget(nextActiveElement),prevElement=this._selection.elementFromIdentifier(prevActiveElement),prevRowIndex=prevElement.is("tr")?this.grid.getElementInfo(prevElement).rowIndex:0,nextRowIndex=nextActiveElement.is("tr")?this.grid.getElementInfo(nextActiveElement).rowIndex:0,deselectRowOnShift=false;if(nextActiveElement.is("tr")&&this.grid.hasFixedColumns()){nextActiveElement.addClass("initially-focused");nextActiveElement=nextActiveElement.add(this._getRowByIndex(nextActiveElement.index(),!this.grid._isFixedElement(nextActiveElement)))}if(!nextActiveElement.is("tr")&&nextId.columnKey.startsWith("##")&&shiftKey){this._navigate(code,ctrlKey,shiftKey,nextId);return}this._selection.activate(nextId,nextActiveElement);if(ctrlKey){this._setScroll(code,nextActiveElement);return}if(shiftKey){if(this.options.mode==="row"||!this.options.multipleSelection){if(!this._rangeSelectionStartIndex){this._rangeSelectionStartIndex=prevRowIndex}if(nextRowIndex-prevRowIndex<0&&prevRowIndex>this._rangeSelectionStartIndex||nextRowIndex-prevRowIndex>0&&prevRowIndex<this._rangeSelectionStartIndex){deselectRowOnShift=true}if(deselectRowOnShift&&this._canBeSelected(prevActiveElement,prevElement)&&(this._selection.isSelected(this._selection.activeElement,this.grid)||!this._canBeSelected(nextId,nextActiveElement))){this._selection.deselect(prevActiveElement)}else if(!deselectRowOnShift&&this._canBeSelected(nextId,nextActiveElement)){this._selection.toggle(nextActiveElement)}}else{this._shiftSelectChange(nextActiveElement,false)}}else{if(nextId.columnKey&&nextId.columnKey.startsWith("##")||!this._canBeSelected(nextId,nextActiveElement)){if(this._selection.isSelected(prevActiveElement)){this._selection.clearSelection()}}else{this._rangeSelectionStartIndex=null;this._selection.select(nextId,false,{element:nextActiveElement})}}this._setScroll(code,nextActiveElement)},_handleToggle:function(ctrlKey){var element=this._selection.elementFromIdentifier(this._selection.activeElement),row,cell;if(element.is("th")){row=this._getRowsByIdentifier(this._selection.activeElement.id);if(this.grid.hasFixedColumns()&&this.grid._isFixedElement(element)){cell=this._firstDataCellForRow(row.first())}else{cell=this._firstDataCellForRow(row.last())}this._singleSelectChange(cell,ctrlKey)}else if(element.attr("data-parent")){element.closest(".ui-iggrid-root").igHierarchicalGrid("toggle",element.closest("tr"))}else if(element.hasClass("ui-igtreegrid-expansion-indicator-cell")&&element.attr("data-expand-cell")){element.closest(".ui-iggrid-table").igTreeGrid("toggleRow",element.closest("tr"))}},_getNextActiveElement:function(code,wrapAround,override){var currentActiveElement=override instanceof $?override:this._selection.elementFromIdentifier(override||this._selection.activeElement),currentRow=currentActiveElement.closest("tr"),currentCellIndex=currentActiveElement.index(),hasFixedCols=this.grid.hasFixedColumns(),isFixedElement=hasFixedCols?this.grid._isFixedElement(currentActiveElement):false,fixingDir=this.grid.fixingDirection(),nextElement,nextElementIndex,nextRow,wrapped,go=this.grid.options,vVirt=go.virtualization||go.rowVirtualization,cellRowSpan=currentActiveElement.attr("rowspan")!==undefined,cellColSpan=currentActiveElement.attr("colspan")!==undefined,cellColSpanVal=parseInt(currentActiveElement.attr("colspan")),hierRowSkip=this.options.skipChildren?"[data-container=true]":"",lastSmallSelection;if(!this._rowMergeOffset){this._rowMergeOffset=0}if(this._selectionHistory&&this._selectionHistory.length===1){this._rowMergeOffset=0}if(code===$.ui.keyCode.UP){nextRow=this._getPrevRow(currentRow,wrapAround,isFixedElement,false,vVirt);currentRow=nextRow;if(this.options.mode==="row"||!nextRow){return nextRow}nextElementIndex=currentCellIndex>=nextRow.children().length?nextRow.children().length-1:this._storedActiveIndex||currentCellIndex;nextElement=nextRow.children().eq(nextElementIndex);if(this._rowMergeOffset!==0){nextElementIndex+=this._rowMergeOffset;nextElement=nextRow.children().eq(nextElementIndex);this._rowMergeOffset=0}if(nextElement.attr("aria-rowmerged")!==undefined){while(nextElement.attr("aria-rowmerged")!==undefined){this._rowMergeOffset++;nextElementIndex--;nextElement=nextRow.children().eq(nextElementIndex)}}while(!nextElement.is(":visible")&&nextElement.attr("aria-rowmerged")===undefined){nextRow=this._getPrevRow(currentRow,wrapAround,isFixedElement,false,vVirt);currentRow=nextRow;if(this.options.mode==="row"||!nextRow){return nextRow}nextElement=nextRow.children().eq(nextElementIndex)}}else if(code===$.ui.keyCode.DOWN){nextRow=this._getNextRow(currentRow,wrapAround,isFixedElement,false,vVirt);if(cellRowSpan){var rowspan=parseInt(currentActiveElement.attr("rowspan"));nextRow=this._getRowByIndex(currentRow.index()+rowspan,isFixedElement);if(!nextRow.length){nextRow=this._firstRow(null,isFixedElement,hierRowSkip)}else if(nextRow.attr("data-container")){nextRow=this._firstRow(nextRow,isFixedElement,hierRowSkip)}}if(this.options.mode==="row"||!nextRow){return nextRow}nextElementIndex=currentCellIndex>=nextRow.children().length?nextRow.children().length-1:this._storedActiveIndex||currentCellIndex;nextElement=nextRow.children().eq(nextElementIndex);if(this._rowMergeOffset!==0){nextElementIndex+=this._rowMergeOffset;nextElement=nextRow.children().eq(nextElementIndex);this._rowMergeOffset=0}if(nextElement.attr("aria-rowmerged")!==undefined){while(nextElement.attr("aria-rowmerged")!==undefined){this._rowMergeOffset++;nextElementIndex--;nextElement=nextRow.children().eq(nextElementIndex)}}}else if(code===$.ui.keyCode.LEFT&&this.options.mode==="cell"){if(currentActiveElement.is(":first-child")){if(hasFixedCols&&!isFixedElement&&fixingDir==="left"){if(cellRowSpan&&this._selectionHistory.length>1){nextRow=this._getNextRowByEndMergedCell(code,wrapAround,isFixedElement,fixingDir)}else if(cellColSpan){currentCellIndex-=cellColSpanVal-1;nextRow=this._getRowByIndex(currentRow.index(),true)}else{nextRow=this._getRowByIndex(currentRow.index(),true)}}else if(hasFixedCols&&isFixedElement&&fixingDir==="right"){if(cellRowSpan&&this._selectionHistory.length>1){nextRow=this._getNextRowByEndMergedCell(code,wrapAround,isFixedElement,fixingDir)}else if(cellColSpan){currentCellIndex-=cellColSpanVal-1;nextRow=this._getRowByIndex(currentRow.index(),false)}else{nextRow=this._getRowByIndex(currentRow.index(),false)}}else{if(cellRowSpan&&this._selectionHistory.length>1){nextRow=this._getNextRowByEndMergedCell(code,wrapAround,isFixedElement,fixingDir)}else if(cellColSpan){currentCellIndex-=cellColSpanVal-1;nextRow=this._getPrevRow(currentRow,wrapAround,isFixedElement,hasFixedCols,vVirt)}else{nextRow=this._getPrevRow(currentRow,wrapAround,isFixedElement,hasFixedCols,vVirt)}this._cleanHistorySavePrevRow(code,wrapAround,isFixedElement,hasFixedCols,vVirt)}wrapped=true}else{if(cellRowSpan&&this._selectionHistory.length>1){if(this._selectionHistory[0].keyCode===$.ui.keyCode.UP){currentRow=this._selectionHistory[1].rowOfElem;nextRow=this._getPrevRow(currentRow,wrapAround,isFixedElement,false,vVirt)}else if(this._selectionHistory[0].keyCode===$.ui.keyCode.DOWN){nextRow=this._selectionHistory[0].rowOfElem}else if(this._selectionHistory[0].keyCode===$.ui.keyCode.RIGHT){nextRow=this._selectionHistory[1].rowOfElem}else if(this._selectionHistory[0].keyCode===$.ui.keyCode.LEFT&&isFixedElement){lastSmallSelection=this._findLastSmallestCellGroupSelected();nextRow=this._getRowByIndex(lastSmallSelection.rowOfElem.index(),true)}else if(this._selectionHistory[0].keyCode===$.ui.keyCode.LEFT){lastSmallSelection=this._findLastSmallestCellGroupSelected();nextRow=this._getRowByIndex(lastSmallSelection.rowOfElem.index(),false)}else{nextRow=currentRow}}else{nextRow=currentRow}}if(!nextRow||nextRow.length===0){return null}nextElementIndex=wrapped?nextRow.children().length-1:currentCellIndex-1;nextElement=nextRow.children().eq(nextElementIndex);if(nextElement.attr("colspan")===undefined){this._rowMergeOffset=0}while(!nextElement.is(":visible")){if(nextElement.attr("aria-rowmerged")!==undefined){while(nextElement.attr("aria-rowmerged")!==undefined){this._rowMergeOffset++;nextElementIndex--;nextElement=nextRow.children().eq(nextElementIndex)}}else{nextRow=this._getPrevRow(nextRow,wrapAround,isFixedElement,false,vVirt);nextElementIndex=wrapped?nextRow.children().length-1:currentCellIndex-1;nextElement=nextRow.children().eq(nextElementIndex)}}this._revertH=wrapped}else if(code===$.ui.keyCode.RIGHT&&this.options.mode==="cell"){if(currentActiveElement.is(":last-child")){if(hasFixedCols&&isFixedElement&&fixingDir==="left"){if(cellRowSpan&&this._selectionHistory.length>1){nextRow=this._getNextRowByEndMergedCell(code,wrapAround,isFixedElement,fixingDir)}else if(cellColSpan){currentCellIndex+=cellColSpanVal-1;nextRow=this._getRowByIndex(currentRow.index(),false)}else{nextRow=this._getRowByIndex(currentRow.index(),false)}}else if(hasFixedCols&&!isFixedElement&&fixingDir==="right"){if(cellRowSpan&&this._selectionHistory.length>1){nextRow=this._getNextRowByEndMergedCell(code,wrapAround,isFixedElement,fixingDir)}else if(cellColSpan){currentCellIndex+=cellColSpanVal-1;
nextRow=this._getRowByIndex(currentRow.index(),true)}else{nextRow=this._getRowByIndex(currentRow.index(),true)}}else{if(cellRowSpan&&this._selectionHistory.length>1){nextRow=this._getNextRowByEndMergedCell(code,wrapAround,isFixedElement,fixingDir)}else if(cellColSpan){currentCellIndex+=cellColSpanVal-1;nextRow=this._getNextRow(currentRow,wrapAround,isFixedElement,hasFixedCols,vVirt)}else{nextRow=this._getNextRow(currentRow,wrapAround,isFixedElement,hasFixedCols,vVirt)}this._cleanHistorySaveNextRow(code,wrapAround,isFixedElement,hasFixedCols,vVirt)}wrapped=true}else{if(cellRowSpan&&this._selectionHistory.length>1){if(this._selectionHistory[0].keyCode===$.ui.keyCode.UP){currentRow=this._selectionHistory[1].rowOfElem;nextRow=this._getPrevRow(currentRow,wrapAround,isFixedElement,false,vVirt)}else if(this._selectionHistory[0].keyCode===$.ui.keyCode.DOWN){nextRow=this._selectionHistory[0].rowOfElem}else if(this._selectionHistory[0].keyCode===$.ui.keyCode.LEFT){nextRow=this._selectionHistory[1].rowOfElem}else if(this._selectionHistory[0].keyCode===$.ui.keyCode.RIGHT&&isFixedElement){lastSmallSelection=this._findLastSmallestCellGroupSelected();nextRow=this._getRowByIndex(lastSmallSelection.rowOfElem.index(),true)}else if(this._selectionHistory[0].keyCode===$.ui.keyCode.RIGHT){lastSmallSelection=this._findLastSmallestCellGroupSelected();nextRow=this._getRowByIndex(lastSmallSelection.rowOfElem.index(),false)}else{nextRow=currentRow}}else if(cellColSpan){if(this.grid.options.columns.length<=currentCellIndex+parseInt(cellColSpanVal)){currentCellIndex=-1;nextRow=this._getNextRow(currentRow,wrapAround,!isFixedElement,hasFixedCols,vVirt)}else{currentCellIndex+=parseInt(cellColSpanVal)-1;nextRow=currentRow}}else{nextRow=currentRow}}if(!nextRow){return null}nextElementIndex=wrapped?0:currentCellIndex+1;nextElement=nextRow.children().eq(nextElementIndex);if(nextElement.attr("colspan")===undefined){this._rowMergeOffset=0}while(!nextElement.is(":visible")){if(nextElement.attr("aria-rowmerged")!==undefined){while(nextElement.attr("aria-rowmerged")!==undefined){this._rowMergeOffset++;nextRow=this._getPrevRow(nextRow,wrapAround,isFixedElement,false,vVirt);nextElementIndex=wrapped?0:currentCellIndex+1;nextElement=nextRow.children().eq(nextElementIndex)}}else{nextRow=this._getPrevRow(nextRow,wrapAround,isFixedElement,false,vVirt);nextElementIndex=wrapped?0:currentCellIndex+1;nextElement=nextRow.children().eq(nextElementIndex)}}this._revertH=wrapped}if(nextElement&&!nextElement.attr("data-gbsummary")){this._storedActiveIndex=nextElementIndex}if(!this._selectionHistory){this._maxHistoryLength=this.grid.options.columns.length;this._selectionHistory=[{elem:nextElement,elemIndex:nextElementIndex,rowOfElem:nextRow,keyCode:null}]}else{this._selectionHistory.unshift({elem:nextElement,elemIndex:nextElementIndex,rowOfElem:nextRow,keyCode:code});if(this._selectionHistory.length>this._maxHistoryLength){this._selectionHistory.splice(this._maxHistoryLength)}}return nextElement},_findLastSmallestCellGroupSelected:function(){var i,nextCell,curCell,targetCell=this._selectionHistory[0],curRowspan=targetCell.elem&&targetCell.elem.attr("rowspan")?parseInt(targetCell.elem.attr("rowspan")):0;for(i=1;i<this._selectionHistory.length;i++){nextCell=this._selectionHistory[i-1];curCell=this._selectionHistory[i];if(nextCell.keyCode===$.ui.keyCode.UP||nextCell.keyCode===$.ui.keyCode.DOWN){break}if(curCell.elem===null||!curCell.elem.attr("rowspan")){return curCell}else if(parseInt(curCell.elem.attr("rowspan"))<curRowspan){targetCell=curCell;curRowspan=parseInt(targetCell.elem.attr("rowspan"))}}return targetCell},_cleanHistorySaveNextRow:function(keyCode,wrapAround,isFixedElement,hasFixedCols,vVirt){var smallestCell=this._findLastSmallestCellGroupSelected(),cellRow=smallestCell.rowOfElem,nextRow=this._getNextRow(cellRow,wrapAround,isFixedElement,hasFixedCols,vVirt);this._selectionHistory=[{elem:null,elemIndex:smallestCell.elemIndex,rowOfElem:nextRow?nextRow:cellRow,keyCode:keyCode}]},_cleanHistorySavePrevRow:function(keyCode,wrapAround,isFixedElement,hasFixedCols,vVirt){var smallestCell=this._findLastSmallestCellGroupSelected(),cellRow=smallestCell.rowOfElem,prevRow=this._getPrevRow(cellRow,wrapAround,isFixedElement,hasFixedCols,vVirt);this._selectionHistory=[{elem:null,elemIndex:smallestCell.elemIndex,rowOfElem:prevRow?prevRow:cellRow,keyCode:keyCode}]},_getNextRowByEndMergedCell:function(code,wrapAround,isFixedElement,fixingDir){var nextRow,hasFixedCols=this.grid.hasFixedColumns(),vVirt=this.grid.options.virtualization||this.grid.options.rowVirtualization,lastSmallSelection=this._findLastSmallestCellGroupSelected(),smallRowSelected=lastSmallSelection.rowOfElem,prevRowSelected=this._selectionHistory[1].rowOfElem;if(code===$.ui.keyCode.RIGHT){if(this._selectionHistory[0].keyCode===$.ui.keyCode.UP){nextRow=this._getRowByIndex(prevRowSelected.index(),hasFixedCols?!isFixedElement:false)}else if(isFixedElement&&fixingDir==="left"||!isFixedElement&&fixingDir==="right"){nextRow=this._getRowByIndex(smallRowSelected.index(),!isFixedElement)}else{nextRow=this._getNextRow(smallRowSelected,wrapAround,isFixedElement,hasFixedCols,vVirt)}}else if(code===$.ui.keyCode.LEFT){if(this._selectionHistory[0].keyCode===$.ui.keyCode.UP){nextRow=this._getPrevRow(prevRowSelected,wrapAround,isFixedElement,hasFixedCols,vVirt);nextRow=this._getPrevRow(nextRow,wrapAround,isFixedElement,hasFixedCols,vVirt);this._selectionHistory.shift();this._cleanHistorySavePrevRow(code,wrapAround,false,hasFixedCols,vVirt)}else if(!isFixedElement&&fixingDir==="left"||isFixedElement&&fixingDir==="right"){nextRow=this._getRowByIndex(smallRowSelected.index(),!isFixedElement)}else{nextRow=this._getPrevRow(smallRowSelected,wrapAround,isFixedElement,hasFixedCols,vVirt)}}return nextRow},_getNextRow:function(currentRow,wrapAround,isFixed,swap,virt){var hierRowSkip=this.options.skipChildren?"[data-container=true]":"",nextRow,cIdx;if(virt){cIdx=currentRow.index();if(cIdx>=this.grid._virtualRowCount-1){this._scrollVmanual(true);return null}}if(currentRow.first().parent().children((hierRowSkip.length>0?":not("+hierRowSkip+")":"")+":visible:last")[0]===currentRow[0]){if(wrapAround){nextRow=this._firstRow(null,swap?!isFixed:isFixed,hierRowSkip)}else{return}this._revertV=true}else{if(isFixed&&$.ig.util.isIE){currentRow.width()}if(swap){nextRow=this._getRowByIndex(currentRow.index()+1,!isFixed)}else{nextRow=currentRow.nextAll("tr"+(hierRowSkip.length>0?":not("+hierRowSkip+")":"")+":visible").first()}this._revertV=false}if(nextRow.attr("data-container")){nextRow=this._firstRow(nextRow,swap?!isFixed:isFixed,hierRowSkip)}return nextRow},_getPrevRow:function(currentRow,wrapAround,isFixed,swap,virt){var hierRowSkip=this.options.skipChildren?"[data-container=true]":"",nextRow,cIdx;if(virt){cIdx=currentRow.index();if(cIdx<=0){this._scrollVmanual(false);return null}}if(currentRow.is(":first-child")){if(wrapAround){nextRow=this._lastRow(null,swap?!isFixed:isFixed,hierRowSkip)}else{return}this._revertV=true}else{if(isFixed&&$.ig.util.isIE){currentRow.width()}if(swap){nextRow=this._getRowByIndex(currentRow.index()-1,!isFixed)}else{nextRow=currentRow.prevAll("tr"+(hierRowSkip.length>0?":not("+hierRowSkip+")":"")+":visible").first()}this._revertV=false}if(nextRow.attr("data-container")){nextRow=this._lastRow(nextRow,swap?!isFixed:isFixed,hierRowSkip)}return nextRow},_lastRow:function(container,fixed,rowSkip){var body;if(container){body=container.find("tbody")}else if(fixed){body=this.grid.fixedBodyContainer().find("tbody")}else{body=this.grid.element.children("tbody")}return body.children("tr"+(rowSkip.length>0?":not("+rowSkip+")":"")+":visible").last()},_firstRow:function(container,fixed,rowSkip){var body;if(container){body=container.find("tbody")}else if(fixed){body=this.grid.fixedBodyContainer().find("tbody")}else{body=this.grid.element.children("tbody")}return body.children("tr"+(rowSkip.length>0?":not("+rowSkip+")":"")).first()},_createUidForData:function(){var i=0,ds=this.grid.dataSource?this.grid.dataSource._data:[];for(i=0;i<ds.length;i++){if(!ds[i].ig_pk){ds[i].ig_pk=$.ig.util.getCheckSumForObject(ds[i])}}},_initSelectionCollection:function(){var rootGrid,opts;rootGrid=this.grid.element.closest(".ui-iggrid-root");if(rootGrid.length>0){rootGrid=rootGrid.data("igGrid")}else{rootGrid=this.grid}opts={multipleSelection:this.options.multipleSelection,byIndex:this._pkProp===null,owner:this.grid};if(this.options.mode==="row"){rootGrid._selectionCollection=rootGrid._selectionCollection||new $.ig.SelectedRowsCollection(opts)}else{rootGrid._selectionCollection=rootGrid._selectionCollection||new $.ig.SelectedCellsCollection(opts)}this._selection=rootGrid._selectionCollection;this.grid._selection=this._selection;if(!this._subId){this._subId=this._selection.addSubscriber(this,this.grid.id())}},_setScroll:function(code,nextActiveElement){var scrollHDir;var scrollVDir=this._revertV?code===$.ui.keyCode.DOWN||code===$.ui.keyCode.RIGHT?"up":"down":code===$.ui.keyCode.DOWN||code===$.ui.keyCode.RIGHT?"down":"up";this._setScrollTop(nextActiveElement,this.grid.element.parent(),nextActiveElement.closest("tr"),scrollVDir,nextActiveElement.closest("tr").index());if(this.options.mode==="cell"&&(code===$.ui.keyCode.LEFT||code===$.ui.keyCode.RIGHT)&&!this.grid._isFixedElement(nextActiveElement)){scrollHDir=this._revertH?code===$.ui.keyCode.LEFT?"right":"left":code===$.ui.keyCode.LEFT?"left":"right";this._setScrollLeft(this.grid._hscrollbarcontent(),nextActiveElement,scrollHDir,nextActiveElement.index())}},_setScrollTop:function(nextActiveElement,parent,child,direction,index){var childh,isDown,isUp,v,c,parentOffset=parent.igOffset(),childOffset=child.igOffset();if(!child||child.length===0){return}v=this.grid.options.virtualization||this.grid.options.rowVirtualization;c=v&&this.grid.options.virtualizationMode==="continuous";if(nextActiveElement.attr("rowspan")!==undefined){if(direction==="down"){childh=nextActiveElement.outerHeight()+child.outerHeight()-($(parent).outerHeight()-(childOffset.top-parentOffset.top))}else{childh=child.outerHeight()-(childOffset.top-parentOffset.top)}}else{childh=v&&!c?parseInt(this.grid.options.avgRowHeight,10):child.outerHeight()}if(!v||c){if(nextActiveElement.attr("rowspan")!==undefined){isDown=childOffset.top+nextActiveElement.outerHeight()+this.grid._scrollbarWidth()>parentOffset.top+$(parent).outerHeight()}else{isDown=childOffset.top+childh+this.grid._scrollbarWidth()>parentOffset.top+$(parent).outerHeight()}isUp=childOffset.top-childh/2<=parentOffset.top||c&&index<0}if(index===0&&(!v||c)){parent[0].scrollTop=0}else if(direction==="down"){if(isDown){if(c){this.grid._onVirtualVerticalScroll({},childh,direction)}}}else{if(isUp){if(c){this.grid._onVirtualVerticalScroll({},childh,direction)}}}},_setScrollLeft:function(parent,child,direction,index){var parentOffset=parent.igOffset(),sc,childOffset=child.igOffset(),fullLeft;if(!child||!child.length||!parent.length){return}sc=this.grid.scrollContainer();fullLeft=childOffset.left+(sc.length>0?sc.scrollLeft():0);if(index===0){parent[0].scrollLeft=0;this.grid._synchronizeHScroll()}else if(direction==="right"){if(fullLeft+child.outerWidth()>parentOffset.left+parent.outerWidth()){parent[0].scrollLeft=fullLeft-(parentOffset.left+parent.outerWidth())+child.outerWidth();this.grid._synchronizeHScroll()}}else{if(childOffset.left<parentOffset.left){parent[0].scrollLeft=parent[0].scrollLeft-child.outerWidth();this.grid._synchronizeHScroll()}}},_scrollVmanual:function(down){var sc=$("#"+this.grid.element[0].id+"_scrollContainer"),h=parseInt(this.grid.options.avgRowHeight,10);this.grid._ignoreScroll=true;if(down){sc.scrollTop(sc.scrollTop()+h)}else{sc.scrollTop(sc.scrollTop()-h)}this.grid._onVirtualVerticalScroll();this.grid._ignoreScroll=false},_getRecordRange:function(start,end,data){var startRecord,endRecord,startRecordIndex,endRecordIndex,startPropIndex,endPropIndex,range=[],recordRange,propRange,i,j,dv=data?data:this.grid._getDataView(),srId,erId,vcols=this.grid._visibleColumns();if(this.options.mode==="row"){srId=start;erId=end}else{srId=start.id;erId=end.id}if(this._pkProp){for(i=0;i<dv.length;i++){if(dv[i][this._pkProp]===srId){startRecord=dv[i];startRecordIndex=i}if(dv[i][this._pkProp]===erId){endRecord=dv[i];endRecordIndex=i}if(startRecord&&endRecord){break}}}else{startRecord=srId>=0&&srId<dv.length?dv[srId]:null;startRecordIndex=srId;endRecord=erId>=0&&erId<dv.length?dv[erId]:null;endRecordIndex=erId}if(!startRecord||!endRecord){return}if(startRecordIndex>endRecordIndex){recordRange=dv.slice(endRecordIndex,startRecordIndex+1)}else{recordRange=dv.slice(startRecordIndex,endRecordIndex+1)}startRecordIndex=Math.min(startRecordIndex,endRecordIndex);if(this.options.mode==="row"){if(!this._pkProp){for(i=0;i<recordRange.length;i++){range.push({id:i+startRecordIndex})}}else{for(i=0;i<recordRange.length;i++){if(!recordRange[i].__gbRecord){range.push({id:recordRange[i][this._pkProp]})}}}return{startIndex:startRecordIndex,endIndex:endRecordIndex,active:end,element:this._getRowsByIdentifier(end),range:range}}for(i=0;i<vcols.length;i++){if(vcols[i].key===start.columnKey){startPropIndex=i}if(vcols[i].key===end.columnKey){endPropIndex=i}if(startPropIndex!==undefined&&endPropIndex!==undefined){break}}if(startPropIndex===undefined||endPropIndex===undefined){return}if(startPropIndex>endPropIndex){propRange=vcols.slice(endPropIndex,startPropIndex+1)}else{propRange=vcols.slice(startPropIndex,endPropIndex+1)}if(!this._pkProp){for(i=0;i<recordRange.length;i++){for(j=0;j<propRange.length;j++){range.push({id:{id:i+startRecordIndex,columnKey:propRange[j].key}})}}}else{for(i=0;i<recordRange.length;i++){for(j=0;j<propRange.length;j++){range.push({id:{id:recordRange[i][this._pkProp],columnKey:propRange[j].key}})}}}return{firstRowIndex:startRecordIndex,lastRowIndex:endRecordIndex,firstColumnIndex:startPropIndex,lastColumnIndex:endPropIndex,active:end,element:this._getCellByIdentifier(end),range:range}},_getElementRange:function(start,end){var startElement,endElement,startRowIndex,endRowIndex,range=[],i,reverse,rowRange,fixedRowRange,cellRange,rowIndex,isStartFixed,isEndFixed,rowIdentifier,rowElement;startElement=this._selection.elementFromIdentifier(start);endElement=this._selection.elementFromIdentifier(end);startRowIndex=this._getIndexForRow(startElement.closest("tr"));endRowIndex=this._getIndexForRow(endElement.closest("tr"));reverse=startRowIndex>endRowIndex;if(reverse){startRowIndex=startRowIndex+endRowIndex;endRowIndex=startRowIndex-endRowIndex;startRowIndex=startRowIndex-endRowIndex}rowRange=this.grid.element.find("tbody").children("tr:not([data-container]):visible").slice(startRowIndex,endRowIndex+1);if(this.grid.hasFixedColumns()){fixedRowRange=this.grid.fixedBodyContainer().find("tbody").children("tr:not([data-container]):visible").slice(startRowIndex,endRowIndex+1)}if(this.options.mode==="row"){for(i=0;i<rowRange.length;i++){rowIndex=i+startRowIndex;rowIdentifier=this._identifierForRow(rowRange.eq(i));rowElement=rowRange.eq(i);if(this._canBeSelected(rowIdentifier,rowElement)){range.push({id:this._pkProp?this._identifierForRow(rowElement):rowIndex,index:rowIndex,element:rowElement.add(fixedRowRange?fixedRowRange.eq(i):null)})}}return{startIndex:startRowIndex,endIndex:endRowIndex,active:end,element:endElement,range:range}}if(this.grid.hasFixedColumns()){isStartFixed=this.grid._isFixedElement(startElement);isEndFixed=this.grid._isFixedElement(endElement);if(isStartFixed&&isEndFixed){cellRange=this._getCellRangeFor(fixedRowRange,startElement,endElement,startRowIndex)}else if(isStartFixed!==isEndFixed){cellRange=this._getCrossCellRange(rowRange,fixedRowRange,startElement,endElement,startRowIndex)}else{cellRange=this._getCellRangeFor(rowRange,startElement,endElement,startRowIndex)}}else{cellRange=this._getCellRangeFor(rowRange,startElement,endElement,startRowIndex)}return $.extend(cellRange,{firstRowIndex:startRowIndex,lastRowIndex:endRowIndex,active:end,element:endElement})},_getCrossCellRange:function(rowRange,fixedRowRange,startElement,endElement,startRowIndex){var fixingDir=this.grid.fixedBodyContainer().attr("data-fixing-direction"),startFixedElement,endFixedElement,startUnfixedElement,endUnfixedElement,startFixedRow,endFixedRow,startUnfixedRow,endUnfixedRow,unfixedRange,fixedRange;if(this.grid._isFixedElement(startElement)){startFixedRow=startElement.parent();startFixedElement=startElement;endUnfixedRow=endElement.parent();endUnfixedElement=endElement;endFixedRow=this._getRowByIndex(endUnfixedRow.index(),true);startUnfixedRow=this._getRowByIndex(startFixedRow.index(),false);if(fixingDir==="left"){endFixedElement=endFixedRow.children("td:not([data-skip=true])").last();startUnfixedElement=startUnfixedRow.children("td:not([data-skip=true])").first()}else{endFixedElement=endFixedRow.children("td:not([data-skip=true])").first();startUnfixedElement=startUnfixedRow.children("td:not([data-skip=true])").last()}}else{startUnfixedRow=startElement.parent();startUnfixedElement=startElement;endFixedRow=endElement.parent();endFixedElement=endElement;endUnfixedRow=this._getRowByIndex(endFixedRow.index(),false);startFixedRow=this._getRowByIndex(startUnfixedRow.index(),true);if(fixingDir==="left"){endUnfixedElement=endUnfixedRow.children("td:not([data-skip=true])").first();startFixedElement=startFixedRow.children("td:not([data-skip=true])").last()}else{endUnfixedElement=endUnfixedRow.children("td:not([data-skip=true])").last();startFixedElement=startFixedRow.children("td:not([data-skip=true])").first()}}fixedRange=this._getCellRangeFor(fixedRowRange,startFixedElement,endFixedElement,startRowIndex);unfixedRange=this._getCellRangeFor(rowRange,startUnfixedElement,endUnfixedElement,startRowIndex);return{range:fixedRange.range.concat(unfixedRange.range),firstColumnIndex:fixedRange.startCellIndex,lastColumnIndex:fixedRange.endCellIndex}},_getCellRangeFor:function(rowRange,startElement,endElement,startRowIndex){var startCellIndex,endCellIndex,reverse,crLength,cellRange,range=[],row,rowIndex,cell,cellIndex,cellId,i,startElementIndex;startCellIndex=startElement.parent().children("td").index(startElement);endCellIndex=endElement.parent().children("td").index(endElement);reverse=startCellIndex>endCellIndex;if(reverse){startCellIndex=startCellIndex+endCellIndex;endCellIndex=startCellIndex-endCellIndex;startCellIndex=startCellIndex-endCellIndex}crLength=endCellIndex-startCellIndex+1;cellRange=rowRange.find("td:nth-of-type(n+"+(startCellIndex+1)+"):nth-of-type(-n+"+(endCellIndex+1)+")");if(!cellRange.length){return{range:range}}row=cellRange.eq(0).parent();rowIndex=startRowIndex;startElementIndex=startElement.index();for(i=0;i<cellRange.length;i++){cell=cellRange.eq(i);if(cell.parent()[0]!==row[0]){row=cell.parent();rowIndex=startRowIndex+Math.floor(i/crLength)}cellIndex=i%crLength+startElementIndex;cellId=this._identifierForTarget(cell);if(this._canBeSelected(cellId)){range.push({id:cellId,element:cell,rowIndex:rowIndex,index:cellIndex})}}return{firstColumnIndex:startCellIndex,lastColumnIndex:endCellIndex,range:range}},_isOutOfView:function(rowIdx,colIdx){var rv=this.grid.options.rowVirtualization||this.grid.options.virtualization,cv=this.grid.options.columnVirtualization||this.grid.options.virtualization,sri=this.grid._startRowIndex||0,sci=this.grid._startColIndex||0,vrc=this.grid._virtualRowCount,vcc=this.grid._virtualColumnCount;if(colIdx===null||colIdx===undefined){return rv?rowIdx<sri||rowIdx>=sri+vrc:false}return rv||cv?rowIdx<sri||rowIdx>=sri+vrc||(colIdx<sci||colIdx>=sci+vcc):false},_isDataElement:function(identifier){var type=$.type(identifier);return type==="number"||type==="string"||!identifier.columnKey.startsWith("##")},_suppressKey:function(keyCode){var updating=this.grid.element.data("igGridUpdating"),key;switch(keyCode){case $.ui.keyCode.ENTER:key="enter";break;case $.ui.keyCode.SPACE:key="space";break}if(updating){return updating.options.startEditTriggers.indexOf(key)>=0}return false},_firstDataCellForRow:function(row){return row.children("td:not([data-skip='true'],td[data-parent]):first")},_canBeSelected:function(identifier,target){return!identifier.columnKey&&target&&target.is("tr")&&!target.attr("data-grouprow")&&!target.attr("data-summaryrow")||identifier.columnKey&&!identifier.columnKey.startsWith("##")},_identifierForTarget:function(target){if(target.is("tr")){return this._identifierForRow(target)}if(target.hasClass("ui-iggrid-nongrouprowemptycell")){return this._identifierForDataSkipCell(target,this._gbEmptyCellKey)}if(target.hasClass("ui-iggrid-expandcolumn")){if(target.attr("data-parent")){return this._identifierForDataSkipCell(target,this._hgCellKey)}return this._identifierForDataSkipCell(target,this._gbExpandCellKey)}if(target.attr("data-gbsummary")){return this._identifierForDataSkipCell(target,this._gbSummaryCellKey)}if(target.attr("gbsummaryiconcell")){return this._identifierForDataSkipCell(target,this._gbGroupSummaryIconCellKey)}if(target.attr("gbsummaryemptycell")){return this._identifierForDataSkipCell(target,this._gbGroupSummaryEmptyCellKey)}if(target.attr("gbsummarycell")){return this._identifierForDataSkipCellPerColumn(target,this._gbGroupSummaryCellKey,"{col}")}if(target.hasClass("ui-igtreegrid-non-data-column")&&target.attr("data-skip")){return this._identifierForDataSkipCell(target,this._tgExpandKey)}if(target.is("td")){return this._identifierForCell(target)}if(target.is("th")){return this._identifierForDataSkipCell(target,this._rsCellKey)}return null},_getRowId:function(row){var attrId=row.attr("data-id");if(row.attr("data-grouprow")||row.attr("data-summaryrow")){if(!this._pkProp){return null}return attrId}return this.grid._fixPKValue(attrId)},_identifierForCell:function(cell){var row=cell.parent(),id=this._getRowId(row);if(id===null||id===undefined){id=this._getIndexForRow(row)}return{id:id,columnKey:this._getColKeyForCell(cell)}},_identifierForRow:function(row){var id=this._getRowId(row);if(id!==null&&id!==undefined){return id}return this._getIndexForRow(row)},_identifierForDataSkipCell:function(cell,key){var row=cell.parent(),id=this._getRowId(row);if(id===null||id===undefined){id=this._getIndexForRow(row)}return{id:id,columnKey:key}},_identifierForDataSkipCellPerColumn:function(cell,key,replaceValue){var row=cell.parent(),id=this._getRowId(row),col=this.grid.getColumnByTD(cell);if(id===null||id===undefined){id=this._getIndexForRow(row)}key=key.replace(replaceValue,col.column.key);return{id:id,columnKey:key}},_getRowsByIdentifier:function(identifier){var urow,frow=$();if(!this._pkProp){if(this.grid.hasFixedColumns()){frow=this._getRowByIndex(identifier,true)}urow=this._getRowByIndex(identifier,false)}else{if(this.grid.hasFixedColumns()){frow=this.grid.rowById(identifier,true)}urow=this.grid.rowById(identifier,false)}return urow instanceof $?urow.add(frow):$()},_getCellByIdentifier:function(identifier){var cellRow,isFixed,skippedCells,colIndex,i,cols,sci=this.grid._startColIndex||0;if(identifier.columnKey&&identifier.columnKey.startsWith("##")){return this._getNonDataCellByIdentifier(identifier)}if(!this._pkProp){isFixed=this.grid.isFixedColumn(identifier.columnKey);cellRow=this._getRowByIndex(identifier.id,isFixed);cols=this.grid._visibleColumns(isFixed);skippedCells=cellRow.children("th,[data-skip=true],[data-parent]").length;for(i=0;i<cols.length;i++){if(cols[i].key===identifier.columnKey){colIndex=i;break}}return cellRow.children("td:nth-child("+(colIndex+1+skippedCells-sci)+")")}return this.grid.cellById(identifier.id,identifier.columnKey)||$()},_getNonDataCellPerColumnByIdentifier:function(cellRow,identifier){var colKey=identifier.columnKey.replace(/#/g,"").split("_")[1];return cellRow.children("td[aria-describedby='"+this.grid.id()+"_"+colKey+"']")},_getNonDataCellByIdentifier:function(identifier){var cellRow;if(!this._pkProp){cellRow=this._getRowByIndex(identifier.id,this.grid.hasFixedColumns())}else{cellRow=this._getRowsByIdentifier(identifier.id)}if(/##GBGSCEL_([^\s]+)##/.test(identifier.columnKey)){return this._getNonDataCellPerColumnByIdentifier(cellRow,identifier)}switch(identifier.columnKey){case this._rsCellKey:return cellRow.children("th:first");case this._gbEmptyCellKey:return cellRow.children(".ui-iggrid-nongrouprowemptycell:first");case this._gbExpandCellKey:return cellRow.children().first();case this._gbSummaryCellKey:return cellRow.children().last();case this._gbGroupSummaryIconCellKey:return cellRow.children().first();case this._gbGroupSummaryEmptyCellKey:return cellRow.children(".ui-iggrid-summaryemptycellcolumn:first");case this._hgCellKey:return cellRow.children("td[data-parent='true']");case this._tgExpandKey:return cellRow.children(".ui-igtreegrid-non-data-column:first");default:return $()}},_getRecordByIdentifier:function(identifier){var dv=this.grid._getDataView(),i,record=null,index=-1;if(this._pkProp){for(i=0;i<dv.length;i++){if(dv[i][this._pkProp]===identifier){record=dv[i];index=i;break}}}else{if(identifier>=0&&identifier<dv.length){record=dv[identifier];index=identifier}}return{record:record,index:index}},_getRowByIndex:function(index,fixed){var tbody=fixed?this.grid.fixedBodyContainer().find("tbody"):this.grid.element.find("tbody");return tbody.children("tr:not([data-container])").eq(index)},_getCellByIndex:function(index,row){return row.children("td").eq(index)},_getIndexForRow:function(row){return row.closest("tbody").children("tr:not([data-container])").index(row)+(this.grid._startRowIndex||0)},_getColKeyForCell:function(cell){var col=this.grid.getColumnByTD(cell);return col?col.column.key:null},_getColIndexByKey:function(key){var i,columns=this.grid._visibleColumns();for(i=0;i<columns.length;i++){if(columns[i].key===key){return i}}return-1},_onRowSelectionChanging:function(a){var args={owner:this,selectedRows:this._selection.selectedRows()};if(a.element&&a.element.length){args.row={element:a.element,index:a.index!==undefined?a.index:this._getIndexForRow(a.element)};if(this._pkProp){args.row.id=a.id||this._identifierForRow(a.element)}}else{args.row={element:$(),index:-1};if(this._pkProp&&a.range&&a.range.length>0){args.row.id=a.range[a.range.length-1].id}else if(this._pkProp){args.row.id=a.id}}if(a.startIndex!==undefined){args.startIndex=a.startIndex;args.endIndex=a.endIndex}return this._trigger(this.events.rowSelectionChanging,null,args)},_onRowSelectionChanged:function(a){var args={owner:this,selectedRows:this._selection.selectedRows()};if(a.element&&a.element.length){args.row={element:a.element,index:a.index!==undefined?a.index:this._getIndexForRow(a.element)};if(this._pkProp){args.row.id=a.id||this._identifierForRow(a.element)}}else{args.row={element:$(),index:-1};if(this._pkProp){args.row.id=a.id}}return this._trigger(this.events.rowSelectionChanged,null,args)},_onCellSelectionChanging:function(a){var args={owner:this,selectedCells:this._selection.selectedCells()};if(a.element&&a.element.length){args.cell={element:a.element,row:a.row||a.element.closest("tr"),columnKey:a.id?a.id.columnKey:this._getColKeyForCell(a.element)};args.cell.index=a.index!==undefined?a.index:this._getColIndexByKey(args.cell.columnKey);args.cell.rowIndex=a.rowIndex!==undefined?a.rowIndex:this._getIndexForRow(args.cell.row);if(this._pkProp){args.cell.rowId=a.id?a.id.id:this._identifierForRow(args.cell.row)}}else{args.cell={element:$(),row:$(),columnKey:a.id.columnKey};args.cell.index=-1;args.cell.rowIndex=-1;if(this._pkProp){args.cell.rowId=a.id?a.id.id:null}}if(a.firstColumnIndex!==undefined){args.firstColumnIndex=a.firstColumnIndex;args.firstRowIndex=a.firstRowIndex;args.lastColumnIndex=a.lastColumnIndex;args.lastRowIndex=a.lastRowIndex}return this._trigger(this.events.cellSelectionChanging,null,args)},_onCellSelectionChanged:function(a){var args={owner:this,selectedCells:this._selection.selectedCells()};if(a.element&&a.element.length){args.cell={element:a.element,row:a.row||a.element.closest("tr"),columnKey:a.id?a.id.columnKey:this._getColKeyForCell(a.element)};args.cell.index=a.index!==undefined?a.index:this._getColIndexByKey(args.cell.columnKey);args.cell.rowIndex=a.rowIndex!==undefined?a.rowIndex:this._getIndexForRow(args.cell.row);if(this._pkProp){args.cell.rowId=a.rowId||this._identifierForRow(args.cell.row)}}else{args.cell={element:$(),row:$(),columnKey:a.id.columnKey};args.cell.index=-1;args.cell.rowIndex=-1;if(this._pkProp){args.cell.rowId=a.id?a.id.id:null}}return this._trigger(this.events.cellSelectionChanged,null,args)},_onRowActivationChanging:function(a){var args={owner:this,row:a?{element:a.element,index:this._getIndexForRow(a.element)}:null};if(this._pkProp&&a){args.row.id=a.id}return this._trigger(this.events.activeRowChanging,null,args)},_onRowActivationChanged:function(a){var args={owner:this,row:a?{element:a.element,index:this._getIndexForRow(a.element)}:null};if(this._pkProp&&a){args.row.id=a.id}return this._trigger(this.events.activeRowChanged,null,args)},_onCellActivationChanging:function(a){var args={owner:this,cell:a?{element:a.element,row:a.element.closest("tr")}:null},noCancel=true;if(a){args.cell.index=this._getColIndexByKey(a.id.columnKey);args.cell.rowIndex=this._getIndexForRow(args.cell.row);args.cell.columnKey=a.id.columnKey;if(this._pkProp){args.cell.rowId=a.id.id}}noCancel=this._trigger(this.events.activeCellChanging,null,args);if(!noCancel){this._storedActiveIndex=this._getCellByIdentifier(this._selection.activeElement).index()}return noCancel},_onCellActivationChanged:function(a){var args={owner:this,cell:a?{element:a.element,row:a.element.closest("tr")}:null};if(a){args.cell.index=this._getColIndexByKey(a.id.columnKey);args.cell.rowIndex=this._getIndexForRow(args.cell.row);args.cell.columnKey=a.id.columnKey;if(this._pkProp){args.cell.rowId=a.id.id}}return this._trigger(this.events.activeCellChanged,null,args)},_select:function(info){var element=info.element||this._selection.elementFromIdentifier(info.id);if(element.is("tr")){element.children("td").not("[data-skip=true]").addClass(this.css.selectedCell)}else{element.addClass(this.css.selectedCell)}element.attr("aria-selected",true)},_deselect:function(info){var element=info.element||this._selection.elementFromIdentifier(info.id);if(element.is("tr")){element.children("td").removeClass(this.css.selectedCell)}else{element.removeClass(this.css.selectedCell)}element.attr("aria-selected",false)},_resizeGridWidth:function(decrease){if(decrease&&this._gridWidthDecreased||!decrease&&!this._gridWidthDecreased){return}var grid=this.grid,diff,padding=parseInt(grid.element.find("tbody tr td:last-child").css(grid._padding),10),$col=grid.element.find("colgroup:first>col:last");this._scrollbarWidth=this._scrollbarWidth||grid._scrollbarWidth();diff=this._scrollbarWidth;this._gridWidthDecreased=false;if(decrease){diff=-diff;this._gridWidthDecreased=true}grid.element.find("tbody tr td:last-child").css({"padding-right":padding+diff,"border-right":diff>0?"1px":"0px"});grid.element.css("width",grid.element.width()+diff);$col.width($col.width()+diff)},_isScrollbarOverLastCells:function(){if(this._isScrollbarOverLastCellsCache===undefined||this._isScrollbarOverLastCellsCache===null){var opts=this.grid.options,hasFixedHeaders=opts.showHeader&&opts.fixedHeaders===true&&opts.height!==null,hasVirtualization=opts.virtualization===true||opts.columnVirtualization===true||opts.rowVirtualization===true,lastColInPixels=this.grid._lastColPixelWidth!==undefined&&this.grid._lastColPixelWidth!==null,hasHorizontalScrollbar=this.grid._hscrollbar().length>0;this._isScrollbarOverLastCellsCache=this.grid._hasVerticalScrollbar&&hasFixedHeaders&&!hasVirtualization&&hasHorizontalScrollbar&&lastColInPixels}return this._isScrollbarOverLastCellsCache},_activate:function(element){var initiallyFocused,me=this;if(element.is("tr")){element.addClass(this.css.activeRow);initiallyFocused=element.filter(".initially-focused");if(initiallyFocused.length){initiallyFocused.focus();initiallyFocused.removeClass("initially-focused");return}}else{element.addClass(this.css.activeCell)}if(this.options.mode==="cell"&&$.ig.util.isIE&&element.is(":last-child")&&this._isScrollbarOverLastCells()){
this._resizeGridWidth(true);element.focus();if(this._timeoutResizeGrid){clearTimeout(this._timeoutResizeGrid);this._timeoutResizeGrid=null}this._timeoutResizeGrid=setTimeout(function(){me._resizeGridWidth(false)},100)}else{element.focus()}},_deactivate:function(){if(this.grid.hasFixedColumns()){if(this.options.mode==="row"){this.grid.fixedBodyContainer().find("tbody").find("tr.ui-iggrid-activerow").removeClass(this.css.activeRow)}else{this.grid.fixedBodyContainer().find("tbody").find("td.ui-iggrid-activecell").removeClass(this.css.activeCell)}}if(this.options.mode==="row"){this.grid.element.find("tbody").find("tr.ui-iggrid-activerow").removeClass(this.css.activeRow)}else{this.grid.element.find("tbody").find("td.ui-iggrid-activecell").removeClass(this.css.activeCell)}},_clearSelection:function(){this.grid.fixedBodyContainer().find("tbody").find("td.ui-iggrid-selectedcell").removeClass(this.css.selectedCell).attr("aria-selected",false);this.grid.fixedBodyContainer().find("tbody").find("tr[aria-selected]").attr("aria-selected",false);this.grid.element.children("tbody").find("td.ui-iggrid-selectedcell").removeClass(this.css.selectedCell).attr("aria-selected",false);this.grid.element.children("tbody").find("tr[aria-selected]").attr("aria-selected",false)},_createHandlers:function(){this._dataRenderingHandler=$.proxy(this._dataRendering,this);this._virtualRecordsRenderingHandler=$.proxy(this._virtualRecordsRendering,this);this._virtualRecordsRendererHandler=$.proxy(this._virtualRecordsRender,this);this._columnsCollectionModifiedHandler=$.proxy(this._columnsCollectionModified,this);this._mouseDownHandler=$.proxy(this._mouseDown,this);this._mouseMoveHandler=$.proxy(this._mouseMove,this);this._mouseUpHandler=$.proxy(this._mouseUp,this);this._pointerDownHandler=$.proxy(this._pointerDown,this);this._pointerMoveHandler=$.proxy(this._pointerMove,this);this._pointerUpHandler=$.proxy(this._pointerUp,this);this._selectStartHandler=$.proxy(this._selectStart,this);this._selectStartContainerHandler=$.proxy(this._selectStartContainer,this);this._releaseMouseHandler=$.proxy(this._releaseMouse,this);this._touchStartHandler=$.proxy(this._touchStart,this);this._touchEndHandler=$.proxy(this._touchEnd,this);this._touchMoveHandler=$.proxy(this._touchMove,this);this._keyDownHandler=$.proxy(this._keyDown,this);this._containerFocusHandler=$.proxy(this._containerFocus,this);this._focusInHandler=$.proxy(this._tbodyFocusIn,this);this._focusOutHandler=$.proxy(this._tbodyFocusOut,this);this._preventDefaultHandler=$.proxy(this._preventDefault,this)},_unregisterEvents:function(){var gOpts=this.grid.options,tbody=this.grid.element.find("tbody").add(this.grid.fixedBodyContainer().find("tbody")),hasVirtualization=gOpts.virtualization||gOpts.rowVirtualization||gOpts.columnVirtualization,scrollCont=hasVirtualization?this.grid._vdisplaycontainer():this.grid.scrollContainer();if(this._tbodyBinding){tbody.unbind(this._tbodyBinding)}$(document).unbind("mouseup."+this.grid.id()+"_selection");scrollCont.unbind("scroll",this._releaseMouseHandler);this.grid.container().unbind("selectstart",this._selectStartContainerHandler);this.grid.element.removeClass("ui-iggrid-canceltextselection");if(this.options.mode==="row"){this.grid.element.find("tbody td").unbind("mousedown",this._preventDefaultHandler)}},_registerEvents:function(){var gOpts=this.grid.options,tbody=this.grid.element.find("tbody").add(this.grid.fixedBodyContainer().find("tbody")),hasVirtualization=gOpts.virtualization||gOpts.rowVirtualization||gOpts.columnVirtualization,scrollCont=hasVirtualization?this.grid._vdisplaycontainer():this.grid.scrollContainer();this._tbodyBinding=this._tbodyBinding||this._generateTbodyBinding();tbody.unbind(this._tbodyBinding).bind(this._tbodyBinding);$(document).bind("mouseup."+this.grid.id()+"_selection",this._releaseMouseHandler);scrollCont.bind("scroll",this._releaseMouseHandler);scrollCont.bind("igscrollscrolling",this._releaseMouseHandler);this.grid.container().bind("selectstart",this._selectStartContainerHandler);if(this.options.multipleSelection===true){this.grid.element.addClass("ui-iggrid-canceltextselection")}if(this.options.mode==="row"){this.grid.element.find("tbody td").bind("mousedown",this._preventDefaultHandler)}},_generateTbodyBinding:function(){var binding={};binding.selectstart=this._selectStartHandler;binding.focusin=this._focusInHandler;binding.focusout=this._focusOutHandler;binding.keydown=this._keyDownHandler;if($.ig.util.isTouch){binding.touchstart=this._touchStartHandler;binding.touchend=this._touchEndHandler;binding.touchmove=this._touchMoveHandler}if(window.navigator.msPointerEnabled||window.navigator.pointerEnabled){binding.MSPointerDown=this._pointerDownHandler;binding.MSPointerMove=this._pointerMoveHandler;binding.MSPointerUp=this._pointerUpHandler;binding.pointerdown=this._pointerDownHandler;binding.pointermove=this._pointerMoveHandler;binding.pointerup=this._pointerUpHandler}else{binding.mousedown=this._mouseDownHandler;binding.mousemove=this._mouseMoveHandler;binding.mouseup=this._mouseUpHandler}return binding},_injectGrid:function(gridInstance,isRebind){var i;this.grid=gridInstance;for(i=0;i<this.grid.options.features.length;i++){if(this.grid.options.features[i].name==="Selection"){this.grid.options.features[i].inherit=true}if(this.grid.options.features[i].name==="RowSelectors"){if(this.grid.options.features[i].enableCheckBoxes===true&&this.grid.options.features[i].checkBoxMode!=="triState"){this.options.mode="row"}}}this._initSelectionCollection(isRebind);if(!isRebind){this._createHandlers()}this.grid.element.unbind("iggriddatarendering",this._dataRenderingHandler).bind("iggriddatarendering",this._dataRenderingHandler);this.grid.element.unbind("iggridvirtualrendering",this._virtualRecordsRenderingHandler).bind("iggridvirtualrendering",this._virtualRecordsRenderingHandler);this.grid.element.unbind("igtreegridvirtualrendering",this._virtualRecordsRenderingHandler).bind("igtreegridvirtualrendering",this._virtualRecordsRenderingHandler);this.grid.element.unbind("iggridvirtualrecordsrender",this._virtualRecordsRendererHandler).bind("iggridvirtualrecordsrender",this._virtualRecordsRendererHandler);this.grid.element.unbind("igtreegridvirtualrecordsrender",this._virtualRecordsRendererHandler).bind("igtreegridvirtualrecordsrender",this._virtualRecordsRendererHandler);this.grid.element.unbind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler).bind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler);if(!isRebind){this.grid._cellStyleSubscribers.push(this.options.mode==="row"?$.proxy(this._applyRowStyle,this):$.proxy(this._applyCellStyle,this))}}});$.extend($.ui.igGridSelection,{version:"21.2.12"});$.ig.SelectionCollection=$.ig.SelectionCollection||Class.extend({settings:{multipleSelection:false,subscribers:{},owner:null},init:function(options){if(options){this.settings=$.extend(true,{},$.ig.SelectionCollection.prototype.settings,options)}this.selection={};return this},addSubscriber:function(subscriber,owner){var suid=$.ig.uid();if(!this.settings.subscribers[owner]){this.settings.subscribers[owner]={}}this.settings.subscribers[owner][suid]=subscriber;return suid},removeSubscriber:function(subscriberId,owner){delete this.settings.subscribers[owner][subscriberId]},changeOwner:function(newOwner){this.cleanAll();this.settings.owner=newOwner},isSelected:function(identifier,forOwner){return false},isActive:function(identifier,forOwner){return false},elementFromIdentifier:function(identifier){return $()},toggle:function(element){if(this.activeElement===null){return}this.select(this.activeElement,true,{element:element||this.elementFromIdentifier(this.activeElement)})},activate:function(identifier,element,suppress){var info={element:element,id:identifier};if(!this.isActive(identifier)){if(this._requestTrigger("ActivationChanging",suppress,info)){this._notify("deactivate");this.activeElement=identifier;this._notify("activate",element);this._requestTrigger("ActivationChanged",suppress,info)}}},deactivate:function(suppress){if(this._requestTrigger("ActivationChanging",suppress,null)){this._notify("deactivate");this.activeElement=null;this._requestTrigger("ActivationChanged",suppress,null)}},select:function(identifier,add,info,suppress){info=info||{};info.element=info.element||this.elementFromIdentifier(identifier);info.id=identifier;if(this.isSelected(identifier)){if(add){if(this._requestTrigger("SelectionChanging",suppress,info)){this._markUnselected(identifier);this._notify("deselect",info);this._requestTrigger("SelectionChanged",suppress,info)}}else{if(this.onlyOneSelected()){return}if(this._requestTrigger("SelectionChanging",suppress,info)){this.clearSelection();this._markSelected(identifier,info);this._notify("select",info);this._requestTrigger("SelectionChanged",suppress,info)}}}else{if(this._requestTrigger("SelectionChanging",suppress,info)){if(!add||!this.settings.multipleSelection){this.clearSelection()}this._markSelected(identifier,info);this._notify("select",info);this._requestTrigger("SelectionChanged",suppress,info)}}this.rangeSelectStart=identifier;this.rangeSelectEnd=identifier},rangeSelect:function(range,add,prevRange,info,suppress){var i;if(!this._requestTrigger("SelectionChanging",suppress,info)){return}if(!prevRange||!this._rangeUnlock){if(!add){this.clearSelection()}}else{this._rangeUnlock(prevRange)}for(i=0;i<range.length;i++){if(!this.isSelected(range[i].id)){this._markSelected(range[i].id,range[i]);this._notify("select",range[i])}}this.activate(info.active,info.element||this.elementFromIdentifier(info.active));this._requestTrigger("SelectionChanged",suppress,info)},rangeDeselect:function(range,info,suppress){var i;if(!this._requestTrigger("SelectionChanging",suppress,info)){return}for(i=0;i<range.length;i++){this._markUnselected(range[i].id);this._notify("deselect",range[i])}this._requestTrigger("SelectionChanged",suppress,info)},deselect:function(identifier,info,suppress){info=info||{};info.element=info.element||this.elementFromIdentifier(identifier);info.id=identifier;this.select(identifier,true,info,suppress)},deselectAll:function(suppress){if(!this._requestTrigger("SelectionChanging",suppress,{})){return}this.clearSelection();this._requestTrigger("SelectionChanged",suppress,{})},clearSelection:function(forOwner){if(!forOwner||forOwner===this.settings.owner){this.selection={};this._notify("clearSelection")}},cleanAll:function(forOwner){if(!forOwner||forOwner===this.settings.owner){this.deactivate(true);this.clearSelection()}},onlyOneSelected:function(){return false},selectedCells:function(){return[]},selectedRows:function(){return[]},selectionLength:function(){return Object.keys(this.selection).length},_requestTrigger:function(type,suppress,args){var subs=this.settings.subscribers[this.settings.owner.id()],func="_on"+this._selectionMode()+type,key,result=true;if(suppress){return true}for(key in subs){if(subs.hasOwnProperty(key)&&typeof subs[key][func]==="function"){result=result&&subs[key][func](args)}}return result},_notify:function(message,info){var subs=this.settings.subscribers[this.settings.owner.id()],func="_"+message,key;for(key in subs){if(subs.hasOwnProperty(key)&&typeof subs[key][func]==="function"){subs[key][func](info)}}}});$.ig.SelectedRowsCollection=$.ig.SelectedRowsCollection||$.ig.SelectionCollection.extend({isSelected:function(identifier,forOwner){if(forOwner&&this.settings.owner!==forOwner){return false}return this.selection[identifier]!==undefined},isActive:function(identifier,forOwner){if(forOwner&&this.settings.owner!==forOwner){return false}return this.activeElement===identifier},selectedDataRows:function(){var s=this.selection,key,dataRows=[];for(key in s){if(s.hasOwnProperty(key)&&key.indexOf(":")===-1&&s[key].element&&!s[key].element.attr("data-grouprow")&&!s[key].element.attr("data-summaryrow")){dataRows.push(s[key])}}return dataRows},selectedRows:function(){var rows=this._rowscache||[],rowKey,id;for(rowKey in this.selection){if(this.selection.hasOwnProperty(rowKey)){id=this.settings.owner._fixPKValue(rowKey);id=isNaN(id)?rowKey:id;rows.push(this._selectedRowObject(id))}}this.invalid=false;return rows},activeRow:function(){var row;if(this.activeElement!==null&&this.activeElement!==undefined){row=this.elementFromIdentifier(this.activeElement);return{id:this.activeElement,index:this.elementPosition(this.activeElement,row),element:row}}return null},elementFromIdentifier:function(identifier){return this.settings.owner.element.data("igGridSelection")._getRowsByIdentifier(identifier)},elementPosition:function(identifier,element){var ownSelection=this.settings.owner.element.data("igGridSelection");if(element&&element.length>0){return ownSelection._getIndexForRow(element)}return ownSelection._getRecordByIdentifier(identifier).index},onlyOneSelected:function(){return Object.keys(this.selection).length===1},_markSelected:function(identifier,info){this.selection[identifier]=info||true},_markUnselected:function(identifier){delete this.selection[identifier]},_selectedRowObject:function(identifier){var rowInfo=this.selection[identifier];if($.type(rowInfo)!=="object"){rowInfo={};this.selection[identifier]=rowInfo}if(this.invalid){rowInfo.element=this.elementFromIdentifier(identifier);rowInfo.index=this.elementPosition(identifier,rowInfo.element)}else{rowInfo.element=rowInfo.element||this.elementFromIdentifier(identifier);rowInfo.index=rowInfo.index!==undefined&&rowInfo.index!==null?rowInfo.index:this.elementPosition(identifier,rowInfo.element)}return $.extend(true,{},rowInfo,{id:identifier})},_selectionMode:function(){return"Row"}});$.ig.SelectedCellsCollection=$.ig.SelectedCellsCollection||$.ig.SelectionCollection.extend({isSelected:function(identifier,forOwner){if(forOwner&&this.settings.owner!==forOwner){return false}return this.selection[identifier.id]!==undefined&&this.selection[identifier.id][identifier.columnKey]!==undefined},atLeastOneSelected:function(rowId,forOwner){if(forOwner&&this.settings.owner!==forOwner){return false}return Object.keys(this.selection[rowId]).length>0},isActive:function(identifier,forOwner){if(forOwner&&this.settings.owner!==forOwner){return false}return this.activeElement&&this.activeElement.id===identifier.id&&this.activeElement.columnKey===identifier.columnKey},selectedCells:function(){var cells=[],sid,rowKey,columnKey,id;for(rowKey in this.selection){if(this.selection.hasOwnProperty(rowKey)){for(columnKey in this.selection[rowKey]){if(this.selection[rowKey].hasOwnProperty(columnKey)){id=this.settings.owner._fixPKValue(rowKey);id=isNaN(id)?rowKey:id;sid={id:id,columnKey:columnKey};cells.push(this._selectedCellObject(sid))}}}}this.invalid=false;return cells},activeCell:function(){var cell,pos;if(this.activeElement){cell=this.elementFromIdentifier(this.activeElement);pos=this.elementPosition(this.activeElement,cell);return{row:cell.parent(),id:this.activeElement.id,columnKey:this.activeElement.columnKey,rowIndex:pos.x,index:pos.y,element:cell}}return null},elementFromIdentifier:function(identifier){return this.settings.owner.element.data("igGridSelection")._getCellByIdentifier(identifier)},elementPosition:function(identifier,element){var ownSelection=this.settings.owner.element.data("igGridSelection");if(element&&element.length>0){return{x:ownSelection._getIndexForRow(element.parent()),y:element.index()}}return{x:ownSelection._getRecordByIdentifier(identifier.id).index,y:ownSelection._getColIndexByKey(identifier.columnKey)}},onlyOneSelected:function(){var rKeys=Object.keys(this.selection);if(rKeys.length===1){return Object.keys(this.selection[rKeys[0]]).length===1}return false},_lockSelection:function(){var rowId,cellId;for(rowId in this.selection){if(this.selection.hasOwnProperty(rowId)){for(cellId in this.selection[rowId]){if(this.selection[rowId].hasOwnProperty(cellId)){if($.type(this.selection[rowId][cellId]==="object")){this.selection[rowId][cellId].locked=true}else{this.selection[rowId][cellId]={locked:true}}}}}}},_markSelected:function(identifier,info){this.selection[identifier.id]=this.selection[identifier.id]||{};this.selection[identifier.id][identifier.columnKey]=info||true},_markUnselected:function(identifier){if(!this.selection[identifier.id]){return}delete this.selection[identifier.id][identifier.columnKey]},_unlockSelected:function(identifier){var c;if(!this.selection[identifier.id]){return false}c=this.selection[identifier.id][identifier.columnKey];if($.type(c)==="object"){if(!c.locked){delete this.selection[identifier.id][identifier.columnKey];return true}return false}delete this.selection[identifier.id][identifier.columnKey];return true},_rangeUnlock:function(range){var i;for(i=0;i<range.length;i++){if(this._unlockSelected(range[i].id)){this._notify("deselect",range[i])}}},_selectedCellObject:function(identifier){var cellInfo=this.selection[identifier.id][identifier.columnKey],pos;if($.type(cellInfo)!=="object"){cellInfo={};this.selection[identifier.id][identifier.columnKey]=cellInfo}if(this.invalid){cellInfo.element=this.elementFromIdentifier(identifier);cellInfo.row=cellInfo.element.parent();pos=this.elementPosition(identifier,cellInfo.element);cellInfo.rowIndex=pos.x;cellInfo.index=pos.y}else{cellInfo.element=cellInfo.element||this.elementFromIdentifier(identifier);cellInfo.row=cellInfo.row||cellInfo.element.parent();if(!(cellInfo.rowIndex!==undefined&&cellInfo.rowIndex!==null&&cellInfo.index!==undefined&&cellInfo.index!==null)){pos=this.elementPosition(identifier,cellInfo.element);cellInfo.rowIndex=pos.x;cellInfo.index=pos.y}}return $.extend(true,{},cellInfo,{id:identifier.id,columnKey:identifier.columnKey})},_selectionMode:function(){return"Cell"}})})($);/*!@license
 * Infragistics.Web.ClientUI Grid Sorting 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
  *	infragistics.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 *	infragistics.ui.grid.shared.js
 *	infragistics.ui.grid.featurechooser.js
 */
(function($){$.widget("ui.igGridSorting",$.ui.igWidget,{css:{sortableColumnHeader:"ui-iggrid-sortableheader ui-state-default",sortableColumnHeaderActive:"ui-iggrid-sortableheaderactive ui-state-active",sortableColumnHeaderHover:"ui-iggrid-sortableheaderhover ui-state-hover",sortableColumnHeaderFocus:"ui-iggrid-sortableheaderfocus ui-state-focus",ascendingColumnHeader:"ui-iggrid-colheaderasc",descendingColumnHeader:"ui-iggrid-colheaderdesc",ascendingColumn:"ui-iggrid-colasc ui-state-highlight",descendingColumn:"ui-iggrid-coldesc ui-state-highlight",sortIndicator:"ui-iggrid-colindicator",fcSortIndicatorAscending:"ui-iggrid-featurechooser-li-iconcontainer ui-icon ui-iggrid-icon-sort-a-z",fcSortIndicatorDescending:"ui-iggrid-featurechooser-li-iconcontainer ui-icon ui-iggrid-icon-sort-z-a",sortIndicatorAscending:"ui-iggrid-colindicator-asc ui-icon ui-icon-arrowthick-1-n",sortIndicatorDescending:"ui-iggrid-colindicator-desc ui-icon ui-icon-arrowthick-1-s",dialogSortedColumns:"ui-iggrid-sorting-dialog-sortedcolumns",dialogUnsortedColumns:"ui-iggrid-sorting-dialog-unsortedcolumns",dialogUnsortedColumnsSortByButton:"ui-iggrid-sorting-dialog-unsortedcolumns-sortbybutton",dialogAsdDescButton:"ui-iggrid-sorting-dialog-ascdescbutton",modalDialogSortByColumn:"ui-iggrid-sorting-dialog-sortbybutton",dialogSortedColumnsItem:"ui-widget-content",dialogUnsortedColumnsItem:"ui-widget-content",dialogButtonAsc:"ui-button ui-corner-all ui-button-icon-only ig-sorting-indicator",dialogButtonAscIcon:"ui-button-icon-primary ui-icon ui-icon-arrowthick-1-n",dialogButtonDesc:"ui-button ui-corner-all ui-button-icon-only ig-sorting-indicator",dialogButtonDescIcon:"ui-button-icon-primary ui-icon ui-icon-arrowthick-1-s",dialogButtonUnsort:"ui-iggrid-sorting-dialog-sortbybuttons ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only ui-igbutton ui-widget-content ui-igbutton-remove",dialogButtonUnsortContainer:"ui-button-icon-primary ui-icon ui-icon-circle-close",dialogSortedColumnTextContainer:"ui-iggrid-dialog-text",dialogItemText:"ui-iggrid-dialog-text",dialogButtonsHover:"ui-state-hover",featureChooserModalDialogIcon:"ui-icon ui-iggrid-icon-multiple-sorting"},options:{type:null,caseSensitive:false,applySortedColumnCss:true,sortUrlKey:null,sortUrlKeyAscValue:null,sortUrlKeyDescValue:null,mode:"single",customSortFunction:null,firstSortDirection:"ascending",modalDialogSortOnClick:false,modalDialogSortByButtonText:undefined,modalDialogResetButtonLabel:undefined,modalDialogCaptionButtonDesc:undefined,modalDialogCaptionButtonAsc:undefined,modalDialogCaptionButtonUnsort:undefined,featureChooserText:undefined,unsortedColumnTooltip:undefined,modalDialogCaptionText:undefined,modalDialogButtonApplyText:undefined,modalDialogButtonCancelText:undefined,featureChooserSortAsc:undefined,featureChooserSortDesc:undefined,locale:{sortedColumnTooltip:undefined,unsortedColumnTooltip:undefined,ascending:undefined,descending:undefined,modalDialogSortByButtonText:undefined,modalDialogResetButton:undefined,modalDialogCaptionButtonDesc:undefined,modalDialogCaptionButtonAsc:undefined,modalDialogCaptionButtonUnsort:undefined,featureChooserText:undefined,modalDialogCaptionText:undefined,modalDialogButtonApplyText:undefined,modalDialogButtonCancelText:undefined,featureChooserSortAsc:undefined,featureChooserSortDesc:undefined},modalDialogWidth:350,modalDialogHeight:"",modalDialogAnimationDuration:200,columnSettings:[{columnKey:null,columnIndex:null,firstSortDirection:null,currentSortDirection:null,allowSorting:true,compareFunc:null}],persist:true,sortingDialogContainment:"owner",dialogWidget:"igGridModalDialog",inherit:false},renderInFeatureChooser:true,events:{columnSorting:"columnSorting",columnSorted:"columnSorted",modalDialogOpening:"modalDialogOpening",modalDialogOpened:"modalDialogOpened",modalDialogMoving:"modalDialogMoving",modalDialogClosing:"modalDialogClosing",modalDialogClosed:"modalDialogClosed",modalDialogContentsRendering:"modalDialogContentsRendering",modalDialogContentsRendered:"modalDialogContentsRendered",modalDialogSortingChanged:"modalDialogSortingChanged",modalDialogButtonUnsortClick:"modalDialogButtonUnsortClick",modalDialogSortClick:"modalDialogSortClick",modalDialogButtonApplyClick:"modalDialogButtonApplyClick",modalDialogButtonResetClick:"modalDialogButtonResetClick"},_createWidget:function(){this.options.columnSettings=[];this._superApply(arguments)},_create:function(){var self=this;this._headers=[];this._clickHandler=function(event){var th,id,scrLeft,$scrContainer,colKey;id=$(event.target).closest(".ui-iggrid").attr("id").replace("_container","");if(self.grid.element.attr("id")!==id){return}th=$(event.currentTarget).closest("th");if(th.attr("data-skip")!=="true"&&(self.grid._isMultiColumnGrid!==true||th.attr("data-isheadercell")==="true")){colKey=th.attr("id").replace(self.grid.id()+"_","");if(!self._checkSortingAllowed(colKey)){return}self._handleSort(event);scrLeft=$("#"+self.grid.id()+"_hscroller").scrollLeft();if(scrLeft>0){if(self.grid.options.fixedHeaders===true){self.grid.headersTable().parent().scrollLeft(scrLeft)}if(self.grid.options.fixedFooters===true){self.grid.footersTable().parent().scrollLeft(scrLeft)}$scrContainer=self.grid.scrollContainer();if(!$scrContainer.length){$scrContainer=self.grid._vdisplaycontainer()}$scrContainer.scrollLeft(scrLeft)}}};this._dragStartHandler=function(event){var id,noCancel=true;noCancel=self.grid._trigger("headercelldragcancel",event,{});if(noCancel){id=$(event.target).closest(".ui-iggrid").attr("id").replace("_container","");if(self.grid.element.attr("id")!==id){return}event.stopPropagation();event.preventDefault()}else{return true}return false};this._mouseOverHandler=function(event){var id,$target=$(event.currentTarget),cs,colKey;id=$(event.target).closest(".ui-iggrid").attr("id").replace("_container","");if(self.grid.element.attr("id")!==id){return}colKey=$target.closest("th").attr("id");if(colKey){colKey=colKey.replace(id+"_","");cs=self._getColumnSettingByKey(colKey);if(cs&&cs.allowSorting!==false){$target.addClass(self.css.sortableColumnHeaderHover)}}};this._mouseOutHandler=function(event){var id;id=$(event.target).closest(".ui-iggrid").attr("id").replace("_container","");if(self.grid.element.attr("id")!==id){return}$(event.currentTarget).removeClass(self.css.sortableColumnHeaderHover)};$("#"+this.element[0].id).delegate("thead th",{click:this._clickHandler,mouseover:this._mouseOverHandler,mouseout:this._mouseOutHandler});$("#"+this.element[0].id+" thead th").bind("dragstart",this._dragStartHandler);$("#"+this.element[0].id+"_headers thead th").bind("dragstart",this._dragStartHandler);$(document).delegate("#"+this.element[0].id+"_headers thead th",{click:this._clickHandler,mouseover:this._mouseOverHandler,mouseout:this._mouseOutHandler});this._keyDownHandler=function(event){self._handleSortKb(event)};this._focusHandler=function(event){self._handleFocusKb(event)};this._blurHandler=function(event){self._handleBlurKb(event)};$("#"+this.element[0].id).delegate("thead th",{keydown:this._keyDownHandler,focus:this._focusHandler,blur:this._blurHandler});$(document).delegate("#"+this.element[0].id+"_headers thead th",{keydown:this._keyDownHandler,focus:this._focusHandler,blur:this._blurHandler})},changeGlobalLanguage:function(){},changeGlobalRegional:function(){},_changeLocaleForModalDialog:function(){var $button,$modalDialog=this._getModalDialog();if($modalDialog.length){$modalDialog[this.options.dialogWidget]({locale:{buttonApplyText:this._getLocaleValue("modalDialogButtonApplyText"),buttonCancelText:this._getLocaleValue("modalDialogButtonCancelText"),modalDialogCaptionText:this._getLocaleValue("modalDialogCaptionText")}});$button=this._getDialogClearAllButton();if($button.length){$button.igButton("option","labelText",this._getLocaleValue("modalDialogResetButton"))}$.ui.igWidget.prototype.changeLocale.call(this,$modalDialog)}},_changeLocaleForFeatureChooser:function(){var fc=this.grid.element.data("igGridFeatureChooser");if(fc&&this.renderInFeatureChooser){fc._removeFeature("SortingAscending");fc._removeFeature("SortingDescending");fc._removeFeature("MultipleSorting");this._featureChooserInitialized=false;this._initFC()}},_changeLocaleForThs:function(){var self=this;this.grid.headersTable().find("th").each(function(){var $th=$(this),sortDir=$th.attr("aria-sort");if(sortDir){self._setHeaderAttributes($th,sortDir)}else{self._removeHeaderAttributes($th)}})},changeLocale:function(){this._changeLocaleForModalDialog();this._changeLocaleForFeatureChooser();this._changeLocaleForThs()},_registerWidget:$.noop,_unregisterWidget:$.noop,_setOption:function(key,value){var $modalDialog=this._getModalDialog();this._super(key,value);switch(key){case"type":throw new Error(this._getLocaleValue("optionChangeNotSupported").replace("{optionName}",key));case"caseSensitive":this.grid.dataSource.settings.sorting.caseSensitive=this.options.caseSensitive;break;case"modalDialogSortOnClick":$modalDialog.remove();this._renderMultipleSortingDialog();break;case"modalDialogAnimationDuration":$modalDialog[this.options.dialogWidget]("option","animationDuration",value);break;case"modalDialogWidth":$modalDialog[this.options.dialogWidget]("option","modalDialogWidth",value);break;case"modalDialogHeight":$modalDialog[this.options.dialogWidget]("option","modalDialogHeight",value);break;default:break}},_handleSortKb:function(event){if($(event.target).attr("id")===undefined||$(event.target).attr("id")===null){return}var $el=$(event.target),key=$el.attr("id").replace(this.grid.element.attr("id")+"_",""),id;id=$el.closest(".ui-iggrid").attr("id").replace("_container","");if(this.grid.element.attr("id")!==id){return}if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){if(this._checkSortingAllowed(key)){if(event.shiftKey){this.unsortColumn(key,$el)}else{if(this.sortColumn(key,null,$el)){this._clearActiveHeader();$el.addClass(this.css.sortableColumnHeaderActive);this._currentActiveHeader=$el}}}event.stopPropagation();event.preventDefault()}},_handleFocusKb:function(event){if(this._resizing&&this._resizing._resizing){return}var $target=$(event.target),id=$target.closest(".ui-iggrid").attr("id").replace("_container",""),colId=$target.closest("th").attr("id"),colKey;if(!colId){return}colKey=colId.replace(this.grid.id()+"_","");if(this.grid.element.attr("id")!==id||$target.attr("data-fixing-indicator")!==undefined||!this._checkSortingAllowed(colKey)||!$target.is("th")){return}$target.addClass(this.css.sortableColumnHeaderFocus)},_handleBlurKb:function(event){var id=$(event.target).closest(".ui-iggrid").attr("id").replace("_container","");if(this.grid.element.attr("id")!==id){return}$(event.target).removeClass(this.css.sortableColumnHeaderFocus)},_handleSort:function(event){if(this._resizing&&this._resizing._resizing){this._resizing._resizing=false;return}var $currentTarget=$(event.currentTarget),$th=$currentTarget.closest("th"),key=$th.attr("id").replace(this.grid.element.attr("id")+"_",""),isShiftClicked=false;this._clearActiveHeader();isShiftClicked=event.shiftKey;if(isShiftClicked){this.unsortColumn(key,$th)}else{if(this.sortColumn(key,null,$currentTarget)){$currentTarget.addClass(this.css.sortableColumnHeaderActive);this._currentActiveHeader=$th}}event.stopPropagation();event.preventDefault()},_checkSortingAllowed:function(colKey){var expr,s=this._getColumnSettingByKey(colKey);if(!s||s.allowSorting===false){return false}expr=this._findExpressionByColKey(colKey);if(expr&&expr.isGroupBy){return false}return true},_initLoadingIndicator:function(){this._loadingIndicator=this.grid.container().length>0?this.grid.container().igLoading().data("igLoading").indicator():this.grid.element.igLoading().data("igLoading").indicator()},_getHeaderCellByIdentifier:function(identifier){var $headerCell,colKey;if($.type(identifier)==="number"){colKey=this.grid.options.columns[identifier].key}else{colKey=identifier}$headerCell=$("#"+this.grid.element[0].id+"_"+colKey);return $headerCell},_removeHeaderAttributes:function($header){$header.attr({title:this._getLocaleValue("unsortedColumnTooltip"),"data-localeid":"unsortedColumnTooltip"}).removeAttr("aria-sort")},_setHeaderAttributes:function($header,sortDir){if(!sortDir){return}$header.attr({title:sortDir.startsWith("asc")?this._getLocaleValue("sortedColumnTooltip").replace("${direction}",this._getLocaleValue("ascending")):this._getLocaleValue("sortedColumnTooltip").replace("${direction}",this._getLocaleValue("descending")),"aria-sort":sortDir,"data-localeid":"sortedColumnTooltip","data-localeattr":"title"})},sortColumn:function(index,direction,header){var colKey,expr,noCancel=true,s,i,newDir,apiCall=!header,sortingNewExprs,curNewExpr,compareFunc;this._activeSortedCol=null;if($.type(index)==="number"){colKey=this.grid.options.columns[index].key}else{colKey=index}header=header||$("#"+this.grid.element[0].id+"_"+colKey);this._curColKey=colKey;expr=this.grid.dataSource.settings.sorting.expressions;s=this._getColumnSettingByKey(colKey);if(apiCall){this._clearActiveHeader()}if(!s||!apiCall&&!this._checkSortingAllowed(colKey)){return}if(direction){newDir=direction}else{if(!s.currentSortDirection||!s.currentSortDirection.startsWith("asc")&&!s.currentSortDirection.startsWith("desc")){newDir=s.firstSortDirection===undefined?this.options.firstSortDirection:s.firstSortDirection}else{newDir=s.currentSortDirection&&s.currentSortDirection.indexOf("asc")!==-1?"descending":"ascending"}}compareFunc=null;if(s&&s.compareFunc){if($.type(s.compareFunc)==="function"){compareFunc=s.compareFunc}else if(typeof s.compareFunc==="string"&&window[s.compareFunc]&&typeof window[s.compareFunc]==="function"){compareFunc=window[s.compareFunc]}}curNewExpr={fieldName:colKey,isSorting:true,dir:newDir.startsWith("asc")?"asc":"desc",compareFunc:compareFunc,layout:this.grid.options.key||null};sortingNewExprs=this.grid._getSortingExpressionsManager().addSortingExpression(expr.slice(),curNewExpr,this);this._trigger("internalcolumnsorting",null,{owner:this});sortingNewExprs=this.grid._getSortingExpressionsManager().setFormattersForSortingExprs(sortingNewExprs);if(!apiCall){noCancel=this._trigger(this.events.columnSorting,null,{columnKey:colKey,direction:newDir,owner:this,newExpressions:sortingNewExprs})}this.grid._fireInternalEvent("_sortedColumnsChanging",sortingNewExprs);if(noCancel){s.currentSortDirection=curNewExpr.dir.startsWith("asc")?"ascending":"descending";this._loadingIndicator.show();this._setHeaderAttributes(header,s.currentSortDirection);if(this.options.mode==="single"){for(i=0;i<this.grid.options.columns.length;i++){if(this.options.columnSettings[i]&&this.options.columnSettings[i].columnKey!==colKey){delete this.options.columnSettings[i].currentSortDirection;this._clearSortStyles(this.options.columnSettings[i].columnKey)}}}this.grid.dataSource.settings.sorting.expressions=sortingNewExprs;noCancel=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid,dataSource:this.grid.dataSource});if(this.grid._hasUnboundColumns&&this.options.type==="remote"){this.grid._rebindUnboundColumns=true}if(noCancel){this._saveSortingExpressions();this.grid.element.trigger("iggriduisoftdirty",{owner:this});this._curColKey=colKey;if(this.options.type==="remote"){if(!apiCall){this._shouldFireColumnSorted=true}this.grid.dataSource.dataBind()}else{this.grid.dataSource.sort(this.grid.dataSource.settings.sorting.expressions,s.currentSortDirection);this.grid._renderData();if(!apiCall){this._trigger(this.events.columnSorted,null,{columnKey:colKey,direction:s.currentSortDirection,owner:this,expressions:this.grid.dataSource.settings.sorting.expressions})}}this._curSortDir=s.currentSortDirection;return true}}},sortMultiple:function(exprs){exprs=exprs||this.grid.dataSource.settings.sorting.expressions;var self=this,noCancel,exprsLen=exprs.length,oldExprsLen=this.grid.dataSource.settings.sorting.expressions.length;noCancel=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid,dataSource:this.grid.dataSource});if(noCancel){this.grid.dataSource.settings.sorting.expressions=exprs;this._curColKey=null;this._clearActiveHeader();if(exprsLen){this._curColKey=exprs[exprsLen-1].fieldName}$.each(this.grid.options.columns,function(index,column){var cs,expr,colKey=column.key;cs=self._getColumnSettingByKey(colKey);if(cs){expr=self._findExpressionByColKey(colKey,exprs);if(expr){cs.currentSortDirection=expr.dir;self._applySortStyles(colKey)}else{cs.currentSortDirection=undefined;self._clearSortStyles(colKey)}}});this._saveSortingExpressions();if(this.options.type==="remote"){this.grid.dataSource.dataBind()}else{this.grid.dataSource.sort(exprs);if(this.grid.dataSource.settings.sorting.expressions.length===0&&oldExprsLen>0&&this.grid.dataSource.settings.sorting.defaultFields.length===0){this.grid.dataSource.dataBind()}else{this.grid._renderData()}}}},clearSorting:function(){var i,se=[],exprs=this.grid.dataSource.settings.sorting.expressions;for(i=0;i<exprs.length;i++){se.push(exprs[i].fieldName)}for(i=0;i<se.length;i++){this.unsortColumn(se[i],undefined)}},unsortColumn:function(index,header){var colKey,expr,noCancel=true,s,exprLen,headerId,$th,apiCall=!header;this._activeSortedCol=null;if($.type(index)==="number"){colKey=this.grid.options.columns[index].key}else{colKey=index}headerId=this.grid.id()+"_"+colKey;$th=header||$("#"+headerId);expr=this.grid.dataSource.settings.sorting.expressions;exprLen=expr.length;s=this._getColumnSettingByKey(colKey);if(!s||!apiCall&&!this._checkSortingAllowed(colKey)){return}s.currentSortDirection=undefined;if(!apiCall){noCancel=this._trigger(this.events.columnSorting,null,{columnKey:colKey,direction:s.currentSortDirection,owner:this,expressions:this.grid.dataSource.settings.sorting.expressions})}if(!noCancel||!this._removeExprByKey(colKey,expr)){return}if(!apiCall&&!(this.grid.dataSource.settings.sorting.expressions.length===0&&this.options.type==="local")){noCancel=this.grid._trigger(this.grid.events.dataBinding,null,{owner:this.grid,dataSource:this.grid.dataSource})}if(noCancel){this._curColKey=this._curColKey===colKey?null:this._curColKey;this._clearSortStyles(colKey);this.grid.element.trigger("iggriduisoftdirty",{owner:this});this.grid._fireInternalEvent("_sortedColumnsChanging",expr);$th.removeClass(this.css.sortableColumnHeaderFocus).removeClass(this.css.sortableColumnHeaderActive);this._saveSortingExpressions();if(this.options.type==="remote"){if(!this._loadingIndicator){this._initLoadingIndicator()}this._loadingIndicator.show();if(!apiCall){this._shouldFireColumnSorted=true}this.grid.dataSource.dataBind()}else{if(this.grid.dataSource.settings.sorting.expressions.length===0&&exprLen>0&&this.grid.dataSource.settings.sorting.defaultFields.length===0){this.grid.dataBind()}else{this.grid.dataSource.sort(this.grid.dataSource.settings.sorting.expressions);this.grid._renderData()}if(!apiCall){this._trigger(this.events.columnSorted,null,{columnKey:colKey,direction:s.currentSortDirection,owner:this,expressions:this.grid.dataSource.settings.sorting.expressions})}}this._curSortDir=s.currentSortDirection}},_excludeExpr:function(key){if(this.options.persist&&!this._couldPreserveData()){return}var expr=this.grid.dataSource.settings.sorting.expressions,i;for(i=0;i<expr.length;i++){if(expr[i].fieldName===key){$.ig.removeFromArray(expr,i)}}},_applySortStyles:function(columnKey,ignoreActiveSelection){var prevHeight=null,span,$cells,indicatorContainer,$th,currentColumnSetting,$tbody,hasFixedColumns=this.grid.hasFixedColumns();if(this.grid.options.fixedHeaders){prevHeight=this.grid.headersTable().outerHeight()}$th=$("#"+this.grid.id()+"_"+columnKey);span=$th.find(".ui-iggrid-colindicator");if(span.length===0){span=$("<span></span>").addClass(this.css.sortIndicator)}indicatorContainer=$th.find(".ui-iggrid-indicatorcontainer");if(indicatorContainer.length===0){indicatorContainer=$("<div></div>").appendTo($th).addClass("ui-iggrid-indicatorcontainer")}indicatorContainer.append(span);currentColumnSetting=this._getColumnSettingByKey(columnKey);if(this.options.applySortedColumnCss!==false&&ignoreActiveSelection!==true){if(hasFixedColumns&&this.grid._isFixedElement($th)){$tbody=this.grid.fixedTable().children("tbody")}else{$tbody=this.grid.element.children("tbody")}$cells=this.grid._getCellsByColKey($tbody.find(">tr:not([data-grouprow],[data-summaryrow])"),columnKey)}this._activeSortedCol=null;if(currentColumnSetting&&currentColumnSetting.currentSortDirection){if(currentColumnSetting.currentSortDirection.indexOf("asc")!==-1){span.removeClass(this.css.sortIndicatorDescending).addClass(this.css.sortIndicatorAscending);$th.removeClass(this.css.descendingColumnHeader).addClass(this.css.ascendingColumnHeader);this._setHeaderAttributes($th,"ascending");if(this.options.mode==="single"){$th.siblings("th").removeAttr("aria-sort")}if($cells){this._activeSortedCol={key:currentColumnSetting.columnKey,asc:true};$cells.removeClass(this.css.descendingColumn).addClass(this.css.ascendingColumn)}}else{span.removeClass(this.css.sortIndicatorAscending).addClass(this.css.sortIndicatorDescending);$th.removeClass(this.css.ascendingColumnHeader).addClass(this.css.descendingColumnHeader);this._setHeaderAttributes($th,"descending");if(this.options.mode==="single"){$th.siblings("th").removeAttr("aria-sort")}if($cells){this._activeSortedCol={key:currentColumnSetting.columnKey,asc:false};$cells.removeClass(this.css.ascendingColumn).addClass(this.css.descendingColumn)}}}else{this._removeHeaderAttributes($th);this._clearHeaderCellSortStyles($th)}if(prevHeight!==null&&prevHeight!==this.grid.headersTable().outerHeight()){this.grid._initializeHeights()}},_clearSortStateByColKey:function(key){var s=this._getColumnSettingByKey(key);this._clearSortStyles(key);if(!s){return}s.currentSortDirection=undefined},_clearSortStyles:function(key){if(key===undefined||key===null){return}var hk=this.grid.id()+"_"+key,$cells,i,$tbl,$th,cs;for(i=0;i<this.options.columnSettings.length;i++){cs=this.options.columnSettings[i];if(cs.columnKey===key){if(this.grid._detachedHeaderCells&&this.grid._detachedHeaderCells[key]){$th=this.grid._detachedHeaderCells[key][0]}$th=!$th||!$th.length?$("#"+hk):$th;break}}if(this.options.applySortedColumnCss!==false){$tbl=this.grid.isFixedColumn(key)?$("#"+this.grid.id()+"_fixed"):this.grid.element;$cells=this.grid._getCellsByColKey($tbl,key);$cells.removeClass(this.css.descendingColumn).removeClass(this.css.ascendingColumn)}this._clearHeaderCellSortStyles($th);if(cs&&cs.allowSorting){this._removeHeaderAttributes($th)}else{$th.attr("title","")}},_clearHeaderCellSortStyles:function(spanHeader){var span=spanHeader.find(".ui-iggrid-colindicator");if(span.hasClass("ui-iggrid-colindicator-desc")||span.hasClass("ui-iggrid-colindicator-asc")){span.removeClass(this.css.sortIndicatorDescending).removeClass(this.css.sortIndicatorAscending);spanHeader.removeClass(this.css.ascendingColumnHeader).removeClass(this.css.descendingColumnHeader).removeClass(this.css.sortableColumnHeaderFocus)}},_initDefaultSettings:function(suppressUsrOpts){var settings=[],key,cs=this.options.columnSettings,i,j,k,colIndex=0,defaultExpressions=[],defExpLength,isToSkipGroupBySortingExpr=false,dir,allowSorting,isToCheckUnboundColumns=this.grid._hasUnboundColumns===true&&this.options.type==="remote";if(this.grid.dataSource.settings.sorting.expressions!==null&&this.grid.dataSource.settings.sorting.expressions!==undefined){defaultExpressions=this.grid.dataSource.settings.sorting.expressions}defExpLength=defaultExpressions.length;if(this.grid.options.columns&&this.grid.options.columns.length>0){for(i=0;i<this.grid.options.columns.length;i++){allowSorting=true;if(isToCheckUnboundColumns&&this.grid.getUnboundColumnByKey(this.grid.options.columns[i].key)!==null){allowSorting=false}settings[i]={columnIndex:colIndex,columnKey:this.grid.options.columns[i].key,allowSorting:allowSorting};if(this.grid.options.columns[i].hidden!==true){colIndex++}}}for(i=0;i<cs.length;i++){for(key in cs[i]){if(cs[i].hasOwnProperty(key)&&key!=="columnKey"&&key!=="columnIndex"){if(key==="userSet_currentSortDirection"){if(cs[i].userSet_currentSortDirection==="undefined"||!cs[i].userSet_currentSortDirection){delete cs[i].currentSortDirection}else{cs[i].currentSortDirection=cs[i].userSet_currentSortDirection}}else if(key==="userSet_allowSorting"){cs[i].allowSorting=cs[i][key];delete cs[i][key]}}}}if(settings.length===0&&this.grid.options.autoGenerateColumns&&cs.length>0){for(i=0;i<cs.length;i++){if(!cs[i].columnKey||typeof cs[i].currentSortDirection!=="string"){continue}dir=cs[i].currentSortDirection.startsWith("asc")?"asc":"desc";defaultExpressions.push({fieldName:cs[i].columnKey,isSorting:true,dir:dir})}}else{for(i=0;i<cs.length;i++){for(j=0;j<settings.length;j++){if(settings[j].columnKey!==null&&settings[j].columnKey!==undefined&&cs[i].columnKey!==null&&cs[i].columnKey!==undefined){if(settings[j].columnKey===cs[i].columnKey){break}}else if(settings[j].columnIndex===cs[i].columnIndex){break}}if(j===settings.length){continue}for(key in cs[i]){if(cs[i].hasOwnProperty(key)&&key!=="columnKey"&&key!=="columnIndex"&&!key.startsWith("userSet")){settings[j][key]=cs[i][key];if(!suppressUsrOpts){settings[j]["userSet_"+key]=cs[i][key]}if(key==="currentSortDirection"&&cs[i][key]){if($.type(settings[j].columnKey)!=="number"){isToSkipGroupBySortingExpr=false;if(defExpLength>0){for(k=0;k<defExpLength;k++){if(defaultExpressions[k].fieldName===settings[j].columnKey){if(defaultExpressions[k].isGroupBy===true){isToSkipGroupBySortingExpr=true}else{defaultExpressions.splice(k,1)}break}}}if(isToSkipGroupBySortingExpr===true){continue}defaultExpressions.push({fieldName:settings[j].columnKey,isSorting:true,dir:cs[i][key].startsWith("asc")?"asc":"desc",compareFunc:cs[i].compareFunc})}else{defaultExpressions.push({fieldIndex:settings[j].columnKey,isSorting:true,dir:cs[i][key].startsWith("asc")?"asc":"desc",compareFunc:cs[i].compareFunc})}}}}}}for(i=0;i<settings.length;i++){if(!settings[i].hasOwnProperty("currentSortDirection")){settings[i].userSet_currentSortDirection="undefined"}for(j=0;j<this.grid.dataSource.settings.sorting.expressions.length;j++){if(this.grid.dataSource.settings.sorting.expressions[j].fieldName===settings[i].columnKey){settings[i].currentSortDirection=this.grid.dataSource.settings.sorting.expressions[j].dir}}}this.options.columnSettings=settings;defaultExpressions=this.grid._getSortingExpressionsManager().setFormattersForSortingExprs(defaultExpressions);this.grid.dataSource.settings.sorting.expressions=defaultExpressions;this.grid.dataSource.settings.sorting.defaultFields=defaultExpressions},_clearActiveHeader:function(){if(this._currentActiveHeader){this._currentActiveHeader.removeClass(this.css.sortableColumnHeaderActive).removeClass(this.css.sortableColumnHeaderFocus)}},_initFC:function(){var col,i,cs,initialSorting,featureChooserInstance=this.grid.element.data("igGridFeatureChooser");if(!this._featureChooserInitialized&&featureChooserInstance&&this.renderInFeatureChooser){if(this._featureChooserMenuTogglingHandler){this.grid.element.unbind("iggridfeaturechoosermenutoggling",this._featureChooserMenuTogglingHandler)}this._featureChooserMenuTogglingHandler=$.proxy(this._featureChooserMenuToggling,this);this.grid.element.bind("iggridfeaturechoosermenutoggling",this._featureChooserMenuTogglingHandler);if(featureChooserInstance._isTouchDevice()){for(i=0;i<this.grid.options.columns.length;i++){col=this.grid.options.columns[i];cs=this._getColumnSettingByKey(col.key);if(this._checkSortingAllowed(col.key)){if(featureChooserInstance&&featureChooserInstance._shouldRenderInFeatureChooser(col.key)===true){initialSorting=cs?cs.currentSortDirection:false;if(initialSorting===null){initialSorting=false}featureChooserInstance._renderInFeatureChooser(col.key,{name:"SortingAscending",text:this._getLocaleValue("featureChooserSortAsc"),textHide:this._getLocaleValue("featureChooserSortAsc"),iconClass:this.css.fcSortIndicatorAscending,iconClassOff:this.css.fcSortIndicatorAscending,isSelected:initialSorting&&typeof initialSorting==="string"?initialSorting.toLowerCase().indexOf("asc")>-1:false,method:$.proxy(this._sortAscFromFeatureChooser,this),updateOnClickAll:false,groupName:"toggle",groupOrder:1,order:0,type:"toggle"});featureChooserInstance._renderInFeatureChooser(col.key,{name:"SortingDescending",text:this._getLocaleValue("featureChooserSortDesc"),textHide:this._getLocaleValue("featureChooserSortDesc"),iconClass:this.css.fcSortIndicatorDescending,iconClassOff:this.css.fcSortIndicatorDescending,isSelected:initialSorting&&typeof initialSorting==="string"?initialSorting.toLowerCase().indexOf("desc")>-1:false,method:$.proxy(this._sortDescFromFeatureChooser,this),updateOnClickAll:false,groupName:"toggle",groupOrder:1,order:0,type:"toggle"})}}}}if(this.options.mode!=="single"){for(i=0;i<this.grid.options.columns.length;i++){col=this.grid.options.columns[i];if(this._checkSortingAllowed(col.key)){if(featureChooserInstance._shouldRenderInFeatureChooser(col.key)===true){featureChooserInstance._renderInFeatureChooser(col.key,{name:"MultipleSorting",text:this._getLocaleValue("featureChooserText"),iconClass:this.css.featureChooserModalDialogIcon,method:$.proxy(this.openMultipleSortingDialog,this),groupName:"modaldialog",groupOrder:3,order:2})}}}}this._featureChooserInitialized=true}},_headerCellRendered:function(event,ui){var cs=this._getColumnSettingByKey(ui.columnKey),expr;if(event.target.id!==this.grid.element[0].id){return}if(ui.isMultiColumnHeader===true){return}if(ui.columnKey&&cs){this._headers.push({header:ui.th,index:cs.columnIndex});if(this._checkSortingAllowed(ui.columnKey)!==false){ui.th.addClass(this.css.sortableColumnHeader);if(cs.currentSortDirection===undefined||cs.currentSortDirection===null){ui.th.attr("title",this._getLocaleValue("unsortedColumnTooltip"))}else{ui.th.attr("title",cs.currentSortDirection.startsWith("asc")?this._getLocaleValue("sortedColumnTooltip").replace("${direction}",this._getLocaleValue("ascending")):this._getLocaleValue("sortedColumnTooltip").replace("${direction}",this._getLocaleValue("descending")))}$("<span></span>").appendTo(ui.th).addClass(this.css.sortIndicator);if(cs.currentSortDirection!==undefined){expr=this._findExpressionByColKey(cs.columnKey);if(expr&&!expr.isGroupBy){this._applySortStyles(cs.columnKey)}}}}this._initFC()},_featureChooserMenuToggling:function(event,args){var i,expr,isAsc,hasSorting=false,columnKey=args.columnKey,featureChooserInstance=this.grid.element.data("igGridFeatureChooser"),exprs=this.grid.dataSource.settings.sorting.expressions,exprsLength=exprs.length;if(!args.isVisible){for(i=0;i<exprsLength;i++){expr=exprs[i];if(expr.fieldName===columnKey){hasSorting=true;isAsc=false;if(expr.dir&&expr.dir.toLowerCase().indexOf("asc")>-1){isAsc=true}featureChooserInstance._setSelectedState("SortingDescending",columnKey,!isAsc,false);featureChooserInstance._setSelectedState("SortingAscending",columnKey,isAsc,false)}}if(!hasSorting){featureChooserInstance._setSelectedState("SortingDescending",columnKey,false,false);featureChooserInstance._setSelectedState("SortingAscending",columnKey,false,false)}}},_sortAscFromFeatureChooser:function(event,columnKey,isSelected){var featureChooserInstance=this.grid.element.data("igGridFeatureChooser"),gridId=this.grid.id(),$th=$("#"+gridId+"_"+columnKey);if(!featureChooserInstance){return}featureChooserInstance._setSelectedState("SortingDescending",columnKey,false,false);if(isSelected){this.sortColumn(columnKey,"asc",$th)}else{this.unsortColumn(columnKey,$th)}},_sortDescFromFeatureChooser:function(event,columnKey,isSelected){var featureChooserInstance=this.grid.element.data("igGridFeatureChooser"),gridId=this.grid.id(),$th=$("#"+gridId+"_"+columnKey);featureChooserInstance._setSelectedState("SortingAscending",columnKey,false,false);if(!featureChooserInstance){return}if(isSelected){this.sortColumn(columnKey,"desc",$th)}else{this.unsortColumn(columnKey,$th)}},_fixedColumnsChanged:function(args){var i,grid=this.grid,stngs=this.options.columnSettings,start=args.start,len=args.length,at=args.at,fixedTable=grid.fixedHeadersTable(),isAttachedSortingHandlers=fixedTable.data("attachedSortingHandlers");
if(isAttachedSortingHandlers!==true){fixedTable.data("attachedSortingHandlers",true);fixedTable.delegate("thead th",{click:this._clickHandler,mouseover:this._mouseOverHandler,mouseout:this._mouseOutHandler})}grid._rearrangeArray(stngs,start,len,at);for(i=0;i<stngs.length;i++){stngs[i].columnIndex=i}},_columnsRearranged:function(){this._initDefaultSettings(true)},_columnMap:function(){var self=this,isMultiple=self.options.mode!=="single";return $.map(this.grid.options.columns,function(col){var cs=self._getColumnSettingByKey(col.key),allowSorting=!!(isMultiple&&cs&&cs.allowSorting);return{columnKey:col.key,enabled:allowSorting}})},_findExpressionByColKey:function(key,exprs){exprs=exprs||this.grid.dataSource.settings.sorting.expressions;var i,len=exprs.length,res=null,layout=this.grid.options.key||null;for(i=0;i<len;i++){if(exprs[i].fieldName===key&&(!exprs[i].layout&&!layout||exprs[i].layout===layout)){return exprs[i]}}return res},_dataRendered:function(){var i,cs,expr,col,colKey,gridId=this.grid.element[0].id,ignoreActiveSelection;if(!this._loadingIndicator){this._initLoadingIndicator()}expr=this._sortingExpressions;if(this._shouldFireColumnSorted){this._trigger(this.events.columnSorted,null,{columnKey:this._curColKey,direction:this._curSortDir,owner:this,expressions:this.grid.dataSource.settings.sorting.expressions});this._shouldFireColumnSorted=false}this._loadingIndicator.hide();if(this._curColKey!==undefined&&this._curColKey!==null){this._applySortStyles(this._curColKey)}else if(this.options.persist&&this._restoreSorting&&expr&&expr.length>0){for(i=0;i<expr.length;i++){if(expr[i].isGroupBy){continue}colKey=expr[i].fieldName;cs=this._getColumnSettingByKey(colKey);if(cs){cs.currentSortDirection=expr[i].dir}ignoreActiveSelection=true;col=$("#"+gridId+"_"+colKey);this._curColKey=colKey;if(i===expr.length-1){col.addClass(this.css.sortableColumnHeaderActive);this._currentActiveHeader=col;ignoreActiveSelection=false;this._curColKey=colKey}this._applySortStyles(colKey,ignoreActiveSelection)}this._restoreSorting=false}},_onUIDirty:function(e,args){if(this.options.persist&&this.options.type==="remote"){return}var i,j,exprs=this.grid.dataSource.settings.sorting.expressions,defaultExprs=this.grid.dataSource.settings.sorting.defaultFields,cs=this.options.columnSettings,skip=false;if(args.owner===this||args.owner.element[0].id!==this.element[0].id){return}this._curColKey=null;this._clearUi(true);for(i=0;i<exprs.length;i++){skip=false;for(j=0;j<cs.length;j++){if(exprs[i].isGroupBy===true||cs[j].columnKey===exprs[i].fieldName&&cs[j].userSet_currentSortDirection){skip=true;break}}if(!skip){if(exprs.length>i){$.ig.removeFromArray(exprs,i)}if(defaultExprs.length>i){$.ig.removeFromArray(defaultExprs,i)}}}},_clearUi:function(){var i,header,csd,isMCH=this.grid._isMultiColumnGrid,persist=this.options.persist;for(i=0;this._headers&&i<this._headers.length;i++){csd=this.options.columnSettings[i].userSet_currentSortDirection;if((isMCH||persist)&&this.options.columnSettings[i].columnKey){header=$("#"+this.grid.element[0].id+"_"+this.options.columnSettings[i].columnKey)}else{header=this._headers[i].header}if(!csd||csd==="undefined"){this._clearSortStyles(this.options.columnSettings[i].columnKey);if(this.options.mode!=="single"){delete this.options.columnSettings[i].currentSortDirection;this._excludeExpr(this.options.columnSettings[i].columnKey)}}else{this._applySortStyles(this.options.columnSettings[i].columnKey)}header.removeClass(this.css.sortableColumnHeaderActive).removeClass(this.css.sortableColumnHeaderHover).addClass(this.grid.css.headerClass);if(this._checkSortingAllowed(this.options.columnSettings[i].columnKey)){header.addClass(this.css.sortableColumnHeader)}}},_virtualHorizontalScroll:function(event,args){var start=args.startColIndex,end=args.endColIndex,i,j,cs=this.options.columnSettings,header,ths=this.grid.headersTable().find("thead > tr").first().find("th").not("[ data-skip=true ]"),visibleColumns=this.grid._visibleColumns(),key;for(i=0;i<ths.length;i++){header=ths.eq(i);key=header.attr("id").replace(this.grid.id()+"_","");this._clearSortStyles(key);header.removeClass(this.css.sortableColumnHeaderActive).removeClass(this.css.sortableColumnHeaderHover).addClass(this.grid.css.headerClass).addClass(this.css.sortableColumnHeader)}for(i=start;i<=end;i++){header=ths.eq(i-start);header.data("columnIndex",i);for(j=0;j<cs.length;j++){if(cs[j].currentSortDirection&&cs[j].columnKey===visibleColumns[i].key){this._applySortStyles(cs[j].columnKey)}}}},_columnsCollectionModified:function(event,args){if(args.owner.element.attr("id")!==this.grid.element.attr("id")){return}var i,j,found,colKey,cs,visibleColumns=this.grid._visibleColumns();for(i=0;i<this.options.columnSettings.length;i++){j=0;found=false;for(j=0;j<visibleColumns.length;j++){if(visibleColumns[j].key===this.options.columnSettings[i].columnKey){found=true;colKey=visibleColumns[j].key;break}}if(found){this.options.columnSettings[i].columnIndex=j;cs=this.options.columnSettings[i];if(cs&&cs.currentSortDirection!==undefined&&this.options.applySortedColumnCss!==false){this._applySortStyles(colKey,true)}}}if(this._curColKey){this._applySortStyles(this._curColKey)}$("#"+this.element[0].id+" thead th").removeClass(this.css.sortableColumnHeaderHover)},_detachEvents:function(){if(this._headerCellRenderedHandler){this.grid.element.unbind("iggridheadercellrendered",this._headerCellRenderedHandler)}if(this._virtualHorizontalScrollHandler){this.grid.element.unbind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler)}if(this._uiDirtyHandler){this.grid.element.unbind("iggriduidirty",this._uiDirtyHandler)}if(this._headerRenderedHandler){this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler)}if(this._columnsCollectionModifiedHandler){this.grid.element.unbind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler)}if(this._columnsRearangedHandler){this.grid.element.unbind("iggrid_columnsmoved",this._columnsRearangedHandler)}if(this._featureChooserMenuTogglingHandler){this.grid.element.unbind("iggridfeaturechoosermenutoggling",this._featureChooserMenuTogglingHandler)}},destroy:function(){var i,a,fc,header,span,text,modalDialog=this._getModalDialog();if(!this.grid){return}$("#"+this.element[0].id+" thead th").unbind("dragstart",this._dragStartHandler);$("#"+this.element[0].id+"_headers thead th").unbind("dragstart",this._dragStartHandler);$(document).undelegate("#"+this.element[0].id+"_headers thead th",{click:this._clickHandler,mouseover:this._mouseOverHandler,mouseout:this._mouseOutHandler});$("#"+this.element[0].id).undelegate("thead th",{click:this._clickHandler,mouseover:this._mouseOverHandler,mouseout:this._mouseOutHandler});$("#"+this.element[0].id).undelegate("thead th",{keydown:this._keyDownHandler,focus:this._focusHandler,blur:this._blurHandler});$(document).undelegate("#"+this.element[0].id+"_headers thead th",{keydown:this._keyDownHandler,focus:this._focusHandler,blur:this._blurHandler});this._detachEvents();delete this._blurHandler;delete this._clickHandler;delete this._headerCellRenderedHandler;delete this._focusHandler;delete this._keyDownHandler;delete this._mouseOutHandler;delete this._mouseOverHandler;delete this._dragStartHandler;delete this._uiDirtyHandler;delete this._virtualHorizontalScrollHandler;delete this._headerRenderedHandler;delete this._columnsRearangedHandler;this.grid.element.find(".ui-iggrid-colasc").removeClass("ui-iggrid-colasc ui-state-highlight");this.grid.element.find(".ui-iggrid-coldesc").removeClass("ui-iggrid-coldesc ui-state-highlight");this._clearUi(true);for(i=0;this._headers&&i<this._headers.length;i++){header=this._headers[i].header;header.removeClass("ui-iggrid-sortableheader ui-state-default"+" ui-state-active ui-state-hover ui-state-focus");header.attr("title","");span=header.find("a span");text=span.text();a=header.find("a:not([ th-remove-focus ])");$("<span>"+text+"</span>").appendTo(header).addClass("ui-iggrid-headertext");a.remove()}fc=this.grid.element.data("igGridFeatureChooser");if(fc&&this.renderInFeatureChooser){fc._removeFeature("SortingAscending");fc._removeFeature("SortingDescending");fc._removeFeature("MultipleSorting")}this._headers=null;if(this._loadingIndicator){delete this._loadingIndicator}modalDialog[this.options.dialogWidget]("getCaptionButtonContainer");modalDialog.remove();this._superApply(arguments);return this},_renderMultipleSortingDialog:function(){var $buttonOK,containment,self=this,o=this.options,modalDialogId=this.grid.element[0].id+"_multiplesorting_modalDialog",$captionButtonContainer,modalDialog;if(this.options.sortingDialogContainment==="owner"){containment=this.grid.container()}else{containment="window"}$("#"+modalDialogId).remove();modalDialog=$("<div></div>").appendTo(this.grid._rootContainer()).attr("id",modalDialogId);modalDialog[this.options.dialogWidget]({containment:containment,locale:{buttonApplyText:this._getLocaleValue("modalDialogButtonApplyText"),buttonCancelText:this._getLocaleValue("modalDialogButtonCancelText"),modalDialogCaptionText:this._getLocaleValue("modalDialogCaptionText")},renderFooterButtons:!o.modalDialogSortOnClick,modalDialogWidth:o.modalDialogWidth,modalDialogHeight:o.modalDialogHeight,animationDuration:o.modalDialogAnimationDuration,gridContainer:this.grid.container(),modalDialogOpening:$.proxy(this._onDialogOpening,this),modalDialogMoving:$.proxy(this._onDialogMoving,this),modalDialogClosing:$.proxy(this._onDialogClosing,this),modalDialogClosed:$.proxy(this._onDialogClosed,this)});if(o.modalDialogSortOnClick){$captionButtonContainer=modalDialog[this.options.dialogWidget]("getCaptionButtonContainer");$("<span></span>").addClass("ui-icon ui-icon-closethick").appendTo($("<a></a>").appendTo($captionButtonContainer).attr("title",this._getLocaleValue("columnChooserCloseButtonTooltip")).attr("href","#").attr("role","button").addClass("ui-dialog-titlebar-close ui-corner-all").bind("click.hiding",function(event){modalDialog[self.options.dialogWidget]("closeModalDialog",true);event.preventDefault();event.stopPropagation();return false}))}else{$captionButtonContainer=modalDialog[this.options.dialogWidget]("getCaptionButtonContainer");$buttonOK=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog_footer_buttonok");$buttonOK.bind("igbuttonclick",function(e){self._multiplesortingDialogButtonOKClick(e);e.preventDefault()})}},openMultipleSortingDialog:function(){var modalDialog=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog");modalDialog[this.options.dialogWidget]("openModalDialog")},closeMultipleSortingDialog:function(){var modalDialog=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog");modalDialog[this.options.dialogWidget]("closeModalDialog")},_onDialogOpening:function(e,args){var noCancel=this._trigger(this.events.modalDialogOpening,e,{modalDialogElement:args.modalDialog,owner:this});if(noCancel){this._tempExpr=this.grid.dataSource.settings.sorting.expressions.slice(0);this.renderMultipleSortingDialogContent(true);this._trigger(this.events.modalDialogOpened,e,{modalDialogElement:args.modalDialog,owner:this})}return noCancel},_onDialogMoving:function(e,ui){this._trigger(this.events.modalDialogMoving,e,{modalDialogElement:e.target,owner:this,originalPosition:ui.originalPosition,position:ui.position})},_onDialogClosing:function(e,args){return this._trigger(this.events.modalDialogClosing,e,{modalDialogElement:args.modalDialog,owner:this})},_onDialogClosed:function(e,args){this._trigger(this.events.modalDialogClosed,e,{modalDialogElement:args.modalDialog,owner:this})},renderMultipleSortingDialogContent:function(isToCallEvents){var $content,$sortedColumns,$unsortedColumns,i,noCancel=true,self=this,tempExpr,grid=this.grid,columns=grid.options.columns,css=this.css,modalDialog=$("#"+grid.element[0].id+"_multiplesorting_modalDialog");if(isToCallEvents){noCancel=this._trigger(this.events.modalDialogContentsRendering,null,{modalDialogElement:modalDialog,owner:this})}if(noCancel){this.removeDialogClearButton();$content=modalDialog[this.options.dialogWidget]("getContent");$content.empty();$sortedColumns=$("<div></div>").attr("id",grid.element[0].id+"_multiplesorting_modalDialog_sortedcolumns").addClass(css.dialogSortedColumns).appendTo($content);$unsortedColumns=$("<div></div>").attr("id",grid.element[0].id+"_multiplesorting_modalDialog_unsortedcolumns").addClass(css.dialogUnsortedColumns).appendTo($content);$("<ul></ul>").addClass(css.dialogSortedColumnsList).appendTo($sortedColumns);$("<ul></ul>").addClass(css.dialogUnsortedColumnsList).appendTo($unsortedColumns);tempExpr=self._tempExpr||[];tempExpr.forEach(function(se){var key=se.fieldName,cs=self._getColumnSettingByKey(key);if(!cs||self._checkSortingAllowed(key)===false){return}self._renderDialogSortedColumn(grid.columnByKey(key),cs.columnIndex,se.dir)});$.each(columns,function(columnIndex,column){var cs,direction,key=column.key;cs=self._getColumnSettingByKey(key);if(!cs||self._checkSortingAllowed(key)===false){return true}for(i=0;i<tempExpr.length;i++){if(tempExpr[i].fieldName===key){return true}}direction=cs.currentSortDirection||cs.firstSortDirection||self.options.firstSortDirection;self._renderDialogUnsortedColumn(column,cs.columnIndex,direction)});if(isToCallEvents){this._trigger(this.events.modalDialogContentsRendered,null,{modalDialogElement:modalDialog,owner:this})}if(this._isToRenderButtonClearAll()){this._renderDialogButtonClearAll()}}},_renderDialogSortedColumn:function(column,columnIndex,direction){var self=this,$li,css=this.css,$buttonUnsort,liHTML,o=this.options,key=column.key,buttonAscDescId=this.grid.element[0].id+"_"+key+"_multiplesorting_modalDialog_sortedcolumns_buttonascdesc",buttonUnsortId=this.grid.element[0].id+"_"+key+"_multiplesorting_modalDialog_sortedcolumns_buttonunsort",$ul=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog_sortedcolumns ul");$ul.css("width");$li=$("<li  tabIndex='0'></li>").attr("id",self.grid.element[0].id+"_"+key+"_multiplesorting_sorted_li").addClass(css.dialogSortedColumnsItem);$li.appendTo($ul);if(columnIndex!==null&&columnIndex!==undefined){$li.attr("li-order",columnIndex)}liHTML="<span id='"+buttonAscDescId+"' class='"+css.dialogButtonAsc+"' role='button' title='"+this._getLocaleValue("modalDialogCaptionButtonDesc")+"' data-localeid='modalDialogCaptionButtonDesc' data-localeattr='title'>"+"\t<span class='"+css.dialogButtonAscIcon+"'></span>"+"</span>"+"<span class='"+css.dialogSortedColumnTextContainer+"'>"+column.headerText+"</span>"+"<button type='button' id='"+buttonUnsortId+"' class='"+css.dialogButtonUnsort+"' role='button' data-localeid='modalDialogCaptionButtonUnsort' "+"data-localeattr='title' title='"+this._getLocaleValue("modalDialogCaptionButtonUnsort")+"' >"+"\t<span class='"+css.dialogButtonUnsortContainer+"'></span>"+"\t<span class='ui-button-text' data-localeid='modalDialogCaptionButtonUnsort'>"+this._getLocaleValue("modalDialogCaptionButtonUnsort")+"</span>"+"</button>";$li.bind({click:function(e){self._curColKey=key;self._dialogButtonAscDescClick(key);if(self._isToRenderButtonClearAll()){self._renderDialogButtonClearAll()}else{self.removeDialogClearButton()}e.preventDefault();e.stopPropagation()}});$li.html(liHTML);$buttonUnsort=$("#"+buttonUnsortId);if(direction!==undefined){if(direction.indexOf("asc")!==-1){self._setDialogButtonAscDesc(true,key)}else{self._setDialogButtonAscDesc(false,key)}}else{self._setDialogButtonAscDesc(true,key)}$buttonUnsort.bind({keydown:function(e){if(e.keyCode===$.ui.keyCode.ENTER||e.keyCode===$.ui.keyCode.SPACE){e.target.click();e.preventDefault();e.stopPropagation()}},click:function(e){var noCancel,gridId=self.grid.element[0].id,modalDialog=$("#"+gridId+"_multiplesorting_modalDialog");noCancel=self._trigger(self.events.modalDialogButtonUnsortClick,e,{modalDialogElement:modalDialog,owner:self,columnKey:key});if(noCancel){$li.remove();if(o.modalDialogSortOnClick===true){self.unsortColumn(key,$("#"+gridId+"_"+key))}else{self._removeExprByKey(key,self._tempExpr)}self._renderDialogUnsortedColumn(column,columnIndex,direction);if(self._isToRenderButtonClearAll()){self._renderDialogButtonClearAll()}else{self.removeDialogClearButton()}}e.preventDefault();e.stopPropagation()},mouseover:function(){if(!$(this).hasClass(css.dialogButtonsHover)){$(this).addClass(css.dialogButtonsHover)}},mouseout:function(){if($(this).hasClass(css.dialogButtonsHover)){$(this).removeClass(css.dialogButtonsHover)}}});return $li},_dialogButtonAscDescClick:function(colKey){var o=this.options,noCancel,modalDialog=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog"),$buttonAscDesc=$("#"+this.grid.element[0].id+"_"+colKey+"_multiplesorting_modalDialog_sortedcolumns_buttonascdesc"),isAsc=$buttonAscDesc.data("isAsc");noCancel=this._trigger(this.events.modalDialogSortingChanged,null,{modalDialogElement:modalDialog,owner:this,columnKey:colKey,isAsc:!isAsc});if(noCancel){this._curColKey=colKey;if(this._isToRenderButtonClearAll()){this._renderDialogButtonClearAll()}else{this.removeDialogClearButton()}if(isAsc===true){if(o.modalDialogSortOnClick===true){this.sortColumn(colKey,"descending",this._getHeaderCellByIdentifier(colKey))}else{this._sortTempExprs(colKey,"desc")}this._setDialogButtonAscDesc(false,colKey)}else{if(o.modalDialogSortOnClick===true){this.sortColumn(colKey,"ascending",this._getHeaderCellByIdentifier(colKey))}else{this._sortTempExprs(colKey,"asc")}this._setDialogButtonAscDesc(true,colKey)}}},_setDialogButtonAscDesc:function(isAsc,colKey){var css=this.css,buttonAscDescId=this.grid.element[0].id+"_"+colKey+"_multiplesorting_modalDialog_sortedcolumns_buttonascdesc",$buttonAscDesc=$("#"+buttonAscDescId),$spanIcon=$buttonAscDesc.find("span:eq(0)");$buttonAscDesc.data("isAsc",isAsc);if(isAsc===true){$buttonAscDesc.attr({title:this._getLocaleValue("modalDialogCaptionButtonDesc"),"data-localeid":"modalDialogCaptionButtonDesc","data-localeattr":"title"}).removeClass(css.dialogButtonDesc).addClass(css.dialogButtonAsc);$spanIcon.removeClass(css.dialogButtonDescIcon).addClass(css.dialogButtonAscIcon)}else{$buttonAscDesc.attr({title:this._getLocaleValue("modalDialogCaptionButtonAsc"),"data-localeid":"modalDialogCaptionButtonAsc","data-localeattr":"title"}).removeClass(css.dialogButtonAsc).addClass(css.dialogButtonDesc);$spanIcon.removeClass(css.dialogButtonAscIcon).addClass(css.dialogButtonDescIcon)}},_removeExprByKey:function(colKey,exprs){var i,len=exprs.length;for(i=0;i<len;i++){if(exprs[i].fieldName===colKey){exprs.splice(i,1);return true}}return false},_sortTempExprs:function(colKey,dir){var i,exprs=this._tempExpr,expr={fieldName:colKey,isSorting:true,dir:dir};for(i=0;i<exprs.length;i++){if(exprs[i].fieldName===colKey){exprs[i]=expr;return}}exprs.push(expr)},_renderDialogUnsortedColumn:function(column,columnIndex,direction){var self=this,$li,$a,key=column.key,o=this.options,css=this.css,$ul=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog_unsortedcolumns ul");$ul.css("width");$li=$("<li></li>").attr("id",self.grid.element[0].id+"_"+key+"_multiplesorting_unsorted_li").addClass(css.dialogUnsortedColumnsItem).append("<span class='"+css.dialogUnsortedColumnsSortByButton+"'><a href='#'></a></span> <span class='"+css.dialogItemText+"'>"+column.headerText+"</span>");this._insertColumnModalDialog($ul,$li,columnIndex);if(columnIndex!==null&&columnIndex!==undefined){$li.attr("li-order",columnIndex)}$a=$li.find("a:first");$a.addClass(css.modalDialogSortByColumn);$a.attr({"data-localeid":"modalDialogSortByButtonText"}).html(this._getLocaleValue("modalDialogSortByButtonText"));$li.bind({keydown:function(e){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){$li.click();e.preventDefault();e.stopPropagation()}},click:function(e){var noCancel,modalDialog=$("#"+self.grid.element[0].id+"_multiplesorting_modalDialog");noCancel=self._trigger(self.events.modalDialogSortClick,e,{modalDialogElement:modalDialog,owner:self,columnKey:key});if(noCancel){$li.remove();self._renderDialogSortedColumn(column,columnIndex,direction);self._sortTempExprs(column.key,direction);if(o.modalDialogSortOnClick){self.sortColumn(key,null,self._getHeaderCellByIdentifier(key))}else{if(self._isToRenderButtonClearAll()){self._renderDialogButtonClearAll()}else{self.removeDialogClearButton()}}}e.preventDefault();e.stopPropagation()}});return $li},_isToRenderButtonClearAll:function(){var i,j,cs,columnKey,expr=this._tempExpr;for(i=0;i<this.options.columnSettings.length;i++){cs=this.options.columnSettings[i];if(!this._checkSortingAllowed(cs.columnKey)){continue}columnKey=cs.columnKey;for(j=0;j<expr.length;j++){if(expr[j].fieldName===columnKey){if(cs.userSet_currentSortDirection!==expr[j].dir){return true}break}}if(j===expr.length&&cs.userSet_currentSortDirection!=="undefined"&&cs.userSet_currentSortDirection){return true}}return false},_getDialogClearAllButton:function(){return $("#"+this.grid.element[0].id+"_sorting_modalDialog_reset_button")},_getModalDialog:function(){return $("#"+this.grid.element[0].id+"_multiplesorting_modalDialog")},removeDialogClearButton:function(){this._getDialogClearAllButton().remove()},_onDialogButtonClearAllClick:function(e){var noCancel,i,cs=this.options.columnSettings;noCancel=this._trigger(this.events.modalDialogButtonResetClick,e,{modalDialogElement:$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog"),owner:this});if(noCancel){this._tempExpr=[];for(i=0;i<cs.length;i++){if(cs[i].userSet_currentSortDirection&&cs[i].userSet_currentSortDirection!=="undefined"&&this._checkSortingAllowed(cs[i].columnKey)!==false){this._tempExpr.push({fieldName:cs[i].columnKey,isSorting:true,dir:cs[i].userSet_currentSortDirection})}}this.renderMultipleSortingDialogContent(false);this.removeDialogClearButton()}},_renderDialogButtonClearAll:function(){if(this.options.modalDialogSortOnClick===true){return}var resetButtonId=this.grid.element[0].id+"_sorting_modalDialog_reset_button",modalDialog=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog"),$captionButtonContainer,$resetButton;if($("#"+resetButtonId).length===0){$captionButtonContainer=modalDialog[this.options.dialogWidget]("getCaptionButtonContainer");$resetButton=$("<button type='button'></button>").attr("id",resetButtonId).appendTo($captionButtonContainer);$resetButton.igButton({labelText:this._getLocaleValue("modalDialogResetButton"),click:$.proxy(this._onDialogButtonClearAllClick,this)})}},_multiplesortingDialogButtonOKClick:function(e){var noCancel,exprs=this.grid._getSortingExpressionsManager().setFormattersForSortingExprs(this._tempExpr),modalDialog=$("#"+this.grid.element[0].id+"_multiplesorting_modalDialog");noCancel=this._trigger(this.events.modalDialogButtonApplyClick,e,{modalDialogElement:modalDialog,owner:this,columnsToSort:this._tempExpr});if(noCancel){this.sortMultiple(exprs);modalDialog[this.options.dialogWidget]("closeModalDialog")}},_insertColumnModalDialog:function($ul,$li,pos){var i,$currLi,currPos,listItems=$ul.find("li"),listItemsLength=listItems.length;if(listItemsLength===0||pos===null||pos===undefined){$li.appendTo($ul);return}for(i=0;i<listItemsLength;i++){$currLi=$(listItems[i]);currPos=$currLi.attr("li-order");if(currPos>=pos){$li.insertBefore($currLi);break}}if(i===listItemsLength){$li.appendTo($ul)}},_getColumnSettingByKey:function(key){var i,colSettings=this.options.columnSettings,len=colSettings.length;for(i=0;i<len;i++){if(colSettings[i].columnKey===key){return colSettings[i]}}},_headerRendered:function(event,ui){if(ui.owner.element.attr("id")!==this.grid.element.attr("id")){return}if(this.grid.element.data("igGridResizing")){this._resizing=this.grid.element.data("igGridResizing")}if(!this._columnFixing&&this.grid.element.data("igGridColumnFixing")){this._columnFixing=this.grid.element.data("igGridColumnFixing")}if(this.options.mode!=="single"){this._renderMultipleSortingDialog()}},_saveSortingExpressions:function(){var grid=this.grid;if(this.options.persist){var se;se=$.grep(this.grid.dataSource.settings.sorting.expressions,function(s){var col=grid.columnByKey(s.fieldName);return!col||col.unbound!==true});this.grid._savePersistenceData(se,"sorting",this.grid.element[0].id);this._sortingExpressions=se;this._restoreSorting=false}},_preserveSorting:function(){var grid=this.grid,arr,gbArr=[],se=grid._getPersistenceData("sorting",grid.element[0].id),topmostEl,gb,i,layout=grid.options.key,indToRemove;if(se){topmostEl=this.element.closest(".ui-iggrid-root");this._restoreSorting=true;if(se!==this._sortingExpressions){this._sortingExpressions=se}if(topmostEl.length&&topmostEl.attr("id")!==grid.id()){gb=topmostEl.data("igGridGroupBy");if(gb){if(grid.element.data("igGridGroupBy")){arr=grid.dataSource.settings.sorting.defaultFields;for(i=0;i<arr.length;i++){if(arr[i].layout===layout){if(arr[i].isGroupBy){gbArr.push(arr[i]);continue}break}}}indToRemove=-1;for(i=0;i<se.length;i++){if(se[i].isGroupBy){indToRemove=i}else{break}}if(indToRemove>-1){$.ig.removeFromArray(se,0,indToRemove)}for(i=0;i<gbArr.length;i++){se.unshift(gbArr[i])}}}se=grid._getSortingExpressionsManager().setFormattersForSortingExprs(se);grid.dataSource.settings.sorting.expressions=se;grid.dataSource.settings.sorting.defaultFields=se}},_applyActiveSortCellStyle:function(data,col){var expressionExists=false;$(this.grid.dataSource.settings.sorting.expressions).each(function(){if(this.fieldName===col){expressionExists=true;return false}});if(this._activeSortedCol&&expressionExists&&col===this._activeSortedCol.key){return this._activeSortedCol.asc?this.css.ascendingColumn:this.css.descendingColumn}return""},_couldPreserveData:function(){return!this.options.persist||this.grid.dataSource.settings.sorting.expressions!==this.grid._getPersistenceData("sorting",this.grid.element[0].id)},_injectGrid:function(gridInstance,isRebind){var i,cs,col,restoreSortingExpr,topmostGrid,semgr;this.grid=gridInstance;semgr=this.grid._getSortingExpressionsManager();this._detachEvents();if(this.options.type===null){this.options.type=this.grid._inferOpType()}if(this.options.persist&&this.options.type==="remote"){topmostGrid=this.element.closest(".ui-iggrid-root").data("igGrid");if(topmostGrid&&topmostGrid.element.attr("id")!==this.grid.element[0].id&&topmostGrid.options.initialDataBindDepth===-1){this.options.persist=false}}if(this.options.type){this.grid.dataSource.settings.sorting.type=this.options.type}else{this.grid.dataSource.settings.sorting.type="remote"}this.grid.dataSource.settings.sorting.caseSensitive=this.options.caseSensitive;this.grid.dataSource.settings.sorting.defaultFields=semgr.setFormattersForSortingExprs(this.grid.dataSource.settings.sorting.expressions);this.grid.dataSource.settings.sorting.enabled=true;this.grid.dataSource.settings.sorting.sortUrlKey=this.options.sortUrlKey;this.grid.dataSource.settings.sorting.sortUrlAscValueKey=this.options.sortUrlKeyAscValue;this.grid.dataSource.settings.sorting.sortUrlDescValueKey=this.options.sortUrlKeyDescValue;if($.type(this.options.customSortFunction)==="function"){this.grid.dataSource.settings.sorting.customFunc=this.options.customSortFunction}else if(typeof this.options.customSortFunction==="string"){if(window[this.options.customSortFunction]&&typeof window[this.options.customSortFunction]==="function"){this.grid.dataSource.settings.sorting.customFunc=window[this.options.customSortFunction]}}this._headerCellRenderedHandler=$.proxy(this._headerCellRendered,this);this._columnsCollectionModifiedHandler=$.proxy(this._columnsCollectionModified,this);this._uiDirtyHandler=$.proxy(this._onUIDirty,this);this._headerRenderedHandler=$.proxy(this._headerRendered,this);this._columnsRearangedHandler=$.proxy(this._columnsRearranged,this);this.grid.element.bind("iggridheadercellrendered",this._headerCellRenderedHandler);this._virtualHorizontalScrollHandler=$.proxy(this._virtualHorizontalScroll,this);this.grid.element.bind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler);this.grid.element.bind("iggriduidirty",this._uiDirtyHandler);this.grid.element.bind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler);this.grid.element.bind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.bind("iggrid_columnsmoved",this._columnsRearangedHandler);if(this.options.persist&&this.grid._hasUnboundColumns){cs=this.options.columnSettings;for(i=0;i<cs.length;i++){if(cs[i].columnKey&&cs[i].currentSortDirection){col=this.grid.columnByKey(cs[i].columnKey);if(col&&col.unbound===true){delete cs[i].currentSortDirection}}}}this._initDefaultSettings();restoreSortingExpr=null;if(this.options.persist&&this.grid.element.data("igGridGroupBy")&&this.options.mode!=="single"){if(this.grid.element.data("igGridGroupBy")._getSortingExpressions()===this.grid.dataSource.settings.sorting.expressions){restoreSortingExpr=this.grid.dataSource.settings.sorting.expressions.slice(0)}}this._clearUi();if(restoreSortingExpr){this.grid.dataSource.settings.sorting.expressions=semgr.setFormattersForSortingExprs(restoreSortingExpr);this._saveSortingExpressions()}this._currentActiveHeader=null;this._curColKey=null;if(this.options.persist){this._preserveSorting()}if(!isRebind&&!this._cellStyleSubscriberAdded&&(this.grid.options.rowVirtualization||this.grid.options.virtualization)){this._cellStyleSubscriberAdded=true;this.grid._cellStyleSubscribers.push($.proxy(this._applyActiveSortCellStyle,this))}}});$.extend($.ui.igGridSorting,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI Grid Column Summaries 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 *	infragistics.ui.grid.shared.js
 *	infragistics.ui.grid.featurechooser.js
 */
(function($){$.widget("ui.igGridSummaries",$.ui.igWidget,{grid:null,css:{columnSummariesDropdown:"ui-iggrid-summaries-dialog",footerRowTextContainer:"ui-iggrid-summaries-footer-text-container",footerRowIconContainer:"ui-corner-all ui-iggrid-summaries-footer-icon-container",footerDropdownButtonsContainer:"ui-iggrid-summaries-footer-dialog-buttons-container",footerButtonIcon:"ui-icon ui-icon-calculator ui-iggrid-icon-summaries",footerButtonIconHover:"ui-iggrid-filterbuttonhover ui-state-hover",footerButtonIconActive:"ui-iggrid-filterbuttonactive ui-state-active",featureChooserIconClass:"ui-icon ui-iggrid-icon-summaries",dropDownListContainer:"ui-iggrid-summaries-dropdown-listcontainer ui-widget",dropDownListItem:"ui-iggrid-summaries-dialog-listitem",headerButtonContainer:"ui-iggrid-summaries-headerbuttoncontainer ui-corner-all",headerButtonIcon:"ui-iggrid-summaries-header-icon ui-corner-all ui-icon ui-icon-calculator ui-icon-summaries",headerButtonIconHover:"ui-iggrid-summaries-header-icon-hover ui-state-hover",footerRowCell:"ui-widget-footer ui-state-default",footerRowCellHover:"ui-state-hover",checkbox:"ui-state-default ui-corner-all ui-igcheckbox-normal",checkboxOff:"ui-icon ui-icon-check ui-igcheckbox-normal-off",checkboxOn:"ui-icon ui-icon-check ui-igcheckbox-normal-on",checkboxHovered:"ui-state-hover",footerRowIconContainerEmpty:"ui-iggrid-summaries-footer-icon-container-empty",footerRowTextContainerEmpty:"ui-iggrid-summaries-footer-text-container-empty",baseClassIE7:"ui-ie7"},defaultSummaryMethods:null,renderInFeatureChooser:true,options:{type:null,dialogButtonOKText:null,dialogButtonCancelText:null,featureChooserText:null,featureChooserTextHide:null,emptyCellText:null,summariesHeaderButtonTooltip:null,calculateRenderMode:"okcancelbuttons",compactRenderingMode:true,showSummariesButton:true,summariesResponseKey:"summaries",summaryExprUrlKey:"summaries",callee:null,dropDownHeight:"",dropDownWidth:"",showDropDownButton:true,summaryExecution:"afterfilteringbeforepaging",dropDownDialogAnimationDuration:400,resultTemplate:"{0} = {1}",renderSummaryCellFunc:null,columnSettings:[{allowSummaries:true,columnKey:null,columnIndex:-1,summaryOperands:[{rowDisplayLabel:"",type:"custom",active:true,summaryCalculator:null,order:5,format:undefined}]}],inherit:false,locale:{dialogButtonOKText:undefined,dialogButtonCancelText:undefined,featureChooserText:undefined,featureChooserTextHide:undefined,emptyCellText:undefined,summariesHeaderButtonTooltip:undefined}},events:{dropDownOpening:"dropDownOpening",dropDownOpened:"dropDownOpened",dropDownClosing:"dropDownClosing",dropDownClosed:"dropDownClosed",summariesCalculating:"summariesCalculating",summariesCalculated:"summariesCalculated",summariesMethodSelectionChanged:"summariesMethodSelectionChanged",summariesToggling:"summariesToggling",summariesToggled:"summariesToggled",dropDownOKClicked:"dropDownOKClicked",dropDownCancelClicked:"dropDownCancelClicked"},_initDefaultSummaryMethods:function(){this.defaultSummaryMethods=this.defaultSummaryMethods||[{rowDisplayLabel:this._getLocaleValue("defaultSummaryRowDisplayLabelCount"),type:"count",allowed:"all",active:true,order:0},{rowDisplayLabel:this._getLocaleValue("defaultSummaryRowDisplayLabelMin"),type:"min",allowed:["number","date","time","numeric"],active:true,order:1},{rowDisplayLabel:this._getLocaleValue("defaultSummaryRowDisplayLabelMax"),type:"max",allowed:["number","date","time","numeric"],active:true,order:2},{rowDisplayLabel:this._getLocaleValue("defaultSummaryRowDisplayLabelSum"),type:"sum",allowed:["number","numeric"],active:true,order:3},{rowDisplayLabel:this._getLocaleValue("defaultSummaryRowDisplayLabelAvg"),type:"avg",allowed:["number","numeric"],active:true,order:4},{rowDisplayLabel:this._getLocaleValue("defaultSummaryRowDisplayLabelCustom"),type:"custom",allowed:"all",active:true,summaryCalculator:null,order:5}]},_createWidget:function(){this.options.columnSettings=[];this._summariesRows=[];this._data={};this._currentOpenedColumnKey=null;this._isRenderedSummariesRows=false;this._footerInitialized=false;this._currentRowShownIcons=null;this._customInitMethods=[];this._fcData={};this._isInitFC=false;this._isSummariesRowsHidden=false;this._disallowedSummaries=[];$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){this._initDefaultSummaryMethods();var compactRenderingMode=this.options.compactRenderingMode;this._setRenderSummaryCellFunction(this.options.renderSummaryCellFunc);if(compactRenderingMode==="true"){compactRenderingMode=true}else if(compactRenderingMode==="false"){compactRenderingMode=false}this.options.compactRenderingMode=compactRenderingMode},changeGlobalLanguage:function(){},changeGlobalRegional:function(){},_setRenderSummaryCellFunction:function(func){if(func&&$.type(func)!=="function"){if(window[func]&&typeof window[func]==="function"){func=window[func]}}if(func&&$.type(func)==="function"){this._renderCellHandler=func}else{this._renderCellHandler=$.proxy(this._renderCell,this)}},_initColumnSettings:function(){var settings=[],i,j,k,l,cs=$.extend(true,[],this.options.columnSettings),csetting,columnSettingsLength=cs.length,gridColumnsLength=this.grid.options.columns?this.grid.options.columns.length:0;this.grid.dataSource.settings.summaries.calculateAll=false;this.newColumnSettings=[];this._disallowedSummaries=[];for(i=0;i<gridColumnsLength;i++){settings.push({columnIndex:i,columnKey:this.grid.options.columns[i].key,dataType:this.grid.options.columns[i].dataType})}if(columnSettingsLength>0){for(i=0;i<columnSettingsLength;i++){csetting=cs[i];if(csetting.summaryOperands===null||csetting.summaryOperands===undefined){continue}if(csetting.columnKey!==null&&csetting.columnKey!==undefined||csetting.columnIndex!==null&&csetting.columnIndex!==undefined){for(j=0;j<gridColumnsLength;j++){for(l=0;l<csetting.summaryOperands.length;l++){if(csetting.summaryOperands[l].active===null||csetting.summaryOperands[l].active===undefined){csetting.summaryOperands[l].active=true}if(csetting.summaryOperands[l].type.startsWith("custom")===true){if(csetting.summaryOperands[l].type!=="custom"){for(k=0;k<this._customInitMethods.length;k++){if(csetting.summaryOperands[l].summaryCalculator===this._customInitMethods[k].summaryCalculator){break}}if(this._customInitMethods.length===k){this._customInitMethods.push({summaryCalculator:csetting.summaryOperands[l].summaryCalculator,type:csetting.summaryOperands[l].type,index:csetting.summaryOperands[l].type.replace("custom","")})}}}}}}}for(i=0;i<columnSettingsLength;i++){csetting=cs[i];if(csetting.columnKey!==null&&csetting.columnKey!==undefined||csetting.columnIndex!==null&&csetting.columnIndex!==undefined){for(j=0;j<gridColumnsLength;j++){if(settings[j].columnIndex===csetting.columnIndex&&csetting.columnIndex!==undefined&&csetting.columnIndex!==null||settings[j].columnKey===csetting.columnKey&&csetting.columnKey!==undefined&&csetting.columnKey!==null){csetting.dataType=settings[j].dataType;csetting.columnIndex=settings[j].columnIndex;csetting.columnKey=settings[j].columnKey;csetting.summaryOperands=this._initAllowedSummaryMethods(csetting);if(csetting.allowSummaries!==false){this.newColumnSettings.push(csetting)}else{this._disallowedSummaries[settings[j].columnKey]=true}break}}}}for(i=0;i<gridColumnsLength;i++){for(j=0;j<this.newColumnSettings.length;j++){if(this.newColumnSettings[j].columnKey===settings[i].columnKey){break}}if(j===this.newColumnSettings.length&&this._disallowedSummaries[settings[i].columnKey]!==true){this.newColumnSettings.push({dataType:settings[i].dataType,columnIndex:i,columnKey:settings[i].columnKey,summaryOperands:this._initAllowedSummaryMethods(settings[i],false)})}}}else{for(i=0;i<gridColumnsLength;i++){this.newColumnSettings.push({dataType:settings[i].dataType,columnIndex:i,columnKey:settings[i].columnKey,summaryOperands:this._initAllowedSummaryMethods(settings[i])})}if(!gridColumnsLength&&this.grid.options.autoGenerateColumns&&this.options.type==="remote"){this.grid.dataSource.settings.summaries.calculateAll=true}}this.columnSettings=this.newColumnSettings},_initAllowedSummaryMethods:function(column,isNotActive){var i,j,k,z,c,lastCustomSummaryOperandIndex,defaultSummaryMethodsLength=this.defaultSummaryMethods.length,columnDataType,methods=[],allowedMethods=[],methodName,methodsLength,isActive,defaultMethodName;if(column===null||column===undefined){return}columnDataType=column.dataType;if(columnDataType==="object"){columnDataType=this.grid.dataSource._getFieldTypeFromSchema(column.columnKey)}if(column!==null&&column!==undefined&&column.summaryOperands!==undefined&&column.summaryOperands!==null){for(i=0;i<column.summaryOperands.length;i++){if(column.summaryOperands[i].type===undefined||column.summaryOperands[i].type===null){return}methodName=column.summaryOperands[i].type.toLowerCase();if(this._isAllowedMethodName(methodName)===true){if(isNotActive===true){column.summaryOperands[i].active=false}if(column.summaryOperands[i].type==="custom"){if(column.summaryOperands[i].summaryCalculator===null||column.summaryOperands[i].summaryCalculator===undefined){continue}lastCustomSummaryOperandIndex=1;for(k=0;k<this._customInitMethods.length;k++){if(column.summaryOperands[i].summaryCalculator===this._customInitMethods[k].summaryCalculator){column.summaryOperands[i].type=this._customInitMethods[k].type;break}if(this._customInitMethods[k].index>lastCustomSummaryOperandIndex){lastCustomSummaryOperandIndex=this._customInitMethods[k].index}}if(this._customInitMethods.length===k){lastCustomSummaryOperandIndex++;column.summaryOperands[i].type="custom"+lastCustomSummaryOperandIndex;this._customInitMethods.push({summaryCalculator:column.summaryOperands[i].summaryCalculator,type:"custom"+lastCustomSummaryOperandIndex,index:lastCustomSummaryOperandIndex})}}methods.push(column.summaryOperands[i])}}}else{for(i=0;i<defaultSummaryMethodsLength;i++){c=this.defaultSummaryMethods[i];if(c.type.startsWith("custom")){continue}isActive=c.active;if(isNotActive===true){isActive=false}methods.push({rowDisplayLabel:c.rowDisplayLabel,type:c.type,allowed:c.allowed,active:isActive,order:c.order,format:c.format})}}methodsLength=methods.length;for(i=0;i<methodsLength;i++){for(j=0;j<defaultSummaryMethodsLength;j++){defaultMethodName=this.defaultSummaryMethods[j].type.toUpperCase();if(defaultMethodName===methods[i].type.toUpperCase()||methods[i].type.startsWith("custom")){if(methods[i].type.toLowerCase().startsWith("custom")){if(methods[i].order<this.defaultSummaryMethods[j].order){methods[i].order=this.defaultSummaryMethods[j].order}}else if(methods[i].order!==this.defaultSummaryMethods[j].order){methods[i].order=this.defaultSummaryMethods[j].order}if(methods[i].rowDisplayLabel===null||methods[i].rowDisplayLabel===undefined){methods[i].rowDisplayLabel=this.defaultSummaryMethods[j].rowDisplayLabel}if(this.defaultSummaryMethods[j].allowed==="all"){allowedMethods.push(methods[i])}else{for(z=0;z<this.defaultSummaryMethods[j].allowed.length;z++){if(this.defaultSummaryMethods[j].allowed[z]===columnDataType){allowedMethods.push(methods[i]);break}}}break}}}return allowedMethods},changeLocale:function(){var fc=this.grid.element.data("igGridFeatureChooser"),self=this,$container=this.grid._rootContainer(),cols;if(fc&&this.renderInFeatureChooser){this._fcData={};fc._removeFeature("Summaries");this._initFC()}this.defaultSummaryMethods=null;this._initDefaultSummaryMethods();$container.find("[data-localeid=summariesHeaderButtonTooltip]").each(function(){self._changeLocaleForElement($(this))});cols=this.grid.options.columns;cols.forEach(function(col){this._updateColumnSettings(col.key);if(!this._isSummariesRowsHidden&&!col.hidden){this._updateDataLabels(col.key);this._renderFooterColumnInfo(col.key,this.summariesFor(col.key))}this._renderDropDown(col.key)},this)},changeRegional:function(){var cols=this.grid._getAllFormattedColumns();cols.forEach(function(col){this._renderFooterColumnInfo(col.key,this.summariesFor(col.key))},this)},_registerWidget:$.noop,_unregisterWidget:$.noop,_setOption:function(key,value){var i,o=this.options,columns,columnsLength,cs,csLength,$colCell,columnKey,gridId=this.grid.element[0].id;switch(key){case"calculateRenderMode":if(o.calculateRenderMode!==value){o.calculateRenderMode=value;columns=this.grid.options.columns;columnsLength=columns.length;for(i=0;i<columnsLength;i++){this._renderDropDown(columns[i].key)}}break;case"compactRenderingMode":if(o.compactRenderingMode!==value){o.compactRenderingMode=value;this._clearAllRows();this.calculateSummaries()}break;case"showSummariesButton":if(o.showSummariesButton!==value){o.showSummariesButton=value;cs=this.columnSettings;csLength=cs.length;for(i=0;i<csLength;i++){columnKey=cs[i].columnKey;if(value===true){$colCell=this.grid._rootContainer().find("#"+gridId+"_"+columnKey);if(this._fcData!==null&&this._fcData!==undefined&&$colCell.length>0&&this._fcData[columnKey]!==true){this._renderHeaderCellButton($colCell,columnKey)}}else{this.grid._rootContainer().find("#"+this._id("summaries","header_column_icon",columnKey)).remove()}}}break;case"disabled":if(o.disabled!==value){o.disabled=value;if(value===true){this._clearAllRows()}else{this.calculateSummaries()}}break;case"type":if(o.type!==value){o.type=value;this._setDataSourceColumnSettingsOptions()}break;case"summaryExprUrlKey":if(o.summaryExprUrlKey!==value){o.summaryExprUrlKey=value;this._setDataSourceColumnSettingsOptions()}break;case"dropDownHeight":if(o.dropDownHeight!==value){o.dropDownHeight=value;columns=this.grid.options.columns;columnsLength=columns.length;for(i=0;i<columnsLength;i++){this.grid._rootContainer().find("#"+this._id("summaries","methods_dialog",columns[i].key)).css("height",value)}}break;case"dropDownWidth":if(o.dropDownWidth!==value){o.dropDownWidth=value;columns=this.grid.options.columns;columnsLength=columns.length;for(i=0;i<columnsLength;i++){this.grid._rootContainer().find("#"+this._id("summaries","methods_dialog",columns[i].key)).css("width",value)}}break;case"showDropDownButton":if(o.showDropDownButton!==value){o.showDropDownButton=value;if(value===true){this._renderFooterIcons()}else{this._clearFooterIcons()}}break;case"resultTemplate":if(o.resultTemplate!==value){o.resultTemplate=value;this._clearAllRows();this.calculateSummaries()}break;case"columnSettings":if(o.columnSettings!==value){o.columnSettings=value;this.columnSettings=[];this.newColumnSettings=[];this._data={};this._clearAllRows();this._initColumnSettings();columns=this.grid.options.columns;columnsLength=columns.length;this.grid.dataSource.dataBind();for(i=0;i<columnsLength;i++){this._renderDropDown(columns[i].key)}}break;case"renderSummaryCellFunc":if(o.renderSummaryCellFunc!==value){this._setRenderSummaryCellFunction(value)}break}this._superApply(arguments)},_removeHeaderColumnIcons:function(){var i,cs=this.columnSettings,csLength=cs.length;for(i=0;i<csLength;i++){this.grid._rootContainer().find("#"+this._id("summaries","header_column_icon",cs[i].columnKey)).remove()}},destroy:function(){var i,columns,columnsLength,fc;this._detachEvents();this._clearAllRows();this.newColumnSettings=null;this.options=null;this._summariesRows=null;if(this._activeDialog){this._activeDialog.remove();this._activeDialog=null}this._data=null;this._currentOpenedColumnKey=null;this._isRenderedSummariesRows=null;this._footerInitialized=null;this._currentRowShownIcons=null;this._customInitMethods=null;this._fcData=null;this._isInitFC=null;this._isSummariesRowsHidden=null;this._disallowedSummaries=null;this._activeDialog=null;this.defaultSummaryMethods=null;columns=this.grid.options.columns;columnsLength=columns.length;for(i=0;i<columnsLength;i++){this.grid._rootContainer().find("#"+this._id("summaries","methods_dialog",columns[i].key)).remove()}fc=this.grid.element.data("igGridFeatureChooser");if(fc&&this.renderInFeatureChooser){fc._removeFeature("Summaries")}this._superApply(arguments);return this},_detachEvents:function(){this.grid.footersTable().find("tr:first td").unbind(".summaries");if(this._headerRenderedHandler){this.grid.element.unbind("iggridheaderrendered",this._headerRenderedHandler)}if(this._footerRenderedHandler){this.grid.element.unbind("iggridfooterrendered",this._footerRenderedHandler)}if(this._headerCellRenderedHandler){this.grid.element.unbind("iggridheadercellrendered",this._headerCellRenderedHandler)}if(this._headerFooterInitHandler){this.grid.element.unbind("iggridheaderextracellsmodified",this._headerFooterInitHandler)}if(this._columnsCollectionModifiedHandler){this.grid.element.unbind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler)}if(this._virtualHorizontalScrollHandler){this.grid.element.unbind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler)}},_headerCellRendered:function(event,ui){if(ui.owner.element.attr("id")!==this.grid.element.attr("id")){return}if(this._isInitFC!==true){this._initFC()}},_initFC:function(){var i,fc,o=this.options,cs=this.columnSettings,csLength=cs.length,columnKey;this._isInitFC=true;fc=this.grid.element.data("igGridFeatureChooser");if(fc!==null&&fc!==undefined&&this.renderInFeatureChooser&&o.showSummariesButton){for(i=0;i<csLength;i++){if(cs[i].allowSummaries===false){continue}columnKey=cs[i].columnKey;if(fc._shouldRenderInFeatureChooser(columnKey)===true){fc._renderInFeatureChooser(columnKey,{name:"Summaries",text:this._getLocaleValue("featureChooserText"),textHide:this._getLocaleValue("featureChooserTextHide"),iconClass:this.css.featureChooserIconClass,iconClassOff:this.css.featureChooserIconClass,isSelected:!this._isSummariesRowsHidden,method:$.proxy(this._togglefromfc,this),updateOnClickAll:true,order:1,groupName:"toggle",groupOrder:1,type:"toggle",state:this._isSummariesRowsHidden?"show":"hide"});this._fcData[columnKey]=true}}}},_footerRendered:function(sender,args){if(args.owner.element.attr("id")!==this.grid.element.attr("id")){return}this._initColumnSettings();var i,cs=this.columnSettings,csLength=cs.length,columnKey;for(i=0;i<csLength;i++){if(cs[i].allowSummaries===false){continue}columnKey=cs[i].columnKey;this._renderDropDown(columnKey)}},_headerRendered:function(sender,args){if(args.owner.element.attr("id")!==this.grid.element.attr("id")){return}var i,cs=this.columnSettings,csLength=cs.length,$colCell,columnKey,gridId=this.grid.element[0].id;for(i=0;i<csLength;i++){if(cs[i].allowSummaries===false){continue}columnKey=cs[i].columnKey;$colCell=this.grid.headersTable().find("#"+gridId+"_"+columnKey);if($colCell.length>0&&this._fcData[columnKey]!==true&&this.options.showSummariesButton!==false){this._renderHeaderCellButton($colCell,columnKey)}}},_columnMap:function(){var o=this.options,cs=this.newColumnSettings,i,csLength=cs.length,elem,result=[];if(o.showSummariesButton===false){return false}for(i=0;i<csLength;i++){elem={columnKey:cs[i].columnKey,enabled:true};if(cs[i].allowSummaries===false){elem.enabled=false}result.push(elem)}return result},_dataRendered:function(){var grid=this.grid,padding;if(this.options.disabled!==true&&this._isSummariesRowsHidden===false){this._clearAllRows();this.calculateSummaries();if(!grid._initialized){if(!grid.options.fixedFooters){padding=parseFloat(grid.element.find("tbody > tr:first > :last-child").css(grid._padding));if(padding){grid._increaseLastCellVScrollbarPadding(grid.element,"tfoot","td",padding)}}if(this._isVirtualization()&&grid.options.virtualizationMode==="fixed"){grid._resetVirtualDom();grid._renderVirtualRecordsFixed()}}else{if(this._isVirtualization()){this.grid._synchronizeHScroll()}}}},_updatingApplied:function(){if(this.grid.options.autoCommit&&this._isRenderedSummariesRows){this.calculateSummaries()}},_rowDeleted:function(){this._updatingApplied()},_rowAdded:function(){this._updatingApplied()},_internalRowUpdated:function(){this._updatingApplied()},_internalCellUpdated:function(){this._updatingApplied()},isSummariesRowsHidden:function(){return this._isSummariesRowsHidden},calculateSummaries:function(){var h=this.grid.footersTable().outerHeight();this._trigger(this.events.rowsInitialize,null,{});this._calculateInternalSummaries();if(this.options.showDropDownButton===true){this._renderFooterIcons()}this._adjustHeights(h)},_adjustHeights:function(h){var grid=this.grid,gridHeight=grid.options.height;if(gridHeight===null||gridHeight===undefined){return}grid._fireInternalEvent("_summariesHeightsAdjusting");if(grid.hasFixedColumns()){this._syncFixedUnfixedRowHeights()}if(!h||h!==this.grid.footersTable().outerHeight()){grid._initializeHeights();if(this._isVirtualization()){var svst=this.grid._persistVirtualScrollTop;this.grid._persistVirtualScrollTop=true;this.grid._saveFirstVisibleTRIndex();grid._resetVirtualDom();grid._renderVirtualRecords();this.grid._persistVirtualScrollTop=svst}}if(grid.hasVerticalScrollbar()!==grid._hasVerticalScrollbar){grid._adjustLastColumnWidth(false)}},_removeFooterRows:function(){var i,sr=this._summariesRows,hasFixedColumns=this.grid.hasFixedColumns(),srLength=sr.length;for(i=0;i<srLength;i++){this.grid._rootContainer().find("#"+this._id("summaries","footer_row",sr[i].type)).remove();if(hasFixedColumns){this.grid._rootContainer().find("#"+this._id("summaries","footer_row",sr[i].type,"fixed")).remove()}}this._isRenderedSummariesRows=false;this._summariesRows=[]},_calculateSelectedSummaries:function(columnKey){var i,k,methods,hasFixedColumns=this.grid.hasFixedColumns(),res=[],csLength,$checkbox,methodsLength,summariesRowsLength,isToCalculate=false,data,newMax,max,cs=null,isChecked,j,compactRenderingMode=this.options.compactRenderingMode,selectedColumnSettingsIndex,columnSettingsLength=this.columnSettings.length,isToRerender=false,isToRemoveRow=false,methodNameToRemove,unactiveMethods=[],unactiveMethodsLength=0,activeMethods=[],isToRemoveFirstRow=false,elemDataCalculating,rowToRemoveMethodName="";if(columnKey===undefined||columnKey===null){return}for(j=0;j<columnSettingsLength;j++){if(this.columnSettings[j].columnKey===columnKey&&this._isVisibleColumn(columnKey)){cs=this.columnSettings[j];selectedColumnSettingsIndex=j;break}}if(cs===null||cs===undefined){return}methods=cs.summaryOperands;methodsLength=methods.length;for(i=0;i<methodsLength;i++){$checkbox=this.grid._rootContainer().find("#"+this._id("summaries_footer_checkbox",methods[i].type.toLowerCase(),columnKey));isChecked=$checkbox.attr("data-chk").toLowerCase()==="on";if(isChecked!==methods[i].active){isToRerender=true;this.newColumnSettings[selectedColumnSettingsIndex].summaryOperands[i].active=isChecked;if(isChecked===true){isToCalculate=true;activeMethods.push(this.newColumnSettings[selectedColumnSettingsIndex].summaryOperands[i])}else{unactiveMethods.push(methods[i])}}}this.columnSettings[selectedColumnSettingsIndex].summaryOperands=this.newColumnSettings[selectedColumnSettingsIndex].summaryOperands;this.isToCalculateInRemoteMode=false;if(this.options.compactRenderingMode==="auto"){if(this._summariesRows.length===1&&this._analyzeAutoCompactRenderingMode()===false){this.grid._rootContainer().find("#"+this._summariesRows[0].id).remove();if(hasFixedColumns){this.grid._rootContainer().find("#"+this._summariesRows[0].id+"_fixed").remove()}this._summariesRows=[];this.calculateSummaries();return}if(this._summariesRows.length>1&&this._analyzeAutoCompactRenderingMode()===true){for(i=0;i<this._summariesRows.length;i++){this.grid._rootContainer().find("#"+this._summariesRows[i].id).remove();if(hasFixedColumns){this.grid._rootContainer().find("#"+this._summariesRows[i].id+"_fixed").remove()}}this._summariesRows=[];this.calculateSummaries();return}}if(isToCalculate===true){if((compactRenderingMode===false||compactRenderingMode==="auto"&&this._analyzeAutoCompactRenderingMode()===false)&&this._summariesRows.length===1){rowToRemoveMethodName=this._summariesRows[0].type.toLowerCase();isToRemoveFirstRow=true;for(j=0;j<this.columnSettings.length;j++){if(!this._isVisibleColumn(this.columnSettings[j].columnKey)){continue}for(k=0;k<this.columnSettings[j].summaryOperands.length;k++){if(this.columnSettings[j].summaryOperands[k].type.toLowerCase()===rowToRemoveMethodName&&this.columnSettings[j].summaryOperands[k].active!==false){isToRemoveFirstRow=false;break}}if(isToRemoveFirstRow===false){break}}}if(this.options.type==="remote"){if(this.options.calculateRenderMode==="onselect"){this.isToCalculateInRemoteMode=true;elemDataCalculating={type:activeMethods[0].type,result:"calculating",rowDisplayLabel:activeMethods[0].rowDisplayLabel,order:activeMethods[0].order,format:activeMethods[0].format,dataType:this.newColumnSettings[selectedColumnSettingsIndex].dataType};if(this._data[columnKey]===null||this._data[columnKey]===undefined){this._data[columnKey]=[]}this._data[columnKey].push(elemDataCalculating);this._renderFooterColumnInfo(columnKey,this._data[columnKey])}else{this._setDataSourceColumnSettingsOptions();this.grid.dataSource.dataBind()}}else{data=this._dataSummaries();if(this._trigger(this.events.summariesCalculating,null,{owner:this})!==false){res=this.calculateSummaryColumn(columnKey,activeMethods,data,this.newColumnSettings[selectedColumnSettingsIndex].dataType);if(compactRenderingMode===false||compactRenderingMode==="auto"&&this._analyzeAutoCompactRenderingMode()===false){this._renderFooterColumnInfo(columnKey,res)}this._trigger(this.events.summariesCalculated,null,{data:data,owner:this})}}}unactiveMethodsLength=unactiveMethods.length;if(compactRenderingMode===true||compactRenderingMode==="auto"&&this._analyzeAutoCompactRenderingMode()===true){cs=this.newColumnSettings;csLength=cs.length;max=0;newMax=0;if(compactRenderingMode==="auto"){unactiveMethods=[];for(i=0;i<methodsLength;i++){$checkbox=this.grid._rootContainer().find("#"+this._id("summaries_footer_checkbox",methods[i].type.toLowerCase(),columnKey));isChecked=$checkbox.attr("data-chk").toLowerCase()==="on";if(isChecked===false){unactiveMethods.push(methods[i])}}unactiveMethodsLength=unactiveMethods.length}for(i=0;i<unactiveMethodsLength;i++){this._removeDataResult(columnKey,unactiveMethods[i].type.toLowerCase())}if(unactiveMethodsLength>activeMethods.length){for(i=0;i<csLength;i++){if(!this._isVisibleColumn(cs[i].columnKey)){continue}newMax=0;for(j=0;j<cs[i].summaryOperands.length;j++){if(cs[i].summaryOperands[j].active===true){newMax++}}if(newMax>max){max=newMax}}summariesRowsLength=this._summariesRows.length;if(max>summariesRowsLength){return}for(i=0;i<max;i++){this.grid._rootContainer().find("#"+this._id("summaries","footer_row_text_container",this._summariesRows[i].type.toLowerCase(),columnKey)).attr("data-localeid","emptyCellText").html(this._getLocaleValue("emptyCellText"))}for(i=max;i<summariesRowsLength;i++){this.grid._rootContainer().find("#"+this._summariesRows[i].id).remove();if(hasFixedColumns){this.grid._rootContainer().find("#"+this._summariesRows[i].id+"_fixed").remove()}}for(i=max;i<summariesRowsLength;i++){this._summariesRows.pop()}if(hasFixedColumns&&this.grid.options.height===null&&$.ig.util.isIE&&$.ig.util.browserVersion>=9){this._getColumnFixingInstance()._syncTableHeights()}}else if(activeMethods.length>unactiveMethodsLength){this._initCompactModeSummariesRows()}this._renderFooterColumnInfo(columnKey,this._data[columnKey]);if(this._summariesRows.length===0){this._insertSummariesRows(this.defaultSummaryMethods[0].type.toLowerCase(),this.defaultSummaryMethods[0].order);this._renderFooterIcons()}this._adjustHeights()}if(isToRerender&&(compactRenderingMode===false||compactRenderingMode==="auto"&&this._analyzeAutoCompactRenderingMode()===false)){for(i=0;i<unactiveMethodsLength;i++){methodNameToRemove=unactiveMethods[i].type.toLowerCase();this.grid._rootContainer().find("#"+this._id("summaries","footer_row_text_container",methodNameToRemove,columnKey)).attr("data-localeid","emptyCellText").html(this._getLocaleValue("emptyCellText"));this._removeDataResult(columnKey,methodNameToRemove);if(this._summariesRows.length<=1){continue}isToRemoveRow=true;for(j=0;j<this.columnSettings.length;j++){if(!this._isVisibleColumn(this.columnSettings[j].columnKey)){continue}for(k=0;k<this.columnSettings[j].summaryOperands.length;k++){if(this.columnSettings[j].summaryOperands[k].type.toLowerCase()===methodNameToRemove&&this.columnSettings[j].summaryOperands[k].active!==false){isToRemoveRow=false;break}}if(isToRemoveRow===false){break}}if(isToRemoveRow===true&&this._summariesRows.length>1){this._removeRowsDataByType(methodNameToRemove);this.grid._rootContainer().find("#"+this._id("summaries","footer_row",methodNameToRemove)).remove();if(hasFixedColumns){this.grid._rootContainer().find("#"+this._id("summaries","footer_row",methodNameToRemove,"fixed")).remove()}}}if(this._summariesRows.length>=1&&isToRemoveFirstRow===true){for(i=0;i<activeMethods.length;i++){if(activeMethods[i].type.toLowerCase()===rowToRemoveMethodName){break}}if(i===activeMethods.length){this._removeRowsDataByType(rowToRemoveMethodName);this.grid._rootContainer().find("#"+this._id("summaries","footer_row",rowToRemoveMethodName)).remove();if(hasFixedColumns){this.grid._rootContainer().find("#"+this._id("summaries","footer_row",rowToRemoveMethodName,"fixed")).remove()}}}if(this._summariesRows.length>0&&this.grid._rootContainer().find("#"+this._id("summaries","footer_row_button_dd",this._summariesRows[0].type,columnKey)).length===0){this._renderFooterIcons()}this._adjustHeights()}},_analyzeAutoCompactRenderingMode:function(){var i,j,methods,cs,methodsLength,activeMethodsCount,columnSettingsLength=this.columnSettings.length;for(j=0;j<columnSettingsLength;j++){cs=this.columnSettings[j];methods=cs.summaryOperands;methodsLength=methods.length;activeMethodsCount=0;for(i=0;i<methodsLength;i++){if(methods[i].active===true&&++activeMethodsCount>1){return false}}}return true},_removeRowsDataByType:function(methodNameToRemove){if(methodNameToRemove===undefined||methodNameToRemove===null){return}var hasFixedColumns=this.grid.hasFixedColumns(),self=this;this._summariesRows=$.grep(this._summariesRows,function(n){if(n.type===methodNameToRemove){$(n).remove();if(hasFixedColumns){self.grid.container().find("#"+n.id+"_fixed").remove()}}return n.type!==methodNameToRemove})},_syncFixedUnfixedRowHeights:function(){var $tfoot=this.grid.footersTable().find("tfoot"),$fixedTFoot=this.grid.fixedFootersTable().find("tfoot"),summariesRows=$tfoot.find("tr[ data-role ]"),fixedSummariesRows=$fixedTFoot.find("tr[ data-role ]"),$fixedRow;$.each(summariesRows,function(index,r){var h,fixedRowHeight,rowHeight,$row=$(r);$fixedRow=fixedSummariesRows.eq(index);if($fixedRow.length===0){return true}fixedRowHeight=$fixedRow.height();rowHeight=$row.height();if(fixedRowHeight>rowHeight){h=fixedRowHeight}else{h=rowHeight}$row.height(h);$fixedRow.height(h)})},_clearFooterIcons:function(){var i,currentRow=this._currentRowShownIcons,columns,columnsLength;if(currentRow===null||currentRow===undefined){return}columns=this.grid.options.columns;columnsLength=columns.length;for(i=0;i<columnsLength;i++){this.grid._rootContainer().find("#"+this._id("summaries","footer_row_button_dd",currentRow.type,columns[i].key)).remove()}},clearAllFooterIcons:function(){var i,j,rows=this._summariesRows,rowsLength=rows.length,columns=this.grid.options.columns,columnsLength=columns.length;for(i=0;i<rowsLength;i++){for(j=0;j<columnsLength;j++){this.grid._rootContainer().find("#"+this._id("summaries","footer_row_button_dd",rows[i].type,columns[j].key)).remove()}}},_clearAllRows:function(){var i,summaryRowsLength,hasFixedColumns=this.grid.hasFixedColumns(),$row;if(!this._summariesRows){return}summaryRowsLength=this._summariesRows.length;for(i=0;i<summaryRowsLength;i++){$row=this.grid._rootContainer().find("#"+this._summariesRows[i].id);$row.remove();if(hasFixedColumns){this.grid._rootContainer().find("#"+this._summariesRows[i].id+"_fixed").remove()}}this._summariesRows.length=0},_removeUnusedFooterRows:function(oldRows){var i,j,sr=this._summariesRows,summariesRowsLength=this._summariesRows.length,hasFixedColumns=this.grid.hasFixedColumns(),oldRowsLength=oldRows.length;if(summariesRowsLength===0){for(i=0;i<oldRowsLength;i++){this.grid._rootContainer().find("#"+oldRows.id).remove();
}return}for(i=0;i<oldRowsLength;i++){for(j=0;j<summariesRowsLength;j++){if(sr[j].id===oldRows[i].id){continue}}if(j===summariesRowsLength){this.grid._rootContainer().find("#"+oldRows[i].id).remove();if(hasFixedColumns){this.grid._rootContainer().find("#"+oldRows[i].id+"_fixed").remove()}}}},_renderFooterIcons:function(startInd,endInd){var i,columnKey,sr=this._summariesRows,columnSetting,isToRemoveRow=true,gridColumns=this.grid.options.columns,gridColumnsLength=gridColumns.length,methodName;if(startInd===null||startInd===undefined){startInd=0}if(endInd===null||endInd===undefined){endInd=gridColumnsLength}if(sr.length===0){return}this._clearFooterIcons();methodName=sr[0].type;this._currentRowShownIcons=sr[0];for(i=startInd;i<endInd;i++){columnKey=gridColumns[i].key;if(this._disallowedSummaries[columnKey]===true){continue}columnSetting=this._getColumnSettingByKey(columnKey);if(columnSetting===null||columnSetting===undefined||columnSetting.length===0||columnSetting.allowSummaries===false){continue}isToRemoveRow=false;this._renderFooterIconMarkup(methodName,columnKey)}if(isToRemoveRow===true){this._removeRowsDataByType(methodName)}},_renderFooterIconMarkup:function(methodName,columnKey){var self=this,$td,$button;$button=$("<span></span>").appendTo(this.grid._rootContainer().find("#"+this._id("summaries","footer_row_icon_container",methodName,columnKey))).addClass(self.css.footerButtonIcon);$button.wrap("<a id='"+this._id("summaries","footer_row_button_dd",methodName,columnKey)+"' href='#' title='' tabindex='"+this.grid.options.tabIndex+"'></a>");$button.data("columnKey",columnKey);$td=$button.closest("td");$td.data("columnKey",columnKey);$td.unbind(".summaries");$td.bind({"mousedown.summaries":function(e){self.toggleDropDown(columnKey,e);e.stopPropagation()}});$button.parent().bind({mousedown:$.proxy(self._onMouseDownFooterIcon,self),click:$.proxy(self._onClickFooterIcon,self),mouseover:$.proxy(self._onMouseOverFooterIcon,self),mouseout:$.proxy(self._onMouseOutFooterIcon,self),focus:$.proxy(self._onMouseOverFooterIcon,self),blur:$.proxy(self._onMouseOutFooterIcon,self),keydown:function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){event.stopPropagation();event.preventDefault();self.toggleDropDown(null,event)}}})},_onMouseOverFooterIcon:function(e){var $button=$(e.target);if($button.closest("div").hasClass(this.css.footerButtonIconActive)===false){$button.closest("div").addClass(this.css.footerButtonIconHover)}},_onMouseOutFooterIcon:function(e){var $button=$(e.target);if($button.closest("div").hasClass(this.css.footerButtonIconActive)===false){$button.closest("div").removeClass(this.css.footerButtonIconHover)}},_onClickFooterIcon:function(e){e.preventDefault()},_onMouseDownFooterIcon:function(event){this.toggleDropDown(null,event)},_isFirstRowEmpty:function(){var i,res=true,columnKey,sr=this._summariesRows,data=null,row,gridColumns=this.grid.options.columns,gridColumnsLength=gridColumns.length;if(sr.length===0){return false}row=sr[0];for(i=0;i<gridColumnsLength;i++){columnKey=gridColumns[i].key;data=this._getDataByKeyMethodName(columnKey,row.type);if(data!==null){return false}}return res},toggleDropDown:function(columnKey,event){var $target,$dialog,top,left,self,isVisible,rOffset,$footersTable,$td;if(!event){if(this.grid.isFixedColumn(columnKey)){$footersTable=this.grid.fixedFootersTable()}else{$footersTable=this.grid.footersTable()}$target=$footersTable.find("tfoot tr:first-child td[ data-key="+columnKey+" ] a>span")}else{$td=$(event.target).closest("td");columnKey=$td.data("columnKey");$target=$td.find("a>span");if(!$target.length){return}}if(columnKey===null||columnKey===undefined){$target=$target.find("span");columnKey=$target.data("columnKey")}$dialog=this.grid._rootContainer().find("#"+this._id("summaries","methods_dialog",columnKey));top=$.ig.util.offset($target).top;left=$.ig.util.offset($target).left;self=this;isVisible=$dialog.is(":visible")===true;if($dialog.length===0||$dialog.data("isAnimating")===true){return}top-=$target.height()-2;if($target.is("span")===true){$dialog.data("buttonId",$target.parent().attr("id"))}if(!isVisible){rOffset=$.ig.util.getRelativeOffset($dialog);$dialog.css({top:top-$dialog.height()-rOffset.top,left:left-rOffset.left})}if(self._activeDialog!==null&&self._activeDialog!==undefined&&$dialog!==self._activeDialog&&columnKey!==self._activeDialog.data("columnKey")){self.showHideDialog(self._activeDialog)}if(isVisible===true){self._currentOpenedColumnKey=null}else{self._currentOpenedColumnKey=columnKey}self.showHideDialog($dialog)},showHideDialog:function($dialog){if($dialog===null||$dialog===undefined){return}var self=this,e=this.events,$button=this.grid._rootContainer().find("#"+$dialog.data("buttonId")),columnKey=$dialog.data("columnKey"),animationDuration=self.options.dropDownDialogAnimationDuration;if($dialog.data("isAnimating")===true&&self._activeDialog===$dialog){return}if($dialog.is(":visible")===true){if(this._trigger(e.dropDownClosing,null,{columnKey:columnKey,owner:this})===false){return}if($button!==null&&$button!==undefined){$button.closest("div").removeClass(self.css.footerButtonIconActive)}}else{if(this._trigger(e.dropDownOpening,null,{columnKey:columnKey,owner:this})===false){return}$dialog.css("min-width",self._getMinWidthOfDropDown($dialog));if($button!==null&&$button!==undefined){$button.closest("div").removeClass(self.css.footerButtonIconHover);$button.closest("div").addClass(self.css.footerButtonIconActive);this._rollbackCheckboxState(columnKey)}}if(animationDuration<=0){animationDuration=1}$dialog.data("isAnimating",true);$dialog.toggle("slide",{duration:animationDuration,direction:"down"},function(){$dialog.data("isAnimating",false);if($dialog.is(":visible")===true){$dialog.focus();self.grid._focusedElement=$dialog;self._activeDialog=$dialog;self._trigger(e.dropDownOpened,null,{columnKey:columnKey,owner:this})}else{self._trigger(e.dropDownClosed,null,{columnKey:columnKey,owner:this});self.grid._focusedElement=null;if(self.options.type==="remote"&&self.options.calculateRenderMode==="onselect"&&self.isToCalculateInRemoteMode===true){self.isToCalculateInRemoteMode=false;self._setDataSourceColumnSettingsOptions();self.grid.dataSource.dataBind()}if(self._activeDialog!==null&&self._activeDialog!==undefined&&self._activeDialog.data("columnKey")===columnKey){self._activeDialog=null}}})},_getMinWidthOfDropDown:function($dropDown){if(!$dropDown.length){return}var s=$dropDown.attr("style"),w;$dropDown.css({position:"absolute",display:"block",left:0,top:0,visibility:"hidden","min-width":""});w=$dropDown[0].getBoundingClientRect().width;$dropDown.attr("style",s);return Math.ceil(w)},_closeDropDown:function(){var $dialog=this._activeDialog;this.showHideDialog($dialog)},_setDataSourceColumnSettingsOptions:function(){var o=this.options;this.grid.dataSource.settings.summaries.columnSettings=this.newColumnSettings;this.grid.dataSource.settings.summaries.type=o.type;this.grid.dataSource.settings.summaries.summaryExecution=o.summaryExecution;this.grid.dataSource.settings.summaries.summaryExprUrlKey=o.summaryExprUrlKey;this.grid.dataSource.settings.summaries.summariesResponseKey=o.summariesResponseKey;if(this.grid.dataSource.type&&this.grid.dataSource.type()==="remoteUrl"&&this.grid._dataOptions&&$.type(this.grid._dataOptions.dataSource)==="string"){this.grid.dataSource.settings.dataSource=this.grid._dataOptions.dataSource}},_getColumnSettingByKey:function(columnKey){var i,len=this.columnSettings.length;if(columnKey===null||columnKey===undefined){return null}for(i=0;i<len;i++){if(this.columnSettings[i].columnKey===columnKey){return this.columnSettings[i]}}return null},_renderHeaderCellButton:function(columnCell,columnKey){var summaryHeaderIconContainer,self=this,css=self.css,buttonId=this._id("summaries","header_column_icon",columnKey),$button,$divHeaderButtonContainer;summaryHeaderIconContainer=columnCell.find(".ui-iggrid-indicatorcontainer");this.grid._enableHeaderCellFeature(columnCell);if(summaryHeaderIconContainer.length===0){summaryHeaderIconContainer=$("<div></div>").appendTo(columnCell);summaryHeaderIconContainer.addClass("ui-iggrid-indicatorcontainer")}this.grid._rootContainer().find("#"+buttonId).remove();$button=$("<a></a>").attr({href:"#",id:buttonId,tabindex:this.grid.options.tabIndex,title:this._getLocaleValue("summariesHeaderButtonTooltip"),"data-localeid":"summariesHeaderButtonTooltip","data-localeattr":"title"});$divHeaderButtonContainer=summaryHeaderIconContainer.find(".ui-iggrid-summaries-headerbuttoncontainer");if($divHeaderButtonContainer.length===0){$divHeaderButtonContainer=$("<div></div>").addClass(css.headerButtonContainer).appendTo(summaryHeaderIconContainer)}$button.appendTo($divHeaderButtonContainer);$("<span></span>").addClass(css.headerButtonIcon).appendTo($button);if($.ig.util.isIE7===true){$button.parent().addClass(this.css.baseClassIE7)}$button.hover(function(){$(this).parent().addClass(css.headerButtonIconHover)},function(){$(this).parent().removeClass(css.headerButtonIconHover)});$button.bind({click:function(event){event.preventDefault();event.stopPropagation();self._internalToggleSummariesRow(null,event)}})},_togglefromfc:function(event,columnKey,isSelected){this._internalToggleSummariesRow(isSelected,event)},_internalToggleSummariesRow:function(isToShow,event){if(isToShow===null||isToShow===undefined){isToShow=!this._isRenderedSummariesRows}if(this._trigger(this.events.summariesToggling,event,{isToShow:isToShow,owner:this})===false){return}this.toggleSummariesRows(isToShow,true);this._trigger(this.events.summariesToggled,event,{isShown:isToShow,owner:this})},toggleSummariesRows:function(isToShow,isInternalCall){var fc,cs,csLength,i,$hScroller,hScrollerLeft,grid=this.grid;if(isToShow===true){$hScroller=this.grid._rootContainer().find("#"+grid.id()+"_horizontalScrollContainer");if($hScroller.length>0&&(grid.options.columnVirtualization||grid._isColumnVirtualizationEnabled())){hScrollerLeft=$hScroller.scrollLeft();$hScroller.scrollLeft(0)}this.calculateSummaries();if(hScrollerLeft){setTimeout(function(){$hScroller.scrollLeft(hScrollerLeft)},0)}grid._synchronizeHScroll();this._isSummariesRowsHidden=false;if(this._summariesRows.length===0){cs=this.newColumnSettings;csLength=cs.length;this._insertSummariesRows(this.defaultSummaryMethods[0].type,this.defaultSummaryMethods[0].order);for(i=0;i<csLength;i++){if(!this._isVisibleColumn(cs[i].columnKey)){continue}this._renderFooterIconMarkup(this.defaultSummaryMethods[0].type,cs[i].columnKey)}}}else{this._removeFooterRows();this._isSummariesRowsHidden=true}if(this._isFixedFooters()){grid._fixedfooters().data("ignoreScroll",!isToShow)}this._adjustHeights();if(isInternalCall===undefined||isInternalCall===false){fc=grid.element.data("igGridFeatureChooser");if(fc!==null&&fc!==undefined){fc._toggleSelectedItems("Summaries",!isToShow)}}if(grid.hasFixedColumns()){if($.ig.util.isIE&&$.ig.util.browserVersion>=9){grid.element.data("igGridColumnFixing")._syncTableHeights()}this._syncFixedUnfixedRowHeights()}},_renderDropDown:function(columnKey){var $dialog,$ul,i,j,$buttonOK,$buttonCancel,$div,minInd,swap,$li,id=this._id("summaries","methods_dialog",columnKey),methodsLength,cs=this._getColumnSettingByKey(columnKey),css=this.css,checkboxId,allowedMethods,self=this,o=this.options,isChecked=false,cssClassCheckBox,onFocusLi,onMousedownLi,toggleState,onBlurLi,onKeydownLi,onMousedown,onMouseover,onMouseout,$checkbox,onClick;if(cs===null||cs===undefined){return}allowedMethods=cs.summaryOperands;if(allowedMethods===null||allowedMethods===undefined){return}this.grid._rootContainer().find("#"+id).remove();$dialog=$("<div></div>").appendTo(this.grid._rootContainer()).attr("id",id).css("position","absolute").css("width",this.options.dropDownWidth).css("height",this.options.dropDownHeight).addClass(this.css.columnSummariesDropdown).attr("tabindex",this.grid.options.tabIndex).hide();$dialog.data("methods",allowedMethods);$ul=$("<ul></ul>").addClass(css.dropDownListContainer);$ul.appendTo($dialog);methodsLength=allowedMethods.length;for(i=0;i<methodsLength;i++){minInd=i;for(j=i;j<methodsLength;j++){if(allowedMethods[j].order===null||allowedMethods[j].order===undefined){allowedMethods[j].order=0}if(allowedMethods[minInd].order>allowedMethods[j].order){minInd=j}}if(minInd!==i){swap=allowedMethods[minInd];allowedMethods[minInd]=allowedMethods[i];allowedMethods[i]=swap}}toggleState=function($checkbox,event){self.toggleCheckstate($checkbox);self._trigger(self.events.summariesMethodSelectionChanged,event,{columnKey:columnKey,isSelected:$checkbox.attr("data-chk").toLowerCase()==="on",methodName:$checkbox.data("methodName"),owner:this});if(o.calculateRenderMode==="onselect"){self._calculateSelectedSummaries(columnKey);if(self.grid.hasFixedColumns()){self._syncFixedUnfixedRowHeights()}}};onClick=function(event){toggleState($(event.currentTarget),event);if(self._activeDialog){self._activeDialog.data("focussed",true);self._activeDialog.focus()}event.preventDefault();event.stopPropagation()};onMousedown=function(event){if(self._activeDialog){self._activeDialog.data("focussed",true);self._activeDialog.focus()}event.preventDefault();event.stopPropagation()};onMouseover=function(event){$(event.currentTarget).addClass(css.checkboxHovered)};onMouseout=function(event){$(event.currentTarget).removeClass(css.checkboxHovered)};$dialog.bind({blur:function(){$dialog.data("focussed",false);setTimeout(function(){self._checkCloseDropDown($dialog)},10)},focus:function(){$dialog.data("focussed",true)},keydown:function(event){if(event.keyCode===$.ui.keyCode.ESCAPE||event.keyCode===$.ui.keyCode.SPACE||event.keyCode===$.ui.keyCode.ENTER){event.stopPropagation();event.preventDefault();self.toggleDropDown(null,event);if(self._summariesRows.length>0){self.grid.container().find("#"+self._id("summaries","footer_row_button_dd",self._summariesRows[0].type,columnKey)).focus()}}}});onFocusLi=function(){if(self._activeDialog){self._activeDialog.data("focussed",true)}};onBlurLi=function(){if(self._activeDialog){self._activeDialog.data("focussed",false)}setTimeout($.proxy(self._checkCloseDropDown,self),300)};onKeydownLi=function(event){var $liFocused=$(this),keyCode=event.keyCode;if(keyCode===$.ui.keyCode.ENTER||keyCode===$.ui.keyCode.SPACE){toggleState(self.grid.container().find("#"+$liFocused.data("checkboxId")),event);event.stopPropagation();event.preventDefault()}else if(keyCode===$.ui.keyCode.ESCAPE){$dialog.blur()}};onMousedownLi=function(event){toggleState(self.grid.container().find("#"+$(this).data("checkboxId")),event)};for(i=0;i<methodsLength;i++){checkboxId=this._id("summaries_footer_checkbox",allowedMethods[i].type.toLowerCase(),columnKey);if(allowedMethods[i].active===true||allowedMethods[i].active===1){isChecked="on";cssClassCheckBox=css.checkboxOn}else{isChecked="off";cssClassCheckBox=css.checkboxOff}$li=$("<li></li>").data("checkboxId",checkboxId).addClass(css.dropDownListItem).appendTo($ul).attr("tabindex",this.grid.options.tabIndex);$li.bind({focus:onFocusLi,blur:onBlurLi,keydown:onKeydownLi,mousedown:onMousedownLi});$("<span id='"+checkboxId+"' class='"+css.checkbox+"'></span>").appendTo($li);$("<label></label>").html(allowedMethods[i].rowDisplayLabel).appendTo($li);$checkbox=this.grid._rootContainer().find("#"+checkboxId);$("<span class='"+cssClassCheckBox+"'></span>").appendTo($checkbox);$checkbox.attr("data-chk",isChecked).attr("data-role","checkbox");$checkbox.data("methodName",allowedMethods[i].type);$checkbox.bind({click:onClick,mouseover:onMouseover,mouseout:onMouseout,mousedown:onMousedown})}$div=$("<div></div>").addClass(this.css.footerDropdownButtonsContainer).appendTo($dialog);if(o.calculateRenderMode==="okcancelbuttons"){$buttonOK=$("<a href='http://localhost/'></a>");$buttonOK.attr({id:this._id("summaries","dialog_button_ok",columnKey),tabindex:this.grid.options.tabIndex}).appendTo($div);$buttonOK.igButton({link:{href:"#",title:""},labelText:this._getLocaleValue("dialogButtonOKText"),keydown:function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){self._clickOKButton(columnKey)}if(event.keyCode!==$.ui.keyCode.TAB){event.stopPropagation();event.preventDefault()}},click:function(e){self._clickOKButton(columnKey);e.preventDefault();e.stopPropagation()},mousedown:function(event){event.preventDefault();event.stopPropagation()},focus:function(){if(self._activeDialog){self._activeDialog.data("focussed",true)}},blur:function(){if(self._activeDialog){self._activeDialog.data("focussed",false)}setTimeout($.proxy(self._checkCloseDropDown,self),300)}});$buttonCancel=$("<a></a>");$buttonCancel.attr({id:this._id("summaries","dialog_button_cancel",columnKey),tabindex:this.grid.options.tabIndex}).appendTo($div);$buttonCancel.igButton({link:{href:"#",title:""},labelText:this._getLocaleValue("dialogButtonCancelText"),click:function(e){self._clickCancelButton(columnKey);e.preventDefault();e.stopPropagation()},mousedown:function(event){event.preventDefault();event.stopPropagation()},focus:function(){if(self._activeDialog){self._activeDialog.data("focussed",true)}},blur:function(){if(self._activeDialog){self._activeDialog.data("focussed",false)}setTimeout($.proxy(self._checkCloseDropDown,self),300)}})}$dialog.data("columnKey",columnKey)},_checkCloseDropDown:function($dialog){if(this._activeDialog===null){return}if(this._activeDialog.data("focussed")===false){setTimeout($.proxy(this._closeDropDown,this),10);return}if($dialog&&$dialog.is(":visible")&&$dialog.attr("id")!==this._activeDialog.attr("id")){this.showHideDialog($dialog)}},toggleCheckstate:function($checkbox){var noCancel;noCancel=true;if(noCancel){if($checkbox.attr("data-chk")==="on"){this.selectCheckBox($checkbox,false)}else{this.selectCheckBox($checkbox,true)}}},selectCheckBox:function($checkbox,isToSelect){var css=this.css,$innerSpan=$checkbox.children("span");if(isToSelect===true){$innerSpan.removeClass(css.checkboxOff).addClass(css.checkboxOn);$checkbox.attr("data-chk","on")}else{$innerSpan.removeClass(css.checkboxOn).addClass(css.checkboxOff);$checkbox.attr("data-chk","off")}},_clickOKButton:function(columnKey){var i,j,cs,$checkbox,columnSettingsLength=this.columnSettings.length,methods,methodsLength,eventData=[],elem;if(columnKey===null||columnKey===undefined){return}for(j=0;j<columnSettingsLength;j++){if(this.columnSettings[j].columnKey===columnKey){cs=this.columnSettings[j];break}}if(cs===null||cs===undefined){return}methods=cs.summaryOperands;methodsLength=methods.length;for(i=0;i<methodsLength;i++){$checkbox=this.grid._rootContainer().find("#"+this._id("summaries_footer_checkbox",methods[i].type.toLowerCase(),columnKey));elem={type:methods[i].type.toLowerCase(),active:false};if($checkbox.attr("data-chk")!==undefined&&$checkbox.attr("data-chk").toLowerCase()==="on"){elem.active=true}eventData.push(elem)}this._trigger(this.events.dropDownOKClicked,null,{columnKey:columnKey,eventData:eventData,owner:this});this.showHideDialog(this.grid._rootContainer().find("#"+this._id("summaries","methods_dialog",columnKey)));this._calculateSelectedSummaries(columnKey);if(this.grid.hasFixedColumns()){this._syncFixedUnfixedRowHeights()}},_clickCancelButton:function(columnKey){this._trigger(this.events.dropDownCancelClicked,null,{columnKey:columnKey,owner:this});this.showHideDialog(this.grid._rootContainer().find("#"+this._id("summaries","methods_dialog",columnKey)))},_rollbackCheckboxState:function(columnKey){var cs,i,j,methods,isChecked,methodsLength,columnSettingsLength=this.columnSettings.length,$checkbox;if(columnKey===undefined||columnKey===null){return}for(j=0;j<columnSettingsLength;j++){if(this.columnSettings[j].columnKey===columnKey){cs=this.columnSettings[j];break}}if(cs===null||cs===undefined){return}methods=cs.summaryOperands;methodsLength=methods.length;for(i=0;i<methodsLength;i++){$checkbox=this.grid._rootContainer().find("#"+this._id("summaries_footer_checkbox",methods[i].type.toLowerCase(),columnKey));if($checkbox.attr("data-chk")!==undefined){isChecked=$checkbox.attr("data-chk").toLowerCase()==="on";if(methods[i].active!==isChecked){if(methods[i].active===true){this.selectCheckBox($checkbox,true)}else{this.selectCheckBox($checkbox,false)}}}}},_initCompactModeSummariesRows:function(){var i,j,k,cs=this.newColumnSettings,csLength=cs.length,columnMaxMethods=cs[0],cmm,cmmLength,countRowsToAdd,methodName,maxMethods=-1,summariesRowsLength,newMaxMethods;for(i=0;i<csLength;i++){if(!this._isVisibleColumn(cs[i].columnKey)){continue}newMaxMethods=0;if(cs[i].summaryOperands===null||cs[i].summaryOperands===undefined){continue}for(j=0;j<cs[i].summaryOperands.length;j++){if(cs[i].summaryOperands[j].active===true){newMaxMethods++}}newMaxMethods=Math.max(newMaxMethods,1);if(newMaxMethods>maxMethods){maxMethods=newMaxMethods;columnMaxMethods=cs[i]}}if(columnMaxMethods===undefined||columnMaxMethods===null){return}cmm=columnMaxMethods.summaryOperands;cmmLength=cmm.length;summariesRowsLength=this._summariesRows.length;if(summariesRowsLength>maxMethods){return}countRowsToAdd=maxMethods-summariesRowsLength;if(countRowsToAdd===0){return}k=0;for(i=0;i<cmmLength;i++){methodName=cmm[i].type.toLowerCase();if(this.grid._rootContainer().find("#"+this._id("summaries","footer_row",methodName)).length===0){this._insertSummariesRows(methodName,null);if(++k===countRowsToAdd){break}}}},_calculateInternalSummaries:function(){var cs=this.newColumnSettings,csLength=cs.length,i,o=this.options,data,res,e=this.events;if(this._trigger(e.summariesCalculating,null,{owner:this})===false){return}data=this._dataSummaries();if(o.callee!==null&&o.callee!==undefined&&$.type(o.callee)==="function"){data=o.callee(data)}if(data===null||data===undefined){data=[]}if(o.compactRenderingMode===true||o.compactRenderingMode==="auto"&&this._analyzeAutoCompactRenderingMode()===true){this._initCompactModeSummariesRows()}for(i=0;i<csLength;i++){if(!this._isVisibleColumn(cs[i].columnKey)){continue}res=this.calculateSummaryColumn(cs[i].columnKey,cs[i].summaryOperands,data,cs[i].dataType);this._renderFooterColumnInfo(cs[i].columnKey,res)}this._isRenderedSummariesRows=true;this._trigger(e.summariesCalculated,null,{data:data,owner:this})},_isVisibleColumn:function(columnKey){var cols=this.grid._visibleColumns(),ret=false;$.each(cols,function(index,value){if(value.key===columnKey){ret=true;return false}});return ret},calculateSummaryColumn:function(ck,columnMethods,data,dataType){var i,j,val,o=this.options,columnMethodsLength,tmpArr=[],rowsCount=0,res=[],order,resultCalculated,resElement,methodName,gridDataSource,isDate,isTime,cellValue;if(ck===null||ck===undefined){throw new Error(this._getLocaleValue("calculateSummaryColumnKeyNotSpecified"))}if(columnMethods===undefined||columnMethods===null){return}columnMethodsLength=columnMethods.length;if(o.type==="local"){rowsCount=data.length;isDate=dataType==="date";isTime=dataType==="time";if(isDate===true||isTime===true){for(i=0;i<rowsCount;i++){if(data[i][ck]!==null&&data[i][ck]!==undefined){if(data[i][ck].getTime){cellValue=this.grid.dataSource.getCellValue(ck,data[i]);tmpArr.push(isDate?cellValue.getTime():$.ig.Date.prototype.resetDateToCurrentDate(cellValue).getTime())}else{tmpArr.push(this.grid.dataSource.getCellValue(ck,data[i]))}}}}else{for(i=0;i<rowsCount;i++){if(data[i][ck]===undefined){data[i][ck]=null}tmpArr.push(this.grid.dataSource.getCellValue(ck,data[i]))}}for(i=0;i<columnMethodsLength;i++){methodName=columnMethods[i].type.toLowerCase();if(methodName.startsWith("custom")){methodName="custom"}if(columnMethods[i].active===true||columnMethods[i].active===1){order=columnMethods[i].order;if(order===undefined){order=null}if(methodName==="count"){resultCalculated=rowsCount}else{resultCalculated=$.ig.calcSummaries(methodName,tmpArr,columnMethods[i].summaryCalculator,dataType)}resElement={type:columnMethods[i].type,result:resultCalculated,rowDisplayLabel:columnMethods[i].rowDisplayLabel,order:order,format:columnMethods[i].format,dataType:dataType};res.push(resElement);this._addDataResult(ck,resElement)}}}else if(o.type==="remote"){if(data[ck]!==undefined&&data[ck]!==null){for(i=0;i<columnMethodsLength;i++){val=data[ck][columnMethods[i].type];if(columnMethods[i].active===true||columnMethods[i].active===1){order=columnMethods[i].order;if(order===undefined){order=null}if(val===null||val===undefined){if(columnMethods[i].summaryCalculator!==undefined){gridDataSource=this.grid.dataSource._data;rowsCount=gridDataSource.length;isDate=dataType==="date";isTime=dataType==="time";if(isDate===true||isTime===true){for(j=0;j<rowsCount;j++){if(gridDataSource[j][ck]!==null&&gridDataSource[j][ck]!==undefined){cellValue=this.grid.dataSource.getCellValue(ck,gridDataSource[j]);tmpArr.push(isDate?cellValue.getTime():$.ig.Date.prototype.resetDateToCurrentDate(cellValue).getTime())}}}else{for(j=0;j<rowsCount;j++){tmpArr.push(this.grid.dataSource.getCellValue(ck,gridDataSource[j]))}}val=$.ig.calcSummaries(columnMethods[i].type.toLowerCase(),tmpArr,columnMethods[i].summaryCalculator,dataType)}else{val=""}}res.push({type:columnMethods[i].type,result:val,rowDisplayLabel:columnMethods[i].rowDisplayLabel,order:order,format:columnMethods[i].format,dataType:dataType})}}}this._data[ck]=res}return res},summaryCollection:function(){return this._data},summariesFor:function(columnKey){return this._data[columnKey]},_addDataResult:function(columnKey,resElement){var d=this._data[columnKey],i,dLen;if(d===null||d===undefined){this._data[columnKey]=[];this._data[columnKey].push(resElement);return}dLen=d.length;for(i=0;i<dLen;i++){if(d[i].type.toLowerCase()===resElement.type.toLowerCase()){d[i]=resElement;break}}if(i===dLen){this._data[columnKey].push(resElement)}},_removeDataResult:function(columnKey,methodName){var d=this._data[columnKey];if(d===undefined||d===null){return}d=$.grep(d,function(n){return n.type.toLowerCase()!==methodName.toLowerCase()});this._data[columnKey]=d},_getDataByKeyMethodName:function(columnKey,methodName){var i,d=this._data[columnKey],dLength,res=null;methodName=methodName.toLowerCase();if(d===undefined||d===null){return null}dLength=d.length;for(i=0;i<dLength;i++){if(d[i].type.toLowerCase()===methodName){return d[i]}}return res},_updateDataLabels:function(columnKey){var d=this._data[columnKey],dLength=d.length,dsm=this.defaultSummaryMethods,dsmLength=dsm.length,i,j;for(i=0;i<dLength;i++){for(j=0;j<dsmLength;j++){if(dsm[j].type===d[i].type){d[i].rowDisplayLabel=dsm[j].rowDisplayLabel}}}},_updateColumnSettings:function(columnKey){var columnSetting=this._getColumnSettingByKey(columnKey),dsm=this.defaultSummaryMethods,dsmLength=dsm.length,i,j;for(i=0;i<columnSetting.summaryOperands.length;i++){for(j=0;j<dsmLength;j++){if(dsm[j].type===columnSetting.summaryOperands[i].type){columnSetting.summaryOperands[i].rowDisplayLabel=dsm[j].rowDisplayLabel}}}},_renderFooterColumnInfo:function(columnKey,data){if(data===null||data===undefined){return}var i,j,methodName,footerRowId,$footerRow,order,compactRenderingMode=this.options.compactRenderingMode,dataLength=data.length,min,swapElement;if(compactRenderingMode===true||this.options.compactRenderingMode==="auto"&&this._analyzeAutoCompactRenderingMode()===true){if(dataLength>1){for(i=0;i<dataLength;i++){min=i;for(j=i+1;j<dataLength;j++){if(data[j].order<data[min].order){swapElement=data[j];data[j]=data[min];data[min]=swapElement;min=j}}}}for(i=0;i<dataLength;i++){if(this._summariesRows[i]===undefined||this._summariesRows[i]===null||data[i]===undefined||data[i]===null){continue}this._renderCellHandler(this._summariesRows[i].type,columnKey,data[i])}}else if(compactRenderingMode===false||this.options.compactRenderingMode==="auto"&&this._analyzeAutoCompactRenderingMode()===false){for(i=0;i<dataLength;i++){methodName=data[i].type.toLowerCase();footerRowId=this._id("summaries","footer_row",methodName);$footerRow=this.grid._rootContainer().find("#"+footerRowId);if($footerRow.length===0){order=data[i].order;if(order===undefined){order=null}this._addDataResult(columnKey,data[0]);this._insertSummariesRows(methodName,order)}this._renderCellHandler(methodName,columnKey,data[i])}}},_renderCell:function(methodName,columnKey,data){var resultTemplate=this.options.resultTemplate,column,value=data.result,res,oColumnType,oColumnFormat,oFormatted,summaryOperand=data.type,rowDisplayLabel=data.rowDisplayLabel,format=data.format,dataType=data.dataType,isNumber=this._isNumber(value),applyFormat=true;if(isNumber&&dataType==="bool"){applyFormat=false}if((dataType==="date"||dataType==="time")&&isNumber&&(summaryOperand==="min"||summaryOperand==="max")){value=new Date(parseInt(value,10))}if(format===undefined&&applyFormat){column=this._getGridColumnFor(columnKey);if(column!==null){oColumnFormat=column.format;oColumnType=column.dataType;oFormatted=column.formatted;if(summaryOperand==="count"){column.format="0";column.dataType="number"}value=this.grid._renderCell(value,column);column.format=oColumnFormat;column.dataType=oColumnType;column.formatted=oFormatted}}else if(applyFormat){value=$.ig.formatter(value,dataType,format)}if(value===null||value===undefined){value=""}if(resultTemplate){res=resultTemplate.replace("{0}",rowDisplayLabel).replace("{1}",value)}else{res=value}this.grid._rootContainer().find("#"+this._id("summaries","footer_row_text_container",methodName,columnKey)).html(res)},_getGridColumnFor:function(columnKey){var i,gridColumnsLength=this.grid.options.columns?this.grid.options.columns.length:0;for(i=0;i<gridColumnsLength;i++){if(this.grid.options.columns[i].key===columnKey){return this.grid.options.columns[i]}}return null},_isNumber:function(n){return!isNaN(parseFloat(n))&&isFinite(n)},_columnsCollectionModified:function(event,ui){if(ui.owner.element.attr("id")!==this.grid.element.attr("id")){return}if(this._isSummariesRowsHidden===true){return}this._clearAllRows();this.calculateSummaries()},_insertSummariesRows:function(methodName,order){methodName=methodName.toLowerCase();var srLength,i,j,srOrder,hasFixed=this.grid.hasFixedColumns(),css=this.css,$grid=this.grid,gridColumns=$grid._visibleColumns(),gridColumnsLength=gridColumns.length,$tfoot=this._tfoot,$td,$tfootFixed,$footer=$grid._footer,footerRowIdFixed,$footerRowFixed,footerRowId=this._id("summaries","footer_row",methodName),$footerRow=$("<tr></tr>").attr("id",footerRowId).attr("data-role","summaryrow"),elem={id:footerRowId,type:methodName,order:order},footerRowCellMousein=function(){$(this).addClass(css.footerRowCellHover)},footerRowCellMouseout=function(){$(this).removeClass(css.footerRowCellHover)};if(hasFixed===true){footerRowIdFixed=this._id("summaries","footer_row",methodName,"fixed");$footerRowFixed=$("<tr></tr>").attr("id",footerRowIdFixed).attr("data-role","summaryrow");$tfootFixed=this.grid.fixedFootersTable().find("tfoot")}if($tfoot===null||$tfoot===undefined){if($footer===undefined||$footer===null||$footer.length===0){$grid._renderFooter();$footer=$grid._footer}if($footer===undefined||$footer===null||$footer.length===0){return}$footer.css("display","");if(this._isVirtualization()===true){$tfoot=this.grid.footersTable().find("tfoot")}else if(this._isFixedFooters()===true){$tfoot=$footer.find("tfoot")}else{$tfoot=$footer}this._tfoot=$tfoot}if($tfoot.attr("id")!==""&&$tfoot.attr("id")!==null&&$tfoot.attr("id")!==undefined){$tfoot=this.grid._rootContainer().find("#"+$tfoot.attr("id"))}if(order===null){elem.order=this._summariesRows.length;this._summariesRows.push(elem);$footerRow.appendTo($tfoot);if(hasFixed){$footerRowFixed.appendTo($tfootFixed)}}else{srLength=this._summariesRows.length;if(srLength===0){this._summariesRows.push(elem);$footerRow.appendTo($tfoot);if(hasFixed){$footerRowFixed.appendTo($tfootFixed)}}else{if(this.options.compactRenderingMode===true||this.options.compactRenderingMode==="auto"&&this._analyzeAutoCompactRenderingMode()===true){$footerRow.appendTo($tfoot);if(hasFixed){$footerRowFixed.appendTo($tfootFixed)}this._summariesRows.push(elem)}else if(this.options.compactRenderingMode===false||this.options.compactRenderingMode==="auto"&&this._analyzeAutoCompactRenderingMode()===false){
for(i=0;i<srLength;i++){srOrder=this._summariesRows[i].order;if(srOrder===undefined||srOrder===null){continue}if(order<=srOrder){$footerRow.insertBefore(this.grid._rootContainer().find("#"+this._id("summaries","footer_row",this._summariesRows[i].type)));if(hasFixed){$footerRowFixed.insertBefore(this.grid._rootContainer().find("#"+this._id("summaries","footer_row",this._summariesRows[i].type,"fixed")))}this._summariesRows.splice(i,0,elem);break}}if(i===srLength){this._summariesRows.push(elem);$footerRow.appendTo($tfoot);if(hasFixed){$footerRowFixed.appendTo($tfootFixed)}}}}}if(this._isVirtualization()&&this.grid.options.virtualizationMode==="fixed"&&!hasFixed){gridColumnsLength=this.grid._virtualColumnCount}for(j=0;j<gridColumnsLength;j++){$td=$("<td></td>").attr("tabIndex",this.grid.options.tabIndex).attr("aria-describedby",this.grid.id()+"_"+gridColumns[j].key).addClass(css.footerRowCell).attr("data-key",gridColumns[j].key);if(gridColumns[j].fixed===true){$td.appendTo($footerRowFixed);this.grid._rootContainer().find("#"+footerRowIdFixed+" td.ui-state-default").hover(footerRowCellMousein,footerRowCellMouseout)}else{$td.appendTo($footerRow);this.grid._rootContainer().find("#"+footerRowId+" td.ui-state-default").hover(footerRowCellMousein,footerRowCellMouseout)}if(j===gridColumnsLength-1&&$grid.options.height&&parseInt($grid.options.height,10)>0){$td.css("width",parseInt(gridColumns[j].width,10)+$grid._scrollbarWidth())}else{$td.css("width",gridColumns[j].width)}this._renderInnerCellMarkup($td,methodName,gridColumns[j].key)}if(hasFixed&&this.grid.hasFixedDataSkippedColumns()&&this.grid.fixingDirection()==="left"){this.grid._footerInit($footerRowFixed,null,true,css.footerRowCell)}else{this.grid._footerInit($footerRow,null,true,css.footerRowCell)}},_renderInnerCellMarkup:function($td,methodName,columnKey){var $textContainer,$iconContainer;$textContainer=$("<div></div>").attr("id",this._id("summaries","footer_row_text_container",methodName,columnKey)).addClass(this.css.footerRowTextContainer).appendTo($td).attr("data-localeid","emptyCellText").html(this._getLocaleValue("emptyCellText"));$iconContainer=$("<div></div>").attr("id",this._id("summaries","footer_row_icon_container",methodName,columnKey)).addClass(this.css.footerRowIconContainer).insertBefore($textContainer);if($.ig.util.isIE7===true){$iconContainer.addClass(this.css.baseClassIE7)}if(this.options.showDropDownButton===false){$iconContainer.addClass(this.css.footerRowIconContainerEmpty);$textContainer.addClass(this.css.footerRowTextContainerEmpty)}},_virtualHorizontalScroll:function(event,args){if(this._isRenderedSummariesRows===false){return}var start=args.startColIndex,end=args.endColIndex,i,j,$row,$children,$td,sr=this._summariesRows,srLength=sr.length,columnSetting,columnKey,cols=this.grid._visibleColumns(),self=this;end=start+this.grid._virtualColumnCount;if(srLength>0){$children=sr[0];$.each($children,function(index,element){self.grid._rootContainer().find("#"+self._id("summaries","methods_dialog",$(element).attr("data-key"))).remove()})}for(i=0;i<srLength;i++){$row=this.grid._rootContainer().find("#"+sr[i].id);$children=$row.children();$children.html("");for(j=start;j<=end;j++){$td=$row.find("td:nth-child("+(j-start+1)+")");$td.html("");if(cols[j]===null||cols[j]===undefined){continue}this._renderInnerCellMarkup($td,sr[i].type,cols[j].key)}}for(i=start;i<end;i++){if(cols[i]!==null&&cols[i]!==undefined){columnKey=cols[i].key;columnSetting=this._getColumnSettingByKey(columnKey);if(columnKey===undefined||columnKey===null){continue}this._renderFooterIconMarkup(sr[0].type,columnKey);this._renderDropDown(columnKey);if(columnSetting===null||columnSetting===undefined){continue}this._renderFooterColumnInfo(columnKey,this._data[columnKey])}}if(this.grid.hasFixedColumns()){this._syncFixedUnfixedRowHeights()}},_isFixedFooters:function(){return this.grid.options.fixedFooters===true&&this.grid.options.height!==null},_isVirtualization:function(){var gridOptions=this.grid.options;return gridOptions.virtualization===true||gridOptions.rowVirtualization===true&&gridOptions.height!==null||gridOptions.columnVirtualization===true&&gridOptions.width!==null},_id:function(){var i,res=this.grid.element[0].id,argumentsLength=arguments.length;if(argumentsLength===0){return null}for(i=0;i<argumentsLength;i++){res+="_"+arguments[i]}return res},_getColumnFixingInstance:function(){return this.grid.element.data("igGridColumnFixing")},_isAllowedMethodName:function(methodName){var defaultMethodName,isAllowed=false,len=this.defaultSummaryMethods.length,i;for(i=0;i<len;i++){defaultMethodName=this.defaultSummaryMethods[i].type;if(defaultMethodName===methodName||defaultMethodName===methodName.substr(0,defaultMethodName.length)){isAllowed=true;break}}return isAllowed},_footerInit:function(owner,args){if(args.owner.element.attr("id")!==this.grid.element.attr("id")){return}var rows,i;rows=this.grid.footersTable().find("[ data-role=summaryrow ]");rows.find("[ data-skip=true ]").remove();for(i=0;i<rows.length;i++){this.grid._footerInit($(rows[i]),null,true,this.css.footerRowCell)}},_dataSummaries:function(){var ds=this.grid.dataSource;return ds.dataSummaries()},_injectGrid:function(gridInstance){this.grid=gridInstance;if(this.options.type===null){this.options.type=this.grid._inferOpType()}this._detachEvents();this._headerRenderedHandler=$.proxy(this._headerRendered,this);this._footerRenderedHandler=$.proxy(this._footerRendered,this);this._headerCellRenderedHandler=$.proxy(this._headerCellRendered,this);this._headerFooterInitHandler=$.proxy(this._footerInit,this);this._columnsCollectionModifiedHandler=$.proxy(this._columnsCollectionModified,this);this.grid.element.bind("iggridheaderrendered",this._headerRenderedHandler);this.grid.element.bind("iggridfooterrendered",this._footerRenderedHandler);this.grid.element.bind("iggridheadercellrendered",this._headerCellRenderedHandler);this.grid.element.bind("iggridheaderextracellsmodified",this._headerFooterInitHandler);this.grid.element.bind("iggridcolumnscollectionmodified",this._columnsCollectionModifiedHandler);this._virtualHorizontalScrollHandler=$.proxy(this._virtualHorizontalScroll,this);this.grid.element.bind("iggridvirtualhorizontalscroll",this._virtualHorizontalScrollHandler);this._initColumnSettings();this._setDataSourceColumnSettingsOptions();if(this.grid.element.igGridFeatureChooser!==undefined){this.grid.element.igGridFeatureChooser()}else{throw new Error(this._getLocaleValue("featureChooserNotReferenced"))}}});$.extend($.ui.igGridSummaries,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI Grid Tooltips 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.popover.js
 *	infragistics.ui.grid.framework.js
 */
(function($){$.widget("ui.igGridTooltips",{options:{visibility:"overflow",style:"tooltip",showDelay:500,hideDelay:300,columnSettings:[{columnKey:null,columnIndex:-1,allowTooltips:true,maxWidth:null}],fadeTimespan:150,cursorLeftOffset:10,cursorTopOffset:15,inherit:false},css:{tooltip:"ui-iggrid-tooltip",tooltipContent:"ui-iggrid-tooltip-content"},events:{tooltipShowing:"tooltipShowing",tooltipShown:"tooltipShown",tooltipHiding:"tooltipHiding",tooltipHidden:"tooltipHidden"},_createWidget:function(){this.visible=false;this._canFadeIn=true;this._canFadeOut=true;$.Widget.prototype._createWidget.apply(this,arguments)},destroy:function(){this.grid.element.unbind(".tooltip");if(this.tooltip&&this._registered){if(this.tooltip.data("users")===1){this.tooltip.remove()}else{this.tooltip.data("users",this.tooltip.data("users")-1);this.tooltip.children("[id$='_content']").unbind("pointerenter."+this.grid.id()).unbind("MSPointerEnter."+this.grid.id()).unbind("pointerleave."+this.grid.id()).unbind("MSPointerLeave."+this.grid.id()).unbind("mouseenter."+this.grid.id()).unbind("mouseleave."+this.grid.id())}}if(this.ruler&&this._registered){if(this.ruler.data("users")===1){this.ruler.remove()}else{this.ruler.data("users",this.ruler.data("users")-1)}}this._registered=false;this._superApply(arguments);return this},id:function(){return this.tooltip[0].id},_injectGrid:function(gridInstance,isRebind){if(isRebind===true){return}this.grid=gridInstance;this._createHandlers();this._unregisterGridEvents();this._registerGridEvents()},_createTooltip:function(){var existingTooltip=this.grid._rootContainer().children("[id$='_tooltips']"),tooltipContent,closeButton=$.ig.util.isTouch;if(existingTooltip.length>0){this.tooltip=existingTooltip;this.tooltip.data("users",this.tooltip.data("users")+1)}else{if(this.options.style==="tooltip"){this.tooltip=$("<div></div>").attr("id",this.grid.id()+"_tooltips").attr("role","tooltip").addClass("ui-tooltip").addClass("ui-widget").addClass("ui-corner-all").addClass("ui-widget-content").addClass(this.css.tooltip).css({position:"absolute",display:"none","white-space":"normal","word-wrap":"break-word"});$("<div></div>").attr("id",this.id()+"_content").addClass("ui-tooltip-content").addClass(this.css.tooltipContent).appendTo(this.tooltip)}else if(this.options.style==="popover"){this.tooltip=$("<div><div>").attr("id",this.grid.id()+"_tooltips").igPopover({animationDuration:this.options.fadeTimespan,maxHeight:"auto",headerTemplate:{closeButton:closeButton}})}this.tooltip.data("users",1)}if(this.options.style==="tooltip"){tooltipContent=this.tooltip.children("[id$='_content']");if(window.navigator.msPointerEnabled||window.navigator.pointerEnabled){tooltipContent.bind("MSPointerEnter."+this.grid.id(),$.proxy(this._tooltipMouseEnter,this)).bind("pointerenter."+this.grid.id(),$.proxy(this._tooltipMouseEnter,this)).bind("MSPointerLeave."+this.grid.id(),$.proxy(this._tooltipMouseLeave,this)).bind("pointerleave."+this.grid.id(),$.proxy(this._tooltipMouseLeave,this))}else{tooltipContent.bind("mouseenter."+this.grid.id(),$.proxy(this._tooltipMouseEnter,this)).bind("mouseleave."+this.grid.id(),$.proxy(this._tooltipMouseLeave,this))}}this.tooltip.appendTo(this.grid._rootContainer())},_createRuler:function(){var existingRuler=this.grid._rootContainer().children("[id$='_ruler']");if(existingRuler.length>0){this.ruler=existingRuler;this.ruler.data("users",this.ruler.data("users")+1)}else{this.ruler=$("<div></div>").attr("id",this.id()+"_ruler").css({visibility:"hidden",position:"absolute"}).prependTo(this.grid._rootContainer());this.ruler.data("users",1)}},_displayOverflow:function(element){var ruler=this.ruler,cellTextHeight,dcell=element[0];ruler.text(element.text());ruler.css({"font-family":element.css("font-family"),"font-size":element.css("font-size"),"font-size-adjust":element.css("font-size-adjust"),"font-stretch":element.css("font-stretch"),"font-style":element.css("font-style"),"font-variant":element.css("font-variant"),"font-weight":element.css("font-weight"),"border-left":element.css("border-left"),"border-right":element.css("border-right"),"padding-left":element.css("padding-left"),"padding-top":element.css("padding-top"),"padding-right":element.css("padding-right"),"padding-bottom":element.css("padding-bottom"),overflow:element.css("overflow"),"white-space":element.css("white-space"),"word-break":element.css("word-break")});ruler.width(element.width());cellTextHeight=ruler.height();ruler.css({overflow:"visible","white-space":"normal","word-break":"break-all"});return dcell.offsetWidth<dcell.scrollWidth||dcell.scrollWidth>dcell.clientWidth||cellTextHeight<ruler.height()},_gridHeaderRendering:function(event,ui){if(ui.owner.id()!==this.grid.id()){return}this._createTooltip();this._createRuler();this._registered=true},_dataRendered:function(event,ui){var $tbody,$tbodyFixed;if(ui!==undefined){if($(ui.owner.element).attr("id")!==this.grid.id()){return}}if(!this.tooltip){this._createTooltip();this._createRuler();this._registered=true}$tbody=this.grid.element.children("tbody");this._registerMouseEvents($tbody);if(this.grid.hasFixedColumns()){$tbodyFixed=this.grid.fixedTable().find("tbody");this._registerMouseEvents($tbodyFixed)}if(this.grid.options.fixedHeaders===true){this._$thead=this.grid.headersTable().find("thead")}else{this._$thead=this.grid.container().find("#"+this.grid.id()+" thead")}},_rowsRendered:function(event,ui){var tbody;if(ui!==undefined){if($(ui.owner.element).attr("id")!==this.grid.id()){return}}tbody=this.grid.element.children("tbody");this._registerMouseEvents(tbody);if(this.grid.hasFixedColumns()){tbody=this.grid.fixedTable().find("tbody");this._registerMouseEvents(tbody)}},_registerMouseEvents:function(tbody){var binding;if(window.navigator.msPointerEnabled||window.navigator.pointerEnabled){binding={"MSPointerLeave.tooltip":this._gridMouseLeaveHandler,"pointerleave.tooltip":this._gridMouseLeaveHandler,"MSPointerMove.tooltip":this._gridMouseMoveHandler,"pointermove.tooltip":this._gridMouseMoveHandler};tbody.unbind(binding).bind(binding)}else{binding={"mouseleave.tooltip":this._gridMouseLeaveHandler,"mousemove.tooltip":this._gridMouseMoveHandler};tbody.unbind(binding).bind(binding)}},_gridMouseLeave:function(){clearTimeout(this.timeoutShowing);clearTimeout(this.timeoutHiding);if(this.tooltip.css("display")!=="none"){this._hideTooltip(true)}this._currentlyHovered=null},_gridMouseMove:function(event){var element=$(event.target).closest("td,th"),elementData,hidePrevious=true,shouldShow,hasFixedCols=this.grid.hasFixedColumns(),isFixedElement=this.grid._isFixedElement(element);if(element.closest("table").attr("id")!==this.grid.id()&&!isFixedElement||hasFixedCols&&isFixedElement&&element.closest("table").attr("id")!==this.grid.id()+"_fixed"){return}this.mouseX=event.pageX!==undefined?event.pageX:event.originalEvent.pageX;this.mouseY=event.pageY!==undefined?event.pageY:event.originalEvent.pageY;if(element[0]===this._currentlyHovered||element.length===0){return}elementData=this._getElementValue(element);if(elementData===undefined){hidePrevious=true}if(element[0]===this._currentlyDisplayed&&this.visible===true){hidePrevious=false;clearTimeout(this.timeoutHiding);return}this._currentlyHovered=element[0];this._previouslyHoveredData=this._currentlyHoveredData;this._currentlyHoveredData=elementData;clearTimeout(this.timeoutShowing);shouldShow=this._shouldShowForTarget(element)&&elementData!==undefined&&elementData!==""&&$(event.target).attr("unselectable")===undefined;if(this.visible===true&&hidePrevious===true){this._hideTooltip(!shouldShow)}if(shouldShow===true){this._currentlyDisplayed=this._currentlyHovered;this._showTooltip()}},_tooltipMouseEnter:function(){if(this.timeoutHiding!==null&&this.timeoutHiding!==undefined){clearTimeout(this.timeoutHiding)}},_tooltipMouseLeave:function(){this._hideTooltip()},_getColumnFixingInstance:function(){if(!this._columnFixing&&this.grid.element.data("igGridColumnFixing")){this._columnFixing=this.grid.element.data("igGridColumnFixing")}return this._columnFixing},_getRowIndex:function(element,row){return element.closest("tbody").children("tr:not([data-container='true'])").index(row)},_getElementValue:function(element){var col,val,tlog,i,tid,row=element.closest("tr"),key,hasFixedCols=this.grid.hasFixedColumns(),hskip=0,cf,rec,sri=this.grid._startRowIndex||0;if(this.grid.options.virtualization||this.grid.options.columnVirtualization){hskip=this.grid._startColIndex||0}if(hasFixedCols){cf=this._getColumnFixingInstance();if(element.is("th")||element.attr("data-skip")){col=-1}else{col=element.index();key=cf._getKeyByVisibleIndex(col,this.grid._isFixedElement(element))}}else{if(this._$thead.length>0){col=element.index()-this._$thead.children(":first").children("th[data-skip='true']").length+hskip}else{col=element.index()-element.parent().find("td[data-parent='true'],td[data-skip='true'],th").length+hskip}}if(col<0){return val}if(!key){key=this.grid._visibleColumns()[col].key}this._pRowIdx=this._rowIdx;this._rowIdx=this._getRowIndex(element,row);if(this.grid.options.virtualization||this.grid.options.rowVirtualization){this._rowIdx+=sri}tlog=this.grid.dataSource.pendingTransactions();tid=parseInt(element.parent().attr("data-id"),10);for(i=tlog.length-1;i>=0;i--){if(tlog[i].type==="deleterow"){continue}if(tlog[i].type==="cell"){if(tlog[i].rowId===tid&&tlog[i].col===key){rec=$.extend(true,{},this.grid.dataSource.findRecordByKey(tlog[i].rowId));rec[key]=tlog[i].value;val=this.grid.dataSource.getCellValue(key,rec);break}}else{if(tlog[i].rowId===tid){val=this.grid.dataSource.getCellValue(key,tlog[i].row);break}}}if(val===undefined&&this.grid._getDataView()[this._rowIdx]!==undefined){val=this.grid.dataSource.getCellValue(key,this.grid._getDataView()[this._rowIdx])}if($.type(val)==="date"){val=$.ig.formatter(val,"date","dateTime",true,col?col.dateDisplayType==="utc":false,col&&rec?this.grid._getOffsetForCol(rec,col):0)}return val},_shouldShowForTarget:function(element){var shouldShow=true,dataIdx,hasFixedColumns=this.grid.hasFixedColumns(),col;switch(this.options.visibility){case"always":break;case"never":shouldShow=false;break;case"overflow":shouldShow=this._displayOverflow(element);break}if(shouldShow===false){return false}dataIdx=element.parent().children("td:not([data-parent],[data-skip='true'])").index(element);this._pColumnIdx=this._columnIdx;if(this.grid._isMultiColumnGrid){this._columnIdx=dataIdx}else{if(hasFixedColumns&&element.closest("[data-fixed-container]").length===1){this._columnIdx=this.grid.fixedHeadersTable().find("thead th[id]").not("[data-skip='true']").eq(dataIdx).data("columnIndex")}else{this._columnIdx=this._$thead.find("th[id]").not("[data-skip='true']").eq(dataIdx).data("columnIndex")}}if(this._columnIdx===undefined||this._columnIdx===null){this._columnIdx=dataIdx}if(this._columnIdx<0||this._columnIdx>=this.grid.options.columns.length){return false}this._pColumnKey=this._columnKey;if(hasFixedColumns){col=this.grid.getColumnByTD(element);if(col){this._columnKey=col.column.key}}else{if(this.grid._isMultiColumnGrid){this._columnKey=this.grid._visibleColumns()[dataIdx].key}else{this._columnKey=this.grid.options.columns[this._columnIdx].key}}return shouldShow&&this._shouldShowForColumn()},_shouldShowForColumn:function(){var i,colSettings=this.options.columnSettings;for(i=0;i<colSettings.length;i++){if(colSettings[i].columnKey===this._columnKey||colSettings[i].columnIndex===this._columnIdx){return colSettings[i].allowTooltips!==undefined?colSettings[i].allowTooltips:true}}return true},_hideTooltip:function(current){var self=this,args,fn;args={owner:this,tooltip:current===true?String(this._currentlyHoveredData):String(this._previouslyHoveredData),value:current===true?this._currentlyHoveredData:this._previouslyHoveredData,element:this._currentlyDisplayed,columnKey:current===true?this._columnKey:this._pColumnKey,index:current===true?this._rowIdx:this._pRowIdx,columnIndex:current===true?this._columnIdx:this._pColumnIdx};fn=function(){var noCancel=self._trigger(self.events.tooltipHiding,self,args);if(noCancel===true){self._hideTooltipNoDelay();self._trigger(self.events.tooltipHidden,self,args)}};if($.ig.util.isTouch){fn()}else{clearTimeout(this.timeoutHiding);this.timeoutHiding=setTimeout(fn,this.options.hideDelay)}},_showTooltip:function(){var self=this,args,fn;args={owner:this,tooltip:String(this._currentlyHoveredData),value:this._currentlyHoveredData,element:this._currentlyDisplayed,columnKey:this._columnKey,index:this._rowIdx,columnIndex:this._columnIdx};fn=function(){var noCancel=self._trigger(self.events.tooltipShowing,self,args);if(noCancel===true){self._showTooltipNoDelay(args.tooltip);self._trigger(self.events.tooltipShown,self,args)}};if($.ig.util.isTouch){fn()}else{this.timeoutShowing=setTimeout(fn,this.options.showDelay)}},_hideTooltipNoDelay:function(){if(this.options.style==="tooltip"){if(this._canFadeOut===true){this._canFadeOut=false;this.tooltip.fadeOut(this.options.fadeTimespan,$.proxy(this._fadeOutEnd,this))}}else if(this.options.style==="popover"){this.tooltip.igPopover("hide")}this.visible=false},_showTooltipNoDelay:function(value){var tooltip;if(this._currentlyDisplayed===null){return}clearTimeout(this.timeoutHiding);tooltip=$("#"+this.id());if(this.options.style==="tooltip"){this._updateTooltip(value);if(this._canFadeIn===true){this._canFadeIn=false;tooltip.fadeIn(this.options.fadeTimespan,$.proxy(this._fadeInEnd,this))}}else if(this.options.style==="popover"){tooltip.igPopover("show",$(this._currentlyDisplayed),value)}this.visible=true},_fadeOutEnd:function(){this._canFadeOut=true},_fadeInEnd:function(){this._canFadeIn=true},_updateTooltip:function(value){var tooltipContent=this.tooltip.children("[id$='_content']");tooltipContent.text(value);tooltipContent.parent().css("max-width",this._getMaxWidth(this._columnKey,this._columnIdx,this._currentlyDisplayed));this._positionTooltip(tooltipContent.parent())},_getMaxWidth:function(colKey,colIdx,td){var colSettings=this.options.columnSettings,i;for(i=0;i<colSettings.length;i++){if(colSettings[i].columnKey===colKey||colSettings[i].columnIndex===colIdx){if(colSettings[i].maxWidth!==null&&colSettings[i].maxWidth!==undefined){return colSettings[i].maxWidth}break}}return $(td).width()},_positionTooltip:function(tooltip){var win=$(window),left,top,toffset,tfullw=tooltip.outerWidth(),tfullh=tooltip.outerHeight();toffset=$.ig.util.getRelativeOffset(tooltip);left=this.mouseX-toffset.left+this.options.cursorLeftOffset;top=this.mouseY-toffset.top+this.options.cursorTopOffset;if(left+tfullw+toffset.left>win.width()+win.scrollLeft()){left=win.width()-toffset.left-tfullw+win.scrollLeft()}if(top+tfullh+toffset.top>win.height()+win.scrollTop()){top=win.height()-toffset.top-tfullh+win.scrollTop()}tooltip.css({top:top,left:left})},_fixedColumnsChanged:function(fObj){var $tbodyFixed;if(fObj.isToFix&&fObj.isInit){$tbodyFixed=this.grid.fixedTable().find("tbody");this._registerMouseEvents($tbodyFixed)}},_createHandlers:function(){this._rowsRenderedHandler=$.proxy(this._rowsRendered,this);this._gridMouseLeaveHandler=$.proxy(this._gridMouseLeave,this);this._gridMouseMoveHandler=$.proxy(this._gridMouseMove,this);this._gridHeaderRenderingHandler=$.proxy(this._gridHeaderRendering,this)},_registerGridEvents:function(){this.grid.element.bind("iggridrowsrendered.tooltip",this._rowsRenderedHandler);this.grid.element.bind("iggridheaderrendering.tooltip",this._gridHeaderRenderingHandler)},_unregisterGridEvents:function(){this.grid.element.unbind("iggridrendered.tooltip",this._dataRenderedHandler);this.grid.element.unbind("iggridheaderrendering.tooltip",this._gridHeaderRenderingHandler)}});$.extend($.ui.igGridTooltips,{version:"21.2.12"})})($);/*!@license
* Infragistics.Web.ClientUI Grid Editing 21.2.12
*
* Copyright (c) 2011-2022 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on:
* jquery-1.9.1.js
* jquery.ui-1.9.0.js
* jquery.ui.widget.js
* infragistics.ui.grid.framework.js
* infragistics.ui.grid.shared.js
* infragistics.ui.editors.js
* infragistics.ui.validator.js
* infragistics.ui.combo.js
* infragistics.ui.rating.js
* infragistics.ui.shared.js
* infragistics.dataSource.js
* infragistics.util.js
*/
(function($){$.widget("ui.igGridUpdating",$.ui.igWidget,{options:{columnSettings:[{columnKey:null,editorType:null,editorProvider:null,editorOptions:null,required:null,readOnly:null,validation:null,defaultValue:null}],editMode:"row",enableDeleteRow:true,enableAddRow:true,validation:false,doneLabel:null,doneTooltip:null,cancelLabel:null,cancelTooltip:null,addRowLabel:null,addRowTooltip:null,deleteRowLabel:null,deleteRowTooltip:null,showDoneCancelButtons:true,enableDataDirtyException:true,startEditTriggers:"click,F2,enter",horizontalMoveOnEnter:false,excelNavigationMode:false,saveChangesSuccessHandler:null,saveChangesErrorHandler:null,swipeDistance:"100px",wrapAround:true,rowEditDialogOptions:{containment:"owner",width:"415px",height:"350px",animationDuration:200,showReadonlyEditors:true,showEditorsForHiddenColumns:false,namesColumnWidth:"150px",editorsColumnWidth:null,showDoneCancelButtons:true,dialogTemplate:null,dialogTemplateSelector:null,editorsTemplate:null,editorsTemplateSelector:null},dialogWidget:"igGridModalDialog",inherit:false,locale:{doneLabel:undefined,doneTooltip:undefined,cancelLabel:undefined,cancelTooltip:undefined,addRowLabel:undefined,addRowTooltip:undefined,deleteRowLabel:undefined,deleteRowTooltip:undefined}},events:{editRowStarting:"editRowStarting",editRowStarted:"editRowStarted",editRowEnding:"editRowEnding",editRowEnded:"editRowEnded",editCellStarting:"editCellStarting",editCellStarted:"editCellStarted",editCellEnding:"editCellEnding",editCellEnded:"editCellEnded",rowAdding:"rowAdding",rowAdded:"rowAdded",rowDeleting:"rowDeleting",rowDeleted:"rowDeleted",dataDirty:"dataDirty",generatePrimaryKeyValue:"generatePrimaryKeyValue",rowEditDialogBeforeOpen:"rowEditDialogBeforeOpen",rowEditDialogAfterOpen:"rowEditDialogAfterOpen",rowEditDialogBeforeClose:"rowEditDialogBeforeClose",rowEditDialogAfterClose:"rowEditDialogAfterClose",rowEditDialogContentsRendered:"rowEditDialogContentsRendered"},css:{buttonContainer:"ui-iggrid-buttoncontainer ui-widget-content ui-corner-all",button:"ui-iggrid-button ui-state-default ui-corner-all",doneButton:"ui-iggrid-donebutton ui-priority-primary ui-corner-all",cancelButton:"ui-iggrid-cancelbutton ui-corner-all",deleteButton:"ui-iggrid-deletebutton ui-state-default ui-corner-all",buttonHover:"ui-iggrid-buttonhover ui-state-hover",buttonDisabled:"ui-iggrid-buttondisabled ui-state-disabled",buttonActive:"ui-iggrid-buttonactive ui-state-active",doneIcon:"ui-iggrid-doneicon ui-icon ui-icon-check",cancelIcon:"ui-iggrid-cancelicon ui-icon ui-icon-cancel",buttonIconOnly:"ui-iggrid-button-icon-only",editingCell:"ui-iggrid-editingcell",addRow:"ui-iggrid-addrow ui-widget-header",addRowHover:"ui-iggrid-addrowhover ui-state-hover",addRowActive:"ui-iggrid-addrowactive ui-state-active",addRowIcon:"ui-iggrid-addrowicon ui-icon ui-icon-circle-plus",deleteIcon:"ui-iggrid-deleteicon ui-icon ui-icon-circle-close",editor:"ui-iggrid-editor",rowEditDialogHeaderCaptionTitle:"ui-dialog-title",rowEditDialogCloseButton:"ui-icon ui-icon-close",rowEditDialog:"ui-dialog ui-draggable ui-resizable ui-iggrid-dialog ui-widget ui-widget-content ui-corner-all",blockArea:"ui-widget-overlay ui-iggrid-blockarea",rowEditDialogButtonsContainer:"ui-dialog-buttonpane ui-widget-content ui-helper-clearfix",rowEditDialogTable:"ui-iggrid-filtertable ui-helper-reset"},_createWidget:function(){this.options.columnSettings=[];$.Widget.prototype._createWidget.apply(this,arguments)},setCellValue:function(rowId,colKey,value){var provider,providerWrapper;if(rowId===null||rowId===undefined||$.type(colKey)!=="string"){return}if(value===undefined){throw new Error(this._getLocaleValue("undefinedCellValue"))}if(!this._recOrPropFound(rowId,colKey)){throw new Error(this._getLocaleValue("recordOrPropertyNotFoundException"))}if(this.isEditing()&&this._editingForRowId===rowId){providerWrapper=this._providerForKey(colKey);if(this._originalValues.hasOwnProperty(colKey)&&providerWrapper){provider=providerWrapper.igEditorFilter("option","provider");provider.setValue(value);this._editorTextChanged();return}else{this.endEdit(false,false)}}this._updateCell(rowId,colKey,value)},updateRow:function(rowId,values){var key,provider,providerWrapper,shouldUpdate=false;if(rowId===null||rowId===undefined||$.type(values)!=="object"){return}if(!this._recOrPropFound(rowId)){throw new Error(this._getLocaleValue("recordOrPropertyNotFoundException"))}if(this.isEditing()&&this._editingForRowId===rowId){for(key in values){providerWrapper=this._providerForKey(key);if(values.hasOwnProperty(key)&&this._originalValues.hasOwnProperty(key)&&providerWrapper){provider=providerWrapper.igEditorFilter("option","provider");provider.setValue(values[key])}else{this.endEdit(false,false);shouldUpdate=true;break}}this._editorTextChanged()}else{shouldUpdate=true}if(shouldUpdate){this._updateRow(rowId,values,null,null)}},addRow:function(values){var settings=this.options.columnSettings,i=settings?settings.length:0,defVals={},key,val;while(i-- >0){key=settings[i].columnKey;val=settings[i].defaultValue;if(val!==undefined&&key!==undefined&&key!==null){defVals[key]=val}}this._addRow(null,$.extend(defVals,values),defVals,true)},deleteRow:function(rowId){if(rowId===null||rowId===undefined){return}if(!this._recOrPropFound(rowId)){throw new Error(this._getLocaleValue("recordOrPropertyNotFoundException"))}if(this.isEditing()&&this._editingForRowId===rowId){this.endEdit(false)}this._deleteRow(null,rowId,true)},startEdit:function(rowId,column,raiseEvents){var columnIndex,columnKey,mode=this.options.editMode,visibleColumns=this.grid._visibleColumns(),cell,row;if(this.isEditing()){throw new Error(this._getLocaleValue("editingInProgress"))}if($.type(column)==="string"){columnKey=column;columnIndex=this._getVisibleIndexForKey(columnKey)}else if($.type(column)==="number"&&column>=0&&column<visibleColumns.length){columnKey=visibleColumns[column].key;columnIndex=column}if(!columnKey||columnIndex===undefined||columnIndex===null){if(mode==="cell"){throw new Error(this._getLocaleValue("columnNotFound").replace("{key}",columnKey))}columnKey=visibleColumns[0].key;columnIndex=0}if(mode==="cell"&&visibleColumns[columnIndex].readOnly){return false}switch(mode){case"dialog":return this._startEditDialog(null,!raiseEvents,rowId,false,columnKey,cell);case"row":row=this.grid.rowById(rowId);if(!row||!row.length){throw new Error(this._getLocaleValue("rowOrColumnSpecifiedOutOfView"))}return this._startEditForRow(null,!raiseEvents,rowId,columnKey,row);case"cell":cell=this.grid.cellById(rowId,columnKey);if(!cell||!cell.length){throw new Error(this._getLocaleValue("rowOrColumnSpecifiedOutOfView"))}return this._startEditForCell(null,!raiseEvents,rowId,columnKey,cell,true,false)}},startAddRowEdit:function(raiseEvents){if(this.isEditing()){throw new Error(this._getLocaleValue("editingInProgress"))}if(!this.options.enableAddRow){return false}if(this.options.editMode==="dialog"){return this._startEditDialog(null,!raiseEvents,null,true,this.grid._visibleColumns()[0].key,null)}return this._startEditForRow(null,!raiseEvents,null,null,this.grid.headersTable().children("thead").children("[data-add-row]").children(":not([data-skip='true'])").first())},endEdit:function(update,raiseEvents){var dialog;if(!this.isEditing()){return}if(this.options.editMode==="dialog"){dialog=$("#"+this.grid.id()+"_updating_dialog_container");if(dialog&&dialog.data()[this.options.dialogWidget]){dialog[this.options.dialogWidget]("closeModalDialog",update,!!raiseEvents)}}else{return this._endEdit(null,!!update,!raiseEvents)}},findInvalid:function(){var key,all=this._editors,provider;for(key in all){if(all.hasOwnProperty(key)&&all[key]){provider=all[key].data("igEditorFilter").options.provider;provider.refreshValue();if(!all[key].data("igEditorFilter").options.provider.validate()){return key}}}return null},isEditing:function(){return!!this._originalValues},editorForKey:function(key){var provider;if(!this._editors||!this._editors[key]){return null}provider=this._editors[key];return provider.igEditorFilter("option","provider").editor.element},editorForCell:function(cell,create){var columnKey=this._getColumnKeyForCell(cell);if(!this._editors){this._editors={}}if(!this._editors[columnKey]&&create){this._editors[columnKey]=this._createEditor(cell,columnKey)}return this.editorForKey(columnKey)},destroy:function(){if(this.options.enableAddRow){this._removeAddRow()}if(this.options.enableDeleteRow){this._removeDeleteButton()}if(this.options.showDoneCancelButtons&&this.options.editMode==="row"){this._removeDoneCancelButtons()}this._destroyAllEditors();this._unbindAllEvents();delete this._stopEditingHandler;delete this._gridHandlers;delete this._handlers;delete this._buttonHandlers;delete this._addNewRowHandlers;delete this._validationHandlers;delete this._dialogHandlers;delete this._editorCallbacks;this._superApply(arguments);return this},changeRegional:function(){var regional=this.grid.options.regional,key;this._stopEditing();if(this._editors){for(key in this._editors){if(this._editors.hasOwnProperty(key)&&this._editors[key].data("igEditorFilter")&&!this.grid.columnByKey(key).regional){this._editors[key].data("igEditorFilter")._setRegional(regional)}}}},changeLocale:function(){var self=this,gridId=this.grid.id(),$elements=$(),key;$elements=$elements.add(this.grid.fixedHeadersTable().children("thead").children("tr[data-add-row='true']"));$elements=$elements.add(this.grid.headersTable().children("thead").children("tr[data-add-row='true']"));$elements=$elements.add($("#"+gridId+"_updating_deletehover"));$elements=$elements.add($("#"+gridId+"_updating_delete_touch"));$elements=$elements.add($("#"+gridId+"_updating_done"));$elements=$elements.add($("#"+gridId+"_updating_cancel"));$elements.each(function(){self._super($(this))});if($("#"+gridId+"_updating_dialog_container").length){this._changeLocaleUpdatingDialog()}if(this._editors){for(key in this._editors){if(this._editors.hasOwnProperty(key)&&this._editors[key].data("igEditorFilter")){this._editors[key].data("igEditorFilter")._setLanguage(this.grid.options.language)}}}this._superApply(arguments)},_registerWidget:$.noop,_unregisterWidget:$.noop,_changeLocaleUpdatingDialog:function(){var $updatingDialog=$("#"+this.grid.id()+"_updating_dialog_container");if($updatingDialog.data(this.options.dialogWidget)){$updatingDialog[this.options.dialogWidget]("option",{locale:{modalDialogCaptionText:this._getLocaleValue("rowEditDialogCaptionLabel"),buttonApplyText:this._getLocaleValue("doneLabel"),buttonApplyTitle:this._getLocaleValue("doneTooltip"),buttonCancelText:this._getLocaleValue("cancelLabel"),buttonCancelTitle:this._getLocaleValue("cancelTooltip")}})}},_setOption:function(key,value){var opts=this.options,vt=$.type(value);if(opts[key]===value&&vt!=="object"&&vt!=="array"){return this}if(key==="editMode"){this.endEdit(false,false);this._dialogInvalid=true;this._destroyAllEditors()}this._super(key,value);switch(key){case"rowEditDialogOptions":this._dialogInvalid=true;opts.rowEditDialogOptions=$.extend(opts.rowEditDialogOptions,value);break;case"enableDeleteRow":if(value===true){this._renderDeleteButton()}else{this._removeDeleteButton()}break;case"enableAddRow":if(value===true&&this.grid.options.showHeader){this._updateAddNewRow()}else{this._removeAddRow()}this._rebindEditTriggers();break;case"startEditTriggers":this._analyzeEditTriggers();this._rebindEditTriggers();break;case"columnSettings":this.endEdit(false,false);this._destroyAllEditors();this._processReadOnly();if(this.options.enableAddRow&&this.grid.options.showHeader){this._updateAddNewRow()}this.grid._renderData();this._gridDirty=true;this._dialogInvalid=true;break}if(key==="saveChangesSuccessHandler"){this._addDSSuccessHandler()}else if(key==="saveChangesErrorHandler"){this._addDSErrorHandler()}return this},_gridDataRendering:function(evt,ui){var ds,l,noCancel;if(ui&&ui.owner.id()!==this.grid.id()){return}ds=this.grid.dataSource;l=ds.data()?ds.data().length:0;if(!this.grid.options.showHeader){this._processReadOnly()}if(this.isEditing()){if(!this.endEdit(this.grid.options.autoCommit,true)){this.endEdit(false,true)}}this._pkVal=Math.max(this._pkVal||1,l+1);if(ds.pendingTransactions().length){if(this.options.enableDataDirtyException){noCancel=this._trigger(this.events.dataDirty,null,{owner:this});if(noCancel){throw new Error(this._getLocaleValue("dataDirtyException"))}}}if(l&&!this.grid.options.primaryKey){throw new Error(this._getLocaleValue("noPrimaryKeyDefined"))}this.hideDeleteButton()},_gridRendered:function(){this._rebindEditTriggers()},_rowsRendered:function(evt,ui){if(ui&&ui.owner&&ui.owner.id()!==this.grid.id()){return}this._paintModifiedCells()},_virtPreRender:function(evt,ui){if(ui&&ui.owner&&ui.owner.id()!==this.grid.id()){return}if(this.isEditing()&&!this._vscrolled){if(!this._endEdit(evt,true,false,true)){this._endEdit(evt,false,false,true)}}delete this._vscrolled},_virtPostRender:function(evt,ui){if(ui&&ui.owner&&ui.owner.id()!==this.grid.id()){return}this.hideDeleteButton();this._paintModifiedCells()},_headerRendered:function(evt,ui){if(ui.owner.id()!==this.grid.id()){return}this._updateAddNewRow()},_fixedColumnsChanged:function(){this._stopEditing();this._editorsContainerInvalid=true;if(this.options.enableAddRow){this._updateAddNewRow()}if(this.options.enableDeleteRow){this._removeDeleteButton();this._renderDeleteButton()}if(this.options.showDoneCancelButtons&&this.options.editMode==="row"){this._removeDoneCancelButtons()}},_groupedColumnsChanged:function(){if(this.options.enableAddRow){this._updateAddNewRow()}},_hidingFinishing:function(){if(this.isEditing()){if(!this.endEdit(true,true)){this.endEdit(false,true)}}},_columnsModified:function(evt,ui){if(ui.owner.id()!==this.grid.id()){return}this._editorsContainerInvalid=true;if(this.options.enableAddRow){this._updateAddNewRow()}this._paintModifiedCells()},_columnsMoved:function(){this._hideValidatorMessages()},_scroll:function(){if(this.isEditing()){if(this._editingForRowId!==undefined&&this._editingForRowId!==null){this._positionDoneCancelButtons(this.grid.rowById(this._editingForRowId))}else{this._positionDoneCancelButtons(this.grid.headersTable().find("tr[data-new-row]"))}this._hideValidatorMessages()}},_internalColumnResized:function(){this._stopEditing()},_mouseDown:function(evt){var target=$(evt.target).closest("td"),targetContainer=target.closest(".ui-iggrid"),originalTarget=evt.originalEvent.target instanceof $?evt.originalEvent.target[0]:evt.originalEvent.target,targetGrid=target.closest(this.grid._isMultiRowGrid()?".ui-iggrid-table-mrl":".ui-iggrid-table"),re=new RegExp("^"+this.grid.id()+"(_fixed)?$"),selection=this.grid.element.data("igGridSelection");if(evt.originalEvent&&evt.originalEvent.type==="touchstart"){this._cevt=originalTarget}else{if(this._cevt===originalTarget){this._cevt=null;return}}if(targetContainer.length&&targetContainer[0]===this.grid.container()[0]){if(this.isEditing()){if(!target.hasClass(this.css.editingCell)&&(this.options.editMode==="cell"||this._getRowId(target.closest("tr"))!==this._editingForRowId)){this._endEdit(evt,true,false,true)}}if(this.grid.headersTable().children("thead").has(target).length||this.grid.fixedHeadersTable().children("thead").has(target).length){return}if(targetGrid.length&&targetGrid.attr("id").match(re)){if(selection&&!target.hasClass("ui-iggrid-selectedcell")){this._wait=true}else{delete this._wait}}}},_clickTrigger:function(evt){var target=$(evt.target),targetCell=target.closest("td"),targetGrid=targetCell.closest(".ui-iggrid");if(targetGrid.length&&targetGrid[0]===this.grid.container()[0]&&!target.is("a")){if(this._wait){delete this._wait;if(evt.type!=="dblclick"){return}}this._startEditForElement(evt,targetCell)}},_keyDown:function(evt){var target=$(evt.target),targetGrid=target.closest(".ui-iggrid"),sel,row;if(!targetGrid.length||targetGrid[0]!==this.grid.container()[0]){return}if(target.is("td,tr")){if(evt.keyCode===$.ui.keyCode.ENTER&&this._editTriggers.enter||evt.keyCode===113&&this._editTriggers.f2){if(this.options.editMode==="cell"&&target.is("tr")){target=this._getEditableCellsForRow(target).first()}this._startEditForElement(evt,target)}else if(evt.keyCode===$.ui.keyCode.DELETE&&this.options.enableDeleteRow&&!this.isEditing()){sel=this.grid.element.data("igGridSelection");if(sel&&sel.options.mode==="row"&&sel.options.multipleSelection){this._deleteMultipleRows(evt)}else{row=target.closest("tr");if(this._isEditableRow(row)){this._deleteRow(evt,this._getRowId(row),false)}}}}},_touchStart:function(evt){this._firstTouchX=evt.originalEvent.touches&&evt.originalEvent.touches[0]?evt.originalEvent.touches[0].pageX:evt.originalEvent.clientX;this._firstTouchRow=evt.originalEvent.touches?$(evt.originalEvent.touches[0].target).closest("tr"):$(evt.originalEvent.target).closest("tr");this._storedScrollLeft=this.grid.scrollContainer().scrollLeft()||0;this._storedScrollWidth=this.grid.scrollContainer().width()||0;this.hideDeleteButton()},_touchEnd:function(evt){var changedTouchX=evt.originalEvent.changedTouches&&evt.originalEvent.changedTouches[0]?evt.originalEvent.changedTouches[0].pageX:evt.originalEvent.clientX,targetGrid=evt.target?$(evt.target).closest(".ui-iggrid-table"):null,re=new RegExp("^"+this.grid.id()+"(_fixed)?$");if(targetGrid&&targetGrid.length>0&&!targetGrid.attr("id").match(re)){return}this._storedScrollLeft-=this.grid.scrollContainer().scrollLeft()||0;this._storedScrollWidth-=this.grid.scrollContainer().width()||0;if(this.options.enableDeleteRow&&Math.abs(changedTouchX-this._firstTouchX)>parseInt(this.options.swipeDistance,10)&&this._firstTouchRow&&this._storedScrollLeft===0&&this._storedScrollWidth===0&&this._firstTouchRow.filter(":not([data-container],[data-grouprow],[data-summaryrow],.ui-iggrid-deletedrecord)").length){this.showDeleteButtonFor(this._firstTouchRow)}delete this._firstTouchX;delete this._firstTouchRow;delete this._storedScrollLeft;delete this._storedScrollWidth;delete this._firstTouchRow},_pointerDown:function(evt){var oe=evt.originalEvent;if(oe.pointerType!=="touch"){return}this._firstTouchX=oe.pageX;this._firstTouchRow=$(oe.target).closest("tr");this._storedScrollLeft=this.grid.scrollContainer().scrollLeft()||0;this._storedScrollWidth=this.grid.scrollContainer().width()||0;this.hideDeleteButton()},_pointerUp:function(evt){var oe=evt.originalEvent,changedTouchX;if(oe.pointerType!=="touch"){return}changedTouchX=oe.pageX;this._storedScrollLeft-=this.grid.scrollContainer().scrollLeft()||0;this._storedScrollWidth-=this.grid.scrollContainer().width()||0;if(this.options.enableDeleteRow&&Math.abs(changedTouchX-this._firstTouchX)>parseInt(this.options.swipeDistance,10)&&this._firstTouchRow&&this._storedScrollLeft===0&&this._storedScrollWidth===0&&this._firstTouchRow.filter(":not([data-container],[data-grouprow],[data-summaryrow],.ui-iggrid-deletedrecord)").length){this.showDeleteButtonFor(this._firstTouchRow)}delete this._firstTouchX;delete this._firstTouchRow;delete this._storedScrollLeft;delete this._storedScrollWidth;delete this._firstTouchRow},_addRowFocus:function(evt){$(evt.target).closest("tr").addClass(this.css.addRowActive)},_addRowBlur:function(evt){$(evt.target).closest("tr").removeClass(this.css.addRowActive)},_rowMouseEnter:function(evt){var row=$(evt.target).closest("tr");if(!this.isEditing()&&this._isEditableRow(row)){this.showDeleteButtonFor(row)}else{this.hideDeleteButton()}},_rowPointerEnter:function(evt){if(evt.originalEvent.pointerType==="mouse"){this._rowMouseEnter(evt)}},_containerMouseLeave:function(){this.hideDeleteButton()},_containerPointerLeave:function(evt){if(evt.originalEvent.pointerType!=="touch"){this.hideDeleteButton()}},_buttonMouseEnter:function(evt){var button=$(evt.target).closest(".ui-iggrid-button,.ui-iggrid-deletebutton");if(!button.hasClass("ui-state-disabled")){button.addClass(this.css.buttonHover)}},_buttonMouseLeave:function(evt){var button=$(evt.target).closest(".ui-iggrid-button,.ui-iggrid-deletebutton");button.removeClass(this.css.buttonHover)},_buttonFocus:function(evt){var button=$(evt.target).closest(".ui-iggrid-button,.ui-iggrid-deletebutton");if(!button.hasClass("ui-state-disabled")){button.addClass(this.css.buttonActive)}},_buttonBlur:function(evt){$(evt.target).removeClass(this.css.buttonActive)},_doneButtonClick:function(evt){var target=$(evt.target).closest(".ui-iggrid-button");if(!target.length||target.hasClass(this.css.buttonDisabled)){return}this._endEdit(evt,true)},_doneButtonKeyDown:function(evt){var cols=this._getColumnsOrderedByNavIndex();if(evt.keyCode===$.ui.keyCode.TAB&&evt.shiftKey){this._activateEditor(this._providerForKey(cols[cols.length-1].key))}},_doneButtonKeyUp:function(evt){var target=$(evt.target).closest(".ui-iggrid-button");if(!target.length||target.hasClass(this.css.buttonDisabled)||evt.keyCode!==$.ui.keyCode.ENTER){return}this._endEdit(evt,true)},_cancelButtonKeyDown:function(evt){var cols=this._getColumnsOrderedByNavIndex();if(evt.keyCode===$.ui.keyCode.TAB&&!evt.shiftKey){this._activateEditor(this._providerForKey(cols[0].key))}},_cancelButtonKeyUp:function(evt){if(evt.keyCode===$.ui.keyCode.ENTER){this._stopEditing()}},_deleteButtonClick:function(evt){var rowId=$(evt.target).closest(".ui-iggrid-deletebutton").data("button-for");if(this._deleteRow(evt,rowId,false)){this.hideDeleteButton()}},_touchDeleteButtonClick:function(evt){var rowId=this._editingForRowId,target=$(evt.target).closest(".ui-iggrid-button");if(this.isEditing()&&!target.hasClass(this.css.buttonDisabled)){this._endEdit(evt,false,false);this._deleteRow(evt,rowId,false)}},_touchDeleteButtonKeyUp:function(evt){var rowId,target=$(evt.target).closest(".ui-iggrid-button");if(evt.keyCode===$.ui.keyCode.ENTER){rowId=this._editingForRowId;if(this.isEditing()&&!target.hasClass(this.css.buttonDisabled)){this._endEdit(evt,false,false);this._deleteRow(evt,rowId,false)}}},_dialogCloseClick:function(evt){var dialog=$("#"+this.grid.id()+"_updating_dialog_container");if(dialog&&dialog.data()[this.options.dialogWidget]){dialog[this.options.dialogWidget]("closeModalDialog",false,evt)}},_dialogDone:function(evt,ui){ui.toClose=true},_dialogCancel:function(evt,ui){ui.toClose=true},_dialogClosing:function(evt,ui){var dialog=ui.modalDialog;if(ui.raiseEvents){this._trigger(this.events.rowEditDialogBeforeClose,evt,{owner:this,dialogElement:dialog})}return this._endEditDialog(evt,ui.accepted,ui.owner.getContent(),!ui.raiseEvents)},_dialogClosed:function(evt,ui){if(ui.raiseEvents){this._trigger(this.events.rowEditDialogAfterClose,evt,{owner:this,dialogElement:ui.modalDialog})}},_dialogOpening:function(evt,ui){var dialog=ui.modalDialog,opts=this.options.rowEditDialogOptions,rowId=this.grid._fixPKValue(dialog.attr("data-for-rowid")),isAdding=dialog.attr("data-isadding")==="true",content=dialog[this.options.dialogWidget]("getContent"),templateParent,she=opts.showEditorsForHiddenColumns,cols=$.extend([],this.grid.options.columns),values=isAdding?this._getDefaultValues():this._getLatestValues(rowId),cache=content.find("[data-render-tmpl]").children(),invalid=!!this._editorsContainerInvalid,at=dialog.data("at"),rArgs;if(cache.length){if(!invalid){cache.detach()}else{this._clearEditorsFromContainer(cache);cache.remove()}}this._renderDialogContent(content,values);this._initDialogEditors(content,cols,values);templateParent=content.find("[data-render-tmpl]");if(templateParent.length&&!templateParent.children().length){if(!invalid){cache.appendTo(templateParent)}else{this._renderDialogTemplate(templateParent,cols,!she);delete this._editorsContainerInvalid}}this._initDialogEditors(content,cols,values);if(isAdding&&!this._anyEditorInvalid()){this._enableDoneButton()}else{this._disableDoneButton()}this._originalValues=$.extend({},values,this._originalValues);rArgs={owner:this,rowAdding:isAdding,rowID:rowId};if(at!==null&&at!==undefined){rArgs=$.extend({parentID:at},rArgs)}this._trigger(this.events.rowEditDialogAfterOpen,evt,{owner:this,dialogElement:dialog});this._trigger(this.events.editRowStarted,evt,rArgs)},_dialogOpened:function(evt,ui){ui.shouldFocus=false;if(this._columnToFocus&&this._columnToFocus.data&&this._columnToFocus.data("igEditorFilter")){this._columnToFocus.igEditorFilter("setFocus")}},_editorErrorShowing:function(evt,ui){var colKey=this._getEditorKey(ui.owner.element);if(this._errorShownFor&&this._errorShownFor!==colKey){return false}},_editorErrorShown:function(evt,ui){var colKey=this._getEditorKey(ui.owner.element);this._errorShownFor=colKey;this._disableDoneButton()},_editorErrorHidden:function(){delete this._errorShownFor;this._enableDoneButton()},_editorTextChanged:function(){if(this._fromExitEditing){delete this._fromExitEditing;return}if(!this.findInvalid()){this._enableDoneButton()}else{this._disableDoneButton()}},_editorKeyDown:function(evt,ui,columnKey){var keyCode=evt.keyCode,rowId,editor=this._editors[columnKey],providerWrapper=editor.data("igEditorFilter"),provider,row=ui.owner.element.closest("tr"),isAdd=row.hasClass("ui-iggrid-addrow")||row.attr("data-new-row");if(!row.length){return}if(providerWrapper){provider=providerWrapper.options.provider}if(keyCode===$.ui.keyCode.ESCAPE){if(this._revertValueForEditor(provider,columnKey)){evt.stopPropagation();return}}if(this.options.editMode==="dialog"){return}rowId=isAdd?null:this._getRowId(row);this._navigateElement(evt,keyCode,row,rowId,columnKey,isAdd)},_stopEditing:function(){if(this.isEditing()){this._endEdit(null,false)}},_paintModifiedCells:function(){var transactions=this.grid.pendingTransactions(),tran,i;for(i=0;i<transactions.length;i++){tran=transactions[i];this._updateUIForTransaction(tran)}},_removeAddRow:function(){this.grid.fixedHeadersTable().children("thead").children("tr[data-add-row='true'],tr[data-new-row='true']").remove();this.grid.headersTable().children("thead").children("tr[data-add-row='true'],tr[data-new-row='true']").remove()},_updateAddNewRow:function(){if(this.grid.hasFixedColumns()){this._updateAddNewRowForTable(true)}this._updateAddNewRowForTable(false)},_updateAddNewRowForTable:function(fixed){var numOfCols,thead,i,j,addRow,newRow,vcols,ihc,layout,colgroup,headerTable;headerTable=fixed?this.grid.fixedHeadersTable():this.grid.headersTable();thead=headerTable.children("thead");this._renderAddNewRow(thead);vcols=$.extend([],this.grid._visibleColumns(fixed));ihc=this.grid._initialHiddenColumns;if(ihc&&ihc.length){for(i=0;i<ihc.length;i++){for(j=0;j<vcols.length;j++){if(ihc[i].key===vcols[j].key){$.ig.removeFromArray(vcols,j,j);break}}}}numOfCols=this.grid._isMultiRowGrid()?this.grid._recordHorizontalSize():vcols.length;addRow=thead.children("tr[data-add-row='true']");addRow.children("td:last").attr("colspan",numOfCols);layout=this.grid._isMultiRowGrid()?this.grid._multiRowLayoutRenderingHelper(fixed):this._generateDummyLayout(vcols);if(($.ig.util.isIE||$.ig.util.isEdge)&&!this.grid._allColumnWidthsInPercentage&&!this.grid._allColumnWidthsInPixels){colgroup=headerTable.find("colgroup").detach();colgroup.prependTo(headerTable)}for(i=0;i<layout.length;i++){newRow=thead.children("tr[data-new-row='true']").eq(i).empty();for(j=0;j<layout[i].length;j++){$("<td></td>").attr("aria-readonly",!!layout[i][j].col.readOnly).attr("aria-describedby",this.grid.id()+"_"+layout[i][j].col.key).attr("colspan",layout[i][j].cs||1).attr("rowspan",layout[i][j].rs||1).appendTo(newRow)}}newRow=thead.children("tr[data-new-row='true']");if(fixed&&this.grid.fixingDirection()==="left"||!fixed&&(this.grid.fixingDirection()!=="left"||!this.grid.hasFixedColumns())){addRow.find("th[data-skip='true'],td[data-skip='true']").remove();newRow.find("th[data-skip='true'],td[data-skip='true']").remove();this.grid._headerInit(addRow,null,true);this.grid._headerInit(newRow,null,true)}},_toggleAddRow:function(){var newRow=this.grid.headersTable().find("tr[data-new-row]"),addRow=this.grid.headersTable().find("tr[data-add-row]"),height;if(this.grid.hasFixedColumns()){newRow=newRow.add(this.grid.fixedHeadersTable().find("tr[data-new-row]"));addRow=addRow.add(this.grid.fixedHeadersTable().find("tr[data-add-row]"))}if(newRow.eq(0).is(":visible")){newRow.hide();addRow.show()}else{height=addRow.height();addRow.hide();newRow.show();newRow.css("height",height)}},_providerForKey:function(key){if(!this._editors){return null}return this._editors[key]||null},_startEditForElement:function(evt,target){var mode=this.options.editMode,td=target.is("td")?target:null,tr=target.is("tr")?target:target.parent(),isAdding=tr.hasClass("ui-iggrid-addrow"),rowId=isAdding?null:this._getRowId(tr),editEnded=true,col;if(mode==="dialog"){if(!td){td=tr.children("td:not([data-skip='true'],[data-parent='true'])").first()}if(!this._isDataCell(td)||!this._isEditableRow(tr)){return false}this._startEditDialog(evt,false,rowId,isAdding,null,td)}else if(mode==="row"||tr.hasClass("ui-iggrid-addrow")){if(!td){td=tr.children("td:not([data-skip='true'],[data-parent='true'])").first()}if(!this._isDataCell(td)||!this._isEditableRow(tr)){return false}if(this.isEditing()){if(this._editingForRowId===rowId){return false}editEnded=this._endEdit(evt,true,false)}return!editEnded?false:this._startEditForRow(evt,false,rowId,null,td)}else if(mode==="cell"){if(!this._isEditableCell(td)){return false}if(this.isEditing()){col=this._getColumnKeyForCell(td);if(rowId===this._editingForRowId&&col&&this._originalValues.hasOwnProperty(col)){return false}editEnded=this._endEdit(evt,true,false)}return!editEnded?false:this._startEditForCell(evt,false,rowId,col,td,true,isAdding)}return false},_startEditDialog:function(evt,suppress,rowId,adding,columnKey,element,at){var dialog=this._renderRowEditDialog(!!this._dialogInvalid),rArgs;rArgs={owner:this,rowAdding:adding,rowID:rowId};if(at!==null&&at!==undefined){dialog.data("at",at);rArgs=$.extend({parentID:at},rArgs)}if(!suppress&&!this._trigger(this.events.editRowStarting,evt,rArgs)){return false}dialog.attr({"data-for-rowid":rowId,"data-isadding":adding});if(!suppress){this._trigger(this.events.rowEditDialogBeforeOpen,evt,{owner:this,dialogElement:dialog})}this._disableDoneButton();if(element&&element.is("td")&&!columnKey){columnKey=this._getColumnKeyForCell(element)}this._columnToFocus=this._chooseColumnToFocus(adding,columnKey);dialog[this.options.dialogWidget]("openModalDialog");return true},_startEditForRow:function(evt,suppress,rowId,columnKey,element){var rowElement,args,editModeStarted=false,colElements,pair,columnToFocus=null,i,allValues,cellValue,isAdding,at;rowElement=this._resolveRowElement(element,rowId);isAdding=rowElement.hasClass("ui-iggrid-addrow");at=this.grid._normalizedKey(rowElement.data("parent-id"));args={owner:this,rowAdding:isAdding,rowID:rowId};if(at!==null&&at!==undefined){args=$.extend({parentID:at},args)}if(!suppress&&!this._trigger(this.events.editRowStarting,evt,args)){return}if(this._gridDirty){rowElement=this._resolveRowElement(isAdding?element:null,rowId);if(!rowElement||!rowElement.length){return}}if(isAdding){rowElement=this._combineRowElements(rowElement);if(!rowElement.attr("data-new-row")){rowElement=rowElement.siblings("[data-new-row]");this._toggleAddRow()}}if(element&&element.is("td")&&!columnKey){columnKey=this._getColumnKeyForCell(element)}if(this.grid._isMultiRowGrid()){columnToFocus=this._chooseColumnToFocusMrl(isAdding,columnKey)}else{columnToFocus=this._chooseColumnToFocus(isAdding,columnKey)}colElements=this._getEditableElementsForRow(rowElement);allValues=isAdding?this._getDefaultValues():this._getLatestValues(rowId);for(i=0;i<colElements.length;i++){pair=colElements[i];cellValue=allValues[pair.colKey]===undefined?null:allValues[pair.colKey];editModeStarted=this._startEditForCell(evt,suppress,rowId,pair.colKey,pair.element,pair.colKey===columnToFocus,isAdding,cellValue)||editModeStarted}if(editModeStarted){if(this.options.showDoneCancelButtons){this._showDoneCancelButtons();this._positionDoneCancelButtons(rowElement);if(isAdding&&!this._anyEditorInvalid()){this._enableDoneButton()}else{this._disableDoneButton()}if(this._renderTouchUI){this._updateTouchButtons(isAdding)}}if(!suppress){this._trigger(this.events.editRowStarted,evt,args);
}this._editingForRowId=isAdding?null:rowId;this._originalValues=$.extend({},allValues,this._originalValues);if(this._selectionMode()==="row"||isAdding){this._selectionToggle(rowElement)}}else{rowElement.children().removeClass(this.css.editingCell);return false}return true},_startEditForCell:function(evt,suppress,rowId,columnKey,element,focus,isAdding,value){var providerWrapper,provider,validator,args,editor,newValue,width,height;columnKey=columnKey||this._getColumnKeyForCell(element);rowId=rowId===null?this._getRowId(element.closest("tr")):rowId;if(element){element.addClass(this.css.editingCell);editor=this.editorForCell(element,true);providerWrapper=this._providerForKey(columnKey);if(providerWrapper){provider=providerWrapper.igEditorFilter("option","provider")}else{return false}height=element.outerHeight();width=element.outerWidth();width=this._isLastScrollableCell(element)?width-this.grid._scrollbarWidth():width}if(value===undefined){value=this._getLatestValues(rowId,columnKey);value=value===undefined?null:value}args={owner:this,rowID:rowId,columnIndex:this.grid.getVisibleIndexByKey(columnKey),columnKey:columnKey,editor:editor,value:value,rowAdding:isAdding};if(!suppress&&!this._trigger(this.events.editCellStarting,evt,args)){if(editor){provider.setValue(null)}element.removeClass(this.css.editingCell);return false}if(editor){providerWrapper.css("z-index",$.ig.getZIndex(this.grid.container())+1);providerWrapper.prependTo(element);provider.setSize(Math.max(8,width),Math.max(10,height));validator=provider.validator();newValue=args.value;provider.setValue(newValue,false,this.grid._calcOffsetForCol(this._origRec,this.grid.columnByKey(columnKey),true))}this._originalValues=this._originalValues||{};this._originalValues[columnKey]=editor&&newValue===value?provider.getValue():value;this._trigger(this.events.editCellStarted,evt,args);if(focus&&editor){this._activateEditor(providerWrapper)}this.hideDeleteButton();this._editingForRowId=rowId;if((this.options.editMode==="cell"||this._selectionMode()==="cell"&&focus)&&!isAdding){this._selectionToggle(element)}return true},_endEditDialog:function(evt,shouldUpdate,dialogContent,suppress){var newValues={},prevValues=this._originalValues,update,colElements,hasInvalid,add=dialogContent.parent().attr("data-isadding")==="true",noCancel,isChanged,rowId=this.grid._fixPKValue(dialogContent.parent().attr("data-for-rowid")),at=this.grid._fixPKValue(dialogContent.parent().data("at"));colElements=this._getEditedColumnElementsForDialog(dialogContent);if(shouldUpdate){hasInvalid=this._handleInvalid(colElements,evt);if(hasInvalid){return false}newValues=this._getNewValuesForRow(colElements);isChanged=this._compareValues(prevValues,newValues);if(add){newValues=$.extend({},prevValues,newValues)}}update={update:shouldUpdate&&(isChanged||add)};if(!suppress){noCancel=this._fireEndingEvents(evt,prevValues,newValues,colElements,rowId,add,update,at);if(!noCancel){return false}}delete this._originalValues;delete this._editingForRowId;if(update.update&&(this._compareValues(prevValues,newValues)||add)){if(add){this._addRow(evt,newValues,prevValues,suppress,at)}else{this._updateRow(prevValues[this.grid.options.primaryKey],newValues,null,null)}}if(!suppress){this._fireEndedEvents(evt,prevValues,newValues,colElements,rowId,add,update,at)}this._hideValidatorMessages();if(at!==null&&at!==undefined){dialogContent.parent().removeData("at")}delete this._fromExitEditing;return true},_endEdit:function(evt,shouldUpdate,suppress,dontToggle){var cell,row,rowId,colKey,colElements,hasInvalid,add,prevValues=this._originalValues,newValues={},isChanged,noCancel=true,update,val,at,self=this;cell=this.grid.container().find("."+this.css.editingCell).filter(function(){var clg=$(this).closest("table").attr("id");return clg===self.grid.element.attr("id")||clg===self.grid.headersTable().attr("id")||clg===self.grid.fixedBodyContainer().children("table").attr("id")||clg===self.grid.fixedHeadersTable().attr("id")}).first();row=cell.closest("tr");at=row.data("parent-id");rowId=this._getRowId(row);row=this._resolveRowElement(cell,rowId);add=!!row.data("new-row");colElements=this._getEditedColumnElementsForRow(row);if(shouldUpdate){hasInvalid=this._handleInvalid(colElements,evt);if(hasInvalid){return false}newValues=this._getNewValuesForRow(colElements);isChanged=this._compareValues(prevValues,newValues);if(add){newValues=$.extend({},prevValues,newValues)}}update={update:shouldUpdate&&(isChanged||add)};if(!suppress){noCancel=this._fireEndingEvents(evt,prevValues,newValues,colElements,rowId,add,update,this.grid._normalizedKey(at));if(!noCancel){return false}}this._closeEditingForRow(colElements);delete this._originalValues;delete this._editingForRowId;if(add){this._toggleAddRow()}if(update.update&&(this._compareValues(prevValues,newValues)||add)){if(add){this._addRow(evt,newValues,prevValues,suppress,at)}else if(this.options.editMode==="cell"){colKey=colElements[0].colKey;cell=colElements[0].element;val=newValues[colKey];this._updateCell(rowId,colKey,val,cell)}else{this._updateRow(rowId,newValues,prevValues,row)}}if(!suppress){this._fireEndedEvents(evt,prevValues,newValues,colElements,rowId,add,update)}this._hideDoneCancelButtons();this._hideValidatorMessages();this._selectionToggle(null,dontToggle);delete this._fromExitEditing;return true},_handleInvalid:function(colElements,evt){var i,key,editor,provider,providerWrapper;for(i=0;i<colElements.length;i++){key=colElements[i].colKey;editor=this._providerForKey(key);providerWrapper=editor.data("igEditorFilter");providerWrapper.options.provider.refreshValue();this._fromExitEditing=true;providerWrapper.exitEditMode();provider=providerWrapper.options.provider;if(editor&&editor.length&&editor.is(":visible")&&(providerWrapper.hasInvalidMessage()||!provider.requestValidate(evt)||!provider.isValid())){this._activateEditor(editor);this._disableDoneButton();return true}}return false},_fireEndingEvents:function(evt,prevValues,newValues,colElements,rowId,add,update,at){var i,colKey,editor,rArg,cArg,mode=this.options.editMode,noCancel;if(mode!=="cell"){rArg={owner:this,oldValues:prevValues,values:update.update?newValues:prevValues,rowID:rowId,update:update.update,rowAdding:add};if(at!==null&&at!==undefined){rArg=$.extend({parentID:at},rArg)}noCancel=this._trigger(this.events.editRowEnding,evt,rArg);if(update.update){update.update=rArg.update}if(!noCancel){return false}}if(mode!=="dialog"){for(i=0;i<colElements.length;i++){colKey=colElements[i].colKey;editor=this.editorForKey(colKey);cArg={owner:this,rowID:rowId,columnIndex:this.grid.getVisibleIndexByKey(colKey),columnKey:colKey,editor:editor,value:newValues.hasOwnProperty(colKey)?newValues[colKey]:prevValues[colKey],oldValue:prevValues[colKey],update:update.update&&newValues[colKey]!==prevValues[colKey],rowAdding:add};noCancel=this._trigger(this.events.editCellEnding,evt,cArg);if(!noCancel&&mode==="cell"){return false}newValues[colKey]=cArg.value;if(mode==="cell"&&!add){update.update=cArg.update}else{if(!cArg.update){newValues[colKey]=prevValues[colKey]}}}}return true},_fireEndedEvents:function(evt,prevValues,newValues,colElements,rowId,add,update,at){var i,colKey,editor,rArg,cArg,mode=this.options.editMode;if(mode!=="dialog"){for(i=0;i<colElements.length;i++){colKey=colElements[i].colKey;editor=this.editorForKey(colKey);cArg={owner:this,rowID:rowId,columnIndex:this.grid.getVisibleIndexByKey(colKey),columnKey:colKey,editor:editor,value:newValues.hasOwnProperty(colKey)?newValues[colKey]:prevValues[colKey],oldValue:prevValues[colKey],update:update.update&&newValues[colKey]!==prevValues[colKey],rowAdding:add};this._trigger(this.events.editCellEnded,evt,cArg)}}if(mode!=="cell"){rArg={owner:this,oldValues:prevValues,values:update.update?newValues:prevValues,rowID:rowId,update:update.update,rowAdding:add};if(at!==null&&at!==undefined){rArg=$.extend({parentID:at},rArg)}this._trigger(this.events.editRowEnded,evt,rArg)}},_getNewValuesForRow:function(colElements){var i,key,editor,provider,providerWrapper,newValues={};for(i=0;i<colElements.length;i++){key=colElements[i].colKey;editor=this._providerForKey(key);providerWrapper=editor.data("igEditorFilter");provider=providerWrapper.options.provider;newValues[key]=provider.getValue()}return newValues},_compareValues:function(prevValues,newValues){var key,noChange=true;for(key in newValues){if(newValues.hasOwnProperty(key)){if($.type(newValues[key])==="date"&&$.type(prevValues[key])==="date"){noChange=noChange&&newValues[key].getTime()===prevValues[key].getTime()}else{noChange=noChange&&newValues[key]===prevValues[key]}}}return!noChange},_closeEditingForRow:function(colElements){var i,colKey,editor,provider,providerWrapper;if($.ig.util.isIE&&document.activeElement){document.activeElement.blur()}for(i=0;i<colElements.length;i++){colKey=colElements[i].colKey;editor=this._providerForKey(colKey);providerWrapper=editor.data("igEditorFilter");provider=providerWrapper.options.provider;providerWrapper.remove();colElements[i].element.closest("td").removeClass(this.css.editingCell)}},_createEditor:function(cell,columnKey,element){var vh=this._validationHandlers,colSetting=this._getColSettingsForCol(columnKey),column=this.grid.columnByKey(columnKey),provider=colSetting?colSetting.editorProvider:null,editorOptions=colSetting?$.extend(true,{},colSetting.editorOptions)||{}:{},editorType=colSetting?colSetting.editorType:null,validatorOptions,required,editorMargins,wrapper,elem,format=column.format,regional=column.regional||this.grid.options.regional,lang=this.grid.options.language;editorMargins=!element?this._getEditorMargins(cell):null;if(colSetting){validatorOptions=editorOptions.validatorOptions;required=colSetting.required;if(!validatorOptions&&(colSetting.validation||required)){validatorOptions={}}if(required){validatorOptions.required=true;editorOptions.required=true}}if(!validatorOptions&&this.options.validation){validatorOptions={};if(!editorOptions){editorOptions={}}}if(validatorOptions){if(!this.grid.element.igValidator){throw new Error(this._getLocaleValue("igValidatorException"))}if(colSetting&&!colSetting.editorOptions){colSetting.editorOptions=editorOptions}editorOptions.validatorOptions=validatorOptions;validatorOptions.notificationOptions=validatorOptions.notificationOptions||{};if(!element){validatorOptions.notificationOptions.mode="popover";validatorOptions.notificationOptions.containment=this.grid.container();validatorOptions.notificationOptions.appendTo=this.grid.container()}if(validatorOptions.notificationOptions.mode==="popover"&&element){validatorOptions.notificationOptions.containment=$(element.context);validatorOptions.notificationOptions.appendTo=$(element.context)}}if(!provider){provider=$.ig.GetEditorProvider(this.grid,column,editorType)}editorOptions.language=lang;editorOptions.regional=regional;elem=provider.createEditor(this._editorCallbacks,columnKey,editorOptions?editorOptions||null:null,this._getNextTabIndex(),format,element,this.grid._calcOffsetForCol(null,column,true));provider.attachErrorEvents(vh.errorShowing,vh.errorShown,vh.errorHidden);if(!element){elem.addClass(this.css.editor).css({marginLeft:editorMargins.x+"px",marginTop:editorMargins.y+"px"});elem.css("position","absolute")}wrapper=elem.igEditorFilter({provider:provider});return wrapper},_getEditorKey:function(element){var id=element.attr("id"),colKey,idx;if(id&&id.length){idx=id.indexOf("_editorfor_");colKey=idx>0?id.substring(idx+10):null}if(!colKey){colKey=this._getColumnKeyForCell(element.closest("td"))}return colKey},_getEditorMargins:function(cell){if(!cell||!cell.length){return{x:0,y:0}}if(!this._editorMargins){var btw=parseInt(cell.css("borderTopWidth"),10);var paddingTop=parseInt(cell.css("paddingTop"),10);var blw=parseInt(cell.css("borderLeftWidth"),10);var paddingLeft=parseInt(cell.css("paddingLeft"),10);this._editorMargins={x:-1*(paddingLeft+blw),y:-1*(paddingTop+btw)}}return this._editorMargins},_getColSettingsForCol:function(colKey){var i,settings=this.options.columnSettings;if(!settings){return null}for(i=0;i<settings.length;i++){if(settings[i].columnKey===colKey){return settings[i]}}},_destroyAllEditors:function(){var key;for(key in this._editors){if(this._editors.hasOwnProperty(key)){if(this._editors[key].data("igEditorFilter")){this._editors[key].igEditorFilter("destroy");this._editors[key].remove()}}}delete this._editors},_navigateElement:function(evt,keyCode,row,rowId,columnKey,isAdd){if(keyCode===$.ui.keyCode.TAB||this.options.horizontalMoveOnEnter&&keyCode===$.ui.keyCode.ENTER){if(evt.shiftKey){return this._navigateLeft(evt,row,rowId,columnKey,isAdd)}return this._navigateRight(evt,row,rowId,columnKey,isAdd)}if(keyCode===$.ui.keyCode.ENTER){if(isAdd){return this._endEdit(evt,true,false)}if(evt.shiftKey){return this._navigateUp(evt,rowId,columnKey)}return this._navigateDown(evt,rowId,columnKey)}if(keyCode===$.ui.keyCode.ESCAPE){return this._stopEditing()}if(this.options.excelNavigationMode){switch(keyCode){case $.ui.keyCode.LEFT:return this._navigateLeft(evt,row,rowId,columnKey,isAdd);case $.ui.keyCode.RIGHT:return this._navigateRight(evt,row,rowId,columnKey,isAdd);case $.ui.keyCode.DOWN:if(!isAdd){return this._navigateDown(evt,rowId,columnKey)}break;case $.ui.keyCode.UP:if(!isAdd){return this._navigateUp(evt,rowId,columnKey)}break}}},_navigateLeft:function(evt,row,rowId,columnKey,isAdd){if(!isAdd&&this.options.editMode==="cell"){if(this.grid._isMultiRowGrid()){return this._navigateLeftForMultiCell(evt,rowId,columnKey)}return this._navigateLeftForCell(evt,rowId,columnKey)}if(this.grid._isMultiRowGrid()){return this._navigateLeftForMultiRow(evt,row,rowId,columnKey,isAdd)}return this._navigateLeftForRow(evt,row,rowId,columnKey,isAdd)},_navigateLeftForRow:function(evt,row,rowId,columnKey,isAdd){var i,prevRow,prevCell,pairs=this._getEditedColumnElementsForRow(row),db,wrap=this.options.wrapAround&&!this.grid.options.virtualization&&!this.grid.options.rowVirtualization;for(i=0;i<pairs.length;i++){if(pairs[i].colKey===columnKey){break}}if(i===0){if(this.options.showDoneCancelButtons){db=$("#"+this.grid.id()+"_updating_done");if(db.hasClass(this.css.buttonDisabled)){db.siblings().first().focus()}else{db.focus()}return}if(!this._endEdit(evt,true,false)||isAdd){return}row=this.grid.rowById(rowId);prevRow=this._nextEditableDataRow(row,"prev");if(!prevRow.length&&wrap){prevRow=this._lastEditableDataRow()}if(!prevRow.length){return}prevCell=this._getEditableCellsForRow(prevRow).last();this._startEditForRow(evt,false,this._getRowId(prevRow),this._getColumnKeyForCell(prevCell),prevCell);evt.preventDefault()}else if(this.grid.columnByKey(pairs[i].colKey).fixed!==this.grid.columnByKey(columnKey).fixed){this._activateEditor(this._providerForKey(pairs[i-1].colKey))}else{this._scrollTo(pairs[i-1].element)}},_navigateLeftForCell:function(evt,rowId,columnKey){var i,cols=this.grid._visibleColumns(),nextCell,curRow,wrap=this.options.wrapAround&&!this.grid.options.virtualization&&!this.grid.options.rowVirtualization;curRow=this.grid.rowById(rowId);if(!this._endEdit(evt,true,false,true)){return}if(!$.contains(document.documentElement,curRow[0])){curRow=this.grid.rowById(rowId)}for(i=0;i<cols.length;i++){if(cols[i].key===columnKey){break}}while(curRow.length){rowId=this._getRowId(curRow);while(--i>=0){if(!cols[i].readOnly){nextCell=this.grid.cellById(rowId,cols[i].key);if(nextCell.css("display")==="none"){continue}this._startEditForCell(evt,false,rowId,cols[i].key,nextCell,true,false);evt.preventDefault();return}}curRow=this._nextEditableDataRow(curRow,"prev");if(!curRow.length&&wrap){curRow=this._lastEditableDataRow()}i=cols.length}},_navigateLeftForMultiRow:function(evt,row,rowId,columnKey,isAdd){var ni=this.grid.columnByKey(columnKey).navigationIndex,i,db,prevRow,prevCell,wrap=this.options.wrapAround&&!this.grid.options.virtualization&&!this.grid.options.rowVirtualization,cols=this._getColumnsOrderedByNavIndex();evt.preventDefault();for(i=0;i<cols.length;i++){if(cols[i].navigationIndex===ni){break}}if(i===0){if(this.options.showDoneCancelButtons){db=$("#"+this.grid.id()+"_updating_cancel");db.focus();return}if(!this._endEdit(evt,true,false)||isAdd){return}if(row.length){row=this._resolveRowElement(null,this._getRowId(row))}prevRow=this._nextEditableDataRow(row,"prev");if(!prevRow.length&&wrap){prevRow=this._lastEditableDataRow()}if(!prevRow.length){return}prevCell=prevRow.children("td[data-navindex='"+cols[cols.length-1].navigationIndex+"']");this._startEditForRow(evt,false,this._getRowId(prevRow),this._getColumnKeyForCell(prevCell),prevCell)}else{this._activateEditor(this._providerForKey(cols[i-1].key))}},_navigateLeftForMultiCell:function(evt,rowId,columnKey){var i,cols=this._getColumnsOrderedByNavIndex(),nextCell,curRow,ni,ncol,wrap=this.options.wrapAround&&!this.grid.options.virtualization&&!this.grid.options.rowVirtualization;curRow=this.grid.rowById(rowId);if(!this._endEdit(evt,true,false,true)){return}if(!$.contains(document.documentElement,curRow[0])){curRow=this.grid.rowById(rowId)}for(i=0;i<cols.length;i++){if(cols[i].key===columnKey){break}}ni=cols[i].navigationIndex;while(curRow.length){rowId=this._getRowId(curRow);while(--ni>=0){ncol=this._getColumnByNavigationIndex(ni);if(!ncol.readOnly){nextCell=this.grid.cellById(rowId,ncol.key);this._startEditForCell(evt,false,rowId,ncol.key,nextCell,true,false);evt.preventDefault();return}}curRow=this._nextEditableDataRow(curRow,"prev");if(!curRow.length&&wrap){curRow=this._lastEditableDataRow()}ni=this.grid.options.columns.length}},_navigateRight:function(evt,row,rowId,columnKey,isAdd){if(!isAdd&&this.options.editMode==="cell"){if(this.grid._isMultiRowGrid()){return this._navigateRightForMultiCell(evt,rowId,columnKey)}return this._navigateRightForCell(evt,rowId,columnKey)}if(this.grid._isMultiRowGrid()){return this._navigateRightForMultiRow(evt,row,rowId,columnKey,isAdd)}return this._navigateRightForRow(evt,row,rowId,columnKey,isAdd)},_navigateRightForCell:function(evt,rowId,columnKey){var i,cols=this.grid._visibleColumns(),nextCell,curRow,wrap=this.options.wrapAround&&!this.grid.options.virtualization&&!this.grid.options.rowVirtualization;curRow=this.grid.rowById(rowId);if(!this._endEdit(evt,true,false,true)){return}if(!$.contains(document.documentElement,curRow[0])){curRow=this.grid.rowById(rowId)}for(i=0;i<cols.length;i++){if(cols[i].key===columnKey){break}}while(curRow.length){rowId=this._getRowId(curRow);while(++i<cols.length){if(!cols[i].readOnly){nextCell=this.grid.cellById(rowId,cols[i].key);if(nextCell.css("display")==="none"){continue}this._startEditForCell(evt,false,rowId,cols[i].key,nextCell,true,false);evt.preventDefault();return}}curRow=this._nextEditableDataRow(curRow,"next");if(!curRow.length&&wrap){curRow=this._firstEditableDataRow()}i=-1}},_navigateRightForRow:function(evt,row,rowId,columnKey,isAdd){var i,nextRow,nextCell,pairs=this._getEditedColumnElementsForRow(row),wrap=this.options.wrapAround&&!this.grid.options.virtualization&&!this.grid.options.rowVirtualization;for(i=0;i<pairs.length;i++){if(pairs[i].colKey===columnKey){break}}if(i===pairs.length-1){if(this.options.showDoneCancelButtons){return}if(!this._endEdit(evt,true,false)||isAdd){return}row=this.grid.rowById(rowId);nextRow=this._nextEditableDataRow(row,"next");if(!nextRow.length&&wrap){nextRow=this._firstEditableDataRow()}if(!nextRow.length){return}nextCell=this._getEditableCellsForRow(nextRow).first();this._startEditForRow(evt,false,this._getRowId(nextRow),this._getColumnKeyForCell(nextCell),nextCell);evt.preventDefault()}else if(this.grid.columnByKey(pairs[i].colKey).fixed!==this.grid.columnByKey(columnKey).fixed){this._activateEditor(this._providerForKey(pairs[i+1].colKey))}else{this._scrollTo(pairs[i+1].element)}},_navigateRightForMultiRow:function(evt,row,rowId,columnKey,isAdd){var ni=this.grid.columnByKey(columnKey).navigationIndex,i,db,nextRow,nextCell,wrap=this.options.wrapAround&&!this.grid.options.virtualization&&!this.grid.options.rowVirtualization,cols=this._getColumnsOrderedByNavIndex();evt.preventDefault();for(i=0;i<cols.length;i++){if(cols[i].navigationIndex===ni){break}}evt.preventDefault();if(i===cols.length-1){if(this.options.showDoneCancelButtons){db=$("#"+this.grid.id()+"_updating_done");if(db.hasClass(this.css.buttonDisabled)){db.siblings().first().focus()}else{db.focus()}return}if(!this._endEdit(evt,true,false)||isAdd){return}if(row.length){row=this._resolveRowElement(null,this._getRowId(row))}nextRow=this._nextEditableDataRow(row,"next");if(!nextRow.length&&wrap){nextRow=this._firstEditableDataRow()}if(!nextRow.length){return}nextCell=nextRow.children("td[data-navindex='"+cols[0].navigationIndex+"']");this._startEditForRow(evt,false,this._getRowId(nextRow),this._getColumnKeyForCell(nextCell),nextCell)}else{this._activateEditor(this._providerForKey(cols[i+1].key))}},_navigateRightForMultiCell:function(evt,rowId,columnKey){var i,cols=this._getColumnsOrderedByNavIndex(),nextCell,curRow,ni,ncol,wrap=this.options.wrapAround&&!this.grid.options.virtualization&&!this.grid.options.rowVirtualization;curRow=this.grid.rowById(rowId);if(!this._endEdit(evt,true,false,true)){return}if(!$.contains(document.documentElement,curRow[0])){curRow=this.grid.rowById(rowId)}for(i=0;i<cols.length;i++){if(cols[i].key===columnKey){break}}ni=cols[i].navigationIndex;while(curRow.length){rowId=this._getRowId(curRow);while(++ni<this.grid.options.columns.length){ncol=this._getColumnByNavigationIndex(ni);if(!ncol.readOnly){nextCell=this.grid.cellById(rowId,ncol.key);this._startEditForCell(evt,false,rowId,ncol.key,nextCell,true,false);evt.preventDefault();return}}curRow=this._nextEditableDataRow(curRow,"next");if(!curRow.length&&wrap){curRow=this._firstEditableDataRow()}ni=-1}},_navigateUp:function(evt,rowId,columnKey){var nextCell,curRow,wrap;wrap=this.options.wrapAround&&!this.grid.options.virtualization&&!this.grid.options.rowVirtualization;evt.preventDefault();evt.stopPropagation();if(!this._endEdit(evt,true,false,true)){return}curRow=this._nextEditableDataRow(this.grid.rowById(rowId),"prev");if(!curRow.length&&wrap){curRow=this._lastEditableDataRow()}if(curRow.length){rowId=this._getRowId(curRow);nextCell=this.grid.cellById(rowId,columnKey);if(this.options.editMode==="row"&&nextCell.css("display")!=="none"){this._startEditForRow(evt,false,rowId,columnKey,nextCell)}else{this._startEditForCell(evt,false,rowId,columnKey,nextCell,true,false)}evt.originalEvent.stopPropagation();evt.originalEvent.preventDefault()}},_navigateDown:function(evt,rowId,columnKey){var nextCell,curRow,wrap;wrap=this.options.wrapAround&&!this.grid.options.virtualization&&!this.grid.options.rowVirtualization;evt.preventDefault();evt.stopPropagation();if(!this._endEdit(evt,true,false,true)){return}curRow=this._nextEditableDataRow(this.grid.rowById(rowId),"next");if(!curRow.length&&wrap){curRow=this._firstEditableDataRow()}if(curRow.length){rowId=this._getRowId(curRow);nextCell=this.grid.cellById(rowId,columnKey);if(this.options.editMode==="row"&&nextCell.css("display")!=="none"){this._startEditForRow(evt,false,rowId,columnKey,nextCell)}else{this._startEditForCell(evt,false,rowId,columnKey,nextCell,true,false)}evt.originalEvent.stopPropagation();evt.originalEvent.preventDefault()}},_nextEditableDataRow:function(row,command){var go=this.grid.options,vVirt=go.virtualization||go.rowVirtualization,cIdx,query=":not([data-container],[data-grouprow],[data-summaryrow],"+".ui-iggrid-deletedrecord,[data-id='"+row.attr("data-id")+"']):visible:first";if(vVirt){if(go.virtualizationMode==="fixed"){cIdx=row.index();if(cIdx>=this.grid._virtualRowCount-1&&command==="next"){this._scrollVmanual(true);return this._lastEditableDataRow()}if(cIdx<=0&&command==="prev"){this._scrollVmanual(false);return this._firstEditableDataRow()}}}row=row[command+"All"](query);if(row.length){row=this._resolveRowElement(null,this._getRowId(row))}if(vVirt&&go.virtualizationMode==="continuous"){this._setScroll(command==="next"?$.ui.keyCode.DOWN:$.ui.keyCode.UP,row)}return row},_firstEditableDataRow:function(){return this.element.children("tbody").children("tr:not([data-grouprow],[data-summaryrow],.ui-iggrid-deletedrecord):visible:first")},_lastEditableDataRow:function(){return this.element.children("tbody").children("tr:not([data-container],.ui-iggrid-deletedrecord):visible:last")},_updateUnboundValuesForRow:function(row){if(!this.grid._hasUnboundColumns){return}var i,uc=this.grid._unboundColumns,col,f,dataRec,key=row[this.grid.options.primaryKey],ind;if(!uc||!uc.length){return}for(i=0;i<uc.length;i++){col=uc[i];if(col&&col.editModeUnboundValues!=="manual"&&col.formula){if(col.formula){f=this.grid._getUnboundColumnFormula(col);if(f){row[col.key]=f.apply(col,[row,this.grid.element]);dataRec=this.grid.findRecordByKey(key);if(!dataRec){return}ind=this.grid.dataSource.data().indexOf(dataRec);dataRec[col.key]=f.apply(col,[dataRec,this.grid.element]);this.grid._addUnboundColumnValue(col.key,row[col.key],ind)}}}}},_isEditableRow:function(row){var targetGrid=row.closest(this.grid._isMultiRowGrid()?".ui-iggrid-table-mrl,.ui-iggrid-headertable-mrl":".ui-iggrid-table,.ui-iggrid-headertable"),re=new RegExp("^"+this.grid.id()+"(_headers)?(_fixed)?$");return row&&row.is("tr")&&!row.hasClass(this.grid.css.deletedRecord)&&!row.attr("data-grouprow")&&!row.attr("data-summaryrow")&&(row.attr("data-id")!==undefined||row.attr("data-add-row")!==undefined)&&targetGrid.length&&targetGrid.attr("id").match(re)},_isEditableCell:function(cell){return this._isDataCell(cell)&&cell.attr("aria-readonly")!=="true"&&this._isEditableRow(cell.parent())},_isDataCell:function(cell){return cell&&cell.is("td")&&!cell.attr("data-skip")&&!cell.attr("data-parent")},_isLastScrollableCell:function(cell){return cell&&cell.is(":last-child")&&(parseInt(cell.css("padding-right"),10)>12||this.grid._hscrollbar().is(":visible")&&this.grid._hasVerticalScrollbar)&&this.grid.scrollContainer()&&this.grid.scrollContainer().has(cell).length},_selectionToggle:function(element,dontToggle){var sel=this.grid.element.data("igGridSelection");if(!sel){return}sel._suspend=!sel._suspend;if(element||dontToggle){this._actElement=element}else{this._actElement.focus()}},_selectionMode:function(){var sel=this.grid.element.data("igGridSelection");if(!sel){return null}return this.grid.element.data("igGridSelection").options.mode},_showDoneCancelButtons:function(){var container=this._findElementInScrollContainer(".ui-iggrid-buttoncontainer:first");if(!container.length){container=this._renderDoneCancelButtons()}container.show()},_hideDoneCancelButtons:function(){var container=this._findElementInScrollContainer(".ui-iggrid-buttoncontainer:first");if(container.length){container.hide()}},_positionDoneCancelButtons:function(row){var container=this._findElementInScrollContainer(".ui-iggrid-buttoncontainer:first"),sbw=this.grid._hasVerticalScrollbar===true?this.grid._scrollbarWidth():0,left,top,sc,contHeight,scHeight,rowPos,go=this.grid.options,v,hasHeight=go.height!==null&&go.height!==undefined,scrContainer;row=this._combineRowElements(row);sc=container.parent();left=sc.outerWidth()-container.outerWidth()-sbw+sc.scrollLeft();if(!sc.has(row).length&&sc[0]!==this.grid.container()[0]){top=sc.scrollTop()}else{contHeight=container.outerHeight();scHeight=sc.outerHeight();rowPos=row.last().igPosition();top=rowPos.top+row.outerHeight();if(top+contHeight>scHeight){top=row.first().igPosition().top-contHeight}if(!hasHeight){v=go.virtualization||go.rowVirtualization||go.columnVirtualization;scrContainer=v?this.grid._vdisplaycontainer():this.grid.scrollContainer();if(scrContainer.length){top+=scrContainer.igPosition().top}}top+=sc.scrollTop()}container.css({top:top,left:left})},_disableDoneButton:function(){if(this.options.editMode==="dialog"){$("#"+this.grid.id()+"_updating_dialog_container")[this.options.dialogWidget]("option","buttonApplyDisabled",true)}else{$("#"+this.grid.id()+"_updating_done").addClass(this.css.buttonDisabled).removeClass(this.css.buttonActive).attr("tabIndex",-1)}},_enableDoneButton:function(){if(this.options.editMode==="dialog"){$("#"+this.grid.id()+"_updating_dialog_container")[this.options.dialogWidget]("option","buttonApplyDisabled",false)}else{$("#"+this.grid.id()+"_updating_done").removeClass(this.css.buttonDisabled).attr("tabIndex",this._getNextTabIndex()+1)}},_updateTouchButtons:function(isAdding){var button=$("#"+this.grid.id()+"_updating_delete_touch");if(button.length){if(isAdding||!this.options.enableDeleteRow){button.addClass(this.css.buttonDisabled)}else{button.removeClass(this.css.buttonDisabled)}}},showDeleteButtonFor:function(row){var db=$("#"+this.grid.id()+"_updating_deletehover"),go=this.grid.options,v,hasHeight=go.height!==null&&go.height!==undefined,sbw=this.grid.hasVerticalScrollbar()===true?this.grid._scrollbarWidth():0,left,top,sc,offset=0,scrContainer,totalHeight,rowGrp=row.siblings("[data-id='"+row.attr("data-id")+"']").add(row);if(db.length){db.show();sc=db.parent();if(!hasHeight){v=go.virtualization||go.rowVirtualization||go.columnVirtualization;scrContainer=v?this.grid._vdisplaycontainer():this.grid.scrollContainer();if(scrContainer.length){offset=scrContainer.igPosition().top}}totalHeight=rowGrp.last().igPosition().top+rowGrp.last().outerHeight()-rowGrp.first().igPosition().top;left=sc.outerWidth()-db.outerWidth()-sbw+sc.scrollLeft()-5;top=rowGrp.first().igPosition().top+totalHeight/2-db.outerHeight()/2+sc.scrollTop()+offset;db.css({top:top,left:left});db.data("button-for",this._getRowId(row))}},hideDeleteButton:function(){var db=$("#"+this.grid.id()+"_updating_deletehover");if(db.length){db.hide()}},_getNextTabIndex:function(){var gti=this.grid.options.tabIndex;return gti+1},_getRowId:function(element){return this.grid._fixPKValue(element.attr("data-id"))},_getEditableElementsForRow:function(row){var result=[],i,cells=this._getEditableCellsForRow(row),editableCols=this._getEditableColsOrdered(),vcc=this.grid.hasFixedColumns()?this.grid._visibleColumns().length:this.grid._virtualColumnCount||this.grid._visibleColumns().length,vci=this.grid._startColIndex||0;for(i=0;i<editableCols.length;i++){result.push({colKey:editableCols[i].key,element:i>=vci&&i<vci+vcc?cells.eq(i-vci):null})}return result},_getEditableColsOrdered:function(){var ec,i,j;if(this.grid._isMultiRowGrid()){if(this._ec){return this._ec}ec=[];for(i=0;i<this.grid._rlp.length;i++){for(j=0;j<this.grid._rlp[i].length;j++){if(!this.grid._rlp[i][j].col.readOnly){ec.push(this.grid._rlp[i][j].col)}}}this._ec=ec;return ec}return $.grep(this.grid._visibleColumns(),function(col){return!col.readOnly})},_getColumnsOrderedByNavIndex:function(){var rwCols=$.extend(true,[],this._getEditableColsOrdered());rwCols.sort(function(a,b){return a.navigationIndex-b.navigationIndex});return rwCols},_getColumnByNavigationIndex:function(navIdx){var i;for(i=0;i<this.grid.options.columns.length;i++){if(this.grid.options.columns[i].navigationIndex===navIdx){return this.grid.options.columns[i]}}},_getEditedColumnElementsForRow:function(row){var result=[],cells,i;cells=this._getEditableCellsForRow(row).filter("."+this.css.editingCell);for(i=0;i<cells.length;i++){result.push({colKey:this._getColumnKeyForCell(cells.eq(i)),element:cells.eq(i)})}return result},_getEditedColumnElementsForDialog:function(content){var result=[],cols=this.grid.options.columns,i,key,element;for(i=0;i<cols.length;i++){key=cols[i].key;element=content.find("[data-editor-for-"+key.toLowerCase()+"]");if(element.length===1){result.push({colKey:key,element:element})}}return result},_getEditableCellsForRow:function(row){return this._combineRowElements(row).children("td[aria-readonly='false']:not([data-skip='true'],[data-parent])")},_combineRowElements:function(row){var frow,urow,fixingDir=this.grid.fixingDirection(),type=row.attr("data-new-row")?"[data-new-row]":"[data-add-row]";if(this.grid.hasFixedColumns()){if(this.grid._isFixedElement(row)){frow=row;urow=row.parent().is("thead")?this.grid.headersTable().children("thead").children("tr"+type):this._getRowByIndex(this._getIndexForRow(row),false);
}else{urow=row;frow=row.parent().is("thead")?this.grid.fixedHeadersTable().children("thead").children("tr"+type):this._getRowByIndex(this._getIndexForRow(row),true)}return fixingDir==="left"?$([frow[0],urow[0]]):$([urow[0],frow[0]])}return row},_getVisibleIndexForKey:function(columnKey){var vc=this.grid._visibleColumns(),i;for(i=0;i<vc.length;i++){if(vc[i].key===columnKey){return i}}return null},_getRowByIndex:function(index,fixed){var tbody=fixed?this.grid.fixedBodyContainer().find("tbody"):this.grid.element.find("tbody");return tbody.children("tr:not([data-container])").eq(index-(this.grid._startRowIndex||0))},_getIndexForRow:function(row){return row.closest("tbody").children("tr:not([data-container])").index(row)+(this.grid._startRowIndex||0)},_getColumnKeyForCell:function(cell){var col=this.grid.getColumnByTD(cell);return col?col.column.key:null},_analyzeEditTriggers:function(){var trg=this.options.startEditTriggers,key;this._editTriggers={click:false,dblclick:false,f2:false,enter:false};for(key in this._editTriggers){if(this._editTriggers.hasOwnProperty(key)){if($.type(trg)==="array"){this._editTriggers[key]=$.inArray(key,trg)}else{this._editTriggers[key]=trg.toLowerCase().indexOf(key)>=0}}}},_rebindEditTriggers:function(){var selector="#"+this.grid.id()+">tbody>tr>td,#"+this.grid.id()+"_fixed>tbody>tr>td",hId,scr,v,go=this.grid.options;if(this.options.enableAddRow&&go.showHeader){hId=this.grid.headersTable().attr("id");selector+=",#"+hId+">thead>tr.ui-iggrid-addrow,#"+hId+"_fixed>thead>tr.ui-iggrid-addrow"}this.grid.container().off(".triggers");this.grid.container().on({"mousedown.triggers":this._handlers.mouseDown,"touchstart.triggers":this._handlers.mouseDown},selector);if(this._editTriggers.dblclick){this.grid.container().on({"dblclick.triggers":this._handlers.clickTrigger},selector)}else if(this._editTriggers.click){this.grid.container().on({"click.triggers":this._handlers.clickTrigger},selector)}this.grid.container().on({"keydown.triggers":this._handlers.keyDown},selector.replace(/>td/g,""));if(this.options.enableDeleteRow){this._renderDeleteButton()}v=go.virtualization||go.rowVirtualization||go.columnVirtualization;scr=v?this.grid._vdisplaycontainer():this.grid.scrollContainer();if(scr&&scr.length){scr.unbind("scroll",this._handlers.scroll).bind("scroll",this._handlers.scroll)}},_getLatestValues:function(id,columnKey){var original,record,transactions,i,notNew=false;original=this.grid.dataSource.findRecordByKey(id);record=$.extend(true,{},original);transactions=this.grid.dataSource.pendingTransactions();for(i=0;i<transactions.length;i++){if(transactions[i].rowId===id){switch(transactions[i].type){case"row":case"newrow":case"insertnode":$.extend(true,record,transactions[i].row);break;case"cell":record[transactions[i].col]=transactions[i].value;break;case"deleterow":record=null;break}notNew=true}}if(original||notNew){this._origRec=record;return $.type(columnKey)==="string"?record[columnKey]:record}throw new Error(this._getLocaleValue("recordOrPropertyNotFoundException"))},_getDefaultValues:function(columnKey){var defVals=this._defaultValues,allValues,settings=this.options.columnSettings,i,gpkArgs;if(!defVals){defVals={};for(i=0;i<settings.length;i++){if(settings[i].defaultValue!==undefined&&$.type(settings[i].columnKey)==="string"){defVals[settings[i].columnKey]=settings[i].defaultValue}}this._defaultValues=defVals}allValues=$.extend(true,{},defVals);if((!columnKey||columnKey===this.grid.options.primaryKey)&&!defVals.hasOwnProperty(columnKey)){gpkArgs={owner:this};if(this._getPKType()==="string"){gpkArgs.value=String(this._pkVal)}else{gpkArgs.value=this._pkVal}this._trigger(this.events.generatePrimaryKeyValue,null,gpkArgs);allValues[this.grid.options.primaryKey]=gpkArgs.value}return columnKey?allValues[columnKey]:allValues},_getPKType:function(){var pk=this.grid.options.primaryKey,pkType,pkColumn,data=this.grid.dataSource._data;if(!this._pkt){if(!pk){throw new Error(this._getLocaleValue("noPrimaryKeyException"))}pkColumn=this.grid.columnByKey(pk);if(pkColumn&&pkColumn.dataType){pkType=pkColumn.dataType}else{pkType=data&&data.length>0&&data[0][pk]!==null&&data[0][pk]!==undefined?$.type(data[0][pk]):null}this._pkt=pkType}return this._pkt},_updateUIForTransaction:function(t,element){var go=this.grid.options,autoCommit=go.autoCommit,v=go.virtualization||go.rowVirtualization||go.columnVirtualization,fv=go.virtualizationMode==="fixed",row,vals,pk,groupBy,grp,idx,nextRow,rowHeight,dataRows;switch(t.type){case"newrow":if(this.grid.element.children("tbody").children("tr."+this.grid.css.modifiedRecord+"[data-id='"+t.rowId+"']").length){return}groupBy=this.grid.element.data("igGridGroupBy");grp=groupBy&&groupBy.options&&groupBy.options.groupedColumns&&groupBy.options.groupedColumns.length>0;this._updateUnboundValuesForRow(t.row);if(v&&!autoCommit){break}if(grp){this.grid.element.data("igGridGroupBy")._renderNewRow(t.row,t.rowId)}else{this.grid.renderNewRow(t.row,t.rowId)}this.grid._updateGridContentWidth();row=this.grid.rowById(t.rowId);if(!autoCommit&&row.length){this._combineRowElements(row).addClass(this.grid.css.modifiedRecord)}break;case"cell":pk=autoCommit&&t.col===go.primaryKey?t.value:t.rowId;if(element){row=element.parent();row=row.siblings("[data-id='"+row.attr("data-id")+"']").add(row)}else{row=this.grid.rowById(t.rowId)}vals=this._getLatestValues(pk);vals[t.col]=t.value;this._updateUnboundValuesForRow(vals);if(!row||!row.length){break}rowHeight=row.height();this.grid._renderRow(vals,row);if(autoCommit&&v&&rowHeight!==row.height()){this._updateRowVirtualization(row,fv,t.type)}if(!autoCommit){this._combineRowElements(row).addClass(this.grid.css.modifiedRecord)}else{this._combineRowElements(row).attr("data-id",pk).data("id",pk)}break;case"row":pk=autoCommit&&t.row.hasOwnProperty(go.primaryKey)?t.row[go.primaryKey]:t.rowId;row=element||this.grid.rowById(pk);vals=$.extend({},this._getLatestValues(pk),t.row);this._updateUnboundValuesForRow(vals);if(!row||!row.length){break}rowHeight=row.height();this.grid._renderRow(vals,row);if(autoCommit&&v&&rowHeight!==row.height()){this._updateRowVirtualization(row,fv,t.type)}if(!autoCommit){this._combineRowElements(row).addClass(this.grid.css.modifiedRecord)}else{this._combineRowElements(row).attr("data-id",pk).data("id",pk)}break;case"deleterow":row=element||this.grid.rowById(t.rowId);if(autoCommit&&v){this._updateRowVirtualization(row,fv,t.type);this._notifyRowDeleted(t.rowId,row);break}if(!row||!row.length){if(autoCommit){this._notifyRowDeleted(t.rowId,row)}break}if(autoCommit){dataRows=this.grid.element.children("tbody").children("tr:not([data-container],[data-grouprow],[data-summaryrow])");idx=dataRows.index(row);row=this._combineRowElements(row);nextRow=row.next("tr[data-container='true']");if(nextRow.length===1){nextRow.remove()}row.remove();this.grid._reapplyZebraStyle(idx);this.grid._updateGridContentWidth();this._notifyRowDeleted(t.rowId,row)}else{this._combineRowElements(row).addClass(this.grid.css.deletedRecord)}break}return row},_processReadOnly:function(){var i,col,cols=this.grid.options.columns,colSettings=this.options.columnSettings;delete this._ec;for(i=0;i<cols.length;i++){delete cols[i].readOnly}if(colSettings){for(i=0;i<colSettings.length;i++){col=this.grid.columnByKey(colSettings[i].columnKey);if(col&&col.readOnly!==colSettings[i].readOnly){col.readOnly=colSettings[i].readOnly}}}},_isMultiLineText:function(key){var cs=this._getColSettingsForCol(key);if(cs&&cs.editorOptions){return cs.editorOptions.textMode==="multiline"}return false},_anyEditorInvalid:function(){var key,all=this._editors,provider;for(key in all){if(all.hasOwnProperty(key)&&all[key]){provider=all[key].data("igEditorFilter").options.provider;provider.refreshValue();if(!all[key].data("igEditorFilter").options.provider.validate()){return true}}}return false},_revertValueForEditor:function(provider,columnKey){var oval,nval,ac,hf;provider.refreshValue();nval=provider.getValue();oval=this._originalValues[columnKey];hf=$.type(provider.editor.field)==="function";if(hf){ac=provider.editor.field().attr("autocomplete");provider.editor.field().attr("autocomplete","off")}if($.type(nval)==="date"&&$.type(oval)==="date"){if(nval.getTime()!==oval.getTime()){provider.setValue(new Date(oval.getTime()),true);if(hf){if(ac){provider.editor.field().removeAttr("autocomplete")}else{provider.editor.field().attr("autocomplete",ac)}}return true}}else if(oval!==nval){provider.setValue(oval,true);if(hf){if(ac){provider.editor.field().removeAttr("autocomplete")}else{provider.editor.field().attr("autocomplete",ac)}}return true}if(hf){if(ac){provider.editor.field().removeAttr("autocomplete")}else{provider.editor.field().attr("autocomplete",ac)}}return false},_hideValidatorMessages:function(){var key,e=this._editors,wrapper,validator;for(key in e){if(e.hasOwnProperty(key)){wrapper=this._providerForKey(key).data("igEditorFilter");if(wrapper&&wrapper.hasInvalidMessage()){validator=wrapper.options.provider.validator();if(validator){validator.hide()}}}}},_chooseColumnToFocus:function(isAdding,initialKey){var defaultIndex,i,columnToFocus,visibleCols=this.grid._visibleColumns(),vcc=this.grid._virtualColumnCount||visibleCols.length,vci=this.grid._startColIndex||0;defaultIndex=isAdding?0:this._getVisibleIndexForKey(initialKey);defaultIndex=Math.min(Math.max(vci,defaultIndex),vci+vcc-1);if(!initialKey){defaultIndex--}if(initialKey&&!this.grid.columnByKey(initialKey).readOnly){columnToFocus=initialKey}else{i=defaultIndex+1<visibleCols.length?defaultIndex+1:vci;while(visibleCols[i].key!==initialKey){if(!visibleCols[i].readOnly){columnToFocus=visibleCols[i].key;break}if(++i===vci+vcc){i=vci}}}return columnToFocus},_chooseColumnToFocusMrl:function(isAdding,initialKey){var cols=this._getColumnsOrderedByNavIndex(),col,targetNavIndex=0,i=0,rolledBack=false;if(isAdding){return cols?cols[0].key:null}if(initialKey){col=this.grid.columnByKey(initialKey);if(!col.readOnly){return initialKey}targetNavIndex=col.navigationIndex}while(i<cols.length){if(cols[i].navigationIndex>=targetNavIndex){return cols[i].key}i++;if(i===cols.length&&!rolledBack){i=0;rolledBack=true}}},_addDSSuccessHandler:function(){var fS,grid=this.grid;if(this._addChangesSuccessHandler!==null&&this._addChangesSuccessHandler!==undefined){grid.dataSource._removeChangesSuccessHandler(this._addChangesSuccessHandler)}fS=this.options.saveChangesSuccessHandler;if(fS){if($.type(fS)==="string"&&window[fS]&&$.type(window[fS])==="function"){fS=window[fS]}}if($.type(fS)!=="function"){fS=null}this._addChangesSuccessHandler=function(data){if(grid.rows().parent().find("."+grid.css.deletedRecord).length){grid._renderData()}grid.rows().removeClass(grid.css.modifiedRecord);if(fS){fS(data)}};grid.dataSource._addChangesSuccessHandler(this._addChangesSuccessHandler)},_addDSErrorHandler:function(){var fE;if(this._addChangesErrorHandler!==null&&this._addChangesErrorHandler!==undefined){this.grid.dataSource._removeChangesErrorHandler(this._addChangesErrorHandler)}if(this.options.saveChangesErrorHandler){fE=this.options.saveChangesErrorHandler;if($.type(fE)==="string"&&window[fE]&&$.type(window[fE])==="function"){fE=window[fE]}if($.type(fE)==="function"){this._addChangesErrorHandler=function(jqXHR,textStatus,errorThrown){fE(jqXHR,textStatus,errorThrown)};this.grid.dataSource._addChangesErrorHandler(this._addChangesErrorHandler)}}},_resolveRowElement:function(element,rowId){if(element){if(element.is("tr")){return element}if(element.is("td")&&(element.hasClass("ui-iggrid-addrow")||rowId===null)){if(element.parent().attr("data-new-row")){return element.parent().parent().children("[data-new-row]")}else{return element.parent()}}}return this.grid.rowById(rowId)},_updateRowVirtualization:function(row,fixed,type){var svst;if(fixed&&type==="deleteRow"){if(this.grid._startRowIndex+this.grid._virtualRowCount===this.grid._totalRowCount){this.grid._startRowIndex=Math.max(0,this.grid._startRowIndex-1)}this.grid._totalRowCount--;if(this.grid._virtualRowCount>this.grid._totalRowCount){this._virtPreRender(null,{owner:this.grid});this.grid._buildVirtualDom();this._virtPostRender(null,{owner:this.grid})}else{this.grid._renderVirtualRecords();this.grid._setScrollContainerHeight(this.grid._totalRowCount*parseInt(this.grid.options.avgRowHeight,10))}}else{svst=this.grid._persistVirtualScrollTop;this.grid._persistVirtualScrollTop=true;this.grid._saveFirstVisibleTRIndex();this.grid._renderVirtualRecords();this.grid._persistVirtualScrollTop=svst}},_childrenWithAddRowEnabled:function(opts,inheritedRule){var i,j,cl,clr;if(opts.columnLayouts){for(i=0;i<opts.columnLayouts.length;i++){cl=opts.columnLayouts[i];if(inheritedRule!==null&&inheritedRule!==undefined){clr=inheritedRule}else{clr=$.ui.igGridUpdating.prototype.options.enableAddRow}if(cl.features&&cl.features.length>0){for(j=0;j<cl.features.length;j++){if(cl.features[j].name==="Updating"){return cl.features[j].enableAddRow===null||cl.features[j].enableAddRow===undefined?clr:cl.features[j].enableAddRow}}}else{return inheritedRule===true}}}return false},_recOrPropFound:function(rowId,colKey){var pendingTransactions=this.grid.dataSource.pendingTransactions(),rec,i=pendingTransactions.length,found,hasUnboundValue;rec=this.grid.dataSource.findRecordByKey(rowId);found=!!rec;if(colKey){hasUnboundValue=this.grid._unboundValues&&this.grid._unboundValues.hasOwnProperty(colKey);found=found&&(rec.hasOwnProperty(colKey)||hasUnboundValue)}if(!found){while(--i>=0){if(pendingTransactions[i].rowId===rowId){return colKey?pendingTransactions[i].row.hasOwnProperty(colKey):true}}return false}return true},_activateEditor:function(editor){var cell=editor.closest("td");if(cell.length&&this.options.editMode!=="dialog"){this._scrollTo(cell)}editor.igEditorFilter("setFocus");setTimeout(function(){if(editor.data("igEditorFilter")){editor.igEditorFilter("setFocus")}},5)},_scrollTo:function(cell){var gOpts=this.grid.options,v=gOpts.virtualization||gOpts.rowVirtualization||gOpts.columnVirtualization,scrollContainer=v?this.grid._vdisplaycontainer():this.grid.scrollContainer(),cellPosition,ct,cl,paddingRight;if(scrollContainer.length&&scrollContainer.has(cell).length){cellPosition=cell.igPosition();paddingRight=this.grid.element.find("tbody > tr:first > :last-child").attr("data-vscr-padding-icrement");paddingRight=paddingRight&&!cell.is(":last-child")?parseInt(paddingRight,10):0;ct=cellPosition.top+scrollContainer.scrollTop();cl=cell.igOffset().left-cell.offsetParent().igOffset().left+scrollContainer.scrollLeft();if(cellPosition.left<0){scrollContainer.scrollLeft(cl)}else if(cl+cell.outerWidth()+paddingRight>scrollContainer.scrollLeft()+scrollContainer.outerWidth()){scrollContainer.scrollLeft(cl+cell.outerWidth()+paddingRight-scrollContainer.outerWidth())}if(cellPosition.top<0){scrollContainer.scrollTop(ct)}else if(ct+cell.outerHeight()>scrollContainer.scrollTop()+scrollContainer.outerHeight()){scrollContainer.scrollTop(ct+cell.outerHeight()-scrollContainer.outerHeight())}}},_setScroll:function(code,nextActiveElement){var scrollVDir=code===$.ui.keyCode.DOWN||code===$.ui.keyCode.RIGHT?"down":"up";this._setScrollTop(this.grid.element.parent(),nextActiveElement.closest("tr"),scrollVDir,nextActiveElement.closest("tr").index()+(this.grid._startRowIndex||0))},_setScrollTop:function(parent,child,direction,index){var parentOffset=parent.igOffset(),childOffset=child.igOffset(),childh,isDown,isUp,v,c;if(!child||child.length===0){return}v=this.grid.options.virtualization||this.grid.options.rowVirtualization;c=v&&this.grid.options.virtualizationMode==="continuous";childh=v&&!c?parseInt(this.grid.options.avgRowHeight,10):child.outerHeight();if(!v||c){isDown=childOffset.top+childh+this.grid._scrollbarWidth()>parentOffset.top+$(parent).outerHeight();isUp=childOffset.top-childh/2<=parentOffset.top||c&&index<0}if(index===0&&(!v||c)){parent[0].scrollTop=0}else if(direction==="down"){if(isDown){if(c){this.grid._onVirtualVerticalScroll({},childh,direction)}}}else{if(isUp){if(c){this.grid._onVirtualVerticalScroll({},childh,direction)}}}},_scrollVmanual:function(down){var sc=$("#"+this.grid.element[0].id+"_scrollContainer"),h=parseInt(this.grid.options.avgRowHeight,10);this.grid._ignoreScroll=true;if(down){sc.scrollTop(sc.scrollTop()+h)}else{sc.scrollTop(sc.scrollTop()-h)}this.grid._onVirtualVerticalScroll();this.grid._ignoreScroll=false;this._vscrolled=true},_deleteRow:function(evt,rowId,suppress){var arg,t,autoCommit=this.grid.options.autoCommit,row=this.grid.rowById(rowId);if(row.hasClass(this.grid.css.deletedRecord)){return}arg={owner:this,element:row,rowID:rowId};if(!suppress){if(!this._trigger(this.events.rowDeleting,evt,arg)){return false}}t=this.grid.dataSource.deleteRow(rowId,autoCommit);row=this._updateUIForTransaction(t,row);if(!suppress){this._trigger(this.events.rowDeleted,evt,arg)}return true},_deleteMultipleRows:function(evt){var selectedRows=this.grid.element.igGridSelection("selectedRows"),i;for(i=0;i<selectedRows.length;i++){if(selectedRows[i]&&selectedRows[i].hasOwnProperty("id")&&!selectedRows[i].element.hasClass(this.grid.css.deletedRecord)){this._deleteRow(evt,selectedRows[i].id,false)}}},_updateRow:function(rowId,updateObj,origObj,row){var t,autoCommit=this.grid.options.autoCommit,i,extendedObj,key,colLaytout=this.grid.options.columnLayouts;origObj=origObj||this._getLatestValues(rowId);row=row||this.grid.rowById(rowId);extendedObj=$.extend({},origObj,updateObj);if(colLaytout){for(i=0;i<colLaytout.length;i++){key=colLaytout[i].key;delete extendedObj[key]}}t=this.grid.dataSource.updateRow(rowId,extendedObj,autoCommit);this._updateUIForTransaction(t,row);this._notifyRowUpdated(rowId,row)},_updateCell:function(rowId,colKey,value,cell){var t,autoCommit=this.grid.options.autoCommit;t=this.grid.dataSource.setCellValue(rowId,colKey,value,autoCommit);this._updateUIForTransaction(t,cell);this._notifyCellUpdated(rowId,cell)},_addRow:function(evt,addObj,defVals,suppress){var arg,key,t,row,fk=this.grid.options.foreignKey,ds=this.grid.dataSource,sl,go=this.grid.options,isVirtualGrid=go.virtualization||go.rowVirtualization||go.columnVirtualization,container=isVirtualGrid?this.grid._vdisplaycontainer():this.grid.scrollContainer();addObj=$.extend({},defVals,addObj);arg={owner:this,values:addObj,oldValues:defVals};if(!suppress){if(!this._trigger(this.events.rowAdding,evt,arg)){return false}}key=addObj[this.grid.options.primaryKey];if(key===undefined||key===null){key=this._pkVal;addObj[this.grid.options.primaryKey]=key}else{if(fk&&!addObj.hasOwnProperty(fk)){if(ds._origDs&&ds._origDs.length&&ds._origDs[0].hasOwnProperty(fk)){addObj[fk]=ds._origDs[0][fk]}else if(this.grid.options.foreignKeyValue!==null&&this.grid.options.foreignKey!==undefined){addObj[fk]=this.grid.options.foreignKeyValue}else{addObj[fk]=null}}}t=this.grid.dataSource.addRow(key,addObj,this.grid.options.autoCommit);row=this._updateUIForTransaction(t);this._notifyRowAdded(row);sl=container.data("igScroll");if(sl&&!isVirtualGrid){sl._scrollTop(this.element.height()-container.height())}if($.type(this._pkVal)==="number"){this._pkVal++}if(!suppress){this._trigger(this.events.rowAdded,evt,arg)}},_notifyRowAdded:function(row){var container,sl,isVirtualGrid=false,go=this.grid.options,rs=this.grid.element.data("igGridRowSelectors"),pa=this.grid.element.data("igGridPaging"),su=this.grid.element.data("igGridSummaries");if(go.virtualization||go.rowVirtualization||go.columnVirtualization){container=this.grid._vdisplaycontainer();isVirtualGrid=true}else{container=this.grid.scrollContainer()}if(rs&&typeof rs._rowAdded==="function"){rs._rowAdded(row)}if(pa&&typeof pa._rowAdded==="function"){pa._rowAdded(row)}if(su&&typeof su._rowAdded==="function"){su._rowAdded(row)}sl=container.data("igScroll");if(sl){if(isVirtualGrid){this.grid._enableVirtualTouchScrollbars()}else{this.grid._enableTouchScrollbars()}}this.grid._fireInternalEvent("_internalRowAdded",{row:row})},_notifyRowDeleted:function(rowId,element){var container,sl,isVirtualGrid=false,go=this.grid.options,se=this.grid.element.data("igGridSelection"),pa=this.grid.element.data("igGridPaging"),su=this.grid.element.data("igGridSummaries");if(go.virtualization||go.rowVirtualization||go.columnVirtualization){container=this.grid._vdisplaycontainer();isVirtualGrid=true}else{container=this.grid.scrollContainer()}if(se&&typeof se._rowDeleted==="function"){se._rowDeleted(rowId,element)}if(su&&typeof su._rowDeleted==="function"){su._rowDeleted(rowId,element)}if(pa&&typeof pa._rowDeleted==="function"){pa._rowDeleted(rowId,element)}sl=container.data("igScroll");if(sl){if(isVirtualGrid){this.grid._enableVirtualTouchScrollbars()}else{this.grid._enableTouchScrollbars();sl._scrollTop(sl._getContentPositionY())}}this.grid._fireInternalEvent("_internalRowDeleted",{rowID:rowId,row:element})},_notifyCellUpdated:function(rowId,cell){this.grid._fireInternalEvent("_internalCellUpdated",{rowID:rowId,cell:cell})},_notifyRowUpdated:function(rowId,row){this.grid._fireInternalEvent("_internalRowUpdated",{rowID:rowId,row:row})},_renderRowEditDialog:function(rerender){var opts=this.options.rowEditDialogOptions,container,containment,captionsContainer,closeButton,dialogSelector="#"+this.grid.id()+"_updating_dialog_container",titleLabel=this._getLocaleValue("rowEditDialogCaptionLabel"),doneButtonLabel=this._getLocaleValue("doneLabel"),doneButtonTitle=this._getLocaleValue("doneTooltip"),cancelButtonLabel=this._getLocaleValue("cancelLabel"),cancelButtonTitle=this._getLocaleValue("cancelTooltip");container=$(dialogSelector);if(container.length){if(!rerender){return container}container[this.options.dialogWidget]("destroy");container.remove();this._destroyAllEditors()}if(opts.containment==="owner"){containment=this.grid._rootContainer()}else{containment="window"}container=$("<div></div>").appendTo(this.grid._rootContainer()).attr("id",dialogSelector.substring(1));container[this.options.dialogWidget]({containment:containment,renderFooterButtons:opts.showDoneCancelButtons,modalDialogWidth:opts.width,modalDialogHeight:opts.height,locale:{modalDialogCaptionText:titleLabel,buttonApplyText:doneButtonLabel,buttonApplyTitle:doneButtonTitle,buttonCancelText:cancelButtonLabel,buttonCancelTitle:cancelButtonTitle},animationDuration:opts.animationDuration,buttonApplyDisabled:true,gridContainer:this.grid._rootContainer(),closeModalDialogOnEnter:true,modalDialogOpening:this._dialogHandlers.dialogOpening,modalDialogOpened:this._dialogHandlers.dialogOpened,modalDialogClosing:this._dialogHandlers.dialogClosing,modalDialogClosed:this._dialogHandlers.dialogClosed,buttonOKClick:this._dialogHandlers.dialogDone,buttonCancelClick:this._dialogHandlers.dialogCancel,tabIndex:this._getNextTabIndex()});captionsContainer=container[this.options.dialogWidget]("getCaptionButtonContainer");closeButton=$("<button type='button'></button>").attr("id",this.grid.id()+"_updating_dialog_closeButton").attr("tabindex",this._getNextTabIndex()).appendTo(captionsContainer);closeButton.igButton({onlyIcons:true,icons:{primary:this.css.rowEditDialogCloseButton},width:"20px",height:"20px",click:this._dialogHandlers.dialogCloseClick});this._dialogInvalid=false;this._editorsContainerInvalid=true;this._trigger(this.events.rowEditDialogContentsRendered,null,{owner:this,dialogElement:container});return container},_renderDialogContent:function(content,values){var opts=this.options.rowEditDialogOptions,colgroup,tmpl;this._clearEditorsFromContainer(content);content.empty();if(opts.dialogTemplateSelector){tmpl=$(opts.dialogTemplateSelector);content.append($(this._jsr?tmpl.render(values):$.ig.tmpl(tmpl.html().fullTrim(),values)))}else if(opts.dialogTemplate){tmpl=opts.dialogTemplate;content.append($(this._jsr?$.render[this.grid.id()+"_rowEditDialogTemplate"](values):$.ig.tmpl(tmpl,values)))}else{content.html(this._defaultDialogTemplate);content.find("table").addClass(this.css.rowEditDialogTable).css("table-layout","fixed");colgroup=content.find("colgroup");colgroup.children(":first").css("width",opts.namesColumnWidth);colgroup.children(":last").css("width",opts.editorsColumnWidth);colgroup.parent().css("width","100%")}},_renderDialogTemplate:function(tmplParent,cols,onlyVisible){var opts=this.options.rowEditDialogOptions,tmpl,i,tr,e;cols=onlyVisible?$.grep(cols,function(col){return!col.hidden}):cols;if(!opts.showReadonlyEditors){cols=$.grep(cols,function(col){return!col.readOnly})}if(opts.editorsTemplateSelector){tmpl=$(opts.editorsTemplateSelector);tmplParent.append($(this._jsr?tmpl.render(cols):$.ig.tmpl(tmpl.html().fullTrim(),cols)))}else if(opts.editorsTemplate){tmpl=opts.editorsTemplate;tmplParent.append($(this._jsr?$.render[this.grid.id()+"_rowEditDialogEditorsTemplate"](cols):$.ig.tmpl(tmpl,cols)))}else{for(i=0;i<cols.length;i++){tr=$("<tr></tr>");$("<td>"+(cols[i].headerText||cols[i].key)+"</td>").appendTo(tr);$("<td></td>").appendTo(tr);e=this._isMultiLineText(cols[i].key)?$("<textarea></textarea>"):$("<input />");e.attr("data-editor-for-"+cols[i].key,"").appendTo(tr.children(":last"));tr.appendTo(tmplParent)}}},_initDialogEditors:function(content,cols,values){var i=0,provider,providerWrapper,ro,key,element,val,settings;this._editors=this._editors||{};while(i<cols.length){key=cols[i].key;ro=!!cols[i].readOnly;val=values[key]===undefined?null:values[key];element=content.find("[data-editor-for-"+key.toLowerCase()+"]");if(element.length===1){providerWrapper=this._providerForKey(key);if(providerWrapper&&providerWrapper.has(element).length){provider=providerWrapper.igEditorFilter("option","provider");provider.setValue(val,false,this.grid._calcOffsetForCol(this._origRec,cols[i],true))}else{if(ro){settings=this._getColSettingsForCol(key);if(!settings){this.options.columnSettings.push({columnKey:key,editorOptions:{readOnly:true}})}else{$.extend(true,settings,{editorOptions:{readOnly:true}})}}providerWrapper=this._createEditor(null,key,element);this._editors[key]=providerWrapper;provider=providerWrapper.igEditorFilter("option","provider");provider.setValue(val,false,this.grid._calcOffsetForCol(this._origRec,cols[i],true))}if(this._columnToFocus===key){this._columnToFocus=providerWrapper}this._originalValues=this._originalValues||{};this._originalValues[key]=provider.getValue();$.ig.removeFromArray(cols,i,i)}else{i++}}},_clearEditorsFromContainer:function(content){var cols=this.grid.options.columns,i=-1,key,element,providerWrapper;while(++i<cols.length){key=cols[i].key;element=content.find("[data-editor-for-"+key.toLowerCase()+"]");if(element.length){providerWrapper=this._providerForKey(key).data("igEditorFilter");if(providerWrapper){this._providerForKey(key).igEditorFilter("destroy");delete this._editors[key]}}}},_renderDoneCancelButtons:function(){var buttonContainer,buttonsParent,doneButton,cancelButton,deleteButton,doneButtonLabel=this._getLocaleValue("doneLabel"),doneButtonTitle=this._getLocaleValue("doneTooltip"),cancelButtonLabel=this._getLocaleValue("cancelLabel"),cancelButtonTitle=this._getLocaleValue("cancelTooltip"),doneSelector,cancelSelector,deleteSelector,v=this.grid.options.virtualization===true||this.grid.options.columnVirtualization===true||this.grid.options.rowVirtualization===true,sbw=this.grid.hasVerticalScrollbar()&&!v?this.grid._scrollbarWidth():0;buttonContainer=$("<div></div>").css("position","absolute").attr("unselectable","on").addClass(this.css.buttonContainer);buttonsParent=this._addElementToScrollContainer(buttonContainer);doneButton=$("<span></span").attr("id",this.grid.id()+"_updating_done").addClass(this.css.button).addClass(this.css.doneButton).attr({unselectable:"on",tabIndex:this._getNextTabIndex()+1,title:doneButtonTitle,"data-localeid":"doneTooltip","data-localeattr":"title"}).css({display:"inline-block",position:"relative"}).appendTo(buttonContainer);$("<span></span>").css("display","inline-block").addClass(this.css.doneIcon).attr("unselectable","on").appendTo(doneButton);if(doneButtonLabel&&doneButton.length){$("<span></span>").css("display","inline-block").attr({unselectable:"on","data-localeid":"doneLabel"}).html(doneButtonLabel).appendTo(doneButton)}else{doneButton.addClass(this.css.buttonIconOnly)}cancelButton=$("<span></span>").attr("id",this.grid.id()+"_updating_cancel").addClass(this.css.button).addClass(this.css.cancelButton).attr({unselectable:"on",tabIndex:this._getNextTabIndex()+1,title:cancelButtonTitle,"data-localeid":"cancelTooltip","data-localeattr":"title"}).css({display:"inline-block",position:"relative"}).appendTo(buttonContainer);$("<span></span>").css("display","inline-block").addClass(this.css.cancelIcon).attr("unselectable","on").appendTo(cancelButton);if(cancelButtonLabel&&cancelButtonLabel.length){$("<span></span>").css("display","inline-block").attr({unselectable:"on","data-localeid":"cancelLabel"}).html(cancelButtonLabel).appendTo(cancelButton)}else{cancelButton.addClass(this.css.buttonIconOnly)}if(this._renderTouchUI&&this.options.enableDeleteRow){deleteButton=$("<span />").attr("id",this.grid.id()+"_updating_delete_touch").addClass(this.css.button).addClass(this.css.doneButton).attr({unselectable:"on",tabIndex:this._getNextTabIndex()+1,title:this._getLocaleValue("deleteRowTooltip"),"data-localeid":"deleteRowTooltip","data-localeattr":"title"}).prependTo(buttonContainer);$("<span />").css({display:"inline-block",left:0}).addClass(this.css.deleteIcon).attr("unselectable","on").appendTo(deleteButton);$("<span />").css("display","inline-block").attr({unselectable:"on","data-localeid":"deleteRowLabel"}).html(this._getLocaleValue("deleteRowLabel")).appendTo(deleteButton);deleteButton.css({"float":"left",position:"relative"});doneButton.css("float","right");cancelButton.css("float","right");buttonContainer.css("width",buttonsParent.outerWidth()-sbw-2);deleteSelector="#"+deleteButton.attr("id")}doneSelector="#"+doneButton.attr("id");cancelSelector="#"+cancelButton.attr("id");this.grid.container().on({"mouseenter.donecancel":this._buttonHandlers.mouseEnter,"mouseleave.donecancel":this._buttonHandlers.mouseLeave,"focus.donecancel":this._buttonHandlers.focus,"blur.donecancel":this._buttonHandlers.blur},doneSelector+","+cancelSelector+(deleteSelector?","+deleteSelector:""));this.grid.container().on({"click.donecancel":this._buttonHandlers.doneClick,"keyup.donecancel":this._buttonHandlers.doneKeyUp,"keydown.donecancel":this._buttonHandlers.doneKeyDown},doneSelector);this.grid.container().on({"click.donecancel":this._buttonHandlers.cancelClick,"keyup.donecancel":this._buttonHandlers.cancelKeyUp,"keydown.donecancel":this._buttonHandlers.cancelKeyDown},cancelSelector);if(deleteSelector){this.grid.container().on({"click.donecancel":this._buttonHandlers.touchDeleteClick,"keyup.donecancel":this._buttonHandlers.touchDeleteKeyUp},deleteSelector)}return buttonContainer},_removeDoneCancelButtons:function(){var container=this._findElementInScrollContainer(".ui-iggrid-buttoncontainer:first");this.grid.container().off(".donecancel");container.remove()},_renderDeleteButton:function(){var deleteButton,deleteParent,ubodySelector="#"+this.grid.id()+">tbody",fbodySelector="#"+this.grid.id()+"_fixed>tbody",deleteSelector="#"+this.grid.id()+"_updating_deletehover",deleteButtonTitle=this._getLocaleValue("deleteRowTooltip"),pe=window.navigator.pointerEnabled;deleteButton=$(deleteSelector);if(deleteButton.length){return}deleteButton=$("<span></span>").attr("id",deleteSelector.substring(1)).css("position","absolute").addClass(this.css.deleteButton).attr({unselectable:"on",title:deleteButtonTitle,"data-localeid":"deleteRowTooltip","data-localeattr":"title"});deleteButton.hide();$("<span></span>").css("display","inline-block").addClass(this.css.deleteIcon).attr("unselectable","on").appendTo(deleteButton);deleteParent=this._addElementToScrollContainer(deleteButton);this.grid.container().on({"mouseenter.deletebutton":this._buttonHandlers.mouseEnter,"mouseleave.deletebutton":this._buttonHandlers.mouseLeave,"click.deletebutton":this._buttonHandlers.deleteClick,"keyup.deletebutton":this._buttonHandlers.deleteClick},deleteSelector);if(pe){this.grid.container().on({
"pointerover.deletebutton":this._handlers.pointerEnter},ubodySelector+">tr,"+fbodySelector+">tr")}else{this.grid.container().on({"mouseenter.deletebutton":this._handlers.mouseEnter},ubodySelector+">tr,"+fbodySelector+">tr")}this.grid.container().on({"MSPointerDown.deletebutton":this._handlers.pointerDown,"pointerdown.deletebutton":this._handlers.pointerDown,"MSPointerUp.deletebutton":this._handlers.pointerUp,"pointerup.deletebutton":this._handlers.pointerUp,"touchstart.deletebutton":this._handlers.touchStart,"touchend.deletebutton":this._handlers.touchEnd},ubodySelector+">tr,"+fbodySelector+">tr");if(deleteParent[0]===this.grid.container()[0]){if(pe){this.grid.container().bind("pointerleave.deletebutton",this._handlers.pointerLeave)}else{this.grid.container().bind("mouseleave.deletebutton",this._handlers.mouseLeave)}}else{if(pe){this.grid.container().on({"pointerleave.deletebutton":this._handlers.pointerLeave},"#"+deleteParent.attr("id"))}else{this.grid.container().on({"mouseleave.deletebutton":this._handlers.mouseLeave},"#"+deleteParent.attr("id"))}}},_removeDeleteButton:function(){$("#"+this.grid.id()+"_updating_deletehover").remove();this.grid.container().off(".deletebutton");this.grid.container().unbind(".deletebutton")},_renderAddNewRow:function(thead){var addRowLabel=this._getLocaleValue("addRowLabel"),addRowTitle=this._getLocaleValue("addRowTooltip"),addTr,newTr,mainTd,i,recVerticalSize;addTr=thead.children("tr[data-add-row='true']");if(!addTr.length){addTr=$("<tr></tr>").addClass(this.css.addRow).attr({"data-add-row":true,tabIndex:this.grid.options.tabIndex}).appendTo(thead)}addTr.empty();mainTd=$("<td></td>").attr({title:addRowTitle,"data-localeid":"addRowTooltip","data-localeattr":"title"}).addClass(this.css.addRow).appendTo(addTr);$("<span></span>").css("display","inline-block").addClass(this.css.addRowIcon).appendTo(mainTd);$("<span></span>").text(addRowLabel).css("outline",0).attr({tabIndex:0,"data-localeid":"addRowLabel"}).appendTo(mainTd);newTr=thead.children("tr[data-new-row='true']");if(!newTr.length){recVerticalSize=this.grid._recordVerticalSize();for(i=0;i<recVerticalSize;i++){$("<tr></tr>").attr("data-new-row","true").attr("data-role","newrow").appendTo(thead).hide()}}},_generateDummyLayout:function(cols){var i,layout=[[]];for(i=0;i<cols.length;i++){layout[0].push({col:cols[i],rs:1,cs:1})}return layout},_addElementToScrollContainer:function(element){var go=this.grid.options,container,hasHeight=go.height!==null&&go.height!==undefined;if(!hasHeight){container=this.grid.container();element.appendTo(container)}else if(this.grid.hasFixedColumns()&&this.grid.fixingDirection()==="right"){container=this.grid.fixedBodyContainer();element.prependTo(container)}else{if(go.virtualization||go.rowVirtualization||go.columnVirtualization){container=this.grid._vdisplaycontainer()}else{container=this.grid.scrollContainer()}element.prependTo(container)}return container},_findElementInScrollContainer:function(selector){var go=this.grid.options,container,hasHeight=go.height!==null&&go.height!==undefined;if(!hasHeight){container=this.grid.container()}else if(this.grid.hasFixedColumns()&&this.grid.fixingDirection()==="right"){container=this.grid.fixedBodyContainer()}else{if(go.virtualization||go.rowVirtualization||go.columnVirtualization){container=this.grid._vdisplaycontainer()}else{container=this.grid.scrollContainer()}}return container.children(selector)},_createHandlers:function(){this._stopEditingHandler=this._stopEditingHandler||$.proxy(this._stopEditing,this);this._gridHandlers=this._gridHandlers||{stopEditing:this._stopEditingHandler,gridDataRendering:$.proxy(this._gridDataRendering,this),rowsRendered:$.proxy(this._rowsRendered,this),headerRendering:$.proxy(this._processReadOnly,this),headerRendered:$.proxy(this._headerRendered,this),rendered:$.proxy(this._headerRendered,this),virtualFrameChanging:$.proxy(this._virtPreRender,this),virtualFrameChanged:$.proxy(this._virtPostRender,this),columnsCollectionModified:$.proxy(this._columnsModified,this),columnsMoved:$.proxy(this._columnsMoved,this)};this._handlers=this._handlers||{mouseDown:$.proxy(this._mouseDown,this),clickTrigger:$.proxy(this._clickTrigger,this),keyDown:$.proxy(this._keyDown,this),focus:$.proxy(this._focus,this),blur:$.proxy(this._blur,this),touchStart:$.proxy(this._touchStart,this),touchEnd:$.proxy(this._touchEnd,this),pointerDown:$.proxy(this._pointerDown,this),pointerUp:$.proxy(this._pointerUp,this),mouseEnter:$.proxy(this._rowMouseEnter,this),pointerEnter:$.proxy(this._rowPointerEnter,this),mouseLeave:$.proxy(this._containerMouseLeave,this),pointerLeave:$.proxy(this._containerPointerLeave,this),scroll:$.proxy(this._scroll,this)};this._buttonHandlers=this._buttonHandlers||{mouseEnter:$.proxy(this._buttonMouseEnter,this),mouseLeave:$.proxy(this._buttonMouseLeave,this),focus:$.proxy(this._buttonFocus,this),blur:$.proxy(this._buttonBlur,this),doneClick:$.proxy(this._doneButtonClick,this),doneKeyUp:$.proxy(this._doneButtonKeyUp,this),doneKeyDown:$.proxy(this._doneButtonKeyDown,this),cancelClick:this._stopEditingHandler,cancelKeyUp:$.proxy(this._cancelButtonKeyUp,this),cancelKeyDown:$.proxy(this._cancelButtonKeyDown,this),deleteClick:$.proxy(this._deleteButtonClick,this),touchDeleteClick:$.proxy(this._touchDeleteButtonClick,this),touchDeleteKeyUp:$.proxy(this._touchDeleteButtonKeyUp,this)};this._addNewRowHandlers=this._addNewRowHandlers||{focus:$.proxy(this._addRowFocus,this),blur:$.proxy(this._addRowBlur,this)};this._validationHandlers=this._validationHandlers||{errorShowing:$.proxy(this._editorErrorShowing,this),errorShown:$.proxy(this._editorErrorShown,this),errorHidden:$.proxy(this._editorErrorHidden,this)};this._dialogHandlers=this._dialogHandlers||{dialogCloseClick:$.proxy(this._dialogCloseClick,this),dialogOpening:$.proxy(this._dialogOpening,this),dialogOpened:$.proxy(this._dialogOpened,this),dialogClosing:$.proxy(this._dialogClosing,this),dialogClosed:$.proxy(this._dialogClosed,this),dialogDone:$.proxy(this._dialogDone,this),dialogCancel:$.proxy(this._dialogCancel,this)};this._editorCallbacks=this._editorCallbacks||{keyDown:$.proxy(this._editorKeyDown,this),textChanged:$.proxy(this._editorTextChanged,this),valueChanged:$.proxy(this._editorTextChanged,this)}},_unbindAllEvents:function(){if(!this._gridHandlers){return}this.grid.element.off({"iggriduidirty.updating":this._gridHandlers.stopEditing,"ighierarchicalgridrowexpanded.updating":this._gridHandlers.stopEditing,"iggridrendered.updating":this._gridHandlers.gridRendered,"iggriddatarendering.updating":this._gridHandlers.gridDataRendering,"iggridrowsrendered.updating":this._gridHandlers.rowsRendered,"iggridvirtualrendering.updating":this._gridHandlers.virtualFrameChanging,"iggridvirtualrecordsrender.updating":this._gridHandlers.virtualFrameChanged,"iggridcolumnscollectionmodified.updating":this._gridHandlers.columnsCollectionModified,"iggridheaderrendering.updating":this._gridHandlers.headerRendering,iggriddatabinding:this._gridHandlers.gridDataRendering,"iggrid_columnsmoved.updating":this._gridHandlers.columnsMoved});if(this.options.enableAddRow){this.grid.element.off({"iggridheaderrenderedinternal.updating":this._gridHandlers.headerRendered,"iggridrendered.updating":this._gridHandlers.rendered})}this.grid.container().off({click:this._handlers.click})},_bindGridEvents:function(){this.grid.element.on({"iggriduidirty.updating":this._gridHandlers.stopEditing,"ighierarchicalgridrowexpanded.updating":this._gridHandlers.stopEditing,"iggriddatarendering.updating":this._gridHandlers.gridDataRendering,"iggridrowsrendered.updating":this._gridHandlers.rowsRendered,"iggridvirtualrendering.updating":this._gridHandlers.virtualFrameChanging,"iggridvirtualrecordsrender.updating":this._gridHandlers.virtualFrameChanged,"iggridcolumnscollectionmodified.updating":this._gridHandlers.columnsCollectionModified,"iggridheaderrendering.updating":this._gridHandlers.headerRendering,iggriddatabinding:this._gridHandlers.gridDataRendering,"iggrid_columnsmoved.updating":this._gridHandlers.columnsMoved});if(this.options.enableAddRow){this.grid.element.on({"iggridheaderrenderedinternal.updating":this._gridHandlers.headerRendered,"iggridrendered.updating":this._gridHandlers.rendered})}},_injectGrid:function(gridInstance,isRebind){var hg,cl,v;this.grid=gridInstance;v=this.grid.options.virtualization||this.grid.options.rowVirtualization||this.grid.options.columnVirtualization;this._addDSSuccessHandler();this._addDSErrorHandler();if(isRebind){return}this._dialogInvalid=true;this._defaultDialogTemplate="<table><colgroup><col></col><col></col></colgroup><tbody data-render-tmpl></tbody></table>";this._editors=this._editors||{};if(this.grid.options.virtualizationMode!=="continuous"&&(this.grid.options.virtualization===true&&this.grid.options.width||this.grid.options.columnVirtualization===true)&&this.options.editMode==="row"){throw new Error(this._getLocaleValue("rowUpdatingNotSupportedWithColumnVirtualization"))}if(this.options.excelNavigationMode&&(this.options.editMode!=="cell"&&this.options.editMode!=="row")){throw new Error(this._getLocaleValue("excelNavigationNotSupportedWithCurrentEditMode"))}if(this.grid.options.autoCommit===false&&v){throw new Error(this._getLocaleValue("virtualizationNotSupportedWithoutAutoCommit"))}this._createHandlers();this._bindGridEvents();this._analyzeEditTriggers();if(this.grid.options._isHierarchicalGrid&&this.grid._originalOptions){if(this.options.inherit){this.grid._shouldAlwaysRenderChildIndicator=this._childrenWithAddRowEnabled(this.grid.options,this.options.enableAddRow)}else{this.grid._shouldAlwaysRenderChildIndicator=this._childrenWithAddRowEnabled(this.grid.options)}if(!this.grid.dataSource.settings.schema.layouts){hg=this.grid.element.closest(".ui-iggrid-root").data("igHierarchicalGrid");cl=[];hg._parseLayouts(cl,"",this.grid._originalOptions);this.grid.dataSource.settings.schema.layouts=cl}}this._renderTouchUI=$.ig.util.isTouch;if(window.navigator.msPointerEnabled||window.navigator.pointerEnabled){this.grid.element.css("-ms-touch-action","none");this.grid.element.css("touch-action","none")}if(String(this.grid.options.templatingEngine).toLowerCase()==="jsrender"){this._jsr=true;if(this.options.rowEditDialogOptions.dialogTemplate&&typeof this.options.rowEditDialogOptions.dialogTemplate==="string"){$.templates(this.grid.id()+"_rowEditDialogTemplate",this.options.rowEditDialogOptions.dialogTemplate)}if(this.options.rowEditDialogOptions.editorsTemplate&&typeof this.options.rowEditDialogOptions.editorsTemplate==="string"){$.templates(this.grid.id()+"_rowEditDialogEditorsTemplate",this.options.rowEditDialogOptions.editorsTemplate)}}}});$.extend($.ui.igGridUpdating,{version:"21.2.12"})})($);/*!@license
* Infragistics.Web.ClientUI Layout Manager 21.2.12
*
* Copyright (c) 2011-2022 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on:
*	jquery.js
*	jquery.ui.core.js
*	jquery.ui.widget.js
*	infragistics.util.js
*   infragistics.util.jquery.js
*/
(function($){$.widget("ui.igLayoutManager",{css:{item:"ig-layout-item",container:"ig-layout",flowItem:"ig-layout-flow-item",flow:"ig-layout-flow",vertical:"ig-layout-vertical",verticalItem:"ig-layout-vertical-item",border:"ig-layout-border",borderItem:"ig-layout-border-item",borderItemHidden:"ig-layout-border-item-hidden",borderHeader:"ig-layout-border-header",borderFooter:"ig-layout-border-footer",borderLeft:"ig-layout-border-left",borderCenter:"ig-layout-border-center",borderRight:"ig-layout-border-right",borderContainer:"ig-layout-border-container",gridItemAbs:"ig-layout-griditem-abs",gridItemRel:"ig-layout-griditem-rel"},options:{borderLayout:{leftWidth:"20%",rightWidth:"10%",showFooter:true,showHeader:true,showLeft:true,showRight:true},gridLayout:{animationDuration:500,cols:null,columnHeight:null,columnWidth:null,marginLeft:0,marginTop:0,overrideConfigOnSetOption:true,rearrangeItems:true,rows:null},height:null,itemCount:null,items:[{colIndex:0,colSpan:1,height:null,rowIndex:0,rowSpan:1,width:null}],layoutMode:"column",width:null},events:{internalResized:"internalResized",internalResizing:"internalResizing",itemRendered:"itemRendered",itemRendering:"itemRendering",rendered:"rendered"},_opt:null,_createWidget:function(options){this.options.items=[];this.options.gridLayout.useOffset=true;if(options&&options.items){options.items=$.extend(true,[],options.items)}$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){var self=this;this._opt={eventHandlers:{},gridLayout:null,borderLayout:null,scrollBarWidth:$.ig.util.getScrollWidth(),scrollBarHeight:$.ig.util.getScrollHeight(),resizeLayout:this.options.layoutMode==="grid"||this.options.layoutMode==="border"};this.element.addClass(this.css.container);if(this.options.width!==null){this.element.css("width",this.options.width)}if(this.options.height!==null){this.element.css("height",this.options.height)}if(this._opt.resizeLayout){this._opt.eventHandlers.windowResizeHandler=function(e){var noCancel=self._triggerInternalResizing(e);if(noCancel){self.reflow(false,null,e)}};$(window).on("resize",this._opt.eventHandlers.windowResizeHandler)}switch(this.options.layoutMode){case"grid":this._initGridLayout();break;case"border":this._initBorderLayout();break;case"flow":this._initFlowLayout();break;case"vertical":this._initVerticalLayout();break;default:break}},_setOption:function(option,value){if(this.options[option]===value){return}var opt=this.options,borderLayout=$.extend(true,{},this.options.borderLayout),initGridLayout,gridLayout;switch(option){case"gridLayout":if(opt.gridLayout.overrideConfigOnSetOption){gridLayout=$.extend(true,{overrideConfigOnSetOption:opt.gridLayout.overrideConfigOnSetOption,useOffset:opt.gridLayout.useOffset},{cols:null,rows:null,columnWidth:null,columnHeight:null,marginLeft:0,marginTop:0,rearrangeItems:true,animationDuration:500});initGridLayout=true}else{gridLayout=$.extend(true,{},this.options.gridLayout);initGridLayout=value.cols||value.rows||value.columnWidth||value.columnHeight||typeof value.marginLeft==="number"||typeof value.marginTop==="number"||value.useOffset}break;default:break}$.Widget.prototype._setOption.apply(this,arguments);switch(option){case"width":this.element.width(this.options.width);if(opt.layoutMode==="grid"){this.reflow(true)}break;case"height":this.element.height(this.options.height);if(opt.layoutMode==="grid"){this.reflow(true)}break;case"gridLayout":this.options.gridLayout=$.extend(true,{},gridLayout,this.options.gridLayout);if(initGridLayout){this._destroyGridLayout();this._initGlFromItemsConfig(false)}else{if(value.hasOwnProperty("rearrangeItems")){this._opt.gridLayout.rearrangeItems=value.rearrangeItems}if(value.hasOwnProperty("animationDuration")){this._opt.gridLayout.animationDuration=value.animationDuration}}break;case"borderLayout":this._destroyBorderLayout();this.options.borderLayout=$.extend(true,{},borderLayout,this.options.borderLayout);this._initBorderLayout();break;case"items":switch(opt.layoutMode){case"vertical":this._destroyVerticalLayout();this._initVerticalLayout();break;case"grid":this._initGlFromItemsConfig(false);break;case"flow":this._destroyFlowLayout();this._initFlowLayout();break}break;case"itemCount":switch(opt.layoutMode){case"vertical":this._destroyVerticalLayout();this._initVerticalLayout();break;case"flow":this._destroyFlowLayout();this._initFlowLayout();break}break;default:break}},reflow:function(forceReflow,animationDuration,event){var parsedDur;if(this.options.layoutMode==="grid"){parsedDur=parseInt(animationDuration,10);animationDuration=parsedDur>=0?parsedDur:this.options.gridLayout.animationDuration;this._reflowGlConfiguration(forceReflow,animationDuration,event)}if(this.options.layoutMode==="border"){this._setBorderLayoutPaddings()}},_initVerticalLayout:function(){var i,length=this.options.itemCount,items=this.options.items,item;this.element.addClass(this.css.vertical);if(length>0){for(i=0;i<length;i++){this._trigger(this.events.itemRendering,null,{index:i});item=$("<div></div>").appendTo(this.element).addClass(this.css.verticalItem);this.options.destroyItems=true;this._trigger(this.events.itemRendered,null,{item:item,index:i})}this._trigger(this.events.rendered,null,{owner:this})}else if(items&&items.length>0){this.element.empty();for(i=0;i<items.length;i++){this._trigger(this.events.itemRendering,null,{itemData:items[i],index:i});item=$("<div></div>").appendTo(this.element).addClass(this.css.verticalItem);if(items[i].width){item.css("width",items[i].width)}if(items[i].height){item.css("height",items[i].height)}this._trigger(this.events.itemRendered,null,{item:item,index:i})}this.options.destroyItems=true;this._trigger(this.events.rendered,null,{owner:this})}else{this.element.children().addClass(this.css.verticalItem)}},_analyzeGlWidth:function(){var gl=this._opt.gridLayout,columnWidth=gl.columnWidth,ml=gl.marginLeft,elWidth=this.element.width(),analyzedColumnWidth,i;if(columnWidth){if(typeof columnWidth==="string"){analyzedColumnWidth=this._analyzeGlColumnWidth(columnWidth,elWidth,ml);gl.columnWidth=analyzedColumnWidth.columnWidth;gl.columnWidthRatio=analyzedColumnWidth.columnWidthRatio;gl.columnWidthHasAsterisk=analyzedColumnWidth.columnWidthHasAsterisk}else if($.isArray(columnWidth)){gl.columnWidthRatio=[];gl.columnWidthHasAsterisk=[];for(i=0;i<columnWidth.length;i++){analyzedColumnWidth=this._analyzeGlColumnWidth(columnWidth[i],elWidth,ml);gl.columnWidth[i]=analyzedColumnWidth.columnWidth;gl.columnWidthRatio.push(analyzedColumnWidth.columnWidthRatio);gl.columnWidthHasAsterisk.push(analyzedColumnWidth.columnWidthHasAsterisk)}}}},_analyzeGlColumnWidth:function(columnWidth,elWidth,marginLeft){var units,analyzedColumnWidth=columnWidth,analyzedColumnWidthRatio=null,hasAsterisk=false;if(columnWidth.indexOf("%")!==-1){units=columnWidth.substring(0,columnWidth.length-1);units=parseInt(units,10)/100;if(!isNaN(units)&&units>0){analyzedColumnWidthRatio=units;analyzedColumnWidth=Math.floor(elWidth*units-marginLeft)}}else if(columnWidth==="*"){hasAsterisk=true}else{units=parseInt(columnWidth,10);if(!isNaN(units)&&units>0){analyzedColumnWidth=units}}return{columnWidth:analyzedColumnWidth,columnWidthRatio:analyzedColumnWidthRatio,columnWidthHasAsterisk:hasAsterisk}},_analyzeGlHeight:function(){var i,gl=this._opt.gridLayout,columnHeight=gl.columnHeight,mt=gl.marginTop,elHeight=this.element.height(),analyzedColumnHeight;if(columnHeight){if(typeof columnHeight==="string"){analyzedColumnHeight=this._analyzeGlColumnHeight(columnHeight,elHeight,mt);gl.columnHeight=analyzedColumnHeight.columnHeight;gl.columnHeightRatio=analyzedColumnHeight.columnHeightRatio;gl.columnHeightHasAsterisk=analyzedColumnHeight.columnHeightHasAsterisk}else if($.isArray(columnHeight)){gl.columnHeightRatio=[];gl.columnHeightHasAsterisk=[];for(i=0;i<columnHeight.length;i++){analyzedColumnHeight=this._analyzeGlColumnHeight(columnHeight[i],elHeight,mt);gl.columnHeight[i]=analyzedColumnHeight.columnHeight;gl.columnHeightRatio.push(analyzedColumnHeight.columnHeightRatio);gl.columnHeightHasAsterisk.push(analyzedColumnHeight.columnHeightHasAsterisk)}}}},_analyzeGlColumnHeight:function(columnHeight,elHeight,marginTop){var units,analyzedColumnHeight=columnHeight,analyzedColumnHeightRatio=null,hasAsterisk=false;if(columnHeight.indexOf("%")!==-1){units=columnHeight.substring(0,columnHeight.length-1);units=parseInt(units,10)/100;if(!isNaN(units)&&units>0){analyzedColumnHeightRatio=units;analyzedColumnHeight=Math.floor(elHeight*units-marginTop)}}else if(columnHeight==="*"){hasAsterisk=true}else{units=parseInt(columnHeight,10);if(!isNaN(units)&&units>0){analyzedColumnHeight=units}}return{columnHeight:analyzedColumnHeight,columnHeightRatio:analyzedColumnHeightRatio,columnHeightHasAsterisk:hasAsterisk}},_analyzeGlItems:function(){var gl=this._opt.gridLayout,items=this.options.items,cols=0,rows=0,item,itemCols,itemRows,i;for(i=0;items.length>i;i++){item=items[i];itemCols=item.colIndex+item.colSpan;itemRows=item.rowIndex+item.rowSpan;if(itemCols>cols){cols=itemCols}if(itemRows>rows){rows=itemRows}}if(cols>0){gl.cols=cols}if(rows>0){gl.rows=rows}},_analyzeGlColsRows:function(){var gl=this._opt.gridLayout,elWidth=this.element.width(),elHeight=this.element.height(),itemsLength=this.options.items.length,isColumnWidthNumber=gl.columnWidth&&typeof gl.columnWidth==="number"&&gl.columnWidth>0,isColumnWidthArray=gl.columnWidth&&$.isArray(gl.columnWidth),isColumnHeightNumber=gl.columnHeight&&typeof gl.columnHeight==="number"&&gl.columnHeight>0,isColumnHeightArray=gl.columnHeight&&$.isArray(gl.columnHeight),colsOption=false,rowsOption=false;if(isColumnWidthArray){gl.cols=gl.columnWidth.length}if(isColumnHeightArray){gl.rows=gl.columnHeight.length}colsOption=typeof gl.cols==="number"&&gl.cols>0;rowsOption=typeof gl.rows==="number"&&gl.rows>0;if(!colsOption){if(rowsOption){gl.cols=Math.ceil(itemsLength/gl.rows)}else{if(isColumnWidthNumber){gl.cols=Math.floor(elWidth/(gl.columnWidth+gl.marginLeft));gl.rows=Math.ceil(itemsLength/gl.cols)}else if(isColumnHeightNumber){gl.rows=Math.floor(elHeight/(gl.columnHeight+gl.marginTop));gl.cols=Math.ceil(itemsLength/gl.rows)}else{gl.cols=Math.ceil(Math.sqrt(itemsLength));gl.rows=Math.ceil(itemsLength/gl.cols)}}}else if(!rowsOption){gl.rows=Math.ceil(itemsLength/gl.cols)}return{hasColsInitially:colsOption,hasRowsInitially:rowsOption}},_analyzeGlNotSetWidthHeight:function(){var gl=this._opt.gridLayout,elWidth=this.element.width(),elHeight=this.element.height(),hasColumnWidth=typeof gl.columnWidth==="number"&&gl.columnWidth>0||gl.columnWidth==="*"||gl.columnWidth&&$.isArray(gl.columnWidth)&&this._isColumnsWidthOrHeightValid(gl.columnWidth),hasColumnHeight=typeof gl.columnHeight==="number"&&gl.columnHeight>0||gl.columnHeight==="*"||gl.columnHeight&&$.isArray(gl.columnHeight)&&this._isColumnsWidthOrHeightValid(gl.columnHeight);if(!hasColumnWidth){gl.columnWidth=Math.floor(elWidth*(1/gl.cols)-gl.marginLeft);gl.columnWidthRatio=1/gl.cols}if(!hasColumnHeight){gl.columnHeight=Math.floor(elHeight*(1/gl.rows)-gl.marginTop);gl.columnHeightRatio=1/gl.rows}},_isColumnsWidthOrHeightValid:function(arr){var i,isValid=arr&&arr.length>0;for(i=0;i<arr.length;i++){isValid=typeof arr[i]==="number"&&arr[i]>0||arr[i]==="*";if(!isValid){break}}return isValid},_analyzeGlWidthAsterisks:function(){var gl=this._opt.gridLayout,elWidth=this._getContainerWidthNoScroll(),ml=gl.marginLeft,asterisksCount=0,i=0,occupiedWidth=0,widthForAsterisks,widthPerAsterisk,updated=false;if($.isArray(gl.columnWidthHasAsterisk)){for(i=0;i<gl.columnWidth.length;i++){if(gl.columnWidthHasAsterisk[i]){asterisksCount++}else{occupiedWidth+=gl.columnWidth[i]+ml}}if(asterisksCount>0){widthForAsterisks=elWidth-occupiedWidth;widthPerAsterisk=Math.floor(widthForAsterisks/asterisksCount)-ml;for(i=0;i<gl.columnWidth.length;i++){if(gl.columnWidthHasAsterisk[i]){gl.columnWidth[i]=widthPerAsterisk;updated=true}}}}else if(gl.columnHeightHasAsterisk){gl.columnWidth=Math.floor(elWidth/gl.cols)-ml;updated=true}return updated},_analyzeGlHeightAsterisks:function(){var gl=this._opt.gridLayout,elHeight=this._getContainerHeightNoScroll(),mt=gl.marginTop,asterisksCount=0,i=0,occupiedHeight=0,heightForAsterisks,heightPerAsterisk,updated=false;if($.isArray(gl.columnHeightHasAsterisk)){for(i=0;i<gl.columnHeight.length;i++){if(gl.columnHeightHasAsterisk[i]){asterisksCount++}else{occupiedHeight+=gl.columnHeight[i]+mt}}if(asterisksCount>0){heightForAsterisks=elHeight-occupiedHeight;heightPerAsterisk=Math.floor(heightForAsterisks/asterisksCount)-mt;for(i=0;i<gl.columnHeight.length;i++){if(gl.columnHeightHasAsterisk[i]){gl.columnHeight[i]=heightPerAsterisk;updated=true}}}}else if(gl.columnHeightHasAsterisk){gl.columnHeight=Math.floor(elHeight/gl.rows)-mt;updated=true}return updated},_analyzeGlAutoAdjust:function(hasColsOptionInitially,hasRowsOptionInitially){var gl=this._opt.gridLayout,hasColumnWidth=typeof gl.columnWidth==="number"&&gl.columnWidth>0||$.isArray(gl.columnWidth),hasColumnHeight=typeof gl.columnHeight==="number"&&gl.columnHeight>0||$.isArray(gl.columnHeight);if(!hasColumnHeight&&!hasColsOptionInitially&&!this._hasGlColumnWidthRatio()){gl.autoAdjustColumnHeight=true}if(!hasColumnWidth&&!hasRowsOptionInitially&&!this._hasGlColumnHeightRatio()){gl.autoAdjustColumnWidth=true}},_hasGlColumnWidthRatio:function(){var gl=this._opt.gridLayout,i;if($.isArray(gl.columnWidthRatio)){for(i=0;i<gl.columnWidthRatio.length;i++){if(gl.columnWidthRatio[i]){return true}}}else if(gl.columnWidthRatio){return true}return false},_hasGlColumnHeightRatio:function(){var gl=this._opt.gridLayout,i;if($.isArray(gl.columnHeightRatio)){for(i=0;i<gl.columnHeightRatio.length;i++){if(gl.columnHeightRatio[i]){return true}}}else if(gl.columnHeightRatio){return true}return false},_hasGlColumnWidthAsterisks:function(){var gl=this._opt.gridLayout,i;if($.isArray(gl.columnWidthHasAsterisk)){for(i=0;i<gl.columnWidthHasAsterisk.length;i++){if(gl.columnWidthHasAsterisk[i]){return true}}}else if(gl.columnWidthHasAsterisk){return true}return false},_hasGlColumnHeightAsterisks:function(){var gl=this._opt.gridLayout,i;if($.isArray(gl.columnHeightHasAsterisk)){for(i=0;i<gl.columnHeightHasAsterisk.length;i++){if(gl.columnHeightHasAsterisk[i]){return true}}}else if(gl.columnHeightHasAsterisk){return true}return false},_analyzeGlConfiguration:function(){var hasColsRowsOptionsInitially=null;this._analyzeGlWidth();this._analyzeGlHeight();this._analyzeGlItems();hasColsRowsOptionsInitially=this._analyzeGlColsRows();this._analyzeGlNotSetWidthHeight();this._analyzeGlWidthAsterisks();this._analyzeGlHeightAsterisks();this._analyzeGlAutoAdjust(hasColsRowsOptionsInitially.hasColsInitially,hasColsRowsOptionsInitially.hasRowsInitially)},_createGlConfig:function(){var gl,e=this.element;this._opt.gridLayout=gl=$.extend(true,{},this.options.gridLayout,{elements:$(),minColCount:1,columnWidthRatio:null,columnWidthHasAsterisk:null,columnHeightRatio:null,columnHeightHasAsterisk:null,containerWidthNoScroll:e.width(),containerHeightNoScroll:e.height(),resizeItems:false,animating:false,autoAdjustColumnWidth:false,autoAdjustColumnHeight:false,initialCols:0,initialRows:0,initialColWidth:0,initialColWidthRatio:null,initialColHeight:0,initialColHeightRatio:null,initialItems:[],initialReflow:true,useOffset:(e.css("position")==="static"||e.css("position")==="fixed")&&this.options.gridLayout.useOffset?true:false,destroyItemsFromIndex:e.children().length});if(typeof gl.cols==="string"){gl.cols=parseInt(gl.cols,10)}if(typeof gl.rows==="string"){gl.rows=parseInt(gl.rows,10)}this._analyzeGlConfiguration();gl.resizeItems=!!(this._hasGlColumnWidthRatio()||this._hasGlColumnHeightRatio())},_glSortItemsByPositionOrder:function(){var items=this.options.items,compareFunc=function(item1,item2){return item1.rowIndex!==item2.rowIndex?item1.rowIndex-item2.rowIndex:item1.colIndex-item2.colIndex};items=items.sort(compareFunc)},_renderGlItemsFromItemsConfig:function(initialRendering){var i,item,itemData,width,height,top,left,row,col,colSpan,rowSpan,$currChild,renderNewItem,e=this.element,items=this.options.items,gl=this._opt.gridLayout,ml=gl.marginLeft,mt=gl.marginTop,colWidth=$.isArray(gl.columnWidth)?null:gl.columnWidth,colsWidthMatrix=$.isArray(gl.columnWidth)?this._calculateColumnsWidthOrHeightMatrix(gl.columnWidth):null,colHeight=$.isArray(gl.columnHeight)?null:gl.columnHeight,colsHeightMatrix=$.isArray(gl.columnHeight)?this._calculateColumnsWidthOrHeightMatrix(gl.columnHeight):null,offset=e.igOffset(),$children=e.children();for(i=0;i<items.length;i++){itemData=items[i];$currChild=$children.eq(i);renderNewItem=$currChild.length===0;colSpan=itemData.colSpan=typeof itemData.colSpan==="number"?itemData.colSpan:1;rowSpan=itemData.rowSpan=typeof itemData.rowSpan==="number"?itemData.rowSpan:1;row=itemData.rowIndex=typeof itemData.rowIndex==="number"?itemData.rowIndex:Math.floor(i/gl.cols);col=itemData.colIndex=typeof itemData.colIndex==="number"?itemData.colIndex:i%gl.cols;if(renderNewItem||initialRendering){this._trigger(this.events.itemRendering,null,{itemData:itemData,index:i})}if(renderNewItem){item=$("<div>").appendTo(this.element)}else{item=$currChild}itemData.item=item;gl.elements=gl.elements.add(item);if(colSpan>gl.minColCount){gl.minColCount=colSpan}width=this._calculateGlItemWidth(col,colSpan,colWidth,colsWidthMatrix,ml);height=this._calculateGlItemHeight(row,rowSpan,colHeight,colsHeightMatrix,mt);left=this._calculateGlItemLeft(col,colWidth,colsWidthMatrix,ml);top=this._calculateGlItemTop(row,colHeight,colsHeightMatrix,mt);if(gl.useOffset){top+=offset.top;left+=offset.left}item.addClass(this.css.item).addClass(this.css.gridItemAbs).attr("data-index",i).css({top:top,left:left,width:width,height:height});if(renderNewItem||initialRendering){this._trigger(this.events.itemRendered,null,{item:item,itemData:itemData,index:i})}}this._glSortItemsByPositionOrder();$children.slice(items.length).remove();if(initialRendering){this._trigger(this.events.rendered,null,{items:this.options.items})}},_calculateColumnsWidthOrHeightMatrix:function(sizes){var sizesMatrix=[],i=0,j=0,size=sizes.length;sizesMatrix.push(sizes.slice());for(i=0;i<size-1;i++){sizesMatrix.push(new Array(size))}for(j=1;j<size;j++){for(i=1;i<size;i++){if(sizesMatrix[i-1][j-1]){sizesMatrix[i][j]=sizesMatrix[0][j]+sizesMatrix[i-1][j-1]}}}return sizesMatrix},_calculateGlItemWidth:function(col,colSpan,colWidth,colsWidthMatrix,marginLeft){var baseWidth,width;if(colWidth){baseWidth=colSpan*colWidth}else{baseWidth=colsWidthMatrix[colSpan-1][col+colSpan-1]}width=baseWidth+(colSpan-1)*marginLeft;return width},_calculateGlItemHeight:function(row,rowSpan,colHeight,colsHeightMatrix,marginTop){var baseHeight,height;if(colHeight){baseHeight=rowSpan*colHeight}else{baseHeight=colsHeightMatrix[rowSpan-1][row+rowSpan-1]}height=baseHeight+(rowSpan-1)*marginTop;return height},_calculateGlItemLeft:function(col,colWidth,colsWidthMatrix,marginLeft){var baseLeft=0,left;if(col>0){if(colWidth){baseLeft=col*colWidth}else{baseLeft=colsWidthMatrix[col-1][col-1]}}left=baseLeft+(col+1)*marginLeft;return left},_calculateGlItemTop:function(row,colHeight,colsHeightMatrix,marginTop){var baseTop=0,top;if(row>0){if(colHeight){baseTop=row*colHeight}else{baseTop=colsHeightMatrix[row-1][row-1]}}top=baseTop+(row+1)*marginTop;return top},_initGlFromItemsConfig:function(initialRendering){this._createGlConfig();this._renderGlItemsFromItemsConfig(initialRendering);this.reflow(false,0)},_renderGlItemsFromColsRows:function(initialRendering){var i,j,width,height,top,left,item,e=this.element,gl=this._opt.gridLayout,ml=gl.marginLeft,mt=gl.marginTop,rows=gl.rows,cols=gl.cols,colWidth=$.isArray(gl.columnWidth)?null:gl.columnWidth,colsWidthMatrix=$.isArray(gl.columnWidth)?this._calculateColumnsWidthOrHeightMatrix(gl.columnWidth):null,colHeight=$.isArray(gl.columnHeight)?null:gl.columnHeight,colsHeightMatrix=$.isArray(gl.columnHeight)?this._calculateColumnsWidthOrHeightMatrix(gl.columnHeight):null,offset=e.igOffset();for(i=0;i<rows;i++){for(j=0;j<cols;j++){width=this._calculateGlItemWidth(j,1,colWidth,colsWidthMatrix,ml);height=this._calculateGlItemHeight(i,1,colHeight,colsHeightMatrix,mt);top=this._calculateGlItemTop(i,colHeight,colsHeightMatrix,mt);left=this._calculateGlItemLeft(j,colWidth,colsWidthMatrix,ml);if(gl.useOffset){top+=offset.top;left+=offset.left}item=$("<div>").appendTo(this.element).addClass(this.css.item).addClass(this.css.gridItemAbs).attr("data-index",i*gl.cols+j).css({top:top,left:left,width:width,height:height});this._trigger(this.events.itemRendered,null,{item:item})}}if(initialRendering){this._trigger(this.events.rendered,null,{items:this.options.items})}},_initGlFromColsRows:function(initialRendering){this._createGlConfig();this._renderGlItemsFromColsRows(initialRendering)},_initGridLayout:function(){var i,items=this.options.items,e=this.element,$children=e.children(),lenDiff=$children.length-this.options.items.length;if(lenDiff>0){for(i=0;i<lenDiff;i++){this.options.items.push({})}}if(items&&items.length>0){this._initGlFromItemsConfig(true)}else if($children.length===0){this._initGlFromColsRows(true)}},_setGlInitialConfig:function(){var gl=this._opt.gridLayout;gl.initialCols=gl.cols;gl.initialRows=gl.rows;gl.initialColWidth=gl.columnWidth;gl.initialColWidthRatio=gl.columnWidthRatio;gl.initialColHeight=gl.columnHeight;gl.initialColHeightRatio=gl.columnHeightRatio;gl.initialItems=$.extend(true,[],this.options.items)},_getContainerWidthNoScroll:function(){var widthNoScroll;if($.ig.util.isWebKit&&window.getComputedStyle){widthNoScroll=parseInt(window.getComputedStyle(this.element[0]).width,10)}else{widthNoScroll=this.element.width()-($.ig.util.hasVerticalScroll(this.element)?this._opt.scrollBarWidth:0)}return widthNoScroll},_getContainerHeightNoScroll:function(){var heightNoScroll;if($.ig.util.isWebKit&&window.getComputedStyle){heightNoScroll=parseInt(window.getComputedStyle(this.element[0]).height,10)}else{heightNoScroll=this.element.height()-($.ig.util.hasHorizontalScroll(this.element)?this._opt.scrollBarHeight:0)}return heightNoScroll},_glReflowNeeded:function(){var gl=this._opt.gridLayout,newContainerWidthNoScroll=this._getContainerWidthNoScroll(),newContainerHeightNoScroll=this._getContainerHeightNoScroll(),reflowNeeded=false,colsCouldBeAdjusted=false;colsCouldBeAdjusted=gl.columnWidth&&!$.isArray(gl.columnWidth)&&gl.cols!==Math.floor(newContainerWidthNoScroll/(gl.columnWidth+gl.marginLeft));reflowNeeded=gl.containerWidthNoScroll!==newContainerWidthNoScroll&&(this._hasGlColumnWidthRatio()||this._hasGlColumnWidthAsterisks()||colsCouldBeAdjusted);reflowNeeded=reflowNeeded||gl.containerHeightNoScroll!==newContainerHeightNoScroll&&(this._hasGlColumnHeightRatio()||this._hasGlColumnHeightAsterisks());return reflowNeeded},_reflowGlConfiguration:function(forceReflow,animationDuration,event){var self=this,e=this.element,gl=this._opt.gridLayout,ml=gl.marginLeft,mt=gl.marginTop,items=this.options.items,newContainerWidthNoScroll=this._getContainerWidthNoScroll(),newContainerHeightNoScroll=this._getContainerHeightNoScroll(),leftOffset=gl.useOffset?e.igOffset().left:0,topOffset=gl.useOffset?e.igOffset().top:0,colWidth,colHeight,colsWidthMatrix,colsHeightMatrix,col,row,colSpan,rowSpan,newColCount,newDim,helperArray,itemData,colWidthChanged,colHeightChanged,positionsChanged,foundMatch,currentRow,item,i,j,k,r,n,rearrangeCallback=function(){if(!gl.elements.is(":animated")){gl.animating=false;if(self._glReflowNeeded()){self.reflow(false,animationDuration,event)}else{self._triggerInternalResized(event)}}};if(items){if(gl.containerWidthNoScroll!==newContainerWidthNoScroll){colWidthChanged=this._updateGlColumnWidthByRatio(newContainerWidthNoScroll)}else{colWidthChanged=false}if(gl.containerHeightNoScroll!==newContainerHeightNoScroll){colHeightChanged=this._updateGlColumnHeightByRatio(newContainerHeightNoScroll)}else{colHeightChanged=false}if(gl.autoAdjustColumnWidth&&(gl.containerHeightNoScroll!==newContainerHeightNoScroll&&gl.rearrangeItems||forceReflow)){gl.rows=Math.max(Math.floor(newContainerHeightNoScroll/(gl.columnHeight+mt)),1);gl.columnWidthRatio=1/Math.ceil(items.length/gl.rows);gl.columnWidth=Math.floor(newContainerWidthNoScroll*gl.columnWidthRatio-ml);colWidthChanged=true}gl.containerWidthNoScroll=newContainerWidthNoScroll;gl.containerHeightNoScroll=newContainerHeightNoScroll;if(gl.rearrangeItems||forceReflow){if(gl.rearrangeItems){if(gl.columnWidthRatio&&!$.isArray(gl.columnWidthRatio)){newColCount=Math.floor(1/gl.columnWidthRatio)}else if(gl.columnWidth&&!$.isArray(gl.columnWidth)){newColCount=Math.floor(newContainerWidthNoScroll/(gl.columnWidth+ml))}else{newColCount=gl.cols}if(newColCount!==gl.cols&&$.isArray(gl.columnHeight)){if(Math.ceil(items.length/newColCount)!==gl.columnHeight.length){newColCount=gl.cols}else{colWidthChanged=colHeightChanged=true}}}else{if(gl.autoAdjustColumnWidth){newColCount=Math.ceil(items.length/gl.rows)}else if(gl.autoAdjustColumnHeight){newColCount=Math.floor(newContainerWidthNoScroll/(gl.columnWidth+ml))}else{newColCount=gl.cols}}if(gl.minColCount>newColCount){newColCount=gl.minColCount}if(newColCount!==gl.cols||forceReflow){if(newColCount===gl.initialCols){items=this.options.items=$.extend(true,[],gl.initialItems);gl.rows=gl.initialRows;gl.cols=gl.initialCols}else{gl.cols=newColCount;helperArray=[[]];helperArray[0].length=gl.cols||0;for(i=0;i<items.length;i++){itemData=items[i];colSpan=itemData.colSpan;rowSpan=itemData.rowSpan;foundMatch=false;for(j=0;j<helperArray.length&&!foundMatch;j++){for(k=0;k<helperArray[j].length&&!foundMatch;k++){if(!helperArray[j][k]){foundMatch=true;for(r=0;foundMatch&&r<rowSpan*colSpan;r++){if(colSpan>helperArray[j].length-k){foundMatch=false}else{currentRow=j+Math.floor(r/colSpan);if(!helperArray[currentRow]){helperArray[currentRow]=[];helperArray[currentRow].length=gl.cols}if(helperArray[currentRow][k+r%colSpan]===1){foundMatch=false}}}}if(foundMatch){itemData.rowIndex=j;itemData.colIndex=k;for(n=0;n<rowSpan*colSpan;n++){helperArray[itemData.rowIndex+Math.floor(n/colSpan)][itemData.colIndex+n%colSpan]=1}}else if(j===helperArray.length-1&&k===helperArray[j].length-1){helperArray[j+1]=[];helperArray[j+1].length=gl.cols}}}}if(gl.autoAdjustColumnHeight&&gl.rows!==helperArray.length){gl.columnHeightRatio=1/helperArray.length;gl.columnHeight=Math.floor(newContainerHeightNoScroll*gl.columnHeightRatio-mt);colHeightChanged=true}gl.rows=helperArray.length}positionsChanged=true}}if(colWidthChanged||colHeightChanged||positionsChanged||forceReflow){colWidth=$.isArray(gl.columnWidth)?null:gl.columnWidth;colsWidthMatrix=$.isArray(gl.columnWidth)?this._calculateColumnsWidthOrHeightMatrix(gl.columnWidth):null;colHeight=$.isArray(gl.columnHeight)?null:gl.columnHeight;colsHeightMatrix=$.isArray(gl.columnHeight)?this._calculateColumnsWidthOrHeightMatrix(gl.columnHeight):null;gl.animating=positionsChanged&&animationDuration>0||gl.animating;for(i=0;i<items.length;i++){itemData=items[i];item=itemData.item;row=itemData.rowIndex;col=itemData.colIndex;colSpan=itemData.colSpan;rowSpan=itemData.rowSpan;newDim={};if(positionsChanged||gl.animating){newDim.left=this._calculateGlItemLeft(col,colWidth,colsWidthMatrix,ml)+leftOffset;newDim.top=this._calculateGlItemTop(row,colHeight,colsHeightMatrix,mt)+topOffset;if(colWidthChanged||forceReflow){newDim.width=this._calculateGlItemWidth(col,colSpan,colWidth,colsWidthMatrix,ml)}if(colHeightChanged||forceReflow){newDim.height=this._calculateGlItemHeight(row,rowSpan,colHeight,colsHeightMatrix,mt)}if(animationDuration>0){item.animate(newDim,{duration:animationDuration,queue:false,complete:rearrangeCallback})}else{item.css(newDim)}}else{if(colWidthChanged||forceReflow){newDim.left=this._calculateGlItemLeft(col,colWidth,colsWidthMatrix,ml)+leftOffset;newDim.width=this._calculateGlItemWidth(col,colSpan,colWidth,colsWidthMatrix,ml)}if(colHeightChanged||forceReflow){newDim.top=this._calculateGlItemTop(row,colHeight,colsHeightMatrix,mt)+topOffset;newDim.height=this._calculateGlItemHeight(row,rowSpan,colHeight,colsHeightMatrix,mt)}item.css(newDim)}}}if(!gl.animating){if(this._glReflowNeeded()){this.reflow(false,animationDuration,event)}else{if(gl.initialReflow){this._setGlInitialConfig();gl.initialReflow=false}this._triggerInternalResized(event)}}}},_updateGlColumnWidthByRatio:function(newContainerWidthNoScroll){var gl=this._opt.gridLayout,ml=gl.marginLeft,columnWidthUpdated=false,i;if($.isArray(gl.columnWidthRatio)){for(i=0;i<gl.columnWidthRatio.length;i++){if(gl.columnWidthRatio[i]){gl.columnWidth[i]=Math.floor(newContainerWidthNoScroll*gl.columnWidthRatio[i]-ml);columnWidthUpdated=true}}}else if(gl.columnWidthRatio){gl.columnWidth=Math.floor(newContainerWidthNoScroll*gl.columnWidthRatio-ml);columnWidthUpdated=true}columnWidthUpdated=this._analyzeGlWidthAsterisks()||columnWidthUpdated;return columnWidthUpdated},_updateGlColumnHeightByRatio:function(newContainerHeightNoScroll){var gl=this._opt.gridLayout,mt=gl.marginTop,columnHeightUpdated=false,i;if($.isArray(gl.columnHeightRatio)){for(i=0;i<gl.columnHeightRatio.length;i++){if(gl.columnHeightRatio[i]){gl.columnHeight[i]=Math.floor(newContainerHeightNoScroll*gl.columnHeightRatio[i]-mt);columnHeightUpdated=true}}}else if(gl.columnHeightRatio){gl.columnHeight=Math.floor(newContainerHeightNoScroll*gl.columnHeightRatio-mt);columnHeightUpdated=true}columnHeightUpdated=this._analyzeGlHeightAsterisks()||columnHeightUpdated;return columnHeightUpdated},_initBorderLayout:function(){var left,right,center,header,footer,rwidth,lwidth,container,sections,maxHeight,currHeight,i,bl=this.options.borderLayout;this.element.addClass(this.css.border);left=this.element.find(".left");header=this.element.find(".header");right=this.element.find(".right");center=this.element.find(".center");footer=this.element.find(".footer");if(left.length===0){this._trigger(this.events.itemRendering,null,{region:"left"});left=$("<div></div>").appendTo(this.element);this._removeLeft=true;this._trigger(this.events.itemRendered,null,{region:"left",element:left})}if(bl.showLeft){left.removeClass(this.css.borderItemHidden)}else{left.addClass(this.css.borderItemHidden)}left.addClass(this.css.borderItem).addClass(this.css.borderLeft);if(right.length===0){this._trigger(this.events.itemRendering,null,{region:"right"});right=$("<div></div>").appendTo(this.element);this._removeRight=true;this._trigger(this.events.itemRendered,null,{region:"right",element:right})}if(bl.showRight){right.removeClass(this.css.borderItemHidden)}else{right.addClass(this.css.borderItemHidden)}right.addClass(this.css.borderItem).addClass(this.css.borderRight);if(center.length===0){this._trigger(this.events.itemRendering,null,{region:"center"});center=$("<div></div>").appendTo(this.element);this._removeCenter=true;this._trigger(this.events.itemRendered,null,{region:"center",element:center})}center.addClass(this.css.borderItem).addClass(this.css.borderCenter);if(footer.length===0){this._trigger(this.events.itemRendering,null,{region:"footer"});footer=$("<div></div>").appendTo(this.element);this._removeFooter=true;this._trigger(this.events.itemRendered,null,{region:"footer",element:footer})}if(bl.showFooter){footer.removeClass(this.css.borderItemHidden)}else{footer.addClass(this.css.borderItemHidden)}footer.addClass(this.css.borderItem).addClass(this.css.borderFooter);if(header.length===0){this._trigger(this.events.itemRendering,null,{region:"header"});header=$("<div></div>").appendTo(this.element);this._removeHeader=true;this._trigger(this.events.itemRendered,null,{region:"header",element:header})}if(bl.showHeader){header.removeClass(this.css.borderItemHidden)}else{header.addClass(this.css.borderItemHidden)}header.addClass(this.css.borderItem).addClass(this.css.borderHeader);container=$("<div></div>").appendTo(this.element).addClass(this.css.borderContainer).append(left).append(right).append(center);this.element.append(footer);if(bl.leftWidth!==null&&bl.showLeft){left.css("width",bl.leftWidth)}else if(bl.showLeft===false||left.length===0){container.css("padding-left",0)}if(bl.rightWidth!==null&&bl.showRight){
right.css("width",bl.rightWidth)}else if(bl.showRight===false||right.length===0){container.css("padding-right",0)}lwidth=bl.leftWidth&&bl.leftWidth.indexOf&&bl.leftWidth.indexOf("%")!==-1?0:parseInt(bl.leftWidth,10);rwidth=bl.rightWidth&&bl.rightWidth.indexOf&&bl.rightWidth.indexOf("%")!==-1?0:parseInt(bl.rightWidth,10);this.element.css("min-width",lwidth+rwidth);this._opt.borderLayout={header:header,footer:footer,paddingTop:null,paddingBottom:null};this._setBorderLayoutPaddings();if(this.options.height===null){sections=left.add(right).add(center);for(i=0,maxHeight=0;i<sections.length;i++){currHeight=sections.eq(i).hasClass(this.css.borderItemHidden)?0:sections.eq(i).outerHeight(true);if(currHeight>maxHeight){maxHeight=currHeight}}this.element.height(maxHeight)}this._trigger(this.events.rendered,null,{owner:this})},_setBorderLayoutPaddings:function(){var headerHeight,footerHeight,isHeaderHidden,isFooterHidden,_bl=this._opt.borderLayout;if(_bl.header.length){isHeaderHidden=_bl.header.hasClass(this.css.borderItemHidden);headerHeight=isHeaderHidden?0:_bl.header.outerHeight(true);if(_bl.paddingTop!==headerHeight){_bl.paddingTop=headerHeight;this.element.css("paddingTop",_bl.paddingTop)}}if(_bl.footer.length){isFooterHidden=_bl.footer.hasClass(this.css.borderItemHidden);footerHeight=isFooterHidden?0:_bl.footer.outerHeight(true);if(_bl.paddingBottom!==footerHeight){_bl.paddingBottom=footerHeight;this.element.css("paddingBottom",_bl.paddingBottom)}}},_initFlowLayout:function(){var i,length=this.options.itemCount,items=this.options.items,item;this.element.addClass(this.css.flow);if(length>0){for(i=0;i<length;i++){this._trigger(this.events.itemRendering,null,{index:i});item=$("<li></li>").appendTo(this.element).addClass(this.css.flowItem);this.options.destroyItems=true;this._trigger(this.events.itemRendered,null,{item:item,index:i})}this._trigger(this.events.rendered,null,{owner:this})}else if(items&&items.length>0){this.element.empty();for(i=0;i<items.length;i++){this._trigger(this.events.itemRendering,null,{itemData:items[i],index:i});item=$("<li></li>").appendTo(this.element).addClass(this.css.flowItem);if(items[i].width){item.css("width",items[i].width)}if(items[i].height){item.css("height",items[i].height)}this._trigger(this.events.itemRendered,null,{item:item,index:i})}this.options.destroyItems=true;this._trigger(this.events.rendered,null,{owner:this})}else{this.element.children().addClass(this.css.flowItem)}},_triggerInternalResizing:function(event){var args={owner:this};return this._trigger(this.events.internalResizing,event,args)},_triggerInternalResized:function(event){var args={owner:this};return this._trigger(this.events.internalResized,event,args)},_destroyBorderLayout:function(){this.element.removeClass(this.css.border);if(this.element.find("."+this.css.borderLeft).length){this.element.find("."+this.css.borderLeft).unwrap()}else{this.element.find("."+this.css.borderRight).unwrap()}if(this._removeLeft){this.element.children("."+this.css.borderLeft).remove()}if(this._removeRight){this.element.children("."+this.css.borderRight).remove()}if(this._removeCenter){this.element.children("."+this.css.borderCenter).remove()}if(this._removeHeader){this.element.children("."+this.css.borderHeader).remove()}if(this._removeFooter){this.element.children("."+this.css.borderFooter).remove()}this.element.children().removeClass(this.css.borderItem).removeClass(this.css.borderLeft).removeClass(this.css.borderRight).removeClass(this.css.borderCenter).removeClass(this.css.borderFooter).removeClass(this.css.borderHeader);this.element.find("."+this.css.borderItemHidden).removeClass(this.css.borderItemHidden)},_destroyGridLayout:function(){var $children=this.element.children();$children.slice(this._opt.gridLayout.destroyItemsFromIndex).remove();$children.removeClass(this.css.item).removeClass(this.css.gridItemAbs).removeClass(this.css.gridItemRel).removeAttr("data-index")},_destroyFlowLayout:function(){this.element.removeClass(this.css.flow);if(this.options.destroyItems){this.element.empty()}else{this.element.children().removeClass(this.css.flowItem)}},_destroyVerticalLayout:function(){this.element.removeClass(this.css.vertical);if(this.options.destroyItems){this.element.empty()}else{this.element.children().removeClass(this.css.verticalItem)}},destroy:function(){this._superApply(arguments);this.element.removeClass(this.css.container);switch(this.options.layoutMode){case"grid":this._destroyGridLayout();break;case"border":this._destroyBorderLayout();break;case"flow":this._destroyFlowLayout();break;case"vertical":this._destroyVerticalLayout();break;default:break}if(this._opt.resizeLayout){$(window).off("resize",this._opt.eventHandlers.windowResizeHandler)}return this}});$.extend($.ui.igLayoutManager,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI Splitter 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *  jquery.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.util.js
 *  infragistics.util.jquery.js
 *  infragistics.ui.widget.js
 *	infragistics.ui.splitter-en.js
 */
(function($){$.widget("ui.igSplitter",$.ui.igWidget,{_const:{orientations:{horizontal:{size:"height",oppositeSize:"width",outerSize:"outerHeight",dimention:"top",start:"_startY",mouse:"_mouseStartY",page:"pageY",keyboard:["UP","DOWN"]},vertical:{size:"width",oppositeSize:"height",outerSize:"outerWidth",dimention:"left",start:"_startX",mouse:"_mouseStartX",page:"pageX",keyboard:["LEFT","RIGHT"]}},properties:["max","_max","min","_min","size","collapsed","collapsible","resizable"],step:10,touchEvents:{mousedown:"touchstart",mouseup:"touchend",mousemove:"touchmove",mouseenter:"",mouseleave:"",focus:"focus",blur:"blur",keydown:"keydown"}},css:{splitter:"ui-igsplitter ui-widget ui-widget-content",verticalPanel:"ui-igsplitter-panel-vertical ui-widget-content",horizontalPanel:"ui-igsplitter-panel-horizontal ui-widget-content",bar:"ui-igsplitter-splitbar",barNormal:"ui-igsplitter-splitbar-default ui-state-default",barCollapsed:"ui-igsplitter-splitbar-collapsed",barHover:"ui-igsplitter-splitbar-hover ui-state-hover",barActive:"ui-igsplitter-splitbar-focus ui-state-focus",barInvalid:"ui-igsplitter-splitbar-invalid",resizeHandler:"ui-igsplitter-splitbar-resize-handler",resizeHandlerInner:"ui-igsplitter-splitbar-resize-handler-inner",verticalCollapseButtonLeftExpanded:"ui-igsplitter-collapse-button-vertical-left",verticalCollapseButtonLeftExpandedIcon:"ui-icon ui-icon-triangle-1-w",verticalCollapseButtonLeftCollapsed:"ui-igsplitter-collapse-button-vertical-left",verticalCollapseButtonLeftCollapsedIcon:"ui-icon ui-icon-triangle-1-e",verticalCollapseButtonRightExpanded:"ui-igsplitter-collapse-button-vertical-right",verticalCollapseButtonRightExpandedIcon:"ui-icon ui-icon-triangle-1-e",verticalCollapseButtonRightCollapsed:"ui-igsplitter-collapse-button-vertical-right",verticalCollapseButtonRightCollapsedIcon:"ui-icon ui-icon-triangle-1-w",horizontalCollapseButtonLeftExpanded:"ui-igsplitter-collapse-button-horizontal-left",horizontalCollapseButtonLeftExpandedIcon:"ui-icon ui-icon-triangle-1-n",horizontalCollapseButtonLeftCollapsed:"ui-igsplitter-collapse-button-horizontal-left",horizontalCollapseButtonLeftCollapsedIcon:"ui-icon ui-icon-triangle-1-s",horizontalCollapseButtonRightExpanded:"ui-igsplitter-collapse-button-horizontal-right",horizontalCollapseButtonRightExpandedIcon:"ui-icon ui-icon-triangle-1-s",horizontalCollapseButtonRightCollapsed:"ui-igsplitter-collapse-button-horizontal-right",horizontalCollapseButtonRightCollapsedIcon:"ui-icon ui-icon-triangle-1-n",collapseButtonDefault:"ui-state-default",collapseButtonSingle:"ui-igsplitter-collapse-single-button",collapseButtonPressed:"ui-igsplitter-collapse-button-pressed",collapseButtonHover:"ui-igsplitter-collapse-button-hover ui-state-hover",noScroll:"ui-igsplitter-no-scroll"},events:{collapsed:"collapsed",expanded:"expanded",resizeStarted:"resizeStarted",resizing:"resizing",resizeEnded:"resizeEnded",layoutRefreshing:"layoutRefreshing",layoutRefreshed:"layoutRefreshed"},options:{width:null,height:null,orientation:"vertical",panels:[{size:null,min:null,max:null,resizable:false,collapsed:false,collapsible:false}],dragDelta:3,resizeOtherSplitters:true},widget:function(){return this.element},_createWidget:function(){this.options.panels=[];this._opt={eventHandlers:{},defaultPanelSize:"50%",defaultPanelMaxSize:9007199254740992,calculateSizeCloneObject:{element:null,panels:[{options:{},element:null},{options:{},element:null}],bar:{element:null}}};this._superApply(arguments)},_create:function(){var splitters,length=$(this.element.children("div")).length;this._htmlMarkup=this.element.html();if(this.options.panels.length>2||length>2){throw new Error(this._getLocaleValue("errorPanels"))}if(length===1){this.element.append("<div/>")}else if(length===0){this.element.append("<div/>");this.element.append("<div/>")}this._panels=[];this._splitter={};splitters=$.data(document.body,"ig-splitters")||[];splitters.push(this.element);$.data(document.body,"ig-splitters",splitters);if(this.options.width){this.element.css("width",this.options.width)}if(this.options.height){this.element.css("height",this.options.height)}this._opt.barMouseDown=false;this._render();this._removeClasses();this._addClasses();this._removeEventHandlers();this._addEventHandlers();this._panelsLayout({isInit:true})},_setOption:function(option,value){var oldWidth,oldHeight;if(this.options[option]===value){return}this._super(option,value);switch(option){case"width":oldWidth=this.element.width();this.element.css("width",value);if(this.options.orientation==="vertical"){this._setPanelsNewWidth(value,oldWidth)}this._panelsLayout();break;case"height":oldHeight=this.element.height();this.element.css("height",value);if(this.options.orientation==="horizontal"){this._setPanelsNewHeight(value,oldHeight)}this._panelsLayout();break;case"orientation":case"panels":throw new Error(this._getLocaleValue("errorSettingOption"));default:break}},_setPanelsNewWidth:function(newWidth,oldWidth){var secondPanelRatio=this.secondPanel().width()/oldWidth;this.setSecondPanelSize(newWidth*secondPanelRatio)},_setPanelsNewHeight:function(newHeight,oldHeight){var secondPanelRatio=this.secondPanel().height()/oldHeight;this.setSecondPanelSize(newHeight*secondPanelRatio)},_render:function(){var panels=$(this.element.children("div")),panel,self=this,reducedSize,defaultSize=0,j,elementSize;reducedSize=this._reducedSize();if(this.options[this._getOrientation("size")]){elementSize=this._getOrientation("size")==="width"?this.element.width():this.element.height();defaultSize=elementSize-reducedSize.size}else{defaultSize=this._getSize(this._getOrientation("size"))-reducedSize.size}if(panels.length-reducedSize.length!==0){defaultSize=Math.floor(defaultSize/(panels.length-reducedSize.length))}if(this._panels.length<1){panels.each(function(i,element){panel=$(element);panel.options={max:self._opt.defaultPanelMaxSize,_max:"100%",min:0,_min:"0",collapsible:false,resizable:true,collapsed:false,size:panel[self._getOrientation("size")]()};for(j=0;j<self._const.properties.length;j++){if(self.options.panels[i]&&self.options.panels[i][self._const.properties[j]]!==undefined&&self.options.panels[i][self._const.properties[j]]!==null){panel.options[self._const.properties[j]]=self.options.panels[i][self._const.properties[j]]}else{if(self._const.properties[j]==="size"){if(panel[0].style[self._getOrientation("size")]!=="auto"&&panel[0].style[self._getOrientation("size")]!==""){panel.options.size=panel[self._getOrientation("size")]()}else{panel.options.size=defaultSize}}}}self._panels.push(panel)});this._createSplitter()}},_reducedSize:function(){var i,reducedSize={size:0,length:0},size=0;for(i=0;i<this.options.panels.length;i++){size=0;if(this.options.panels[i].size!==undefined){if(/%/.test(this.options.panels[i].size)){this.options.panels[i].size=this.options.panels[i].size.replace("%","")*this._getSize(this._getOrientation("size"))/100;this._isPercentLayout=true}if(/px/.test(this.options.panels[i].size)){this.options.panels[i].size=parseInt(this.options.panels[i].size,10)}size=this.options.panels[i].size;reducedSize.length+=1}if(this.options.panels[i].min!==undefined){if(/px/.test(this.options.panels[i].min)){this.options.panels[i].min=parseInt(this.options.panels[i].min,10)}if(/%/.test(this.options.panels[i].min)){this.options.panels[i]._min=this.options.panels[i].min;this.options.panels[i].min=this.options.panels[i].min.replace("%","")*this._getSize(this._getOrientation("size"))/100}}if(this.options.panels[i].max!==undefined){if(/px/.test(this.options.panels[i].max)){this.options.panels[i].max=parseInt(this.options.panels[i].max,10)}if(/%/.test(this.options.panels[i].max)){this.options.panels[i]._max=this.options.panels[i].max;this.options.panels[i].max=this.options.panels[i].max.replace("%","")*this._getSize(this._getOrientation("size"))/100}}reducedSize.size+=size}return reducedSize},_getSize:function(size){var borderWidth,boxSizing=this.element.css("box-sizing"),value;if(window.getComputedStyle!==undefined){value=parseInt(window.getComputedStyle(this.element[0])[size],10);var _getBorderWidth=function(element,orientation){var computedStyle=window.getComputedStyle(element[0]);if(orientation==="horizontal"){var leftBorder=isNaN(parseInt(computedStyle.borderLeftWidth,10))?0:parseInt(computedStyle.borderLeftWidth,10);var rightBorder=isNaN(parseInt(computedStyle.borderRightWidth,10))?0:parseInt(computedStyle.borderRightWidth,10);return Math.max(leftBorder,rightBorder)}else{var topBorder=isNaN(parseInt(computedStyle.borderTopWidth,10))?0:parseInt(computedStyle.borderTopWidth,10);var bottomBorder=isNaN(parseInt(computedStyle.borderBottomWidth,10))?0:parseInt(computedStyle.borderBottomWidth,10);return Math.max(topBorder,bottomBorder)}};if(boxSizing==="border-box"){if($.ig.util.isChrome&&$.ig.util.isChrome.webstore){borderWidth=this.element.css("border-width")===""?0:this.element.css("border-width");borderWidth=parseInt(borderWidth,10)}else{borderWidth=_getBorderWidth(this.element,this.options.orientation)}value-=borderWidth*2;return value}return value}return this.element[size]()},_getOrientation:function(property){return this._const.orientations[this.options.orientation][property]},_getEvent:function(event){if(this._isTouch()){return event+" "+this._const.touchEvents[event]}return event},_isTouch:function(event){var isTouch=$.ig.util.isTouch;if(event){isTouch=isTouch&&event.originalEvent.touches}return isTouch},_createSplitter:function(){var collapseButtons=$("<div><span></span></div><div><span></span></div>"),bar=$("<div></div>").attr("tabindex",0),div;this._splitter={left:this._panels[0],right:this._panels[1]};bar.insertAfter(this._panels[0]);this._splitter.bar=bar;this._splitter.bar.append(collapseButtons);div=$("<div/>").appendTo(this._splitter.bar);$("<span></span>")[this._getOrientation("size")](this._splitter.bar[this._getOrientation("size")]).attr("title","").appendTo(div)},_removeClasses:function(){var buttonLeft,buttonRight,resizeHandler,i;this.element.removeClass(this.css.splitter);if(!this._splitter&&!this._panels){return}for(i=0;i<this._panels.length;i++){this._panels[i].removeClass(this.css[this.options.orientation+"Panel"])}this._splitter.bar.removeClass(this.css.bar+"-"+this.options.orientation);this._splitter.bar.removeClass(this.css.barNormal);this._splitter.bar.removeClass(this.css.barCollapsed);buttonLeft=$(this._splitter.bar.children()[0]);buttonRight=$(this._splitter.bar.children()[1]);buttonLeft.removeClass(this.css[this.options.orientation+"CollapseButtonLeftExpanded"]);buttonRight.removeClass(this.css[this.options.orientation+"CollapseButtonRightExpanded"]);buttonLeft.removeClass(this.css.collapseButtonDefault);buttonRight.removeClass(this.css.collapseButtonDefault);resizeHandler=$(this._splitter.bar.children()[2]);resizeHandler.removeClass(this.css.resizeHandler+"-"+this.options.orientation);$(resizeHandler.children()[0]).removeClass(this.css.resizeHandlerInner+"-"+this.options.orientation)},_addClasses:function(){var buttonLeft,buttonRight,i,resizeHandler;this.element.addClass(this.css.splitter);for(i=0;i<this._panels.length;i++){this._panels[i].addClass(this.css[this.options.orientation+"Panel"])}this._splitter.bar.addClass(this.css.bar+"-"+this.options.orientation);this._splitter.bar.addClass(this.css.barNormal);if(this._panels[0].options.collapsed||this._panels[1].options.collapsed){this._splitter.bar.addClass(this.css.barCollapsed)}buttonLeft=$(this._splitter.bar.children()[0]);buttonRight=$(this._splitter.bar.children()[1]);buttonLeft.addClass(this.css[this.options.orientation+"CollapseButtonLeftExpanded"]);$(buttonLeft.children()).addClass(this.css[this.options.orientation+"CollapseButtonLeftExpandedIcon"]);buttonRight.addClass(this.css[this.options.orientation+"CollapseButtonRightExpanded"]);$(buttonRight.children()).addClass(this.css[this.options.orientation+"CollapseButtonRightExpandedIcon"]);resizeHandler=$(this._splitter.bar.children()[2]);resizeHandler.addClass(this.css.resizeHandler+"-"+this.options.orientation);$(resizeHandler.children()[0]).addClass(this.css.resizeHandlerInner+"-"+this.options.orientation);if(!this._panels[0].options.collapsible){buttonLeft.hide();buttonRight.addClass(this.css.collapseButtonSingle)}if(!this._panels[1].options.collapsible){buttonRight.hide();buttonLeft.addClass(this.css.collapseButtonSingle)}buttonLeft.addClass(this.css.collapseButtonDefault);buttonRight.addClass(this.css.collapseButtonDefault);if(this.options.disabled){this.options.disabled=false;this._setOption("disabled",true)}},_removeEventHandlers:function(){if(!this._splitter){return}$(this._splitter.bar).unbind(this._getEvent("focus"),this._getEvent("blur"),this._getEvent("keydown"));$(this._splitter.bar.children()[0]).unbind(this._getEvent("mousedown"));$(this._splitter.bar.children()[1]).unbind(this._getEvent("mousedown"));if(!this._isTouch()){$(this._splitter.bar).unbind(this._getEvent("mouseenter"),this._getEvent("mouseleave"));$(this._splitter.bar.children()[0]).unbind(this._getEvent("mouseenter"),this._getEvent("mouseleave"));$(this._splitter.bar.children()[1]).unbind(this._getEvent("mouseenter"),this._getEvent("mouseleave"))}},_addEventHandlers:function(){var self=this,options=this.options;self.autoResize=true;this._opt.eventHandlers.documentMouseUp=function(){if(options.disabled){return}self.autoResize=false;self._stopDrag(self);self.autoResize=true;self._lastMove=null;self._opt.barMouseDown=false};this._opt.eventHandlers.documentMouseMove=function(ev){if(options.disabled){return}var noCancel=true;self._currentMove=self._isTouch(ev)?ev.originalEvent.touches[0][self._getOrientation("page")]:ev[self._getOrientation("page")];if(self._capturedElement&&self._isDragging()&&!self._isDrag){self._triggerResizeStarted();self._isDrag=true}if(self._capturedElement&&self._isDragging()){noCancel=self._triggerResizing()}if(noCancel&&self._isDragging()){self._performDrag(self,ev)}else{return false}};this._opt.eventHandlers.windowResize=function(){var noCancel=self._triggerLayoutRefreshing();if(noCancel){self._panelsLayout({isWindowResize:true});self._triggerLayoutRefreshed()}};$(document).bind(this._getEvent("mouseup")+"."+this.element.attr("id"),this._opt.eventHandlers.documentMouseUp).bind(this._getEvent("mousemove")+"."+this.element.attr("id"),this._opt.eventHandlers.documentMouseMove);$(window).bind("resize."+this.element.attr("id"),this._opt.eventHandlers.windowResize);this._addBarHandlers();this._addCollapseButtonHandlers($(this._splitter.bar.children()[0]),0);this._addCollapseButtonHandlers($(this._splitter.bar.children()[1]),1)},_isDragging:function(){if(this.element.find("iframe").length){return true}return Math.abs(this._currentMove-this._lastMove)>this.options.dragDelta},_addBarHandlers:function(){var self=this,splitter=this._splitter,options=this.options;splitter.bar.bind(this._getEvent("mousedown"),{self:this},this._startDrag).bind(this._getEvent("mousedown"),function(){if(options.disabled){return}self._opt.barMouseDown=true});this._splitter.bar.find("."+this.css.resizeHandler+"-"+this.options.orientation).bind(this._getEvent("mousedown"),{self:this},this._startDrag);splitter.bar.bind(this._getEvent("keydown"),{self:this},this._kbNavigation);if(!this._isTouch()){splitter.bar.bind(this._getEvent("mouseenter"),function(){if(options.disabled){return}$(this).addClass(self.css.barHover)});splitter.bar.bind(this._getEvent("mouseleave"),function(){if(options.disabled){return}$(this).removeClass(self.css.barHover)})}splitter.bar.bind(this._getEvent("focus"),function(){if(options.disabled){return}$(this).addClass(self.css.barActive)});splitter.bar.bind(this._getEvent("blur"),function(){if(options.disabled){return}$(this).removeClass(self.css.barActive)})},_kbNavigation:function(event){var splitter=event.data.self,noCancel=true;if(splitter.options.disabled){return}if(event.keyCode===$.ui.keyCode[splitter._getOrientation("keyboard")[0]]){if(event.ctrlKey){splitter._stopDrag(splitter,true,true);if(splitter._panels[1].options.collapsed){splitter.expandAt(1)}else if(!splitter._panels[0].options.collapsed){splitter.collapseAt(0)}}else{splitter._startDrag(event);splitter._kbMove-=splitter._kbLockRight?0:splitter._getStep();if(splitter._capturedElement&&!splitter._isDrag){splitter._triggerResizeStarted();splitter._isDrag=true}if(splitter._capturedElement){noCancel=splitter._triggerResizing()}if(noCancel){splitter._performDrag(splitter,event)}else{return false}if(splitter._capturedElement&&splitter._capturedElement.hasClass(splitter.css.barInvalid)){splitter._kbLockRight=true;splitter._kbLockLeft=false}else{splitter._kbLockRight=false;splitter._kbLockLeft=false}}event.preventDefault()}else if(event.keyCode===$.ui.keyCode[splitter._getOrientation("keyboard")[1]]){if(event.ctrlKey){splitter._stopDrag(splitter,true,true);if(splitter._panels[0].options.collapsed){splitter.expandAt(0)}else if(!splitter._panels[1].options.collapsed){splitter.collapseAt(1)}}else{splitter._startDrag(event);splitter._kbMove+=splitter._kbLockLeft?0:splitter._getStep();if(splitter._capturedElement&&!splitter._isDrag){splitter._triggerResizeStarted();splitter._isDrag=true}if(splitter._capturedElement){noCancel=splitter._triggerResizing()}if(noCancel){splitter._performDrag(splitter,event)}else{return false}if(splitter._capturedElement&&splitter._capturedElement.hasClass(splitter.css.barInvalid)){splitter._kbLockRight=false;splitter._kbLockLeft=true}else{splitter._kbLockRight=false;splitter._kbLockLeft=false}}event.preventDefault()}else if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){splitter._stopDrag(splitter,false,true);event.preventDefault()}else if(event.keyCode===$.ui.keyCode.ESCAPE){splitter._stopDrag(splitter,true)}else if(event.keyCode===$.ui.keyCode.TAB){splitter._stopDrag(splitter,false,true)}},_startDrag:function(event){var left,right,capturedElementOffset,splitter=event.data.self;if(splitter.options.disabled){return}splitter._splitter.bar.focus();splitter._resizeArea=splitter._splitter;if(splitter._resizeArea!==null){if((splitter._resizeArea.left.options.resizable===undefined||splitter._resizeArea.left.options.resizable)&&(splitter._resizeArea.right.options.resizable===undefined||splitter._resizeArea.right.options.resizable)){left=splitter._resizeArea.left;right=splitter._resizeArea.right;if(!left.options.collapsed&&!right.options.collapsed&&!(right.options.max<=right[splitter._getOrientation("outerSize")]()&&left.options.max<=left[splitter._getOrientation("outerSize")]())){if(!splitter._capturedElement){splitter._lastMove=splitter._isTouch(event)?event.originalEvent.touches[0][splitter._getOrientation("page")]:event[splitter._getOrientation("page")];if($(event.target).is("span")){splitter._capturedElement=splitter._clone($($(event.target).parent()).parent(),splitter)}else{splitter._capturedElement=splitter._clone(event.target,splitter)}capturedElementOffset=$.ig.util.offset(splitter._capturedElement);splitter._startX=capturedElementOffset.left;splitter._startY=capturedElementOffset.top;splitter._kbMove=0;splitter._kbLockLeft=false;splitter._kbLockRight=false;splitter._mouseStartX=splitter._isTouch(event)?event.originalEvent.touches[0].pageX:event.pageX;splitter._mouseStartY=splitter._isTouch(event)?event.originalEvent.touches[0].pageY:event.pageY}}}return false}return false},_clone:function(bar,splitter){var opt=this._opt,$bar=$(bar),clonedBar=$bar.clone(),offset=$.ig.util.offset($bar);clonedBar.css({position:"absolute",top:offset.top,left:offset.left,"z-index":9999}).fadeTo(0,.7);clonedBar.mouseup(function(){if(splitter.options.orientation==="vertical"){if(opt.barMouseDown&&Math.round(offset.left)===Math.round($.ig.util.offset(clonedBar).left)){$bar.trigger("click")}}else{if(opt.barMouseDown&&Math.round(offset.top)===Math.round($.ig.util.offset(clonedBar).top)){$bar.trigger("click")}}opt.barMouseDown=false});$(document.body).append(clonedBar);return clonedBar},_addCollapseButtonHandlers:function(button,index){var self=this,options=this.options;button.bind(this._getEvent("mouseenter"),function(e){if(options.disabled){return}$($(this).parent()).removeClass(self.css.barHover);$(this).addClass(self.css.collapseButtonHover);if(e.stopPropagation!==undefined){e.stopPropagation()}if(e.preventDefault!==undefined){e.preventDefault()}return false});button.bind(this._getEvent("mouseleave"),function(){if(options.disabled){return}$($(this).parent()).addClass(self.css.barHover);$(this).removeClass(self.css.collapseButtonHover)});button.bind("mousedown touchstart",function(e){if(options.disabled){return}$(this).toggleClass(self.css.collapseButtonPressed);if(self._panels[index].options.collapsed){self.expandAt(index)}else{self.collapseAt(index)}if(e.stopPropagation!==undefined){e.stopPropagation()}if(e.preventDefault!==undefined){e.preventDefault()}return false})},_performDrag:function(self,ev){var page=self._isTouch(ev)?ev.originalEvent.touches[0][self._getOrientation("page")]:ev[self._getOrientation("page")],bar;if(self._capturedElement){if(ev.type==="keydown"){bar=self[self._getOrientation("start")]+self._kbMove}else{bar=page-self[self._getOrientation("mouse")]+self[self._getOrientation("start")]}self._moveBar(bar);return false}return true},_moveBar:function(bar){bar=this._validatePosition(bar);if(bar.invalid){this._capturedElement.addClass(this.css.barInvalid)}else{this._capturedElement.removeClass(this.css.barInvalid)}this._capturedElement.css(this._getOrientation("dimention"),bar.position)},_validatePosition:function(bar){var resizeArea=this._resizeArea,rightBoundary=this._getNextBoundary(resizeArea),getPreviousBoundary=this._getPreviousBoundary(resizeArea),min=Math.min(rightBoundary,rightBoundary-resizeArea.right.options.min,getPreviousBoundary+resizeArea.left.options.max),max=Math.max(getPreviousBoundary,getPreviousBoundary+resizeArea.left.options.min,rightBoundary-resizeArea.right.options.max),pos;if(max>min){pos=resizeArea.right.igOffset()[this._getOrientation("dimention")]-this._capturedElement[this._getOrientation("outerSize")](true);return{position:pos,invalid:true}}if(bar<max){return{position:max,invalid:true}}if(bar>min){return{position:min,invalid:true}}return{position:bar,invalid:false}},_getNextBoundary:function(panel){var size=panel.right.igOffset()[this._getOrientation("dimention")]+panel.right[this._getOrientation("size")]()-this._capturedElement[this._getOrientation("outerSize")](true);if(panel.right.options.collapsed){size-=panel.right.options.min}return size},_getPreviousBoundary:function(panel){var size=panel.left.igOffset()[this._getOrientation("dimention")];if(panel.left.options.collapsed){size+=panel.left.options.min}return size},_stopDrag:function(self,cancel,kbMove){if(self._capturedElement){if(!cancel&&(self._isDrag||kbMove)){self._performAreaResize()}self._capturedElement.remove();self._isDrag=false}self._capturedElement=null},_performAreaResize:function(){var resizeArea=this._resizeArea,offset=$.ig.util.offset(this._capturedElement)[this._getOrientation("dimention")]-this[this._getOrientation("start")],left=resizeArea.left[this._getOrientation("size")]()+offset,right=resizeArea.right[this._getOrientation("size")]()-offset;this._setPanelSize(resizeArea.left,left);this._setPanelSize(resizeArea.right,right);if(offset!==0){this._triggerResizeEnded()}this._splittersLayout()},_splittersLayout:function(){var splitters=$.data(document.body,"ig-splitters")||[],$currSplitter,i;for(i=0;i<splitters.length;i++){$currSplitter=splitters[i];if($currSplitter===this.element){$currSplitter.data("igSplitter")._panelsLayout()}else if(this.options.resizeOtherSplitters){$currSplitter.data("igSplitter")._panelsLayout()}}},_getSplitBarSize:function(){var style,innerSize,border,size,elem=this._splitter.bar[0],sizeKey=this._const.orientations[this.options.orientation].size;if(window.getComputedStyle){style=window.getComputedStyle(elem,null)}else{style=elem.currentStyle}innerSize=style[sizeKey];border=style.borderLeftWidth;size=parseFloat(innerSize)+2*parseFloat(border);return Math.ceil(size)},_panelsLayout:function(parameterObject){var i,$currChild,$currChildChildren,oppositeSize,panelsSizeInPercentages,outerSize=(this._panels.length-1)*this._getSplitBarSize(),sizeKey=this._getOrientation("size"),oppositeSizeKey=this._getOrientation("oppositeSize"),size=this._getSize(sizeKey),$splitBarChildren=this._splitter.bar.children(),regExp=new RegExp("%"),cloneObjPanels=this._opt.calculateSizeCloneObject.panels,outerOppositeSizeKey;for(i=0;i<this._panels.length;i++){if(!this._panels[i].options.collapsed){outerSize+=this._handlerPanelSize(this._panels[i],outerSize,size)}else{$currChild=$splitBarChildren.eq(i);$currChildChildren=$currChild.children();this._handlerPanelSize(this._panels[i],outerSize,size);$splitBarChildren.eq((i+1)%2).hide();$currChild.removeClass(this.css[this.options.orientation+"CollapseButton"+(i%2===0?"Left":"Right")+"Expanded"]).addClass(this.css[this.options.orientation+"CollapseButton"+(i%2===0?"Left":"Right")+"Collapsed"]);$currChildChildren.removeClass(this.css[this.options.orientation+"CollapseButton"+(i%2===0?"Left":"Right")+"ExpandedIcon"]).addClass(this.css[this.options.orientation+"CollapseButton"+(i%2===0?"Left":"Right")+"CollapsedIcon"])}}if(regExp.test(this.options[sizeKey])||!this.options[sizeKey]){if(parameterObject&&parameterObject.isWindowResize){this._calculateSizeWithClone()}else{cloneObjPanels[0].options={min:this._getPanelInitMin(0),max:this._getPanelInitMax(0)};cloneObjPanels[1].options={min:this._getPanelInitMin(1),max:this._getPanelInitMax(1)};if(this._isPercentLayout||!this.options.panels.length||(this.options.panels[0]===undefined||this.options.panels[0].size===undefined)&&(this.options.panels[1]===undefined||this.options.panels[1].size===undefined)){panelsSizeInPercentages=this._getPanelsSizeInPercentages.call(this,sizeKey);cloneObjPanels[0].options.size=panelsSizeInPercentages[0];cloneObjPanels[1].options.size=panelsSizeInPercentages[1]}else{cloneObjPanels[0].options.size=this.options.panels[0]&&this.options.panels[0].size&&this._panels[0].options.size;cloneObjPanels[1].options.size=this.options.panels[1]&&this.options.panels[1].size&&this._panels[1].options.size}if(parameterObject&&parameterObject.isInit){this._calculateSizeWithClone()}if(outerSize<size&&!(parameterObject&&parameterObject.isInit)){this._createPanel(size,outerSize,this._panels.length-1)}}}else if(outerSize<size){this._createPanel(size,outerSize,this._panels.length-1)}oppositeSize=this.element[oppositeSizeKey]();outerOppositeSizeKey="outer"+oppositeSizeKey.charAt(0).toUpperCase()+oppositeSizeKey.slice(1);if(oppositeSize===this._splitter.bar[outerOppositeSizeKey](true)){oppositeSize-=this._splitter.bar[outerOppositeSizeKey](true)-this._splitter.bar[oppositeSizeKey]()}this._splitter.bar[oppositeSizeKey](oppositeSize);$splitBarChildren.eq(2).find("span")[oppositeSizeKey](oppositeSize)},_calculateSizeWithClone:function(){var $splitterClone,sizeWithoutBarSize,panel1RecalculatedSize,panel2RecalculatedSize,min,max,oppositeSizeKey=this._getOrientation("oppositeSize"),cloneObj=this._opt.calculateSizeCloneObject,cloneObjPanels=cloneObj.panels,$bar=cloneObj.bar.element,$panel1=cloneObjPanels[0].element,$panel2=cloneObjPanels[1].element,sizeKey=this._getOrientation("size"),outerSizeKey="outer"+sizeKey.charAt(0).toUpperCase()+sizeKey.slice(1),minSize="min-"+sizeKey,maxSize="max-"+sizeKey,cssObj={},size=this._getSize(sizeKey),barSize=this._getSplitBarSize(),panel1Size=cloneObjPanels[0].options.size&&/%/.test(cloneObjPanels[0].options.size)?size*cloneObjPanels[0].options.size.replace("%","")/100:cloneObjPanels[0].options.size,panel2Size=size-panel1Size-barSize,isPanel1Collapsed=this._panels[0].options.collapsed,isPanel2Collapsed=this._panels[1].options.collapsed,isAnyPanelCollapsed=isPanel1Collapsed||isPanel2Collapsed;if(!cloneObj.element||!$panel1||!$panel2||!$bar){$splitterClone=this.element.clone().html("");$splitterClone.removeAttr("id").css({top:-99999,left:-99999,position:"absolute"}).addClass("calc-size-clone");$panel2=$("<div>");cssObj={"float":"right"};cssObj[oppositeSizeKey]="100%";$panel2.prop("className",this._panels[1].prop("className"));$panel2.css(cssObj).appendTo($splitterClone);$bar=$("<div>");$bar.css(cssObj).appendTo($splitterClone);cssObj={};cssObj[oppositeSizeKey]="100%";cssObj.overflow="hidden";$panel1=$("<div>");$panel1.prop("className",this._panels[0].prop("className"));$panel1.css(cssObj).appendTo($splitterClone);cssObj={};cloneObj.element=$splitterClone;cloneObjPanels[0].element=$panel1;cloneObjPanels[1].element=$panel2;cloneObj.bar.element=$bar}cssObj[maxSize]=isAnyPanelCollapsed?"":cloneObjPanels[1].options.max;cssObj[minSize]=isAnyPanelCollapsed?0:cloneObjPanels[1].options.min;cssObj[sizeKey]=isPanel2Collapsed?0:isPanel1Collapsed?size:panel2Size;$panel2.css(cssObj);$bar[sizeKey](barSize);cssObj[maxSize]=isAnyPanelCollapsed?"":cloneObjPanels[0].options.max;cssObj[minSize]=isAnyPanelCollapsed?0:cloneObjPanels[0].options.min;cssObj[sizeKey]=isPanel1Collapsed?0:isPanel2Collapsed?size-barSize+"px":panel1Size;$panel1.css(cssObj);cloneObj.element[sizeKey](size);cloneObj.element.appendTo($("body"));sizeWithoutBarSize=size-barSize;panel2RecalculatedSize=sizeWithoutBarSize-panel1Size;if(panel2Size===undefined&&panel1Size===undefined){$panel1[sizeKey](this._opt.defaultPanelSize)}else if(panel1Size>sizeWithoutBarSize&&!this._panels[1].options.size){$panel1[sizeKey](sizeWithoutBarSize)}if(panel2Size!==panel2RecalculatedSize||panel2Size===undefined&&panel1Size!==undefined){if(panel1Size===undefined&&panel2Size>0&&!this.options[sizeKey]){if(sizeWithoutBarSize<panel2Size){$panel1[sizeKey](0);$panel2[sizeKey](panel2RecalculatedSize)}else{panel1RecalculatedSize=sizeWithoutBarSize-panel2Size;$panel1[sizeKey](panel1RecalculatedSize)}}else{$panel2[sizeKey](panel2RecalculatedSize)}}if($panel1[outerSizeKey]()+$panel2[outerSizeKey]()+barSize!==cloneObj.element[sizeKey]()){this._resolveSizeConflictsOfCloneObject($panel1,$panel2,cloneObj.element,sizeKey)}this._resolveRoundingConflictsOfCloneObject($panel1,$panel1.css(minSize),$panel2,size,sizeKey);this._resolveRoundingConflictsOfCloneObject($panel2,$panel2.css(minSize),$panel1,size,sizeKey);if(this.options.orientation==="vertical"){var panel1BorderWidth=this._panels[0][0].offsetWidth-this._panels[0][0].clientWidth;$panel1[sizeKey](panel1Size-panel1BorderWidth);var panel2BorderWidth=this._panels[1][0].offsetWidth-this._panels[1][0].clientWidth;$panel2[sizeKey](panel2Size-panel2BorderWidth)}this._setPanelSize(this._panels[1],panel2Size);if($panel2.css(minSize)&&$panel2.css(minSize)!=="none"&&!isAnyPanelCollapsed){min=$panel2.css(minSize);this._setPanelActualMin(1,min)}else{this._panels[1].css(minSize,"")}if($panel2.css(maxSize)&&$panel2.css(maxSize)!=="none"&&!isAnyPanelCollapsed){max=$panel2.css(maxSize);this._setPanelActualMax(1,max)}else{this._panels[1].css(maxSize,"")}this._setPanelSize(this._panels[0],panel1Size);if($panel1.css(minSize)&&$panel1.css(minSize)!=="none"&&!isAnyPanelCollapsed){min=$panel1.css(minSize);this._setPanelActualMin(0,min)}else{this._panels[0].css(minSize,"")}if($panel1.css(maxSize)&&$panel1.css(maxSize)!=="none"&&!isAnyPanelCollapsed){max=$panel1.css(maxSize);this._setPanelActualMax(0,max)}else{this._panels[0].css(maxSize,"")}cloneObj.element.detach()},_resolveSizeConflictsOfCloneObject:function(clonePanel1,clonePanel2,cloneSplitter,sizeKey){var barSize=this._getSplitBarSize(),size=cloneSplitter[sizeKey](),size1=this._getSizeInPixels(clonePanel1[sizeKey](),size),size2=this._getSizeInPixels(clonePanel2[sizeKey](),size),outerSizeKey="outer"+sizeKey.charAt(0).toUpperCase()+sizeKey.slice(1),outerSize1=this._getSizeInPixels(clonePanel1[outerSizeKey](),size),outerSize2=this._getSizeInPixels(clonePanel2[outerSizeKey](),size),clonePanel1NeededArea=size-barSize-size2,clonePanel2NeededArea=size-barSize-size1,clonePanel1Min=this._getSizeInPixels(clonePanel1.css("min-"+sizeKey),size),clonePanel2Min=this._getSizeInPixels(clonePanel2.css("min-"+sizeKey),size);if(size1>clonePanel1NeededArea&&(clonePanel1Min||clonePanel2Min)){
if(clonePanel1Min&&!clonePanel2Min){clonePanel2[sizeKey](clonePanel2NeededArea)}else if(!clonePanel1Min&&clonePanel2Min){if(clonePanel2NeededArea>clonePanel2Min){clonePanel2[sizeKey](clonePanel2NeededArea)}else{clonePanel2[sizeKey](clonePanel2Min);clonePanel1[sizeKey](size-barSize-clonePanel2Min)}}else{if(clonePanel2NeededArea>clonePanel2Min){clonePanel2[sizeKey](clonePanel2NeededArea)}else if(clonePanel1NeededArea>clonePanel1Min){clonePanel2[sizeKey](clonePanel2Min);clonePanel1[sizeKey](size-barSize-clonePanel2Min)}else{clonePanel1[sizeKey](Math.floor(clonePanel1Min));clonePanel2.css("min-"+sizeKey,size-barSize-Math.floor(clonePanel1Min))}}}else if(outerSize1!==size-barSize-outerSize2&&(size1!==outerSize1||size2!==outerSize2)){if(size2!==outerSize2){clonePanel2[sizeKey](size2-(outerSize2-size2))}outerSize2=this._getSizeInPixels(clonePanel2[outerSizeKey](),size);if(outerSize1!==size-barSize-outerSize2&&size1!==outerSize1){clonePanel1[sizeKey](size1-(outerSize1-size1))}}},_resolveRoundingConflictsOfCloneObject:function(checkedPanel,checkedPanelMin,oppositePanel,sizeSplitter,sizeKey){var floatSize,diff,newSize,outerSizeKey="outer"+sizeKey.charAt(0).toUpperCase()+sizeKey.slice(1),barSize=this._getSplitBarSize();floatSize=Math.floor(checkedPanel[0].getBoundingClientRect()[sizeKey]*1e3)/1e3;diff=Math.abs(this._getSizeInPixels(checkedPanel[outerSizeKey]())-floatSize);if(0<diff&&diff<=1){if(checkedPanelMin){checkedPanelMin=this._getSizeInPixels(checkedPanelMin,sizeSplitter);diff=Math.abs(Math.floor(checkedPanelMin)-checkedPanelMin);if(0<diff&&diff<=1){checkedPanel.css("min-"+sizeKey,Math.floor(checkedPanelMin)+"px")}}newSize=Math.floor(floatSize);checkedPanel[sizeKey](newSize+"px");oppositePanel[sizeKey](sizeSplitter-barSize-newSize+"px")}},_getSizeInPixels:function(candidateValue,sizeOfParentInPixels){if(/%/.test(candidateValue)){return parseFloat(sizeOfParentInPixels*candidateValue.replace("%","")/100)}else{return parseFloat(candidateValue)}},_getPanelInitMin:function(panelIndex){var optionsPanel=this.options.panels[panelIndex];return optionsPanel&&(optionsPanel._min||optionsPanel.min)},_getPanelInitMax:function(panelIndex){var optionsPanel=this.options.panels[panelIndex];return optionsPanel&&(optionsPanel._max||optionsPanel.max)},_getStep:function(){return this._const.step+this._splitter.bar[this._getOrientation("size")]()},_handlerPanelSize:function(panel,outerSize,size){if(this._isPercentLayout){if(panel.options._min!==undefined){panel.options.min=panel.options._min.replace("%","")*this._getSize(this._getOrientation("size"))/100}if(panel.options._max!==undefined){panel.options.max=panel.options._max.replace("%","")*this._getSize(this._getOrientation("size"))/100}}this._setPanelSize(panel,panel.options.size);var newSize;if(outerSize+panel.options.size>=size&&!panel.options.collapsed){newSize=size-outerSize;if(!panel.options.collapsed){if(this._isPercentLayout){panel[this._getOrientation("size")](newSize/this._getSize(this._getOrientation("size"))*100+"%")}else{panel[this._getOrientation("size")](newSize)}panel.options.size=newSize}}return panel[this._getOrientation("outerSize")](true)},_setPanelSize:function(panel,size){if(!panel.options.collapsed){panel.options.size=parseInt(size,10);if(panel.options.size===0||this._isPercentLayout&&panel.options.size<=$.ig.util.getScrollWidth()){panel.addClass(this.css.noScroll)}else{panel.removeClass(this.css.noScroll)}if(this._isPercentLayout){size=parseInt(size,10);panel[this._getOrientation("size")](size/this._getSize(this._getOrientation("size"))*100+"%")}else{panel[this._getOrientation("size")](size)}}else{panel.addClass(this.css.noScroll);panel[this._getOrientation("size")](0)}},_setPanelActualMin:function(panelIndex,min){var convertedMin,panel=this._panels[panelIndex],sizeKey=this._getOrientation("size"),size=this._getSize(sizeKey);if(min===undefined){return}if(/%/.test(min)){if(this._isInitMinDefinedInPercentages(panelIndex)){panel.options._min=min}convertedMin=size*parseFloat(min,10)/100;panel.options.min=convertedMin}else{min=parseInt(min,10);if(this._isInitMinDefinedInPercentages(panelIndex)){convertedMin=min/size*100;panel.options._min=convertedMin+"%"}panel.options.min=min;min+="px"}if(!panel.options.collapsed){panel.css("min-"+this._getOrientation("size"),min)}},_setPanelActualMax:function(panelIndex,max){var convertedMax,panel=this._panels[panelIndex],sizeKey=this._getOrientation("size"),size=this._getSize(sizeKey);if(max===undefined){return}if(/%/.test(max)){if(this._isInitMaxDefinedInPercentages(panelIndex)){panel.options._max=max}convertedMax=size*parseFloat(max,10)/100;panel.options.max=convertedMax}else{max=parseInt(max,10);if(this._isInitMaxDefinedInPercentages(panelIndex)){convertedMax=max/size*100;panel.options._max=convertedMax+"%"}panel.options.max=max;max+="px"}if(!panel.options.collapsed){panel.css("max-"+this._getOrientation("size"),max)}},_isInitMinDefinedInPercentages:function(panelIndex){var initPanelOptions=this.options.panels[panelIndex];return initPanelOptions!==undefined&&(initPanelOptions._min!==undefined||/%/.test(initPanelOptions.min))},_isInitMaxDefinedInPercentages:function(panelIndex){var initPanelOptions=this.options.panels[panelIndex];return initPanelOptions!==undefined&&(initPanelOptions._max!==undefined||/%/.test(initPanelOptions.max))},_createPanel:function(size,outerSize,index,overrideMax){var panel,newSize,panelSize,maxSize;if(overrideMax===undefined){overrideMax=true}if(index===undefined){index=0}panel=this._panels[index];newSize=size-outerSize;panelSize=panel[this._getOrientation("size")]();maxSize=newSize+panelSize;if(panel.options.collapsed){this._panelHelper(outerSize,size)}else{if(maxSize>panel.options.max&&overrideMax){panel.options.max=maxSize}if(this._isPercentLayout){panel[this._getOrientation("size")](maxSize/this._getSize(this._getOrientation("size"))*100+"%")}else{panel[this._getOrientation("size")](maxSize)}panel.options.size=maxSize}},_panelHelper:function(outerSize,size){var panel,flag=false,i;for(i=0;i<this._panels.length&&!flag;i++){panel=this._panels[i];if(!panel.options.collapsed){flag=true}}panel[this._getOrientation("size")](size-outerSize+panel[this._getOrientation("size")]())},expandAt:function(index){var neighborPanel,sizeProperty=this._getOrientation("size"),panel=this._panels[index];if(index<=this._panels.length&&index>=0&&panel.options.collapsed){neighborPanel=this._panels[index%2===0?1:0];panel.options.collapsed=false;panel.options.size=Math.min(panel.options.size,neighborPanel[this._getOrientation("size")]());neighborPanel.options.size=neighborPanel[this._getOrientation("size")]()-panel.options.size;this._splitter.bar.removeClass(this.css.barCollapsed);if(this._panels[(index+1)%2].options.collapsible){$(this._splitter.bar.children()[(index+1)%2]).show()}$(this._splitter.bar.children()[index]).removeClass(this.css.collapseButtonPressed);$(this._splitter.bar.children()[index]).removeClass(this.css[this.options.orientation+"CollapseButton"+(index%2===0?"Left":"Right")+"Collapsed"]);$($(this._splitter.bar.children()[index]).children()).removeClass(this.css[this.options.orientation+"CollapseButton"+(index%2===0?"Left":"Right")+"CollapsedIcon"]);$(this._splitter.bar.children()[index]).addClass(this.css[this.options.orientation+"CollapseButton"+(index%2===0?"Left":"Right")+"Expanded"]);$($(this._splitter.bar.children()[index]).children()).addClass(this.css[this.options.orientation+"CollapseButton"+(index%2===0?"Left":"Right")+"ExpandedIcon"]);neighborPanel.css(sizeProperty,neighborPanel.options.size);panel.css(sizeProperty,panel.options.size);this._setPanelMinMax(panel);this._setPanelMinMax(neighborPanel);this._splittersLayout();this._triggerExpanded(index)}},collapseAt:function(index){var size,neighborPanel,panel=this._panels[index],sizeProperty=this._getOrientation("size");if(index<this._panels.length&&index>=0&&!panel.options.collapsed&&panel.options.collapsible){size=panel[this._getOrientation("size")]();neighborPanel=this._panels[index%2===0?1:0];panel.options.size=size||panel.options.size;panel.options.collapsed=true;this._splitter.bar.addClass(this.css.barCollapsed);$(this._splitter.bar.children()[(index+1)%2]).hide();$(this._splitter.bar.children()[index]).addClass(this.css.collapseButtonPressed);$(this._splitter.bar.children()[index]).removeClass(this.css[this.options.orientation+"CollapseButton"+(index%2===0?"Left":"Right")+"Expanded"]);$($(this._splitter.bar.children()[index]).children()).removeClass(this.css[this.options.orientation+"CollapseButton"+(index%2===0?"Left":"Right")+"ExpandedIcon"]);$(this._splitter.bar.children()[index]).addClass(this.css[this.options.orientation+"CollapseButton"+(index%2===0?"Left":"Right")+"Collapsed"]);$($(this._splitter.bar.children()[index]).children()).addClass(this.css[this.options.orientation+"CollapseButton"+(index%2===0?"Left":"Right")+"CollapsedIcon"]);neighborPanel.options.size=neighborPanel[this._getOrientation("size")]()+size;neighborPanel.css(sizeProperty,neighborPanel.options.size);panel.css(sizeProperty,0);this._clearPanelMinMax(panel);this._clearPanelMinMax(neighborPanel);this._splittersLayout();this._triggerCollapsed(index)}},_clearPanelMinMax:function(panel){var sizeProperty=this._getOrientation("size");if(parseFloat(panel.css("min-"+sizeProperty))){panel.css("min-"+sizeProperty,"")}if(panel.css("max-"+sizeProperty)){panel.css("max-"+sizeProperty,"")}},_setPanelMinMax:function(panel){var sizeProperty=this._getOrientation("size");if(panel.options&&panel.options.min){panel.css("min-"+sizeProperty,panel.options.min+"px")}if(panel.options&&panel.options.max&&panel.options.max<this._opt.defaultPanelMaxSize){panel.css("max-"+sizeProperty,panel.options.max+"px")}},_triggerCollapsed:function(index){var args={owner:this,index:index};this._trigger(this.events.collapsed,null,args)},_triggerExpanded:function(index){var args={owner:this,index:index};this._trigger(this.events.expanded,null,args)},_triggerResizeStarted:function(){var args={owner:this},iframes=this.element.find("iframe");if(iframes.length>0){iframes.css("pointer-events","none")}this._trigger(this.events.resizeStarted,null,args)},_triggerResizing:function(){var args={owner:this};return this._trigger(this.events.resizing,null,args)},_triggerResizeEnded:function(){var args={owner:this},iframes=this.element.find("iframe");if(iframes.length>0){iframes.css("pointer-events","auto")}this._trigger(this.events.resizeEnded,null,args)},_triggerLayoutRefreshing:function(){var args={owner:this};return this._trigger(this.events.layoutRefreshing,null,args)},_triggerLayoutRefreshed:function(){var args={owner:this};return this._trigger(this.events.layoutRefreshed,null,args)},firstPanel:function(){return this._panels[0]},secondPanel:function(){return this._panels[1]},refreshLayout:function(){this._panelsLayout()},setFirstPanelSize:function(size){if(/%/.test(size)){size=size.replace("%","")*this._getSize(this._getOrientation("size"))/100;this._isPercentLayout=true}if(/px/.test(size)){size=parseInt(size,10)}this._setPanelSize(this._panels[0],size);this._splittersLayout()},setSecondPanelSize:function(size){if(/%/.test(size)){size=size.replace("%","")*this._getSize(this._getOrientation("size"))/100;this._isPercentLayout=true}if(/px/.test(size)){size=parseInt(size,10)}this._setPanelSize(this._panels[0],this._getSize(this._getOrientation("size"))-size);this._splittersLayout()},_getPanelsSizeInPercentages:function(sizeKey){var size=this._getSize(sizeKey),barSize=this._getSplitBarSize(),panel1CalculatedSize=size-barSize===this._panels[0].options.size?100:this._panels[0].options.size/size*100,panel1Size=panel1CalculatedSize<0?0:panel1CalculatedSize>100?100:panel1CalculatedSize,panel2CalculatedSize=100-panel1Size,panel2Size=panel2CalculatedSize<0?0:panel2CalculatedSize>100?100:panel2CalculatedSize;return[panel1Size+"%",panel2Size+"%"]},destroy:function(){var evtHandlers=this._opt?this._opt.eventHandlers:null,i,splitters,index;this._removeEventHandlers();this._removeClasses();this.element.html(this._htmlMarkup);splitters=$.data(document.body,"ig-splitters")||[];for(i=0;i<splitters.length;i++){if(splitters[i][0].id===this.element[0].id){index=i;break}}splitters.splice(index,1);$.data(document.body,"ig-splitters",splitters);if(evtHandlers){$(document).unbind(this._getEvent("mouseup"),evtHandlers.documentMouseUp);$(document).unbind(this._getEvent("mousemove"),evtHandlers.documentMouseMove);$(window).unbind("resize",evtHandlers.windowResize)}this._superApply(arguments);this._opt=null;return this}});$.extend($.ui.igSplitter,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI SplitButton 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 * <Licensing info>
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *   jquery.js
 *   jquery.ui.core.js
 *   jquery.ui.widget.js
 * 	 infragistics.util.js
 *   infragistics.util.jquery.js
 *   infragistics.ui.shared.js
 *   infragistics.ui.toolbarbutton.js
 */
(function($){$.widget("ui.igSplitButton",{options:{items:[{name:"button1",label:"Button 1",iconClass:"ui-icon-gear"}],defaultItemName:"button1",swapDefaultEnabled:false},events:{click:"click",expanded:"expanded",expanding:"expanding",collapsed:"collapsed",collapsing:"collapsing"},css:{container:"ui-splitbutton ui-widget ui-state-default",arrow:"ui-splitbutton-arrow",conrnersLeft:"ui-corner-left",conrnersRight:"ui-corner-right",hover:"ui-splitbutton-hover",active:"ui-state-active",focus:"ui-state-focus"},_id:function(id){return this.element[0].id+id},_renderDefaultBtn:function(){var options=this.options,defaultItem=this._getDefaultItem(options.defaultItemName);this._options.defaultButton=$('<div id="'+this._id("_"+options.defaultItemName)+'"></div>').appendTo(this.element).igToolbarButton({onlyIcons:true,labelText:"&nbsp;",title:defaultItem.label,icons:{primary:defaultItem.iconClass},name:options.defaultItemName,allowToggling:false}).addClass("ui-splitbutton-cleargaps "+this.css.conrnersLeft).removeClass("ui-corner-all")},_renderExpandBtn:function(){this._options.expandButton=$("<div id='"+this._id("_arrow")+"' class='"+this.css.arrow+"'></div>").igToolbarButton({onlyIcons:true,labelText:"&nbsp;",icons:{primary:"ui-icon-triangle-1-s"},allowToggling:false}).addClass("ui-splitbutton-cleargaps "+this.css.conrnersRight).removeClass("ui-corner-all").appendTo(this.element)},_setupElement:function(){this.element.addClass(this.css.container).attr("tabIndex",0)},_create:function(){this._options={defaultButton:null,expandButton:null,itemsList:null,isExpanded:false,justFocused:false};this._setupElement();this._renderDefaultBtn();this._renderExpandBtn();this._createItemsList();this._attachEvents()},_attachEvents:function(){var _opt=this._options;_opt.defaultButton.on("igtoolbarbuttonclick",$.proxy(this._onDefaultBtnClick,this));_opt.expandButton.on("focus",$.proxy(this._onExpandBtnFocus,this));_opt.expandButton.on("blur",$.proxy(this._onExpandBtnBlur,this));_opt.expandButton.on("igtoolbarbuttonclick",$.proxy(this._onExpandBtnClick,this));_opt.itemsList.on("igtoolbarbuttonclick","a",$.proxy(this._onItemClick,this));this.element.on("keypress",$.proxy(this._onEnterKeypress,this));this.element.hover($.proxy(this._onMouseEnter,this),$.proxy(this._onMouseLeave,this))},_onDefaultBtnClick:function(e){var self=this;e.stopPropagation();this._trigger(this.events.click,e,{name:self._options.defaultButton.igToolbarButton("option","name"),item:self.element})},_onExpandBtnClick:function(e){var _options=this._options;if(!_options.expandButton.is(":focus")){if(!_options.isExpanded){_options.expandButton.focus()}return}if(_options.justFocused){_options.justFocused=false}else{this.toggle(e)}},_onExpandBtnFocus:function(e){var noCancel;if(!this._options.isExpanded){noCancel=this._triggerExpanding(e);if(noCancel){this.expand(e);this._options.justFocused=true}}},_onExpandBtnBlur:function(e){var noCancel,self=this;if(this._options.isExpanded){setTimeout(function(){noCancel=self._triggerCollapsing(e);if(noCancel){self.collapse(e)}},150)}},_onItemClick:function(e){var $target=$(e.currentTarget);if(this.options.swapDefaultEnabled){this.switchToButton($target)}e.stopImmediatePropagation();this._trigger(this.events.click,e,{name:$target.igToolbarButton("option","name")})},_onEnterKeypress:function(e){if(e.which===$.ui.keyCode.ENTER){this.toggle(e)}},_onMouseEnter:function(){this.element.addClass(this.css.hover)},_onMouseLeave:function(){this.element.removeClass(this.css.hover)},_getDefaultItem:function(name){var options=this.options,i;for(i=0;i<options.items.length;i++){if(options.items[i].name===name){return options.items[i]}}},_createItemsList:function(){var list=$("<ul class='ui-splitbutton-list ui-menu ui-widget ui-widget-content ui-corner-all'></ul>"),options=this.options,i,item;for(i=0;i<options.items.length;i++){if(options.items[i].name!==options.defaultItemName){item=$('<a id="'+this._id("_"+options.items[i].name)+'" class="ui-corner-all" tabindex="-1"></a>').igToolbarButton({onlyIcons:true,labelText:"",title:options.items[i].label,icons:{primary:options.items[i].iconClass},name:options.items[i].name,allowToggling:false}).addClass("ui-splitbutton-cleargaps");$('<li class="ui-menu-item" role="menuitem"></li>').appendTo(list).append(item)}}this._options.itemsList=list.appendTo(this.element)},switchToButton:function(button){var defaultButton=this._options.defaultButton,targetButton=typeof button==="string"?$("#"+this._id("_"+button)):button,defBtnOpts=defaultButton.igToolbarButton("option"),defBtnId=defaultButton.attr("id"),targetBtnOpts=targetButton.igToolbarButton("option"),targetBtnId=targetButton.attr("id");targetButton.igToolbarButton("option",defBtnOpts).attr("id",defBtnId);defaultButton.igToolbarButton("option",targetBtnOpts).attr("id",targetBtnId).igToolbarButton("toggle")},_triggerCollapsing:function(){var args={owner:this};return this._trigger(this.events.collapsing,null,args)},_triggerCollapsed:function(){var args={owner:this};return this._trigger(this.events.collapsed,null,args)},_triggerExpanding:function(){var args={owner:this};return this._trigger(this.events.expanding,null,args)},_triggerExpanded:function(){var args={owner:this};return this._trigger(this.events.expanded,null,args)},widget:function(){return this.element},toggle:function(e){var noCancel,_options=this._options;if(_options.isExpanded){noCancel=this._triggerCollapsing(e);if(noCancel){this.collapse(e)}}else{noCancel=this._triggerExpanding(e);if(noCancel){this.expand(e)}}},collapse:function(e){var self=this,_opt=this._options,expandButton=_opt.expandButton;_opt.itemsList.hide(0,function(){self.element.removeClass(self.css.active);_opt.expandButton.removeClass(self.css.focus);_opt.isExpanded=false;if(e&&e.originalEvent){self._triggerCollapsed(e)}else if(expandButton.is(":focus")){expandButton.blur()}})},expand:function(e){var self=this,_opt=this._options,expandButton=_opt.expandButton;_opt.itemsList.show(0,function(){self.element.addClass(self.css.active);_opt.isExpanded=true;if(e&&e.originalEvent){self._triggerExpanded(e)}else if(!expandButton.is(":focus")){expandButton.focus()}})},destroy:function(){var _opt=this._options;$.Widget.prototype.destroy.apply(this,arguments);_opt.itemsList.off();this.element.find(":ui-igToolbarButton").igToolbarButton("destroy").end().off().removeClass(this.css.container).removeAttr("tabindex").empty();delete _opt.expandButton;delete _opt.itemsList},_setOption:function(key,value){var options=this.options,self=this;if(options[key]===value){return}this._superApply(arguments);switch(key){case"defaultItemName":var result=$("#"+self.element.attr("id")+"_"+value);if(result.length===1){self.switchToButton(result)}break}}});$.extend($.ui.igSplitButton,{version:"21.2.12"})})($);/*!@license
* Infragistics.Web.ClientUI infragistics.olap.js 21.2.20212.99
*
* Copyright (c) 2011-2022 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends:
*     jquery-1.4.4.js
*     jquery.ui.core.js
*     jquery.ui.widget.js
*     infragistics.util.js
*     infragistics.ext_core.js
*     infragistics.ext_collections.js
*     infragistics.ext_collectionsExtended.js
*     infragistics.ext_threading.js
*/
(function($){$.ig=$.ig||{};var $$t={};$.ig.$currDefinitions=$$t;$.ig.util.bulkDefine(["OlapDataSource:a","Object:b","Type:c","Boolean:d","ValueType:e","Void:f","IConvertible:g","IFormatProvider:h","Number:i","String:j","IComparable:k","Number:l","IComparable$1:m","IEquatable$1:n","Number:o","Number:p","Number:q","NumberStyles:r","Enum:s","Array:t","IList:u","ICollection:v","IEnumerable:w","IEnumerator:x","Error:y","Error:z","Number:aa","String:ab","StringComparison:ac","RegExp:ad","CultureInfo:ae","DateTimeFormat:af","Calendar:ag","Date:ah","Number:ai","DayOfWeek:aj","DateTimeKind:ak","CalendarWeekRule:al","NumberFormatInfo:am","CompareInfo:an","CompareOptions:ao","IEnumerable$1:ap","IEnumerator$1:aq","IDisposable:ar","StringSplitOptions:as","Number:at","Number:au","Number:av","Number:aw","Number:ax","Number:ay","Assembly:az","Stream:a0","SeekOrigin:a1","RuntimeTypeHandle:a2","MethodInfo:a3","MethodBase:a4","MemberInfo:a5","ParameterInfo:a6","TypeCode:a7","ConstructorInfo:a8","PropertyInfo:a9","IOlapDataSource:ba","OlapMetadataTreeItem:bb","ICoreOlapElement:bc","OlapMetadataTreeItemType:bd","IList$1:be","ICollection$1:bf","Hierarchy:bg","HierarchyOrigin:bh","Measure:bi","AggregatorType:bj","MeasureListLocation:bk","OlapResult:bl","OlapResultAxis:bm","PositionResolver$2:bn","List$1:bo","IArray:bp","Script:bq","IArrayList:br","Array:bs","CompareCallback:bt","MulticastDelegate:bu","IntPtr:bv","Func$3:bw","Action$1:bx","Comparer$1:by","IComparer:bz","IComparer$1:b0","DefaultComparer$1:b1","Comparison$1:b2","ReadOnlyCollection$1:b3","Predicate$1:b4","NotImplementedException:b5","IPosition$2:b6","IPositionItem$2:b7","PositionItemInfo$2:b8","Dictionary$2:b9","IDictionary$2:ca","KeyValuePair$2:cb","IDictionary:cc","IEqualityComparer$1:cd","EqualityComparer$1:ce","IEqualityComparer:cf","DefaultEqualityComparer$1:cg","InvalidOperationException:ch","ArgumentException:ci","Thread:cj","ThreadStart:ck","IHierarchicalPositionItem$2:cl","Math:cm","Enumerable:cn","Func$2:co","IOrderedEnumerable$1:cp","SortedList$1:cq","ArgumentNullException:cr","EventHandler$1:cs","AsyncCompletedEventArgs:ct","EventArgs:cu","Delegate:cv","Interlocked:cw","ListSortDirection:cx","Nullable$1:cy","OlapResultTuple:cz","OlapResultAxisMember:c0","StringBuilder:c1","Environment:c2","OlapResultCell:c3","ArrayListCollection$1:c4","INotifyCollectionChanged:c5","NotifyCollectionChangedEventHandler:c6","NotifyCollectionChangedEventArgs:c7","NotifyCollectionChangedAction:c8","Cube:c9","CubeType:da","Task$1:db","Task:dc","JQueryPromise:dd","Action:de","AggregateException:df","TaskStatus:dg","TaskCompletionSource$1:dh","JQueryDeferred:di","JQuery:dj","JQueryObject:dk","Element:dl","Node:dm","ElementAttributeCollection:dn","ElementCollection:dp","WebStyle:dq","ElementNodeType:dr","document:ds","EventListener$1:dt","Event:du","DOMTokenList:dv","EventListener:dw","IElementEventHandler:dx","ElementEventHandler:dy","ElementAttribute:dz","JQueryPosition:d0","JQueryCallback:d1","JQueryEvent:d2","JQueryUICallback:d3","Member:d4","MemberType:d5","Catalog:d6","MeasureGroup:d7","DataSourceBaseOptions:d8","IOlapDataProviderFactory:d9","IOlapDiscoverDataProvider:ea","KeyValueItem:eb","Dimension:ec","DimensionType:ed","Level:ee","MeasureGroupDimension:ef","CardinalityType:eg","Kpi:eh","OlapResultView:ei","PositionInfo:ej","ResultViewHelper:ek","IPostionComparer:el","CubeMetaItemsCache:em","KpiMeasure:en","MeasureGroupMetaItemsCache:eo","Tuple$2:ep","AxisElement:eq","MeasureList:er","TaskFactory:es","TaskExtensions:et","AxisDefinitionParser:eu","MetaTreeHelper:ev","HierarchyItemPosition:ew","KpiDimension:ex","ArgumentOutOfRangeException:ey","LevelSortDirection:ez","LevelSortBehavior:e0","TupleSortDirection:e1","DataSourceBase:e2","OlapUtilities:e3","HeaderCellsLayoutOrientation:e4","LevelSpanManager:e5","SpanSource:e6","ITableViewHeadersFactory:e7","OlapTableViewHeaderCell:e8","TableViewHeadersFactory:e9","TableViewHeaderCellSource:fa","TableSuperCompactViewHeadersFactory:fb","TreeStackAttributesBehavior:fc","OlapTableViewTreeHeaderCell:fd","TreeStackChildrenFirstBehavior:fe","TreeStackNextDimensionFirstBehavior:ff","TableViewTreeHeadersFactory:fg","Stack$1:fh","ReverseArrayEnumerator$1:fi","TableViewImpl:fj","TableViewSettings:fk","RowHeaderLayout:fl","OlapTableViewResultCell:fm","ResultHeaderSorter:fn","ResultSorter$1:fo","AxisTupleVisitor:fp","AxisHeaderSortingVisitor:fq","ResultColumnValueSorter:fr","AxisValueSortingVisitor:fs","TreeLayoutTableViewSettings:ft","SourceInitHelper:fu","CoreOlapElementType:fv","CoreOlapElementParseResult:fw","CoreOlapElementParser:fx","PivotActionStatus:fy","PivotAction:fz","AxisItemsChangeType:f0","AxisChangedAction:f1","AxisItemsChangedAction:f2","ExpansionStateChangeType:f3","ExpansionStateChangedAction:f4","PivotActionManager:f5","HierarchyFilterView:f6","FilterMember:f7","INotifyPropertyChanged:f8","PropertyChangedEventHandler:f9","PropertyChangedEventArgs:ga","FilterMemberStateChangedEventArgs:gb","jQueryUtils:gc","OlapTableView:gd","IConnection:ge","IOlapExecuteCommandProvider:gf","GetPositionIndexCompletedEventArgs:gg","ScopeType:gh","LevelType:gi","AbstractEnumerable:gj","Func$1:gk","AbstractEnumerator:gl","GenericEnumerable$1:gm","GenericEnumerator$1:gn"]);var $a=$.ig.intDivide,$b=$.ig.util.cast,$c=$.ig.util.defType,$d=$.ig.util.defEnum,$e=$.ig.util.getBoxIfEnum,$f=$.ig.util.getDefaultValue,$g=$.ig.util.getEnumValue,$h=$.ig.util.getValue,$i=$.ig.util.intSToU,$j=$.ig.util.nullableEquals,$k=$.ig.util.nullableIsNull,$l=$.ig.util.nullableNotEquals,$m=$.ig.util.toNullable,$n=$.ig.util.toString$1,$o=$.ig.util.u32BitwiseAnd,$p=$.ig.util.u32BitwiseOr,$q=$.ig.util.u32BitwiseXor,$r=$.ig.util.u32LS,$s=$.ig.util.unwrapNullable,$t=$.ig.util.wrapNullable,$u=String.fromCharCode,$v=$.ig.util.castObjTo$t,$w=$.ig.util.compare,$x=$.ig.util.replace,$y=$.ig.util.stringFormat,$z=$.ig.util.stringFormat1,$0=$.ig.util.stringFormat2,$1=$.ig.util.stringCompare1,$2=$.ig.util.stringCompare2,$3=$.ig.util.stringCompare3,$4=$.ig.util.compareSimple;$d("MemberType:d5",false,false,{Unknown:0,Regular:1,All:2,Measure:3,Formula:4});$d("CardinalityType:eg",false,false,{One:0,Many:1});$d("AggregatorType:bj",false,false,{Unknown:0,Sum:1,Count:2,Min:3,Max:4,Average:5,Variance:6,Std:7,DistinctCount:8,None:9,AverageOfChildren:10,FirstNonEmpty:13,LastNonEmpty:14,ByAccount:15,Calculated:127});$d("HierarchyOrigin:bh",true,false,{UserDefined:1,SystemEnabled:2,SystemInternal:4});$d("LevelType:gi",false,false,{Account:4116,All:1,BillOfMaterialsResource:4114,Calculated:2,Channel:4193,Company:4162,CurrencyDestination:4178,CurrencySource:4177,Customer:4129,CustomerGroup:4130,CustomerHousehold:4131,GeoCity:8198,GeoContinent:8193,GeoCountry:8195,GeoCounty:8197,GeoPoint:8200,GeoPostalCode:8199,GeoRegion:8194,GeoStateOrProvince:8196,OrgUnit:4113,Person:4161,Product:4145,ProductGroup:4146,Promotion:4209,Quantitative:4115,Regular:0,Representative:4194,ReservedForFutureUse:8,Scenario:4117,Time:4,TimeDays:516,TimeHalfYears:36,TimeHours:772,TimeMinutes:1028,TimeMonths:132,TimeQuarters:68,TimeSeconds:2052,TimeUndefined:4100,TimeWeeks:260,TimeYears:20,Utility:4118});$d("DimensionType:ed",false,false,{Unknown:0,Time:1,Measure:2,Other:3,Quantitative:5,Accounts:6,Customers:7,Products:8,Scenario:9,Utility:10,Currency:11,Rates:12,Channel:13,Promotion:14,Organization:15,BillOfMaterials:16,Geography:17});$d("ScopeType:gh",false,false,{Unknown:0,Global:1,Session:2});$d("CubeType:da",false,false,{Cube:0,Dimension:1,Unknown:2});$d("OlapMetadataTreeItemType:bd",false,false,{Cube:0,Dimension:1,Group:2,UserDefinedHierarchy:3,SystemEnabledHierarchy:4,ParentChildHierarchy:5,Measure:6,Level1:7,Level2:8,Level3:9,Level4:10,Level5:11,KpiRoot:12,Kpi:13,KpiValue:14,KpiGoal:15,KpiStatus:16,KpiTrend:17,KpiWeight:18});$d("MeasureListLocation:bk",false,false,{Rows:0,Columns:1});$d("ExpansionStateChangeType:f3",false,false,{Expand:0,Collapse:1});$d("AxisItemsChangeType:f0",false,false,{Add:0,Remove:1});$d("PivotActionStatus:fy",false,false,{Created:0,Queued:1,Started:2,Canceled:3,Completed:4});$d("CoreOlapElementType:fv",false,false,{Catalog:0,Cube:1,Dimension:2,Hierarchy:3,Level:4,Member:5,Measure:6,MeasureList:7});$d("RowHeaderLayout:fl",false,false,{Standard:0,SuperCompact:1,Tree:2});$d("HeaderCellsLayoutOrientation:e4",false,false,{Horizontal:0,Vertical:1});$d("LevelSortBehavior:e0",false,false,{Alphabetical:0,System:1});$c("IOlapDataSource:ba","Object",{$type:new $.ig.Type("IOlapDataSource",null)},true);$c("OlapDataSource:a","Object",{w:null,v:null,ah:null,ai:0,j:0,g:null,init:function(a){this.w=new $$t.bo($$t.$ej.$type,0);this.v=new $$t.bo($$t.$ej.$type,0);this.ah=new $$t.bo(String,0);this.af=new $$t.bo(String,0);$.ig.$op.init.call(this);this._y=new $$t.bo($$t.$eq.$type,0);this._ag=new $$t.bo($$t.$eq.$type,0);this._z=new $$t.bo($$t.$eq.$type,0);this._o=false;this._al=null;this._t=false;this._au=null;this.isInitialized(false);this._m=false;this._s=false;this._n=false;this._r=false;this._q=false;this._p=false;this.catalogs(new $$t.c4($$t.$d6.$type));this.cubes(new $$t.c4($$t.$c9.$type));this.measureGroups(new $$t.c4($$t.$d7.$type));this.rowAxis(new $$t.c4($$t.$bc.$type));this.columnAxis(new $$t.c4($$t.$bc.$type));this.filters(new $$t.c4($$t.$bg.$type));this.measures(new $$t.c4($$t.$bi.$type));this.measureListLocation(1);this.measureListIndex(-1);this.sourceOptions(a);this.result(function(){var $ret=new $$t.bl;$ret.isEmpty(true);return $ret}())},_isInitialized:false,isInitialized:function(a){if(arguments.length===1){this._isInitialized=a;return a}else{return this._isInitialized}},_catalogs:null,catalogs:function(a){if(arguments.length===1){this._catalogs=a;return a}else{return this._catalogs}},_cubes:null,cubes:function(a){if(arguments.length===1){this._cubes=a;return a}else{return this._cubes}},_cube:null,cube:function(a){if(arguments.length===1){this._cube=a;return a}else{return this._cube}},_measureGroup:null,measureGroup:function(a){if(arguments.length===1){this._measureGroup=a;return a}else{return this._measureGroup}},_measureGroups:null,measureGroups:function(a){if(arguments.length===1){this._measureGroups=a;return a}else{return this._measureGroups}},_sourceOptions:null,sourceOptions:function(a){if(arguments.length===1){this._sourceOptions=a;return a}else{return this._sourceOptions}},dataProviderFactory:function(a){if(arguments.length===1){this.g=a;return a}else{if(this.g==null){this.g=this.h()}return this.g}},_metadataTree:null,metadataTree:function(a){if(arguments.length===1){this._metadataTree=a;return a}else{return this._metadataTree}},_rowAxis:null,rowAxis:function(a){if(arguments.length===1){this._rowAxis=a;return a}else{return this._rowAxis}},_columnAxis:null,columnAxis:function(a){if(arguments.length===1){this._columnAxis=a;return a}else{return this._columnAxis}},_filters:null,filters:function(a){if(arguments.length===1){this._filters=a;return a}else{return this._filters}},_measures:null,measures:function(a){if(arguments.length===1){this._measures=a;return a}else{return this._measures}},measureListIndex:function(a){if(arguments.length===1){if(this.ai!=a){this._p=true;this.ai=a;this.a1();this._p=false}return a}else{return this.ai}},measureListLocation:function(a){if(arguments.length===1){if(this.j!=a){this.az();this.j=a;this.a1()}return a}else{return this.j}},_result:null,result:function(a){if(arguments.length===1){this._result=a;return a}else{return this._result}},_l:null,_c:null,_y:null,_ag:null,_z:null,af:null,_o:false,_al:null,_t:false,_au:null,_m:false,_s:false,_n:false,_r:false,_q:false,_p:false,getMembersOfLevel:function(a){},getMembersOfHierarchy:function(a){},getMembersOfMember:function(a){},setCube:function(a){if(!this.isInitialized()){throw new $$t.ch(1,"Data source is not initialized.")}return this.aq(a)},setMeasureGroup:function(a){if(!this.isInitialized()){throw new $$t.ch(1,"Data source is not initialized.")}return this.ar(a)},getCoreElement:function(a,b){if(b==$$t.$er.$type){var c;if(this.measureListLocation()==1){c=this.columnAxis()}else{c=this.rowAxis()}var d=null;var f=c.getEnumerator();while(f.moveNext()){var e=f.current();d=$b($$t.$er.$type,e);if(d!=null){break}}return d}else{return $$t.$cn.af($$t.$bc.$type,this.getCoreElements(a,b))}},getCoreElements:function(a,b){if(b==$$t.$ec.$type){return this.a($$t.$ec.$type,$$t.$cn.u($$t.$ec.$type,this._c._t,function(c){return a(c)}))}if(b==$$t.$bg.$type){return this.a($$t.$bg.$type,$$t.$cn.u($$t.$bg.$type,this._c._u,function(c){return a(c)}))}if(b==$$t.$ee.$type){return this.a($$t.$ee.$type,$$t.$cn.u($$t.$ee.$type,this._c._x,function(c){return a(c)}))}if(b==$$t.$bi.$type){return this.a($$t.$bi.$type,$$t.$cn.u($$t.$bi.$type,this._c._z,function(c){return a(c)}))}if(b==$$t.$en.$type){return this.a($$t.$en.$type,$$t.$cn.u($$t.$en.$type,this._c._v,function(c){return a(c)}))}if(b==$$t.$eh.$type){return this.a($$t.$eh.$type,$$t.$cn.u($$t.$eh.$type,this._c._w,function(c){return a(c)}))}throw new $$t.y(1,"Supported types are Dimension, Hierarchy, Level and Measure")},expandTupleMember:function(a,b,c){var d=this.d(a,this.result());if(d==null){throw new $$t.ch(1,"No axis found for the specified index.")}var e=$$t.$a.u(b,c,d);if(e==false){return}var f=$$t.$cn.af($$t.$ej.$type,$$t.$cn.u($$t.$ej.$type,this.w,function(g){return g._c==a&&g._b==b&&g._a==c}));if(f==null){f=function(){var $ret=new $$t.ej;$ret._c=a;$ret._a=c;$ret._b=b;return $ret}();this.w.add(f)}else{this.w.remove(f)}},collapseTupleMember:function(a,b,c){var d=this.d(a,this.result());if(d==null){throw new $$t.ch(1,"No axis found for the specified index.")}var e=$$t.$a.u(b,c,d);if(e==false){return}var f=$$t.$cn.af($$t.$ej.$type,$$t.$cn.u($$t.$ej.$type,this.w,function(g){return g._c==a&&g._b==b&&g._a==c}));if(f==null){f=function(){var $ret=new $$t.ej;$ret._c=a;$ret._a=c;$ret._b=b;return $ret}();this.v.add(f)}else{this.w.remove(f)}},clearPendingChanges:function(){this.v.clear();this.w.clear()},update:function(){var $self=this;if(this._t){return this._au}this._t=true;var a=null;if(this.w.count()>0){a=this.an(this.w)}if(this.ah.count()>0){var b=new $$t.dh(Array,0);var c=new Array(this.ah.count());for(var d=0;d<c.length;d++){c[d]=this.getMembersOfHierarchy(this.ah.__inner[d])}this.ah.clear();var e=new $$t.es;e.c(c,b.e.runOn(b));if(a!=null){a=$$t.$et.a(Array,a,function(f){return b._b})}else{a=b._b}}if(a!=null){a=$$t.$et.a($$t.$bl.$type,a,function(f){return $self.as()})}else{a=this.as()}this._au=a;this._au.j(function(f){$self._t=false;$self._au=null});return a},initialize:function(){var $self=this;if(this._o){return this._al}this._o=true;this._al=this.ap();var a=this._al;this._al.j(function(b){$self._o=false;$self._al=null});return a},addFilterMember:function(a,b){var $self=this;var c;var d=function(){var e=$self.b(a,c);c=e.p1;return e.ret}();if(d==null){d=new $$t.eq(a,function(){var $ret=new $$t.c4(String);$ret.add(b);return $ret}());c.add(d)}if(!d._a.contains(b)){d._a.add(b);if(this.af.contains(b)){this.af.remove(b)}else{this.af.add(b)}}var e;if(!function(){var f=$self._c.h(b,e);e=f.p1;return f.ret}()&&!this.ah.contains(a)){this.ah.add(a)}},getFilterMemberNames:function(a){var $self=this;var b;var c=function(){var d=$self.b(a,b);b=d.p1;return d.ret}();if(c!=null){return this.a(String,c._a)}return new $$t.c4(String)},removeFilterMember:function(a,b){var $self=this;var c;var d=function(){var e=$self.b(a,c);c=e.p1;return e.ret}();if(d==null){return}if(d._a.remove(b)){if(this.af.contains(b)){this.af.remove(b)}else{this.af.add(b)}}},removeAllFilterMembers:function(a){var $self=this;var b;var c=function(){var d=$self.b(a,b);b=d.p1;return d.ret}();if(c==null){return}for(var d=c._a.count()-1;d>=0;d--){var e=c._a.item(d);c._a.removeAt(d);if(this.af.contains(e)){this.af.remove(e)}else{this.af.add(e)}}},getProviderDefaultProperties:function(){var a=new $$t.bo($$t.$eb.$type,0);return a},getProviderDefaultRestrictions:function(){var a=new $$t.bo($$t.$eb.$type,0);return a},tryGetMember:function(a,b){var $self=this;return{ret:function(){var c=$self._c.h(a,b);b=c.p1;return c.ret}(),p1:b}},tryGetMembersForLevel:function(a,b){var $self=this;return{ret:function(){var c=$self._c.j(a,b);b=c.p1;return c.ret}(),p1:b}},ap:function(){},as:function(){},h:function(){},aj:function(){},aq:function(a){var $self=this;if(String.isNullOrEmpty(a)){if(a==null){throw new $$t.cr(0,"cubeName")}throw new $$t.ch(1,"cubeName cannot be empty.")}var b=new $$t.dh($$t.$bb.$type,0);if(this.cube()!=null){if(this.cube().name()==a){b.e(this.metadataTree());return b._b}this.aw()}var d=this.cubes().getEnumerator();while(d.moveNext()){var c=d.current();if(c.name()==a){this.cube(c);break}}var e=this.aj();if(!this.isInitialized()){var f=this.sourceOptions().measureGroup();if(!String.isNullOrEmpty(f)){return $$t.$et.a($$t.$bb.$type,e,function(g){return $self.ar(f)})}}return $$t.$et.a($$t.$bb.$type,e,function(g){return $self.ar(null)})},ak:function(){var $self=this;var a=null;var b=null;var c=null;var d=new $$t.bo($$t.$eq.$type,0);if(!String.isNullOrEmpty(this.sourceOptions().columns())){var e=new $$t.eu(this.sourceOptions().columns());a=e.c()}if(!String.isNullOrEmpty(this.sourceOptions().rows())){var f=new $$t.eu(this.sourceOptions().rows());b=f.c()}if(!String.isNullOrEmpty(this.sourceOptions().filters())){var g=new $$t.eu(this.sourceOptions().filters());c=g.c()}if(a!=null&&a.count()>0){var i=a.getEnumerator();while(i.moveNext()){var h=i.current();this.av($$t.$bc.$type,h._b,this.columnAxis(),$$t.$bg.$type);this._y.add(h);if(h._a.count()>0){d.add(h);var k=h._a.getEnumerator();while(k.moveNext()){var j=k.current();this.af.add(j)}}}}if(b!=null&&b.count()>0){var m=b.getEnumerator();while(m.moveNext()){var l=m.current();this.av($$t.$bc.$type,l._b,this.rowAxis(),$$t.$bg.$type);this._ag.add(l);if(l._a.count()>0){d.add(l);var o=l._a.getEnumerator();while(o.moveNext()){var n=o.current();this.af.add(n)}}}}if(c!=null&&c.count()>0){var q=c.getEnumerator();while(q.moveNext()){var p=q.current();this.av($$t.$bg.$type,p._b,this.filters(),$$t.$bg.$type);this._z.add(p);if(p._a.count()>0){d.add(p);var s=p._a.getEnumerator();while(s.moveNext()){var r=s.current();this.af.add(r)}}}}var t=null;if(!String.isNullOrEmpty(this.sourceOptions().measures())){var u=new $$t.eu(this.sourceOptions().measures());t=u.c()}if(t!=null&&t.count()>0){var w=t.getEnumerator();while(w.moveNext()){var v=w.current();this.av($$t.$bi.$type,v._b,this.measures(),$$t.$bi.$type)}}if(this._m||this._s||this._n||this._r||this._p){if(d.count()>0){var x=new Array(d.count());for(var y=0;y<d.count();y++){var z=d.item(y)._b;x[y]=this.getMembersOfHierarchy(z)}var aa=new $$t.dh($$t.$bb.$type,0);var ab=new $$t.es;ab.c(x,function(ac){$self.as().j(function(ad){$self.ay();aa.e($self.metadataTree())})});return aa._b}return $$t.$et.b($$t.$bl.$type,$$t.$bb.$type,this.as(),function(ac){$self.ay();var ad=new $$t.dh($$t.$bb.$type,0);ad.e($self.metadataTree());return ad._b})}this.ay();var ac=new $$t.dh($$t.$bb.$type,0);ac.e(this.metadataTree());return ac._b},am:function(a){var $self=this;var b=this.dataProviderFactory().createDataProvider();var c=this.getProviderDefaultRestrictions();var d=this.getProviderDefaultProperties();var e=b.discoverCubesAsync(d,c).k($$t.$be.$type.specialize($$t.$c9.$type),function(f){$self.cubes($self.a($$t.$c9.$type,f.n()));return $self.cubes()});return e},ao:function(){var $self=this;var a=this.dataProviderFactory().createDataProvider();var b=this.getProviderDefaultRestrictions();var c=this.getProviderDefaultProperties();var d=a.discoverMeasureGroupsAsync(c,b).k($$t.$be.$type.specialize($$t.$d7.$type),function(e){$self.measureGroups($self.a($$t.$d7.$type,e.n()));return $self.measureGroups()});return d},ay:function(){this.isInitialized(true)},aw:function(){this.cube(null);this.measureGroups(new $$t.c4($$t.$d7.$type));this.filters().clear();this.rowAxis().clear();this.columnAxis().clear();this.measures().clear();this._c=null;this.ax()},ax:function(){this.measureGroup(null);this.metadataTree(null)},ar:function(a){var $self=this;if(this.cube()==null){throw new $$t.ch(1,"Data source has no Cube set.")}var b=new $$t.dh($$t.$bb.$type,0);if(this.measureGroup()!=null){if(this.measureGroup().name()==a){b.e(this.metadataTree());return b._b}this.ax()}if(!String.isNullOrEmpty(a)&&this.measureGroups().count()==0){var c=$$t.$et.b($$t.$be.$type.specialize($$t.$d7.$type),$$t.$bb.$type,this.ao(),function(d){if($self.measureGroups().count()==0){return $self.ar(null)}return $self.ar(a)});return c}var e=this.measureGroups().getEnumerator();while(e.moveNext()){var d=e.current();if(d.name()==a){this.measureGroup(d);break}}this.metadataTree(this.k(a));b.e(this.metadataTree());return b._b},k:function(a){var $self=this;var b=function(){var $ret=new $$t.bb;$ret.type(0);$ret.caption($self.cube().caption());$ret.item($self.cube());return $ret}();var c;var d;var e;var f=true;if(String.isNullOrEmpty(a)||this.measureGroups()==null){c=this._c._t;d=this._c._z;e=this._c._w}else{f=false;c=this._c._a.getMeasureGroupDimensions(a);d=this._c._a.getMeasureGroupMeasures(a);e=this._c._a.getMeasureGroupKpis(a)}var g=$$t.$ev.getDimensionMetaItems(c,d,e,this._c._u,this._c._x,f,this._c,this.measureGroups());$$t.$ev.setMetaItemChildren(b,g);return b},d:function(a,b){if(b!=null&&b.axes().count()>0){return $$t.$cn.af($$t.$bm.$type,$$t.$cn.u($$t.$bm.$type,b.axes(),function(c){return c.name()==a}))}return null},a0:function(a,b){switch(a.action()){case 0:var d=a.newItems().getEnumerator();while(d.moveNext()){var c=d.current();var e=$b($$t.$bg.$type,c);if(e!=null){if(this.isInitialized()){b.add(new $$t.eq(e.uniqueName(),new $$t.c4(String)))}}}break;case 1:var g=a.oldItems().getEnumerator();while(g.moveNext()){var f=g.current();var h=$b($$t.$bg.$type,f);if(h!=null){var i=$$t.$cn.af($$t.$eq.$type,$$t.$cn.u($$t.$eq.$type,b,function(j){return j._b==h.uniqueName()}));if(i!=null){var j=new $$t.bo(String,0);for(var k=0;k<i._a.count();k++){j.add(i._a.item(k))}for(var l=0;l<j.count();l++){var m=j.item(l);this.removeFilterMember(i._b,m)}b.remove(i)}}else{var n=$b($$t.$er.$type,f);if(n!=null){if(!this._r&&!this._q&&!this._p){this.measures().clear()}}}}break}},a2:function(a,b){switch(a.action()){case 0:var d=a.newItems().getEnumerator();while(d.moveNext()){var c=d.current();var e=$b($$t.$bg.$type,c);if(e!=null){var f=$b($$t.$er.$type,$$t.$cn.af($$t.$bc.$type,$$t.$cn.u($$t.$bc.$type,b,function(g){return $b($$t.$er.$type,g)!==null})));if(f!=null&&this.measureListIndex()>=a.newStartingIndex()){this.measureListIndex(this.measureListIndex()+1)}}}break;case 1:var h=a.oldItems().getEnumerator();while(h.moveNext()){var g=h.current();var i=$b($$t.$bg.$type,g);if(i!=null){var j=$b($$t.$er.$type,$$t.$cn.af($$t.$bc.$type,$$t.$cn.u($$t.$bc.$type,b,function(k){return $b($$t.$er.$type,k)!==null})));if(j!=null&&this.measureListIndex()>a.oldStartingIndex()){this.measureListIndex(this.measureListIndex()-1)}}}break}},a1:function(){var $self=this;var a;if(this.measureListLocation()==1){a=this.columnAxis()}else{a=this.rowAxis()}var b=null;var c=0;var e=a.getEnumerator();while(e.moveNext()){var d=e.current();b=$b($$t.$er.$type,d);if(b!=null){break}c++}if(this.measures().count()>1){if(b==null){b=function(){var $ret=new $$t.er;$ret.measures($self.measures());return $ret}();if(this.measureListIndex()<0||this.measureListIndex()>a.count()){this.ai=a.count();a.add(b)}else{a.insert(this.measureListIndex(),b)}}else{if(c!=this.measureListIndex()){a.removeAt(c);if(this.measureListIndex()>a.count()){this.ai=a.count();a.add(b)}else{a.insert(this.measureListIndex(),b)}}}}else{if(b!=null){a.removeAt(c)}}},ab:function(){return this.w},aa:function(){return this.v},av:function($tItem,a,b,c){var d=function(e){return $v($tItem,e).uniqueName()==a};var e=this.getCoreElement(d,c);if(e!=null&&!$$t.$cn.e($.ig.$op.$type,b,e)){b.add($v($tItem,e))}},an:function(a){var b=new $$t.bo(String,0);var d=a.getEnumerator();while(d.moveNext()){var c=d.current();var e=this.d(c._c,this.result()).tuples().__inner[c._b].members().item(c._a);var f=this.getCoreElement(function(g){return g.hierarchyUniqueName()==e.hierarchyUniqueName()&&g.depth()==e.levelNumber()+1},$$t.$ee.$type);if(f!=null&&!this._c.c(f.uniqueName())&&!b.contains(f.uniqueName())){b.add(f.uniqueName())}}if(b.count()>0){var g=new Array(b.count());for(var h=0;h<b.count();h++){g[h]=this.getMembersOfLevel(b.item(h))}return(new $$t.es).d(Array,g,function(i){return i})}var i=new $$t.dh(Array,0);i.e(new Array(0));return i._b},az:function(){var a;if(this.measureListLocation()==1){a=this.columnAxis()}else{a=this.rowAxis()}if(a==null){return}var b=null;var c=0;var e=a.getEnumerator();while(e.moveNext()){var d=e.current();b=$b($$t.$er.$type,d);if(b!=null){break}c++}if(b!=null){this._q=true;a.removeAt(c)}},a:function($t,a){var b=new $$t.c4($t);var d=a.getEnumerator();while(d.moveNext()){var c=d.current();b.add(c)}return b},b:function(a,b){var c=$$t.$cn.af($$t.$eq.$type,$$t.$cn.u($$t.$eq.$type,this._y,function(d){return d._b==a}));if(c!=null){b=this._y;return{ret:c,p1:b}}c=$$t.$cn.af($$t.$eq.$type,$$t.$cn.u($$t.$eq.$type,this._ag,function(d){return d._b==a}));if(c!=null){b=this._ag;return{ret:c,p1:b}}c=$$t.$cn.af($$t.$eq.$type,$$t.$cn.u($$t.$eq.$type,this._z,function(d){return d._b==a}));if(c!=null){b=this._z;return{ret:c,p1:b}}b=null;return{ret:null,p1:b}},u:function(a,b,c){if(a<0||a>=c.tuples().count()){throw new $$t.ey(1,"tupleIndex")}else{var d=c.tuples().__inner[a];if(b<0||b>=d.members().count()){throw new $$t.ey(1,"tupleIndex")}var e=d.members().item(b);if(e.isExpandable()==false){return false}}return true},$type:new $.ig.Type("OlapDataSource",$.ig.$ot,[$$t.$ba.$type])},true);$c("PositionInfo:ej","Object",{init:function(){$.ig.$op.init.call(this)},_c:null,_b:0,_a:0,$type:new $.ig.Type("PositionInfo",$.ig.$ot)},true);$c("LevelSortDirection:ez","Object",{init:function(){$.ig.$op.init.call(this);this.sortBehavior(1)},_levelUniqueName:null,levelUniqueName:function(a){if(arguments.length===1){this._levelUniqueName=a;return a}else{return this._levelUniqueName}},_sortDirection:0,sortDirection:function(a){if(arguments.length===1){this._sortDirection=a;return a}else{return this._sortDirection}},_sortBehavior:0,sortBehavior:function(a){if(arguments.length===1){this._sortBehavior=a;return a}else{return this._sortBehavior}},$type:new $.ig.Type("LevelSortDirection",$.ig.$ot)},true);$c("TupleSortDirection:e1","Object",{init:function(){$.ig.$op.init.call(this)},_tupleIndex:0,tupleIndex:function(a){if(arguments.length===1){this._tupleIndex=a;return a}else{return this._tupleIndex}},_memberNames:null,memberNames:function(a){if(arguments.length===1){this._memberNames=a;return a}else{return this._memberNames}},_sortDirection:0,sortDirection:function(a){if(arguments.length===1){this._sortDirection=a;return a}else{return this._sortDirection}},_comparer:null,comparer:function(a){if(arguments.length===1){this._comparer=a;return a}else{return this._comparer}},$type:new $.ig.Type("TupleSortDirection",$.ig.$ot)},true);$c("DataSourceBase:e2","Object",{init:function(){$.ig.$op.init.call(this)},_dataSource:null,dataSource:function(a){if(arguments.length===1){this._dataSource=a;return a}else{return this._dataSource}},isInitialized:function(){if(this.dataSource()==null){return false}return this.dataSource().isInitialized()},_isModified:false,isModified:function(a){if(arguments.length===1){this._isModified=a;return a}else{return this._isModified}},_isUpdating:false,isUpdating:function(a){if(arguments.length===1){this._isUpdating=a;return a}else{return this._isUpdating}},initialize:function(){var promise_=this.dataSource().initialize()._d;var $this=this;if(!this._isInitializedAttached){this._isInitializedAttached=true;promise_.always(function(result){var args={error:null,metadataTreeRoot:null};if(promise_.state()==="rejected"){args.error=result}else{args.metadataTreeRoot=result}$($this).trigger("initialized",args);$this._isInitializedAttached=false})}return promise_},cubes:function(){return this.dataSource().cubes().inner()},cube:function(){return this.dataSource().cube()},setCube:function(a){return this.dataSource().setCube(a).k($$t.$bb.$type,function(b){return b.n()})._d},metadataTree:function(){return this.dataSource().metadataTree()},addRowItem:function(a){if($b($$t.$bg.$type,a)!==null){this.dataSource().rowAxis().add(a);this.isModified(true)}},insertRowItem:function(a,b){if($b($$t.$bg.$type,b)!==null){this.dataSource().rowAxis().insert(a,b);this.isModified(true)}},removeRowItem:function(a){if($b($$t.$bg.$type,a)!==null||$b($$t.$er.$type,a)!==null){this.dataSource().rowAxis().remove(a);this.isModified(true)}},addColumnItem:function(a){if($b($$t.$bg.$type,a)!==null){this.dataSource().columnAxis().add(a);this.isModified(true)}},insertColumnItem:function(a,b){if($b($$t.$bg.$type,b)!==null){this.dataSource().columnAxis().insert(a,b);this.isModified(true)}},removeColumnItem:function(a){if($b($$t.$bg.$type,a)!==null||$b($$t.$er.$type,a)!==null){this.dataSource().columnAxis().remove(a);this.isModified(true)}},addFilterItem:function(a){if($b($$t.$bg.$type,a)!==null){this.dataSource().filters().add(a);this.isModified(true)}},insertFilterItem:function(a,b){if($b($$t.$bg.$type,b)!==null){this.dataSource().filters().insert(a,b);this.isModified(true)}},removeFilterItem:function(a){if($b($$t.$bg.$type,a)!==null){this.dataSource().filters().remove(a);this.isModified(true)}},addMeasureItem:function(a){if($b($$t.$bi.$type,a)!==null){this.dataSource().measures().add(a);this.isModified(true)}},insertMeasureItem:function(a,b){if($b($$t.$bi.$type,b)!==null){this.dataSource().measures().insert(a,b);this.isModified(true)}},removeMeasureItem:function(a){if($b($$t.$bi.$type,a)!==null){this.dataSource().measures().remove(a);this.isModified(true)}},setMeasureListIndex:function(a){this.dataSource().measureListIndex(a);this.isModified(true)},setMeasureListLocation:function(a){switch(a){case"rows":this.dataSource().measureListLocation(0);break;case"columns":this.dataSource().measureListLocation(1);break;default:break}this.isModified(true)},getMeasureListLocation:function(){switch(this.dataSource().measureListLocation()){case 0:return"rows";break;case 1:return"columns";break;default:return null;break}},expandTupleMember:function(a,b,c){this.dataSource().expandTupleMember(a,b,c)},collapseTupleMember:function(a,b,c){this.dataSource().collapseTupleMember(a,b,c)},rowAxis:function(){return this.dataSource().rowAxis().inner()},columnAxis:function(){return this.dataSource().columnAxis().inner()},filters:function(){return this.dataSource().filters().inner()},measures:function(){return this.dataSource().measures().inner()},result:function(){return this.dataSource().result()},bindCollectionChanged:function(a){var options_=a;var ds_=this.dataSource();var attachCollectionChanged=function(collection,handler){collection.collectionChanged=$.ig.Delegate.prototype.combine(collection.collectionChanged,handler)};if($.isFunction(options_["filters"])){attachCollectionChanged(ds_._filters,options_["filters"])}if($.isFunction(options_["rowAxis"])){attachCollectionChanged(ds_._rowAxis,options_["rowAxis"])}if($.isFunction(options_["columnAxis"])){attachCollectionChanged(ds_._columnAxis,options_["columnAxis"])}if($.isFunction(options_["measures"])){attachCollectionChanged(ds_._measures,options_["measures"])}},unbindCollectionChanged:function(a){var options_=a;var ds_=this.dataSource();var unbindCollectionChanged=function(collection,handler){collection.collectionChanged=$.ig.Delegate.prototype.remove(collection.collectionChanged,handler)};if($.isFunction(options_["filters"])){unbindCollectionChanged(ds_._filters,options_["filters"])}if($.isFunction(options_["rowAxis"])){unbindCollectionChanged(ds_._rowAxis,options_["rowAxis"])}if($.isFunction(options_["columnAxis"])){unbindCollectionChanged(ds_._columnAxis,options_["columnAxis"])}if($.isFunction(options_["measures"])){unbindCollectionChanged(ds_._measures,options_["measures"])}},clearPendingChanges:function(){this.dataSource().clearPendingChanges()},update:function(){var promise_=this.dataSource().update()._d;var $this=this;if(!this.isUpdating()){this.isUpdating(true);promise_.always(function(result){
var args={error:null,result:null};if(promise_.state()==="rejected"){args.error=result}else{args.result=result}$this.isUpdating(false);$this.isModified(false);$($this).trigger("updated",args)})}return promise_},getCoreElement:function(a,b){return this.dataSource().getCoreElement(a,b)},getCoreElements:function(a,b){return this.dataSource().getCoreElements(a,b).inner()},getMembersOfHierarchy:function(a){return this.dataSource().getMembersOfHierarchy(a)._d},getMembersOfLevel:function(a){return this.dataSource().getMembersOfLevel(a)._d},tryGetMember:function(a){var $self=this;var b;if(function(){var c=$self.dataSource().tryGetMember(a,b);b=c.p1;return c.ret}()){return b}return null},tryGetMembersForLevel:function(a){var $self=this;var b=new $$t.c4($$t.$d4.$type);var c=function(){var d=$self.dataSource().tryGetMembersForLevel(a,b);b=d.p1;return d.ret}();return c?b.inner():new $$t.c4($$t.$d4.$type).inner()},getMembersOfMember:function(a){return this.dataSource().getMembersOfMember(a)._d},addFilterMember:function(a,b){this.dataSource().addFilterMember(a,b);this.isModified(true)},removeAllFilterMembers:function(a){this.dataSource().removeAllFilterMembers(a);this.isModified(true)},getFilterMemberNames:function(a){return this.dataSource().getFilterMemberNames(a).inner()},getDimension:function(a){return this.dataSource().getCoreElement(function(b){return b.uniqueName()==a},$$t.$ec.$type)},getHierarchy:function(a){return this.dataSource().getCoreElement(function(b){return b.uniqueName()==a},$$t.$bg.$type)},getLevel:function(a){return this.dataSource().getCoreElement(function(b){return b.uniqueName()==a},$$t.$ee.$type)},getMeasure:function(a){return this.dataSource().getCoreElement(function(b){return b.uniqueName()==a},$$t.$bi.$type)},getMeasureList:function(){return this.dataSource().getCoreElement(null,$$t.$er.$type)},$type:new $.ig.Type("DataSourceBase",$.ig.$ot)},true);$c("TaskExtensions:et","Object",{init:function(){$.ig.$op.init.call(this)},a:function($tResult,a,b){var c=new $$t.dh($tResult,0);a.f(function(d){if(d._a==null){try{b(d).j(function(e){if(e._a==null){c.e(e.n());return}c.d(e._a)})}catch(e_){var e;e=e_;console.log(e_);c.d(e)}}else{c.d(d._a)}});return c._b},b:function($tResult1,$tResult2,a,b){return $$t.$et.a($tResult2,a,function(c){return b(c)})},$type:new $.ig.Type("TaskExtensions",$.ig.$ot)},true);$c("OlapUtilities:e3","Object",{init:function(){$.ig.$op.init.call(this)},dateMemberProvider:function(a,b,c,d){if(String.isNullOrEmpty(a)||String.isNullOrEmpty(b)){return null}var propName_=b;var datePartFormat_=d;var format_=c;var yearProvider_;var semesterProvider_;var quarterProvider_;var monthProvider_;a=a.toLowerCase();switch(a){case"year":if(datePartFormat_==null){datePartFormat_="yyyy"}if(format_==null){return function(item){return $.ig.formatter(new Date(item[propName_]),"date",datePartFormat_)}}return function(item){return format_.replace("{0}",$.ig.formatter(new Date(item[propName_]),"date",datePartFormat_))};case"semester":if(format_==null){format_="H{0}"}yearProvider_=$$t.$e3.dateMemberProvider("year",b,null,null);return function(item){var year=yearProvider_(item);return format_.replace("{0}",Math.floor(new Date(item[propName_]).getMonth()/6)+1).replace("{1}",year)};case"quarter":if(format_==null){format_="Q{0}"}yearProvider_=$$t.$e3.dateMemberProvider("year",b,null,null);semesterProvider_=$$t.$e3.dateMemberProvider("semester",b,null,null);return function(item){var year=yearProvider_(item);var semester=semesterProvider_(item);return format_.replace("{0}",Math.floor(new Date(item[propName_]).getMonth()/3)+1).replace("{1}",semester).replace("{2}",year)};case"month":if(datePartFormat_==null){datePartFormat_="MMMM"}if(format_==null){return function(item){return $.ig.formatter(new Date(item[propName_]),"date",datePartFormat_)}}yearProvider_=$$t.$e3.dateMemberProvider("year",b,null,null);semesterProvider_=$$t.$e3.dateMemberProvider("semester",b,null,null);quarterProvider_=$$t.$e3.dateMemberProvider("quarter",b,null,null);return function(item){var year=yearProvider_(item);var semester=semesterProvider_(item);var quarter=quarterProvider_(item);return format_.replace("{0}",$.ig.formatter(new Date(item[propName_]),"date",datePartFormat_)).replace("{1}",quarter).replace("{2}",semester).replace("{3}",year)};case"date":if(datePartFormat_==null){datePartFormat_=$.ig.regional.defaults.datePattern.toString()}if(format_==null){return function(item){return $.ig.formatter(new Date(item[propName_]),"date",datePartFormat_)}}yearProvider_=$$t.$e3.dateMemberProvider("year",b,null,null);semesterProvider_=$$t.$e3.dateMemberProvider("semester",b,null,null);quarterProvider_=$$t.$e3.dateMemberProvider("quarter",b,null,null);monthProvider_=$$t.$e3.dateMemberProvider("month",b,null,null);return function(item){var year=yearProvider_(item);var semester=semesterProvider_(item);var quarter=quarterProvider_(item);var month=monthProvider_(item);return format_.replace("{0}",$.ig.formatter(new Date(item[propName_]),"date",datePartFormat_)).replace("{1}",month).replace("{2}",quarter).replace("{3}",semester).replace("{4}",year)}}return null},getDateHierarchy:function(a,b,c,d,e,f){if(String.isNullOrEmpty(a)){return null}if(b==null||b.length==0){b=["year","quarter","month","date"]}else{for(var g=0;g<b.length;g++){b[g]=b[g].toLowerCase()}}if(c==null){c="Dates"}if(d==null){d=c}var res_=null;var name_=c;var caption_=d;var rootCaption_=f;var dateParts_=b;if(e==null){e=new Array(b.length);for(var h=0;h<e.length;h++){var i=b[h];e[h]=i.substr(0,1).toUpperCase()+i.substr(1,i.length)+"s"}}var captions_=e;var memberProviders_=new Array(b.length);for(var j=0;j<b.length;j++){var k=b[j];memberProviders_[j]=$$t.$e3.dateMemberProvider(k,a,null,null)}var levelsMetadata=[];var levelOffset=0;if(rootCaption_!=null&&rootCaption_!=""){levelOffset=1;levelsMetadata[0]={name:rootCaption_,caption:rootCaption_,memberProvider:function(item){return rootCaption_}}}for(var i=0;i<memberProviders_.length;i++){levelsMetadata[i+levelOffset]={name:dateParts_[i],caption:captions_[i],memberProvider:memberProviders_[i]}}res_={name:name_,caption:caption_,levels:levelsMetadata,isDateTimeHier:true};return res_},sumAggregator:function(a,b){var propName_=a;var precision_=b;return function(items,cellMetadata){var sum=0,areAllNullOrUndefined=true,value;for(var i=0;i<items.length;i++){value=items[i][propName_];if(value!==null&&value!==undefined){areAllNullOrUndefined=false;sum+=value}}if(areAllNullOrUndefined)return null;if(precision_!=null){return sum.toFixed(precision_)}return sum}},avgAggregator:function(a,b){var propName_=a;var precision_=b;return function(items,cellMetadata){if(precision_==null){precision_=2}var sum=0,count=0,areAllNullOrUndefined=true,value;for(var i=0;i<items.length;i++){value=items[i][propName_];if(value!==null&&value!==undefined){areAllNullOrUndefined=false;sum+=value;count++}}if(areAllNullOrUndefined)return null;return(sum/count).toFixed(precision_)}},minAggregator:function(a){var propName_=a;return function(items,cellMetadata){var result=items[0][propName_];for(var i=1;i<items.length;i++){result=Math.min(result,items[i][propName_])}return result}},maxAggregator:function(a){var propName_=a;return function(items,cellMetadata){var result=items[0][propName_];for(var i=1;i<items.length;i++){result=Math.max(result,items[i][propName_])}return result}},countAggregator:function(){return function(items,cellMetadata){return items.length}},$type:new $.ig.Type("OlapUtilities",$.ig.$ot)},true);$c("LevelSpanManager:e5","Object",{a:null,init:function(a){$.ig.$op.init.call(this);this._c=a;this.a=new Array(a)},_c:0,b:function(a,b){var c=this.a[a];if(c==null){c=new $$t.b9($$t.$l.$type,$$t.$e6.$type,0);this.a[a]=c}var d;if(!function(){var e=c.tryGetValue(b,d);d=e.p1;return e.ret}()){d=new $$t.e6;if(b>0){var e;if(function(){var f=c.tryGetValue(b-1,e);e=f.p1;return f.ret}()){d._a=e;e.e()}}c.add(b,d)}return d},$type:new $.ig.Type("LevelSpanManager",$.ig.$ot)},true);$c("SpanSource:e6","Object",{init:function(){$.ig.$op.init.call(this);this.c=1},_a:null,c:0,d:function(a){if(arguments.length===1){if(this.c!=a){var b=a-this.c;if(this._a!=null){this._a.d(this._a.d()+b)}this.c=a}return a}else{return this.c}},b:false,e:function(){if(!this.b){this.b=true;this.d(this.d()+1)}},$type:new $.ig.Type("SpanSource",$.ig.$ot)},true);$c("ITableViewHeadersFactory:e7","Object",{$type:new $.ig.Type("ITableViewHeadersFactory",null)},true);$c("TableViewHeadersFactory:e9","Object",{_b:null,_a:null,_c:0,_d:false,_e:null,init:function(a,b,c,d,e){$.ig.$op.init.call(this);this._b=a;this._a=b;this._c=c;this._d=d;this._e=e},createHeaderCells:function(){var $self=this;if(this._b.positionResolver().hasUnregisterdPositions()){this._b.positionResolver().completeRegisterPositions()}var a=this._b.positionResolver().rootPositionInfo();var b=new $$t.bo($$t.$be.$type.specialize($$t.$fa.$type),0);for(var c=0;c<a.positionSize();c++){b.add(new $$t.bo($$t.$fa.$type,0))}$$t.$e9.createHeaderCells2(a,a.positionItemDepthMin(),b,this._d,this._e);var d=new $$t.c4($$t.$e8.$type);var e=0;for(var f=0;f<a.positionSize();f++){var g=b.item(f);var h=0;var i=0;var k=g.getEnumerator();while(k.moveNext()){var j=k.current();var l;var m;var n;var o;if(this._c==0){l=h;m=j._c.d();n=j._b.positionItemDepth()+e;o=j._d.d()}else{n=h;o=j._c.d();l=j._b.positionItemDepth()+e;m=j._d.d()}var p=this._b.tuples().__inner[j._b.positionIndex()];var q=p.item(j._b.positionItemIndex());var r=this._b.tuples().__inner[j._l];if(this._a.positionResolver().hasUnregisterdPositions()){this._a.positionResolver().completeRegisterPositions()}var s=this._a.positionResolver().getPositionIndex(r);var t=function(){var $ret=new $$t.e8;$ret.axisName($self._b.name());$ret.hierarchyNumber(j._b.positionItemIndex());$ret.levelNumber(j._b.positionItemDepth());$ret.caption(q.caption());$ret.columnIndex(l);$ret.columnSpan(m);$ret.isExpanded(j._g);$ret.isExpandable(j._f);$ret.tupleIndex(s);$ret.memberIndex(j._b.positionItemIndex());$ret.rowIndex(n);$ret.rowSpan(o);return $ret}();if(!j._h){h=h+j._c.d()}i=Math.max(i,j._b.positionItemDepth());d.add(t)}e+=i+1}return d},createHeaderCells2:function(a,b,c,d,e){var f=new $$t.e5(a.positionSize());var h=$$t.$cn.u($$t.$b8.$type.specialize(String,$.ig.$op.$type),a.values(),function(i){return i.positionItemDepth()==b}).getEnumerator();while(h.moveNext()){var g=h.current();var i;var j;var k=$$t.$e9.createHeaderCells1(a,g,c,f,d,e,i,j);i=k.p6;j=k.p7}},h:function(a,b,c,d,e,f){var g=$$t.$cn.z($$t.$b8.$type.specialize(String,$.ig.$op.$type),$$t.$cn.u($$t.$b8.$type.specialize(String,$.ig.$op.$type),a.values(),function(h){return h.positionItemDepth()==a.positionItemDepthMin()}));if(g.count()>0){var i=g.getEnumerator();while(i.moveNext()){var h=i.current();var j;var k;var l=$$t.$e9.createHeaderCells1(a,h,b,c,d,f,j,k);j=l.p6;k=l.p7;e._c.d(e._c.d()+k);if(j._h){e._c.d(e._c.d()+1)}}e._c.d(e._c.d()-1)}else{f.add(a.positionIndex())}e._l=a.positionIndex()},createHeaderCells1:function(a,b,c,d,e,f,g,h){var i=c.item(b.positionItemIndex());var j=d.b(b.positionItemIndex(),b.positionItemDepth());var k=function(){var $ret=new $$t.fa;$ret._d=j;$ret._b=b;$ret._a=a;$ret._f=b.isExpandable();return $ret}();g=k;if(e){i.add(k);$$t.$e9.h(b,c,d,true,k,f)}var l=null;if(b.isExpanded()){l=$$t.$cn.z($$t.$b8.$type.specialize(String,$.ig.$op.$type),$$t.$cn.u($$t.$b8.$type.specialize(String,$.ig.$op.$type),a.values(),function(m){return m.parentKey()==b.key()}))}if(l!=null&&l.count()>0){var m=function(){var $ret=new $$t.fa;$ret._h=true;$ret._b=b;$ret._f=b.isExpandable();return $ret}();i.add(m);var o=l.getEnumerator();while(o.moveNext()){var n=o.current();var p;var q;var r=$$t.$e9.createHeaderCells1(a,n,c,d,e,f,p,q);p=r.p6;q=r.p7;m._c.d(m._c.d()+q);if(p._h){m._c.d(m._c.d()+1)}}m._c.d(m._c.d()-1);k._g=true;k._f=false;m._g=true;k._e=m;if(!e){i.add(k);$$t.$e9.h(b,c,d,false,k,f)}m._l=k._l;g=m;h=k._c.d()+m._c.d()-1}else{if(b.isExpanded()){k._f=false}if(!e){i.add(k);$$t.$e9.h(b,c,d,false,k,f)}h=k._c.d()}return{p6:g,p7:h}},$type:new $.ig.Type("TableViewHeadersFactory",$.ig.$ot,[$$t.$e7.$type])},true);$c("TableSuperCompactViewHeadersFactory:fb","Object",{_b:null,_a:null,_c:0,_d:false,_e:null,init:function(a,b,c,d,e){$.ig.$op.init.call(this);this._b=a;this._a=b;this._c=c;this._d=d;this._e=e},createHeaderCells:function(){var $self=this;if(this._b.positionResolver().hasUnregisterdPositions()){this._b.positionResolver().completeRegisterPositions()}var a=this._b.positionResolver().rootPositionInfo();var b=new $$t.bo($$t.$be.$type.specialize($$t.$fa.$type),0);for(var c=0;c<a.positionSize();c++){b.add(new $$t.bo($$t.$fa.$type,0))}$$t.$fb.createHeaderCells2(a,a.positionItemDepthMin(),b,this._d,this._e);var d=new $$t.c4($$t.$e8.$type);var e=0;for(var f=0;f<a.positionSize();f++){var g=b.item(f);var h=0;var i=0;var k=g.getEnumerator();while(k.moveNext()){var j=k.current();var l;var m;var n;var o;if(this._c==0){l=h;m=j._c.d();n=e;o=1}else{n=h;o=j._c.d();l=e;m=1}var p=this._b.tuples().__inner[j._b.positionIndex()];var q=p.item(j._b.positionItemIndex());var r=this._b.tuples().__inner[j._l];if(this._a.positionResolver().hasUnregisterdPositions()){this._a.positionResolver().completeRegisterPositions()}var s=this._a.positionResolver().getPositionIndex(r);var t=function(){var $ret=new $$t.e8;$ret.axisName($self._b.name());$ret.hierarchyNumber(j._b.positionItemIndex());$ret.levelNumber(j._b.positionItemDepth());$ret.caption(q.caption());$ret.columnIndex(l);$ret.columnSpan(m);$ret.isExpanded(j._g);$ret.isExpandable(j._f);$ret.tupleIndex(s);$ret.memberIndex(j._b.positionItemIndex());$ret.rowIndex(n);$ret.rowSpan(o);return $ret}();if(!j._h){h=h+j._c.d()}d.add(t)}e+=i+1}return d},createHeaderCells2:function(a,b,c,d,e){var f=new $$t.e5(a.positionSize());var h=$$t.$cn.u($$t.$b8.$type.specialize(String,$.ig.$op.$type),a.values(),function(i){return i.positionItemDepth()==b}).getEnumerator();while(h.moveNext()){var g=h.current();var i;var j;var k=$$t.$fb.createHeaderCells1(a,g,c,f,d,e,i,j);i=k.p6;j=k.p7}},h:function(a,b,c,d,e,f){var g=$$t.$cn.z($$t.$b8.$type.specialize(String,$.ig.$op.$type),$$t.$cn.u($$t.$b8.$type.specialize(String,$.ig.$op.$type),a.values(),function(h){return h.positionItemDepth()==a.positionItemDepthMin()}));if(g.count()>0){var i=g.getEnumerator();while(i.moveNext()){var h=i.current();var j;var k;var l=$$t.$fb.createHeaderCells1(a,h,b,c,d,f,j,k);j=l.p6;k=l.p7;e._c.d(e._c.d()+k);if(j._e!=null){e._c.d(e._c.d()+1)}}e._c.d(e._c.d()-1)}else{f.add(a.positionIndex())}e._l=a.positionIndex()},createHeaderCells1:function(a,b,c,d,e,f,g,h){var i=c.item(b.positionItemIndex());var j=d.b(b.positionItemIndex(),b.positionItemDepth());var k=function(){var $ret=new $$t.fa;$ret._d=j;$ret._b=b;$ret._f=b.isExpandable();return $ret}();g=k;if(e){i.add(k);$$t.$fb.h(b,c,d,true,k,f)}var l=null;if(b.isExpanded()){l=$$t.$cn.z($$t.$b8.$type.specialize(String,$.ig.$op.$type),$$t.$cn.u($$t.$b8.$type.specialize(String,$.ig.$op.$type),a.values(),function(m){return m.parentKey()==b.key()}))}if(l!=null&&l.count()>0){var m=function(){var $ret=new $$t.fa;$ret._h=true;$ret._b=b;$ret._f=b.isExpandable();return $ret}();var o=l.getEnumerator();while(o.moveNext()){var n=o.current();var p;var q;var r=$$t.$fb.createHeaderCells1(a,n,c,d,e,f,p,q);p=r.p6;q=r.p7;m._c.d(m._c.d()+q);if(p._e!=null){m._c.d(m._c.d()+1)}}m._c.d(m._c.d()-1);k._g=true;k._f=true;k._e=m;if(!e){i.add(k);$$t.$fb.h(b,c,d,false,k,f)}m._l=k._l;h=k._c.d()+m._c.d()-1}else{if(b.isExpanded()){k._f=false}if(!e){i.add(k);$$t.$fb.h(b,c,d,false,k,f)}h=k._c.d()}return{p6:g,p7:h}},$type:new $.ig.Type("TableSuperCompactViewHeadersFactory",$.ig.$ot,[$$t.$e7.$type])},true);$c("TableViewHeaderCellSource:fa","Object",{init:function(){$.ig.$op.init.call(this);this._c=new $$t.e6;this._d=new $$t.e6},_h:false,_k:0,_i:0,_d:null,_c:null,_e:null,_b:null,_a:null,_l:0,_j:0,_g:false,_f:false,toString:function(){return $y("{0}-{1}",this._b.positionIndex(),this._b.positionItemIndex())},$type:new $.ig.Type("TableViewHeaderCellSource",$.ig.$ot)},true);$c("TreeStackAttributesBehavior:fc","Object",{init:function(){$.ig.$op.init.call(this)},a:function(a,b){},$type:new $.ig.Type("TreeStackAttributesBehavior",$.ig.$ot)},true);$c("TreeStackChildrenFirstBehavior:fe","TreeStackAttributesBehavior",{init:function(){$$t.$fc.init.call(this)},a:function(a,b){if(a.memberIndex()<b.memberIndex()||a.memberIndex()==b.memberIndex()&&a.levelNumber()<=b.levelNumber()){return true}return false},$type:new $.ig.Type("TreeStackChildrenFirstBehavior",$$t.$fc.$type)},true);$c("TreeStackNextDimensionFirstBehavior:ff","TreeStackAttributesBehavior",{init:function(a,b){$$t.$fc.init.call(this);this._b=a;this._c=b},_b:0,_c:0,a:function(a,b){if(a.memberIndex()<b.memberIndex()){return true}if(a.memberIndex()==b.memberIndex()){if(a.levelNumber()<=b.levelNumber()){return true}}if(a.memberIndex()>b.memberIndex()&&a.parentMemberLevelNumber()<b.levelNumber()){return true}return false},$type:new $.ig.Type("TreeStackNextDimensionFirstBehavior",$$t.$fc.$type)},true);$c("TableViewTreeHeadersFactory:fg","Object",{_b:null,_a:null,_c:0,_d:false,_e:null,_childrenAttributesIndentation:0,childrenAttributesIndentation:function(a){if(arguments.length===1){this._childrenAttributesIndentation=a;return a}else{return this._childrenAttributesIndentation}},_dimensionAttributesIndentation:0,dimensionAttributesIndentation:function(a){if(arguments.length===1){this._dimensionAttributesIndentation=a;return a}else{return this._dimensionAttributesIndentation}},init:function(a,b,c,d,e,f){$.ig.$op.init.call(this);this._b=a;this._a=b;this._c=c;this._d=true;this._e=d;this.childrenAttributesIndentation(e);this.dimensionAttributesIndentation(f)},createHeaderCells:function(){var $self=this;if(this._b.positionResolver().hasUnregisterdPositions()){this._b.positionResolver().completeRegisterPositions()}var a=this._b.positionResolver().rootPositionInfo();var b=new $$t.bo($$t.$fa.$type,0);$$t.$fg.createHeaderCells2(a,a.positionItemDepthMin(),b,this._e);var c=new $$t.b9(String,$$t.$e8.$type,0);var d=new $$t.fh($$t.$fd.$type);var e=new $$t.c4($$t.$e8.$type);var f=0;var h=b.getEnumerator();while(h.moveNext()){var g=h.current();if(g._h){continue}var i=this._b.tuples().__inner[g._b.positionIndex()];var j=i.item(g._b.positionItemIndex());var k=this._b.tuples().__inner[g._l];if(this._a.positionResolver().hasUnregisterdPositions()){this._a.positionResolver().completeRegisterPositions()}var l=this._a.positionResolver().getPositionIndex(k);var m=function(){var $ret=new $$t.fd;$ret.axisName($self._b.name());$ret.hierarchyNumber(g._b.positionItemIndex());$ret.levelNumber(g._b.positionItemDepth());$ret.parentMemberLevelNumber(g._a.positionItemDepth());$ret.caption(j.caption());$ret.columnIndex(0);$ret.columnSpan(1);$ret.isExpanded(g._g);$ret.isExpandable(g._f);$ret.tupleIndex(l);$ret.memberIndex(g._b.positionItemIndex());$ret.rowIndex(f);$ret.rowSpan(1);return $ret}();c.add($y("{0}-{1}",m.tupleIndex(),m.memberIndex()),m);var n=g._b.positionItemIndex()>0&&g._b.positionItemDepth()==0;if(!g._h&&!n){f=f+1}if(!n){e.add(m);this.m(d,m,new $$t.ff(this.childrenAttributesIndentation(),this.dimensionAttributesIndentation()))}}var p=e.getEnumerator();while(p.moveNext()){var o=p.current();if(o.memberIndex()<this._b.tupleSize()){var q=$y("{0}-{1}",o.tupleIndex(),o.memberIndex()+1);var r=null;if(function(){var s=c.tryGetValue(q,r);r=s.p1;return s.ret}()){o.isItemExpanded(r.isExpanded());o.isItemExpandable(r.isExpandable())}}}return e},m:function(a,b,c){var d=null;if(a.count()==0){this.l(a,b,null);return}d=a.peek();if(c.a(b,d)){this.h(a,b,c);d=null;if(a.count()>0){d=a.peek()}}this.l(a,b,d)},l:function(a,b,c){if(c!=null){if(b.memberIndex()>c.memberIndex()){b.indent(c.indent()+this.dimensionAttributesIndentation())}else{b.indent(c.indent()+this.childrenAttributesIndentation())}}a.push(b)},h:function(a,b,c){a.pop();if(a.count()>0){var d=a.peek();if(c.a(b,d)){this.h(a,b,c)}}},createHeaderCells2:function(a,b,c,d){var e=new $$t.e5(a.positionSize());var g=$$t.$cn.u($$t.$b8.$type.specialize(String,$.ig.$op.$type),a.values(),function(h){return h.positionItemDepth()==b}).getEnumerator();while(g.moveNext()){var f=g.current();var h;var i;var j=$$t.$fg.createHeaderCells1(a,f,c,e,d,true,h,i);h=j.p6;i=j.p7}},k:function(a,b,c,d,e,f){var g=$$t.$cn.z($$t.$b8.$type.specialize(String,$.ig.$op.$type),$$t.$cn.u($$t.$b8.$type.specialize(String,$.ig.$op.$type),a.values(),function(h){return h.positionItemDepth()==a.positionItemDepthMin()}));if(g.count()>0){var i=g.getEnumerator();while(i.moveNext()){var h=i.current();var j;var k;var l=$$t.$fg.createHeaderCells1(a,h,b,c,e,f,j,k);j=l.p6;k=l.p7;d._c.d(d._c.d()+k);if(j._h){d._c.d(d._c.d()+1)}}d._c.d(d._c.d()-1)}d._l=a.positionIndex()},createHeaderCells1:function(a,b,c,d,e,f,g,h){var i=c;var j=d.b(b.positionItemIndex(),b.positionItemDepth());var k=function(){var $ret=new $$t.fa;$ret._d=j;$ret._b=b;$ret._a=a;$ret._f=b.isExpandable();return $ret}();g=k;i.add(k);if(f){f=false;e.add(b.positionIndex())}var l=null;if(b.isExpanded()){l=$$t.$cn.z($$t.$b8.$type.specialize(String,$.ig.$op.$type),$$t.$cn.u($$t.$b8.$type.specialize(String,$.ig.$op.$type),a.values(),function(m){return m.parentKey()==b.key()}))}if(l!=null&&l.count()>0){var m=function(){var $ret=new $$t.fa;$ret._h=true;$ret._b=b;$ret._a=a;$ret._f=b.isExpandable();return $ret}();i.add(m);var o=l.getEnumerator();while(o.moveNext()){var n=o.current();var p;var q;var r=$$t.$fg.createHeaderCells1(a,n,c,d,e,true,p,q);p=r.p6;q=r.p7;m._c.d(m._c.d()+q);if(p._h){m._c.d(m._c.d()+1)}}m._c.d(m._c.d()-1);k._g=true;m._g=true;k._e=m;m._l=k._l;g=m;h=k._c.d()+m._c.d()-1}else{h=k._c.d()}$$t.$fg.k(b,c,d,k,e,false);return{p6:g,p7:h}},$type:new $.ig.Type("TableViewTreeHeadersFactory",$.ig.$ot,[$$t.$e7.$type])},true);$c("TableViewImpl:fj","Object",{init:function(a,b,c,d){var $self=this;this.w=40;this.x=20;$.ig.$op.init.call(this);if(a==null){throw new $$t.cr(0,"result")}this.result(a);this.originalResult(a);if(d==null){this.viewSettings(new $$t.fk)}else{this.viewSettings(d)}this.hasColumns(b);this.hasRows(c);this.columnSortDirections(new $$t.c4($$t.$e1.$type));var e=this.columnSortDirections();e.collectionChanged=$.ig.Delegate.prototype.combine(e.collectionChanged,function(e,f){$self._i=true});this.levelSortDirections(new $$t.c4($$t.$ez.$type));var f=this.levelSortDirections();f.collectionChanged=$.ig.Delegate.prototype.combine(f.collectionChanged,function(f,g){$self._i=true});this.appliedColumnSortDirections(new $$t.bo($$t.$e1.$type,0));this.appliedLevelSortDirections(new $$t.bo($$t.$ez.$type,0));this.appliedSortDirectionsMap(new $$t.b9(String,$$t.$ca.$type.specialize($$t.$l.$type,$$t.$ca.$type.specialize($$t.$l.$type,$$t.$cx.$type)),0))},_viewSettings:null,viewSettings:function(a){if(arguments.length===1){this._viewSettings=a;return a}else{return this._viewSettings}},_result:null,result:function(a){if(arguments.length===1){this._result=a;return a}else{return this._result}},_originalResult:null,originalResult:function(a){if(arguments.length===1){this._originalResult=a;return a}else{return this._originalResult}},_hasRows:false,hasRows:function(a){if(arguments.length===1){this._hasRows=a;return a}else{return this._hasRows}},_hasColumns:false,hasColumns:function(a){if(arguments.length===1){this._hasColumns=a;return a}else{return this._hasColumns}},_d:null,_c:null,_h:false,_i:false,m:null,k:null,l:null,rowHeaders:function(a){if(arguments.length===1){this.m=a;return a}else{if(!this._h||this._i){this.initialize()}return this.m}},columnHeaders:function(a){if(arguments.length===1){this.k=a;return a}else{if(!this._h||this._i){this.initialize()}return this.k}},resultCells:function(a){if(arguments.length===1){this.l=a;return a}else{if(!this._h||this._i){this.initialize()}return this.l}},_columnSortDirections:null,columnSortDirections:function(a){if(arguments.length===1){this._columnSortDirections=a;return a}else{return this._columnSortDirections}},_levelSortDirections:null,levelSortDirections:function(a){if(arguments.length===1){this._levelSortDirections=a;return a}else{return this._levelSortDirections}},_appliedColumnSortDirections:null,appliedColumnSortDirections:function(a){if(arguments.length===1){this._appliedColumnSortDirections=a;return a}else{return this._appliedColumnSortDirections}},_appliedLevelSortDirections:null,appliedLevelSortDirections:function(a){if(arguments.length===1){this._appliedLevelSortDirections=a;return a}else{return this._appliedLevelSortDirections}},_appliedSortDirectionsMap:null,appliedSortDirectionsMap:function(a){if(arguments.length===1){this._appliedSortDirectionsMap=a;return a}else{return this._appliedSortDirectionsMap}},initialize:function(){this._d=null;this._c=null;this.rowHeaders(null);this.columnHeaders(null);this.resultCells(null);this.result(this.originalResult());if(this.result().isEmpty()){this._i=false;this._h=true;return}if(this.levelSortDirections().count()>0){var a=new $$t.fn(this.result(),this.hasRows(),this.hasColumns(),this.levelSortDirections());this.result(a.b());this.appliedLevelSortDirections(a._h);this.appliedSortDirectionsMap(a._g)}else{this.appliedLevelSortDirections(new $$t.bo($$t.$ez.$type,0));this.appliedSortDirectionsMap(new $$t.b9(String,$$t.$ca.$type.specialize($$t.$l.$type,$$t.$ca.$type.specialize($$t.$l.$type,$$t.$cx.$type)),0))}if(this.hasRows()&&this.columnSortDirections().count()>0){if(this.appliedLevelSortDirections().count()>0){if(this.originalResult().axes().item(0).positionResolver().hasUnregisterdPositions()){this.originalResult().axes().item(0).positionResolver().completeRegisterPositions()}if(this.result().axes().item(0).positionResolver().hasUnregisterdPositions()){this.result().axes().item(0).positionResolver().completeRegisterPositions()}var b=new $$t.bo($$t.$e1.$type,2,this.columnSortDirections().count());var c=new $$t.b9($$t.$l.$type,$$t.$l.$type,1,this.appliedColumnSortDirections().count());var e=this.columnSortDirections().getEnumerator();while(e.moveNext()){var d=e.current();var f=this.originalResult().axes().item(0).tuples().__inner[d.tupleIndex()];var g=this.result().axes().item(0).positionResolver().getPositionIndex(f);var h=new $$t.e1;h.sortDirection(d.sortDirection());h.tupleIndex(g);h.comparer(d.comparer());b.add(h);c.item(g,d.tupleIndex())}var i=new $$t.fr(this.result(),this.hasRows(),this.hasColumns(),b);this.result(i.b());var k=i._g.getEnumerator();while(k.moveNext()){var j=k.current();j.tupleIndex(c.item(j.tupleIndex()))}this.appliedColumnSortDirections(i._g)}else{var l=new $$t.fr(this.result(),this.hasRows(),this.hasColumns(),this.columnSortDirections());this.result(l.b());this.appliedColumnSortDirections(l._g)}}else{this.appliedColumnSortDirections(new $$t.bo($$t.$e1.$type,0))}var m=0;var n=new $$t.b9($$t.$l.$type,$$t.$l.$type,0);var o=1;if(this.hasColumns()){var p=this.result().axes().item(m);var q=this.originalResult().axes().item(m);var r=this.r(p,q);for(var s=0;s<r.count();s++){var t=r.item(s);n.add(t,s)}m++;o=p.tuples().count()}var u=new $$t.b9($$t.$l.$type,$$t.$l.$type,0);if(this.hasRows()){var v=this.result().axes().item(m);var w=this.originalResult().axes().item(m);var x=this.s(v,w);for(var y=0;y<x.count();y++){var z=x.item(y);u.add(z,y)}}var aa=new $$t.c4($$t.$fm.$type);for(var ab=0;ab<this.result().cells().count();ab++){var ac=this.result().cells().item(ab);var ad;var ae=ac.properties().tryGetValue("Value",ad);ad=ae.p1;var af;var ag=ac.properties().tryGetValue("FmtValue",af);af=ag.p1;var ah=ac.cellOrdinal();if(this.hasColumns()){var ai=ah%o;var aj=n.item(ai);if(ai!=aj){var ak=$a(ah,o);ah=ak*o+aj}}if(this.hasRows()){var al=$a(ah,o);var am=u.item(al);if(al!=am){var an=ah%o;ah=am*o+an}}aa.add(function(){var $ret=new $$t.fm;$ret.value(ad);$ret.formattedValue(af);$ret.cellOrdinal(ah);$ret.resultCellIndex(ab);return $ret}());this.resultCells(aa)}this._i=false;this._h=true},r:function(a,b){var c=new $$t.bo($$t.$l.$type,0);if(this.viewSettings()._b){this._c=new $$t.fb(a,b,0,this.viewSettings()._c,c)}else{this._c=new $$t.e9(a,b,0,this.viewSettings()._c,c)}this.columnHeaders(this._c.createHeaderCells());return c},w:0,x:0,s:function(a,b){var c=new $$t.bo($$t.$l.$type,0);var d=this.viewSettings()._a;var e=this.viewSettings()._d;switch(d){case 0:this._d=new $$t.e9(a,b,1,e,c);break;case 1:this._d=new $$t.fb(a,b,1,e,c);break;case 2:var f=this.w;var g=this.x;var h=$b($$t.$ft.$type,this.viewSettings());if(h!=null){f=h._e;g=h._f}this._d=new $$t.fg(a,b,1,c,f,g);break}this.rowHeaders(this._d.createHeaderCells());return c},$type:new $.ig.Type("TableViewImpl",$.ig.$ot)},true);$c("OlapResultView:ei","Object",{init:function(a,b,c,d){$.ig.$op.init.call(this);if(a==null){throw new $$t.cr(0,"result")}this.result(a);this.visibleResult(b);this.hasColumns(c);this.hasRows(d)},_result:null,result:function(a){if(arguments.length===1){this._result=a;return a}else{return this._result}},_visibleResult:null,visibleResult:function(a){if(arguments.length===1){this._visibleResult=a;return a}else{return this._visibleResult}},_hasRows:false,hasRows:function(a){if(arguments.length===1){this._hasRows=a;return a}else{return this._hasRows}},_hasColumns:false,hasColumns:function(a){if(arguments.length===1){this._hasColumns=a;return a}else{return this._hasColumns}},c:function(a,b,c,d,e){var f=0;var g=null;var h=1;if(e){g=a.axes().item(f);h=g.tuples().count();f++}var i=null;var j=1;if(d){i=a.axes().item(f);j=i.tuples().count()}var k=1;if(b!=null){k=b.tuples().count()}var l=1;if(c!=null){l=c.tuples().count()}var m=new Array(k*l);if(a.cells().count()>0){var n=0;var o=a.cells().item(n);for(var p=0;p<j;p++){var q=$a(o.cellOrdinal(),h);if(q!=p){continue}var r=0;if(b!=null&&i!=null){var s=i.tuples().__inner[p];r=b.positionResolver().getPositionIndex(s)}if(r==-1){while(q==p){n++;if(n<a.cells().count()){o=a.cells().item(n);q=$a(o.cellOrdinal(),h)}else{break}}continue}var t=o.cellOrdinal()%h;for(var u=0;u<h;u++){if(t!=u){continue}var v=-1;if(c==null||g==null){v=0}else{var w=g.tuples().__inner[u];v=c.positionResolver().getPositionIndex(w)}if(v==-1){n++;if(n<a.cells().count()){o=a.cells().item(n);q=$a(o.cellOrdinal(),h);if(q>p){break}t=o.cellOrdinal()%h}continue}var x=o.clone();x.cellOrdinal(r*l+v);m[x.cellOrdinal()]=x;n++;if(n<a.cells().count()){o=a.cells().item(n);q=$a(o.cellOrdinal(),h);if(q>p){break}t=o.cellOrdinal()%h}}}}var y=new $$t.bo($$t.$c3.$type,0);for(var aa=0;aa<m.length;aa++){var z=m[aa];if(z!=null){y.add(z)}}var ab=new $$t.bo($$t.$bm.$type,0);if(e){ab.add(c)}if(d){ab.add(b)}return function(){var $ret=new $$t.bl;$ret.axes(ab);$ret.cells(y);$ret.isEmpty(!d&&!e&&y.count()==0);return $ret}()},a:function(a,b,c){var d=new $$t.bo($$t.$cz.$type,0);if(c){for(var e=0;e<b.count();e++){var f=b.item(e);d.add(a.tuples().__inner[f].clone())}}else{var g=0;var h=b.item(g);for(var i=0;i<a.tuples().count();i++){if(i==h){g++;if(g<b.count()){h=b.item(g)}}else{d.add(a.tuples().__inner[i].clone())}}}var j=function(){var $ret=new $$t.bm(d,a.tupleSize());$ret.name(a.name());return $ret}();return j},expandTupleMember:function(a,b,c){var d=this.f(a,b,c,this.visibleResult());if(d==null){return null}if(!d.isExpandable()){throw new $$t.ch(1,"The position is not expandable.")}if(d.isExpanded()){return this}var e=$$t.$cn.ad($$t.$bm.$type,$$t.$cn.u($$t.$bm.$type,this.visibleResult().axes(),function(f){return f.name()==a}));var f=$$t.$cn.ad($$t.$bm.$type,$$t.$cn.u($$t.$bm.$type,this.result().axes(),function(g){return g.name()==a}));var g=a=="Axis0"&&!this.hasColumns()||a=="Axis1"&&this.hasRows();var h=e.tuples().__inner[b];var i=f.positionResolver().getPositionIndex(h);var j=this.l(a,i,c,this.result());if(j.count()==0){return null}var k=null;var l=null;if(g){k=this.a(f,j,true);if(this.hasColumns()){l=this.visibleResult().axes().item(0)}}else{l=this.a(f,j,true);if(this.hasRows()){k=this.visibleResult().axes().item(1)}}var m=this.c(this.result(),k,l,this.hasRows(),this.hasColumns());var n=this.b(this.visibleResult(),m,f.name());return new $$t.ei(this.result(),n,this.hasColumns(),this.hasRows())},collapseTupleMember:function(a,b,c){var d=this.f(a,b,c,this.visibleResult());if(d==null){return null}if(!d.isExpandable()){throw new $$t.ch(1,"The position is not expandable.");
}if(!d.isExpanded()){return this}var e=this.l(a,b,c,this.visibleResult());if(e.count()==0){return null}var f=$$t.$cn.ad($$t.$bm.$type,$$t.$cn.u($$t.$bm.$type,this.visibleResult().axes(),function(g){return g.name()==a}));var g=a=="Axis0"&&!this.hasColumns()||a=="Axis1"&&this.hasRows();var h=null;var i=null;if(g){h=this.a(f,e,false);if(this.hasColumns()){i=this.visibleResult().axes().item(0)}}else{i=this.a(f,e,false);if(this.hasRows()){h=this.visibleResult().axes().item(1)}}var j=$$t.$cn.ad($$t.$bm.$type,$$t.$cn.u($$t.$bm.$type,this.result().axes(),function(k){return k.name()==a}));var k=j.tuples().__inner[b];var l=function(){var $ret=new $$t.ej;$ret._c=a;$ret._a=c;$ret._b=b;return $ret}();$$t.$ek.f(l,false,j.positionResolver(),this.visibleResult());var m=this.c(this.visibleResult(),h,i,this.hasRows(),this.hasColumns());return new $$t.ei(this.result(),m,this.hasColumns(),this.hasRows())},extend:function(a,b){var c=$$t.$cn.ad($$t.$bm.$type,$$t.$cn.u($$t.$bm.$type,this.visibleResult().axes(),function(d){return d.name()==b}));var d=b=="Axis0"&&!this.hasColumns()||b=="Axis1"&&this.hasRows();var e=null;var f=null;var g=null;var h=false;if(d){e=c;if(this.hasColumns()){f=$$t.$cn.ad($$t.$bm.$type,$$t.$cn.u($$t.$bm.$type,this.visibleResult().axes(),function(i){return i.name()!=b}));g=$$t.$cn.ad($$t.$bm.$type,$$t.$cn.u($$t.$bm.$type,this.result().axes(),function(i){return i.name()!=b}));h=f.tuples().count()!=g.tuples().count()}}else{f=c;if(this.hasRows()){e=$$t.$cn.ad($$t.$bm.$type,$$t.$cn.u($$t.$bm.$type,this.visibleResult().axes(),function(i){return i.name()!=b}));g=$$t.$cn.ad($$t.$bm.$type,$$t.$cn.u($$t.$bm.$type,this.result().axes(),function(i){return i.name()!=b}));h=e.tuples().count()!=g.tuples().count()}}var i=null;var j=null;if(g!=null&&h){var k=this.c(this.result(),e,f,this.hasRows(),this.hasColumns());i=this.b(k,a,b);j=this.b(k,a,b)}else{i=this.b(this.result(),a,b);j=this.b(this.visibleResult(),a,b)}return new $$t.ei(i,j,this.hasColumns(),this.hasRows())},b:function(a,b,c){var d=$$t.$cn.ad($$t.$bm.$type,$$t.$cn.u($$t.$bm.$type,a.axes(),function(e){return e.name()==c}));if(d==null){return null}var e=$$t.$cn.ad($$t.$bm.$type,$$t.$cn.u($$t.$bm.$type,b.axes(),function(f){return f.name()==c}));var f=c=="Axis0"&&!this.hasColumns()||c=="Axis1"&&this.hasRows();var g=null;var h=null;if(f){if(this.hasColumns()){g=$$t.$cn.ad($$t.$bm.$type,$$t.$cn.u($$t.$bm.$type,a.axes(),function(i){return i.name()!=c}));h=$$t.$cn.ad($$t.$bm.$type,$$t.$cn.u($$t.$bm.$type,b.axes(),function(i){return i.name()!=c}))}}else{if(this.hasRows()){g=$$t.$cn.ad($$t.$bm.$type,$$t.$cn.u($$t.$bm.$type,a.axes(),function(i){return i.name()!=c}));h=$$t.$cn.ad($$t.$bm.$type,$$t.$cn.u($$t.$bm.$type,b.axes(),function(i){return i.name()!=c}))}}var i=new $$t.bo($$t.$cz.$type,0);var k=d.tuples().getEnumerator();while(k.moveNext()){var j=k.current();i.add(j.clone())}var m=e.tuples().getEnumerator();while(m.moveNext()){var l=m.current();i.add(l)}var n=e.tuples().count();var o=h!=null&&h.tuples().count()>0?h.tuples().count():1;var p=d.tuples().count()>0?d.tuples().count():1;var q=g!=null&&g.tuples().count()>0?g.tuples().count():1;var r=p*q;var s=new $$t.bo($$t.$c3.$type,0);if(f){var u=a.cells().getEnumerator();while(u.moveNext()){var t=u.current();s.add(t.clone())}var v=new Array(n*q);var w=p*q;var y=b.cells().getEnumerator();while(y.moveNext()){var x=y.current();var z=x.clone();var aa=this.m(z.cellOrdinal(),g,h);var ab=$a(z.cellOrdinal(),o);z.cellOrdinal(ab*q+aa);z.cellOrdinal(z.cellOrdinal()+r);v[z.cellOrdinal()-w]=z}for(var ac=0;ac<v.length;ac++){var ad=v[ac];if(ad!=null){s.add(ad)}}}else{var ae=new Array(q*(p+n));var ag=a.cells().getEnumerator();while(ag.moveNext()){var af=ag.current();var ah=af.clone();var ai=$a(ah.cellOrdinal(),p);ah.cellOrdinal(ah.cellOrdinal()+ai*n);ae[ah.cellOrdinal()]=ah}var ak=b.cells().getEnumerator();while(ak.moveNext()){var aj=ak.current();var al=aj.clone();var am=this.n(al.cellOrdinal(),g,h,n);var an=$a(aj.cellOrdinal(),n);if(am!=an){}var ao=al.cellOrdinal()%n;al.cellOrdinal(am*n+ao);al.cellOrdinal(al.cellOrdinal()+(am+1)*p);ae[al.cellOrdinal()]=al}for(var aq=0;aq<ae.length;aq++){var ap=ae[aq];if(ap!=null){s.add(ap)}}}var ar=new $$t.bl;ar.axes(new $$t.bo($$t.$bm.$type,0));var as=function(){var $ret=new $$t.bm(i,d.tupleSize());$ret.name(d.name());return $ret}();if(f){if(g!=null){ar.axes().add(g)}ar.axes().add(as)}else{ar.axes().add(as);if(g!=null){ar.axes().add(g)}}ar.cells(s);ar.isEmpty(!this.hasColumns()&&!this.hasRows()&&s.count()==0);return ar},m:function(a,b,c){if(c==null){return 0}var d=a%c.tuples().count();var e=c.tuples().__inner[d];var f=b.positionResolver().getPositionIndex(e);return f},n:function(a,b,c,d){if(c==null){return 0}var e=$a(a,d);var f=c.tuples().__inner[e];var g=b.positionResolver().getPositionIndex(f);return g},l:function(a,b,c,d){var e=$$t.$cn.ad($$t.$bm.$type,$$t.$cn.u($$t.$bm.$type,d.axes(),function(f){return f.name()==a}));var f=e.tuples().__inner[b];var g=f.item(c);if(e.positionResolver().hasUnregisterdPositions()){e.positionResolver().completeRegisterPositions()}var h=e.positionResolver().i(g,0);if(h!=null){return $$t.$cn.z($$t.$l.$type,h)}return null},f:function(a,b,c,d){var e=$$t.$cn.ad($$t.$bm.$type,$$t.$cn.u($$t.$bm.$type,d.axes(),function(f){return f.name()==a}));var f=e.tuples().__inner[b];var g=f.item(c);if(e.positionResolver().hasUnregisterdPositions()){e.positionResolver().completeRegisterPositions()}var h=e.positionResolver().getHostPositionItemInfo(f,c);var i;var j=h.tryGetValue(g.key(),i);i=j.p1;return i},$type:new $.ig.Type("OlapResultView",$.ig.$ot)},true);$c("ResultViewHelper:ek","Object",{init:function(){$.ig.$op.init.call(this)},g:function(a,b,c){var d=$$t.$ek.a(a._c,c.visibleResult());var e=$$t.$ek.a(a._c,c.result());$$t.$ek.f(a,b,d.positionResolver(),c.visibleResult());$$t.$ek.f(a,b,e.positionResolver(),c.visibleResult())},f:function(a,b,c,d){if(c.hasUnregisterdPositions()){c.completeRegisterPositions()}var e=$$t.$ek.b(a._c,a._b,d);$$t.$ek.e(e,a._a,b,c)},h:function(a,b,c){var d=$$t.$cn.ad($$t.$bm.$type,$$t.$cn.u($$t.$bm.$type,b.visibleResult().axes(),function(e){return e.name()==a}));var e=$$t.$cn.ad($$t.$bm.$type,$$t.$cn.u($$t.$bm.$type,c.visibleResult().axes(),function(f){return f.name()==a}));$$t.$ek.d(d.positionResolver(),e.positionResolver());var f=$$t.$cn.ad($$t.$bm.$type,$$t.$cn.u($$t.$bm.$type,b.result().axes(),function(g){return g.name()==a}));var g=$$t.$cn.ad($$t.$bm.$type,$$t.$cn.u($$t.$bm.$type,c.result().axes(),function(h){return h.name()==a}));$$t.$ek.d(f.positionResolver(),g.positionResolver())},d:function(a,b){if(a.hasUnregisterdPositions()){a.completeRegisterPositions()}if(b.hasUnregisterdPositions()){b.completeRegisterPositions()}$$t.$ek.c(a.rootPositionInfo(),b.rootPositionInfo())},a:function(a,b){return $$t.$cn.ae($$t.$bm.$type,b.axes(),function(c){return c.name()==a})},c:function(a,b){var d=a.getEnumerator();while(d.moveNext()){var c=d.current();var e=c.value();var f;if(function(){var g=b.tryGetValue(c.key(),f);f=g.p1;return g.ret}()){if(e.isExpanded()!=true){f.isExpanded(false)}if(f.count()>0){$$t.$ek.c(e,f)}}}},e:function(a,b,c,d){var e=new $$t.el;var f=$$t.$cn.ae($$t.$b6.$type.specialize(String,$.ig.$op.$type),d.positions(),function(g){return e.equalsC(a,g)});var g=d.getHostPositionItemInfo(f,b);var h=g.item(f.item(b).key());h.isExpanded(c)},b:function(a,b,c){var d=$$t.$ek.a(a,c);if(d.positionResolver().hasUnregisterdPositions()){d.positionResolver().completeRegisterPositions()}var e=d.positionResolver().positions().__inner[b];return e},$type:new $.ig.Type("ResultViewHelper",$.ig.$ot)},true);$c("IPosition$2:b6","Object",{$type:new $.ig.Type("IPosition$2",null)},true);$c("IPostionComparer:el","Object",{init:function(){$.ig.$op.init.call(this)},equalsC:function(a,b){var c=$$t.$cn.z($$t.$b7.$type.specialize(String,$.ig.$op.$type),a.getItems());var d=$$t.$cn.z($$t.$b7.$type.specialize(String,$.ig.$op.$type),b.getItems());if(c.count()!=d.count()){return false}for(var e=0;e<c.count();e++){if(c.__inner[e].key()!=d.__inner[e].key()){return false}}return true},getHashCodeC:function(a){var b=$$t.$cn.z($$t.$b7.$type.specialize(String,$.ig.$op.$type),a.getItems());var c=17;var e=b.getEnumerator();while(e.moveNext()){var d=e.current();c^=b.getHashCode()}return c},$type:new $.ig.Type("IPostionComparer",$.ig.$ot,[$$t.$cd.$type.specialize($$t.$b6.$type.specialize(String,$.ig.$op.$type))])},true);$c("OlapTableViewHeaderCell:e8","Object",{init:function(){$.ig.$op.init.call(this);this.columnSpan(1);this.rowSpan(1)},_id:null,id:function(a){if(arguments.length===1){this._id=a;return a}else{return this._id}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_isExpanded:false,isExpanded:function(a){if(arguments.length===1){this._isExpanded=a;return a}else{return this._isExpanded}},_isExpandable:false,isExpandable:function(a){if(arguments.length===1){this._isExpandable=a;return a}else{return this._isExpandable}},_rowIndex:0,rowIndex:function(a){if(arguments.length===1){this._rowIndex=a;return a}else{return this._rowIndex}},_rowSpan:0,rowSpan:function(a){if(arguments.length===1){this._rowSpan=a;return a}else{return this._rowSpan}},_columnIndex:0,columnIndex:function(a){if(arguments.length===1){this._columnIndex=a;return a}else{return this._columnIndex}},_columnSpan:0,columnSpan:function(a){if(arguments.length===1){this._columnSpan=a;return a}else{return this._columnSpan}},_axisName:null,axisName:function(a){if(arguments.length===1){this._axisName=a;return a}else{return this._axisName}},_tupleIndex:0,tupleIndex:function(a){if(arguments.length===1){this._tupleIndex=a;return a}else{return this._tupleIndex}},_memberIndex:0,memberIndex:function(a){if(arguments.length===1){this._memberIndex=a;return a}else{return this._memberIndex}},_levelNumber:0,levelNumber:function(a){if(arguments.length===1){this._levelNumber=a;return a}else{return this._levelNumber}},_hierarchyNumber:0,hierarchyNumber:function(a){if(arguments.length===1){this._hierarchyNumber=a;return a}else{return this._hierarchyNumber}},_headerSpan:0,headerSpan:function(a){if(arguments.length===1){this._headerSpan=a;return a}else{return this._headerSpan}},_rowOrigin:0,rowOrigin:function(a){if(arguments.length===1){this._rowOrigin=a;return a}else{return this._rowOrigin}},toString:function(){return this.caption()},$type:new $.ig.Type("OlapTableViewHeaderCell",$.ig.$ot)},true);$c("OlapTableViewResultCell:fm","Object",{init:function(){$.ig.$op.init.call(this)},_value:null,value:function(a){if(arguments.length===1){this._value=a;return a}else{return this._value}},_formattedValue:null,formattedValue:function(a){if(arguments.length===1){this._formattedValue=a;return a}else{return this._formattedValue}},_cellOrdinal:0,cellOrdinal:function(a){if(arguments.length===1){this._cellOrdinal=a;return a}else{return this._cellOrdinal}},_resultCellIndex:0,resultCellIndex:function(a){if(arguments.length===1){this._resultCellIndex=a;return a}else{return this._resultCellIndex}},$type:new $.ig.Type("OlapTableViewResultCell",$.ig.$ot)},true);$c("TableViewSettings:fk","Object",{init:function(){$.ig.$op.init.call(this)},_c:false,_d:false,_a:0,_b:false,$type:new $.ig.Type("TableViewSettings",$.ig.$ot)},true);$c("OlapTableViewTreeHeaderCell:fd","OlapTableViewHeaderCell",{init:function(){$$t.$e8.init.call(this);this.parentMemberLevelNumber(-1)},_indent:0,indent:function(a){if(arguments.length===1){this._indent=a;return a}else{return this._indent}},_parentMemberLevelNumber:0,parentMemberLevelNumber:function(a){if(arguments.length===1){this._parentMemberLevelNumber=a;return a}else{return this._parentMemberLevelNumber}},_isItemExpanded:false,isItemExpanded:function(a){if(arguments.length===1){this._isItemExpanded=a;return a}else{return this._isItemExpanded}},_isItemExpandable:false,isItemExpandable:function(a){if(arguments.length===1){this._isItemExpandable=a;return a}else{return this._isItemExpandable}},$type:new $.ig.Type("OlapTableViewTreeHeaderCell",$$t.$e8.$type)},true);$c("TreeLayoutTableViewSettings:ft","TableViewSettings",{init:function(a,b){$$t.$fk.init.call(this);this._a=2;this._e=a;this._f=b},_e:0,_f:0,$type:new $.ig.Type("TreeLayoutTableViewSettings",$$t.$fk.$type)},true);$c("CubeMetaItemsCache:em","Object",{init:function(){this.p=new $$t.b9(String,$$t.$ep.$type.specialize($$t.$l.$type,$$t.$d4.$type),0);this.s=new $$t.b9($$t.$l.$type,$$t.$d4.$type,0);this.q=new $$t.b9(String,$$t.$be.$type.specialize($$t.$d4.$type),0);this.r=new $$t.b9(String,$$t.$be.$type.specialize($$t.$d4.$type),0);this.o=new $$t.b9(String,$$t.$bi.$type,0);this.l=new $$t.b9(String,$$t.$en.$type,0);this.n=new $$t.b9(String,$$t.$d.$type,0);this.m=new $$t.b9(String,$$t.$d.$type,0);$.ig.$op.init.call(this)},p:null,s:null,q:null,r:null,o:null,l:null,n:null,m:null,_z:null,_v:null,_t:null,_u:null,_x:null,_w:null,_y:null,_a:null,c:function(a){var $self=this;var b;if(!function(){var c=$self.n.tryGetValue(a,b);b=c.p1;return c.ret}()){return false}return b},ac:function(a){this.n.item(a,true)},b:function(a){var $self=this;var b;if(!function(){var c=$self.m.tryGetValue(a,b);b=c.p1;return c.ret}()){return false}return b},ab:function(a){this.m.item(a,true);var c=$$t.$cn.u($$t.$ee.$type,this._x,function(d){return d.hierarchyUniqueName()==a}).getEnumerator();while(c.moveNext()){var b=c.current();this.ac(b.uniqueName())}},d:function(a){return this.r.containsKey(a)},aa:function(a){var $self=this;var b;if(!function(){var c=$self.p.tryGetValue(a.uniqueName(),b);b=c.p1;return c.ret}()){var c=this.p.count();b=new $$t.ep($$t.$l.$type,$$t.$d4.$type,c,a);this.p.item(a.uniqueName(),b);this.s.item(c,a);var d;if(!function(){var e=$self.q.tryGetValue(a.levelUniqueName(),d);d=e.p1;return e.ret}()){d=new $$t.c4($$t.$d4.$type);this.q.item(a.levelUniqueName(),d)}if(!String.isNullOrEmpty(a.parentUniqueName())){var e;if(!function(){var f=$self.r.tryGetValue(a.parentUniqueName(),e);e=f.p1;return f.ret}()){e=new $$t.bo($$t.$d4.$type,0);this.r.item(a.parentUniqueName(),e)}e.add(a)}d.add(a)}return b._c},i:function(a,b){var $self=this;var c;if(function(){var d=$self.p.tryGetValue(a,c);c=d.p1;return d.ret}()){b=c._c;return{ret:true,p1:b}}b=-1;return{ret:false,p1:b}},h:function(a,b){var $self=this;var c;if(function(){var d=$self.p.tryGetValue(a,c);c=d.p1;return d.ret}()){b=c._d;return{ret:true,p1:b}}b=null;return{ret:false,p1:b}},g:function(a,b){var $self=this;return{ret:function(){var c=$self.s.tryGetValue(a,b);b=c.p1;return c.ret}(),p1:b}},k:function(a,b){var $self=this;return{ret:function(){var c=$self.r.tryGetValue(a,b);b=c.p1;return c.ret}(),p1:b}},j:function(a,b){var $self=this;return{ret:function(){var c=$self.q.tryGetValue(a,b);b=c.p1;return c.ret}(),p1:b}},f:function(a,b){var $self=this;if(!function(){var c=$self.o.tryGetValue(a,b);b=c.p1;return c.ret}()){b=$$t.$cn.af($$t.$bi.$type,$$t.$cn.u($$t.$bi.$type,this._z,function(c){return c.uniqueName()==a}));if(b==null){return{ret:false,p1:b}}this.o.add(a,b)}return{ret:true,p1:b}},e:function(a,b){var $self=this;if(!function(){var c=$self.l.tryGetValue(a,b);b=c.p1;return c.ret}()){b=$$t.$cn.af($$t.$en.$type,$$t.$cn.u($$t.$en.$type,this._v,function(c){return c.uniqueName()==a}));if(b==null){return{ret:false,p1:b}}this.l.add(a,b)}return{ret:true,p1:b}},$type:new $.ig.Type("CubeMetaItemsCache",$.ig.$ot)},true);$c("MetaTreeHelper:ev","Object",{init:function(){$.ig.$op.init.call(this)},getDimensionMetaItems:function(a,b,c,d,e,f,g,h){var i=new $$t.bo($$t.$bb.$type,0);var j=new $$t.ew;j._a=0;j._b=0;var k=new $$t.bo($$t.$bg.$type,0);var m=d.getEnumerator();while(m.moveNext()){var l=m.current();k.add(l)}var n=new $$t.bo($$t.$ee.$type,0);var p=e.getEnumerator();while(p.moveNext()){var o=p.current();n.add(o)}var r=a.getEnumerator();while(r.moveNext()){var q=r.current();var s=$$t.$ev.e(k,n,q,j);if(q.dimensionType()!=2){var t=function(){var $ret=new $$t.bb;$ret.type(1);$ret.caption(q.caption());$ret.item(q);return $ret}();$$t.$ev.setMetaItemChildren(t,s);i.add(t)}else{var u=$$t.$ev.c(b,q,h);i.insert(0,u);if($$t.$cn.aj($$t.$eh.$type,c)>0){var v=function(){var $ret=new $$t.ex;$ret.caption("Kpis");return $ret}();var w=$$t.$ev.b(c,v,g);w.type(12);i.insert(1,w)}}}return i},setMetaItemChildren:function(a,b){if(b.count()>0){var c=$$t.$cn.a($$t.$bb.$type,$$t.$cn.x($$t.$bb.$type,String,$$t.$cn.u($$t.$bb.$type,b,function(d){return d.type()==2}),function(d){return d.caption()}));var d=$$t.$cn.a($$t.$bb.$type,$$t.$cn.u($$t.$bb.$type,b,function(e){return e.type()!=2}));var e=new Array(c.length+d.length);for(var f=0;f<c.length;f++){e[f]=c[f]}for(var g=0;g<d.length;g++){e[c.length+g]=d[g]}a.children(e)}},e:function(a,b,c,d){var e=new $$t.b9(String,$$t.$ep.$type.specialize($$t.$bb.$type,$$t.$be.$type.specialize($$t.$bb.$type)),0);var f=new $$t.bo($$t.$bb.$type,0);var g=a.item(d._a);while(g.dimensionUniqueName()!=c.uniqueName()){d._a=d._a+1;g=a.item(d._a)}while(g.dimensionUniqueName()==c.uniqueName()){var h=null;if(!String.isNullOrEmpty(g.hierarchyDisplayFolder())){var i=String.empty();var j=$$t.$ev.a(g.hierarchyDisplayFolder());for(var k=0;k<j.length;k++){var l=j[k];i+=l+"\\";var m;if(!function(){var n=e.tryGetValue(i,m);m=n.p1;return n.ret}()){var n=function(){var $ret=new $$t.bb;$ret.type(2);$ret.caption(l);return $ret}();m=new $$t.ep($$t.$bb.$type,$$t.$be.$type.specialize($$t.$bb.$type),n,new $$t.bo($$t.$bb.$type,0));e.add(i,m);if(h!=null){h._d.add(n)}else{f.add(n)}}h=m}}var o;switch(g.hierarchyOrigin()){case 2:o=4;break;case 1:o=3;break;default:o=5;break}var p=$$t.$ev.f(b,g,d);var q=function(){var $ret=new $$t.bb;$ret.type(o);$ret.caption(g.caption());$ret.item(g);return $ret}();$$t.$ev.setMetaItemChildren(q,p);if(h!=null){h._d.add(q)}else{f.add(q)}if(d._a+1>=a.count()){break}d._a=d._a+1;g=a.item(d._a)}var s=e.values().getEnumerator();while(s.moveNext()){var r=s.current();var t=r._c;$$t.$ev.setMetaItemChildren(t,r._d)}return f},f:function(a,b,c){var d=new $$t.bo($$t.$bb.$type,0);if(a==null||a.count()==0){return d}var e=a.item(c._b);while(e.hierarchyUniqueName()!=b.uniqueName()){c._b=c._b+1;e=a.item(c._b)}while(e.hierarchyUniqueName()==b.uniqueName()){var f;switch(e.depth()){case 0:case 1:f=7;break;case 2:f=8;break;case 3:f=9;break;case 4:f=10;break;default:f=11;break}var g=function(){var $ret=new $$t.bb;$ret.type(f);$ret.caption(e.caption());$ret.item(e);return $ret}();d.add(g);if(c._b+1>=a.count()){break}c._b=c._b+1;e=a.item(c._b)}return d},c:function(a,b,c){var d=new $$t.b9(String,$$t.$ep.$type.specialize($$t.$bb.$type,$$t.$be.$type.specialize($$t.$bb.$type)),0);var e=function(){var $ret=new $$t.bb;$ret.type(6);$ret.caption(b.caption());$ret.item(b);return $ret}();var f=new $$t.ep($$t.$bb.$type,$$t.$be.$type.specialize($$t.$bb.$type),e,new $$t.bo($$t.$bb.$type,0));var h=a.getEnumerator();while(h.moveNext()){var g=h.current();if($b($$t.$en.$type,g)!==null){continue}var i=f;if(!String.isNullOrEmpty(g.measureGroupName())){if(!function(){var j=d.tryGetValue(g.measureGroupName(),i);i=j.p1;return j.ret}()){var j=$$t.$cn.ad($$t.$d7.$type,$$t.$cn.u($$t.$d7.$type,c,function(k){return k.name()==g.measureGroupName()}));var k=function(){var $ret=new $$t.bb;$ret.type(2);$ret.caption(j.caption());return $ret}();i=new $$t.ep($$t.$bb.$type,$$t.$be.$type.specialize($$t.$bb.$type),k,new $$t.bo($$t.$bb.$type,0));d.add(g.measureGroupName(),i);f._d.add(i._c)}}var l=i;if(!String.isNullOrEmpty(g.measureDisplayFolder())){var m=g.measureGroupName();var n=$$t.$ev.a(g.measureDisplayFolder());for(var o=0;o<n.length;o++){var p=n[o];m+="\\"+p;var q;if(!function(){var r=d.tryGetValue(m,q);q=r.p1;return r.ret}()){var r=function(){var $ret=new $$t.bb;$ret.type(2);$ret.caption(p);return $ret}();q=new $$t.ep($$t.$bb.$type,$$t.$be.$type.specialize($$t.$bb.$type),r,new $$t.bo($$t.$bb.$type,0));d.add(m,q);l._d.add(r)}l=q}}var s=function(){var $ret=new $$t.bb;$ret.type(6);$ret.caption(g.caption());$ret.item(g);return $ret}();l._d.add(s)}var t=new $$t.bo($$t.$bb.$type,0);var v=$$t.$cn.x($$t.$bb.$type,String,$$t.$cn.u($$t.$bb.$type,f._d,function(w){return w.type()==2}),function(w){return w.caption()}).getEnumerator();while(v.moveNext()){var u=v.current();t.add(u)}var x=$$t.$cn.x($$t.$bb.$type,String,$$t.$cn.u($$t.$bb.$type,f._d,function(y){return y.type()!=2}),function(y){return y.caption()}).getEnumerator();while(x.moveNext()){var w=x.current();t.add(w)}$$t.$ev.setMetaItemChildren(e,t);var z=d.values().getEnumerator();while(z.moveNext()){var y=z.current();var aa=y._d;var ab=$$t.$cn.z($$t.$bb.$type,$$t.$cn.x($$t.$bb.$type,String,$$t.$cn.u($$t.$bb.$type,aa,function(ac){return ac.type()==2}),function(ac){return ac.caption()}));var ac=$$t.$cn.z($$t.$bb.$type,$$t.$cn.x($$t.$bb.$type,String,$$t.$cn.u($$t.$bb.$type,aa,function(ad){return ad.type()!=2}),function(ad){return ad.caption()}));var ad=new $$t.bo($$t.$bb.$type,0);for(var ae=0;ae<ab.count();ae++){ad.add(ab.item(ae))}for(var af=0;af<ac.count();af++){ad.add(ac.item(af))}var ag=y._c;$$t.$ev.setMetaItemChildren(ag,ad)}return e},b:function(a,b,c){var d=new $$t.b9(String,$$t.$ep.$type.specialize($$t.$bb.$type,$$t.$be.$type.specialize($$t.$bb.$type)),0);var e=$$t.$cn.z($$t.$bi.$type,c._z);c._z=e;var f=new $$t.bo($$t.$en.$type,0);c._v=f;var g=function(){var $ret=new $$t.bb;$ret.type(12);$ret.caption(b.caption());$ret.item(b);return $ret}();var h=new $$t.ep($$t.$bb.$type,$$t.$be.$type.specialize($$t.$bb.$type),g,new $$t.bo($$t.$bb.$type,0));var j=a.getEnumerator();while(j.moveNext()){var i=j.current();var k=h;if(!String.isNullOrEmpty(i.kpiDisplayFolder())){var l=String.empty();var m=$$t.$ev.a(i.kpiDisplayFolder());for(var n=0;n<m.length;n++){var o=m[n];l+="\\"+o;var p;if(!function(){var q=d.tryGetValue(l,p);p=q.p1;return q.ret}()){var q=function(){var $ret=new $$t.bb;$ret.type(2);$ret.caption(o);return $ret}();p=new $$t.ep($$t.$bb.$type,$$t.$be.$type.specialize($$t.$bb.$type),q,new $$t.bo($$t.$bb.$type,0));d.add(l,p);k._d.add(q)}k=p}}var r=function(){var $ret=new $$t.bb;$ret.type(13);$ret.caption(i.caption());$ret.item(i);return $ret}();if(!String.isNullOrEmpty(i.kpiValue())){var s=null;var t=6;var u="Value";if(!function(){var v=c.f(i.kpiValue(),s);s=v.p1;return v.ret}()){t=14;s=$$t.$en.createKpiValueMeasure(i);e.add(s);f.add(s)}else{u+=" ("+s.caption()+")"}r.e(function(){var $ret=new $$t.bb;$ret.caption(u);$ret.item(s);$ret.type(t);return $ret}())}if(!String.isNullOrEmpty(i.kpiGoal())){var v=null;var w=6;var x="Goal";if(!function(){var y=c.f(i.kpiGoal(),v);v=y.p1;return y.ret}()){w=15;v=$$t.$en.createKpiGoalMeasure(i);e.add(v);f.add(v)}else{x+=" ("+v.caption()+")"}r.e(function(){var $ret=new $$t.bb;$ret.caption(x);$ret.item(v);$ret.type(w);return $ret}())}if(!String.isNullOrEmpty(i.kpiStatus())){var y=$$t.$en.createKpiStatusMeasure(i);e.add(y);f.add(y);r.e(function(){var $ret=new $$t.bb;$ret.caption("Status");$ret.item(y);$ret.type(16);return $ret}())}if(!String.isNullOrEmpty(i.kpiTrend())){var z=$$t.$en.createKpiTrendMeasure(i);e.add(z);f.add(z);r.e(function(){var $ret=new $$t.bb;$ret.caption("Trend");$ret.item(z);$ret.type(17);return $ret}())}if(!String.isNullOrEmpty(i.kpiWeight())){var aa=$$t.$en.createKpiWeightMeasure(i);e.add(aa);f.add(aa);r.e(function(){var $ret=new $$t.bb;$ret.caption("Weight");$ret.item(aa);$ret.type(18);return $ret}())}k._d.add(r)}var ab=new $$t.bo($$t.$bb.$type,0);var ad=$$t.$cn.x($$t.$bb.$type,String,$$t.$cn.u($$t.$bb.$type,h._d,function(ae){return ae.type()==2}),function(ae){return ae.caption()}).getEnumerator();while(ad.moveNext()){var ac=ad.current();ab.add(ac)}var af=$$t.$cn.x($$t.$bb.$type,String,$$t.$cn.u($$t.$bb.$type,h._d,function(ag){return ag.type()!=2}),function(ag){return ag.caption()}).getEnumerator();while(af.moveNext()){var ae=af.current();ab.add(ae)}$$t.$ev.setMetaItemChildren(g,ab);var ah=d.values().getEnumerator();while(ah.moveNext()){var ag=ah.current();var ai=ag._d;var aj=$$t.$cn.z($$t.$bb.$type,$$t.$cn.x($$t.$bb.$type,String,$$t.$cn.u($$t.$bb.$type,ai,function(ak){return ak.type()==2}),function(ak){return ak.caption()}));var ak=$$t.$cn.z($$t.$bb.$type,$$t.$cn.x($$t.$bb.$type,String,$$t.$cn.u($$t.$bb.$type,ai,function(al){return al.type()!=2}),function(al){return al.caption()}));var al=new $$t.bo($$t.$bb.$type,0);for(var am=0;am<aj.count();am++){al.add(aj.item(am))}for(var an=0;an<ak.count();an++){al.add(ak.item(an))}var ao=ag._c;$$t.$ev.setMetaItemChildren(ao,al)}return g},a:function(a){var b=a.split("\\");return b},$type:new $.ig.Type("MetaTreeHelper",$.ig.$ot)},true);$c("HierarchyItemPosition:ew","Object",{init:function(){$.ig.$op.init.call(this)},_a:0,_b:0,$type:new $.ig.Type("HierarchyItemPosition",$.ig.$ot)},true);$c("DataSourceBaseOptions:d8","Object",{init:function(){$.ig.$op.init.call(this)},_cube:null,cube:function(a){if(arguments.length===1){this._cube=a;return a}else{return this._cube}},_measureGroup:null,measureGroup:function(a){if(arguments.length===1){this._measureGroup=a;return a}else{return this._measureGroup}},_measures:null,measures:function(a){if(arguments.length===1){this._measures=a;return a}else{return this._measures}},_filters:null,filters:function(a){if(arguments.length===1){this._filters=a;return a}else{return this._filters}},_columns:null,columns:function(a){if(arguments.length===1){this._columns=a;return a}else{return this._columns}},_rows:null,rows:function(a){if(arguments.length===1){this._rows=a;return a}else{return this._rows}},$type:new $.ig.Type("DataSourceBaseOptions",$.ig.$ot)},true);$c("SourceInitHelper:fu","Object",{init:function(){$.ig.$op.init.call(this)},a:function(a){if(String.isNullOrEmpty(a)){return null}var b=new $$t.eu(a);var c=b.c();if(c.count()>0){var d=new $$t.bo(String,0);var f=c.getEnumerator();while(f.moveNext()){var e=f.current();d.add(e._b)}}return c},$type:new $.ig.Type("SourceInitHelper",$.ig.$ot)},true);$c("AxisDefinitionParser:eu","Object",{init:function(a){$.ig.$op.init.call(this);this._d=-1;this._k=a},_a:false,_g:null,_d:0,_k:null,b:function(){if(this._d==this._k.length-1){return false}var a=-1;var b=-1;var c=false;while(this._d+1<this._k.length){this._d=this._d+1;var d=this._k.substr(this._d,1);switch(d){case"[":if(a==-1){a=this._d}break;case"]":b=this._d;while(this._d+1<this._k.length){d=this._k.substr(this._d+1,1);switch(d){case"]":b=this._d+1;break;case",":if("]"==this._k.substr(this._d,1)){c=true}break;case"{":case"}":c=true;break}if(c){break}this._d=this._d+1}c=true;break;case",":c=true;break;case"{":this._a=true;break;case"}":c=true;this._a=false;break}if(c){c=false;if(a>-1&&b>-1){break}}}if(this._d==this._k.length-1){if(b==-1||a==-1){return false}}var e=this._k.substr(a,b-a+1).trim();this._g=e;return true},c:function(){var a=new $$t.bo($$t.$eq.$type,0);var b=null;while(this.b()){if(!this._a){b=new $$t.c4(String);var c=new $$t.eq(this._g,b);a.add(c)}else if(b!=null){b.add(this._g)}}return a},$type:new $.ig.Type("AxisDefinitionParser",$.ig.$ot)},true);$c("CoreOlapElementParseResult:fw","Object",{init:function(){$.ig.$op.init.call(this)},_a:0,_b:null,$type:new $.ig.Type("CoreOlapElementParseResult",$.ig.$ot)},true);$c("CoreOlapElementParser:fx","Object",{init:function(a){$.ig.$op.init.call(this);this._c=-1;this._h=a},_f:null,_c:0,_h:null,a:function(){if(this._c==this._h.length-1){return false}var a=-1;var b=-1;var c=false;while(this._c+1<this._h.length){this._c=this._c+1;var d=this._h.substr(this._c,1);switch(d){case"[":if(a==-1){a=this._c}break;case"]":b=this._c;while(this._c+1<this._h.length){d=this._h.substr(this._c+1,1);switch(d){case"]":b=this._c+1;break;case".":c=true;break}if(c){break}this._c=this._c+1}break;case".":c=true;break}if(c){c=false;if(a>-1&&b>-1){break}}}if(this._c==this._h.length-1){if(b==-1||a==-1){return false}}var e=this._h.substr(a,b-a+1).trim();this._f=e;return true},b:function(){var a=new $$t.bo(String,0);while(this.a()){a.add(this._f)}return a},$type:new $.ig.Type("CoreOlapElementParser",$.ig.$ot)},true);$c("PivotAction:fz","Object",{init:function(){$.ig.$op.init.call(this);this._a=0},c:function(){this._a=1;this._b=$$t.$ah.now()},e:function(){this._a=4},d:function(){this._a=3},_b:new Date,_a:0,$type:new $.ig.Type("PivotAction",$.ig.$ot)},true);$c("AxisChangedAction:f1","PivotAction",{init:function(a){$$t.$fz.init.call(this);this._f=a},_f:null,$type:new $.ig.Type("AxisChangedAction",$$t.$fz.$type)},true);$c("AxisItemsChangedAction:f2","AxisChangedAction",{init:function(a,b,c,d){$$t.$f1.init.call(this,a);this._h=b;this._g=c;this._j=d},_h:null,_g:0,_j:0,i:function(a){if(this._f!=a._f){return false}if(this._h!=a._h){return false}if(this._j!=a._j){return false}return this._g!=a._g},$type:new $.ig.Type("AxisItemsChangedAction",$$t.$f1.$type)},true);$c("ExpansionStateChangedAction:f4","AxisChangedAction",{init:function(a,b,c){$$t.$f1.init.call(this,a);this._g=b;this._h=c},_g:null,_h:0,i:function(a){if(this._f!=a._f){return false}if(this._g!=a._g){return false}return this._h!=a._h},$type:new $.ig.Type("ExpansionStateChangedAction",$$t.$f1.$type)},true);$c("PivotActionManager:f5","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("PivotActionManager",$.ig.$ot)},true);$c("MeasureGroupMetaItemsCache:eo","Object",{a:null,c:null,b:null,f:null,d:null,g:null,e:null,init:function(a,b,c,d){$.ig.$op.init.call(this);this.a=new $$t.b9(String,$$t.$ap.$type.specialize($$t.$ec.$type),0);this.c=new $$t.b9(String,$$t.$ap.$type.specialize($$t.$bi.$type),0);this.b=new $$t.b9(String,$$t.$ap.$type.specialize($$t.$eh.$type),0);this.f=d;this.d=a;this.g=b;this.e=c},getMeasureGroupDimensions:function(a){var $self=this;var b;if(!function(){var c=$self.a.tryGetValue(a,b);b=c.p1;return c.ret}()){var c=new $$t.bo(String,0);var e=this.f.getEnumerator();while(e.moveNext()){var d=e.current();if(d.measureGroupName()==a){c.add(d.dimensionUniqueName())}}var f=new $$t.bo($$t.$ec.$type,0);var h=this.d.getEnumerator();while(h.moveNext()){var g=h.current();if(c.contains(g.uniqueName())||g.dimensionType()==2){f.add(g)}}this.a.add(a,f);b=f}return b},getMeasureGroupMeasures:function(a){var $self=this;var b;if(!function(){var c=$self.c.tryGetValue(a,b);b=c.p1;return c.ret}()){var c=new $$t.bo($$t.$bi.$type,0);var e=this.g.getEnumerator();while(e.moveNext()){var d=e.current();if(d.measureGroupName()==a){c.add(d)}}this.c.add(a,c);b=c}return b},getMeasureGroupKpis:function(a){var $self=this;var b;if(!function(){var c=$self.b.tryGetValue(a,b);b=c.p1;return c.ret}()){var c=new $$t.bo($$t.$eh.$type,0);var e=this.e.getEnumerator();while(e.moveNext()){var d=e.current();if(d.measureGroupName()==a){c.add(d)}}this.b.add(a,c);b=c}return b},$type:new $.ig.Type("MeasureGroupMetaItemsCache",$.ig.$ot)},true);$c("HierarchyFilterView:f6","Object",{c:null,d:null,e:null,init:function(a){this.e=new $$t.b9(String,$$t.$f7.$type,0);$.ig.$op.init.call(this);this.hierarchy(a);this.d=new $$t.b9($$t.$l.$type,$$t.$be.$type.specialize($$t.$f7.$type),0);this.c=new $$t.b9(String,$$t.$f7.$type,0)},filterMemberExpansionChanged:null,filterMemberSelectionChanged:null,_hierarchy:null,hierarchy:function(a){if(arguments.length===1){this._hierarchy=a;return a}else{return this._hierarchy}},addFiltersForMembers:function(a){var c=a.getEnumerator();while(c.moveNext()){var b=c.current();this.addFilterForMember(b)}},addFilterForMember:function(a){var $self=this;if(!this.c.containsKey(a.uniqueName())){var b=new $$t.f7(a);b.propertyChanged=$.ig.Delegate.prototype.combine(b.propertyChanged,this.o.runOn(this));b.selectionChanged=$.ig.Delegate.prototype.combine(b.selectionChanged,this.p.runOn(this));var c;if(!function(){var d=$self.d.tryGetValue(a.levelDepth(),c);c=d.p1;return d.ret}()){c=new $$t.bo($$t.$f7.$type,0);this.d.add(a.levelDepth(),c)}this.c.add(a.uniqueName(),b);this.e.add(a.uniqueName(),b);c.add(b);this.j(b);this.m(b)}},tryGetFilterMember:function(a){if(this.c.containsKey(a)){return this.c.item(a)}return null},getRootFilterMembers:function(){var a=-1;var c=this.d.keys().getEnumerator();while(c.moveNext()){var b=c.current();if(a==-1){a=b}else{a=Math.min(b,a)}}if(a==-1){return null}return this.d.item(a)},getSelectedFilterItems:function(){var a=this.getRootFilterMembers();var b=new $$t.bo($$t.$f7.$type,0);var c=0;var e=a.getEnumerator();while(e.moveNext()){
var d=e.current();if(d.isSelected().hasValue()==true&&d.isSelected().value()==true){c++}}if(c==a.count()){return b}var g=a.getEnumerator();while(g.moveNext()){var f=g.current();if(f.isSelected().hasValue()==false){this.n(f,b)}else if(f.isSelected().hasValue()==true&&f.isSelected().value()==true){b.add(f)}}return b},p:function(a,b){if(this.filterMemberSelectionChanged!=null){this.filterMemberSelectionChanged(this,new $$t.gb(a))}},o:function(a,b){if(b.propertyName()=="IsExpanded"){if(this.filterMemberExpansionChanged!=null){this.filterMemberExpansionChanged(this,new $$t.gb(a))}}},n:function(a,b){if(a.isSelected().hasValue()==true&&a.isSelected().value()==true){b.add(a)}else{if(a.children()==null){return}var d=a.children().getEnumerator();while(d.moveNext()){var c=d.current();this.n(c,b)}}},m:function(a){var $self=this;var b=a.member().parentUniqueName();if(String.isNullOrEmpty(b)){return}var c;if(function(){var d=$self.c.tryGetValue(b,c);c=d.p1;return d.ret}()){c.n(a);if(c.isSelected().hasValue()==true&&c.isSelected().value()==false){a.isSelected($m($$t.$d.$type,false))}}},j:function(a){var $self=this;var b=a.member().levelDepth();var c;if(function(){var d=$self.d.tryGetValue(b+1,c);c=d.p1;return d.ret}()){var e=c.getEnumerator();while(e.moveNext()){var d=e.current();if(d.member().parentUniqueName()==a.member().uniqueName()){a.n(d)}}}},$type:new $.ig.Type("HierarchyFilterView",$.ig.$ot)},true);$c("FilterMember:f7","Object",{l:$m($$t.$d.$type,null),c:false,e:false,d:false,init:function(a){this.e=false;this.d=false;$.ig.$op.init.call(this);var b=$m($$t.$d.$type,true);this.l=b;this.member(a);this._k=0;this._j=0},selectionChanged:null,propertyChanged:null,_parent:null,parent:function(a){if(arguments.length===1){this._parent=a;return a}else{return this._parent}},_member:null,member:function(a){if(arguments.length===1){this._member=a;return a}else{return this._member}},isExpandable:function(){return this.member().childrenCardinality()>0},isExpanded:function(a){if(arguments.length===1){if(this.c!=a){this.c=a;this.o("IsExpanded")}return a}else{return this.c}},isSelected:function(a){if(arguments.length===1){var b=a;var c=$m($$t.$d.$type,null);if($j(this.l,b)==false){var d=this.l;this.l=a;if(!this.d){if(this.l.hasValue()==true){if(this.children()!=null){var f=this.children().getEnumerator();while(f.moveNext()){var e=f.current();e.e=true;e.isSelected(this.l);e.e=false}}}}if(this.parent()!=null){if(d.hasValue()==true&&d.value()==false){if(this.l.hasValue()==false){this.p(true)}this.q(false)}else if(d.hasValue()==false){if(this.l.hasValue()==true&&this.l.value()==false){this.q(true)}this.p(false)}else{if(this.l.hasValue()==true&&this.l.value()==false){this.q(true)}else if(this.l.hasValue()==false){this.p(true)}}if(!this.e){this.parent().d=true;var g=this.parent()._k;var h=this.parent()._j;var i=this.parent().children().count();if(h==0){if(g==0){this.parent().isSelected($m($$t.$d.$type,true))}else if(g==i){this.parent().isSelected($m($$t.$d.$type,false))}else{this.parent().isSelected(c)}}else{this.parent().isSelected(c)}this.parent().d=false}}this.o("IsSelected");if(!this.e&&!this.d){if(this.selectionChanged!=null){this.selectionChanged(this,$$t.$cu.empty)}}}return a}else{return this.l}},q:function(a){if(a){this.parent()._k=this.parent()._k+1}else{this.parent()._k=this.parent()._k-1}},p:function(a){if(a){this.parent()._j=this.parent()._j+1}else{this.parent()._j=this.parent()._j-1}},_children:null,children:function(a){if(arguments.length===1){this._children=a;return a}else{return this._children}},n:function(a){if(this.children()==null){this.children(new $$t.bo($$t.$f7.$type,0))}a.parent(this);this.children().add(a);this.o("Children")},_k:0,_j:0,o:function(a){if(this.propertyChanged!=null){this.propertyChanged(this,new $$t.ga(a))}},$type:new $.ig.Type("FilterMember",$.ig.$ot,[$$t.$f8.$type])},true);$c("FilterMemberStateChangedEventArgs:gb","EventArgs",{init:function(a){$$t.$cu.init.call(this);this.filterMember(a)},_filterMember:null,filterMember:function(a){if(arguments.length===1){this._filterMember=a;return a}else{return this._filterMember}},$type:new $.ig.Type("FilterMemberStateChangedEventArgs",$$t.$cu.$type)},true);$c("ResultSorter$1:fo","Object",{$t:null,_a:null,_d:false,_c:false,init:function($t,a,b,c){this.$t=$t;if(!this.hasOwnProperty("$type")){this.$type=this.$type.specialize(this.$t)}$.ig.$op.init.call(this);this._a=a;this._d=b;this._c=c},b:function(){},e:function(a,b,c){a.e();var d=a._d;var e=new Array(d.count());for(var f=0;f<d.count();f++){var g=d.item(f);c.add(g,f)}for(var h=0;h<d.count();h++){var i=d.item(h);var j=b.tuples().__inner[i];e[h]=j}return new $$t.bo($$t.$cz.$type,1,e)},$type:new $.ig.Type("ResultSorter$1",$.ig.$ot)},true);$c("AxisTupleVisitor:fp","Object",{_a:null,_d:null,init:function(a){$.ig.$op.init.call(this);this._a=a},e:function(){if(this._a.positionResolver().hasUnregisterdPositions()){this._a.positionResolver().completeRegisterPositions()}this._d=new $$t.bo($$t.$l.$type,2,this._a.tuples().count());var a=this._a.positionResolver().rootPositionInfo();var b=$$t.$cn.u($$t.$b8.$type.specialize(String,$.ig.$op.$type),a.values(),function(c){return c.positionItemDepth()==a.positionItemDepthMin()});var d=this.c(a,b).getEnumerator();while(d.moveNext()){var c=d.current();this.f(a,c)}},b:function(a,b){},c:function(a,b){},f:function(a,b){var c=$$t.$cn.u($$t.$b8.$type.specialize(String,$.ig.$op.$type),b.values(),function(d){return d.positionItemDepth()==b.positionItemDepthMin()});if($$t.$cn.aj($$t.$b8.$type.specialize(String,$.ig.$op.$type),c)>0){if($$t.$cn.b($$t.$b8.$type.specialize(String,$.ig.$op.$type),c,function(d){return d.positionItemDepth()>-1&&d.parentKey()==null&&d.hierarchyLevelKey()!=null&&d.hierarchyLevelKey().contains("[all]")==false})){c=this.c(a,c)}var e=c.getEnumerator();while(e.moveNext()){var d=e.current();this.f(b,d)}}else{this._d.add(b.positionIndex())}var f=this.b(a,b);var h=f.getEnumerator();while(h.moveNext()){var g=h.current();this.f(a,g)}},$type:new $.ig.Type("AxisTupleVisitor",$.ig.$ot)},true);$c("AxisHeaderSortingVisitor:fq","AxisTupleVisitor",{h:null,i:null,g:null,init:function(a,b,c,d){$$t.$fp.init.call(this,a);this.h=b;this.i=c;this.g=d},b:function(a,b){var c=$$t.$cn.u($$t.$b8.$type.specialize(String,$.ig.$op.$type),a.values(),function(d){return d.parentKey()==b.key()});return this.c(a,c)},c:function(a,b){var $self=this;var c=$$t.$cn.z($$t.$b8.$type.specialize(String,$.ig.$op.$type),b);if(c.count()>0){var d=c.item(0);var e;if(d.hierarchyLevelKey()!=null&&function(){var f=$self.h.tryGetValue(d.hierarchyLevelKey(),e);e=f.p1;return f.ret}()){if(e.sortBehavior()==1){c=e.sortDirection()==0?$$t.$cn.z($$t.$b8.$type.specialize(String,$.ig.$op.$type),$$t.$cn.x($$t.$b8.$type.specialize(String,$.ig.$op.$type),$.ig.$op.$type,c,function(f){return f.sortKey()})):$$t.$cn.z($$t.$b8.$type.specialize(String,$.ig.$op.$type),$$t.$cn.y($$t.$b8.$type.specialize(String,$.ig.$op.$type),$.ig.$op.$type,c,function(f){return f.sortKey()}))}else{c=e.sortDirection()==0?$$t.$cn.z($$t.$b8.$type.specialize(String,$.ig.$op.$type),$$t.$cn.x($$t.$b8.$type.specialize(String,$.ig.$op.$type),String,c,function(f){return f.caption()})):$$t.$cn.z($$t.$b8.$type.specialize(String,$.ig.$op.$type),$$t.$cn.y($$t.$b8.$type.specialize(String,$.ig.$op.$type),String,c,function(f){return f.caption()}))}if($$t.$cn.d($$t.$ez.$type,this.i,function(f){return f.levelUniqueName()==e.levelUniqueName()})==false){this.i.add(e)}var f;if(!function(){var g=$self.g.tryGetValue(d.positionItemIndex(),f);f=g.p1;return g.ret}()){f=new $$t.b9($$t.$l.$type,$$t.$cx.$type,0);this.g.add(d.positionItemIndex(),f)}f.item(d.positionItemDepth(),e.sortDirection())}}return c},$type:new $.ig.Type("AxisHeaderSortingVisitor",$$t.$fp.$type)},true);$c("ResultHeaderSorter:fn","ResultSorter$1",{f:null,_h:null,_g:null,init:function(a,b,c,d){$$t.$fo.init.call(this,$$t.$fq.$type,a,b,c);this.f=new $$t.b9(String,$$t.$ez.$type,1,d.count());var f=d.getEnumerator();while(f.moveNext()){var e=f.current();this.f.item(e.levelUniqueName(),e)}},b:function(){var $self=this;this._h=new $$t.bo($$t.$ez.$type,0);this._g=new $$t.b9(String,$$t.$ca.$type.specialize($$t.$l.$type,$$t.$ca.$type.specialize($$t.$l.$type,$$t.$cx.$type)),0);if(this._a.isEmpty()){return this._a}var a=new $$t.bo($$t.$bm.$type,0);var b=0;var c=1;var d=new $$t.b9($$t.$l.$type,$$t.$l.$type,0);var e=new $$t.b9($$t.$l.$type,$$t.$l.$type,0);if(this._c){var f=this._a.axes().item(b);var g=new $$t.b9($$t.$l.$type,$$t.$ca.$type.specialize($$t.$l.$type,$$t.$cx.$type),0);var h=new $$t.fq(f,this.f,this._h,g);var i=this.e(h,f,d);var j=function(){var $ret=new $$t.bm(i,f.tupleSize());$ret.name(f.name());return $ret}();a.add(j);this._g.item(f.name(),g);c=f.tuples().count();b++}if(this._d){var k=this._a.axes().item(b);var l=new $$t.b9($$t.$l.$type,$$t.$ca.$type.specialize($$t.$l.$type,$$t.$cx.$type),0);var m=new $$t.fq(k,this.f,this._h,l);var n=this.e(m,k,e);var o=function(){var $ret=new $$t.bm(n,k.tupleSize());$ret.name(k.name());return $ret}();a.add(o);this._g.item(k.name(),l)}var p=new $$t.bo($$t.$c3.$type,2,this._a.cells().count());var r=this._a.cells().getEnumerator();while(r.moveNext()){var q=r.current();var s=q.clone();var t=s.cellOrdinal();if(this._c){var u=t%c;var v=d.item(u);if(u!=v){var w=$a(t,c);t=w*c+v}}if(this._d){var x=$a(t,c);var y=e.item(x);if(x!=y){var z=t%c;t=y*c+z}}s.cellOrdinal(t);p.add(s)}var aa=function(){var $ret=new $$t.bl;$ret.isEmpty($self._a.isEmpty());$ret.axes(a);$ret.cells(p);return $ret}();return aa},$type:new $.ig.Type("ResultHeaderSorter",$$t.$fo.$type.specialize($$t.$fq.$type))},true);$c("AxisValueSortingVisitor:fs","AxisTupleVisitor",{g:null,init:function(a,b){$$t.$fp.init.call(this,a);this.g=b},b:function(a,b){var c=$$t.$cn.u($$t.$b8.$type.specialize(String,$.ig.$op.$type),a.values(),function(d){return d.parentKey()==b.key()});return this.c(a,c)},c:function(a,b){var positionItemInfos_=$$t.$cn.a($$t.$b8.$type.specialize(String,$.ig.$op.$type),b);if(positionItemInfos_.length>0){var tupleSortDirections_=$$t.$cn.a($$t.$cb.$type.specialize($$t.$e1.$type,Array),this.g);var sortFunction=function(tupleSortDirections){var compareCells=function(comparer,cell1,cell2){var result=comparer(cell1,cell2);if(result<0){return-1}if(result>0){return 1}return!isNaN(parseFloat(result))&&isFinite(result)?result:0};return function(o1,o2){var i,length,tupleSortDirection,cells,direction,cell1,cell2,arr1=[],arr2=[];for(i=0;i<tupleSortDirections.length;i++){tupleSortDirection=tupleSortDirections[i].key();cells=tupleSortDirections[i].value();if(tupleSortDirection.sortDirection()===$.ig.ListSortDirection.prototype.ascending){direction=1}else{direction=-1}var comparer=tupleSortDirection.comparer();cell1=cells[o1.positionIndex()];cell2=cells[o2.positionIndex()];if(tupleSortDirections.length===1){arr1=direction*compareCells(comparer,cell1,cell2);arr2=direction*compareCells(comparer,cell2,cell1)}else{arr1.push(direction*compareCells(comparer,cell1,cell2));arr2.push(direction*compareCells(comparer,cell2,cell1))}}if(arr1<arr2){return-1}if(arr1>arr2){return 1}return 0}};positionItemInfos_.sort(sortFunction(tupleSortDirections_))}return positionItemInfos_},$type:new $.ig.Type("AxisValueSortingVisitor",$$t.$fp.$type)},true);$c("ResultColumnValueSorter:fr","ResultSorter$1",{f:null,_g:null,init:function(a,b,c,d){$$t.$fo.init.call(this,$$t.$fs.$type,a,b,c);this.f=d},b:function(){var $self=this;this._g=new $$t.bo($$t.$e1.$type,0);if(!this._d||this._a.isEmpty()){return this._a}var a=new $$t.bo($$t.$bm.$type,0);var b=0;var c=null;var d=1;if(this._c){c=this._a.axes().item(b);d=c.tuples().count();a.add(c.clone());b++}var e=this._a.axes().item(b);var f=this._a.axes().item(b).tuples().count();var g=new $$t.b9($$t.$l.$type,$.ig.$op.$type,1,this._a.cells().count());var i=this._a.cells().getEnumerator();while(i.moveNext()){var h=i.current();var j=null;if(function(){var k=h.properties().tryGetValue("Value",j);j=k.p1;return k.ret}()){g.item(h.cellOrdinal(),j)}else{var k=h.properties().tryGetValue("FmtValue",j);j=k.p1;g.item(h.cellOrdinal(),j)}}var l=new $$t.bo($$t.$cb.$type.specialize($$t.$e1.$type,Array),2,this.f.count());var n=this.f.getEnumerator();while(n.moveNext()){var m=n.current();var o;if(c!=null&&m.memberNames()!=null){if(c.positionResolver().hasUnregisterdPositions()){c.positionResolver().completeRegisterPositions()}o=c.positionResolver().rootPositionInfo().getIndex(m.memberNames());m.tupleIndex(o)}else{o=m.tupleIndex()}if(o>-1&&o<d){var p=new Array(f);for(var q=0;q<f;q++){var r=null;var s=g.tryGetValue(q*d+o,r);r=s.p1;p[q]=r}l.add(new $$t.cb($$t.$e1.$type,Array,1,m,p));this._g.add(m)}}var t=new $$t.b9($$t.$l.$type,$$t.$l.$type,0);var u=new $$t.fs(e,l);var v=this.e(u,e,t);var w=function(){var $ret=new $$t.bm(v,e.tupleSize());$ret.name(e.name());return $ret}();a.add(w);var x=new $$t.bo($$t.$c3.$type,2,this._a.cells().count());var z=this._a.cells().getEnumerator();while(z.moveNext()){var y=z.current();var aa=y.clone();var ab=aa.cellOrdinal();var ac=$a(ab,d);var ad=t.item(ac);if(ac!=ad){var ae=ab%d;ab=ad*d+ae}aa.cellOrdinal(ab);x.add(aa)}var af=function(){var $ret=new $$t.bl;$ret.isEmpty($self._a.isEmpty());$ret.axes(a);$ret.cells(x);return $ret}();return af},$type:new $.ig.Type("ResultColumnValueSorter",$$t.$fo.$type.specialize($$t.$fs.$type))},true);$c("jQueryUtils:gc","Object",{init:function(){$.ig.$op.init.call(this)},c:function($t,a){if(a==null){return null}var jsObject_=a;var dict_=new $$t.b9(String,$t,0);(function(obj,dict){var tempDict=$.ig.Dictionary.prototype.getDictionary(obj);var keys=tempDict.keys();while(keys.moveNext()){var key=keys.current();var value=tempDict.item(key);dict.add(key,value)}})(jsObject_,dict_);return dict_},i:function($t,a){if(a==null){return null}var jsObject_=$$t.$gc.createJavascriptObject();var b=a.getEnumerator();while(b.moveNext()){var item_=b.current();jsObject_[item_.key()]=item_.value()}return jsObject_},convertToObjectDictionary:function(a){return $$t.$gc.c($.ig.$op.$type,a)},convertToStringDictionary:function(a){return $$t.$gc.c(String,a)},convertFromObjectDictionary:function(a){return $$t.$gc.i($.ig.$op.$type,a)},convertFromStringDictionary:function(a){return $$t.$gc.i(String,a)},createJavascriptObject:function(){return{}},getJavascriptObjectProperty:function(a,b){var jsObject_=a;var property_=b;return jsObject_[property_]},setJavascriptObjectProperty:function(a,b,c){var jsObject_=a;var property_=b;var value_=c;jsObject_[property_]=value_},getJavascriptObjectMethodResult:function(a,b,c){var jsObject_=a;var method_=b;var args_=c;return jsObject_[method_].call(jsObject_,args_)},$type:new $.ig.Type("jQueryUtils",$.ig.$ot)},true);$c("OlapTableView:gd","Object",{a:null,init:function(a,b,c,d){$.ig.$op.init.call(this);var e=this.b(d);this.a=new $$t.fj(a,b,c,e)},rowHeaders:function(){if(this.a.rowHeaders()==null){return null}return this.a.rowHeaders().inner()},columnHeaders:function(){if(this.a.columnHeaders()==null){return null}return this.a.columnHeaders().inner()},resultCells:function(){if(this.a.resultCells()==null){return null}return this.a.resultCells().inner()},columnSortDirections:function(a){if(arguments.length===1){this.a.columnSortDirections().clear();var c=a.getEnumerator();while(c.moveNext()){var b=c.current();var d=this.d(b);this.a.columnSortDirections().add(d)}return a}else{var a=new $$t.bs;var c=this.a.columnSortDirections().getEnumerator();while(c.moveNext()){var b=c.current();a.add(this.n(b))}return a}},appliedColumnSortDirections:function(){var a=new $$t.bs;var c=this.a.appliedColumnSortDirections().getEnumerator();while(c.moveNext()){var b=c.current();a.add(this.n(b))}return a},levelSortDirections:function(a){if(arguments.length===1){this.a.levelSortDirections().clear();var c=a.getEnumerator();while(c.moveNext()){var b=c.current();var d=this.c(b);this.a.levelSortDirections().add(d)}return a}else{var a=new $$t.bs;var c=this.a.levelSortDirections().getEnumerator();while(c.moveNext()){var b=c.current();a.add(this.m(b))}return a}},appliedLevelSortDirections:function(){var a=new $$t.bs;var c=this.a.appliedLevelSortDirections().getEnumerator();while(c.moveNext()){var b=c.current();a.add(this.m(b))}return a},appliedSortDirectionsMap:function(){var resultMap_=$$t.$gc.createJavascriptObject();var a=this.a.appliedSortDirectionsMap().getEnumerator();while(a.moveNext()){var i_=a.current();var axisMap_=$$t.$gc.createJavascriptObject();var b=i_.value().getEnumerator();while(b.moveNext()){var j_=b.current();var hierarchyMap_=$$t.$gc.createJavascriptObject();var c=j_.value().getEnumerator();while(c.moveNext()){var k_=c.current();var sortDirection_=k_.value()==0?"ascending":"descending";hierarchyMap_[k_.key()]=sortDirection_}axisMap_[j_.key()]=hierarchyMap_}resultMap_[i_.key()]=axisMap_}return resultMap_},initialize:function(){this.a.initialize()},b:function(a){var b=new $$t.fk;var c=$$t.$gc.getJavascriptObjectProperty(a,"rowHeadersLayout");var d=1;if(!String.isNullOrEmpty(c)){switch(c){case"tree":d=2;var e=$$t.$gc.getJavascriptObjectProperty(a,"compactRowHeaderIndentation");var f=$$t.$gc.getJavascriptObjectProperty(a,"treeRowHeaderIndentation");b=new $$t.ft(e,f);break;case"standard":d=0;break}}var g=$$t.$gc.getJavascriptObjectProperty(a,"isParentInFrontForColumns");var h=$$t.$gc.getJavascriptObjectProperty(a,"isParentInFrontForRows");var i=$$t.$gc.getJavascriptObjectProperty(a,"compactColumnHeaders");b._c=g;b._d=h;b._b=i;b._a=d;return b},d:function(o_){var a=$$t.$gc.getJavascriptObjectProperty(o_,"memberNames");var b=$h($$t.$gc.getJavascriptObjectProperty(o_,"tupleIndex"));var c=$$t.$gc.getJavascriptObjectProperty(o_,"sortDirection");var d=0;if(!String.isNullOrEmpty(c)){c=c.toLowerCase();if(c=="descending"){d=1}}var comparer_=null;if($.isFunction(o_.comparer)){comparer_=o_.comparer}else{comparer_=function(o1,o2){return parseFloat(o1||-Infinity)-parseFloat(o2||-Infinity)}}return function(){var $ret=new $$t.e1;$ret.memberNames(a);$ret.tupleIndex(b);$ret.sortDirection(d);$ret.comparer(comparer_);return $ret}()},n:function(a){var b=$$t.$gc.createJavascriptObject();$$t.$gc.setJavascriptObjectProperty(b,"memberNames",a.memberNames());$$t.$gc.setJavascriptObjectProperty(b,"tupleIndex",a.tupleIndex());$$t.$gc.setJavascriptObjectProperty(b,"sortDirection",a.sortDirection()==0?"ascending":"descending");if(a.comparer()!=null){$$t.$gc.setJavascriptObjectProperty(b,"comparer",a.comparer())}return b},c:function(a){var b=$$t.$gc.getJavascriptObjectProperty(a,"levelUniqueName");var c=$$t.$gc.getJavascriptObjectProperty(a,"sortDirection");var d=$$t.$gc.getJavascriptObjectProperty(a,"sortBehavior");if(!String.isNullOrEmpty(b)){var e=new $$t.ez;e.sortDirection(0);e.sortBehavior(1);e.levelUniqueName(b);if(!String.isNullOrEmpty(c)){c=c.toLowerCase();if(c=="descending"){e.sortDirection(1)}}if(!String.isNullOrEmpty(d)){d=d.toLowerCase();if(d=="alphabetical"){e.sortBehavior(0)}}return e}else{return null}},m:function(a){var b=$$t.$gc.createJavascriptObject();$$t.$gc.setJavascriptObjectProperty(b,"levelUniqueName",a.levelUniqueName());$$t.$gc.setJavascriptObjectProperty(b,"sortBehavior",a.sortBehavior()==1?"system":"alphabetical");$$t.$gc.setJavascriptObjectProperty(b,"sortDirection",a.sortDirection()==0?"ascending":"descending");return b},$type:new $.ig.Type("OlapTableView",$.ig.$ot)},true);$c("IConnection:ge","Object",{$type:new $.ig.Type("IConnection",null)},true);$c("IOlapDataProviderFactory:d9","Object",{$type:new $.ig.Type("IOlapDataProviderFactory",null)},true);$c("IOlapDiscoverDataProvider:ea","Object",{$type:new $.ig.Type("IOlapDiscoverDataProvider",null)},true);$c("IOlapExecuteCommandProvider:gf","Object",{$type:new $.ig.Type("IOlapExecuteCommandProvider",null)},true);$c("ArrayListCollection$1:c4","Object",{$t:null,init:function($t){this.$t=$t;if(!this.hasOwnProperty("$type")){this.$type=this.$type.specialize(this.$t)}$.ig.$op.init.call(this);this.inner(new $$t.bs)},_inner:null,inner:function(a){if(arguments.length===1){this._inner=a;return a}else{return this._inner}},collectionChanged:null,indexOf:function(a){return this.inner().indexOf($e(this.$t,a))},insert:function(a,b){this.inner().insert(a,$e(this.$t,b));this.d(a,b)},removeAt:function(a){var b=$v(this.$t,this.inner()[a]);this.inner().removeAt(a);this.e(a,b)},item:function(a,b){if(arguments.length===2){this.inner()[a]=$e(this.$t,b);return b}else{return $v(this.$t,this.inner()[a])}},add:function(a){this.inner().add($e(this.$t,a));this.d(this.inner().length-1,a)},clear:function(){this.inner().clear();this.c()},contains:function(a){return this.inner().contains($e(this.$t,a))},copyTo:function(a,b){throw new $$t.b5(0)},count:function(){return this.inner().length},isReadOnly:function(){return false},remove:function(a){var b=this.inner().indexOf($e(this.$t,a));if(b>=0){this.inner().removeAt(b);this.e(b,a);return true}return false},b:function(){var d__=new $.ig.ArrayListCollection___Enumerate__IteratorClass$1(this.$t,(-2));d__.__4__this=this;return d__},getEnumerator:function(){return this.b().getEnumerator()},d:function(a,b){if(this.collectionChanged!=null){var c=new $$t.c7(1,0,$e(this.$t,b),a);this.collectionChanged(this,c)}},e:function(a,b){if(this.collectionChanged!=null){var c=new $$t.c7(1,1,$e(this.$t,b),a);this.collectionChanged(this,c)}},c:function(){if(this.collectionChanged!=null){var a=new $$t.c7(1,4,null,(-1));this.collectionChanged(this,a)}},$type:new $.ig.Type("ArrayListCollection$1",$.ig.$ot,[$$t.$be.$type.specialize(0),$$t.$c5.$type])},true);$c("ICoreOlapElement:bc","Object",{$type:new $.ig.Type("ICoreOlapElement",null)},true);$c("MeasureList:er","Object",{init:function(){$.ig.$op.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},uniqueName:function(a){if(arguments.length===1){this.name(a);return a}else{return this.name()}},_measures:null,measures:function(a){if(arguments.length===1){this._measures=a;return a}else{return this._measures}},$type:new $.ig.Type("MeasureList",$.ig.$ot,[$$t.$bc.$type])},true);$c("OlapMetadataTreeItem:bb","Object",{init:function(){$.ig.$op.init.call(this)},_item:null,item:function(a){if(arguments.length===1){this._item=a;return a}else{return this._item}},_type:0,type:function(a){if(arguments.length===1){this._type=a;return a}else{return this._type}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_children:null,children:function(a){if(arguments.length===1){this._children=a;return a}else{return this._children}},e:function(a){if(this.children()==null){this.children(new Array(1));this.children()[0]=a;return}var b=new Array(this.children().length+1);$.ig.util.arrayCopy1(this.children(),0,b,0,this.children().length);b[this.children().length]=a;this.children(b)},$type:new $.ig.Type("OlapMetadataTreeItem",$.ig.$ot)},true);$c("GetPositionIndexCompletedEventArgs:gg","AsyncCompletedEventArgs",{init:function(a,b,c,d){$$t.$ct.init.call(this,b,c,d);this.positionIndex(a)},_positionIndex:0,positionIndex:function(a){if(arguments.length===1){this._positionIndex=a;return a}else{return this._positionIndex}},$type:new $.ig.Type("GetPositionIndexCompletedEventArgs",$$t.$ct.$type)},true);$c("KeyValueItem:eb","Object",{init:function(){$.ig.$op.init.call(this)},_a:null,_b:null,$type:new $.ig.Type("KeyValueItem",$.ig.$ot)},true);$c("AxisElement:eq","Object",{init:function(a,b){$.ig.$op.init.call(this);this._b=a;this._a=b},_b:null,_a:null,$type:new $.ig.Type("AxisElement",$.ig.$ot)},true);$c("IPositionItem$2:b7","Object",{$type:new $.ig.Type("IPositionItem$2",null)},true);$c("IHierarchicalPositionItem$2:cl","Object",{$type:new $.ig.Type("IHierarchicalPositionItem$2",null,[$$t.$b7.$type.specialize(0,1)])},true);$c("PositionItemInfo$2:b8","Dictionary$2",{$tKey:null,$tSortKey:null,init:function($tKey,$tSortKey,a,b,c,d){this.$tKey=$tKey;this.$tSortKey=$tSortKey;if(!this.hasOwnProperty("$type")){this.$type=this.$type.specialize(this.$tKey,this.$tSortKey)}$$t.$b9.init.call(this,this.$tKey,$$t.$b8.$type.specialize(this.$tKey,this.$tSortKey),0);this.ab=new $$t.b9(this.$tKey,$.ig.$op.$type,0);this.positionItem(a);this.positionIndex(b);this.positionItemIndex(c);this.positionItemDepth(0);this.positionItemDepthMin(-1);this.positionItemDepthMax(2147483647);this.positionSize(d);if(a!=null){this.positionItemDepth(this.positionItem().depth());this.key(this.positionItem().key());this.parentKey(this.positionItem().parentKey());this.hierarchyKey(this.positionItem().hierarchyKey());this.hierarchyLevelKey(this.positionItem().hierarchyLevelKey());this.sortKey(this.positionItem().sortKey());this.caption(this.positionItem().caption())}},q:function(a,b,c,d){return new $$t.b8(this.$tKey,this.$tSortKey,a,b,c,d)},_positionItemDepthMin:0,positionItemDepthMin:function(a){if(arguments.length===1){this._positionItemDepthMin=a;return a}else{return this._positionItemDepthMin}},_positionItemDepthMax:0,positionItemDepthMax:function(a){if(arguments.length===1){this._positionItemDepthMax=a;return a}else{return this._positionItemDepthMax}},_positionItem:null,positionItem:function(a){if(arguments.length===1){this._positionItem=a;return a}else{return this._positionItem}},_positionIndex:0,positionIndex:function(a){if(arguments.length===1){this._positionIndex=a;return a}else{return this._positionIndex}},_positionItemDepth:0,positionItemDepth:function(a){if(arguments.length===1){this._positionItemDepth=a;return a}else{return this._positionItemDepth}},_positionItemIndex:0,positionItemIndex:function(a){if(arguments.length===1){this._positionItemIndex=a;return a}else{return this._positionItemIndex}},_positionSize:0,positionSize:function(a){if(arguments.length===1){this._positionSize=a;return a}else{return this._positionSize}},_key:null,key:function(a){if(arguments.length===1){this._key=a;return a}else{return this._key}},_parentKey:null,parentKey:function(a){if(arguments.length===1){this._parentKey=a;return a}else{return this._parentKey}},_hierarchyKey:null,hierarchyKey:function(a){if(arguments.length===1){this._hierarchyKey=a;return a}else{return this._hierarchyKey}},_hierarchyLevelKey:null,hierarchyLevelKey:function(a){if(arguments.length===1){this._hierarchyLevelKey=a;return a}else{return this._hierarchyLevelKey}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},v:null,sortKey:function(a){if(arguments.length===1){this.v=a;return a}else{return this.v}},_isExpandable:false,isExpandable:function(a){if(arguments.length===1){this._isExpandable=a;return a}else{return this._isExpandable}},_isExpanded:false,isExpanded:function(a){if(arguments.length===1){this._isExpanded=a;return a}else{return this._isExpanded}},x:function(a,b,c){var d=false;if(this.positionItemIndex()==-1){d=true}else{if(c!=null){if(a.item(this.positionItemIndex()).key()!=null){var e=c.item(this.positionItemIndex());d=a.item(this.positionItemIndex()).key().equals(e.key())}}}if(this.positionItemIndex()+1==this.positionSize()){return d}var f=this.y(a,b,this.positionItemIndex()+1,c);return d&&f},am:function(a,b){},ab:null,y:function(a,b,c,d){var $self=this;var e;var f=a.item(c);if(!this.containsKey(f.key())){var g=this.q(f,b,c,this.positionSize());g.isExpandable(f.isExpandable());if(this.ab.containsKey(g.key())){this.ab.remove(g.key());g.isExpanded(true)}if(f.parentKey()!=null){var h=null;if(function(){var i=$self.tryGetValue(f.parentKey(),h);h=i.p1;return i.ret}()){h.isExpanded(true)}else{if(!this.ab.containsKey(f.parentKey())){this.ab.add(f.parentKey(),null)}}}e=g.x(a,b,d);this.add(f.key(),g);if(this.positionItemDepthMin()==-1){this.positionItemDepthMin(f.depth())}else{this.positionItemDepthMin(Math.min(this.positionItemDepthMin(),f.depth()))}if(this.positionItemDepthMax()==2147483647){this.positionItemDepthMax(f.depth())}else{this.positionItemDepthMax(Math.max(this.positionItemDepthMax(),f.depth()))}this.am(a,g)}else{var i=this.item(f.key());e=i.x(a,b,d)}return e},getIndex2:function(a){var b=new Array(a.count());for(var c=0;c<b.length;c++){b[c]=a.item(c).key()}return this.getIndex(b)},getIndex:function(a){return this.ad(a,a.length)},ad:function(a,b){var $self=this;if(this.positionItemIndex()==b-1){return this.positionIndex()}var c;if(!function(){var d=$self.tryGetValue(a[$self.positionItemIndex()+1],c);c=d.p1;return d.ret}()){return-1}if(c.count()==0){return c.positionIndex()}return c.ad(a,b)},$type:new $.ig.Type("PositionItemInfo$2",$$t.$b9.$type.specialize(0,-1))},true);$$t.$b8.$type.initSelfReferences();$c("PositionResolver$2:bn","Object",{$tKey:null,$tSortKey:null,m:0,b:null,f:null,g:null,init:function($tKey,$tSortKey,a,b){this.$tKey=$tKey;this.$tSortKey=$tSortKey;if(!this.hasOwnProperty("$type")){this.$type=this.$type.specialize(this.$tKey,this.$tSortKey)}this.m=0;$.ig.$op.init.call(this);this.positions($$t.$cn.z($$t.$b6.$type.specialize(this.$tKey,this.$tSortKey),a));this.positionSize(b)},getPositionIndexCompleted:null,_positions:null,positions:function(a){if(arguments.length===1){this._positions=a;return a}else{return this._positions}},_positionSize:0,positionSize:function(a){if(arguments.length===1){this._positionSize=a;return a}else{return this._positionSize}},rootPositionInfo:function(){if(this.b==null){this.b=this.d(this.positionSize())}return this.b},d:function(a){return new $$t.b8(this.$tKey,this.$tSortKey,null,(-1),(-1),a)},hasUnregisterdPositions:function(){return this.m<this.positions().count()},completeRegisterPositions:function(){if(this.hasUnregisterdPositions()){this.q(null)}},resolveParentPositionItem:function(a,b){b=-1;var c=$b($$t.$cl.$type.specialize(this.$tKey,this.$tSortKey),a);if(c==null||c.parentKey()==null){return{ret:null,p1:b}}var d=c.position().indexOf(c);var e=new Array(c.position().itemsCount());for(var f=0;f<c.position().itemsCount();f++){e[f]=c.position().item(f).key()}e[d]=c.parentKey();b=this.rootPositionInfo().getIndex(e);if(b==-1){return{ret:null,p1:b}}var g=this.positions().__inner[b];var h=g.item(d);return{ret:h,p1:b}},getHostPositionItemInfo:function(a,b){var c=this.rootPositionInfo();var d=a.item(b);for(var e=0;e<b;e++){var f;if(function(){var g=c.tryGetValue(a.item(e).key(),f);f=g.p1;return g.ret}()){c=f}else{c=null;break}}if(c==null){return null}if(!c.containsKey(d.key())){return null}return c},i:function(a,b){if(this.rootPositionInfo().count()==0){return null}var c=this.rootPositionInfo();var d=a.position().indexOf(a);for(var e=0;e<d;e++){var f;if(function(){var g=c.tryGetValue(a.position().item(e).key(),f);f=g.p1;return g.ret}()){c=f}else{c=null;break}}if(c==null){return null}if(!c.containsKey(a.key())){return null}var g=new $$t.bo($$t.$l.$type,0);this.u(a.key(),c,g);if(b==1){g.sort2(function(h,i){if(h==i){return 0}if(h>i){return-1}return 1});return g}g.sort2(function(h,i){if(h==i){return 0}if(h>i){return 1}return-1});return g},u:function(a,b,c){var e=$$t.$cn.u($$t.$b8.$type.specialize(this.$tKey,this.$tSortKey),b.values(),function(f){return a.equals(f.parentKey())}).getEnumerator();while(e.moveNext()){var d=e.current();if(d.count()==0){c.add(d.positionIndex())}else{this.t(d,c)}if(!d.isExpanded()){continue}if(d.positionItemDepth()<b.positionItemDepthMax()){this.u(d.key(),b,c)}}},t:function(a,b){var d=$$t.$cn.u($$t.$b8.$type.specialize(this.$tKey,this.$tSortKey),a.values(),function(e){return e.parentKey()==null}).getEnumerator();while(d.moveNext()){var c=d.current();if(c.count()==0){b.add(c.positionIndex())}else{this.t(c,b)}if(!c.isExpanded()){continue}if(c.positionItemDepth()<a.positionItemDepthMax()){this.u(c.key(),a,b)}}},getChildren:function(a,b){if(this.hasUnregisterdPositions()){this.completeRegisterPositions()}var c=this.getHostPositionItemInfo(a,b);var d=a.item(b);return $$t.$cn.u($$t.$b8.$type.specialize(this.$tKey,this.$tSortKey),c.values(),function(e){return d.key().equals(e.parentKey())})},isMemberExpanded:function(a){if(this.hasUnregisterdPositions()){this.completeRegisterPositions()}var b=this.getPositionIndex(a.position());if(b==-1||this.rootPositionInfo().count()==0){
return $m($$t.$d.$type,null)}var c=a.position().indexOf(a);var d=this.rootPositionInfo();for(var e=0;e<c;e++){var f;if(function(){var g=d.tryGetValue(a.position().item(e).key(),f);f=g.p1;return g.ret}()){d=f}else{d=null;break}}if(d==null){return $m($$t.$d.$type,null)}if(!d.containsKey(a.key())){return $m($$t.$d.$type,null)}var g=null;var h=d.values().getEnumerator();while(h.moveNext()){if(a.key().equals(h.current().parentKey())){g=h.current();break}}return $m($$t.$d.$type,g!=null)},getPositionIndex:function(a){if(a==null){return-1}if(a.itemsCount()!=this.positionSize()){return-1}if(a.isEmpty()&&this.positions().count()==1&&this.positions().__inner[0].isEmpty()){return 0}if(this.m>0){var b=this.o(a);if(b>-1){return b}if(this.m==this.positions().count()){return-1}}return this.q(a)},o:function(a){if(a.isEmpty()&&this.positions().count()==1&&this.positions().__inner[0].isEmpty()){return 0}return this.rootPositionInfo().getIndex2($$t.$cn.z($$t.$b7.$type.specialize(this.$tKey,this.$tSortKey),a.getItems()))},q:function(a){var b=a==null;var c=-1;for(var d=this.m;d<this.positions().count();d++){var e=this.positions().__inner[d];var f=this.rootPositionInfo().x(e,d,a);this.m++;if(c==-1&&f){c=d;if(!b){break}}}return c},$type:new $.ig.Type("PositionResolver$2",$.ig.$ot)},true);$c("Cube:c9","Object",{init:function(){$.ig.$op.init.call(this)},_catalogName:null,catalogName:function(a){if(arguments.length===1){this._catalogName=a;return a}else{return this._catalogName}},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_cubeType:0,cubeType:function(a){if(arguments.length===1){this._cubeType=a;return a}else{return this._cubeType}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_lastProcessed:new Date,lastProcessed:function(a){if(arguments.length===1){this._lastProcessed=a;return a}else{return this._lastProcessed}},_lastUpdated:new Date,lastUpdated:function(a){if(arguments.length===1){this._lastUpdated=a;return a}else{return this._lastUpdated}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},uniqueName:function(a){if(arguments.length===1){this.name(a);return a}else{return this.name()}},$type:new $.ig.Type("Cube",$.ig.$ot,[$$t.$bc.$type])},true);$c("Catalog:d6","Object",{init:function(){$.ig.$op.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},$type:new $.ig.Type("Catalog",$.ig.$ot,[$$t.$bc.$type])},true);$c("Dimension:ec","Object",{init:function(){$.ig.$op.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_dimensionType:0,dimensionType:function(a){if(arguments.length===1){this._dimensionType=a;return a}else{return this._dimensionType}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_defaultHierarchy:null,defaultHierarchy:function(a){if(arguments.length===1){this._defaultHierarchy=a;return a}else{return this._defaultHierarchy}},$type:new $.ig.Type("Dimension",$.ig.$ot,[$$t.$bc.$type])},true);$c("KpiDimension:ex","Object",{init:function(){$.ig.$op.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},$type:new $.ig.Type("KpiDimension",$.ig.$ot,[$$t.$bc.$type])},true);$c("Hierarchy:bg","Object",{init:function(){$.ig.$op.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_defaultHierarchy:null,defaultHierarchy:function(a){if(arguments.length===1){this._defaultHierarchy=a;return a}else{return this._defaultHierarchy}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_defaultMember:null,defaultMember:function(a){if(arguments.length===1){this._defaultMember=a;return a}else{return this._defaultMember}},_allMember:null,allMember:function(a){if(arguments.length===1){this._allMember=a;return a}else{return this._allMember}},_dimensionUniqueName:null,dimensionUniqueName:function(a){if(arguments.length===1){this._dimensionUniqueName=a;return a}else{return this._dimensionUniqueName}},_hierarchyOrigin:0,hierarchyOrigin:function(a){if(arguments.length===1){this._hierarchyOrigin=a;return a}else{return this._hierarchyOrigin}},_hierarchyDisplayFolder:null,hierarchyDisplayFolder:function(a){if(arguments.length===1){this._hierarchyDisplayFolder=a;return a}else{return this._hierarchyDisplayFolder}},$type:new $.ig.Type("Hierarchy",$.ig.$ot,[$$t.$bc.$type])},true);$c("Kpi:eh","Object",{init:function(){$.ig.$op.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_measureGroupName:null,measureGroupName:function(a){if(arguments.length===1){this._measureGroupName=a;return a}else{return this._measureGroupName}},_kpiDisplayFolder:null,kpiDisplayFolder:function(a){if(arguments.length===1){this._kpiDisplayFolder=a;return a}else{return this._kpiDisplayFolder}},_kpiValue:null,kpiValue:function(a){if(arguments.length===1){this._kpiValue=a;return a}else{return this._kpiValue}},_kpiGoal:null,kpiGoal:function(a){if(arguments.length===1){this._kpiGoal=a;return a}else{return this._kpiGoal}},_kpiStatus:null,kpiStatus:function(a){if(arguments.length===1){this._kpiStatus=a;return a}else{return this._kpiStatus}},_kpiTrend:null,kpiTrend:function(a){if(arguments.length===1){this._kpiTrend=a;return a}else{return this._kpiTrend}},_kpiStatusGraphic:null,kpiStatusGraphic:function(a){if(arguments.length===1){this._kpiStatusGraphic=a;return a}else{return this._kpiStatusGraphic}},_kpiTrendGraphic:null,kpiTrendGraphic:function(a){if(arguments.length===1){this._kpiTrendGraphic=a;return a}else{return this._kpiTrendGraphic}},_kpiWeight:null,kpiWeight:function(a){if(arguments.length===1){this._kpiWeight=a;return a}else{return this._kpiWeight}},_parentKpiName:null,parentKpiName:function(a){if(arguments.length===1){this._parentKpiName=a;return a}else{return this._parentKpiName}},_currentTimeMember:null,currentTimeMember:function(a){if(arguments.length===1){this._currentTimeMember=a;return a}else{return this._currentTimeMember}},$type:new $.ig.Type("Kpi",$.ig.$ot,[$$t.$bc.$type])},true);$c("Level:ee","Object",{init:function(){$.ig.$op.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_depth:0,depth:function(a){if(arguments.length===1){this._depth=a;return a}else{return this._depth}},_hierarchyUniqueName:null,hierarchyUniqueName:function(a){if(arguments.length===1){this._hierarchyUniqueName=a;return a}else{return this._hierarchyUniqueName}},_dimensionUniqueName:null,dimensionUniqueName:function(a){if(arguments.length===1){this._dimensionUniqueName=a;return a}else{return this._dimensionUniqueName}},_membersCount:0,membersCount:function(a){if(arguments.length===1){this._membersCount=a;return a}else{return this._membersCount}},_levelOrigin:0,levelOrigin:function(a){if(arguments.length===1){this._levelOrigin=a;return a}else{return this._levelOrigin}},_levelOrderingProperty:null,levelOrderingProperty:function(a){if(arguments.length===1){this._levelOrderingProperty=a;return a}else{return this._levelOrderingProperty}},$type:new $.ig.Type("Level",$.ig.$ot,[$$t.$bc.$type])},true);$c("Measure:bi","Object",{init:function(){$.ig.$op.init.call(this)},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_measureGroupName:null,measureGroupName:function(a){if(arguments.length===1){this._measureGroupName=a;return a}else{return this._measureGroupName}},_aggregatorType:0,aggregatorType:function(a){if(arguments.length===1){this._aggregatorType=a;return a}else{return this._aggregatorType}},_defaultFormatString:null,defaultFormatString:function(a){if(arguments.length===1){this._defaultFormatString=a;return a}else{return this._defaultFormatString}},_measureDisplayFolder:null,measureDisplayFolder:function(a){if(arguments.length===1){this._measureDisplayFolder=a;return a}else{return this._measureDisplayFolder}},$type:new $.ig.Type("Measure",$.ig.$ot,[$$t.$bc.$type])},true);$c("KpiMeasure:en","Measure",{init:function(a,b){$$t.$bi.init.call(this);this.uniqueName(a);this.caption(b)},_graphic:null,graphic:function(a){if(arguments.length===1){this._graphic=a;return a}else{return this._graphic}},createKpiValueMeasure:function(a){return new $$t.en(a.kpiValue(),a.caption()+" Value")},createKpiGoalMeasure:function(a){return new $$t.en(a.kpiGoal(),a.caption()+" Goal")},createKpiWeightMeasure:function(a){return new $$t.en(a.kpiWeight(),a.caption()+" Weight")},createKpiStatusMeasure:function(a){var b=new $$t.en(a.kpiStatus(),a.caption()+" Status");b.graphic(a.kpiStatusGraphic());return b},createKpiTrendMeasure:function(a){var b=new $$t.en(a.kpiTrend(),a.caption()+" Trend");b.graphic(a.kpiTrendGraphic());return b},$type:new $.ig.Type("KpiMeasure",$$t.$bi.$type)},true);$c("MeasureGroup:d7","Object",{init:function(){$.ig.$op.init.call(this)},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_cubeName:null,cubeName:function(a){if(arguments.length===1){this._cubeName=a;return a}else{return this._cubeName}},_catalogName:null,catalogName:function(a){if(arguments.length===1){this._catalogName=a;return a}else{return this._catalogName}},uniqueName:function(a){if(arguments.length===1){this.name(a);return a}else{return this.name()}},$type:new $.ig.Type("MeasureGroup",$.ig.$ot,[$$t.$bc.$type])},true);$c("MeasureGroupDimension:ef","Object",{init:function(){$.ig.$op.init.call(this)},_cubeName:null,cubeName:function(a){if(arguments.length===1){this._cubeName=a;return a}else{return this._cubeName}},_catalogName:null,catalogName:function(a){if(arguments.length===1){this._catalogName=a;return a}else{return this._catalogName}},_measureGroupName:null,measureGroupName:function(a){if(arguments.length===1){this._measureGroupName=a;return a}else{return this._measureGroupName}},_dimensionUniqueName:null,dimensionUniqueName:function(a){if(arguments.length===1){this._dimensionUniqueName=a;return a}else{return this._dimensionUniqueName}},_measureGroupCardinality:0,measureGroupCardinality:function(a){if(arguments.length===1){this._measureGroupCardinality=a;return a}else{return this._measureGroupCardinality}},_dimensionCardinality:0,dimensionCardinality:function(a){if(arguments.length===1){this._dimensionCardinality=a;return a}else{return this._dimensionCardinality}},_isDimensionVisible:false,isDimensionVisible:function(a){if(arguments.length===1){this._isDimensionVisible=a;return a}else{return this._isDimensionVisible}},_isFactDimension:false,isFactDimension:function(a){if(arguments.length===1){this._isFactDimension=a;return a}else{return this._isFactDimension}},_dimensionPath:null,dimensionPath:function(a){if(arguments.length===1){this._dimensionPath=a;return a}else{return this._dimensionPath}},_dimensionGranularity:null,dimensionGranularity:function(a){if(arguments.length===1){this._dimensionGranularity=a;return a}else{return this._dimensionGranularity}},$type:new $.ig.Type("MeasureGroupDimension",$.ig.$ot)},true);$c("Member:d4","Object",{init:function(){$.ig.$op.init.call(this);var a=$m($$t.$l.$type,null);this.scope(a)},_cubeName:null,cubeName:function(a){if(arguments.length===1){this._cubeName=a;return a}else{return this._cubeName}},_catalogName:null,catalogName:function(a){if(arguments.length===1){this._catalogName=a;return a}else{return this._catalogName}},_dimensionUniqueName:null,dimensionUniqueName:function(a){if(arguments.length===1){this._dimensionUniqueName=a;return a}else{return this._dimensionUniqueName}},_hierarchyUniqueName:null,hierarchyUniqueName:function(a){if(arguments.length===1){this._hierarchyUniqueName=a;return a}else{return this._hierarchyUniqueName}},_levelUniqueName:null,levelUniqueName:function(a){if(arguments.length===1){this._levelUniqueName=a;return a}else{return this._levelUniqueName}},_levelDepth:0,levelDepth:function(a){if(arguments.length===1){this._levelDepth=a;return a}else{return this._levelDepth}},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_memberType:0,memberType:function(a){if(arguments.length===1){this._memberType=a;return a}else{return this._memberType}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_childrenCardinality:0,childrenCardinality:function(a){if(arguments.length===1){this._childrenCardinality=a;return a}else{return this._childrenCardinality}},_parentLevel:0,parentLevel:function(a){if(arguments.length===1){this._parentLevel=a;return a}else{return this._parentLevel}},_parentUniqueName:null,parentUniqueName:function(a){if(arguments.length===1){this._parentUniqueName=a;return a}else{return this._parentUniqueName}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_scope:$m($$t.$l.$type,null),scope:function(a){if(arguments.length===1){this._scope=a;return a}else{return this._scope}},$type:new $.ig.Type("Member",$.ig.$ot,[$$t.$bc.$type])},true);$c("OlapResult:bl","Object",{init:function(){$.ig.$op.init.call(this)},_isEmpty:false,isEmpty:function(a){if(arguments.length===1){this._isEmpty=a;return a}else{return this._isEmpty}},_axes:null,axes:function(a){if(arguments.length===1){this._axes=a;return a}else{return this._axes}},_cells:null,cells:function(a){if(arguments.length===1){this._cells=a;return a}else{return this._cells}},$type:new $.ig.Type("OlapResult",$.ig.$ot)},true);$c("OlapResultAxis:bm","Object",{init:function(a,b){$.ig.$op.init.call(this);this.tuples($$t.$cn.z($$t.$cz.$type,a));this.tupleSize(b);this.positionResolver(new $$t.bn(String,$.ig.$op.$type,a,b))},_positionResolver:null,positionResolver:function(a){if(arguments.length===1){this._positionResolver=a;return a}else{return this._positionResolver}},clone:function(){var $self=this;var a=new $$t.bo($$t.$cz.$type,0);var c=this.tuples().getEnumerator();while(c.moveNext()){var b=c.current();a.add(b.clone())}return function(){var $ret=new $$t.bm(a,$self.tupleSize());$ret.name($self.name());return $ret}()},_name:null,name:function(a){if(arguments.length===1){this._name=a;return a}else{return this._name}},_tupleSize:0,tupleSize:function(a){if(arguments.length===1){this._tupleSize=a;return a}else{return this._tupleSize}},_tuples:null,tuples:function(a){if(arguments.length===1){this._tuples=a;return a}else{return this._tuples}},$type:new $.ig.Type("OlapResultAxis",$.ig.$ot)},true);$c("OlapResultTuple:cz","Object",{init:function(a){$.ig.$op.init.call(this);this.members(new $$t.b3($$t.$c0.$type,1,a))},_members:null,members:function(a){if(arguments.length===1){this._members=a;return a}else{return this._members}},getItems:function(){return this.members()},itemsCount:function(){return this.members().count()},indexOf:function(a){return this.members().indexOf(a)},item:function(a){return this.members().item(a)},isEmpty:function(){return false},clone:function(){var a=new $$t.bo($$t.$c0.$type,0);var c=this.members().getEnumerator();while(c.moveNext()){var b=c.current();a.add(b.clone())}var d=new $$t.cz(a);var f=a.getEnumerator();while(f.moveNext()){var e=f.current();e.position(d)}return d},c:function(){if(this.members().count()==0){return"Empty tuple."}else{var a=new $$t.c1(0);var c=this.members().getEnumerator();while(c.moveNext()){var b=c.current();a.l(b.caption()+"; ")}a.c(a.c()-2);return a.toString()}},$type:new $.ig.Type("OlapResultTuple",$.ig.$ot,[$$t.$b6.$type.specialize(String,$.ig.$op.$type)])},true);$c("OlapResultAxisMember:c0","Object",{init:function(){$.ig.$op.init.call(this);this.properties(new $$t.b9(String,String,0));this.ordinal(-1)},_uniqueName:null,uniqueName:function(a){if(arguments.length===1){this._uniqueName=a;return a}else{return this._uniqueName}},_caption:null,caption:function(a){if(arguments.length===1){this._caption=a;return a}else{return this._caption}},_levelUniqueName:null,levelUniqueName:function(a){if(arguments.length===1){this._levelUniqueName=a;return a}else{return this._levelUniqueName}},_hierarchyUniqueName:null,hierarchyUniqueName:function(a){if(arguments.length===1){this._hierarchyUniqueName=a;return a}else{return this._hierarchyUniqueName}},_levelNumber:0,levelNumber:function(a){if(arguments.length===1){this._levelNumber=a;return a}else{return this._levelNumber}},_displayInfo:0,displayInfo:function(a){if(arguments.length===1){this._displayInfo=a;return a}else{return this._displayInfo}},e:function(){return $o(this.displayInfo(),~65536)&~131072},drilledDown:function(){return(this.displayInfo()&65536)==65536},parentSameAsPrev:function(){return(this.displayInfo()&131072)==131072},_properties:null,properties:function(a){if(arguments.length===1){this._properties=a;return a}else{return this._properties}},_position:null,position:function(a){if(arguments.length===1){this._position=a;return a}else{return this._position}},key:function(){return this.uniqueName()},sortKey:function(){if(this.ordinal()>-1){return this.ordinal()}if(this.caption().contains("/")){return this.caption()}var a=parseFloat(this.caption());if(!isNaN(a)){return a}return this.caption()},_ordinal:0,ordinal:function(a){if(arguments.length===1){this._ordinal=a;return a}else{return this._ordinal}},hierarchyKey:function(){return this.hierarchyUniqueName()},hierarchyLevelKey:function(){return this.levelUniqueName()},parentKey:function(){var a;var b=this.properties().tryGetValue("PARENT_UNIQUE_NAME",a);a=b.p1;return a},depth:function(){return this.levelNumber()},isExpandable:function(){return this.e()>0},clone:function(){var a=new $$t.c0;a.caption(this.caption());a.displayInfo(this.displayInfo());a.hierarchyUniqueName(this.hierarchyUniqueName());a.levelNumber(this.levelNumber());a.levelUniqueName(this.levelUniqueName());a.ordinal(this.ordinal());var c=this.properties().getEnumerator();while(c.moveNext()){var b=c.current();a.properties().add(b.key(),b.value())}a.uniqueName(this.uniqueName());a.position(this.position());return a},$type:new $.ig.Type("OlapResultAxisMember",$.ig.$ot,[$$t.$cl.$type.specialize(String,$.ig.$op.$type)])},true);$c("OlapResultCell:c3","Object",{init:function(){$.ig.$op.init.call(this);this.properties(new $$t.b9(String,$.ig.$op.$type,0))},_cellOrdinal:0,cellOrdinal:function(a){if(arguments.length===1){this._cellOrdinal=a;return a}else{return this._cellOrdinal}},_properties:null,properties:function(a){if(arguments.length===1){this._properties=a;return a}else{return this._properties}},clone:function(){var $self=this;var a=function(){var $ret=new $$t.c3;$ret.cellOrdinal($self.cellOrdinal());return $ret}();var c=this.properties().getEnumerator();while(c.moveNext()){var b=c.current();a.properties().add(b.key(),b.value())}return a},$type:new $.ig.Type("OlapResultCell",$.ig.$ot)},true);$c("ArrayListCollection___Enumerate__IteratorClass$1","Object",{$t:null,c:0,b:null,d:0,__4__this:null,init:function($t,a){this.$t=$t;if(!this.hasOwnProperty("$type")){this.$type=this.$type.specialize(this.$t)}$.ig.$op.init.call(this);this.c=a},moveNext:function(){while(this.c>=0){switch(this.c){case 0:this.c=-1;this.d=0;this.c=1;break;case 1:this.c=-1;if(this.d<this.__4__this.inner().length){this.b=$v(this.$t,this.__4__this.inner()[this.d]);this.c=2;return true}break;case 2:this.c=-1;this.d++;this.c=1;break}}return false},getEnumerator:function(){var d__;if(this.c==-2){this.c=0;d__=this}else{d__=new $.ig.ArrayListCollection___Enumerate__IteratorClass$1(this.$t,0);d__.__4__this=this.__4__this}return d__},reset:function(){throw new $$t.y(0)},dispose:function(){},current:function(){return this.b},current1:function(){return $e(this.$t,this.b)},$type:new $.ig.Type("ArrayListCollection___Enumerate__IteratorClass$1",$.ig.$ot,[$$t.$ap.$type.specialize(0),$$t.$w.$type,$$t.$aq.$type.specialize(0),$$t.$x.$type,$$t.$ar.$type])},true)})($);/*!@license
* Infragistics.Web.ClientUI infragistics.olapxmladatasource.js 21.2.20212.99
*
* Copyright (c) 2011-2022 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends:
*     jquery-1.4.4.js
*     jquery.ui.core.js
*     jquery.ui.widget.js
*     infragistics.util.js
*     infragistics.ext_core.js
*     infragistics.ext_collections.js
*     infragistics.ext_collectionsExtended.js
*     infragistics.ext_text.js
*     infragistics.ext_threading.js
*     infragistics.ext_web.js
*     infragistics.ext_xml.js
*     infragistics.olap.js
*/
(function($){$.ig=$.ig||{};var $$t={};$.ig.$currDefinitions=$$t;$.ig.util.bulkDefine(["IRemoteRequestSerializer:a","String:b","Object:c","Type:d","Boolean:e","ValueType:f","Void:g","IConvertible:h","IFormatProvider:i","Number:j","NumberStyles:k","Enum:l","Array:m","IList:n","ICollection:o","IEnumerable:p","IEnumerator:q","Number:r","IComparable:s","IComparable$1:t","IEquatable$1:u","Number:v","Number:w","Number:x","Error:y","Error:z","Number:aa","String:ab","Date:ac","Number:ad","DayOfWeek:ae","DateTimeKind:af","Number:ag","Number:ah","Number:ai","Number:aj","Number:ak","Number:al","Assembly:am","Stream:an","IDisposable:ao","SeekOrigin:ap","RuntimeTypeHandle:aq","MethodInfo:ar","MethodBase:as","MemberInfo:at","ParameterInfo:au","TypeCode:av","ConstructorInfo:aw","PropertyInfo:ax","StringComparison:ay","RegExp:az","CultureInfo:a0","DateTimeFormat:a1","Calendar:a2","CalendarWeekRule:a3","NumberFormatInfo:a4","CompareInfo:a5","CompareOptions:a6","IEnumerable$1:a7","IEnumerator$1:a8","StringSplitOptions:a9","RemoteRequest:ba","RemoteRequestType:bb","Dictionary$2:bc","IDictionary$2:bd","ICollection$1:be","KeyValuePair$2:bf","IDictionary:bg","Script:bh","IEqualityComparer$1:bi","EqualityComparer$1:bj","IEqualityComparer:bk","DefaultEqualityComparer$1:bl","InvalidOperationException:bm","NotImplementedException:bn","ArgumentException:bo","Thread:bp","ThreadStart:bq","MulticastDelegate:br","IntPtr:bs","IRemoteResponseSerializer:bt","JsonRemoteRequestSerializer:bu","JavaScriptSerializer:bv","RemoteRequestJsonTypeSeriazlier:bw","JsonTypeSeriazlierBase$1:bx","IJsonTypeSerializer$1:by","JsonSerializerUtils:bz","jQueryUtils:b0","JsonRemoteResponseSerializer:b1","ArrayJsonSerializer:b2","IList$1:b3","List$1:b4","IArray:b5","IArrayList:b6","Array:b7","CompareCallback:b8","Func$3:b9","Action$1:ca","Comparer$1:cb","IComparer:cc","IComparer$1:cd","DefaultComparer$1:ce","Comparison$1:cf","ReadOnlyCollection$1:cg","Predicate$1:ch","Enumerable:ci","Func$2:cj","IOrderedEnumerable$1:ck","SortedList$1:cl","Math:cm","ArgumentNullException:cn","Catalog:co","ICoreOlapElement:cp","CatalogJsonTypeSeriazlier:cq","Cube:cr","CubeType:cs","CubeJsonTypeSeriazlier:ct","Dimension:cu","DimensionType:cv","DimensionJsonTypeSeriazlier:cw","Hierarchy:cx","HierarchyOrigin:cy","HierarchyJsonTypeSeriazlier:cz","Level:c0","LevelJsonTypeSeriazlier:c1","Measure:c2","AggregatorType:c3","MeasureJsonTypeSeriazlier:c4","MeasureGroup:c5","MeasureGroupJsonTypeSeriazlier:c6","MeasureGroupDimension:c7","CardinalityType:c8","MeasureGroupDimensionJsonTypeSeriazlier:c9","Member:da","MemberType:db","Nullable$1:dc","MemberJsonTypeSeriazlier:dd","Kpi:de","KpiJsonTypeSeriazlier:df","ResultJsonTypeSeriazlier:dg","OlapResult:dh","OlapResultAxis:di","PositionResolver$2:dj","IPosition$2:dk","IPositionItem$2:dl","PositionItemInfo$2:dm","IHierarchicalPositionItem$2:dn","EventHandler$1:dp","AsyncCompletedEventArgs:dq","EventArgs:dr","Delegate:ds","Interlocked:dt","ListSortDirection:du","OlapResultTuple:dv","OlapResultAxisMember:dw","StringBuilder:dx","Environment:dy","OlapResultCell:dz","AxisJsonTypeSeriazlier:d0","TupleJsonTypeSeriazlier:d1","AxisMemberJsonTypeSeriazlier:d2","CellJsonTypeSeriazlier:d3","MdxDataSourceImpl:d4","OlapDataSource:d5","IOlapDataSource:d6","OlapMetadataTreeItem:d7","OlapMetadataTreeItemType:d8","MeasureListLocation:d9","ArrayListCollection$1:ea","INotifyCollectionChanged:eb","NotifyCollectionChangedEventHandler:ec","NotifyCollectionChangedEventArgs:ed","NotifyCollectionChangedAction:ee","Task$1:ef","Task:eg","JQueryPromise:eh","Action:ei","AggregateException:ej","TaskStatus:ek","TaskCompletionSource$1:el","JQueryDeferred:em","JQuery:en","JQueryObject:eo","Element:ep","Node:eq","ElementAttributeCollection:er","ElementCollection:es","WebStyle:et","ElementNodeType:eu","document:ev","EventListener$1:ew","Event:ex","DOMTokenList:ey","EventListener:ez","IElementEventHandler:e0","ElementEventHandler:e1","ElementAttribute:e2","JQueryPosition:e3","JQueryCallback:e4","JQueryEvent:e5","JQueryUICallback:e6","DataSourceBaseOptions:e7","IOlapDataProviderFactory:e8","IOlapDiscoverDataProvider:e9","KeyValueItem:fa","OlapResultView:fb","PositionInfo:fc","ResultViewHelper:fd","IPostionComparer:fe","CubeMetaItemsCache:ff","KpiMeasure:fg","MeasureGroupMetaItemsCache:fh","Tuple$2:fi","AxisElement:fj","MeasureList:fk","TaskFactory:fl","TaskExtensions:fm","AxisDefinitionParser:fn","MetaTreeHelper:fo","HierarchyItemPosition:fp","KpiDimension:fq","ArgumentOutOfRangeException:fr","MdxDataSourceOptions:fs","MdxSettings:ft","MdxDimensionAxisSettings:fu","MdxAxisSettings:fv","MdxSetSettings:fw","MdxSlicerAxisSettings:fx","ObservableCollection$1:fy","INotifyPropertyChanged:fz","PropertyChangedEventHandler:f0","PropertyChangedEventArgs:f1","MdxDimensionAxisProvider:f2","IMdxDimensionAxisProvider:f3","IMdxAxisProvider:f4","IMdxAxis:f5","IMdxExpression:f6","IMdxSet:f7","IMdxElement:f8","MdxElementType:f9","MdxElementCollectionElement:ga","IMdxCollectionElement:gb","MdxAxis:gc","MdxSet:gd","MdxSingleElement:ge","MdxElement:gf","IMdxItemElement:gg","MdxLevelMembersElement:gh","MdxChildrenCollectionElement:gi","MdxDimensionMember:gj","MdxSlicerAxisProvider:gk","MdxSlicerAxis:gl","IMdxSlicerAxis:gm","IMdxExtendedFilterInfo:gn","IMdxFilterInfo:go","IAxisFilterElement:gp","MdxSlicerAxisBuilder:gq","MdxAxisFilterElement:gr","MdxSlicerSet:gs","MdxQueryBuilder:gt","MdxCalculatedMembersCache:gu","IOlapExecuteCommandProvider:gv","DiscoverResponseResult:gw","XmlaSoapMethodResult:gx","IXmlaMethodResult:gy","XElement:gz","XContainer:g0","XNode:g1","XObject:g2","XmlNode:g3","XmlNodeList:g4","XmlNamedNodeMap:g5","XmlNodeType:g6","XmlDocument:g7","XmlElement:g8","XmlLinkedNode:g9","XmlAttribute:ha","XmlUtils:hb","XName:hc","XNamespace:hd","XDocument:he","XAttribute:hf","XmlaSoapMessageHeader:hg","FaultError:hh","RequestCompletedEventArgs$1:hi","ExecuteResponseResult:hj","FaultDetail:hk","IXmlaSoapMethod:hl","XmlaPropertiesCollection:hm","XmlaQueryProperty:hn","XmlaNamespace:ho","XmlaSoapFault:hp","XmlaSoapMessageBuilder:hq","XmlaSoapMethod:hr","XmlaSoapMethodDiscover:hs","XmlaSoapMethodExecute:ht","XmlaSoapWebClient:hu","XmlaSoapWebClient$1:hv","ICredentials:hw","NetworkCredential:hx","Uri:hy","UriKind:hz","Encoding:h0","UTF8Encoding:h1","Decoder:h2","UnicodeEncoding:h3","AsciiEncoding:h4","DefaultDecoder:h5","WebClient:h6","WebHeaderCollection:h7","NameValueCollection:h8","UploadStringCompletedEventHandler:h9","UploadStringCompletedEventArgs:ia","UploadDataCompletedEventHandler:ib","UploadDataCompletedEventArgs:ic","XmlaSoapFaultXmlTypeSerializer:id","IXmlTypeSerializer$1:ie","ErrorXmlTypeSerializer:ig","SerializerUtils:ih","FaultReason:ii","FaultCode:ij","FaultException$1:ik","FaultException:il","Session:im","IMdxCalculatedMembersCacheProvider:io","IMdxQuery:ip","MdxConstantElement:iq","MdxDimensionAxisCreateMode:ir","DefaultXmlaDataProviderFactory:is","IXmlaDataProviderFactory:it","XmlaConnection:iu","ICoreXmlaConnection:iv","IConnection:iw","XmlaDataProvider:ix","IXmlaDataProvider:iy","DatabaseXmlTypeSerializer:iz","CubeXmlTypeSerializer:i0","DimensionXmlTypeSerializer:i1","HierarchyXmlTypeSerializer:i2","LevelXmlTypeSerializer:i3","MeasureXmlTypeSerializer:i4","MeasureGroupXmlTypeSerializer:i5","MeasureGroupDimensionXmlTypeSerializer:i6","MemberXmlTypeSerializer:i7","KpiXmlTypeSerializer:i8","ResultXmlTypeSerializer:i9","ArraySerializer:ja","AxisXmlTypeSerializer:jb","TupleXmlTypeSerializer:jc","AxisMemberXmlTypeSerializer:jd","CellXmlTypeSerializer:je","RemoteXmlaDataProviderFactory:jf","RemoteXmlaDataProvder:jg","XmlaDataSourceImpl:jh","XmlaDataSourceOptions:ji","RequestOptions:jj","XmlaDiscoverProperties:jk","XmlaSampleClass:jl","CustomRemoteXmlaRequestSerializer:jm","CustomRemoteXmlaResponseSerializer:jn","OlapXmlaDataSource:jo","DataSourceBase:jp","XmlaConstants:jq","CubeConstants:jr","DimensionConstants:js","HierarchyConstants:jt","InstanceConstants:ju","KpiConstants:jv","LevelConstants:jw","MeasureConstants:jx","MeasureGroupConstants:jy","MeasureGroupDimensionConstants:jz","MemberConstants:j0","OlapSchemaConstants:j1","CubeRestrictions:j2","DimensionRestrictions:j3","HierarchyRestrictions:j4","KpiRestrictions:j5","LevelRestrictions:j6","MeasureRestrictions:j7","MeasureGroupRestrictions:j8","MeasureGroupDimensionRestrictions:j9","MemberRestrictions:ka","CatalogConstants:kb","ColumnsConstants:kc","ProviderTypeConstants:kd","TableConstants:ke","DbSchemaConstants:kf","CatalogRestrictions:kg","ColumnsRestrictions:kh","ProviderTypeRestrictions:ki","TableRestrictions:kj","AbstractEnumerable:kk","Func$1:kl","AbstractEnumerator:km","GenericEnumerable$1:kn","GenericEnumerator$1:ko"]);var $a=$.ig.intDivide,$b=$.ig.util.cast,$c=$.ig.util.defType,$d=$.ig.util.defEnum,$e=$.ig.util.getBoxIfEnum,$f=$.ig.util.getDefaultValue,$g=$.ig.util.getEnumValue,$h=$.ig.util.getValue,$i=$.ig.util.intSToU,$j=$.ig.util.nullableEquals,$k=$.ig.util.nullableIsNull,$l=$.ig.util.nullableNotEquals,$m=$.ig.util.toNullable,$n=$.ig.util.toString$1,$o=$.ig.util.u32BitwiseAnd,$p=$.ig.util.u32BitwiseOr,$q=$.ig.util.u32BitwiseXor,$r=$.ig.util.u32LS,$s=$.ig.util.unwrapNullable,$t=$.ig.util.wrapNullable,$u=String.fromCharCode,$v=$.ig.util.castObjTo$t,$w=$.ig.util.compare,$x=$.ig.util.replace,$y=$.ig.util.stringFormat,$z=$.ig.util.stringFormat1,$0=$.ig.util.stringFormat2,$1=$.ig.util.stringCompare1,$2=$.ig.util.stringCompare2,$3=$.ig.util.stringCompare3,$4=$.ig.util.equalsSimple,$5=$.ig.util.compareSimple,$6=$.ig.util.numberToString,$7=$.ig.util.tryParseInt32_1,$8=$.ig.util.tryParseInt32_2,$9=$.ig.util.intToString1,$aa=$.ig.util.parseInt32_1,$ab=$.ig.util.parseInt32_2;$d("MdxDimensionAxisCreateMode:ir",false,false,{Create:0,Extend:1,Change:2});$d("MdxElementType:f9",false,false,{Member:0,MemberTree:1,Calculated:2,Filter:3,Collection:4,UserDefined:5});$d("XmlaSoapMessageHeader:hg",false,false,{None:0,Session:1,BeginSession:2,EndSession:3});$d("RemoteRequestType:bb",false,false,{DiscoverCatalogs:0,DiscoverCubes:1,DiscoverDimensions:2,DiscoverHierarchies:3,DiscoverLevels:4,DiscoverMeasures:5,DiscoverMeasureGroups:6,DiscoverMeasureGroupDimensions:7,DiscoverMembers:8,DiscoverKpis:9,ExecuteStatement:10});$c("IRemoteRequestSerializer:a","Object",{$type:new $.ig.Type("IRemoteRequestSerializer",null)},true);$c("IRemoteResponseSerializer:bt","Object",{$type:new $.ig.Type("IRemoteResponseSerializer",null)},true);$c("JsonRemoteRequestSerializer:bu","Object",{a:null,init:function(){$.ig.$op.init.call(this);this.a=new $$t.bv},serializeRequest:function(a){return $$t.$bw.instance().serialize(a,this.a)},deserializeRequest:function(a){return $$t.$bw.instance().deserialize(a,this.a)},$type:new $.ig.Type("JsonRemoteRequestSerializer",$.ig.$ot,[$$t.$a.$type])},true);$c("JsonRemoteResponseSerializer:b1","Object",{a:null,init:function(){$.ig.$op.init.call(this);this.a=new $$t.bv},serializeResponse:function(a,b){switch(b){case 0:return $$t.$b2.c().f($$t.$co.$type,a,$$t.$cq.instance(),this.a);case 1:return $$t.$b2.c().f($$t.$cr.$type,a,$$t.$ct.instance(),this.a);case 2:return $$t.$b2.c().f($$t.$cu.$type,a,$$t.$cw.instance(),this.a);case 3:return $$t.$b2.c().f($$t.$cx.$type,a,$$t.$cz.instance(),this.a);case 4:return $$t.$b2.c().f($$t.$c0.$type,a,$$t.$c1.instance(),this.a);case 5:return $$t.$b2.c().f($$t.$c2.$type,a,$$t.$c4.instance(),this.a);case 6:return $$t.$b2.c().f($$t.$c5.$type,a,$$t.$c6.instance(),this.a);case 7:return $$t.$b2.c().f($$t.$c7.$type,a,$$t.$c9.instance(),this.a);case 8:return $$t.$b2.c().f($$t.$da.$type,a,$$t.$dd.instance(),this.a);case 9:return $$t.$b2.c().f($$t.$de.$type,a,$$t.$df.instance(),this.a);case 10:return $$t.$dg.instance().serialize(a,this.a);default:throw new $$t.z(1,"Unknown RemoteXmlaRequestType.")}},deserializeResponse:function(a,b){switch(b){case 0:return $$t.$b2.c().d($$t.$co.$type,a,$$t.$cq.instance(),this.a);case 1:return $$t.$b2.c().d($$t.$cr.$type,a,$$t.$ct.instance(),this.a);case 2:return $$t.$b2.c().d($$t.$cu.$type,a,$$t.$cw.instance(),this.a);case 3:return $$t.$b2.c().d($$t.$cx.$type,a,$$t.$cz.instance(),this.a);case 4:return $$t.$b2.c().d($$t.$c0.$type,a,$$t.$c1.instance(),this.a);case 5:return $$t.$b2.c().d($$t.$c2.$type,a,$$t.$c4.instance(),this.a);case 6:return $$t.$b2.c().d($$t.$c5.$type,a,$$t.$c6.instance(),this.a);case 7:return $$t.$b2.c().d($$t.$c7.$type,a,$$t.$c9.instance(),this.a);case 8:return $$t.$b2.c().d($$t.$da.$type,a,$$t.$dd.instance(),this.a);case 9:return $$t.$b2.c().d($$t.$de.$type,a,$$t.$df.instance(),this.a);case 10:return $$t.$dg.instance().deserialize(a,this.a);default:throw new $$t.z(1,"Unknown RemoteXmlaRequestType.")}},$type:new $.ig.Type("JsonRemoteResponseSerializer",$.ig.$ot,[$$t.$bt.$type])},true);$c("ArrayJsonSerializer:b2","Object",{init:function(){$.ig.$op.init.call(this)},c:function(){return $$t.$b2.b},d:function($t,a,b,c){var d=c.a(a);return this.e($t,d,b)},f:function($t,a,b,c){var d=this.a($t,a,b);return c.b(d)},e:function($t,a,b){var c=new $$t.b4($t,0);for(var d=0;d<a.length;d++){var e=a[d];c.add(b.fromJsonObject(e))}return c},a:function($t,a,b){var c=$$t.$ci.a($t,a);var d=new Array(c.length);for(var e=0;e<c.length;e++){d[e]=b.toJsonObject(c[e])}return d},$type:new $.ig.Type("ArrayJsonSerializer",$.ig.$ot)},true);$c("IJsonTypeSerializer$1:by","Object",{$type:new $.ig.Type("IJsonTypeSerializer$1",null)},true);$c("JsonTypeSeriazlierBase$1:bx","Object",{$t:null,init:function($t){this.$t=$t;if(!this.hasOwnProperty("$type")){this.$type=this.$type.specialize(this.$t)}$.ig.$op.init.call(this)},deserialize:function(a,b){return this.fromJsonObject(b.a(a))},serialize:function(a,b){return b.b(this.toJsonObject(a))},fromJsonObject:function(a){},toJsonObject:function(a){},$type:new $.ig.Type("JsonTypeSeriazlierBase$1",$.ig.$ot,[$$t.$by.$type.specialize(0)])},true);$c("AxisJsonTypeSeriazlier:d0","JsonTypeSeriazlierBase$1",{init:function(){$$t.$bx.init.call(this,$$t.$di.$type)},instance:function(){return $$t.$d0.a},fromJsonObject:function(a){var b=$$t.$bz.d(a,"n");var c=$$t.$b2.c().e($$t.$dv.$type,$$t.$bz.d(a,"t"),$$t.$d1.instance());var d=0;if(c.count()>0){d=c.item(0).members().count()}return function(){var $ret=new $$t.di(c,d);$ret.name(b);return $ret}()},toJsonObject:function(a){var b=$$t.$b2.c().a($$t.$dv.$type,a.tuples(),$$t.$d1.instance());var c=$$t.$bz.c();$$t.$bz.f(c,"n",a.name());$$t.$bz.f(c,"t",b);return c},$type:new $.ig.Type("AxisJsonTypeSeriazlier",$$t.$bx.$type.specialize($$t.$di.$type))},true);$c("AxisMemberJsonTypeSeriazlier:d2","JsonTypeSeriazlierBase$1",{init:function(){$$t.$bx.init.call(this,$$t.$dw.$type)},instance:function(){return $$t.$d2.a},fromJsonObject:function(a){return function(){var $ret=new $$t.dw;$ret.hierarchyUniqueName($$t.$bz.d(a,"hun"));$ret.uniqueName($$t.$bz.d(a,"un"));$ret.levelUniqueName($$t.$bz.d(a,"lun"));$ret.caption($$t.$bz.d(a,"c"));$ret.levelNumber($h($$t.$bz.d(a,"ln")));$ret.displayInfo($h($$t.$bz.d(a,"di")));$ret.properties($$t.$bz.b(a,"p"));return $ret}()},toJsonObject:function(a){var b=$$t.$bz.c();$$t.$bz.f(b,"hun",a.hierarchyUniqueName());$$t.$bz.f(b,"un",a.uniqueName());$$t.$bz.f(b,"lun",a.levelUniqueName());$$t.$bz.f(b,"c",a.caption());$$t.$bz.f(b,"ln",a.levelNumber());$$t.$bz.f(b,"di",a.displayInfo());$$t.$bz.g(b,"p",a.properties());return b},$type:new $.ig.Type("AxisMemberJsonTypeSeriazlier",$$t.$bx.$type.specialize($$t.$dw.$type))},true);$c("CatalogJsonTypeSeriazlier:cq","JsonTypeSeriazlierBase$1",{init:function(){$$t.$bx.init.call(this,$$t.$co.$type)},instance:function(){return $$t.$cq.a},fromJsonObject:function(a){return function(){var $ret=new $$t.co;$ret.caption($$t.$bz.d(a,"c"));$ret.description($$t.$bz.d(a,"d"));$ret.name($$t.$bz.d(a,"n"));$ret.uniqueName($$t.$bz.d(a,"un"));return $ret}()},toJsonObject:function(a){var b=$$t.$bz.c();$$t.$bz.f(b,"c",a.caption());$$t.$bz.f(b,"d",a.description());$$t.$bz.f(b,"n",a.name());$$t.$bz.f(b,"un",a.uniqueName());return b},$type:new $.ig.Type("CatalogJsonTypeSeriazlier",$$t.$bx.$type.specialize($$t.$co.$type))},true);$c("CellJsonTypeSeriazlier:d3","JsonTypeSeriazlierBase$1",{init:function(){$$t.$bx.init.call(this,$$t.$dz.$type)},instance:function(){return $$t.$d3.a},fromJsonObject:function(a){return function(){var $ret=new $$t.dz;$ret.cellOrdinal($h($$t.$bz.d(a,"co")));$ret.properties($$t.$bz.a(a,"p"));return $ret}()},toJsonObject:function(a){var b=$$t.$bz.c();$$t.$bz.f(b,"co",a.cellOrdinal());$$t.$bz.e(b,"p",a.properties());return b},$type:new $.ig.Type("CellJsonTypeSeriazlier",$$t.$bx.$type.specialize($$t.$dz.$type))},true);$c("CubeJsonTypeSeriazlier:ct","JsonTypeSeriazlierBase$1",{init:function(){$$t.$bx.init.call(this,$$t.$cr.$type)},instance:function(){return $$t.$ct.a},fromJsonObject:function(a){return function(){var $ret=new $$t.cr;$ret.caption($$t.$bz.d(a,"c"));$ret.description($$t.$bz.d(a,"d"));$ret.name($$t.$bz.d(a,"n"));$ret.catalogName($$t.$bz.d(a,"cn"));$ret.cubeType($g($$t.$bz.d(a,"ct")));$ret.lastProcessed($$t.$bz.d(a,"lp"));$ret.lastUpdated($$t.$bz.d(a,"lu"));return $ret}()},toJsonObject:function(a){var b=$$t.$bz.c();$$t.$bz.f(b,"c",a.caption());$$t.$bz.f(b,"d",a.description());$$t.$bz.f(b,"n",a.name());$$t.$bz.f(b,"cn",a.catalogName());$$t.$bz.f(b,"ct",$$t.$cs.getBox(a.cubeType()));$$t.$bz.f(b,"lp",a.lastProcessed());$$t.$bz.f(b,"lu",a.lastUpdated());return b},$type:new $.ig.Type("CubeJsonTypeSeriazlier",$$t.$bx.$type.specialize($$t.$cr.$type))},true);$c("DimensionJsonTypeSeriazlier:cw","JsonTypeSeriazlierBase$1",{init:function(){$$t.$bx.init.call(this,$$t.$cu.$type)},instance:function(){return $$t.$cw.a},fromJsonObject:function(a){return function(){var $ret=new $$t.cu;$ret.caption($$t.$bz.d(a,"c"));$ret.description($$t.$bz.d(a,"d"));$ret.name($$t.$bz.d(a,"n"));$ret.uniqueName($$t.$bz.d(a,"un"));$ret.dimensionType($g($$t.$bz.d(a,"dt")));return $ret}()},toJsonObject:function(a){var b=$$t.$bz.c();$$t.$bz.f(b,"c",a.caption());$$t.$bz.f(b,"d",a.description());$$t.$bz.f(b,"n",a.name());$$t.$bz.f(b,"un",a.uniqueName());$$t.$bz.f(b,"dt",$$t.$cv.getBox(a.dimensionType()));return b},$type:new $.ig.Type("DimensionJsonTypeSeriazlier",$$t.$bx.$type.specialize($$t.$cu.$type))},true);$c("HierarchyJsonTypeSeriazlier:cz","JsonTypeSeriazlierBase$1",{init:function(){$$t.$bx.init.call(this,$$t.$cx.$type)},instance:function(){return $$t.$cz.a},fromJsonObject:function(a){return function(){var $ret=new $$t.cx;$ret.caption($$t.$bz.d(a,"c"));$ret.description($$t.$bz.d(a,"d"));$ret.name($$t.$bz.d(a,"n"));$ret.uniqueName($$t.$bz.d(a,"un"));$ret.allMember($$t.$bz.d(a,"am"));$ret.defaultMember($$t.$bz.d(a,"dm"));$ret.dimensionUniqueName($$t.$bz.d(a,"dun"));$ret.hierarchyDisplayFolder($$t.$bz.d(a,"hdf"));$ret.hierarchyOrigin($g($$t.$bz.d(a,"ho")));return $ret}()},toJsonObject:function(a){var b=$$t.$bz.c();$$t.$bz.f(b,"c",a.caption());$$t.$bz.f(b,"d",a.description());$$t.$bz.f(b,"n",a.name());$$t.$bz.f(b,"un",a.uniqueName());$$t.$bz.f(b,"am",a.allMember());$$t.$bz.f(b,"dm",a.defaultMember());$$t.$bz.f(b,"dun",a.dimensionUniqueName());$$t.$bz.f(b,"hdf",a.hierarchyDisplayFolder());$$t.$bz.f(b,"ho",$$t.$cy.getBox(a.hierarchyOrigin()));return b},$type:new $.ig.Type("HierarchyJsonTypeSeriazlier",$$t.$bx.$type.specialize($$t.$cx.$type))},true);$c("JsonSerializerUtils:bz","Object",{init:function(){$.ig.$op.init.call(this)},c:function(){return $$t.$b0.createJavascriptObject()},d:function(a,b){return $$t.$b0.getJavascriptObjectProperty(a,b)},f:function(a,b,c){$$t.$b0.setJavascriptObjectProperty(a,b,c)},a:function(a,b){return $$t.$b0.convertToObjectDictionary($$t.$b0.getJavascriptObjectProperty(a,b))},e:function(a,b,c){var d=$$t.$b0.convertFromObjectDictionary(c);$$t.$b0.setJavascriptObjectProperty(a,b,d)},b:function(a,b){return $$t.$b0.convertToStringDictionary($$t.$b0.getJavascriptObjectProperty(a,b))},g:function(a,b,c){var d=$$t.$b0.convertFromStringDictionary(c);$$t.$b0.setJavascriptObjectProperty(a,b,d)},$type:new $.ig.Type("JsonSerializerUtils",$.ig.$ot)},true);$c("KpiJsonTypeSeriazlier:df","JsonTypeSeriazlierBase$1",{init:function(){$$t.$bx.init.call(this,$$t.$de.$type)},instance:function(){return $$t.$df.a},fromJsonObject:function(a){return function(){var $ret=new $$t.de;$ret.caption($$t.$bz.d(a,"c"));$ret.description($$t.$bz.d(a,"d"));$ret.name($$t.$bz.d(a,"n"));$ret.uniqueName($$t.$bz.d(a,"un"));$ret.kpiDisplayFolder($$t.$bz.d(a,"kdf"));$ret.measureGroupName($$t.$bz.d(a,"mgn"));$ret.kpiStatusGraphic($$t.$bz.d(a,"ksg"));$ret.kpiTrendGraphic($$t.$bz.d(a,"ktg"));$ret.parentKpiName($$t.$bz.d(a,"pkn"));$ret.kpiGoal($$t.$bz.d(a,"kg"));$ret.kpiStatus($$t.$bz.d(a,"ks"));$ret.kpiTrend($$t.$bz.d(a,"kt"));$ret.kpiValue($$t.$bz.d(a,"kv"));$ret.kpiWeight($$t.$bz.d(a,"kw"));return $ret}()},toJsonObject:function(a){var b=$$t.$bz.c();$$t.$bz.f(b,"c",a.caption());$$t.$bz.f(b,"d",a.description());$$t.$bz.f(b,"n",a.name());$$t.$bz.f(b,"un",a.uniqueName());$$t.$bz.f(b,"kdf",a.kpiDisplayFolder());$$t.$bz.f(b,"mgn",a.measureGroupName());$$t.$bz.f(b,"ksg",a.kpiStatusGraphic());$$t.$bz.f(b,"ktg",a.kpiTrendGraphic());$$t.$bz.f(b,"pkn",a.parentKpiName());$$t.$bz.f(b,"kg",a.kpiGoal());$$t.$bz.f(b,"ks",a.kpiStatus());$$t.$bz.f(b,"kt",a.kpiTrend());$$t.$bz.f(b,"kv",a.kpiValue());$$t.$bz.f(b,"kw",a.kpiWeight());return b},$type:new $.ig.Type("KpiJsonTypeSeriazlier",$$t.$bx.$type.specialize($$t.$de.$type))},true);$c("LevelJsonTypeSeriazlier:c1","JsonTypeSeriazlierBase$1",{init:function(){$$t.$bx.init.call(this,$$t.$c0.$type)},instance:function(){return $$t.$c1.a},fromJsonObject:function(a){return function(){var $ret=new $$t.c0;$ret.caption($$t.$bz.d(a,"c"));$ret.description($$t.$bz.d(a,"d"));$ret.name($$t.$bz.d(a,"n"));$ret.uniqueName($$t.$bz.d(a,"un"));$ret.depth($h($$t.$bz.d(a,"d")));$ret.dimensionUniqueName($$t.$bz.d(a,"dun"));$ret.hierarchyUniqueName($$t.$bz.d(a,"hun"));$ret.levelOrderingProperty($$t.$bz.d(a,"lop"));$ret.levelOrigin($h($$t.$bz.d(a,"lo")));$ret.membersCount($h($$t.$bz.d(a,"mc")));return $ret}()},toJsonObject:function(a){var b=$$t.$bz.c();$$t.$bz.f(b,"c",a.caption());$$t.$bz.f(b,"d",a.description());$$t.$bz.f(b,"n",a.name());$$t.$bz.f(b,"un",a.uniqueName());$$t.$bz.f(b,"d",a.depth());$$t.$bz.f(b,"dun",a.dimensionUniqueName());$$t.$bz.f(b,"hun",a.hierarchyUniqueName());$$t.$bz.f(b,"lop",a.levelOrderingProperty());$$t.$bz.f(b,"lo",a.levelOrigin());$$t.$bz.f(b,"mc",a.membersCount());return b},$type:new $.ig.Type("LevelJsonTypeSeriazlier",$$t.$bx.$type.specialize($$t.$c0.$type))},true);$c("MeasureGroupDimensionJsonTypeSeriazlier:c9","JsonTypeSeriazlierBase$1",{init:function(){$$t.$bx.init.call(this,$$t.$c7.$type)},instance:function(){return $$t.$c9.a},fromJsonObject:function(a){return function(){var $ret=new $$t.c7;$ret.catalogName($$t.$bz.d(a,"cn"));$ret.cubeName($$t.$bz.d(a,"cbn"));$ret.dimensionCardinality($g($$t.$bz.d(a,"dc")));$ret.dimensionGranularity($$t.$bz.d(a,"dg"));$ret.dimensionPath($$t.$bz.d(a,"dap"));$ret.dimensionUniqueName($$t.$bz.d(a,"dun"));$ret.isDimensionVisible($$t.$bz.d(a,"idv"));$ret.isFactDimension($$t.$bz.d(a,"iafd"));$ret.measureGroupCardinality($g($$t.$bz.d(a,"mgc")));$ret.measureGroupName($$t.$bz.d(a,"mgn"));return $ret}()},toJsonObject:function(a){var b=$$t.$bz.c();$$t.$bz.f(b,"cn",a.catalogName());$$t.$bz.f(b,"cbn",a.cubeName());$$t.$bz.f(b,"dc",$$t.$c8.getBox(a.dimensionCardinality()));$$t.$bz.f(b,"dg",a.dimensionGranularity());$$t.$bz.f(b,"dap",a.dimensionPath());$$t.$bz.f(b,"dun",a.dimensionUniqueName());$$t.$bz.f(b,"idv",a.isDimensionVisible());$$t.$bz.f(b,"iafd",a.isFactDimension());$$t.$bz.f(b,"mgc",$$t.$c8.getBox(a.measureGroupCardinality()));$$t.$bz.f(b,"mgn",a.measureGroupName());return b},$type:new $.ig.Type("MeasureGroupDimensionJsonTypeSeriazlier",$$t.$bx.$type.specialize($$t.$c7.$type))},true);$c("MeasureGroupJsonTypeSeriazlier:c6","JsonTypeSeriazlierBase$1",{init:function(){$$t.$bx.init.call(this,$$t.$c5.$type)},instance:function(){return $$t.$c6.a},fromJsonObject:function(a){return function(){var $ret=new $$t.c5;$ret.caption($$t.$bz.d(a,"c"));$ret.description($$t.$bz.d(a,"d"));$ret.name($$t.$bz.d(a,"n"));$ret.catalogName($$t.$bz.d(a,"cn"));$ret.cubeName($$t.$bz.d(a,"cbn"));return $ret}()},toJsonObject:function(a){var b=$$t.$bz.c();$$t.$bz.f(b,"c",a.caption());$$t.$bz.f(b,"d",a.description());$$t.$bz.f(b,"n",a.name());$$t.$bz.f(b,"cn",a.catalogName());$$t.$bz.f(b,"cbn",a.cubeName());return b},$type:new $.ig.Type("MeasureGroupJsonTypeSeriazlier",$$t.$bx.$type.specialize($$t.$c5.$type))},true);$c("MeasureJsonTypeSeriazlier:c4","JsonTypeSeriazlierBase$1",{init:function(){$$t.$bx.init.call(this,$$t.$c2.$type)},instance:function(){return $$t.$c4.a},fromJsonObject:function(a){return function(){var $ret=new $$t.c2;$ret.caption($$t.$bz.d(a,"c"));$ret.description($$t.$bz.d(a,"d"));$ret.name($$t.$bz.d(a,"n"));$ret.uniqueName($$t.$bz.d(a,"un"));$ret.aggregatorType($g($$t.$bz.d(a,"at")));$ret.defaultFormatString($$t.$bz.d(a,"dfs"));$ret.measureDisplayFolder($$t.$bz.d(a,"mdf"));$ret.measureGroupName($$t.$bz.d(a,"mgn"));return $ret}()},toJsonObject:function(a){var b=$$t.$bz.c();$$t.$bz.f(b,"c",a.caption());$$t.$bz.f(b,"d",a.description());$$t.$bz.f(b,"n",a.name());$$t.$bz.f(b,"un",a.uniqueName());$$t.$bz.f(b,"at",$$t.$c3.getBox(a.aggregatorType()));$$t.$bz.f(b,"dfs",a.defaultFormatString());$$t.$bz.f(b,"mdf",a.measureDisplayFolder());$$t.$bz.f(b,"mgn",a.measureGroupName());return b},$type:new $.ig.Type("MeasureJsonTypeSeriazlier",$$t.$bx.$type.specialize($$t.$c2.$type))},true);$c("MemberJsonTypeSeriazlier:dd","JsonTypeSeriazlierBase$1",{init:function(){$$t.$bx.init.call(this,$$t.$da.$type)},instance:function(){return $$t.$dd.a},fromJsonObject:function(a){var b=$m($$t.$r.$type,null);var c=$$t.$bz.d(a,"s");return function(){var $ret=new $$t.da;$ret.caption($$t.$bz.d(a,"c"));$ret.description($$t.$bz.d(a,"d"));$ret.name($$t.$bz.d(a,"n"));$ret.uniqueName($$t.$bz.d(a,"un"));$ret.catalogName($$t.$bz.d(a,"cn"));$ret.childrenCardinality($h($$t.$bz.d(a,"cc")));$ret.cubeName($$t.$bz.d(a,"cbn"));$ret.dimensionUniqueName($$t.$bz.d(a,"dun"));$ret.hierarchyUniqueName($$t.$bz.d(a,"hun"));$ret.levelDepth($h($$t.$bz.d(a,"ld")));$ret.levelUniqueName($$t.$bz.d(a,"lun"));$ret.memberType($g($$t.$bz.d(a,"mt")));$ret.parentLevel($h($$t.$bz.d(a,"pl")));$ret.parentUniqueName($$t.$bz.d(a,"pun"));$ret.scope(c==null?b:$m($$t.$r.$type,$$t.$r.parseInt(c)));return $ret}()},toJsonObject:function(a){var b=$$t.$bz.c();$$t.$bz.f(b,"c",a.caption());$$t.$bz.f(b,"d",a.description());$$t.$bz.f(b,"n",a.name());$$t.$bz.f(b,"un",a.uniqueName());$$t.$bz.f(b,"cn",a.catalogName());$$t.$bz.f(b,"cc",a.childrenCardinality());$$t.$bz.f(b,"cbn",a.cubeName());$$t.$bz.f(b,"dun",a.dimensionUniqueName());$$t.$bz.f(b,"hun",a.hierarchyUniqueName());$$t.$bz.f(b,"ld",a.levelDepth());$$t.$bz.f(b,"lun",a.levelUniqueName());$$t.$bz.f(b,"mt",$$t.$db.getBox(a.memberType()));$$t.$bz.f(b,"pl",a.parentLevel());$$t.$bz.f(b,"pun",a.parentUniqueName());$$t.$bz.f(b,"s",$s(a.scope()));return b},$type:new $.ig.Type("MemberJsonTypeSeriazlier",$$t.$bx.$type.specialize($$t.$da.$type))},true);$c("RemoteRequest:ba","Object",{init:function(){$.ig.$op.init.call(this)},_a:0,_c:null,_d:null,_b:null,_e:null,$type:new $.ig.Type("RemoteRequest",$.ig.$ot)},true);$c("RemoteRequestJsonTypeSeriazlier:bw","JsonTypeSeriazlierBase$1",{init:function(){$$t.$bx.init.call(this,$$t.$ba.$type)},instance:function(){return $$t.$bw.a},fromJsonObject:function(a){var b=new $$t.ba;b._a=$g($b($$t.$bc.$type.specialize(String,$.ig.$op.$type),$$t.$bz.d(a,"t")).item("_v"));b._c=$$t.$bz.b(a,"p");b._d=$$t.$bz.b(a,"r");b._b=$$t.$bz.b(a,"par");b._e=$$t.$bz.d(a,"s")!=null?$$t.$bz.d(a,"s"):null;return b},toJsonObject:function(a){var b=$$t.$bz.c();$$t.$bz.f(b,"t",$$t.$bb.getBox(a._a));$$t.$bz.g(b,"p",a._c);$$t.$bz.g(b,"r",a._d);$$t.$bz.g(b,"par",a._b);$$t.$bz.f(b,"s",a._e);return b},$type:new $.ig.Type("RemoteRequestJsonTypeSeriazlier",$$t.$bx.$type.specialize($$t.$ba.$type))},true);$c("ResultJsonTypeSeriazlier:dg","JsonTypeSeriazlierBase$1",{init:function(){$$t.$bx.init.call(this,$$t.$dh.$type)},instance:function(){return $$t.$dg.a},fromJsonObject:function(a){var b=$$t.$bz.d(a,"ie");if(b){return function(){var $ret=new $$t.dh;$ret.isEmpty(true);return $ret}()}else{var c=$$t.$b2.c().e($$t.$di.$type,$$t.$bz.d(a,"a"),$$t.$d0.instance());var d=$$t.$b2.c().e($$t.$dz.$type,$$t.$bz.d(a,"c"),$$t.$d3.instance());return function(){var $ret=new $$t.dh;$ret.axes(c);$ret.cells(d);return $ret}()}},toJsonObject:function(a){var b=$$t.$bz.c();$$t.$bz.f(b,"ie",a.isEmpty());if(!a.isEmpty()){var c=$$t.$b2.c().a($$t.$di.$type,a.axes(),$$t.$d0.instance());var d=$$t.$b2.c().a($$t.$dz.$type,a.cells(),$$t.$d3.instance());$$t.$bz.f(b,"a",c);$$t.$bz.f(b,"c",d)}return b},$type:new $.ig.Type("ResultJsonTypeSeriazlier",$$t.$bx.$type.specialize($$t.$dh.$type))},true);$c("TupleJsonTypeSeriazlier:d1","JsonTypeSeriazlierBase$1",{init:function(){$$t.$bx.init.call(this,$$t.$dv.$type)},instance:function(){return $$t.$d1.a},fromJsonObject:function(a){var b=$$t.$b2.c().e($$t.$dw.$type,$$t.$bz.d(a,"m"),$$t.$d2.instance());var c=new $$t.dv(b);var e=b.getEnumerator();while(e.moveNext()){var d=e.current();d.position(c)}return c},toJsonObject:function(a){var b=$$t.$b2.c().a($$t.$dw.$type,a.members(),$$t.$d2.instance());var c=$$t.$bz.c();$$t.$bz.f(c,"m",b);return c},$type:new $.ig.Type("TupleJsonTypeSeriazlier",$$t.$bx.$type.specialize($$t.$dv.$type))},true);$c("MdxDataSourceImpl:d4","OlapDataSource",{bc:null,bb:false,init:function(a){this.bc=new $$t.b4($$t.$f2.$type,0);$$t.$d5.init.call(this,a);this.mdxSettings(a.mdxSettings());this.mdxSourceOptions(a);this.dataProviderFactory(a.dataProviderFactory());this.bb=true;if(this.mdxSourceOptions()!=null){this.bb=this.mdxSourceOptions().enableResultCache()==true}},_mdxSourceOptions:null,mdxSourceOptions:function(a){if(arguments.length===1){this._mdxSourceOptions=a;return a}else{return this._mdxSourceOptions}},_mdxSettings:null,mdxSettings:function(a){if(arguments.length===1){this._mdxSettings=a;return a}else{return this._mdxSettings}},_catalog:null,catalog:function(a){if(arguments.length===1){this._catalog=a;return a}else{return this._catalog}},setCatalog:function(a){if(!this.isInitialized()){throw new $$t.bm(1,"Data source is not initialized.")}return this.bh(a)},bq:function(a,b){if(a.positionItemIndex()==b){a.clear()}else{var d=a.values().getEnumerator();while(d.moveNext()){var c=d.current();this.bq(c,b)}}},ba:function(a,b,c,d,e){var $self=this;var f=new $$t.b4($$t.$fj.$type,0);var h=c.getEnumerator();while(h.moveNext()){var g=h.current();var i=new $$t.fj(g._b,new $$t.b4(String,0));for(var j=0;j<g._a.count();j++){var k=g._a.item(j);var l;if(function(){var m=$self._c.h(k,l);l=m.p1;return m.ret}()){if(e||l.scope().hasValue()==false){i._a.add(k)}}}f.add(i)}var m=new $$t.b4($$t.$fj.$type,0);var o=b.getEnumerator();while(o.moveNext()){var n=o.current();var p=new $$t.fj(n._b,new $$t.b4(String,0));for(var q=0;q<n._a.count();q++){var r=n._a.item(q);var s;if(function(){var t=$self._c.h(r,s);s=t.p1;return t.ret}()){if(e||s.scope().hasValue()==false){p._a.add(r)}}}m.add(p)}var t=new $$t.b4($$t.$fj.$type,0);var v=a.getEnumerator();while(v.moveNext()){var u=v.current();var w=new $$t.fj(u._b,new $$t.b4(String,0));for(var x=0;x<u._a.count();x++){var y=u._a.item(x);var z;if(function(){var aa=$self._c.h(y,z);z=aa.p1;return aa.ret}()){if(e||z.scope().hasValue()==false){w._a.add(y)}}}t.add(w)}return new $$t.gk(this,t,m,f,d)},getMembersOfLevel:function(a){var $self=this;var b=a;var c=this.getProviderDefaultProperties();var d=this.getProviderDefaultRestrictions();if(d!=null){d.add(function(){var $ret=new $$t.fa;$ret._a="LEVEL_UNIQUE_NAME";$ret._b=a;return $ret}())}var e=this.dataProviderFactory().createDataProvider();var f=e.discoverMembersAsync(c,d);f.j(function(g){var i=g.n().getEnumerator();while(i.moveNext()){var h=i.current();$self._c.aa(h)}$self._c.ac(b)});return f},getMembersOfHierarchy:function(a){var $self=this;var b=a;var c=this.getProviderDefaultProperties();var d=this.getProviderDefaultRestrictions();if(d!=null){d.add(function(){var $ret=new $$t.fa;$ret._a="HIERARCHY_UNIQUE_NAME";$ret._b=a;return $ret}())}var e=this.dataProviderFactory().createDataProvider();var f=e.discoverMembersAsync(c,d);
f.j(function(g){var i=g.n().getEnumerator();while(i.moveNext()){var h=i.current();$self._c.aa(h)}$self._c.ab(b)});return f},getMembersOfMember:function(a){var $self=this;var b=this.getProviderDefaultProperties();var c=this.getProviderDefaultRestrictions();if(c!=null){c.add(function(){var $ret=new $$t.fa;$ret._a="MEMBER_UNIQUE_NAME";$ret._b=a;return $ret}());c.add(function(){var $ret=new $$t.fa;$ret._a="TREE_OP";$ret._b="1";return $ret}())}var d=this.dataProviderFactory().createDataProvider();var e=d.discoverMembersAsync(b,c);$$t.$fm.b($$t.$a7.$type.specialize($$t.$da.$type),$$t.$a7.$type.specialize($$t.$da.$type),e,function(f){return $self.bi(f.n())});return e},bi:function(a){var b=new $$t.b4($$t.$da.$type,0);var d=a.getEnumerator();while(d.moveNext()){var c=d.current();b.add(c);break}if(b.count()>0){var e=b.item(0).levelUniqueName();if(!this._c.c(e)){return this.getMembersOfLevel(e).k($$t.$a7.$type.specialize($$t.$da.$type),function(f){return a})}}var f=new $$t.el($$t.$a7.$type.specialize($$t.$da.$type),0);f.e(a);return f._b},bt:function(a){var $self=this;if(a.isEmpty()){return}var c=a.axes().getEnumerator();while(c.moveNext()){var b=c.current();var d=b.tuples();for(var e=0;e<d.count();e++){var f=d.__inner[e].members();for(var g=0;g<f.count();g++){var h=f.item(g);var i;if(function(){var j=$self._c.i(h.uniqueName(),i);i=j.p1;return j.ret}()){h.ordinal(i)}}}}},bv:function(a,b){var c=0;var d=this.measureListIndex();if(a){var e=this.a8(c);if(e!=null&&this.measureListLocation()==1){if(d>-1){var f=e.rootPositionInfo();if(f!=null){this.bq(f,d-1)}e.q()}}c++}if(b){var g=this.a8(c);if(g!=null&&this.measureListLocation()==0){if(d>-1){var h=g.rootPositionInfo();if(h!=null){this.bq(h,d-1)}g.q()}}}},bu:function(a,b,c){var d=0;if(c){var e=d<a.axes().count()?a.axes().item(d):null;var f=e!=null?this.a8(d):null;if(f!=null){f.rootPositionInfo(e.positionResolver().rootPositionInfo());f.q()}d++}if(b){var g=d<a.axes().count()?a.axes().item(d):null;var h=g!=null?this.a8(d):null;if(h!=null){h.rootPositionInfo(g.positionResolver().rootPositionInfo());h.q()}d++}},bd:function(a,b,c,d){this.bl(a,b,c);var e=new $$t.bc(String,$$t.$e.$type,0);var f=this.ab();d=new $$t.bc(String,$$t.$b3.$type.specialize($$t.$fc.$type),0);for(var g=0;g<f.count();g++){var h=f.item(g);var i;if(!function(){var j=d.tryGetValue(h._c,i);i=j.p1;return j.ret}()){i=new $$t.b4($$t.$fc.$type,0);d.add(h._c,i)}i.add(h);if(this._l==null){this._l=new $$t.fb(this.result(),this.result(),a,b)}var j=this._l.expandTupleMember(h._c,h._b,h._a);if(j==null){e.item(h._c,true)}else{var k=this._l;this._l=j;$$t.$fd.h(h._c,k,this._l);$$t.$fd.g(h,true,this._l);this.result(this._l.visibleResult());this.bt(this.result());this.bu(this._l.visibleResult(),b,a)}}var l=new $$t.b4($$t.$f5.$type,0);var n=d.getEnumerator();while(n.moveNext()){var m=n.current();var o=this.a4(m.key());if(o==null){continue}if(o.positionResolver().hasUnregisterdPositions()){o.positionResolver().completeRegisterPositions()}var p=new $$t.b4($$t.$dl.$type.specialize(String,$.ig.$op.$type),0);var r=m.value().getEnumerator();while(r.moveNext()){var q=r.current();if(q._b<o.tuples().count()){var s=o.tuples().__inner[q._b];var t=s.item(q._a);p.add(t)}}if(p.count()>0){var u=this.result().axes().indexOf(o);var v=this.a8(u);var w=v.createAxis(u);var x=false;if(function(){var y=e.tryGetValue(o.name(),x);x=y.p1;return y.ret}()&&x){v=new $$t.f2(1,o,v.mdxSettings(),p);var y=v.extendAxis(w,w.axisIndex());l.add(y)}}}this.ab().clear();return{ret:l,p3:d}},a6:function(a,b,c){var d=null;if(a.count()>0){d=this.a8(c);if(b){var e=null;if(d!=null){e=d.rootPositionInfo()}var f=c==0?this.mdxSettings()._a:this.mdxSettings()._b;d=new $$t.f2(0,this,f,a,e);this.bs(c,d)}}if(d!=null){return d.createAxis(c)}return null},bl:function(a,b,c){if(this.result()!=null){var d=new $$t.bc(String,$$t.$b3.$type.specialize($$t.$fc.$type),0);var e=this.aa();for(var f=0;f<e.count();f++){var g=e.item(f);var h;if(!function(){var i=d.tryGetValue(g._c,h);h=i.p1;return i.ret}()){h=new $$t.b4($$t.$fc.$type,0);d.add(g._c,h)}h.add(g);if(c){if(this._l==null){this._l=new $$t.fb(this.result(),this.result(),a,b)}else{this._l=this._l.collapseTupleMember(g._c,g._b,g._a);this.result(this._l.visibleResult());this.bt(this.result());this.bu(this._l.visibleResult(),b,a)}}}var i=new $$t.b4($$t.$di.$type,0);var k=d.getEnumerator();while(k.moveNext()){var j=k.current();var l=this.a4(j.key());if(l==null){continue}if(l.positionResolver().hasUnregisterdPositions()){l.positionResolver().completeRegisterPositions()}if(!i.contains(l)){i.add(l)}if(!c){var n=j.value().getEnumerator();while(n.moveNext()){var m=n.current();if(m._b<l.tuples().count()){var o=l.tuples().__inner[m._b];var p=o.item(m._a);var q=l.positionResolver().getHostPositionItemInfo(o,m._a);var r=$$t.$ci.af($$t.$dm.$type.specialize(String,$.ig.$op.$type),$$t.$ci.u($$t.$dm.$type.specialize(String,$.ig.$op.$type),q.values(),function(s){return s.key()==p.key()}));if(r!=null){r.isExpanded(false)}}}}}if(i.count()>0){if(!c&&!this.result().isEmpty()){this.bu(this.result(),b,a)}var t=i.getEnumerator();while(t.moveNext()){var s=t.current();var u=b&&s.name()=="Axis1"?1:0;var v=this.a8(u);v.q()}}this.aa().clear()}},bk:function(){this.catalog(null);this.cubes(new $$t.ea($$t.$cr.$type));this.aw()},bg:function(){var $self=this;var a=this.dataProviderFactory().createDataProvider();var b=this.getProviderDefaultProperties();var c=$$t.$fm.b($$t.$a7.$type.specialize($$t.$co.$type),$$t.$a7.$type.specialize($$t.$co.$type),a.discoverCatalogsAsync(b,null),function(d){$self.catalogs($self.a3($$t.$co.$type,d.n()));return d});return c},bh:function(a){if(String.isNullOrEmpty(a)){if(a==null){throw new $$t.cn(0,"catalogName")}throw new $$t.bm(1,"catalogName cannot be empty.")}var b=new $$t.el($$t.$b3.$type.specialize($$t.$cr.$type),0);if(this.catalog()!=null){if(this.catalog().name()==a){b.e(this.cubes());return b._b}this.bk()}var d=this.catalogs().getEnumerator();while(d.moveNext()){var c=d.current();if(c.name()==a){this.catalog(c);break}}if(this.cubes()==null||this.cubes().count()==0){this.am(a).j(function(e){if(e._a==null){b.e(e.n());return}b.d(e._a)})}else{b.e(this.cubes())}return b._b},ap:function(){var $self=this;var a=new $$t.el($$t.$d7.$type,0);if(this.isInitialized()){a.e(this.metadataTree());return a._b}var b=this.mdxSourceOptions().catalog();var c=this.mdxSourceOptions().cube();var d=this.columnAxis();d.collectionChanged=$.ig.Delegate.prototype.combine(d.collectionChanged,this.bm.runOn(this));var e=this.rowAxis();e.collectionChanged=$.ig.Delegate.prototype.combine(e.collectionChanged,this.br.runOn(this));var f=this.filters();f.collectionChanged=$.ig.Delegate.prototype.combine(f.collectionChanged,this.bo.runOn(this));var g=this.measures();g.collectionChanged=$.ig.Delegate.prototype.combine(g.collectionChanged,this.bp.runOn(this));var h=this.bg();if(String.isNullOrEmpty(b)){h.j(function(i){if(i._a==null){$self.ay();var j=function(){var $ret=new $$t.dh;$ret.isEmpty(true);return $ret}();$self._l=new $$t.fb(j,j,false,false);$self.result(j);a.e(null);return}a.d(i._a)});return a._b}var i=$$t.$fm.b($$t.$a7.$type.specialize($$t.$co.$type),$$t.$b3.$type.specialize($$t.$cr.$type),h,function(j){if(j._a==null){return $self.bh(b)}var k=new $$t.el($$t.$b3.$type.specialize($$t.$cr.$type),0);k.d(j._a);return k._b});if(String.isNullOrEmpty(c)){i.j(function(j){if(j._a==null){$self.ay();var k=function(){var $ret=new $$t.dh;$ret.isEmpty(true);return $ret}();$self._l=new $$t.fb(k,k,false,false);$self.result(k);a.e(null);return}a.d(j._a)});return a._b}var j=$$t.$fm.b($$t.$d7.$type,$$t.$d7.$type,$$t.$fm.b($$t.$b3.$type.specialize($$t.$cr.$type),$$t.$d7.$type,i,function(k){return $self.aq(c)}),function(k){return $self.ak()});return j},as:function(){var $self=this;var a=this._m;var b=this._s;var c=this._r;var d=this._n;var e=this.ab().count()>0;var f=this.aa().count()>0;var g=this.af.count()>0;if(!a&&!b&&!c&&!d&&!e&&!f&&!g){var h=new $$t.el($$t.$dh.$type,0);h.e(this.result());return h._b}var i=this.columnAxis().count()>0;var j=this.rowAxis().count()>0;if(this.rowAxis().count()==0&&this.columnAxis().count()==0&&this.measures().count()==0){var k=function(){var $ret=new $$t.dh;$ret.isEmpty(true);return $ret}();var l=new $$t.el($$t.$dh.$type,0);l.e(k);this._l=new $$t.fb(k,k,false,false);this.result(k);this.bt(k);this.bu(this._l.visibleResult(),j,i);this.clearPendingChanges();return l._b}if(this._r){this.bv(i,j)}this._r=false;this._n=false;this._q=false;var m=false;if(this.bb&&!this._m&&!this._s){m=true}var n=null;var o=null;var p=0;n=this.a6(this.columnAxis(),this._m,p);this._m=false;if(n!=null){p++}o=this.a6(this.rowAxis(),this._s,p);this._s=false;if(o!=null){o.axisIndex(p);p++}var q;var r=function(){var s=$self.bd(i,j,m,q);q=s.p3;return s.ret}();var s=this.mdxSourceOptions()!=null?this.mdxSourceOptions().executeProperties():null;var t=s!=null&&s.containsKey("DbpropMsmdSubQueries")&&s.item("DbpropMsmdSubQueries")=="2";var u=this.ba(this._y,this._ag,this._z,this.mdxSettings(),t);var v=u.createAxis(p);var w=new $$t.gt(1,this.mdxSettings());var x=this.getProviderDefaultProperties();if(s!=null&&s.count()>0){var z=s.getEnumerator();while(z.moveNext()){var y=z.current();x.add(function(){var $ret=new $$t.fa;$ret._a=y.key();$ret._b=y.value();return $ret}())}}var aa=this.getProviderDefaultRestrictions();var ab=this.dataProviderFactory().createDataProvider();if(m&&!g&&(e||f)){var ac=null;if(n!=null){var ad=$$t.$ci.af($$t.$f5.$type,$$t.$ci.u($$t.$f5.$type,r,function(ae){return ae.axisIndex()==n.axisIndex()}));var ae;var af=q.tryGetValue("Axis0",ae);ae=af.p1;if(ad!=null){var ag=w.c(ad,o,v,new $$t.gu,this.cube().name());ac=ab.executeStatementAsync(ag,x,aa);ac=$$t.$fm.b($$t.$dh.$type,$$t.$dh.$type,ac,function(ah){if($self._l==null){$self._l=new $$t.fb($self.result(),$self.result(),i,j)}var ai=$self._l;$self._l=$self._l.extend(ah.n(),"Axis0");$self.result($self._l.visibleResult());$self.bt($self.result());$$t.$fd.h("Axis0",ai,$self._l);var ak=ae.getEnumerator();while(ak.moveNext()){var aj=ak.current();$$t.$fd.g(aj,true,$self._l)}var al=j;var am=i;$self.bu($self._l.visibleResult(),al,am);var an=new $$t.el($$t.$dh.$type,0);an.e($self._l.visibleResult());return an._b})}}if(o!=null){var ah=$$t.$ci.af($$t.$f5.$type,$$t.$ci.u($$t.$f5.$type,r,function(ai){return ai.axisIndex()==o.axisIndex()}));var ai=this._l.hasColumns()?"Axis1":"Axis0";var aj;var ak=q.tryGetValue(ai,aj);aj=ak.p1;if(ah!=null){if(ac!=null){ac=$$t.$fm.b($$t.$dh.$type,$$t.$dh.$type,ac,function(al){n=$self.a6($self.columnAxis(),false,0);var am=w.c(n,ah,v,new $$t.gu,$self.cube().name());return ab.executeStatementAsync(am,x,aa)})}else{var al=w.c(n,ah,v,new $$t.gu,this.cube().name());ac=ab.executeStatementAsync(al,x,aa)}ac=$$t.$fm.b($$t.$dh.$type,$$t.$dh.$type,ac,function(am){if($self._l==null){$self._l=new $$t.fb($self.result(),$self.result(),i,j)}var an=$self._l;$self._l=$self._l.extend(am.n(),ai);$self.result($self._l.visibleResult());$self.bt($self.result());$$t.$fd.h(ai,an,$self._l);var ap=aj.getEnumerator();while(ap.moveNext()){var ao=ap.current();$$t.$fd.g(ao,true,$self._l)}var aq=j;var ar=i;$self.bu($self._l.visibleResult(),aq,ar);var as=new $$t.el($$t.$dh.$type,0);as.e($self._l.visibleResult());return as._b})}}if(ac!=null){return ac}var am=new $$t.el($$t.$dh.$type,0);am.e(this.result());return am._b}else{if(g){this.af.clear()}{p=0;n=this.a6(this.columnAxis(),this._m,p);if(n!=null){p++}o=this.a6(this.rowAxis(),this._s,p)}var an=w.c(n,o,v,new $$t.gu,this.cube().name());return ab.executeStatementAsync(an,x,aa).k($$t.$dh.$type,function(ao){$self._l=new $$t.fb(ao.n(),ao.n(),i,j);$self.result($self._l.visibleResult());$self.bt($self.result());var ap=j;var aq=i;$self.bu($self._l.visibleResult(),ap,aq);$self.clearPendingChanges();return $self.result()})}},aq:function(a){if(this.catalog()==null){throw new $$t.bm(1,"Data source has no Catalog set.")}return $$t.$d5.aq.call(this,a)},ar:function(a){if(this.catalog()==null){throw new $$t.bm(1,"Data source has no Catalog set.")}return $$t.$d5.ar.call(this,a)},aj:function(){var $self=this;var a=new $$t.b4($$t.$eg.$type,0);var b=this.getProviderDefaultProperties();var c=this.getProviderDefaultRestrictions();var d=this.dataProviderFactory().createDataProvider();a.add(d.discoverMeasuresAsync(b,c));a.add(d.discoverKpisAsync(b,c));a.add(d.discoverDimensionsAsync(b,c));a.add(d.discoverHierarchiesAsync(b,c));a.add(d.discoverLevelsAsync(b,c));a.add(d.discoverMeasureGroupDimensionsAsync(b,c));a.add(this.ao());var e=new Array(a.count());a.copyTo(e,0);var f=new $$t.fl;var g=new $$t.ff;this._c=g;return f.c(e,function(h){var i=h[0];var j=h[1];var k=h[2];var l=h[3];var m=h[4];var n=h[5];g._z=i.n();g._t=k.n();g._u=l.n();g._x=m.n();g._w=j.n();if($self.measureGroups()!=null){g._y=n.n();g._a=new $$t.fh(g._t,g._z,g._w,g._y)}})},a3:function($t,a){var b=new $$t.ea($t);var d=a.getEnumerator();while(d.moveNext()){var c=d.current();b.add(c)}return b},getProviderDefaultRestrictions:function(){var $self=this;var a=$$t.$d5.getProviderDefaultRestrictions.call(this);if(this.catalog()!=null){a.add(function(){var $ret=new $$t.fa;$ret._a="CATALOG_NAME";$ret._b=$self.catalog().name();return $ret}());if(this.cube()!=null){a.add(function(){var $ret=new $$t.fa;$ret._a="CUBE_NAME";$ret._b=$self.cube().name();return $ret}())}}return a},bm:function(a,b){this._m=true;this.bx(0,this.columnAxis(),this.rowAxis());this.a0(b,this._y);this.a2(b,this.columnAxis());if(b.action()!=4&&this.columnAxis()!=null){var c=Math.max(b.newStartingIndex(),b.oldStartingIndex());this.bw("Axis0",c)}},br:function(a,b){this._s=true;this.bx(1,this.rowAxis(),this.columnAxis());this.a0(b,this._ag);this.a2(b,this.rowAxis());if(b.action()!=4&&this.rowAxis()!=null){var c=this.columnAxis()==null?"Axis0":"Axis1";var d=Math.max(b.newStartingIndex(),b.oldStartingIndex());this.bw(c,d)}},bw:function(a,b){var c=this.aa();for(var d=c.count()-1;d>=0;d--){var e=c.item(d);if(e._c==a&&e._a>=b){c.removeAt(d)}}var f=this.ab();for(var g=f.count()-1;g>=0;g--){var h=f.item(g);if(h._c==a&&h._a>=b){f.removeAt(g)}}},bx:function(a,b,c){if(b.count()>0){if(c.count()>0){if(this.bc.count()<2){this.bc.insert(a,null)}}else{if(this.bc.count()==0){this.bc.insert(0,null)}}}else{if(this.bc.count()>0){if(this.bc.count()>1){this.bc.removeAt(a)}else{this.bc.removeAt(0)}}}},bo:function(a,b){this._n=true;this.a0(b,this._z)},bp:function(a,b){this._r=true;this.a1()},bn:function(a,b,c){var d=null;var f=a.getEnumerator();while(f.moveNext()){var e=f.current();if(e._a==b){d=e;break}}if(d==null){a.add(function(){var $ret=new $$t.fa;$ret._a=b;$ret._b=c;return $ret}())}},a4:function(a){if(this.result()!=null&&this.result().axes().count()>0){return $$t.$ci.af($$t.$di.$type,$$t.$ci.u($$t.$di.$type,this.result().axes(),function(b){return b.name()==a}))}return null},a8:function(a){if(a<this.bc.count()){return this.bc.item(a)}return null},bs:function(a,b){this.bc.item(a,b)},$type:new $.ig.Type("MdxDataSourceImpl",$$t.$d5.$type)},true);$c("MdxDataSourceOptions:fs","DataSourceBaseOptions",{init:function(){$$t.$e7.init.call(this)},_catalog:null,catalog:function(a){if(arguments.length===1){this._catalog=a;return a}else{return this._catalog}},_discoverProperties:null,discoverProperties:function(a){if(arguments.length===1){this._discoverProperties=a;return a}else{return this._discoverProperties}},_executeProperties:null,executeProperties:function(a){if(arguments.length===1){this._executeProperties=a;return a}else{return this._executeProperties}},_dataProviderFactory:null,dataProviderFactory:function(a){if(arguments.length===1){this._dataProviderFactory=a;return a}else{return this._dataProviderFactory}},_enableResultCache:false,enableResultCache:function(a){if(arguments.length===1){this._enableResultCache=a;return a}else{return this._enableResultCache}},_mdxSettings:null,mdxSettings:function(a){if(arguments.length===1){this._mdxSettings=a;return a}else{return this._mdxSettings}},$type:new $.ig.Type("MdxDataSourceOptions",$$t.$e7.$type)},true);$c("IXmlaMethodResult:gy","Object",{$type:new $.ig.Type("IXmlaMethodResult",null)},true);$c("XmlaSoapMethodResult:gx","Object",{init:function(){$.ig.$op.init.call(this)},b:null,returnElement:function(a){if(arguments.length===1){this.b=a;return a}else{return this.b}},_sessionId:null,sessionId:function(a){if(arguments.length===1){this._sessionId=a;return a}else{return this._sessionId}},$type:new $.ig.Type("XmlaSoapMethodResult",$.ig.$ot,[$$t.$gy.$type])},true);$c("DiscoverResponseResult:gw","XmlaSoapMethodResult",{init:function(){$$t.$gx.init.call(this)},$type:new $.ig.Type("DiscoverResponseResult",$$t.$gx.$type)},true);$c("FaultError:hh","Object",{init:function(){$.ig.$op.init.call(this)},_errorCode:null,errorCode:function(a){if(arguments.length===1){this._errorCode=a;return a}else{return this._errorCode}},_description:null,description:function(a){if(arguments.length===1){this._description=a;return a}else{return this._description}},_source:null,source:function(a){if(arguments.length===1){this._source=a;return a}else{return this._source}},_helpFile:null,helpFile:function(a){if(arguments.length===1){this._helpFile=a;return a}else{return this._helpFile}},_severity:null,severity:function(a){if(arguments.length===1){this._severity=a;return a}else{return this._severity}},$type:new $.ig.Type("FaultError",$.ig.$ot)},true);$c("RequestCompletedEventArgs$1:hi","AsyncCompletedEventArgs",{$t:null,i:null,init:function($t,a,b,c,d){this.$t=$t;if(!this.hasOwnProperty("$type")){this.$type=this.$type.specialize(this.$t)}$$t.$dq.init.call(this,b,c,d);this.i=a},result:function(){$$t.$dq.h.call(this);return this.i},$type:new $.ig.Type("RequestCompletedEventArgs$1",$$t.$dq.$type)},true);$c("ExecuteResponseResult:hj","XmlaSoapMethodResult",{init:function(){$$t.$gx.init.call(this)},$type:new $.ig.Type("ExecuteResponseResult",$$t.$gx.$type)},true);$c("FaultDetail:hk","Object",{init:function(){$.ig.$op.init.call(this)},_a:null,$type:new $.ig.Type("FaultDetail",$.ig.$ot)},true);$c("IXmlaSoapMethod:hl","Object",{$type:new $.ig.Type("IXmlaSoapMethod",null)},true);$c("XmlaNamespace:ho","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("XmlaNamespace",$.ig.$ot)},true);$c("XmlaQueryProperty:hn","Object",{init:function(a){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}$.ig.$op.init.call(this)},init1:function(a,b,c){$.ig.$op.init.call(this);this._a=b;this._c=c},_a:null,_c:null,toString:function(){return String.concat(this._a," = ",this._c)},$type:new $.ig.Type("XmlaQueryProperty",$.ig.$ot)},true);$c("XmlaPropertiesCollection:hm","Object",{c:null,d:null,e:null,init:function(){$.ig.$op.init.call(this);this.c=new $$t.bc(String,$$t.$hn.$type,0);this.d=new $$t.bc(String,$$t.$r.$type,0);this.e=new $$t.b4($$t.$hn.$type,0)},tryGetValue:function(a,b){var $self=this;return{ret:function(){var c=$self.c.tryGetValue(a,b);b=c.p1;return c.ret}(),p1:b}},contains1:function(a){return this.c.containsKey(a)},indexOf:function(a){return this.e.indexOf(a)},insert:function(a,b){this.c.add(b._a,b);this.e.insert(a,b)},removeAt:function(a){if(a<this.e.count()){var b=this.e.item(a);if(this.c.remove(b._a)){this.e.removeAt(a)}}},item:function(a,b){if(arguments.length===2){var c=this.e.item(a);this.c.remove(c._a);this.c.add(b._a,b);this.e.item(a,b);return b}else{return this.e.item(a)}},add$1:function(a){this.c.add(a._a,a);this.e.add(a)},clear:function(){this.e.clear();this.c.clear()},contains:function(a){return this.e.contains(a)},copyTo$1:function(a,b){this.e.copyTo(a,b)},count:function(){return this.e.count()},isReadOnly:function(){return this.e.isReadOnly()},remove:function(a){if(this.e.remove(a)){return this.c.remove(a._a)}return false},getEnumerator:function(){return this.e.getEnumerator()},add:function(a){this.add$1(a);return this.count()-1},isFixedSize:function(){return false},copyTo:function(a,b){throw new $$t.bn(0)},isSynchronized:function(){return this.e.isSynchronized()},syncRoot:function(){return this.e.syncRoot()},$type:new $.ig.Type("XmlaPropertiesCollection",$.ig.$ot,[$$t.$b3.$type.specialize($$t.$hn.$type),$$t.$n.$type])},true);$c("XmlaSoapFault:hp","Object",{init:function(){$.ig.$op.init.call(this)},_c:null,_d:null,_b:null,_a:null,$type:new $.ig.Type("XmlaSoapFault",$.ig.$ot)},true);$c("XmlaSoapMessageBuilder:hq","Object",{init:function(){$.ig.$op.init.call(this)},_a:null,c:function(){if(this._a==null){throw new $$t.bm(1,"XmlaMethod is not specified.")}var a=$$t.$hd.get($$t.$hq.g);this._a.construct(a);var b=this.j();return b.toString()},j:function(){var a=new $$t.gz(1,$$t.$hc.get("Envelope",$$t.$hq.g));this.i(a);this.h(a);return a},i:function(a){var b=new $$t.gz(1,$$t.$hc.get("Header",a.name().namespace().namespaceName()));a.add(b);var d=this._a.headers().getEnumerator();while(d.moveNext()){var c=d.current();b.add(c)}},h:function(a){var b=new $$t.gz(1,$$t.$hc.get("Body",a.name().namespace().namespaceName()));a.add(b);var c=new $$t.gz(1,$$t.$hc.get(this._a.name(),"urn:schemas-microsoft-com:xml-analysis"));b.add(c);var e=this._a.parameters().getEnumerator();while(e.moveNext()){var d=e.current();c.add(d)}},$type:new $.ig.Type("XmlaSoapMessageBuilder",$.ig.$ot)},true);$c("XmlaSoapMethod:hr","Object",{g:null,f:null,c:null,b:null,a:null,init:function(){$.ig.$op.init.call(this);this.c=new $$t.b4($$t.$gz.$type,0);this.b=new $$t.b4($$t.$gz.$type,0);this.g=new $$t.cg($$t.$gz.$type,1,this.c);this.f=new $$t.cg($$t.$gz.$type,1,this.b);this.a=new $$t.hm},properties:function(){return this.a},name:function(){},parameters:function(){return this.g},headers:function(){return this.f},e:function(){return this.c},d:function(){return this.b},construct:function(a){},mergeProperties:function(a){var $self=this;if(a==null){return}var c=a.getEnumerator();while(c.moveNext()){var b=c.current();var d;if(function(){var e=$self.properties().tryGetValue(b._a,d);d=e.p1;return e.ret}()){d._c=b._c}else{this.properties().add$1(b)}}},$type:new $.ig.Type("XmlaSoapMethod",$.ig.$ot,[$$t.$hl.$type])},true);$c("XmlaSoapMethodDiscover:hs","XmlaSoapMethod",{k:null,init:function(a){$$t.$hr.init.call(this);this.headerType(0);this.requestType(a);this.k=new $$t.bc(String,$.ig.$op.$type,0)},restrictions:function(){return this.k},_requestType:null,requestType:function(a){if(arguments.length===1){this._requestType=a;return a}else{return this._requestType}},name:function(){return"Discover"},_headerType:0,headerType:function(a){if(arguments.length===1){this._headerType=a;return a}else{return this._headerType}},_sessionId:null,sessionId:function(a){if(arguments.length===1){this._sessionId=a;return a}else{return this._sessionId}},construct:function(a){var b=$$t.$hd.get("urn:schemas-microsoft-com:xml-analysis");var c=new $$t.gz(1,$$t.$hc.get("RequestType",b.namespaceName()));c.value(this.requestType());var d=new $$t.gz(1,$$t.$hc.get("Properties","urn:schemas-microsoft-com:xml-analysis"));var e=new $$t.gz(1,$$t.$hc.get("PropertyList",d.name().namespace().namespaceName()));d.add(e);var f=new $$t.gz(1,$$t.$hc.get("Restrictions","urn:schemas-microsoft-com:xml-analysis"));var g=new $$t.gz(1,$$t.$hc.get("RestrictionList",f.name().namespace().namespaceName()));f.add(g);var i=this.properties().getEnumerator();while(i.moveNext()){var h=i.current();e.add(new $$t.gz(2,$$t.$hc.get(h._a,"urn:schemas-microsoft-com:xml-analysis"),h._c))}var k=this.k.getEnumerator();while(k.moveNext()){var j=k.current();g.add(new $$t.gz(2,$$t.$hc.get(j.key(),""),j.value()))}this.e().add(c);this.e().add(f);this.e().add(d)},$type:new $.ig.Type("XmlaSoapMethodDiscover",$$t.$hr.$type)},true);$c("XmlaSoapMethodExecute:ht","XmlaSoapMethod",{init:function(a){$$t.$hr.init.call(this);this.statement(a)},name:function(){return"Execute"},_statement:null,statement:function(a){if(arguments.length===1){this._statement=a;return a}else{return this._statement}},construct:function(a){var b=$$t.$hd.get("urn:schemas-microsoft-com:xml-analysis");var c=new $$t.gz(1,$$t.$hc.get("Command",b.namespaceName()));var d=new $$t.gz(1,$$t.$hc.get("Statement",b.namespaceName()));d.value(this.statement());c.add(d);var e=new $$t.gz(1,$$t.$hc.get("Properties","urn:schemas-microsoft-com:xml-analysis"));var f=new $$t.gz(1,$$t.$hc.get("PropertyList",e.name().namespace().namespaceName()));e.add(f);var h=this.properties().getEnumerator();while(h.moveNext()){var g=h.current();f.add(new $$t.gz(2,$$t.$hc.get(g._a,"urn:schemas-microsoft-com:xml-analysis"),g._c))}this.e().add(c);this.e().add(e)},$type:new $.ig.Type("XmlaSoapMethodExecute",$$t.$hr.$type)},true);$c("XmlaSoapWebClient:hu","Object",{init:function(){$.ig.$op.init.call(this)},staticInit:function(){$$t.$hu.a=new $$t.b4(String,0)},$type:new $.ig.Type("XmlaSoapWebClient",$.ig.$ot)},true);$c("XmlaSoapWebClient$1:hv","XmlaSoapWebClient",{$t:null,f:null,b:false,init:function($t,a,b){this.$t=$t;if(!this.hasOwnProperty("$type")){this.$type=this.$type.specialize(this.$t)}$$t.$hu.init.call(this);this.f=new $$t.h6;this.f._e=b;var c=this.f;c.uploadStringCompleted=$.ig.Delegate.prototype.combine(c.uploadStringCompleted,this.l.runOn(this));this._g=a},requestCompleted:null,_e:null,_g:null,c:function(){return this.b},j:function(a){this.k(a,null)},k:function(a,b){var c=new $$t.hq;c._a=a;var d=c.c();if(this._e!=null){this.f._a=this._e}else{this.f._a=null}this.f._d.item("UserAgent","XmlaClient");this.f._d.item("SOAPAction","urn:schemas-microsoft-com:xml-analysis:Execute");this.f._d.item("Content-Type","text/xml");this.f.k(this._g,"POST",d,b)},h:function(a){if(this.requestCompleted!=null){this.requestCompleted(this,a)}},l:function(a,b){this.b=true;var c=$$t.$he.parse(b.result());this.i(c,b.error(),b.cancelled(),b.userState())},i:function(a,b,c,d){var e=null;var f=null;var g=null;if(!c&&b==null){try{var h=a.element($$t.$hc.get("Envelope","http://schemas.xmlsoap.org/soap/envelope/"));var i=h.element($$t.$hc.get("Body","http://schemas.xmlsoap.org/soap/envelope/"));var j=i.element($$t.$hc.get("Fault","http://schemas.xmlsoap.org/soap/envelope/"));if(j!=null){var k=new $$t.id;var l=k.deserialize(j);f=new $$t.ik($$t.$hp.$type,l,new $$t.ii(l._d),new $$t.ij(l._c),null)}else{if(this.$t==$$t.$gw.$type){var m=i.element($$t.$hc.get("DiscoverResponse","urn:schemas-microsoft-com:xml-analysis"));var n=m.element($$t.$hc.get("return","urn:schemas-microsoft-com:xml-analysis"));var o=n.element($$t.$hc.get("root",$$t.$ho.e));var p=new $$t.gw;p.returnElement(o);e=p}if(this.$t==$$t.$hj.$type){var q=i.element($$t.$hc.get("ExecuteResponse","urn:schemas-microsoft-com:xml-analysis"));var r=q.element($$t.$hc.get("return","urn:schemas-microsoft-com:xml-analysis"));var s=r.element($$t.$hc.get("root",$$t.$ho.d));var t=new $$t.hj;t.returnElement(s);e=t}}}catch(e_){g=e_}}if(g==null){g=b!=null?b:f}var u=new $$t.hi(this.$t,e,g,c,d);this.h(u)},$type:new $.ig.Type("XmlaSoapWebClient$1",$$t.$hu.$type)},true);$c("Session:im","Object",{init:function(){$.ig.$op.init.call(this)},_a:null,$type:new $.ig.Type("Session",$.ig.$ot)},true);$c("IMdxExpression:f6","Object",{$type:new $.ig.Type("IMdxExpression",null)},true);$c("IMdxElement:f8","Object",{$type:new $.ig.Type("IMdxElement",null,[$$t.$f6.$type])},true);$c("IAxisFilterElement:gp","Object",{$type:new $.ig.Type("IAxisFilterElement",null,[$$t.$f8.$type])},true);$c("IMdxAxis:f5","Object",{$type:new $.ig.Type("IMdxAxis",null,[$$t.$f6.$type])},true);$c("IMdxAxisProvider:f4","Object",{$type:new $.ig.Type("IMdxAxisProvider",null)},true);$c("IMdxCalculatedMembersCacheProvider:io","Object",{$type:new $.ig.Type("IMdxCalculatedMembersCacheProvider",null)},true);$c("IMdxCollectionElement:gb","Object",{$type:new $.ig.Type("IMdxCollectionElement",null,[$$t.$f8.$type])},true);$c("IMdxDimensionAxisProvider:f3","Object",{$type:new $.ig.Type("IMdxDimensionAxisProvider",null,[$$t.$f4.$type])},true);$c("IMdxFilterInfo:go","Object",{$type:new $.ig.Type("IMdxFilterInfo",null)},true);$c("IMdxExtendedFilterInfo:gn","Object",{$type:new $.ig.Type("IMdxExtendedFilterInfo",null,[$$t.$go.$type])},true);$c("IMdxItemElement:gg","Object",{$type:new $.ig.Type("IMdxItemElement",null,[$$t.$f8.$type])},true);$c("IMdxQuery:ip","Object",{$type:new $.ig.Type("IMdxQuery",null)},true);$c("IMdxSet:f7","Object",{$type:new $.ig.Type("IMdxSet",null,[$$t.$f6.$type])},true);$c("MdxAxis:gc","Object",{e:null,f:null,d:false,i:null,h:0,a:null,init:function(a,b){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}$$t.$gc.init1.call(this,1,b,new $$t.fu)},init1:function(a,b,c){this.a=["COLUMNS","ROWS","PAGES"];$.ig.$op.init.call(this);this.axisIndex(b);this.mdxSettings(c!=null?c:new $$t.fu);this.e=new $$t.b4($$t.$f7.$type,0);this.f=new $$t.cg($$t.$f7.$type,1,this.e)},axisIndex:function(a){if(arguments.length===1){if(this.h!=a){this.h=a;this.d=false}return a}else{return this.h}},_mdxSettings:null,mdxSettings:function(a){if(arguments.length===1){this._mdxSettings=a;return a}else{return this._mdxSettings}},c:function(){return $b($$t.$fu.$type,this.mdxSettings())},sets:function(){return this.f},mdxExpression:function(){if(!this.d){this.i=this.j();this.d=true}return this.i},rebuildExpression:function(){this.i=this.j();this.d=true},getMdxSets:function(){var d__=new $.ig.MdxAxis___GetMdxSets__IteratorClass((-2));d__.__4__this=this;return d__},addSet:function(a){this.e.add(a);this.d=false},j:function(){var a=new $$t.dx(0);var b=false;var d=this.sets().getEnumerator();while(d.moveNext()){var c=d.current();if(!c.isEnabled()){continue}if(b){a.l(",");a.l($$t.$dy.newLine())}a.l(c.mdxExpression());b=true}if(this.sets().count()>1){a.x(0,"{");a.l("}")}this.m(a,this.c());this.n(a,this.c());this.l(a,this.c());this.k(a);return a.toString()},m:function(a,b){if(b._f){a.x(0,"Distinct(");a.l(")")}},n:function(a,b){if(b._h){a.x(0,$$t.$dy.newLine());a.x(0,"NON EMPTY")}},l:function(a,b){if(b._e){a.l($$t.$dy.newLine());a.l("DIMENSION PROPERTIES");var c=b._j;var d=false;var f=c.getEnumerator();while(f.moveNext()){var e=f.current();a.l($$t.$dy.newLine());if(d){a.l(",")}a.l(e);d=true}}},k:function(a){if(this.axisIndex()<2){a.l($$t.$dy.newLine());a.l(String.concat("ON ",this.a[this.axisIndex()]))}},$type:new $.ig.Type("MdxAxis",$.ig.$ot,[$$t.$f5.$type])},true);$c("MdxAxisFilterElement:gr","Object",{a:null,b:null,init:function(){$.ig.$op.init.call(this);this.b=new $$t.b4($$t.$f8.$type,0);this.singleFilterElements(new $$t.cg($$t.$f8.$type,1,this.b));this.a=new $$t.ga},mdxExpression:function(){if(this.a.collectionElements().count()>1){this.a.wrapExpressionWithBrackets(["(",")"])}return this.a.mdxExpression()},_singleFilterElements:null,singleFilterElements:function(a){if(arguments.length===1){this._singleFilterElements=a;return a}else{return this._singleFilterElements}},filterCollection:function(){return this.a.collectionElements()},rebuildExpression:function(){this.a.rebuildExpression()},addFilterPart:function(a,b){if(a.collectionElements().count()>0){if(a.collectionElements().count()==1&&b){this.b.add(a.collectionElements().item(0));return}this.a.addElement(a)}},elementType:function(){return 3},$type:new $.ig.Type("MdxAxisFilterElement",$.ig.$ot,[$$t.$gp.$type])},true);$c("MdxCalculatedMembersCache:gu","Object",{init:function(){this.d=new $$t.b4(String,0);this.b=new $$t.bc(String,String,0);$.ig.$op.init.call(this)},d:null,b:null,e:function(a){var b=new $$t.dx(0);var d=a.c().getEnumerator();while(d.moveNext()){var c=d.current();$$t.$gu.f(b,c.key(),c.value())}return b.toString()},g:function(a,b,c){if(!this.d.contains(a)){this.d.add(a)}if(!this.b.containsKey(b)){this.b.add(b,c)}},c:function(){var d__=new $.ig.MdxCalculatedMembersCache___GetMemberAliasExpressionPairs__IteratorClass((-2));d__.__4__this=this;return d__},a:function(a){return this.d.contains(a)},f:function(a,b,c){a.l(String.concat("MEMBER ",b," AS",$$t.$dy.newLine()));a.l(c);a.l($$t.$dy.newLine())},$type:new $.ig.Type("MdxCalculatedMembersCache",$.ig.$ot)},true);$c("MdxElement:gf","Object",{init:function(){$.ig.$op.init.call(this);this.elementType(5)},mdxExpression:function(){},_elementType:0,elementType:function(a){if(arguments.length===1){this._elementType=a;return a}else{return this._elementType}},_sourceItemExpression:null,sourceItemExpression:function(a){
if(arguments.length===1){this._sourceItemExpression=a;return a}else{return this._sourceItemExpression}},rebuildExpression:function(){},$type:new $.ig.Type("MdxElement",$.ig.$ot,[$$t.$gg.$type])},true);$c("MdxSingleElement:ge","MdxElement",{init:function(a,b,c,d){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}$$t.$ge.init1.call(this,1,b,c,d,0)},init1:function(a,b,c,d,e){$$t.$gf.init.call(this);this.memberDepth(d);switch(e){case 0:case 2:this.sourceItemExpression(b);this.elementUniqueName(c);this.elementType(e);break;default:throw new $$t.bo(2,"Element type could be MdxElementType.Member or MdxElementType.Calculated","elementType")}},mdxExpression:function(){return this.sourceItemExpression()},_elementUniqueName:null,elementUniqueName:function(a){if(arguments.length===1){this._elementUniqueName=a;return a}else{return this._elementUniqueName}},_memberDepth:0,memberDepth:function(a){if(arguments.length===1){this._memberDepth=a;return a}else{return this._memberDepth}},$type:new $.ig.Type("MdxSingleElement",$$t.$gf.$type)},true);$c("MdxDimensionMember:gj","MdxSingleElement",{init:function(a,b,c,d,e){$$t.$ge.init.call(this,0,a,b,c);this.parentHierarchyUniqueName(d);this.parent(e)},_parentHierarchyUniqueName:null,parentHierarchyUniqueName:function(a){if(arguments.length===1){this._parentHierarchyUniqueName=a;return a}else{return this._parentHierarchyUniqueName}},_parent:null,parent:function(a){if(arguments.length===1){this._parent=a;return a}else{return this._parent}},$type:new $.ig.Type("MdxDimensionMember",$$t.$ge.$type)},true);$c("MdxChildrenCollectionElement:gi","MdxDimensionMember",{init:function(a,b,c,d,e){$$t.$gj.init.call(this,a,b,c,d,e)},mdxExpression:function(){return String.concat(this.sourceItemExpression(),".Children")},$type:new $.ig.Type("MdxChildrenCollectionElement",$$t.$gj.$type)},true);$c("MdxConstantElement:iq","Object",{init:function(a){$.ig.$op.init.call(this);this.mdxExpression(a)},elementType:function(){return 5},_mdxExpression:null,mdxExpression:function(a){if(arguments.length===1){this._mdxExpression=a;return a}else{return this._mdxExpression}},rebuildExpression:function(){},$type:new $.ig.Type("MdxConstantElement",$.ig.$ot,[$$t.$f8.$type])},true);$c("MdxElementCollectionElement:ga","Object",{d:null,c:false,e:null,a:null,init:function(){$.ig.$op.init.call(this);this.d=new $$t.b4($$t.$f8.$type,0);this.collectionElements(new $$t.cg($$t.$f8.$type,1,this.d))},wrapExpressionWithBrackets:function(a){if(arguments.length===1){if(this.a!=a){this.c=false;this.a=a}return a}else{return this.a}},_collectionElements:null,collectionElements:function(a){if(arguments.length===1){this._collectionElements=a;return a}else{return this._collectionElements}},elementType:function(){return 4},mdxExpression:function(){if(!this.c){this.e=this.f();this.c=true}return this.e},rebuildExpression:function(){this.e=this.f();this.c=true},addElement:function(a){this.d.add(a);if(this.collectionElements().count()>1){this.wrapExpressionWithBrackets(["{","}"])}this.c=false},f:function(){if(this.collectionElements().count()==0){return String.empty()}var a=new $$t.dx(0);var b=false;var d=this.collectionElements().getEnumerator();while(d.moveNext()){var c=d.current();if(b){a.l(",");a.l($$t.$dy.newLine())}a.l(c.mdxExpression());b=true}if(this.wrapExpressionWithBrackets()!=null&&this.wrapExpressionWithBrackets().length==2){a.x(0,this.wrapExpressionWithBrackets()[0]);a.l(this.wrapExpressionWithBrackets()[1])}return a.toString()},$type:new $.ig.Type("MdxElementCollectionElement",$.ig.$ot,[$$t.$gb.$type])},true);$c("MdxLevelMembersElement:gh","MdxSingleElement",{init:function(a,b,c){$$t.$ge.init.call(this,0,a,b,c)},mdxExpression:function(){return String.concat(this.sourceItemExpression(),".MEMBERS")},$type:new $.ig.Type("MdxLevelMembersElement",$$t.$ge.$type)},true);$c("MdxQueryBuilder:gt","Object",{a:null,init:function(a){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}$$t.$gt.init1.call(this,1,new $$t.ft)},init1:function(a,b){$.ig.$op.init.call(this);this.b(b)},b:function(a){if(arguments.length===1){this.a=a;return a}else{if(this.a==null){this.a=new $$t.ft}return this.a}},c:function(a,b,c,d,e){var f=c;var g=this.d(a,b,f,d);var h=this.h(f);var i=this.g(f,e);var j=new $$t.dx(0);if(!String.isNullOrEmpty(g)){j.l(String.concat("WITH",$$t.$dy.newLine()))}j.l(g);j.l("SELECT");j.l($$t.$dy.newLine());if(a!=null){j.l(a.mdxExpression())}if(b!=null){if(a==null){b.axisIndex(0)}else{j.l(String.concat(",",$$t.$dy.newLine()))}j.l(b.mdxExpression())}j.l($$t.$dy.newLine());j.l(i);if(!String.isNullOrEmpty(h)){j.l($$t.$dy.newLine());j.l(h)}var k=j.toString();return k},d:function(a,b,c,d){return $$t.$gu.e(d)},g:function(a,b){var c=String.concat("FROM ","[",b,"]");var d=$b($$t.$gn.$type,a);c=this.f(c,a.filtersFilter(),null);if(a.columnsFilter()!=null){c=this.f(c,a.columnsFilter(),a.rowsFilter())}else{c=this.f(c,a.rowsFilter(),null)}if(d!=null){c=this.e(c,d)}return c},e:function(a,b){if(b.filterElements()!=null&&b.filterElements().count()>0){var d=b.filterElements().getEnumerator();while(d.moveNext()){var c=d.current();var e=new $$t.dx(0);e.x(0,String.concat(["FROM",$$t.$dy.newLine(),"(",$$t.$dy.newLine(),"SELECT",$$t.$dy.newLine()]));e.l(String.concat(c.mdxExpression()," ON COLUMNS",$$t.$dy.newLine()));e.l(a);e.l(this.h(b));e.l(String.concat(")",$$t.$dy.newLine()));a=e.toString()}}return a},f:function(a,b,c){if(b==null||b.filterCollection().count()==0){return a}var d=new $$t.dx(0);d.l("FROM");d.l($$t.$dy.newLine());d.l("(");d.l($$t.$dy.newLine());d.l("SELECT");d.l($$t.$dy.newLine());d.l(b.mdxExpression());d.l(" ON COLUMNS");if(c!=null&&c.filterCollection().count()>0){d.l($$t.$dy.newLine());d.l(", ");d.l(c.mdxExpression());d.l(" ON ROWS")}d.l($$t.$dy.newLine());d.l(a);d.l($$t.$dy.newLine());d.l(")");return d.toString()},h:function(a){var b=new $$t.ga;if(a.measureFilter()!=null&&a.measureFilter().singleFilterElements().count()==1){b.addElement(a.measureFilter().singleFilterElements().item(0))}if(a.filtersFilter()!=null){var d=a.filtersFilter().singleFilterElements().getEnumerator();while(d.moveNext()){var c=d.current();b.addElement(c)}}if(b.collectionElements().count()==0){return String.empty()}b.wrapExpressionWithBrackets(["(",")"]);return String.concat("WHERE ",b.mdxExpression())},$type:new $.ig.Type("MdxQueryBuilder",$.ig.$ot)},true);$c("MdxSet:gd","Object",{d:null,e:null,b:false,g:null,init:function(a){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}$$t.$gd.init1.call(this,1,new $$t.fw);this.d=new $$t.b4($$t.$f8.$type,0);this.e=new $$t.cg($$t.$f8.$type,1,this.d);this.isEnabled(true)},init1:function(a,b){$.ig.$op.init.call(this);this.d=new $$t.b4($$t.$f8.$type,0);this.e=new $$t.cg($$t.$f8.$type,1,this.d);this.isEnabled(true);this.mdxSettings(b!=null?b:new $$t.fw)},_mdxSettings:null,mdxSettings:function(a){if(arguments.length===1){this._mdxSettings=a;return a}else{return this._mdxSettings}},_isEnabled:false,isEnabled:function(a){if(arguments.length===1){this._isEnabled=a;return a}else{return this._isEnabled}},elements:function(){return this.e},mdxExpression:function(){if(!this.b){this.g=this.h();this.b=true}return this.g},rebuildExpression:function(){this.g=this.h();this.b=true},addElement:function(a){if(this.supportsElementType(a)){this.d.add(a);this.b=false}},getMdxElements:function(){var d__=new $.ig.MdxSet___GetMdxElements__IteratorClass((-2));d__.__4__this=this;return d__},supportsElementType:function(a){switch(a.elementType()){case 1:case 0:case 2:case 4:return true}return false},h:function(){var a=new $$t.dx(0);var b=this.elements().item(0);this.j(a,b);for(var c=1;c<this.elements().count();c++){a.x(0,"CrossJoin(");a.x(10,$$t.$dy.newLine());a.l(",");a.l($$t.$dy.newLine());var d=this.elements().item(c);this.j(a,d);a.l(")")}return a.toString()},j:function(a,b){var c=new $$t.dx(0);switch(b.elementType()){case 2:var d=b;var e=d.elementUniqueName();c.l("{");c.l(e);c.l("}");break;case 0:c.l("{");c.l(b.mdxExpression());c.l("}");break;case 4:case 1:c.l(b.mdxExpression());break}if($b($$t.$gh.$type,b)!==null||$b($$t.$gi.$type,b)!==null){this.i(c,b)}switch(b.elementType()){case 1:case 0:this.k(c,b);break}a.n(c)},k:function(a,b){},i:function(a,b){if(this.mdxSettings()._a){a.x(0,"AddCalculatedMembers(");a.l(")")}},clone:function(){var a=new $$t.gd(1,this.mdxSettings());var c=this.elements().getEnumerator();while(c.moveNext()){var b=c.current();a.addElement(b)}return a},$type:new $.ig.Type("MdxSet",$.ig.$ot,[$$t.$f7.$type])},true);$c("MdxSettings:ft","Object",{i:false,h:false,e:false,d:false,m:false,l:false,k:false,j:false,o:false,n:false,g:false,f:false,init:function(){$.ig.$op.init.call(this);this._a=new $$t.fu;this._b=new $$t.fu;this._c=new $$t.fx;this.y(true);this.x(true);var a=new $$t.fy(String,0);a.collectionChanged=$.ig.Delegate.prototype.combine(a.collectionChanged,this.ae.runOn(this));this._ac=a;var b=new $$t.fy(String,0);b.collectionChanged=$.ig.Delegate.prototype.combine(b.collectionChanged,this.ad.runOn(this));this._ab=b;this.s(true);this.r(true);this.q(true);this.p(true);this.ag(this._ac);this.ag(this._ab)},ae:function(a,b){this._b._j.clear();var d=this._ac.getEnumerator();while(d.moveNext()){var c=d.current();this._b._j.add(c)}},ad:function(a,b){this._a._j.clear();var d=this._ab.getEnumerator();while(d.moveNext()){var c=d.current();this._a._j.add(c)}},_a:null,_b:null,_c:null,aa:function(a){if(arguments.length===1){if(this.i!=a){this.i=a;this._b.i(a)}return a}else{return this.i}},z:function(a){if(arguments.length===1){if(this.h!=a){this.h=a;this._a.i(a)}return a}else{return this.h}},q:function(a){if(arguments.length===1){if(this.e!=a){this.e=a;this._b.d(a)}return a}else{return this.e}},p:function(a){if(arguments.length===1){if(this.d!=a){this.d=a;this._a.d(a)}return a}else{return this.d}},w:function(a){if(arguments.length===1){if(this.m!=a){this.m=a;this._b._g=a}return a}else{return this.m}},v:function(a){if(arguments.length===1){if(this.l!=a){this.l=a;this._a._g=a}return a}else{return this.l}},u:function(a){if(arguments.length===1){if(this.k!=a){this.k=a;this._b._f=a}return a}else{return this.k}},t:function(a){if(arguments.length===1){if(this.j!=a){this.j=a;this._a._f=a}return a}else{return this.j}},y:function(a){if(arguments.length===1){if(this.o!=a){this.o=a;this._b._h=a}return a}else{return this.o}},x:function(a){if(arguments.length===1){if(this.n!=a){this.n=a;this._a._h=a}return a}else{return this.n}},s:function(a){if(arguments.length===1){if(this.g!=a){this.g=a;this._b._e=a}return a}else{return this.g}},r:function(a){if(arguments.length===1){if(this.f!=a){this.f=a;this._a._e=a}return a}else{return this.f}},_ac:null,_ab:null,af:function(a){this.ag(a)},ag:function(a){a.clear();a.add("CHILDREN_CARDINALITY");a.add("PARENT_UNIQUE_NAME")},$type:new $.ig.Type("MdxSettings",$.ig.$ot)},true);$c("MdxAxisSettings:fv","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("MdxAxisSettings",$.ig.$ot)},true);$c("MdxSlicerAxisSettings:fx","MdxAxisSettings",{init:function(){$$t.$fv.init.call(this)},$type:new $.ig.Type("MdxSlicerAxisSettings",$$t.$fv.$type)},true);$c("MdxDimensionAxisSettings:fu","MdxAxisSettings",{c:false,b:false,init:function(){$$t.$fv.init.call(this);this._j=new $$t.b4(String,0);this._a=new $$t.fw},_a:null,_g:false,_f:false,_h:false,_e:false,i:function(a){if(arguments.length===1){if(this.c!=a){this.c=a;this._a._b=a}return a}else{return this.c}},d:function(a){if(arguments.length===1){if(this.b!=a){this.b=a;this._a._a=a}return a}else{return this.b}},_j:null,$type:new $.ig.Type("MdxDimensionAxisSettings",$$t.$fv.$type)},true);$c("MdxSetSettings:fw","Object",{init:function(){$.ig.$op.init.call(this)},_b:false,_a:false,$type:new $.ig.Type("MdxSetSettings",$.ig.$ot)},true);$c("IMdxSlicerAxis:gm","Object",{$type:new $.ig.Type("IMdxSlicerAxis",null,[$$t.$gn.$type])},true);$c("MdxSlicerAxis:gl","MdxAxis",{init:function(a){$$t.$gc.init1.call(this,1,2,a)},_columnsFilter:null,columnsFilter:function(a){if(arguments.length===1){this._columnsFilter=a;return a}else{return this._columnsFilter}},_rowsFilter:null,rowsFilter:function(a){if(arguments.length===1){this._rowsFilter=a;return a}else{return this._rowsFilter}},_filtersFilter:null,filtersFilter:function(a){if(arguments.length===1){this._filtersFilter=a;return a}else{return this._filtersFilter}},_measureFilter:null,measureFilter:function(a){if(arguments.length===1){this._measureFilter=a;return a}else{return this._measureFilter}},_filterElements:null,filterElements:function(a){if(arguments.length===1){this._filterElements=a;return a}else{return this._filterElements}},$type:new $.ig.Type("MdxSlicerAxis",$$t.$gc.$type,[$$t.$gm.$type])},true);$c("MdxSlicerSet:gs","MdxSet",{init:function(){$$t.$gd.init.call(this,0)},supportsElementType:function(a){return $b($$t.$gp.$type,a)!==null},$type:new $.ig.Type("MdxSlicerSet",$$t.$gd.$type)},true);$c("MdxDimensionAxisProvider:f2","Object",{h:null,i:null,l:0,init:function(a,b,c,d,e){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}this.h=new $$t.bc(String,$$t.$ga.$type,0);this.i=new $$t.b4(String,0);this.l=-1;$.ig.$op.init.call(this);if(b==null){throw new $$t.cn(0,"xmlaDataSource")}this.xmlaDataSource(b);this.mdxSettings(c);this.sourceAxis(d);this.rootPositionInfo(e)},init1:function(a,b,c,d){this.h=new $$t.bc(String,$$t.$ga.$type,0);this.i=new $$t.b4(String,0);this.l=-1;$.ig.$op.init.call(this);this.mdxSettings(c);this.currentResultAxis(b);this.positionsToExtend(d)},_axis:null,axis:function(a){if(arguments.length===1){this._axis=a;return a}else{return this._axis}},c:null,rootPositionInfo:function(a){if(arguments.length===1){this.c=a;return a}else{return this.c}},_mdxSettings:null,mdxSettings:function(a){if(arguments.length===1){this._mdxSettings=a;return a}else{return this._mdxSettings}},_xmlaDataSource:null,xmlaDataSource:function(a){if(arguments.length===1){this._xmlaDataSource=a;return a}else{return this._xmlaDataSource}},_sourceAxis:null,sourceAxis:function(a){if(arguments.length===1){this._sourceAxis=a;return a}else{return this._sourceAxis}},_positionsToExtend:null,positionsToExtend:function(a){if(arguments.length===1){this._positionsToExtend=a;return a}else{return this._positionsToExtend}},_currentResultAxis:null,currentResultAxis:function(a){if(arguments.length===1){this._currentResultAxis=a;return a}else{return this._currentResultAxis}},q:function(){this.axis(null)},extendAxis:function(a,b){var c=a;var d=this.positionsToExtend();var e=this.currentResultAxis().positionResolver();var f=new $$t.gc(1,a.axisIndex(),this.mdxSettings());var h=d.getEnumerator();while(h.moveNext()){var g=h.current();var i=new $$t.gd(1,c.mdxSettings()._a);var j=new $$t.b4($$t.$f7.$type,0);var k=e.getHostPositionItemInfo(g.position(),g.position().indexOf(g));var m=g.position().getItems().getEnumerator();while(m.moveNext()){var l=m.current();var n;if(l==g){n=new $$t.gi(l.key(),l.key(),(-1),null,null);i.addElement(n);break}n=new $$t.ge(0,l.key(),l.key(),l.depth());i.addElement(n)}var o=$$t.$ci.af($$t.$dm.$type.specialize(String,$.ig.$op.$type),$$t.$ci.u($$t.$dm.$type.specialize(String,$.ig.$op.$type),k.values(),function(p){return p.key()==g.key()}));if(o!=null){if(o.count()==0){j.add(i)}else{this.p(o,i,j,false,true,false)}var q=j.getEnumerator();while(q.moveNext()){var p=q.current();a.addSet(p);f.addSet(p)}}}return f},t:function(a,b){if(this.l!=0){var c=new $$t.gd(1,this.mdxSettings()._a);if(this.l==-1){b.add(c)}this.s(a,c,b);this.p(a,new $$t.gd(1,this.mdxSettings()._a),b,true,false,true)}else{this.p(a,new $$t.gd(1,this.mdxSettings()._a),b,false,false,true)}},s:function(a,b,c){var d=$$t.$ci.z($$t.$dm.$type.specialize(String,$.ig.$op.$type),$$t.$ci.u($$t.$dm.$type.specialize(String,$.ig.$op.$type),a.values(),function(e){return e.positionItemDepth()==a.positionItemDepthMin()}));if(d.count()==0){return}if(this.l==a.positionItemIndex()+1){var f=$$t.$ci.u($$t.$dm.$type.specialize(String,$.ig.$op.$type),a.values(),function(g){return g.positionItemDepth()==0}).getEnumerator();while(f.moveNext()){var e=f.current();var g=b.clone();var h=new $$t.ge(0,e.positionItem().key(),e.positionItem().key(),0);g.addElement(h);c.add(g);this.u(e);if(e.count()==0){this.n(this.sourceAxis(),e.positionItemIndex()+1,g)}else{this.s(e,g,c)}}}else{var i=d.item(0);var j=new $$t.gh(i.hierarchyLevelKey(),i.hierarchyLevelKey(),a.positionItemDepthMin());b.addElement(j);this.u(i);if(i.count()==0){if(this.l!=-1){c.add(b)}this.n(this.sourceAxis(),i.positionItemIndex()+1,b)}else{this.s(i,b,c)}}},createAxis:function(a){if(this.axis()!=null){return this.axis()}if(this.rootPositionInfo()==null){this.axis(this.createAxis1(a,this.sourceAxis()));return this.axis()}this.r(a);this.u(this.rootPositionInfo());if(this.rootPositionInfo().count()==0){this.axis(this.createAxis1(a,this.sourceAxis()));return this.axis()}var b=new $$t.b4($$t.$f7.$type,0);this.t(this.rootPositionInfo(),b);var c=new $$t.gc(1,a,this.mdxSettings());var e=b.getEnumerator();while(e.moveNext()){var d=e.current();c.addSet(d)}this.axis(c);return c},r:function(a){var b=this.xmlaDataSource().columnAxis().count()>0;var c=this.xmlaDataSource().rowAxis().count()>0;var d=this.xmlaDataSource().measures().count()>1;if(d){if(a==0){if(b){if(this.xmlaDataSource().measureListLocation()==1){this.l=this.xmlaDataSource().measureListIndex()}}else if(c&&this.xmlaDataSource().measureListLocation()==0){this.l=this.xmlaDataSource().measureListIndex()}}else if(a==1&&c&&this.xmlaDataSource().measureListLocation()==0){this.l=this.xmlaDataSource().measureListIndex()}}var f=this.xmlaDataSource().measures().getEnumerator();while(f.moveNext()){var e=f.current();this.i.add(e.uniqueName())}},u:function(a){if(this.sourceAxis()!=null){var b=a.positionItemIndex()+1;if(b<this.sourceAxis().count()){var c=this.sourceAxis().item(b);var d=$b($$t.$fk.$type,c);if(d!=null){var e=$$t.$ci.z($$t.$dm.$type.specialize(String,$.ig.$op.$type),a.values());var g=e.getEnumerator();while(g.moveNext()){var f=g.current();if(!this.i.contains(f.key())){a.remove(f.key())}}}var h=$b($$t.$cx.$type,c);if(h!=null){var i=$$t.$ci.af($$t.$dm.$type.specialize(String,$.ig.$op.$type),a.values());if(i!=null){if(i.hierarchyKey()!=h.uniqueName()){a.clear()}}}}else{a.clear()}}},createAxis1:function(a,b){var c=new $$t.gd(1,this.mdxSettings()._a);this.n(b,0,c);var d=new $$t.gc(1,a,this.mdxSettings());d.addSet(c);return d},n:function(a,b,c){var $self=this;if(a==null){return}for(var d=b;d<a.count();d++){var e=a.item(d);var f=$b($$t.$cx.$type,e);if(f!=null){if(f.allMember()==null){var g=$$t.$ci.z($$t.$cp.$type,this.xmlaDataSource().getCoreElements(function(h){return h.hierarchyUniqueName()==f.uniqueName()},$$t.$c0.$type));var h=g.item(0);c.addElement(new $$t.gh(h.uniqueName(),h.uniqueName(),0))}else{c.addElement(new $$t.ge(0,f.defaultMember(),f.defaultMember(),0))}continue}var i=$b($$t.$c0.$type,e);if(i!=null){var j;if(!function(){var k=$self.h.tryGetValue(i.hierarchyUniqueName(),j);j=k.p1;return k.ret}()){j=new $$t.ga;c.addElement(j);this.h.add(i.hierarchyUniqueName(),j)}j.addElement(new $$t.gh(i.uniqueName(),i.uniqueName(),i.depth()));continue}var k=$b($$t.$fk.$type,e);if(k!=null){var l=new $$t.ga;var n=k.measures().getEnumerator();while(n.moveNext()){var m=n.current();l.addElement(new $$t.ge(0,m.uniqueName(),m.uniqueName(),0))}c.addElement(l)}}},o:function(a,b,c,d,e,f,g){var h=c.clone();h.addElement(new $$t.ge(0,b.key(),b.key(),b.positionItemDepth()));this.u(b);if(b.count()==0){if(e){if(f){d.add(h);this.n(this.sourceAxis(),b.positionItemIndex()+1,h)}}else{d.add(h);this.n(this.sourceAxis(),b.positionItemIndex()+1,h)}}else{this.p(b,h,d,e,f,g)}if(g&&b.isExpanded()){this.m(b,d,a,c)}},m:function(a,b,c,d){var e=$$t.$ci.z($$t.$dm.$type.specialize(String,$.ig.$op.$type),$$t.$ci.u($$t.$dm.$type.specialize(String,$.ig.$op.$type),c.values(),function(f){return f.parentKey()==a.key()}));if(e.count()>0){var f=d.clone();f.addElement(new $$t.gi(a.key(),a.key(),a.positionItemDepth(),null,null));this.u(a);if(a.count()==0){b.add(f);this.n(this.sourceAxis(),a.positionItemIndex()+1,f)}else{this.p(a,f,b,true,true,false)}}var h=e.getEnumerator();while(h.moveNext()){var g=h.current();var i=d.clone();i.addElement(new $$t.ge(0,g.key(),g.key(),g.positionItemDepth()));this.u(g);if(g.isExpanded()){this.m(g,b,c,d)}this.p(g,i,b,true,false,true)}},p:function(a,b,c,d,e,f){var g=$$t.$ci.z($$t.$dm.$type.specialize(String,$.ig.$op.$type),$$t.$ci.u($$t.$dm.$type.specialize(String,$.ig.$op.$type),a.values(),function(h){return h.positionItemDepth()==a.positionItemDepthMin()}));if(g.count()==0){return}var i=g.getEnumerator();while(i.moveNext()){var h=i.current();this.o(a,h,b,c,d,e,f)}},$type:new $.ig.Type("MdxDimensionAxisProvider",$.ig.$ot,[$$t.$f3.$type])},true);$c("MdxSlicerAxisProvider:gk","Object",{c:null,e:null,d:null,init:function(a,b,c,d,e){this.c=new $$t.b4($$t.$fj.$type,0);this.e=new $$t.b4($$t.$fj.$type,0);this.d=new $$t.b4($$t.$fj.$type,0);$.ig.$op.init.call(this);this.dataSource(a);this.mdxSettings(e);this.c=b;this.e=c;this.d=d},_dataSource:null,dataSource:function(a){if(arguments.length===1){this._dataSource=a;return a}else{return this._dataSource}},_mdxSettings:null,mdxSettings:function(a){if(arguments.length===1){this._mdxSettings=a;return a}else{return this._mdxSettings}},createAxis:function(a){var b=new $$t.gl(this.mdxSettings()._c);b.axisIndex(a);b.columnsFilter($$t.$gq.a(this.c,b));b.rowsFilter($$t.$gq.a(this.e,b));b.filtersFilter($$t.$gq.a(this.d,b));b.measureFilter($$t.$gq.b(this.dataSource().measures(),b));return b},$type:new $.ig.Type("MdxSlicerAxisProvider",$.ig.$ot,[$$t.$f4.$type])},true);$c("MdxSlicerAxisBuilder:gq","Object",{init:function(){$.ig.$op.init.call(this)},b:function(a,b){if($$t.$ci.aj($$t.$c2.$type,a)==0){return null}var c=new $$t.gr;var d=new $$t.ga;var f=a.getEnumerator();while(f.moveNext()){var e=f.current();var g=new $$t.ge(0,e.uniqueName(),e.uniqueName(),0);d.addElement(g)}var h=new $$t.gs;h.addElement(c);b.addSet(h);c.addFilterPart(d,true);return c},a:function(a,b){var c=new $$t.gr;for(var d=0;d<a.count();d++){var e=a.item(d);var f=new $$t.ga;var g=new $$t.bc(String,$$t.$ge.$type,0);var i=e._a.getEnumerator();while(i.moveNext()){var h=i.current();var j;if(!function(){var k=g.tryGetValue(h,j);j=k.p1;return k.ret}()){j=new $$t.ge(0,h,h,(-1));g.add(h,j)}f.addElement(j)}c.addFilterPart(f,false)}if(c.filterCollection().count()==0&&c.singleFilterElements().count()==0){return null}var k=new $$t.gs;k.addElement(c);b.addSet(k);return c},$type:new $.ig.Type("MdxSlicerAxisBuilder",$.ig.$ot)},true);$c("IXmlaDataProviderFactory:it","Object",{$type:new $.ig.Type("IXmlaDataProviderFactory",null,[$$t.$e8.$type])},true);$c("DefaultXmlaDataProviderFactory:is","Object",{b:null,a:null,init:function(a,b){$.ig.$op.init.call(this);this.b=a;this.a=b},createDataProvider:function(){return new $$t.ix(new $$t.iu(new $$t.hy(0,this.b),this.a),null)},$type:new $.ig.Type("DefaultXmlaDataProviderFactory",$.ig.$ot,[$$t.$it.$type])},true);$c("RemoteXmlaDataProviderFactory:jf","Object",{a:null,b:null,d:null,c:null,init:function(a){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break;case 2:this.init2.apply(this,arguments);break}return}$.ig.$op.init.call(this);this.a=new $$t.bu;this.b=new $$t.b1},init1:function(a,b,c){$.ig.$op.init.call(this);this.a=new $$t.bu;this.b=new $$t.b1;this.d=b;this.c=c},init2:function(a,b,c){$.ig.$op.init.call(this);this.a=b;this.b=c},createDataProvider:function(){return new $$t.jg(this.d,this.c,this.a,this.b)},$type:new $.ig.Type("RemoteXmlaDataProviderFactory",$.ig.$ot,[$$t.$it.$type])},true);$c("IXmlaDataProvider:iy","Object",{$type:new $.ig.Type("IXmlaDataProvider",null,[$$t.$e9.$type,$$t.$gv.$type])},true);$c("RemoteXmlaDataProvder:jg","Object",{e:null,d:null,a:null,b:null,init:function(a,b,c,d){$.ig.$op.init.call(this);this.e=a;this.d=b;this.a=c;this.b=d},discoverCatalogsAsync:function(a,b){var c=this.b;return this.f(0,a,b,null,null).k($$t.$a7.$type.specialize($$t.$co.$type),function(d){return c.deserializeResponse(d.n(),0)})},discoverCubesAsync:function(a,b){var c=this.b;return this.f(1,a,b,null,null).k($$t.$a7.$type.specialize($$t.$cr.$type),function(d){return c.deserializeResponse(d.n(),1)})},discoverDimensionsAsync:function(a,b){var c=this.b;return this.f(2,a,b,null,null).k($$t.$a7.$type.specialize($$t.$cu.$type),function(d){return c.deserializeResponse(d.n(),2)})},discoverHierarchiesAsync:function(a,b){var c=this.b;return this.f(3,a,b,null,null).k($$t.$a7.$type.specialize($$t.$cx.$type),function(d){return c.deserializeResponse(d.n(),3)})},discoverLevelsAsync:function(a,b){var c=this.b;return this.f(4,a,b,null,null).k($$t.$a7.$type.specialize($$t.$c0.$type),function(d){return c.deserializeResponse(d.n(),4)})},discoverMeasuresAsync:function(a,b){var c=this.b;return this.f(5,a,b,null,null).k($$t.$a7.$type.specialize($$t.$c2.$type),function(d){return c.deserializeResponse(d.n(),5)})},discoverMeasureGroupsAsync:function(a,b){var c=this.b;return this.f(6,a,b,null,null).k($$t.$a7.$type.specialize($$t.$c5.$type),function(d){return c.deserializeResponse(d.n(),6)})},discoverMeasureGroupDimensionsAsync:function(a,b){var c=this.b;return this.f(7,a,b,null,null).k($$t.$a7.$type.specialize($$t.$c7.$type),function(d){return c.deserializeResponse(d.n(),7)})},discoverMembersAsync:function(a,b){var c=this.b;return this.f(8,a,b,null,null).k($$t.$a7.$type.specialize($$t.$da.$type),function(d){return c.deserializeResponse(d.n(),8)})},discoverKpisAsync:function(a,b){var c=this.b;return this.f(9,a,b,null,null).k($$t.$a7.$type.specialize($$t.$de.$type),function(d){return c.deserializeResponse(d.n(),9)})},executeStatementAsync:function(a,b,c){var d=this.b;return this.f(10,b,null,c,a).k($$t.$dh.$type,function(e){return d.deserializeResponse(e.n(),10)})},f:function(a,b,c,d,e){var $self=this;var f=function(){var $ret=new $$t.h6;$ret._a=$self.d;return $ret}();var g=this.a.serializeRequest(function(){var $ret=new $$t.ba;$ret._a=a;$ret._c=$self.c(b);$ret._d=$self.c(c);$ret._b=$self.c(d);$ret._e=e;return $ret}());var h=new $$t.el(String,0);f.uploadStringCompleted=$.ig.Delegate.prototype.combine(f.uploadStringCompleted,this.g.runOn(this));f.k(new $$t.hy(0,this.e),"POST",g,h);return h._b},g:function(a,b){var c=b.userState();if(b.cancelled()){c.c()}else if(b.error()!=null){c.d(b.error())}else{c.e(b.result())}},c:function(a){if(a==null){return null}var b=new $$t.bc(String,String,0);var d=a.getEnumerator();while(d.moveNext()){var c=d.current();b.add(c._a,c._b)}return b},$type:new $.ig.Type("RemoteXmlaDataProvder",$.ig.$ot,[$$t.$iy.$type])},true);$c("ICoreXmlaConnection:iv","Object",{$type:new $.ig.Type("ICoreXmlaConnection",null,[$$t.$iw.$type])},true);$c("XmlaConnection:iu","Object",{b:null,a:null,init:function(a,b){$.ig.$op.init.call(this);this.b=a;this.a=b},getXmlaSoapWebClient$1:function($t){var a=new $$t.hv($t,this.b,$$t.$h0.uTF8());a._e=this.a;return a},$type:new $.ig.Type("XmlaConnection",$.ig.$ot,[$$t.$iv.$type])},true);$c("XmlaDataSourceImpl:jh","MdxDataSourceImpl",{init:function(a){$$t.$d4.init.call(this,a);this.xmlaSourceOptions(a)},_xmlaSourceOptions:null,xmlaSourceOptions:function(a){if(arguments.length===1){this._xmlaSourceOptions=a;return a}else{return this._xmlaSourceOptions}},am:function(a){var $self=this;var b=this.dataProviderFactory().createDataProvider();var c=this.getProviderDefaultRestrictions();this.bn(c,"CATALOG_NAME",a);var d=this.getProviderDefaultProperties();this.bn(d,"Catalog",a);var e=b.discoverCubesAsync(d,c).k($$t.$b3.$type.specialize($$t.$cr.$type),function(f){$self.cubes($self.a3($$t.$cr.$type,f.n()));return $self.cubes()});return e},ao:function(){var $self=this;var a=this.catalog().name();var b=this.cube().name();var c=this.dataProviderFactory().createDataProvider();var d=this.getProviderDefaultRestrictions();this.bn(d,"CATALOG_NAME",a);this.bn(d,"CUBE_NAME",b);var e=this.getProviderDefaultProperties();this.bn(e,"Catalog",a);var f=c.discoverMeasureGroupsAsync(e,d).k($$t.$b3.$type.specialize($$t.$c5.$type),function(g){$self.measureGroups($self.a3($$t.$c5.$type,g.n()));return $self.measureGroups()});return f},h:function(){return new $$t.is(this.xmlaSourceOptions().serverUrl(),this.xmlaSourceOptions().requestOptions())},getProviderDefaultProperties:function(){var a=new $$t.b4($$t.$fa.$type,0);if(this.mdxSourceOptions().discoverProperties()!=null){var c=this.mdxSourceOptions().discoverProperties().getEnumerator();while(c.moveNext()){var b=c.current();var d=new $$t.hn(1,b.key(),b.value());a.add(function(){var $ret=new $$t.fa;$ret._a=d._a;$ret._b=d._c;return $ret}())}}if(this.catalog()!=null){this.bn(a,"Catalog",this.catalog().name())}return a},$type:new $.ig.Type("XmlaDataSourceImpl",$$t.$d4.$type)},true);$c("XmlaDiscoverProperties:jk","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("XmlaDiscoverProperties",$.ig.$ot)},true);$c("XmlaDataSourceOptions:ji","MdxDataSourceOptions",{init:function(){$$t.$fs.init.call(this)},_serverUrl:null,serverUrl:function(a){if(arguments.length===1){this._serverUrl=a;return a}else{return this._serverUrl}},_requestOptions:null,requestOptions:function(a){if(arguments.length===1){this._requestOptions=a;return a}else{return this._requestOptions}},$type:new $.ig.Type("XmlaDataSourceOptions",$$t.$fs.$type)},true);$c("RequestOptions:jj","NetworkCredential",{init:function(a,b,c){if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}$$t.$jj.init1.call(this,1,b,c,String.empty())},init1:function(a,b,c,d){$$t.$hx.init1.call(this,1,b,c,d)},$type:new $.ig.Type("RequestOptions",$$t.$hx.$type)},true);$c("XmlaSampleClass:jl","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("XmlaSampleClass",$.ig.$ot)},true);$c("CustomRemoteXmlaRequestSerializer:jm","Object",{a:null,init:function(a){$.ig.$op.init.call(this);this.a=a},serializeRequest:function(a){return this.a(a)},deserializeRequest:function(a){throw new $$t.y(0)},$type:new $.ig.Type("CustomRemoteXmlaRequestSerializer",$.ig.$ot,[$$t.$a.$type])},true);$c("CustomRemoteXmlaResponseSerializer:jn","Object",{a:null,init:function(a){$.ig.$op.init.call(this);this.a=a},serializeResponse:function(a,b){throw new $$t.y(0)},deserializeResponse:function(a,b){return this.a(a,b)},$type:new $.ig.Type("CustomRemoteXmlaResponseSerializer",$.ig.$ot,[$$t.$bt.$type])},true);$c("OlapXmlaDataSource:jo","DataSourceBase",{staticInit:function(){$$t.$jo.a5()},init:function(a){$$t.$jp.init.call(this);var b=$$t.$b0.getJavascriptObjectProperty(a,"serverUrl");var c=$$t.$b0.getJavascriptObjectProperty(a,"catalog");var d=$$t.$b0.getJavascriptObjectProperty(a,"cube");var e=$$t.$b0.getJavascriptObjectProperty(a,"measures");var f=$$t.$b0.getJavascriptObjectProperty(a,"measureGroup");var g=$$t.$b0.getJavascriptObjectProperty(a,"filters");var h=$$t.$b0.getJavascriptObjectProperty(a,"columns");var i=$$t.$b0.getJavascriptObjectProperty(a,"rows");var j=$$t.$b0.getJavascriptObjectProperty(a,"requestOptions");var k=$$t.$b0.getJavascriptObjectProperty(a,"enableResultCache");var l=true;if(k!=null){l=k}var m=$$t.$b0.convertToStringDictionary($$t.$b0.getJavascriptObjectProperty(a,"discoverProperties"));var n=$$t.$b0.convertToStringDictionary($$t.$b0.getJavascriptObjectProperty(a,"executeProperties"));var o=$$t.$b0.getJavascriptObjectProperty(a,"isRemote");if(o){if(j==null){j={}}var ro_=j;ro_.isCrossDomain=false}var p=$$t.$b0.getJavascriptObjectProperty(a,"serializeRequest");var q=$$t.$b0.getJavascriptObjectProperty(a,"deserializeResponse");var r=this.a0(a);var s=function(){var $ret=new $$t.ji;$ret.serverUrl(b);$ret.requestOptions(j);$ret.catalog(c);$ret.cube(d);$ret.measures(e);$ret.measureGroup(f);$ret.filters(g);$ret.columns(h);$ret.rows(i);$ret.discoverProperties(m);$ret.executeProperties(n);$ret.enableResultCache(l);$ret.mdxSettings(r);return $ret}();if(o){var t=null;var u=null;if(p!=null){t=new $$t.jm(p)}if(q!=null){u=new $$t.jn(q)}var v=new $$t.jf(1,b,j);s.dataProviderFactory(v)}this.dataSource(new $$t.jh(s))},catalogs:function(){return this.dataSource().catalogs().inner()},catalog:function(){return this.dataSource().catalog();
},setCatalog:function(a){return this.dataSource().setCatalog(a).k(Array,function(b){return b.n().inner()})._d},measureGroups:function(){return this.dataSource().measureGroups().inner()},measureGroup:function(){return this.dataSource().measureGroup()},setMeasureGroup:function(a){return this.dataSource().setMeasureGroup(a).k($$t.$d7.$type,function(b){return b.n()})._d},a0:function(a){var b=new $$t.ft;var c=$$t.$b0.getJavascriptObjectProperty(a,"mdxSettings");if(c==null){return b}var d=$$t.$b0.getJavascriptObjectProperty(c,"nonEmptyOnRows");if(d!=null){b.y(d)}var e=$$t.$b0.getJavascriptObjectProperty(c,"nonEmptyOnColumns");if(e!=null){b.x(e)}var f=$$t.$b0.getJavascriptObjectProperty(c,"addCalculatedMembersOnRows");if(f!=null){b.q(f)}var g=$$t.$b0.getJavascriptObjectProperty(c,"addCalculatedMembersOnColumns");if(g!=null){b.p(g)}var h=$$t.$b0.getJavascriptObjectProperty(c,"dimensionPropertiesOnRows");if(h!=null){for(var i=0;i<h.count();i++){b._ac.add(h.item(i))}}var j=$$t.$b0.getJavascriptObjectProperty(c,"dimensionPropertiesOnColumns");if(j!=null){for(var k=0;k<j.count();k++){b._ab.add(j.item(k))}}return b},a5:function(){$.ig.XObject.prototype.toString=function(){if(this.backingNode()!=null){return $.ig.XmlUtils.prototype.xmlNodeToString(this.backingNode())}else{return""}}},$type:new $.ig.Type("OlapXmlaDataSource",$$t.$jp.$type)},true);$c("XmlaDataProvider:ix","Object",{a:null,b:null,init:function(a,b){$.ig.$op.init.call(this);this.a=a;this.b=b},discoverCatalogsAsync:function(a,b){return this.c($$t.$co.$type,new $$t.iz,"DBSCHEMA_CATALOGS",a,b)},discoverCubesAsync:function(a,b){return this.c($$t.$cr.$type,new $$t.i0,"MDSCHEMA_CUBES",a,b)},discoverDimensionsAsync:function(a,b){return this.c($$t.$cu.$type,new $$t.i1,"MDSCHEMA_DIMENSIONS",a,b)},discoverHierarchiesAsync:function(a,b){return this.c($$t.$cx.$type,new $$t.i2,"MDSCHEMA_HIERARCHIES",a,b)},discoverLevelsAsync:function(a,b){return this.c($$t.$c0.$type,new $$t.i3,"MDSCHEMA_LEVELS",a,b)},discoverMeasuresAsync:function(a,b){return this.c($$t.$c2.$type,new $$t.i4,"MDSCHEMA_MEASURES",a,b)},discoverMeasureGroupsAsync:function(a,b){return this.c($$t.$c5.$type,new $$t.i5,"MDSCHEMA_MEASUREGROUPS",a,b)},discoverMeasureGroupDimensionsAsync:function(a,b){return this.c($$t.$c7.$type,new $$t.i6,"MDSCHEMA_MEASUREGROUP_DIMENSIONS",a,b)},discoverMembersAsync:function(a,b){return this.c($$t.$da.$type,new $$t.i7,"MDSCHEMA_MEMBERS",a,b)},discoverKpisAsync:function(a,b){return this.c($$t.$de.$type,new $$t.i8,"MDSCHEMA_KPIS",a,b)},executeStatementAsync:function(a,b,c){var $self=this;var d=new $$t.el($$t.$dh.$type,0);var e=this.a.getXmlaSoapWebClient$1($$t.$hj.$type);var f=new $$t.i9;e.requestCompleted=$.ig.Delegate.prototype.combine(e.requestCompleted,function(g,h){$self.e($$t.$dh.$type,f,h,d)});var g=new $$t.ht(a);this.g(g,b,c);e.j(g);return d._b},c:function($t,a,b,c,d){var $self=this;var e=new $$t.el($$t.$a7.$type.specialize($t),0);var f=this.a.getXmlaSoapWebClient$1($$t.$gw.$type);f.requestCompleted=$.ig.Delegate.prototype.combine(f.requestCompleted,function(g,h){$self.d($t,a,h,e)});var g=new $$t.hs(b);this.f(g,c,d);f.j(g);return e._b},f:function(a,b,c){if(c!=null){var e=c.getEnumerator();while(e.moveNext()){var d=e.current();a.restrictions().add(d._a,d._b)}}if(b!=null){var g=b.getEnumerator();while(g.moveNext()){var f=g.current();a.properties().add$1(new $$t.hn(1,f._a,f._b))}}if(this.b!=null){this.b(a)}},g:function(a,b,c){if(c!=null){var e=c.getEnumerator();while(e.moveNext()){var d=e.current()}}if(b!=null){var g=b.getEnumerator();while(g.moveNext()){var f=g.current();a.properties().add$1(new $$t.hn(1,f._a,f._b))}}if(this.b!=null){this.b(a)}},d:function($t,a,b,c){if(b.error()!=null){c.d(b.error())}else if(b.cancelled()){c.c()}else{var d=b.result();if(d!=null){var e=new $$t.ja;var f=e.a($t,b.result().returnElement(),$$t.$hc.get("row",$$t.$ho.e),a);c.e(f)}}},e:function($t,a,b,c){if(b.error()!=null){c.d(b.error())}else if(b.cancelled()){c.c()}else{var d=b.result();if(d!=null){var e=a.deserialize(b.result().returnElement());c.e(e)}}},$type:new $.ig.Type("XmlaDataProvider",$.ig.$ot,[$$t.$iy.$type])},true);$c("ArraySerializer:ja","Object",{init:function(){$.ig.$op.init.call(this)},a:function($t,a,b,c){var d=new $$t.b4($t,0);var f=a.elements1(b).getEnumerator();while(f.moveNext()){var e=f.current();d.add(c.deserialize(e))}return d},$type:new $.ig.Type("ArraySerializer",$.ig.$ot)},true);$c("IXmlTypeSerializer$1:ie","Object",{$type:new $.ig.Type("IXmlTypeSerializer$1",null)},true);$c("AxisXmlTypeSerializer:jb","Object",{init:function(){$.ig.$op.init.call(this);if($$t.$jb.a!=null){return}$$t.$jb.a=new $$t.bc(String,$$t.$hc.$type,0);$$t.$jb.a.item("0",$$t.$hc.get("Tuple",$$t.$ho.d));$$t.$jb.a.item("1",$$t.$hc.get("Tuples",$$t.$ho.d))},deserialize:function(a){if(a.nodeType()!=1){return null}var b=a;var c=$$t.$ih.e(b.attribute($$t.$hc.get("name","")));var d=b.element($$t.$jb.a.item("1"));var e=new $$t.ja;var f=e.a($$t.$dv.$type,d,$$t.$jb.a.item("0"),new $$t.jc);var g=0;if(f.count()>0){g=f.__inner[0].members().count()}return function(){var $ret=new $$t.di(f,g);$ret.name(c);return $ret}()},$type:new $.ig.Type("AxisXmlTypeSerializer",$.ig.$ot,[$$t.$ie.$type.specialize($$t.$di.$type)])},true);$c("TupleXmlTypeSerializer:jc","Object",{init:function(){$.ig.$op.init.call(this);if($$t.$jc.a!=null){return}$$t.$jc.a=new $$t.bc(String,$$t.$hc.$type,0);$$t.$jc.a.item("0",$$t.$hc.get("Member",$$t.$ho.d))},deserialize:function(a){if(a.nodeType()!=1){return null}var b=a;var c=new $$t.ja;var d=c.a($$t.$dw.$type,b,$$t.$jc.a.item("0"),new $$t.jd);var e=new $$t.dv(d);var g=d.getEnumerator();while(g.moveNext()){var f=g.current();f.position(e)}return e},$type:new $.ig.Type("TupleXmlTypeSerializer",$.ig.$ot,[$$t.$ie.$type.specialize($$t.$dv.$type)])},true);$c("AxisMemberXmlTypeSerializer:jd","Object",{init:function(){$.ig.$op.init.call(this);if($$t.$jd.a!=null){return}$$t.$jd.a=new $$t.bc(String,$$t.$hc.$type,0);$$t.$jd.a.item("0",$$t.$hc.get("UName",$$t.$ho.d));$$t.$jd.a.item("1",$$t.$hc.get("LName",$$t.$ho.d));$$t.$jd.a.item("2",$$t.$hc.get("Caption",$$t.$ho.d));$$t.$jd.a.item("3",$$t.$hc.get("LNum",$$t.$ho.d));$$t.$jd.a.item("4",$$t.$hc.get("DisplayInfo",$$t.$ho.d))},deserialize:function(a){if(a.nodeType()!=1){return null}var b=a;var c=$$t.$ih.f(b.element($$t.$jd.a.item("0")));var d=$$t.$ih.f(b.element($$t.$jd.a.item("1")));var e=$$t.$ih.f(b.element($$t.$jd.a.item("2")));var f=$$t.$ih.f(b.element($$t.$jd.a.item("3")));var g=$$t.$ih.f(b.element($$t.$jd.a.item("4")));var h=b.attribute($$t.$hc.get("Hierarchy","")).value();var i=function(){var $ret=new $$t.dw;$ret.hierarchyUniqueName(h);$ret.levelUniqueName(d);$ret.levelNumber($$t.$r.parseInt(f));$ret.uniqueName(c);$ret.caption(e);$ret.displayInfo(String.isNullOrEmpty(g)?0:$i($$t.$r.parseInt(g)));return $ret}();var k=b.elements().getEnumerator();while(k.moveNext()){var j=k.current();switch(j.name().localName()){case"UName":case"LName":case"Caption":case"LNum":case"DisplayInfo":continue;default:i.properties().add(j.name().localName(),j.value());break}}return i},$type:new $.ig.Type("AxisMemberXmlTypeSerializer",$.ig.$ot,[$$t.$ie.$type.specialize($$t.$dw.$type)])},true);$c("CellXmlTypeSerializer:je","Object",{init:function(){$.ig.$op.init.call(this)},deserialize:function(a){if(a.nodeType()!=1){return null}var b=a;var c=b.attribute($$t.$hc.get("CellOrdinal","")).value();var d=function(){var $ret=new $$t.dz;$ret.cellOrdinal($$t.$r.parseInt(c));return $ret}();var f=b.elements().getEnumerator();while(f.moveNext()){var e=f.current();d.properties().add(e.name().localName(),e.value())}return d},$type:new $.ig.Type("CellXmlTypeSerializer",$.ig.$ot,[$$t.$ie.$type.specialize($$t.$dz.$type)])},true);$c("CubeXmlTypeSerializer:i0","Object",{init:function(){$.ig.$op.init.call(this)},deserialize:function(a){if(a.nodeType()!=1){return null}var b=a;var c=$$t.$ih.f(b.element($$t.$hc.get("CUBE_NAME",$$t.$ho.e)));var d=$$t.$ih.f(b.element($$t.$hc.get("CUBE_CAPTION",$$t.$ho.e)));var e=$$t.$ih.f(b.element($$t.$hc.get("DESCRIPTION",$$t.$ho.e)));var f;var g=$$t.$ih.f(b.element($$t.$hc.get("CUBE_TYPE",$$t.$ho.e)));switch(g){case"CUBE":f=0;break;case"DIMENSION":f=1;break;default:f=2;break}var h=$$t.$ih.f(b.element($$t.$hc.get("CATALOG_NAME",$$t.$ho.e)));var i=$$t.$ih.b(b.element($$t.$hc.get("LAST_DATA_UPDATE",$$t.$ho.e)));var j=$$t.$ih.b(b.element($$t.$hc.get("LAST_SCHEMA_UPDATE",$$t.$ho.e)));return function(){var $ret=new $$t.cr;$ret.name(c);$ret.caption(d);$ret.description(e);$ret.cubeType(f);$ret.catalogName(h);$ret.lastProcessed(i);$ret.lastUpdated(j);return $ret}()},$type:new $.ig.Type("CubeXmlTypeSerializer",$.ig.$ot,[$$t.$ie.$type.specialize($$t.$cr.$type)])},true);$c("DatabaseXmlTypeSerializer:iz","Object",{init:function(){$.ig.$op.init.call(this)},deserialize:function(a){if(a.nodeType()!=1){return null}var b=a;var c=$$t.$ih.f(b.element($$t.$hc.get("CATALOG_NAME",$$t.$ho.e)));var d=$$t.$ih.f(b.element($$t.$hc.get("DESCRIPTION",$$t.$ho.e)));return function(){var $ret=new $$t.co;$ret.name(c);$ret.caption(c);$ret.uniqueName(c);$ret.description(d);return $ret}()},$type:new $.ig.Type("DatabaseXmlTypeSerializer",$.ig.$ot,[$$t.$ie.$type.specialize($$t.$co.$type)])},true);$c("DimensionXmlTypeSerializer:i1","Object",{init:function(){$.ig.$op.init.call(this);if($$t.$i1.a!=null){return}$$t.$i1.a=new $$t.bc(String,$$t.$hc.$type,0);$$t.$i1.a.item("DIMENSION_NAME",$$t.$hc.get("DIMENSION_NAME",$$t.$ho.e));$$t.$i1.a.item("DIMENSION_UNIQUE_NAME",$$t.$hc.get("DIMENSION_UNIQUE_NAME",$$t.$ho.e));$$t.$i1.a.item("DIMENSION_CAPTION",$$t.$hc.get("DIMENSION_CAPTION",$$t.$ho.e));$$t.$i1.a.item("DESCRIPTION",$$t.$hc.get("DESCRIPTION",$$t.$ho.e));$$t.$i1.a.item("DIMENSION_TYPE",$$t.$hc.get("DIMENSION_TYPE",$$t.$ho.e));$$t.$i1.a.item("DEFAULT_HIERARCHY",$$t.$hc.get("DEFAULT_HIERARCHY",$$t.$ho.e))},deserialize:function(a){if(a.nodeType()!=1){return null}var b=a;var c=$$t.$ih.f(b.element($$t.$i1.a.item("DIMENSION_NAME")));var d=$$t.$ih.f(b.element($$t.$i1.a.item("DIMENSION_UNIQUE_NAME")));var e=$$t.$ih.f(b.element($$t.$i1.a.item("DIMENSION_CAPTION")));var f=$$t.$ih.f(b.element($$t.$i1.a.item("DESCRIPTION")));var g=$$t.$ih.f(b.element($$t.$i1.a.item("DIMENSION_TYPE")));var h=$$t.$r.parseInt(g);var i=$$t.$ih.f(b.element($$t.$i1.a.item("DEFAULT_HIERARCHY")));return function(){var $ret=new $$t.cu;$ret.name(c);$ret.uniqueName(d);$ret.caption(e);$ret.description(f);$ret.dimensionType(h);$ret.defaultHierarchy(i);return $ret}()},$type:new $.ig.Type("DimensionXmlTypeSerializer",$.ig.$ot,[$$t.$ie.$type.specialize($$t.$cu.$type)])},true);$c("ErrorXmlTypeSerializer:ig","Object",{init:function(){$.ig.$op.init.call(this)},deserialize:function(a){var b=new $$t.hh;var c=a;b.errorCode($$t.$ih.e(c.attribute($$t.$hc.get("ErrorCode",""))));b.description($$t.$ih.e(c.attribute($$t.$hc.get("Description",""))));b.source($$t.$ih.e(c.attribute($$t.$hc.get("Source",""))));b.helpFile($$t.$ih.e(c.attribute($$t.$hc.get("HelpFile",""))));b.severity($$t.$ih.e(c.attribute($$t.$hc.get("Severity",""))));return b},$type:new $.ig.Type("ErrorXmlTypeSerializer",$.ig.$ot,[$$t.$ie.$type.specialize($$t.$hh.$type)])},true);$c("HierarchyXmlTypeSerializer:i2","Object",{init:function(){$.ig.$op.init.call(this);if($$t.$i2.a!=null){return}$$t.$i2.a=new $$t.bc(String,$$t.$hc.$type,0);$$t.$i2.a.item("HIERARCHY_NAME",$$t.$hc.get("HIERARCHY_NAME",$$t.$ho.e));$$t.$i2.a.item("HIERARCHY_UNIQUE_NAME",$$t.$hc.get("HIERARCHY_UNIQUE_NAME",$$t.$ho.e));$$t.$i2.a.item("HIERARCHY_CAPTION",$$t.$hc.get("HIERARCHY_CAPTION",$$t.$ho.e));$$t.$i2.a.item("DESCRIPTION",$$t.$hc.get("DESCRIPTION",$$t.$ho.e));$$t.$i2.a.item("DEFAULT_MEMBER",$$t.$hc.get("DEFAULT_MEMBER",$$t.$ho.e));$$t.$i2.a.item("ALL_MEMBER",$$t.$hc.get("ALL_MEMBER",$$t.$ho.e));$$t.$i2.a.item("DIMENSION_UNIQUE_NAME",$$t.$hc.get("DIMENSION_UNIQUE_NAME",$$t.$ho.e));$$t.$i2.a.item("HIERARCHY_DISPLAY_FOLDER",$$t.$hc.get("HIERARCHY_DISPLAY_FOLDER",$$t.$ho.e));$$t.$i2.a.item("HIERARCHY_ORIGIN",$$t.$hc.get("HIERARCHY_ORIGIN",$$t.$ho.e))},deserialize:function(a){if(a.nodeType()!=1){return null}var b=a;var c=$$t.$ih.f(b.element($$t.$i2.a.item("HIERARCHY_NAME")));var d=$$t.$ih.f(b.element($$t.$i2.a.item("HIERARCHY_UNIQUE_NAME")));var e=$$t.$ih.f(b.element($$t.$i2.a.item("HIERARCHY_CAPTION")));var f=$$t.$ih.f(b.element($$t.$i2.a.item("DESCRIPTION")));var g=$$t.$ih.f(b.element($$t.$i2.a.item("DEFAULT_MEMBER")));var h=$$t.$ih.f(b.element($$t.$i2.a.item("ALL_MEMBER")));var i=$$t.$ih.f(b.element($$t.$i2.a.item("DIMENSION_UNIQUE_NAME")));var j=$$t.$ih.f(b.element($$t.$i2.a.item("HIERARCHY_DISPLAY_FOLDER")));var k=$$t.$ih.f(b.element($$t.$i2.a.item("HIERARCHY_ORIGIN")));var l=k==null?1:$$t.$r.parseInt(k);return function(){var $ret=new $$t.cx;$ret.name(c);$ret.uniqueName(d);$ret.caption(e);$ret.description(f);$ret.defaultMember(g);$ret.allMember(h);$ret.dimensionUniqueName(i);$ret.hierarchyDisplayFolder(j);$ret.hierarchyOrigin(l);return $ret}()},$type:new $.ig.Type("HierarchyXmlTypeSerializer",$.ig.$ot,[$$t.$ie.$type.specialize($$t.$cx.$type)])},true);$c("KpiXmlTypeSerializer:i8","Object",{init:function(){$.ig.$op.init.call(this)},deserialize:function(a){if(a.nodeType()!=1){return null}var b=a;var c=$$t.$ih.f(b.element($$t.$hc.get("KPI_NAME",$$t.$ho.e)));var d=c;var e=$$t.$ih.f(b.element($$t.$hc.get("KPI_CAPTION",$$t.$ho.e)));var f=$$t.$ih.f(b.element($$t.$hc.get("KPI_DESCRIPTION",$$t.$ho.e)));var g=$$t.$ih.f(b.element($$t.$hc.get("MEASUREGROUP_NAME",$$t.$ho.e)));var h=$$t.$ih.f(b.element($$t.$hc.get("KPI_DISPLAY_FOLDER",$$t.$ho.e)));var i=$$t.$ih.f(b.element($$t.$hc.get("KPI_VALUE",$$t.$ho.e)));var j=$$t.$ih.f(b.element($$t.$hc.get("KPI_GOAL",$$t.$ho.e)));var k=$$t.$ih.f(b.element($$t.$hc.get("KPI_STATUS",$$t.$ho.e)));var l=$$t.$ih.f(b.element($$t.$hc.get("KPI_TREND",$$t.$ho.e)));var m=$$t.$ih.f(b.element($$t.$hc.get("KPI_WEIGHT",$$t.$ho.e)));var n=$$t.$ih.f(b.element($$t.$hc.get("KPI_STATUS_GRAPHIC",$$t.$ho.e)));var o=$$t.$ih.f(b.element($$t.$hc.get("KPI_TREND_GRAPHIC",$$t.$ho.e)));var p=$$t.$ih.f(b.element($$t.$hc.get("KPI_PARENT_KPI_NAME",$$t.$ho.e)));var q=$$t.$ih.f(b.element($$t.$hc.get("KPI_CURRENT_TIME_MEMBER",$$t.$ho.e)));return function(){var $ret=new $$t.de;$ret.name(c);$ret.uniqueName(d);$ret.caption(e);$ret.description(f);$ret.measureGroupName(g);$ret.kpiDisplayFolder(h);$ret.kpiValue(i);$ret.kpiGoal(j);$ret.kpiStatus(k);$ret.kpiTrend(l);$ret.kpiStatusGraphic(n);$ret.kpiTrendGraphic(o);$ret.kpiWeight(m);$ret.parentKpiName(p);$ret.currentTimeMember(q);return $ret}()},$type:new $.ig.Type("KpiXmlTypeSerializer",$.ig.$ot,[$$t.$ie.$type.specialize($$t.$de.$type)])},true);$c("LevelXmlTypeSerializer:i3","Object",{init:function(){$.ig.$op.init.call(this)},deserialize:function(a){if(a.nodeType()!=1){return null}var b=a;var c=$$t.$ih.f(b.element($$t.$hc.get("LEVEL_NAME",$$t.$ho.e)));var d=$$t.$ih.f(b.element($$t.$hc.get("LEVEL_UNIQUE_NAME",$$t.$ho.e)));var e=$$t.$ih.f(b.element($$t.$hc.get("LEVEL_CAPTION",$$t.$ho.e)));var f=$$t.$ih.f(b.element($$t.$hc.get("DESCRIPTION",$$t.$ho.e)));var g=$$t.$ih.f(b.element($$t.$hc.get("DIMENSION_UNIQUE_NAME",$$t.$ho.e)));var h=$$t.$ih.f(b.element($$t.$hc.get("HIERARCHY_UNIQUE_NAME",$$t.$ho.e)));var i=$$t.$ih.f(b.element($$t.$hc.get("LEVEL_NUMBER",$$t.$ho.e)));var j=$$t.$ih.f(b.element($$t.$hc.get("LEVEL_CARDINALITY",$$t.$ho.e)));var k=$$t.$ih.f(b.element($$t.$hc.get("LEVEL_ORIGIN",$$t.$ho.e)));var l=$$t.$ih.f(b.element($$t.$hc.get("LEVEL_ORDERING_PROPERTY",$$t.$ho.e)));return function(){var $ret=new $$t.c0;$ret.name(c);$ret.uniqueName(d);$ret.caption(e);$ret.description(f);$ret.dimensionUniqueName(g);$ret.hierarchyUniqueName(h);$ret.depth($$t.$r.parseInt(i));$ret.membersCount($$t.$r.parseInt(j));$ret.levelOrigin(String.isNullOrEmpty(k)?0:$$t.$r.parseInt(k));$ret.levelOrderingProperty(l);return $ret}()},$type:new $.ig.Type("LevelXmlTypeSerializer",$.ig.$ot,[$$t.$ie.$type.specialize($$t.$c0.$type)])},true);$c("MeasureGroupDimensionXmlTypeSerializer:i6","Object",{init:function(){$.ig.$op.init.call(this);if($$t.$i6.a!=null){return}$$t.$i6.a=new $$t.bc(String,$$t.$hc.$type,0);$$t.$i6.a.item("CATALOG_NAME",$$t.$hc.get("CATALOG_NAME",$$t.$ho.e));$$t.$i6.a.item("CUBE_NAME",$$t.$hc.get("CUBE_NAME",$$t.$ho.e));$$t.$i6.a.item("MEASUREGROUP_NAME",$$t.$hc.get("MEASUREGROUP_NAME",$$t.$ho.e));$$t.$i6.a.item("DIMENSION_UNIQUE_NAME",$$t.$hc.get("DIMENSION_UNIQUE_NAME",$$t.$ho.e));$$t.$i6.a.item("MEASUREGROUP_CARDINALITY",$$t.$hc.get("MEASUREGROUP_CARDINALITY",$$t.$ho.e));$$t.$i6.a.item("DIMENSION_CARDINALITY",$$t.$hc.get("DIMENSION_CARDINALITY",$$t.$ho.e));$$t.$i6.a.item("DIMENSION_IS_VISIBLE",$$t.$hc.get("DIMENSION_IS_VISIBLE",$$t.$ho.e));$$t.$i6.a.item("DIMENSION_IS_FACT_DIMENSION",$$t.$hc.get("DIMENSION_IS_FACT_DIMENSION",$$t.$ho.e));$$t.$i6.a.item("DIMENSION_PATH",$$t.$hc.get("DIMENSION_PATH",$$t.$ho.e));$$t.$i6.a.item("DIMENSION_GRANULARITY",$$t.$hc.get("DIMENSION_GRANULARITY",$$t.$ho.e))},deserialize:function(a){if(a.nodeType()!=1){return null}var b=a;var c=$$t.$ih.f(b.element($$t.$i6.a.item("CATALOG_NAME")));var d=$$t.$ih.f(b.element($$t.$i6.a.item("CUBE_NAME")));var e=$$t.$ih.f(b.element($$t.$i6.a.item("MEASUREGROUP_NAME")));var f=$$t.$ih.f(b.element($$t.$i6.a.item("DIMENSION_UNIQUE_NAME")));var g=$$t.$ih.f(b.element($$t.$i6.a.item("MEASUREGROUP_CARDINALITY")));var h=g=="ONE"?0:1;var i=$$t.$ih.f(b.element($$t.$i6.a.item("DIMENSION_CARDINALITY")));var j=i=="ONE"?0:1;var k=$$t.$ih.a(b.element($$t.$i6.a.item("DIMENSION_IS_VISIBLE")));var l=$$t.$ih.a(b.element($$t.$i6.a.item("DIMENSION_IS_FACT_DIMENSION")));var m=$$t.$ih.f(b.element($$t.$i6.a.item("DIMENSION_PATH")));var n=$$t.$ih.f(b.element($$t.$i6.a.item("DIMENSION_GRANULARITY")));return function(){var $ret=new $$t.c7;$ret.catalogName(c);$ret.cubeName(d);$ret.measureGroupName(e);$ret.dimensionUniqueName(f);$ret.measureGroupCardinality(h);$ret.dimensionCardinality(j);$ret.isDimensionVisible(k);$ret.isFactDimension(l);$ret.dimensionPath(m);$ret.dimensionGranularity(n);return $ret}()},$type:new $.ig.Type("MeasureGroupDimensionXmlTypeSerializer",$.ig.$ot,[$$t.$ie.$type.specialize($$t.$c7.$type)])},true);$c("MeasureGroupXmlTypeSerializer:i5","Object",{init:function(){$.ig.$op.init.call(this);if($$t.$i5.a!=null){return}$$t.$i5.a=new $$t.bc(String,$$t.$hc.$type,0);$$t.$i5.a.item("CATALOG_NAME",$$t.$hc.get("CATALOG_NAME",$$t.$ho.e));$$t.$i5.a.item("CUBE_NAME",$$t.$hc.get("CUBE_NAME",$$t.$ho.e));$$t.$i5.a.item("MEASUREGROUP_NAME",$$t.$hc.get("MEASUREGROUP_NAME",$$t.$ho.e));$$t.$i5.a.item("MEASUREGROUP_CAPTION",$$t.$hc.get("MEASUREGROUP_CAPTION",$$t.$ho.e));$$t.$i5.a.item("DESCRIPTION",$$t.$hc.get("DESCRIPTION",$$t.$ho.e))},deserialize:function(a){if(a.nodeType()!=1){return null}var b=a;var c=$$t.$ih.f(b.element($$t.$i5.a.item("CATALOG_NAME")));var d=$$t.$ih.f(b.element($$t.$i5.a.item("CUBE_NAME")));var e=$$t.$ih.f(b.element($$t.$i5.a.item("MEASUREGROUP_NAME")));var f=$$t.$ih.f(b.element($$t.$i5.a.item("MEASUREGROUP_CAPTION")));var g=$$t.$ih.f(b.element($$t.$i5.a.item("DESCRIPTION")));return function(){var $ret=new $$t.c5;$ret.catalogName(c);$ret.cubeName(d);$ret.name(e);$ret.caption(f);$ret.description(g);return $ret}()},$type:new $.ig.Type("MeasureGroupXmlTypeSerializer",$.ig.$ot,[$$t.$ie.$type.specialize($$t.$c5.$type)])},true);$c("MeasureXmlTypeSerializer:i4","Object",{init:function(){$.ig.$op.init.call(this);if($$t.$i4.a!=null){return}$$t.$i4.a=new $$t.bc(String,$$t.$hc.$type,0);$$t.$i4.a.item("MEASURE_NAME",$$t.$hc.get("MEASURE_NAME",$$t.$ho.e));$$t.$i4.a.item("MEASURE_UNIQUE_NAME",$$t.$hc.get("MEASURE_UNIQUE_NAME",$$t.$ho.e));$$t.$i4.a.item("MEASURE_CAPTION",$$t.$hc.get("MEASURE_CAPTION",$$t.$ho.e));$$t.$i4.a.item("DESCRIPTION",$$t.$hc.get("DESCRIPTION",$$t.$ho.e));$$t.$i4.a.item("DEFAULT_FORMAT_STRING",$$t.$hc.get("DEFAULT_FORMAT_STRING",$$t.$ho.e));$$t.$i4.a.item("MEASUREGROUP_NAME",$$t.$hc.get("MEASUREGROUP_NAME",$$t.$ho.e));$$t.$i4.a.item("MEASURE_AGGREGATOR",$$t.$hc.get("MEASURE_AGGREGATOR",$$t.$ho.e));$$t.$i4.a.item("MEASURE_DISPLAY_FOLDER",$$t.$hc.get("MEASURE_DISPLAY_FOLDER",$$t.$ho.e))},deserialize:function(a){if(a.nodeType()!=1){return null}var b=a;var c=$$t.$ih.f(b.element($$t.$i4.a.item("MEASURE_NAME")));var d=$$t.$ih.f(b.element($$t.$i4.a.item("MEASURE_UNIQUE_NAME")));var e=$$t.$ih.f(b.element($$t.$i4.a.item("MEASURE_CAPTION")));var f=$$t.$ih.f(b.element($$t.$i4.a.item("DESCRIPTION")));var g=$$t.$ih.f(b.element($$t.$i4.a.item("DEFAULT_FORMAT_STRING")));var h=$$t.$ih.f(b.element($$t.$i4.a.item("MEASUREGROUP_NAME")));var i=$$t.$ih.f(b.element($$t.$i4.a.item("MEASURE_AGGREGATOR")));var j=$$t.$r.parseInt(i);var k=$$t.$ih.f(b.element($$t.$i4.a.item("MEASURE_DISPLAY_FOLDER")));return function(){var $ret=new $$t.c2;$ret.name(c);$ret.uniqueName(d);$ret.caption(e);$ret.description(f);$ret.defaultFormatString(g);$ret.measureGroupName(h);$ret.aggregatorType(j);$ret.measureDisplayFolder(k);return $ret}()},$type:new $.ig.Type("MeasureXmlTypeSerializer",$.ig.$ot,[$$t.$ie.$type.specialize($$t.$c2.$type)])},true);$c("MemberXmlTypeSerializer:i7","Object",{init:function(){$.ig.$op.init.call(this);if($$t.$i7.a!=null){return}$$t.$i7.a=new $$t.bc(String,$$t.$hc.$type,0);$$t.$i7.a.item("CATALOG_NAME",$$t.$hc.get("CATALOG_NAME",$$t.$ho.e));$$t.$i7.a.item("CUBE_NAME",$$t.$hc.get("CUBE_NAME",$$t.$ho.e));$$t.$i7.a.item("MEMBER_NAME",$$t.$hc.get("MEMBER_NAME",$$t.$ho.e));$$t.$i7.a.item("MEMBER_UNIQUE_NAME",$$t.$hc.get("MEMBER_UNIQUE_NAME",$$t.$ho.e));$$t.$i7.a.item("MEMBER_TYPE",$$t.$hc.get("MEMBER_TYPE",$$t.$ho.e));$$t.$i7.a.item("DIMENSION_UNIQUE_NAME",$$t.$hc.get("DIMENSION_UNIQUE_NAME",$$t.$ho.e));$$t.$i7.a.item("HIERARCHY_UNIQUE_NAME",$$t.$hc.get("HIERARCHY_UNIQUE_NAME",$$t.$ho.e));$$t.$i7.a.item("LEVEL_UNIQUE_NAME",$$t.$hc.get("LEVEL_UNIQUE_NAME",$$t.$ho.e));$$t.$i7.a.item("MEMBER_CAPTION",$$t.$hc.get("MEMBER_CAPTION",$$t.$ho.e));$$t.$i7.a.item("DESCRIPTION",$$t.$hc.get("DESCRIPTION",$$t.$ho.e));$$t.$i7.a.item("LEVEL_NUMBER",$$t.$hc.get("LEVEL_NUMBER",$$t.$ho.e));$$t.$i7.a.item("CHILDREN_CARDINALITY",$$t.$hc.get("CHILDREN_CARDINALITY",$$t.$ho.e));$$t.$i7.a.item("PARENT_UNIQUE_NAME",$$t.$hc.get("PARENT_UNIQUE_NAME",$$t.$ho.e));$$t.$i7.a.item("SCOPE",$$t.$hc.get("SCOPE",$$t.$ho.e));$$t.$i7.a.item("PARENT_LEVEL",$$t.$hc.get("PARENT_LEVEL",$$t.$ho.e))},deserialize:function(a){if(a.nodeType()!=1){return null}var b=a;var c=$$t.$ih.f(b.element($$t.$i7.a.item("CATALOG_NAME")));var d=$$t.$ih.f(b.element($$t.$i7.a.item("CUBE_NAME")));var e=$$t.$ih.f(b.element($$t.$i7.a.item("MEMBER_NAME")));var f=$$t.$ih.f(b.element($$t.$i7.a.item("MEMBER_UNIQUE_NAME")));var g=$$t.$ih.f(b.element($$t.$i7.a.item("MEMBER_TYPE")));var h=$$t.$ih.f(b.element($$t.$i7.a.item("DIMENSION_UNIQUE_NAME")));var i=$$t.$ih.f(b.element($$t.$i7.a.item("HIERARCHY_UNIQUE_NAME")));var j=$$t.$ih.f(b.element($$t.$i7.a.item("LEVEL_UNIQUE_NAME")));var k=$$t.$ih.f(b.element($$t.$i7.a.item("MEMBER_CAPTION")));var l=$$t.$ih.f(b.element($$t.$i7.a.item("DESCRIPTION")));var m=$$t.$ih.f(b.element($$t.$i7.a.item("LEVEL_NUMBER")));var n=$$t.$ih.f(b.element($$t.$i7.a.item("CHILDREN_CARDINALITY")));var o=$$t.$ih.f(b.element($$t.$i7.a.item("PARENT_UNIQUE_NAME")));var p=$$t.$ih.f(b.element($$t.$i7.a.item("SCOPE")));var q=$$t.$ih.f(b.element($$t.$hc.get("PARENT_LEVEL",$$t.$ho.e)));var r=$m($$t.$r.$type,null);return function(){var $ret=new $$t.da;$ret.catalogName(c);$ret.cubeName(d);$ret.dimensionUniqueName(h);$ret.hierarchyUniqueName(i);$ret.levelUniqueName(j);$ret.levelDepth($$t.$r.parseInt(m));$ret.name(e);$ret.uniqueName(f);$ret.memberType($$t.$r.parseInt(g));$ret.caption(k);$ret.childrenCardinality($$t.$r.parseInt(n));$ret.description(l);$ret.parentUniqueName(o);$ret.scope(p==null?r:$m($$t.$r.$type,$$t.$r.parseInt(p)));$ret.parentLevel(String.isNullOrEmpty(q)?0:$$t.$r.parseInt(q));return $ret}()},$type:new $.ig.Type("MemberXmlTypeSerializer",$.ig.$ot,[$$t.$ie.$type.specialize($$t.$da.$type)])},true);$c("ResultXmlTypeSerializer:i9","Object",{init:function(){$.ig.$op.init.call(this)},deserialize:function(a){if(a.nodeType()!=1){return null}var b=a;var c=b.name().namespaceName();switch(c){case $$t.$ho.b:return function(){var $ret=new $$t.dh;$ret.isEmpty(true);return $ret}();case $$t.$ho.d:var d=b.element($$t.$hc.get("OlapInfo",$$t.$ho.d));var e=b.element($$t.$hc.get("Axes",$$t.$ho.d));var f=new $$t.ja;var g=f.a($$t.$di.$type,e,$$t.$hc.get("Axis",$$t.$ho.d),new $$t.jb);var h=b.element($$t.$hc.get("CellData",$$t.$ho.d));var i=f.a($$t.$dz.$type,h,$$t.$hc.get("Cell",$$t.$ho.d),new $$t.je);return function(){var $ret=new $$t.dh;$ret.axes(g);$ret.cells(i);return $ret}()}return null},$type:new $.ig.Type("ResultXmlTypeSerializer",$.ig.$ot,[$$t.$ie.$type.specialize($$t.$dh.$type)])},true);$c("SerializerUtils:ih","Object",{init:function(){$.ig.$op.init.call(this)},f:function(a){if(a!=null){return a.value()}else{return null}},e:function(a){if(a!=null){return a.value()}else{return null}},a:function(a){var b=$$t.$ih.f(a).toLowerCase();return b=="true"},b:function(a){if(a!=null&&!String.isNullOrEmpty(a.value())){return $$t.$ih.d(a.value())}else{return $$t.$ih.c()}},d:function(a){var dateString_=a;var b;b=function(text){var match=/^\s*(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(.*)$/.exec(text);if(!match){throw"Invalid textual date representation."}var year=parseInt(match[1],10);var month=parseInt(match[2],10)-1;var day=parseInt(match[3],10);var hours=parseInt(match[4],10);var minutes=parseInt(match[5],10);var seconds=parseInt(match[6],10);return new Date(year,month,day,hours,minutes,seconds)}(dateString_);return b},c:function(){var a;a=new Date(2e3,0,1);return a},$type:new $.ig.Type("SerializerUtils",$.ig.$ot)},true);$c("XmlaConstants:jq","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("XmlaConstants",$.ig.$ot)},true);$c("XmlaSoapFaultXmlTypeSerializer:id","Object",{init:function(){$.ig.$op.init.call(this)},deserialize:function(a){var b=a;var c=new $$t.hp;var e=b.elements().getEnumerator();while(e.moveNext()){var d=e.current();switch(d.name().localName()){case"faultcode":c._c=$$t.$ih.f(d);break;case"faultstring":c._d=$$t.$ih.f(d);break;case"faultactor":c._b=$$t.$ih.f(d);break}}var f=b.element($$t.$hc.get("detail",""));if(f!=null){var g=f.elements1($$t.$hc.get("Error",""));var h=new $$t.b4($$t.$hh.$type,0);var i=new $$t.ig;var k=g.getEnumerator();while(k.moveNext()){var j=k.current();var l=i.deserialize(j);h.add(l)}c._a=function(){var $ret=new $$t.hk;$ret._a=h.toArray();return $ret}()}return c},$type:new $.ig.Type("XmlaSoapFaultXmlTypeSerializer",$.ig.$ot,[$$t.$ie.$type.specialize($$t.$hp.$type)])},true);$c("CubeConstants:jr","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("CubeConstants",$.ig.$ot)},true);$c("DimensionConstants:js","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("DimensionConstants",$.ig.$ot)},true);$c("HierarchyConstants:jt","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("HierarchyConstants",$.ig.$ot)},true);$c("InstanceConstants:ju","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("InstanceConstants",$.ig.$ot)},true);$c("KpiConstants:jv","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("KpiConstants",$.ig.$ot)},true);$c("LevelConstants:jw","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("LevelConstants",$.ig.$ot)},true);$c("MeasureConstants:jx","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("MeasureConstants",$.ig.$ot)},true);$c("MeasureGroupConstants:jy","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("MeasureGroupConstants",$.ig.$ot)},true);$c("MeasureGroupDimensionConstants:jz","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("MeasureGroupDimensionConstants",$.ig.$ot)},true);$c("MemberConstants:j0","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("MemberConstants",$.ig.$ot)},true);$c("OlapSchemaConstants:j1","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("OlapSchemaConstants",$.ig.$ot)},true);$c("CubeRestrictions:j2","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("CubeRestrictions",$.ig.$ot)},true);$c("DimensionRestrictions:j3","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("DimensionRestrictions",$.ig.$ot)},true);$c("HierarchyRestrictions:j4","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("HierarchyRestrictions",$.ig.$ot)},true);$c("KpiRestrictions:j5","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("KpiRestrictions",$.ig.$ot)},true);$c("LevelRestrictions:j6","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("LevelRestrictions",$.ig.$ot)},true);$c("MeasureRestrictions:j7","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("MeasureRestrictions",$.ig.$ot)},true);$c("MeasureGroupRestrictions:j8","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("MeasureGroupRestrictions",$.ig.$ot)},true);$c("MeasureGroupDimensionRestrictions:j9","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("MeasureGroupDimensionRestrictions",$.ig.$ot)},true);$c("MemberRestrictions:ka","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("MemberRestrictions",$.ig.$ot)},true);$c("CatalogConstants:kb","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("CatalogConstants",$.ig.$ot)},true);$c("ColumnsConstants:kc","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("ColumnsConstants",$.ig.$ot)},true);$c("ProviderTypeConstants:kd","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("ProviderTypeConstants",$.ig.$ot)},true);$c("TableConstants:ke","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("TableConstants",$.ig.$ot)},true);$c("DbSchemaConstants:kf","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("DbSchemaConstants",$.ig.$ot)},true);$c("CatalogRestrictions:kg","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("CatalogRestrictions",$.ig.$ot)},true);$c("ColumnsRestrictions:kh","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("ColumnsRestrictions",$.ig.$ot)},true);$c("ProviderTypeRestrictions:ki","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("ProviderTypeRestrictions",$.ig.$ot)},true);$c("TableRestrictions:kj","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("TableRestrictions",$.ig.$ot)},true);$c("MdxCalculatedMembersCache___GetMemberAliasExpressionPairs__IteratorClass","Object",{d:0,c:null,b:null,__4__this:null,init:function(a){this.c=new $$t.bf(String,String);$.ig.$op.init.call(this);this.d=a},moveNext:function(){while(this.d>=0){switch(this.d){case 0:this.d=-1;this.b=this.__4__this.b.getEnumerator();this.d=1;break;case 1:this.d=-1;if(this.b.moveNext()){this.c=this.b.current();this.d=1;return true}break}}return false},getEnumerator:function(){var d__;if(this.d==-2){this.d=0;d__=this}else{d__=new $.ig.MdxCalculatedMembersCache___GetMemberAliasExpressionPairs__IteratorClass(0);d__.__4__this=this.__4__this}return d__},reset:function(){throw new $$t.y(0)},dispose:function(){},current:function(){return this.c},current1:function(){return this.c},$type:new $.ig.Type("MdxCalculatedMembersCache___GetMemberAliasExpressionPairs__IteratorClass",$.ig.$ot,[$$t.$a7.$type.specialize($$t.$bf.$type.specialize(String,String)),$$t.$p.$type,$$t.$a8.$type.specialize($$t.$bf.$type.specialize(String,String)),$$t.$q.$type,$$t.$ao.$type])},true);$c("MdxSet___GetMdxElements__IteratorClass","Object",{d:0,a:null,c:null,__4__this:null,init:function(a){$.ig.$op.init.call(this);this.d=a},moveNext:function(){while(this.d>=0){switch(this.d){case 0:this.d=-1;this.c=this.__4__this.d.getEnumerator();this.d=1;break;case 1:this.d=-1;if(this.c.moveNext()){this.a=this.c.current();this.d=1;return true}break}}return false},getEnumerator:function(){var d__;if(this.d==-2){this.d=0;d__=this}else{d__=new $.ig.MdxSet___GetMdxElements__IteratorClass(0);d__.__4__this=this.__4__this}return d__},reset:function(){
throw new $$t.y(0)},dispose:function(){},current:function(){return this.a},current1:function(){return this.a},$type:new $.ig.Type("MdxSet___GetMdxElements__IteratorClass",$.ig.$ot,[$$t.$a7.$type.specialize($$t.$f8.$type),$$t.$p.$type,$$t.$a8.$type.specialize($$t.$f8.$type),$$t.$q.$type,$$t.$ao.$type])},true);$c("MdxAxis___GetMdxSets__IteratorClass","Object",{d:0,a:null,c:null,__4__this:null,init:function(a){$.ig.$op.init.call(this);this.d=a},moveNext:function(){while(this.d>=0){switch(this.d){case 0:this.d=-1;this.c=this.__4__this.f.getEnumerator();this.d=1;break;case 1:this.d=-1;if(this.c.moveNext()){this.a=this.c.current();this.d=1;return true}break}}return false},getEnumerator:function(){var d__;if(this.d==-2){this.d=0;d__=this}else{d__=new $.ig.MdxAxis___GetMdxSets__IteratorClass(0);d__.__4__this=this.__4__this}return d__},reset:function(){throw new $$t.y(0)},dispose:function(){},current:function(){return this.a},current1:function(){return this.a},$type:new $.ig.Type("MdxAxis___GetMdxSets__IteratorClass",$.ig.$ot,[$$t.$a7.$type.specialize($$t.$f7.$type),$$t.$p.$type,$$t.$a8.$type.specialize($$t.$f7.$type),$$t.$q.$type,$$t.$ao.$type])},true);$$t.$b2.b=new $$t.b2;$$t.$d0.a=new $$t.d0;$$t.$d2.a=new $$t.d2;$$t.$cq.a=new $$t.cq;$$t.$d3.a=new $$t.d3;$$t.$ct.a=new $$t.ct;$$t.$cw.a=new $$t.cw;$$t.$cz.a=new $$t.cz;$$t.$df.a=new $$t.df;$$t.$c1.a=new $$t.c1;$$t.$c9.a=new $$t.c9;$$t.$c6.a=new $$t.c6;$$t.$c4.a=new $$t.c4;$$t.$dd.a=new $$t.dd;$$t.$bw.a=new $$t.bw;$$t.$dg.a=new $$t.dg;$$t.$d1.a=new $$t.d1;$$t.$ho.d="urn:schemas-microsoft-com:xml-analysis:mddataset";$$t.$ho.e="urn:schemas-microsoft-com:xml-analysis:rowset";$$t.$ho.b="urn:schemas-microsoft-com:xml-analysis:empty";$$t.$ho.c="urn:schemas-microsoft-com:xml-analysis:exception";$$t.$hq.g="http://schemas.xmlsoap.org/soap/envelope/";$$t.$hu.a=null;if($$t.$hu.staticInit&&!$$t.$hu.xmlaSoapWebClientStaticInitCalled){$$t.$hu.staticInit();$$t.$hu.xmlaSoapWebClientStaticInitCalled=true}if($$t.$jo.staticInit&&!$$t.$jo.olapXmlaDataSourceStaticInitCalled){$$t.$jo.staticInit();$$t.$jo.olapXmlaDataSourceStaticInitCalled=true}$$t.$jb.a=null;$$t.$jc.a=null;$$t.$jd.a=null;$$t.$i1.a=null;$$t.$i2.a=null;$$t.$i6.a=null;$$t.$i5.a=null;$$t.$i4.a=null;$$t.$i7.a=null})($);/*!@license
* Infragistics.Web.ClientUI infragistics.olapflatdatasource.js 21.2.20212.99
*
* Copyright (c) 2011-2022 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends:
*     jquery-1.4.4.js
*     jquery.ui.core.js
*     jquery.ui.widget.js
*     infragistics.util.js
*     infragistics.ext_core.js
*     infragistics.ext_collections.js
*     infragistics.ext_collectionsExtended.js
*     infragistics.ext_threading.js
*     infragistics.olap.js
*/
(function($){$.ig=$.ig||{};var $$t={};$.ig.$currDefinitions=$$t;$.ig.util.bulkDefine(["FlatDataSourceImpl:a","OlapDataSource:b","Object:c","Type:d","Boolean:e","ValueType:f","Void:g","IConvertible:h","IFormatProvider:i","Number:j","String:k","IComparable:l","Number:m","IComparable$1:n","IEquatable$1:o","Number:p","Number:q","Number:r","NumberStyles:s","Enum:t","Array:u","IList:v","ICollection:w","IEnumerable:x","IEnumerator:y","Error:z","Error:aa","Number:ab","String:ac","StringComparison:ad","RegExp:ae","CultureInfo:af","DateTimeFormat:ag","Calendar:ah","Date:ai","Number:aj","DayOfWeek:ak","DateTimeKind:al","CalendarWeekRule:am","NumberFormatInfo:an","CompareInfo:ao","CompareOptions:ap","IEnumerable$1:aq","IEnumerator$1:ar","IDisposable:as","StringSplitOptions:at","Number:au","Number:av","Number:aw","Number:ax","Number:ay","Number:az","Assembly:a0","Stream:a1","SeekOrigin:a2","RuntimeTypeHandle:a3","MethodInfo:a4","MethodBase:a5","MemberInfo:a6","ParameterInfo:a7","TypeCode:a8","ConstructorInfo:a9","PropertyInfo:ba","IOlapDataSource:bb","OlapMetadataTreeItem:bc","ICoreOlapElement:bd","OlapMetadataTreeItemType:be","IList$1:bf","ICollection$1:bg","Hierarchy:bh","HierarchyOrigin:bi","Measure:bj","AggregatorType:bk","MeasureListLocation:bl","OlapResult:bm","OlapResultAxis:bn","PositionResolver$2:bo","List$1:bp","IArray:bq","Script:br","IArrayList:bs","Array:bt","CompareCallback:bu","MulticastDelegate:bv","IntPtr:bw","Func$3:bx","Action$1:by","Comparer$1:bz","IComparer:b0","IComparer$1:b1","DefaultComparer$1:b2","Comparison$1:b3","ReadOnlyCollection$1:b4","Predicate$1:b5","NotImplementedException:b6","IPosition$2:b7","IPositionItem$2:b8","PositionItemInfo$2:b9","Dictionary$2:ca","IDictionary$2:cb","KeyValuePair$2:cc","IDictionary:cd","IEqualityComparer$1:ce","EqualityComparer$1:cf","IEqualityComparer:cg","DefaultEqualityComparer$1:ch","InvalidOperationException:ci","ArgumentException:cj","Thread:ck","ThreadStart:cl","IHierarchicalPositionItem$2:cm","Math:cn","Enumerable:co","Func$2:cp","IOrderedEnumerable$1:cq","SortedList$1:cr","ArgumentNullException:cs","EventHandler$1:ct","AsyncCompletedEventArgs:cu","EventArgs:cv","Delegate:cw","Interlocked:cx","ListSortDirection:cy","Nullable$1:cz","OlapResultTuple:c0","OlapResultAxisMember:c1","StringBuilder:c2","Environment:c3","OlapResultCell:c4","ArrayListCollection$1:c5","INotifyCollectionChanged:c6","NotifyCollectionChangedEventHandler:c7","NotifyCollectionChangedEventArgs:c8","NotifyCollectionChangedAction:c9","Cube:da","CubeType:db","Task$1:dc","Task:dd","JQueryPromise:de","Action:df","AggregateException:dg","TaskStatus:dh","TaskCompletionSource$1:di","JQueryDeferred:dj","JQuery:dk","JQueryObject:dl","Element:dm","Node:dn","ElementAttributeCollection:dp","ElementCollection:dq","WebStyle:dr","ElementNodeType:ds","document:dt","EventListener$1:du","Event:dv","DOMTokenList:dw","EventListener:dx","IElementEventHandler:dy","ElementEventHandler:dz","ElementAttribute:d0","JQueryPosition:d1","JQueryCallback:d2","JQueryEvent:d3","JQueryUICallback:d4","Member:d5","MemberType:d6","Catalog:d7","MeasureGroup:d8","DataSourceBaseOptions:d9","IOlapDataProviderFactory:ea","IOlapDiscoverDataProvider:eb","KeyValueItem:ec","Dimension:ed","DimensionType:ee","Level:ef","MeasureGroupDimension:eg","CardinalityType:eh","Kpi:ei","OlapResultView:ej","PositionInfo:ek","ResultViewHelper:el","IPostionComparer:em","CubeMetaItemsCache:en","KpiMeasure:eo","MeasureGroupMetaItemsCache:ep","Tuple$2:eq","AxisElement:er","MeasureList:es","TaskFactory:et","TaskExtensions:eu","AxisDefinitionParser:ev","MetaTreeHelper:ew","HierarchyItemPosition:ex","KpiDimension:ey","ArgumentOutOfRangeException:ez","IFlatDataProvider:e0","FlatDataSourceOptions:e1","DataSourceMetadata:e2","CubeMetadata:e3","MeasuresDimensionMetadata:e4","MeasureMetadata:e5","CellMetadata:e6","DimensionMetadata:e7","HierarchyMetadata:e8","LevelMetadata:e9","IFlatDataProviderFactory:fa","FlatDataAxisProvider:fb","IFlatDataAxisProvider:fc","RowMetadata:fd","FlatDataProvider:fe","TableMetadata:ff","DataMemberMetadata:fg","KeyListPair$1:fh","FlatDataAxisProviderHelper:fi","FlatDataPartialAxisProvider:fj","DefaultFlatDataProviderFactory:fk","CoreOlapElementParser:fl","OlapFlatDataSource:fm","DataSourceBase:fn","jQueryUtils:fo","FlatDataSampleClass:fp","AbstractEnumerable:fq","Func$1:fr","AbstractEnumerator:fs","GenericEnumerable$1:ft","GenericEnumerator$1:fu"]);var $a=$.ig.intDivide,$b=$.ig.util.cast,$c=$.ig.util.defType,$d=$.ig.util.defEnum,$e=$.ig.util.getBoxIfEnum,$f=$.ig.util.getDefaultValue,$g=$.ig.util.getEnumValue,$h=$.ig.util.getValue,$i=$.ig.util.intSToU,$j=$.ig.util.nullableEquals,$k=$.ig.util.nullableIsNull,$l=$.ig.util.nullableNotEquals,$m=$.ig.util.toNullable,$n=$.ig.util.toString$1,$o=$.ig.util.u32BitwiseAnd,$p=$.ig.util.u32BitwiseOr,$q=$.ig.util.u32BitwiseXor,$r=$.ig.util.u32LS,$s=$.ig.util.unwrapNullable,$t=$.ig.util.wrapNullable,$u=String.fromCharCode,$v=$.ig.util.castObjTo$t,$w=$.ig.util.compare,$x=$.ig.util.replace,$y=$.ig.util.stringFormat,$z=$.ig.util.stringFormat1,$0=$.ig.util.stringFormat2,$1=$.ig.util.stringCompare1,$2=$.ig.util.stringCompare2,$3=$.ig.util.stringCompare3,$4=$.ig.util.equalsSimple,$5=$.ig.util.compareSimple,$6=$.ig.util.numberToString,$7=$.ig.util.tryParseInt32_1,$8=$.ig.util.tryParseInt32_2,$9=$.ig.util.intToString1,$aa=$.ig.util.parseInt32_1,$ab=$.ig.util.parseInt32_2;$c("FlatDataSourceImpl:a","OlapDataSource",{a5:null,dataProvider:function(){if(this.a5==null){this.a5=this.dataProviderFactory().createDataProvider()}return this.a5},init:function(a){this.a9=new $$t.bp($$t.$fb.$type,0);$$t.$b.init.call(this,a);this.flatDataSourceOptions(a);this.dataProviderFactory(a.dataProviderFactory())},h:function(){return new $$t.fk(this.flatDataSourceOptions().itemsSource(),this.flatDataSourceOptions().dataSourceMetadata())},_flatDataSourceOptions:null,flatDataSourceOptions:function(a){if(arguments.length===1){this._flatDataSourceOptions=a;return a}else{return this._flatDataSourceOptions}},ap:function(){var $self=this;var a=new $$t.di($$t.$bc.$type,0);if(this.isInitialized()){a.e(this.metadataTree());return a._b}var b=this.columnAxis();b.collectionChanged=$.ig.Delegate.prototype.combine(b.collectionChanged,this.bd.runOn(this));var c=this.rowAxis();c.collectionChanged=$.ig.Delegate.prototype.combine(c.collectionChanged,this.bh.runOn(this));var d=this.filters();d.collectionChanged=$.ig.Delegate.prototype.combine(d.collectionChanged,this.be.runOn(this));var e=this.measures();e.collectionChanged=$.ig.Delegate.prototype.combine(e.collectionChanged,this.bf.runOn(this));return $$t.$eu.b($$t.$bc.$type,$$t.$bc.$type,$$t.$eu.b($$t.$bf.$type.specialize($$t.$da.$type),$$t.$bc.$type,this.am(null),function(f){return $self.aq($$t.$co.ad($$t.$da.$type,$self.cubes()).name())}),function(f){return $self.ak()})},aj:function(){var a=this.dataProvider();var b=new $$t.bp($$t.$dd.$type,0);b.add(a.discoverDimensionsAsync(null,null));b.add(a.discoverHierarchiesAsync(null,null));b.add(a.discoverLevelsAsync(null,null));b.add(a.discoverMeasuresAsync(null,null));b.add(a.discoverKpisAsync(null,null));var c=new Array(b.count());b.copyTo(c,0);var d=new $$t.en;this._c=d;var e=new $$t.et;return e.c(c,function(f){var g=f[0];var h=f[1];var i=f[2];var j=f[3];var k=f[4];d._z=j.n();d._t=g.n();d._u=h.n();d._x=i.n();d._w=k.n()})},bj:function(a,b){var c=0;var d=this.measureListIndex();if(a){var e=this.a4(c);if(e!=null&&this.measureListLocation()==1){if(d>-1){var f=e.positionResolver().rootPositionInfo();if(f!=null){this.bg(f,d-1)}}}c++}if(b){var g=this.a4(c);if(g!=null&&this.measureListLocation()==0){if(d>-1){var h=g.positionResolver().rootPositionInfo();if(h!=null){this.bg(h,d-1)}}}}},bg:function(a,b){if(a.positionItemIndex()==b){a.clear()}else{var d=a.values().getEnumerator();while(d.moveNext()){var c=d.current();this.bg(c,b)}}},as:function(){var a=this.ba();if(!String.isNullOrEmpty(a)){var b=new $$t.di($$t.$bm.$type,0);b.d(new $$t.ci(1,a));return b._b}var c=this.columnAxis().count()>0;var d=this.rowAxis().count()>0;if(!d&&!c&&this.measures().count()==0){var e=function(){var $ret=new $$t.bm;$ret.isEmpty(true);return $ret}();var f=new $$t.di($$t.$bm.$type,0);f.e(e);this._l=new $$t.ej(e,e,false,false);this.result(e);this.clearPendingChanges();return f._b}var g=this._m;var h=this._s;var i=this._r||this._p;var j=this._n;var k=this.ab().count()>0;var l=this.aa().count()>0;var m=this.af.count()>0;if(!g&&!h&&!i&&!j&&!k&&!l&&!m){var n=new $$t.di($$t.$bm.$type,0);n.e(this.result());return n._b}if(this._r){this.bj(c,d)}var o=null;var p=null;var q=0;var r="Axis0";var s=this._m;if(this._r&&c&&this.measureListIndex()>-1&&this.measureListLocation()==1){s=true}o=this.a3(this.columnAxis(),s,q);this._m=false;if(o!=null){q++;r="Axis1"}var t=this._s;if(this._r&&d&&this.measureListIndex()>-1&&this.measureListLocation()==0){t=true}p=this.a3(this.rowAxis(),t,q);this._s=false;if(p!=null){if(p.axis()!=null){p.axis().name(r)}q++}this._r=false;this._n=false;var u=new $$t.bp($$t.$er.$type,0);var w=this._y.getEnumerator();while(w.moveNext()){var v=w.current();u.add(v)}var y=this._ag.getEnumerator();while(y.moveNext()){var x=y.current();u.add(x)}var aa=this._z.getEnumerator();while(aa.moveNext()){var z=aa.current();u.add(z)}var ab=this.bb(u,c,d,k,l,o,p);return ab},bb:function(a,b,c,d,e,f,g){var $self=this;if(this.af.count()>0){this.dataProvider().am(a);var i=this.a9.getEnumerator();while(i.moveNext()){var h=i.current();h.resetAxisMetadata()}this.af.clear()}this.a8(b,c);this.bc(b,c,true);if(d||e){var j=null;if(b){var k=this.ab();var l=$$t.$co.z($$t.$ek.$type,$$t.$co.u($$t.$ek.$type,k,function(m){return m._c=="Axis0"}));if(l.count()>0){var m=l.item(0);k.remove(m);var n=this.result().axes().item(0).tuples().__inner[m._b];var o=n.members().item(m._a);var p=new $$t.fj(this.dataProvider(),this.columnAxis(),o,this._c);var q=p.generateAxis("Axis0");j=$$t.$eu.b($$t.$bn.$type,$$t.$bm.$type,q,function(r){var s=$self.dataProvider().evaluateResult(p,g,$self.measures());return s});j=$$t.$eu.b($$t.$bm.$type,$$t.$bm.$type,j,function(r){if($self.d("Axis0",r.n()).tuples().count()==0){o.displayInfo($i(0))}var s=$self._l;$self._l=$self._l.extend(r.n(),"Axis0");$self.result($self._l.visibleResult());$$t.$el.h("Axis0",s,$self._l);{$$t.$el.g(m,true,$self._l)}f.extendWith(p);f.axis($self.d("Axis0",$self.result()));var t=new $$t.di($$t.$bm.$type,0);t.e($self._l.visibleResult());$$t.$el.f(m,true,f.positionResolver(),$self._l.visibleResult());return t._b})}}if(c){var r=b?"Axis1":"Axis0";var s=this.ab();var t=$$t.$co.z($$t.$ek.$type,$$t.$co.u($$t.$ek.$type,s,function(u){return u._c==r}));if(d&&t.count()>0){var u=t.item(0);s.remove(u);var v=$$t.$co.ad($$t.$bn.$type,$$t.$co.u($$t.$bn.$type,this.result().axes(),function(w){return w.name()==r})).tuples().__inner[u._b];var w=v.members().item(u._a);var x;var y=new $$t.fj(this.dataProvider(),this.rowAxis(),w,this._c);if(j!=null){x=$$t.$eu.b($$t.$bm.$type,$$t.$bn.$type,j,function(z){return y.generateAxis(r)})}else{x=y.generateAxis(r)}j=$$t.$eu.b($$t.$bn.$type,$$t.$bm.$type,x,function(z){var aa=$self.dataProvider().evaluateResult(f,y,$self.measures());return aa});j=$$t.$eu.b($$t.$bm.$type,$$t.$bm.$type,j,function(z){if($self._l==null){$self._l=new $$t.ej($self.result(),$self.result(),b,c)}var aa=$self._l.hasColumns()?"Axis1":"Axis0";if($self.d(aa,z.n()).tuples().count()==0){w.displayInfo($i(0))}var ab=$self._l;$self._l=$self._l.extend(z.n(),aa);$self.result($self._l.visibleResult());$$t.$el.h(aa,ab,$self._l);{$$t.$el.g(u,true,$self._l)}var ac=new $$t.di($$t.$bm.$type,0);ac.e($self._l.visibleResult());g.extendWith(y);g.axis($self.d(aa,$self.result()));$$t.$el.f(u,true,g.positionResolver(),$self.result());return ac._b})}}if(j!=null){return j}var z=new $$t.di($$t.$bm.$type,0);z.e(this.result());return z._b}else{var aa=new $$t.di($$t.$bm.$type,0);if(f==null&&g==null&&this.measures().count()==0){var ab=function(){var $ret=new $$t.bm;$ret.isEmpty(true);return $ret}();this.result(ab);aa.e(this.result());return aa._b}var ac=this.dataProvider().evaluateResult(f,g,this.measures());return $$t.$eu.b($$t.$bm.$type,$$t.$bm.$type,ac,function(ad){$self._l=new $$t.ej(ad.n(),ad.n(),b,c);$self.result($self._l.visibleResult());$self.clearPendingChanges();aa.e($self.result());return aa._b})}},ba:function(){var a=new $$t.ca(String,String,0);for(var b=0;b<this.columnAxis().count();b++){var c=this.columnAxis().item(b);if($b($$t.$es.$type,c)!==null){continue}if(!a.containsKey(c.uniqueName())){a.add(c.uniqueName(),"columns")}else{return"the "+c.uniqueName()+" hierarchy is used twice in columns"}}for(var d=0;d<this.rowAxis().count();d++){var e=this.rowAxis().item(d);if($b($$t.$es.$type,e)!==null){continue}if(!a.containsKey(e.uniqueName())){a.add(e.uniqueName(),"rows")}else{return"the "+e.uniqueName()+" hierarchy is used in rows and in columns"}}for(var f=0;f<this.filters().count();f++){var g=this.filters().item(f);var h;if(!function(){var i=a.tryGetValue(g.uniqueName(),h);h=i.p1;return i.ret}()){a.add(g.uniqueName(),"filters")}else{return"the "+g.uniqueName()+" hierarchy is used in filters and in "+h}}for(var i=0;i<this.measures().count();i++){var j=this.measures().item(i);var k;if(!function(){var l=a.tryGetValue(j.uniqueName(),k);k=l.p1;return l.ret}()){a.add(j.uniqueName(),"measures")}else{if(k=="measures"){return"the "+j.uniqueName()+" measure is used twice in measures"}return"the "+j.uniqueName()+" measure is used in measures and in "+k}}return null},a8:function(a,b){var c=new $$t.ca(String,$$t.$bf.$type.specialize($$t.$ek.$type),0);var d=this._l;var e=this.ab();for(var f=0;f<e.count();f++){var g=e.item(f);var h;if(!function(){var i=c.tryGetValue(g._c,h);h=i.p1;return i.ret}()){h=new $$t.bp($$t.$ek.$type,0);c.add(g._c,h)}if(this._l==null){this._l=new $$t.ej(this.result(),this.result(),a,b)}var i=this._l.expandTupleMember(g._c,g._b,g._a);if(i!=null){h.add(g);this._l=i;this.result(this._l.visibleResult())}}var k=c.getEnumerator();while(k.moveNext()){var j=k.current();var m=j.value().getEnumerator();while(m.moveNext()){var l=m.current();e.remove(l)}}var n=0;var o="Axis0";if(a){var p=$$t.$co.af(String,$$t.$co.u(String,c.keys(),function(q){return q==o}))!=null;var q=this.a4(n);if(q!=null&&p){var r=c.item(o);if(r.count()>0){$$t.$el.h(o,d,this._l);var t=r.getEnumerator();while(t.moveNext()){var s=t.current();$$t.$el.g(s,true,this._l);$$t.$el.f(s,true,q.positionResolver(),this._l.visibleResult())}var u=this.d(o,this.result());q.axis(u);$$t.$el.d(u.positionResolver(),q.positionResolver())}}n++;o="Axis1"}if(b){var v=$$t.$co.af(String,$$t.$co.u(String,c.keys(),function(w){return w==o}))!=null;var w=this.a4(n);if(w!=null&&v){var x=c.item(o);if(x.count()>0){$$t.$el.h(o,d,this._l);var z=x.getEnumerator();while(z.moveNext()){var y=z.current();$$t.$el.g(y,true,this._l);$$t.$el.f(y,true,w.positionResolver(),this._l.visibleResult())}var aa=this.d(o,this.result());w.axis(aa);$$t.$el.d(aa.positionResolver(),w.positionResolver())}}}return e.count()>0},bc:function(a,b,c){if(this.result()!=null){var d=this.aa();var e=new $$t.ca(String,$$t.$bf.$type.specialize($$t.$ek.$type),0);var f=this._l;for(var g=0;g<d.count();g++){var h=d.item(g);var i;if(!function(){var j=e.tryGetValue(h._c,i);i=j.p1;return j.ret}()){i=new $$t.bp($$t.$ek.$type,0);e.add(h._c,i)}i.add(h);if(c){if(this._l==null){this._l=new $$t.ej(this.result(),this.result(),a,b)}else{this._l=this._l.collapseTupleMember(h._c,h._b,h._a);this.result(this._l.visibleResult())}}}var j=0;var k="Axis0";if(a){var l=$$t.$co.af(String,$$t.$co.u(String,e.keys(),function(m){return m==k}))!=null;var m=this.a4(j);if(m!=null&&l){var n=e.item(k);if(n.count()>0){$$t.$el.h(k,f,this._l);var p=n.getEnumerator();while(p.moveNext()){var o=p.current();$$t.$el.f(o,false,m.positionResolver(),this._l.visibleResult())}var q=this.d(k,this.result());m.axis(q)}}j++;k="Axis1"}if(b){var r=$$t.$co.af(String,$$t.$co.u(String,e.keys(),function(s){return s==k}))!=null;var s=this.a4(j);if(s!=null&&r){var t=e.item(k);if(t.count()>0){$$t.$el.h(k,f,this._l);var v=t.getEnumerator();while(v.moveNext()){var u=v.current();$$t.$el.f(u,false,s.positionResolver(),this._l.visibleResult())}var w=this.d(k,this.result());s.axis(w)}}}d.clear()}},a3:function(a,b,c){var d=null;if(a.count()>0){d=this.a4(c);if(b){if(d!=null){d.resetAxis(a)}else{d=new $$t.fb(this.dataProvider(),a,this._c);this.bi(c,d)}}}return d},bi:function(a,b){this.a9.item(a,b)},a4:function(a){if(a<this.a9.count()){return this.a9.item(a)}return null},getMembersOfLevel:function(a){var $self=this;var b=new $$t.bp($$t.$ec.$type,0);var c=a;b.add(function(){var $ret=new $$t.ec;$ret._a="LEVEL_UNIQUE_NAME";$ret._b=a;return $ret}());var d=this.dataProvider().discoverMembersAsync(null,b);d.j(function(e){var g=e.n().getEnumerator();while(g.moveNext()){var f=g.current();$self._c.aa(f)}$self._c.ac(c)});return d},getMembersOfHierarchy:function(a){var $self=this;var b=a;var c=new $$t.fl(a);var d=c.b();if(d.count()<2){throw new $$t.cj(2,"Specified value: "+a+" is not valid.",a)}var e=new $$t.ec;e._a="HIERARCHY_UNIQUE_NAME";e._b=d.item(0)+"."+d.item(1);var f=new $$t.bp($$t.$ec.$type,0);f.add(e);var g=this.dataProvider().discoverMembersAsync(null,f);g.j(function(h){var j=h.n().getEnumerator();while(j.moveNext()){var i=j.current();$self._c.aa(i)}$self._c.ab(b)});return g},getMembersOfMember:function(a){var $self=this;var b=new $$t.fl(a);var c=b.b();var d=new $$t.ec;if(c.count()<3){throw new $$t.cj(2,"Specified value: "+a+" is not valid.",a)}switch(c.count()){case 1:d._a="DIMENSION_UNIQUE_NAME";d._b=c.item(0);break;case 2:d._a="HIERARCHY_UNIQUE_NAME";d._b=c.item(0)+"."+c.item(1);break;default:d._a="LEVEL_UNIQUE_NAME";d._b=c.item(0)+"."+c.item(1)+"."+c.item(2);break}var e=new $$t.bp($$t.$ec.$type,0);e.add(d);e.add(function(){var $ret=new $$t.ec;$ret._a="MEMBER_UNIQUE_NAME";$ret._b=a;return $ret}());var f=this.dataProvider().discoverMembersAsync(null,e);f.j(function(g){var i=g.n().getEnumerator();while(i.moveNext()){var h=i.current();$self._c.aa(h)}});return f},bd:function(a,b){this._m=true;this.bk(0,this.columnAxis(),this.rowAxis());this.a0(b,this._y);this.a2(b,this.columnAxis());if(b.action()!=4&&this.columnAxis()!=null){var c=Math.max(b.newStartingIndex(),b.oldStartingIndex());this.bl("Axis0",c)}},bh:function(a,b){this._s=true;this.bk(1,this.rowAxis(),this.columnAxis());this.a0(b,this._ag);this.a2(b,this.rowAxis());if(b.action()!=4&&this.rowAxis()!=null){var c=this.columnAxis()==null?"Axis0":"Axis1";var d=Math.max(b.newStartingIndex(),b.oldStartingIndex());this.bl(c,d)}},a9:null,bk:function(a,b,c){if(b.count()>0){if(c.count()>0){if(this.a9.count()<2){this.a9.insert(a,null)}}else{if(this.a9.count()==0){this.a9.insert(0,null)}}}else{if(this.a9.count()>0){if(this.a9.count()>1){this.a9.removeAt(a)}else{this.a9.removeAt(0)}}}},bl:function(a,b){var c=this.ab();var d=this.aa();for(var e=d.count()-1;e>=0;e--){var f=d.item(e);if(f._c==a&&f._a>=b){d.removeAt(e)}}for(var g=c.count()-1;g>=0;g--){var h=c.item(g);if(h._c==a&&h._a>=b){c.removeAt(g)}}},be:function(a,b){this._n=true;this.a0(b,this._z)},bf:function(a,b){this._r=true;this.a1()},$type:new $.ig.Type("FlatDataSourceImpl",$$t.$b.$type)},true);$c("IFlatDataProviderFactory:fa","Object",{$type:new $.ig.Type("IFlatDataProviderFactory",null,[$$t.$ea.$type])},true);$c("DefaultFlatDataProviderFactory:fk","Object",{b:null,a:null,init:function(a,b){$.ig.$op.init.call(this);this.b=a;this.a=b},createDataProvider:function(){return new $$t.fe(this.b,this.a)},$type:new $.ig.Type("DefaultFlatDataProviderFactory",$.ig.$ot,[$$t.$fa.$type])},true);$c("FlatDataSourceOptions:e1","DataSourceBaseOptions",{init:function(){$$t.$d9.init.call(this)},_itemsSource:null,itemsSource:function(a){if(arguments.length===1){this._itemsSource=a;return a}else{return this._itemsSource}},_dataSourceMetadata:null,dataSourceMetadata:function(a){if(arguments.length===1){this._dataSourceMetadata=a;return a}else{return this._dataSourceMetadata}},_dataProviderFactory:null,dataProviderFactory:function(a){if(arguments.length===1){this._dataProviderFactory=a;return a}else{return this._dataProviderFactory}},$type:new $.ig.Type("FlatDataSourceOptions",$$t.$d9.$type)},true);$c("OlapFlatDataSource:fm","DataSourceBase",{a6:null,init:function(a){this.a6=null;this.a5=false;$$t.$fn.init.call(this);if(a==null){throw new $$t.cs(0,"options")}this.a6=a;this.a9(this.a6)},a3:function(a){var b=$$t.$fo.getJavascriptObjectProperty(a,"metadata");if(b==null){throw new $$t.ci(1,"metadata is null or undefined.")}var c=new $$t.e2;var d=this.a2(b);c._a=d;return c},a2:function(a){var b=$$t.$fo.getJavascriptObjectProperty(a,"cube");if(b==null){throw new $$t.ci(1,"metadata.cube is null or undefined.")}var c=new $$t.e3;c._e=$$t.$fo.getJavascriptObjectProperty(b,"name");if(String.isNullOrEmpty(c._e)){throw new $$t.ci(1,"cube.name is null, empty or undefined")}c._c=$$t.$fo.getJavascriptObjectProperty(b,"caption");if(String.isNullOrEmpty(c._c)){c._c=c._e}c._b=this.a4(b);c._d=$$t.$fo.getJavascriptObjectProperty(b,"description");c._a=this.ay(b);return c},a4:function(a){var b=$$t.$fo.getJavascriptObjectProperty(a,"measuresDimension");if(b==null){return null}var c=$$t.$fo.getJavascriptObjectProperty(b,"caption");var d=$$t.$fo.getJavascriptObjectProperty(b,"name");var e=function(){var $ret=new $$t.e4;$ret._b=c;$ret._c=d;return $ret}();e._a=this.a1(b);return e},ay:function(a){var b=$$t.$fo.getJavascriptObjectProperty(a,"dimensions");if(b==null){return null}var c=new $$t.c5($$t.$e7.$type);for(var d=0;d<b.length;d++){var e=new $$t.e7;c.add(e);var f=b[d];e._e=$$t.$fo.getJavascriptObjectProperty(f,"name");if(String.isNullOrEmpty(e._e)){throw new $$t.ci(1,"dimension.name is null, empty or undefined")}e._b=$$t.$fo.getJavascriptObjectProperty(f,"caption");if(String.isNullOrEmpty(e._b)){e._b=e._e}e._c=$$t.$fo.getJavascriptObjectProperty(f,"defaultHierarchy");e._a=this.az(f);e._d=$$t.$fo.getJavascriptObjectProperty(f,"description")}return c},a1:function(a){var b=$$t.$fo.getJavascriptObjectProperty(a,"measures");if(b==null){return null}var c=new $$t.c5($$t.$e5.$type);for(var d=0;d<b.length;d++){var e=new $$t.e5;c.add(e);var f=b[d];e._f=$$t.$fo.getJavascriptObjectProperty(f,"name");if(String.isNullOrEmpty(e._f)){throw new $$t.ci(1,"measure.name is null, empty or undefined")}e._e=$$t.$fo.getJavascriptObjectProperty(f,"caption");if(String.isNullOrEmpty(e._e)){e._e=e._f}e._d=$$t.$fo.getJavascriptObjectProperty(f,"displayFormat");e._c=$$t.$fo.getJavascriptObjectProperty(f,"displayFolder");e._b=$$t.$fo.getJavascriptObjectProperty(f,"aggregator");if(e._b==null){throw new $$t.ci(1,"aggregator is null or undefined for measureMetadata: "+e._f)}}return c},az:function(a){var b=$$t.$fo.getJavascriptObjectProperty(a,"hierarchies");if(b==null){return null}var c=new $$t.c5($$t.$e8.$type);for(var d=0;d<b.length;d++){var e=new $$t.e8;c.add(e);var f=b[d];e._e=$$t.$fo.getJavascriptObjectProperty(f,"name");if(String.isNullOrEmpty(e._e)){throw new $$t.ci(1,"hierarchy.hierarchyName is null, empty or undefined")}e._b=$$t.$fo.getJavascriptObjectProperty(f,"caption");if(String.isNullOrEmpty(e._b)){e._b=e._e}e._d=$$t.$fo.getJavascriptObjectProperty(f,"displayFolder");e._a=this.a0(f);if(e._a==null||e._a.count()==0){throw new $$t.ci(1,"levelKeys is null, empty or undefined for hierarchyMetadata: "+e._e)}}return c},a0:function(a){var b=$$t.$fo.getJavascriptObjectProperty(a,"levels");if(b==null){return null}var c=new $$t.c5($$t.$e9.$type);for(var d=0;d<b.length;d++){var e=new $$t.e9;c.add(e);var f=b[d];e._c=$$t.$fo.getJavascriptObjectProperty(f,"name");if(String.isNullOrEmpty(e._c)){throw new $$t.ci(1,"level.name is null, empty or undefined")}e._b=$$t.$fo.getJavascriptObjectProperty(f,"caption");if(String.isNullOrEmpty(e._b)){e._b=e._c}e._a=$$t.$fo.getJavascriptObjectProperty(f,"memberProvider");if(e._a==null){throw new $$t.ci(1,"levelMetadata.memberProvider is null or undefined")}}return c},a9:function(a){var options_=a;var schema_=this.a7(a);var dataSource=options_.dataSource;if(!options_.dataSource&&options_.dataSourceUrl){options_.dataSource=options_.dataSourceUrl}var dataOptions={callback:this.dataSourceDataResolved,callee:this,dataSource:options_.dataSource,defaultChildrenDataProperty:options_.bindings.childDataProperty,responseDataType:options_.responseDataType,localSchemaTransform:options_.dataSourceType&&options_.dataSourceType==="xml"?true:false,schema:schema_};if(options_.dataSourceType){dataOptions.type=options_.dataSourceType}if(options_.responseDataKey){dataOptions.responseDataKey=options_.responseDataKey}if(!(options_.dataSource instanceof $.ig.DataSource)){options_.dataSource=new $.ig.DataSource(dataOptions)}options_.dataSource.dataBind(this.dataSourceDataResolved,this)},dataSourceDataResolved:function(){var a=$$t.$fo.getJavascriptObjectProperty(this.a6,"dataSource");if(a==null){throw new $$t.ci(1,"dataSource is null or undefined")}var b=this.a3(this.a6);var c=$$t.$fo.getJavascriptObjectProperty(this.a6,"measures");var d=$$t.$fo.getJavascriptObjectProperty(this.a6,"filters");var e=$$t.$fo.getJavascriptObjectProperty(this.a6,"columns");var f=$$t.$fo.getJavascriptObjectProperty(this.a6,"rows");var g=$$t.$fo.getJavascriptObjectMethodResult(a,"data",[]);var h=function(){var $ret=new $$t.e1;$ret.measures(c);$ret.filters(d);$ret.columns(e);$ret.rows(f);$ret.itemsSource(g);$ret.dataSourceMetadata(b);return $ret}();this.dataSource(new $$t.a(h));this.initDataSource()},initDataSource:function(){var $self=this;if(this.a5){this.a5=false;var a=this.dataSource().initialize();var promise_=a._d;a.j(function(b){$self.a8.e(b.n())});var $this=this;if(!this._isInitializedAttached){this._isInitializedAttached=true;promise_.always(function(result){var args={error:null,metadataTreeRoot:null};if(promise_.state()==="rejected"){args.error=result}else{args.metadataTreeRoot=result}$($this).trigger("initialized",args);$this._isInitializedAttached=false})}}},a5:false,a8:null,initialize:function(){if(this.dataSource()!=null){return $$t.$fn.initialize.call(this)}this.a5=true;this.a8=new $$t.di($$t.$bc.$type,0);return this.a8._a.promise()},a7:function(a){var options_=a;var schema_=null;var schema={},opt=options_,bindings=options_.bindings;if(bindings==null){opt.bindings={};schema.text={name:"Text",type:"string"};opt.bindings.textKey="Text";schema.value={name:"Value",type:"string"};opt.bindings.valueKey="Value";schema.imageUrl={name:"ImageUrl",type:"string"};opt.bindings.imageUrlKey="ImageUrl";schema.navigateUrl={name:"NavigateUrl",type:"string"};opt.bindings.navigateUrlKey="NavigateUrl";schema.childData={name:"Nodes",type:"object"};opt.bindings.childDataProperty="Nodes";schema.target={name:"Target",type:"string"};opt.bindings.targetKey="Target";bindings=opt.bindings}else if(opt.dataSourceType==="xml"){if(bindings.searchFieldXPath){schema.searchField=bindings.searchFieldXPath}}schema.fields=[];if(bindings.textKey){schema.fields.push({name:bindings.textKey,type:"string",xpath:bindings.textXPath});schema.textKey=bindings.textKey}if(bindings.valueKey){schema.fields.push({name:bindings.valueKey,type:"string",xpath:bindings.valueXPath});schema.valueKey=bindings.valueKey}if(bindings.navigateUrlKey){schema.fields.push({name:bindings.navigateUrlKey,type:"string",xpath:bindings.navigateUrlXPath});schema.navigateUrlKey=bindings.navigateUrlKey}if(bindings.imageUrlKey){schema.fields.push({name:bindings.imageUrlKey,type:"string",xpath:bindings.imageUrlXPath});schema.imageUrlKey=bindings.imageUrlKey}if(bindings.targetKey){schema.fields.push({name:bindings.targetKey,type:"string"});schema.targetKey=bindings.targetKey}if(bindings.expandedKey){schema.fields.push({name:"Expanded",type:"boolean"});schema.expandedKey=bindings.expandedKey}if(bindings.primaryKey){schema.fields.push({name:bindings.primaryKey,type:"string"});schema.primaryKey=bindings.primaryKey}if(bindings.childDataProperty){schema.fields.push({name:bindings.childDataProperty,type:"object",xpath:bindings.childDataXPath});schema.childDataProperty=bindings.childDataProperty}if(!schema.searchField&&opt.responseDataKey){schema.searchField=opt.responseDataKey}schema_=schema;return schema_},$type:new $.ig.Type("OlapFlatDataSource",$$t.$fn.$type)},true);$c("FlatDataSampleClass:fp","Object",{init:function(){$.ig.$op.init.call(this)},$type:new $.ig.Type("FlatDataSampleClass",$.ig.$ot)},true);$c("IFlatDataAxisProvider:fc","Object",{$type:new $.ig.Type("IFlatDataAxisProvider",null)},true);$c("FlatDataAxisProvider:fb","Object",{h:null,c:null,a:null,init:function(a,b,c){this.i=null;this.b=null;this.f=false;this.g=false;$.ig.$op.init.call(this);this.a=c;this.dataProvider(a);this.h=$$t.$co.z($$t.$bd.$type,$$t.$co.o($$t.$bd.$type,$$t.$bd.$type,b,function(d){return d}));this.c=new $$t.fi(a,b.count(),c)},_dataProvider:null,dataProvider:function(a){if(arguments.length===1){this._dataProvider=a;return a}else{return this._dataProvider}},_axis:null,axis:function(a){if(arguments.length===1){this._axis=a;return a}else{return this._axis}},positionResolver:function(){return this.c._d},i:null,b:null,f:false,g:false,resetAxis:function(a){if(this.axis()!=null){this.b=this.axis();this.i=$$t.$co.z($$t.$bd.$type,$$t.$co.o($$t.$bd.$type,$$t.$bd.$type,a,function(b){return b}));this.f=true}else{this.c=new $$t.fi(this.dataProvider(),a.count(),this.a);this.h=a}},resetAxisMetadata:function(){if(this.axis()!=null){this.g=true}},j:function(a){var $self=this;this.f=false;var b=this.i;var c=this.b;var d=new $$t.di($$t.$bn.$type,0);var e=new $$t.bp(String,0);for(var f=0;f<this.h.count();f++){var g=this.h.item(f);if($b($$t.$es.$type,g)!==null){e.add(this.dataProvider().sourceMetadata()._a._b._c);continue}e.add(g.uniqueName())}this.h=b;var h=new $$t.bp(String,0);var i=new $$t.bp($$t.$cc.$type.specialize(String,$$t.$m.$type),0);for(var j=0;j<this.h.count();j++){var k=this.h.item(j);if($b($$t.$es.$type,k)!==null){h.add(this.dataProvider().sourceMetadata()._a._b._c);continue}h.add(k.uniqueName());i.add(new $$t.cc(String,$$t.$m.$type,1,k.uniqueName(),0))}var l=new $$t.bp($$t.$cc.$type.specialize(String,$$t.$m.$type),0);if(e.count()>0){var m=-1;for(var n=0;n<h.count();n++){if(n==e.count()||e.item(n)!=h.item(n)){break}m=n}if(m<i.count()-1){for(var o=m+1;o<i.count();o++){l.add(i.item(o))}}else{l=i}var p=new Array(this.h.count());var q=new $$t.bp($$t.$c0.$type,0);this.c.m(l).j(function(r){$self.p(m,b,p,r.n(),q,c.name(),d,true)});return d._b}return this.generateAxis(a)},generateAxis:function(a){var $self=this;if(this.g||this.f){var b=null;if(this.g){b=this.k(a)}if(this.f){b=this.j(a)}return b}var c=new $$t.di($$t.$bn.$type,0);if(this.axis()!=null){c.e(this.axis());return c._b}var d=new Array(this.h.count());var e=new $$t.bp(String,0);var f=new $$t.bp($$t.$c0.$type,0);var g=new $$t.bp($$t.$cc.$type.specialize(String,$$t.$m.$type),0);var h=this.h;for(var i=0;i<this.h.count();i++){var j=this.h.item(i);if($b($$t.$es.$type,j)!==null){e.add(this.dataProvider().sourceMetadata()._a._b._c);continue}e.add(j.uniqueName());g.add(new $$t.cc(String,$$t.$m.$type,1,j.uniqueName(),0))}var k=new $$t.bp($$t.$cc.$type.specialize(String,$$t.$m.$type),0);var l=this.dataProvider().tableMetadata().e();k=g;var m=this.c.m(k);m.j(function(n){$self.c.o(h,0,d,n.n(),l,null,f);$self.axis(function(){var $ret=new $$t.bn(f,h.count());$ret.name(a);return $ret}());c.e($self.axis())});return c._b},p:function(a,b,c,d,e,f,g,h){var i=this.positionResolver();if(h){this.c=new $$t.fi(this.dataProvider(),b.count(),this.a)}if(a>-1&&i.rootPositionInfo().count()>0){this.c.p(b,a,i.rootPositionInfo(),c,d,e)}else{var j=$$t.$co.z($$t.$fd.$type,$$t.$co.u($$t.$fd.$type,this.dataProvider().tableMetadata().e(),function(k){return!k._a}));this.c.o(b,0,c,d,j,null,e)}this.axis(function(){var $ret=new $$t.bn(e,b.count());$ret.name(f);return $ret}());g.e(this.axis())},addTuples:function(a){if(this.axis()==null){throw new $$t.ci(0)}var c=a.getEnumerator();while(c.moveNext()){var b=c.current();this.c.e(b.key(),b.value())}},extendWith:function(a){var b=new $$t.bp($$t.$cc.$type.specialize($$t.$c0.$type,$$t.$bf.$type.specialize($$t.$fd.$type)),0);var d=a.getPositionsMetadata().getEnumerator();while(d.moveNext()){
var c=d.current();var e=a.getTupleRowsMetadata(c);b.add(new $$t.cc($$t.$c0.$type,$$t.$bf.$type.specialize($$t.$fd.$type),1,c,e))}this.addTuples(b)},k:function(a){var $self=this;this.g=false;var b=new $$t.di($$t.$bn.$type,0);var c=new $$t.bp($$t.$cc.$type.specialize($$t.$c0.$type,$$t.$bf.$type.specialize($$t.$fd.$type)),0);var d=new $$t.bp($$t.$c0.$type,0);for(var e=0;e<this.c._d.positions().count();e++){var f=this.c._d.positions().__inner[e];var g=$$t.$co.z($$t.$fd.$type,$$t.$co.u($$t.$fd.$type,this.dataProvider().u($$t.$co.a($$t.$c1.$type,f.members()),f.itemsCount()),function(h){return!h._a}));if(g.count()>0){d.add(f)}c.add(new $$t.cc($$t.$c0.$type,$$t.$bf.$type.specialize($$t.$fd.$type),1,f,g))}if(c.count()>0){this.addTuples(c)}var h=new Array(this.h.count());var i=new $$t.bp($$t.$cc.$type.specialize(String,$$t.$m.$type),0);for(var j=0;j<this.h.count();j++){var k=this.h.item(j);if($b($$t.$es.$type,k)!==null){continue}i.add(new $$t.cc(String,$$t.$m.$type,1,k.uniqueName(),0))}this.c.m(i).j(function(l){$self.p($self.h.count()-1,$self.h,h,l.n(),new $$t.bp($$t.$c0.$type,0),a,b,false)});return b._b},getTupleRowsMetadata:function(a){return this.c.i(a)},$type:new $.ig.Type("FlatDataAxisProvider",$.ig.$ot,[$$t.$fc.$type])},true);$c("FlatDataAxisProviderHelper:fi","Object",{b:null,f:null,_j:null,init:function(a,b,c){$.ig.$op.init.call(this);this.b=c;this._c=a;this.f=new $$t.ca($$t.$m.$type,$$t.$bf.$type.specialize($$t.$fd.$type),0);this._d=new $$t.bo(String,$.ig.$op.$type,new $$t.bp($$t.$b7.$type.specialize(String,$.ig.$op.$type),0),b);this._j=this._d.positions()},_c:null,_d:null,i:function(a){var b=null;var c=this._d.getPositionIndex(a);if(c>-1){var d=this.f.tryGetValue(c,b);b=d.p1}return b},e:function(a,b){var c=this._d.getPositionIndex(a);if(c==-1){this.f.add(this._j.count(),b);this._j.add(a);return true}this.f.item(c,b);return false},p:function(a,b,c,d,e,f){var g=c.positionItemDepthMin();var i=$$t.$co.u($$t.$b9.$type.specialize(String,$.ig.$op.$type),c.values(),function(j){return j.positionItemDepth()<=g}).getEnumerator();while(i.moveNext()){var h=i.current();if(h.positionItemIndex()==b||h.count()==0){if(h.count()==0){b=h.positionItemIndex()}this.n(c,h,d,a,b,e,f)}else{var j=$$t.$fi.a(a,d,h);this.p(a,b,h,j,e,f);var k=$$t.$co.u($$t.$b9.$type.specialize(String,$.ig.$op.$type),c.values(),function(l){return l.parentKey()==h.key()});var m=k.getEnumerator();while(m.moveNext()){var l=m.current();var n=$$t.$fi.a(a,d,l);this.p(a,b,l,n,e,f)}}}},n:function(a,b,c,d,e,f,g){var h=b.positionItem();var i=h.clone();var j=new Array(d.count());$.ig.util.arrayCopy1(c,0,j,0,d.count());j[b.positionItemIndex()]=i;var k=$$t.$co.z($$t.$fd.$type,this._c.u(j,b.positionItemIndex()+1));if(k.count()>0){if(e<d.count()-1){this.o(d,e+1,j,f,k,null,g)}else{var l=new $$t.c0(j);var m=$$t.$co.z($$t.$fd.$type,$$t.$co.u($$t.$fd.$type,k,function(n){return!n._a}));var n=this._d.getPositionIndex(l);if(n==-1){this.f.add(this._j.count(),m);this._j.add(l)}else{this._j.item(n,l)}for(var p=0;p<j.length;p++){var o=j[p];o.position(l)}if(m.count()>0){g.add(l)}}if(b.isExpanded()){var r=$$t.$co.u($$t.$b9.$type.specialize(String,$.ig.$op.$type),a.values(),function(s){return s.parentKey()==b.key()}).getEnumerator();while(r.moveNext()){var q=r.current();this.n(a,q,c,d,e,f,g)}}}},o:function(a,b,c,d,e,f,g){var h=a.item(b);if($b($$t.$bh.$type,h)!==null){if(d.containsKey(h.uniqueName())==false){return}var i=d.item(h.uniqueName());if(f!=null){i=$$t.$co.u($$t.$d5.$type,i,function(j){return j.parentUniqueName()==f})}if(i==null){return}var k=i.getEnumerator();while(k.moveNext()){var j=k.current();var l;var m=this._c.i(j.uniqueName(),l);l=m.p1;var n=$$t.$co.z($$t.$fd.$type,$$t.$co.u($$t.$fd.$type,e,function(o){return o.d(j.levelUniqueName())==l}));if(n.count()>0){var o=new Array(a.count());$.ig.util.arrayCopy1(c,0,o,0,a.count());var p=new $$t.c1;p.caption(j.caption());p.hierarchyUniqueName(j.hierarchyUniqueName());p.levelNumber(j.levelDepth());p.levelUniqueName(j.levelUniqueName());p.uniqueName(j.uniqueName());p.displayInfo($i(j.childrenCardinality()));p.properties().add("PARENT_UNIQUE_NAME",j.parentUniqueName());p.properties().add("memberId",l.toString());o[b]=p;if(b==a.count()-1){var q=$$t.$co.z($$t.$fd.$type,$$t.$co.u($$t.$fd.$type,n,function(r){return!r._a}));var r=new $$t.c0(o);var s=this._d.getPositionIndex(r);if(s==-1){this.f.add(this._j.count(),q);this._j.add(r)}else{this._j.item(s,r)}for(var u=0;u<o.length;u++){var t=o[u];t.position(r)}if(q.count()>0){g.add(r)}}else{this.o(a,b+1,o,d,n,null,g)}}}}else if($b($$t.$es.$type,h)!==null){var v=h;var x=v.measures().getEnumerator();while(x.moveNext()){var w=x.current();var y=new Array(a.count());$.ig.util.arrayCopy1(c,0,y,0,a.count());var z=new $$t.c1;z.caption(w.caption());var aa=this.k(this._c.sourceMetadata()._a._b._c);z.hierarchyUniqueName(aa);z.levelNumber(0);z.uniqueName(w.uniqueName());y[b]=z;if(b==a.count()-1){var ab=new $$t.c0(y);var ac=$$t.$co.z($$t.$fd.$type,$$t.$co.u($$t.$fd.$type,e,function(ad){return!ad._a}));var ad=this._d.getPositionIndex(ab);if(ad==-1){this.f.add(this._j.count(),ac);this._j.add(ab)}else{this._j.item(ad,ab)}for(var af=0;af<y.length;af++){var ae=y[af];ae.position(ab)}if(ac.count()>0){g.add(ab)}}else{this.o(a,b+1,y,d,e,null,g)}}}},m:function(a){var b=this.b;if(a.count()==0){var c=new $$t.di($$t.$cb.$type.specialize(String,$$t.$aq.$type.specialize($$t.$d5.$type)),0);c.e(new $$t.ca(String,$$t.$aq.$type.specialize($$t.$d5.$type),0));return c._b}var d=new $$t.ca(String,$$t.$ef.$type,0);for(var e=0;e<a.count();e++){var f=a.item(e).key();var g=a.item(e).value();var h=$$t.$co.af($$t.$ef.$type,$$t.$co.u($$t.$ef.$type,b._x,function(i){return i.hierarchyUniqueName()==f&&i.depth()==g}));if(!d.containsKey(f)){d.add(f,h)}}return this.l(d)},k:function(a){if(a.substr(0,1)!="["){a="["+a}if(a.substr(a.length-1,1)!="]"){a+="]"}return a},l:function(a){var $self=this;var b=this.b;var c=new $$t.ca(String,$$t.$aq.$type.specialize($$t.$d5.$type),0);var d=new $$t.bp(String,0);var f=a.getEnumerator();while(f.moveNext()){var e=f.current();var g=e.value().uniqueName();var h;if(b.c(g)&&function(){var i=b.j(g,h);h=i.p1;return i.ret}()){c.add(e.key(),h)}else{d.add(e.key())}}if(d.count()==0){var i=new $$t.di($$t.$cb.$type.specialize(String,$$t.$aq.$type.specialize($$t.$d5.$type)),0);i.e(c);return i._b}var j=new Array(d.count());var k=0;var m=d.getEnumerator();while(m.moveNext()){var l=m.current();var n=new $$t.bp($$t.$ec.$type,0);n.add(function(){var $ret=new $$t.ec;$ret._a="LEVEL_UNIQUE_NAME";$ret._b=a.item(l).uniqueName();return $ret}());j[k]=this._c.discoverMembersAsync(null,n);k++}var o=new $$t.et;var p=o.d($$t.$cb.$type.specialize(String,$$t.$aq.$type.specialize($$t.$d5.$type)),j,function(q){return $self.h(q,d,c)});return p},h:function(a,b,c){for(var d=0;d<b.count();d++){var e=b.__inner[d];if(!c.containsKey(e)){var f=a[d].n();var h=f.getEnumerator();while(h.moveNext()){var g=h.current();this.b.aa(g)}c.add(e,f)}}return c},g:function(a,b){var c=new $$t.ca(String,$$t.$ef.$type,0);for(var d=0;d<b.count();d++){var e=a[d];if(e._a!=null||e._b){return null}var f=b.item(d);var g=$$t.$co.af($$t.$ef.$type,$$t.$co.u($$t.$ef.$type,e.n(),function(h){return h.depth()==f}));if(g!=null&&!c.containsKey(g.hierarchyUniqueName())){c.add(g.hierarchyUniqueName(),g)}}return c},a:function(a,b,c){var d=c.positionItem();var e=d.clone();var f=new Array(a.count());$.ig.util.arrayCopy1(b,0,f,0,a.count());f[c.positionItemIndex()]=e;return f},$type:new $.ig.Type("FlatDataAxisProviderHelper",$.ig.$ot)},true);$c("FlatDataPartialAxisProvider:fj","Object",{b:null,d:null,a:null,init:function(a,b,c,d){$.ig.$op.init.call(this);this.dataProvider(a);this.b=new $$t.fi(a,b.count(),d);this.a=c;this.d=b},_dataProvider:null,dataProvider:function(a){if(arguments.length===1){this._dataProvider=a;return a}else{return this._dataProvider}},_axis:null,axis:function(a){if(arguments.length===1){this._axis=a;return a}else{return this._axis}},generateAxis:function(a){var $self=this;var b=new $$t.di($$t.$bn.$type,0);if(this.axis()!=null){b.e(this.axis());return b._b}var c=new Array(this.a.position().itemsCount());var d=new $$t.bp($$t.$c0.$type,0);var e=this.a.position().indexOf(this.a);var f=this.a.position();var g=new $$t.bp($$t.$cc.$type.specialize(String,$$t.$m.$type),0);for(var h=0;h<this.a.position().itemsCount();h++){if(h<e){c[h]=this.a.position().members().item(h).clone()}else if(h==e){if($b($$t.$es.$type,this.d.item(h))!==null){continue}var i=f.members().item(h);g.add(new $$t.cc(String,$$t.$m.$type,1,i.hierarchyUniqueName(),i.depth()+1))}else{if($b($$t.$es.$type,this.d.item(h))!==null){continue}var j=f.members().item(h);g.add(new $$t.cc(String,$$t.$m.$type,1,j.hierarchyUniqueName(),j.depth()))}}this.b.m(g).j(function(k){var l=$$t.$co.z($$t.$fd.$type,$self.dataProvider().u($$t.$co.a($$t.$c1.$type,f.members()),e+1));$self.b.o($self.d,e,c,k.n(),l,$self.a.uniqueName(),d);$self.axis(function(){var $ret=new $$t.bn(d,f.itemsCount());$ret.name(a);return $ret}());b.e($self.axis())});return b._b},getTupleRowsMetadata:function(a){return this.b.i(a)},getPositionsMetadata:function(){return this.b._j},$type:new $.ig.Type("FlatDataPartialAxisProvider",$.ig.$ot,[$$t.$fc.$type])},true);$c("IFlatDataProvider:e0","Object",{$type:new $.ig.Type("IFlatDataProvider",null,[$$t.$eb.$type])},true);$c("FlatDataProvider:fe","Object",{v:null,w:null,y:null,z:null,l:null,m:null,p:null,q:null,r:null,aa:null,o:null,n:null,_tableMetadata:null,tableMetadata:function(a){if(arguments.length===1){this._tableMetadata=a;return a}else{return this._tableMetadata}},init:function(a,b){this.p=new $$t.ca(String,$$t.$m.$type,0);this.q=new $$t.ca(String,$$t.$fg.$type,0);this.r=new $$t.ca(String,$$t.$fg.$type,0);this.k=new $$t.ca(String,$$t.$cb.$type.specialize(String,$$t.$fg.$type),0);$.ig.$op.init.call(this);this.itemsSource(a);this.sourceMetadata(b);this.tableMetadata(new $$t.ff(a));if(b._a!=null){if(b._a._b==null){b._a._b=function(){var $ret=new $$t.e4;$ret._b="Measures";$ret._c="Measures";return $ret}()}else{if(String.isNullOrEmpty(b._a._b._b)){b._a._b._b="Measures"}if(String.isNullOrEmpty(b._a._b._c)){b._a._b._c="Measures"}}}},_itemsSource:null,itemsSource:function(a){if(arguments.length===1){this._itemsSource=a;return a}else{return this._itemsSource}},_sourceMetadata:null,sourceMetadata:function(a){if(arguments.length===1){this._sourceMetadata=a;return a}else{return this._sourceMetadata}},discoverCatalogsAsync:function(a,b){throw new $$t.b6(0)},discoverCubesAsync:function(a,b){var c=new $$t.di($$t.$aq.$type.specialize($$t.$da.$type),0);if(this.v==null){this.v=this.ab()}c.e(this.v);return c._b},discoverDimensionsAsync:function(a,b){var c=new $$t.di($$t.$aq.$type.specialize($$t.$ed.$type),0);if(this.w==null){this.w=this.ac()}c.e(this.w);return c._b},discoverHierarchiesAsync:function(a,b){var c=new $$t.di($$t.$aq.$type.specialize($$t.$bh.$type),0);if(this.y==null){this.y=this.ad()}c.e(this.y);return c._b},discoverLevelsAsync:function(a,b){var c=new $$t.di($$t.$aq.$type.specialize($$t.$ef.$type),0);var d=this.s(a,b);c.e(d);return c._b},s:function(a,b){if(this.z==null){this.l=new $$t.ca(String,$$t.$bf.$type.specialize($$t.$ef.$type),0);this.z=this.ae()}var c=null;var d=null;if(b!=null){c=$$t.$co.af($$t.$ec.$type,$$t.$co.u($$t.$ec.$type,b,function(e){return e._a=="HIERARCHY_UNIQUE_NAME"}));d=$$t.$co.af($$t.$ec.$type,$$t.$co.u($$t.$ec.$type,b,function(e){return e._a=="LEVEL_UNIQUE_NAME"}))}var e;if(c!=null){e=$$t.$co.u($$t.$ef.$type,this.z,function(f){return f.hierarchyUniqueName()==c._b})}else{e=$$t.$co.z($$t.$ef.$type,this.z)}if(d!=null){e=$$t.$co.u($$t.$ef.$type,e,function(f){return f.uniqueName()==d._b})}return e},discoverMeasuresAsync:function(a,b){var c=new $$t.di($$t.$aq.$type.specialize($$t.$bj.$type),0);if(this.aa==null){this.o=new $$t.ca(String,$$t.$bx.$type.specialize($$t.$x.$type,$$t.$e6.$type,$.ig.$op.$type),0);this.aa=this.af(this.o)}c.e(this.aa);return c._b},discoverMeasureGroupsAsync:function(a,b){throw new $$t.b6(0)},discoverMeasureGroupDimensionsAsync:function(a,b){throw new $$t.b6(0)},discoverMembersAsync:function(a,b){var c=new $$t.di($$t.$aq.$type.specialize($$t.$d5.$type),0);var d=this.discoverMembers(a,b);c.e(d);return c._b},discoverKpisAsync:function(a,b){var c=new $$t.di($$t.$aq.$type.specialize($$t.$ei.$type),0);c.e(new $$t.bp($$t.$ei.$type,0));return c._b},discoverMembers:function(a,b){var $self=this;if(this.n==null){this.n=new $$t.ca(String,$$t.$cb.$type.specialize(String,$$t.$d5.$type),0)}var c=$$t.$co.af($$t.$ec.$type,$$t.$co.u($$t.$ec.$type,b,function(d){return d._a=="HIERARCHY_UNIQUE_NAME"}));var d=$$t.$co.af($$t.$ec.$type,$$t.$co.u($$t.$ec.$type,b,function(e){return e._a=="LEVEL_UNIQUE_NAME"}));var e=$$t.$co.af($$t.$ec.$type,$$t.$co.u($$t.$ec.$type,b,function(f){return f._a=="MEMBER_UNIQUE_NAME"}));if(this.z==null){this.z=this.ae()}var f=null;var g=this.z;if(c!=null){g=$$t.$co.z($$t.$ef.$type,$$t.$co.u($$t.$ef.$type,g,function(h){return h.hierarchyUniqueName()==c._b}))}if(d!=null){var h=$$t.$co.ad($$t.$ef.$type,$$t.$co.u($$t.$ef.$type,g,function(i){return i.uniqueName()==d._b}));var i=h.hierarchyUniqueName();var j=h.depth();var k=0;if(e!=null){k=1}g=$$t.$co.z($$t.$ef.$type,$$t.$co.u($$t.$ef.$type,g,function(l){return l.hierarchyUniqueName()==i&&l.depth()<=j+k}))}else if(e!=null){throw new $$t.ci(1,"LEVEL_UNIQUE_NAME restriction is required for MEMBER_UNIQUE_NAME restriction.")}f=new Array(g.count());for(var l=0;l<g.count();l++){f[l]=g.item(l)}var m=null;if(f.length>0){var n=f[0];var o=$$t.$co.ad($$t.$bh.$type,$$t.$co.u($$t.$bh.$type,this.y,function(p){return p.uniqueName()==n.hierarchyUniqueName()}));var p=this.tableMetadata().e();this.al(f,0,".",null,o,p);if(c!=null&&d==null&&e==null){var q=new $$t.bp($$t.$d5.$type,0);for(var r=0;r<f.length;r++){var s=f[r];var t;if(!function(){var u=$self.n.tryGetValue(s.uniqueName(),t);t=u.p1;return u.ret}()){}var v=t.values().getEnumerator();while(v.moveNext()){var u=v.current();q.add(u)}}m=q}else{n=f[f.length-1];if(e==null){var w;if(!function(){var x=$self.n.tryGetValue(n.uniqueName(),w);w=x.p1;return x.ret}()){}m=w.values()}else{var x;if(!function(){var y=$self.n.tryGetValue(n.uniqueName(),x);x=y.p1;return y.ret}()){}var y=new $$t.bp($$t.$d5.$type,0);var aa=x.values().getEnumerator();while(aa.moveNext()){var z=aa.current();if(z.parentUniqueName()==e._b){y.add(z)}}m=y}}}else{m=new $$t.bp($$t.$d5.$type,0)}return m},evaluateResult:function(a,b,c){var $self=this;var d=new $$t.bp($$t.$dd.$type,0);if(a!=null){d.add(a.generateAxis("Axis0"))}if(b!=null){var e=a==null?"Axis0":"Axis1";d.add(b.generateAxis(e))}if(d.count()>0){var f=new Array(d.count());for(var g=0;g<d.count();g++){f[g]=d.item(g)}var h=new $$t.et;return h.d($$t.$bm.$type,f,function(i){return $self.d(a,b,c)})}var i=new $$t.di($$t.$bm.$type,0);var j=this.d(null,null,c);i.e(j);return i._b},am:function(a){var $self=this;var b=new $$t.ca(String,$$t.$cb.$type.specialize($$t.$m.$type,$$t.$cb.$type.specialize(String,$$t.$fg.$type)),0);var d=a.getEnumerator();while(d.moveNext()){var c=d.current();if(c._a.count()>0){for(var e=0;e<c._a.count();e++){var f=c._a.item(e);var g;if(function(){var h=$self.q.tryGetValue(f,g);g=h.p1;return h.ret}()){var h;if(!function(){var i=b.tryGetValue(c._b,h);h=i.p1;return i.ret}()){h=new $$t.ca($$t.$m.$type,$$t.$cb.$type.specialize(String,$$t.$fg.$type),0);b.add(c._b,h)}var i;if(!function(){var j=h.tryGetValue(g._a.levelDepth(),i);i=j.p1;return j.ret}()){i=new $$t.ca(String,$$t.$fg.$type,0);h.add(g._a.levelDepth(),i)}if(!i.containsKey(f)){i.add(f,g)}}}}}var j=new $$t.ca(String,$$t.$cb.$type.specialize(String,$$t.$fg.$type),0);var l=b.getEnumerator();while(l.moveNext()){var k=l.current();var m=k.value();var n=$$t.$co.z($$t.$cb.$type.specialize(String,$$t.$fg.$type),$$t.$co.o($$t.$cc.$type.specialize($$t.$m.$type,$$t.$cb.$type.specialize(String,$$t.$fg.$type)),$$t.$cb.$type.specialize(String,$$t.$fg.$type),$$t.$co.x($$t.$cc.$type.specialize($$t.$m.$type,$$t.$cb.$type.specialize(String,$$t.$fg.$type)),$$t.$m.$type,m,function(o){return o.key()}),function(o){return o.value()}));for(var o=n.count()-1;o>=0;o--){var p=$$t.$co.z($$t.$fg.$type,$$t.$co.o($$t.$cc.$type.specialize(String,$$t.$fg.$type),$$t.$fg.$type,n.item(o),function(q){return q.value()}));for(var q=0;q<p.count();q++){var r=p.item(q);var s=r._a.levelDepth();if(s>0){var t;if(!function(){var u=m.tryGetValue(s-1,t);t=u.p1;return u.ret}()||!t.containsKey(r._a.parentUniqueName())){var u;if(!function(){var v=j.tryGetValue(r._a.parentUniqueName(),u);u=v.p1;return v.ret}()){u=new $$t.ca(String,$$t.$fg.$type,0);j.add(r._a.parentUniqueName(),u)}u.add(r._a.uniqueName(),r)}}}}var v=n.item(0);var w=$$t.$co.ad($$t.$fg.$type,v.values());if(!String.isNullOrEmpty(w._a.parentUniqueName())){w=this.q.item(w._a.parentUniqueName())}var x=new $$t.bp($$t.$ec.$type,0);x.add(function(){var $ret=new $$t.ec;$ret._a="LEVEL_UNIQUE_NAME";$ret._b=w._a.levelUniqueName();return $ret}());var y=$$t.$co.z($$t.$d5.$type,this.discoverMembers(null,x));for(var z=0;z<y.count();z++){var aa=y.item(z);if(!v.containsKey(aa.uniqueName())&&!j.containsKey(aa.uniqueName())){j.add(aa.uniqueName(),new $$t.ca(String,$$t.$fg.$type,0))}}}var ac=this.k.keys().getEnumerator();while(ac.moveNext()){var ab=ac.current();var ad;if(function(){var ae=$self.q.tryGetValue(ab,ad);ad=ae.p1;return ae.ret}()){for(var ae=0;ae<ad._d.count();ae++){var af=ad._d.item(ae);if(af._a){af.h()}}}}this.k=j;var ah=this.k.keys().getEnumerator();while(ah.moveNext()){var ag=ah.current();var ai;if(function(){var aj=$self.q.tryGetValue(ag,ai);ai=aj.p1;return aj.ret}()){if(!this.g(ai)){for(var aj=0;aj<ai._d.count();aj++){var ak=ai._d.item(aj);ak.f()}}}}var am=this.k.keys().getEnumerator();while(am.moveNext()){var al=am.current();var an;if(function(){var ao=$self.q.tryGetValue(al,an);an=ao.p1;return ao.ret}()){var ao=$$t.$co.z($$t.$fg.$type,this.k.item(al).values());for(var ap=0;ap<ao.count();ap++){var aq=ao.item(ap);for(var ar=0;ar<aq._d.count();ar++){var as=aq._d.item(ar);if(as._a){as.h()}}}}}},g:function(a){var $self=this;var b=a._a.parentUniqueName();while(!String.isNullOrEmpty(b)){if(this.k.containsKey(b)){return true}var c;if(function(){var d=$self.q.tryGetValue(b,c);c=d.p1;return d.ret}()){b=c._a.parentUniqueName()}else{return false}}return false},k:null,u:function(a,b){var $self=this;var c=null;var d=-1;for(var e=0;e<b;e++){var f=a[e];var g=null;var h;if(function(){var i=$self.h(f.uniqueName(),h);h=i.p1;return i.ret}()){g=h._d}if(g!=null){if(c==null||c.count()>g.count()){d=e;c=g}}}if(c==null){c=$$t.$co.z($$t.$fd.$type,this.tableMetadata().e())}var i=c;for(var j=0;j<b;j++){if(j!=d){var k=a[j];var l;if(function(){var m=k.properties().tryGetValue("memberId",l);l=m.p1;return m.ret}()){var m=k.levelUniqueName();var n=$$t.$m.parseInt(l);i=$$t.$co.z($$t.$fd.$type,$$t.$co.u($$t.$fd.$type,i,function(o){return o.d(m)==n}))}}}return i},i:function(a,b){var $self=this;return{ret:function(){var c=$self.p.tryGetValue(a,b);b=c.p1;return c.ret}(),p1:b}},h:function(a,b){var $self=this;return{ret:function(){var c=$self.q.tryGetValue(a,b);b=c.p1;return c.ret}(),p1:b}},b:function($t,a){var b=new $$t.c5($t);var d=a.getEnumerator();while(d.moveNext()){var c=d.current();b.add(c)}return b},d:function(a,b,c){var d=null;if(a!=null){d=a.axis()}var e=null;if(b!=null){e=b.axis()}var f=this.a(d,e,c);var g=f[0];var h=$h(f[1]);var i=null;var j=-1;var k=null;var l=new $$t.ca(String,$$t.$m.$type,0);var m=new $$t.bt;var n=new $$t.bt;var o=new $$t.bt;for(var p=0;p<c.count();p++){l.add(c.item(p).uniqueName(),p);m.add(c.item(p))}if(g=="none"&&c.count()>0){i=c.item(0).uniqueName();j=l.item(i);k=this.o.item(i)}if(d==null&&e==null){var q=new $$t.bp($$t.$c4.$type,0);if(k!=null){var r=$$t.$co.u($$t.$fd.$type,this.tableMetadata().e(),function(s){return!s._a});var s=new $$t.bt;var u=$$t.$co.o($$t.$fd.$type,$.ig.$op.$type,r,function(v){return v._e}).getEnumerator();while(u.moveNext()){var t=u.current();s.add(t)}if(s.length>0){var v=new $$t.e6(0,0,0,j,n,o,m);var w=k(s,v);if(w!=null){var x=new $$t.c4;x.cellOrdinal(0);x.properties().add("Value",w);x.properties().add("FmtValue",w.toString());q.add(x)}}}return this.c(null,null,q)}if(e!=null){var y=e.tuples();for(var z=0;z<y.count();z++){n.add(y.__inner[z])}}if(d!=null){var aa=d.tuples();for(var ab=0;ab<aa.count();ab++){o.add(aa.__inner[ab])}}var ac=1;if(d!=null){ac=d.tuples().count()}var ad=1;if(e!=null){ad=e.tuples().count()}var ae=new $$t.bp($$t.$c4.$type,0);for(var af=0;af<ad;af++){var ag=null;var ah=null;if(e!=null){ah=e.tuples().__inner[af];ag=b.getTupleRowsMetadata(ah);if(g=="rows"){i=ah.members().item(h).uniqueName();j=l.item(i);k=this.o.item(i)}}for(var ai=0;ai<ac;ai++){var aj=ag;var ak=null;var al=null;if(d!=null){al=d.tuples().__inner[ai];ak=a.getTupleRowsMetadata(al);if(g=="columns"){i=al.members().item(h).uniqueName();j=l.item(i);k=this.o.item(i)}}if(aj!=null){if(ak!=null){var am=h;if(g=="columns"&&ak.count()<ag.count()||g=="rows"&&ak.count()>=ag.count()||g=="none"){am=-1}aj=this.ag(aj,ak,ah,al,am)}}else{aj=ak}if(k!=null){var an=af*ac+ai;var ao=new $$t.e6(af,ai,an,j,n,o,m);var ap=new $$t.bt;var ar=$$t.$co.o($$t.$fd.$type,$.ig.$op.$type,aj,function(as){return as._e}).getEnumerator();while(ar.moveNext()){var aq=ar.current();ap.add(aq)}if(ap.length>0){var as=k(ap,ao);if(as!=null){var at=new $$t.c4;at.cellOrdinal(an);at.properties().add("Value",as.toString());at.properties().add("FmtValue",as.toString());ae.add(at)}}}}}var au=this.c(d,e,ae);return au},c:function(a,b,c){var d=function(){var $ret=new $$t.bm;$ret.axes(new $$t.bp($$t.$bn.$type,0));return $ret}();if(a!=null){d.axes().add(a)}if(b!=null){d.axes().add(b)}d.cells(c);d.isEmpty(b==null&&a==null&&c.count()==0);return d},ag:function(a,b,c,d,e){if(b.count()<a.count()){a=b;d=c}for(var f=0;f<d.members().count();f++){var g=d.members().item(f);var h;if(function(){var i=g.properties().tryGetValue("memberId",h);h=i.p1;return i.ret}()){var i=$$t.$m.parseInt(h);a=$$t.$co.z($$t.$fd.$type,$$t.$co.u($$t.$fd.$type,a,function(j){return j.d(g.levelUniqueName())==i}))}}return a},a:function(a,b,c){var d=this.aj(this.sourceMetadata()._a._b._c);var e="none";var f=-1;if(c.count()>0){if(a!=null&&a.tuples().count()>0){var g=a.tuples().__inner[0];for(var h=0;h<g.members().count();h++){var i=g.members().item(h);if(i.hierarchyUniqueName()==d){e="columns";f=h;break}}}if(e=="none"){if(b!=null&&b.tuples().count()>0){var j=b.tuples().__inner[0];for(var k=0;k<j.members().count();k++){var l=j.members().item(k);if(l.hierarchyUniqueName()==d){e="rows";f=k;break}}}}}return[e,f]},al:function(a,b,c,d,e,f){var $self=this;var g=a[b];var h=this.m.item(g.uniqueName());var i=$$t.$co.af($$t.$ef.$type,$$t.$co.u($$t.$ef.$type,this.z,function(j){return j.hierarchyUniqueName()==e.uniqueName()&&j.depth()==g.depth()+1}));var j=null;if(d!=null){j=d.uniqueName()}var k;if(!function(){var l=$self.n.tryGetValue(g.uniqueName(),k);k=l.p1;return l.ret}()){k=new $$t.ca(String,$$t.$d5.$type,0);this.n.add(g.uniqueName(),k)}var l=new $$t.bp($$t.$fh.$type.specialize($$t.$fd.$type),0);var m=new $$t.ca(String,$$t.$bf.$type.specialize($$t.$fd.$type),0);var o=f.getEnumerator();while(o.moveNext()){var n=o.current();var p=h(n._e);if(p!=null){var q;if(!function(){var r=m.tryGetValue(p,q);q=r.p1;return r.ret}()){q=new $$t.bp($$t.$fd.$type,0);m.add(p,q);l.add(new $$t.fh($$t.$fd.$type,1,p,q))}q.add(n)}}for(var r=0;r<l.count();r++){var s=l.item(r)._b;var t=l.item(r)._a;var u=c+"&"+this.aj(s);var v=g.uniqueName()+u;var w;var x;var y;if(!function(){var z=k.tryGetValue(v,w);w=z.p1;return z.ret}()){w=new $$t.d5;w.caption(s);w.dimensionUniqueName(g.dimensionUniqueName());w.hierarchyUniqueName(g.hierarchyUniqueName());w.levelDepth(g.depth());w.levelUniqueName(g.uniqueName());w.name(s);w.parentLevel(g.depth()-1);w.parentUniqueName(j);w.uniqueName(v);if(i!=null){w.childrenCardinality(1)}if(d!=null){d.childrenCardinality(d.childrenCardinality()+1)}k.add(v,w);x=this.p.count();this.p.add(w.uniqueName(),x);y=new $$t.fg(w,u,x,k.count());this.q.add(w.uniqueName(),y);this.r.add(w.uniqueName(),y);for(var z=0;z<t.count();z++){var aa=t.item(z);aa.g(g.uniqueName(),x);y.h(aa)}}if(b+1<a.length){this.al(a,b+1,u,w,e,t)}}if(d!=null){d.childrenCardinality(l.count())}},aj:function(a){if(a.substr(0,1)!="["){a="["+a}if(a.substr(a.length-1,1)!="]"){a+="]"}return a},x:null,j:null,ab:function(){var a=new $$t.bp($$t.$da.$type,0);if(this.sourceMetadata()==null||this.sourceMetadata()._a==null){return a}var b=new $$t.da;b.caption(this.sourceMetadata()._a._c);b.name(this.sourceMetadata()._a._e);b.description(this.sourceMetadata()._a._d);a.add(b);return a},af:function(a){var b=new $$t.bp($$t.$bj.$type,0);if(this.sourceMetadata()==null||this.sourceMetadata()._a==null||this.sourceMetadata()._a._b==null||this.sourceMetadata()._a._b._a==null){return b}var c=this.sourceMetadata()._a._b._c;var e=this.sourceMetadata()._a._b._a.getEnumerator();while(e.moveNext()){var d=e.current();var f=new $$t.bj;f.caption(d._e);f.defaultFormatString(d._d);f.measureDisplayFolder(d._c);f.name(d._f);f.uniqueName(this.aj(c)+"."+this.aj(d._f));b.add(f);a.item(f.uniqueName(),d._b)}return b},ac:function(){if(this.v==null){this.v=this.ab()}var a=new $$t.bp($$t.$ed.$type,0);if(this.sourceMetadata()==null||this.sourceMetadata()._a==null){return a}var b=new $$t.ed;b.dimensionType(2);b.caption(this.sourceMetadata()._a._b._b);b.uniqueName(this.aj(this.sourceMetadata()._a._b._c));a.add(b);if(this.sourceMetadata()._a._a==null){return a}this.x=new $$t.bp($$t.$e7.$type,0);var d=this.sourceMetadata()._a._a.getEnumerator();while(d.moveNext()){var c=d.current();this.x.add(c);var e=new $$t.ed;e.caption(c._b);e.defaultHierarchy(c._c);e.uniqueName(this.aj(c._e));e.name(c._e);e.description(c._d);a.add(e)}return a},ad:function(){var $self=this;if(this.w==null){this.w=this.ac()}var a=new $$t.bp($$t.$bh.$type,0);if(this.sourceMetadata()==null||this.sourceMetadata()._a==null){return a}var b=new $$t.bh;b.uniqueName(this.aj(this.sourceMetadata()._a._b._c));b.dimensionUniqueName(this.aj(this.sourceMetadata()._a._b._c));a.add(b);if(this.sourceMetadata()._a._a==null){return a}this.j=new $$t.ca(String,$$t.$bf.$type.specialize($$t.$e8.$type),0);for(var c=0;c<this.x.count();c++){var d=this.x.item(c);if(d._a!=null){var e;if(!function(){var f=$self.j.tryGetValue(d._e,e);e=f.p1;return f.ret}()){e=new $$t.bp($$t.$e8.$type,0);this.j.add(d._e,e)}var g=d._a.getEnumerator();while(g.moveNext()){var f=g.current();e.add(f);var h=new $$t.bh;h.caption(f._b);h.description(f._c);h.dimensionUniqueName(this.aj(d._e));h.hierarchyDisplayFolder(f._d);h.name(f._e);h.uniqueName(h.dimensionUniqueName()+"."+this.aj(h.name()));a.add(h)}}}return a},ae:function(){var $self=this;if(this.y==null){this.y=this.ad()}this.m=new $$t.ca(String,$$t.$cp.$type.specialize($.ig.$op.$type,String),0);var a=new $$t.bp($$t.$ef.$type,0);if(this.sourceMetadata()==null||this.sourceMetadata()._a==null){return a}var b=new $$t.ef;b.hierarchyUniqueName(this.aj(this.sourceMetadata()._a._b._c));b.uniqueName(b.hierarchyUniqueName()+".[MeasuresLevel]");b.depth(-1);a.add(b);if(this.sourceMetadata()._a._a==null){return a}var c=new $$t.e8;c._e=this.sourceMetadata()._a._b._c;c._b=this.sourceMetadata()._a._b._b;var d=new $$t.bp($$t.$e8.$type,0);d.add(c);for(var e=0;e<this.x.count();e++){var f=this.x.item(e);var g;if(function(){var h=$self.j.tryGetValue(f._e,g);g=h.p1;return h.ret}()){for(var h=0;h<g.count();h++){d.add(g.item(h))}}}for(var i=0;i<d.count();i++){var j=d.item(i);if(j._a==null){continue}var k=this.y.item(i);for(var l=0;l<j._a.count();l++){var m=j._a.item(l);var n=new $$t.ef;n.caption(m._b);n.depth(l);n.dimensionUniqueName(k.dimensionUniqueName());n.hierarchyUniqueName(k.uniqueName());n.name(m._c);n.uniqueName(k.uniqueName()+"."+this.aj(n.name()));a.add(n);var o;if(!function(){var p=$self.l.tryGetValue(k.uniqueName(),o);o=p.p1;return p.ret}()){o=new $$t.bp($$t.$ef.$type,0);this.l.add(k.uniqueName(),o)}o.add(n);this.m.item(n.uniqueName(),m._a)}}return a},$type:new $.ig.Type("FlatDataProvider",$.ig.$ot,[$$t.$e0.$type])},true);$c("KeyListPair$1:fh","Object",{$t:null,_b:null,_a:null,init:function($t,a){this.$t=$t;if(!this.hasOwnProperty("$type")){this.$type=this.$type.specialize(this.$t)}if(a>0){switch(a){case 1:this.init1.apply(this,arguments);break}return}$.ig.$op.init.call(this);this._b=String.empty();this._a=new $$t.bp(this.$t,0)},init1:function($t,a,b,c){this.$t=$t;if(!this.hasOwnProperty("$type")){this.$type=this.$type.specialize(this.$t)}$.ig.$op.init.call(this);this._b=b;this._a=c},$type:new $.ig.Type("KeyListPair$1",$.ig.$ot)},true);$c("CellMetadata:e6","Object",{init:function(a,b,c,d,e,f,g){$.ig.$op.init.call(this);this.rowIndex(a);this.columnIndex(b);this.cellOrdinal(c);this.measureIndex(d);this.rowTuples(e);this.columnTuples(f);this.measures(g)},_rowIndex:0,rowIndex:function(a){if(arguments.length===1){this._rowIndex=a;return a}else{return this._rowIndex}},_columnIndex:0,columnIndex:function(a){if(arguments.length===1){this._columnIndex=a;return a}else{return this._columnIndex}},_cellOrdinal:0,cellOrdinal:function(a){if(arguments.length===1){this._cellOrdinal=a;return a}else{return this._cellOrdinal}},_measureIndex:0,measureIndex:function(a){if(arguments.length===1){this._measureIndex=a;return a}else{return this._measureIndex}},_rowTuples:null,rowTuples:function(a){if(arguments.length===1){this._rowTuples=a;return a}else{return this._rowTuples}},_columnTuples:null,columnTuples:function(a){if(arguments.length===1){this._columnTuples=a;return a}else{return this._columnTuples}},_measures:null,measures:function(a){if(arguments.length===1){this._measures=a;return a}else{return this._measures}},$type:new $.ig.Type("CellMetadata",$.ig.$ot)},true);$c("CubeMetadata:e3","Object",{init:function(){$.ig.$op.init.call(this);this._a=new $$t.c5($$t.$e7.$type)},_e:null,_c:null,_d:null,_b:null,_a:null,$type:new $.ig.Type("CubeMetadata",$.ig.$ot)},true);$c("MeasuresDimensionMetadata:e4","Object",{init:function(){$.ig.$op.init.call(this)},_b:null,_c:null,_a:null,$type:new $.ig.Type("MeasuresDimensionMetadata",$.ig.$ot)},true);$c("DataMemberMetadata:fg","Object",{init:function(a,b,c,d){$.ig.$op.init.call(this);this._a=a;this._g=b;this._e=c;this._f=d;this._d=new $$t.bp($$t.$fd.$type,0)},_e:0,_a:null,_g:null,_f:0,_d:null,c:function(){return $$t.$co.z($$t.$fd.$type,$$t.$co.u($$t.$fd.$type,this._d,function(a){return a._a==false}))},h:function(a){this._d.add(a)},b:function(a){if(this._d.remove(a)){return true}return false},$type:new $.ig.Type("DataMemberMetadata",$.ig.$ot)},true);$c("DataSourceMetadata:e2","Object",{init:function(){$.ig.$op.init.call(this)},_a:null,$type:new $.ig.Type("DataSourceMetadata",$.ig.$ot)},true);$c("DimensionMetadata:e7","Object",{init:function(){$.ig.$op.init.call(this)},_e:null,_c:null,_b:null,_d:null,_a:null,$type:new $.ig.Type("DimensionMetadata",$.ig.$ot)},true);$c("HierarchyMetadata:e8","Object",{init:function(){$.ig.$op.init.call(this)},_e:null,_b:null,_c:null,_d:null,_a:null,$type:new $.ig.Type("HierarchyMetadata",$.ig.$ot)},true);$c("LevelMetadata:e9","Object",{init:function(){$.ig.$op.init.call(this)},_c:null,_b:null,_a:null,$type:new $.ig.Type("LevelMetadata",$.ig.$ot)},true);$c("MeasureMetadata:e5","Object",{init:function(){$.ig.$op.init.call(this);this._a=1},_b:null,_a:0,_d:null,_f:null,_e:null,_c:null,$type:new $.ig.Type("MeasureMetadata",$.ig.$ot)},true);$c("RowMetadata:fd","Object",{b:null,c:0,init:function(a){$.ig.$op.init.call(this);this.b=new $$t.ca(String,$$t.$m.$type,0);this.c=0;this._a=false;this._e=a},g:function(a,b){if(this.b.containsKey(a)){return}this.b.item(a,b)},d:function(a){var b;var c=this.b.tryGetValue(a,b);b=c.p1;return b},f:function(){this.c++;this._a=true},h:function(){this.c--;this._a=this.c>0},_e:null,_a:false,$type:new $.ig.Type("RowMetadata",$.ig.$ot)},true);$c("TableMetadata:ff","Object",{d:null,a:null,c:null,f:0,init:function(a){$.ig.$op.init.call(this);var b=0;var c=$b($$t.$v.$type,a);if(c!=null){b=c.count()}else{var e=a.getEnumerator();while(e.moveNext()){var d=e.current();b++}}this.c=new $$t.bp($$t.$fd.$type,0);this.a=new Array(b);var g=a.getEnumerator();while(g.moveNext()){
var f=g.current();var h=new $$t.fd(f);this.h(h);this.c.add(h)}this.d=new $$t.bp(String,0)},e:function(){return this.c},b:function(){return this.a},g:function(){return this.f},h:function(a){if(this.f==this.a.length){this.i()}this.a[this.f++]=a},j:function(a,b){if(this.f==this.a.length){this.i()}$.ig.util.arrayCopy1(this.a,a,this.a,a+1,this.f-a);this.a[a]=b;this.f++},k:function(a){this.f--;$.ig.util.arrayCopy1(this.a,a+1,this.a,a,this.f-a);var b=$$t.$u.resize$1($$t.$fd.$type,this.a,this.f);this.a=b.p0},i:function(){var a=new Array(this.f+1);$.ig.util.arrayCopy1(this.a,0,a,0,this.f);this.a=a},$type:new $.ig.Type("TableMetadata",$.ig.$ot)},true);$$t.$fe.defaultMeasureGroup="(All)"})($);/*!@license
* Infragistics.Web.ClientUI Pivot Shared 21.2.12
*
* Copyright (c) 2011-2012 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on:
*   jquery-1.9.1.js
*   jquery.ui.core.js
*   jquery.ui.widget.js
*   jquery.ui.mouse.js
*   jquery.ui.draggable.js
*   jquery.ui.droppable.js
*   infragistics.util.js
*   infragistics.util.jquery.js
*   infragistics.datasource.js
*   infragistics.olapxmladatasource.js
*   infragistics.olapflatdatasource.js
*   infragistics.templating.js
*   infragistics.ui.shared.js
*   infragistics.ui.scroll.js
*   infragistics.ui.tree.js
*/
(function($){var _aNull=function(val){return val===null||val===undefined},_draggable=$.ui.draggable.prototype.widgetFullName||$.ui.draggable.prototype.widgetName,_tree=$.ui.igTree.prototype.widgetFullName||$.ui.igTree.prototype.widgetName;$.ig=$.ig||{};$.ig.Pivot=$.ig.Pivot||{};$.ig.Pivot._pivotShared=$.ig.Pivot._pivotShared||{_isInstance:function(object,typeName){return typeName!==undefined&&!_aNull(object)&&object.$type&&object.$type.name===typeName},_const:{index:0,dragCursorAt:{top:-10,left:10},dragHelperMarkup:"<div class='ui-widget ui-corner-all ui-igpivot-draghelper'><p><span></span><strong>{0}</strong></p></div>",touchEvents:{mousedown:"touchstart mousedown",mouseover:"mouseover",mouseout:"mouseover"},ie:!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase())},_insertIndex:0,_showLastLevelExpanders:true,_createDataSource:function(dataSource,dataSourceOptions){var ds=null,dsOptions;if(!_aNull(dataSource)&&(this._isInstance(dataSource,"OlapXmlaDataSource")||this._isInstance(dataSource,"OlapFlatDataSource"))){ds=dataSource}else if(!_aNull(dataSourceOptions)){dsOptions=$.extend({},dataSourceOptions);delete dsOptions.xmlaOptions;delete dsOptions.flatDataOptions;if(!_aNull(dataSourceOptions.xmlaOptions)&&!_aNull(dataSourceOptions.xmlaOptions.serverUrl)){dsOptions=$.extend(dsOptions,dataSourceOptions.xmlaOptions);ds=new $.ig.OlapXmlaDataSource(dsOptions)}else if(!_aNull(dataSourceOptions.flatDataOptions)&&(!_aNull(dataSourceOptions.flatDataOptions.dataSource)||!_aNull(dataSourceOptions.flatDataOptions.dataSourceUrl))){dsOptions=$.extend(dsOptions,dataSourceOptions.flatDataOptions);ds=new $.ig.OlapFlatDataSource(dsOptions)}}return ds},_addingKpiMetadataItems:function(dataSource,name){var kpi,kpiMeasure,kpiValue,kpiGoal,kpiStatus,kpiTrend,kpiWeight,item;kpi=dataSource.getCoreElement(function(el){return el.uniqueName()===name},$.ig.Kpi.prototype.getType());item=[];kpiValue=kpi.kpiValue();kpiGoal=kpi.kpiGoal();kpiStatus=kpi.kpiStatus();kpiTrend=kpi.kpiTrend();kpiWeight=kpi.kpiWeight();if(null!==kpiValue&&""!==kpiValue){kpiMeasure=dataSource.getCoreElement(function(el){return el.uniqueName()===kpiValue},$.ig.Measure.prototype.getType());if(null===kpiMeasure){kpiMeasure=dataSource.getCoreElement(function(el){return el.uniqueName()===kpiValue},$.ig.KpiMeasure.prototype.getType())}item.push(kpiMeasure)}if(null!==kpiGoal&&""!==kpiGoal){kpiMeasure=dataSource.getCoreElement(function(el){return el.uniqueName()===kpiGoal},$.ig.Measure.prototype.getType());if(null===kpiMeasure){kpiMeasure=dataSource.getCoreElement(function(el){return el.uniqueName()===kpiGoal},$.ig.KpiMeasure.prototype.getType())}item.push(kpiMeasure)}if(null!==kpiStatus&&""!==kpiStatus){kpiMeasure=dataSource.getCoreElement(function(el){return el.uniqueName()===kpiStatus},$.ig.KpiMeasure.prototype.getType());item.push(kpiMeasure)}if(null!==kpiTrend&&""!==kpiTrend){kpiMeasure=dataSource.getCoreElement(function(el){return el.uniqueName()===kpiTrend},$.ig.KpiMeasure.prototype.getType());item.push(kpiMeasure)}if(null!==kpiWeight&&""!==kpiWeight){kpiMeasure=dataSource.getCoreElement(function(el){return el.uniqueName()===kpiWeight},$.ig.KpiMeasure.prototype.getType());item.push(kpiMeasure)}return item},_getEvent:function(event){if($.ig.util.isTouchDevice()){return this._const.touchEvents[event]}return event},_makeDroppable:function(droppable){var $this=this;{droppable.droppable({tolerance:"pointer",accept:function(draggable){return draggable.hasClass("ui-igpivot-dragover")===false&&draggable.closest("li.ui-igtree-node").length===0&&(draggable.hasClass("ui-igpivot-metadataitem")||draggable.find(".ui-igpivot-metadataitem:first").length>0)},over:function(event,ui){var isValid=true,markup=$(ui.helper.html()),element=ui.draggable,typeName,name;if(!element.hasClass("ui-igpivot-metadataitem")){element=element.find(".ui-igpivot-metadataitem:first")}if(element.length>0){typeName=element.attr("data-type");name=element.attr("data-name")}else{return false}if($.isFunction($this.options.customMoveValidation)){isValid=$this.options.customMoveValidation.call($this.element,$this.widgetName,typeName,name)}if(ui.helper.hasClass("ui-igpivot-draghelper")){if(isValid){markup.find("span").removeClass("ui-icon-plus ui-icon-cancel").addClass("ui-icon-close").siblings("strong");ui.helper.removeClass($this.css.dropIndicator).addClass($this.css.invalidDropIndicator).html(markup)}else{markup.find("span").removeClass("ui-icon-plus ui-icon-close").addClass("ui-icon-cancel").siblings("strong");ui.helper.removeClass($this.css.dropIndicator).addClass($this.css.invalidDropIndicator).html(markup)}}},out:function(event,ui){var markup=$(ui.helper.html());if(ui.helper.hasClass("ui-igpivot-draghelper")){markup.find("span").removeClass("ui-icon-close ui-icon-plus").addClass("ui-icon-cancel").siblings("strong");ui.helper.removeClass($this.css.dropIndicator).addClass($this.css.invalidDropIndicator).html(markup)}},drop:function(event,ui){var element=ui.draggable,isValid=true,typeName,type,name,item,noCancel,location,dataRole;ui.draggable.unbind("."+$this.widgetName);if(!element.hasClass("ui-igpivot-metadataitem")){element=element.find(".ui-igpivot-metadataitem:first")}if(element.length>0){typeName=element.attr("data-type");name=element.attr("data-name")}else{return false}if($.isFunction($this.options.customMoveValidation)){dataRole=$(this).attr("data-role");location=dataRole===undefined?$this.widgetName:dataRole;isValid=$this.options.customMoveValidation.call($this.element,location,typeName,name)}if(!isValid){return false}switch(typeName){case $.ig.Dimension.prototype.getType().typeName():type=$.ig.Dimension.prototype.getType();break;case $.ig.Hierarchy.prototype.getType().typeName():type=$.ig.Hierarchy.prototype.getType();break;case $.ig.Measure.prototype.getType().typeName():type=$.ig.Measure.prototype.getType();break;case $.ig.MeasureList.prototype.getType().typeName():type=$.ig.MeasureList.prototype.getType();break;case $.ig.Kpi.prototype.getType().typeName():type=$.ig.Kpi.prototype.getType();break;case $.ig.KpiMeasure.prototype.getType().typeName():type=$.ig.KpiMeasure.prototype.getType();break;default:return false}item=$this._ds.getCoreElement(function(el){return el.uniqueName()===name},type);if(item){noCancel=$this._triggerMetadataRemoving(event,element,item);if(noCancel){$this._ds.removeFilterItem(item);$this._ds.removeRowItem(item);$this._ds.removeColumnItem(item);$this._ds.removeMeasureItem(item);$this._triggerMetadataRemoved(event,item);$this._updateDataSource();return true}}return false}})}},_createDropAreaOptions:function(){var $this=this,dropAreaOptions={greedy:true,tolerance:"pointer",activeClass:this.css.activeDropArea,accept:function(draggable){return $this._accept($(this),draggable)},over:function(event,ui){$this._onDraggableOver(event,ui)},out:function(event,ui){$this._onDraggableOut(event,ui)},drop:function(event,ui){var element=ui.draggable,type,name;if(!element.hasClass("ui-igpivot-metadataitem")){element=element.find(".ui-igpivot-metadataitem:first")}if(element.length>0){type=element.attr("data-type");name=element.attr("data-name");if(!name){name="null"}return $this._onDrop(event,ui,$(this),element,type,name)}return false}};return dropAreaOptions},_onDataSourceCollectionChanged:function(collection,collectionChangedArgs,dropArea,isDisabled){var action,items,i,length,name,filter,startingIndex,previousItem,destroyDraggable;action=collectionChangedArgs.action();switch(action){case $.ig.NotifyCollectionChangedAction.prototype.add:items=collectionChangedArgs.newItems().__inner;startingIndex=collectionChangedArgs.newStartingIndex();if(startingIndex===0){this._createMetadataElement(items[0],isDisabled,"prependTo",dropArea)}else{previousItem=dropArea.find(".ui-igpivot-metadataitem")[startingIndex-1];this._createMetadataElement(items[0],isDisabled,"insertAfter",previousItem)}break;case $.ig.NotifyCollectionChangedAction.prototype.remove:items=collectionChangedArgs.oldItems().__inner;filter=function(ind,itemElement){return $(itemElement).attr("data-name")===name};destroyDraggable=function(ind,el){var draggable=$(el).data(_draggable);if(draggable){draggable.destroy()}};for(i=0,length=items.length;i<length;i++){if(this._isInstance(items[i],"MeasureList")){dropArea.find(".ui-igpivot-metadataitem[data-type="+$.ig.MeasureList.prototype.getType().typeName()+"]").each(destroyDraggable).remove()}else{name=items[i].uniqueName();dropArea.find(".ui-igpivot-metadataitem").filter(filter).each(destroyDraggable).remove()}}break;case $.ig.NotifyCollectionChangedAction.prototype.reset:destroyDraggable=function(ind,el){var draggable=$(el).data(_draggable);if(draggable){draggable.destroy()}};dropArea.find(".ui-igpivot-metadataitem").each(destroyDraggable).remove();break}},_createMetadataElement:function(item,isDisabled,appendFunc,target){var $this=this,dragAndDropSettings=this.options.dragAndDropSettings,metadataElement,metadataElementMarkup;metadataElementMarkup="<li ";if(this._isInstance(item,"MeasureList")&&item.caption()===null){item.caption($.ig.util.getLocaleValue("PivotShared","measureList"))}else{metadataElementMarkup+="data-name='"+item.uniqueName()+"' "}metadataElementMarkup+="title='"+item.caption()+"' data-type='"+item.getType().typeName()+"'>";if(this._isInstance(item,"Hierarchy")&&!isDisabled){metadataElementMarkup+="<span style='display:block; float:left;'"+" class='ui-icon "+this.css.filterIcon+"'></span>"}if(this.widget()[0].className.indexOf("ui-igpivotdataselector ui-droppable")!==-1&&target!==undefined){metadataElementMarkup+="<div style='float:left; display:block; width: calc(100%";if("Hierarchy"===item.getType().typeName()){metadataElementMarkup+=" - 28px"}else{metadataElementMarkup+=" - 16px"}metadataElementMarkup+=");overflow-x:hidden !important; text-overflow:ellipsis !important;'>";metadataElementMarkup+="<span data-role='caption'>";metadataElementMarkup+=item.caption();metadataElementMarkup+="</span>";metadataElementMarkup+="</div>"}else{metadataElementMarkup+="<span data-role='caption'>"+item.caption()+"</span>"}if(!isDisabled){metadataElementMarkup+="<span class='ui-icon ui-icon-close'></span>"}metadataElementMarkup+="</li>";metadataElement=$(metadataElementMarkup).addClass(this.css.metadataItem);metadataElement[appendFunc](target);if(!isDisabled){metadataElement.find("span.ui-icon-pivot-smallfilter").click(function(event){$this._createFilterDropDown(event,this,item);return false});metadataElement.find("span.ui-icon-close").click(function(event){var noCancel=$this._triggerMetadataRemoving(event,metadataElement,item);if(noCancel){$this._ds.removeFilterItem(item);$this._ds.removeRowItem(item);$this._ds.removeColumnItem(item);$this._ds.removeMeasureItem(item);$this._triggerMetadataRemoved(event,item);$this._updateDataSource();return false}return false});{metadataElement.draggable({appendTo:dragAndDropSettings.appendTo,containment:dragAndDropSettings.containment,opacity:dragAndDropSettings.dragOpacity,zIndex:dragAndDropSettings.zIndex,cursorAt:this._const.dragCursorAt,revert:false,cancel:".ui-icon",helper:function(event){var target=$(event.target).closest(".ui-igpivot-metadataitem").find("span[data-role='caption']"),markup=$($this._const.dragHelperMarkup.replace("{0}",target.text()));markup.addClass($this.css.invalidDropIndicator).find("span").addClass("ui-icon");return markup},start:function(event,ui){return $this._triggerDragStart(event,ui,item)},drag:function(event,ui){return $this._triggerDrag(event,ui,item)},over:function(event,ui){$this._onDraggableOver(event,ui)},out:function(event,ui){$this._onDraggableOut(event,ui)},stop:function(event,ui){$this._triggerDragStop(event,ui)}})}metadataElement.click(function(event){$this._createMetadataItemDropDown(event,this,item)})}return metadataElement},_accept:function(targetElement,draggable){var target,typeName,isValid=false,isMeasureDimension,dimension,dataSource=this._ds;if(!draggable.hasClass("ui-igpivot-metadataitem")){draggable=draggable.find(".ui-igpivot-metadataitem:first")}typeName=draggable.attr("data-type");target=targetElement.attr("data-role");$(".ui-igpivot-overlaydroparea").css("display","block");dimension=dataSource.getCoreElement(function(el){return el.dimensionType()===$.ig.DimensionType.prototype.measure},$.ig.Dimension.prototype.getType());isMeasureDimension=draggable.text()===dimension.name()||draggable.text()===dimension.caption();if(typeName){switch(target){case"rows":case"columns":isValid=typeName===$.ig.Hierarchy.prototype.getType().typeName()||typeName===$.ig.Dimension.prototype.getType().typeName()&&!isMeasureDimension||typeName===$.ig.MeasureList.prototype.getType().typeName();break;case"filters":isValid=typeName===$.ig.Hierarchy.prototype.getType().typeName()||typeName===$.ig.Dimension.prototype.getType().typeName()&&!isMeasureDimension;break;case"measures":isValid=(typeName===$.ig.Measure.prototype.getType().typeName()||typeName===$.ig.Kpi.prototype.getType().typeName()||typeName===$.ig.KpiMeasure.prototype.getType().typeName()||isMeasureDimension)&&"MeasureList"!==draggable.attr("data-type");break}}return isValid},_onDraggableOver:function(event,ui){var $this=this,isValid=true,markup=$(ui.helper.html()),element=ui.draggable,typeName,name;ui.draggable.addClass("ui-igpivot-dragover");$(".ui-igpivot-overlaydroparea").css("display","none");if(!element.hasClass("ui-igpivot-metadataitem")){element=element.find(".ui-igpivot-metadataitem:first")}if(element.length>0){typeName=element.attr("data-type");name=element.attr("data-name")}else{return false}if($.isFunction(this.options.customMoveValidation)){isValid=this.options.customMoveValidation.call(this.element,$(event.target).attr("data-role"),typeName,name)}if(ui.helper.hasClass("ui-igpivot-draghelper")){if(isValid){markup.find("span").removeClass("ui-icon-cancel ui-icon-close").addClass("ui-icon-plus").siblings("strong");ui.helper.removeClass(this.css.invalidDropIndicator).addClass(this.css.dropIndicator).html(markup)}else{markup.find("span").removeClass("ui-icon-plus ui-icon-close").addClass("ui-icon-cancel").siblings("strong");ui.helper.removeClass(this.css.dropIndicator).addClass(this.css.invalidDropIndicator).html(markup)}}if(!isValid){return false}ui.draggable.bind("drag."+this.widgetName,function(event1,ui1){$this._onDraggableDrag(event1,ui1)})},_onDraggableDrag:function(event,ui){var target=$(event.originalEvent.target),insertItem="<li class='"+this.css.insertItem+"'></li>";if(target.hasClass("ui-igpivot-insertitem")){if(!this._const.ie||this._const.ie&&document.documentMode!==8){return}}$(document).find(".ui-igpivot-insertitem").remove();if(target.is("span")){target=target.closest(".ui-igpivot-metadataitem")}if(!(target.parent().hasClass("ui-igpivot-droparea")||target.hasClass("ui-igpivot-droparea"))){return}if(target.is(".ui-igpivot-metadataitem")){if(this._shouldAppendToTarget(target,ui)){this._insertIndex=target.index()+1;$(insertItem).insertAfter(target)}else{if(target.index()===0){this._insertIndex=0;$(insertItem).insertBefore(target)}else{this._insertIndex=target.index();$(insertItem).insertBefore(target)}}}else if(target.is(".ui-igpivot-droparea")){target=target.find(".ui-igpivot-metadataitem:last");this._insertIndex=target.index()+1;$(insertItem).insertAfter(target)}},_onDraggableOut:function(event,ui){var markup=$(ui.helper.html()),invalidIcon;ui.draggable.removeClass("ui-igpivot-dragover");invalidIcon=ui.draggable.closest("li.ui-igtree-node").length===0?"ui-icon-close":"ui-icon-cancel";if(ui.helper.hasClass("ui-igpivot-draghelper")){markup.find("span").removeClass("ui-icon-plus").addClass(invalidIcon).siblings("strong");ui.helper.removeClass(this.css.dropIndicator).addClass(this.css.invalidDropIndicator).html(markup)}ui.draggable.unbind("drag."+this.widgetName);$(document).find(".ui-igpivot-insertitem").remove();this._insertIndex=0},_getDefaultHierarchy:function(dimensionName,name,dataSource,typeName){var i,firstHierarchy,returnValue;dimensionName=name.substr(1,name.length-2);if(null!==dataSource.getDimension(name)&&$.ig.DimensionType.prototype.measure===dataSource.getDimension(name).dimensionType()){for(i=dataSource.metadataTree().children().length-1;i>=0;i--){if(name===dataSource.metadataTree().children()[i].item().uniqueName()){firstHierarchy=dataSource.metadataTree().children()[i];while(null!==firstHierarchy.children()){firstHierarchy=firstHierarchy.children()[0]}name=firstHierarchy.item().uniqueName();returnValue=dataSource.getMeasure(name)}}}else if(typeName===$.ig.Dimension.prototype.getType().typeName()){for(i=dataSource.metadataTree().children().length-1;i>=0;i--){if(dimensionName===dataSource.metadataTree().children()[i].item().name()||dimensionName===dataSource.metadataTree().children()[i].item().name().replace(" ","")){if(typeof dataSource.metadataTree().children()[i].item().defaultHierarchy==="function"&&dataSource.metadataTree().children()[i].item().defaultHierarchy()){name=dataSource.metadataTree().children()[i].item().defaultHierarchy()}else if(null!==dataSource.metadataTree().children()[i].children()[0].item()){name=dataSource.metadataTree().children()[i].children()[0].item().uniqueName()}else{firstHierarchy=dataSource.metadataTree().children()[i].children()[0];while(null===firstHierarchy.item()){firstHierarchy=firstHierarchy.children()[0]}name=firstHierarchy.item().uniqueName()}break}}returnValue=dataSource.getHierarchy(name)}else{returnValue=null}return returnValue},_addDroppedMeasure:function(item,dataSource,targetIndex){var i;if(item instanceof Array){for(i=0;i<item.length;i++){dataSource.addMeasureItem(item[i])}}else if(item instanceof $.ig.Kpi){item=this._addingKpiMetadataItems(dataSource,item.name());for(i=0;i<item.length;i++){dataSource.removeMeasureItem(item[i]);dataSource.addMeasureItem(item[i])}}else{dataSource.insertMeasureItem(targetIndex,item)}},_onDrop:function(event,ui,targetElement,draggedElement,typeName,name){var dataSource=this._ds,isValid=true,targetRole=$(targetElement).attr("data-role"),targetIndex=this._insertIndex,item,type,sourceRole,sourceIndex,filterMembers,i,isTreeLayout,noCancel,dimensionName;ui.draggable.unbind("."+this.widgetName);$(document).find(".ui-igpivot-insertitem").remove();if($.isFunction(this.options.customMoveValidation)){isValid=this.options.customMoveValidation.call(this.element,$(event.target).attr("data-role"),typeName,name)}if(!isValid){return false}switch(typeName){case $.ig.Dimension.prototype.getType().typeName():type=$.ig.Dimension.prototype.getType();break;case $.ig.Hierarchy.prototype.getType().typeName():type=$.ig.Hierarchy.prototype.getType();break;case $.ig.Measure.prototype.getType().typeName():type=$.ig.Measure.prototype.getType();break;case $.ig.Kpi.prototype.getType().typeName():type=$.ig.Kpi.prototype.getType();break;case $.ig.KpiMeasure.prototype.getType().typeName():type=$.ig.KpiMeasure.prototype.getType();break;case $.ig.MeasureList.prototype.getType().typeName():type=$.ig.MeasureList.prototype.getType();break;default:return false}item=this._getDefaultHierarchy(dimensionName,name,dataSource,typeName);if(null===item){item=dataSource.getCoreElement(function(el){return el.uniqueName()===name},type)}if(!item){return false}noCancel=this._triggerMetadataDropping(event,ui,targetElement,draggedElement,item,targetIndex);if(noCancel){if((sourceIndex=$.inArray(item,dataSource.filters()))>-1){sourceRole="filters"}else if((sourceIndex=$.inArray(item,dataSource.rowAxis()))>-1){sourceRole="rows"}else if((sourceIndex=$.inArray(item,dataSource.columnAxis()))>-1){sourceRole="columns"}else if((sourceIndex=$.inArray(item,dataSource.measures()))>-1||item instanceof Array){sourceRole="measures"}else{sourceRole=null}if(sourceRole!==null&&sourceRole===targetRole&&sourceIndex<targetIndex){targetIndex--}isTreeLayout=false;$(".ui-igpivotgrid").each(function(){if($(this).data("igPivotGrid")&&$(this).igPivotGrid("option","rowHeadersLayout")==="tree"){isTreeLayout=true;return false}});if(this._isInstance(item,"MeasureList")){dataSource.setMeasureListLocation(targetRole);dataSource.setMeasureListIndex(isTreeLayout&&targetRole==="rows"?0:targetIndex)}else if(isTreeLayout&&this._isInstance(item,"Measure")&&dataSource.measures().length>0&&dataSource.dataSource().measureListLocation()===0){dataSource.setMeasureListIndex(0);this._addDroppedMeasure(item,dataSource,targetIndex)}else{if(this._isInstance(item,"Hierarchy")){filterMembers=dataSource.getFilterMemberNames(name)}if(isTreeLayout&&typeof dataSource.rowAxis().item(0)!=="undefined"&&typeof dataSource.rowAxis().item(0).measures==="function"&&targetIndex===0){targetIndex=1}switch(sourceRole){case"filters":dataSource.removeFilterItem(item);break;case"rows":dataSource.removeRowItem(item);break;case"columns":dataSource.removeColumnItem(item);break;case"measures":if(item instanceof Array){for(i=0;i<item.length;i++){dataSource.removeMeasureItem(item[i])}}else{dataSource.removeMeasureItem(item)}break}switch(targetRole){case"filters":dataSource.insertFilterItem(targetIndex,item);break;case"rows":dataSource.insertRowItem(targetIndex,item);break;case"columns":dataSource.insertColumnItem(targetIndex,item);break;case"measures":this._addDroppedMeasure(item,dataSource,targetIndex);break}if(this._isInstance(item,"Hierarchy")){for(i=0;i<filterMembers.length;i++){dataSource.addFilterMember(name,filterMembers[i])}}}if(this.widgetName==="igPivotGrid"&&ui.draggable.data(_draggable)){delete ui.draggable.data(_draggable).plugins.stop}this._updateDataSource();this._triggerMetadataDropped(event,ui,targetElement,draggedElement,item,targetIndex);return true}return false},_createMetadataItemDropDown:function(event,targetElement,metadataItem){var $this=this,options=this.options,dataSource=this._ds,closestDropArea,dropDownParent,dropDownElement,menu,addMeasureList,addHierarchy,items,item,customValidation,dimensionName,defaultHierarchy,defaultHierarchyElement,i;closestDropArea=$(targetElement).closest(".ui-igpivot-droparea").attr("data-role");if((closestDropArea==="columns"||closestDropArea==="rows")&&metadataItem._caption==="Measures"){return}if($.isFunction(this.options.customMoveValidation)){customValidation=function(location){return $this.options.customMoveValidation.call($this.element,location,metadataItem.getType().name,metadataItem.uniqueName()||undefined)}}else{customValidation=function(){return true}}dropDownParent=$(this.options.dropDownParent).first();dropDownElement=$("<div class='"+this.css.metadataItemDropDown+"'></div>");dropDownElement.data("efh","1");dropDownElement.css({position:"absolute",top:0,left:0}).appendTo(dropDownParent).bind(this._getEvent("mousedown"),function(event1){event1.stopPropagation()});menu=$("<ul class='ui-widget'></ul>").appendTo(dropDownElement);defaultHierarchy=this._getDefaultHierarchy(dimensionName,metadataItem.uniqueName(),dataSource,metadataItem.getType().typeName());if(defaultHierarchy){metadataItem=defaultHierarchy}defaultHierarchyElement=$("li[data-name='"+metadataItem.uniqueName()+"']");if(0<defaultHierarchyElement.length){closestDropArea=defaultHierarchyElement.parent().attr("data-role")}if(this._isInstance(metadataItem,"Measure")||this._isInstance(metadataItem,"Kpi")){if(!options.disableMeasuresDropArea&&closestDropArea!=="measures"&&customValidation("measures")){$("<li><span class='ui-icon ui-icon-pivot-measures'></span>"+$.ig.util.getLocaleValue("PivotShared","addToMeasures")+"</li>").appendTo(menu).click(function(){if($this._isInstance(metadataItem,"Kpi")){item=$this._addingKpiMetadataItems($this._ds,$(targetElement).attr("data-name"));for(i=0;i<item.length;i++){$this._ds.removeMeasureItem(item[i]);$this._ds.addMeasureItem(item[i])}dropDownElement.remove();$this._updateDataSource()}else{$this._ds.removeMeasureItem(metadataItem);$this._ds.addMeasureItem(metadataItem);dropDownElement.remove();$this._updateDataSource()}})}}else if(this._isInstance(metadataItem,"MeasureList")){addMeasureList=function(location,index){$this._ds.setMeasureListLocation(location);$this._ds.setMeasureListIndex(index);dropDownElement.remove();$this._updateDataSource()};if(!options.disableColumnsDropArea&&closestDropArea!=="columns"&&customValidation("columns")){$("<li><span class='ui-icon ui-icon-pivot-clumns'></span>"+$.ig.util.getLocaleValue("PivotShared","addToColumns")+"</li>").appendTo(menu).click(function(){addMeasureList("columns",$this._ds.columnAxis().length)})}if(!options.disableRowsDropArea&&closestDropArea!=="rows"&&customValidation("rows")){$("<li><span class='ui-icon ui-icon-pivot-rows'></span>"+$.ig.util.getLocaleValue("PivotShared","addToRows")+"</li>").appendTo(menu).click(function(){addMeasureList("rows",$this._ds.rowAxis().length)})}}else{addHierarchy=function(addMethod){var i,name=metadataItem.uniqueName(),filterMembers=$this._ds.getFilterMemberNames(name);$this._ds.removeFilterItem(metadataItem);$this._ds.removeColumnItem(metadataItem);$this._ds.removeRowItem(metadataItem);$this._ds[addMethod](metadataItem);for(i=0;i<filterMembers.length;i++){$this._ds.addFilterMember(name,filterMembers[i])}dropDownElement.remove();$this._updateDataSource()};if(!options.disableFiltersDropArea&&closestDropArea!=="filters"&&customValidation("filters")){$("<li><span class='ui-icon ui-icon-pivot-filters'></span>"+$.ig.util.getLocaleValue("PivotShared","addToFilters")+"</li>").appendTo(menu).click(function(){addHierarchy("addFilterItem")})}if(!options.disableColumnsDropArea&&closestDropArea!=="columns"&&customValidation("columns")){$("<li><span class='ui-icon ui-icon-pivot-columns'></span>"+$.ig.util.getLocaleValue("PivotShared","addToColumns")+"</li>").appendTo(menu).click(function(){addHierarchy("addColumnItem")})}if(!options.disableRowsDropArea&&closestDropArea!=="rows"&&customValidation("rows")){$("<li><span class='ui-icon ui-icon-pivot-rows'></span>"+$.ig.util.getLocaleValue("PivotShared","addToRows")+"</li>").appendTo(menu).click(function(){addHierarchy("addRowItem")})}}items=dropDownElement.find("li");if(items.length===0){dropDownElement.remove();return}dropDownElement.css("position","absolute").position({of:targetElement,my:"left top",at:"left bottom"});items.bind(this._getEvent("mouseover"),function(){$(this).addClass("ui-state-hover")}).bind(this._getEvent("mouseout"),function(){$(this).removeClass("ui-state-hover")});$(document).bind(this._getEvent("mousedown")+"."+this.widgetName,function(){dropDownElement.remove();$(document).unbind("."+$this.widgetName)})},_createFilterDropDown:function(event,targetElement,hierarchy){var $this=this,hierarchyName,hierarchyFilterView,dropDownParent,dropDownElement,filterMembersTree,buttonContainer,removeFilterDropDown,noCancel;noCancel=this._triggerFilterDropDownOpening(event,hierarchy);if(noCancel){hierarchyName=hierarchy.uniqueName();hierarchyFilterView=new $.ig.HierarchyFilterView(hierarchy);dropDownParent=$(this.options.dropDownParent).first();dropDownElement=$("<div class='"+this.css.filterDropDown+"'></div>");dropDownElement.data("efh","1");dropDownElement.css({position:"absolute",top:0,left:0}).attr("data-hierarchy",hierarchyName).appendTo(dropDownParent).position({of:targetElement,my:"left top",at:"left bottom"}).bind(this._getEvent("mousedown"),function(event1){event1.stopPropagation()});filterMembersTree=$("<div class='"+this.css.filterMembers+"'></div>").appendTo(dropDownElement);buttonContainer=$("<div class='ui-igpivot-filterdropdown-buttoncontainer'></div>").appendTo(dropDownElement);removeFilterDropDown=function(event1){$this._removeFilterDropDown(event1,dropDownElement,hierarchy)};$("<button></button>").attr("data-role","ok").text($.ig.util.getLocaleValue("PivotShared","ok")).appendTo(buttonContainer).igButton().igButton("disable").click(function(event1){$this._onFilterOk(event1,dropDownElement,hierarchyFilterView,hierarchy)});$("<button></button>").attr("data-role","cancel").text($.ig.util.getLocaleValue("PivotShared","cancel")).appendTo(buttonContainer).igButton().click(removeFilterDropDown);$(document).bind(this._getEvent("mousedown")+"."+this.widgetName,removeFilterDropDown);this._loadFilterMembers(hierarchyFilterView,hierarchy,removeFilterDropDown);this._triggerFilterDropDownOpened(event,dropDownElement,hierarchy)}},_loadFilterMembers:function(hierarchyFilterView,hierarchy,removeFilterDropDown){var $this=this,dataSource,hierarchyName,rootFilterMembers,filterMembers,filterMember,member,members,maxLevel,levels,levelMembers,rootLevel,i;dataSource=this._ds;hierarchyName=hierarchy.uniqueName();filterMembers=dataSource.getFilterMemberNames(hierarchyName);if(filterMembers.length>0){members=[];maxLevel=0;for(i=0;i<filterMembers.length;i++){member=dataSource.tryGetMember(filterMembers[i]);if(member){members.push(member);if(member.levelDepth()>maxLevel){maxLevel=member.levelDepth()}}}levels=dataSource.getCoreElements(function(el){return el.hierarchyUniqueName()===hierarchyName&&el.depth()<=maxLevel},$.ig.Level.prototype.getType());for(i=0;i<levels.length;i++){levelMembers=dataSource.tryGetMembersForLevel(levels[i].uniqueName());hierarchyFilterView.addFiltersForMembers(levelMembers)}rootFilterMembers=hierarchyFilterView.getRootFilterMembers();rootFilterMembers=rootFilterMembers?rootFilterMembers.__inner:[];for(i=0;i<rootFilterMembers.length;i++){rootFilterMembers[i].isSelected($.ig.util.toNullable($.ig.Boolean.prototype.$type,false))}for(i=0;i<members.length;i++){filterMember=hierarchyFilterView.tryGetFilterMember(members[i].uniqueName());if(filterMember){filterMember.isSelected($.ig.util.toNullable($.ig.Boolean.prototype.$type,true))}}}rootLevel=dataSource.getCoreElement(function(el){return el.depth()===0&&el.hierarchyUniqueName()===hierarchyName},$.ig.Level.prototype.getType());this._ds.getMembersOfLevel(rootLevel.uniqueName()).done(function(m){$this._onFilterMembersLoaded(hierarchyFilterView,m,hierarchy)}).fail(removeFilterDropDown)},_onFilterMembersLoaded:function(hierarchyFilterView,members,hierarchy){var hierarchyName,dropDownElement,filterMembersTree;hierarchyName=hierarchy.uniqueName();hierarchyFilterView.addFiltersForMembers(members);dropDownElement=$(".ui-igpivot-filterdropdown").filter(function(){return $(this).attr("data-hierarchy")===hierarchyName});if(dropDownElement.length>0){filterMembersTree=$(dropDownElement[0]).find(".ui-igpivot-filtermembers");this._initTree(filterMembersTree,hierarchyFilterView)}},_getScrollBarWidth:function(){var el=$("<div style='"+"width: 100px; height: 100px; position: absolute; top: -10000px;"+"left: -10000px; overflow: scroll'></div>").appendTo($(document.body)),scrollWidth;scrollWidth=el[0].offsetWidth-el[0].clientWidth;el.remove();return scrollWidth},_getElementSize:function(element){var el=$("<div style='"+"width: 5000px; height: 5000px; position: absolute; top: -10000px; left: -10000px;'>"+"</div>").appendTo($(document.body)),result,position,float;position=element.css("position");float=element.css("float");element.css({position:"relative","float":"left"});element.appendTo(el);result=[element.width(),element.height()];element.css("position",position);element.css("float",float);element.detach();el.remove();return result},_arrangeDropDown:function(onExpand){var $this=this,fdd,fm,fmHeight,bcHeight,ddTop,bTop,bHeight,bBottom,fmBottom,fmMaxHeight,ddLeft,bLeft,bWidth,bRight,fmRight,fddMaxWidth,windowHeight,windowInnerHeight,parentOffset,elementSize,fddWidth,scrollTop,dropDownOffsetBottom;dropDownOffsetBottom=30;fdd=$(".ui-igpivot-filterdropdown");fm=$(".ui-igpivot-filterdropdown .ui-igpivot-filtermembers");fmHeight=fm.height();bcHeight=$(".ui-igpivot-filterdropdown-buttoncontainer").innerHeight();ddTop=parseInt(fdd.css("top").replace("px",""),10);bTop=$(document).scrollTop();windowHeight=$(window).height();windowInnerHeight=window.innerHeight;bHeight=windowHeight>windowInnerHeight?windowHeight:windowInnerHeight;bBottom=bTop+bHeight;fmBottom=bBottom-bcHeight-dropDownOffsetBottom;fmMaxHeight=Math.floor(fmBottom-ddTop);ddLeft=parseInt(fdd.css("left").replace("px",""),10);bLeft=$("body").css("left");if(bLeft==="auto"){bLeft=0}else{bLeft=parseInt(bLeft.replace("px",""),10)}bWidth=$("body").width();bRight=bLeft+bWidth;fmRight=bRight;fddMaxWidth=Math.floor(fmRight-ddLeft);
fm.css("max-height",fmMaxHeight);fdd.css("max-width",fddMaxWidth);parentOffset=parseInt(fdd.css("padding-left").replace("px",""),10)+parseInt(fdd.css("padding-right").replace("px",""),10)+parseInt(fdd.css("border-left-width").replace("px",""),10)+parseInt(fdd.css("border-right-width").replace("px",""),10);scrollTop=fm[0].scrollTop;fm.detach();elementSize=$this._getElementSize(fm);fdd.prepend(fm);fm[0].scrollTop=scrollTop;fddWidth=elementSize[0]+$this._getScrollBarWidth()+parseInt(fm.css("padding-right").replace("px",""),10)+parentOffset;fddWidth=Math.max(fddWidth,parseInt(fdd.css("min-width").replace("px",""),10));fdd.css("width",fddWidth);if(fmHeight>fmMaxHeight||onExpand===false){if(fddWidth<=fddMaxWidth){fm.css("overflow-x","hidden")}else{fm.css("overflow-x","auto")}}},_initTree:function(filterMembersTree,hierarchyFilterView){var $this=this,dataSource=this._ds,checkChildNodes,parsedFilterMembers;$(filterMembersTree).siblings(".ui-igpivot-filterdropdown-buttoncontainer").children(".ui-igbutton[data-role=ok]").igButton("enable");checkChildNodes=function(nodeElement,filterMembers){var isSelected,state,i,filterMember;for(i=0;i<filterMembers.length;i++){filterMember=filterMembers[i].filterMember;isSelected=filterMember.isSelected();if(isSelected.hasValue()){if(isSelected.value()){state="on"}else{state="off"}}else{state="partial"}if($(nodeElement).is(".ui-igpivot-filtermembers")){var bindings=$(nodeElement).igTree("option","bindings");if(filterMembers[i].hasOwnProperty(bindings.checkedKey)){filterMembers[i][bindings.checkedKey]=state}}$(nodeElement).find('.ui-igtree-node[data-value="'+filterMembers[i].uniqueName+'"]').children("[data-role=checkbox]").attr("data-chk",state).children("span").removeClass("ui-state-disabled ui-igcheckbox-normal-on "+"ui-igcheckbox-normal-partial ui-igcheckbox-normal-off").addClass("ui-igcheckbox-normal-"+state+(state==="partial"?" ui-igcheckbox-normal-on ui-state-disabled":""))}};parsedFilterMembers=this._parseFilterMembers(hierarchyFilterView.getRootFilterMembers());filterMembersTree.igTree({dataSource:parsedFilterMembers,loadOnDemand:true,checkboxMode:"triState",bindings:{textKey:"caption",valueKey:"uniqueName",childDataProperty:"children"},rendered:function(){$this._arrangeDropDown(false)},nodeCollapsed:function(){$this._arrangeDropDown(false)},nodeCheckstateChanged:function(event,ui){var okButton,isSelected;okButton=$(this).siblings(".ui-igpivot-filterdropdown-buttoncontainer").children(".ui-igbutton[data-role=ok]");if(ui.newCheckedNodes&&ui.newCheckedNodes.length>0){okButton.igButton("enable")}else{okButton.igButton("disable")}isSelected=$(ui.node.element).children("[data-role=checkbox]").attr("data-chk");isSelected=isSelected==="partial"?null:isSelected==="on"?true:false;ui.node.data.filterMember.isSelected($.ig.util.toNullable($.ig.Boolean.prototype.$type,isSelected))},nodeExpanded:function(ect,ui){$this._arrangeDropDown(true);var i,collection,element;if(!$.ig.Pivot._pivotShared._showLastLevelExpanders){element=ui.node.element;collection=ui.node.data.children;if(collection!==null&&0<collection.length){for(i=0;i<collection.length;i++){if(null!==collection[i].children&&0===collection[i].children.length){element.find(".ui-igtree-node").eq(i).find("span:first").css("display","none")}}}}}}).css("overflow-x","hidden").data(_tree)._executeUrlRequest=function(node){var $$this=this,nodeData=this.nodeDataFor(node.attr("data-path")),ul,indicator,levels;ul=node.children("ul");$("<li style='width:20px; height:20px;' data-role='loading'>&nbsp;</li>").appendTo(ul);ul.show();indicator=ul.children("li").igLoading({includeVerticalOffset:true,cssClass:"ui-igpivotgrid-tree-blockarea"}).data("igLoading").indicator();indicator.show();this._populatingNode={ul:ul,node:node,indicator:indicator};levels=dataSource.getCoreElements(function(el){return el.hierarchyUniqueName()===nodeData.member.hierarchyUniqueName()},$.ig.Level.prototype.$type);$.ig.Pivot._pivotShared._showLastLevelExpanders=true;dataSource.getMembersOfMember(nodeData.member.uniqueName()).done(function(members){var parsedFilterMembers1;if(members.item(0)&&levels.length-1===members.item(0).levelDepth()){$.ig.Pivot._pivotShared._showLastLevelExpanders=false}hierarchyFilterView.addFiltersForMembers(members);parsedFilterMembers1=$this._parseFilterMembers(nodeData.filterMember.children());$$this._populateNodeData(true,"",{data:function(){return parsedFilterMembers1}});$$this._updateParentState(node);checkChildNodes(node,nodeData.children);$this._triggerFilterMembersLoaded(node,parsedFilterMembers,parsedFilterMembers1)})};checkChildNodes(filterMembersTree,parsedFilterMembers);this._triggerFilterMembersLoaded(filterMembersTree,parsedFilterMembers,parsedFilterMembers)},_parseFilterMembers:function(filterMembers){var parsedFilterMembers,parsedFilterMember,filterMember,member,i;if(filterMembers===null){return[]}filterMembers=filterMembers.__inner;parsedFilterMembers=[];for(i=0;i<filterMembers.length;i++){filterMember=filterMembers[i];member=filterMember.member();parsedFilterMember={};parsedFilterMember.filterMember=filterMember;parsedFilterMember.member=member;parsedFilterMember.caption=member.caption();parsedFilterMember.uniqueName=member.uniqueName();parsedFilterMember.children=[];parsedFilterMembers.push(parsedFilterMember)}return parsedFilterMembers},_onFilterOk:function(event,dropDownElement,hierarchyFilterView,hierarchy){var dataSource=this._ds,hierarchyName=hierarchy.uniqueName(),filterMembers,checkedFilterMembers,i,noCancel;filterMembers=hierarchyFilterView.getSelectedFilterItems().__inner;checkedFilterMembers=[];for(i=0;i<filterMembers.length;i++){checkedFilterMembers.push(filterMembers[i].member().uniqueName())}noCancel=this._triggerFilterDropDownOk(event,dropDownElement,hierarchy,checkedFilterMembers);if(noCancel){dataSource.removeAllFilterMembers(hierarchyName);for(i=0;i<checkedFilterMembers.length;i++){dataSource.addFilterMember(hierarchyName,checkedFilterMembers[i])}this._updateDataSource();this._removeFilterDropDown(event,dropDownElement,hierarchy)}},_removeFilterDropDown:function(event,dropDownElement,hierarchy){var noCancel;noCancel=this._triggerFilterDropDownClosing(event,dropDownElement,hierarchy);if(noCancel){dropDownElement.find(".ui-igtree").igTree("destroy");dropDownElement.find(".ui-button").igButton("destroy");dropDownElement.remove();$(document).unbind("."+this.widgetName);this._triggerFilterDropDownClosed(event,hierarchy)}},_triggerDataSourceInitialized:function(evt,args){this._trigger("dataSourceInitialized",evt,args)},_triggerDataSourceUpdated:function(evt,args){this._trigger("dataSourceUpdated",evt,args)},_triggerDragStart:function(event,ui,item){var args={helper:ui.helper,offset:ui.offset,originalPosition:ui.originalPosition,position:ui.position,metadata:item};$(".ui-igpivot-overlaydroparea").css("display","block");return this._trigger("dragStart",event,args)},_triggerDrag:function(event,ui,item){var args={helper:ui.helper,offset:ui.offset,originalPosition:ui.originalPosition,position:ui.position,metadata:item};return this._trigger("drag",event,args)},_triggerDragStop:function(event,ui){$(".ui-igpivot-overlaydroparea").css("display","none");this._trigger("dragStop",event,ui)},_triggerMetadataDropping:function(event,ui,targetElement,item,itemIndex){var args={helper:ui.helper,offset:ui.offset,position:ui.position,targetElement:targetElement,metadata:item,metadataIndex:itemIndex};return this._trigger("metadataDropping",event,args)},_triggerMetadataDropped:function(event,ui,targetElement,draggedElement,item,itemIndex){var args={helper:ui.helper,offset:ui.offset,position:ui.position,targetElement:targetElement,draggedElement:draggedElement,metadata:item,metadataIndex:itemIndex};this._trigger("metadataDropped",event,args)},_triggerMetadataRemoving:function(event,targetElement,item){var args={targetElement:targetElement,metadata:item};return this._trigger("metadataRemoving",event,args)},_triggerMetadataRemoved:function(event,item){var args={metadata:item};this._trigger("metadataRemoved",event,args)},_triggerFilterDropDownOpening:function(event,hierarchy){var args={hierarchy:hierarchy};return this._trigger("filterDropDownOpening",event,args)},_triggerFilterDropDownOpened:function(event,dropDownElement,hierarchy){var args={dropDownElement:dropDownElement,hierarchy:hierarchy};this._trigger("filterDropDownOpened",event,args)},_triggerFilterMembersLoaded:function(parent,rootFilterMembers,filterMembers){var args={parent:parent,rootFilterMembers:rootFilterMembers,filterMembers:filterMembers};this._trigger("filterMembersLoaded",null,args)},_triggerFilterDropDownOk:function(event,dropDownElement,hierarchy,filterMembers){var args={dropDownElement:dropDownElement,hierarchy:hierarchy,filterMembers:filterMembers};return this._trigger("filterDropDownOk",event,args)},_triggerFilterDropDownClosing:function(event,dropDownElement,hierarchy){var args={dropDownElement:dropDownElement,hierarchy:hierarchy};return this._trigger("filterDropDownClosing",event,args)},_triggerFilterDropDownClosed:function(event,hierarchy){var args={hierarchy:hierarchy};this._trigger("filterDropDownClosed",event,args)}};$.widget("ui.igOlapDataSourceWidget",{_create:function(){this._ds=$.ig.Pivot._pivotShared._createDataSource(null,this.options.dataSourceOptions)},dataSource:function(){return this._ds}})})($);/*!@license
* Infragistics.Web.ClientUI Pivot Data Selector 21.2.12
*
* Copyright (c) 2011-2012 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on:
*	jquery-1.9.1.js
*	jquery.ui.core.js
*	jquery.ui.widget.js
*	jquery.ui.mouse.js
*	infragistics.ui.widget.js
*	jquery.ui.draggable.js
*	jquery.ui.droppable.js
*	infragistics.util.js
*   infragistics.util.jquery.js
*	infragistics.datasource.js
*	infragistics.olapxmladatasource.js
*	infragistics.olapflatdatasource.js
*	infragistics.templating.js
*	infragistics.ui.shared.js
*   infragistics.ui.scroll.js
*	infragistics.ui.combo.js
*	infragistics.ui.tree.js
*	infragistics.ui.pivot.shared.js
*/
(function($){var _droppable=$.ui.droppable.prototype.widgetFullName||$.ui.droppable.prototype.widgetName;$.widget("ui.igPivotDataSelector",$.ui.igWidget,{css:{dataSelector:"ui-igpivotdataselector",dataSelectorRoot:"ui-igpivotdataselector-root",catalog:"ui-igpivotdataselector-catalog",cube:"ui-igpivotdataselector-cube",measureGroup:"ui-igpivotdataselector-measuregroup",metadata:"ui-igpivotdataselector-metadata ui-widget-content",metadataItem:"ui-igpivot-metadataitem ui-widget ui-corner-all ui-state-default",dropAreasTable:"ui-igpivotdataselector-dropareas",dropArea:"ui-igpivot-droparea ui-widget-content",activeDropArea:"active",filtersIcon:"ui-icon ui-icon-pivot-filters",columnsIcon:"ui-icon ui-icon-pivot-columns",rowsIcon:"ui-icon ui-icon-pivot-rows",measuresIcon:"ui-icon ui-icon-pivot-measures",updateLayout:"ui-igpivotdataselector-updatelayout",dropIndicator:"ui-state-highlight",invalidDropIndicator:"ui-state-error",insertItem:"ui-igpivot-insertitem ui-state-highlight ui-corner-all",metadataItemDropDown:"ui-igpivot-metadatadropdown ui-widget ui-widget-content",filterIcon:"ui-icon ui-icon-pivot-smallfilter ui-icon-carat-1-s",filterDropDown:"ui-igpivot-filterdropdown ui-widget ui-widget-content",filterMembers:"ui-igpivot-filtermembers"},options:{width:250,height:null,dataSource:null,dataSourceOptions:{xmlaOptions:{serverUrl:null,catalog:null,cube:null,measureGroup:null,requestOptions:{withCredentials:false,beforeSend:null},enableResultCache:true,discoverProperties:null,executeProperties:null,mdxSettings:{nonEmptyOnRows:true,nonEmptyOnColumns:true,addCalculatedMembersOnRows:true,addCalculatedMembersOnColumns:true,dimensionPropertiesOnRows:[],dimensionPropertiesOnColumns:[]}},flatDataOptions:{dataSource:null,dataSourceUrl:null,dataSourceType:null,responseDataKey:null,responseDataType:null,metadata:{cube:{name:null,caption:null,measuresDimension:{name:null,caption:null,measures:[{name:null,caption:null,aggregator:null,displayFolder:null}]},dimensions:[{name:null,caption:null,hierarchies:[{name:null,caption:null,displayFolder:null,levels:[{name:null,caption:null,memberProvider:null}]}]}]}}},measures:null,filters:null,rows:null,columns:null},deferUpdate:false,dragAndDropSettings:{appendTo:"body",containment:false,zIndex:10},dropDownParent:"body",disableRowsDropArea:false,disableColumnsDropArea:false,disableMeasuresDropArea:false,disableFiltersDropArea:false,customMoveValidation:null},events:{dataSelectorRendered:null,dataSourceInitialized:null,dataSourceUpdated:null,deferUpdateChanged:null,dragStart:null,drag:null,dragStop:null,metadataDropping:null,metadataDropped:null,metadataRemoving:null,metadataRemoved:null,filterDropDownOpening:null,filterDropDownOpened:null,filterMembersLoaded:null,filterDropDownOk:null,filterDropDownClosing:null,filterDropDownClosed:null},_deferUpdate:false,_create:function(){var $this=this,elementName=this.element[0].nodeName.toUpperCase();if(elementName!=="DIV"){throw new Error(elementName+this._getLocaleValue("invalidBaseElement"))}this.element.addClass(this.css.dataSelector);this._onFiltersChanged=function(collection,collectionChangedArgs){var dropArea=$this.element.find(".ui-igpivot-droparea[data-role=filters]");$this._onDataSourceCollectionChanged(collection,collectionChangedArgs,dropArea,$this.options.disableFiltersDropArea)};this._onRowAxisChanged=function(collection,collectionChangedArgs){var dropArea=$this.element.find(".ui-igpivot-droparea[data-role=rows]");$this._onDataSourceCollectionChanged(collection,collectionChangedArgs,dropArea,$this.options.disableRowsDropArea)};this._onColumnAxisChanged=function(collection,collectionChangedArgs){var dropArea=$this.element.find(".ui-igpivot-droparea[data-role=columns]");$this._onDataSourceCollectionChanged(collection,collectionChangedArgs,dropArea,$this.options.disableColumnsDropArea)};this._onMeasuresChanged=function(collection,collectionChangedArgs){var dropArea=$this.element.find(".ui-igpivot-droparea[data-role=measures]");$this._onDataSourceCollectionChanged(collection,collectionChangedArgs,dropArea,$this.options.disableMeasuresDropArea)};this._setDataSource();this._makeDroppable(this.element)},changeLocale:function(){this._super();var $combo=this.element.find("[data-combo-catalog]");if($combo.data("igCombo")){$combo.igCombo("option","locale",{placeHolder:this._getLocaleValue("catalog")})}$combo=this.element.find("[data-combo-cube]");if($combo.data("igCombo")){$combo.igCombo("option","locale",{placeHolder:this._getLocaleValue("cube")})}$combo=this.element.find("[data-combo-group]");if($combo.data("igCombo")){$combo.igCombo("option","locale",{placeHolder:this._getLocaleValue("measureGroup")})}},_setOption:function(key,value){var dropArea,droppable;switch(key){case"dataSource":this._clearDataSource();this.options.dataSourceOptions=null;this.options.dataSource=this._createDataSource(value,null);this._setDataSource();break;case"dataSourceOptions":this._clearDataSource();this.options.dataSourceOptions=value;this.options.dataSource=this._createDataSource(null,value);this._setDataSource();break;case"deferUpdate":$.Widget.prototype._setOption.apply(this,arguments);this._deferUpdate=value;this.element.find(".ui-igpivotdataselector-deferupdate").attr("checked",value);this.element.find(".ui-igpivotdataselector-updatelayout").igButton(value?"enable":"disable");break;case"width":$.Widget.prototype._setOption.apply(this,arguments);this.element.width(value);this.element.find(".ui-igpivotdataselector-catalog, "+".ui-igpivotdataselector-cube, "+".ui-igpivotdataselector-measuregroup").igCombo("option","width",this.element.children(".ui-igpivotdataselector-root").width());break;case"height":$.Widget.prototype._setOption.apply(this,arguments);this.element.height(value);break;case"dragAndDropSettings":$.Widget.prototype._setOption.apply(this,arguments);this.element.find(":ui-draggable").each(function(ind,el){var draggable=$(el);draggable.draggable("option","appendTo",value.appendTo);draggable.draggable("option","containment",value.containment);draggable.draggable("option","zIndex",value.zIndex)});break;case"disableRowsDropArea":$.Widget.prototype._setOption.apply(this,arguments);dropArea=this.element.find(".ui-igpivot-droparea[data-role=rows]");if(value){droppable=dropArea.data(_droppable);if(droppable){droppable.destroy()}}else{dropArea.droppable(this._createDropAreaOptions())}this._fillDropArea(dropArea,this._ds.rowAxis(),this.options.disableRowsDropArea);break;case"disableColumnsDropArea":$.Widget.prototype._setOption.apply(this,arguments);dropArea=this.element.find(".ui-igpivot-droparea[data-role=columns]");if(value){droppable=dropArea.data(_droppable);if(droppable){droppable.destroy()}}else{dropArea.droppable(this._createDropAreaOptions())}this._fillDropArea(dropArea,this._ds.columnAxis(),this.options.disableColumnsDropArea);break;case"disableMeasuresDropArea":$.Widget.prototype._setOption.apply(this,arguments);dropArea=this.element.find(".ui-igpivot-droparea[data-role=measures]");if(value){droppable=dropArea.data(_droppable);if(droppable){droppable.destroy()}}else{dropArea.droppable(this._createDropAreaOptions())}this._fillDropArea(dropArea,this._ds.measures(),this.options.disableMeasuresDropArea);break;case"disableFiltersDropArea":$.Widget.prototype._setOption.apply(this,arguments);dropArea=this.element.find(".ui-igpivot-droparea[data-role=filters]");if(value){droppable=dropArea.data(_droppable);if(droppable){droppable.destroy()}}else{dropArea.droppable(this._createDropAreaOptions())}this._fillDropArea(dropArea,this._ds.filters(),this.options.disableFiltersDropArea);break;case"locale":case"language":this._superApply(arguments);break}},_initUI:function(){var $this=this,dataSource=this._ds,rootDiv,comboOptions,droppableOptions,dropAreasTable,tableRow,tableHeader,tableColumn,dropArea,deferUpdateCheck,deferUpdateLabel;if(this.options.width){this.element.width(this.options.width)}if(this.options.height){this.element.height(this.options.height)}rootDiv=$("<div class='ui-widget "+this.css.dataSelectorRoot+"'></div>").appendTo(this.element);if(this._isInstance(dataSource,"OlapXmlaDataSource")){comboOptions={textKey:"_caption",valueKey:"_name",mode:"dropdown",enableClearButton:false,width:rootDiv.width()};$("<input class='"+this.css.catalog+"' />").appendTo(rootDiv).attr("data-combo-catalog",true).igCombo($.extend({locale:{placeHolder:this._getLocaleValue("catalog")},selectionChanged:function(evt,ui){$this._onCatalogSelected(ui.items[0].data.name())}},comboOptions));$("<input class='"+this.css.cube+"' />").appendTo(rootDiv).attr("data-combo-cube",true).igCombo($.extend({locale:{placeHolder:this._getLocaleValue("cube")},selectionChanged:function(evt,ui){$this._onCubeSelected(ui.items[0].data.name())}},comboOptions));$("<input class='"+this.css.measureGroup+"' />").appendTo(rootDiv).attr("data-combo-group",true).igCombo($.extend({locale:{placeHolder:this._getLocaleValue("measureGroup")},selectionChanged:function(evt,ui){$this._onMeasureGroupSelected(ui.items[0].data.name())}},comboOptions))}$("<div class='"+this.css.metadata+"'></div>").appendTo(rootDiv).addClass().igTree({initialExpandDepth:0,bindings:{nodeContentTemplate:"<span class='ui-igpivot-metadataitem' data-name='${name}' data-type='${type}'>"+"<span class='${image}'/>${caption}</span>",childDataProperty:"children"},rendered:function(evt,ui){ui.owner.element.removeAttr("data-scroll")}});droppableOptions=this._createDropAreaOptions();dropAreasTable=$("<table class='"+this.css.dropAreasTable+"'></table>").appendTo(rootDiv);tableRow=$("<tr></tr>").appendTo(dropAreasTable);tableHeader=$("<th></th>").appendTo(tableRow);$("<span class='"+this.css.filtersIcon+"'></span>").appendTo(tableHeader);$("<span></span>").attr({"data-localeid":"filters"}).text(this._getLocaleValue("filters")).appendTo(tableHeader);tableHeader=$("<th></th>").appendTo(tableRow);$("<span class='"+this.css.columnsIcon+"'></span>").appendTo(tableHeader);$("<span></span>").attr({"data-localeid":"columns"}).text(this._getLocaleValue("columns")).appendTo(tableHeader);tableRow=$("<tr></tr>").appendTo(dropAreasTable);tableColumn=$("<td></td>").appendTo(tableRow);dropArea=$("<ul class='"+this.css.dropArea+"' data-role='filters'></ul>").appendTo(tableColumn);if(!this.options.disableFiltersDropArea){dropArea.droppable(droppableOptions)}tableColumn=$("<td></td>").appendTo(tableRow);dropArea=$("<ul class='"+this.css.dropArea+"' data-role='columns'></ul>").appendTo(tableColumn);if(!this.options.disableColumnsDropArea){dropArea.droppable(droppableOptions)}tableRow=$("<tr></tr>").appendTo(dropAreasTable);tableHeader=$("<th></th>").appendTo(tableRow);$("<span class='"+this.css.rowsIcon+"'></span>").appendTo(tableHeader);$("<span></span>").attr({"data-localeid":"rows"}).text(this._getLocaleValue("rows")).appendTo(tableHeader);tableHeader=$("<th></th>").appendTo(tableRow);$("<span class='"+this.css.measuresIcon+"'></span>").appendTo(tableHeader);$("<span></span>").attr({"data-localeid":"measures"}).text(this._getLocaleValue("measures")).appendTo(tableHeader);tableRow=$("<tr></tr>").appendTo(dropAreasTable);tableColumn=$("<td></td>").appendTo(tableRow);dropArea=$("<ul class='"+this.css.dropArea+"' data-role='rows'></ul>").appendTo(tableColumn);if(!this.options.disableRowsDropArea){dropArea.droppable(droppableOptions)}tableColumn=$("<td></td>").appendTo(tableRow);dropArea=$("<ul class='"+this.css.dropArea+"' data-role='measures'></ul>").appendTo(tableColumn);if(!this.options.disableMeasuresDropArea){dropArea.droppable(droppableOptions)}if($.ig.util.isTouchDevice()){dropAreasTable.find(".ui-igpivot-droparea").igScroll()}this._deferUpdate=this.options.deferUpdate;deferUpdateLabel=$("<label></label>").attr({"data-localeid":"deferUpdate"}).appendTo(rootDiv).text(this._getLocaleValue("deferUpdate"));deferUpdateCheck=$("<input class='ui-igpivotdataselector-deferupdate' type='checkbox' />").prependTo(deferUpdateLabel).change(function(event){$this._deferUpdate=$(event.target).is(":checked");if($this._deferUpdate){$this.element.find(".ui-igpivotdataselector-updatelayout").igButton("enable")}else{$this.element.find(".ui-igpivotdataselector-updatelayout").igButton("disable");$this._updateDataSource()}$this._triggerDeferUpdateChanged($this._deferUpdate)});$("<button class='"+this.css.updateLayout+"'></button>").attr({title:this._getLocaleValue("updateLayout"),"data-localeid":"updateLayout","data-localeattr":"title"}).appendTo(rootDiv).igButton({text:false,icons:{primary:"ui-icon-refresh"}}).igButton(this._deferUpdate?"enable":"disable").click(function(){$this._updateDataSource(true)});this._triggerDataSelectorRendered()},_clearUI:function(){this.element.find(".ui-igpivotdataselector-catalog, "+".ui-igpivotdataselector-cube, "+".ui-igpivotdataselector-measuregroup").igCombo("destroy");this.element.find(".ui-igpivotdataselector-metadata").igTree("destroy");this.element.find(".ui-igpivot-droparea .ui-igpivot-metadataitem.ui-draggable").draggable("destroy").remove();this.element.empty()},_setDataSource:function(){var $this=this,dataSource;this._ds=dataSource=this._createDataSource(this.options.dataSource,this.options.dataSourceOptions);this._initUI();if(!dataSource){return}this.timestamp=(new Date).getTime();$(dataSource).bind("initialized.dataselector"+this.timestamp,function(evt,args){$this._onDataSourceInitialized(evt,args)});$(dataSource).bind("updated.dataselector"+this.timestamp,function(evt,args){$this._onDataSourceUpdated(evt,args)});if(dataSource.isInitialized()){if(this._isInstance(dataSource,"OlapXmlaDataSource")){this._onCatalogSelected(this._getItemName(dataSource.catalog()),true)}else{this._fillMetadata(dataSource.metadataTree())}dataSource.bindCollectionChanged({filters:this._onFiltersChanged,rowAxis:this._onRowAxisChanged,columnAxis:this._onColumnAxisChanged,measures:this._onMeasuresChanged})}else{dataSource.initialize()}},_clearDataSource:function(){if(this._ds){$(this._ds).unbind("updated.dataselector");this._ds.unbindCollectionChanged({filters:this._onFiltersChanged,rowAxis:this._onRowAxisChanged,columnAxis:this._onColumnAxisChanged,measures:this._onMeasuresChanged})}this._filterMembersCache=[];this._clearUI()},_onDataSourceInitialized:function(evt,evtArgs){var dataSource=this._ds,args=$.extend({owner:this,dataSource:dataSource},evtArgs);dataSource.bindCollectionChanged({filters:this._onFiltersChanged,rowAxis:this._onRowAxisChanged,columnAxis:this._onColumnAxisChanged,measures:this._onMeasuresChanged});this._triggerDataSourceInitialized(evt,args);if(!evtArgs.error){if(this._isInstance(dataSource,"OlapXmlaDataSource")){this._onCatalogSelected(this._getItemName(dataSource.catalog()),true)}else{this._fillMetadata(dataSource.metadataTree())}}},_updateDataSource:function(deferUpdateOverride){var dataSource=this._ds,shouldUpdate=deferUpdateOverride||this._deferUpdate===false;if(shouldUpdate&&dataSource.cube()!==null){dataSource.update()}},_onDataSourceUpdated:function(evt,evtArgs){var dataSource=this._ds,args=$.extend({owner:this,dataSource:dataSource},evtArgs);this._triggerDataSourceUpdated(evt,args)},_getItemName:function(item){return item&&item.name()},_fillCombo:function(comboSelector,items,selectedItem){var t=typeof selectedItem;this.element.find(comboSelector).igCombo("option","dataSource",items);if(t==="number"&&selectedItem!==null){this.element.find(comboSelector).igCombo("index",selectedItem)}else if(t==="object"&&selectedItem!==null&&$.isFunction(selectedItem.name)){this.element.find(comboSelector).igCombo("value",selectedItem.name())}},_clearCombo:function(comboSelector){this.element.find(comboSelector).igCombo("deselectAll").igCombo("option","dataSource",null)},_fillMetadata:function(metadata){var $this=this,parseMetadata=function(m){var metadataItem={},hasItem=true,item,imgClass,children,i;switch(m.type()){case $.ig.OlapMetadataTreeItemType.prototype.cube:imgClass="cube";break;case $.ig.OlapMetadataTreeItemType.prototype.dimension:imgClass="dimension";break;case $.ig.OlapMetadataTreeItemType.prototype.group:imgClass="folder";hasItem=false;break;case $.ig.OlapMetadataTreeItemType.prototype.userDefinedHierarchy:imgClass="hierarchymultiple";break;case $.ig.OlapMetadataTreeItemType.prototype.systemEnabledHierarchy:imgClass="hierarchysingle";break;case $.ig.OlapMetadataTreeItemType.prototype.parentChildHierarchy:imgClass="hierarchydirect";break;case $.ig.OlapMetadataTreeItemType.prototype.measure:imgClass="measure";break;case $.ig.OlapMetadataTreeItemType.prototype.level1:imgClass="level1";break;case $.ig.OlapMetadataTreeItemType.prototype.level2:imgClass="level2";break;case $.ig.OlapMetadataTreeItemType.prototype.level3:imgClass="level3";break;case $.ig.OlapMetadataTreeItemType.prototype.level4:imgClass="level4";break;case $.ig.OlapMetadataTreeItemType.prototype.level5:imgClass="level5";break;case $.ig.OlapMetadataTreeItemType.prototype.kpiRoot:case $.ig.OlapMetadataTreeItemType.prototype.kpi:imgClass="kpi";break;case $.ig.OlapMetadataTreeItemType.prototype.kpiValue:imgClass="kpi value";break;case $.ig.OlapMetadataTreeItemType.prototype.kpiGoal:imgClass="kpi goal";break;case $.ig.OlapMetadataTreeItemType.prototype.kpiStatus:imgClass="kpi status";break;case $.ig.OlapMetadataTreeItemType.prototype.kpiTrend:imgClass="kpi trend";break;case $.ig.OlapMetadataTreeItemType.prototype.kpiWeight:imgClass="kpi weight";break;default:imgClass="folder";break}metadataItem.caption=m.caption();metadataItem.image=imgClass;if(hasItem){item=m.item();metadataItem.name=item.uniqueName();metadataItem.type=item.getType().typeName()}children=m.children();if(children){metadataItem.children=[];for(i=0;i<children.length;i++){metadataItem.children[i]=parseMetadata(children[i])}}return metadataItem},parsedMetadata=metadata===null?[]:[parseMetadata(metadata)],dragAndDropSettings=this.options.dragAndDropSettings,tree,items;tree=this.element.find(".ui-igpivotdataselector-metadata").igTree("option","dataSource",parsedMetadata);items=tree.find(".ui-igpivot-metadataitem[data-type='Kpi'],"+".ui-igpivot-metadataitem[data-type='Measure'],"+".ui-igpivot-metadataitem[data-type='Dimension'],"+".ui-igpivot-metadataitem[data-type='Hierarchy'],"+".ui-igpivot-metadataitem[data-type='KpiMeasure']");{items.draggable({appendTo:dragAndDropSettings.appendTo,containment:dragAndDropSettings.containment,zIndex:dragAndDropSettings.zIndex,cursorAt:this._const.dragCursorAt,revert:false,helper:function(){var markup;markup=$($this._const.dragHelperMarkup.replace("{0}",$(this).text()));markup.addClass($this.css.invalidDropIndicator).find("span").addClass("ui-icon  ui-icon-cancel");return markup},start:function(event,ui){return $this._triggerDragStart(event,ui,tree.igTree("nodeDataFor",$(this).attr("data-path")))},drag:function(event,ui){return $this._triggerDrag(event,ui,tree.igTree("nodeDataFor",$(this).attr("data-path")))},over:function(event,ui){$this._onDraggableOver(event,ui)},out:function(event,ui){$this._onDraggableOut(event,ui)},stop:function(event,ui){$this._triggerDragStop(event,ui)}})}items.click(function(event){var item=tree.igTree("nodeDataFor",$(this).closest("li").attr("data-path")),name=item.name,type=$.ig[item.type].prototype.getType(),metadataItem;metadataItem=$this._ds.getCoreElement(function(el){return el.uniqueName()===name},type);if(metadataItem){$this._createMetadataItemDropDown(event,this,metadataItem)}});this._fillDropArea(".ui-igpivot-droparea[data-role=filters]",this._ds.filters(),this.options.disableFiltersDropArea);this._fillDropArea(".ui-igpivot-droparea[data-role=rows]",this._ds.rowAxis(),this.options.disableRowsDropArea);this._fillDropArea(".ui-igpivot-droparea[data-role=columns]",this._ds.columnAxis(),this.options.disableColumnsDropArea);this._fillDropArea(".ui-igpivot-droparea[data-role=measures]",this._ds.measures(),this.options.disableMeasuresDropArea)},_fillDropArea:function(dropArea,items,isDisabled){var i,length;dropArea=dropArea.jquery?dropArea:this.element.find(dropArea);dropArea.empty();for(i=0,length=items.length;i<length;i++){this._createMetadataElement(items[i],isDisabled,"appendTo",dropArea)}},_clearMetadata:function(){this.element.find(".ui-igpivotdataselector-metadata").igTree("option","dataSource",[])},_onCatalogSelected:function(catalog,isInit){var $this=this,dataSource=this._ds,callback=function(){$this._fillCombo(".ui-igpivotdataselector-catalog",dataSource.catalogs(),dataSource.catalog());$this._fillCombo(".ui-igpivotdataselector-cube",dataSource.cubes(),dataSource.cube());$this._onCubeSelected($this._getItemName(dataSource.cube()),isInit)};this._clearCombo(".ui-igpivotdataselector-cube");if(catalog===null){callback()}else{dataSource.setCatalog(catalog).done(callback)}},_onCubeSelected:function(cube,isInit){var $this=this,dataSource=this._ds,callback=function(){var measureGroup=dataSource.cube()&&(dataSource.measureGroup()||0),measureGroups=dataSource.measureGroups().slice();measureGroups.splice(0,0,{_caption:$this._getLocaleValue("measureGroupAll"),_name:$this._getLocaleValue("measureGroupAll")});$this._fillCombo(".ui-igpivotdataselector-measuregroup",measureGroups,measureGroup);$this._onMeasureGroupSelected($this._getItemName(dataSource.measureGroup()),isInit)};this._clearCombo(".ui-igpivotdataselector-measuregroup");if(cube===null){callback()}else{dataSource.setCube(cube).done(callback)}},_onMeasureGroupSelected:function(measureGroup,isInit){var $this=this,dataSource=this._ds,callback=function(){$this._fillMetadata(dataSource.metadataTree());if(!isInit){$this._updateDataSource()}};this._clearMetadata();if(measureGroup===null){callback()}else{dataSource.setMeasureGroup(measureGroup).done(callback)}},_shouldAppendToTarget:function(target,dragged){return target.igOffset().top+target.height()/2<dragged.offset.top+this._const.dragCursorAt.top},update:function(){this._ds.update()},destroy:function(){this._clearDataSource();this.element.removeClass(this.css.dataSelector);$(this._ds).unbind("updated.dataselector"+this.timestamp);$(this._ds).unbind("initialized.dataselector"+this.timestamp);this._superApply(arguments);return this},_triggerDataSelectorRendered:function(){var args={owner:this};this._trigger("dataSelectorRendered",null,args)},_triggerDeferUpdateChanged:function(deferUpdate){var args={owner:this,deferUpdate:deferUpdate};this._trigger("deferUpdateChanged",null,args)}});$.extend(true,$.ui.igPivotDataSelector.prototype,$.ig.Pivot._pivotShared);$.extend($.ui.igPivotDataSelector,{version:"21.2.12"})})($);/*!@license
* Infragistics.Web.ClientUI Pivot Grid 21.2.12
*
* Copyright (c) 2011-2012 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on:
*	jquery-1.9.1.js
*	jquery.ui.core.js
*	jquery.ui.widget.js
*	jquery.ui.mouse.js
*	jquery.ui.draggable.js
*	jquery.ui.droppable.js
*	infragistics.util.js
*   infragistics.util.jquery.js
*	infragistics.datasource.js
*	infragistics.olapxmladatasource.js
*	infragistics.olapflatdatasource.js
*	infragistics.ui.widget.js
*	infragistics.ui.shared.js
*   infragistics.ui.scroll.js
*	infragistics.ui.tree.js
*	infragistics.ui.grid.framework.js
*	infragistics.ui.grid.multicolumnheaders.js
*	infragistics.ui.pivot.shared.js
*/
(function($){function Matrix(){this[0]=[]}Matrix.prototype=[];Matrix.prototype.set=function(row,column,value){if(this.length<row+1){this.setRowCount(row+1)}if(this[0].length<column+1){this.setColumnCount(column+1)}this[row][column]=value};Matrix.prototype.setRowCount=function(rowCount){var i,oldRowCount=this.length;this.length=rowCount;for(i=oldRowCount;i<rowCount;i++){this[i]=[];this[i].length=this[0].length}};Matrix.prototype.setColumnCount=function(columnCount){var i;for(i=0;i<this.length;i++){this[i].length=columnCount}};var _aNull=function(val){return val===null||val===undefined},_igGrid=$.ui.igGrid.prototype.widgetFullName||$.ui.igGrid.prototype.widgetName;$.widget("ui.igPivotGrid",$.ui.igWidget,{css:{pivotGrid:"ui-igpivotgrid",pivotGridHeader:"ui-igpivotgrid-header",expandButton:"ui-iggrid-headerbutton ui-icon ui-icon-plus",collapseButton:"ui-iggrid-headerbutton ui-iggrid-headerbuttonexpanded ui-icon ui-icon-minus",rowsAscending:"ui-iggrid-sortindicator ui-icon ui-icon-triangle-1-n",rowsDescending:"ui-iggrid-sortindicator ui-icon ui-icon-triangle-1-s",headerRowsAscending:"ui-iggrid-sortindicator ui-icon ui-icon-triangle-1-n",headerRowsDescending:"ui-iggrid-sortindicator ui-icon ui-icon-triangle-1-s",headerColumnsAscending:"ui-iggrid-sortindicator ui-icon ui-icon-triangle-1-n",headerColumnsDescending:"ui-iggrid-sortindicator ui-icon ui-icon-triangle-1-s",blockArea:"ui-igpivotgrid-blockarea",metadataItem:"ui-igpivot-metadataitem ui-widget ui-corner-all ui-state-default",dropAreaHeader:"ui-igpivot-dropareaheader ui-iggrid-header ui-widget-header",scrollButton:"ui-iggrid-headerbutton",scrollLeft:"ui-icon ui-icon-triangle-1-w",scrollRight:"ui-icon ui-icon-triangle-1-e",dropArea:"ui-igpivot-droparea",overlayDropArea:"ui-igpivot-overlaydroparea",activeDropArea:"active",dropIndicator:"ui-state-highlight",invalidDropIndicator:"ui-state-error",insertItem:"ui-igpivot-insertitem ui-state-highlight ui-corner-all",metadataItemDropDown:"ui-igpivot-metadatadropdown ui-widget ui-widget-content",filterIcon:"ui-icon ui-icon-pivot-smallfilter ui-icon-carat-1-s",filterDropDown:"ui-igpivot-filterdropdown ui-widget ui-widget-content",filterMembers:"ui-igpivot-filtermembers"},options:{width:null,height:null,dataSource:null,dataSourceOptions:{xmlaOptions:{serverUrl:null,catalog:null,cube:null,measureGroup:null,requestOptions:{withCredentials:false,beforeSend:null},enableResultCache:true,discoverProperties:null,executeProperties:null,mdxSettings:{nonEmptyOnRows:true,nonEmptyOnColumns:true,addCalculatedMembersOnRows:true,addCalculatedMembersOnColumns:true,dimensionPropertiesOnRows:[],dimensionPropertiesOnColumns:[]}},flatDataOptions:{dataSource:null,dataSourceUrl:null,dataSourceType:null,responseDataKey:null,responseDataType:null,metadata:{cube:{name:null,caption:null,measuresDimension:{name:null,caption:null,measures:[{name:null,caption:null,aggregator:null,displayFolder:null}]},dimensions:[{name:null,caption:null,hierarchies:[{name:null,caption:null,displayFolder:null,levels:[{name:null,caption:null,memberProvider:null}]}]}]}}},measures:null,filters:null,rows:null,columns:null},deferUpdate:false,isParentInFrontForColumns:false,isParentInFrontForRows:true,compactColumnHeaders:false,compactRowHeaders:true,rowHeadersLayout:null,compactColumnHeaderIndentation:30,compactRowHeaderIndentation:20,rowHeaderLinkGroupIndentation:5,treeRowHeaderIndentation:10,defaultRowHeaderWidth:200,allowSorting:false,firstSortDirection:"ascending",allowHeaderRowsSorting:false,allowHeaderColumnsSorting:false,levelSortDirections:[{levelUniqueName:null,sortDirection:null,sortBehavior:null}],defaultLevelSortBehavior:"alphabetical",firstLevelSortDirection:"ascending",gridOptions:{defaultColumnWidth:null,fixedHeaders:true,caption:null,features:[],tabIndex:0,alternateRowStyles:true,enableHoverStyles:false},dragAndDropSettings:{appendTo:"body",containment:false,zIndex:10},dropDownParent:"body",disableRowsDropArea:false,disableColumnsDropArea:false,disableMeasuresDropArea:false,disableFiltersDropArea:false,hideRowsDropArea:false,hideColumnsDropArea:false,hideMeasuresDropArea:false,hideFiltersDropArea:false,customMoveValidation:null},events:{dataSourceInitialized:null,dataSourceUpdated:null,pivotGridHeadersRendered:null,pivotGridRendered:null,tupleMemberExpanding:null,tupleMemberExpanded:null,tupleMemberCollapsing:null,tupleMemberCollapsed:null,sorting:null,sorted:null,headersSorting:null,headersSorted:null,dragStart:null,drag:null,dragStop:null,metadataDropping:null,metadataDropped:null,metadataRemoving:null,metadataRemoved:null,filterDropDownOpening:null,filterDropDownOpened:null,filterMembersLoaded:null,filterDropDownOk:null,filterDropDownClosing:null,filterDropDownClosed:null},containerVisibilityTimeout:300,_const:{emptyCell:{headerText:"&nbsp;",key:"empty_cell",axisName:"empty_axis",memberIndex:0,tupleIndex:0},hoverScrollOffset:5,hoverScrollInterval:50},_headerScrollOffsets:{},_gridScrollOffsets:{top:0,left:0},_create:function(){var $this=this;this._onFiltersChanged=function(collection,collectionChangedArgs){var dropArea=$("#"+$this.element.attr("id")+"_filters .ui-igpivot-droparea");$this._onDataSourceCollectionChanged(collection,collectionChangedArgs,dropArea,$this.options.disableFiltersDropArea);$this._updateDropArea(dropArea,$this._ds.filters(),$this.options.disableFiltersDropArea,$this.options.disableFiltersDropArea?"disabledFiltersHeader":"filtersHeader")};this._onRowAxisChanged=function(collection,collectionChangedArgs){var dropArea=$("#"+$this.element.attr("id")+"_rows .ui-igpivot-droparea");$this._onDataSourceCollectionChanged(collection,collectionChangedArgs,dropArea,$this.options.disableRowsDropArea);$this._updateDropArea(dropArea,$this._ds.rowAxis(),$this.options.disableRowsDropArea,$this.options.disableRowsDropArea?"disabledRowsHeader":"rowsHeader")};this._onColumnAxisChanged=function(collection,collectionChangedArgs){var dropArea=$("#"+$this.element.attr("id")+"_columns .ui-igpivot-droparea");$this._onDataSourceCollectionChanged(collection,collectionChangedArgs,dropArea,$this.options.disableColumnsDropArea);$this._updateDropArea(dropArea,$this._ds.columnAxis(),$this.options.disableColumnsDropArea,$this.options.disableColumnsDropArea?"disabledColumnsHeader":"columnsHeader");$this._columnsChanged=true};this._onMeasuresChanged=function(collection,collectionChangedArgs){var dropArea=$("#"+$this.element.attr("id")+"_measures .ui-igpivot-droparea");$this._onDataSourceCollectionChanged(collection,collectionChangedArgs,dropArea,$this.options.disableMeasuresDropArea);$this._updateDropArea(dropArea,$this._ds.measures(),$this.options.disableMeasuresDropArea,$this.options.disableMeasuresDropArea?"disabledMeasuresHeader":"measuresHeader")};this.element.addClass(this.css.pivotGrid);this._setDataSource();if(!this.element.is(":visible")){this._recheckVisibility=true;this._visId=setInterval($.proxy(this._checkContainerVisibility,this),this.containerVisibilityTimeout)}},_checkContainerVisibility:function(){var dropArea;if(this._recheckVisibility&&this.element.is(":visible")){this._recheckVisibility=false;clearInterval(this._visId);dropArea=$("#"+this.element.attr("id")+"_columns .ui-igpivot-droparea");this._updateDropArea(dropArea,this._ds.columnAxis(),this.options.disableColumnsDropArea,this.options.disableColumnsDropArea?"disabledColumnsHeader":"columnsHeader");dropArea=$("#"+this.element.attr("id")+"_rows .ui-igpivot-droparea");this._updateDropArea(dropArea,this._ds.rowAxis(),this.options.disableRowsDropArea,this.options.disableRowsDropArea?"disabledRowsHeader":"rowsHeader");dropArea=$("#"+this.element.attr("id")+"_measures .ui-igpivot-droparea");this._updateDropArea(dropArea,this._ds.measures(),this.options.disableMeasuresDropArea,this.options.disableMeasuresDropArea?"disabledMeasuresHeader":"measuresHeader");dropArea=$("#"+this.element.attr("id")+"_filters .ui-igpivot-droparea");this._updateDropArea(dropArea,this._ds.filters(),this.options.disableFiltersDropArea,this.options.disableFiltersDropArea?"disabledFiltersHeader":"filtersHeader")}},_setGridOption:function(key,value){this.element.igGrid("option",key,value)},changeLocale:function(){var $container=this.grid().container();this._super($container.find("data-droparea"))},changeRegional:function(){this._setGridOption("regional",this.options.regional)},_setOption:function(key,value){var grid,w,lastCol;switch(key){case"dataSource":this._clearDataSource();this.options.dataSourceOptions=null;this.options.dataSource=this._createDataSource(value,null);this._setDataSource();break;case"dataSourceOptions":this._clearDataSource();this.options.dataSourceOptions=value;this.options.dataSource=this._createDataSource(null,value);this._setDataSource();break;case"deferUpdate":$.Widget.prototype._setOption.apply(this,arguments);if(value===false){this.updateGrid()}break;case"height":$.Widget.prototype._setOption.apply(this,arguments);grid=this.grid();if(grid){grid.option(key,value)}break;case"width":$.Widget.prototype._setOption.apply(this,arguments);grid=this.grid();if(grid){w=grid.element.outerWidth();grid.option(key,value);lastCol=grid.element.find(">colgroup>col:last")[0];grid._setGridContentWidth(lastCol&&lastCol.style.width==="auto"?value:w);grid._hscrollbarcontent().css("overflow-y","hidden")}break;case"levelSortDirections":case"isParentInFrontForColumns":case"isParentInFrontForRows":case"compactColumnHeaders":case"compactRowHeaders":case"rowHeadersLayout":$.Widget.prototype._setOption.apply(this,arguments);this._createTableView(this._ds);this._onGridUpdated();break;case"dragAndDropSettings":$.Widget.prototype._setOption.apply(this,arguments);this.element.find(":ui-draggable").each(function(ind,el){var draggable=$(el);draggable.draggable("option","appendTo",value.appendTo);draggable.draggable("option","containment",value.containment);draggable.draggable("option","zIndex",value.zIndex)});break;case"language":this._setGridOption(key,value);this._superApply(arguments);break;default:this._superApply(arguments);this._onGridUpdated();break}},_setDataSource:function(){var $this=this,dataSource;this._renderEmptyGrid();this._ds=dataSource=this._createDataSource(this.options.dataSource,this.options.dataSourceOptions);if(!dataSource){return}if(this.options.rowHeadersLayout==="tree"&&dataSource.dataSource().measureListLocation()===0&&dataSource.dataSource().sourceOptions().measures()&&dataSource.dataSource().sourceOptions().measures().contains(",")){this._ds.setMeasureListIndex(0)}this.timestamp=(new Date).getTime();$(dataSource).bind("initialized.pivotgrid"+this.timestamp,function(evt,evtArgs){var args=$.extend({owner:$this,dataSource:$this._ds},evtArgs);$this._triggerDataSourceInitialized(evt,args);$this._onGridUpdated()});$(dataSource).bind("updated.pivotgrid"+this.timestamp,function(evt,evtArgs){var args=$.extend({owner:$this,dataSource:$this._ds},evtArgs);$this._triggerDataSourceUpdated(evt,args);$this._onGridUpdated()});if(dataSource.isInitialized()){dataSource.bindCollectionChanged({filters:this._onFiltersChanged,rowAxis:this._onRowAxisChanged,columnAxis:this._onColumnAxisChanged,measures:this._onMeasuresChanged});this._onGridUpdated()}else{this._updateGrid(true).always(function(){dataSource.bindCollectionChanged({filters:$this._onFiltersChanged,rowAxis:$this._onRowAxisChanged,columnAxis:$this._onColumnAxisChanged,measures:$this._onMeasuresChanged})})}},_updateDropArea:function(dropArea,items,isDisabled,emptyMessageOption){if(!this._ds.isUpdating()){dropArea.empty().css({display:"",overflow:"",margin:"",padding:""}).siblings().remove();this._fillDropArea(dropArea,items,isDisabled,emptyMessageOption);this._measureDropArea(dropArea)}},_clearDataSource:function(){var grid=this.grid();if(this._ds){$(this._ds).unbind("updated.pivotgrid");this._ds.unbindCollectionChanged({filters:this._onFiltersChanged,rowAxis:this._onRowAxisChanged,columnAxis:this._onColumnAxisChanged,measures:this._onMeasuresChanged})}if(grid){grid.destroy();this.element.empty()}},_createTableView:function(dataSource){var viewSettings,hasColumns,hasRows,rowHeadersLayout,map,appliedColumnSortDirections,appliedLevelSortDirections,userLevelSortDirections,mergedLevelSortDirections;appliedColumnSortDirections=this._columnsChanged?[]:this.appliedColumnSortDirections();map=function(array){var i,m={};if($.isArray(array)){for(i=0;i<array.length;i++){if(!_aNull(array[i].levelUniqueName)){m[array[i].levelUniqueName]=array[i]}}}return m};appliedLevelSortDirections=map(this.appliedLevelSortDirections());userLevelSortDirections=map(this.options.levelSortDirections);mergedLevelSortDirections=$.extend(userLevelSortDirections,appliedLevelSortDirections);mergedLevelSortDirections=$.map(mergedLevelSortDirections,function(sd){return sd});rowHeadersLayout=this._resolveRowHeadersLayout();viewSettings={compactRowHeaderIndentation:this.options.compactRowHeaderIndentation,isParentInFrontForColumns:this.options.isParentInFrontForColumns,treeRowHeaderIndentation:this.options.treeRowHeaderIndentation,isParentInFrontForRows:this.options.isParentInFrontForRows,compactColumnHeaders:this.options.compactColumnHeaders,rowHeadersLayout:rowHeadersLayout};hasColumns=dataSource.columnAxis().length>0;hasRows=dataSource.rowAxis().length>0;this._tableView=new $.ig.OlapTableView(dataSource.result(),hasColumns,hasRows,viewSettings);this._tableView.columnSortDirections(appliedColumnSortDirections);this._tableView.levelSortDirections(mergedLevelSortDirections);this._tableView.initialize();this._columnsChanged=false},_resolveRowHeadersLayout:function(){if(this.options.rowHeadersLayout!==undefined&&this.options.rowHeadersLayout!==null){return this.options.rowHeadersLayout}if(this.options.compactRowHeaders===true){return"superCompact"}return"standard"},_configureOptions:function(dataSource){var $this=this,cols,dataCols,data,settings,gridDataSource,options;this._rowsMatrix=new Matrix;this._fillMatrixWithHeaderCells(this._rowsMatrix,this._tableView.rowHeaders());this._maxMemberIndex=dataSource.columnAxis().length-1;cols=this._generateAllGridColumns(this._tableView.columnHeaders());dataCols=this._generateDataColumns(this._tableView.columnHeaders());data=this._transformGridData(this._tableView.resultCells(),dataCols,dataCols.length,this._rowsMatrix.length);settings={dataSource:data};gridDataSource=new $.ig.DataSource(settings);options={headerRendered:function(event,ui){if($this._ds){$this._onGridHeadersRendered(event,ui)}},dataRendered:function(event,ui){if($this._ds){$this._onDataRendered(event,ui)}}};$.extend(true,options,this.options.gridOptions);options.dataSource=gridDataSource;options.columns=cols;options.autoGenerateColumns=false;options.virtualization=false;options.fixedFooters=false;options.autoFormat=false;options.renderCheckBoxes=false;options.autoFitLastColumn=false;options.autoAdjustHeight=true;options.width=this.options.width;options.height=this.options.height;$.merge(options.features,[{name:"MultiColumnHeaders"}]);return options},_addSortingMarkup:function(sortingMarkupSettings){var sortMap=sortingMarkupSettings.sortMap,stringTemplate=sortingMarkupSettings.stringTemplate,sortDirection,replaceString=sortingMarkupSettings.replaceString,markup=sortingMarkupSettings.markup;if(sortingMarkupSettings.condition){sortDirection=sortMap[sortingMarkupSettings.axisName];if(sortDirection){sortDirection=sortDirection[sortingMarkupSettings.hierarchyOffset];if(sortDirection){sortDirection=sortDirection[sortingMarkupSettings.levelNumber]}}if(sortDirection==="ascending"){markup=markup.replace(stringTemplate,replaceString+"='ascending'");markup+=sortingMarkupSettings.ascIcon}else if(sortDirection==="descending"){markup=markup.replace(stringTemplate,replaceString+"='descending'");markup+=sortingMarkupSettings.descIcon}else if(this.options.allowHeaderRowsSorting){markup=markup.replace(stringTemplate,replaceString+"=''")}}else{markup=markup.replace(stringTemplate,"")}return markup},_fillMatrixWithHeaderCells:function(matrix,headerCells){var expandIcon,expandItemIcon,collapseIcon,collapseItemIcon,sortHeaderRowsAscendingIcon,sortHeaderRowsDescendingIcon,itemSortHeaderRowsAscendingIcon,itemSortHeaderRowsDescendingIcon,headerCell,levelSortDirectionsMap,headerMarkup,text,rowSpan,columnSpan,rowIndex,columnIndex,hierarchy,endNodeIndent,headerCellIndent,headerCellLinkIndent,axisName,tupleIndex,memberIndex,css,applyIndent,isExpandable,isItemExpandable,isExpanded,isItemExpanded,isTreeLayout,expandButtonMarkup,itemExpandButtonMarkup,indent,i,linkText,dataSource=this._ds,$this=this,expandedItems,sortingMarkupSettings;if(!headerCells||headerCells.length===0){matrix.set(0,0,"<th class='ui-iggrid-header ui-widget-header'></th>");return}expandIcon="<span data-expand='true' class='"+this.css.expandButton+"' style='margin-left: $$margin$$px;'></span>";collapseIcon="<span data-expand='false' class='"+this.css.collapseButton+"' style='margin-left: $$margin$$px;'></span>";expandItemIcon="<span data-item-expand='true' class='"+this.css.expandButton+"' style='margin-left: $$margin$$px;'></span>";collapseItemIcon="<span data-item-expand='false' class='"+this.css.collapseButton+"' style='margin-left: $$margin$$px;'></span>";sortHeaderRowsAscendingIcon="<span data-sortheader='asc' class='"+this.css.headerRowsAscending+"'></span>";sortHeaderRowsDescendingIcon="<span data-sortheader='desc' class='"+this.css.headerRowsDescending+"'></span>";itemSortHeaderRowsAscendingIcon="<span data-item-sortheader='asc' class='"+this.css.headerRowsAscending+"'></span>";itemSortHeaderRowsDescendingIcon="<span data-item-sortheader='desc' class='"+this.css.headerRowsDescending+"'></span>";isTreeLayout=this.options.rowHeadersLayout==="tree";if(isTreeLayout){expandedItems={};for(i=0;i<headerCells.length;i++){if(headerCells[i].isItemExpanded()){expandedItems[i]=headerCells[i].levelNumber()}}}levelSortDirectionsMap=this._tableView.appliedSortDirectionsMap();applyIndent=!(this.options.rowHeadersLayout==="standard"||this.options.rowHeadersLayout===null&&this.options.compactRowHeaders===false);for(i=0;i<headerCells.length;i++){headerCell=headerCells[i];text=headerCell.caption();rowSpan=headerCell.rowSpan();columnSpan=headerCell.columnSpan();rowIndex=headerCell.rowIndex();columnIndex=headerCell.columnIndex();axisName=headerCell.axisName();tupleIndex=headerCell.tupleIndex();memberIndex=headerCell.memberIndex();isExpandable=headerCell.isExpandable();isExpanded=headerCell.isExpanded();headerCellIndent=isTreeLayout?headerCell.indent():this.options.compactRowHeaderIndentation*headerCell.levelNumber();if(this.options.rowHeaderLinkGroupIndentation){headerCellLinkIndent=this.options.rowHeaderLinkGroupIndentation}if(isTreeLayout){isItemExpandable=headerCell.isItemExpandable();isItemExpanded=headerCell.isItemExpanded()}css="ui-iggrid-header ui-widget-header "+this.css.pivotGridHeader;headerMarkup="<th $$data-sortheader$$ $$data-item-sortheader$$ "+"class='"+css+"' "+"title='"+text+"' "+"data-skip='true' "+"rowspan='"+rowSpan+"' "+"colspan='"+columnSpan+"' "+"data-axis='"+axisName+"' "+"data-tuple='"+tupleIndex+"' "+"data-member='"+memberIndex+"'>";if(isItemExpandable){indent=applyIndent?headerCell.indent():0;itemExpandButtonMarkup=isItemExpanded?collapseItemIcon:expandItemIcon;itemExpandButtonMarkup=itemExpandButtonMarkup.replace("$$margin$$",indent);headerMarkup+=itemExpandButtonMarkup}if(isExpandable){if(isTreeLayout){headerMarkup+="<span class='ui-iggrid-headertext'>"+text+"</span>";sortingMarkupSettings={condition:isItemExpanded,sortMap:levelSortDirectionsMap,axisName:headerCell.axisName(),hierarchyOffset:headerCell.hierarchyNumber()+1,levelNumber:headerCell.levelNumber()-expandedItems[i],replaceString:"data-sortheader",stringTemplate:"$$data-sortheader$$",markup:headerMarkup,ascIcon:sortHeaderRowsAscendingIcon,descIcon:sortHeaderRowsDescendingIcon};headerMarkup=$this._addSortingMarkup(sortingMarkupSettings);expandButtonMarkup=isExpanded?collapseIcon:expandIcon;expandButtonMarkup=expandButtonMarkup.replace("$$margin$$",headerCellLinkIndent);headerMarkup+=expandButtonMarkup;hierarchy=dataSource.rowAxis()[headerCell.memberIndex()];linkText=dataSource.getCoreElement(function(element){return element.hierarchyUniqueName()===hierarchy.uniqueName()&&element.depth()===headerCell.levelNumber()+1},$.ig.Level.prototype.getType());if(linkText){headerMarkup+="<span class='ui-igpivot-rowheaderlink'>"+linkText.caption()+"</span>"}sortingMarkupSettings={condition:isExpanded,sortMap:levelSortDirectionsMap,axisName:headerCell.axisName(),hierarchyOffset:headerCell.hierarchyNumber(),levelNumber:headerCell.levelNumber(),replaceString:"data-item-sortheader",stringTemplate:"$$data-item-sortheader$$",markup:headerMarkup,ascIcon:itemSortHeaderRowsAscendingIcon,descIcon:itemSortHeaderRowsDescendingIcon};headerMarkup=$this._addSortingMarkup(sortingMarkupSettings)}else{indent=applyIndent?headerCellIndent:0;expandButtonMarkup=isExpanded?collapseIcon:expandIcon;expandButtonMarkup=expandButtonMarkup.replace("$$margin$$",indent);headerMarkup+=expandButtonMarkup;headerMarkup+="<span class='ui-iggrid-headertext' style='display:inline;'>"+text+"</span>";sortingMarkupSettings={condition:isExpanded,sortMap:levelSortDirectionsMap,axisName:headerCell.axisName(),hierarchyOffset:headerCell.hierarchyNumber(),levelNumber:headerCell.levelNumber(),replaceString:"data-sortheader",stringTemplate:"$$data-sortheader$$",markup:headerMarkup,ascIcon:sortHeaderRowsAscendingIcon,descIcon:sortHeaderRowsDescendingIcon};headerMarkup=$this._addSortingMarkup(sortingMarkupSettings)}}else if(!isTreeLayout||isTreeLayout&&itemExpandButtonMarkup&&itemExpandButtonMarkup.contains("$$margin$$")){indent=applyIndent?headerCellIndent:0;text="<span class='ui-iggrid-headertext' style='margin-left:"+indent+"px;'>"+text+"</span>";headerMarkup+=text}else{headerMarkup+="<span class='ui-iggrid-headertext'>"+text+"</span>"}if(isTreeLayout&&(isExpandable&&!isItemExpandable||!isExpandable&&!isItemExpandable)){indent=applyIndent?headerCellIndent:0;endNodeIndent=$(".ui-iggrid-headerbutton.ui-icon").eq(0).width()+indent;headerMarkup=headerMarkup.replace("class='ui-iggrid-headertext'","class='ui-iggrid-headertext' style='margin-left:"+endNodeIndent+"px;'")}sortingMarkupSettings={condition:isTreeLayout&&isItemExpanded&&headerMarkup.contains("$$data-item-sortheader$$"),sortMap:levelSortDirectionsMap,axisName:headerCell.axisName(),hierarchyOffset:headerCell.hierarchyNumber()+1,levelNumber:headerCell.levelNumber()-1>0?headerCell.levelNumber()-1:0,replaceString:"data-sortheader",stringTemplate:"$$data-item-sortheader$$",markup:headerMarkup,ascIcon:sortHeaderRowsAscendingIcon,descIcon:sortHeaderRowsDescendingIcon};headerMarkup=$this._addSortingMarkup(sortingMarkupSettings);sortingMarkupSettings={condition:isTreeLayout&&isItemExpanded&&headerMarkup.contains("$$data-item-sortheader$$"),sortMap:levelSortDirectionsMap,axisName:headerCell.axisName(),hierarchyOffset:headerCell.hierarchyNumber()+1,levelNumber:headerCell.levelNumber()-1>0?headerCell.levelNumber()-1:0,replaceString:"data-item-sortheader",stringTemplate:"$$data-item-sortheader$$",markup:headerMarkup,ascIcon:itemSortHeaderRowsAscendingIcon,descIcon:itemSortHeaderRowsDescendingIcon};headerMarkup=$this._addSortingMarkup(sortingMarkupSettings);headerMarkup+="</th>";matrix.set(rowIndex+rowSpan-1,columnIndex+columnSpan-1,undefined);matrix.set(rowIndex,columnIndex,headerMarkup)}},_generateAllGridColumns:function(headers){var cols,levels=[],i;if(!headers||headers.length===0){return[this._const.emptyCell]}for(i=0;i<headers.length;i++){if(!levels[headers[i].rowIndex()]){levels[headers[i].rowIndex()]=[]}levels[headers[i].rowIndex()].push(headers[i])}this._maxLevel=levels.length;cols=this._processHeadersTree(levels);return cols},_generateDataColumns:function(headers){var cols=[],i;if(!headers||headers.length===0){return[this._const.emptyCell]}for(i=0;i<headers.length;i++){if(headers[i].memberIndex()!==this._maxMemberIndex){continue}if(headers[i].columnSpan()===1&&(headers[i].isExpandable()===false||!headers[i].isExpanded())){cols.push({headerText:headers[i].caption(),key:headers[i].axisName()+"_"+headers[i].tupleIndex()+"_"+headers[i].memberIndex()+"_"+headers[i].isExpandable()})}else if(this.options.compactColumnHeaders){cols.push({headerText:headers[i].caption(),key:headers[i].axisName()+"_"+headers[i].tupleIndex()+"_"+headers[i].memberIndex()+"_"+headers[i].isExpandable()})}}return cols},_transformGridData:function(cells,columns,columnsCount,maxRowCount){var data=[],cellOrdinal,i,colIndex;if(!cells||cells.length===0){if(maxRowCount>0){for(i=0;i<maxRowCount;i++){data.push({})}return data}return[{}]}for(i=0;i<maxRowCount;i++){data.push({})}for(i=0;i<cells.length;i++){cellOrdinal=cells[i].cellOrdinal();colIndex=cellOrdinal%columnsCount;data[Math.floor(cellOrdinal/columnsCount)][columns[colIndex].key]=cells[i].formattedValue()}return data},_processHeadersTree:function(tree){var cols=[],i,j,parent,parents;for(i=0;tree.length>=1&&i<tree[0].length;i++){this._createHeader(cols,tree[0][i])}for(i=1;i<tree.length;i++){parents=this._parentsForLevel(i,cols);for(j=0;j<tree[i].length;j++){parent=this._findParent(parents,tree[i][j]);if(parent){this._createHeader(parent,tree[i][j])}else{if(i-1>=1){this._findAndCreateUp(i-1,i,cols,tree,tree[i][j])}}}}return cols},_findAndCreateUp:function(level,itemsLevel,cols,tree,item){var parents,j,currentItem,parent;parents=this._parentsForLevel(level,cols);for(j=0;j<tree[itemsLevel].length;j++){currentItem=tree[itemsLevel][j];if(currentItem.axisName()===item.axisName()&&currentItem.columnIndex()===item.columnIndex()&&currentItem.memberIndex()===item.memberIndex()&&currentItem.tupleIndex()===item.tupleIndex()&&currentItem.caption()===item.caption()){parent=this._findParent(parents,currentItem,itemsLevel-level+1);if(parent){this._createHeader(parent,currentItem)}else{if(level-1>=1){this._findAndCreateUp(level-1,itemsLevel,cols,tree,item)}}}}},_parentsForLevel:function(level,root){var parents=[],i;for(i=0;i<root.length;i++){this._parentsForLevelRecursive(parents,root[i],1,level)}return parents},_parentsForLevelRecursive:function(parents,currentParent,currentLevel,level){var extraLevel=currentParent.rowspan>1?currentParent.rowspan-1:0,i;if(currentLevel===level){parents.push(currentParent)}else if(currentLevel<level&&currentParent.group!==null&&currentParent.group!==undefined){for(i=0;i<currentParent.group.length;i++){this._parentsForLevelRecursive(parents,currentParent.group[i],currentLevel+1+extraLevel,level)}}},_createHeader:function(parent,col){var column={headerText:col.caption(),key:col.axisName()+"_"+col.tupleIndex()+"_"+col.memberIndex()+"_"+col.isExpandable(),rowspan:col.rowSpan(),colSpan:col.columnSpan(),colIndex:col.columnIndex(),axisName:col.axisName(),tupleIndex:col.tupleIndex(),memberIndex:col.memberIndex(),expandable:col.isExpandable(),expanded:col.isExpanded(),hierarchyNumber:col.hierarchyNumber(),levelNumber:col.levelNumber()};if(!this.options.compactColumnHeaders&&(col.columnSpan()>1||col.columnSpan()===1&&col.isExpanded()&&col.isExpandable())){column.group=[]}parent.push(column)},_findParent:function(cols,header,rowSpan){var i;if(!cols||cols.length===undefined||cols.length===null){return null}for(i=0;i<cols.length;i++){if(rowSpan===undefined||rowSpan!==undefined&&cols[i].rowspan===rowSpan){if(cols[i].colSpan+cols[i].colIndex>=header.columnSpan()+header.columnIndex()&&cols[i].colIndex<=header.columnIndex()){if(!cols[i].group){cols[i].group=[]}return cols[i].group}}}return null},grid:function(){return this.element.data(_igGrid)},updateGrid:function(){this._updateGrid(false,true)},_showLoadingIndicator:function(){var container;if(this.element.data(_igGrid)){container=this.grid().container();if(!container.children("div[data-loading-indicator-container]").length){$("#"+this.grid().element.attr("id")+"_columns_overlay").css("display","none");$("#"+this.grid().element.attr("id")+"_measures_overlay").css("display","none");container.css("position","relative");$("<div class='"+this.css.blockArea+"' data-loading-indicator-container></div>").appendTo(container).data("efh","1")}}},_updateGrid:function(init,deferUpdateOverride){var dataSource=this._ds,shouldUpdate=deferUpdateOverride||this.options.deferUpdate===false,promise;if(!init&&!shouldUpdate){return}this._showLoadingIndicator();if(init){promise=dataSource.initialize()}else{promise=dataSource.update()}return promise},_onGridUpdated:function(){var dataSource=this._ds,options;this._createTableView(dataSource);options=this._configureOptions(dataSource);this._renderGrid(options)},_renderEmptyGrid:function(){var options;options=$.extend(true,{},this.options.gridOptions);options.width=this.options.width;options.height=this.options.height;this.element.igGrid(options)},_renderGrid:function(options){var id=this.element.attr("id"),grid,container;grid=this.grid();if(grid){this._gridScrollOffsets.top=grid.scrollContainer().scrollTop();this._gridScrollOffsets.left=$("#"+id+"_hscroller").scrollLeft();this.element.igGrid("destroy");this.element.empty()}this.element.igGrid(options);container=this.grid().container();container.addClass(this.css.pivotGrid);this._makeDroppable(container)},_rerenderColgroups:function(){var grid=this.grid(),go=grid.options,headersTbl=grid.headersTable();this._gridRerenderColgroups.apply(grid,arguments);if(go.height!==null&&go.fixedHeaders===true&&go.showHeader){this._renderExtraColInColgroup(headersTbl.children("colgroup"))}this._measureHeaders(grid._oldCols||go.columns);this._renderExtraColInColgroup(grid.element.children("colgroup"));if(go.height!==null&&go.fixedFooters===true&&go.showFooter){this._renderExtraColInColgroup(grid.footersTable().children("colgroup"))}return this._updateDOMOnDataRendered(grid.element)},_renderExtraColInColgroup:function(colgroup){var i,col,extraColsCount=this._rowsMatrix.length>0?this._rowsMatrix[0].length:1;for(i=0;i<extraColsCount;i++){col=$("<col></col>").prependTo(colgroup).attr("data-skip","true")}if(extraColsCount){colgroup.attr("data-cols-injected","true")}},_onGridHeadersRendered:function(event,ui){var $this=this,headers=ui.owner._oldCols,table=ui.table,id=this.element.attr("id"),appliedColumnSortDirectionsMap,first,firstParent,rowsCellColSpan,rowsCellRowSpan,columnsCellColSpan,filtersCellColSpan,row,droppableOptions,dropArea,header,dataSource=this._ds,colgroup,i,length,sortableHeaders;table.addClass(this.css.pivotGrid);ui.owner._renderRecord=function(data,rowIndex){return $this._renderPivotRecord.call(this,$this._rowsMatrix,data,rowIndex)};this._gridRerenderColgroups=ui.owner._rerenderColgroups;ui.owner._rerenderColgroups=function(){$this._rerenderColgroups.apply($this,arguments)};if(headers===null||headers===undefined){headers=ui.owner.options.columns}appliedColumnSortDirectionsMap={};$.each(this._tableView.appliedColumnSortDirections(),function(ind,csd){appliedColumnSortDirectionsMap[csd.tupleIndex]=csd.sortDirection});this._processHeaderMarkupRecursive(this.grid().element[0].id,headers,appliedColumnSortDirectionsMap,this._tableView.appliedSortDirectionsMap());first=table.find("tr").first();firstParent=first.parent();rowsCellColSpan=this._rowsMatrix.length>0?this._rowsMatrix[0].length:1;rowsCellRowSpan=this._maxLevel;columnsCellColSpan=ui.owner.options.columns.length;filtersCellColSpan=rowsCellColSpan+columnsCellColSpan;if(table.find(".ui-igpivot-droparea[data-role=rows], "+".ui-igpivot-droparea[data-role=columns], "+".ui-igpivot-droparea[data-role=measures], "+".ui-igpivot-droparea[data-role=filters]").length===0){droppableOptions=this._createDropAreaOptions();if(!this.options.hideRowsDropArea){header=$("<th id='"+id+"_rows' rowSpan='"+rowsCellRowSpan+"' colSpan='"+rowsCellColSpan+"' data-skip='true' class='"+this.css.dropAreaHeader+"'></th>").prependTo(first);header.height(header.height());dropArea=$("<ul data-role='rows' class='"+this.css.dropArea+"'></ul>").appendTo(header);if(!this.options.disableRowsDropArea){dropArea.droppable(droppableOptions)}}else{$("<th rowSpan='"+rowsCellRowSpan+"' colSpan='"+rowsCellColSpan+"' data-skip='true' class='ui-iggrid-header ui-widget-header'></th>").prependTo(first);
}if(!this.options.hideColumnsDropArea||!this.options.hideMeasuresDropArea){row=$("<tr></tr>").prependTo(firstParent)}if(!this.options.hideColumnsDropArea){header=$("<th id='"+id+"_columns' rowSpan='1' colSpan='"+columnsCellColSpan+"' data-skip='true' class='"+this.css.dropAreaHeader+"'></th>").prependTo(row);dropArea=$("<ul data-role='columns' class='"+this.css.dropArea+"'></ul>").appendTo(header);if(!this.options.disableColumnsDropArea){dropArea.droppable(droppableOptions);if($("#"+id+"_columns_overlay").length<1){$("<div id='"+id+"_columns_overlay' data-role='columns' class='"+this.css.overlayDropArea+" ui-igpivot-droparea ui-droppable'></div>").appendTo(this.element).droppable(droppableOptions)}}}else if(!this.options.hideMeasuresDropArea){$("<th rowSpan='1' colSpan='"+columnsCellColSpan+"' data-skip='true' class='ui-iggrid-header ui-widget-header'></th>").prependTo(row)}if(!this.options.hideMeasuresDropArea){header=$("<th id='"+id+"_measures' rowSpan='1' colSpan='"+rowsCellColSpan+"' data-skip='true' class='"+this.css.dropAreaHeader+"'></th>").prependTo(row);dropArea=$("<ul data-role='measures' class='"+this.css.dropArea+"'></ul>").appendTo(header);if(!this.options.disableMeasuresDropArea){dropArea.droppable(droppableOptions)}}else if(!this.options.hideColumnsDropArea){$("<th rowSpan='1' colSpan='"+rowsCellColSpan+"' data-skip='true' class='ui-iggrid-header ui-widget-header'></th>").prependTo(row)}if(!this.options.hideFiltersDropArea){row=$("<tr></tr>").prependTo(firstParent);header=$("<th id='"+id+"_filters' rowSpan='1' colSpan='"+filtersCellColSpan+"' data-skip='true' class='"+this.css.dropAreaHeader+"'></th>").prependTo(row);dropArea=$("<ul data-role='filters' class='"+this.css.dropArea+"'></ul>").appendTo(header);if(!this.options.disableFiltersDropArea){dropArea.droppable(droppableOptions)}}}else{$("#"+id+"_rows").attr("rowSpan",rowsCellRowSpan).attr("colSpan",rowsCellColSpan);$("#"+id+"_columns").attr("rowSpan",1).attr("colSpan",columnsCellColSpan);$("#"+id+"_measures").attr("rowSpan",1).attr("colSpan",rowsCellColSpan);$("#"+id+"_fiters").attr("rowSpan",1).attr("colSpan",filtersCellColSpan)}colgroup=table.find("colgroup");if(colgroup.length===0){if(this.grid()._isMultiColumnGrid){length=table.find("th[data-isheadercell]").length}else{length=headers.length}colgroup="<colgroup>";for(i=0;i<length;i++){colgroup+="<col></col>"}colgroup+="</colgroup>";colgroup=$(colgroup).prependTo(table)}this._renderExtraColInColgroup(colgroup);if(this.options.allowSorting){sortableHeaders=table.find(".ui-igpivotgrid-header[data-sort]");sortableHeaders.children(".ui-iggrid-headertext,.ui-iggrid-sortindicator").bind("click",function(evt){$this._onSort(evt)});sortableHeaders.filter("[data-axis='empty_axis']").bind("click",function(evt){$this._onSort(evt)})}if(this.options.allowHeaderColumnsSorting){table.find(".ui-igpivotgrid-header[data-sortheader]").children(".ui-iggrid-headertext,.ui-iggrid-sortindicator").bind("click",function(evt){$this._onSortHeader(evt)})}if(!this.options.hideFiltersDropArea){this._fillDropArea("#"+id+"_filters .ui-igpivot-droparea",dataSource.filters(),this.options.disableFiltersDropArea,this.options.disableFiltersDropArea?"disabledFiltersHeader":"filtersHeader")}if(!this.options.hideRowsDropArea){this._fillDropArea("#"+id+"_rows .ui-igpivot-droparea",dataSource.rowAxis(),this.options.disableRowsDropArea,this.options.disableRowsDropArea?"disabledRowsHeader":"rowsHeader")}if(!this.options.hideColumnsDropArea){this._fillDropArea("#"+id+"_columns .ui-igpivot-droparea",dataSource.columnAxis(),this.options.disableColumnsDropArea,this.options.disableColumnsDropArea?"disabledColumnsHeader":"columnsHeader")}if(!this.options.hideMeasuresDropArea){this._fillDropArea("#"+id+"_measures .ui-igpivot-droparea",dataSource.measures(),this.options.disableMeasuresDropArea,this.options.disableMeasuresDropArea?"disabledMeasuresHeader":"measuresHeader")}this._measureHeaders(headers);table.find("thead span.ui-iggrid-headerbutton.ui-icon").bind("click",function(evt){$this._onToggleTupleMember(evt);return false});this._triggerPivotGridHeadersRendered(event,ui)},_renderPivotRecord:function(matrix,data,rowIndex){var i,key=this.options.primaryKey,temp,grid=this,dstr="",cols=this.options.columns,noVisibleColumns,str="",cellClass;dstr+="<tr";if(rowIndex%2!==0&&this.options.alternateRowStyles){dstr+=" class='"+grid.css.recordAltClass+"'"}if(!_aNull(key)){dstr+=" data-id='"+this._kval_from_key(key,data)+"'"}else if(!_aNull(data.ig_pk)){dstr+=" data-id='"+data.ig_pk+"'"}if(this.options.virtualization&&this.options.virtualizationMode==="continuous"){dstr+=" data-row-idx='"+rowIndex+"'"}dstr+=" role='row'>";for(i=0;i<matrix[rowIndex].length;i++){if(matrix[rowIndex][i]){str+=matrix[rowIndex][i]}}if(str!==""){dstr+=str}noVisibleColumns=true;$(cols).each(function(colIndex){if(cols[colIndex].hidden||cols[colIndex].fixed===true){return}cellClass=false;noVisibleColumns=false;dstr+="<td role='gridcell' aria-describedby='"+grid.id()+"_"+this.key+"' tabindex='"+grid.options.tabIndex+"'";if(cols[colIndex].template&&cols[colIndex].template.length){temp=grid._renderTemplatedCell(data,this);if(temp.indexOf("<td")===0){dstr+=temp.substring(3)}else{dstr+=">"+temp;cellClass=true}dstr=grid._editCellStyle(dstr,data,this.key,this,cellClass)}else{dstr+=grid._addCellStyle(data,this.key?this.key:colIndex,cols[colIndex])+">"+grid._renderCell(data[this.key?this.key:colIndex],this,data)}dstr+="</td>"});if(noVisibleColumns){dstr+="<td role='gridcell'></td>"}dstr+="</tr>";return dstr},_processHeaderMarkupRecursive:function(tableId,headers,columnSortDirectionsMap,levelSortDirectionsMap){var i,headerCell,expanded,expandable,sortDirection,expandIcon,collapseIcon,allowSorting,allowHeaderColumnsSorting,sortRowsAscendingIcon,sortRowsDescendingIcon,sortHeaderColumnsAscendingIcon,sortHeaderColumnsDescendingIcon;allowSorting=this.options.allowSorting;allowHeaderColumnsSorting=this.options.allowHeaderColumnsSorting;expandIcon="<span data-expand='true' class='"+this.css.expandButton+"'/>";collapseIcon="<span data-expand='false' class='"+this.css.collapseButton+"'/>";sortRowsAscendingIcon="<span data-sort='asc' class='"+this.css.rowsAscending+"'/>";sortRowsDescendingIcon="<span data-sort='desc' class='"+this.css.rowsDescending+"'/>";sortHeaderColumnsAscendingIcon="<span data-sortheader='asc' class='"+this.css.headerColumnsAscending+"'></span>";sortHeaderColumnsDescendingIcon="<span data-sortheader='desc' class='"+this.css.headerColumnsDescending+"'></span>";for(i=0;i<headers.length;i++){headerCell=$("#"+tableId+"_"+headers[i].key);headerCell.addClass(this.css.pivotGridHeader).attr("data-axis",headers[i].axisName).attr("data-member",headers[i].memberIndex).attr("data-tuple",headers[i].tupleIndex);if(headers[i].axisName!==this._const.emptyCell.axisName){headerCell.attr("title",headers[i].headerText)}if(this.options.compactColumnHeaders&&headers[i].levelNumber>0){headerCell.css("padding-top",this.options.compactColumnHeaderIndentation*headers[i].levelNumber)}expandable=headers[i].expandable;expanded=headers[i].expanded;if(expandable&&!expanded){$(expandIcon).insertBefore(headerCell.children(".ui-iggrid-headertext"))}else if(expandable&&expanded){$(collapseIcon).insertBefore(headerCell.children(".ui-iggrid-headertext"));sortDirection=levelSortDirectionsMap[headers[i].axisName];if(sortDirection){sortDirection=sortDirection[headers[i].hierarchyNumber];if(sortDirection){sortDirection=sortDirection[headers[i].levelNumber]}}if(sortDirection==="ascending"){headerCell.attr("data-sortheader","ascending");$(sortHeaderColumnsAscendingIcon).appendTo(headerCell)}else if(sortDirection==="descending"){headerCell.attr("data-sortheader","descending");$(sortHeaderColumnsDescendingIcon).appendTo(headerCell)}else if(allowHeaderColumnsSorting){headerCell.attr("data-sortheader","")}}if(!expandable||expandable&&!expanded){sortDirection=columnSortDirectionsMap[headers[i].tupleIndex];if(sortDirection==="ascending"){headerCell.attr("data-sort","ascending");$(sortRowsAscendingIcon).appendTo(headerCell)}else if(sortDirection==="descending"){headerCell.attr("data-sort","descending");$(sortRowsDescendingIcon).appendTo(headerCell)}else if(allowSorting){headerCell.attr("data-sort","")}}if(headers[i].group){this._processHeaderMarkupRecursive(tableId,headers[i].group,columnSortDirectionsMap,levelSortDirectionsMap)}}},_fillDropArea:function(dropAreaSelector,items,isDisabled,emptyMessageOption){var dropArea=$(dropAreaSelector),i,length;dropArea.empty();if(items.length>0){for(i=0,length=items.length;i<length;i++){this._createMetadataElement(items[i],isDisabled,"appendTo",dropArea)}}else{dropArea.attr({"data-localeid":emptyMessageOption,"data-droparea":true}).text(this._getLocaleValue(emptyMessageOption))}},_measureHeaders:function(headers){var $this=this,id=this.element.attr("id"),grid=this.grid(),table=grid.headersTable(),extraColsCount,extraColsWidth,maxWidth,header,measureTh,colsWidth,areaWrapper;extraColsCount=this._rowsMatrix.length>0?this._rowsMatrix[0].length:1;if(this.options.defaultRowHeaderWidth){table.find("col:lt("+extraColsCount+")").width(this.options.defaultRowHeaderWidth);if(!$.ig.util.isTouchDevice()){table.find(".ui-igpivot-droparea[data-role=rows], "+".ui-igpivot-droparea[data-role=columns], .ui-igpivot-droparea[data-role=measures], "+".ui-igpivot-droparea[data-role=filters]").each(function(){$this._measureDropArea($(this))})}else{table.find(".ui-igpivot-droparea[data-role=rows], "+".ui-igpivot-droparea[data-role=columns], .ui-igpivot-droparea[data-role=measures], "+".ui-igpivot-droparea[data-role=filters]").each(function(ind,el){areaWrapper=$("<div id='"+$(el).attr("data-role")+"_wrapper' style='overflow: hidden;'></div>").css("width",$(el).width()+"px").css("height",$(el).height()+"px");$(el).wrap(areaWrapper).parent("div").igScroll()})}extraColsWidth=this.options.defaultRowHeaderWidth*extraColsCount}else{maxWidth=0;table.find("#"+id+"_measures, #"+id+"_rows").each(function(ind,el){var clone,parent;clone=$(el).clone(false);clone.children(".ui-igpivot-droparea").append("<li class='"+$this.css.insertItem+"'></li>");parent=$("<div class='ui-widget ui-widget-header ui-iggrid ui-igpivotgrid'></div>").append(clone).css({position:"absolute",visibility:"hidden",height:"auto",width:"auto",overflow:"visible","text-overflow":"clip",left:"-1000px",top:"-1000px"}).appendTo(document.body);maxWidth=Math.max(maxWidth,parent.outerWidth(true));parent.remove()});table.find("col:lt("+extraColsCount+")").width(Math.ceil(maxWidth/extraColsCount));extraColsWidth=maxWidth}if(grid.options.defaultColumnWidth){table.find("col:gt("+extraColsCount+")").width(grid.options.defaultColumnWidth)}else{header=table.find("th:not(.ui-igpivot-dropareaheader):first");measureTh=$("<th class='"+header.attr("class")+"' style='position:absolute;visibility:hidden;height:auto;width:auto;overflow:visible;"+"text-overflow:clip;left:-1000px;top:-1000px;'></th>").css({"font-family":header.css("fontFamily"),"font-size":header.css("fontSize"),"font-size-adjust":header.css("fontSizeAdjust"),"font-stretch":header.css("fontStretch"),"font-style":header.css("fontStyle"),"font-variant":header.css("fontVariant"),"font-weight":header.css("fontWeight")}).appendTo(document.body);colsWidth=this._measureHeadersRecursive(this.grid().element[0].id,headers,measureTh,extraColsCount);measureTh.remove()}if(table.find("col").length-extraColsCount===1||extraColsWidth+colsWidth<table.width()){table.find("col:last").width("auto")}},_measureHeadersRecursive:function(tableId,headers,measureTh,extraColsCount){var i,headerCell,totalWidth,width;totalWidth=0;for(i=0;i<headers.length;i++){if(headers[i].axisName===this._const.emptyCell.axisName){break}headerCell=$("#"+tableId+"_"+headers[i].key);if(headers[i].group){totalWidth+=this._measureHeadersRecursive(tableId,headers[i].group,measureTh,extraColsCount)}else{width=measureTh.html(headerCell[0].innerHTML)[0].offsetWidth+10;totalWidth+=width;this.grid().headersTable().find("col:eq("+(headerCell.data("columnIndex")+extraColsCount)+")").width(width);headers[i].width=width}}return totalWidth},_measureDropArea:function(dropArea){var $this=this,id,parent,parentClone,parentContainer,parentWidth,left,minLeft,maxLeft,scrollLeft,scrollRight,scrollToLeft,timer,mouseover,mouseout;parent=dropArea.parent("th");id=parent.attr("id");parentClone=$(parent).clone(false);parentClone.children(".ui-igpivot-droparea").append("<li class='"+$this.css.insertItem+"'></li>");parentContainer=$("<div class='ui-widget ui-widget-header ui-iggrid ui-igpivotgrid'></div>").append(parentClone).css({position:"absolute",visibility:"hidden",height:"auto",width:"auto",overflow:"visible","text-overflow":"clip",left:"-1000px",top:"-1000px"}).appendTo(document.body);parentWidth=parent.width();if(parentContainer.find(".ui-igpivot-droparea").outerWidth(true)>parentWidth){dropArea.css({display:"inline-block",overflow:"hidden",margin:0,padding:0});scrollLeft=$("<span class='"+this.css.scrollButton+"'><a class='"+this.css.scrollLeft+"' /></span>").insertBefore(dropArea);scrollRight=$("<span class='"+this.css.scrollButton+"'><a class='"+this.css.scrollRight+"' /></span>").insertAfter(dropArea);if(0===parentWidth){dropArea.width("auto")}else{dropArea.width(parentWidth-scrollLeft.outerWidth(true)-scrollRight.outerWidth(true))}left=this._headerScrollOffsets[id]||0;minLeft=0;maxLeft=dropArea[0].scrollWidth;scrollToLeft=function(){if(left<minLeft){left=minLeft}if(left>maxLeft){left=maxLeft}dropArea.scrollLeft(left);$this._headerScrollOffsets[id]=left};scrollToLeft();mouseover=this._getEvent("mouseover");mouseout=this._getEvent("mouseout");scrollLeft.bind(mouseover,function(){timer=setInterval(function(){left-=$this._const.hoverScrollOffset;scrollToLeft()},$this._const.hoverScrollInterval)}).bind(mouseout,function(){clearInterval(timer)});scrollRight.bind(mouseover,function(){timer=setInterval(function(){left+=$this._const.hoverScrollOffset;scrollToLeft()},$this._const.hoverScrollInterval)}).bind(mouseout,function(){clearInterval(timer)})}else{delete this._headerScrollOffsets[id]}parentContainer.remove()},_getKPIs:function(dataSource){var measures,kpi,kpiObject,KPIs=[],i;measures=dataSource.measures();for(i=measures.length-1;i>=0;i--){kpiObject={};if("KpiMeasure"===measures[i].getType().typeName()){kpi=dataSource.getCoreElements(function(el){return el.uniqueName()===measures[i].uniqueName()},$.ig.KpiMeasure.prototype.getType())}if(undefined!==kpi&&1===kpi.length){if(null!==kpi[0].graphic()){kpiObject.name=kpi[0].caption();kpiObject.graphic=kpi[0].graphic();KPIs.push(kpiObject)}}}return KPIs},_getKPICells:function(KPIs,dataSource){var headers,allColumns,columnIndexes,rowCells,allRows,i,j,k,m,rowspan,colspan,colspanValue,colspanOffset,rows;if(0!==KPIs.length){if(1===dataSource.measures().length){KPIs[0].cells=$("."+this.css.pivotGrid+" td")}else{for(m=KPIs.length-1;m>=0;m--){KPIs[m].cells=$();headers=$();headers=headers.add("th.ui-igpivotgrid-header[title='"+KPIs[m].name+"']");switch(dataSource.getMeasureListLocation()){case"rows":for(k=0;k<headers.length;k++){rowspan=parseInt(headers.eq(k).attr("rowspan"),10);rows=headers.eq(k).parent();for(i=0;i<rowspan;i++){for(j=0;j<rows.find("td").length;j++){KPIs[m].cells=KPIs[m].cells.add(rows.find("td").eq(j)[0])}rows=rows.next()}}break;case"columns":colspanOffset=0;columnIndexes=[];allColumns=headers.parent().find("th[data-skip!=true]");for(i=0,j=0;i<allColumns.length;i++){colspanValue=parseInt(allColumns.eq(i).attr("colspan"),10);colspan=isNaN(colspanValue)?1:colspanValue;if(allColumns.eq(i)[0]===headers.eq(j)[0]){for(k=0;k<colspan;k++){columnIndexes.push(i+k+colspanOffset)}j++}colspanOffset+=colspan>1?colspan-1:0}allRows=$("."+this.css.pivotGrid+" tbody tr");rowCells=allRows.find("td");for(i=0;i<allRows.length;i++){for(j=0,k=0;j<rowCells.length;j++){if(j===columnIndexes[k]){KPIs[m].cells=KPIs[m].cells.add(allRows.eq(i).find("td").eq(j)[0]);k++}}}break}}}return KPIs}return[]},_addKPIImages:function(KPIs){var i,j,imgString,currentCell,val,x,y;for(i=0;i<KPIs.length;i++){for(j=0;j<KPIs[i].cells.length;j++){currentCell=KPIs[i].cells.eq(j);if(!isNaN(currentCell.text())){imgString="<div class='ui-igpivotgrid-kpis'";imgString+=" title='"+currentCell.text()+"'";imgString+=" style='background-position: ";val=parseFloat(currentCell.text());if(0<val){x=0}else if(0>val){x=32}else{x=16}switch(KPIs[i].graphic.toLowerCase()){case"road signs":y=0;break;case"traffic light":y=16;break;case"variance arrow":y=32;break;case"standart arrow":y=48;break;case"status arrow - ascending":y=64;break;case"status arrow - descending":y=80;break;case"faces":y=96;break;case"shapes":y=112;break;case"cylinder":y=128;break;case"gauge - ascending":y=144;break;case"gauge - descending":y=160;break;case"thermometer":y=176;break}imgString+="-"+x+"px -"+y+"px";imgString+="'></div>";KPIs[i].cells.eq(j)[0].innerHTML=imgString}}}},_adjustRowHeadersWidth:function(grid){var maxWidth=0,childrenWidth,headers,headerChildren,rowsDropAreaWidth,row;if(this.options.height!==null){headers=grid.element.find("th")}else{headers=grid.headersTable().find("tbody th")}headers.each(function(){childrenWidth=parseInt($(this).css("border-right-width").replace("px",""),10);headerChildren=$(this).children();headerChildren.each(function(){childrenWidth+=parseInt($(this).css("margin-left").replace("px",""),10);childrenWidth+=$(this).width()});maxWidth=maxWidth<childrenWidth?childrenWidth:maxWidth});grid.headersTable().find("col").eq(0).width(maxWidth+headers.outerWidth()-headers.width());row="#"+this.element[0].id+"_rows";rowsDropAreaWidth=$(row).width()-2*$(row+" span").width();$(row+" ul").width(rowsDropAreaWidth)},_updateDOMOnDataRendered:function(table){var $this=this,id=this.element.attr("id"),grid=this.grid(),overlayDropAreaOptions=this._createDropAreaOptions(),dataSource=this._ds,headersCols,colgroup,i,j,colAttributes,KPIs,headerCell,sortableItems,headerCells,headerItemCells;if($this.options.rowHeadersLayout==="tree"&&!$this.options.defaultRowHeaderWidth&&this._ds.rowAxis().length!==0){$this._adjustRowHeadersWidth(grid)}if("OlapXmlaDataSource"===dataSource.getType().typeName()){KPIs=this._getKPIs(dataSource);KPIs=this._getKPICells(KPIs,dataSource);this._addKPIImages(KPIs,dataSource)}table.addClass(this.css.pivotGrid);table.find("tbody th > span[data-expand]").bind("click",function(evt){$this._onToggleTupleMember(evt);return false});table.find("tbody th > span[data-item-expand]").bind("click",function(evt){$this._onToggleTupleMember(evt);return false});if(this.options.allowHeaderRowsSorting){if(this.options.rowHeadersLayout==="tree"){headerCell="tbody th.ui-igpivotgrid-header[data-item-sortheader],"+"tbody th.ui-igpivotgrid-header[data-sortheader]";sortableItems=".ui-iggrid-sortindicator";headerItemCells=table.find(headerCell).find("span[data-item-expand]");for(i=0;i<headerItemCells.length;i++){if($(headerItemCells[i]).data().itemExpand===false){sortableItems+=",.ui-iggrid-headertext:eq("+i+")"}}headerCells=table.find(headerCell).find("span[data-expand]");for(i=0;i<headerCells.length;i++){if($(headerCells[i]).data().expand===false){sortableItems+=",.ui-igpivot-rowheaderlink:eq("+i+")"}}}else{headerCell="tbody th.ui-igpivotgrid-header[data-sortheader]";sortableItems=".ui-iggrid-headertext,.ui-iggrid-sortindicator"}table.find(headerCell).children(sortableItems).bind("click",function(evt){$this._onSortHeader(evt)})}if(grid.options.fixedHeaders){headersCols=grid.headersTable().find("colgroup").find("col");colgroup=table.find("colgroup");colgroup.empty();for(i=0;i<headersCols.length;i++){colgroup.append($("<col></col>"));colAttributes=headersCols.eq(i)[0].attributes;for(j=0;j<colAttributes.length;j++){colgroup.find("col").eq(i).attr(colAttributes.item(j).name,colAttributes.item(j).value)}}grid._setGridContentWidth(grid.headersTable().width());grid.scrollContainer().scrollTop(this._gridScrollOffsets.top);$("#"+id+"_hscroller").scrollLeft(this._gridScrollOffsets.left)}if(!this.options.disableRowsDropArea){if($("#"+id+"_rows_overlay").length<1){$("<div id='"+id+"_rows_overlay' data-role='rows' class='"+this.css.overlayDropArea+" ui-igpivot-droparea ui-droppable'></div>").appendTo(this.element).droppable(overlayDropAreaOptions)}}if(!this.options.disableMeasuresDropArea){if($("#"+id+"_measures_overlay").length<1){$("<div id='"+id+"_measures_overlay' data-role='measures' class='"+this.css.overlayDropArea+" ui-igpivot-droparea ui-droppable'></div>").appendTo(this.element).droppable(overlayDropAreaOptions)}}this._positionOverlayDropAreas()},_onDataRendered:function(event,ui){this._updateDOMOnDataRendered(ui.owner.element);this._triggerPivotGridRendered(event,ui)},_positionOverlayDropAreas:function(){var id=this.element.attr("id"),headersTable=this.grid().headersTable().find("thead"),dataTable=this.grid().element.find("tbody"),firstColumnHeaderPosition,firstRowHeaderPosition,columnHeadersHeight,rowHeadersWidth,measuresArea,container,containerParent,containerPosition,columnsOverlayTop,columnsOverlayLeft,columnHeadersWidth,measuresHeadersWidth,dataTableHeight,rowsOverlayTop,rowsOverlayLeft,containerId,rowHeight,ht,firstRow,rowsProps,columnsProps,measuresProps,absoluteOffset;firstColumnHeaderPosition=headersTable.find("th[data-axis]:first").igPosition();columnHeadersHeight=0;if($.ig.util.isFF){columnHeadersHeight=headersTable.find("tr[data-header-row], tr[data-mch-level]")[0].scrollHeight}else{headersTable.find("tr[data-header-row], tr[data-mch-level]").each(function(ind,el){columnHeadersHeight+=el.scrollHeight})}if(this.options.height!==null||this.options.width!==null){containerId=this.element.attr("id");container=$("#"+containerId+"_container").length===1?$("#"+containerId+"_container"):$("#"+containerId+"_table_container");containerParent=container.parent();containerPosition=container.igPosition()}if(this.options.height!==null){firstRowHeaderPosition={top:this.grid().headersTable().height()+containerPosition.top,left:containerPosition.left}}else if(this.options.width!==null){rowHeight=this.grid().headersTable().find("tr").eq(0).height();if(this.grid().headersTable().find("tr[data-mch-level]").length===0){firstRowHeaderPosition={top:3*rowHeight+containerPosition.top,left:containerPosition.left}}else{firstRowHeaderPosition={top:2*rowHeight+this.grid().headersTable().find("tr[data-mch-level]").length*this.grid().headersTable().find("tr[data-mch-level]").eq(0).height()+containerPosition.top,left:containerPosition.left}}}if(this.options.height!==null||this.options.width!==null){columnsOverlayTop=firstColumnHeaderPosition.top+containerPosition.top+2*parseInt(containerParent.css("paddingTop")[0].replace("px",""),10);columnsOverlayLeft=firstColumnHeaderPosition.left+containerPosition.left;rowsOverlayTop=firstRowHeaderPosition.top+2*parseInt(containerParent.css("paddingTop")[0].replace("px",""),10);rowsOverlayLeft=firstRowHeaderPosition.left}else{firstRowHeaderPosition=this.grid().headersTable().find("tbody tr:first").igPosition();columnsOverlayTop=firstColumnHeaderPosition.top+headersTable.parent().parent().igPosition().top;columnsOverlayLeft=firstColumnHeaderPosition.left+headersTable.parent().parent().igPosition().left;rowsOverlayTop=firstRowHeaderPosition.top+headersTable.parent().parent().igPosition().top;rowsOverlayLeft=firstRowHeaderPosition.left+headersTable.parent().parent().igPosition().left}if(this.options.hideRowsDropArea&&this.options.hideColumnsDropArea&&this.options.hideMeasuresDropArea&&this.options.hideFiltersDropArea){firstRow=headersTable.find("tr").eq(0).find("th")}else{firstRow=headersTable.find("tr").eq(1).find("th")}ht=firstRow.eq(1);if(headersTable[0].scrollWidth<=this.element.width()){columnHeadersWidth=ht.width()+2*(parseInt(ht.css("paddingLeft")[0].substr(0),10)+parseInt(ht.css("borderLeftWidth")[0].substr(0),10))}else{columnHeadersWidth=ht.width()+2*(parseInt(ht.css("paddingLeft")[0].substr(0),10)+parseInt(ht.css("borderLeftWidth")[0].substr(0),10))-(headersTable[0].scrollWidth-this.element.width())}measuresArea=firstRow.eq(0);dataTableHeight=this.element.height()-rowsOverlayTop>dataTable[0].scrollHeight?dataTable[0].scrollHeight:this.element.height()-headersTable.height();rowHeadersWidth=measuresArea.width()+2*(parseInt(measuresArea.css("paddingLeft")[0].replace("px",""),10)+parseInt(measuresArea.css("borderLeftWidth")[0].replace("px",""),10));if(headersTable[0].scrollWidth<=this.element.width()){measuresHeadersWidth=dataTable[0].scrollWidth-rowHeadersWidth}else{measuresHeadersWidth=dataTable[0].scrollWidth-rowHeadersWidth-(headersTable[0].scrollWidth-this.element.width())}absoluteOffset=this._calculateOffset(this.element);rowsProps={top:rowsOverlayTop+absoluteOffset.top,left:absoluteOffset.left,width:rowHeadersWidth,height:dataTableHeight};columnsProps={top:columnsOverlayTop+absoluteOffset.top,left:rowHeadersWidth+absoluteOffset.left,width:columnHeadersWidth,height:columnHeadersHeight};measuresProps={top:rowsOverlayTop+absoluteOffset.top,left:rowHeadersWidth+absoluteOffset.left,width:measuresHeadersWidth,height:dataTableHeight};$("#"+id+"_rows_overlay").css(rowsProps);$("#"+id+"_columns_overlay").css(columnsProps);$("#"+id+"_measures_overlay").css(measuresProps);headersTable.parent().parent().on("scroll",{table:headersTable,id:id,rowHeadersWidth:rowHeadersWidth,columnHeadersWidth:columnHeadersWidth,rowsOverlayLeft:rowsOverlayLeft,measuresHeadersWidth:measuresHeadersWidth,columnsOverlayLeft:columnsOverlayLeft},this._handlePivotGridScrolling)},_calculateOffset:function(jQueryObj){var el=jQueryObj,offset={top:0,left:el.igOffset().left};while(el[0].tagName&&el.scrollParent()[0].firstChild.name!=="html"){offset.top+=el.scrollParent().scrollTop();offset.left+=el.scrollParent().scrollLeft();el=el.scrollParent()}return offset},_handlePivotGridScrolling:function(evt){var scrollTable=evt.data.table.parent().parent(),id=evt.data.id,offset=scrollTable.scrollLeft(),rowHeadersWidth=evt.data.rowHeadersWidth,columnHeadersWidth=evt.data.columnHeadersWidth,rowsOverlayLeft=evt.data.rowsOverlayLeft,measuresHeadersWidth=evt.data.measuresHeadersWidth,columnsOverlayLeft=evt.data.columnsOverlayLeft;$("#"+id+"_columns_overlay").css({left:columnsOverlayLeft-(rowHeadersWidth>offset?offset:rowHeadersWidth),width:rowHeadersWidth>offset?columnHeadersWidth+offset:scrollTable.width()});$("#"+id+"_rows_overlay").css({width:rowHeadersWidth-offset});$("#"+id+"_measures_overlay").css({left:rowsOverlayLeft+rowHeadersWidth-(rowHeadersWidth>offset?offset:rowHeadersWidth),width:rowHeadersWidth>offset?measuresHeadersWidth+offset:scrollTable.width()})},_updateDataSource:function(deferUpdateOverride){this._updateGrid(false,deferUpdateOverride)},_shouldAppendToTarget:function(target,dragged){return target.igOffset().left+target.width()/2<dragged.offset.left+this._const.dragCursorAt.left},_onToggleTupleMember:function(evt){var $this=this,target=$(evt.target),header=target.closest("th"),axisName,memberIndex,tupleIndex,expand,noCancel;if(!(this._ds.dataSource().measures().inner().count()>1&&this.options.rowHeadersLayout==="tree"&&this._ds.dataSource().measureListLocation()===0)&&(this._performsToggle||this._ds.isModified())){return}axisName=header.attr("data-axis");memberIndex=parseInt(header.attr("data-member"),10);tupleIndex=parseInt(header.attr("data-tuple"),10);expand=target.attr("data-expand")==="true";if($this.options.rowHeadersLayout==="tree"&&target.attr("data-item-expand")){expand=target.attr("data-item-expand")==="true";memberIndex+=1}if(expand){noCancel=this._triggerTupleMemberExpanding(evt,axisName,memberIndex,tupleIndex);if(noCancel){this._showLoadingIndicator();setTimeout(function(){$this._ds.expandTupleMember(axisName,tupleIndex,memberIndex);$this._performsToggle=true;$this._updateGrid(false,true).done(function(){$this._triggerTupleMemberExpanded(null,axisName,memberIndex,tupleIndex)}).always(function(){$this._performsToggle=false})})}}else{noCancel=this._triggerTupleMemberCollapsing(evt,axisName,memberIndex,tupleIndex);if(noCancel){this._ds.collapseTupleMember(axisName,tupleIndex,memberIndex);this._performsToggle=true;this._updateGrid(false,true).done(function(){$this._triggerTupleMemberCollapsed(evt,axisName,memberIndex,tupleIndex)}).always(function(){$this._performsToggle=false})}}},_onSort:function(evt){var $this=this,header=$(evt.target).closest("th"),axisName,tupleIndex,tupleIdentifier,axis,axes,tuple,memberNames,columnSortDirections,columnSortDirection,levelSortDirections,options,i,noCancel,en;if(this._ds.isModified()){return}axisName=header.attr("data-axis");tupleIndex=parseInt(header.attr("data-tuple"),10);if(axisName!==this._const.emptyCell.axisName){axes=this._ds.result().axes().__inner;for(i=0;i<axes.length;i++){if(axisName===axes[i].name()){axis=axes[i];break}}if(!axis){return}tuple=axis.tuples().item(tupleIndex);memberNames=[];en=tuple.members().getEnumerator();while(en.moveNext()){memberNames.push(en.current().uniqueName())}tupleIdentifier=memberNames.join("|")}else{memberNames=null;tupleIdentifier=""}columnSortDirections=this._tableView.columnSortDirections();for(i=0;i<columnSortDirections.length;i++){if(columnSortDirections[i].memberNames&&columnSortDirections[i].memberNames.join("|")===tupleIdentifier||columnSortDirections[i].tupleIndex===tupleIndex){columnSortDirection=columnSortDirections[i];break}}if(!evt.ctrlKey){columnSortDirections=[]}if(columnSortDirection){columnSortDirection.sortDirection=columnSortDirection.sortDirection==="ascending"?"descending":"ascending";if(!evt.ctrlKey){columnSortDirections.push(columnSortDirection)}}else{columnSortDirection={memberNames:memberNames,tupleIndex:tupleIndex,sortDirection:this.options.firstSortDirection};columnSortDirections.push(columnSortDirection)}noCancel=this._triggerSorting(evt,columnSortDirections);if(noCancel){levelSortDirections=$.grep(this._tableView.levelSortDirections(),function(sortDirection){var level,hierarchyName;level=$this._ds.getCoreElement(function(l){return l.uniqueName()===sortDirection.levelUniqueName},$.ig.Level.prototype.getType());if(level){hierarchyName=level.hierarchyUniqueName();return $.grep($this._ds.rowAxis(),function(h){return h.uniqueName()===hierarchyName}).length===0}return false});this._tableView.levelSortDirections(levelSortDirections);this._tableView.columnSortDirections(columnSortDirections);this._tableView.initialize();options=this._configureOptions(this._ds);this._renderGrid(options);this._triggerSorted(evt,columnSortDirections,this._tableView.appliedColumnSortDirections())}},_onSortHeader:function(evt){var header=$(evt.target).closest("th"),axisName,tupleIndex,memberIndex,axis,axes,tuple,member,level,levelName,hierarchyName,levelSortDirections,levelSortDirection,options,i,noCancel;if(this._ds.isModified()){return}axisName=header.attr("data-axis");tupleIndex=parseInt(header.attr("data-tuple"),10);memberIndex=parseInt(header.attr("data-member"),10);if(!header.hasClass("ui-iggrid-multiheader-cell")&&this.options.rowHeadersLayout==="tree"&&($(evt.target).hasClass("ui-iggrid-headertext")||$(evt.target).attr("data-sortheader"))){memberIndex+=1}axes=this._ds.result().axes().__inner;for(i=0;i<axes.length;i++){if(axisName===axes[i].name()){axis=axes[i];break}}if(!axis){return}tuple=axis.tuples().item(tupleIndex);member=tuple.members().item(memberIndex);level=this._ds.getCoreElement(function(l){return l.hierarchyUniqueName()===member.hierarchyUniqueName()&&l.depth()===member.depth()+1},$.ig.Level.prototype.getType());if(!level){return}levelName=level.uniqueName();levelSortDirections=this._tableView.appliedLevelSortDirections();for(i=0;i<levelSortDirections.length;i++){if(levelSortDirections[i].levelUniqueName===levelName){levelSortDirection=levelSortDirections[i];break}}if(levelSortDirection){levelSortDirection.sortDirection=levelSortDirection.sortDirection==="ascending"?"descending":"ascending"}else{levelSortDirection={levelUniqueName:levelName,sortBehavior:this.options.defaultLevelSortBehavior,sortDirection:this.options.firstLevelSortDirection};levelSortDirections.push(levelSortDirection)}noCancel=this._triggerHeadersSorting(evt,levelSortDirections);
if(noCancel){hierarchyName=level.hierarchyUniqueName();if($.grep(this._ds.rowAxis(),function(h){return h.uniqueName()===hierarchyName}).length>0){this._tableView.columnSortDirections([])}this._tableView.levelSortDirections(levelSortDirections);this._tableView.initialize();options=this._configureOptions(this._ds);this._renderGrid(options);this._triggerHeadersSorted(evt,levelSortDirections,this._tableView.appliedLevelSortDirections())}},expandTupleMember:function(tupleLocation,tupleIndex,memberIndex,shouldUpdate){var dataSource=this._ds,hasColumns,hasRows,axisName;hasColumns=dataSource.columnAxis().length>0;hasRows=dataSource.rowAxis().length>0;if(this._ds.isModified()){return false}if(tupleLocation==="columnAxis"&&hasColumns){if(hasColumns){axisName="Axis0"}}else if(tupleLocation==="rowAxis"&&hasRows){if(hasColumns){axisName="Axis1"}else{axisName="Axis0"}}if(!axisName){throw new Error(this._getLocaleValue("noSuchAxis"))}this._ds.expandTupleMember(axisName,tupleIndex,memberIndex);if(shouldUpdate){this._updateGrid(null,true)}},collapseTupleMember:function(tupleLocation,tupleIndex,memberIndex,shouldUpdate){var dataSource=this._ds,hasColumns,hasRows,axisName;hasColumns=dataSource.columnAxis().length>0;hasRows=dataSource.rowAxis().length>0;if(this._ds.isModified()){return false}if(tupleLocation==="columnAxis"&&hasColumns){if(hasColumns){axisName="Axis0"}}else if(tupleLocation==="rowAxis"&&hasRows){if(hasColumns){axisName="Axis1"}else{axisName="Axis0"}}if(!axisName){throw new Error(this._getLocaleValue("noSuchAxis"))}this._ds.collapseTupleMember(axisName,tupleIndex,memberIndex);if(shouldUpdate){this._updateGrid()}},appliedColumnSortDirections:function(){return this._tableView?this._tableView.appliedColumnSortDirections():[]},appliedLevelSortDirections:function(){return this._tableView?this._tableView.appliedLevelSortDirections():[]},destroy:function(){var grid=this.grid();if(grid){grid.destroy()}$("#"+this.element.attr("id")+"_container_block").remove();this.element.removeClass(this.css.pivotGrid);$(this._ds).unbind("initialized.pivotgrid"+this.timestamp);$(this._ds).unbind("updated.pivotgrid"+this.timestamp);this._superApply(arguments)},_triggerPivotGridHeadersRendered:function(evt,ui){var args={owner:this,grid:ui.owner,table:ui.table};this._trigger("pivotGridHeadersRendered",evt,args)},_triggerPivotGridRendered:function(evt,ui){var args={owner:this,grid:ui.owner};this._trigger("pivotGridRendered",evt,args)},_triggerTupleMemberExpanding:function(evt,axisName,memberIndex,tupleIndex){var args={owner:this,dataSource:this._ds,axisName:axisName,memberIndex:memberIndex,tupleIndex:tupleIndex};return this._trigger("tupleMemberExpanding",evt,args)},_triggerTupleMemberExpanded:function(evt,axisName,memberIndex,tupleIndex){var args={owner:this,dataSource:this._ds,axisName:axisName,memberIndex:memberIndex,tupleIndex:tupleIndex};this._trigger("tupleMemberExpanded",evt,args)},_triggerTupleMemberCollapsing:function(evt,axisName,memberIndex,tupleIndex){var args={owner:this,dataSource:this._ds,axisName:axisName,memberIndex:memberIndex,tupleIndex:tupleIndex};return this._trigger("tupleMemberCollapsing",evt,args)},_triggerTupleMemberCollapsed:function(evt,axisName,memberIndex,tupleIndex){var args={owner:this,dataSource:this._ds,axisName:axisName,memberIndex:memberIndex,tupleIndex:tupleIndex};this._trigger("tupleMemberCollapsed",evt,args)},_triggerSorting:function(evt,columnSortDirections){var args={owner:this,sortDirections:columnSortDirections};return this._trigger("sorting",evt,args)},_triggerSorted:function(evt,columnSortDirections,appliedColumnSortDirections){var args={owner:this,sortDirections:columnSortDirections,appliedSortDirections:appliedColumnSortDirections};this._trigger("sorted",evt,args)},_triggerHeadersSorting:function(evt,levelSortDirections){var args={owner:this,levelSortDirections:levelSortDirections};return this._trigger("headersSorting",evt,args)},_triggerHeadersSorted:function(evt,levelSortDirections,appliedLevelSortDirections){var args={owner:this,levelSortDirections:levelSortDirections,appliedLevelSortDirections:appliedLevelSortDirections};this._trigger("headersSorted",evt,args)}});$.extend(true,$.ui.igPivotGrid.prototype,$.ig.Pivot._pivotShared);$.extend($.ui.igPivotGrid,{version:"21.2.12"})})($);/*!@license
* Infragistics.Web.ClientUI Pivot View 21.2.12
*
* Copyright (c) 2011-2012 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on:
*	jquery-1.9.1.js
*	jquery.ui.core.js
*	jquery.ui.widget.js
*	jquery.ui.mouse.js
*	jquery.ui.draggable.js
*	jquery.ui.droppable.js
*	infragistics.util.js
*   infragistics.util.jquery.js
*	infragistics.ui.widget.js
*	infragistics.datasource.js
*	infragistics.olapxmladatasource.js
*	infragistics.olapflatdatasource.js
*	infragistics.ui.shared.js
*	infragistics.ui.scroll.js
*	infragistics.ui.splitter.js
*	infragistics.ui.tree.js
*	infragistics.ui.grid.framework.js
*	infragistics.ui.grid.multicolumnheaders.js
*	infragistics.ui.pivot.shared.js
*	infragistics.ui.pivotdataselector.js
*	infragistics.ui.pivotgrid.js
*/
(function($){var _igPivotGrid=$.ui.igPivotGrid.prototype.widgetFullName||$.ui.igPivotGrid.prototype.widgetName,_igPivotDataSelector=$.ui.igPivotDataSelector.prototype.widgetFullName||$.ui.igPivotDataSelector.prototype.widgetName,_igSplitter=$.ui.igSplitter.prototype.widgetFullName||$.ui.igSplitter.prototype.widgetName;$.widget("ui.igPivotView",$.ui.igWidget,{options:{width:null,height:null,dataSource:null,dataSourceOptions:{xmlaOptions:{serverUrl:null,catalog:null,cube:null,measureGroup:null,requestOptions:{withCredentials:false,beforeSend:null},enableResultCache:true,discoverProperties:null,executeProperties:null,mdxSettings:{nonEmptyOnRows:true,nonEmptyOnColumns:true,addCalculatedMembersOnRows:true,addCalculatedMembersOnColumns:true,dimensionPropertiesOnRows:[],dimensionPropertiesOnColumns:[]}},flatDataOptions:{dataSource:null,dataSourceUrl:null,dataSourceType:null,responseDataKey:null,responseDataType:null,metadata:{cube:{name:null,caption:null,measuresDimension:{name:null,caption:null,measures:[{name:null,caption:null,aggregator:null,displayFolder:null}]},dimensions:[{name:null,caption:null,hierarchies:[{name:null,caption:null,displayFolder:null,levels:[{name:null,caption:null,memberProvider:null}]}]}]}}},measures:null,filters:null,rows:null,columns:null},pivotGridOptions:{isParentInFrontForColumns:false,isParentInFrontForRows:true,compactColumnHeaders:false,rowHeadersLayout:"compact",compactColumnHeaderIndentation:30,compactRowHeaderIndentation:20,defaultRowHeaderWidth:200,allowSorting:false,firstSortDirection:"ascending",allowHeaderRowsSorting:false,allowHeaderColumnsSorting:false,levelSortDirections:[{levelUniqueName:null,sortDirection:null}],firstLevelSortDirection:"ascending",gridOptions:{defaultColumnWidth:null,fixedHeaders:true,caption:null,features:[],tabIndex:0,alternateRowStyles:true,enableHoverStyles:false},dragAndDropSettings:{appendTo:"body",containment:false,zIndex:10},dropDownParent:"body",disableRowsDropArea:false,disableColumnsDropArea:false,disableMeasuresDropArea:false,disableFiltersDropArea:false,hideRowsDropArea:false,hideColumnsDropArea:false,hideMeasuresDropArea:false,hideFiltersDropArea:false,customMoveValidation:null},dataSelectorOptions:{dragAndDropSettings:{appendTo:"body",containment:false,zIndex:10},dropDownParent:"body",customMoveValidation:null},pivotGridPanel:{resizable:true,collapsible:false,collapsed:false,size:null},dataSelectorPanel:{location:"right",resizable:true,collapsible:true,collapsed:false,size:250}},_create:function(){var $this=this,elementName,splitter,panel,pivotGrid,dataSelector,panels,dataSelectorLocation,dataSource;elementName=this.element[0].nodeName.toUpperCase();if(elementName!=="DIV"){throw new Error(elementName+this._getLocaleValue("invalidBaseElement"))}this.element.addClass("ui-igpivotview");if(this.options.width){this.element.width(this.options.width)}if(this.options.height){this.element.height(this.options.height)}dataSelectorLocation=this.options.dataSelectorPanel.location;splitter=$("<div></div>").appendTo(this.element);panel=$("<div></div>").appendTo(splitter);pivotGrid=$("<table></table>").attr("id",this.element.attr("id")+"_pivotGrid").appendTo(panel);panel=$("<div></div>")[dataSelectorLocation==="right"?"appendTo":"prependTo"](splitter);dataSelector=$("<div></div>").attr("id",this.element.attr("id")+"_dataSelector").appendTo(panel);panels=[this.options.pivotGridPanel,this.options.dataSelectorPanel];if(dataSelectorLocation!=="right"){panels.reverse()}dataSource=$.ig.Pivot._pivotShared._createDataSource(this.options.dataSource,this.options.dataSourceOptions);dataSelector.igPivotDataSelector($.extend(true,this.options.dataSelectorOptions,{dataSource:dataSource}));splitter.igSplitter({width:this.options.width||this.element.width(),height:this.options.height||this.element.height(),panels:panels}).bind("igsplitterresizeended igsplitterexpanded igsplittercollapsed",function(){$this._setSize()}).bind("igsplitterresizestarted",function(){$(".ui-igpivot-metadatadropdown,.ui-igpivot-filterdropdown").remove()});if($.ui.igSplitter.prototype.css.verticalPanel){$($.ui.igSplitter.prototype.css.verticalPanel.replace(/ui-/g,".ui-").replace(/ /g,"")).css("overflow","hidden")}pivotGrid.igPivotGrid($.extend(true,this.options.pivotGridOptions,{dataSource:dataSource,width:(dataSelectorLocation==="right"?splitter.igSplitter("firstPanel"):splitter.igSplitter("secondPanel")).width(),height:splitter.igSplitter("option","height")}));splitter.igSplitter("refreshLayout");this._setSize();dataSelector.bind("igpivotdataselectordeferupdatechanged",function(evt,ui){pivotGrid.igPivotGrid("option","deferUpdate",ui.deferUpdate)})},_setOption:function(key,value){switch(key){case"dataSource":this.options.dataSourceOptions=null;this.options.dataSource=$.ig.Pivot._pivotShared._createDataSource(value,null);this.dataSelector().option("dataSource",this.options.dataSource);this.pivotGrid().option("dataSource",this.options.dataSource);break;case"dataSourceOptions":this.options.dataSourceOptions=value;this.options.dataSource=$.ig.Pivot._pivotShared._createDataSource(null,value);this.dataSelector().option("dataSource",this.options.dataSource);this.pivotGrid().option("dataSource",this.options.dataSource);break;case"width":case"height":$.Widget.prototype._setOption.call(this,arguments);this.splitter().element[key](value);this._setSize();break}},_setSize:function(){var splitter=this.splitter(),pivotGrid=this.pivotGrid(),dataSelector=this.dataSelector(),height=this.element.height(),dataSelectorLocation,pivotGridPanelWidth,dataSelectorPanelWidth;dataSelectorLocation=this.options.dataSelectorPanel.location;if(dataSelectorLocation==="right"){pivotGridPanelWidth=splitter.firstPanel().width();dataSelectorPanelWidth=splitter.secondPanel().width()}else{pivotGridPanelWidth=splitter.secondPanel().width();dataSelectorPanelWidth=splitter.firstPanel().width()}pivotGrid.option("width",pivotGridPanelWidth);pivotGrid.option("height",height);dataSelector.option("width",dataSelectorPanelWidth);dataSelector.option("height",height)},pivotGrid:function(){try{return this.element.find(":ui-igPivotGrid").data(_igPivotGrid)}catch(e){if(e==="Syntax error, unrecognized expression: "+"Syntax error, unrecognized expression: ui-igPivotGrid"||e.message==="Syntax error, unrecognized expression: ui-igPivotGrid"){return this.element.find(":ui-igpivotgrid").data(_igPivotGrid)}throw e}},dataSelector:function(){try{return this.element.find(":ui-igPivotDataSelector").data(_igPivotDataSelector)}catch(e){if(e==="Syntax error, unrecognized expression:"+" Syntax error, unrecognized expression: ui-igPivotDataSelector"||e.message==="Syntax error, unrecognized expression: ui-igPivotDataSelector"){return this.element.find(":ui-igpivotdataselector").data(_igPivotDataSelector)}throw e}},splitter:function(){try{return this.element.find(":ui-igSplitter").data(_igSplitter)}catch(e){if(e==="Syntax error, unrecognized expression: "+"Syntax error, unrecognized expression: ui-igSplitter"||e.message==="Syntax error, unrecognized expression: ui-igSplitter"){return this.element.find(":ui-igsplitter").data(_igSplitter)}throw e}},destroy:function(){this.element.removeClass("ui-igpivotview");try{this.element.find(":ui-igPivotGrid").igPivotGrid("destroy");this.element.find(":ui-igPivotDataSelector").igPivotDataSelector("destroy");this.element.find(":ui-igSplitter").igSplitter("destroy").remove();this._superApply(arguments)}catch(e){if(typeof e==="string"){if(e.indexOf("unrecognized expression: ui-ig")!==-1){this.element.find(":ui-igpivotgrid").igPivotGrid("destroy");this.element.find(":ui-igpivotdataselector").igPivotDataSelector("destroy");this.element.find(":ui-igsplitter").igSplitter("destroy").remove();this._superApply(arguments);return}}else{if(e.message.indexOf("unrecognized expression: ui-ig")!==-1){this.element.find(":ui-igpivotgrid").igPivotGrid("destroy");this.element.find(":ui-igpivotdataselector").igPivotDataSelector("destroy");this.element.find(":ui-igsplitter").igSplitter("destroy").remove();this._superApply(arguments);return}}throw e}}});$.extend($.ui.igPivotView,{version:"21.2.12"})})($);/*!@license
* Infragistics.Web.ClientUI Editors 21.2.12
*
* Copyright (c) 2011-2022 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on:
* jquery.js
* jquery.ui.core.js
* jquery.ui.widget.js
* infragistics.util.js
* infragistics.util.jquery.js
* infragistics.ui.widget.js
* infragistics.ui.rating-en.js
*
* Example to use:
*	<script type="text/javascript">
*	$(function () {
*		$('#rating1').igRating({ voteCount:3, value:0.5, vertical:true });
*	});
*	</script>
*	<div id="rating1"></div>
*/
(function($){var _aNull=function(v){return v===null||v===undefined||typeof v==="number"&&isNaN(v)};$.widget("ui.igRating",$.ui.igWidget,{options:{vertical:false,value:null,valueHover:null,voteCount:5,voteWidth:0,voteHeight:0,swapDirection:false,valueAsPercent:true,focusable:true,precision:"whole",precisionZeroVote:.25,roundedDecimalPlaces:3,theme:null,validatorOptions:null,cssVotes:null},css:{normal:"ui-igrating ui-state-default ui-widget-content",active:"ui-igrating-active",selected:"ui-igrating-selected ui-state-highlight",hover:"ui-igrating-hover ui-state-hover",vote:"ui-igrating-vote ui-icon ui-icon-star",voteSelected:"ui-igrating-voteselected",voteDisabled:"ui-igrating-votedisabled ui-state-disabled",voteHover:"ui-igrating-votehover",voteDisabledSelected:"ui-igrating-votedisabledselected ui-state-disabled"},events:{hoverChange:"hoverChange",valueChange:"valueChange"},_create:function(){var inp,cont,elem,sto={fontSize:"1px",width:"100%",height:"100%",position:"relative",overflow:"hidden"},o=this.options,elem0=this.element,me=this,css=this.css,count=this._count(o),v=elem0[0].style,id=o.inputName;me._old={width:v.width,height:v.height,html:elem0[0].innerHTML};if(!id){elem0[0].innerHTML=""}if(o.theme){elem0.addClass(o.theme)}me._swap=o.swapDirection;me._rtl=elem0.css("direction")==="rtl";if(me._rtl){me._swap=!me._swap;elem0.css("direction","ltr")}me._hasHov=0;elem=me._elem=$("<div/>").css(sto).addClass(css.normal).appendTo(elem0).bind(me._evts={mousedown:function(e){me._doEvt(e,1)},mousemove:function(e){me._doEvt(e,2)},mouseleave:function(e){me._doEvt(e,3)}});cont=$("<div/>").css(sto).appendTo(elem);if(o.focusable){v={left:"5px",top:"5px",opacity:.1,position:"absolute",width:"1px",height:"1px",padding:"0px",zIndex:-1,border:"0px",outline:0};me._foc=$('<input type="button"/>').css(v).appendTo(cont).focus(function(evt){if(o.disabled||me._fcs){return}me._fcs=1;if(me._hasHov<2){me._hasHov+=2}if(me._hov){me._doVal(me._valH,1,evt);me._hov.css("visibility","visible")}me._elem.addClass(css.active)}).blur(function(e){if(o.disabled||!me._fcs){return}me._fcs=null;me._hasHov%=2;if(me._hov&&me._hasHov===0){me._hov.css("visibility","hidden")}me._elem.removeClass(css.active);if(me._validator){me._validator._validateInternal(me.element,e,true)}}).keydown(function(evt){var old,arrow=0,k=evt.keyCode,kc=$.ui.keyCode,val=me._valH,swap=me._swap?-1:1,vertical=o.vertical,d=1/me._count(o);if(o.disabled){return}old=val;d/=me._prec(o);if(k===kc.SPACE||k===kc.ENTER){me._doVal(val,false,evt);return}if(k===kc.HOME){val=0}else if(k===kc.END){val=1}else if(k===kc.PAGE_DOWN){val+=d*4}else if(k===kc.PAGE_UP){val-=d*4}else if(k===kc.UP&&vertical){val+=arrow=-d*swap}else if(k===kc.DOWN&&vertical){val+=arrow=d*swap}else if(k===kc.LEFT&&!vertical){val+=arrow=-d*swap}else if(k===kc.RIGHT&&!vertical){val+=arrow=d*swap}if(k>32&&k<41){try{evt.preventDefault();evt.stopPropagation()}catch(ex){}}for(k=0;k<3;k++){if(old!==(val=Math.max(Math.min(val,1),0))&&me._doVal(val,1,evt)&&arrow){val+=arrow}else{break}}})}me._doVotes(o,cont);if(id){inp=$('input[name="'+id+'"]');if(inp.length<=0){inp=$("#"+id)}v=inp[0]?inp[0].value:null;if(v){o.value=me._toNum(v,o)}}me._val=me._toNum(o.value,o);v=o.valueHover;me._valH=_aNull(v)?me._val:me._toNum(v,o);if(!o.valueAsPercent){me._val/=count;me._valH/=count}me.validator();me._set=true;me._doVal(me._val,null,inp?2:inp);me._doVal(me._valH,1);delete me._set},_toNum:function(v,o){if(!v){return 0}o=o._vsFormat;if(typeof v==="string"){v=parseFloat(o?v.replace(o,"_").replace(/[`,\. \':]/g,"").replace("_","."):v)}return isNaN(v)||v<0?0:v},_count:function(o){o=parseInt(o.voteCount,10);return isNaN(o)?5:Math.max(o,1)},_doVotes:function(o,cont){var hov,sel,cssV,height,width,div,span,cssi,val=cont,count=this._count(o),sto={width:"100%",height:"100%"},abs={left:"0px",top:"0px",position:"absolute",overflow:"hidden",border:"none",background:"none"},i=-1,me=this,css=this.css,elem=this._elem,elem0=this.element,touch={touchstart:function(e){e.preventDefault();$(this).trigger("mousedown")}};if(!cont){cont=me._div.parent();me._div.remove();me._hov.remove();me._sel.remove();me._selSwap=me._hovSwap=null}div=me._div=$("<div/>").addClass(css.vote).css(abs).appendTo(cont);if(!o.vertical){div.css("whiteSpace","nowrap")}height=parseInt(o.voteHeight,10);width=parseInt(o.voteWidth,10);if(isNaN(height)||height<2){height=div.css("height");height=!height||height.indexOf("px")<1?16:parseInt(height,10)}if(isNaN(width)||width<2){width=div.css("width");width=!width||width.indexOf("px")<1?16:parseInt(width,10)}div.removeClass(css.vote);sel=me._sel=$("<div/>").addClass(css.selected).css(sto).css(abs).appendTo(cont);if(!o.vertical){sel.css("whiteSpace","nowrap")}hov=me._hov=$("<div/>").addClass(css.hover).css(sto).css(abs).css("visibility","hidden").appendTo(cont);if(!o.vertical){hov.css("whiteSpace","nowrap")}if(me._swap&&!o.vertical){me._hovSwap=hov=$("<div/>").css(sto).appendTo(me._hov);me._selSwap=sel=$("<div/>").css(sto).appendTo(me._sel)}cssV={display:o.vertical?"block":"inline-block",width:width,height:height,textIndent:"0px",overflow:"visible"};while(++i<count){span=$("<span />").addClass(css.vote).css(cssV).appendTo(div).bind(touch);if(o.disabled){span.addClass(css.voteDisabled)}cssi=o.cssVotes?o.cssVotes[i]:null;if(cssi&&cssi[0]){span.addClass(cssi[0])}span[0]._i=i;span=$("<span />").addClass(css.vote).addClass(css.voteSelected).css(cssV).appendTo(sel).bind(touch);if(o.disabled){span.addClass(css.voteDisabledSelected)}if(cssi&&cssi[1]){span.addClass(cssi[1])}span[0]._i=i;if(me._swap&&!me._selSwap){me._selSwap=span}span=$("<span />").addClass(css.vote).addClass(css.voteHover).css(cssV).appendTo(hov).bind(touch);if(cssi&&cssi[2]){span.addClass(cssi[2])}span[0]._i=i;if(me._swap&&!me._hovSwap){me._hovSwap=span}}if(o.vertical){me._size=height;height*=count}else{me._size=width;width*=count}elem.css({height:height+"px",width:width+"px"});try{height+=(i=Math.max(elem.outerHeight()-elem.innerHeight(),0))>10?2:i;width+=(i=Math.max(elem.outerWidth()-elem.innerWidth(),0))>10?2:i}catch(ex){}elem0.css({height:height+"px",width:width+"px"});div.css(sto);if(!val){me.value(me.value())}},validator:function(destroy){var o=this.options.validatorOptions,v=this._validator;if(v&&v.owner===this&&(destroy||!o)){v.destroy();delete this._validator}else if(!v&&!destroy&&o&&this.element.igValidator){this._validator=this.element.igValidator(o).data("igValidator");this._validator.owner=this}else if(v&&!destroy&&o&&this.element.igValidator){this._validator=this.element.igValidator(o).data("igValidator")}return this._validator},validate:function(){return this._validator?this._validator.validate():null},_doEvt:function(evt,type){var val,me=this,o=this.options;if(o.disabled){return}if(type===3){me._hasHov-=me._hasHov%2;if(me._hov&&me._hasHov===0){me._hov[0].style.visibility="hidden"}return}val=me._valFromEvt(evt);if(val<0){return}if(type===1){if(!me._sel){return}val=me._lastHov||val;me._doVal(val,false,evt);me._doVal(val,1,evt);if(me._foc&&document.hasFocus&&!document.hasFocus()){return setTimeout(function(){me.focus()},0)}me.focus()}if(type===2){me._lastHov=val;if(!me._hov){return}if(me._hasHov%2===0){me._hasHov++}me._hov[0].style.visibility="visible";me._doVal(val,1,evt)}evt.preventDefault()},_setOption:function(key,val){var spans,count,css,o=this.options;if(o[key]===val){return this}if(key==="swapDirection"||key==="vertical"||key==="focusable"){throw new Error(this._getLocaleValue("setOptionError")+key)}count=this._count(o);if(key==="disabled"){spans=$("SPAN",this._div);css=this.css.voteDisabled;if(spans.length!==count){return this}if(val){spans.addClass(css)}else{spans.removeClass(css)}spans=$("SPAN",this._sel);css=this.css.voteDisabledSelected;if(spans.length!==count&&this._selSwap){spans=$("SPAN",this._selSwap)}if(spans.length===count){if(val){spans.addClass(css)}else{spans.removeClass(css)}}}if(key==="theme"){if(o.theme){this.element.removeClass(o.theme)}if(val){this.element.addClass(val)}}o[key]=val;if(typeof val==="function"){return this}this._set=true;if(key==="precision"||key==="valueAsPercent"){this._doVal(this._val,false,1);this._doVal(this._valH,1,1)}if(key.indexOf("vote")===0||key==="theme"||key==="cssVotes"){this._doVotes(o)}if(key.indexOf("value")>=0){this._doVal(val,key.length>6,1,1)}if(key==="validatorOptions"){this.validator()}delete this._set;return this},_evtOffset:function(evt,xy){var val,oEvt=evt.originalEvent||evt,offset="offset"+xy;if(_aNull(val=evt[offset])){if(_aNull(val=oEvt[offset])){if(_aNull(val=evt[offset="layer"+xy])){val=oEvt[offset]}}}return val||1},_valFromEvt:function(evt){var plus,val,offset,i,o=this.options,targ=evt?evt.target:null;i=targ&&targ.nodeName==="SPAN"?targ._i:null;if(_aNull(i)){return-1}if(!targ.unselectable){targ.unselectable="on"}offset=this._evtOffset(evt,o.vertical?"Y":"X");plus=this._size;plus*=i;if(plus>offset){offset+=plus}val=offset/this._count(o)/this._size;if(this._swap){val=1-val}return Math.max(Math.min(val,1),0)},_doVal:function(val,hov,evt,v0){var id,inp,v1,count,o=this.options,style=hov?this._hov:this._sel,size=this._size,swap=this._swap?hov?this._hovSwap:this._selSwap:null;if(style){style=style[0];if(style){style=style.style}}if(!style){return}count=this._count(o);if(v0){val=parseFloat(val)}if(isNaN(val)){val=-1}else if(v0&&!o.valueAsPercent){val/=count}if(evt&&evt.type&&val>=0){v0=this._fixVal(hov?this._valH:this._val,1);v1=this._fixVal(val,1);if(v0===v1){return 1}if(!this._trigger(hov?"hoverChange":"valueChange",evt,{value:v1,oldValue:v0})){return}}if(val<0&&hov){val=this._val}val=this._fixVal(val);if(evt){v0=this._round(o.valueAsPercent?val:val*count,o);if(hov){this._valH=val;o.valueHover=v0}else{if(evt!==2){this._val=val;o.value=v0;if(this._validator){this._validator._validateInternal(this.element,evt)}}id=o.inputName;if(id){inp=$('input[name="'+id+'"]');if(inp.length===0){inp=$('<input type="hidden" name="'+id+'" />').appendTo(this.element.parent())}v1=o._vsFormat;inp.val(v1?v0.toString().replace(".",v1):v0)}}}if(!hov&&this._foc){this._foc.val(this._fixVal(val,1))}if(swap){val=1-val}val=Math.floor(val*size*count+.3);val+="px";if(swap){swap=swap[0];if(swap){swap=swap.style}}if(o.vertical){if(swap){style.top=val;swap.marginTop="-"+val}else{style.height=val}}else{if(swap){style.left=val;swap.marginLeft="-"+val}else{style.width=val}}},_prec:function(o){o=this._set?null:o.precision;if(o){o=o.toLowerCase()}return o==="half"?2:o==="whole"?1:4},_fixVal:function(val,full,prec){var fix,count,o=this.options;prec=prec||this._prec(o);count=this._count(o);val=Math.max(Math.min(val,1),0);if(prec<4){fix=count*prec;val*=fix;val=val<o.precisionZeroVote?0:Math.floor(Math.floor(val+.99)+.499*prec)/fix}if(!full){return val}if(!o.valueAsPercent){val*=count;val=prec>1?val:Math.floor(val+.1)}return this._round(val,o)},_round:function(val,o){var pow=1,fix=parseInt(o.roundedDecimalPlaces,10);if(isNaN(fix)||fix<0){return val}fix=Math.min(15,Math.max(fix,this._prec(o)<4?3:o.valueAsPercent?1:0));while(fix-- >0){pow*=10}return Math.round(val*pow)/pow},value:function(val){if(typeof val!=="number"){return this._fixVal(this._val,1,4)}this._set=true;this._doVal(val,false,1,1);delete this._set;return this},valueHover:function(val){if(typeof val!=="number"){return this._fixVal(this._valH,1,4)}this._set=true;this._doVal(val,1,1,1);delete this._set;return this},hasFocus:function(){return this._fcs===1},focus:function(){if(this._foc){try{this._foc[0].focus()}catch(ex){}}return this},destroy:function(){var o=this.options,old=this._old,e=this.element;if(!this._elem){return this}this.validator(1);if(this._foc){this._foc.unbind().remove()}this._elem.remove();if(o.theme){e.removeClass(o.theme)}e[0].style.width=old.width;e[0].style.height=old.height;if(!o.inputName){e[0].innerHTML=old.html}if(this._rtl){e.css("direction","rtl")}this._superApply(arguments);this._elem=this._hov=this._sel=this._selSwap=this._hovSwap=this._foc=this._evts=null;return this}});$.extend($.ui.igRating,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI ToolbarButton 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.util.js
 *  infragistics.util.jquery.js
 *	infragistics.ui.shared.js
 */
(function($){$.widget("ui.igToolbarButton",$.ui.igButton,{options:{allowToggling:true,isSelected:false},css:{toolbarButtonWidget:"ui-igtoolbarbutton"},events:{activating:"activating",activated:"activated",deactivating:"deactivating",deactivated:"deactivated"},_setOption:function(option,value){if(this.options[option]===value){return}$.ui.igButton.prototype._setOption.apply(this,arguments)},_create:function(){$.ui.igButton.prototype._create.apply(this);this._setupElement();this._attachToolbarBtnEvents()},_setupElement:function(){this.element.addClass(this.css.toolbarButtonWidget).attr("tabindex","1");if(this.options.isSelected){this.element.addClass(this.options.css.buttonActiveClasses)}},_onBlur:function(event){var noCancel,o=this.options;if(!o.disabled){noCancel=this._trigger("blur",event);if(noCancel){this.element.removeClass(o.css.buttonFocusClasses);if(!o.allowToggling){this.element.removeClass(o.css.buttonActiveClasses)}}}},_onMouseDown:function(event){var noCancel,e=this.element,o=this.options;if(!o.disabled){noCancel=this._trigger("mousedown",event);if(noCancel){e.removeClass(o.css.buttonHoverClasses);if(!o.allowToggling){e.addClass(o.css.buttonActiveClasses)}}}},_onMouseUp:function(event){var noCancel,o=this.options;if(!o.disabled){noCancel=this._trigger("mouseup",event);if(noCancel){this.element.removeClass(o.css.buttonHoverClasses);if(!o.allowToggling){this.element.removeClass(o.css.buttonActiveClasses)}}}},_onEnterKey:function(e){if(e.keyCode!==$.ui.keyCode.ENTER){return}this.element.mousedown()},_triggerActivating:function(event){var args={owner:this};return this._trigger(this.events.activating,event,args)},_triggerActivated:function(event){var args={owner:this};return this._trigger(this.events.activated,event,args)},_triggerDeactivating:function(event){var args={owner:this};return this._trigger(this.events.deactivating,event,args)},_triggerDeactivated:function(event){var args={owner:this};return this._trigger(this.events.deactivated,event,args)},_attachToolbarBtnEvents:function(){var noCancel,o=this.options,self=this;this.element.click(function(e){if(o.allowToggling){if(o.isSelected){noCancel=self._triggerDeactivating(e);if(noCancel){self.deactivate(e);self.element.addClass(o.css.buttonHoverClasses)}}else{noCancel=self._triggerActivating(e);if(noCancel){self.activate(e)}}}});this.element.on("keypress",$.proxy(this._onEnterKey,this))},toggle:function(){var o=this.options;if(o.disabled===true||o.allowToggling===false){return}o.isSelected=!o.isSelected;this.element.toggleClass(o.css.buttonActiveClasses)},activate:function(event){var o=this.options;if(o.disabled===true||o.allowToggling===false){return}o.isSelected=true;this.element.addClass(o.css.buttonActiveClasses);if(event){this._triggerActivated(event)}},deactivate:function(event){var o=this.options;if(o.disabled===true||o.allowToggling===false){return}o.isSelected=false;this.element.removeClass(o.css.buttonActiveClasses).removeClass(o.css.buttonFocusClasses);if(event){this._triggerDeactivated(event)}},widget:function(){return this.element},destroy:function(){$.ui.igButton.prototype.destroy.call(this);this.element.off().removeClass("")}});$.extend($.ui.igToolbarButton,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI ColorPicker 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 * <Licensing info>
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *   jquery.js
 *   jquery.ui.core.js
 *   jquery.ui.widget.js
 *	 infragistics.util.js
 *   infragistics.util.jquery.js
 *   infragistics.ui.shared.js
 */
(function($){$.widget("ui.igColorPicker",{options:{colors:[["#ffffff","#000000","#EEECE1","#1F497D","#4F81BD","#C0504D","#9BBB59","#8064A2","#4BACC6","#F79646"],["#F2F2F2","#7F7F7F","#DDD9C3","#C6D9F0","#DBE5F1","#F2DCDB","#EBF1DD","#E5E0EC","#DBEEF3","#FDEADA"],["#D8D8D8","#595959","#C4BD97","#8DB3E2","#B8CCE4","#E5B9B7","#D7E3BC","#CCC1D9","#B7DDE8","#FAC08F"],["#BFBFBF","#3F3F3F","#938953","#548DD4","#95B3D7","#D99694","#C3D69B","#B2A1C7","#92CDDC","#FAC08F"],["#A5A5A5","#262626","#494429","#17365D","#366092","#953734","#76923C","#5F497A","#31859B","#E36C09"],["#7F7F7F","#0C0C0C","#1D1B10","#0F243E","#244061","#632423","#4F6128","#3F3151","#205867","#974806"]],standardColors:["#C00000","#FF0000","#FFC000","#FFFF00","#92D050","#00B050","#00B0F0","#0070C0","#002060","#7030A0"]},events:{colorSelected:"colorSelected"},css:{standardColorsRow:"ui-colorpicker-standardcolors",baseClass:"ui-igColorPicker",colorTable:"igColorPicker-table",customColors:"igColorPicker-customColors",defaultColors:"ui-colorpicker-standardcolors",colorsRow:"igColorPicker-row",colorpickerColor:"igColorPicker-color"},_create:function(){this._colorTable=$("<div>");this._colorTable.addClass(this.css.colorTable);this._colorTable.appendTo(this.element);this._addOrChangeColors();this._addOrChangeStandardColors()},_addOrChangeColors:function(){var colsLength,row,col,colors=this.options.colors,rowsLength=colors.length,customColorsHtml="";if(this._customColors&&this._customColors.length>0){this._customColors.html("")}else{this._customColors=$("<div>").addClass(this.css.customColors);this._customColors.appendTo(this._colorTable)}for(row=0;row<rowsLength;row++){customColorsHtml+="<div class= "+this.css.colorsRow+">";colsLength=colors[row].length;for(col=0;col<colsLength;col++){customColorsHtml+="<div class="+this.css.colorpickerColor+' style="background-color: '+colors[row][col]+';"></div>'}customColorsHtml+="</div>"}this._customColors.html(customColorsHtml)},_addOrChangeStandardColors:function(){var item,colors=this.options.standardColors,defaultColorsHtml="";if(this._defaultColors&&this._defaultColors.length>0){this._defaultColors.html("")}else{this._defaultColors=$("<div>").addClass(this.css.defaultColors);this._defaultColors.appendTo(this._colorTable)}for(item=0;item<colors.length;item++){defaultColorsHtml+="<div class="+this.css.colorpickerColor+' style="background-color: '+colors[item]+';"></div>'}this._defaultColors.html(defaultColorsHtml)},_init:function(){this.element.addClass(this.css.baseClass);this._bindEvents()},_bindEvents:function(){var self=this;this._colorTable.delegate("."+this.css.colorpickerColor,"click",function(e){var target=$(e.target);e.preventDefault();self._changeSelectedColor(target);self._trigger(self.events.colorSelected,e,{color:self.colorFromElement(target)})})},_changeSelectedColor:function(target){this._colorTable.find("div.selected-color").removeClass("selected-color");target.addClass("selected-color")},_setOption:function(key,value){if(this.options[key]===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(key){case"standardColors":this._addOrChangeStandardColors();break;case"colors":this._addOrChangeColors();break}},colorTable:function(){return this._colorTable},customColorTable:function(){return this._customColors},standardColorsTable:function(){return this._defaultColors},colorFromElement:function($element){return $element.css("background-color")},selectedColor:function(){var selected=this._colorTable.find("div.selected-color");if(selected.length){return $.ig.util.rgbToHex(selected.css("background-color"))}return null},selectColor:function(color){var matching=this._colorTable.find("div").filter(function(index,item){var hexColor=$.ig.util.rgbToHex(item.style.backgroundColor);return hexColor&&hexColor===color.toLowerCase()});this._changeSelectedColor(matching)}});$.extend($.ui.igColorPicker,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI ColorPickerSplitButton 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 * <Licensing info>
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *   jquery.js
 *   jquery.ui.core.js
 *   jquery.ui.widget.js
 *   infragistics.util.js
 *   infragistics.util.jquery.js
 *   infragistics.ui.shared.js
 *   infragistics.ui.popover.js
 *   infragistics.ui.toolbarbutton.js
 *   infragistics.ui.splitbutton.js
 *   infragistics.ui.colorpicker.js
 */
(function($){$.widget("ui.igColorPickerSplitButton",$.ui.igSplitButton,{options:{items:[],defaultColor:"#000",hasDefaultIcon:true},_create:function(){$.ui.igSplitButton.prototype._create.call(this);this._setButtonColorIndicator(this.options.defaultColor)},_createItemsList:function(){var popoverCont,popoverOptions;this._options.popover=$('<div id="'+this._id("_popover")+'"></div>').appendTo(this.element);if($.ig.util.isTouchDevice()||$("html").hasClass("touch")){popoverOptions={direction:"bottom",closeOnBlur:false,width:480,height:360,maxWidth:480,maxHeight:360,defaultMaxWidth:null}}else{popoverOptions={direction:"bottom",closeOnBlur:false,width:220,defaultMaxWidth:null}}this._options.popover.igPopover(popoverOptions);popoverCont=this._options.popover.igPopover("container");this._options.itemsList=popoverCont.igColorPicker()},_attachEvents:function(){$.ui.igSplitButton.prototype._attachEvents.call(this);this._options.itemsList.on("igcolorpickercolorselected",$.proxy(this._onColorSelect,this));this._options.defaultButton.on("igtoolbarbuttonclick",$.proxy(this._onDefaultButtonClick,this));this._options.itemsList.parent().parent().on("mousedown",$.proxy(this._preventCollapsing,this))},_onItemClick:function(){return false},_onColorSelect:function(e,ui){this._setButtonColorIndicator(ui.color);this.options.defaultColor=ui.color;this._trigger("colorSelected",e,{value:ui.color,item:this.element});this.collapse()},_onDefaultButtonClick:function(e){e.stopPropagation();this._trigger("colorSelected",e,{value:this.options.defaultColor,item:this.element})},_setButtonColorIndicator:function(color){this._options.defaultButton.children(":first").css("border-bottom-color",color);if(!this.options.hasDefaultIcon){this._options.defaultButton.children(":first").css("background-color",color);this._options.defaultButton.children(":first").css("background-image","none")}},_preventCollapsing:function(){return false},_setOption:function(key,value){var options=this.options,self=this;if(options[key]===value){return}$.Widget.prototype._setOption.apply(this,arguments);switch(key){case"defaultColor":self.setColor(value);break}},setColor:function(color){this._options.itemsList.igColorPicker("selectColor",color);this._setButtonColorIndicator(color);this.options.defaultColor=color;this.collapse()},collapse:function(e){var _opt=this._options;_opt.popover.igPopover("hide");this.element.removeClass(this.css.active);_opt.expandButton.removeClass(this.css.focus);_opt.isExpanded=false;if(e){this._triggerCollapsed(e)}},expand:function(e){var _opt=this._options;_opt.popover.igPopover("show",this.element);this.element.addClass(this.css.active);_opt.isExpanded=true;if(e){this._triggerExpanded(e)}},destroy:function(){$.ui.igSplitButton.prototype.destroy.apply(this,arguments)}});$.extend($.ui.igColorPickerSplitButton,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI Toolbar 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 * <Licensing info>
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *   jquery.js
 *   jquery.ui.core.js
 *   jquery.ui.widget.js
 *   infragistics.util.js
 *   infragistics.util.jquery.js
 *   infragistics.ui.shared.js
 *   infragistics.ui.widget.js
 *   infragistics.ui.popover.js
 *   infragistics.ui.toolbarbutton.js
 *   infragistics.ui.splitbutton.js
 *   infragistics.ui.colorpicker.js
 *   infragistics.ui.colorpickersplitbutton.js
 *   infragistics.ui.combo.js
 */
(function($){$.ig=$.ig||{};$.ig.igToolbarItemBaseDescriptor=Class.extend({settings:{width:null,height:null,props:{scope:{value:null}}},_updatedProperties:[],init:function(item){this.settings=$.extend(true,{},this.settings,item);this.name=item.name;this.type=item.type;if(this.settings.scope){this.settings.props.scope=this.settings.scope}},updateProperty:function(name,value){this.settings.props[name].value=value;this._updatedProperties.push(this.settings.props[name])},getProperty:function(name){return this.settings.props[name]},getUpdatedProperties:function(){return this._updatedProperties},getProperties:function(){return this.settings.props},getLocaleProperties:function(){return this.settings.localeProperties},callbackRenderer:function(){if(this.settings.callbackRenderer&&$.isFunction(this.settings.callbackRenderer)){return this.settings.callbackRenderer()}},handler:function(){return this.settings.handler}});$.ig.igToolbarButtonDescriptor=$.ig.igToolbarItemBaseDescriptor.extend({settings:{props:{onlyIcons:{value:true},labelText:{value:"&nbsp;"}}},init:function(item){this._super(item)}});$.ig.igToolbarSplitButtonDescriptor=$.ig.igToolbarItemBaseDescriptor.extend({settings:{props:{items:[]}},init:function(item){this._super(item)}});$.ig.igToolbarComboDescriptor=$.ig.igToolbarItemBaseDescriptor.extend({settings:{props:{valueKey:{value:"text"},textKey:{value:"value"},dropDownOnFocus:{value:true},enableClearButton:{value:false},dataSource:{value:null},mode:{value:"dropdown"},inputName:{value:null}}},init:function(item){this._super(item);if(this.settings.dataSource){this.settings.props.dataSource.value=this.settings.dataSource}}});$.widget("ui.igToolbar",$.ui.igWidget,{options:{height:null,width:null,allowCollapsing:true,collapseButtonIcon:"ui-igbutton-collapsed",expandButtonIcon:"ui-igbutton-expanded",name:"",displayName:"",items:[],isExpanded:true,locale:{collapseButtonTitle:undefined,expandButtonTitle:undefined}},events:{toolbarButtonClick:"toolbarButtonClick",toolbarComboOpening:"toolbarComboOpening",toolbarComboSelected:"toolbarComboSelected",toolbarCustomItemClick:"toolbarCustomItemClick",itemRemoved:"itemRemoved",itemAdded:"itemAdded",collapsing:"collapsing",collapsed:"collapsed",expanding:"expanding",expanded:"expanded",itemDisable:"itemDisable",itemEnabled:"itemEnabled",windowResized:"windowResized"},css:{toolbarWidget:"ui-widget ui-widget-content ui-igtoolbar ui-corner-all",toolbarWrapperConteiner:"ui-widget ui-widget-content ui-igtoolbar ui-corner-all",toolbarCollapsedButton:"ui-state-default ui-igbutton-all-caps",igToolbarSeparator:"ig-toolbar-separator ui-widget-content",igToolbarButtonsHolder:"ig-toolbar-buttons-holder"},_id:function(id){return this.element[0].id+id},widget:function(){return this.element},_create:function(){var itemDescriptor,i,toolbar=this.options;for(i=0;i<toolbar.items.length;i++){if(!toolbar.items[i].type){toolbar.items[i].type="custom"}itemDescriptor=toolbar.items[i]=this._getToolbarItemDescriptor(toolbar.items[i])}this._render();this._createItems();this._onResize()},_getToolbarItemDescriptor:function(item){return new this._toolbarItemsDescriptors[item.type](item)},_toolbarItemsDescriptors:{button:$.ig.igToolbarButtonDescriptor,0:$.ig.igToolbarButtonDescriptor,combo:$.ig.igToolbarComboDescriptor,1:$.ig.igToolbarComboDescriptor,splitButton:$.ig.igToolbarSplitButtonDescriptor,2:$.ig.igToolbarSplitButtonDescriptor,splitButtonColor:$.ig.igToolbarSplitButtonDescriptor,3:$.ig.igToolbarSplitButtonDescriptor,custom:$.ig.igToolbarItemBaseDescriptor},_init:function(){this._attachEvents();if(!this.options.isExpanded){this.buttonsList.hide();this.collapseBtn.igToolbarButton("toggle").children(":first").switchClass(this.options.collapseButtonIcon,this.options.expandButtonIcon)}this._width=this.collapseBtn.outerWidth(true)+this.buttonsList.width();this._height=this.element.height()},_render:function(){var o=this.options;this.element.addClass(this.css.toolbarWidget).width(this.options.width).height(this.options.height);this.collapseBtn=$('<div tabIndex="0" id="'+this._id("_collapseButton")+'"></div>').appendTo(this.element).attr({"data-state":"expand"}).igToolbarButton({onlyIcons:true,labelText:"&nbsp;",title:this._getTooltipByExpandState("expand"),icons:{primary:o.collapseButtonIcon}});this.toolbarBody=this.element.find("#"+this._id("_toolbar"));this.buttonsList=$('<div id="'+this._id("_toolbar_buttons")+'" class="'+this.css.igToolbarButtonsHolder+'"></div>').appendTo(this.element)},_onCollapse:function(e){var noCancel,event,cancelableEvent,options=this.options,width,self=this;e.stopPropagation();if(!options.allowCollapsing){return}if(options.isExpanded){event="collapsed";cancelableEvent="collapsing";noCancel=this._trigger(this.events[cancelableEvent],e,{owner:this,toolbarElement:this.element,toolbar:{}});if(noCancel){options.isExpanded=false;width=this.element.height();this._oldWidth=this._width;this.collapseBtn.attr({title:this._getTooltipByExpandState("collapse"),"data-state":"collapse"}).children(":first").switchClass(this.options.collapseButtonIcon,this.options.expandButtonIcon)}}else{event="expanded";cancelableEvent="expanding";noCancel=this._trigger(this.events[cancelableEvent],e,{owner:this,toolbarElement:this.element,toolbar:{}});if(noCancel){options.isExpanded=true;this.buttonsList.show();width=this._getAdjustedWidth();this.collapseBtn.attr({title:this._getTooltipByExpandState("expand"),"data-state":"expand"}).children(":first").switchClass(this.options.expandButtonIcon,this.options.collapseButtonIcon)}}if(noCancel){this.element.css({overflow:"hidden"});this.element.animate({width:width},300,null,function(){if(!options.isExpanded){self.buttonsList.hide()}else{self.element.css("width","")}self._trigger(self.events[event],e,{owner:self,toolbarElement:self.element,toolbar:{}})})}},_getAdjustedWidth:function(){var width;if(!this.options.isExpanded){width=this.element.height()}else{width=this.buttonsList.outerWidth(true)+this.collapseBtn.outerWidth(true)}return width},_setOption:function(name,value){this._super(name,value);var i,options=this.options;switch(name){case"allowCollapsing":this.options.allowCollapsing=value;break;case"items":for(i=0;i<value.length;i++){if(!value[i].type){value[i].type="custom"}value[i]=this._getToolbarItemDescriptor(value[i])}this._updateItems(value);this.options.items=value;this._createItems();break;case"width":this.element.width(value);break;case"height":this.element.height(value);break;case"isExpanded":if(options.allowCollapsing){this._expandOrCollapse()}break;case"collapseButtonIcon":this.options.collapseButtonIcon=value;break;case"expandButtonIcon":this.options.expandButtonIcon=value;break;default:break}},_getTooltipByExpandState:function(state){return(state==="expand"?this._getLocaleValue("collapseButtonTitle"):this._getLocaleValue("expandButtonTitle")).replace("{0}",this.options.displayName)},changeLocale:function(){var $button=this.collapseBtn;if($button&&$button.length){$button.attr("title",this._getTooltipByExpandState($button.attr("data-state")))}},_expandOrCollapse:function(){var self=this;if(self.options.isExpanded){self.buttonsList.show();this._oldWidth=this._width;self.collapseBtn.attr({title:this._getTooltipByExpandState("expand"),"data-state":"expand"}).children(":first").switchClass(self.options.expandButtonIcon,self.options.collapseButtonIcon)}else{if(typeof self._oldWidth!=="undefined"){self.element.width(self._oldWidth)}this._oldWidth=this._width;self.buttonsList.hide();self.collapseBtn.attr({title:this._getTooltipByExpandState("collapse"),"data-state":"collapse"}).children(":first").switchClass(self.options.collapseButtonIcon,self.options.expandButtonIcon)}this._onResize()},_isSelectedAction:function(el,props){if(props.value){el.addClass("ui-state-active")}},_createItems:function(){var o=this.options,i,localeProps,self=this,itemProps={},newItem,tbItemsHash={button:"igToolbarButton",combo:"igCombo",splitButton:"igSplitButton",splitButtonColor:"igColorPickerSplitButton"},tbItemsPropsTraversing=function(key,property){var scope=o.items[i].scope||self;if(property.action!==undefined&&$.isFunction(scope[property.action])){scope[property.action](newItem,property,itemProps);return}itemProps[key]=property.value};this.buttonsList.empty();for(i=0;i<o.items.length;i++){itemProps={};newItem=(o.items[i].callbackRenderer()||$('<div tabIndex="0"></div>')).attr("id",this._id("_item_"+o.items[i].name)).appendTo(this.buttonsList);localeProps=o.items[i].getLocaleProperties();if(localeProps){newItem.attr(localeProps)}$.each(o.items[i].getProperties(),tbItemsPropsTraversing);if(tbItemsHash.hasOwnProperty(o.items[i].type)){newItem[tbItemsHash[o.items[i].type]](itemProps)}}},_updateItems:function(items){var options=this.options,updProps,scope,el,i;for(i=0;i<items.length;i++){updProps=items[i];el=this.getItem(items[i].name);scope=options.items[i].scope||this}},_tooltipAction:function(el,props,itemOptionObj){if(itemOptionObj!==undefined){itemOptionObj.title=props.value}else{el.igToolbarButton("option","title",props.value)}},_buttonIconAction:function(el,props,itemOptionObj){if(itemOptionObj!==undefined){itemOptionObj.icons={primary:props.value}}else{el.igToolbarButton("option","icons",{primary:props.value})}},_comboDataSourceAction:function(el,props,itemOptionObj){if(itemOptionObj!==undefined){itemOptionObj.dataSource=props.value}else{el.igCombo("option","dataSource",props.value)}},_comboWidthAction:function(el,props,itemOptionObj){if(itemOptionObj!==undefined){itemOptionObj.width=props.value}else{el.igCombo("option","width",props.value)}},_comboHeightAction:function(el,props,itemOptionObj){if(itemOptionObj!==undefined){itemOptionObj.height=props.value}else{el.igCombo("option","height",props.value)}},_comboSelectedItem:function(el,props,itemOptionObj){if(itemOptionObj!==undefined){itemOptionObj.initialSelectedItems=[{value:props.value}]}else{el.igCombo("value",props.value)}},_spltButtonColorAction:function(el,props,itemOptionObj){if(itemOptionObj!==undefined){itemOptionObj.defaultColor=props.value}else{el.igColorPickerSplitButton("option","defaultColor",props.value)}},_comboDropDownListWidth:function(el,props,itemOptionObj){if(itemOptionObj!==undefined){itemOptionObj.dropDownWidth=props.value}else{el.igCombo("option","dropDownWidth",props.value)}},_getWidgetType:function(el){var data,i;if(el!==undefined){data=el.data();for(i in data){if(data.hasOwnProperty(i)&&data[i].widgetName){return data[i].widgetName}}}},_attachEvents:function(){var toolbarItemsEvents="igtoolbarbuttonclick igsplitbuttonclick igcolorpickersplitbuttoncolorselected";this.element.delegate(".ui-widget",toolbarItemsEvents,$.proxy(this._onToolbarItemInteraction,this));this.element.delegate(":ui-igCombo","igcomboselectionchanged",$.proxy(this._onComboListItemClick,this)).delegate(":ui-igCombo","igcombodropdownclosed",$.proxy(this._onComboDropDownClose,this));this.collapseBtn.bind("igtoolbarbuttonclick",$.proxy(this._onCollapse,this));$(window).on("resize",$.proxy(this._onResize,this))},_onToolbarItemInteraction:function(e,ui){var selectedItemValue,selectedItemIndex,triggeredEvent,targetWidget=$(e.target).parentsUntil(":ui-igToolbar").eq(-2),o=this.options;if(targetWidget.length===0){targetWidget=$(e.target)}selectedItemIndex=this.buttonsList.children().index(targetWidget);switch(e.type){case"igtoolbarbuttonclick":triggeredEvent=this.events.toolbarButtonClick;break;default:triggeredEvent=this.events.toolbarCustomItemClick;selectedItemValue=ui.data?ui.data.text:ui.value;break}this._trigger(triggeredEvent,e,{name:ui.name||o.items[selectedItemIndex].name,value:selectedItemValue,handler:o.items[selectedItemIndex].handler(),scope:o.items[selectedItemIndex].getProperty("scope"),itemProperties:o.items[selectedItemIndex].getProperties(),toolbarItem:targetWidget,toolbarName:o.name})},_onComboDropDownClose:function(e,data){if(this._delayComboSelectionChanged){this._delayComboSelectionChanged=false;data.items=$(e.currentTarget).igCombo("selectedItems");this._onComboListItemClick(e,data)}},_onComboListItemClick:function(e,data){var toolbarItemIndex,toolbarItem;if(e.which>=37&&e.which<=40){this._delayComboSelectionChanged=true;return}else{this._delayComboSelectionChanged=false}toolbarItemIndex=this.buttonsList.children().index($(e.currentTarget));toolbarItem=this.options.items[toolbarItemIndex];this._trigger(this.events.toolbarComboSelected,e,{name:toolbarItem.name,value:data.items[0].data?data.items[0].data.text:data.items[0].value,handler:toolbarItem.handler(),scope:toolbarItem.getProperty("scope"),itemProperties:toolbarItem.getProperties(),toolbarItem:data.owner,toolbarName:this.options.name})},_onResize:function(){var isVisible=this.element.is(":visible"),parentWidth=this.element.parent().width();while(isVisible&&this.options.isExpanded&&this.element.outerWidth()>parentWidth){this._hideButtonFromToolbar()}while(this._hiddenButtons&&this._hiddenButtons.length>0&&parentWidth>this.element.outerWidth()+this._hiddenButtons[this._hiddenButtons.length-1].width()){this._showHiddenButtonFromToolbar()}this._trigger(this.events.windowResized)},_hideButtonFromToolbar:function(){var buttonToHide,notHiddenButtons=this.buttonsList.children().filter(function(){return $(this).css("display")!=="none"});if(this._hiddenButtons===undefined){this._hiddenButtons=[]}buttonToHide=$(notHiddenButtons[notHiddenButtons.length-1]);if(typeof buttonToHide.length!=="undefined"){buttonToHide.hide();this._hiddenButtons.push(buttonToHide)}},_showHiddenButtonFromToolbar:function(){this._hiddenButtons[this._hiddenButtons.length-1].show();this._hiddenButtons.pop()},getItem:function(index){var result;if(!isNaN(parseInt(index,10))){return this.buttonsList.children().eq(index)}if(typeof index==="string"){result=this.buttonsList.find("#"+this._id("_item_"+index));if(result.length){return result}}},addItem:function(item){var newItem=this._getToolbarItemDescriptor(item);this.options.items.push(newItem);this._createItems();this._trigger(this.events.itemAdded)},removeItem:function(index){this.buttonsList.children().eq(index).remove();this._trigger(this.events.itemremoved)},disableItem:function(index,disabled){var item=this.getItem(index),widgetType=this._getWidgetType(item);if(widgetType){item[this._getWidgetType(item)]("option","disabled",disabled);this._trigger(this.events.itemDisable,{isDisabled:disabled})}},activateItem:function(index,activated){var item=this.getItem(index),action=activated?item.addClass:item.removeClass;action.call(item,"ui-state-active");item.igToolbarButton("option","isSelected",activated);this._trigger(this.events.itemEnabled,{isActivated:activated})},deactivateAll:function(){this.buttonsList.find(".ui-igbutton.ui-state-active").igToolbarButton("deactivate")},destroy:function(){this.element.undelegate().unbind();this.collapseBtn.igToolbarButton("destroy").remove();this.buttonsList.remove();this.element.removeClass();this._superApply(arguments)}});$.extend($.ui.igToolbar,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI Tile Manager 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *  jquery.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.templating.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 *  infragistics.util.jquery.js
 *  infragistics.ui.widget.js
 *  infragistics.ui.splitter.js
 *	infragistics.ui.layoutmanager.js
 *	infragistics.ui.tilemanager-en.js
 */
(function($){$.widget("ui.igTileManager",$.ui.igWidget,{css:{container:"ui-widget ui-igtilemanager ui-widget-content",leftPanel:"ui-igtilemanager-left",rightPanel:"ui-igtilemanager-right",header:"ui-widget-header ui-igtile-header",content:"ui-widget-content ui-igtile",innerContainer:"ui-igtile-inner-container",minimized:"ui-igtile-minimized",maximized:"ui-igtile-maximized",minimizeButton:"ig-button ig-tile-minimize-button",minimizeIcon:"ig-tile-minimize-icon",hoverClass:"ui-state-hover",hidden:"ui-helper-hidden",overflowHidden:"ui-helper-overflow-hidden",overflowVisible:"ui-helper-overflow-visible",visibilityHidden:"ui-helper-visibility-hidden",splitterNoScroll:"ui-igsplitter-no-scroll"},options:{width:null,height:null,columnWidth:null,columnHeight:null,cols:null,rows:null,marginLeft:0,marginTop:0,rearrangeItems:true,items:null,dataSource:null,minimizedState:null,maximizedState:null,maximizedTileIndex:null,rightPanelCols:1,rightPanelTilesWidth:null,rightPanelTilesHeight:null,showRightPanelScroll:true,splitterOptions:{enabled:true,collapsible:false,collapsed:false,events:{collapsed:null,expanded:null}},preventMaximizingSelector:"a, input",animationDuration:500,dataSourceUrl:null,responseDataKey:null,responseDataType:null,dataSourceType:null,requestType:"GET",responseContentType:null},events:{dataBinding:"dataBinding",dataBound:"dataBound",rendering:"rendering",rendered:"rendered",tileRendering:"tileRendering",tileRendered:"tileRendered",tileMaximizing:"tileMaximizing",tileMaximized:"tileMaximized",tileMinimizing:"tileMinimizing",tileMinimized:"tileMinimized"},_selectors:{tileSelector:".ui-igtile",minimizedTileSelector:".ui-igtile-minimized",minimizeBtnSelector:".ig-tile-minimize-button",minimizeIconSelector:".ig-tile-minimize-icon",leftPanelSelector:".ui-igtilemanager-left",rightPanelSelector:".ui-igtilemanager-right",splitbarSelector:".ui-igsplitter-splitbar-vertical",innerContainerSelector:".ui-igtile-inner-container"},_create:function(){var opt=this.options;this._options={$tiles:null,$maximizedTile:null,$leftPanel:null,$rightPanel:null,$layoutManagerElement:null,fromMarkup:false,animating:false,useMaximizedTileIndex:false,rightPanelWidth:0,gridLayout:null,elementHandlers:{},windowHandlers:{},splitterFirstExpandEventFired:false};this.element.addClass(this.css.container);if(opt.width){this.element.css("width",opt.width)}if(opt.height){this.element.css("height",opt.height)}this.options.tileSelector=this.options.tileSelector||this._selectors.tileSelector;if(opt.dataSource!==null){this.dataBind()}else{this._options.fromMarkup=true;this._initFromMarkup()}if(this.options.disabled){this.options.disabled=false;this._setOption("disabled",true)}this._attachEvents()},_setOption:function(option,value){if(this.options[option]===value){return}var i,len,itemsMerged,items,glOption,self=this,_opt=this._options;this._super(option,value);switch(option){case"dataSource":this.dataBind();break;case"dataSourceUrl":this.dataBind();break;case"width":if(!_opt.useMaximizedTileIndex){this.minimize(0)}this.element.width(this.options.width);this.reflow(true,0);break;case"height":if(!_opt.useMaximizedTileIndex){this.minimize(0)}this.element.height(this.options.height);this.reflow(true,0);break;case"columnWidth":case"columnHeight":case"cols":case"rows":case"marginLeft":case"marginTop":case"rearrangeItems":if(!_opt.useMaximizedTileIndex){this.minimize(0)}glOption={};glOption[option]=value;_opt.$layoutManagerElement.igLayoutManager("option","gridLayout",glOption);_opt.gridLayout=this.layoutManager()._opt.gridLayout;break;case"items":if(value.length!==_opt.$tiles.length){throw new Error(this._getLocaleValue("setOptionItemsLengthError"))}if(_opt.useMaximizedTileIndex){itemsMerged=$.extend(true,[],this._options.$layoutManagerElement.igLayoutManager("option","items"),value)}else{this.minimize(0)}_opt.$layoutManagerElement.igLayoutManager("option","items",value);_opt.gridLayout=this.layoutManager()._opt.gridLayout;if(_opt.useMaximizedTileIndex){items=this._options.$layoutManagerElement.igLayoutManager("option","items");len=items.length;for(i=0;i<len;i++){$.extend(true,items[i],itemsMerged[i])}this.layoutManager()._glSortItemsByPositionOrder();_opt.gridLayout.initialItems=$.extend(true,[],this._options.$layoutManagerElement.igLayoutManager("option","items"))}this.reflow(true,0);break;case"minimizedState":_opt.$tiles.not(_opt.$maximizedTile).each(function(){self._toMinimizedState($(this))});break;case"maximizedState":if(_opt.$maximizedTile){this._toMaximizedState(_opt.$maximizedTile)}break;case"maximizedTileIndex":this._toMinimizedState(_opt.$maximizedTile);_opt.$maximizedTile=_opt.$tiles.filter("[data-index="+this.options.maximizedTileIndex+"]");this._toMaximizedState(_opt.$maximizedTile);break;case"rightPanelCols":if(_opt.$maximizedTile&&!_opt.useMaximizedTileIndex){this._setRightPanelSize();this._positionRightPanelTiles(_opt.$tiles.not(_opt.$maximizedTile),parseInt(_opt.$maximizedTile.attr("data-index"),10),false,false)}break;case"rightPanelTilesWidth":if(_opt.$maximizedTile&&!_opt.useMaximizedTileIndex){this._setRightPanelSize();this._positionRightPanelTiles(_opt.$tiles.not(_opt.$maximizedTile),parseInt(_opt.$maximizedTile.attr("data-index"),10),false,true)}break;case"rightPanelTilesHeight":if(_opt.$maximizedTile&&!_opt.useMaximizedTileIndex){this._setRightPanelSize();this._positionRightPanelTiles(_opt.$tiles.not(_opt.$maximizedTile),parseInt(_opt.$maximizedTile.attr("data-index"),10),false,true)}break;case"showRightPanelScroll":if(!_opt.useMaximizedTileIndex){if(value){_opt.$rightPanel.removeClass(this.css.overflowHidden)}else{_opt.$rightPanel.addClass(this.css.overflowHidden)}if(_opt.$maximizedTile){this._setRightPanelSize()}}break;case"splitterOptions":if(value.hasOwnProperty("collapsed")||value.hasOwnProperty("collapsible")){throw new Error(this._getLocaleValue("errorSettingOption"))}if(value.enabled===true){this.element.children(this._selectors.splitbarSelector).removeClass(this.css.visibilityHidden)}else if(value.enabled===false){this.element.children(this._selectors.splitbarSelector).addClass(this.css.visibilityHidden)}if(value.events&&value.events.collapsed){this.element.igSplitter({collapsed:value.events.collapsed})}if(value.events&&value.events.expanded){this.element.igSplitter({expanded:value.events.expanded})}value=$.extend(true,{},this.layoutManager().options.splitterOptions,value);break;case"animationDuration":this.layoutManager().options.gridLayout.animationDuration=value;break;case"disabled":this._toggleDisabled(value);break;default:break}},_initFromMarkup:function(){var $tiles,$children=this.element.children(),$filtered=$children.filter(this.options.tileSelector);if($filtered.length){$tiles=$filtered;$children.not($tiles).addClass(this.css.hidden)}else{$tiles=this.element.children()}$tiles.wrap("<div>");this._initLayoutManager($tiles)},_renderData:function(success,msg,data){var _opt=this._options;this._triggerDataBound(success,msg,data._data);if(success){if(_opt.$layoutManagerElement){_opt.$layoutManagerElement.igLayoutManager("destroy");if(!_opt.useMaximizedTileIndex){this.element.igSplitter("destroy")}this._resetInternalOptions()}this.element.empty();this._initLayoutManager(data._data)}else{throw new Error(this._getLocaleValue("renderDataError"))}},_resetInternalOptions:function(){var _opt=this._options;_opt.gridLayout=null;_opt.$layoutManagerElement=null;_opt.$leftPanel=null;_opt.$rightPanel=null;_opt.$maximizedTile=null;_opt.$tiles=null;_opt.animating=false},_initDataSource:function(){var opt=this.options,dataOpt;if(!opt.dataSource&&opt.dataSourceUrl){opt.dataSource=opt.dataSourceUrl}if(!(opt.dataSource instanceof $.ig.DataSource)){dataOpt={callback:this._renderData,callee:this,dataSource:opt.dataSource,requestType:opt.requestType,responseContentType:opt.responseContentType,responseDataType:opt.responseDataType,localSchemaTransform:false};if(opt.responseDataKey){dataOpt.responseDataKey=opt.responseDataKey}if(opt.dataSourceType){dataOpt.dataSourceType=opt.dataSourceType}opt.dataSource=new $.ig.DataSource(dataOpt)}},_tileRendered:function(event,ui){var _opt=this._options,$tile=ui.item,renderMaximizedState=_opt.useMaximizedTileIndex&&this.options.maximizedTileIndex===ui.index,$innerContainer;if(_opt.fromMarkup){$innerContainer=$tile.children();if(!_opt.useMaximizedTileIndex){$innerContainer.prepend(this._renderMinimizeButton())}if(renderMaximizedState){if(this.options.maximizedState){$innerContainer.children().not(this.options.maximizedState).addClass(this.css.hidden)}}else if(this.options.minimizedState){$innerContainer.children().not(this.options.minimizedState).addClass(this.css.hidden)}}else{$innerContainer=$("<div/>").appendTo($tile);if(renderMaximizedState){$innerContainer.html(this._renderMaximizedState(ui.index))}else{$innerContainer.html(this._renderMinimizedState(ui.index))}}$innerContainer.addClass(this.css.innerContainer);$tile.addClass(this.css.content).addClass(renderMaximizedState?this.css.maximized:this.css.minimized);this._triggerTileRendered(event,ui)},_initLayoutManager:function($tiles){var self=this,opt=this.options,_opt=this._options,items=[],lengthDiff,noCancel,i;if(opt.items){$.extend(items,opt.items)}if($tiles.length>items.length){lengthDiff=$tiles.length-items.length;for(i=0;i<lengthDiff;i++){items.push({})}}else{items.splice($tiles.length)}noCancel=this._triggerRendering($tiles,items);if(noCancel){if(!(typeof opt.maximizedTileIndex==="number"&&$tiles.length>=opt.maximizedTileIndex)){this._addPanels();_opt.$leftPanel.addClass(this.css.overflowHidden);this._renderSplitter();_opt.$layoutManagerElement=_opt.$leftPanel;_opt.$leftPanel.igLayoutManager($.extend(true,{},{layoutMode:"grid",items:items,gridLayout:{columnWidth:opt.columnWidth,columnHeight:opt.columnHeight,cols:opt.cols,rows:opt.rows,marginLeft:opt.marginLeft,marginTop:opt.marginTop,rearrangeItems:opt.rearrangeItems,animationDuration:opt.animationDuration,overrideConfigOnSetOption:false,useOffset:false},itemRendered:function(event,ui){noCancel=self._triggerTileRendering(event,ui);if(noCancel){self._tileRendered(event,ui)}},rendered:function(){_opt.gridLayout=self.layoutManager()._opt.gridLayout;_opt.$leftPanel.removeClass(self.css.overflowHidden);_opt.$tiles=$(this).data("igLayoutManager")._opt.gridLayout.elements;self._triggerRendered()},internalResizing:function(){if(_opt.$maximizedTile){return false}},internalResized:function(event){self.options.items=self.layoutManager().options.items;if(_opt.$maximizedTile){_opt.animating=false;if(event){self._triggerTileMinimized(event,_opt.$maximizedTile)}_opt.$maximizedTile=null}}}))}else{_opt.useMaximizedTileIndex=true;this.element.addClass(this.css.overflowHidden);_opt.$layoutManagerElement=this.element;this.element.igLayoutManager($.extend(true,{},{layoutMode:"grid",items:items,gridLayout:{columnWidth:opt.columnWidth,columnHeight:opt.columnHeight,cols:opt.cols,rows:opt.rows,marginLeft:opt.marginLeft,marginTop:opt.marginTop,rearrangeItems:opt.rearrangeItems,animationDuration:opt.animationDuration,overrideConfigOnSetOption:false,useOffset:false},itemRendered:function(event,ui){noCancel=self._triggerTileRendering(event,ui);if(noCancel){self._tileRendered(event,ui)}},rendered:function(){_opt.gridLayout=self.layoutManager()._opt.gridLayout;self.element.removeClass(self.css.overflowHidden);_opt.$tiles=$(this).data("igLayoutManager")._opt.gridLayout.elements;self._triggerRendered()},internalResized:function(){self.options.items=self.layoutManager().options.items}}));_opt.$maximizedTile=_opt.$tiles.filter("[data-index="+opt.maximizedTileIndex+"]")}this.options.items=this.layoutManager().options.items}},_toMaximizedState:function($tile){var $innerContChildren,$innerContainer=$tile.children(this._selectors.innerContainerSelector);$tile.removeClass(this.css.minimized).addClass(this.css.maximized);if(!this._options.fromMarkup){$innerContainer.html((this._options.useMaximizedTileIndex?"":this._renderMinimizeButton())+this._renderMaximizedState($tile.attr("data-index")))}else{$innerContChildren=$innerContainer.children();if(this.options.maximizedState){$innerContChildren.not(this.options.maximizedState).addClass(this.css.hidden);$innerContChildren.filter(this.options.maximizedState+", "+this._selectors.minimizeBtnSelector).removeClass(this.css.hidden)}else{$innerContChildren.removeClass(this.css.hidden)}}},_toMinimizedState:function($tile){var $innerContainer=$tile.children(this._selectors.innerContainerSelector),$minimizedState,$children;$tile.removeClass(this.css.maximized).addClass(this.css.minimized);if(!this._options.fromMarkup){$innerContainer.html(this._renderMinimizedState($tile.attr("data-index")))}else{$children=$innerContainer.children();if(this.options.minimizedState){$minimizedState=$children.filter(this.options.minimizedState);$children.not($minimizedState).addClass(this.css.hidden);$minimizedState.removeClass(this.css.hidden)}else{$children.removeClass(this.css.hidden)}}},_renderMaximizedState:function(index){return this.options.maximizedState?$.ig.tmpl(this.options.maximizedState,this.options.dataSource.data()[index]):this._renderMinimizedState(index)},_renderMinimizedState:function(index){return this.options.minimizedState?$.ig.tmpl(this.options.minimizedState,this.options.dataSource.data()[index]):""},_renderMinimizeButton:function(){return'<span class="'+this.css.minimizeButton+'">'+'<span class="'+this.css.minimizeIcon+'"></span></span>'},_addPanels:function(){var _opt=this._options,markup=this.element.children(),$leftPanel=$("<div/>").addClass(this.css.leftPanel),$rightPanel=$("<div/>").addClass(this.css.rightPanel+" "+this.css.hidden);$leftPanel.appendTo(this.element);$rightPanel.appendTo(this.element);_opt.$leftPanel=$leftPanel;_opt.$rightPanel=$rightPanel;if(!this.options.showRightPanelScroll){_opt.$rightPanel.addClass(this.css.overflowHidden)}markup.appendTo(_opt.$leftPanel)},_removePanels:function(){this.element.children(this._selectors.leftPanelSelector).children().appendTo(this.element);this.element.children(this._selectors.leftPanelSelector+", "+this._selectors.rightPanelSelector).remove();this._options.$leftPanel=null;this._options.$rightPanel=null},_renderSplitter:function(){var self=this,opt=this.options,_opt=this._options;this.element.igSplitter({panels:[{},{collapsible:opt.splitterOptions.collapsible,collapsed:opt.splitterOptions.collapsed}],resizeOtherSplitters:false,layoutRefreshing:function(){return false},resizeStarted:function(){_opt.rightPanelWidth=_opt.$rightPanel.width()},resizeEnded:function(){var gl=_opt.gridLayout,rightPanelWidth=_opt.$rightPanel.width(),rightPanelTilesWidth=self._getRightPanelTilesWidth(),rightPanelTilesHeight=self._getRightPanelTilesHeight(),$tiles=_opt.$tiles.not(_opt.$maximizedTile),rightPanelCols,oldRightPanelCols,rightPanelHasScroll;if(_opt.rightPanelWidth>rightPanelWidth){rightPanelCols=Math.floor(rightPanelWidth/(rightPanelTilesWidth+gl.marginLeft))}else{rightPanelCols=Math.ceil(rightPanelWidth/(rightPanelTilesWidth+gl.marginLeft))}rightPanelHasScroll=self.options.showRightPanelScroll&&Math.ceil($tiles.length/rightPanelCols)*(rightPanelTilesHeight+gl.marginTop)>_opt.$rightPanel.height();if(rightPanelHasScroll){if(_opt.rightPanelWidth>rightPanelWidth){rightPanelCols=Math.floor((rightPanelWidth-$.ig.util.getScrollWidth())/(rightPanelTilesWidth+gl.marginLeft))}else{rightPanelCols=Math.ceil((rightPanelWidth-$.ig.util.getScrollWidth())/(rightPanelTilesWidth+gl.marginLeft))}}oldRightPanelCols=self.options.rightPanelCols;self.options.rightPanelCols=rightPanelCols;self._setRightPanelSize();if(oldRightPanelCols!==self.options.rightPanelCols){self._positionRightPanelTiles($tiles,parseInt(_opt.$maximizedTile.attr("data-index"),10),false,false)}_opt.rightPanelWidth=rightPanelWidth},collapsed:opt.splitterOptions.events.collapsed,expanded:function(evt,ui){if(!_opt.splitterFirstExpandEventFired){_opt.splitterFirstExpandEventFired=true;self._setRightPanelSize()}if(opt.splitterOptions.events.expanded){opt.splitterOptions.events.expanded(evt,ui)}}});this._hideSplitterElements()},_attachEvents:function(){var self=this,_opt=this._options,minimizeBtnSelector=this._selectors.minimizeBtnSelector,minimizedTileSelector=this._selectors.minimizedTileSelector,splitter=this.splitter(),elHandlers=_opt.elementHandlers,noCancel;elHandlers.minimizedTileClick=function(event){var $target=$(event.target),$tileToMaximize=$(this);self._stopEventPropagation(event);if(self.options.disabled){return}if($target.is(self.options.preventMaximizingSelector)){return}if(!_opt.animating){_opt.animating=true;$tileToMaximize.removeClass(self.css.hoverClass);noCancel=self._triggerTileMaximizing(event,$tileToMaximize);if(_opt.$maximizedTile){self._triggerTileMinimizing(event,_opt.$maximizedTile,$tileToMaximize)}if(noCancel){self.maximize($tileToMaximize,self.options.animationDuration,event)}else{_opt.animating=false}}};elHandlers.miminimizedTileMouseOver=function(event){self._stopEventPropagation(event);if(self.options.disabled){return}if(!(_opt.animating||splitter&&splitter._isDrag)){$(this).addClass(self.css.hoverClass)}};elHandlers.minimizedTileMouseOut=function(event){self._stopEventPropagation(event);if(self.options.disabled){return}$(this).removeClass(self.css.hoverClass)};elHandlers.minimizeBtnClick=function(event){self._stopEventPropagation(event);if(self.options.disabled){return}if(!_opt.animating){_opt.animating=true;noCancel=self._triggerTileMinimizing(event,_opt.$maximizedTile);if(noCancel){self.minimize(null,event)}else{_opt.animating=false}}};elHandlers.minimizeBtnMouseOver=function(event){self._stopEventPropagation(event);if(self.options.disabled){return}if(!(_opt.animating||splitter&&splitter._isDrag)){$(this).children(self._selectors.minimizeIconSelector).addClass(self.css.hoverClass)}};elHandlers.minimizeBtnMouseOut=function(event){self._stopEventPropagation(event);if(self.options.disabled){return}$(this).children(self._selectors.minimizeIconSelector).removeClass(self.css.hoverClass)};this.element.on("click",minimizedTileSelector,elHandlers.minimizedTileClick).on("mouseover",minimizedTileSelector,elHandlers.miminimizedTileMouseOver).on("mouseout",minimizedTileSelector,elHandlers.minimizedTileMouseOut).on("click",minimizeBtnSelector,elHandlers.minimizeBtnClick).on("mouseover",minimizeBtnSelector,elHandlers.minimizeBtnMouseOver).on("mouseout",minimizeBtnSelector,elHandlers.minimizeBtnMouseOut);_opt.windowHandlers.resize=function(){if(_opt.$maximizedTile&&!_opt.useMaximizedTileIndex){self._setRightPanelSize()}};$(window).on("resize",_opt.windowHandlers.resize)},_stopEventPropagation:function(event){if(event.stopPropagation){event.stopPropagation()}if(event.cancelBubble!==null||event.cancelBubble!==undefined){event.cancelBubble=true}},_getRightPanelTilesWidth:function(){var gl=this._options.gridLayout,rightPanelTilesWidth=parseInt(this.options.rightPanelTilesWidth,10);if(rightPanelTilesWidth){return rightPanelTilesWidth}else if($.isArray(gl.columnWidth)){return gl.columnWidth[gl.columnWidth.length-1]}else{return gl.columnWidth}},_getRightPanelTilesHeight:function(){var gl=this._options.gridLayout,rightPanelTilesHeight=parseInt(this.options.rightPanelTilesHeight,10);if(rightPanelTilesHeight){return rightPanelTilesHeight}else if($.isArray(gl.columnHeight)){return gl.columnHeight[gl.columnHeight.length-1]}else{return gl.columnHeight}},_setRightPanelSize:function(){var self=this,opt=this.options,_opt=this._options,gl=_opt.gridLayout,minMaximizedTileWidth=this._getMinMaximizedTileWidth()+2*gl.marginLeft,rightTilesTotalWidth=this._getRightPanelTilesWidth()+gl.marginLeft,rightTilesTotalHeight=this._getRightPanelTilesHeight()+gl.marginTop,rightPanelHeight=_opt.$rightPanel.height(),splitterWidth=this.element.children(this._selectors.splitbarSelector).outerWidth(true),scrollWidth=$.ig.util.getScrollWidth(),maxCols,minWidth,rightPanelWidth,leftPanelWidth,rightPanelHasScroll=function(){return self.options.showRightPanelScroll&&Math.ceil((_opt.$tiles.length-1)/self.options.rightPanelCols)*rightTilesTotalHeight>rightPanelHeight};if(opt.rightPanelCols<1){opt.rightPanelCols=1}maxCols=Math.max(Math.floor((this.element.width()-minMaximizedTileWidth-splitterWidth-(rightPanelHasScroll()?scrollWidth:0))/rightTilesTotalWidth),1);if(opt.rightPanelCols>maxCols){opt.rightPanelCols=maxCols}rightPanelWidth=opt.rightPanelCols*rightTilesTotalWidth+(rightPanelHasScroll()?scrollWidth:0);minWidth=rightPanelWidth+minMaximizedTileWidth+splitterWidth;this.element.css("min-width",minWidth);leftPanelWidth=this.element.width()-rightPanelWidth-2*gl.marginLeft-splitterWidth;this.element.igSplitter("setFirstPanelSize",leftPanelWidth)},_getMinMaximizedTileWidth:function(){var gl=this._options.gridLayout,minWidth,i;if($.isArray(gl.columnWidth)){minWidth=gl.columnWidth[0];for(i=0;i<gl.columnWidth.length;i++){if(minWidth>gl.columnWidth[i]){minWidth=gl.columnWidth[i]}}return minWidth}else{return gl.columnWidth}},_positionRightPanelTiles:function($tiles,maximizingTileIndex,containerSwap,animateSize,animDuration,callback){var opt=this.options,_opt=this._options,gl=_opt.gridLayout,rightPanelTilesWidth=this._getRightPanelTilesWidth(),rightPanelTilesHeight=this._getRightPanelTilesHeight(),leftAdjustment=containerSwap?_opt.$rightPanel.igPosition().left-gl.marginLeft:0,topAdjustment=containerSwap?_opt.$rightPanel.scrollTop():0,rightPanelCols=opt.rightPanelCols;animDuration=typeof animDuration==="number"?animDuration:this.options.animationDuration;$tiles.each(function(){var $tile=$(this),tileIndex=parseInt($tile.attr("data-index"),10),tileLeft,tileTop,newDim;if(tileIndex>maximizingTileIndex){tileTop=Math.floor((tileIndex-1)/rightPanelCols)*(rightPanelTilesHeight+gl.marginTop)+gl.marginTop;tileLeft=(tileIndex-1)%rightPanelCols*(rightPanelTilesWidth+gl.marginLeft)+gl.marginLeft/2}else{tileTop=Math.floor(tileIndex/rightPanelCols)*(rightPanelTilesHeight+gl.marginTop)+gl.marginTop;tileLeft=tileIndex%rightPanelCols*(rightPanelTilesWidth+gl.marginLeft)+gl.marginLeft/2}newDim={top:tileTop-topAdjustment,left:tileLeft+leftAdjustment};if(animateSize){newDim.width=rightPanelTilesWidth;newDim.height=rightPanelTilesHeight}$tile.animate(newDim,animDuration,function(){if(containerSwap){$tile.css({left:tileLeft,top:tileTop}).appendTo(_opt.$rightPanel)}if(callback){callback.apply(this)}})})},_hideSplitterElements:function(){var _opt=this._options,$splitBar=this.element.children(this._selectors.splitbarSelector);_opt.$rightPanel.addClass(this.css.hidden).addClass(this.css.splitterNoScroll);$splitBar.addClass(this.css.hidden);_opt.$leftPanel.width("100%");if(!this.options.splitterOptions.enabled){$splitBar.addClass(this.css.visibilityHidden)}},_showSplitterElements:function(){this._options.$rightPanel.removeClass(this.css.hidden);if(!this.splitter()._panels[1].options.collapsed){this._options.$rightPanel.removeClass(this.css.splitterNoScroll)}this.element.children(this._selectors.splitbarSelector).removeClass(this.css.hidden)},_toMaximizedView:function($tileToMaximize,animDuration,event){var _opt=this._options,marginLeft=_opt.gridLayout.marginLeft;_opt.$tiles.css({left:"-="+marginLeft});_opt.$leftPanel.css({marginLeft:marginLeft,marginRight:marginLeft});this._setRightPanelSize();this._showSplitterElements();this._positionRightPanelTiles(_opt.$tiles.not($tileToMaximize),parseInt($tileToMaximize.attr("data-index"),10),true,true,animDuration);this._maximizeTile($tileToMaximize,animDuration,event)},_maximizedTileSwap:function($tileToMaximize,animDuration,event){var self=this,_opt=this._options,gl=_opt.gridLayout,minimizedTiles=_opt.$tiles.not(_opt.$maximizedTile),$tileToMinimize=_opt.$maximizedTile,tileToMinimizeIndex=parseInt($tileToMinimize.attr("data-index"),10),tileToMaximizeIndex=parseInt($tileToMaximize.attr("data-index"),10),rightPanelOffset=_opt.$rightPanel.igPosition().left-gl.marginLeft;this._toMinimizedState($tileToMinimize);this._positionRightPanelTiles($tileToMinimize,tileToMaximizeIndex,true,true,animDuration,function(){var prevIndex=tileToMinimizeIndex-1,prevTile;if(prevIndex===tileToMaximizeIndex){prevIndex-=1}prevTile=_opt.$tiles.filter("[data-index="+prevIndex+"]");if(prevTile.length>0){$tileToMinimize.insertAfter(prevTile)}else{$tileToMinimize.prependTo(_opt.$rightPanel)}if(event){self._triggerTileMinimized(event,$tileToMinimize)}});this._positionRightPanelTiles(minimizedTiles.not($tileToMaximize),tileToMaximizeIndex,false,false,animDuration);$tileToMaximize.css({left:"+="+rightPanelOffset,top:"-="+_opt.$rightPanel.scrollTop()}).appendTo(_opt.$leftPanel);this._maximizeTile($tileToMaximize,animDuration,event)},_maximizeTile:function($tileToMaximize,animDuration,event){var self=this,_opt=this._options,mt=_opt.gridLayout.marginTop,innerContainer=$tileToMaximize.children(this._selectors.innerContainerSelector);animDuration=typeof animDuration==="number"?animDuration:this.options.animationDuration;this._toMaximizedState($tileToMaximize);innerContainer.addClass(this.css.overflowHidden);$tileToMaximize.animate({width:"100%",height:this.element.height()-2*mt,top:mt,left:0},animDuration,function(){_opt.$leftPanel.removeClass(self.css.overflowVisible);innerContainer.removeClass(self.css.overflowHidden);_opt.$maximizedTile=$tileToMaximize;_opt.animating=false;if(event){self._triggerTileMaximized(event,$tileToMaximize)}})},_maximizeTileWithCustomIndex:function($tileToMaximize,animDuration,event){var itemData,i,self=this,_opt=this._options,$tileToMinimize=_opt.$maximizedTile,tileToMinimizeNewDim={width:$tileToMaximize.outerWidth(),height:$tileToMaximize.outerHeight(),top:$tileToMaximize.css("top"),left:$tileToMaximize.css("left")},tileToMaximizeNewDim={width:$tileToMinimize.outerWidth(),height:$tileToMinimize.outerHeight(),top:$tileToMinimize.css("top"),left:$tileToMinimize.css("left")},swapTilesInConfig=function(itemsConfig){for(i=0;i<itemsConfig.length;i++){itemData=itemsConfig[i];if(itemData.item.is($tileToMinimize)){itemData.item=$tileToMaximize}else if(itemData.item.is($tileToMaximize)){itemData.item=$tileToMinimize}}};this._toMaximizedState($tileToMaximize);this._toMinimizedState($tileToMinimize);$tileToMinimize.animate(tileToMinimizeNewDim,animDuration,function(){if(event){self._triggerTileMinimized(event,$tileToMinimize)}});$tileToMaximize.animate(tileToMaximizeNewDim,animDuration,function(){swapTilesInConfig(self._options.$layoutManagerElement.igLayoutManager("option","items"));swapTilesInConfig(_opt.gridLayout.initialItems);_opt.$maximizedTile=$tileToMaximize;_opt.animating=false;if(event){self._triggerTileMaximized(event,$tileToMaximize)}})},maximize:function($tileToMaximize,animDuration,event){var _opt=this._options;animDuration=typeof animDuration==="number"?animDuration:this.options.animationDuration;if(!$tileToMaximize){return}if(_opt.$maximizedTile&&_opt.$maximizedTile.attr("data-index")===$tileToMaximize.attr("data-index")){return}if(!_opt.useMaximizedTileIndex){_opt.$leftPanel.addClass(this.css.overflowVisible).removeClass(this.css.overflowHidden);if(!_opt.$maximizedTile){this._toMaximizedView($tileToMaximize,animDuration,event)}else{this._maximizedTileSwap($tileToMaximize,animDuration,event)}}else{this._maximizeTileWithCustomIndex($tileToMaximize,animDuration,event)}},minimize:function(animDuration,event){var _opt=this._options,$tileToMinimize=_opt.$maximizedTile,gl=_opt.gridLayout,rightTilesOffset=_opt.$rightPanel.igPosition().left,tileToMinimizeIndex;if(!$tileToMinimize){return}this.element.css("min-width",0);tileToMinimizeIndex=parseInt($tileToMinimize.attr("data-index"),10);_opt.$leftPanel.width(_opt.$leftPanel.outerWidth(true)).height(_opt.$leftPanel.outerHeight(true)).css({margin:0});this._toMinimizedState($tileToMinimize);$tileToMinimize.css({width:$tileToMinimize.outerWidth(),height:$tileToMinimize.outerHeight(),top:gl.marginTop,left:gl.marginLeft});_opt.$tiles.not($tileToMinimize).each(function(){var $tile=$(this);$tile.css({left:"+="+rightTilesOffset,top:"-="+_opt.$rightPanel.scrollTop()});if(parseInt($tile.attr("data-index"),10)>tileToMinimizeIndex){$tile.appendTo(_opt.$leftPanel)}else{$tile.insertBefore($tileToMinimize)}});this._hideSplitterElements();this.reflow(true,animDuration,event)},maximizedTile:function(){return this._options.$maximizedTile||null},minimizedTiles:function(){var minimizedTiles=this._options.$tiles.not(this._options.$maximizedTile);return minimizedTiles.length>0?minimizedTiles:null},splitter:function(){return this._options.useMaximizedTileIndex?null:this.element.data("igSplitter")},layoutManager:function(){return this._options.$layoutManagerElement.data("igLayoutManager")},reflow:function(forceReflow,animationDuration,event){this.layoutManager().reflow(forceReflow,animationDuration,event)},widget:function(){return this.element},_triggerDataBinding:function(){var args={owner:this,dataSource:this.options.dataSource};return this._trigger(this.events.dataBinding,null,args)},_triggerDataBound:function(success,msg,dataView){var args={owner:this,success:success,errorMessage:msg,dataView:dataView};this._trigger(this.events.dataBound,null,args)},_triggerRendering:function(tiles,items){var args={owner:this,tiles:tiles,items:items};return this._trigger(this.events.rendering,null,args)},_triggerRendered:function(){this._trigger(this.events.rendered,null,{owner:this})},_triggerTileRendering:function(event,ui){var args={owner:this,tile:ui.item};return this._trigger(this.events.tileRendering,event,args)},_triggerTileRendered:function(event,ui){var args={owner:this,tile:ui.item};return this._trigger(this.events.tileRendered,event,args)},_triggerTileMaximizing:function(event,tile){var args={owner:this,tile:tile,minimizingTile:this._options.$maximizedTile||null};return this._trigger(this.events.tileMaximizing,event,args)},_triggerTileMaximized:function(event,tile){var args={owner:this,tile:tile};this._trigger(this.events.tileMaximized,event,args)},_triggerTileMinimizing:function(event,tile,maximizingTile){var args={owner:this,tile:tile,maximizingTile:maximizingTile||null};return this._trigger(this.events.tileMinimizing,event,args)},_triggerTileMinimized:function(event,tile){var args={owner:this,tile:tile};this._trigger(this.events.tileMinimized,event,args)},dataBind:function(){var noCancel;this._initDataSource();noCancel=this._triggerDataBinding();if(noCancel){this.options.dataSource.dataBind(this._renderData,this)}},_destroyTiles:function(){var self=this,_opt=this._options;_opt.$layoutManagerElement.igLayoutManager("destroy");if(!_opt.useMaximizedTileIndex){this.element.igSplitter("destroy")}if(_opt.fromMarkup){if(_opt.useMaximizedTileIndex){_opt.$tiles.each(function(){var $tile=$(this);$tile.children().removeClass(self.css.innerContainer).appendTo(self.element).children("."+self.css.hidden).removeClass(self.css.hidden);$tile.remove()})}else{this._removePanels();this.element.children().children().unwrap()}}else{this.element.empty()}},_removeEventHandlers:function(){var _opt=this._options,elHandlers=_opt.elementHandlers,minimizeBtnSelector=this._selectors.minimizeBtnSelector,minimizedTileSelector=this._selectors.minimizedTileSelector;this.element.off("click",minimizedTileSelector,elHandlers.minimizedTileClick).off("mouseover",minimizedTileSelector,elHandlers.miminimizedTileMouseOver).off("mouseout",minimizedTileSelector,elHandlers.minimizedTileMouseOut).off("click",minimizeBtnSelector,elHandlers.minimizeBtnClick).off("mouseover",minimizeBtnSelector,elHandlers.minimizeBtnMouseOver).off("mouseout",minimizeBtnSelector,elHandlers.minimizeBtnMouseOut);$(window).off("resize",_opt.windowHandlers.resize)},_toggleDisabled:function(value){var splitter=this.splitter(),layoutManager=this._options.$layoutManagerElement.data().igLayoutManager;if(splitter){splitter.options.disabled=value}if(layoutManager){layoutManager.options.disabled=value}},destroy:function(){this.element.removeClass(this.css.container);this._destroyTiles();this._removeEventHandlers();this._superApply(arguments);return this}});$.extend($.ui.igTileManager,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI jQuery File Upload 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *  jquery.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.util.js
 *  infragistics.util.jquery.js
 *  infragistics.ui.widget.js
 *  infragistics.ui.shared.js
 */
(function($){$.widget("ui.igBrowseButton",$.ui.igButton,{_const:{filePickerWidth:"220px",filePickerHeight:"30px"},css:{filePickerClass:"ui-igbrowsebutton-filepicker"},options:{autoselect:true,multipleFiles:false,container:null},_id:function(id){return this.element[0].id+id},_create:function(){var filepickerId=this._id("_fp"),self=this;$.extend($.ui.igBrowseButton.prototype.options,$.ui.igButton.prototype.options);$.extend($.ui.igBrowseButton.prototype.css,$.ui.igButton.prototype.css);$.ui.igButton.prototype._create.apply(this);this._createFilePicker(filepickerId);this._attachBrowseButtonEvents();if(this.options.disabled===true){this._enableFilePicker(true)}else{this.element.bind({click:function(e){e.preventDefault()},drop:function(e){var files=e.originalEvent.dataTransfer.files;e.stopPropagation();e.preventDefault();if(files===null||files===undefined){return false}if(!self._trigger("fileselect",e,{files:files,multiple:true})){return}return false}})}},_createFilePicker:function(filepickerId){$("#"+filepickerId).remove();var multiple="",container=this.options.container;if(this.options.multipleFiles===true){multiple=' multiple=""'}if(!container){container=$(document.body)}this.filePicker=$('<input type="file" id="'+filepickerId+'"'+multiple+"/>").appendTo(container);this.filePicker.css({position:"absolute",margin:"-5px 0 0 -175px",padding:"0",width:"1px",height:"1px",fontSize:"14px",opacity:"0",cursor:"pointer",display:"block",zIndex:"1000000",filter:"alpha(opacity=0)"});this._setTitle(this.options.title)},_setTitle:function(title){var filePicker=$("#"+this._id("_fp"));if(title===false){filePicker.removeAttr("title")}else{filePicker.attr("title",title)}},_attachBrowseButtonEvents:function(){var self=this;this.mouseMoveEvent={mousemove:function(event){self._mousemove(event)}};this._internalEvents={mouseover:function(event){self._mousemove(event);self._attachMouseMove(true)}};self.element.bind(this._internalEvents);self._filePickerBindChange()},_filePickerBindChange:function(){var self=this,filePath,filePicker=$("#"+this._id("_fp"));self.tempClicked=false;self._filePickerEvents={change:function(event){var files=null,multiple=false;filePath=self._fileFromPath(filePicker.val());if(filePicker[0].files){files=filePicker[0].files;multiple=true}self._mousemove(event);if(!self._trigger("fileselect",event,{filePath:filePath,files:files,multiple:multiple})){return}},click:function(event){if(!self._trigger("click",event)){return false}}};filePicker.bind(self._filePickerEvents)},attachFilePicker:function(e,isHidden){var self=this,right,bottom,t,l,relativeOffset,fileUploadButton=self.element,filePicker=this.filePicker,offset=fileUploadButton.igOffset(),left=parseInt(offset.left,10),top=parseInt(offset.top,10),filePickerDOM=filePicker[0];right=parseInt(left+fileUploadButton[0].offsetWidth,10);bottom=parseInt(top+fileUploadButton[0].offsetHeight,10);if(e.pageX>=left&&e.pageX<=right&&e.pageY>=top&&e.pageY<=bottom){relativeOffset=$.ig.util.getRelativeOffset(filePicker);t=e.pageY;l=e.pageX;t-=relativeOffset.top;l-=relativeOffset.left;filePickerDOM.style.top=t+"px";filePickerDOM.style.left=l+"px";if(isHidden===true){filePicker.css({width:"1px",height:"1px"})}else{self.isVisibleFilePicker=true;filePicker.css({width:self._const.filePickerWidth,height:self._const.filePickerHeight})}filePickerDOM.style.display="block";self._onMouseOver(e)}},getFilePicker:function(){var filepickerId=this._id("_fp"),filePicker=$("#"+filepickerId);filePicker.attr("id","").css({display:"none"});this._createFilePicker(filepickerId);this._filePickerBindChange();return filePicker},_mousemove:function(e){var self=this,right,bottom,t,l,fileUploadButton=self.element,filePicker=this.filePicker,relativeOffset,left=$.ig.util.offset(fileUploadButton).left,top=$.ig.util.offset(fileUploadButton).top,filePickerDOM=filePicker[0];right=parseInt(left+fileUploadButton[0].offsetWidth,10);bottom=parseInt(top+fileUploadButton[0].offsetHeight,10);if(e.pageX>=left&&e.pageX<=right&&e.pageY>=top&&e.pageY<=bottom){relativeOffset=$.ig.util.getRelativeOffset(filePicker);t=e.pageY;l=e.pageX;t-=relativeOffset.top;l-=relativeOffset.left;filePickerDOM.style.top=t+"px";filePickerDOM.style.left=l+"px";if(!self.isVisibleFilePicker){filePicker.css({width:self._const.filePickerWidth,height:self._const.filePickerHeight});self.isVisibleFilePicker=true}filePickerDOM.style.display="block";self._onMouseOver(e)}else{if(self.isVisibleFilePicker){filePicker.css({width:"1px",height:"1px"});self.isVisibleFilePicker=false}self._attachMouseMove(false);self._onMouseOut(e)}},_attachMouseMove:function(isToAttach){if(isToAttach){$(document).bind(this.mouseMoveEvent)}else{$(document).unbind(this.mouseMoveEvent)}},_setOption:function(key,value){$.ui.igButton.prototype._setOption.apply(this,arguments);$.Widget.prototype._setOption.apply(this,arguments);switch(key){case"disabled":this._enableFilePicker(value);$.ui.igButton.prototype._setOption.apply(this,arguments);break;case"title":this._setTitle(value);break;default:break}},_enableFilePicker:function(isDisabled){var filePicker=$("#"+this._id("_fp"));if(isDisabled===false){this.isVisibleFilePicker=false;this._attachMouseMove(true);this.element.bind(this._internalEvents).mouseover()}else{this._attachMouseMove(false);filePicker.css({width:"1px",height:"1px"});this.element.unbind(this._internalEvents)}},destroy:function(){this.element.unbind(this._internalEvents);this.element.unbind(this.mouseMoveEvent);this._superApply(arguments);$.ui.igButton.prototype.destroy.apply(this);$("#"+this._id("_fp")).remove()},_fileFromPath:function(file){return file.replace(/(\/|\\)$/,"")}});$.extend($.ui.igBrowseButton,{version:"21.2.12"});$.widget("ui.igUpload",$.ui.igWidget,{_const:{fileNameLimit:100,AjaxQueueName:"uploadrequestsqueue",debug:true,isProgressBarAnimationEnabled:true,isProgressBarRange:false,timeoutGetFileSize:1e3,status:{NotStarted:0,Started:1,Finished:2,NoSuchFile:3,Canceled:4},errorCode:{MimeTypeValidation:1,FileSizeExceeded:2},clientSideErrorCode:{maxAllowedUploadingFiles:1,extensionValidation:2,startUpload:3,ajaxErrorGetFileStatus:4,ajaxErrorCancelUpload:5,removeFileUpload:6,ajaxErrorRequestFileSize:7,checkCanUpload:8,maxFileSizeExcceeded:9,dropMultipleFilesWhenSingleMode:10},fileStatusNoError:-1,progressUpdateInterval:800,animateProgressBarInterval:10,showHideDetailsAnimationTimeout:500,doubleCheckRequestInterval:1e3,removeSingleUploadAnimationTimeout:300,maxUploadFilesDefault:-1},defaultFileExtensionIcons:[{ext:[],css:"ui-icon ui-icon-document "+"ui-igupload-progressbar-icon "+"ui-igupload-progressbar-icon-default",def:true},{ext:["exe","app"],css:"ui-icon ui-icon-gear ui-igupload-progressbar-icon ui-igupload-progressbar-icon-exe",def:false},{ext:["gif","jpg","jpeg","png","bmp","yuv","tif","thm","psd"],css:"ui-icon ui-icon-image ui-igupload-progressbar-icon ui-igupload-progressbar-icon-images",def:false},{ext:["mp3","wav","mp4","aac","mid","wma","ra","iff","aif","m3u","mpa"],css:"ui-icon ui-icon-volume-on "+"ui-icon ui-icon-image "+"ui-igupload-progressbar-icon "+"ui-igupload-progressbar-icon-music",def:false},{ext:["doc","docx","xls","xlsx","txt","ppt","pptx","pdf"],css:"ui-icon ui-icon-document ui-igupload-progressbar-icon ui-igupload-progressbar-icon-docs",def:false},{ext:["3gp","asf","asx","avi","flv","mov","mp4","mpg","rm","swf","vob","wmv"],css:"ui-icon ui-icon-video ui-igupload-progressbar-icon ui-igupload-progressbar-icon-video",def:false}],css:{clearClass:"ui-helper-clearfix",hiddenClass:"ui-helper-hidden",baseClassIE6:"ui-ie6",baseClassIE7:"ui-ie7",baseClassMoz:"ui-moz",baseClassOpera:"ui-opera",baseClassWebkit:"ui-webkit",startupBrowseButtonClasses:"ui-igstartupbrowsebutton",baseClass:"ui-widget ui-widget ui-widget-content ui-corner-all ui-igupload",baseMainContainerClass:"ui-igupload-basemaincontainer",multipleDialogClasses:"ui-iguploadmultiple",singleDialogClass:"ui-iguploadsingle",browseButtonClass:"ui-igupload-browsebutton",containerClass:"ui-igupload-container ui-widget-content",uploadProgressClass:"ui-igupload-uploadprogress",fileInfoMainContainer:"ui-igupload-fimaincontainer",progressContainer:"ui-helper-clearfix",progressBarUploadClass:"ui-igupload-progressbar-upload ui-igupload-progressbar-upload-single ui-helper-clearfix",progressBarFileNameClass:"ui-igupload-progressbar-filename",progressBarFileSizeClass:"ui-igupload-progressbar-filesize",progressBarInnerHTMLContainerClass:"ui-igupload-progressbar-container ui-helper-clearfix",containerButtonCancelClass:"ui-container-button-cancel-class  ui-helper-clearfix",summaryProgressBarClass:"ui-igupload-summaryprogressbar",summaryProgressContainerClass:"ui-igupload-summaryprogresscontainer",summaryProgressbarLabelClass:"ui-igupload-summaryprogress-label",summaryInformationContainerClass:"ui-igupload-summaryinformation-container ui-helper-clearfix",summaryUploadedFilesLabelClass:"ui-igupload-summaryuploadedfiles-label",summaryShowHideDetailsButtonClass:"ui-igupload-showhidedetails-button",summaryButtonClass:"ui-igupload-summary-button",summaryProgressBarInnerProgress:"ui-igupload-summaryprogres_summpbar_progress",summaryProgressBarSecondaryLabel:"ui-igupload-summaryprogress-label ui-igupload-summaryprogress-secondary-label",containerFUS:"ui-widget-content ui-igupload-progress-container ui-corner-all ui-helper-clearfix"},options:{width:"",height:"",autostartupload:false,labelUploadButton:undefined,labelAddButton:undefined,labelClearAllButton:undefined,labelSummaryTemplate:undefined,labelSummaryProgressBarTemplate:undefined,labelShowDetails:undefined,labelHideDetails:undefined,labelSummaryProgressButtonCancel:undefined,labelSummaryProgressButtonContinue:undefined,labelSummaryProgressButtonDone:undefined,labelProgressBarFileNameContinue:undefined,errorMessageMaxFileSizeExceeded:undefined,errorMessageGetFileStatus:undefined,errorMessageCancelUpload:undefined,errorMessageNoSuchFile:undefined,errorMessageOther:undefined,errorMessageValidatingFileExtension:undefined,errorMessageAJAXRequestFileSize:undefined,errorMessageTryToRemoveNonExistingFile:undefined,errorMessageTryToStartNonExistingFile:undefined,errorMessageMaxUploadedFiles:undefined,errorMessageMaxSimultaneousFiles:undefined,errorMessageDropMultipleFilesWhenSingleModel:undefined,locale:{labelUploadButton:undefined,labelAddButton:undefined,labelClearAllButton:undefined,labelSummaryTemplate:undefined,labelSummaryProgressBarTemplate:undefined,labelShowDetails:undefined,labelHideDetails:undefined,labelSummaryProgressButtonCancel:undefined,labelSummaryProgressButtonContinue:undefined,labelSummaryProgressButtonDone:undefined,labelProgressBarFileNameContinue:undefined,errorMessageFileSizeExceeded:undefined,errorMessageGetFileStatus:undefined,errorMessageCancelUpload:undefined,errorMessageNoSuchFile:undefined,errorMessageOther:undefined,errorMessageValidatingFileExtension:undefined,errorMessageAJAXRequestFileSize:undefined,errorMessageMaxUploadedFiles:undefined,errorMessageMaxSimultaneousFiles:undefined,errorMessageTryToRemoveNonExistingFile:undefined,errorMessageTryToStartNonExistingFile:undefined,errorMessageDropMultipleFilesWhenSingleModel:undefined,titleUploadFileButtonInit:undefined,titleAddFileButton:undefined,titleCancelUploadButton:undefined,titleSummaryProgressButtonContinue:undefined,titleClearUploaded:undefined,titleShowDetailsButton:undefined,titleHideDetailsButton:undefined,titleSummaryProgressButtonCancel:undefined,titleSummaryProgressButtonDone:undefined,titleSingleUploadButtonContinue:undefined,titleClearAllButton:undefined},uploadUrl:"ig_fua34sf345sdf13sdf3454erdsf2345asd3425df5235d54df345.aspx",progressUrl:"IGUploadStatusHandler.ashx",allowedExtensions:[],showFileExtensionIcon:true,css:null,fileExtensionIcons:[{ext:[],css:"",def:false}],mode:"single",multipleFiles:false,maxUploadedFiles:-1,maxSimultaneousFilesUploads:1,fileSizeMetric:"auto",controlId:"",fileSizeDecimalDisplay:2,maxFileSize:null,useSingleRequest:false},events:{fileSelecting:"fileSelecting",fileSelected:"fileSelected",fileUploading:"fileUploading",fileUploaded:"fileUploaded",fileUploadAborted:"fileUploadAborted",cancelAllClicked:"cancelAllClicked",onError:"onError",fileExtensionsValidating:"fileExtensionsValidating",onXHRLoad:"onXHRLoad",onFormDataSubmit:"onFormDataSubmit"},summaryButtonModes:{cancel:1,startupload:2,done:3},container:function(){if(this._isDivElement){return this.element}return $("#"+this.element[0].id+"_wrprinit")},widget:function(){return this.element},_id:function(suffix,formNumber){var id=this.element[0].id;if(formNumber!==undefined){return id+"_"+formNumber+"_"+suffix}return id+suffix},_create:function(){var data={formNumber:0,iframe:{ids:[]},pendingQueueIDs:[],uploadingIDs:[],batch:[],lastId:-1,filesInfo:[],countUploadingFiles:0,countTotalFiles:0,fileSizeUploaded:0,fileSizeTotal:0};this.css=$.extend({},this.css,this.options.css);this.allCancelled=false;this.fileInfoData=data;this._renderStartupBrowseButton();this.container().bind("drop",$.proxy(this._dropFiles,this)).width(this.options.width).height(this.options.height);this._attachFakeIframe();this._analyzeFileExtensionIcons();$(document).bind("dragenter."+this.element[0].id,$.proxy(this._docEnter,this));$(document).bind("dragover."+this.element[0].id,$.proxy(this._docOver,this));$(document).bind("dragleave."+this.element[0].id,$.proxy(this._docLeave,this))},_dropFiles:function(e){var isInit=$("#"+this._id("_ibb")).is(":visible"),data={files:e.originalEvent.dataTransfer.files,multiple:true};e.preventDefault();if(isInit){this._initBrowserFileSelect(e,data)}else{this._onBrowseButtonFileSelected(e,false,data)}return false},_docEnter:function(e){e.preventDefault();return false},_docOver:function(e){e.preventDefault();return false},_docLeave:function(e){e.preventDefault();return false},_analyzeFileExtensionIcons:function(){var i,j,arrIconExtensions=this.options.fileExtensionIcons,lengthIconExtensions,defIconExtensions=$.extend(true,[],this.defaultFileExtensionIcons),lengthDefaultIconExtensions=defIconExtensions.length,resArr=[],isDefaultDefined=false;if(arrIconExtensions===undefined||arrIconExtensions===null){this.options.fileExtensionIcons=defIconExtensions;return}lengthIconExtensions=arrIconExtensions.length;if(lengthIconExtensions===1&&arrIconExtensions[0].css===""){this.options.fileExtensionIcons=defIconExtensions;return}for(j=0;j<lengthIconExtensions;j++){for(i=0;i<lengthDefaultIconExtensions;i++){defIconExtensions[i].ext=this._removeCommonElementsInArrays(defIconExtensions[i].ext,arrIconExtensions[j].ext)}if(arrIconExtensions[j].def===true){isDefaultDefined=true}resArr.push(arrIconExtensions[j])}for(i=0;i<lengthDefaultIconExtensions;i++){if(defIconExtensions[i].ext.length>0||isDefaultDefined===false&&defIconExtensions[i].def===true){resArr.push(defIconExtensions[i])}}this.options.fileExtensionIcons=resArr},_removeCommonElementsInArrays:function(arr1,arr2){return $.grep(arr1,function(n){return $.inArray(n,arr2)===-1})},_attachFakeIframe:function(){var idTempIframe=this._id("_tempIframe");if($.ig.util.isIE7||$.ig.util.isIE8||$.ig.util.isIEQuircks){$("#"+idTempIframe).remove();setTimeout($('<iframe src="javascript:false;" '+'id="'+idTempIframe+'" '+'style="display: none;"></iframe>').appendTo($("#"+this._id("_fu"))),300)}},_renderStartupBrowseButton:function(){var self=this,attr,i,css=self.css,e=self.element,o=self.options,bbId=this._id("_ibb"),isMultipleFiles=o.mode==="multiple"&&o.multipleFiles,wrapperElementId=this._id("_wrprinit"),containerDiv,button;if(this.element.is("div")){this._isDivElement=true;this.originalElement=e;containerDiv=e;this._initialAttributes=[];attr=this.element[0].attributes;for(i=0;i<attr.length;i++){if(attr[i].name!=="id"){this._initialAttributes.push({name:attr[i].name,value:attr[i].value})}}this._initialHTML=this.element.html();this.element.empty()}else{this.originalElement=e;containerDiv='<div id="'+wrapperElementId+'" class="ig-upload-container"></div>';e.wrap(containerDiv);e.hide();e=$("#"+wrapperElementId)}bbId=this._id("_ibb");if($.ig.util.isIE7){e.addClass(css.baseClassIE7)}else if($.ig.util.isOpera){e.addClass(css.baseClassOpera)}else if($.ig.util.isOpera){e.addClass(css.baseClassMoz)}else if($.ig.util.isOpera){e.addClass(css.baseClassWebkit)}button=$("<button></button>").appendTo(e).attr("id",bbId).addClass(css.startupBrowseButtonClasses);button.igBrowseButton({multipleFiles:isMultipleFiles,labelText:this._getLocaleValue("labelUploadButton"),container:this.container(),title:this._getLocaleValue("titleUploadFileButtonInit"),fileselect:function(event,data){self._initBrowserFileSelect(event,data)},disabled:o.disabled,click:function(event){var isCancelEvent=false;if(self._trigger(self.events.fileSelecting,event,{owner:self})===false){isCancelEvent=true}return!isCancelEvent}})},_initBrowserFileSelect:function(event,data){var countFiles=1,filePicker,o=this.options;if(!data||!data.files||data.files.length===0){filePicker=$("#"+this._id("_ibb_fp"));if(this._validateFileExtension(filePicker[0].value,true,null)===false){return}}else if(o.mode==="single"&&data.files.length>1){this._setError(this._getLocaleValue("errorMessageDropMultipleFilesWhenSingleModel"),null,this._const.clientSideErrorCode.dropMultipleFilesWhenSingleMode,"clientside");return}if(this._checkMaxUploadingFilesCount(countFiles,true)===true){$("#"+this._id("_ibb")).css({display:"none"});this._HTMLUpload();this._onBrowseButtonFileSelected(event,true,data)}},_HTMLUpload:function(){var uploaderId=this._id("_fu"),baseMainContainerId=this._id("_bmncntr"),o=this.options,e=this.container(),self=this,css=self.css,fileContainerId=this._id("_fc"),browseButtonId=this._id("_bb"),clearAllButtonId=this._id("_clrabtn"),uploaderContainerId=this._id("_fi_main_cntnr"),clearAllButton,html="";if(o.mode==="single"){html+='<div  class="'+css.singleDialogClass+'" id="$baseMainContainerId">';html+='   <div id="$uploaderId$" class="$baseMainContainerClass">';html+='\t\t<div id="$fileContainerId$"></div>';html+='\t\t<button id="$browseButtonId$" class="$browseButtonClass$"></button>';html+="\t</div>";html+="</div>"}else if(o.mode==="multiple"){html='<div class="'+css.multipleDialogClasses+'" id="$baseMainContainerId">';html+='   <div  id="$uploaderId$" class="$baseMainContainerClass">';html+='\t\t<div id="$uploaderFilesContainer" class="$fuMainContainerClass">';html+='\t\t\t<button id="$browseButtonId$" class="$browseButtonClass$"></button>';html+='\t\t\t<button id="$clearAllButtonId$"></button>';html+='\t\t\t<div id="$fileContainerId$"></div>';html+="\t\t</div>";html+="   </div>";html+="</div>"}html=html.replace("$uploaderId$",uploaderId).replace("$browseButtonId$",browseButtonId).replace("$baseMainContainerId",baseMainContainerId).replace("$browseButtonClass$",css.browseButtonClass).replace("$fileContainerId$",fileContainerId).replace("$clearAllButtonId$",clearAllButtonId).replace("$uploaderFilesContainer",uploaderContainerId).replace("$fuMainContainerClass",css.fileInfoMainContainer).replace("$baseMainContainerClass",css.baseMainContainerClass);$(html).appendTo(e).css({width:o.width,height:o.height}).addClass(css.baseClass);clearAllButton=$("#"+clearAllButtonId);if(clearAllButton.length>0){clearAllButton.igButton({title:this._getLocaleValue("titleClearAllButton"),labelText:this._getLocaleValue("labelClearAllButton"),disabled:true,click:function(event){event.preventDefault();self.clearAll()},css:{buttonClasses:"ui-igbutton ui-igupload-button-clear-all",buttonHoverClasses:"",buttonActiveClasses:"",buttonFocusClasses:"",buttonLabelClass:""}})}$("#"+browseButtonId).igBrowseButton({multipleFiles:o.mode==="multiple"&&o.multipleFiles,labelText:this._getLocaleValue("labelAddButton"),container:this.container(),title:this._getLocaleValue("titleAddFileButton"),fileselect:function(event,data){self._onBrowseButtonFileSelected(event,false,data)},click:function(event){var isCancelEvent=false;if(self._trigger(self.events.fileSelecting,event,{owner:self})===false){isCancelEvent=true}return!isCancelEvent}});$("#"+fileContainerId).addClass(css.containerClass);if(o.mode==="multiple"){self._spbRenderInit()}},_disableBrowseButton:function(isToDisable){$("#"+this._id("_bb")).igBrowseButton("option","disabled",isToDisable);$("#"+this._id("_ibb")).igBrowseButton("option","disabled",isToDisable)},_checkMaxUploadingFilesCount:function(count,callEvent){if(count===null||count===undefined){count=1}var o=this.options,allowUpload=true,totalFiles=this.fileInfoData.countTotalFiles+count;if(o.maxUploadedFiles!==this._const.maxUploadFilesDefault&&o.maxUploadedFiles!==null&&totalFiles>o.maxUploadedFiles){allowUpload=false;if(callEvent===true){this._setError(this._getLocaleValue("errorMessageMaxUploadedFiles"),null,this._const.clientSideErrorCode.maxAllowedUploadingFiles,"clientside")}}return allowUpload},_onBrowseButtonFileSelected:function(event,isInitBrowseButton,data){var self=this,allFilesData=this.fileInfoData,o=self.options,fileData,countFiles=1;if(data&&data.files&&data.files.length>=1){countFiles=data.files.length;if(o.mode==="single"){if(countFiles>1){self._setError(this._getLocaleValue("errorMessageDropMultipleFilesWhenSingleModel"),null,self._const.clientSideErrorCode.dropMultipleFilesWhenSingleMode,"clientside");return}}}if(self._checkMaxUploadingFilesCount(countFiles,true)===false){if(data.multiple===true){return}self._disableBrowseButton(true);return}if(o.maxUploadedFiles!==null&&o.maxUploadedFiles!==this._const.maxUploadFilesDefault&&o.maxUploadedFiles===allFilesData.countTotalFiles+countFiles){self._disableBrowseButton(true)}if(o.mode==="single"){if(allFilesData.iframe.ids.length===0){self._removeSingleUpload(allFilesData.lastId);fileData=allFilesData.files||data;if(self._attachIframe(event,isInitBrowseButton,fileData)===true){self._disableBrowseButton(true)}}}else if(o.mode==="multiple"){if(self._attachIframe(event,isInitBrowseButton,data)===false){self._disableBrowseButton(false)}}},clearAll:function(){var e=this.container(),arr=e.data("finishedIDs"),id,l;if(arr===undefined){return}l=arr.length;for(id=0;id<l;id++){this._removeSingleUpload(arr[id])}arr=[];e.data("finishedIDs",arr);this._disableClearAllButton()},_enableClearAllButton:function(){$("#"+this._id("_clrabtn")).igButton({disabled:false})},_disableClearAllButton:function(){$("#"+this._id("_clrabtn")).igButton("option","disabled",true)},_attachIframe:function(event,isInitBrowseButton,data){var res,files,filePicker,browse=$("#"+this._id("_bb"));if(data&&data.files){files=data.files}if(isInitBrowseButton===true){filePicker=$("#"+this._id("_ibb")).igBrowseButton("getFilePicker")}else{filePicker=browse.igBrowseButton("getFilePicker")}if(filePicker[0].files&&(files===null||files===undefined)){files=filePicker[0].files}if(files&&files.length>=1){res=this._uploadMultiple(files);filePicker.remove()}else{res=this._createForm(filePicker)}return res},_uploadMultiple:function(files){var res,i,filesLength=files.length,data=this.fileInfoData,fileId=data.formNumber,o=this.options;for(i=0;i<filesLength;i++){res=this._html5createForm(files[i],i,fileId)}if(o.autostartupload&&o.useSingleRequest){var retVal=this._html5upload();if(retVal){data.batch=[];this._spbCheckModeButton()}else{var idsToRemove=data.batch;for(i=0;i<idsToRemove.length;i++){var id=idsToRemove[i];this._removeIframe(id);this._removeFileUpload(id)}}}return res},_html5upload:function(fileId){var xhr=new XMLHttpRequest,formData=new FormData,o=this.options,self=this,cid=o.controlId,upload=xhr.upload;var fileInfo,file,key,uploadUrl;if(fileId!==undefined){fileInfo=this.fileInfoData.filesInfo[fileId];file=fileInfo.file;key=fileInfo.key;uploadUrl=o.uploadUrl+"?key="+key+"&cid="+cid+"&multiple=true";xhr.open("POST",uploadUrl);xhr.withCredentials="true";self._trigger(self.events.onFormDataSubmit,null,{formData:formData,fileId:fileId,fileInfo:fileInfo,xhr:xhr,owner:self});formData.append(this._id("_frm",fileId)+"_if",file);this.fileInfoData.filesInfo[fileId].xhr=xhr}else{var idsToSend=this.fileInfoData.batch,fileSize=0;fileInfo=[];file=[];key="";fileId=[];for(var i=0;i<idsToSend.length;i++){var currentFileId=idsToSend[i],currentFileInfo=this.fileInfoData.filesInfo[currentFileId],currentFile=currentFileInfo.file,currentKey=currentFileInfo.key,currentFileSize=0;if(currentFile){currentFileSize=currentFile.size}if($.type(currentFileSize)==="number"){fileSize+=currentFileSize}formData.append(this._id("_frm",currentFileId)+"_if",currentFile);this.fileInfoData.filesInfo[currentFileId].xhr=xhr;fileInfo.push(currentFileInfo);file.push(currentFile);if(key===""){key+=currentKey}else{key+=";"+currentKey}fileId.push(currentFileId);var eventArgs={formData:formData,fileId:currentFileId,fileInfo:currentFileInfo,xhr:xhr,owner:self};self._trigger(self.events.onFormDataSubmit,null,eventArgs)}if($.type(o.maxFileSize)==="number"&&$.type(fileSize)==="number"&&o.maxFileSize>-1&&fileSize>o.maxFileSize){self._setError(fileId,this._getLocaleValue("errorMessageMaxFileSizeExceeded"),self._const.clientSideErrorCode.maxFileSizeExcceeded,"clientside");return false}uploadUrl=o.uploadUrl+"?key="+key+"&cid="+cid+"&multiple=true";xhr.open("POST",uploadUrl);xhr.withCredentials="true"}upload.addEventListener("progress",function(e){self._html5progress(e,fileId)},false);upload.addEventListener("error",function(){self._getFileStatus(fileId,true)},false);xhr.onload=function(e){var responseText,response,error,msg;self._trigger(self.events.onXHRLoad,e,{fileId:fileId,xhr:xhr,fileInfo:fileInfo,owner:self});if(xhr.status>=200&&xhr.status<=299){responseText=xhr.responseText;if(responseText){response=self._stringToXmlObject(responseText);if(response){error=parseInt(response.find("error").text(),10);msg=response.find("serverMessage").text()}else{response=self._stringToJSONObject(responseText);if(response){error=parseInt(response.error,10);msg=response.serverMessage}}fileInfo.serverMessage=msg;if(!isNaN(error)){if(msg){self._setFileStatus(fileId,true,{error:error,serverMessage:msg})}else{self._getFileStatus(fileId,true)}return}self._html5progress(e,fileId,true)}else{self._html5progress(e,fileId,true)}}else{self._getFileStatus(fileId,true)}};xhr.send(formData);return true},_html5progress:function(e,formInfo,isFinish){if(typeof formInfo==="number"){this._html5progressSingle(e,formInfo,isFinish)}else{for(var i=0;i<formInfo.length;i++){this._html5progressSingle(e,formInfo[i],isFinish)}}},_html5progressSingle:function(e,formNumber,isFinish){var self=this,singleFileData,data={};if(e.lengthComputable||isFinish){singleFileData=this.getFileInfo(formNumber);if(singleFileData&&singleFileData.innerStatus===self._const.status.Canceled){return}data.size=e.total||0;data.bytesUploaded=e.loaded>singleFileData.sizeBytes?singleFileData.sizeBytes:e.loaded||0;if(isFinish){data.total=data.bytesUploaded=singleFileData.sizeBytes;data.status=self._const.status.Finished}else{data.status=self._const.status.Started}self._setFileStatus(formNumber,true,data)}else{self.cancelUpload(formNumber)}},addDataField:function(formData,field){if(!field||$.type(field)!=="object"){return}this.addDataFields(formData,[field])},addDataFields:function(formData,fields){if(!formData||$.type(fields)!=="array"||!fields.length){return}var i,len=fields.length,f,isHTMLForm;isHTMLForm=formData.length&&formData.is("form");if(!isHTMLForm){if(!(formData instanceof FormData)){return}}for(i=0;i<len;i++){f=fields[i];if(!f.name||$.type(f.value)!=="string"){continue}if(isHTMLForm){$("<input />").attr({type:"hidden",name:f.name,value:f.value}).appendTo(formData)}else{formData.append(f.name,f.value)}}},_html5createForm:function(fileInfo,ind,formNumber){var self=this,o=self.options,fileName=fileInfo.name,fileSize=fileInfo.size,data=this.fileInfoData,fileId=data.formNumber++,key=self._randomString(30),status=self._const.status.Started;if(self._validateFileExtension(fileInfo.name,true,formNumber)===false){if(o.mode==="multiple"){self._spbRenderProgress()}if(o.maxUploadedFiles!==null&&o.maxUploadedFiles>=data.countTotalFiles+1){self._disableBrowseButton(false)}return false}if(isNaN(fileSize)){fileSize=0}data.filesInfo[fileId]={path:fileName,key:key,sizeBytes:fileSize,uploadedBytes:0,status:self._const.status.NotStarted,checksNoSuchFile:0,innerStatus:self._const.status.NotStarted,multipleFiles:true,file:fileInfo,formNumber:formNumber};data.countTotalFiles++;self._spbRenderProgress();self._HTMLSingleUpload(fileId);this._saveFileSize(fileSize,fileId);if(o.autostartupload===true&&o.useSingleRequest===false){if(self._checkCanUpload()===true){self.startUpload(fileId)}else{self._addPendingId(fileId);status=self._const.status.NotStarted}}else{if(o.mode==="single"){self._showSingleUploadStartUpload(true,fileId)}else{self._addIDBatch(fileId);status=self._const.status.NotStarted}}data.iframe.ids[data.iframe.ids.fileId]={id:fileId,status:status};if(o.mode==="multiple"){self._spbCheckModeButton()}self._trigger(self.events.fileSelected,null,{owner:self,fileId:fileId,filePath:self._getOnlyFileName(fileName)});return true},_createForm:function(filePicker){var self=this,o=self.options,data=this.fileInfoData,fileId=data.formNumber++,iframeId=this._id("_ifrm",fileId),formId=this._id("_frm",fileId),form,key=self._randomString(30),status=self._const.status.Started,cid=o.controlId,uploadUrl=o.uploadUrl+"?key="+key+"&cid="+cid;if(self._validateFileExtension(filePicker[0].value,true,fileId)===false){filePicker.remove();if(o.mode==="multiple"){self._spbRenderProgress()}if(o.maxUploadedFiles!==null&&o.maxUploadedFiles>=data.countTotalFiles+1){self._disableBrowseButton(false)}return false}data.filesInfo[fileId]={path:filePicker.val(),key:key,sizeBytes:0,uploadedBytes:0,status:self._const.status.NotStarted,checksNoSuchFile:0,innerStatus:self._const.status.NotStarted};data.countTotalFiles++;self._spbRenderProgress();$('<iframe src="javascript:false;" id="'+iframeId+'" name="'+iframeId+'"></iframe>').appendTo($(document.body)).css({display:"none"});form=$('<form method="post" enctype="multipart/form-data"></form>').attr("id",formId).attr("target",iframeId).attr("action",uploadUrl).appendTo($(document.body));filePicker.attr("name",formId+"_if").attr("id",formId+"_if").appendTo(form);self._trigger(self.events.onFormDataSubmit,null,{formData:form,fileId:fileId,fileInfo:data.filesInfo[fileId],owner:self});self._HTMLSingleUpload(fileId);if(o.autostartupload===true){if(self._checkCanUpload()===true){self.startUpload(fileId)}else{self._addPendingId(fileId);status=self._const.status.NotStarted;self._getFileSize(fileId,key)}}else{if(o.mode==="single"){self._showSingleUploadStartUpload(true,fileId);self._getFileSize(fileId,key)}else{self._addIDBatch(fileId);status=self._const.status.NotStarted;self._getFileSize(fileId,key)}}data.iframe.ids[data.iframe.ids.fileId]={id:fileId,status:status};if(o.mode==="multiple"){self._spbCheckModeButton()}self._trigger(self.events.fileSelected,event,{owner:self,fileId:fileId,filePath:self._getOnlyFileName(filePicker.val())});return true},_showSingleUploadStartUpload:function(){var self=this,startUploadButtonId="_strtuplbtn",startUploadButton=$("#"+this._id(startUploadButtonId)),browseButton=$("#"+this._id("_bb"));if(startUploadButton.length===0){$('<button id="'+self._id(startUploadButtonId)+'"></button>').appendTo($("#"+self._id("_fu"))).igButton({labelText:this._getLocaleValue("labelSummaryProgressButtonContinue"),title:this._getLocaleValue("titleSingleUploadButtonContinue"),click:function(e){e.preventDefault();self.startUpload(self.fileInfoData.formNumber-1,e);browseButton.igBrowseButton("attachFilePicker",e,true)}});startUploadButton=$("#"+this._id(startUploadButtonId))}browseButton.hide();startUploadButton.show()},_removeIframe:function(iframeNumber){var self=this,data=this.fileInfoData,iframeId=this._id("_ifrm",iframeNumber),formId=this._id("_frm",iframeNumber),browseButton=$("#"+self._id("_bb"));$("#"+iframeId).remove();$("#"+formId).remove();data.iframe.ids=self._removeElementArrayById(data.iframe.ids,iframeNumber);if(self.options.mode==="single"){browseButton.igBrowseButton("option","disabled",false);data.lastId=iframeNumber}this._attachFakeIframe();
},_HTMLSingleUpload:function(formNumber){var self=this,o=this.options,css=self.css,fileContainerId=self._id("_fc"),fileUploadStatusId=self._id("_fus",formNumber),singleProgressBarId=self._id("_snglpbar",formNumber),iconId=self._id("_icn",formNumber),cancelButtonId=self._id("_cbtn",formNumber),fileContainer=$("#"+fileContainerId),fileName=this.fileInfoData.filesInfo[formNumber].path,html,progressBarFileNameId=self._id("_pbrflnm",formNumber),progressBarFileSizeId=self._id("_pbrflsz",formNumber),progressBarFileName,singleProgressBar,iconClass=self._getFileExtensionIconPath(self._getFileExtension(fileName));html='<div id="'+fileUploadStatusId+'">';html+='\t<div class="'+css.containerFUS+'">';html+='\t\t<div class="'+css.containerButtonCancelClass+'">';html+='\t\t\t<button id="'+cancelButtonId+'"></button>';html+="\t\t</div>";html+='\t\t<div class="'+css.progressContainer+'">';html+='\t\t\t<div class="'+css.progressBarInnerHTMLContainerClass+'" ';html+='\t\t\ttitle="'+fileName+'">';html+='\t\t\t\t<span id="'+iconId+'" class="'+iconClass+'"></span>';html+='\t\t\t\t<span class="'+css.progressBarFileNameClass+'" ';html+='\t\t\t\t\tid="'+progressBarFileNameId+'">';html+="\t\t\t\t</span>";html+='\t\t\t\t<span class="'+css.progressBarFileSizeClass+'" ';html+='\t\t\t\t\tid="'+progressBarFileSizeId+'">';html+="\t\t\t\t</span>";html+="\t\t\t</div>";html+='\t\t\t<div id="'+singleProgressBarId+'"';html+='\t\t\t\tclass="'+css.progressBarUploadClass+'">';html+="\t\t\t</div>";html+="\t\t</div>";html+="\t</div>";html+="</div>";$(html).appendTo(fileContainer);$("#"+fileUploadStatusId).addClass(css.uploadProgressClass+" "+css.clearClass);singleProgressBar=$("#"+singleProgressBarId);$("#"+cancelButtonId).igButton({onlyIcons:true,icons:{primary:"ui-icon-closethick"},title:this._getLocaleValue("titleCancelUploadButton"),click:function(event){event.preventDefault();self.cancelUpload(formNumber);$("#"+cancelButtonId).igButton("option",{disabled:true,icons:{primary:"ui-icon-check",secondary:null}})},css:{buttonClasses:"ui-button ui-widget "+"ui-state-default "+"ui-corner-all "+"ui-button-icon-only "+"ui-igbutton "+"ui-igupload-cancel-button",buttonHoverClasses:"ui-state-hover",buttonActiveClasses:"ui-state-active",buttonFocusClasses:"ui-state-focus",buttonLabelClass:"ui-button-text",buttonDisabledClass:"ui-state-disabled",buttonPrimaryIconClass:"ui-button-icon-primary ui-icon",buttonMainElementPrimaryIconClass:" ui-button-text-icon-primary",buttonMainElementSecondaryIconClass:" ui-button-text-icon-secondary",buttonSecondaryIconClass:"ui-button-icon-secondary ui-icon",buttonIconsOnly:"ui-button-icons-only",buttonIconOnly:"ui-button-icon-only",buttonIcons:"ui-button-text-icons",buttonTextOnlyClass:"ui-button-text-only"}});singleProgressBar.igProgressBar({animate:self._const.isProgressBarAnimationEnabled,animateTimeout:self._const.animateProgressBarInterval,range:self._const.isProgressBarRange,value:0,queue:false});if(!o.showFileExtensionIcon){$("#"+iconId).css("display","none")}progressBarFileName=$("#"+progressBarFileNameId);fileName=self._getOnlyFileName(fileName);singleProgressBar.data("originalFileName",fileName);if(fileName.length>self._const.fileNameLimit){fileName=fileName.substr(0,self._const.fileNameLimit)}progressBarFileName.text(self._formatFilePath(fileName));self._renderFileName(formNumber,0,fileName)},_renderFileName:function(formNumber,fileSize,fn){var self=this,fileName=fn,previousFileName="",originalFileSize,progressBarFileName=$("#"+self._id("_pbrflnm",formNumber)),progressBarFileSize=$("#"+self._id("_pbrflsz",formNumber)),singleProgressBarWidth=$("#"+self._id("_snglpbar",formNumber)).width(),singleProgressBar=$("#"+self._id("_snglpbar",formNumber)),progressBarFileSizeWidth=progressBarFileSize.width(),offsetLeft;if(progressBarFileName.length===0){return}if(fileName===undefined||fileName===null){fileName=singleProgressBar.data("fileName")}if(singleProgressBarWidth<=0){fileName=this._getLocaleValue("labelProgressBarFileNameContinue");progressBarFileName.text(fileName)}else{if(fileSize!==0&&fileSize!==undefined&&fileSize!==null){originalFileSize=progressBarFileSize.text();progressBarFileSizeWidth=progressBarFileSize.text(self._formatFileSize(fileSize)+"/"+self._formatFileSize(fileSize)).width();progressBarFileSize.text(originalFileSize)}offsetLeft=progressBarFileName.igPosition().left-this.container().igPosition().left;while(offsetLeft+progressBarFileName.width()+progressBarFileSizeWidth>=singleProgressBarWidth&&previousFileName!==fileName){previousFileName=fileName;fileName=fileName.substr(0,fileName.length/2);if(previousFileName===fileName&&fileName.length-1>1){fileName=fileName.substr(0,(fileName.length-1)/2)}progressBarFileName.text(fileName+this._getLocaleValue("labelProgressBarFileNameContinue"))}if(offsetLeft+progressBarFileName.width()+progressBarFileSize.width()>=singleProgressBarWidth){fileName=this._getLocaleValue("labelProgressBarFileNameContinue")}}singleProgressBar.data("fileName",fileName)},_removeSingleUpload:function(formNumber){var self=this,fileUploadStatusId=self._id("_fus",formNumber),fileUploadStatusTmpId=fileUploadStatusId+"_"+self._randomString(20);if(self.options.mode==="multiple"){$("#"+fileUploadStatusId).attr("id",fileUploadStatusTmpId);self._renderAnimatedRemovingUpload(fileUploadStatusTmpId)}else if(self.options.mode==="single"){$("#"+fileUploadStatusId).hide().remove()}},_renderAnimatedRemovingUpload:function(id){$("#"+id).slideUp(this._const.removeSingleUploadAnimationTimeout,function(){$(this).remove()})},startUpload:function(formNumber){var self=this,o=this.options,formId=self._id("_frm",formNumber),allFilesData=this.fileInfoData,fileInfo=allFilesData.filesInfo[formNumber],file,fileSize,isHTML5=false;if(arguments.length===0&&o.useSingleRequest){var retVal=this._html5upload();if(retVal){this.fileInfoData.batch=[]}return}if(formNumber===null||fileInfo===null||fileInfo===undefined){self._setError(this._getLocaleValue("errorMessageTryToStartNonExistingFile").replace("{0}",formNumber),formNumber,self._const.clientSideErrorCode.startUpload,"clientside");return}file=fileInfo.file;if(file){fileSize=file.size}if($.type(o.maxFileSize)==="number"&&$.type(fileSize)==="number"&&o.maxFileSize>-1&&fileSize>o.maxFileSize){self._removeUploadSetError(formNumber,this._getLocaleValue("errorMessageMaxFileSizeExceeded"),self._const.clientSideErrorCode.maxFileSizeExcceeded,"clientside");return false}if(fileInfo.status!==self._const.status.NotStarted){return}isHTML5=fileInfo.multipleFiles;if(isHTML5!==true){$("#"+formId).submit()}else{this._html5upload(formNumber)}self._addUploadingID(formNumber);self._removeIDBatch(formNumber);self._spbCheckModeButton();fileInfo.status=self._const.status.Started;fileInfo.innerStatus=self._const.status.Started;self._spbRenderProgress();if(o.mode==="single"){$("#"+self._id("_strtuplbtn")).hide();$("#"+self._id("_bb")).igBrowseButton("option","disabled",true).show()}if(isHTML5===true){return}setTimeout(function(){self._getFileStatus(formNumber,true)},self._const.progressUpdateInterval)},_setFileStatus:function(formNumber,isNewFile,data){if(!data){return}var self=this,o=self.options,eArgs,isFinishUpload=false,status="",bytesUploaded=0,fileSize=0,singleFileData=this.getFileInfo(formNumber),allFilesData=this.fileInfoData,key=self._getKey(formNumber),fileName,error,isError,serverMessage="";if(key===null||key===undefined||!singleFileData){return false}fileName=singleFileData.path;bytesUploaded=parseInt(data.bytesUploaded,10);status=parseInt(data.status,10);if(singleFileData.file){data.size=singleFileData.file.size}fileSize=parseInt(data.size,10);serverMessage=data.serverMessage;isFinishUpload=status===self._const.status.Finished;error=parseInt(data.error,10);isError=!isNaN(error)&&error!==self._const.fileStatusNoError;if(serverMessage){singleFileData.serverMessage=serverMessage}if(singleFileData.innerStatus===self._const.status.Canceled&&isError){self._setError(this._getLocaleValue("errorMessageOther").replace("{0}",error),formNumber,error,"serverside",serverMessage);return false}if(isError===true&&status!==self._const.status.NoSuchFile){self._removeUploadSetError(formNumber,this._getLocaleValue("errorMessageOther").replace("{0}",error),error,"serverside",serverMessage);return false}if(singleFileData!==null&&singleFileData.status!==self._const.status.Canceled){allFilesData.fileSizeUploaded-=singleFileData.uploadedBytes;if(singleFileData.sizeBytes===0||singleFileData.sizeBytes===null){singleFileData.sizeBytes=fileSize;allFilesData.fileSizeTotal+=fileSize}else if(singleFileData.sizeBytes!==fileSize){fileSize=singleFileData.sizeBytes}if(isFinishUpload){allFilesData.countUploadingFiles++}if(bytesUploaded===0&&singleFileData.uploadedBytes>0){bytesUploaded=singleFileData.uploadedBytes}singleFileData.uploadedBytes=bytesUploaded;singleFileData.status=status;allFilesData.fileSizeUploaded+=singleFileData.uploadedBytes;self._spbRenderProgress();eArgs={fileId:formNumber,filePath:self._getOnlyFileName(fileName),totalSize:fileSize,uploadedBytes:bytesUploaded,fileStatus:status,fileInfo:singleFileData,owner:self};if(self._trigger(self.events.fileUploading,null,eArgs)===false){self.cancelUpload(formNumber)}}if(isFinishUpload||status===self._const.status.Started){if(isFinishUpload){self._removeUploadingID(formNumber);if(o.mode==="multiple"){self._spbCheckModeButton();self._submitNextPendingId()}}self._renderStatus(formNumber,bytesUploaded,fileSize,isFinishUpload,singleFileData);if(!isFinishUpload){return true}}else if(status===self._const.status.NoSuchFile){if(singleFileData!==null&&singleFileData!==undefined&&singleFileData.checksNoSuchFile===0){singleFileData.checksNoSuchFile++;return true}self._removeUploadSetError(formNumber,this._getLocaleValue("errorMessageNoSuchFile"),"nosuchfilekeyid","serverside",serverMessage)}return false},_getFileStatus:function(formNumber,isNewFile){var self=this,o=self.options,key=self._getKey(formNumber);if(key===null||key===undefined){return}key=key.replace("-$#","").replace("#$-","");$.ajaxQueue("uploadrequestsqueue",{url:self._formatURL(o.progressUrl,$.param({key:key,command:"status"})),dataType:"json",cache:false,success:function(data){if(self._setFileStatus(formNumber,isNewFile,data)===true){setTimeout(function(){self._getFileStatus(formNumber,false)},self._const.progressUpdateInterval)}},error:function(){self._setError(self._getLocaleValue("errorMessageGetFileStatus"),formNumber,self._const.clientSideErrorCode.ajaxErrorGetFileStatus,"clientside")}})},_removeUploadSetError:function(formNumber,errorMessage,errorCode,errorType,serverMessage){var self=this,o=this.options;self._removeIframe(formNumber);self._removeFileUpload(formNumber);self._setError(errorMessage,formNumber,errorCode,errorType,serverMessage);if(o.mode==="multiple"){self._spbCheckModeButton();self._submitNextPendingId()}else{$("#"+this._id("_strtuplbtn")).hide();$("#"+this._id("_bb")).igBrowseButton("option","disabled",false).show()}},cancelUpload:function(formNumber){var self=this,eArgs,o=self.options,singleProgressBarId=self._id("_snglpbar",formNumber),singleProgressBar=$("#"+singleProgressBarId),filePicker=$("#"+self._id("_frm",formNumber)+"_if"),fileName=filePicker.val(),totalSize=0,bytesUploaded=0,key=this._getKey(formNumber),singleFileInfo=this.getFileInfo(formNumber);totalSize=singleProgressBar.data("totalSize");bytesUploaded=singleProgressBar.data("bytesUploaded");if(totalSize===undefined){totalSize=0}if(bytesUploaded===undefined){bytesUploaded=0}if(singleFileInfo!==null){if(singleFileInfo.status===self._const.status.Started){singleFileInfo.innerStatus=self._const.status.Canceled;if(singleFileInfo.multipleFiles===true){if(singleFileInfo.xhr){singleFileInfo.xhr.abort()}self._onCancelUpload(formNumber)}else{$.ajaxQueue("uploadrequestsqueue",{url:self._formatURL(o.progressUrl,$.param({key:key,command:"cancel"})),dataType:"json",cache:false,success:function(){self._onCancelUpload(formNumber)},error:function(){self._setError(self._getLocaleValue("errorMessageCancelUpload"),formNumber,self._const.clientSideErrorCode.ajaxErrorCancelUpload,"clientside");self._removeFileUpload(formNumber)}})}}else if(singleFileInfo.status===self._const.status.NotStarted){if(o.mode==="single"){$("#"+this._id("_strtuplbtn")).hide();$("#"+this._id("_bb")).igBrowseButton("option","disabled","false").show()}eArgs={fileId:formNumber,filePath:self._getOnlyFileName(fileName),uploadedBytes:0,totalSize:totalSize,status:self._const.status.NotStarted,owner:self};self._trigger(self.events.fileUploadAborted,null,eArgs);self._removeFileUpload(formNumber)}}},_onCancelUpload:function(formNumber){var eArgs,self=this,o=self.options,continueButton=null,totalSize=0,bytesUploaded=0,allIds=null,singleFileInfo=this.getFileInfo(formNumber),fileName=singleFileInfo.path;if(o.autostartupload===false&&o.mode==="multiple"){continueButton=$("#"+self._id("_spbtncncl"));allIds=continueButton.data("ids");allIds=self._removeElementFromArray(allIds,formNumber);continueButton.data("ids",allIds)}eArgs={fileId:formNumber,filePath:self._getOnlyFileName(fileName),uploadedBytes:bytesUploaded,totalSize:totalSize,status:self._const.status.Canceled,owner:self};self._trigger(self.events.fileUploadAborted,null,eArgs);self._removeFileUpload(formNumber)},_removeFileUpload:function(formNumber){var self=this,o=self.options,cancelButtonId=self._id("_cbtn",formNumber),singleProgressBarId=self._id("_snglpbar",formNumber),singleProgressBar=$("#"+singleProgressBarId),totalSize=0,bytesUploaded=0,allFilesData=this.fileInfoData,singleFileInfo=this.getFileInfo(formNumber);if(singleFileInfo===null){self._setError(this._getLocaleValue("errorMessageTryToRemoveNonExistingFile").replace("{0}",formNumber),formNumber,self._const.clientSideErrorCode.removeFileUpload,"clientside");return}totalSize=singleProgressBar.data("totalSize");bytesUploaded=singleProgressBar.data("bytesUploaded");if(totalSize===undefined){totalSize=0}if(bytesUploaded===undefined){bytesUploaded=0}allFilesData.countTotalFiles--;singleFileInfo.status=self._const.status.Canceled;allFilesData.fileSizeUploaded-=singleFileInfo.uploadedBytes;allFilesData.fileSizeTotal-=singleFileInfo.sizeBytes;self._spbRenderProgress();self._removeUploadingID(formNumber);if(o.mode==="multiple"){self._removePendingId(formNumber);self._removeIDBatch(formNumber);if(this.allCancelled===false){self._submitNextPendingId()}self._spbCheckModeButton()}$("#"+cancelButtonId).remove();self._removeIframe(formNumber);self._removeSingleUpload(formNumber);self._disableBrowseButton(!self._checkMaxUploadingFilesCount())},_getKey:function(formNumber){var a=this.fileInfoData.filesInfo[formNumber];if(a!==null&&a!==undefined){return a.key}return null},_singleFileUploadFinished:function(formNumber){var e=this.container(),self=this,arr;$("#"+self._id("_cbtn",formNumber)).igButton("option",{disabled:true,icons:{primary:"ui-icon-check",secondary:null}});self._removeIframe(formNumber);if(self.options.mode==="multiple"){self._enableClearAllButton();arr=e.data("finishedIDs");if(arr===undefined){arr=[]}arr.push(formNumber);e.data("finishedIDs",arr)}},_renderStatus:function(formNumber,bytesUploaded,fileSize,isFinished,fileInfo){var self=this,eArgs,originalFileName,statusLabel=$("#"+self._id("_pbrflsz",formNumber)),singleProgressBarId=self._id("_snglpbar",formNumber),singleProgressBar=$("#"+singleProgressBarId),percentUploaded=0,fileNameRendered;if(isFinished){bytesUploaded=fileSize;self._singleFileUploadFinished(formNumber)}if(fileSize!==0&&isNaN(bytesUploaded)===false&&isNaN(fileSize)===false){percentUploaded=bytesUploaded/fileSize*100}else if(isFinished){percentUploaded=100}singleProgressBar.data("totalSize",fileSize);singleProgressBar.data("bytesUploaded",bytesUploaded);fileNameRendered=singleProgressBar.data("isFileNameRendered");originalFileName=singleProgressBar.data("originalFileName");singleProgressBar.igProgressBar("option","value",percentUploaded);statusLabel.text(self._formatFileSize(bytesUploaded)+"/"+self._formatFileSize(fileSize));if(fileNameRendered!==true){singleProgressBar.data("isFileNameRendered",true);self._renderFileName(formNumber,fileSize)}if(isFinished){eArgs={fileId:formNumber,filePath:originalFileName,totalSize:bytesUploaded,fileInfo:fileInfo,owner:self};self._trigger(self.events.fileUploaded,null,eArgs);if(self._checkMaxUploadingFilesCount()===false){self._disableBrowseButton(true);return}}},_formatURL:function(url,args){if(url.indexOf("?")===-1){url+="?"}url+=args;return url},_showHideIcons:function(properties){var files=this.fileInfoData.filesInfo,i;for(i in files){if(files[i]!==undefined){$("#"+this._id("_icn",i)).css(properties)}}},_setWidthHeightAllUploads:function(value,isHeight){var files=this.fileInfoData.filesInfo,option=isHeight?"height":"width",i;for(i in files){if(files[i]!==undefined){$("#"+this._id("_snglpbar",i)).igProgressBar("option",option,value)}}},changeLocale:function(){var $button=$("#"+this._id("_ibb")),$sumarryProgressTmp=$("#upload_summplbl"),self=this;this._super();if($sumarryProgressTmp.length){$sumarryProgressTmp.text(this._getLocaleValue("labelSummaryTemplate").replace("{0}",this.fileInfoData.countUploadingFiles).replace("{1}",this.fileInfoData.countTotalFiles))}if($button.length){$button.igBrowseButton("option",{labelText:this._getLocaleValue("labelUploadButton"),title:this._getLocaleValue("titleUploadFileButtonInit")})}$button=$("#"+this._id("_bb"));if($button.length){$button.igBrowseButton("option",{labelText:this._getLocaleValue("labelAddButton"),title:this._getLocaleValue("titleAddFileButton")})}$button=$("#"+this._id("_clrabtn"));if($button.length){$button.igButton("option",{title:this._getLocaleValue("titleClearAllButton"),labelText:this._getLocaleValue("labelClearAllButton")})}$button=$("#"+this._id("_spbtncncl"));if($button.length){$button.igButton("option",{title:this._getLocaleValue("titleShowDetailsButton"),labelText:this._getLocaleValue("labelSummaryProgressButtonCancel")})}$button=$("button[id$='cbtn']");if($button.length){$button.each(function(){$(this).igButton("option",{title:self._getLocaleValue("labelSummaryProgressButtonCancel")})})}},_setOption:function(key,value){var originalMode=this.options.mode,originalAutoStartUpload=this.options.autostartupload;this._superApply(arguments);switch(key){case"width":this.container().width(value);$("#"+this._id("_bmncntr")).width(value);this._reRenderFileSizeMetrics();this._reRenderFileNames();break;case"height":this.container().height(value);$("#"+this._id("_bmncntr")).height(value);break;case"labelSummaryProgressButtonDone":if(this.spbButtonMode===this.summaryButtonModes.done){$("#"+this._id("_spbtncncl")).igButton("option","labelText",value)}break;case"showFileExtensionIcon":this._showHideIcons({display:!value?"none":"block"});break;case"fileSizeMetric":this._reRenderFileSizeMetrics();break;case"fileSizeDecimalDisplay":this._reRenderFileSizeMetrics();break;case"maxUploadedFiles":this._disableBrowseButton(!this._checkMaxUploadingFilesCount());break;case"mode":if(originalMode!==value){this._destroyMarkup();this._create()}break;case"disabled":this._disableBrowseButton(value);break;case"autostartupload":if(value===true&&value!==originalAutoStartUpload){this._spbSubmitAllButton()}break}},_reRenderFileSizeMetrics:function(){var data=this.fileInfoData.filesInfo,l=data.length,i,bytesUploaded=0,self=this,fileSize,statusLabel,singleProgressBar;for(i=0;i<l;i++){statusLabel=$("#"+self._id("_pbrflsz",i));if(statusLabel.length===0){continue}fileSize=data[i].sizeBytes;bytesUploaded=data[i].uploadedBytes;singleProgressBar=$("#"+self._id("_snglpbar",i));statusLabel.text(self._formatFileSize(bytesUploaded)+"/"+self._formatFileSize(fileSize));singleProgressBar.data("isFileNameRendered",true);self._renderFileName(i,fileSize);$("#"+self._id("_summpbrlbl_1")).width($("#"+this._id("_summpbar")).width())}this._spbRenderProgress()},_destroyMarkup:function(){var i,attr,startupButton=$("#"+this._id("_ibb")),browseButton=$("#"+this._id("_bb")),baseMainContainer=$("#"+this._id("_bmncntr"));if(!this._isDivElement){this.originalElement.show().unwrap()}startupButton.igBrowseButton("destroy");browseButton.igBrowseButton("destroy");startupButton.remove();baseMainContainer.remove();if(!this._isDivElement){this.container().remove()}else{this.element.empty();attr=this.element[0].attributes;for(i=0;i<attr.length;i++){if(attr[i].name!=="id"){this.element.removeAttr(attr[i].name)}}for(i=0;i<this._initialAttributes.length;i++){if(this._initialAttributes[i].name!=="id"){this.element.attr(this._initialAttributes[i].name,this._initialAttributes[i].value)}}this.element.html(this._initialHTML)}},destroy:function(){this._destroyMarkup();this._superApply(arguments)},_getFileSize:function(formNumber,key){var self=this,o=this.options,formId=this._id("_fszfrm",formNumber),filePicker=$("#"+self._id("_frm",formNumber)+"_if"),iframeId=this._id("_fszifrm",formNumber),form,url=self._formatURL(o.uploadUrl,$.param({key:key,command:"fileSize"}));$('<iframe src="javascript:false;" id="'+iframeId+'" name="'+iframeId+'"></iframe>').appendTo($(document.body)).css({display:"none"});$('<form method="post" id="'+formId+'" target="'+iframeId+'" enctype="multipart/form-data"></form>').appendTo($(document.body)).css({display:"none"}).attr("action",url);form=$("#"+formId);filePicker.appendTo(form);form.submit();form.remove();$("#"+iframeId).ready(function(){setTimeout(function(){self._sendRequestFileSize(formNumber,key)},self._const.timeoutGetFileSize)});filePicker.appendTo($("#"+self._id("_frm",formNumber)))},_removeGetFileSizeHTML:function(formNumber){var iframeGetFileSize=$("#"+this._id("_fszifrm",formNumber)),formGetFileSize=$("#"+this._id("_fszfrm",formNumber));iframeGetFileSize.remove();formGetFileSize.remove()},_sendRequestFileSize:function(formNumber,key){var self=this,o=this.options,singleFileData=this.getFileInfo(formNumber);if(singleFileData.sizeBytes!==0){return}$.ajaxQueue("uploadrequestsqueue",{url:self._formatURL(o.progressUrl,$.param({key:key,command:"fileSize"})),dataType:"json",cache:false,success:function(data){var fileSize=parseInt(data.fileSize,10);self._saveFileSize(fileSize,formNumber);self._removeGetFileSizeHTML(formNumber)},error:function(){self._setError(self._getLocaleValue("errorMessageAJAXRequestFileSize"),formNumber,self._const.clientSideErrorCode.ajaxErrorRequestFileSize,"clientside");self._removeGetFileSizeHTML(formNumber)}})},_saveFileSize:function(fileSize,formNumber){var self=this,singleProgressBarId=self._id("_snglpbar",formNumber),singleProgressBar=$("#"+singleProgressBarId),allFilesData=this.fileInfoData,singleFileData=this.getFileInfo(formNumber);if(isNaN(fileSize)===true){return}singleProgressBar.data("totalSize",fileSize);if(singleFileData!==null){singleFileData.sizeBytes=fileSize;allFilesData.fileSizeTotal+=fileSize;self._spbRenderProgress()}self._renderStatus(formNumber,0,fileSize,false,singleFileData)},_onShowHideDetailsClick:function(){var self=this,fileContainer=$("#"+self._id("_fc")),marginTop=fileContainer.css("margin-top"),marginBottom=fileContainer.css("margin-bottom");if($.ig.util.isIE7||$.ig.util.isIEQuircks){self._setShowHideDetailsButtonText(fileContainer.is(":hidden"));if(fileContainer.is(":hidden")){fileContainer.show();self._reRenderFileNames()}else{fileContainer.hide()}self._setShowHideDetailsButtonText(fileContainer.is(":hidden"))}else{fileContainer.css({"margin-top":0,"margin-bottom":0});fileContainer.slideToggle(self._const.showHideDetailsAnimationTimeout,function(){fileContainer.css({"margin-top":marginTop,"margin-bottom":marginBottom});self._setShowHideDetailsButtonText(fileContainer.is(":hidden"));if(fileContainer.is(":hidden")===false){self._reRenderFileNames()}})}},_reRenderFileNames:function(){var data=this.fileInfoData.filesInfo,l=data.length,i,originalFileName;for(i=0;i<l;i++){originalFileName=$("#"+this._id("_snglpbar",i)).data("originalFileName");$("#"+this._id("_pbrflnm",i)).text(originalFileName);this._renderFileName(i,0,originalFileName)}},_setShowHideDetailsButtonText:function(isHidden){var showHideDetailsButton=$("#"+this._id("_shdbtn"));if(isHidden){showHideDetailsButton.text(this._getLocaleValue("labelShowDetails"));showHideDetailsButton.attr({"data-localeid":"titleShowDetailsButton"})}else{showHideDetailsButton.text(this._getLocaleValue("labelHideDetails"));showHideDetailsButton.attr({"data-localeid":"titleHideDetailsButton"})}},getFileInfoData:function(){return this.fileInfoData},cancelAll:function(){var i,data=this.fileInfoData,uploadingIDs=data.uploadingIDs,luploadingIDs=uploadingIDs.length,pendingIDs=data.pendingQueueIDs,lpendingIDs=pendingIDs.length,batch=data.batch,lbatch=batch.length;this.allCancelled=true;for(i=0;i<luploadingIDs;i++){if(uploadingIDs[i]!==undefined){this.cancelUpload(uploadingIDs[i])}}for(i=0;i<lpendingIDs;i++){if(pendingIDs[i]!==undefined){this.cancelUpload(pendingIDs[i])}}for(i=0;i<lbatch;i++){if(batch[i]!==undefined){this.cancelUpload(batch[i])}}uploadingIDs=[];pendingIDs=[];batch=[];$("#"+this._id("_spbtncncl")).data("ids",[]);this.allCancelled=false},_submitAllFormsUpload:function(){var self=this,i,id,idsToSubmit=this.fileInfoData.batch,l=idsToSubmit.length,pendingIDs=[];if(this.options.useSingleRequest===false){for(i=0;i<l;i++){id=idsToSubmit[i];if(self._checkCanUpload()){self.startUpload(id)}else{self._addPendingId(id);pendingIDs.push(id)}}this.fileInfoData.batch=[]}else{var result=this._html5upload();if(result===true){this.fileInfoData.batch=[]}}},_spbRenderInit:function(){var self=this,o=this.options,css=self.css,uploaderId=this._id("_fu"),labelSummaryButton=this._getLocaleValue("labelSummaryProgressButtonContinue"),summaryProgressContainerId=this._id("_spbcntr"),summaryProgressBarLabelId=this._id("_summpbrlbl"),summaryProgressBarId=this._id("_summpbar"),summaryProgressLabelId=this._id("_summplbl"),showHideDetailsId=this._id("_shdbtn"),summaryProgressButtonCancelId=this._id("_spbtncncl"),summaryProgressDetailsButtonId=this._id("_spdtlbtn"),summaryProgressBar,html="",data,progressData="progressData",titleSummaryButton=this._getLocaleValue("titleSummaryProgressButtonContinue");html+='<div id="$summaryProgressContainerId$">';html+='\t<div  class="'+css.summaryInformationContainerClass+'">';html+='\t\t<span id="$summaryProgressLabelId$"  data-localeid="labelSummaryTemplate" ';html+='\t\t\tclass="'+css.summaryUploadedFilesLabelClass+'"></span>';html+='\t\t<a href="javascript:void(0);"'+' id="$showHideDetailsId$" data-localeid="titleHideDetailsButton" ';html+='\t\t\tclass="'+css.summaryShowHideDetailsButtonClass+'">$labelShowHideDetails$</a>';html+="\t</div>";html+='\t<div class="'+css.clearClass+'">';html+='\t\t<button id="$summaryProgressButtonCancelId$"></button>';html+='\t\t<div id="$summaryProgressBarId$"></div>';html+="\t</div>";html+="</div>";html=html.replace("$summaryProgressContainerId$",summaryProgressContainerId).replace("$summaryProgressLabelId$",summaryProgressLabelId).replace("$summaryProgressDetailsButtonId$",summaryProgressDetailsButtonId).replace("$summaryProgressBarId$",summaryProgressBarId).replace("$showHideDetailsId$",showHideDetailsId).replace("$labelShowHideDetails$",this._getLocaleValue("labelHideDetails")).replace("$labelSummaryProgressButtonCancel$",this._getLocaleValue("labelSummaryProgressButtonCancel")).replace("$summaryProgressButtonCancelId$",summaryProgressButtonCancelId);$(html).appendTo($("#"+uploaderId));data={IDs:{},CurrentUploadedFiles:0,CurrentUploadedSize:0,TotalFileSize:0,TotalFiles:0,UploadingFiles:0};$("#"+summaryProgressContainerId).data(progressData,data).addClass(css.summaryProgressContainerClass+" "+css.clearClass);summaryProgressBar=$("#"+summaryProgressBarId);$('<span id="'+summaryProgressBarLabelId+'"></span>').addClass(css.summaryProgressbarLabelClass).appendTo(summaryProgressBar.igProgressBar({animate:self._const.isProgressBarAnimationEnabled,animateTimeout:self._const.animateProgressBarInterval,range:self._const.isProgressBarRange,value:0,queue:false}).addClass(css.summaryProgressBarClass));$('<div id="'+summaryProgressBarLabelId+'_1"></div>').width(summaryProgressBar.width()).addClass(css.summaryProgressBarSecondaryLabel).appendTo($("#"+this._id("_summpbar_progress")).addClass(css.summaryProgressBarInnerProgress));$("#"+showHideDetailsId).bind({click:function(event){event.preventDefault();self._onShowHideDetailsClick()}});if(o.autostartupload){labelSummaryButton=this._getLocaleValue("labelSummaryProgressButtonCancel");titleSummaryButton=this._getLocaleValue("titleSummaryProgressButtonCancel");this.spbButtonMode=this.summaryButtonModes.cancel}$("#"+summaryProgressButtonCancelId).igButton({labelText:labelSummaryButton,title:titleSummaryButton,disabled:false,click:function(event){event.preventDefault();self._spbOnClickButton(event)}}).addClass(css.summaryButtonClass)},_spbRenderProgress:function(){var summaryProgressBar=$("#"+this._id("_summpbar")),summaryProgressLabel=$("#"+this._id("_summplbl")),summaryProgressBarLabel=$("#"+this._id("_summpbrlbl")),summaryProgressBarLabel1=$("#"+this._id("_summpbrlbl_1")),textSummaryProgressBarLabel="",value=0,data=this.fileInfoData,fileSizeTotal=data.fileSizeTotal,fileSizeUploaded=data.fileSizeUploaded;if(fileSizeTotal!==0&&isNaN(fileSizeTotal)===false){value=fileSizeUploaded/fileSizeTotal*100}else if(fileSizeTotal===0){value=0}if(data.countUploadingFiles===data.countTotalFiles){if(data.countTotalFiles===0){value=0}else{value=100}data.fileSizeUploaded=fileSizeTotal;fileSizeUploaded=fileSizeTotal}summaryProgressBar.igProgressBar("option","value",value);textSummaryProgressBarLabel=this._getLocaleValue("labelSummaryProgressBarTemplate").replace("{0}",this._formatFileSize(fileSizeUploaded)).replace("{1}",this._formatFileSize(fileSizeTotal)).replace("{2}",value);summaryProgressLabel.html(this._getLocaleValue("labelSummaryTemplate").replace("{0}",data.countUploadingFiles).replace("{1}",data.countTotalFiles));summaryProgressBarLabel.text(textSummaryProgressBarLabel);summaryProgressBarLabel1.text(textSummaryProgressBarLabel)},_spbOnClickButton:function(event){var modes=this.summaryButtonModes,m=this.spbButtonMode;event.preventDefault();if(m===modes.cancel){this._trigger(this.events.cancelAllClicked,event,{owner:this});this.cancelAll()}else if(m===modes.startupload){this._spbSubmitAllButton()}},_spbSubmitAllButton:function(){this._submitAllFormsUpload();this._spbCheckModeButton()},_spbCheckModeButton:function(){var allFilesData=this.fileInfoData;if(this.options.autostartupload){if(allFilesData.pendingQueueIDs.length>0||allFilesData.uploadingIDs.length>0){this._spbSetCancelButton()}else{this._spbSetButtonDone()}}else{if(allFilesData.pendingQueueIDs.length===0&&allFilesData.uploadingIDs.length===0){if(allFilesData.batch.length>0){this._spbSetContinueButton()}else{this._spbSetButtonDone()}}else{this._spbSetCancelButton()}}},_spbSetButtonDone:function(){var button=$("#"+this._id("_spbtncncl"));this.spbButtonMode=this.summaryButtonModes.done;button.igButton("option",{labelText:this._getLocaleValue("labelSummaryProgressButtonDone"),title:this._getLocaleValue("titleSummaryProgressButtonDone"),disabled:true})},_spbSetContinueButton:function(){var button=$("#"+this._id("_spbtncncl"));this.spbButtonMode=this.summaryButtonModes.startupload;button.igButton({title:this._getLocaleValue("titleSummaryProgressButtonContinue"),labelText:this._getLocaleValue("labelSummaryProgressButtonContinue"),disabled:false})},_spbSetCancelButton:function(){var cancelButton=$("#"+this._id("_spbtncncl"));this.spbButtonMode=this.summaryButtonModes.cancel;cancelButton.igButton("option",{labelText:this._getLocaleValue("labelSummaryProgressButtonCancel"),title:this._getLocaleValue("titleSummaryProgressButtonCancel"),disabled:false})},getFileInfo:function(fileIndex){var fid=this.fileInfoData.filesInfo[fileIndex];if(fid===undefined||fid===null){return null}return fid},_formatFilePath:function(file){var ind=file.lastIndexOf("/");file=file.replace(/(\/|\\)$/,"");if(ind===-1){ind=file.lastIndexOf("\\")}return file.substring(ind+1)},_checkCanUpload:function(){
var o=this.options,data=this.fileInfoData,canUpload=true,maxSimultaneousFilesUploads=o.maxSimultaneousFilesUploads;if(o.mode==="multiple"&&maxSimultaneousFilesUploads!==null&&data.uploadingIDs.length>=maxSimultaneousFilesUploads&&o.useSingleRequest===false){canUpload=false;if(maxSimultaneousFilesUploads<=0){this._setError(this._getLocaleValue("errorMessageMaxSimultaneousFiles"),null,this._const.clientSideErrorCode.checkCanUpload,"clientside")}}return canUpload},_addPendingId:function(id){this.fileInfoData.pendingQueueIDs.push(id)},_removePendingId:function(formNumber){var pendingIDs=this.fileInfoData.pendingQueueIDs,id;if(formNumber!==undefined&&formNumber!==null){id=formNumber;this.fileInfoData.pendingQueueIDs=this._removeElementFromArray(pendingIDs,id)}else{id=pendingIDs.shift();if(id===undefined){id=null}}return id},_addUploadingID:function(id){this.fileInfoData.uploadingIDs.push(id)},_removeUploadingID:function(id){this.fileInfoData.uploadingIDs=this._removeElementFromArray(this.fileInfoData.uploadingIDs,id)},_addIDBatch:function(id){this.fileInfoData.batch.push(id)},_removeIDBatch:function(id){this.fileInfoData.batch=this._removeElementFromArray(this.fileInfoData.batch,id)},_submitNextPendingId:function(){var self=this,nextFormToSubmitId;if(self._checkCanUpload()===true){nextFormToSubmitId=self._removePendingId();if(nextFormToSubmitId!==null){self.startUpload(nextFormToSubmitId)}}},_randomString:function(stringLength){var chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",randomstring="",i,rnum;for(i=0;i<stringLength;i++){rnum=Math.floor(Math.random()*chars.length);randomstring+=chars.substring(rnum,rnum+1)}return randomstring},_cutFilePath:function(fileName,length){var fileNameSize=fileName.length;if(fileNameSize<=length){return fileName}},_getOnlyFileName:function(fileName){var delimeter="";if(fileName===null||fileName===undefined){return""}if(fileName.indexOf("/")!==-1){delimeter="/"}else if(fileName.indexOf("\\")!==-1){delimeter="\\"}if(delimeter!==""){fileName=fileName.substr(fileName.lastIndexOf(delimeter)+1)}return fileName},_getFileExtension:function(fileName){return fileName.substring(fileName.lastIndexOf(".")+1)},_validateFileExtension:function(fileName,callEvent,formNumber){var ext="",arrE=this.options.allowedExtensions,res,noCancel;if(arrE.length===0){return true}ext=fileName.substring(fileName.lastIndexOf(".")+1);noCancel=this._trigger(this.events.fileExtensionsValidating,this,{fileName:fileName,fileExtension:ext,owner:this});ext=ext.toLowerCase();res=$.inArray(ext,arrE)>=0;if(callEvent===true&&res===false||!noCancel){res=false;this._setError(this._getLocaleValue("errorMessageValidatingFileExtension"),formNumber,this._const.clientSideErrorCode.extensionValidation,"clientside")}return res},_getFileExtensionIconPath:function(ext){var arrIE=this.options.fileExtensionIcons,i,icon="",l=arrIE.length;ext=String(ext).toLowerCase();for(i=0;i<l;i++){if(arrIE[i].ext!==undefined&&(arrIE[i].ext===ext||$.inArray(ext,arrIE[i].ext)!==-1)){icon=arrIE[i].css;break}if(icon===""&&(arrIE[i].def===true||$.isArray(arrIE[i].ext)&&arrIE[i].ext.length===0)){icon=arrIE[i].css}}return icon},_setError:function(message,fileId,errorCode,errorType,serverMessage){var eArgs,errC=this._const.errorCode;if(serverMessage===undefined){serverMessage=""}if(errorType==="serverside"){switch(errorCode){case errC.MimeTypeValidation:message=this._getLocaleValue("errorMessageValidatingFileExtension");break;case errC.FileSizeExceeded:message=this._getLocaleValue("errorMessageMaxFileSizeExceeded");break}}this._spbCheckModeButton();eArgs={fileId:fileId,errorCode:errorCode,errorMessage:message,errorType:errorType,serverMessage:serverMessage,owner:this};this._trigger(this.events.onError,null,eArgs)},_formatFileSize:function(val){var fsm=this.options.fileSizeMetric,res=val;switch(fsm){case"bytes":res=val+"B";break;case"kbytes":res=this._convertToKBytes(val);break;case"mbytes":res=this._convertToMBytes(val);break;case"gbytes":res=this._convertToGBytes(val);break;case"auto":if(val<1024){res=val+"B"}else if(val<1024*1024){res=this._convertToKBytes(val)}else if(val<1024*1024*1024){res=this._convertToMBytes(val)}else{res=this._convertToGBytes(val)}break;default:break}return res},_convertToKBytes:function(val){var res=val/1024;return res.toFixed(this.options.fileSizeDecimalDisplay)+"KB"},_convertToMBytes:function(val){var res=val/(1024*1024);return res.toFixed(this.options.fileSizeDecimalDisplay)+"MB"},_convertToGBytes:function(val){var res=val/(1024*1024*1024);return res.toFixed(this.options.fileSizeDecimalDisplay)+"GB"},_removeElementArrayById:function(array,keyValue){if(array===undefined||array===null){return[]}return $.grep(array,function(n){return n.id!==keyValue})},_removeElementFromArray:function(array,keyValue){if(array===undefined||array===null){return[]}return $.grep(array,function(n){return n!==keyValue})},_stringToJSONObject:function(s){var data={};try{data=JSON.parse(s)}catch(e){return false}return data},_stringToXmlObject:function(s){var $xml;try{$xml=$(s)}catch(e){return false}if(!$xml.length){return false}return $xml}});$.extend($.ui.igUpload,{version:"21.2.12"})})($);/*!@license
* Infragistics.Web.ClientUI Editors 21.2.12
*
* Copyright (c) 2011-2022 Infragistics Inc.
*
* http://www.infragistics.com/
* Depends on:
* jquery.js
* jquery.ui.core.js
* jquery.ui.widget.js
* infragistics.util.js
* infragistics.util.jquery.js
* infragistics.ui.widget.js
* infragistics.ui.popover.js
* infragistics.ui.notifier.js

* Example to use:
*	<script type="text/javascript">
*	$(function () {
*		$('#text1').igValidator({ minLength: 3 });
*	});
*	</script>
*	<input id="text1" type="text" />
*/
(function($){$.widget("ui.igValidator",$.ui.igWidget,{options:{onchange:false,onblur:true,onsubmit:true,required:false,number:false,date:false,email:false,lengthRange:null,valueRange:null,creditCard:false,pattern:null,executeAllRules:false,messageTarget:null,errorMessage:null,successMessage:null,threshold:-1,equalTo:null,custom:null,fields:[{selector:null}],notificationOptions:null,requiredIndication:false,optionalIndication:false},css:{target:"ui-igvalidator-target",requiredIndication:"ui-igvalidator-required-indication",optionalIndication:"ui-igvalidator-optional-indication"},events:{validating:"validating",validated:"validated",success:"success",error:"error",errorShowing:"errorShowing",errorHiding:"errorHiding",errorShown:"errorShown",errorHidden:"errorHidden",successShowing:"successShowing",successHiding:"successHiding",successShown:"successShown",successHidden:"successHidden",formValidating:"formValidating",formValidated:"formValidated",formError:"formError",formSuccess:"formSuccess"},notifierDefaults:{state:"error"},rules:[],summaryResult:false,_createWidget:function(){delete this.options.fields;$.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){this._formHandleCounter=0;this._fieldOptions=this.options.fields?$.extend([],this.options.fields):null;var shouldHandleForm=false;if(this.options.fields){for(var i=0;i<this.options.fields.length;i++){var options=this.options.fields[i];this._initializeField($(options.selector),options);if(options.onsubmit!==undefined?options.onsubmit:this.options.onsubmit){shouldHandleForm=true;this._formHandleCounter++}}}else{this._initializeField(this.element,this.options)}this._attachToForm(shouldHandleForm||this.options.onsubmit);this._initializeRules()},_setOption:function(option,value){var i;switch(option){case"notificationOptions":this.options.notificationOptions=value;this._updateNotifiers();break;case"onchange":case"onblur":if(!this.options.fields&&!this.options._control){this.element.unbind(".validator");this._attachFieldEvents(this.element)}break;case"onsubmit":if(this.options.onsubmit===value){break}if(this.options.fields){for(i=0;i<this.options.fields.length;i++){if(this.options.fields[i].onsubmit===undefined){if(value){if(!this._formHandleCounter){this._attachToForm(true)}this._formHandleCounter++}else if(!--this._formHandleCounter){this._detachFromForm()}}}}break;case"messageTarget":var oldVisible=this._fieldMessageVisible(this.options);this._clearMessageTarget(this.options);this._hideSuccess(this.options);this._hideError(this.options);this.options.messageTarget=value;this._evalMessageTarget(this.options);if(oldVisible){if(this.options.isValid){this._showSuccess(this.options,{message:this.options._currentMessages[0]})}else{this._showError(this.options,{messages:this.options._currentMessages})}}break;case"errorMessage":case"successMessage":this._hideError(this.options);this._hideSuccess(this.options);break;case"requiredIndication":case"optionalIndication":if(this.options.fields){for(i=0;i<this.options.fields.length;i++){this._removeFieldIndications(this.options.fields[i]);this.options[option]=value;this._addFieldIndications(this.options.fields[i])}}else{this._removeFieldIndications(this.options);this.options[option]=value;this._addFieldIndications(this.options)}break;case"fields":return;default:break}this._super(option,value)},_initializeRules:function(){this.rules=[];this.rules.push(new $.ig.igValidatorRequiredRule(this));this.rules.push(new $.ig.igValidatorControlRule(this));this.rules.push(new $.ig.igValidatorNumberRule(this));this.rules.push(new $.ig.igValidatorDateRule(this));this.rules.push(new $.ig.igValidatorLengthRule(this));this.rules.push(new $.ig.igValidatorValueRule(this));this.rules.push(new $.ig.igValidatorEqualToRule(this));this.rules.push(new $.ig.igValidatorEmailRule(this));this.rules.push(new $.ig.igValidatorCreditCardRule(this));this.rules.push(new $.ig.igValidatorPatternRule(this));this.rules.push(new $.ig.igValidatorCustomRule(this))},_initializeField:function(element,options){var target=element;if(!target.length){options._ignored=true;return}options._control=this._getEditor(target);if(options._control){this._form=this._form||target.closest("form").get(0);if(options._control.widgetName==="igCombo"){options._type="selectrange"}else if(options._control.widgetName==="igRating"){options._type="select"}if(options._control._options){options._control._options.validator=this}else{options._control._validator=this}}else{var elemType=target[0].tagName;switch(elemType){case"INPUT":if(target[0].type==="checkbox"){options._group=this._findGroupTargets(target);options._type=options._group.length>1?"checkboxrange":"checkbox";target=options._group}else if(target[0].type==="radio"){options._group=this._findGroupTargets(target);options._type="radio";target=options._group}else{options._type="input"}break;case"TEXTAREA":options._type="textarea";break;case"SELECT":if(target[0].multiple){options._type="selectrange"}else{options._type="select"}break;case"FORM":this._form=this._form||target[0];options._ignored=true;return;default:this._form=this._form||target.closest("form").get(0);options._ignored=true;return}this._attachFieldEvents(target)}options._ignored=false;target.addClass(this.css.target);target.data("igValidatorField",options);options.notifyTarget=this._targetFromOptions(options,true);this._evalMessageTarget(options);this._ensureNotifier(options,true);this._addFieldIndications(options)},_findGroupTargets:function(target){if(target[0].name){return $("[name="+target[0].name+"]",target[0].form||document)}return target},_attachFieldEvents:function(element){var self=this,evts={"keyup.validator":function(e){if(e.keyCode!==9&&e.keyCode<15||e.keyCode>20){self._validateInternal(element,e)}},"change.validator":function(e){self._validateInternal(element,e)},"cut.validator":function(e){setTimeout(function(){self._validateInternal(element,e)},10)},"paste.validator":function(e){setTimeout(function(){self._validateInternal(element,e)},10)},"drop.validator":function(e){setTimeout(function(){self._validateInternal(element,e)},10)},"dragend.validator":function(e){setTimeout(function(){self._validateInternal(element,e)},10)},"blur.validator":function(e){self._validateInternal(element,e,true)}};element.bind(evts)},_ensureNotifier:function(options,reinit){if(reinit&&options.notifyTarget.data("igNotifier")){options.notifyTarget.igNotifier("destroy").unbind(".validator")}if(!options.notifyTarget.data("igNotifier")){var args={owner:this,target:options.notifyTarget,fieldOptions:options===this.options?null:options};options.notifyTarget.igNotifier($.extend({},this.notifierDefaults,this.options.notificationOptions,options.notificationOptions)).bind({"ignotifiershowing.validator":function(evt,ui){return args.owner._handleNotifierEvent(evt,ui,"Showing",args)},"ignotifiershown.validator":function(evt,ui){return args.owner._handleNotifierEvent(evt,ui,"Shown",args)},"ignotifierhiding.validator":function(evt,ui){return args.owner._handleNotifierEvent(evt,ui,"Hiding",args)},"ignotifierhidden.validator":function(evt,ui){return args.owner._handleNotifierEvent(evt,ui,"Hidden",args)}})}},_updateNotifiers:function(){if(this.options.fields){for(var i=0;i<this.options.fields.length;i++){this._ensureNotifier(this.options.fields[i],true)}}else{this._ensureNotifier(this.options,true)}},_clearMessageTarget:function(options){if(options._$messageTarget){options._$messageTarget.removeClass("field-validation-valid field-validation-error").empty().css("display","")}},_evalMessageTarget:function(options){options._$messageTarget=options.messageTarget;if(typeof options._$messageTarget==="string"){var target=$("[data-valmsg-for='"+options._$messageTarget+"']");options._$messageTarget=target.length?target:$(options._$messageTarget)}if(options._$messageTarget instanceof $){if(options._$messageTarget.length){options._$messageTarget.hide()}else{options._$messageTarget=null}}},_addFieldIndications:function(options){var ops,target=options.notifyTarget;if(options._group&&options._group.length>1||options._control&&options._control.widgetName==="igRating"){return}if(options._control!==null&&options._control.widgetName==="igCombo"){target=target.parent()}ops=this._addGlobalSettings(options);if(ops.required&&ops.requiredIndication){options._$indicator=target.after("<span title='"+this._getLocalizedMessage("required")+"' class='"+this.css.requiredIndication+"'>*</span>").next()}if(!ops.required&&ops.optionalIndication){options._$indicator=target.after("<span class='"+this.css.optionalIndication+"'>"+this._getLocalizedMessage("optional","String")+"</span>").next()}},_removeFieldIndications:function(options){if(options._$indicator){options._$indicator.hide();options._$indicator.remove();delete options._$indicator}},_attachToForm:function(shouldHandleForm){this._form=this._form||this.element[0].form||this.element.closest("form").get(0);if(!this._form||!shouldHandleForm){return}if(!this._form._igValidators||!this._form._igValidators.length){this._form._igValidators=[];$(this._form).bind("submit.validator",function(e){this._igErrorShown=false;var summaryResult=true,current;for(var i=0;i<this._igValidators.length;i++){current=this._igValidators[i]._validateForm(e);summaryResult=summaryResult?current:summaryResult}if(!summaryResult){e.preventDefault();e.stopPropagation()}delete this._igErrorShown})}this._form._igValidators.push(this)},_detachFromForm:function(){var index;if(this._form&&(index=$.inArray(this,this._form._igValidators))>-1){this._form._igValidators.splice(index,1);if(!this._form._igValidators.length){$(this._form).unbind("submit.validator")}}},_validate:function(field,evt,isSubmitting){var current,i,valid=true;if(this.options.fields){if(field!==undefined&&(i=this._fieldIndexOf(field))>-1){field=this.options.fields[i];valid=field.isValid=this._validateField(field,evt,isSubmitting)}else{for(i=0;i<this.options.fields.length;i++){field=this.options.fields[i];current=field.isValid=this._validateField(field,evt,isSubmitting);valid=valid?current:valid}}}else{valid=this._validateField(this.options,evt,isSubmitting);this.options.isValid=valid}return valid},_validateForm:function(evt){var valid=true,args={owner:this,target:$(evt.target)};if(this._trigger(this.events.formValidating,evt,args)){args.valid=valid=this._validate(null,evt,true);this._trigger(this.events.formValidated,evt,args);this._trigger(valid?this.events.formSuccess:this.events.formError,evt,args)}return valid},_errorOnSubmitAllowed:function(){if(!$.ui.igValidator.defaults.showAllErrorsOnSubmit&&this._form&&this._form._igErrorShown!==undefined){return!this._form._igErrorShown}return true},_addErrorOnSubmit:function(){if(!$.ui.igValidator.defaults.showAllErrorsOnSubmit&&this._form&&this._form._igErrorShown!==undefined){this._form._igErrorShown=true}},_validateInternal:function(element,evt,blur,value){element=element||evt&&(element=$(evt.target).closest("."+this.css.target)).length||this.element;var field=element.data("igValidatorField");if(field){field.isValid=this._validateField(field,evt||{},false,value,blur);return field.isValid}if(value!==undefined){this.options.isValid=this._validateField(this.options,evt||{},false,value,blur);return this.options.isValid}else{return this._validate(null,evt||{})}},_validateField:function(opts,evt,isSubmitting,value,blur){if(opts._ignored){return true}var options=this._addGlobalSettings(opts),valueString,hasLength,args,result=true,rule,ruleResult,ruleMessage;value=value!==undefined?value:this._getTargetValue(options);valueString=value!==0?value&&value.toString():value.toString();hasLength=valueString&&value.length!==undefined;if(isSubmitting&&!options.onsubmit){return true}if(!this._forceValidation&&!isSubmitting){if(blur&&!options.onblur||!blur&&!options.onchange){return true}if(options.hasOwnProperty("threshold")&&hasLength&&value.length<=options.threshold){return true}}args={value:value,owner:this,fieldOptions:options===this.options?null:opts};if(evt&&!this._trigger(this.events.validating,evt,args)){return true}args.messages=opts._currentMessages=[];args.rules=[];for(var i=0;i<this.rules.length;i++){rule=this.rules[i];if(!rule.shouldRun(options,valueString)){if(rule.name==="required"&&!valueString&&!options.executeAllRules){break}continue}ruleResult=rule.isValid(options,value);result=result?ruleResult:result;if(!ruleResult){ruleMessage=rule.getRuleMessage(options)||this._getLocalizedMessage(rule.getMessageType(options));ruleMessage=rule.formatMessage(ruleMessage);args.messages.push(ruleMessage);args.rules.push(rule.name);if(!options.executeAllRules){break}}}if(result){if(options.successMessage){args.messages.push(options.successMessage)}delete args.rules;this._success(options,args,evt);return true}else{args.rule=args.rules[0];this._showError(options,args,evt);return false}},_success:function(options,args,evt){args.valid=true;args.message=args.messages[0]||null;if(evt){this._trigger(this.events.validated,evt,args);this._trigger(this.events.success,evt,args)}this._showSuccess(options,args,evt)},_showError:function(options,args,evt){args.valid=false;if(args.messages.length&&options.executeAllRules){args.message="<ul><li>"+args.messages.join("</li><li>")+"</li></ul>"}else{args.message=args.messages[0]||null}if(evt){this._trigger(this.events.validated,evt,args);this._trigger(this.events.error,evt,args)}if(this._skipMessages||!this._errorOnSubmitAllowed()){return}this._hideSuccess(options,evt);args={owner:this,message:args.message,target:options._$messageTarget?options._$messageTarget:options.notifyTarget,fieldOptions:args.fieldOptions};if(evt&&!this._trigger(this.events.errorShowing,evt,args)){return}this._ensureNotifier(options);if(options._$messageTarget){options._$messageTarget.removeClass("field-validation-valid").addClass("field-validation-error").html(args.message).show();options.notifyTarget.data("igNotifier")._setOption("state","error");options.notifyTarget.data("igNotifier")._setTargetState()}else{options.notifyTarget.igNotifier("notify","error",args.message)}if(evt){this._trigger(this.events.errorShown,evt,args)}this._addErrorOnSubmit()},_hideError:function(options,evt){var notifier=options._$messageTarget||options.notifyTarget.data("igNotifier"),args={owner:this,target:options._$messageTarget||options.notifyTarget,message:notifier._currentText||options._$messageTarget&&options._$messageTarget.text(),fieldOptions:options===this.options?null:options};if(this._hasVisibleError(options)){if(evt&&!this._trigger(this.events.errorHiding,evt,args)){return}notifier.hide();options.notifyTarget.data("igNotifier")._setTargetState(true);if(evt){this._trigger(this.events.errorHidden,evt,args)}}},_showSuccess:function(options,args,evt){if(this._skipMessages){return}this._hideError(options,evt);if(args.message){args={owner:this,message:args.message,target:options._$messageTarget?options._$messageTarget:options.notifyTarget,fieldOptions:args.fieldOptions};if(evt&&!this._trigger(this.events.successShowing,evt,args)){return}this._ensureNotifier(options);if(options._$messageTarget){options._$messageTarget.removeClass("field-validation-error").addClass("field-validation-valid").html(args.message).show();options.notifyTarget.data("igNotifier")._setOption("state","success");options.notifyTarget.data("igNotifier")._setTargetState()}else{options.notifyTarget.igNotifier("notify","success",args.message)}if(evt){this._trigger(this.events.successShown,evt,args)}}},_hideSuccess:function(options,evt){var notifier=options._$messageTarget||options.notifyTarget.data("igNotifier"),args={owner:this,target:options._$messageTarget||options.notifyTarget,message:notifier._currentText||options._$messageTarget&&options._$messageTarget.text(),fieldOptions:options===this.options?null:options};if(this._hasVisibleSuccess(options)){if(evt&&!this._trigger(this.events.successHiding,evt,args)){return}notifier.hide();if(evt){this._trigger(this.events.successHidden,evt,args)}}},_handleNotifierEvent:function(evt,ui,type,args){var state=ui.owner.options.state;args.message=ui.owner._currentText;if(state==="error"){return args.owner._trigger(this.events["error"+type],evt,args)}else if(state==="success"){return args.owner._trigger(this.events["success"+type],evt,args)}return true},_getTargetValue:function(options){if(options._control){if(options._control.options.checked!==undefined){return options._control.options.checked}else if(options._control.refreshValue&&options._control.options.allowCustomValue){options._control.refreshValue()}return options._control.value()}var $target=this._targetFromOptions(options);if(!$target.length){return null}switch(options._type){case"textarea":return $target.val().replace(/\r?\n/g,"\r\n");case"checkbox":return $target[0].checked;case"radio":case"checkboxrange":return options._group.filter(":checked").map(function(){return this.value}).get();case"input":case"select":case"selectrange":return $target.val()}return $target.val&&$target.val()},_getLocalizedMessage:function(key,postfix){key+=postfix||"Message";var message=this._getLocaleValue(key);if(!message&&$.ig&&$.ig.Validator&&$.ig.Validator.locale){message=this._getLocaleValue(key)}return message||""},_targetFromOptions:function(options,outer){if(outer&&options._control){if(options._control.editorContainer){return options._control.editorContainer()}else if(options._control.comboWrapper){return options._control.comboWrapper().children().first()}}if(options.selector){return options.selector instanceof $?options.selector:$(options.selector)}else{return this.element}},_getEditor:function(elem){var widgets=elem.data(),controls=["Editor","Combo","Rating","DatePicker","TimePicker"],regEx=new RegExp("ig.*?("+controls.join("|")+")");for(var i in widgets){if(widgets[i].widgetName&&regEx.test(widgets[i].widgetName)){return widgets[i]}}return null},_cleanupField:function(options){var element=this._targetFromOptions(options||this.options);element.unbind(".validator");if(options.notifyTarget&&options.notifyTarget.data("igNotifier")){options.notifyTarget.igNotifier("destroy").unbind(".validator")}this._clearMessageTarget(options);if(element.data("igValidatorField")){element.removeData("igValidatorField")}this._removeFieldIndications(options);if(options._control){if(options._control._options){options._control._options.validator=null}else{options._control._validator=null}}element.removeClass(this.css.target)},_addGlobalSettings:function(options){if(options===this.options){return options}var properties=["required","threshold","number","date","lengthRange","valueRange","email","creditCard","custom","onblur","onchange","onsubmit","successMessage","errorMessage","requiredIndication","optionalIndication","executeAllRules"],extendedOptions=$.extend({},options);for(var i=0;i<properties.length;i++){if(!options.hasOwnProperty(properties[i])&&this.options[properties[i]]!==null){extendedOptions[properties[i]]=this.options[properties[i]]}}return extendedOptions},_indexOfByProperty:function(array,property,value){for(var i=0;i<array.length;i++){if(array[i][property]&&array[i][property]===value){return i}}return-1},_hasVisibleSuccess:function(options){if(this._fieldMessageVisible(options)){if(options._$messageTarget&&options._$messageTarget.hasClass("field-validation-valid")){return true}else{return options.notifyTarget.data("igNotifier").options.state==="success"}}return false},_hasVisibleError:function(options){if(this._fieldMessageVisible(options)){if(options._$messageTarget&&options._$messageTarget.hasClass("field-validation-error")){return true}else{return options.notifyTarget.data("igNotifier").options.state==="error"}}return false},_fieldMessageVisible:function(options){if(options._$messageTarget){return options._$messageTarget.is(":visible")}if(options.notifyTarget.data("igNotifier")){return options.notifyTarget.data("igNotifier").isVisible()}return false},_fieldIndexOf:function(fieldParam){var index=-1;if(typeof fieldParam==="number"&&this.options.fields[fieldParam]){return fieldParam}if(typeof fieldParam==="string"){index=this._indexOfByProperty(this.options.fields,"selector",fieldParam)}if(typeof fieldParam==="object"){index=$.inArray(fieldParam,this.options.fields)}if(index>=this.options.fields.length){return-1}return index},validate:function(field){var valid;this._forceValidation=true;valid=this._validate(field);this._forceValidation=false;return valid},isValid:function(field){this._skipMessages=true;var valid=this.validate(field);this._skipMessages=false;return valid},hide:function(field){var i;if(this.options.fields){if(field!==undefined){if((i=this._fieldIndexOf(field))>-1){this._hideError(this.options.fields[i]);this._hideSuccess(this.options.fields[i])}return}for(i=0;i<this.options.fields.length;i++){if(this.options.fields[i].isValid!==undefined){this._hideError(this.options.fields[i]);this._hideSuccess(this.options.fields[i])}}}else{this._hideError(this.options);this._hideSuccess(this.options)}},getErrorMessages:function(field){var result=[],i;if(this.options.fields){if(field!==undefined){if((i=this._fieldIndexOf(field))>-1&&this.options.fields[i].isValid!==undefined&&!this.options.fields[i].isValid){Array.prototype.push.apply(result,this.options.fields[i]._currentMessages)}return result}for(i=0;i<this.options.fields.length;i++){if(this.options.fields[i].isValid!==undefined&&!this.options.fields[i].isValid){Array.prototype.push.apply(result,this.options.fields[i]._currentMessages)}}}else if(this.options.isValid!==undefined&&!this.options.isValid){Array.prototype.push.apply(result,this.options._currentMessages)}return result},isMessageDisplayed:function(field){var result=false,i;if(this.options.fields){if(field!==undefined){if((i=this._fieldIndexOf(field))>-1){result=!result?this._fieldMessageVisible(this.options.fields[i]):result}return result}for(i=0;i<this.options.fields.length;i++){result=!result?this._fieldMessageVisible(this.options.fields[i]):result}}else{result=this._fieldMessageVisible(this.options)}return result},notifier:function(field){var i,notifier;if(field!==undefined&&this.options.fields&&(i=this._fieldIndexOf(field))>-1){notifier=this.options.fields[i].notifyTarget&&this.options.fields[i].notifyTarget.data("igNotifier")}else{notifier=this.options.notifyTarget&&this.options.notifyTarget.data("igNotifier")}return notifier||null},addField:function(field){if(!this.options.fields){return}this.options.fields.push(field);this._initializeField($(field.selector),field);var options=this._addGlobalSettings(field);if(options.onsubmit){if(!this._formHandleCounter){this._attachToForm(true)}this._formHandleCounter++}},removeField:function(field){if(!this.options.fields){return}var index=this._fieldIndexOf(field);if(index>-1){var removed=this.options.fields.splice(index,1)[0],options=this._addGlobalSettings(removed);this._cleanupField(removed);if(options.onsubmit&&!--this._formHandleCounter){this._detachFromForm()}}},updateField:function(field,fieldOptions){if(!this.options.fields){return}var index=this._fieldIndexOf(field);if(index>-1){if(!fieldOptions){this._cleanupField(this.options.fields[index]);this._initializeField($(this.options.fields[index].selector),this.options.fields[index]);return}fieldOptions=$.extend({},this.options.fields[index],fieldOptions);var current=this._addGlobalSettings(this.options.fields[index]),options=this._addGlobalSettings(fieldOptions);this._cleanupField(current);this._initializeField($(fieldOptions.selector),fieldOptions);if(current.onsubmit&&!--this._formHandleCounter){this._detachFromForm()}if(options.onsubmit){if(!this._formHandleCounter){this._attachToForm(true)}this._formHandleCounter++}this.options.fields.splice(index,1,fieldOptions)}},destroy:function(){if(!this.options.fields){this._cleanupField(this.options)}else{for(var i=0;i<this.options.fields.length;i++){this._cleanupField(this.options.fields[i])}}this._detachFromForm();this._superApply(arguments)}});$.extend($.ui.igValidator,{version:"21.2.12"});$.ui.igValidator.defaults={showAllErrorsOnSubmit:true,decimalSeparator:".",thousandsSeparator:",",emailRegEx:/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/};$.ig.igValidatorBaseRule=$.ig.igValidatorBaseRule||Class.extend({name:"base",formatItems:[],getMessageType:function(options){return this.name},getRuleMessage:function(options){if(options[this.name].errorMessage){return options[this.name].errorMessage}else if(options.errorMessage){return options.errorMessage}return""},formatMessage:function(message){for(var i=0;i<this.formatItems.length;i++){message=message.replace("{"+i+"}",this.formatItems[i])}return message},shouldRun:function(options,value){return options[this.name]&&value},isValid:function(options,value){return true},init:function(validator){this.validator=validator}});$.ig.igValidatorRequiredRule=$.ig.igValidatorRequiredRule||$.ig.igValidatorBaseRule.extend({name:"required",groupTypes:["checkboxrange","radio","select","selectrange"],groupMessageName:"select",getMessageType:function(options){if($.inArray(options._type,this.groupTypes)>-1){return this.groupMessageName}else{return this.name}},shouldRun:function(options){return options[this.name]},isValid:function(options,value){var internalValue=!isNaN(parseFloat(value))?value.toString():value;if(!internalValue||value.length===0){return false}return true}});$.ig.igValidatorControlRule=$.ig.igValidatorControlRule||$.ig.igValidatorBaseRule.extend({name:"control",getMessageType:function(){return"default"},getRuleMessage:function(options){return options.errorMessage||options._control._currentMessage||""},shouldRun:function(options,value){return options._control&&typeof options._control.isValid==="function"&&value},isValid:function(options){return options._control.isValid()}});$.ig.igValidatorNumberRule=$.ig.igValidatorNumberRule||$.ig.igValidatorBaseRule.extend({name:"number",_isNumber:function(options,value){if(typeof value==="number"){return true}else if(typeof value==="string"){return this._parseNumber(value,options)!==null}return false},_parseNumber:function(value,options){if(typeof value==="number"){return value}var decimalSeparator=options.number&&options.number.decimalSeparator,thousandsSeparator=options.number&&options.number.thousandsSeparator,thousandsRegEx,result;decimalSeparator=decimalSeparator||$.ui.igValidator.defaults.decimalSeparator;thousandsSeparator=thousandsSeparator||$.ui.igValidator.defaults.thousandsSeparator;thousandsRegEx=new RegExp("\\"+thousandsSeparator,"g");value=value.split(decimalSeparator);value[0]=value[0].replace(thousandsRegEx,"");result=value.join(".");if(result.length&&!isNaN(result)){return parseFloat(result)}return null},isValid:function(options,value){var internalValue=""+value;if(internalValue){return this._isNumber(options,value)}return true}});$.ig.igValidatorDateRule=$.ig.igValidatorDateRule||$.ig.igValidatorBaseRule.extend({name:"date",isValid:function(options,value){return value instanceof Date||!isNaN(new Date(value).getSeconds())}});$.ig.igValidatorLengthRule=$.ig.igValidatorLengthRule||$.ig.igValidatorBaseRule.extend({name:"lengthRange",_lastMessageType:"rangeLength",getMessageType:function(){return this._lastMessageType},isValid:function(options,value){if(value&&value.length){var min,max,messageSuffix=value.push?"Select":"Length",minLength=options.lengthRange.push?options.lengthRange[0]:options.lengthRange.min,maxLength=options.lengthRange.push?options.lengthRange[1]:options.lengthRange.max;min=minLength&&value.length<minLength;max=maxLength&&value.length>maxLength;if(minLength&&maxLength&&(min||max)){this._lastMessageType="range"+messageSuffix;this.formatItems=[minLength,maxLength]}else if(min){this._lastMessageType="min"+messageSuffix;this.formatItems=[minLength]}else if(max){this._lastMessageType="max"+messageSuffix;this.formatItems=[maxLength]}if(min||max){return false}}return true}});$.ig.igValidatorValueRule=$.ig.igValidatorValueRule||$.ig.igValidatorNumberRule.extend({name:"valueRange",_lastMessageType:"rangeValue",getMessageType:function(){return this._lastMessageType},isValid:function(options,value){var min=false,max=false,minValue,maxValue,hasMin,hasMax,isNumber=this._isNumber(options,value),isDateParsable=!isNaN(new Date(value).getSeconds());if(!isDateParsable&&!isNumber){return true}minValue=options.valueRange.push?options.valueRange[0]:options.valueRange.min;maxValue=options.valueRange.push?options.valueRange[1]:options.valueRange.max;hasMin=typeof minValue==="number"||minValue;hasMax=typeof maxValue==="number"||maxValue;if(!hasMin&&!hasMax){return true}if(isNumber&&!options.date){value=this._parseNumber(value,options);if(hasMin){min=value<minValue}if(hasMax){max=value>maxValue}}else if(isDateParsable&&!options.number){value=new Date(value);if(hasMin){minValue=new Date(minValue);min=value<minValue;minValue=minValue.toLocaleString()}if(hasMax){maxValue=new Date(maxValue);max=value>maxValue;maxValue=maxValue.toLocaleString()}}if(hasMin&&hasMax&&(min||max)){this._lastMessageType="rangeValue";this.formatItems=[minValue,maxValue]}else if(min){this._lastMessageType="minValue";this.formatItems=[minValue]}else if(max){this._lastMessageType="maxValue";this.formatItems=[maxValue]}return!(min||max)}});$.ig.igValidatorEqualToRule=$.ig.igValidatorEqualToRule||$.ig.igValidatorBaseRule.extend({name:"equalTo",isValid:function(options,value){var selector=options.equalTo.selector||options.equalTo,targetValue=this.validator._getTargetValue({_control:this.validator._getEditor($(selector)),selector:selector});if($.ig.util.compare(value,targetValue)){return false}return true}});$.ig.igValidatorEmailRule=$.ig.igValidatorEmailRule||$.ig.igValidatorBaseRule.extend({name:"email",isValid:function(options,value){return $.ui.igValidator.defaults.emailRegEx.test(value)}});$.ig.igValidatorPatternRule=$.ig.igValidatorPatternRule||$.ig.igValidatorBaseRule.extend({name:"pattern",isValid:function(options,value){var regEx=options.pattern.expresion||options.pattern.expression||options.pattern;regEx=regEx.test?regEx:new RegExp(regEx.toString());return regEx.test(value)}});$.ig.igValidatorCustomRule=$.ig.igValidatorCustomRule||$.ig.igValidatorBaseRule.extend({name:"custom",getMessageType:function(){return"default"},shouldRun:function(options){return options[this.name]},isValid:function(options,value){var fieldOptions=options===this.validator.options?null:options,func=options.custom.method||options.custom;if(typeof func==="string"&&typeof window[func]==="function"){func=window[func]}if(typeof func==="function"&&!func.apply(this.validator,[value,fieldOptions])){return false}return true}});$.ig.igValidatorCreditCardRule=$.ig.igValidatorCreditCardRule||$.ig.igValidatorBaseRule.extend({name:"creditCard",isValid:function(options,value){var val=value&&""+value,evenDigit=false,checksum=0;if(val){val=val.replace(/-/g,"");val=val.replace(/ /g,"");val=val.reverse();for(var i=0;i<val.length;i++){if(!$.ig.String.prototype.isDigit(val[i])){return false}var digitValue=+val[i]*(evenDigit?2:1);evenDigit=!evenDigit;while(digitValue>0){checksum+=digitValue%10;digitValue=Math.floor(digitValue/10)}}return checksum%10===0}return true}})})($);/*!@license
 * Infragistics.Web.ClientUI HtmlEditor 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 * <Licensing info>
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *   jquery.js
 *   jquery.ui.core.js
 *   jquery.ui.widget.js
 *	 infragistics.util.js
 *   infragistics.util.jquery.js
 *   infragistics.ui.widget.js
 *   infragistics.ui.toolbarbutton.js
 *   infragistics.ui.toolbar.js
 *   infragistics.ui.popover.js
 *   infragistics.ui.splitbutton.js
 *   infragistics.ui.colorpicker.js
 *   infragistics.ui.colorpickersplitbutton.js
 *   infragistics.ui.combo.js
 *   infragistics.ui.htmleditor-en.js
 *   infragistics.ui.toolbar-en.js
 */
(function($){$.widget("ui.igHtmlEditor",$.ui.igWidget,{options:{showFormattingToolbar:true,showTextToolbar:true,showInsertObjectToolbar:true,showCopyPasteToolbar:true,width:725,height:350,toolbarSettings:[],customToolbars:[],inputName:"source",value:""},events:{rendered:"rendered",rendering:"rendering",actionExecuting:"actionExecuting",actionExecuted:"actionExecuted",toolbarCollapsing:"toolbarCollapsing",toolbarCollapsed:"toolbarCollapsed",toolbarExpanding:"toolbarExpanding",toolbarExpanded:"toolbarExpanded",cut:"cut",copy:"copy",paste:"paste",undo:"undo",redo:"redo",workspaceResized:"workspaceResized"},css:{htmlEditor:"ui-widget ui-widget-content ui-corner-all ui-ightmleditor ui-helper-clearfix",htmlEditorContent:"ui-ightmleditor-content",toolbarsContainer:"ui-igtoolbars-holder",pathFinder:"ui-igPathFinder",workspaceIframe:"ui-widget-content"},NODE:new $.ig.XmlNodeType,_toolbarsActiveState:{},_isDirty:false,_initDefaultToolbars:function(){this.defaultToolbars=[{name:"textToolbar",displayName:this._getLocaleValue("textToolbar"),isExpanded:true,language:this.options.language,allowCollapsing:true,collapseButtonIcon:"ui-igbutton-collapse",expandButtonIcon:"ui-igbutton-expand",items:[{name:"Bold",type:"button",scope:null,localeProperties:{"data-localeid":"boldButtonTitle","data-localeattr":"title"},props:{allowToggling:{value:true},isBold:{value:false,action:"_isSelectedAction"},boldButtonTooltip:{value:this._getLocaleValue("boldButtonTitle"),action:"_tooltipAction"},boldButtonIcon:{value:"ui-igbutton-bold",action:"_buttonIconAction"}}},{name:"Italic",type:"button",language:this.options.language,localeProperties:{"data-localeid":"italicButtonTitle","data-localeattr":"title"},props:{isItalic:{value:false,action:"_isSelectedAction"},italicButtonTooltip:{value:this._getLocaleValue("italicButtonTitle"),action:"_tooltipAction"},italicButtonIcon:{value:"ui-igbutton-italic",action:"_buttonIconAction"}}},{name:"Underline",type:"button",language:this.options.language,localeProperties:{"data-localeid":"underlineButtonTitle","data-localeattr":"title"},props:{isUnderline:{value:false,action:"_isSelectedAction"},underlineButtonTooltip:{value:this._getLocaleValue("underlineButtonTitle"),action:"_tooltipAction"},underlineButtonIcon:{value:"ui-igbutton-underline",action:"_buttonIconAction"}}},{name:"Strikethrough",type:"button",language:this.options.language,localeProperties:{"data-localeid":"strikethroughButtonTitle","data-localeattr":"title"},props:{isStrikethrough:{value:false,action:"_isSelectedAction"},strikethroughButtonTooltip:{value:this._getLocaleValue("strikethroughButtonTitle"),action:"_tooltipAction"},strikethroughButtonIcon:{value:"ui-igbutton-strikethrough",action:"_buttonIconAction"}}},{name:"fontFamily",type:"combo",language:this.options.language,scope:null,handler:"_fontNamePlg",props:{fontFamilyComboWidth:{value:180,action:"_comboWidthAction"},fontFamilyComboHeight:{value:"",action:"_comboHeightAction"},fontFamilies:{value:this._getFontFamilies(),action:"_comboDataSourceAction"},selectedFontFamily:{value:"Times New Roman",action:"_comboSelectedItem"}}},{type:"combo",name:"fontSize",language:this.options.language,scope:null,handler:"_fontSizePlg",props:{fontSizeComboWidth:{value:75,action:"_comboWidthAction"},fontSizeComboHeight:{value:"",action:"_comboHeightAction"},fontSizes:{value:this._getLocaleValue("fontSizes"),action:"_comboDataSourceAction"},selectedFontSize:{value:"3",action:"_comboSelectedItem"},fontSizeItemsListWidth:{value:100,action:"_comboDropDownListWidth"}}},{type:"combo",name:"formatsList",language:this.options.language,scope:null,handler:"_formatsListPlg",props:{formatsListComboWidth:{value:170,action:"_comboWidthAction"},formatsListComboHeight:{value:"",action:"_comboHeightAction"},formatsList:{value:this._getLocaleValue("formatsList"),action:"_comboDataSourceAction"},selectedFormat:{value:"p",action:"_comboSelectedItem"}}}]},{name:"formattingToolbar",displayName:this._getLocaleValue("formattingToolbar"),isExpanded:true,language:this.options.language,allowCollapsing:true,collapseButtonIcon:"ui-igbutton-collapse",expandButtonIcon:"ui-igbutton-expand",items:[{name:"justifyleft",type:"button",localeProperties:{"data-localeid":"alignTextLeftButtonTitle","data-localeattr":"title"},props:{isJustifyLeft:{value:true,action:"_isSelectedAction"},justifyLeftButtonTooltip:{value:this._getLocaleValue("alignTextLeftButtonTitle"),action:"_tooltipAction"},justifyLeftButtonIcon:{value:"ui-igbutton-justifyleft",action:"_buttonIconAction"}}},{name:"justifycenter",type:"button",localeProperties:{"data-localeid":"alignTextCenterButtonTitle","data-localeattr":"title"},props:{isJustifyCenter:{value:false,action:"_isSelectedAction"},justifyCenterButtonTooltip:{value:this._getLocaleValue("alignTextCenterButtonTitle"),action:"_tooltipAction"},justifyCenterButtonIcon:{value:"ui-igbutton-justifycenter",action:"_buttonIconAction"}}},{name:"justifyright",type:"button",localeProperties:{"data-localeid":"alignTextRightButtonTitle","data-localeattr":"title"},props:{isJustifyRight:{value:false,action:"_isSelectedAction"},justifyRightButtonTooltip:{value:this._getLocaleValue("alignTextRightButtonTitle"),action:"_tooltipAction"},justifyRightButtonIcon:{value:"ui-igbutton-justifyright",action:"_buttonIconAction"}}},{name:"justifyfull",type:"button",localeProperties:{"data-localeid":"justifyButtonTitle","data-localeattr":"title"},props:{isJustifyFull:{value:false,action:"_isSelectedAction"},justifyFullButtonTooltip:{value:this._getLocaleValue("justifyButtonTitle"),action:"_tooltipAction"},justifyFullButtonIcon:{value:"ui-igbutton-justifyfull",action:"_buttonIconAction"}}},{name:"InsertUnorderedList",type:"button",localeProperties:{"data-localeid":"bulletsButtonTitle","data-localeattr":"title"},props:{isUnorderedList:{value:false,action:"_isSelectedAction"},insertUnorderedListTooltip:{value:this._getLocaleValue("bulletsButtonTitle"),action:"_tooltipAction"},insertUnorderedListButtonIcon:{value:"ui-igbutton-unorderedlist",action:"_buttonIconAction"}}},{name:"InsertOrderedList",type:"button",localeProperties:{"data-localeid":"numberingButtonTitle","data-localeattr":"title"},props:{isOrderedList:{value:false,action:"_isSelectedAction"},insertOrderedListTooltip:{value:this._getLocaleValue("numberingButtonTitle"),action:"_tooltipAction"},insertOrderedListButtonIcon:{value:"ui-igbutton-orderedlist",action:"_buttonIconAction"}}},{name:"outdent",type:"button",localeProperties:{"data-localeid":"decreaseIndentButtonTitle","data-localeattr":"title"},props:{outdentButtonTooltip:{value:this._getLocaleValue("decreaseIndentButtonTitle"),action:"_tooltipAction"},outdentButtonIcon:{value:"ui-igbutton-removeindent",action:"_buttonIconAction"}}},{name:"indent",type:"button",localeProperties:{"data-localeid":"increaseIndentButtonTitle","data-localeattr":"title"},props:{indentTooltip:{value:this._getLocaleValue("increaseIndentButtonTitle"),action:"_tooltipAction"},indentButtonIcon:{value:"ui-igbutton-indent",action:"_buttonIconAction"}}},{name:"textColor",type:"splitButtonColor",handler:"_fontColorPlg",localeProperties:{"data-localeid":"fontColorButtonTitle","data-localeattr":"title",title:this._getLocaleValue("fontColorButtonTitle")},props:{items:{value:[{name:"textColor",iconClass:"ui-igbutton-forecolor"}]},defaultItemName:{value:"textColor"},selectedTextColor:{value:"red",action:"_spltButtonColorAction"}}},{name:"backgroundTextColor",type:"splitButtonColor",handler:"_fontBackgroundColorPlg",localeProperties:{"data-localeid":"textHighlightButtonTitle","data-localeattr":"title",title:this._getLocaleValue("textHighlightButtonTitle")},props:{items:{value:[{name:"backgroundTextColor",iconClass:"ui-igbutton-backcolor"}]},defaultItemName:{value:"backgroundTextColor"},selectedTextBackgroundColor:{value:"",action:"_spltButtonColorAction"}}}]},{name:"insertObjectToolbar",displayName:this._getLocaleValue("insertObjectToolbar"),isExpanded:true,language:this.options.language,allowCollapsing:true,collapseButtonIcon:"ui-igbutton-collapse",expandButtonIcon:"ui-igbutton-expand",items:[{name:"image",type:"button",localeProperties:{"data-localeid":"insertPictureButtonTitle","data-localeattr":"title"},handler:"_insertImageDialogPlg",props:{isImage:{value:false,action:"_isSelectedAction"},imageButtonTooltip:{value:this._getLocaleValue("insertPictureButtonTitle"),action:"_tooltipAction"},imageButtonIcon:{value:"ui-igbutton-addimage",action:"_buttonIconAction"}}},{name:"link",type:"button",handler:"_insertLinkPlg",localeProperties:{"data-localeid":"insertLinkButtonTitle","data-localeattr":"title"},props:{isLink:{value:false,action:"_isSelectedAction"},linkButtonTooltip:{value:this._getLocaleValue("insertLinkButtonTitle"),action:"_tooltipAction"},linkButtonIcon:{value:"ui-igbutton-addlink",action:"_buttonIconAction"}}},{name:"table",type:"button",handler:"_insertTablePlg",localeProperties:{"data-localeid":"insertTableButtonTitle","data-localeattr":"title"},props:{isTable:{value:false,action:"_isSelectedAction"},tableButtonTooltip:{value:this._getLocaleValue("insertTableButtonTitle"),action:"_tooltipAction"},tableButtonIcon:{value:"ui-igbutton-table",action:"_buttonIconAction"}}},{name:"addRow",type:"button",handler:"_addTableRowPlg",localeProperties:{"data-localeid":"addRowButtonTitle","data-localeattr":"title"},props:{allowToggling:{value:false},isAddRow:{value:false,action:"_isSelectedAction"},addRowButtonTooltip:{value:this._getLocaleValue("addRowButtonTitle"),action:"_tooltipAction"},addRowButtonIcon:{value:"ui-igbutton-addrow",action:"_buttonIconAction"}}},{name:"addColumn",type:"button",handler:"_addTableColumnPlg",localeProperties:{"data-localeid":"addColumnButtonTitle","data-localeattr":"title"},props:{allowToggling:{value:false},isAddColumn:{value:false,action:"_isSelectedAction"},addColumnButtonTooltip:{value:this._getLocaleValue("addColumnButtonTitle"),action:"_tooltipAction"},addColumnButtonIcon:{value:"ui-igbutton-addcolumn",action:"_buttonIconAction"}}},{name:"removeRow",type:"button",handler:"_removeTableRowPlg",localeProperties:{"data-localeid":"removeRowButtonTitle","data-localeattr":"title"},props:{allowToggling:{value:false},isRemoveRow:{value:false,action:"_isSelectedAction"},removeRowButtonTooltip:{value:this._getLocaleValue("removeRowButtonTitle"),action:"_tooltipAction"},removeRowButtonIcon:{value:"ui-igbutton-removerow",action:"_buttonIconAction"}}},{name:"removeColumn",type:"button",handler:"_removeTableColumnPlg",localeProperties:{"data-localeid":"removeColumnButtonTitle","data-localeattr":"title"},props:{allowToggling:{value:false},isRemoveColumn:{value:false,action:"_isSelectedAction"},removeColumnButtonTooltip:{value:this._getLocaleValue("removeColumnButtonTitle"),action:"_tooltipAction"},removeColumnButtonIcon:{value:"ui-igbutton-removecolumn",action:"_buttonIconAction"}}}]},{name:"copyPasteToolbar",displayName:this._getLocaleValue("copyPasteToolbar"),isExpanded:true,language:this.options.language,allowCollapsing:true,collapseButtonIcon:"ui-igbutton-collapse",expandButtonIcon:"ui-igbutton-expand",items:[{name:"copy",type:"button",scope:null,localeProperties:{"data-localeid":"copyButtonTitle","data-localeattr":"title"},props:{isCopy:{value:false,action:"_isSelectedAction"},copyButtonTooltip:{value:this._getLocaleValue("copyButtonTitle"),action:"_tooltipAction"},copyButtonIcon:{value:"ui-igbutton-copy",action:"_buttonIconAction"}}},{name:"cut",type:"button",scope:null,localeProperties:{"data-localeid":"cutButtonTitle","data-localeattr":"title"},props:{isCut:{value:false,action:"_isSelectedAction"},cutButtonTooltip:{value:this._getLocaleValue("cutButtonTitle"),action:"_tooltipAction"},cutButtonIcon:{value:"ui-igbutton-cut",action:"_buttonIconAction"}}},{name:"paste",type:"button",scope:null,localeProperties:{"data-localeid":"pasteButtonTitle","data-localeattr":"title"},props:{isPaste:{value:false,action:"_isSelectedAction"},pasteButtonTooltip:{value:this._getLocaleValue("pasteButtonTitle"),action:"_tooltipAction"},pasteButtonIcon:{value:"ui-igbutton-paste",action:"_buttonIconAction"}}},{name:"undo",type:"button",scope:null,localeProperties:{"data-localeid":"undoButtonTitle","data-localeattr":"title"},props:{allowToggling:{value:false},isUndo:{value:false,action:"_isSelectedAction"},undoButtonTooltip:{value:this._getLocaleValue("undoButtonTitle"),action:"_tooltipAction"},undoButtonIcon:{value:"ui-igbutton-undo",action:"_buttonIconAction"}}},{name:"redo",type:"button",scope:null,localeProperties:{"data-localeid":"redoButtonTitle","data-localeattr":"title"},props:{allowToggling:{value:false},isRedo:{value:false,action:"_isSelectedAction"},redoButtonTooltip:{value:this._getLocaleValue("redoButtonTitle"),action:"_tooltipAction"},redoButtonIcon:{value:"ui-igbutton-redo",action:"_buttonIconAction"}}}]}]},_createWidget:function(){this._superApply(arguments)},_id:function(id){return this.element[0].id+id},widget:function(){return this.element},_render:function(){var html="",inputName=this.options.inputName;this.element.addClass(this.css.htmlEditor);html+='<div id="'+this._id("_toolbars")+'" class="'+this.css.toolbarsContainer+'"></div>';html+='<div id="'+this._id("_content")+'" class="'+this.css.htmlEditorContent+'">';html+='<iframe class="'+this.css.workspaceIframe+'" id="'+this._id("_editor")+'"></iframe>';html+='<textarea name="'+inputName+'" id="'+this._id("_source")+'"></textarea>';html+="</div>";$(html).appendTo(this.element);$("#"+this._id("_source")).hide();this.element.height(this.options.height);this.element.width(this.options.width)},_createWorkspace:function(content){var iFrameContent="<"+"!"+"DOCTYPE html"+">"+"<html>"+"<head>"+"<title>igHtmlEditor</title>"+"</head>"+'<body contentEditable="true" spellcheck="false" style="-webkit-tap-highlight-color: rgba(255, 255, 255, 0);">'+"<p>";if(!document.all){iFrameContent+="<br />"}iFrameContent+="</p></body></html>";this.workspace=this.element.find("#"+this._id("_editor"))[0];this.workspace.contentWindow.document.open("text/html","replace");this.workspace.contentWindow.document.write(iFrameContent);this.workspace.contentWindow.document.close();if(content&&content.length>0){$(this.workspace).contents().find("body").html(content)}if($.ig.util.isWebKit){this.workspace.contentWindow.document.body.contentEditable=true}if(!document.all){var showUI=false,comandValue=true;this.workspace.contentWindow.document.execCommand("styleWithCSS",showUI,comandValue)}},_getToolbar:function(index){if(!isNaN(parseInt(index,10))){return this._toolbars.eq(index)}if(typeof index==="string"){return this._toolbars.find("#"+this._id("_toolbars_"+index))}},_getToolbarSettings:function(name){var curToolbar,result,i;for(i=0;i<this._allToolbars.length&&!result;i++){curToolbar=this._allToolbars[i];if(curToolbar.name===name){result=curToolbar}}return result},_getFirefoxVersion:function(){if($.ig.util.isFF){return parseInt(window.navigator.userAgent.match(/\bFirefox\/[ 0-9\. ]+\b/)[0].split("/").reverse()[0],10)}},_create:function(){this._allToolbars=[];this._initDefaultToolbars();var noCancel=this._trigger(this.events.rendering,null,{owner:this}),content=this.options.value||this.element.html();this.element.empty();if(noCancel){this._render();this._initToolbars();this._createWorkspace(content);this._domPathToolbar();this.resizeWorkspace();this._trigger(this.events.rendered,null,{owner:this})}},_resizeWorkspaceHandler:function(){var args={owner:this};this.resizeWorkspace();return this._trigger(this.events.workspaceResized,null,args)},_init:function(){this._comboHeight=24;this._bindToToolbarEvents();this._bindWorkspaceEvents();this.sourceWindow=this.element.find("#"+this._id("_source"));this._initFontsCombos();this._initFormatsListCombo();this._initFontSizeCombo();this._analyser=new $.ig.ToolbarHelper(this.workspace.contentWindow,this._toolbars.children());var self=this;this._onSelectionChange(function(){self._initialWorkspaceFormatting()})},_initFontsCombos:function(){var textToolbar=this._getToolbar("textToolbar"),fontFamiliesCombo=textToolbar.igToolbar("getItem","fontFamily").addClass("ui-combo-fontfamily");fontFamiliesCombo.igCombo("option",{language:this.options.language,itemTemplate:'<span style="font-family: ${value}" unselectable="on">${text}</span>',height:this._comboHeight,dropDownOrientation:"bottom"})},_initFormatsListCombo:function(){var formatsListCombo=this._getToolbar("textToolbar").igToolbar("getItem","formatsList");formatsListCombo.igCombo("option",{language:this.options.language,itemTemplate:'<${text} unselectable="on">${value}</${text}>',height:this._comboHeight,dropDownOrientation:"bottom"})},_initFontSizeCombo:function(){var fontSizesCombo=this._getToolbar("textToolbar").igToolbar("getItem","fontSize");fontSizesCombo.igCombo("option",{language:this.options.language,itemTemplate:'<span unselectable="on">${value}</span>',height:this._comboHeight,dropDownOrientation:"bottom"})},_getFontFamilies:function(){return this._getLocaleValue("fontNames")[/^win/gi.test(navigator.platform)?"win":"mac"]},_setOption:function(name,value){var self=this;if(name===undefined||value===undefined){return}if(name==="toolbarSettings"){$.each(value,function(index,toolbar){$.each(toolbar,function(tbPropName,tbPropVal){if(tbPropName!=="name"){self._getToolbar(self._allToolbars[index].name).igToolbar("option",tbPropName,tbPropVal)}})})}else if(this._toolbarsActiveState[name]){this._showToolbar(this._toolbarsActiveState[name].name,value)}else if(name==="width"){this.element.width(value)}else if(name==="height"){this.element.height(value);this.resizeWorkspace()}else if(name==="value"){this.setContent(value,"text")}this._super(name,value)},_changeLocaleForToolbars:function(){this._allToolbars.forEach(function(toolbar){this._getToolbar(toolbar.name).igToolbar("option",{displayName:this._getLocaleValue(toolbar.name),language:this.options.language})},this)},changeLocale:function(){this._superApply(arguments);this._changeLocaleForToolbars();if(this._insertLinkDialog){this._insertLinkDialog.remove();this._insertLinkDialog=null}if(this._imageDialog){this._imageDialog.remove();this._imageDialog=null}this._changeLocaleForFontFamilies();this._changeLocaleForFontSizes();this._changeLocaleForFormatsList()},_changeLocaleForFontFamilies:function(){var selectedValue,$combo=this._getToolbar("textToolbar").igToolbar("getItem","fontFamily"),comboInstance=$combo.data("igCombo");if(comboInstance){selectedValue=comboInstance.value();comboInstance._setOption("dataSource",this._getFontFamilies());comboInstance._setOption("language",this.options.language);comboInstance.value(selectedValue)}},_changeLocaleForFontSizes:function(){var selectedValue,$combo=this._getToolbar("textToolbar").igToolbar("getItem","fontSize"),comboInstance=$combo.data("igCombo");if(comboInstance){selectedValue=comboInstance.value();comboInstance._setOption("dataSource",this._getLocaleValue("fontSizes"));comboInstance._setOption("language",this.options.language);comboInstance.value(selectedValue)}},_changeLocaleForFormatsList:function(){var selectedValue,$combo=this._getToolbar("textToolbar").igToolbar("getItem","formatsList"),comboInstance=$combo.data("igCombo");if(comboInstance){selectedValue=comboInstance.value();comboInstance._setOption("dataSource",this._getLocaleValue("formatsList"));comboInstance._setOption("language",this.options.language);comboInstance.value(selectedValue)}},_showToolbar:function(name,show){if(show){this._getToolbar(name).removeClass("hidden").show()}else{this._getToolbar(name).addClass("hidden").hide()}},_initToolbars:function(){this._allToolbars=$.extend(true,[],this.defaultToolbars.concat(this.options.customToolbars));this._toolbars=this.element.find("#"+this._id("_toolbars"));this._mergeToolbarSettings();this._createToolbars()},_mergeToolbarSettings:function(){var customSettings=this.options.toolbarSettings,curSettings,curCustomSettings,curName,items,curItem,curItemProps,propFound,property,i,j;for(i=0;i<customSettings.length;i++){curCustomSettings=customSettings[i];curName=curCustomSettings.name;if(typeof curName==="string"){curSettings=this._getToolbarSettings(curName);if(curSettings){for(property in curCustomSettings){if(property!=="name"){propFound=false;if(curSettings.hasOwnProperty(property)){curSettings[property]=curCustomSettings[property]}else{items=curSettings.items;for(j=0;j<items.length&&!propFound;j++){curItem=items[j];curItemProps=curItem.props;if(curItemProps.hasOwnProperty(property)){curItemProps[property].value=curCustomSettings[property];propFound=true}}}}}}}}},_createToolbars:function(){var options=this.options,curSettings,curName,showToolbarOption,showToolbar,i;this._toolbars=this.element.find("#"+this._id("_toolbars"));for(i=0;i<this._allToolbars.length;i++){curSettings=this._allToolbars[i];curName=curSettings.name;showToolbarOption=$.camelCase("show-"+curName);showToolbar=true;$("<span>").attr("id",this._id("_toolbars")+"_"+curName).appendTo(this._toolbars).igToolbar(curSettings);if(options[showToolbarOption]!==undefined){showToolbar=options[showToolbarOption]}this._toolbarsActiveState[showToolbarOption]={name:curName,value:showToolbar};this._showToolbar(curName,showToolbar)}if($.ig.util.isIE){this._toolbars.find("*").attr("unselectable","on")}},_initialWorkspaceFormatting:function(){var i,curSettings,property,command,args,toolbarSettings=this.options.toolbarSettings,commands={isBold:"bold",isItalic:"italic",isUnderline:"underline",isStrikethrough:"strikethrough",isJustifyLeft:"justifyleft",isJustifyRight:"justifyright",isJustifyCenter:"justifycenter",isJustifyFull:"justifyfull",isUnorderedList:"InsertUnorderedList",isOrderedList:"InsertOrderedList"},argsCommands={selectedFontFamily:"fontName",selectedFontSize:"fontSize",selectedFormat:"formatBlock",selectedTextColor:"forecolor",selectedTextBackgroundColor:"backcolor"};for(i=0;i<toolbarSettings.length;i++){curSettings=toolbarSettings[i];for(property in curSettings){if(curSettings.hasOwnProperty(property)){if(commands.hasOwnProperty(property)){command=commands[property]}else if(argsCommands.hasOwnProperty(property)){command=argsCommands[property];args=curSettings[property]}else{command=null}if(command){if(command===argsCommands.selectedFormat){args="<"+args+">"}this._initialSelectionSetup();this._execCommand(command,args);this._emptyAndCollapseSelection()}}}}},_initialSelectionSetup:function(){var lastNode=$(this.contentDocument()).find(":not(br)").last(),sel=this._selectionWrapperSaved._getSelection(),range=this._selectionWrapperSaved._getRange();lastNode.html("&nbsp;");range.selectNode(lastNode[0]);sel.removeAllRanges();sel.addRange(range)},_emptyAndCollapseSelection:function(){var lastNode=$(this.contentDocument()).find(":not(br)").last(),sel=this._selectionWrapperSaved._getSelection(),range=this._selectionWrapperSaved._getRange();lastNode.html("<br>");if(lastNode.length>0){range.setStart(lastNode[0],0);range.setEnd(lastNode[0],0);range.collapse(true);sel.removeAllRanges();sel.addRange(range)}},_execCommand:function(name,args){this._selectionWrapperSaved.focus();if($.ig.util.isIE){this._selectionWrapperSaved._updateSelection(this._selectionWrapperSaved._getRange())}this._selectionWrapperSaved.execCommand(name.toLowerCase(),args);this._onSelectionChange()},_hideDialogs:function(){this.element.find(":ui-igLinkPropertiesDialog").igLinkPropertiesDialog("hide");this.element.find(":ui-igTablePropertiesDialog").igTablePropertiesDialog("hide");this.element.find(":ui-igImagePropertiesDialog").igImagePropertiesDialog("hide")},_bindToToolbarEvents:function(){var self=this,events="igtoolbartoolbarbuttonclick igtoolbartoolbarcomboselected "+"igtoolbartoolbarcustomitemclick igtoolbarcollapsing "+"igtoolbarcollapsed igtoolbarexpanding igtoolbarexpanded",splitBtnArrowSelector=".ui-splitbutton-arrow",toolbarEvents={igtoolbarcollapsing:this.events.toolbarCollapsing,igtoolbarcollapsed:this.events.toolbarCollapsed,igtoolbarexpanding:this.events.toolbarExpanding,igtoolbarexpanded:this.events.toolbarExpanded};this._toolbars.delegate(":ui-igToolbar",events,function _onToolbarItemClick(e,ui){var scope=ui.scope,handler=ui.handler,$eTarget=$(e.originalEvent.currentTarget),noCancel;delete ui.scope;delete ui.handler;self._hideDialogs();if($eTarget.is(splitBtnArrowSelector)){e.stopImmediatePropagation();return}if(toolbarEvents.hasOwnProperty(e.type)){self.resizeWorkspace();self._trigger(toolbarEvents[e.type],e,ui);return}ui.selectedItem=self._selectionWrapperSaved&&self._selectionWrapperSaved.getSelectedItem();noCancel=self._trigger(self.events.actionExecuting,e,{owner:self,toolbar:ui.toolbarName,actionName:ui.name});if(noCancel){if(!handler&&!scope){self._execCommand(ui.name,ui.value)}else if(handler&&!scope){self[handler](self.workspace.contentWindow.document,ui)}else if(handler&&scope){handler.call(ui.scope,self.workspace.contentWindow.document,ui)}self._trigger(self.events.actionExecuted,e,{owner:self,toolbar:ui.toolbarName,actionName:ui.name});e.stopImmediatePropagation()}})},_bindWorkspaceEvents:function(){var self=this,$workspaceDocument=$(this.contentDocument()),$workspaceBody=$(this.contentEditable()),KEYS={webKitIE:{CTRLZ:90,CTRLY:89},moz:{CTRLZ:90,CTRLY:89}};$workspaceDocument.find("html").bind("click",function(e){var target=$(e.target);if(target.is("html")){self.workspace.contentWindow.document.body.focus()}self._isDirty=true;self._hideDialogs();e.stopPropagation()}).bind("mouseup",function(){self._onSelectionChange()});$workspaceDocument.bind("keydown",function(e){var $children,$firstChild;self._isDirty=true;if(e.ctrlKey&&(e.which===KEYS.webKitIE.CTRLZ||e.which===KEYS.moz.CTRLZ)){self._trigger(self.events.undo,e,{owner:self})}if(e.ctrlKey&&(e.which===KEYS.webKitIE.CTRLY||e.which===KEYS.moz.CTRLY)){self._trigger(self.events.redo,e,{owner:self})}if(e.keyCode===8||e.keyCode===46){$children=$workspaceBody.children();$firstChild=$children.first();if($children.length===1&&$firstChild.html()==="<br>"){e.preventDefault()}}self._onSelectionChange()});$workspaceDocument.bind("cut copy paste",function(e){self._trigger(e.type,e,{owner:self})});this.element.bind("ightmleditoractionexecuted",function(e,ui){if(ui.actionName.toLowerCase()===self.events.undo||ui.actionName.toLowerCase()===self.events.redo){self._trigger(ui.actionName.toLowerCase(),e,{owner:self});e.stopImmediatePropagation()}});$(document).click(function(e){var $tarParents=$(e.target).parents();if(!$tarParents.is(".ui-igpopover")&&!$tarParents.is(".ui-igcombo-list")){self._hideDialogs()}});$(window).on("resize",$.proxy(this._resizeWorkspaceHandler,this))},_viewSource:function(){var workspace=$(this.workspace),workSpaceBody=workspace.contents().find("body");if(workspace.is(":visible")){workSpaceBody.attr("contentEditable",false);this.sourceWindow.val($.trim(workSpaceBody.html()));workspace.hide();this.sourceWindow.show()}else{workSpaceBody.attr("contentEditable",true);workSpaceBody.html($.trim(this.sourceWindow.val()));workspace.show();this.sourceWindow.hide();this.sourceWindow.val(encodeURIComponent(this.sourceWindow.val()))}},_viewSourcePlg:function(){this._viewSource()},_insertImageDialogPlg:function(workspace,plgUI){var image=$("<img>",this.workspace.contentWindow.document),self=this;if(plgUI.selectedItem.is("img")){image=plgUI.selectedItem}this._imageDialog=$("#"+this._id("_imageDialog"));if(!this._imageDialog.length){this._imageDialog=$('<div id="'+this._id("_imageDialog")+'"></div>').appendTo(this.element).igImagePropertiesDialog({item:image,target:plgUI.toolbarItem,language:this.options.language,locale:this.options.locale,applyform:function(e,ui){self._selectionWrapperSaved.focus();self._selectionWrapperSaved.replaceNode(ui.image)}})}else{if(this._imageDialog.igImagePropertiesDialog("option","isHidden")){this._imageDialog.igImagePropertiesDialog("show",image)}else{this._imageDialog.igImagePropertiesDialog("hide",image)}}},_insertLinkPlg:function(workspace,ui){var self=this,selectedItem=this._selectionWrapperSaved.getSelectedItem(),selectedItemNodeType=selectedItem[0].nodeType,anchor=$("<a></a>",this.workspace.contentWindow.document);if(selectedItem.parent().is("a")){anchor=selectedItem.parent()}else if(selectedItemNodeType===this.NODE._Text||selectedItemNodeType===this.NODE._Element){anchor.html(this._selectionWrapperSaved.getSelectionAsText())}if(!this._insertLinkDialog){this._insertLinkDialog=$('<div id="'+this._id("_linkDialog")+'"></div>').appendTo(this.element).igLinkPropertiesDialog({item:anchor,target:ui.toolbarItem,language:this.options.language,locale:this.options.locale,applyform:function(e,ui){self._selectionWrapperSaved.focus();self._selectionWrapperSaved.replaceNode(ui.anchor)}})}else{if(this._insertLinkDialog.igLinkPropertiesDialog("option","isHidden")){this._insertLinkDialog.igLinkPropertiesDialog("show",anchor)}else{this._insertLinkDialog.igLinkPropertiesDialog("hide",anchor)}}},_fontNamePlg:function(workspace,ui){this._execCommand("fontname",ui.value)},_fontSizePlg:function(workspace,ui){this._execCommand("fontsize",ui.value)},_formatsListPlg:function(workspace,ui){this._execCommand("formatBlock","<"+ui.value+">")},_insertTablePlg:function(workspace,plgUI){var table=$("<table></table>",this.workspace.contentWindow.document),self=this;if(plgUI.selectedItem.is("table")){table=plgUI.selectedItem}if(!this.insertTableDialog){this.insertTableDialog=$("<div id='"+this._id("_tableDialog")+"'</div>").appendTo(this.element).igTablePropertiesDialog({item:table,target:plgUI.toolbarItem,applyform:function(e,ui){self._selectionWrapperSaved.insertTable(ui.table)}});return}if(this.insertTableDialog.igTablePropertiesDialog("option","isHidden")){this.insertTableDialog.igTablePropertiesDialog("show",table);return}if(!this.insertTableDialog.igTablePropertiesDialog("option","isHidden")){this.insertTableDialog.igTablePropertiesDialog("hide")}},_addTableRowPlg:function(){var selectedItem=this._selectionWrapperSaved.getSelectedItem();if(selectedItem.is("table")){selectedItem.tableManipulator("addRow")}else if(selectedItem.is("td")){selectedItem.parents("table").first().tableManipulator("addRow",selectedItem.parent().index())}},_removeTableRowPlg:function(){var selectedItem=this._selectionWrapperSaved.getSelectedItem();if(selectedItem.is("table")){selectedItem.tableManipulator("removeRow")}else if(selectedItem.is("td")){selectedItem.parents("table").first().tableManipulator("removeRow",selectedItem.parent().index())}},_addTableColumnPlg:function(){var selectedItem=this._selectionWrapperSaved.getSelectedItem();if(selectedItem.is("table")){selectedItem.tableManipulator("addColumn")}else if(selectedItem.is("td")){selectedItem.parents("table").first().tableManipulator("addColumn",selectedItem.index())}},_removeTableColumnPlg:function(){var selectedItem=this._selectionWrapperSaved.getSelectedItem();if(selectedItem.is("table")){selectedItem.tableManipulator("removeColumn")}else if(selectedItem.is("td")){selectedItem.parents("table").first().tableManipulator("removeColumn",selectedItem.index())}},_fontColorPlg:function(workspace,ui){if(/^rgb/.test(ui.value)){ui.value=$.ig.util.rgbToHex(ui.value)}this._execCommand("forecolor",ui.value)},_fontBackgroundColorPlg:function(workspace,ui){var command=this._getFirefoxVersion()?"hilitecolor":"backcolor";this._execCommand(command,ui.value)},_domPathToolbar:function(){var self=this,tableItemPref="#"+this._id("_toolbars_insertObjectToolbar_item_"),tableItemAddRowID=tableItemPref+"addRow",tableItemAddColID=tableItemPref+"addColumn",tableItemRemRowID=tableItemPref+"removeRow",tableItemRemColID=tableItemPref+"removeColumn",doNotEnableToolbarButtonsSelector=tableItemAddRowID+", "+tableItemAddColID+", "+tableItemRemRowID+", "+tableItemRemColID;this._viewSourceBtn=$('<div class="ui-igbutton-viewsource"></div>').appendTo(this.element).igButton({labelText:"&nbsp;",title:this._getLocaleValue("viewSourceButtonTitle"),icons:{primary:"ui-igbutton-viewsource-icon"},onlyIcons:true,click:function(){self._viewSourcePlg();if(self._domPathToolbar.igPathFinder("option","disabled")){self._domPathToolbar.igPathFinder("option","disabled",false);
self._toolbars.find(":ui-igToolbarButton").not(doNotEnableToolbarButtonsSelector).igToolbarButton("option","disabled",false).end().end().find(":ui-igCombo").igCombo("enable");self._analyser._disableUnsupportedItems();self._onSelectionChange()}else{self._domPathToolbar.igPathFinder("option","disabled",true);self._toolbars.find(":ui-igToolbarButton").igToolbarButton("option","disabled",true).end().find(":ui-igCombo").igCombo("disable")}}}).attr({"data-localeid":"viewSourceButtonTitle","data-localeattr":"title"});this._domPathToolbar=$('<div id="'+this._id("_domPathToolbar")+'"></div>').appendTo(this.element).igPathFinder({click:function(e,ui){var selectionWrapper=self._selectionWrapperSaved;self.workspace.contentWindow.document.body.focus();if(self._domPathToolbar.igPathFinder("option","disabled")){return}e.preventDefault();if(ui.item.is("html")){selectionWrapper.select(ui.item.children("body"))}else if(ui.item.is("body")){selectionWrapper.select(ui.item)}else{selectionWrapper.select(ui.item)}}})},_onSelectionChange:function(callback){var self=this,selectionWrapper,workSpaceBody=$(this.workspace).contents().find("body"),selectionCallback=callback||function(){var selectedItem=this.getSelectedItem();if(selectedItem&&(selectedItem.is("p")||selectedItem.is(":header"))&&selectedItem.children("span").length>0){selectedItem=selectedItem.children("span").first()}else if(selectedItem&&(selectedItem.is("p")||selectedItem.is(":header"))&&selectedItem.children("font").length>0){selectedItem=selectedItem.children("font").first()}if(selectedItem[0].nodeType===self.NODE._Text){selectedItem=selectedItem.parent()}self._analyser.analyse(selectedItem);if(selectedItem.length){self._domPathToolbar.igPathFinder("option","items",$.merge(selectedItem,selectedItem.parents()))}};selectionWrapper=new $.ig.SelectionWrapper(this.workspace.contentWindow,function(){self._selectionWrapperSaved=this;self.sourceWindow.val(encodeURIComponent(workSpaceBody.html()));selectionCallback.call(this)})},_destroyPopovers:function(){var el=this.element[0];$(':data("igPopover")').each(function(){if($.contains(el,this)){$(this).igPopover("destroy")}})},resizeWorkspace:function(){var $clonedElement,height=this.element.height(),$editor=$("#"+this._id("_editor")),$toolbars=$("#"+this._id("_toolbars"));if(!$toolbars.is(":visible")){$clonedElement=$toolbars.clone();$clonedElement.css({display:"initial",position:"absolute",top:"-10000px",width:this.element.width()});$("body").append($clonedElement);height-=$clonedElement.height()+$toolbars.outerHeight(true);$clonedElement.remove()}else{height-=$toolbars.outerHeight(true)}height-=$(".ui-igbutton-viewsource").outerHeight(true);height-=$editor.outerHeight(true)-$editor.height();$editor.height(height);$("#"+this._id("_source")).height(height)},getContent:function(format){if(format==="text"){return $(this.workspace).contents().find("body").text()}if(format==="html"){return $(this.workspace).contents().find("body").html()}},setContent:function(content,format){if(format==="text"){$(this.workspace).contents().find("body").text(content)}else if(format==="html"){$(this.workspace).contents().find("body").html(content)}this.sourceWindow.val(encodeURIComponent(content));this.workspace.blur()},destroy:function(){this._superApply(arguments);$(this.workspace.contentWindow).undelegate();this._destroyPopovers();this._viewSourceBtn.igButton("destroy");this.element.removeClass(this.css.htmlEditor).find("#"+this._id("_content")).removeClass(this.css.htmlEditorContent).end().find("#"+this._id("_domPathToolbar")).removeClass(this.css.pathFinder).end().find("#"+this._id("_toolbars")).removeClass(this.css.toolbarsContainer).end().find(":ui-igToolbar").igToolbar("destroy").end().empty()},executeAction:function(actionName,args){this._selectionWrapperSaved.execCommand(actionName.toLowerCase(),args);this._onSelectionChange()},isDirty:function(){return this._isDirty},contentWindow:function(){return this.workspace.contentWindow},contentDocument:function(){return this.contentWindow().document},contentEditable:function(){return this.contentDocument().body},selection:function(){return this._selectionWrapperSaved._getSelection()},range:function(){return this._selectionWrapperSaved._getRange()},insertAtCaret:function(element){var el,range;if($.ig.util.isDomElement(element)){element=$(element)}if(element instanceof $){element=$("<div />").append(element).html()}else if(typeof element!=="string"){return}el=$(element,this._selectionWrapperSaved._document)[0];range=this.range();range.insertNode(el)}});$.widget("ui.igPathFinder",{options:{items:null},css:{button:"ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only "+"ui-igbutton ui-widget-content",buttonLabel:"ui-button-text",stateDefault:"ui-state-default",firstButton:"ui-first-button",overflowMarker:"ui-igpathfinder-overflowMarker"},_create:function(){var self=this,o=this.options;this._addStyles();this.element.attr("disabled",o.disabled).attr("aria-disabled",o.disabled).on("mouseover","div",function(){if(!o.disabled){$(this).addClass("ui-state-hover")}}).on("mouseleave","div",function(){if(!o.disabled){$(this).removeClass("ui-state-hover")}}).on("click","div",function(e){if(!o.disabled){$(this).siblings(".ui-state-active").removeClass("ui-state-active");$(this).addClass("ui-state-active");self._trigger("click",e,{item:self.options.__currentParents.eq(self.options.__currentButtonList.index(this))})}})},_addStyles:function(){this.element.addClass("ui-igPathFinder")},_setOption:function(name,value){$.Widget.prototype._setOption.apply(this,arguments);switch(name){case"items":this._updateToolbar();break;case"disabled":this.element.toggleClass("ui-state-disabled",!!value).attr("aria-disabled",value);break;default:break}},_addOverflowMarker:function(){var overflowMarker=$("<div>...</div>").addClass(this.css.overflowMarker).addClass(this.css.stateDefault);overflowMarker.prependTo(this.element)},_updateToolbar:function(){var i,parents,btn,buttonsList,self=this,o=this.options,path=[],html="",viewSrcBtn=$(".ui-igbutton-viewsource"),overflowMarkerWidth=20,maxWidth=viewSrcBtn.parent().width()-viewSrcBtn.outerWidth(true)-overflowMarkerWidth,maxWidthReached=false;if(o.items.length){o.items.each(function(index,element){html='<div aria-disabled="false" style="z-index:'+index+'" class="'+self.css.button+'">'+'<span class="'+self.css.buttonLabel+'">'+element.nodeName+"</span>"+"</div>";path.push(html)});this.element.empty();parents=$(o.items.toArray().reverse());buttonsList=$(path.reverse().join(""));for(i=buttonsList.length-1;i>=0&&!maxWidthReached;i--){buttonsList.removeClass(this.css.firstButton);btn=buttonsList.eq(i).addClass(this.css.firstButton).prependTo(this.element);if(i===0){maxWidth+=overflowMarkerWidth}if(this.element.outerWidth(true)>maxWidth){btn.remove();buttonsList.eq(i+1).addClass(this.css.firstButton);this._addOverflowMarker();maxWidthReached=true}}this.options.__currentButtonList=buttonsList;this.options.__currentParents=parents}}});$.widget("ui.igHtmlEditorPopover",$.ui.igWidget,{localeWidgetName:"HtmlEditor",options:{item:null,target:null,isHidden:true},css:{igHtmlEditorPropertiesDialog:"ui-ightmleditor-dialog",igHtmlEditorPropertiesDialogContainer:"ui-ightmleditor-dialog-container"},events:{apply:"applyform",cancel:"cancelform",show:"show",hide:"hide"},_id:function(id){return this.element[0].id+id},_create:function(){this.element.igPopover({closeOnBlur:false,position:"balanced",direction:"bottom",renderCloseButton:false,showOn:null,maxWidth:"90%",width:"95%",maxHeight:"300px",minWidth:"160px"});this.poContent=this.element.igPopover("container");this._createForm()},_init:function(){this._item=this.options.item;this.poContent.addClass(this.css.igHtmlEditorPropertiesDialog);this.element.addClass(this.css.igHtmlEditorPropertiesDialogContainer);this._attachFormEvents();this.show(this._item)},_createForm:function(){},_attachFormEvents:function(){},_dataBind:function(){},show:function(item){this._item=item;this._dataBind(item);this.options.isHidden=false;this.element.igPopover("show",this.options.target);this._trigger(this.events.show)},hide:function(){this.options.isHidden=true;if(this.options.target.igToolbarButton("option","isSelected")){this.options.target.igToolbarButton("toggle")}this.element.igPopover("hide");this._trigger(this.events.hide)}});$.widget("ui.igLinkPropertiesDialog",$.ui.igHtmlEditorPopover,{_txtUrl:"",_cbTarget:"",_attachFormEvents:function(){var self=this;this.poContent.find("#"+this._id("_cmbOpenIn")).igCombo({initialSelectedItems:[{index:0}],enableClearButton:false,width:"100%",mode:"dropdown"});this.poContent.find("#"+this._id("_btnCancel")).igButton({click:function(){self.hide()}});this.poContent.find("#"+this._id("_btnApply")).igButton({click:function(e){e.stopImmediatePropagation();self._item.attr({href:self._txtUrl.val(),target:self._cbTarget.igCombo("value")}).html(self._displayText.val().length>0?self._displayText.val():self._txtUrl.val());self._trigger(self.events.apply,e,{anchor:self._item});self.hide()}});this.poContent.bind("keypress",function(e){if(e.keyCode===$.ui.keyCode.ESCAPE){self.hide()}});this.element.bind("igpopovershown",function(){self.poContent.find("#"+self._id("_linkHref")).focus()})},_createForm:function(){var html="";html+="<div>"+'<ol class="layoutList">'+"<li>"+'<label for="'+this._id("_linkHref")+'" data-localeid="linkNavigateToUrlDialogText">'+this._getLocaleValue("linkNavigateToUrlDialogText")+"</label>"+'<input autocomplete="off" id="'+this._id("_linkHref")+'" name="href" type="text" value="" />'+"</li>"+"<li>"+'<label for="'+this._id("_linkDisplayText")+'" data-localeid="linkDisplayTextDialogText">'+this._getLocaleValue("linkDisplayTextDialogText")+"</label>"+'<input autocomplete="off" id="'+this._id("_linkDisplayText")+'" name="href" type="text" value="" />'+"</li>"+"<li>"+'<label for="'+this._id("_cmbOpenIn")+'" data-localeid="linkOpenInDialogText">'+this._getLocaleValue("linkOpenInDialogText")+"</label>"+'<select id="'+this._id("_cmbOpenIn")+'" name="target">'+'<option value="_blank" data-localeid="linkTargetNewWindowDialogText">'+this._getLocaleValue("linkTargetNewWindowDialogText")+"</option>"+'<option value="_self" data-localeid="linkTargetSameWindowDialogText">'+this._getLocaleValue("linkTargetSameWindowDialogText")+"</option>"+'<option value="_parent" data-localeid="linkTargetParentWindowDialogText">'+this._getLocaleValue("linkTargetParentWindowDialogText")+"</option>"+'<option value="_top" data-localeid="linkTargetTopmostWindowDialogText">'+this._getLocaleValue("linkTargetTopmostWindowDialogText")+"</option>"+"</select>"+"</li>"+'<li style="text-align:right">'+'<button aria-disabled="false" id="'+this._id("_btnApply")+'" name="insertLink" role="button" title="'+this._getLocaleValue("applyButtonTitle")+'" type="button" '+"data-localeid='applyButtonTitle' "+"data-localeattr='title'>"+this._getLocaleValue("applyButtonTitle")+"</button>"+'<button aria-disabled="false" id="'+this._id("_btnCancel")+'" role="button" title="'+this._getLocaleValue("cancelButtonTitle")+'" type="button" '+"data-localeid='cancelButtonTitle' "+"data-localeattr='title'>"+this._getLocaleValue("cancelButtonTitle")+"</button>"+"</li>"+"</ol>"+"</div>";$(html).appendTo(this.poContent)},_dataBind:function(anchor){this._txtUrl=this.poContent.find("#"+this._id("_linkHref")).val(anchor.attr("href"));this._cbTarget=this.poContent.find("#"+this._id("_cmbOpenIn")).val(anchor.attr("target"));this._displayText=this.poContent.find("#"+this._id("_linkDisplayText")).val(anchor.html())}});$.widget("ui.igTablePropertiesDialog",$.ui.igHtmlEditorPopover,{_init:function(){this.rowsNumField=this.element.find("#"+this._id("_tableRows"));this.columnsNumField=this.element.find("#"+this._id("_tableColumns"));$.ui.igHtmlEditorPopover.prototype._init.apply(this,arguments)},_createForm:function(){var html="<div>"+'<ol class="layoutList">'+"<li>"+"</li>"+"<li>"+'<div class="ui-igtablepropertiesdialog-cols-rows-num">'+'<input type="hidden" id="'+this._id("_tableRows")+'" name="tableRows" readonly="readonly" value="">'+'<input type="hidden" id="'+this._id("_tableColumns")+'" name="tableColumns" readonly="readonly" value="">'+"</div>"+"</li>"+"</ol>"+"</div>";$(html).appendTo(this.poContent);this._sampleTable=$('<table "'+this._id("_tableModel")+'" class="ui-igtablepropertiesdialog-sample-table"></table>').tableManipulator({rows:8,columns:6}).appendTo(this.poContent.find(".layoutList li:first"))},_attachFormEvents:function(){var tablePreview=this.poContent.find("table"),cells=tablePreview.find("td").addClass("ui-state-default"),rows=tablePreview.find("tr"),self=this;tablePreview.delegate("td","mouseover",function(e){var target=$(e.target),currentRowNumber=target.parent().index()+1,currentColumnNumber=$(this).index()+1,i;cells.removeClass("ui-state-hover");for(i=0;i<currentRowNumber;i++){$(rows.get(i)).find("td:lt("+currentColumnNumber+")").addClass("ui-state-hover")}self.rowsNumField.val(currentRowNumber);self.columnsNumField.val(currentColumnNumber)});tablePreview.delegate("td","click",function(e){var target=$(e.target),currentRowNumber=target.parent().index()+1,currentColumnNumber=$(this).index()+1;self._item.tableManipulator({rows:currentRowNumber,columns:currentColumnNumber,addSpacingChar:true});self._trigger(self.events.apply,e,{table:self._item.attr("border",1)});self.hide()});tablePreview.bind("mouseout",function(){cells.removeClass("ui-state-hover");self.rowsNumField.val(null);self.columnsNumField.val(null)})},_dataBind:function(){this.rowsNumField.val();this.columnsNumField.val()}});$.widget("ui.igImagePropertiesDialog",$.ui.igHtmlEditorPopover,{_init:function(){this._imgSrcFld=this.poContent.find("#"+this._id("_imgSrc"));this._imgAltFld=this.poContent.find("#"+this._id("_imgAlt"));$.ui.igHtmlEditorPopover.prototype._init.apply(this,arguments)},_createForm:function(){var html="";html+='<div class="'+this.css.igImagePropertiesDialogContent+'">';html+="   <div>";html+='       <ol class="layoutList">';html+="           <li>";html+='               <label for="'+this._id("_imgSrc")+'" data-localeid="imageUrlDialogText">'+this._getLocaleValue("imageUrlDialogText")+"</label>";html+='               <input autocomplete="off" id="'+this._id("_imgSrc")+'" name="src" type="text" value="" />';html+="           </li>";html+="           <li>";html+='               <label for="'+this._id("_imgAlt")+'" data-localeid="imageAlternativeTextDialogText">'+this._getLocaleValue("imageAlternativeTextDialogText")+"</label>";html+='               <input autocomplete="off" id="'+this._id("_imgAlt")+'" name="altText" type="text" value="" />';html+="           </li>";html+='           <li style="text-align:right">';html+='               <button aria-disabled="false" id="'+this._id("_btnApply")+'" name="insertLink" role="button" title="'+this._getLocaleValue("applyButtonTitle")+'" type="button" '+"data-localeid='applyButtonTitle' data-localeattr='title'>"+this._getLocaleValue("applyButtonTitle")+"</button>";html+='               <button aria-disabled="false" id="'+this._id("_btnCancel")+'" role="button" title="'+this._getLocaleValue("cancelButtonTitle")+'" type="button" '+"data-localeid='cancelButtonTitle' data-localeattr='title'>"+this._getLocaleValue("cancelButtonTitle")+"</button>";html+="           </li>";html+="       </ol>";html+="   </div>";html+="</div>";this.poContent.append(html)},_attachFormEvents:function(){var self=this;this.poContent.find("#"+this._id("_btnApply")).igButton({click:function(e){self._item.attr({src:self._imgSrcFld.val(),alt:self._imgAltFld.val()});self._trigger(self.events.apply,e,{image:self._item});self.hide()}}).end().find("#"+this._id("_btnCancel")).igButton({click:function(e){self._trigger(self.events.cancel,e);self.hide()}})},_dataBind:function(image){this._imgSrcFld.val(image.attr("src"));this._imgAltFld.val(image.attr("alt"))}});var table,tableNumRows=0,tableNumCols=0,settings={document:document,rows:0,columns:0,addSpacingChar:false},spacingChar="",methods={init:function(options){return this.each(function(){var tRows;$.extend(settings,options);if(this.nodeName.toLowerCase()!=="table"){return}if(settings.addSpacingChar){spacingChar="&nbsp;"}table=$(this);tRows=methods.getTableRows();if(settings.rows&&settings.rows>0){tableNumRows=settings.rows}else{tableNumRows=tRows.length}if(settings.columns&&settings.columns>0){tableNumCols=settings.columns}else if(tRows[0]){tableNumCols=tRows[0].cells.length}if(!table.children().length){methods.create()}})},create:function(){var newRow,i,j;table.empty();for(i=0;i<tableNumRows;i++){newRow=$("<tr></tr>",settings.document).appendTo(table);for(j=0;j<tableNumCols;j++){$("<td>"+spacingChar+"</td>",settings.document).appendTo(newRow)}}},addRow:function(position){var newRow=$("<tr></tr>",settings.document),j;if(position!==undefined){newRow.insertAfter(methods.getTableRows().eq(position))}else{newRow.appendTo(table)}for(j=0;j<methods.getColumnsNum();j++){$("<td>"+spacingChar+"</td>",settings.document).appendTo(newRow)}return newRow},removeRow:function(position){var rows=methods.getTableRows(),removedRow;if(position!==undefined){removedRow=rows.eq(position).remove()}else{removedRow=rows.last().remove()}return removedRow},addColumn:function(position){var columnCellsArr=[];methods.getTableRows().each(function(idx,el){var row=$(el),columns=row.children("td"),newColumn=$("<td>"+spacingChar+"</td>",settings.document);if(position!==undefined&&columns.length){columnCellsArr.push(newColumn.insertAfter(columns.eq(position))[0]);return true}columnCellsArr.push(newColumn.appendTo(row)[0])});return $([]).pushStack(columnCellsArr)},removeColumn:function(position){var removedRowsArr=[];methods.getTableRows().each(function(idx,el){var row=$(el);if(position!==undefined){removedRowsArr.push(row.children("td").eq(position).remove());return true}removedRowsArr.push(row.children("td:last").remove())});return $([]).pushStack(removedRowsArr)},getRowsNum:function(){return methods.getTableRows().length},getColumnsNum:function(){return methods.getTableCols().length},getTableRows:function(){return table.children("tbody").children("tr")},getTableCols:function(){return table.children("tbody").children("tr").first().children("td")}};$.fn.tableManipulator=function(method){if(methods[method]){if(table===undefined||this!==table[0]){table=$(this)}return methods[method].apply(this,Array.prototype.slice.call(arguments,1))}if(typeof method==="object"||!method){return methods.init.apply(this,arguments)}$.error("Method "+method+" does not exist on jQuery.tableManipulator")};$.ig.SelectionWrapper=$.ig.SelectionWrapper||Class.extend({_selection:null,_range:null,_window:null,_document:null,_commands:{insertunorderedlist:{name:"_insertList",browsers:null,args:["insertunorderedlist"]},insertorderedlist:{name:"_insertList",browsers:null,args:["insertorderedlist"]}},_css:{larger:"ui-ightmleditor-larger",smaller:"ui-ightmleditor-smaller"},NODE:new $.ig.XmlNodeType,init:function(window,callback){var self=this;this._window=window;this._document=this._window.document;this._selection=this._window.getSelection();self._range=self._getSelection().rangeCount===0?self._document.createRange():self._selection.getRangeAt(0);self._selectClosestTextNode();if($.isFunction(callback)){callback.call(self)}},_getSelection:function(){return this._selection},_getRange:function(){return this._range},_isCommandSupportedByBrowser:function(command){var supportedBrowsers,i;if(command===null||!this._commands.hasOwnProperty(command.toLowerCase())){return}if(this._commands[command].browsers===null){return}supportedBrowsers=this._commands[command].browsers;for(i=0;i<supportedBrowsers.length;i++){if($.browser&&$.browser.hasOwnProperty(supportedBrowsers[i])){return true}if(!$.browser){if($.ig.util.isIE||$.ig.util.isSafari||$.ig.util.isChrome){return true}}}},_findTextNodes:function(node,allTextNodes){var self=this,$nodeContents=$(node).contents();if($nodeContents.length>0){$nodeContents.each(function(){if(this.nodeType===3){allTextNodes.push(this)}else{self._findTextNodes(this,allTextNodes)}})}},_findAllTextNodes:function(node){var allTextNodes=[];this._findTextNodes(node,allTextNodes);return allTextNodes},_selectClosestTextNode:function(){var children,closestToCaretNode,allTextNodes,textNodeToFocus,range=this._range;if(($.ig.util.isIE||$.ig.util.isFF)&&range.collapsed&&range.startOffset>0&&range.startContainer.nodeType===this.NODE._Element){children=range.startContainer.childNodes;if(children.length>0){closestToCaretNode=children[range.startOffset-1];if(closestToCaretNode.nodeType===3){textNodeToFocus=closestToCaretNode}else{allTextNodes=this._findAllTextNodes($(closestToCaretNode));textNodeToFocus=allTextNodes[allTextNodes.length-1]}if(textNodeToFocus&&!$(textNodeToFocus).parent().is("a")){range.setStart(textNodeToFocus,textNodeToFocus.length);range.collapse(true);this._updateSelection(range)}}}},getSelectedItem:function(){var range=this._getRange(),rangeParent=$(range.commonAncestorContainer);if(range.collapsed&&range.endContainer.nodeType===this.NODE._Text){if(rangeParent.parent().is("img")||rangeParent.parent().is("td")){return rangeParent.parent()}return $(range.startContainer)}if(range.collapsed){return $(range.commonAncestorContainer)}if(range.collapsed&&range.endContainer.nodeType===this.NODE._Element){return $(range.commonAncestorContainer.childNodes[range.endOffset-range.startOffset])}return $(range.commonAncestorContainer)},getSelectionAsText:function(){if(this._getRange().text!==undefined){return this._getRange().text}return this._getRange().toString()},select:function(element){var selectedItem=element||this.getSelectedItem();this._range.selectNodeContents(selectedItem[0]);this._selection.removeAllRanges();this._selection.addRange(this._range)},insertElement:function(element){this._getRange().insertNode(element.get(0))},execCommand:function(name,args){var startEl,endEl,p,range=this._getRange(),customCommand=this._commands[name]?this[this._commands[name].name]:null,customCommandArgs=this._commands[name]?this._commands[name].args:null,browser=this._commands[name]?this._commands[name].browsers:null,isCommandSupported=this._isCommandSupportedByBrowser(name);if(this._selection.isCollapsed&&range.collapsed){if($(range.startContainer).is("body")){startEl=$(range.startContainer).find(":first");if(!startEl.length){startEl=$(range.startContainer)}range.selectNodeContents(startEl[0])}else if(range.startContainer.nodeType===this.NODE._Document){startEl=$(range.startContainer.body).find(":first");if(!startEl.length){startEl=$(range.startContainer.body)}range.selectNodeContents(startEl[0])}else if(range.startContainer.nodeType===this.NODE._Text){this._document.execCommand(name,false,args);return}else{startEl=$(range.startContainer)}if(startEl&&startEl.is("br")&&endEl&&endEl.is("br")){p=$("<p><br /></p>",this._document);startEl.replaceWith(p);range.selectNodeContents(p[0]);this._updateSelection(range)}}if($.ig.util.isIE&&$.ig.util.browserVersion>=9||$.ig.util.isOpera){if(this._selection.focusNode.nodeType!==3){this._updateSelection(range)}}if($.isFunction(customCommand)&&browser===null){customCommand.call(this,name,args)}else if($.isFunction(customCommand)&&isCommandSupported){customCommand.apply(this,customCommandArgs)}else{this._document.execCommand(name,false,args)}},_insertList:function(listType,args){var self=this,textNodes;this._document.execCommand(listType,false,args);if(!this._document.queryCommandState(listType)){if(this._selection.anchorNode&&this._selection.anchorNode.nodeType===this.NODE._Text&&$(this._selection.focusNode).is("body")){textNodes=$(this._selection.focusNode).contents().filter(function(){if($(this).is("br")){$(this).remove();return false}return this.nodeType===self.NODE._Text})}}},_getTextNodesOnlyCallback:function(){return this.nodeType===this.NODE._Text},_wrapPartialString:function(string,start,end,wrapElName){var stack=[];stack.push(this._document.createTextNode(string.slice(0,start)));stack.push(wrapElName.text(string.substring(start,end))[0]);stack.push(this._document.createTextNode(string.slice(end)));return $(stack)},_updateSelection:function(range){this._selection.removeAllRanges();this._selection.addRange(range)},replaceNode:function(newNode){var range=this._getRange(),selItem=this.getSelectedItem();if(selItem.is(newNode)){return}if(range.startOffset!==range.endOffset){range.deleteContents()}if(range.insertNode!==undefined&&!selItem.parent().is("a")){range.insertNode(newNode[0])}else if(range.pasteHTML!==undefined){range.pasteHTML(newNode[0].outerHTML)}},insertTable:function(table){var $body,$firstP,selItem=this.getSelectedItem(),br=$("<br>",this._document);if(selItem[0].nodeType===this.NODE._Document){$body=selItem.find("body");$firstP=$body.children("p").first();if($firstP.length>0){this._range.selectNodeContents($firstP[0])}else{this._range.selectNodeContents($body[0])}this._range.insertNode(table[0])}else if(selItem.is("td")){table.appendTo(selItem)}else if(selItem.is("table")){selItem.replaceWith(table)}else if(selItem.is("br")){selItem.replaceWith(table)}else{this._range.insertNode(table[0])}if(this._range.selectNodeContents!==undefined){this._range.selectNodeContents(br.insertAfter(table)[0])}},focus:function(){var focusTarget;if((this._range.startContainer.nodeType===this.NODE._Document||$(this._range.startContainer).is("body"))&&this._range.collapsed){focusTarget=$(this._document.body).find(":not(br):first");if(focusTarget.length>0){this._range.setStart(focusTarget[0],0);this._range.setEnd(focusTarget[0],0);this._document.body.focus()}}else{if($.ig.util.isIE){if(this._selection&&this._selection.focusNode&&this._selection.focusNode.nodeType!==this.NODE._Text){this._updateSelection(this._range)}}else{this._document.body.focus()}}}});$.ig.ToolbarHelper=$.ig.ToolbarHelper||Class.extend({_toolbarsItemsLocation:{textToolbar:{name:"textToolbar",bold:{name:"bold"},italic:{name:"Italic"},underline:{name:"Underline"},strikethrough:{name:"Strikethrough"},fontFamily:{name:"fontFamily"},fontSize:{name:"fontSize"},formatsList:{name:"formatsList"}},formattingToolbar:{name:"formattingToolbar",justifyleft:{name:"justifyleft"},justifycenter:{name:"justifycenter"},justifyright:{name:"justifyright"},justifyfull:{name:"justifyfull"},bullets:{name:"bullets"},indent:{name:"indent"},outdent:{name:"outdent"},textColor:{name:"textColor"},backgroundTextColor:{name:"backgroundTextColor"}},insertObjectToolbar:{name:"insertObjectToolbar",image:{name:"image"},link:{name:"link"},table:{name:"table"},addRow:{name:"addRow"},addColumn:{name:"addColumn"},removeRow:{name:"removeRow"},removeColumn:{name:"removeColumn"}},copyPasteToolbar:{name:"copyPasteToolbar",copy:{name:"copy"},cut:{name:"cut"},paste:{name:"paste"},undo:{name:"undo"},redo:{name:"redo"}}},init:function(window,toolbars){this._toolbars={};this._w=window;this._d=window.document;var self=this;toolbars.each(function(idx,el){var igToolbarName=$(el).igToolbar("option","name");self._toolbars[igToolbarName]=$(el)});this._initAlignButtons(toolbars);this._disableUnsupportedItems();this._disableTableControls(true)},_initAlignButtons:function(toolbars){var alignButtonsToolbar=this._toolbars.formattingToolbar,alignButtons={justifyleft:alignButtonsToolbar.igToolbar("getItem","justifyleft").attr({"data-localeid":"alignTextLeftButtonTitle","data-localeattr":"title"}),justifycenter:alignButtonsToolbar.igToolbar("getItem","justifycenter").attr({"data-localeid":"alignTextCenterButtonTitle","data-localeattr":"title"}),justifyright:alignButtonsToolbar.igToolbar("getItem","justifyright").attr({"data-localeid":"alignTextRightButtonTitle","data-localeattr":"title"}),justifyfull:alignButtonsToolbar.igToolbar("getItem","justifyfull").attr({"data-localeid":"justifyButtonTitle","data-localeattr":"title"})};toolbars.bind("igtoolbartoolbarbuttonclick",function(e,ui){if(alignButtons.hasOwnProperty(ui.name)){$.each(alignButtons,function(buttonName,button){if(buttonName!==ui.name&&button.igToolbarButton("option","isSelected")){button.igToolbarButton("toggle");return}})}})},_disableUnsupportedItems:function(){var copyPasteToolbar=this._toolbars.copyPasteToolbar;if(!$.ig.util.isIE){copyPasteToolbar.igToolbar("disableItem","cut",true);copyPasteToolbar.igToolbar("disableItem","copy",true);copyPasteToolbar.igToolbar("disableItem","paste",true)}},_disableTableControls:function(toDisable){var insertObjectToolbar=this._toolbars.insertObjectToolbar;if(!toDisable&&this._isTableControlsDisabled){insertObjectToolbar.igToolbar("disableItem","addColumn",false);insertObjectToolbar.igToolbar("disableItem","removeColumn",false);insertObjectToolbar.igToolbar("disableItem","addRow",false);insertObjectToolbar.igToolbar("disableItem","removeRow",false);this._isTableControlsDisabled=false}else if(toDisable&&!this._isTableControlsDisabled){insertObjectToolbar.igToolbar("disableItem","addColumn",true);insertObjectToolbar.igToolbar("disableItem","removeColumn",true);insertObjectToolbar.igToolbar("disableItem","addRow",true);insertObjectToolbar.igToolbar("disableItem","removeRow",true);this._isTableControlsDisabled=true}},_callbackMap:{_isBold:"_onBold",_isItalic:"_onItalic",_isUnderlined:"_onUnderlined",_isLineThrough:"_onLineThrough",_isJustifyCenter:"_onAlign",_isJustifyFull:"_onAlign",_isJustifyLeft:"_onAlign",_isJustifyRight:"_onAlign",_isOrderedList:"_onList",_isUnorderedList:"_onList",_hasFontName:"_onFontName",_hasFontSize:"_onFontSize",_isTable:"_onTable"},analyse:function(el){var self=this,justify;this._resetToolbars();if(el[0].nodeType===9){this._computedStyles=this._w.getComputedStyle&&this._w.getComputedStyle(this._d.body)||this._d.body.currentStyle}else{this._computedStyles=this._w.getComputedStyle&&this._w.getComputedStyle(el[0])||el[0].currentStyle}if(el.is(":header")){this._onHeader(el)}$.each(this._callbackMap,function(isTrueFunc,callback){var isTrueRes=self[isTrueFunc](el);if($.isFunction(self[isTrueFunc])&&isTrueRes&&$.isFunction(self[callback])){self[callback](el,isTrueRes);if(callback==="_onAlign"){justify=true}}});if(!justify){this._onAlign(el,"justifyleft")}if(!el.is("table")&&!el.is("td")){this._disableTableControls(true)}},_isBold:function(){return this._d.queryCommandState("bold")},_isItalic:function(){return this._d.queryCommandState("italic")},_isUnderlined:function(){return this._d.queryCommandState("underline")},_isLineThrough:function(){return this._d.queryCommandState("strikethrough")},_isJustifyCenter:function(){if(this._d.queryCommandState("justifycenter")){return"justifycenter"}},_isJustifyFull:function(){if(this._d.queryCommandState("justifyfull")){return"justifyfull"}},_isJustifyLeft:function(){if(this._d.queryCommandState("justifyleft")){return"justifyleft"}},_isJustifyRight:function(){if(this._d.queryCommandState("justifyright")){return"justifyright"}},_isOrderedList:function(){if(this._d.queryCommandState("insertorderedlist")){return"InsertOrderedList"}},_isUnorderedList:function(){if(this._d.queryCommandState("insertunorderedlist")){return"InsertUnorderedList"}},_isTable:function(el){if(el.is("table")||el.is("td")){return true}},_hasFontName:function(){var fontName=this._getFontFamily();if(fontName==="serif"){fontName="Times New Roman"}return fontName},_getFontFamily:function(){var fontName=this._d.queryCommandValue("FontName");if(fontName===""){fontName=this._computedStyles.fontFamily}return fontName},_hasFontSize:function(){return this._computedStyles.fontSize},_onBold:function(){this._toolbars.textToolbar.igToolbar("getItem","Bold").igToolbarButton("toggle")},_onItalic:function(){this._toolbars.textToolbar.igToolbar("getItem","Italic").igToolbarButton("toggle")},_onUnderlined:function(){this._toolbars.textToolbar.igToolbar("getItem","Underline").igToolbarButton("toggle")},_onLineThrough:function(){this._toolbars.textToolbar.igToolbar("getItem","Strikethrough").igToolbarButton("toggle")},_onAlign:function(el,dir){this._toolbars.formattingToolbar.igToolbar("getItem",dir).igToolbarButton("toggle")},_onList:function(el,listType){this._toolbars.formattingToolbar.igToolbar("getItem",listType).igToolbarButton("toggle");
},_onFontName:function(el,fontName){var combo=this._toolbars.textToolbar.igToolbar("getItem","fontFamily");fontName=fontName.replace(/'|"/g,"");this._setComboValue(combo,combo.igCombo("option","dataSource").data(),fontName)},_onFontSize:function(){var pxTbl={11:1,13:2,16:3,19:4,24:5,32:6},fontSizeUnits=this._d.queryCommandValue("fontsize")||pxTbl[Math.round(parseFloat(this._computedStyles.fontSize))],fontSizeUnitsStr=fontSizeUnits?fontSizeUnits.toString():"",combo=this._toolbars.textToolbar.igToolbar("getItem","fontSize");this._setComboValue(combo,$.ig.util.getLocaleValue("HtmlEditor","fontSizes"),fontSizeUnitsStr)},_onHeader:function(element){var combo=this._toolbars.textToolbar.igToolbar("getItem","formatsList");this._setComboValue(combo,$.ig.util.getLocaleValue("HtmlEditor","formatsList"),element[0].nodeName.toLowerCase())},_onTable:function(){this._disableTableControls(false)},_setComboValue:function(combo,values,newValue,valueKey){var i,dsValueKey=valueKey||valueKey===undefined?"text":valueKey,currentValue=values[combo.igCombo("index")][dsValueKey],dataSourceValue;if(newValue===currentValue){return}for(i=0;i<values.length;i++){dataSourceValue=values[i][dsValueKey];if(newValue===dataSourceValue){combo.igCombo("index",i);break}}},_resetToolbars:function(){$.each(this._toolbars,function(idx,el){$(el).igToolbar("deactivateAll")})}});$.extend($.ui.igHtmlEditor,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI jQuery HTML5 Video Player 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *  jquery.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.util.js
 *  infragistics.util.jquery.js
 *  infragistics.ui.widget.js
 *  infragistics.ui.shared.js
 */
(function($){$.widget("ui.igVideoPlayer",$.ui.igWidget,{_const:{VOLUME_MAX:1,VOLUME_MIN:0,VIDEO_STATE_TIMEOUT:200,SCROLL_TIMEOUT:100,COMMERCIAL_SEEK_DELTA:2,SLIDE_SEEK_TIMEOUT:500,HREF:"#"},_id:function(id){return this.element[0].id+id},options:{sources:[],width:null,height:null,posterUrl:"",preload:false,autoplay:false,autohide:true,volumeAutohideDelay:1e3,centerButtonHideDelay:1200,loop:false,browserControls:false,fullscreen:false,volume:.5,muted:false,title:"",showSeekTime:true,progressLabelFormat:"${currentTime} / ${duration}",bookmarks:[{time:0,title:"",disabled:false}],relatedVideos:[{imageUrl:"",title:"",width:null,height:null,link:"",sources:[],css:null}],banners:[{imageUrl:"",times:[],closeBanner:true,animate:true,visible:true,duration:1e3,autohide:false,hidedelay:1e4,link:null,width:null,height:null,css:null}],commercials:{linkedCommercials:[{sources:[],startTime:10,link:"",title:""}],embeddedCommercials:[{startTime:20,endTime:30,link:"",title:""}],alwaysPlayCommercials:false,showBookmarks:true,adMessage:{animate:true,autoHide:true,hideDelay:2e4,animationDuration:1e3}},locale:{liveStream:undefined,live:undefined,paused:undefined,playing:undefined,play:undefined,volume:undefined,progressLabelLongFormat:undefined,progressLabelShortFormat:undefined,enterFullscreen:undefined,exitFullscreen:undefined,skipTo:undefined,buffering:undefined,adMessage:undefined,adMessageLong:undefined,adMessageNoDuration:undefined,adNewWindowTip:undefined,relatedVideos:undefined,replayButton:undefined,replayTooltip:undefined}},events:{ended:"ended",playing:"playing",paused:"paused",buffering:"buffering",progress:"progress",waiting:"waiting",bookmarkHit:"bookmarkHit",bookmarkClick:"bookmarkClick",enterFullScreen:"enterFullScreen",exitFullScreen:"exitFullScreen",relatedVideoClick:"relatedVideoClick",bannerVisible:"bannerVisible",bannerHidden:"bannerHidden",bannerClick:"bannerClick",browserNotSupported:"browserNotSupported"},css:{baseClasses:"ui-widget ui-igplayer",controlsClass:"ui-widget-header ui-igplayer-controls "+"ui-igplayer-grid ui-igplayer-autohide ui-corner-all",controlsHideClass:"ui-igplayer-controls-hide",videoClass:"ui-igplayer-video",unsupportedBrowserClass:"ui-html5-non-html5-supported-message ui-helper-clearfix",activeVideoClass:"ui-igplayer-active-video",playButtonClass:"ui-igplayer-playbutton",progressBarClass:"ui-igplayer-progressbar ui-corner-all",fullScreenClass:"ui-igplayer-fullscreen-button",fullScreenIconClass:"ui-icon ui-igbutton-icon ui-icon-arrow-4-diag",volumeControlClass:"ui-igplayer-volumecontrol",volumeSliderClass:"ui-igplayer-volumeslider",progressLabelClass:"ui-igplayer-progresslabel",bookmarkContainerClass:"ui-widget ui-igplayer-bookmark-container",bookmarkContainerHeaderClass:"ui-widget-header ui-igplayer-bookmark-header",bookmarkListClass:"ui-widget-content ui-igplayer-bookmark-list",bookmarkItemDisabledClass:"ui-igplayer-bookmark-item-disabled",bookmarkItemTimeClass:"ui-igplayer-bookmark-item-time",bookmarkItemTitleClass:"ui-igplayer-bookmark-item-title",bookmarkActiveItemClass:"ui-igplayer-bookmark-active-item",relatedVideosContainerClass:"ui-igplayer-related-video-container",relatedVideosOuterContainerClass:"ui-igplayer-related-video-outer-container",relatedVideoClass:"ui-igplayer-related-video",relatedVideoFirstClass:"ui-igplayer-related-video-first",relatedVideoLastClass:"ui-igplayer-related-video-last",relatedVideoHoverClass:"ui-igplayer-related-video-hover",relatedVideoScrollLeftClass:"ui-igplayer-related-scroller-left",relatedVideoScrollLeftIconClass:"ui-icon-triangle-1-w",relatedVideoScrollRightClass:"ui-igplayer-related-scroller-right",relatedVideoScrollRightIconClass:"ui-icon-triangle-1-e",relatedVideoScrollListClass:"ui-igplayer-related-list",relatedVideosHeaderClass:"ui-igplayer-related-video-header",relatedVideoBarClass:"ui-igplayer-related-video-bar",relatedVideoReplayClass:"ui-igplayer-related-video-replay",relatedVideoReplayIconClass:"ui-icon-arrowrefresh-1-s",bannerContainerClass:"ui-igplayer-banner-container",bannerClass:"ui-igplayer-banner ui-corner-all",bannerCloseClass:"ui-igplayer-banner-close",bannerCloseIconClass:"ui-icon-close",adMsgContainerClass:"ui-igplayer-ad-msg-container",adMsgClass:"ui-igplayer-ad-msg",adMsgCloseClass:"ui-igplayer-ad-msg-close",adMsgCloseIconClass:"ui-icon-close",linkedBookmarkClass:"ui-igplayer-linked-bookmark",adBookmarkClass:"ui-igplayer-ad-bookmark",unsupportedVideoSourceClass:"ui-igplayer-not-supported-video-source",unsupportedVideoSourceIconClass:"ui-igplayer-not-supported-video-source-icon",centerPlayButtonClass:"ui-igplayer-centerplaybutton-play",centerPauseButtonClass:"ui-igplayer-centerplaybutton-pause",centerPlayButtonIconClass:"ui-igplayer-centerplaybutton-icon",waitingIndicatorClass:"ui-igplayer-waiting",waitingIndicatorIconClass:"ui-igplayer-waiting-icon",seekTooltipClass:"ui-igplayer-seektooltip"},widget:function(){return this.element},_createWidget:function(){var o=this.options;o.bookmarks=[];o.relatedVideos=[];o.banners=[];o.commercials.linkedCommercials=[];o.commercials.embeddedCommercials=[];this._superApply(arguments)},_create:function(){if($.ig.util.isTouchDevice()){this.options.browserControls=true}if(this.element.is("div")){this.container=this.element}else if(this.element.is("video")){this.container=$("<div></div>").attr("id",this._id("_container")).insertBefore(this.element);this.element.appendTo(this.container)}else{throw new Error(this._getLocaleValue("nonDivException"))}this._oldWidth=this.element.css("width");this._oldHeight=this.element.css("height");this._renderControl()},_renderControl:function(){var o=this.options,video,css=this.css;this._prevReadyState=0;this._bookmarksRendered=false;if(this.supportsVideo()){this._renderBanners()}this.currentVideo=video=this._createMainVideoElement().addClass(css.videoClass);if(o.disabled){this.container.addClass("ui-state-disabled")}if(o.width){video.css("width",o.width);this.container.css("width",o.width)}if(o.height){video.css("height",o.height);this.container.css("height",o.height)}if(this.supportsVideo()){this._baseZIndex=parseInt(this.container.css("z-index"),10)||0;this._attachEvents(video);this._renderSources(o.sources,video);this._analyzeSource(video);setTimeout($.proxy(this._onVideoStateChange,this),this._const.VIDEO_STATE_TIMEOUT);this._createBigPlayButton();this._createWaitingIndicator();this._renderEmbeddedCommercials();this._renderCommercials();video[0].muted=o.muted;if(o.muted&&$.ig.util.isWebKit){video[0].volume=0}else if(o.volume>=this._const.VOLUME_MIN&&o.volume<=this._const.VOLUME_MAX){video[0].volume=o.volume}if(!o.browserControls){this._renderControls()}this._lastPausedState=video[0].paused;if(o.fullscreen){this._setOption("fullscreen",true,true)}this._renderRelatedVideos()}else{this.currentVideo.hide();$.ig.util._renderUnsupportedBrowser(this,this._getLocaleDictionary())}$("#"+this._id("_detectError")).appendTo(this.container).bind({click:function(event){event.preventDefault()}});this.container.addClass(css.baseClasses)},_createVideoElement:function(id){var video=$("<video></video>").attr("id",id);return video},_saveExistingVideoProperties:function(video){this._oldAutoPlay=this._getVideoProperty(video,"autoplay");this._oldPreload=this._getVideoProperty(video,"preload");this._oldLoop=this._getVideoProperty(video,"loop");this._oldPoster=this._getVideoProperty(video,"poster");this._oldControls=this._getVideoProperty(video,"controls");this._oldSrc=this._getVideoProperty(video,"src");this._oldMuted=video[0].muted;this._oldVolume=video[0].volume;this._removeVideoProperty(video,"autoplay");this._removeVideoProperty(video,"preload");this._removeVideoProperty(video,"loop");if(this._oldPoster!==""){this._removeVideoProperty(video,"poster")}this._removeVideoProperty(video,"controls");this._removeVideoProperty(video,"src")},_restoreExistingVideoProperties:function(video){this._setVideoProperty(video,"autoplay",this._oldAutoPlay);this._setVideoProperty(video,"preload",this._oldPreload);this._setVideoProperty(video,"loop",this._oldLoop);this._setVideoProperty(video,"poster",this._oldPoster);this._setVideoProperty(video,"controls",this._oldControls);this._setVideoProperty(video,"src",this._oldSrc);video[0].muted=this._oldMuted;video[0].volume=this._oldVolume},_createMainVideoElement:function(){var o=this.options,isVideoExisting=this.element.is("video"),video=isVideoExisting?this.element:this._createVideoElement(this._id("_video"));if(isVideoExisting){this._saveExistingVideoProperties(video)}if(o.autoplay){this._setVideoProperty(video,"autoplay",true)}this._setVideoProperty(video,"preload","metadata");if(o.preload){this._setVideoProperty(video,"preload","auto")}if(o.browserControls){this._setVideoProperty(video,"controls",true)}if(o.loop){this._setVideoProperty(video,"loop",true)}if(o.posterUrl.length>0){this._setVideoProperty(video,"poster",o.posterUrl)}return video.appendTo(this.container)},_setVideoProperty:function(video,prop,value){if(video.prop){video.prop(prop,value)}else{video.attr(prop,value)}},_getVideoProperty:function(video,prop){if(video.prop){return video.prop(prop)}else{return video.attr(prop)}},_removeVideoProperty:function(video,prop){if(video.prop){return video.removeProp(prop)}else{return video.removeAttr(prop)}},_renderUnsupportedBrowser:function(){if(this._trigger(this.events.browserNotSupported)){var container=$("<div data-test></div>").attr({"data-not-supported-browser":true}).addClass(this.css.unsupportedBrowserClass).appendTo(this.container),ul,browserUnsupported;if($.ig.util.isIE){browserUnsupported="Internet Explorer "+$.ig.util.browserVersion}else if($.ig.util.isOpera){browserUnsupported="Opera "+$.ig.util.browserVersion}else if($.ig.util.isWebKit){browserUnsupported="Webkit "+$.ig.util.browserVersion}else if($.ig.util.isFF){browserUnsupported="Mozilla Firefox "+$.ig.util.browserVersion}else{browserUnsupported=$.ig.util.browserVersion}$("<div></div>").addClass("ui-igvideoplayer-current-browser-label").html(this._getLocaleValue("currentBrowser").replace("{0}",browserUnsupported)).appendTo(container);$("<div></div>").addClass("ui-igvideoplayer-non-html5-text").html(this._getLocaleValue("unsupportedBrowser")).appendTo(container);ul=$("<ul></ul>").addClass("ui-igplayer-browsers-list").appendTo(container);$("<a></a>").attr({href:this._getLocaleValue("chromeDownload"),target:"_blank"}).addClass("ui-igplayer-chrome-icon").html(this._getLocaleValue("chrome8")).appendTo($("<li></li>").addClass("ui-corner-all").appendTo(ul));$("<a></a>").attr("href",this._getLocaleValue("firefoxDownload")).attr("target","_blank").addClass("ui-igplayer-firefox-icon").html(this._getLocaleValue("firefox36")).appendTo($("<li></li>").addClass("ui-corner-all").appendTo(ul));$("<a></a>").attr("href",this._getLocaleValue("operaDownload")).attr("target","_blank").addClass("ui-igplayer-Opera-icon").html(this._getLocaleValue("opera11")).appendTo($("<li></li>").addClass("ui-corner-all").appendTo(ul));$("<a></a>").attr("href",this._getLocaleValue("safariDownload")).attr("target","_blank").addClass("ui-igplayer-safari-icon").html(this._getLocaleValue("safari5")).appendTo($("<li></li>").addClass("ui-corner-all").appendTo(ul));$("<a></a>").attr("href",this._getLocaleValue("ieDownload")).attr("target","_blank").addClass("ui-igplayer-ie-icon").html(this._getLocaleValue("ie9")).appendTo($("<li></li>").addClass("ui-corner-all").appendTo(ul));this.container.addClass("ui-igvideoplayer-non-html5")}},_renderRelatedVideoBar:function(container){var css=this.css,control=this,relatedVideoBar=$("<div></div>").attr("id",this._id("_rv_bar")).addClass(css.relatedVideoBarClass).appendTo(container);$("<a></a>").attr("id",this._id("_rv_bar_fs")).appendTo($("<div></div>").css({position:"absolute",top:0,left:0,"text-align":"right",width:"100%",height:"100%"}).appendTo(relatedVideoBar)).igButton({link:{href:this._const.HREF},css:{buttonLabelClass:css.fullScreenIconClass}}).attr({title:this._getLocaleValue("enterFullscreen"),"data-localeid":"enterFullscreen","data-localeattr":"title"}).addClass(css.fullScreenClass).bind({click:function(event){event.preventDefault();control._setOption("fullscreen",!control.options.fullscreen)}});$("<a></a>").attr("id",this._id("_rv_bar_replay")).appendTo(relatedVideoBar).igButton({onlyIcons:false,labelText:this._getLocaleValue("replayButton"),icons:{primary:css.relatedVideoReplayIconClass},link:{href:this._const.HREF}}).attr({title:this._getLocaleValue("replayTooltip"),"data-localeid":"replayButton","data-localeattr":"title"}).bind({click:function(event){event.preventDefault();if(!$(this).igButton("option","disabled")){control.togglePlay()}}}).addClass(css.relatedVideoReplayClass)},_renderScrollButtons:function(container){var css=this.css,ul;$("<a></a>").attr("id",this._id("_rv_left")).appendTo(container).igButton({onlyIcons:true,icons:{primary:css.relatedVideoScrollLeftIconClass},link:{href:this._const.HREF}}).addClass(css.relatedVideoScrollLeftClass).css("position","absolute").hide();ul=$("<ul></ul>").addClass(css.relatedVideoScrollListClass).appendTo(container);$("<a></a>").attr("id",this._id("_rv_right")).appendTo(container).igButton({onlyIcons:true,icons:{primary:css.relatedVideoScrollRightIconClass},link:{href:this._const.HREF}}).addClass(css.relatedVideoScrollRightClass).css("position","absolute");return ul},_renderRelatedVideos:function(){var o=this.options,related=o.relatedVideos||[],len=related.length,i=0,css=this.css,container,scrollContainer,ulContainer,ulContainerWidth=10,currentVideo,control=this;if(len>0){container=$("<div></div>").attr("id",this._id("_rvcc")).addClass(css.relatedVideosOuterContainerClass).appendTo(this.container).hide();$("<div><div>").html(this._getLocaleValue("relatedVideos")).attr({"data-localeid":"relatedVideos"}).addClass(css.relatedVideosHeaderClass).appendTo(container);scrollContainer=$("<div></div>").attr("id",this._id("_rvc")).appendTo(container).addClass(css.relatedVideosContainerClass);ulContainer=this._renderScrollButtons(scrollContainer);this._renderRelatedVideoBar(container);this._rvUlWidth=0;this._rvImagesToLoad=0;this._rvImagesLoaded=0;for(i;i<len;i++){if(related[i].imageUrl&&related[i].imageUrl!==""){currentVideo=this._renderRelatedVideo(related[i],ulContainer,i===0,i===len-1);this._rvImagesToLoad++;ulContainerWidth+=currentVideo.outerWidth(true)}}if(ulContainerWidth>container.width()&&ulContainerWidth>ulContainer.width()){ulContainer.width(ulContainerWidth)}this.relatedScrollers=$("a",scrollContainer).bind({mouseover:function(){if(!control._isScrolling){control._isScrolling=true;control._leftDirection=$(this).hasClass(control.css.relatedVideoScrollLeftClass);control._rvDoScroll()}},mouseout:function(){control._rvStopScroll()}});this.relatedVideoElements=$("."+this.css.relatedVideoClass.split(" ")[0],ulContainer).each(function(i){$(this).data("related-index",i)}).bind({mouseover:function(){$(this).addClass(control.css.relatedVideoHoverClass).children().filter("div").show()},mouseout:function(){$(this).removeClass(control.css.relatedVideoHoverClass).children().filter("div").hide()},click:function(event){var relatedVideo=control.options.relatedVideos[$(this).data("related-index")];if(control._relatedVideoClick(relatedVideo,$(this),event)){if(relatedVideo.link&&relatedVideo.link.length>0){window.open(relatedVideo.link,"_blank")}else if(relatedVideo.sources){control._renderSources(relatedVideo.sources,control.currentVideo);control._analyzeSource(control.currentVideo,true);control.play()}}}})}},_rvScrollOnce:function(){var container=$("#"+this._id("_rvc")),ul=$("ul",container),currentLeftStr=ul[0].style.left,currentLeft=parseInt(currentLeftStr===""||currentLeftStr==="auto"?"0px":currentLeftStr,10),pixelsToScroll=10,newLeft=this._leftDirection?currentLeft+pixelsToScroll:currentLeft-pixelsToScroll,left=$("#"+this._id("_rv_left")),right=$("#"+this._id("_rv_right")),ulWidth=ul.width(),scrollContainerWidth=container.width(),continueScrolling=true;ul[0].style.left=newLeft+"px";if(currentLeft===0&&newLeft<0){left.show()}if(newLeft>=0&&currentLeft!==0&&left[0].style.display!=="none"){left.hide();continueScrolling=false}if(scrollContainerWidth-newLeft>=ulWidth&&right[0].style.display!=="none"){continueScrolling=false;right.hide()}else if(right[0].style.display==="none"){right.show()}return continueScrolling},_rvDoScroll:function(){var continueScrolling=this._isScrolling&&this._rvScrollOnce();if(continueScrolling){this._scrollingTimoutId=setTimeout($.proxy(this._rvDoScroll,this),this._const.SCROLL_TIMEOUT)}else{this._rvStopScroll()}},_rvStopScroll:function(){if(this._isScrolling){clearTimeout(this._scrollingTimoutId);this._isScrolling=false}},_relatedVideoClick:function(relatedVideo,relatedElement,event){var args={relatedVideo:relatedVideo,relatedVideoElement:relatedElement};return this._trigger(this.events.relatedVideoClick,event,args)},_renderRelatedVideo:function(related,container,isFirst,isLast){var rv=$("<li></li>").appendTo(container).addClass(this.css.relatedVideoClass),relatedImg=$("<img/>").appendTo(rv),self=this;if(isFirst||isLast){rv.addClass(isFirst?this.css.relatedVideoFirstClass:this.css.relatedVideoLastClass)}if(related.imageUrl&&related.imageUrl!==""){relatedImg.attr("src",related.imageUrl)}if(related.title&&related.title!==""){relatedImg.attr("title",related.title)}if(related.css&&related.css!==""){relatedImg.addClass(related.css)}if(related.width&&related.width!==""){relatedImg.css("width",related.width)}if(related.height&&related.height!==""){relatedImg.css("height",related.height)}$("<div></div>").appendTo(relatedImg.parent()).css("position","absolute").hide();relatedImg.bind({load:function(){self._imageLoaded(this)},error:function(){self._rvImagesLoaded++;self._onImagesLoaded()},readystatechange:function(){self._imageLoaded(this)}});return rv},_imageLoaded:function(img){var rs=img.readyState,width=parseInt(img.style.width,10),height=parseInt(img.style.height,10),spanSize;if(!rs||new RegExp("loaded|complete").test(rs)){this._rvUlWidth+=width+parseInt($(img).parent().css("marginRight"),10)+parseInt($(img).parent().css("marginLeft"),10);this._rvImagesLoaded++;if(width>24&&height>24){if(width>50&&height>50){spanSize=48}else if(width>34&&height>34){spanSize=32}else{spanSize=24}$(img).parent().children().filter("div").addClass("ui-igplayer-related-video-hover-x"+spanSize).css({width:spanSize,height:spanSize,top:height/2-spanSize/2,left:width/2-spanSize/2})}}this._onImagesLoaded()},_onImagesLoaded:function(){if(this._rvImagesLoaded===this._rvImagesToLoad){var container=$("#"+this._id("_rvc"));$("ul",container).css("width",this._rvUlWidth+4);container.parent().show();if(this._rvUlWidth<container.width()){this.relatedScrollers.hide()}else{$(this.relatedScrollers[1]).show()}container.parent().hide();delete this._rvUlWidth;delete this._rvImagesLoaded;delete this._rvImagesToLoad}},_renderEmbeddedCommercials:function(){var ec=this.options.commercials.embeddedCommercials||[],i=0,len=ec.length,filtered=[],val;for(i;i<len;i++){val=ec[i];if(val&&val.startTime&&val.endTime&&val.startTime<val.endTime){filtered.push(val)}}ec=filtered;len=ec.length;if(ec&&len>0){this._embeddedCommercialsShow=$.extend(true,[],ec);this._embeddedCommercialIndex=0;this._renderAdMessage()}},_renderCommercials:function(){var o=this.options,com=o.commercials.linkedCommercials||[],control=this,video;if(com.length>0){video=this._createVideoElement(this._id("_com_video")).attr("preload","auto").appendTo(this.container).addClass(this.css.videoClass).bind({ended:function(){var slider=$("#"+control._id("_ctrls_s")),bookmarks=slider.data("igSlider").bookmarks;control._hideWaitingIndicator();control._commercialIndex++;control._commercialsShow.shift();control._commercialPlaying=false;control.currentVideo=control._getMainVideo();control.currentVideo.show();$(this).hide();slider.igSlider("option","disabled",false);if(bookmarks){bookmarks.show()}control.currentVideo[0].muted=this.muted;control.currentVideo[0].play();control.currentVideo.addClass(control.css.videoClass);control.controls[control._activeControlsIndex].css("z-index","");$("#"+control._id("_seek_tooltip")).css("z-index","");$("#"+control._id("_play")).css("z-index","")},waiting:function(event){control._onVideoWaiting(event);control._waiting(this.currentSrc,this.currentTime,this.duration,event)},timeupdate:function(event){control._changeCurrentTime(event)},playing:function(event){control._hideWaitingIndicator();$("span",$("#"+control._id("_ctrls_play"))).addClass("ui-icon-pause").removeClass("ui-icon-play");control._playing(this.currentSrc,this.duration,event)},pause:function(event){$("span",$("#"+control._id("_ctrls_play"))).addClass("ui-icon-play").removeClass("ui-icon-pause");control._paused(this.currentSrc,this.duration,event)},click:function(event){event.preventDefault();var link=control.options.commercials.linkedCommercials[control._commercialIndex].link;if(link&&link.length>0){window.open(link,"_blank")}}}).hide();if(video.prop&&video.prop("preload")!=="auto"){video.prop("preload","auto")}this._buildCommercialsShow();this._renderAdMessage()}},_renderAdClose:function(container){var control=this;$("<a></a>").attr("id",this._id("_ad_msg_close")).appendTo(container).igButton({onlyIcons:true,icons:{primary:this.css.adMsgCloseIconClass},link:{href:this._const.HREF}}).addClass(this.css.adMsgCloseClass).bind("click",function(event){event.preventDefault();event.stopPropagation();control.hideAdMessage()})},_renderAdMessage:function(){if($("#"+this._id("_ad_msg_c")).length===0){var css=this.css,container;container=$("<div></div>").attr("id",this._id("_ad_msg_c")).addClass(css.adMsgContainerClass).prependTo(this.container).bind({mouseover:function(){$(this).addClass("ui-state-hover")},mouseout:function(){$(this).removeClass("ui-state-hover")}}).hide();$("<span></span>").attr({id:this._id("_ad_msg"),"data-localeid":"adMessage"}).appendTo(container).addClass(css.adMsgClass).html(this._getLocaleValue("adMessage"));this._renderAdClose(container)}},_showAdMessage:function(seconds){var adMsgContainer=$("#"+this._id("_ad_msg_c")),msgOpt=this.options.commercials.adMessage;this._updateAdMessage(seconds,true);adMsgContainer.css("width",this.container.css("width"));if(msgOpt.animate){adMsgContainer.slideToggle(msgOpt.animationDuration)}else{adMsgContainer.show()}if(msgOpt.autoHide){this._adHideTimeout=setTimeout($.proxy(this.hideAdMessage,this),msgOpt.hideDelay)}},_updateAdMessage:function(seconds,force){var msg=$("#"+this._id("_ad_msg"));if(msg.is(":visible")||force){if(isNaN(seconds)){msg.html(this._getLocaleValue("adMessageNoDuration"))}else{seconds=parseInt(seconds,10);if(seconds>60){msg.html(this._getLocaleValue("adMessageLong").replace("$duration$",this._toTimeString(seconds)))}else{msg.html(this._getLocaleValue("adMessage").replace("$duration$",seconds))}}this._isHiddenAdMessage=false}else if(!this._isHiddenAdMessage){this._showAdMessage(seconds)}},hideAdMessage:function(){clearTimeout(this._adHideTimeout);var msg=$("#"+this._id("_ad_msg_c")),msgOpt=this.options.commercials.adMessage;if(msg.is(":visible")){if(msgOpt.animate){msg.slideToggle(msgOpt.animationDuration)}else{msg.hide()}this._isHiddenAdMessage=true}},_buildCommercialsShow:function(){var com=this.options.commercials.linkedCommercials||[],len=com.length,i=0;this._commercialsShow=[];this._commercialIndex=0;for(i;i<len;i++){this._commercialsShow.push(com[i].startTime)}this._commercialsShow=$.extend(true,[],this._commercialsShow)},playCommercial:function(commercial){if(!commercial||!commercial.sources){return}var comVideo=$("#"+this._id("_com_video")),videoOffset=this.currentVideo.igOffset(),slider=$("#"+this._id("_ctrls_s")),bookmarks=slider.data("igSlider").bookmarks,bookmarkTitle=$("#"+this._id("_ctrls_s_tooltip"));this._commercialPlaying=true;$("source",comVideo).remove();this._renderSources(commercial.sources,comVideo);this._analyzeSource(comVideo);this.currentVideo[0].pause();this.currentVideo.removeClass(this.css.videoClass);this.controls[this._activeControlsIndex].css("z-index",this._baseZIndex+5e3);$("#"+this._id("_seek_tooltip")).css("z-index",this._baseZIndex+5e3);$("#"+this._id("_play")).css("z-index",this._baseZIndex+5e3);slider.igSlider("option","disabled",true);if(bookmarks&&bookmarkTitle){bookmarks.hide();bookmarkTitle.hide()}comVideo[0].muted=this.currentVideo[0].muted;comVideo[0].play();if(commercial.link&&commercial.link.length>0){comVideo.attr({title:this._getLocaleValue("adNewWindowTip"),"data-localeid":"adNewWindowTip","data-localeattr":"title"})}else{comVideo.removeAttr("title")}comVideo.css("top",videoOffset.top).css("left",videoOffset.left).css("width",this.currentVideo.css("width")).css("height",this.currentVideo.css("height")).show();this.currentVideo.hide();this.currentVideo=comVideo},_renderBanners:function(){var banners=this.options.banners||[],len=banners.length,i=0,parent=$("<div></div>").appendTo(this.container).addClass(this.css.bannerContainerClass),banner;this._bannerShow=[];for(i;i<len;i++){banner=banners[i];if(banner.imageUrl&&banner.imageUrl.length>0){this._renderBannerContainer(banner,this._id("_banner_grid"+i),parent).data("banner-index",i)}this._bannerShow.push($.extend(true,[],banner.times))}},_buildBannersShow:function(){var banners=this.options.banners||[],len=banners.length,i=0;if(len>0){this._bannerShow=[]}for(i;i<len;i++){this._bannerShow.push($.extend(true,[],banners[i].times))}},_renderBannerClose:function(container,id){var css=this.css,control=this;$("<a></a>").attr("id",id+"_banner_close").appendTo($("<div></div>").css({position:"absolute",top:0,left:0,"text-align":"right",width:"100%",height:"100%"}).appendTo(container)).addClass(css.bannerCloseClass).igButton({onlyIcons:true,icons:{primary:css.bannerCloseIconClass},link:{href:this._const.HREF}}).bind("click",function(event){event.preventDefault();event.stopPropagation();control.hideBanner($(this).parent().parent().data("banner-index"))})},_renderBannerContainer:function(banner,id,parent){var css=this.css,control=this,container=$("<div></div>").attr("id",id).appendTo(parent),img=$("<img></img>").attr("id",id+"_img").attr("src",banner.imageUrl).appendTo(container);this.banner=container.addClass(css.bannerClass);if(!banner.visible){container.hide()}if(banner.closeBanner){this._renderBannerClose(container,id)}if(banner.width){container.css("width",banner.width);img.attr("width",parseInt(banner.width,10))}if(banner.height){container.css("height",banner.height);img.attr("height",parseInt(banner.height,10))}if(banner.css){container.addClass(banner.css)}container.bind("click",function(event){var noCancel=true,args={bannerElement:$(event.currentTarget)};noCancel=control._trigger(control.events.bannerClick,event,args);if(banner.link&&banner.link.length>0&&noCancel){window.open(banner.link,"_blank")}});return container},showBanner:function(index){if(this.options.banners&&index>=0&&index<this.options.banners.length){var banner=this.options.banners[index],id=this._id("_banner_grid"+index),container=$("#"+id);if(banner.animate){container.fadeIn(banner.duration)}else{container.show()}this._bannerVisible(index,container);if(banner.autohide){this._bannerHideTimeout=setTimeout(this._createDelegate(this,this.hideBanner,[index]),banner.hidedelay)}}},_createDelegate:function(instance,method,args){return function(){return method.apply(instance,args)}},hideBanner:function(index){if(this.options.banners&&index>=0&&index<this.options.banners.length){clearTimeout(this._bannerHideTimeout);var banner=this.options.banners[index],container=$("#"+this._id("_banner_grid"+index));if(banner.animate){container.fadeOut(banner.duration)}else{container.hide()}this._bannerHidden(index,container)}},_renderSources:function(sources,video){var control=this;$(sources).each(function(){control._renderSource(this,video)})},_renderSource:function(source,video){var qmIndex=source.indexOf("?"),extStartIndex=source.lastIndexOf(".")+1,extEndIndex=qmIndex>-1?qmIndex:source.length,extension=source.substring(extStartIndex,extEndIndex);$("<source></source>").attr("src",source).attr("type",("video/"+source.substring(source.lastIndexOf(".")+1,source.length)).replace("/ogv","/ogg")).appendTo(video);video.data(extension,source)},_getMainVideo:function(){return this.element.is("video")?this.element:$("#"+this._id("_video"))},_setOption:function(key,value,force){var video=this.currentVideo,titleOption,videoElem=video[0],mainVideo=this._getMainVideo(),videoOffset=video.igOffset(),options=this.options,noCancel=true,fsVideoH=0;if(this.options[key]===value&&!force){return}switch(key){case"disabled":if(value){this.container.addClass("ui-state-disabled")}else{this.container.removeClass("ui-state-disabled")}break;case"sources":$("source",mainVideo).remove();this._renderSources(value,mainVideo);this._analyzeSource(mainVideo);break;case"width":if(value!==options.width){video.css("width",value);this.container.css("width",value);if(!options.browserControls){$("#"+this._id("_ctrls")).parent().css("width",value);$("#"+this._id("_title_ctrls")).parent().css("width",value)}options.width=value}break;case"height":if(value!==options.height){video.css("height",value);this.container.css("height",value);options.height=value}break;case"posterUrl":if(value!==options.posterUrl){this._setVideoProperty(video,"poster",value);options.posterUrl=value}break;case"loop":if(value!==options.loop){videoElem.loop=value;options.loop=value}break;case"browserControls":if($.ig.util.isTouchDevice()){return}if(value!==options.browserControls){if(!value){videoElem.controls=false;this._ensureVolume();this._renderControls();this._detectBuffered()}else{videoElem.controls=true;this._destroyControls()}options.browserControls=value}break;case"autohide":if(!options.browserControls){if(value){this._onControlMouseOut()}else{this._onControlMouseOver()}}options.autohide=value;break;case"fullscreen":if(value!==options.fullscreen||force){if(value){noCancel=this._enterFullScreen(videoElem.currentSrc);if(noCancel){this.container.data("style.position",this.container.css("position"));this.container.data("document.scrollTop",$(document).scrollTop());this.container.data("document.scrollLeft",$(document).scrollLeft());this.container.data("style.left",this.container.css("left"));this.container.data("style.top",this.container.css("top"));this.container.css("z-index",this._baseZIndex+1e4);$(document).scrollTop(0);$(document).scrollLeft(0);this.container.css("position","fixed").css("height","100%").css("width","100%").css("left","0px").css("top","0px");$("#"+this._id("_ctrls")).parent().css("width","100%");if(this._commercialPlaying){video.css("top",0).css("left",0);mainVideo.css("height","100%").css("width","100%")}video.css("height","100%").css("width","100%");if(!options.browserControls){$("span",$("#"+this._id("_ctrls_fs_btn"))).removeClass("ui-icon-arrow-4-diag").addClass("ui-icon-closethick")}if($("#"+this._id("_rv_bar_fs")).is(":visible")){$("span",$("#"+this._id("_rv_bar_fs"))).removeClass("ui-icon-arrow-4-diag").addClass("ui-icon-closethick")}if(options.bookmarks&&options.bookmarks.length>0){$("#"+this._id("_bookmarks")).hide()}}}else{noCancel=this._exitFullScreen(videoElem.currentSrc);if(noCancel){this.container.css("position",this.container.data("style.position")).css("left",this.container.data("style.left")).css("top",this.container.data("style.top"));this.container.css("z-index",this._baseZIndex);$(document).scrollTop(this.container.data("document.scrollTop"));$(document).scrollLeft(this.container.data("document.scrollLeft"));if(options.height){if(options.bookmarks&&options.bookmarks.length>0){fsVideoH=parseInt(options.height,10)-parseInt($("#"+this._id("_bookmarks")).css("height"),10);if(this._commercialPlaying){mainVideo.css("height",fsVideoH)}video.css("height",fsVideoH)}else{if(this._commercialPlaying){mainVideo.css("height",options.height)}video.css("height",options.height)}this.container.css("height",options.height)}else{if(this._commercialPlaying){mainVideo.css("height","")}video.css("height","");this.container.css("height","")}if(options.width){
if(this._commercialPlaying){mainVideo.css("width",options.width)}video.css("width",options.width);$("#"+this._id("_ctrls")).parent().css("width",options.width);this.container.css("width",options.width)}else{if(this._commercialPlaying){mainVideo.css("width","")}video.css("width","");$("#"+this._id("_ctrls")).parent().css("width","");this.container.css("width","")}if(this._commercialPlaying){video.css("top",videoOffset.top).css("left",videoOffset.left)}if(!options.browserControls){$("span",$("#"+this._id("_ctrls_fs_btn"))).removeClass("ui-icon-closethick").addClass("ui-icon-arrow-4-diag")}if($("#"+this._id("_rv_bar_fs")).is(":visible")){$("span",$("#"+this._id("_rv_bar_fs"))).removeClass("ui-icon-closethick").addClass("ui-icon-arrow-4-diag")}if(options.bookmarks&&options.bookmarks.length>0){$("#"+this._id("_bookmarks")).show()}}}if(!noCancel){return}if($("#"+this._id("_waiting")).is(":visible")){this._showWaitingIndicator()}if($("#"+this._id("_play")).is(":visible")){this._showCenterPlayButton()}if($("#"+this._id("_ad_msg_c")).is(":visible")){$("#"+this._id("_ad_msg_c")).css("width",this.container.css("width"))}if($("#"+this._id("_ctrls_vs")).is(":visible")){this._hideVolumeSlider()}if($("#"+this._id("_detectError")).is(":visible")){this._showUnsupportedVideoSourceMsg()}if(value){$("body").addClass("ui-igplayer-full-screen-mode")}else{$("body").removeClass("ui-igplayer-full-screen-mode")}if(!options.browserControls){$("#"+this._id("_ctrls_fs_btn")).attr({title:value?this._getLocaleValue("exitFullscreen"):this._getLocaleValue("enterFullscreen"),"data-localeid":"exitFullscreen","data-localeattr":"title"})}if($("#"+this._id("_rv_bar_fs")).is(":visible")){titleOption=value?"exitFullscreen":"enterFullscreen";$("#"+this._id("_rv_bar_fs")).attr({title:this._getLocaleValue(titleOption),"data-localeid":titleOption,"data-localeattr":"title"})}options.fullscreen=value}break;case"volume":if(value!==options.volume&&value>=this._const.VOLUME_MIN&&value<=this._const.VOLUME_MAX){options.volume=videoElem.volume=value;if(value>0&&videoElem.muted){options.muted=videoElem.muted=false}else if(value===0&&!videoElem.muted){options.muted=videoElem.muted=true}if(!options.browserControls){this._adjustVolumeButton(value);$("#"+this._id("_ctrls_vs")).igSlider("option","value",value*100)}}break;case"muted":if(value!==options.muted){options.muted=videoElem.muted=value;$("#"+this._id("_ctrls_vs")).igSlider("option","value",value?0:(options.volume!==0?options.volume:.3)*100);if(options.volume===0){options.volume=.3}if(!value&&videoElem.volume===0){videoElem.volume=options.volume}if(!options.browserControls){this._adjustVolumeButton($("#"+this._id("_ctrls_vs")).igSlider("option","value"))}}break;case"title":$("#"+this._id("_title_ctrls_t")).html(value);break;case"progressLabelFormat":options.progressLabelFormat=value;this._updateProgressLabel();break;case"alwaysPlayCommercials":if(value!==options.commercials.alwaysPlayCommercials){options.commercials.alwaysPlayCommercials=value;if(value){this.resetCommercialsShow()}}break;case"bookmarks":this._destroyBookmarks();options.bookmarks=value;this._renderBookmarks();break;case"relatedVideos":this._destroyRelatedVideos();options.relatedVideos=value;this._renderRelatedVideos();break;default:break}this._superApply(arguments)},_onVideoStateChange:function(){var video=this.currentVideo,videoElem=video[0],o=this.options,prevReadyState=this._prevReadyState,readyState=videoElem.readyState;if(prevReadyState>=videoElem.HAVE_FUTURE_DATA&&readyState<=videoElem.HAVE_CURRENT_DATA){if(!videoElem.ended){this._showWaitingIndicator()}}else if(prevReadyState<=videoElem.HAVE_CURRENT_DATA&&readyState===videoElem.HAVE_FUTURE_DATA){this._hideWaitingIndicator()}else if(readyState===videoElem.HAVE_ENOUGH_DATA){if(prevReadyState<=videoElem.HAVE_CURRENT_DATA){this._hideWaitingIndicator()}else{return}}this._prevReadyState=readyState;this._detectBuffered();if(this._lastPausedState!==videoElem.paused){if(this._lastPausedState){this._showCenterPlayButton().removeClass(this.css.centerPauseButtonClass).addClass(this.css.centerPlayButtonClass)}else{this._showCenterPlayButton().removeClass(this.css.centerPlayButtonClass).addClass(this.css.centerPauseButtonClass)}setTimeout($.proxy(this._hideCenterPlayButton,this),o.centerButtonHideDelay);this._prepareForPlay();this._lastPausedState=videoElem.paused}this._setOption("muted",videoElem.muted);this._refreshDuration();this._onVideoStateChangeId=setTimeout($.proxy(this._onVideoStateChange,this),this._const.VIDEO_STATE_TIMEOUT)},_updateTitleControlsTimeString:function(timeString,title){if(this._activeControlsIndex===1&&timeString){if(!title){title=timeString}$("span.ui-igplayer-playbutton-text",$("#"+this._id("_title_ctrls"))).attr("title",title).html(timeString)}},_analyzeSource:function(video,doNotShowError){var detected=false;if(this.supportsH264BaselineVideo()&&video.data("mp4")!==undefined){video.attr("src",video.data("mp4"));detected=true}else if(this.supportsWebmVideo()&&video.data("webm")!==undefined){video.attr("src",video.data("webm"));detected=true}else if(this.supportsOggTheoraVideo()){if(video.data("ogv")!==undefined){video.attr("src",video.data("ogv"));detected=true}else if(video.data("ogg")!==undefined){video.attr("src",video.data("ogg"));detected=true}}video.data("sourceDetected",detected);if(!detected&&!doNotShowError){this._showUnsupportedVideoSourceMsg();if(!this.options.browserControls){if(this._activeControlsIndex===0){$("#"+this._id("_ctrls_play")).igButton("option","disabled",true)}}}else{this._hideUnsupportedVideoSourceMsg();if(!this.options.browserControls){if(this._activeControlsIndex===0){$("#"+this._id("_ctrls_play")).igButton("option","disabled",false)}}}},resetCommercialsShow:function(){this._buildCommercialsShow();this._embeddedCommercialsShow=$.extend(true,[],this.options.commercials.embeddedCommercials);this._embeddedCommercialIndex=0},_attachVideoEvents:function(video){var control=this;this._videoEvents={error:function(event){control._onVideoError(event)},progress:function(event){control._onVideoLoading(event)},waiting:function(event){control._onVideoWaiting(event);control._waiting(this.currentSrc,this.currentTime,this.duration,event)},seeking:function(){control._showWaitingIndicator()},seeked:function(){control._hideWaitingIndicator()},timeupdate:function(event){control._changeCurrentTime(event)},ended:function(event){control._showCenterPlayButton().removeClass("ui-igplayer-centerplaybutton-pause").addClass("ui-igplayer-centerplaybutton-play");control._hideWaitingIndicator();if(!control.options.browserControls){$("span",$("#"+control._id("_ctrls_play"))).addClass("ui-icon-play").removeClass("ui-icon-pause")}$("#"+control._id("_ctrls_pb")).igProgressBar("option","value",0);if(control.options.relatedVideos.length>0){control._onControlMouseOut(null);$("#"+control._id("_rvcc")).show()}control._buildBannersShow();if(control.options.commercials.alwaysPlayCommercials){control.resetCommercialsShow()}control._ended(this.currentSrc,this.duration,event)},playing:function(event){control._hideWaitingIndicator();$("span",$("#"+control._id("_ctrls_play"))).addClass("ui-icon-pause").removeClass("ui-icon-play");control._playing(this.currentSrc,this.duration,event)},pause:function(event){$("span",$("#"+control._id("_ctrls_play"))).addClass("ui-icon-play").removeClass("ui-icon-pause");control._paused(this.currentSrc,this.duration,event)},click:function(event){var o=control.options;if(!o.browserControls){event.preventDefault()}if(event.button===0&&!o.disabled){control._onVideoClick(!o.browserControls)}},dblclick:function(event){event.preventDefault();if(event.button===0&&!control.options.disabled){control._onVideoDblClick()}},selectstart:function(){return false},loadedmetadata:function(){control._refreshDuration()}};video.bind(this._videoEvents)},_onVideoClick:function(allowPlay){if(this._embeddedCommercialPlaying){var link=this.options.commercials.embeddedCommercials[this._embeddedCommercialIndex].link;if(link&&link.length>0){window.open(link,"_blank")}}else if(allowPlay){this.togglePlay()}},_onVideoDblClick:function(){var o=this.options;this._setOption("fullscreen",!o.fullscreen);if(!o.browserControls){this._toggleCenterPlayButton()}},_attachEvents:function(video){var control=this;this._attachVideoEvents(video);this._generalEvts={keydown:function(event){if(event.keyCode===$.ui.keyCode.ESCAPE){if(control.options.fullscreen){control._setOption("fullscreen",false);event.preventDefault();event.stopPropagation()}}else if(event.keyCode===$.ui.keyCode.SPACE){event.preventDefault();event.stopPropagation();control.togglePlay()}}};this._documentEvts={contextmenu:function(e){if($(e.target).is("video")&&control.options.disabled){e.preventDefault();e.stopPropagation()}}};$(document).bind(this._documentEvts);if(!this.options.browserControls){this._controlsEvts={mouseenter:function(event){control._onControlMouseOver(event)},mouseleave:function(event){control._onControlMouseOut(event)}};this.container.bind(this._controlsEvts)}this.container.bind(this._generalEvts)},_handleKbNavigation:function(event){if(event.keyCode===$.ui.keyCode.HOME){$(this.controlButtons[0]).focus();event.stopPropagation();event.preventDefault()}else if(event.keyCode===$.ui.keyCode.END){$(this.controlButtons[this.controlButtons.length-1]).focus();event.stopPropagation();event.preventDefault()}},_handleBlurKb:function(){this.currentVideo.removeClass(this.css.activeVideoClass)},_handleFocusKb:function(){this.currentVideo.addClass(this.css.activeVideoClass)},_onVideoLoading:function(event){this._detectBuffered(event)},_detectBuffered:function(event){var videoElem=this.currentVideo[0],buffered=videoElem.buffered,duration=parseInt(videoElem.duration,10),len=buffered?buffered.length:0,firstBuffered=len>0?parseInt(buffered.start(len-1),10):0,lastBuffered=len>0?parseInt(buffered.end(len-1),10):0,bufferSize=lastBuffered/duration*100;if(len>0&&this._previouslyBuffered!==bufferSize){if(this._previousBuffer&&lastBuffered<parseInt(this._previousBuffer.end(0),10)){$("#"+this._id("_ctrls_pb")).igProgressBar("option","value",firstBuffered)}$("#"+this._id("_ctrls_pb")).igProgressBar("option","endValue",lastBuffered/duration*100);this._buffering(videoElem.currentSrc,bufferSize,event);this._previouslyBuffered=bufferSize;this._previousBuffer=buffered}},_getActiveControls:function(){var ai=this._activeControlsIndex;if(ai!==undefined&&this.controls&&ai>=0&&ai<this.controls.length){return this.controls[ai].parent()}return null},_onControlMouseOver:function(){var controlsDiv=this._getActiveControls(),o=this.options;if(controlsDiv&&!o.browserControls&&o.autohide&&!$("#"+this._id("_rvcc")).is(":visible")){controlsDiv.show().removeClass(this.css.controlsHideClass)}},_onControlMouseOut:function(){var o=this.options,controlsDiv=this._getActiveControls();if(controlsDiv&&!o.browserControls&&o.autohide){controlsDiv.addClass(this.css.controlsHideClass).hide()}},_onVideoError:function(e){var error=e.target.error;switch(error.code){case error.MEDIA_ERR_ABORTED:break;case error.MEDIA_ERR_NETWORK:this.play();break;case error.MEDIA_ERR_DECODE:case error.MEDIA_ERR_SRC_NOT_SUPPORTED:this._showUnsupportedVideoSourceMsg();break;default:break}},_changeCurrentTime:function(event){var videoElem=this.currentVideo[0],rawDuration=videoElem.duration,currentTime;if(rawDuration===Infinity){this._updateProgressLabel()}else if(!isNaN(rawDuration)){currentTime=parseInt(videoElem.currentTime,10);if(!this._userSliding){$("#"+this._id("_ctrls_s")).igSlider("option","value",currentTime/rawDuration*100)}this._updateProgressLabel();if(this._embeddedCommercialPlaying){this._updateAdMessage(this.options.commercials.embeddedCommercials[this._embeddedCommercialIndex].endTime-currentTime);this._checkEmbeddedCommercialShow(currentTime)}else if(!this._commercialPlaying){this._checkBannerShow(currentTime);this._checkCommercialsShow(currentTime);this._checkEmbeddedCommercialShow(currentTime)}else{this._updateAdMessage(rawDuration-currentTime)}}this._progress(videoElem.currentSrc,currentTime,rawDuration,event)},_checkBannerShow:function(currentTime){var show=this._bannerShow||[],len=show.length,i=0;for(i;i<len;i++){if(show[i].length>0&&currentTime>=show[i][0]){show[i].shift();this.showBanner(i)}}},_checkCommercialsShow:function(currentTime){if(this._commercialsShow&&this._commercialsShow.length>0&&currentTime>=this._commercialsShow[0]&&!this._commercialPlaying){this._commercialPlaying=true;if(currentTime-this._commercialsShow[0]>this._const.COMMERCIAL_SEEK_DELTA){this.currentTime(this._commercialsShow[0])}if(!this.options.browserControls){this.playCommercial(this.options.commercials.linkedCommercials[this._commercialIndex])}}},_checkEmbeddedCommercialShow:function(currentTime){if(this._embeddedCommercialsShow&&this._embeddedCommercialsShow.length>0&&!this.currentVideo[0].seeking){var currentCommercial=this._embeddedCommercialsShow[0];if(currentTime>=currentCommercial.startTime&&!this._embeddedCommercialPlaying){this._embeddedCommercialPlaying=true;if(currentTime-currentCommercial.startTime>this._const.COMMERCIAL_SEEK_DELTA){this.currentTime(currentCommercial.startTime)}$("#"+this._id("_ctrls_s")).igSlider("option","disabled",true);this._showAdMessage(currentCommercial.endTime-currentCommercial.startTime);if(currentCommercial.link&&currentCommercial.link.length>0){this.currentVideo.attr({title:this._getLocaleValue("adNewWindowTip"),"data-localeid":"adNewWindowTip","data-localeattr":"title"})}}else if(currentTime>=currentCommercial.endTime&&this._embeddedCommercialPlaying){this._embeddedCommercialsShow.shift();this._embeddedCommercialIndex++;this._embeddedCommercialPlaying=false;this.hideAdMessage();$("#"+this._id("_ctrls_s")).igSlider("option","disabled",false);if(currentCommercial.link&&currentCommercial.link.length>0){this.currentVideo.removeAttr("title")}}}},_updateProgressLabel:function(){var videoElem=this.currentVideo[0],progressLabel=$("#"+this._id("_ctrls_pl")),rawDuration=videoElem.duration,duration=parseInt(rawDuration,10),currentTime=parseInt(videoElem.currentTime,10),progressString=this.options.progressLabelFormat;progressString=progressString.replace("${currentTime}",this._toTimeString(currentTime)).replace("${duration}",rawDuration===Infinity?this._getLocaleValue("liveStream "):this._toTimeString(duration));progressLabel.html(progressString)},_toTimeString:function(val){if(typeof val==="number"){var secs=parseInt(val%60,10),mins=parseInt(val/60,10),hours=parseInt(mins/60,10),days=parseInt(hours/24,10),timeFormat="{0}d {1}:{2}:{3}";mins=parseInt(mins%60,10);hours=parseInt(hours%60,10);timeFormat=timeFormat.replace("{3}",secs<10?"0"+secs:secs).replace("{2}",mins);if(hours>0){timeFormat=timeFormat.replace("{1}",hours);if(days>0){timeFormat=timeFormat.replace("{0}",days)}else{timeFormat=timeFormat.replace("{0}d ","")}}else{timeFormat=timeFormat.replace("{0}d {1}:","")}return timeFormat}return"NaN"},_onVideoWaiting:function(){this._showWaitingIndicator()},_createUnsupportedVideoSourceMsg:function(){var css=this.css;return this._createButton(this._id("_detectError"),css.unsupportedVideoSourceClass,css.unsupportedVideoSourceIconClass,this._getLocaleValue("missingVideoSource")).attr({title:this._getLocaleValue("unsupportedVideoSource"),"data-localeid":"unsupportedVideoSource","data-localeattr":"title"})},_showUnsupportedVideoSourceMsg:function(){var error=$("#"+this._id("_detectError"));if(error.length===0){error=this._createUnsupportedVideoSourceMsg()}return error.show()},_hideUnsupportedVideoSourceMsg:function(){$("#"+this._id("_detectError")).hide()},_createBigPlayButton:function(){var control=this,css=this.css;this._createButton(this._id("_play"),css.centerPlayButtonClass,css.centerPlayButtonIconClass,"").bind({click:function(event){event.preventDefault();if(event.button===0){control._onVideoClick(true)}},dblclick:function(event){event.preventDefault();if(event.button===0){control._onVideoDblClick()}}})},_updateButtonLabel:function(buttonId,text){var $buttonLabel=$("#"+buttonId).find("[data-button-label]");if($buttonLabel.length){$buttonLabel.html(text)}},_createButton:function(buttonId,buttonClass,spanClass,text){$("<span data-button-label></span>").html(text).addClass(spanClass).appendTo($("<a></a>").attr("id",buttonId).attr("href",this._const.HREF).attr("tabIndex",-1).addClass("ui-state-default").addClass(buttonClass).appendTo(this.container));return $("#"+buttonId).bind({mouseover:function(){$(this).addClass("ui-state-hover")},mouseout:function(){$(this).removeClass("ui-state-hover")}}).hide()},_showCenterPlayButton:function(){var video=this.currentVideo,button=$("#"+this._id("_play")),videoCenterTop=Math.floor(video.height()/2),videoCenterLeft=Math.floor(video.width()/2),top=videoCenterTop-Math.floor(button.innerHeight()/2),left=videoCenterLeft-Math.floor(button.innerWidth()/2);button.css("position","absolute").css("left",left).css("top",top);return button.show()},_toggleCenterPlayButton:function(){var videoElem=this.currentVideo[0],o=this.options,css=this.css;if(videoElem.paused||videoElem.ended){this._showCenterPlayButton().removeClass(css.centerPauseButtonClass).addClass(css.centerPlayButtonClass)}else{this._showCenterPlayButton().removeClass(css.centerPlayButtonClass).addClass(css.centerPauseButtonClass)}setTimeout($.proxy(this._hideCenterPlayButton,this),o.centerButtonHideDelay)},_hideCenterPlayButton:function(){return $("#"+this._id("_play")).hide()},_createWaitingIndicator:function(){var css=this.css;this._createButton(this._id("_waiting"),css.waitingIndicatorClass,css.waitingIndicatorIconClass,this._getLocaleValue("buffering"))},_createSeekTimeToolTip:function(){$("<div></div>").attr("id",this._id("_seek_tooltip")).hide().igTooltip({text:"00:00",arrowLocation:"bottom"}).appendTo(this.container).addClass(this.css.seekTooltipClass)},_showSeekTimeToolTip:function(x,y,seconds){var toolTip=$("#"+this._id("_seek_tooltip"));toolTip.css("top",y-toolTip.outerHeight()).css("left",x-toolTip.width()/2).igTooltip("option","text",this._toTimeString(seconds)).show()},_showWaitingIndicator:function(){if($("#"+this._id("_detectError")).is(":visible")){return}var video=this.currentVideo,button=$("#"+this._id("_waiting")),videoCenterTop=Math.floor(video.height()/2),videoCenterLeft=Math.floor(video.width()/2),top=videoCenterTop-Math.floor(button.innerHeight()/2),left=videoCenterLeft-Math.floor(button.innerWidth()/2);button.css("position","absolute").css("left",left).css("top",top).show()},_hideWaitingIndicator:function(){$("#"+this._id("_waiting")).hide()},_renderTitleControls:function(){var title=this.options.title,control=this,controlsDiv,html='<div id="'+this._id("_title_ctrls")+'" class="ui-widget-header ui-igplayer-controls '+'ui-igplayer-grid ui-igplayer-title-controls ui-corner-all">';html+='<div class="ui-igplayer-row">';html+='<div class="ui-igplayer-container ui-igplayer-cell ui-igplayer-playback-alone">';html+='\t\t<a id="'+this._id("_title_ctrls_play")+'" class="ui-button ui-igplayer-playbutton ui-igplayer-playback-with-time '+'ui-state-default ui-corner-all ui-priority-primary" href="'+this._const.HREF+'">';html+='\t\t\t<span title="'+this._getLocaleValue("play")+'" '+'data-localeid="play" data-localeattr="title" '+'class="ui-icon ui-icon-play ui-igplayer-playbutton-icon"></span>';html+='\t\t\t<span title="00:00" class="ui-button-text ui-igplayer-playbutton-text">00:00</span>';html+="\t\t</a>";html+="</div>";html+='<div id="'+this._id("_title_ctrls_t")+'" class="ui-igplayer-container ui-igplayer-cell ui-igplayer-video-title">';if(title&&title.length>0){html+=title}html+="</div></div></div>";controlsDiv=$(html).appendTo(this.container).wrap('<div style="position:absolute; width: 100%;"></div>');if(this.options.width){controlsDiv.parent().css("width",this.options.width)}$("#"+this._id("_title_ctrls_play")).bind({click:function(event){event.preventDefault();if(event.button===0&&!control.options.disabled){control.togglePlay()}}});return controlsDiv},_hideTitleControls:function(){if(this._activeControlsIndex!==0){this._activeControlsIndex=0;$("#"+this._id("_title_ctrls")).addClass(this.css.controlsHideClass).parent().remove();$("#"+this._id("_ctrls")).parent().show()}},_convertBookmarks:function(prop,bookmarks,duration,css){var len=bookmarks.length,newBookmarks=[],i=0,mark,newMark,value;for(i;i<len;i++){mark=bookmarks[i];if(mark[prop]>0&&mark[prop]<duration){value=parseInt(mark[prop]/duration*100,10);newMark={value:value,secondsValue:mark[prop],displayTime:this._toTimeString(mark[prop]),index:i,title:mark.title,disabled:mark.disabled};if(css&&css.length>0){newMark.css=css}newBookmarks.push(newMark)}}return newBookmarks},_renderBookmarks:function(){var o=this.options,bookmarks=o.bookmarks||[],com=o.commercials,ads=com.linkedCommercials||[],eads=com.embeddedCommercials||[],duration=this.currentVideo[0].duration,newBookmarks=[],newAdBookmarks=[],newEAdBookmarks=[];if(com.showBookmarks){if(ads.length>0){newAdBookmarks=this._convertBookmarks("startTime",ads,duration,this.css.linkedBookmarkClass)}if(eads.length>0){newEAdBookmarks=this._convertBookmarks("startTime",eads,duration,this.css.adBookmarkClass)}}if(bookmarks.length>0){newBookmarks=this._convertBookmarks("time",bookmarks,duration);if(newBookmarks.length>0){this._renderBookmarkArea(newBookmarks)}}if(newAdBookmarks.length>0){$.merge(newBookmarks,newAdBookmarks)}if(newEAdBookmarks.length>0){$.merge(newBookmarks,newEAdBookmarks)}if(newBookmarks.length>0){$("#"+this._id("_ctrls_s")).igSlider("option","bookmarks",newBookmarks)}this._bookmarksRendered=true},_renderBookmarkArea:function(bookmarks){if(bookmarks&&bookmarks.length>0){var css=this.css,bookmarkStr='<li class="ui-corner-all $class$"><span class="'+css.bookmarkItemTimeClass+'">$time$</span><span class="'+css.bookmarkItemTitleClass+'" title="$titleAttr$">$title$</span></li>',bookmarkAreaStr='<div id="$id$" class="$bookmarkContainerClass$">'+'<div class="$headerClass$" data-localeid="skipTo">$headerText$</div>'+'<ul class="$bookmarkListClass$">$list$</ul></div>',bookmarkList="",bookmarkArea,mark,i=0,len=bookmarks.length,control=this;for(i;i<len;i++){mark=bookmarks[i];bookmarkList+=bookmarkStr.replace("$time$",mark.displayTime).replace("$titleAttr$",mark.title).replace("$title$",mark.title).replace("$class$",mark.disabled?css.bookmarkItemDisabledClass:"")}bookmarkAreaStr=bookmarkAreaStr.replace("$id$",this._id("_bookmarks")).replace("$bookmarkContainerClass$",css.bookmarkContainerClass).replace("$headerClass$",css.bookmarkContainerHeaderClass).replace("$bookmarkListClass$",css.bookmarkListClass).replace("$headerText$",this._getLocaleValue("skipTo")).replace("$list$",bookmarkList);bookmarkArea=$(bookmarkAreaStr).appendTo(this.container);this.bookmarkElements=$("li",$("#"+this._id("_bookmarks")));this.bookmarkElements.each(function(i){$(this).data("bookmark-index",bookmarks[i].index);$(this).data("bookmark-sec-value",bookmarks[i].secondsValue)});this.bookmarkElements.bind({click:function(event){var index=$(this).data("bookmark-index"),mark=control.options.bookmarks[index];event.stopPropagation();event.preventDefault();if(!mark.disabled){if(control.paused()){control.togglePlay()}control.currentTime($(this).data("bookmark-sec-value"));control._changeActiveBookmark(index);control._bookmarkClick(mark,bookmarks[index],event)}}});if(this.options.height){this.currentVideo.css("height",this.container.height()-bookmarkArea.height());this._resizeBookmarkAreaTimeoutId=setTimeout($.proxy(this._onPlayerResize,this),500)}}},_onPlayerResize:function(){var o=this.options,containerH=this.container.height(),containerW=this.container.width(),bookmarkArea=$("#"+this._id("_bookmarks"));if((o.height||o.width)&&(this._oldContainerHeight!==containerH||this._oldContainerWidth!==containerW)){this.currentVideo.css("height",containerH-bookmarkArea.height());this._oldContainerHeight=containerH;this._oldContainerWidth=containerW}this._resizeBookmarkAreaTimeoutId=setTimeout($.proxy(this._onPlayerResize,this),250)},_ensureVolume:function(){this.options.volume=this.currentVideo[0].volume},_renderControls:function(){$("body").addClass("ui-igplayer-normal-screen-mode");if(this.options.showSeekTime){this._createSeekTimeToolTip()}var videoElem=this.currentVideo[0],titleOption,control=this,controlsDiv,controlsArray=[],autoPlay=this.options.autoplay,href=this._const.HREF,html='<div id="'+this._id("_ctrls")+'" class="$controlsClass$">',cachedTime;html+='\t\t\t<div class="ui-igplayer-row">';html+='\t\t\t\t<div class="ui-igplayer-container ui-igplayer-cell ui-igplayer-playback">';html+='\t\t\t\t\t<a id="$playButtonId$" class="$playButtonClass$" href="'+href+'"></a>';html+="\t\t\t\t</div>";html+='\t\t\t\t<div class="ui-igplayer-container ui-igplayer-cell ui-igplayer-progress-bar">';html+='\t\t\t\t\t<div id="$progressBarId$" class="$progressBarClass$"></div>';html+="\t\t\t\t</div>";html+='\t\t\t\t<div class="ui-igplayer-container ui-igplayer-extra">';html+='\t\t\t\t\t<div class="ui-igplayer-grid">';html+='\t\t\t\t\t\t<div class="ui-igplayer-row">';html+='\t\t\t\t\t\t\t<div class="ui-igplayer-cell">';html+='\t\t\t\t\t\t\t\t<a id="$progressLabelId$" class="$progressLabelClass$" href="'+href+'"></a>';html+="\t\t\t\t\t\t\t</div>";html+='\t\t\t\t\t\t\t<div class="ui-igplayer-cell">';html+="\t\t\t\t\t\t\t\t<div>";html+='\t\t\t\t\t\t\t\t\t<div id="$volumeSliderId$" class="$volumeSliderClass$"></div>';html+="\t\t\t\t\t\t\t\t\t<div>";html+='\t\t\t\t\t\t\t\t\t\t<a id="$volumeControlId$" class="$volumeControlClass$" href="'+href+'"></a>';html+="\t\t\t\t\t\t\t\t\t</div>";html+="\t\t\t\t\t\t\t\t</div>";html+="\t\t\t\t\t\t\t</div>";html+='\t\t\t\t\t\t\t<div class="ui-igplayer-cell">';html+='\t\t\t\t\t\t\t\t<a id="$fullScreenId$" class="$fullScreenClass$" href="'+href+'"></a>';html+="\t\t\t\t\t\t\t</div>";html+="\t\t\t\t\t\t</div>";html+="\t\t\t\t\t</div>";html+="\t\t\t\t</div>";html+="\t\t\t</div>";html+="\t\t</div>";html=html.replace("$playButtonClass$",this.css.playButtonClass).replace("$progressBarClass$",this.css.progressBarClass).replace("$fullScreenClass$",this.css.fullScreenClass).replace("$controlsClass$",this.css.controlsClass).replace("$volumeControlClass$",this.css.volumeControlClass).replace("$volumeSliderClass$",this.css.volumeSliderClass).replace("$progressLabelClass$",this.css.progressLabelClass);html=html.replace("$playButtonId$",this._id("_ctrls_play")).replace("$progressBarId$",this._id("_ctrls_s")).replace("$fullScreenId$",this._id("_ctrls_fs_btn")).replace("$volumeControlId$",this._id("_ctrls_vc_btn")).replace("$volumeSliderId$",this._id("_ctrls_vs")).replace("$progressLabelId$",this._id("_ctrls_pl"));controlsDiv=$(html).appendTo(this.container).wrap('<div style="position:absolute; width: 100%;"></div>');if(this.options.width){controlsDiv.parent().css("width",this.options.width)}controlsArray.push(controlsDiv);if(!autoPlay&&videoElem.currentTime===0){controlsDiv.parent().hide();this._activeControlsIndex=1;controlsArray.push(this._renderTitleControls())}else{this._activeControlsIndex=0}this.controls=$(controlsArray);titleOption=autoPlay?"playing":"paused";$("#"+this._id("_ctrls_play")).bind({click:function(event){event.preventDefault();if(!$(this).igButton("option","disabled")){control.togglePlay()}}}).igButton({link:{href:this._const.HREF},css:{buttonLabelClass:"ui-icon "+(autoPlay?"ui-icon-pause ":"ui-icon-play ")+"ui-igplayer-playbutton-icon "}}).addClass("ui-priority-primary").attr({title:this._getLocaleValue(titleOption),"data-localeid":titleOption,"data-localeattr":"title"});$("#"+this._id("_ctrls_fs_btn")).bind({click:function(event){event.preventDefault();control._setOption("fullscreen",!control.options.fullscreen)}}).igButton({link:{href:this._const.HREF},css:{buttonLabelClass:this.css.fullScreenIconClass}}).attr({title:this._getLocaleValue("enterFullscreen"),"data-localeattr":"title","data-localeid":"enterFullscreen"});$('<div id="'+this._id("_ctrls_pb")+'"></div>').appendTo($("#"+this._id("_ctrls_s")).igSlider({slide:function(event,ui){if(event.originalEvent===undefined){return false}clearTimeout(control._slideTimeout);control._slideTimeout=setTimeout(control._createDelegate(control,control._slide,[ui]),control._const.SLIDE_SEEK_TIMEOUT)},start:function(){control._userSliding=true},stop:function(){control._userSliding=false},bookmarkhit:function(event,ui){var index=ui.bookmark.index,elems=control.bookmarkElements;if(elems&&elems.length>0){control._changeActiveBookmark(index);control._bookmarkHit(control.currentVideo[0].currentSrc,control.options.bookmarks[index],elems[index],event)}},bookmarkclick:function(event,ui){var mark;if($(ui.bookmarkElement).hasClass("ui-igplayer-linked-bookmark")){mark=control.options.commercials.linkedCommercials[ui.bookmark.index]}else if($(ui.bookmarkElement).hasClass("ui-igplayer-ad-bookmark")){mark=control.options.commercials.embeddedCommercials[ui.bookmark.index]}else{mark=control.options.bookmarks[ui.bookmark.index];control._changeActiveBookmark(ui.bookmark.index)}if(mark.time){cachedTime=mark.time}else{cachedTime=mark.startTime}control.currentTime(cachedTime);control._bookmarkClick(mark,ui.bookmarkElement,event);return false},min:0,max:100,animate:true}).css("display","block")).igProgressBar({range:true,endValue:0});$("#"+this._id("_ctrls_pb")).bind({mousemove:function(e){if(control.options.showSeekTime&&this.offsetWidth>0){var relativeX=e.pageX-this.offsetLeft-$(this).igOffset().left,percentLocation=parseInt(relativeX/this.offsetWidth*100,10),duration=videoElem.duration,seconds,controlOffset=control.container.igOffset();if(!isNaN(duration)&&duration!==Infinity&&!control._commercialPlaying){seconds=parseInt(percentLocation*duration/100,10);control._showSeekTimeToolTip(e.pageX-controlOffset.left,e.pageY-controlOffset.top,seconds)}}},mouseout:function(){$("#"+control._id("_seek_tooltip")).hide()}});$("#"+this._id("_ctrls_pl")).bind({click:function(event){event.preventDefault()}});$("#"+this._id("_ctrls_vc_btn")).bind({mouseover:function(){control._showVolumeSlider()},mouseout:function(event){if(!$.contains(event.currentTarget,event.relatedTarget)&&event.currentTarget!==event.relatedTarget){control._volumeSliderTimeoutId=setTimeout($.proxy(control._hideVolumeSlider,control),control.options.volumeAutohideDelay)}},click:function(event){event.preventDefault();control._setOption("muted",!control.options.muted)}}).igButton({link:{href:this._const.HREF},css:{buttonLabelClass:"ui-icon "+(this.options.muted?"ui-icon-volume-off":"ui-icon-volume-on")+" ui-igbutton-icon"}}).attr({title:this._getLocaleValue("volume"),"data-localeid":"volume","data-localeattr":"title"});$("#"+this._id("_ctrls_vs")).hide().bind({mouseover:function(){control._volumeSliderMouseOut=false;clearTimeout(control._volumeSliderTimeoutId)},mouseout:function(){if(!control._userSlidingVolume){control._volumeSliderTimeoutId=setTimeout($.proxy(control._hideVolumeSlider,control),control.options.volumeAutohideDelay)}control._volumeSliderMouseOut=true}}).igSlider({slide:function(event,ui){if(event.originalEvent===undefined){return}control._setOption("volume",parseFloat(parseInt(ui.value,10)/100))},start:function(){control._userSlidingVolume=true},stop:function(){control._userSlidingVolume=false},min:0,max:100,step:10,orientation:"vertical",value:this.options.muted?0:this.options.volume*100});$("#"+this._id("_ctrls_vs")).data("igSlider").handle.attr("tabIndex",-1).bind({blur:function(){control._volumeSliderTimeoutId=setTimeout($.proxy(control._hideVolumeSlider,control),control.options.volumeAutohideDelay)}});this.controlButtons=$([document.getElementById(this._id("_ctrls_play")),$("a.ui-state-default",$("#"+this._id("_ctrls_s")))[0],document.getElementById(this._id("_ctrls_vc_btn")),document.getElementById(this._id("_ctrls_fs_btn"))]);this.controlButtons.each(function(i){$(this).data("index.control-button",i)});this.controlButtons.bind({keydown:function(event){control._handleKbNavigation(event)},focus:function(event){control._handleFocusKb(event)},blur:function(event){control._handleBlurKb(event);
}});$("#"+this._id("_ctrls_vc_btn")).bind({focus:function(){control._showVolumeSlider()},blur:function(){if(!control._transferFocusFromVolumeButtonToVolumeSlider){control._hideVolumeSlider()}control._transferFocusFromVolumeButtonToVolumeSlider=false},keydown:function(event){if(event.keyCode===$.ui.keyCode.TAB){event.preventDefault();event.stopPropagation();control._transferFocusFromVolumeButtonToVolumeSlider=true;$("#"+control._id("_ctrls_vs")).data("igSlider").handle.focus()}}});$("#"+control._id("_ctrls_vs")).data("igSlider").handle.bind({keydown:function(event){if(event.keyCode===$.ui.keyCode.TAB){event.preventDefault();event.stopPropagation();$("#"+control._id("_ctrls_fs_btn")).focus()}}})},_updateNotSupportedBrowserContainer:function(){var $container=this.container.find("[data-not-supported-browser]");if($container.length){$container.remove();$.ig.util._renderUnsupportedBrowser(this,this._getLocaleDictionary())}},changeLocale:function(){this._super();var $button=$("#"+this._id("_rv_bar_replay")),$progressLabel=$("#"+this._id("_ctrls_pl"));if($button.length){$button.igButton("option",{labelText:this._getLocaleValue("replayButton")})}if($progressLabel.length){this._updateProgressLabel()}this._updateButtonLabel(this._id("_waiting"),this._getLocaleValue("buffering"));this._updateButtonLabel(this._id("_detectError"),this._getLocaleValue("missingVideoSource"));this._refreshDuration(true);this._updateNotSupportedBrowserContainer()},_slide:function(ui){var value=ui.value,rawDuration=this.currentVideo[0].duration,currentTime=rawDuration*(value/100);if(!isNaN(rawDuration)&&rawDuration!==Infinity){this.currentTime(currentTime)}this._userSliding=false},_changeActiveBookmark:function(index){var activeBookmarkIndex=this._activeBookmarkIndex,bkElems=this.bookmarkElements;if(bkElems&&bkElems.length>0&&index!==activeBookmarkIndex){if(activeBookmarkIndex>=0&&activeBookmarkIndex<bkElems.length){$(bkElems[activeBookmarkIndex]).removeClass(this.css.bookmarkActiveItemClass)}if(index>=0&&index<bkElems.length){$(bkElems[index]).addClass(this.css.bookmarkActiveItemClass);this._activeBookmarkIndex=index}}},_adjustVolumeButton:function(value){var volumeButton=$("#"+this._id("_ctrls_vc_btn"));if(value===0){$("span",volumeButton).removeClass("ui-icon-volume-on").addClass("ui-icon-volume-off")}else{$("span",volumeButton).removeClass("ui-icon-volume-off").addClass("ui-icon-volume-on")}},_hideVolumeSlider:function(){var slider=$("#"+this._id("_ctrls_vs"));slider.data("igSlider").handle.attr("tabIndex",-1);slider.hide()},_showVolumeSlider:function(){clearTimeout(this._volumeSliderTimeoutId);var slider=$("#"+this._id("_ctrls_vs"));slider.data("igSlider").handle.removeAttr("tabIndex");slider.show()},_ended:function(source,duration,event){var args={source:source,duration:duration};return this._trigger(this.events.ended,event,args)},_playing:function(source,duration,event){var args={source:source,duration:duration,currentTime:this.currentVideo[0].currentTime};return this._trigger(this.events.playing,event,args)},_paused:function(source,duration,event){var args={source:source,duration:duration,currentTime:this.currentVideo[0].currentTime};return this._trigger(this.events.paused,event,args)},_buffering:function(source,bufferedPercent,event){var args={source:source,buffered:bufferedPercent};return this._trigger(this.events.buffering,event,args)},_progress:function(source,currentTime,duration,event){var args={source:source,currentTime:currentTime,duration:duration};return this._trigger(this.events.progress,event,args)},_waiting:function(source,currentTime,duration,event){var args={source:source,currentTime:currentTime,duration:duration};return this._trigger(this.events.waiting,event,args)},_bookmarkHit:function(source,bookmark,bookmarkElement,event){var args={source:source,bookmark:bookmark,bookmarkElement:bookmarkElement};return this._trigger(this.events.bookmarkHit,event,args)},_bookmarkClick:function(bookmark,bookmarkElement,event){var args={bookmark:bookmark,bookmarkElement:bookmarkElement};return this._trigger(this.events.bookmarkClick,event,args)},_enterFullScreen:function(source){var args={source:source};return this._trigger(this.events.enterFullScreen,null,args)},_exitFullScreen:function(source){var args={source:source};return this._trigger(this.events.exitFullScreen,null,args)},_bannerVisible:function(index,element){var args={index:index,banner:this.options.banners[index],bannerElement:element};return this._trigger(this.events.bannerVisible,null,args)},_bannerHidden:function(index,element){var args={index:index,banner:this.options.banners[index],bannerElement:element};return this._trigger(this.events.bannerHidden,null,args)},_prepareForPlay:function(){var o=this.options,video=this.currentVideo;if($("source",video).length===0){this._renderSources(o.sources,video)}if(!video.data("sourceDetected")){this._analyzeSource(video)}this._hideTitleControls();if(o.relatedVideos&&o.relatedVideos.length>0){$("#"+this._id("_rvcc")).hide()}},togglePlay:function(){var videoElem=this.currentVideo[0];this._prepareForPlay();this._toggleCenterPlayButton();if(videoElem.paused||videoElem.ended){if(!this.options.browserControls){$("#"+this._id("_ctrls_play")).attr({title:this._getLocaleValue("playing"),"data-localeid":"playing","data-localeattr":"title"})}videoElem.play()}else{if(!this.options.browserControls){$("#"+this._id("_ctrls_play")).attr({title:this._getLocaleValue("paused"),"data-localeid":"paused","data-localeattr":"title"})}videoElem.pause()}},play:function(){var videoElem=this.currentVideo[0];if(videoElem.paused||videoElem.ended){this._prepareForPlay();this._toggleCenterPlayButton();if(!this.options.browserControls){$("#"+this._id("_ctrls_play")).attr({title:this._getLocaleValue("playing"),"data-localeid":"playing","data-localeattr":"title"})}videoElem.play()}},pause:function(){var videoElem=this.currentVideo[0];if(!videoElem.paused){this._toggleCenterPlayButton();if(!this.options.browserControls){$("#"+this._id("_ctrls_play")).attr({title:this._getLocaleValue("paused"),"data-localeid":"paused","data-localeattr":"title"})}videoElem.pause()}},currentTime:function(val){var videoElem=this.currentVideo[0],rawDuration=videoElem.duration;if(val!==null&&val!==undefined){try{if($.ig.util.isIE){$(videoElem).on("loadedmetadata",function(){this.currentTime=val})}videoElem.currentTime=val;$("#"+this._id("_ctrls_pb")).igProgressBar("option","value",(val/rawDuration).toFixed(2)*100);this._checkCommercialsShow(val);this._checkEmbeddedCommercialShow(val)}catch(ex){}if(videoElem.paused&&!isNaN(rawDuration)){$("#"+this._id("_ctrls_s")).igSlider("option","value",(val/rawDuration).toFixed(2)*100)}}return parseInt(videoElem.currentTime,10)},screenshot:function(scaleFactor){if(!scaleFactor||$.type(scaleFactor)!=="number"){scaleFactor=1}var videoElem=this.currentVideo[0],w=videoElem.videoWidth*scaleFactor,h=videoElem.videoHeight*scaleFactor,canvas=document.createElement("canvas"),ctx;if(canvas.getContext){canvas.width=w;canvas.height=h;ctx=canvas.getContext("2d");ctx.drawImage(videoElem,0,0,w,h)}return canvas},supportsVideo:function(){return!!document.createElement("video").canPlayType},supportsH264BaselineVideo:function(){if(!this.supportsVideo()){return false}var v=document.createElement("video");return v.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')!==""},supportsOggTheoraVideo:function(){if(!this.supportsVideo()){return false}var v=document.createElement("video");return v.canPlayType('video/ogg; codecs="theora, vorbis"')!==""},supportsWebmVideo:function(){if(!this.supportsVideo()){return false}var v=document.createElement("video");return v.canPlayType('video/webm; codecs="vp8, vorbis"')!==""},paused:function(){return this.currentVideo[0].paused},ended:function(){return this._getMainVideo()[0].ended},duration:function(){this._refreshDuration();return this._duration},_refreshDuration:function(forceUpdate){var duration=this.currentVideo[0].duration;if(duration!==this._duration||forceUpdate){this._duration=duration;if(duration===Infinity){this._updateTitleControlsTimeString(this._getLocaleValue("live"),this._getLocaleValue("liveStream"));$("#"+this._id("_ctrls_s")).data("igSlider").handle.hide();$("#"+this._id("_ctrls_s")).igSlider("option","disabled",true)}else if(!isNaN(duration)){if(this._commercialPlaying){this._showAdMessage(parseInt(duration,10))}else{this._updateTitleControlsTimeString(this._toTimeString(duration));if(!this._bookmarksRendered&&duration>0){this._renderBookmarks()}}}}},seeking:function(){return this.currentVideo[0].seeking},destroy:function(){var css=this.css;var isFullscreen=this.options.fullscreen;clearTimeout(this._scrollingTimoutId);clearTimeout(this._volumeSliderTimeoutId);clearTimeout(this._onVideoStateChangeId);clearTimeout(this._resizeBookmarkAreaTimeoutId);if(this._oldWidth){this.element.css("width",this._oldWidth)}if(this._oldHeight){this.element.css("height",this._oldHeight)}this.container.unbind(this._generalEvts);$(document).unbind(this._documentEvts);if(this._controlsEvts){this.container.unbind(this._controlsEvts)}this.container.removeClass(css.baseClasses);$("#"+this._id("_ctrls_s")).igSlider("destroy");$("#"+this._id("_ctrls_pb")).igProgressBar("destroy");$("#"+this._id("_ctrls_vs")).igSlider("destroy");$("#"+this._id("_seek_tooltip")).igTooltip("destroy");if(this._commercialsShow){delete this._commercialsShow;delete this._commercialIndex;delete this._commercialPlaying}if(this._embeddedCommercialsShow){delete this._embeddedCommercialPlaying;delete this._embeddedCommercialIndex;delete this._embeddedCommercialsShow}delete this.bookmarkElements;delete this.relatedVideoElements;delete this.controlButtons;delete this._bannerShow;delete this.banner;if(this.element.is("video")){this.element.unbind(this._videoEvents);this.element.removeClass(css.videoClass);this._restoreExistingVideoProperties(this.element);$(":not(video)",this.container).remove();this.element.unwrap()}else{this.container.children().remove()}if(isFullscreen){$(".ui-igplayer-full-screen-mode").removeClass("ui-igplayer-full-screen-mode")}this._superApply(arguments)},_destroyBookmarks:function(){if(this.bookmarkElements&&this.bookmarkElements.length>0){this.bookmarkElements.unbind();this.bookmarkElements.removeData();delete this.bookmarkElements;$("#"+this._id("_bookmarks")).remove();$("#"+this._id("_ctrls_s")).igSlider("clearBookmarks");this._bookmarksRendered=false}},_destroyRelatedVideos:function(){var related=this.options.relatedVideos;if(related&&related.length>0){$("#"+this._id("_rvcc")).remove();delete this.relatedVideoElements;related=[]}},_destroyControls:function(){var controls=this.options.browserControls;if(!controls){$("#"+this._id("_ctrls_play")).igButton("destroy");$("#"+this._id("_ctrls_vc_btn")).igButton("destroy");$("#"+this._id("_ctrls_fs_btn")).igButton("destroy");$("#"+this._id("_ctrls_pb")).igProgressBar("destroy");$("#"+this._id("_ctrls_s")).igSlider("destroy");$("#"+this._id("_ctrls_vs")).igSlider("destroy");this.controls.each(function(){$(this).parent().remove()});delete this.controls;delete this.controlButtons;delete this._activeControlsIndex}}});$.extend($.ui.igVideoPlayer,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI Tree Grid 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.dataSource.js
 *	infragistics.ui.shared.js
 *	infragistics.util.js
 *	infragistics.ui.grid.framework.js
 */
(function($){var _aNull=function(val){return val===null||val===undefined};$.widget("ui.igTreeGrid",$.ui.igGrid,{css:{containerClasses:"ui-igtreegrid",expandCellExpanded:"ui-icon ui-igtreegrid-expansion-indicator ui-icon-minus",expandCellCollapsed:"ui-icon ui-igtreegrid-expansion-indicator ui-icon-plus",dataSkipCell:"ui-igtreegrid-non-data-column",expandColumn:"ui-igtreegrid-expansion-indicator-cell",dataColumnExpandContainer:"ui-igtreegrid-expansion-indicator-container",expandColumnContainer:"ui-igtreegrid-expansion-column-container",expandContainer:"ui-igtreegrid-expandcell",expandHeaderCell:"ui-igtreegrid-expansion-indicator-header-cell ui-iggrid-header ui-widget-header",rowLevel:"ui-igtreegrid-rowlevel"},options:{indentation:30,initialIndentationLevel:-1,showExpansionIndicator:true,expandTooltipText:null,collapseTooltipText:null,foreignKey:null,initialExpandDepth:-1,foreignKeyRootValue:-1,renderExpansionIndicatorColumn:false,renderFirstDataCellFunction:null,childDataKey:"childData",renderExpansionCellFunction:null,enableRemoteLoadOnDemand:false,dataSourceSettings:{propertyExpanded:null,propertyDataLevel:null,expandedKey:"__ig_options.expanded",dataLevelKey:"__ig_options.dataLevel",initialFlatDataView:false},locale:{expandTooltipText:undefined,collapseTooltipText:undefined},virtualizationMode:"continuous",avgColumnWidth:null,avgRowHeight:25,columnVirtualization:null,restSettings:{}},events:{rowExpanding:"rowExpanding",rowExpanded:"rowExpanded",rowCollapsing:"rowCollapsing",rowCollapsed:"rowCollapsed"},_isHierarchicalDataSource:true,_create:function(){this._checkForUnsoppertedScenarios();var func=this.options.renderFirstDataCellFunction;if(func&&$.type(func)!=="function"){if(window[func]&&typeof window[func]==="function"){func=window[func]}}if(func&&$.type(func)==="function"){this._renderFirstDataCellHandler=func}else{this._renderFirstDataCellHandler=$.proxy(this._renderFirstDataCell,this)}func=this.options.renderExpansionCellFunction;if(func&&$.type(func)!=="function"){if(window[func]&&typeof window[func]==="function"){func=window[func]}}if(func&&$.type(func)==="function"){this._renderExpandCellHandler=func}else{this._renderExpandCellHandler=$.proxy(this._renderExpandCell,this)}this._overrideFunctions();this._attachEvents();this.element.data($.ui.igGrid.prototype.widgetName,this.element.data($.ui.igTreeGrid.prototype.widgetName));this.options.dataSourceSettings.expandedKey=this.options.dataSourceSettings.propertyExpanded||this.options.dataSourceSettings.expandedKey;this.options.dataSourceSettings.dataLevelKey=this.options.dataSourceSettings.propertyDataLevel||this.options.dataSourceSettings.dataLevelKey;$.ui.igGrid.prototype._create.apply(this,arguments);this.element.attr("role","treegrid")},_changeLanguage:function(language){var self=this,i,f,features=this.options.features,featureInstance;this.options.language=language;for(i=0;i<features.length;i++){f=this.options.features[i];if(f&&f.name){featureInstance=this.element.data("igTreeGrid"+f.name)||this.element.data("igGrid"+f.name);if(featureInstance){featureInstance._setOptions({language:language})}}}this.container().find("[data-expand-button]").each(function(){self._changeLocaleForElement($(this))})},_checkForUnsoppertedScenarios:function(){if(this._rowVirtualizationEnabled()&&this.options.virtualizationMode==="fixed"){throw new Error(this._getLocaleValue("fixedVirtualizationNotSupported"))}},_wrapElementDiv:function(){$.ui.igGrid.prototype._wrapElementDiv.apply(this,arguments);this.element.data($.ui.igTreeGrid.prototype.widgetName,this);this._overrideFunctions()},_removeOverridenFunction:function(){if(!this._functionsOverriden){return}var f,funcs=this._functionsOverriden;for(f in funcs){if(funcs.hasOwnProperty(f)){this.element[f]=funcs[f]}}delete this._functionsOverriden},_overrideFunctions:function(){this._overrideFunction("bind");this._overrideFunction("unbind");this._overrideFunction("on");this._overrideFunction("off")},_overrideFunction:function(functionName){var e=this.element,func;if($.type(e[functionName])!=="function"){return}if(!this._functionsOverriden){this._functionsOverriden={}}func=e[functionName];if(!this._functionsOverriden[functionName]){this._functionsOverriden[functionName]=func}e[functionName]=function(name,arg1,arg2){var strIgGrid="iggrid",argsLen=arguments.length,evtName,oEvtName;if($.type(name)==="string"&&name.indexOf(strIgGrid)===0&&name.length>strIgGrid.length&&(argsLen===2||argsLen===3)){name="igtreegrid"+name.substr(strIgGrid.length);if(argsLen===2){return func.call(e,name,arg1)}return func.call(e,name,arg1,arg2)}else if($.type(name)==="object"){for(evtName in name){if(name.hasOwnProperty(evtName)){if($.type(evtName)==="string"&&evtName.indexOf(strIgGrid)===0){oEvtName=evtName;evtName="igtreegrid"+evtName.substr(strIgGrid.length);name[evtName]=name[oEvtName]}}}}return func.apply(e,arguments)}},_updateParentRowAfterDelete:function($pRow,dataLevel){var dl,found,rowId,children,ds=this.dataSource,primaryKeyCol,rec,identation=this.dataSource.getDataBoundDepth();if(isNaN(dataLevel)||dataLevel<=0){return}while($pRow.length===1){dl=parseInt($pRow.attr("aria-level"),10);if(isNaN(dl)){break}if(dl<dataLevel){found=true;break}$pRow=$pRow.prev("tr")}if(found){rowId=$pRow.attr("data-id");primaryKeyCol=this.columnByKey(this.options.primaryKey);if(primaryKeyCol.dataType==="number"||primaryKeyCol.dataType==="numeric"){rec=ds.findRecordByKey(parseInt(rowId,10))}else{rec=ds.findRecordByKey(rowId)}if(rec){children=rec[this.options.childDataKey];if(!children||children.length===0){if(this.hasFixedColumns()){$pRow=this.container().find('tr[data-id="'+rowId+'"]')}$pRow.find("span[data-expandcell-indicator]").empty();$pRow.find("td[data-expand-cell]").removeAttr("data-expand-cell")}}}this._rerenderDataSkipColumn(identation)},rollback:function(rowId,updateUI){var transactions=$.ui.igGrid.prototype.rollback.apply(this,arguments),transaction,i,tridx,tr,prevTr,dataLevel;if(updateUI===true){if(rowId!==null&&rowId!==undefined){if(transactions===null||transactions===undefined||transactions.length===0){return}i=transactions.length;while(i-- >0){transaction=transactions[i];tr=this.element.find("tr[data-id='"+transaction.rowId+"']");if(transaction.type==="insertnode"){tridx=this.element.children("tbody").children("tr:not([data-container],[data-grouprow])").index(tr);prevTr=tr.prev("tr");dataLevel=parseInt(tr.attr("aria-level"),10);tr.remove();this._reapplyZebraStyle(tridx);this._updateParentRowAfterDelete(prevTr,dataLevel)}}}else{this.dataBind()}}return transactions},dataBind:function(){if(!this._initialized){this._renderExtraHeaderCellHandler=$.proxy(this._renderExtraHeaderCells,this);this._renderExtraFooterCellHandler=$.proxy(this._renderExtraFooterCells,this);this._headerInitCallbacks.push({type:"TreeGrid",func:this._renderExtraHeaderCellHandler});this._footerInitCallbacks.push({type:"TreeGrid",func:this._renderExtraFooterCellHandler})}else{if(this._inferOpType()==="remote"&&this.dataSource&&this.dataSource.schema()){this.dataSource._data=[]}}$.ui.igGrid.prototype.dataBind.apply(this,arguments)},_generateDataSourceOptions:function(){var o=this.options,ds=o.dataSource,instanceOfDs,tds,opts=$.ui.igGrid.prototype._generateDataSourceOptions.apply(this,arguments);opts.treeDS={childDataKey:o.childDataKey,initialExpandDepth:o.initialExpandDepth,foreignKey:o.foreignKey,foreignKeyRootValue:o.foreignKeyRootValue};opts.treeDS=$.extend(opts.treeDS,o.dataSourceSettings);opts.treeDS.enableRemoteLoadOnDemand=o.enableRemoteLoadOnDemand;opts.treeDS.dataSourceUrl=o.dataSourceUrl;if(o.dataSourceUrl===null&&typeof ds==="string"){opts.treeDS.dataSourceUrl=ds}instanceOfDs=ds&&typeof ds._xmlToArray==="function"&&typeof ds._encodePkParams==="function";if(instanceOfDs){if(ds._isHierarchicalDataSource!==undefined){ds.settings.treeDS=ds.settings.treeDS||{};ds.settings.treeDS=$.extend(ds.settings.treeDS,opts.treeDS)}else{if($.type(ds.settings.dataSource)==="array"||$.type(ds.settings.dataSource)==="object"){tds=ds.settings.dataSource}else if($.type(ds.settings.dataSource)!=="string"){tds=ds.data()}else{tds=[]}ds.settings.dataSource=null;ds.settings.data=null;if(opts&&opts.dataSource){opts.dataSource=null}opts=$.extend(true,{},ds.settings,opts);opts.dataSource=tds;tds=null;o.dataSource=new $.ig.TreeHierarchicalDataSource(opts)}}else{opts.dataSource=ds}if(o.dataSourceType!==null){opts.type=o.dataSourceType}return opts},_getDataColumns:function(cols){var i,j,res=[],colsLength=cols.length,dCols;for(i=0;i<colsLength;i++){if(cols[i].group!==undefined&&cols[i].group!==null){dCols=this._getDataColumns(this._getDataColumns(cols[i].group));for(j=0;j<dCols.length;j++){res.push(dCols[j])}}else{res.push(cols[i])}}return res},_generateDataSourceSchema:function(){var schema,i,j,rec,prop,cols=this._getDataColumns(this.options.columns),k,c,ds=this.options.dataSource;if(cols.length>0){schema={};schema.fields=[];j=0;for(i=0;i<cols.length;i++){if(cols[i].unbound===true){continue}schema.fields[j]={};schema.fields[j].name=cols[i].key;schema.fields[j].type=cols[i].dataType;schema.fields[j].mapper=cols[i].mapper;j++}}else if(this.options.autoGenerateColumns){schema={};schema.fields=[];if($.type(ds)==="string"&&this.dataSource){ds=this.dataSource.data()}if(ds&&ds.length&&$.type(ds)==="array"){rec=ds[0];for(prop in rec){if(rec.hasOwnProperty(prop)){for(k=0;k<cols;k++){if(cols[k].key===prop){c=cols[k];break}}if(_aNull(c)){schema.fields.push({name:prop,type:$.ig.getColType(rec[prop])})}else{if(c.unbound===true){continue}schema.fields.push({name:prop,type:c.dataType})}}}}}if(schema){schema.searchField=this.options.responseDataKey}this._trigger(this.events.schemaGenerated,null,{owner:this,schema:schema,dataSource:ds});return schema},_createDataSource:function(dataOptions){var ds=this.options.dataSource,currentDataSource;if(!ds||typeof ds._xmlToArray!=="function"||typeof ds._encodePkParams!=="function"){currentDataSource=new $.ig.TreeHierarchicalDataSource(dataOptions)}else{currentDataSource=$.ui.igGrid.prototype._createDataSource.apply(this,arguments)}return currentDataSource},_containersRendered:function(){if(this.options.renderExpansionIndicatorColumn){this._addDataSkipColumn()}},_renderData:function(){var i=this._initialized;$.ui.igGrid.prototype._renderData.apply(this,arguments);if(!i){this._bindEvtsToExpIndicators()}},_bindEvtsToExpIndicators:function(){var $cont=this.container(),selector;if(!this.options.renderExpansionIndicatorColumn){selector="tbody>tr>td>span[data-expandcell-indicator]"}else{selector="td[data-expand-cell=1]"}$cont.off(".toggleTreegrid");$cont.on({"mouseup.toggleTreegrid":$.proxy(this._onMouseUpExpander,this),"keydown.toggleTreegrid":$.proxy(this._onKeyDownExpander,this),"click.toggleTreegrid":function(e){e.stopPropagation()}},selector)},_getTotalRowCount:function(){return this._getDataView().length},_getDataView:function(){return this.dataSource.flatDataView()},_renderVirtualRecordsContinuous:function(from){var to,$scrollContainer,scrllToBttm=false,$ae,$cell,$row,rowId,cellInd,$tr;if(_aNull(from)){$.ui.igGrid.prototype._renderVirtualRecordsContinuous.apply(this,arguments)}else{this._totalRowCount=this._getTotalRowCount();if(from>this._totalRowCount){return $.ui.igGrid.prototype._renderVirtualRecordsContinuous.apply(this,arguments)}this._virtualRowCount=this._determineVirtualRowCount();if(this._virtualRowCount>this._totalRowCount){this._virtualRowCount=this._totalRowCount}to=from+parseInt(this._virtualRowCount,0);if(to>this._totalRowCount){to=this._totalRowCount-1;from=to-this._virtualRowCount;scrllToBttm=true;if(from<0){from=0}}$ae=$(document.activeElement);$cell=$ae.closest("td");$row=$ae.closest("tr");cellInd=$cell.index();rowId=$row.attr("id");this._renderRecords(from,to);this._avgRowHeight=this._calculateAvgRowHeight();this._setScrollContainerHeight(this._totalRowCount*this._avgRowHeight);if(scrllToBttm){$scrollContainer=this._scrollContainer();$scrollContainer[0].scrollTop=this._totalRowCount*this._avgRowHeight+1}if(rowId){$tr=$("#"+rowId.replace(/(:|\.|\[|\]|,|\/)/g,"\\$1"));if($tr.length){if($ae.is("tr")){$ae=$tr;$tr.focus()}else if($ae.is("td")){$ae=$tr.children("td:nth-child("+(cellInd+1)+")");$ae.focus()}else if($ae.attr("data-expand-button")!==undefined){$ae=$tr.find("[data-expand-button]");$ae.focus()}this._fireInternalEvent("_virtualRecordsRendered",{row:$tr,activeElement:$ae,cellInd:cellInd})}}}},_rerenderDataSkipColumn:function(){var $cntnr=this.container();$cntnr.find("thead").find("th").find("[data-treegrid-th]").remove();this._rerenderColgroups();if(this.options.width===null){this._updateContainersWidthOnGridWidthNull()}else{this._adjustLastColumnWidth(true)}},_addDataSkipColumn:function(dbd){if(!this.options.renderExpansionIndicatorColumn){return}var optInd=this.options.indentation,indent,$thDataSkip,$gridColgroup,$headersTbl,$footersTbl,cf;if(_aNull(dbd)){dbd=this.options.initialIndentationLevel>0?this.options.initialIndentationLevel:this.dataSource.getDataBoundDepth()}dbd=dbd||1;if(dbd>=0){indent=parseInt(optInd,10)*dbd;if(optInd&&optInd.indexOf&&optInd.indexOf("%")>=0){indent=indent+"%"}cf=this.hasFixedColumns()&&this.fixingDirection()==="left";if(cf){$gridColgroup=this.fixedBodyContainer().find("colgroup:first")}else{$gridColgroup=this.element.find("colgroup:first")}this._addColHelper($gridColgroup,indent);if(cf){$headersTbl=this.fixedHeadersTable()}else{$headersTbl=this.headersTable()}if($headersTbl.attr("id")!==this.element.attr("id")){this._addColHelper($headersTbl.find("colgroup:first"),indent)}if(cf){$footersTbl=this.fixedFootersTable()}else{$footersTbl=this.footersTable()}if($footersTbl.attr("id")!==this.element.attr("id")){this._addColHelper($footersTbl.find("colgroup"),indent)}if(!$headersTbl.find("> thead th[data-treegrid-th]").length){if(!$headersTbl.find("> thead tr:nth-child(1) th.ui-iggrid-rowselector-header").length){$thDataSkip=$("<th></th>").prependTo($headersTbl.find("> thead tr:nth-child(1)"))}else{$thDataSkip=$("<th></th>").insertAfter($headersTbl.find("> thead tr:nth-child(1) th.ui-iggrid-rowselector-header"))}$thDataSkip.addClass(this.css.expandHeaderCell).attr("data-skip",true).attr("data-treegrid-th",true);if(this._isMultiColumnGrid){$thDataSkip.attr("rowspan",this._maxLevel+1)}}}},_addColHelper:function($colgroup,width){var $col=$colgroup.find("col[data-treegrid-col]");if($col.length===0){$col=$("<col />").prependTo($colgroup).attr("data-skip","true").attr("data-treegrid-col","true")}if(width){$col.width(width)}},_renderHeader:function(){$.ui.igGrid.prototype._renderHeader.apply(this,arguments);this.container().addClass(this.css.containerClasses)},_getHtmlForDataView:function(ds,isFixed,start,end){var i,dsLen,html="";ds=ds||this._getDataView();dsLen=ds.length;if(start===undefined){start=0;end=dsLen-1}if(start!==undefined&&end===undefined){end=start;start=0}start=start<0?0:start;end=end>dsLen-1?dsLen-1:end;for(i=start;i<=end;i++){html+=this._renderRecord(ds[i],i,isFixed)}return html},_renderRecord:function(data,rowIndex,isFixed,rowData){return this._renderRecordInternal(data,rowIndex,isFixed,rowData)},_renderRecordInternal:function(data,rowIndex,isFixed,rowData){var html="",markup,isContainerOnTheLeft,idxStart,children,hasChildren,o=this.options,key=this.options.primaryKey,dataBoundDepth,cssClass,id=this.id(),owns="";if(!rowData){children=data[o.childDataKey];hasChildren=children&&(children===true||$.type(children)==="array"&&(o.enableRemoteLoadOnDemand||children.length>0));rowData={dataBoundDepth:data[o.dataSourceSettings.dataLevelKey],parentCollapsed:false,hasExpandCell:hasChildren,children:children,expand:data[o.dataSourceSettings.expandedKey]}}dataBoundDepth=rowData.dataBoundDepth;cssClass=this.css.rowLevel+dataBoundDepth;html+="<tr";if(rowIndex%2!==0&&this.options.alternateRowStyles){cssClass+=" "+this.css.recordAltClass}if(this._transformCssCallback){cssClass=this._transformCssCallback(cssClass,data)}html+=' class="'+cssClass+'" data-row-idx="'+rowIndex+'" aria-level="'+dataBoundDepth+'"';if(!_aNull(key)){html+=' data-id="'+this._kval_from_key(key,data)+'" id="'+id+"_"+this._kval_from_key(key,data)+'"'}else if(!_aNull(data.ig_pk)){html+=' data-id="'+data.ig_pk+'" id="'+id+"_"+data.ig_pk+'"'}if(rowData.parentCollapsed&&dataBoundDepth>0){html+=' style="display: none;"'}if(rowData.hasExpandCell){$(rowData.children).each(function(){owns+=id+"_"+this[key]+" "});owns=owns.trimEnd();if(owns!==""){html+=' aria-owns="'+owns}html+='" aria-expanded="'+rowData.expand+'"'}html+=' role="row" tabIndex="'+this.options.tabIndex+'">';isContainerOnTheLeft=this._isDataContainerOnTheLeft(isFixed);if(this._shouldRenderDataSkipColumn(isFixed)){if(this._selection&&this._selection instanceof $.ig.SelectedRowsCollection){html+=this._editCellStyle(this._renderExpandCellHandler(rowData),data,key)}else{html+=this._renderExpandCellHandler(rowData)}}markup=$.ui.igGrid.prototype._renderRecord.call(this,data,rowIndex,isFixed);if(isContainerOnTheLeft){html+=this._renderFirstDataCellHandler(markup,rowData)}else{idxStart=markup.indexOf("<td");html+=markup.substring(idxStart)}return html},_shouldRenderDataSkipColumn:function(isFixed){var fdLeft;if(!this.options.renderExpansionIndicatorColumn){return false}if(!this.hasFixedColumns()){return true}fdLeft=this.fixingDirection()==="left";if(!isFixed&&fdLeft&&this._isFixedNonDataColumnsOnly()){return false}return this._isDataContainerOnTheLeft(isFixed)},_renderFirstDataCell:function(markup,rowData){var newTDSmarkup="",idxStart,TDSmarkup,tdContentFirstInd,otherTDSmarkup,classIdx;idxStart=markup.indexOf("<td");if(idxStart===-1){return""}TDSmarkup=markup.substring(idxStart);tdContentFirstInd=TDSmarkup.indexOf(">",2);otherTDSmarkup=TDSmarkup.substring(tdContentFirstInd+1);newTDSmarkup=TDSmarkup.substring(0,tdContentFirstInd);if(this.options.renderExpansionIndicatorColumn){newTDSmarkup+=' data-cell-shift-container="1">'}else{classIdx=newTDSmarkup.indexOf('class="');if(classIdx>-1){newTDSmarkup=newTDSmarkup.substring(0,classIdx+7)+this.css.expandColumn+" "+newTDSmarkup.substr(classIdx+7)}else{newTDSmarkup+=' class="'+this.css.expandColumn+'"'}newTDSmarkup+=' data-expand-cell="1">'}newTDSmarkup+=this._renderExpandCellContainer(rowData);newTDSmarkup+=otherTDSmarkup;return newTDSmarkup},_renderExpandCellContainer:function(rowData){var span="",margin,dataBoundDepth=rowData.dataBoundDepth;margin=dataBoundDepth>0?parseInt(this.options.indentation,10)*dataBoundDepth:0;if(this.options.renderExpansionIndicatorColumn){span='<span class="'+this.css.dataColumnExpandContainer+'" data-shift-container="1" style="display: inline-block; margin-left:'+margin+'px;"></span>'}else{span=this._renderExpandCellContainerHelper(rowData)}return span},_renderExpandCellContainerHelper:function(rowData){var span="",css,title,margin,dataBoundDepth=rowData.dataBoundDepth,cssEC=this.css.expandContainer,renderExpandButton=rowData.hasExpandCell;if(this.options.renderExpansionIndicatorColumn){cssEC=this.css.expandColumnContainer}margin=dataBoundDepth>0?parseInt(this.options.indentation,10)*dataBoundDepth:0;if($.type(this.options.indentation)==="string"&&this.options.indentation.indexOf("%")>0){margin+="%"}else{margin+="px"}span='<span data-expandcell-indicator="1" class="'+cssEC+'" style="padding-left:'+margin+';">';if(renderExpandButton&&this.options.showExpansionIndicator){if(rowData.expand){css=this.css.expandCellExpanded;title=this._getLocaleValue("collapseTooltip")}else{css=this.css.expandCellCollapsed;title=this._getLocaleValue("expandTooltip")}span+='<span data-expand-button class="'+css+'" title="'+title+'" tabIndex="'+this.options.tabIndex+'"'+" data-localeid='"+(rowData.expand?"collapseTooltip":"expandTooltip")+"'"+" data-localeattr='title'"+"></span>"}span+="</span>";return span},_renderExpandCell:function(rowData){if(!rowData.hasExpandCell){return this._renderDataSkipCell()}var html,css;css=(this.css.expandColumn+" "+this.css.dataSkipCell).trim();html='<td class="'+css+'" data-expand-cell="1" data-skip="true" tabIndex="'+this.options.tabIndex+'">';if(this.options.showExpansionIndicator){html+=this._renderExpandCellContainerHelper(rowData)}return html+"</td>"},_renderDataSkipCell:function(){return'<td class="'+this.css.dataSkipCell+'" data-skip="true" tabIndex="'+this.options.tabIndex+'"></td>'},_rerenderColgroups:function(){$.ui.igGrid.prototype._rerenderColgroups.apply(this,arguments);this._addDataSkipColumn()},_columnsGenerated:function(){var cols=this.options.columns,key,i,sDS=this.options.dataSourceSettings,arrSkipColumns=[this.options.childDataKey,sDS.expandedKey,sDS.dataLevelKey];for(i=0;i<cols.length;i++){key=cols[i].key;if($.inArray(key,arrSkipColumns)!==-1){$.ig.removeFromArray(cols,i);i--}}},_rowVirtualizationEnabled:function(){return this.options.rowVirtualization||this.options.virtualization},_rerenderGridRowsOnToggle:function(){var virtualizationEnabled=this._rowVirtualizationEnabled(),dsSettings=this.dataSource.settings;return dsSettings.paging.enabled&&dsSettings.treeDS.paging.mode!=="rootLevelOnly"||virtualizationEnabled},_onDataRecordToggled:function(rec,expand,res,args){if(!res||!args){return}var flatData,html,level,dataIdx,diff,triggerEvents,$row,callAsync=false,$firstRow,rowObj,$fRow,$ufRow,$curRow,offsetTop,customCallback,$this=this,fRows,ufRows,eArgs,$scrollContainer,owner=this,id=$(this.element).attr("id"),ariaOwns="";$row=args.row;triggerEvents=args.triggerEvents;customCallback=args.customCallback;rowObj=this._getRows($row);$fRow=rowObj.fixedRow;$ufRow=rowObj.unfixedRow;level=parseInt($row.attr("aria-level"),10);eArgs={owner:this,row:$ufRow,fixedRow:$fRow,dataLevel:level,dataRecord:rec};this._loadingIndicator.hide();if(!this._rerenderGridRowsOnToggle()){if(expand&&!$row.attr("data-populated")){if(rec){this._toggleRowSuccessors($ufRow);$ufRow.add($fRow).attr("data-populated","1");flatData=this.dataSource.getFlatDataForRecord(rec,level+1);$(rec[this.options.childDataKey]).each(function(){ariaOwns+=id+"_"+this[owner.options.primaryKey]+" "});ariaOwns=ariaOwns.trimEnd();if(flatData&&flatData.flatVisibleData){html=this._getHtmlForDataView(flatData.flatVisibleData,false);ufRows=$(html).insertAfter($ufRow);$ufRow.attr("aria-owns",ariaOwns);if($fRow){html=this._getHtmlForDataView(flatData.flatVisibleData,true);fRows=$(html).insertAfter($fRow);$fRow.attr("aria-owns",ariaOwns)}this._trigger("_buildDOMOnToggle",this,{fRows:fRows,ufRows:ufRows})}}}else{this._toggleRowSuccessors($row)}}else{if(this._rowVirtualizationEnabled()&&this.options.virtualizationMode==="continuous"){$scrollContainer=this._scrollContainer();if($row.length){$firstRow=$row.closest("tbody").children("tr[data-row-idx]:first");if(!$firstRow.length){return}dataIdx=$firstRow.attr("data-row-idx");offsetTop=$row.igOffset().top;this._renderVirtualRecordsContinuous(parseInt(dataIdx,10));this._updateVirtualScrollContainer();this._trigger("virtualrecordsrender",null,{owner:this,dom:this._virtualDom});if(!expand){$curRow=$("#"+this.id()+" > tbody > tr[data-row-idx="+$row.attr("data-row-idx")+"]");diff=$curRow.igOffset().top-offsetTop;if(Math.abs(diff)>1){callAsync=true;setTimeout(function(){$scrollContainer[0].scrollTop=$scrollContainer.scrollTop()+diff},50)}}}else{callAsync=true;this._updateVirtualScrollContainer()}}}if(callAsync){setTimeout(function(){$this._callDataToggledEventsAndCallbacks(customCallback,expand,eArgs,triggerEvents);$this._refreshIgScrollBars()},55)}else{this._callDataToggledEventsAndCallbacks(customCallback,expand,eArgs,triggerEvents);this._refreshIgScrollBars()}},_avgRowHeightChanged:function(){var top=this._getScrollContainerScrollTop(),h=this._getScrollContainerHeight();this._updateVirtualScrollContainer();this._correctVirtVertScrollTop(top,h)},_callDataToggledEventsAndCallbacks:function(customCallback,expand,eArgs,triggerEvents){var hasHeight=this.options.height&&parseInt(this.options.height,10)>0,isVirt=this.options.virtualization===true||this.options.columnVirtualization===true||this.options.rowVirtualization===true;if(customCallback){$.ig.util.invokeCallback(customCallback,[this,{unfixedRow:eArgs.row,fixedRow:eArgs.fixedRow},eArgs.dataRecord,expand])}if(hasHeight&&!isVirt&&this._hasVerticalScrollbar!==this.hasVerticalScrollbar()){this._adjustLastColumnWidth()}if(expand){this._fireInternalEvent("_rowExpanded",eArgs)}else{this._fireInternalEvent("_rowCollapsed",eArgs)}if(triggerEvents){if(expand){this._trigger(this.events.rowExpanded,null,eArgs)}else{this._trigger(this.events.rowCollapsed,null,eArgs)}}},toggleRow:function(row,callback){var $row,state,expand,ds=this.dataSource;if(row instanceof $){$row=row}else{$row=this.element.find("tr[data-id="+row+"]")}state=$row.attr("aria-expanded");if(!$row.length){expand=!ds.getExpandStateById(row)}else{expand=state==="false"}this._expandCollapseRow(row,expand,false,callback)},expandRow:function(row,callback){this._expandCollapseRow(row,true,false,callback)},collapseRow:function(row,callback){this._expandCollapseRow(row,false,false,callback)},_onMouseUpExpander:function(event){var $et=$(event.target);if($et.attr("data-expandcell-indicator")!==undefined){$et.find("[data-expand-button]").focus()}this._toggleRow($et.closest("tr"))},_onKeyDownExpander:function(event){if(event.keyCode===$.ui.keyCode.ENTER||event.keyCode===$.ui.keyCode.SPACE){this._toggleRow($(event.target).closest("tr"));event.preventDefault();event.stopPropagation()}},_toggleRow:function($row){if(!$row.length){return}var state=$row.attr("aria-expanded"),expand;if(state===undefined){return}expand=state==="false"||state==="0";this._expandCollapseRow($row,expand,true)},_expandCollapseRow:function(row,expand,triggerEvents,callback){var primaryKeyCol,noCancel=true,func,args,callbackArgs,rowId,$row,me=this,rows,$fRow,$ufRow,isExpanded=expand,$tr,$ae,$cell,cellInd;if(row instanceof $){$row=row;if(!_aNull(this.options.primaryKey)){primaryKeyCol=this.columnByKey(this.options.primaryKey);rowId=$row.attr("data-id");if(primaryKeyCol&&(primaryKeyCol.dataType==="number"||primaryKeyCol.dataType==="numeric")){rowId=parseInt(rowId,10)}}else{rowId=$row.index()}}else{rowId=row;$row=this.element.find("tr[data-id="+row+"]")}if($row.length===1&&$row.attr("aria-expanded")===isExpanded.toString()){return}func=$.proxy(this._onDataRecordToggled,this);callbackArgs={callback:func,args:{row:$row,triggerEvents:triggerEvents}};if(callback){callbackArgs.args.customCallback=callback}rows=this._getRows($row);$fRow=rows.fixedRow;$ufRow=rows.unfixedRow;args={owner:this,row:$ufRow,fixedRow:$fRow,dataLevel:parseInt($row.attr("aria-level"),10)};if(triggerEvents){if(expand){noCancel=this._trigger(this.events.rowExpanding,null,args)}else{noCancel=this._trigger(this.events.rowCollapsing,null,args)}}if(noCancel){this._loadingIndicator.show();$ae=$(document.activeElement);$cell=$ae.closest("td");cellInd=$cell.index();me.dataSource.setExpandedStateByPrimaryKey(rowId,expand,callbackArgs);if(me._rerenderGridRowsOnToggle()){$tr=me.element.find('[data-id="'+rowId+'"]');if($tr.length){if($ae.is("tr")){$ae=$tr;$tr.focus()}if($ae.is("td")){$ae=$tr.children("td:nth-child("+(cellInd+1)+")");$ae.focus()}else if($ae.attr("data-expand-button")!==undefined){$ae=$tr.find("[data-expand-button]");$ae.focus()}}}}},_toggleRowSuccessors:function($row){var $nextRow=$row,foundUpperLevel=false,dL,$fRow,$ufRow=$row,levelCollapsed=null,$container,dataBoundDepth=parseInt($row.attr("aria-level"),10),isExpanded=$row.attr("aria-expanded"),styleDisplay="",expanded=isExpanded==="true";if(expanded){styleDisplay="none"}if(this.hasFixedColumns()){if(this._isFixedElement($row)){$fRow=$row;if(this._rowVirtualizationEnabled()){$container=this._vdisplaycontainer()}else{$container=this.scrollContainer()}$ufRow=$container.find("tbody > tr").eq($row.index())}else{$fRow=this.fixedBodyContainer().find("tbody > tr").eq($row.index())}}while($nextRow.length===1&&!foundUpperLevel){$nextRow=$nextRow.next("tr[aria-level]");dL=parseInt($nextRow.attr("aria-level"),10);if(isNaN(dL)||dL<=dataBoundDepth){foundUpperLevel=true;break}if(!expanded){if(levelCollapsed!==null){if(dL<=levelCollapsed){levelCollapsed=null}else{continue}}if($nextRow.attr("aria-expanded")==="false"){levelCollapsed=dL}}this._showHideRow($nextRow,styleDisplay)}if(expanded){$ufRow.add($fRow).attr({"data-populated":"1","aria-expanded":false}).find("[data-expand-button]").attr({title:this._getLocaleValue("expandTooltip"),"data-localeid":"expandTooltip","data-localeattr":"title"}).removeClass(this.css.expandCellExpanded).addClass(this.css.expandCellCollapsed)}else{$ufRow.add($fRow).attr("aria-expanded",true).find("[data-expand-button]").attr({title:this._getLocaleValue("collapseTooltip"),"data-localeid":"collapseTooltip","data-localeattr":"title"}).removeClass(this.css.expandCellCollapsed).addClass(this.css.expandCellExpanded)}},_showHideRow:function($row,styleDisplay){var rows,$ufRow=$row,$fRow,fixedColumns=this.hasFixedColumns();if(fixedColumns){rows=this._getRows($row);$fRow=rows.fixedRow;$ufRow=rows.unfixedRow}$ufRow.css("display",styleDisplay);if($fRow){$fRow.css("display",styleDisplay)}if(styleDisplay===""){this._trigger("_rowShown",this,{fRow:$fRow,ufRow:$ufRow})}else{this._trigger("_rowHidden",this,{fRow:$fRow,ufRow:$ufRow})}},_renderExtraHeaderCells:function(row,colgroup,prepend){if(!this.options.renderExpansionIndicatorColumn){return}if(prepend===true){$("<td></td>").prependTo(row).css("border-width",0).attr("data-skip",true);if(colgroup){$("<col />").prependTo(colgroup).attr("data-skip",true).css("width",this.options.indentation)}}else{$("<td></td>").appendTo(row).css("border-width",0).attr("data-skip",true);if(colgroup){$("<col />").appendTo(colgroup).attr("data-skip",true).css("width",this.options.indentation)}}},_isFixedNonDataColumnsOnly:function(){if(this.hasFixedColumns()&&(!this._fixedColumns||!this._fixedColumns.length)){return true}return false},_isDataContainerOnTheLeft:function(isFixed){var fdLeft=this.fixingDirection()==="left";if(!this.hasFixedColumns()){return true}if($.type(this._fixedColumns)==="array"&&!this._fixedColumns.length){return true}if(isFixed){return fdLeft}return!fdLeft},_getRows:function($row){var index,$fRow,$ufRow=$row;if(this.hasFixedColumns()){index=$row.index();if(this._isFixedElement($row)){$fRow=$row;$ufRow=$(this.rowAt(index))}else{$fRow=$(this.fixedRowAt(index))}}return{fixedRow:$fRow,unfixedRow:$ufRow}},_renderRow:function(rec,tr){var funcCallbak;funcCallbak=function(rec,tr){return $.ui.igGrid.prototype._renderRow.call(this,rec,tr)};return this._persistExpansionIndicator(rec,tr,funcCallbak,this)},renderNewChild:function(rec,parentId){var tbody=this.element.children("tbody"),tbodyFixed=this.fixedBodyContainer().find("tbody"),virt=this.options.virtualization===true||this.options.rowVirtualization===true,prevRow,dlprop=this.options.dataSourceSettings.dataLevelKey,dl,parent,rowData,fixing=this.hasFixedColumns(),unfixedRow,fixedRow,dataId,index=this._recordIndexInFlatView(rec[this.options.primaryKey]);if(parentId===undefined||parentId===null){this.renderNewRow(rec)}else{if(virt){this._renderVirtualRecordsContinuous();this._startRowIndex=0;this.virtualScrollTo(index)}else{parent=this.dataSource.findRecordByKey(parentId);if(parent===null){throw new Error(this._getLocaleValue("recordNotFound").replace("{id}",parentId))}parent[this.options.dataSourceSettings.expandedKey]=true;this.dataSource.generateFlatDataView();dl=parent[dlprop]+1;prevRow=this.rowById(parentId);while(prevRow.nextAll(":not(.ui-iggrid-addrow)").first().length>0){if(parseInt(prevRow.nextAll(":not(.ui-iggrid-addrow)").first().attr("aria-level"),10)>=dl){prevRow=prevRow.nextAll(":not(.ui-iggrid-addrow)").first()}else{break}}prevRow=prevRow?prevRow:this.rowById(parentId);rowData={dataBoundDepth:dl};dataId=prevRow.attr("data-id");this._fireInternalEvent("_childRowRendering",{id:rec[this.options.primaryKey],parentId:parentId});unfixedRow=this._renderRecord(rec,prevRow.index()+1,false,rowData);if(fixing){fixedRow=this._renderRecord(rec,prevRow.index()+1,true,rowData)}if(prevRow.length>0){$(prevRow).after(unfixedRow);if(fixing){tbodyFixed.find("tr[data-id="+dataId+"]").after(fixedRow);
}}else{tbody.append(unfixedRow);if(fixing){tbodyFixed.append(fixedRow)}}}}},_recordIndexInFlatView:function(rowId){var dv=this.dataSource.flatDataView(),pk=this.options.primaryKey,index=-1;for(var i=0;i<dv.length;i++){if(dv[i][pk]===rowId){index=i;break}}return index},_persistExpansionIndicator:function(rec,tr,funcCallback,funcCallee){var $td,trRes=tr,$tr=$(tr),$span,renderEC=this.options.renderExpansionIndicatorColumn;if(renderEC){$span=$tr.find("span[data-shift-container]");$td=$span.closest("td")}else{$span=$tr.find("[data-expandcell-indicator]");$td=$span.closest("td");$span.detach()}if(funcCallback&&funcCallee){trRes=funcCallback.call(funcCallee,rec,tr);$tr=$(trRes)}if($span.length>0){$span.prependTo($td)}return trRes},_detachEvents:function(){if(this._columnsGeneratedHandler){this.element.unbind("igtreegrid_columnsgenerated",this._columnsGeneratedHandler)}if(this._containersRenderedHandler){this.element.unbind("iggrid_gridcontainersrendered",this._containersRenderedHandler)}if(this._avgRowHeightChangedHandler){this.element.unbind("iggridavgrowheightchanged",this._avgRowHeightChangedHandler)}$.ui.igGrid.prototype._detachEvents.apply(this,arguments)},_attachEvents:function(){this._columnsGeneratedHandler=$.proxy(this._columnsGenerated,this);this.element.bind("igtreegrid_columnsgenerated",this._columnsGeneratedHandler);this._containersRenderedHandler=$.proxy(this._containersRendered,this);this.element.bind("iggrid_gridcontainersrendered",this._containersRenderedHandler);if(this.options.virtualization||this.options.rowVirtualization){this._avgRowHeightChangedHandler=$.proxy(this._avgRowHeightChanged,this);this.element.bind("iggridavgrowheightchanged",this._avgRowHeightChangedHandler)}},_initFeature:function(featureObject){if(!featureObject){return}if(featureObject.name===undefined){return}var widgetTreeGrid="igTreeGrid"+featureObject.name;if($.type(this.element[widgetTreeGrid])==="function"){if(this.element.data(widgetTreeGrid)){this.element[widgetTreeGrid]("destroy")}featureObject.language=this.options.language;this.element[widgetTreeGrid](featureObject);this.element.data(widgetTreeGrid)._injectGrid(this)}else{return $.ui.igGrid.prototype._initFeature.apply(this,arguments)}},_destroyFeatures:function(){var i,features=this.options.features,e=this.element;for(i=0;i<features.length;i++){if(e.data("igTreeGrid"+features[i].name)){e["igTreeGrid"+features[i].name]("destroy")}else if(e.data("igGrid"+features[i].name)){e["igGrid"+features[i].name]("destroy")}}},destroy:function(){this._detachEvents();this._superApply(arguments);this.element.removeData($.ui.igGrid.prototype.widgetName);this._removeOverridenFunction();return this}});$.extend($.ui.igTreeGrid,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI Tree Grid 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.dataSource.js
 *	infragistics.ui.shared.js
 *	infragistics.ui.treegrid.js
 *	infragistics.util.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.grid.columnfixing.js
 */
(function($){$.widget("ui.igTreeGridColumnFixing",$.ui.igGridColumnFixing,{_create:function(){this.element.data($.ui.igGridColumnFixing.prototype.widgetName,this.element.data($.ui.igTreeGridColumnFixing.prototype.widgetName));$.ui.igGridColumnFixing.prototype._create.apply(this,arguments)},_syncHeigthsOnToggle:function(){if(!this.grid.hasFixedColumns()){return}this._checkAndRenderHScrlbarCntnr();this._syncContainersHeights();if($.ig.util.isIE&&$.ig.util.browserVersion>=9){this._syncTableHeights()}},_rowExpanded:function(){this._syncHeigthsOnToggle()},_rowCollapsed:function(){this._syncHeigthsOnToggle()},_renderFixedRecord:function(data,rowIndex,onlyRows,tr){if(onlyRows){return $.ui.igGridColumnFixing.prototype._renderFixedRecord.apply(this,arguments)}return this.grid._renderRecord(data,rowIndex,true)},_rowShown:function(e,args){if(!this.options.syncRowHeights||!this.grid.hasFixedColumns()){return}this.syncRowsHeights(args.fRow,args.ufRow)},_syncContainersHeights:function(){if(!this.grid.hasFixedColumns()){return}var grid=this.grid,id=grid.id(),scrollContainer;$("#"+id+"_fixedBodyContainer").find("table")[0].style.height="";if(grid._rowVirtualizationEnabled()){scrollContainer=grid._vdisplaycontainer()}else{scrollContainer=grid.scrollContainer()}if(scrollContainer.length===0){scrollContainer=grid.element}scrollContainer.find("table")[0].style.height=""},_renderRow:function(rec,tr,rowId){if(!this.grid.hasFixedColumns()){return $.ui.igGridColumnFixing.prototype._renderRow.apply(this,arguments)}var rows,$fRow,$ufRow,$tr=$(tr),col,funcCallback;rows=this.grid._getRows($tr);$fRow=rows.fixedRow;$ufRow=rows.unfixedRow;funcCallback=function(rec,tr){return this._updateRowContent(rec,tr)};this.grid._persistExpansionIndicator(rec,$fRow[0],funcCallback,this);this.grid._persistExpansionIndicator(rec,$ufRow[0],funcCallback,this)},_buildDOMOnToggle:function(e,args){if(!this.grid.hasFixedColumns()||!this.options.syncRowHeights){return}var $fRows=args.fRows,me=this,$ufRows=args.ufRows;if(!$fRows||!$ufRows||$fRows.length!==$ufRows.length){return}$fRows.each(function(ind){var $fRow=$($fRows[ind]),$ufRow=$($ufRows[ind]);me.syncRowsHeights($fRow,$ufRow)});this._syncHeigthsOnToggle()},_updateRowContent:function(rec,tr){var $this=this,grid=this.grid,$tr=$(tr),cells=$tr.children(":visible:not([data-skip])");cells.each(function(ind){var $td=$(this),content,col=grid.getColumnByTD($td);if(!col){return true}col=col.column;if(col.template&&col.template.length){content=grid._renderTemplatedCell(rec,col);if(content.indexOf("<td")===0){$td.html($(content).html())}else{$td.html(content)}}else{$td.html(String(grid._renderCell(rec[col.key],col,rec)))}});return tr},_fixedColumnsChanged:function(args){var $td,$span,rerender=false,$container;if(!this.grid._initialized||args.nonData){return}if(this.options.fixingDirection==="left"){$container=this.grid.fixedBodyContainer();if(!$container.length||!this.grid._fixedColumns||!this.grid._fixedColumns.length){$container=this.grid.element}}else{$container=this.grid.element}$td=$container.find("tbody>tr:first>td:not([data-skip])").eq(0);$span=$td.find("[data-shift-container],[data-expand-cell]");if($span.length===1){return}if(this._isContinuousVirtualization()){this.grid._renderVirtualRecords()}else{this.grid._renderRecords();this.grid._fireInternalEvent("_dataRendered")}},_detachEvents:function(){$.ui.igGridColumnFixing.prototype._detachEvents.apply(this,arguments);if(this._rowShownHandler){this.grid.element.unbind("igtreegrid_rowshown",this._rowShownHandler)}if(this._onColumnFixedHandler){this.grid.element.unbind("igtreegridcolumnfixing_columnfixed",this._onColumnFixedHandler)}if(this._onColumnUnfixedHandler){this.grid.element.unbind("igtreegridcolumnfixing_columnunfixed",this._onColumnUnfixedHandler)}if(this._buildDOMOnToggleHandler){this.grid.element.unbind("igtreegrid_builddomontoggle",this._buildDOMOnToggleHandler)}},_attachEvents:function(){this._rowShownHandler=$.proxy(this._rowShown,this);this.grid.element.bind("igtreegrid_rowshown",this._rowShownHandler);this._onColumnFixedHandler=$.proxy(this._onColumnFixed,this);this._onColumnUnfixedHandler=$.proxy(this._onColumnUnfixed,this);this.grid.element.bind("igtreegridcolumnfixing_columnfixed",this._onColumnFixedHandler);this.grid.element.bind("igtreegridcolumnfixing_columnunfixed",this._onColumnUnfixedHandler);this._buildDOMOnToggleHandler=$.proxy(this._buildDOMOnToggle,this);this.grid.element.bind("igtreegrid_builddomontoggle",this._buildDOMOnToggleHandler)},destroy:function(){this._superApply(arguments);this.element.removeData($.ui.igGridColumnFixing.prototype.widgetName)},_injectGrid:function(grid,isRebind){$.ui.igGridColumnFixing.prototype._injectGrid.apply(this,arguments);this._attachEvents()}});$.extend($.ui.igTreeGridColumnFixing,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI Tree Grid 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.dataSource.js
 *	infragistics.ui.shared.js
 *	infragistics.ui.treegrid.js
 *	infragistics.util.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.grid.filtering.js
 */
(function($){var _aNull=function(val){return val===null||val===undefined};$.widget("ui.igTreeGridFiltering",$.ui.igGridFiltering,{css:{recordMatchFiltering:"ig-igtreegrid-filter-matching-row",cellMatchFiltering:"ig-igtreegrid-filter-matching-cell",recordNotMatchFiltering:"ui-igtreegrid-record-not-matchfiltering"},options:{recordCountKey:null,fromLevel:0,toLevel:-1,displayMode:"showWithAncestors",matchFiltering:"__matchFiltering",filterSummaryInPagerTemplate:null,locale:{filterSummaryInPagerTemplate:undefined},inherit:false},_create:function(){this.element.data($.ui.igGridFiltering.prototype.widgetName,this.element.data($.ui.igTreeGridFiltering.prototype.widgetName));$.ui.igGridFiltering.prototype._create.apply(this,arguments)},_getFilterSummaryPagerTemplate:function(){var template=this._getLocaleValue("filterSummaryInPagerTemplate"),matchesCount,countMatchesPerPage=0;if(!template){return null}if(template.indexOf("${currentPageMatches}")>-1){countMatchesPerPage=this.grid.dataSource.getFilteredRecordsCountFromDataView();template=template.replace("${currentPageMatches}",countMatchesPerPage)}if(template.indexOf("${totalMatches}")>-1){matchesCount=this.getFilteringMatchesCount();template=template.replace("${totalMatches}",matchesCount)}return template},_transformCss:function(cssClass,dataRow){var matchFiltering,grid=this.grid,ds=grid.dataSource;if(this._gridTransformCssCallback){cssClass=this._gridTransformCssCallback.apply(grid,arguments)}if(this._filteringApplied()){matchFiltering=ds.settings.treeDS.filtering.matchFiltering;if(cssClass!==""){cssClass+=" "}if(!_aNull(matchFiltering)){if(dataRow[matchFiltering]){cssClass+=this.css.recordMatchFiltering}else{cssClass+=this.css.recordNotMatchFiltering}}}return cssClass},_filteringApplied:function(){var ds=this.grid.dataSource,expr=ds.settings.filtering.expressions;if(this.options&&this.options.type==="local"){return ds._filter}return expr&&expr.length},getFilteringMatchesCount:function(){var o=this.options,ds=this.grid.dataSource,matches;if(o.type==="local"||o.type==="remote"&&ds.hasTotalRecordsCount()===false){if(ds._filter){matches=ds.getFilteredRecordsCount()}else{matches=ds.flatDataView().length}}else{matches=ds.getFilteringMatchRecordsCount()}return matches},destroy:function(){this._superApply(arguments);this.element.removeData($.ui.igGridFiltering.prototype.widgetName)},_injectGrid:function(gridInstance,isRebind){var ds,o=this.options;$.ui.igGridFiltering.prototype._injectGrid.apply(this,arguments);if(!isRebind){if(this.grid._transformCssCallback){this._gridTransformCssCallback=this.grid._transformCssCallback}this.grid._transformCssCallback=$.proxy(this._transformCss,this)}ds=this.grid.dataSource;if(ds&&ds.settings&&ds.settings.treeDS){ds.settings.filtering.enabled=true;ds.settings.treeDS.filtering.fromLevel=o.fromLevel;ds.settings.treeDS.filtering.toLevel=o.toLevel;ds.settings.treeDS.filtering.displayMode=o.displayMode;ds.settings.treeDS.filtering.matchFiltering=o.matchFiltering}if(o.recordCountKey!==null){ds.settings.responseTotalRecCountKey=o.recordCountKey}}});$.extend($.ui.igTreeGridFiltering,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI Tree Grid 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.dataSource.js
 *	infragistics.ui.shared.js
 *	infragistics.ui.treegrid.js
 *	infragistics.util.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.grid.hiding.js
 */
(function($){$.widget("ui.igTreeGridHiding",$.ui.igGridHiding,{css:{},options:{inherit:false},_create:function(){this.element.data($.ui.igGridHiding.prototype.widgetName,this.element.data($.ui.igTreeGridHiding.prototype.widgetName));$.ui.igGridHiding.prototype._create.apply(this,arguments)},destroy:function(){this._superApply(arguments);this.element.removeData($.ui.igGridHiding.prototype.widgetName)},_injectGrid:function(){$.ui.igGridHiding.prototype._injectGrid.apply(this,arguments)}});$.extend($.ui.igTreeGridHiding,{version:"21.2.12"})})($);/*!@license
* Infragistics.Web.ClientUI Tree Grid 21.2.12
*
* Copyright (c) 2011-2022 Infragistics Inc.
*
* http://www.infragistics.com/
*
* Depends on:
*	jquery-1.9.1.js
*	jquery.ui.core.js
*	jquery.ui.widget.js
*	infragistics.dataSource.js
*	infragistics.ui.shared.js
*	infragistics.ui.treegrid.js
*	infragistics.util.js
*	infragistics.ui.grid.framework.js
*	infragistics.ui.grid.multicolumnheaders.js
*/
(function($){$.widget("ui.igTreeGridMultiColumnHeaders",$.ui.igGridMultiColumnHeaders,{css:{},options:{inherit:false},_create:function(){this.element.data($.ui.igGridMultiColumnHeaders.prototype.widgetName,this.element.data($.ui.igTreeGridMultiColumnHeaders.prototype.widgetName));$.ui.igGridMultiColumnHeaders.prototype._create.apply(this,arguments)},destroy:function(){this._superApply(arguments);this.element.removeData($.ui.igGridMultiColumnHeaders.prototype.widgetName)},_injectGrid:function(){$.ui.igGridMultiColumnHeaders.prototype._injectGrid.apply(this,arguments)}});$.extend($.ui.igTreeGridMultiColumnHeaders,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI Tree Grid 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.dataSource.js
 *	infragistics.ui.shared.js
 *	infragistics.ui.treegrid.js
 *	infragistics.util.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.grid.paging.js
 */
(function($){$.widget("ui.igTreeGridPaging",$.ui.igGridPaging,{css:{contextRow:"ui-igtreegrid-contextrow",contextRowIcon:"ui-igtreegrid-contextrow-icon ui-icon ui-icon-bookmark",contextRowContent:"ui-igtreegrid-contextrow-content",contextRowTextContainer:"ui-igtreegrid-contextrow-container"},rowsToShowLoadingMessage:3e5,events:{contextRowRendering:"contextRowRendering",contextRowRendered:"contextRowRendered"},options:{mode:"rootLevelOnly",contextRowMode:"none",contextRowLoadingText:null,contextRowRootText:null,breadcrumbKey:null,breadcrumbDelimiter:" &gt; ",renderContextRowFunc:null,locale:{contextRowLoadingText:undefined,contextRowRootText:undefined},inherit:false},_create:function(){this.element.data($.ui.igGridPaging.prototype.widgetName,this.element.data($.ui.igTreeGridPaging.prototype.widgetName));$.ui.igGridPaging.prototype._create.apply(this,arguments)},changeLocale:function(){this._super(this.grid.container().find("[data-treegrid-contextrow-content]"));this._renderContextRow(this.options.contextRowMode)},_getDSLocalRecordsCount:function(){if(this.grid.dataSource._filter&&this.options.mode==="allLevels"){return this.grid.dataSource.totalLocalRecordsCount()}return $.ui.igGridPaging.prototype._getDSLocalRecordsCount.apply(this,arguments)},destroy:function(){this._superApply(arguments);this.element.removeData($.ui.igGridPaging.prototype.widgetName)},_dataRendered:function(){var $tr;$.ui.igGridPaging.prototype._dataRendered.apply(this,arguments);switch(this.options.contextRowMode){case"breadcrumb":case"parent":this._renderContextRow(this.options.contextRowMode);break;default:$tr=this.getContextRow();if($tr.length){$tr.remove();this.grid._initializeHeights()}break}},_renderContextRow:function(mode){var grid=this.grid,dv=grid.dataSource.flatDataView(),dataRow,noCancel,eArgs,self=this;if(dv&&dv[0]){dataRow=dv[0]}eArgs={owner:this,dataRow:dataRow,currentPageIndex:this.options.currentPageIndex,contextRowMode:mode};noCancel=this._trigger(this.events.contextRowRendering,null,eArgs);if(noCancel){this._renderLoading(dataRow);setTimeout(function(){if(mode==="breadcrumb"){self._renderBreadcrumb(dataRow)}else if(mode==="parent"){self._renderParentRow(dataRow)}},10)}},getContextRow:function(){var $thead=this.grid.headersTable().children("thead"),$row=this.grid.headersTable().find(">thead>tr[data-treegrid-contextrow]");if($row.length){return $row}$row=$('<tr data-treegrid-contextrow="true" data-skip="true"></tr>').appendTo($thead);$row.addClass(this.css.contextRow);return $row},getContextRowTextArea:function(){var $thead=this.grid.headersTable().children("thead"),$tr,$td,$container,$colspan,colspan=0;$container=$thead.find("[data-treegrid-contextrow-content]");if($container.length){return $container}$tr=this.getContextRow();$tr.empty();$colspan=$thead.closest("table").children("colgroup");$colspan.find("col").each(function(){var $col=$(this),cs;cs=parseInt($col.attr("colspan"),10);if(isNaN(cs)){cs=1}colspan+=cs});$td=$("<td></td>").attr("colspan",colspan).appendTo($tr);$container=$('<div class="'+this.css.contextRowTextContainer+'" data-treegrid-contextrow-container="1">'+'<span class="'+this.css.contextRowIcon+'"></span>'+'<span class="'+this.css.contextRowContent+'" data-treegrid-contextrow-content'+" title='"+this._getLocaleValue("contextRowRootText")+"'"+" "+"data-localeid=contextRowRootText"+" "+"data-localeattr='title'>"+"</span>"+"</div>").appendTo($td);return this.getContextRowTextArea()},_callRenderContextRowFunc:function(dataRow,$textArea,parents,mode){var func=this.options.renderContextRowFunc,f;if($.type(func)==="function"){f=func}else if(window[func]&&typeof window[func]==="function"){f=window[func]}if(f){return f(dataRow,$textArea,parents,mode)}},_renderLoading:function(dataRow){var self=this,$textArea,o=this.options,grid=this.grid,html;if(o.renderContextRowFunc){$textArea=self.getContextRowTextArea();html=self._callRenderContextRowFunc(dataRow,$textArea,null,"loading");if(!html){return}}if(grid.dataSource._flatVisibleData&&grid.dataSource._flatVisibleData.length>=this.rowsToShowLoadingMessage){if(!html){if(!$textArea){$textArea=self.getContextRowTextArea()}$textArea.html(this._getLocaleValue("contextRowLoadingText"))}self.grid._initializeHeights()}},_renderRootRecord:function(){this.getContextRowTextArea().html(this._getLocaleValue("contextRowRootText"))},_renderBreadcrumb:function(dataRow){var i,$text,ds=this.grid.dataSource,parents,parentsLen,row,o=this.options,eArgs,breadcrumbKey=o.breadcrumbKey,html="";parents=ds.getParentRowsForRow(dataRow);$text=this.getContextRowTextArea();if(o.renderContextRowFunc){html=this._callRenderContextRowFunc(dataRow,$text,parents,"breadcrumb");if(!html){return}}if(html){$text.html(html)}else{if($.type(parents)==="array"){parentsLen=parents.length;if(breadcrumbKey===null||breadcrumbKey===undefined){breadcrumbKey=this.grid.options.primaryKey}if(parentsLen<=1){this._renderRootRecord()}else{for(i=0;i<parentsLen;i++){row=parents[i].row;if(row[breadcrumbKey]===undefined){continue}if(i){html+=o.breadcrumbDelimiter}html+=row[breadcrumbKey]}$text.html(html)}}else{this._renderRootRecord()}}eArgs={owner:this,dataRow:dataRow,currentPageIndex:this.options.currentPageIndex,parentRows:parents,contextRowMode:"breadcrumb"};this.grid._initializeHeights();this._trigger(this.events.contextRowRendered,null,eArgs)},_renderParentRow:function(dataRow){var parentsLen,$span,eArgs,html,parents,lastRec,$tr=this.getContextRow(),ds=this.grid.dataSource,o=this.options;parents=ds.getParentRowsForRow(dataRow);if(o.renderContextRowFunc){html=this._callRenderContextRowFunc(dataRow,$tr,parents,"parent");if(!html){return}}if(html){$tr.html(html)}else{if($.type(parents)==="array"||!parents.length){parentsLen=parents.length;if(parentsLen===1){this._renderRootRecord()}else{lastRec=parents[parentsLen-2];lastRec=$.extend(true,{},parents[parentsLen-2]);if(lastRec&&lastRec.row){lastRec.row.childData=null;lastRec.row[this.grid.options.dataSourceSettings.propertyDataLevel]=0;html=this.grid._renderRecord(lastRec.row);html=html.substr(html.indexOf(">")+1);html=html.substr(0,html.lastIndexOf("</tr"));$tr.html(html);$tr.find("td:not([aria-describedby]),th:not([aria-describedby])").empty();$span=$tr.find("[data-expandcell-indicator],[data-shift-container]");if($span.length){$span.attr("class",this.css.contextRowIcon)}}}}else{this._renderRootRecord()}}eArgs={owner:this,dataRow:dataRow,currentPageIndex:this.options.currentPageIndex,parentRows:parents,contextRowMode:"parent"};this.grid._initializeHeights();this._trigger(this.events.contextRowRendered,null,eArgs)},_rowAdded:function(row){if(!row||$.type(row)==="string"){return}var isChildRow=parseInt(row.attr("aria-level"))>0,id,index,pageSize,targetPage;if(this.options.type==="remote"||this.options.mode!=="allLevels"&&isChildRow||!this.grid.options.autoCommit){return}else if(this.options.mode!=="allLevels"&&!isChildRow){this._super(row);return}id=this.grid._normalizedKey(row.attr("data-id"));index=this.grid._recordIndexInFlatView(id);pageSize=this.options.pageSize;if(index===undefined||index<0){return}targetPage=Math.floor(index/pageSize);this.pageIndex(targetPage)},_injectGrid:function(){var ds,i;$.ui.igGridPaging.prototype._injectGrid.apply(this,arguments);ds=this.grid.dataSource;if(ds&&ds.settings&&ds.settings.treeDS){ds.settings.treeDS.paging.mode=this.options.mode;ds.settings.treeDS.paging.contextRowMode=this.options.contextRowMode;if(this.options.type==="remote"&&this.options.mode==="allLevels"){ds.settings.treeDS.persistExpansionStates=true}}if(this.options.contextRowMode!=="none"){for(i=0;i<this.grid.options.features.length;i++){if(this.grid.options.features[i].name==="ColumnFixing"){throw new Error(this._getLocaleValue("columnFixingWithContextRowNotSupported"))}}}}});$.extend($.ui.igTreeGridPaging,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI Tree Grid 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.dataSource.js
 *	infragistics.ui.shared.js
 *	infragistics.ui.treegrid.js
 *	infragistics.util.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.grid.selection.js
 */
(function($){$.widget("ui.igTreeGridSelection",$.ui.igGridSelection,{css:{},options:{},_create:function(){this.element.data($.ui.igGridSelection.prototype.widgetName,this.element.data($.ui.igTreeGridSelection.prototype.widgetName));$.ui.igGridSelection.prototype._create.apply(this,arguments)},_getDataView:function(){return this.grid.dataSource.flatDataView()},destroy:function(){this._superApply(arguments);this.element.removeData($.ui.igGridSelection.prototype.widgetName)},_keyDown:function(event){var target;if(this.options.mode==="row"){if(this._keyDownRowMode(event)){return}}else if(this.options.mode==="cell"){if(this._keyDownCellMode(event)){return}}target=event&&event.target?$(event.target):null;if(!target.is("[data-expand-button]")){$.ui.igGridSelection.prototype._keyDown.apply(this,arguments)}},_keyDownRowMode:function(event){var tr=$(event.target),keyCode=event.keyCode,state;if(keyCode===$.ui.keyCode.LEFT||keyCode===$.ui.keyCode.RIGHT){if(!tr.is("tr")){return}state=tr.attr("aria-expanded");if(state==="undefined"||state===undefined){return}this.grid._expandCollapseRow(tr,keyCode===$.ui.keyCode.RIGHT,true);return true}else if(keyCode===$.ui.keyCode.HOME){if(this._navigateRow(event,"top")){event.preventDefault();return true}}else if(keyCode===$.ui.keyCode.END){if(this._navigateRow(event,"bottom")){event.preventDefault();return true}}if(tr.is("td.ui-igtreegrid-non-data-column")&&(keyCode===$.ui.keyCode.SPACE||keyCode===$.ui.keyCode.ENTER)){return true}},_keyDownCellMode:function(event){var keyCode=event.keyCode,updating;if(keyCode===$.ui.keyCode.ENTER){updating=this.grid.element.data("igGridUpdating");if(!updating&&this._expandCollapseRowByCell()){event.preventDefault();event.stopPropagation();return true}}else if(event.altKey&&(keyCode===$.ui.keyCode.UP||keyCode===$.ui.keyCode.DOWN)){if(this._expandCollapseRowByCell(null,keyCode===$.ui.keyCode.DOWN)){event.preventDefault();return true}}else if(keyCode===$.ui.keyCode.HOME){if(event.ctrlKey){if(this._navigateCell(event,"topLeft")){event.preventDefault();return true}}if(this._navigateCell(event,"left")){event.preventDefault();return true}}else if(keyCode===$.ui.keyCode.END){if(event.ctrlKey){if(this._navigateCell(event,"bottomRight")){event.preventDefault();return true}}if(this._navigateCell(event,"right")){event.preventDefault();return true}}else if(keyCode===$.ui.keyCode.SPACE&&this.grid.options.renderExpansionIndicatorColumn){if(this._expandCollapseRowByCell()){event.preventDefault();event.stopPropagation();return true}}},_navigateCell:function(event,dir){var $cell=this._getActiveCell(),funcNav,$nextActiveCell,self=this,$tr;if(!$cell||!$cell.length){return}$tr=$cell.closest("tr");if(dir==="left"){$nextActiveCell=$tr.children("td:not([data-skip]):visible").first()}else if(dir==="right"){$nextActiveCell=$tr.children("td:not([data-skip]):visible").last()}if($nextActiveCell){this._storedActiveIndex=null;this._navigateOwn($nextActiveCell,this._selection.activeElement,event.keyCode,false,event.shiftKey);return true}funcNav=function($tbody,e){var $tr,$nextEl,activeElem=this._selection.activeElement||this._storedActiveElement;if(e.ctrlKey){this.clearSelection()}if(dir==="topLeft"){$tr=$tbody.children("tr:visible:not([data-skip])").first();$nextEl=$tr.children("td:visible:not([data-skip])").first()}else{$tr=$tbody.children("tr:visible:not([data-skip])").last();$nextEl=$tr.children("td:visible:not([data-skip])").last()}self._storedActiveIndex=null;self._navigateOwn($nextEl,activeElem,e.keyCode,false,e.shiftKey)};return this._navigateTo(event,dir,funcNav)},_navigateRow:function(event,dir){var funcNav=function($tbody,ev,direction){var $nextEl,prevActiveElement=this._selection.activeElement;if(direction==="top"){$nextEl=$tbody.children("tr:visible:not([data-skip])").first()}else{$nextEl=$tbody.children("tr:visible:not([data-skip])").last()}if(ev.shiftKey&&this.options.multipleSelection){this._shiftSelectChange($nextEl)}else{this._navigateOwn($nextEl,prevActiveElement,ev.keyCode,false,ev.shiftKey)}};return this._navigateTo(event,dir,funcNav)},_navigateTo:function(event,dir,funcNavigate){var $scrollContainer,go=this.grid.options,self=this,scrTop;if(go.virtualization===true&&go.virtualizationMode==="continuous"){$scrollContainer=this.grid._scrollContainer();if(dir==="topLeft"||dir==="top"){scrTop=0}else{scrTop=$scrollContainer.children(":first-child").height()}$scrollContainer.scrollTop(scrTop);if(self._loadingIndicator===undefined){self._initLoadingIndicator()}self._loadingIndicator.show();self.grid.element.bind("iggridvirtualrecordsrender.navigate",function(){if(self._loadingIndicator){self._loadingIndicator.hide()}funcNavigate.call(self,self.grid.element.children("tbody"),event,dir);self.grid.element.unbind("iggridvirtualrecordsrender.navigate")})}else{funcNavigate.call(self,this.grid.element.children("tbody"),event,dir)}return true},_getActiveCell:function(){var activeEl=this._selection.activeElement;if(!activeEl){return}return this._getCellByIdentifier(activeEl)},_expandCollapseRowByCell:function($cell,expand){var $tr;if(!$cell){$cell=this._getActiveCell();if(!$cell){return}}if($cell.length&&$cell.attr("data-expand-cell")&&$cell.find("[data-expand-button]").length){$tr=$cell.closest("tr");if(expand===undefined){this.grid._toggleRow($tr)}else{this.grid._expandCollapseRow($tr,expand,true)}return true}},_initLoadingIndicator:function(){this._loadingIndicator=this.grid.container().length>0?this.grid.container().igLoading().data("igLoading"):this.grid.element.igLoading().data("igLoading").indicator()},_mouseUp:function(event){var target=event&&event.target?$(event.target):null;if(!target.is("[data-expand-button]")&&(!target.is("td[data-expand-cell]")||!this.grid.options.renderExpansionIndicatorColumn)){$.ui.igGridSelection.prototype._mouseUp.apply(this,arguments)}},_virtualRecordsRendered:function(info){var $ae=info.activeElement;if($ae.is("tr")||$ae.is("td")){this._selection.activate(this._identifierForTarget($ae),$ae,true)}},selectRowById:function(id){if(this.options.mode==="cell"){return}if(!this._selection.isSelected(id,this.grid)){if(this._selection.settings.owner!==this.grid){this._selection.changeOwner(this.grid)}this._selection.select(id,true,{element:this._getRowsByIdentifier(id),id:id},true)}},_select:function(info){var element=info.element||this._selection.elementFromIdentifier(info.id);if(element.is("tr")&&this.grid.options.renderExpansionIndicatorColumn){element.children("td.ui-igtreegrid-non-data-column").addClass(this.css.selectedCell)}$.ui.igGridSelection.prototype._select.apply(this,arguments)},_preventDefault:function(event){var target=$(event.target);if(target.is("td")&&(!target.is("td[data-expand-cell]")||!this.grid.options.renderExpansionIndicatorColumn)){event.preventDefault()}else if(target.attr("data-expandcell-indicator")){event.preventDefault();event.stopPropagation()}}});$.extend($.ui.igTreeGridSelection,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI Tree Grid 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.dataSource.js
 *	infragistics.ui.shared.js
 *	infragistics.ui.treegrid.js
 *	infragistics.util.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.grid.sorting.js
 */
(function($){$.widget("ui.igTreeGridSorting",$.ui.igGridSorting,{css:{},options:{fromLevel:0,toLevel:-1,inherit:false},_create:function(){this.element.data($.ui.igGridSorting.prototype.widgetName,this.element.data($.ui.igTreeGridSorting.prototype.widgetName));$.ui.igGridSorting.prototype._create.apply(this,arguments)},changeLocale:function(){this._superApply(arguments)},isColumnSorted:function(columnKey){var i,se=this.grid.dataSource.settings.sorting.expressions;if(!se||!columnKey||!se.length){return false}for(i=0;i<se.length;i++){if(se[i].fieldName===columnKey){return se[i].isSorting}}return false},destroy:function(){this._superApply(arguments);this.element.removeData($.ui.igGridSorting.prototype.widgetName)},_injectGrid:function(gridInstance,isRebind){var ds;$.ui.igGridSorting.prototype._injectGrid.apply(this,arguments);ds=this.grid.dataSource;if(ds&&ds.settings&&ds.settings.treeDS){ds.settings.treeDS.sorting.fromLevel=this.options.fromLevel;ds.settings.treeDS.sorting.toLevel=this.options.toLevel}if(!isRebind&&!this._cellStyleSubscriberAdded){this._cellStyleSubscriberAdded=true;this.grid._cellStyleSubscribers.push($.proxy(this._applyActiveSortCellStyle,this))}}});$.extend($.ui.igTreeGridSorting,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI Tree Grid 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.dataSource.js
 *	infragistics.ui.shared.js
 *	infragistics.ui.treegrid.js
 *	infragistics.util.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.grid.tooltips.js
 */
(function($){$.widget("ui.igTreeGridTooltips",$.ui.igGridTooltips,{options:{inherit:false},_create:function(){this.element.data($.ui.igGridTooltips.prototype.widgetName,this.element.data($.ui.igTreeGridTooltips.prototype.widgetName));$.ui.igGridTooltips.prototype._create.apply(this,arguments)},_getDataView:function(){return this.grid.dataSource.flatDataView()},_getRowIndex:function(element,row){return element.closest("tbody").children("tr:visible:not([data-container='true'],"+"[data-grouprow='true'],"+"[data-new-row='true'])").index(row)},destroy:function(){this._superApply(arguments);this.element.removeData($.ui.igGridTooltips.prototype.widgetName)}});$.extend($.ui.igTreeGridTooltips,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI Tree Grid 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.dataSource.js
 *	infragistics.ui.shared.js
 *	infragistics.ui.treegrid.js
 *	infragistics.util.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.grid.updating.js
 */
(function($){$.widget("ui.igTreeGridUpdating",$.ui.igGridUpdating,{options:{enableAddChild:true,addChildTooltip:null,addChildButtonLabel:null,locale:{addChildTooltip:undefined,addChildButtonLabel:undefined},inherit:false},css:{addChildIcon:"ui-iggrid-addrowicon ui-icon ui-icon-circle-plus"},changeLocale:function(){this._superApply(arguments);var gridId=this.grid.id();if(this._renderTouchUI&&this.options.enableAddChild){this._super($("#"+gridId+"_updating_add_child_touch"))}this._changeLocaleForElement($("#"+gridId+"_updating_add_child_hover"))},_startAddChildFor:function(rowId,raiseEvents){var self=this,row=this.grid.rowById(rowId);if(row.attr("aria-expanded")==="false"){this.grid.expandRow(row,function(){row=self.grid.rowById(rowId);self._addEditableChildRow(row,raiseEvents)});return true}return this._addEditableChildRow(row,raiseEvents)},_addEditableChildRow:function(row,raiseEvents){var newRow,fixedRow,attr,fixDir,cellToFocus,cfInst,hasFixedColumns=this.grid.hasFixedColumns(),fr={},parentLevel,rowId=this.grid._normalizedKey(row.attr("data-id"));attr={"data-new-row":true,"data-child-row":true};fr[this.grid.options.dataSourceSettings.dataLevelKey]=parseInt(row.attr("aria-level"),10)+1;fr[this.grid.options.dataSourceSettings.expandedKey]=false;fr.__fr=rowId;newRow=$(this.grid._renderRecord(fr,rowId));newRow.removeAttr("data-id");newRow=newRow.attr(attr).addClass(this.css.addRow).data("parent-id",rowId);if(hasFixedColumns){fixedRow=$(this.grid._renderRecord({},null,true)).removeAttr("data-id");fixedRow.attr(attr).addClass(this.css.addRow).data("parent-id",rowId);fixDir=this.grid.fixingDirection()}parentLevel=parseInt(row.attr("aria-level"),10);if(row.next("[aria-level='"+(parentLevel+1)+"']").length){newRow.insertAfter(row.nextUntil("[aria-level='"+parentLevel+"']").last())}else{newRow.insertAfter(row)}if(hasFixedColumns){this.grid.rowById(rowId,true).after(fixedRow);if(fixDir==="left"&&fixedRow.find("td").not('[data-skip="true"]').length>0){cellToFocus=fixedRow.find("td").not('[data-skip="true"]').eq(0)}cfInst=this.grid.element.data("igTreeGridColumnFixing");if(cfInst&&cfInst.options.syncRowHeights){cfInst.syncRowsHeights(fixedRow,newRow)}}cellToFocus=cellToFocus||newRow.find("td").not('[data-skip="true"]').eq(0);this._startEditForRow(null,!raiseEvents,null,null,cellToFocus);return true},_renderAddChildButton:function(){var addChildButton,addChildSelector="#"+this.grid.id()+"_updating_add_child_hover",addChildContainer,ubodySelector="#"+this.grid.id()+">tbody",fbodySelector="#"+this.grid.id()+"_fixed>tbody",pe=window.navigator.msPointerEnabled||window.navigator.pointerEnabled,addChildTitle=this._getLocaleValue("addChildTooltip");if($(addChildSelector).length){return}addChildButton=$("<span></span>").css("position","absolute").addClass(this.css.deleteButton);addChildButton.attr({id:addChildSelector.substring(1),unselectable:"on",title:addChildTitle,"data-localeid":"addChildTooltip","data-localeattr":"title"});addChildButton.hide();$("<span></span>").addClass(this.css.addChildIcon).attr("unselectable","on").appendTo(addChildButton);addChildContainer=this._addElementToScrollContainer(addChildButton);this.grid.container().on({"mouseenter.addchildbutton":this._buttonHandlers.mouseEnter,"mouseleave.addchildbutton":this._buttonHandlers.mouseLeave,"click.addchildbutton":this._buttonHandlers.addChildClick,"keyup.addchildbutton":this._buttonHandlers.addChildClick},addChildSelector);if(pe){this.grid.container().on({"pointerenter.deletebutton":this._handlers.pointerEnter,"mspointerenter.deletebutton":this._handlers.pointerEnter},ubodySelector+">tr,"+fbodySelector+">tr")}else{this.grid.container().on({"mouseenter.addchildbutton":this._handlers.mouseEnter},ubodySelector+">tr,"+fbodySelector+">tr")}if(this._renderTouchUI){this.grid.container().on({"touchstart.addchildbutton":this._handlers.touchStart,"touchend.addchildbutton":this._handlers.touchEnd},ubodySelector+">tr,"+fbodySelector+">tr")}if(addChildContainer[0]===this.grid.container()[0]){this.grid.container().bind("mouseleave.addchildbutton",this._handlers.mouseLeave)}else{this.grid.container().on({"mouseleave.addchildbutton":this._handlers.mouseLeave},"#"+addChildContainer.attr("id"))}},_removeAddChildButton:function(){var button=$("#"+this.grid.id()+"_updating_add_child_hover");if(button.length===1){button.remove();this.grid.container().off(".addchildbutton");this.grid.container().unbind(".addchildbutton")}},_toggleAddRow:function(){var isAddChild=this._isAddChild(),newRow;if(isAddChild){newRow=this.grid.element.find("tr[data-child-row]");if(this.grid.hasFixedColumns()){newRow=newRow.add(this.grid.fixedBodyContainer().find("tr[data-child-row]"))}if(newRow.length!==0){newRow.remove()}}else{this._super()}},_addChildButtonClick:function(evt){var rowId=$(evt.target).closest(".ui-iggrid-deletebutton").data("button-for");if(this.options.editMode==="dialog"){this._startEditDialog(evt,false,null,true,null,null,rowId)}else{if(this._startAddChildFor(rowId,true)){this.hideAddChildButton()}}},_touchAddChildClick:function(evt){var rowId=this._editingForRowId,target=$(evt.target).closest(".ui-iggrid-button");if(!target.length||target.hasClass(this.css.buttonDisabled)){return}if(this.isEditing()){this._endEdit(evt,false,false);this._startAddChildFor(rowId)}},_touchAddChildKeyUp:function(evt){var rowId=this._editingForRowId,target=$(evt.target).closest(".ui-iggrid-button");if(!target.length||target.hasClass(this.css.buttonDisabled)||evt.keyCode!==$.ui.keyCode.ENTER){return}if(this.isEditing()){this._endEdit(evt,false,false);this._startAddChildFor(rowId)}},_touchStart:function(evt){this._super(evt);this.hideAddChildButton()},_touchEnd:function(evt){var changedTouchX=evt.originalEvent.changedTouches&&evt.originalEvent.changedTouches[0]?evt.originalEvent.changedTouches[0].pageX:evt.originalEvent.clientX;this._storedScrollLeft-=this.grid.scrollContainer().scrollLeft()||0;this._storedScrollWidth-=this.grid.scrollContainer().width()||0;if(this.options.enableAddChild&&Math.abs(changedTouchX-this._firstTouchX)>parseInt(this.options.swipeDistance,10)&&this._firstTouchRow&&this._storedScrollLeft===0&&this._storedScrollWidth===0){this.showAddChildButtonFor(this._firstTouchRow);if(this.options.enableDeleteRow){this.showDeleteButtonFor(this._firstTouchRow)}}delete this._firstTouchX;delete this._firstTouchRow;delete this._storedScrollLeft;delete this._storedScrollWidth;delete this._firstTouchRow},_pointerUp:function(evt){var oe=evt.originalEvent,changedTouchX;if(oe.pointerType!=="touch"){return}changedTouchX=oe.pageX;this._storedScrollLeft-=this.grid.scrollContainer().scrollLeft()||0;this._storedScrollWidth-=this.grid.scrollContainer().width()||0;if(this.options.enableDeleteRow&&Math.abs(changedTouchX-this._firstTouchX)>parseInt(this.options.swipeDistance,10)&&this._firstTouchRow&&this._storedScrollLeft===0&&this._storedScrollWidth===0){this.showAddChildButtonFor(this._firstTouchRow);if(this.options.enableDeleteRow){this.showDeleteButtonFor(this._firstTouchRow)}}delete this._firstTouchX;delete this._firstTouchRow;delete this._storedScrollLeft;delete this._storedScrollWidth;delete this._firstTouchRow},_rowMouseEnter:function(evt){this._super(evt);var row=$(evt.target).closest("tr");if(!this.isEditing()&&this._isEditableRow(row)){if(!row.hasClass("ui-iggrid-modifiedrecord")&&this.grid.dataSource.findRecordByKey(this.grid._normalizedKey(row.attr("data-id")))){this.showAddChildButtonFor(row)}else{this.hideAddChildButton()}}else{this.hideAddChildButton()}},_containerMouseLeave:function(){this._super();this.hideAddChildButton()},_renderDoneCancelButtons:function(){var buttonContainer=this._super(),addChildButton,addChildSelector="#"+this.grid.id()+"_updating_add_child_touch";if(this._renderTouchUI&&this.options.enableAddChild){addChildButton=$("<span />").attr("id",this.grid.id()+"_updating_add_child_touch").addClass(this.css.button).addClass(this.css.doneButton).attr({unselectable:"on",tabIndex:this._getNextTabIndex()+1,title:this._getLocaleValue("addChildTooltip"),"data-localeid":"addChildTooltip","data-localeattr":"title"});addChildButton.prependTo(buttonContainer);addChildButton.css({"float":"left",position:"relative"});$("<span />").css({display:"inline-block",left:0}).addClass(this.css.addRowIcon).attr("unselectable","on").appendTo(addChildButton);$("<span />").css("display","inline-block").attr({unselectable:"on","data-localeid":"addChildButtonLabel"}).html(this._getLocaleValue("addChildButtonLabel")).appendTo(addChildButton);this.grid.container().on({"mouseenter.donecancel":this._buttonHandlers.mouseEnter,"mouseleave.donecancel":this._buttonHandlers.mouseLeave,"focus.donecancel":this._buttonHandlers.focus,"blur.donecancel":this._buttonHandlers.blur},addChildSelector);this.grid.container().on({"click.donecancel":this._buttonHandlers._touchAddChildClick,"keyup.donecancel":this._buttonHandlers._touchAddChildKeyUp},addChildSelector)}return buttonContainer},_updateTouchButtons:function(isAdding){var addChildButton,isInDS;this._super(isAdding);if(this.options.enableAddChild){isInDS=this.grid.findRecordByKey(this._editingForRowId)!==null;addChildButton=$("#"+this.grid.id()+"_updating_add_child_touch");if(isAdding||this._isAddChild()||!isInDS){addChildButton.addClass(this.css.buttonDisabled);if(addChildButton.hasClass("ui-iggrid-buttonhover")){addChildButton.removeClass(this.css.buttonHover)}}else{addChildButton.removeClass(this.css.buttonDisabled)}}},_isAddChild:function(){return this.grid.element.find("tr[data-child-row]").length!==0},_removeChildrenFromUI:function($row,dataLevel){if(!$row||!$row.length){return}var dl,$tmp,rowId,$fRow,$cntnr,fixedCols=this.grid.hasFixedColumns();if(isNaN(dataLevel)){return}$cntnr=this.grid.container();while($row.length===1){dl=parseInt($row.attr("aria-level"),10);if(isNaN(dl)){break}if(dl<=dataLevel){break}$tmp=$row;rowId=$row.attr("data-id");$row=$row.next("tr");if(fixedCols){$fRow=$cntnr.find('tr[data-id="'+rowId+'"]');$fRow.remove()}$tmp.remove()}},_updateParentRowAfterAddChild:function(parentId){var span,rowData,parentRow,expCol=this.grid.options.renderExpansionIndicatorColumn,fixed=this.grid.hasFixedColumns()&&this.grid.fixingDirection()==="left";parentRow=this.grid.rowById(parentId,fixed);if(parentRow.find("span.ui-igtreegrid-expansion-indicator").length>0){return}rowData={dataBoundDepth:parseInt(parentRow.attr("aria-level"),10),hasExpandCell:true,expand:true};span=this.grid._renderExpandCellContainerHelper(rowData);if(expCol){parentRow.find("td.ui-igtreegrid-non-data-column").attr("data-expand-cell",1).append(span)}else{parentRow.find("span[data-expandcell-indicator]").append($(span).find("span.ui-igtreegrid-expansion-indicator"))}parentRow.attr("aria-expanded",true)},_generatePrimaryKeyValue:function(e,col){var value,ds=this.grid.dataSource;if(col){value=Math.max(this._recCount||1,ds._totalRecordsCount||1,ds._data.length);if(this._getPKType()==="string"){value=String(value)}if(this.element.find("tr[data-id="+value+"]").length||this.grid.findRecordByKey(value)){value=parseInt(value)+1}this._recCount=value;col.value=value}},_scroll:function(){if(this.isEditing()&&this._isAddChild()){this._positionDoneCancelButtons(this.grid.element.find("tr[data-new-row][data-child-row]"))}else{this._super()}},_attachEvents:function(){this._generatePrimaryKeyValueHandler=$.proxy(this._generatePrimaryKeyValue,this);this.element.bind("igtreegridupdatinggenerateprimarykeyvalue",this._generatePrimaryKeyValueHandler)},_detachEvents:function(){if(this._generatePrimaryKeyValueHandler){this.element.unbind("igtreegridupdatinggenerateprimarykeyvalue",this._generatePrimaryKeyValueHandler);delete this._generatePrimaryKeyValueHandler}},addChild:function(values,parentId){var settings=this.options.columnSettings,i=settings?settings.length:0,defVals={},key,val,rec=this.grid.findRecordByKey(parentId);if(rec===null){throw new Error(this._getLocaleValue("recordNotFound").replace("{id}",parentId))}while(i-- >0){key=settings[i].columnKey;val=settings[i].defaultValue;if(val!==undefined&&key!==undefined&&key!==null){defVals[key]=val}}this._addRow(null,$.extend(defVals,values),defVals,true,parentId)},startAddChildFor:function(parentId,raiseEvents){var rec=this.grid.findRecordByKey(parentId);if(rec===null){throw new Error(this._getLocaleValue("recordNotFound").replace("{id}",parentId))}this._startAddChildFor(parentId,raiseEvents)},showAddChildButtonFor:function(row){var acb=$("#"+this.grid.id()+"_updating_add_child_hover"),go=this.grid.options,v,hasHeight=go.height!==null&&go.height!==undefined,sbw=this.grid.hasVerticalScrollbar()===true?this.grid._scrollbarWidth():0,left,top,sc,offset=0,scrContainer,dbw=0,rowId=this._getRowId(row);if(acb.length){if(this.options.enableDeleteRow){dbw+=$("#"+this.grid.id()+"_updating_deletehover").outerWidth()+5}acb.show();sc=acb.parent();if(!hasHeight){v=go.virtualization||go.rowVirtualization||go.columnVirtualization;scrContainer=v?this.grid._vdisplaycontainer():this.grid.scrollContainer();if(scrContainer.length){offset=scrContainer.igPosition().top}}left=sc.outerWidth()-acb.outerWidth()-sbw-dbw+sc.scrollLeft()-5;top=row.igPosition().top+row.outerHeight()/2-acb.outerHeight()/2+sc.scrollTop()+offset;acb.css({top:top,left:left});acb.data("button-for",rowId)}},hideAddChildButton:function(){var acb=$("#"+this.grid.id()+"_updating_add_child_hover");if(acb.length){acb.hide()}},_create:function(){this.element.data($.ui.igGridUpdating.prototype.widgetName,this.element.data($.ui.igTreeGridUpdating.prototype.widgetName));$.ui.igGridUpdating.prototype._create.apply(this,arguments)},_addRow:function(evt,addObj,defVals,suppress,parentId){var arg,key,t,row,index,dataLevelKey=this.grid.options.dataSourceSettings.dataLevelKey,expandedKey=this.grid.options.dataSourceSettings.expandedKey,parentRecord;addObj=$.extend({},defVals,addObj);if(dataLevelKey&&!addObj.hasOwnProperty(dataLevelKey)){addObj[dataLevelKey]=0}if(expandedKey&&!addObj.hasOwnProperty(expandedKey)){addObj[expandedKey]=true}if(parentId!==undefined&&parentId!==null){parentRecord=this.grid.dataSource.findRecordByKey(parentId);if(parentRecord===null){throw new Error($.ig.Grid.locale.recordNotFound.replace("{id}",parentId))}parentRecord[expandedKey]=true;addObj[dataLevelKey]=parentRecord[dataLevelKey]+1;arg={owner:this,values:addObj,oldValues:defVals,addChild:true,parentID:parentId};if(!suppress){if(!this._trigger(this.events.rowAdding,evt,arg)){return false}}key=addObj[this.grid.options.primaryKey];index=this.grid.dataSource.getChildrenByKey(parentId)?this.grid.dataSource.getChildrenByKey(parentId).length:0;index+=this._pendingChildrenCount(parentId);t=this.grid.dataSource.insertRow(key,addObj,index,this.grid.options.autoCommit,parentId);row=this._updateUIForTransaction(t);this._notifyRowAdded(row);if($.type(this._pkVal)==="number"){this._pkVal++}if(!suppress){this._trigger(this.events.rowAdded,evt,arg)}}else{this._super(evt,addObj,defVals,suppress,parentId)}},_pendingChildrenCount:function(parentId){var t=this.grid.pendingTransactions(),count=0;for(var i=0;i<t.length;i++){if(t[i].type==="insertnode"&&t[i].parentRowId===parentId){count++;for(var j=0;j<t.length;j++){if(t[j].rowId===t[i].rowId&&t[j].type==="deleterow"){count--}}}}return count},_startEditForCell:function(evt,suppress,rowId,columnKey,element,focus,isAdding,value){this.hideAddChildButton();return this._super(evt,suppress,rowId,columnKey,element,focus,isAdding,value)},_rebindEditTriggers:function(){this._super();if(this.options.enableAddChild){this._renderAddChildButton()}},_getLatestValues:function(id,columnKey){var record=this._super(id,columnKey);if(record&&record[this.grid.dataSource.settings.treeDS.childDataKey]){delete record[this.grid.dataSource.settings.treeDS.childDataKey]}return record},_createHandlers:function(){this._super();this._buttonHandlers.addChildClick=$.proxy(this._addChildButtonClick,this);this._buttonHandlers._touchAddChildClick=$.proxy(this._touchAddChildClick,this);this._buttonHandlers._touchAddChildKeyUp=$.proxy(this._touchAddChildKeyUp,this)},_deleteRow:function(evt,rowId,suppress){var res,$prevRow,$nextRow,$row=this.grid.rowById(rowId),dataLevel;if($row&&$row.length){$nextRow=$row.next("tr");$prevRow=$row.prev("tr");dataLevel=parseInt($row.attr("aria-level"),10)}res=this._super(evt,rowId,suppress);if(res&&!isNaN(dataLevel)){this._removeChildrenFromUI($nextRow,dataLevel);this.grid._updateParentRowAfterDelete($prevRow,dataLevel)}return res},_updateUIForTransaction:function(t,row){var go=this.grid.options,autoCommit=go.autoCommit,v=go.virtualization||go.rowVirtualization||go.columnVirtualization,newRow,index;if(t.type==="insertnode"){if(this.grid.rowById(t.rowId).length){return}this._updateUnboundValuesForRow(t.row);if(v&&!autoCommit){return}this.grid.renderNewChild(t.row,t.parentRowId);this._updateParentRowAfterAddChild(t.parentRowId);this.grid._rerenderDataSkipColumn(this.grid.dataSource.getDataBoundDepth());newRow=this.grid.rowById(t.rowId);if(!autoCommit&&newRow.length){this._combineRowElements(newRow).addClass(this.grid.css.modifiedRecord)}index=newRow?newRow.index()-1:0;this.grid._reapplyZebraStyle(index)}else{if(t.type==="deleterow"){this.grid._rerenderColgroups()}newRow=this._super(t,row);if(this.grid.options.width===null&&t.type==="deleterow"){this.grid._updateContainersWidthOnGridWidthNull()}}return newRow},_setOption:function(key,value){var button;this._super(key,value);switch(key){case"enableAddChild":if(value===true){this._renderAddChildButton()}else{this._removeAddChildButton()}break;case"addChildTooltip":button=$("#"+this.grid.id()+"_updating_add_child_hover");if(button.length===1){button.attr("title",value)}break;default:this._super(key,value);break}},destroy:function(){this._detachEvents();this._removeAddChildButton();this._superApply(arguments);this.element.removeData($.ui.igGridUpdating.prototype.widgetName)},_injectGrid:function(grid,isRebind){$.ui.igGridUpdating.prototype._injectGrid.apply(this,arguments);if(!isRebind){this._detachEvents();this._attachEvents()}}});$.extend($.ui.igTreeGridUpdating,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI Tree Grid 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.editors.js
 *	infragistics.ui.shared.js
 *	infragistics.dataSource.js
 *	infragistics.util.js
 *	infragistics.ui.treegrid.js
 *	infragistics.ui.grid.rowselectors.js
 */
(function($){$.widget("ui.igTreeGridRowSelectors",$.ui.igGridRowSelectors,{options:{rowSelectorNumberingMode:"sequential",checkBoxMode:"biState",inherit:false},css:{rowSelectorChecked:"ui-state-checked",checkBoxP:"ui-icon ui-icon-check-p ui-igcheckbox-normal-on",checkBoxF:"ui-icon ui-icon-check-f ui-igcheckbox-normal-on"},_create:function(){this.element.data($.ui.igGridRowSelectors.prototype.widgetName,this.element.data($.ui.igTreeGridRowSelectors.prototype.widgetName));$.ui.igGridRowSelectors.prototype._create.apply(this,arguments);this._cIndexes={};this._indexCache={};this._path="";this._pathBuild=false;this._nCache={};this._recordNumbers={};this._checkboxStates={}},destroy:function(){this._superApply(arguments);this.element.removeData($.ui.igGridRowSelectors.prototype.widgetName)},changeLocale:function(){this._superApply(arguments)},_recordsRendering:function(){$.ui.igGridRowSelectors.prototype._recordsRendering.apply(this,arguments);if(this.options.rowSelectorNumberingMode==="sequential"){if(this._cIdx===this.options.rowNumberingSeed){this._numberRecords(this.grid.dataSource.data())}return}this._cIndexes={};this._pathBuild=false;this._nCache={};this._numberRecordsWithParents(this.grid.dataSource.data(),"")},_rsExpandCollapseRow:function(row,expand){if(expand){this._cIndexes={};this._path=(row instanceof $?row.find("span.ui-iggrid-rowselector-row-number").html():this.element.find("[data-id='"+row+"']").find("span.ui-iggrid-rowselector-row-number").html())+".";this._pathBuild=true}$.ui.igTreeGrid.prototype._expandCollapseRow.apply(this.grid,arguments)},_applyNumberToNewChild:function(directParent,row){var directParentId,childrenLength,rsNumber;directParentId=directParent[this.grid.options.primaryKey];childrenLength=directParent[this.grid.options.childDataKey]?directParent[this.grid.options.childDataKey].length:1;if(!$.isEmptyObject(this._nCache)){rsNumber=this._nCache[directParentId]+"."+childrenLength;this._nCache[row.data("id")]=rsNumber}else if(this.element.find("[data-id='"+directParentId+"']").length!==0){rsNumber=this.element.find("[data-id='"+directParentId+"']").find("span.ui-iggrid-rowselector-row-number").html();rsNumber+="."+childrenLength}row.find("span.ui-iggrid-rowselector-row-number").html(rsNumber)},_childRowRendering:function(args){if(this.options.rowSelectorNumberingMode==="sequential"){return}this._getCurrentNumberForNewChild(args.parentId,args.id);this._nCache[args.parentId].children++},_redirectFunctions:function(){if(this._functionsRedirected===false){this._expandCollapseRowHandler=$.proxy(this._rsExpandCollapseRow,this);if(this.options.rowSelectorNumberingMode!=="sequential"){this.grid._expandCollapseRow=this._expandCollapseRowHandler}if(this.options.checkBoxMode!=="biState"){this._select=$.proxy(this._selectHandler,this);this._deselect=$.proxy(this._deselectHandler,this);this._handleCheck=$.proxy(this._handleTriStateCheck,this);this._handleHeaderCheck=$.proxy(this._handleTriStateHeaderCheck,this)}}$.ui.igGridRowSelectors.prototype._redirectFunctions.apply(this,arguments)},_injectGrid:function(){var i;$.ui.igGridRowSelectors.prototype._injectGrid.apply(this,arguments);for(i=0;i<this.grid.options.features.length;i++){if(this.grid.options.features[i].name==="Selection"){if(this.grid.options.features[i].multipleSelection&&this.options.enableCheckBoxes&&this.options.checkBoxMode==="triState"){throw new Error(this._getLocaleValue("multipleSelectionWithTriStateCheckboxesNotSupported"))}break}}},_shouldRenderHeaderCheckBoxes:function(){var o=this.options;return o.enableCheckBoxes===true&&o.checkBoxMode==="triState"||o.enableCheckBoxes===true&&o.checkBoxMode==="biState"&&this._ms},_updateHeader:function(){var sl,check=true,i,dv=this.grid.dataSource.flatDataView(),dvl=dv.length,selection=this._getSelectionInstance(),isSelected,pk=selection._pkProp;if(this.grid.element.data("igGridPaging")){for(i=0;i<dvl;i++){isSelected=this.options.checkBoxMode==="triState"?this._checkboxStates[dv[i][selection._pkProp]]:this.grid._selection.isSelected(pk!==null?dv[i][pk]:i,this.grid);if(!isSelected){check=false;break}}}else{dvl=this.grid.dataSource.getFlatData().length;sl=this.grid._selection?this.grid._selection.selectionLength():0;if(this.options.checkBoxMode==="triState"){check=this._areAllRecordsChecked(sl,dvl)}else{check=sl===dvl&&this._isFirstRowSelected()}}this._alterCheckbox(this._headerCheckbox(),check)},_rowExpanded:function(ui){if(this.options.rowSelectorNumberingMode==="sequential"){this._reapplyNumbering(ui)}if(this.options.enableCheckBoxes===true&&this._ms){this._updateHeader()}},_rowCollapsed:function(ui){if(this.options.rowSelectorNumberingMode==="sequential"){this._reapplyNumbering(ui)}},_getCurrentNumber:function(rowData){var pKey=this.grid.options.primaryKey,path;if(this.options.rowSelectorNumberingMode==="sequential"&&!$.isEmptyObject(this._recordNumbers)){return"<span class='ui-iggrid-rowselector-row-number'>"+(this._recordNumbers[rowData[pKey]]||"")+"</span>"}if(!$.isEmptyObject(this._nCache)){if(rowData.hasOwnProperty("__fr")){path=this._getCurrentNumberForNewChild(rowData.__fr)}else if(this._nCache[rowData[pKey]]){path=this._nCache[rowData[pKey]].path||""}else{this._nCache[rowData[pKey]]={children:0,path:String(this._getNextNumberForParent())};path=this._nCache[rowData[pKey]].path}return"<span class='ui-iggrid-rowselector-row-number'>"+path+"</span>"}return this._super(rowData)},_getCurrentNumberForNewChild:function(parentId,rowId){var childIdx=this._nCache[parentId].path+"."+(this._nCache[parentId].children+1);if(rowId!==undefined){this._nCache[rowId]={path:childIdx,children:0}}return childIdx},_getNextNumberForParent:function(){var i,pt=this.grid.dataSource.pendingTransactions(),count=0;for(i=0;i<pt.length;i++){if(pt[i].type==="newrow"){count++}}return this.grid.dataSource.data().length+count},_getRowSelectorCellMarkup:function(selected,rowData){if(!rowData){return""}var markup="",o=this.options,go=this.grid.options,pKey=go.primaryKey,rowId=rowData[pKey],checkStateDefined=this._checkboxStates[rowId]!==undefined&&this._checkboxStates[rowId]!==null;markup+="<th role='rowheader' tabindex='"+go.tabIndex+"' class='"+this.css.rowSelector;if(selected){markup+=" "+this.css.rowSelectorSelected}if(checkStateDefined){markup+=" "+this.css.rowSelectorChecked}markup+="'><span class='ui-icon ui-icon-triangle-1-e' style='margin-left: -5px'></span>";if(o.enableRowNumbering){markup+=this._getCurrentNumber(rowData)}if(o.enableCheckBoxes){markup+=this._getTriStateCheckBox(rowData,selected&&o.checkBoxMode!=="triState"||checkStateDefined)}markup+="</th>";return markup},_getTriStateCheckBox:function(rowData,checked){var markup="",dataChk="off",checkBoxState=this.css.checkBoxOff,pKey=this.grid.options.primaryKey;if(checked){dataChk="on";checkBoxState=this._checkboxStates[rowData[pKey]]===0?this.css.checkBoxP:this.css.checkBoxF}markup+="<span name='"+"chk"+"' ";markup+="data-chk='"+dataChk+"' ";markup+="data-role='checkbox' class='"+this.css.checkBox+" '";markup+="tabindex='"+this.grid.options.tabIndex+" '";if(this.options.showCheckBoxesOnFocus===true&&this._checkBoxesShown===false){markup+=" style='visibility: hidden;'"}markup+="><span class='"+checkBoxState+"'>";markup+="</span></span>";return markup},_numberRecordsWithParents:function(data,currentPath){var pKey=this.grid.options.primaryKey,childDataKey=this.grid.options.childDataKey,counter=1,cPath,dataLen,i,dataRow;if($.type(data)==="array"){dataLen=data.length;for(i=0;i<dataLen;i++,counter++){dataRow=data[i];cPath=(currentPath===""?"":currentPath+".")+counter.toString();this._nCache[dataRow[pKey]]={path:cPath,children:dataRow[childDataKey]?dataRow[childDataKey].length||0:0};if(dataRow[childDataKey]!==undefined&&dataRow[childDataKey]!==null){this._numberRecordsWithParents(dataRow[childDataKey],cPath)}}}},_numberRecords:function(data){var pKey=this.grid.options.primaryKey,childDataKey=this.grid.options.childDataKey,expanded=this.grid.options.dataSourceSettings.expandedKey,dataLen,i,dataRow;if($.type(data)==="array"){dataLen=data.length;for(i=0;i<dataLen;i++){dataRow=data[i];if(this._recordNumbers===undefined||this._recordNumbers===0){this._cIdx=this.options.rowNumberingSeed;this._recordNumbers={}}this._recordNumbers[dataRow[pKey]]=++this._cIdx;if(dataRow[expanded]&&dataRow[childDataKey]!==undefined&&dataRow[childDataKey]!==null){this._numberRecords(dataRow[childDataKey])}}}},_reapplyNumbering:function(ui){var nextRowId,nextRow=ui.fixedRow||ui.row,rsSelector="span.ui-iggrid-rowselector-row-number";this._cIdx=this.options.rowNumberingSeed;this._numberRecords(this.grid.dataSource.data());while(nextRow.length===1){nextRowId=nextRow.attr("data-id");nextRow.find(rsSelector).text(this._recordNumbers[nextRowId]);nextRow=nextRow.next("tr[aria-level]")}},_selectHandler:function(info){var res;info.element=info.element||this._getRowById(info.id);res=this._rowSelectorFromSelection(info);if(!res){return}res.rowSelector.addClass(this.css.rowSelectorSelected)},_deselectHandler:function(info){var res,shouldDeselect;info.element=info.element||this._getRowById(info.id);res=this._rowSelectorFromSelection(info);if(!res){return}shouldDeselect=this.grid._selection instanceof $.ig.SelectedRowsCollection||!this.grid._selection.atLeastOneSelected(this.grid._fixPKValue(info.element.parent().attr("data-id")));if(shouldDeselect){res.rowSelector.removeClass(this.css.rowSelectorSelected)}},_changeParentsCheckState:function(rowId,toCheck){var grid=this.grid,pKey=grid.options.primaryKey,action=$.proxy(toCheck?this._checkParent:this._uncheckParent,this),parents,res,i,element,parentRow;parents=grid.dataSource.getParentRowsForRow(rowId);for(i=parents.length-1;i>=0;i--){parentRow=parents[i].row;element=this._getRowById(parentRow[pKey]);res=this._rowSelectorFromSelection({element:element});action(parentRow,res)}},_checkParent:function(parentRow,res){var pKey=this.grid.options.primaryKey,childDataKey=this.grid.options.childDataKey,parentRowId=parentRow[pKey];if(this._areAllChildrenChecked(parentRow[childDataKey])){this._checkboxStates[parentRowId]=1;res.checkbox.parent().addClass(this.css.rowSelectorChecked)}else{this._checkboxStates[parentRowId]=0;res.checkbox.parent().addClass(this.css.rowSelectorChecked)}this._alterTriStateCheckbox(res.checkbox,this._checkboxStates[parentRowId])},_uncheckParent:function(parentRow,res){var pKey=this.grid.options.primaryKey,childDataKey=this.grid.options.childDataKey,parentRowId=parentRow[pKey];if(this._hasCheckedChildren(parentRow[childDataKey])){this._checkboxStates[parentRowId]=0;this._alterTriStateCheckbox(res.checkbox,0)}else{delete this._checkboxStates[parentRowId];res.checkbox.parent().removeClass(this.css.rowSelectorChecked);this._alterTriStateCheckbox(res.checkbox)}},_changeChildrenCheckState:function(rowId,toCheck){var grid=this.grid,children=grid.dataSource.getChildrenByKey(rowId,grid.dataSource._data)||[],pKey=grid.options.primaryKey,childDataKey=grid.options.childDataKey,i,childId,child,element,res;for(i=0;i<children.length;i++){child=children[i];childId=child[pKey];element=this._getRowById(childId);res=this._rowSelectorFromSelection({element:element});if(toCheck){this._checkboxStates[childId]=1;res.checkbox.parent().addClass(this.css.rowSelectorChecked);this._alterTriStateCheckbox(res.checkbox,1)}else{delete this._checkboxStates[childId];res.checkbox.parent().removeClass(this.css.rowSelectorChecked);this._alterTriStateCheckbox(res.checkbox)}if($.type(child[childDataKey])==="array"){this._changeChildrenCheckState(childId,toCheck)}}},_areAllChildrenChecked:function(children){var i,childrenLen=children?children.length:0,pKey=this.grid.options.primaryKey,childId,state;for(i=0;i<childrenLen;i++){childId=children[i][pKey];state=this._checkboxStates[childId];if(state===null||state===undefined||state===0){return false}}return true},_hasCheckedChildren:function(children){var i,childrenLen=children?children.length:0,pKey=this.grid.options.primaryKey,childId,state;for(i=0;i<childrenLen;i++){childId=children[i][pKey];state=this._checkboxStates[childId];if(state!==undefined&&state!==null){return true}}return false},_rrn:function(){var rs=this._allRowSelectorCells(),cb=this._allCheckboxes(),cbx,i=0,self=this,sri=this.grid._startRowIndex||0,row,rowId,state;if(!this._skipRefresh){rs.removeClass(this.css.rowSelectorSelected);cb.map(function(){self._alterCheckbox($(this),false)});for(i=0;i<rs.length;i++){row=rs.eq(i).closest("tr");rowId=this.grid._fixPKValue(row.attr("data-id"));state=this._checkboxStates[rowId];if(rowId===null||rowId===undefined){rowId=i+sri}if(this.grid._selection.selection[rowId]!==undefined||state!==undefined&&state!==null){if(this.grid._selection.selection[rowId]){rs.eq(i).addClass(this.css.rowSelectorSelected)}cbx=cb.eq(i);if(cbx.length===1){if(this.options.checkBoxMode!=="triState"&&(state===undefined||state===null)){this._alterCheckbox(cbx,true)}else{this._alterTriStateCheckbox(cbx,state)}}}}}},_alterTriStateCheckbox:function(checkbox,checkState){var inner=checkbox.children().first();if(checkbox.length>0&&inner.length>0){if(checkState===0){checkbox.attr("data-chk","mixed");inner.removeClass(this.css.checkBoxOff).removeClass(this.css.checkBoxF).addClass(this.css.checkBoxP)}else if(checkState===1){checkbox.attr("data-chk","on");inner.removeClass(this.css.checkBoxOff).removeClass(this.css.checkBoxP).addClass(this.css.checkBoxF)}else{checkbox.attr("data-chk","off");inner.removeClass(this.css.checkBoxP).removeClass(this.css.checkBoxF).addClass(this.css.checkBoxOff)}}},_clearSelection:function(){var rsCells,self=this;if(this.grid.hasFixedColumns()&&this.grid.fixingDirection()==="left"){rsCells=this.grid.fixedBodyContainer().find("tbody").find("th.ui-iggrid-selectedcell").removeClass(this.css.rowSelectorSelected)}else{rsCells=this.grid.element.children("tbody").find("th.ui-iggrid-selectedcell").removeClass(this.css.rowSelectorSelected)}if(this.options.enableCheckBoxes&&this.options.checkBoxMode!=="triState"){$.each(rsCells,function(){self._alterCheckbox($(this).children("span:last"),false)});this._alterCheckbox(this._headerCheckbox(),false)}},_areAllRecordsChecked:function(sl,dvl){var size=0;for(var key in this._checkboxStates){if(this._checkboxStates.hasOwnProperty(key)){if(this._checkboxStates[key]===0){return false}if(this._checkboxStates[key]===1){size++}}}return size===dvl},_getDataView:function(){return this.grid.dataSource.flatDataView()},_getAllData:function(){if(this._flatData){return this._flatData}else{this._flatData=this.grid.dataSource.generateFlatData().flatData;return this._flatData}},_handleTriStateCheck:function(checkbox){var row,rowId,upd,sel,offset;if(!checkbox){return}upd=this.grid.element.data("igGridUpdating");sel=this._getSelectionInstance();if(sel&&sel._suspend){if(upd){if(upd.findInvalid()){return}upd._endEdit(null,true)}else{return}}offset=this._v?this.grid._startRowIndex:0;row=checkbox.parent().parent();if(this.grid.hasFixedColumns()){if(this.grid.fixedBodyContainer().attr("data-fixing-direction")==="left"){row=row.add(this.grid.element.find("tbody > tr").eq(row.index()))}else{row=row.add(this.grid.fixedBodyContainer().find("tbody > tr").eq(row.index()))}}rowId=this.grid._fixPKValue(row.attr("data-id"));if(rowId===null||rowId===undefined){rowId=row.closest("tbody").children("tr:not([data-container])").index(row)+offset}this.changeCheckStateById(rowId,checkbox.attr("data-chk")==="off");if(!this._suspendHeader){this._updateHeader()}},_handleTriStateHeaderCheck:function(checkbox){var dv=this._getDataView(),elem=this.grid.element,toCheck=checkbox.attr("data-chk")==="off",templateData,c,all;this._changeCheckStateForRows(dv,toCheck);this._alterCheckbox(checkbox,toCheck);if(this.options.enableSelectAllForPaging&&elem.data("igGridPaging")){c=this.checkedRows().length;all=this._getAllData().length;templateData=[{checked:c,unchecked:all-c,allCheckedRecords:c,totalRecordsCount:all}];this._renderOverlay(templateData,toCheck)}},_selectAllFromOverlay:function(){if(this.options.checkBoxMode==="biState"){this._changeCheckStateForAllRecords(this._getSelectionInstance(),true)}else{this._changeCheckStateForRows(this._getAllData(),true)}},_deselectAllFromOverlay:function(){if(this.options.checkBoxMode==="biState"){this._changeCheckStateForAllRecords(this._getSelectionInstance(),false)}else{this._changeCheckStateForRows(this._getAllData(),false)}},_getRowById:function(identifier){var urow,frow=$();if(this.grid.hasFixedColumns()){frow=this.grid.rowById(identifier,true)}urow=this.grid.rowById(identifier,false);return urow instanceof $?urow.add(frow):$()},_changeCheckStateForRows:function(dv,toCheck){var i,res,element,rowId,pKey=this.grid.options.primaryKey;for(i=0;i<dv.length;i++){rowId=dv[i][pKey];element=this._getRowById(rowId);res=this._rowSelectorFromSelection({element:element});this._alterCheckbox(res.checkbox,toCheck);this._changeChildrenCheckState(rowId,toCheck);this._changeParentsCheckState(rowId,toCheck)}},_changeTriStateById:function(rowId,toCheck){var element=this._getRowById(rowId),res=this._rowSelectorFromSelection({element:element}),checkbox=res.checkbox;if(toCheck){checkbox.parent().addClass("ui-state-checked")}else{checkbox.parent().removeClass("ui-state-checked")}this._alterCheckbox(checkbox,toCheck);this._changeChildrenCheckState(rowId,toCheck);this._changeParentsCheckState(rowId,toCheck)},changeCheckStateById:function(rowId,toCheck){if(this.options.checkBoxMode==="biState"){if(toCheck){this._selection.selectRowById(rowId);return}this._selection.deselectRowById(rowId);return}this._changeTriStateById(rowId,toCheck)},changeCheckState:function(index,toCheck){var pKey=this.grid.options.primaryKey,rowId=this._getDataView()[index][pKey];this.changeCheckStateById(rowId,toCheck)},toggleCheckStateById:function(rowId){var element=this._getRowById(rowId),res=this._rowSelectorFromSelection({element:element}),checkbox=res.checkbox;if(checkbox.attr("data-chk")==="off"){this.changeCheckStateById(rowId,true)}else{this.changeCheckStateById(rowId,false)}},toggleCheckState:function(index){var pKey=this.grid.options.primaryKey,rowId=this._getDataView()[index][pKey];this.toggleCheckStateById(rowId)},_getIndexForRow:function(row){return row.closest("tbody").children("tr:not([data-container])").index(row)+(this.grid._startRowIndex||0)},_rowObject:function(rowId){var rowInfo={};rowInfo.element=this._getRowById(rowId);rowInfo.index=this._getIndexForRow(rowInfo.element);return $.extend(true,{},rowInfo,{id:rowId})},_checkForRequireSelectionWithCheckboxes:function(){return this.options.requireSelection===false&&this.options.enableCheckBoxes===true&&this.options.checkBoxMode==="biState"},checkedRows:function(){var checkStateKey,rows=[];if(this.options.checkBoxMode==="biState"){if(this._ms){return this._selection.selectedRows()}return this._selection.selectedRow()?[this._selection.selectedRow()]:[]}for(checkStateKey in this._checkboxStates){if(this._checkboxStates.hasOwnProperty(checkStateKey)&&this._checkboxStates[checkStateKey]===1){rows.push(this._rowObject(this.grid._fixPKValue(checkStateKey)))}}return rows},partiallyCheckedRows:function(){var checkStateKey,rows=[];for(checkStateKey in this._checkboxStates){if(this._checkboxStates.hasOwnProperty(checkStateKey)&&this._checkboxStates[checkStateKey]===0){rows.push(this._rowObject(this.grid._fixPKValue(checkStateKey)))}}return rows},uncheckedRows:function(){var dv=this._getAllData(),rows=[],i,rowId,pKey=this.grid.options.primaryKey,checkedRows=this.options.checkBoxMode==="biState"?this.grid._selection.selection:this._checkboxStates;for(i=0;i<dv.length;i++){rowId=dv[i][pKey];if(checkedRows[rowId]===undefined||checkedRows[rowId]===null){rows.push(this._rowObject(this.grid._fixPKValue(rowId)))}}return rows},checkStateById:function(rowId){if(this.options.checkBoxMode==="biState"){return this.grid._selection.selection[rowId]?"on":"off"}if(this._checkboxStates[rowId]===undefined||this._checkboxStates[rowId]===null){return"off"}if(this._checkboxStates[rowId]===1){return"on"}if(this._checkboxStates[rowId]===0){return"partial"}}});$.extend($.ui.igTreeGridRowSelectors,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI Tree Grid 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.dataSource.js
 *	infragistics.ui.shared.js
 *	infragistics.ui.treegrid.js
 *	infragistics.util.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.grid.columnmoving.js
 */
(function($){$.widget("ui.igTreeGridColumnMoving",$.ui.igGridColumnMoving,{options:{inherit:false},_create:function(){this.element.data($.ui.igGridColumnMoving.prototype.widgetName,this.element.data($.ui.igTreeGridColumnMoving.prototype.widgetName));$.ui.igGridColumnMoving.prototype._create.apply(this,arguments)},destroy:function(){this._superApply(arguments);this.element.removeData($.ui.igGridColumnMoving.prototype.widgetName)},_injectGrid:function(grid,isRebind){$.ui.igGridColumnMoving.prototype._injectGrid.apply(this,arguments);this._fVisibleColumnKey=this.grid._visibleColumns()[0].key;this._unregisterEvents();this._registerEvents()},_updateLayout:function(){var cols,self=this,firstColChanged=false,hasVirtualization=this.grid.options.virtualization===true||this.grid.options.columnVirtualization===true||this.grid.options.rowVirtualization===true;if(this._colsSave){firstColChanged=this._fVisibleColumnKey!==this.grid._visibleColumns()[0].key;this._fVisibleColumnKey=this.grid._visibleColumns()[0].key}if(firstColChanged&&!this.grid.options.renderExpansionIndicatorColumn){if(this.grid.element.data("igTreeGridUpdating")){this.grid.element.data("igTreeGridUpdating").endEdit()}if(hasVirtualization){this.grid._renderVirtualRecords()}else{this.grid._renderRecords()}if(this.grid.element.data("igTreeGridSorting")){this.grid.element.data("igTreeGridSorting")._initDefaultSettings()}}if(!this._gridReady()){setTimeout(function(){self._updateLayout()},50);return}if(this.grid._oldCols){cols=$.grep(this.grid._oldCols,$.proxy(this.grid._columnVisible,this))}else{cols=this.grid._visibleColumns()}this._hscroller=this.grid._hscrollbarcontent();this._hscroller=this._hscroller.length>0?this._hscroller:this.grid.scrollContainer();this._cache.columns={};this._cache.siblings={};this._cache.fixedSiblings={};this._updateLayoutPerLevel(cols,true);this._createMovingOptions();delete this._movingDirty},_registerEvents:function(){this.grid.element.bind("igtreegridheadercellrendered",this._headerCellRenderedHandler);this.grid.element.bind("igtreegridheaderrendering",this._headerRenderingHandler);this.grid.element.bind("igtreegridheaderrendered",this._headerRenderedHandler);this.grid.element.bind("igtreegridrendered",this._gridFullyRenderedHandler);this.grid.element.bind("igtreegridresizingcolumnresized",this._columnStateChanged);this.grid.element.bind("igtreegridcolumnscollectionmodified",this._columnStateChanged);this.grid.element.bind("igtreegridpagingpagingdropdownrendered",this._columnStateChanged);this.grid.element.bind("igtreegrid_columnsmoved",this._columnStateChanged)},_unregisterEvents:function(){this.grid.element.unbind("igtreegridheadercellrendered",this._headerCellRenderedHandler);this.grid.element.unbind("igtreegridheaderrendering",this._headerRenderingHandler);this.grid.element.unbind("igtreegridheaderrendered",this._headerRenderedHandler);this.grid.element.unbind("igtreegridrendered",this._gridFullyRenderedHandler);this.grid.element.unbind("igtreegridresizingcolumnresized",this._columnStateChanged);this.grid.element.unbind("igtreegridcolumnscollectionmodified",this._columnStateChanged);this.grid.element.unbind("igtreegridpagingpagingdropdownrendered",this._columnStateChanged);this.grid.element.unbind("igtreegrid_columnsmoved",this._columnStateChanged);this.grid.headersTable().find("th").unbind("moving")}});$.extend($.ui.igTreeGridColumnMoving,{version:"21.2.12"})})($);/*!@license
 * Infragistics.Web.ClientUI Tree Grid 21.2.12
 *
 * Copyright (c) 2011-2022 Infragistics Inc.
 *
 * http://www.infragistics.com/
 *
 * Depends on:
 *	jquery-1.9.1.js
 *	jquery.ui.core.js
 *	jquery.ui.widget.js
 *	infragistics.dataSource.js
 *	infragistics.ui.shared.js
 *	infragistics.ui.treegrid.js
 *	infragistics.util.js
 *	infragistics.ui.grid.framework.js
 *	infragistics.ui.grid.resizing.js
 */
(function($){$.widget("ui.igTreeGridResizing",$.ui.igGridResizing,{options:{inherit:false},css:{},_create:function(){this.element.data($.ui.igGridResizing.prototype.widgetName,this.element.data($.ui.igTreeGridResizing.prototype.widgetName));$.ui.igGridResizing.prototype._create.apply(this,arguments)},destroy:function(){this._superApply(arguments);this.element.removeData($.ui.igGridResizing.prototype.widgetName)}});$.extend($.ui.igTreeGridResizing,{version:"21.2.12"})})($)});