@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
1 lines • 188 kB
JavaScript
module.exports=function(r){var i={};function a(e){if(i[e])return i[e].exports;var t=i[e]={exports:{},id:e,loaded:!1};return r[e].call(t.exports,t,t.exports,a),t.loaded=!0,t.exports}return a.m=r,a.c=i,a.p="",a(0)}({0:function(e,t,r){e.exports=r(1300)},3:function(e,t){e.exports=function(){throw Error("define cannot be used indirect")}},1060:function(e,t){e.exports=require("jquery")},1063:function(e,t){e.exports=require("./kendo.data")},1089:function(e,t){e.exports=require("./kendo.html.button")},1093:function(e,t){e.exports=require("./kendo.selectable")},1120:function(e,t){e.exports=require("./kendo.filtermenu")},1220:function(e,t){e.exports=require("./kendo.resizable")},1221:function(e,t){e.exports=require("./kendo.window")},1273:function(e,t){e.exports=require("./kendo.dialog")},1282:function(e,t){e.exports=require("./kendo.editable")},1285:function(e,t){e.exports=require("./kendo.switch")},1290:function(e,t){e.exports=require("./kendo.pdf")},1300:function(e,t,r){var i,vi;vi=r(1060),r(3),r=[r(1063),r(1301),r(1282),r(1221),r(1120),r(1302),r(1303),r(1304),r(1305),r(1093),r(1306),r(1307),r(1220),r(1308),r(1309),r(1310),r(1311),r(1290),r(1273),r(1310),r(1285),r(1089)],void 0===(t="function"==typeof(i=function(){var e={id:"grid",name:"Grid",category:"web",description:"The Grid widget displays tabular data and offers rich support for interacting with data,including paging, sorting, grouping, and selection.",depends:["data","columnsorter","sortable","html.button"],features:[{id:"grid-editing",name:"Editing",description:"Support for record editing",depends:["editable","window"]},{id:"grid-filtering",name:"Filtering",description:"Support for record filtering",depends:["filtermenu"]},{id:"grid-columnmenu",name:"Column menu",description:"Support for header column menu",depends:["columnmenu"]},{id:"grid-grouping",name:"Grouping",description:"Support for grid grouping",depends:["groupable"]},{id:"grid-filtercell",name:"Row filter",description:"Support for grid header filtering",depends:["filtercell"]},{id:"grid-paging",name:"Paging",description:"Support for grid paging",depends:["pager"]},{id:"grid-selection",name:"Selection",description:"Support for row selection",depends:["selectable"]},{id:"grid-column-reorder",name:"Column reordering",description:"Support for column reordering",depends:["reorderable"]},{id:"grid-column-resize",name:"Column resizing",description:"Support for column resizing",depends:["resizable"]},{id:"grid-mobile",name:"Grid adaptive rendering",description:"Support for adaptive rendering",depends:["dialog","pane","switch"]},{id:"grid-excel-export",name:"Excel export",description:"Export grid data as Excel spreadsheet",depends:["excel"]},{id:"grid-pdf-export",name:"PDF export",description:"Export grid data as PDF",depends:["pdf","drawing","progressbar"]}]},a,E=window.kendo.jQuery,R=void 0,D=window.kendo,b=D.ui,m=D.data.DataSource,l=D.data.ObservableObject,o=D.support.tbodyInnerHtml,u=D._activeElement,n=b.Widget,z=D._outerWidth,_=D._outerHeight,d=D.keys,q=E.isPlainObject,T=E.extend,v=E.map,A=E.grep,p=Array.isArray,F=E.inArray,c=Array.prototype.push,f=D.isFunction,h=E.isEmptyObject,s=E.contains,g=Math,I=".",w="progress",C="error",y="k-hierarchy-cell",S=":not(.k-group-cell):not(["+D.attr("virtual")+"]):not(.k-hierarchy-cell:not(:has(.k-icon.k-i-collapse,.k-icon.k-i-expand))):visible",i="tbody>tr:not(.k-grouping-row):not(.k-detail-row):not(.k-group-footer) > td:not(.k-group-cell):not(.k-hierarchy-cell)",M="tr:not(.k-footer-template):visible",P=":not(.k-group-cell):not(.k-detail-cell):not(.k-hierarchy-cell):visible",W="tr:not(.k-grouping-row):not(.k-detail-row):not(.k-footer-template):not(.k-group-footer):visible",V="col:not(.k-group-col, .k-hierarchy-col)",B="th.k-header:not(.k-group-cell):not(.k-hierarchy-cell)",t=".k-grid.k-widget",k=".kendoGrid",O="k-grid-content-locked",G="k-group-cell",N="edit",U="beforeEdit",K="save",j="remove",$="detailInit",Q="filterMenuInit",J="columnMenuInit",Y="filterMenuOpen",X="columnMenuOpen",Z="cellClose",ee="change",te="columnHide",re="columnShow",r="saveChanges",ie="dataBound",ae="detailExpand",le="detailCollapse",oe="itemchange",ne="page",se="paging",de="scroll",ce="sync",ue="loadStart",fe="loadEnd",pe="k-state-focused",he=":kendoFocusable",ge="k-state-selected",me="k-checkbox",ve="input[data-role='checkbox']."+me,ke="k-grid-norecords",be="k-link",_e="k-icon",we="k-sort-order",Ce="k-sorted",ye="k-header-column-menu",Se="k-grid-filter",Te="k-grid-content-sticky",xe="k-grid-header-sticky",He="k-grid-footer-sticky",Re="k-grid-no-left-border",Ie="resize",Ee="columnResize",De="columnReorder",Ae="columnLock",Fe="columnUnlock",Le="columnStick",ze="columnUnstick",qe="rowReorder",Me="navigate",Pe="click",We="mousedown",Ve="height",Be="tabIndex",Oe="function",Ge="string",Ne="bottom",Ue="container-for",Ke="field",je="input",$e="incell",Qe="inline",Je="uid",Ye=1,Xe="colSpan",Ze="overflow",et="hidden",tt="sort",rt="group-sort",it="Are you sure you want to delete this record?",at="No records available.",lt="Delete",ot="Cancel",nt="Collapse",st="Expand",dt="aria-label",ct=/(\}|\#)/gi,ut=/#/gi,ft="[\\x20\\t\\r\\n\\f]",pt=new RegExp("(\\s*left\\s*:\\s*\\d*px;?)*","ig"),ht=new RegExp("(\\s*right\\s*:\\s*\\d*px;?)*","ig"),gt=new RegExp("(^|"+ft+")"+"(k-group-cell|k-hierarchy-cell)"+"("+ft+"|$)"),mt=new RegExp("(^|"+ft+")"+"(k-filter-row)"+"("+ft+"|$)"),vt='<button type="button" class="#=className#" #=attr#>#=text#</button>',kt='<input class="'+me+' k-checkbox-md k-rounded-md" data-role="checkbox" aria-label="Select row" aria-checked="false" type="checkbox">',bt='<input class="'+me+' k-checkbox-md k-rounded-md" data-role="checkbox" aria-label="Select all rows" aria-checked="false" type="checkbox">',_t='<span class="k-icon k-i-reorder"></span>',wt='<span class="k-cell-inner"><span class="k-link"><span class="k-column-title">#=text#</span></span></span>',Ct=false,yt=D.support.browser,St=yt.msie&&yt.version===11,Tt=/Mac OS/.test(navigator.userAgent),xt={content:"k-content",widget:"k-widget",scrollContainer:"k-scroll-container",headerCellInner:"k-cell-inner"};if(b.Pager)a=b.Pager.extend({init:function(e,t){b.Pager.fn.init.call(this,e,T(true,{},t));this.dataSource.options.useRanges=true;this.dataSource._omitPrefetch=true},options:{name:"GroupsPager"},totalPages:function(){var e=this;return Math.ceil((e._collapsedTotal()||0)/(e.pageSize()||1))},_collapsedTotal:function(){var e=this.dataSource;return e?e.groupsTotal(true)||0:0}});var Ht=n.extend({init:function(e,t){var r=this;n.fn.init.call(r,e,t);r._refreshHandler=r.refresh.bind(r);r.setDataSource(t.dataSource);r.wrap()},setDataSource:function(e){var t=this;if(t.dataSource)t.dataSource.unbind(ee,t._refreshHandler);t.dataSource=e;t.dataSource.bind(ee,t._refreshHandler);t.dataSource.options.useRanges=true;t.dataSource.options.virtual=true},options:{name:"VirtualScrollable",itemHeight:E.noop,prefetch:true,maxScrollHeight:25e4},events:[se,ne,de,ue,fe],destroy:function(){var e=this;n.fn.destroy.call(e);e.dataSource.unbind(ee,e._refreshHandler);e.wrapper.add(e.verticalScrollbar).off(k);clearTimeout(e._timeout);if(e._scrollingTimeout)clearTimeout(e._scrollingTimeout);if(e.drag){e.drag.destroy();e.drag=null}e.wrapper=e.element=e.verticalScrollbar=null;e._refreshHandler=null},wrap:function(){var t=this,e=D.support.scrollbar()+1,r=t.element,i;r.css({width:"auto",overflow:"hidden"}).css(Ct?"padding-left":"padding-right",e);t.content=r.children().first();i=t.wrapper=t.content.wrap('<div class="k-virtual-scrollable-wrap"/>').parent().on("DOMMouseScroll"+k+" mousewheel"+k,t._wheelScroll.bind(t));t._wrapper();if(D.support.kineticScrollNeeded||D.support.touch){t.wrapper.css("touch-action","none");t.drag=new D.UserEvents(t.wrapper,{global:true,allowSelection:true,start:function(e){e.sender.capture()},move:function(e){t.verticalScrollbar.scrollTop(t.verticalScrollbar.scrollTop()-e.y.delta);D.scrollLeft(i,D.scrollLeft(i)-e.x.delta);e.preventDefault()}})}t.verticalScrollbar=E('<div class="k-scrollbar k-scrollbar-vertical" />').css({width:e}).appendTo(r).on("scroll"+k,t._scroll.bind(t))},_wrapper:function(){var e=this;if(St){e.wrapper.css({"overflow-y":de});e.element.css(Ct?"padding-left":"padding-right",0)}},_wheelScroll:function(e){if(e.ctrlKey)return;var t=this.verticalScrollbar,r=t.scrollTop(),i=D.wheelDeltaY(e);if(i&&!(i>0&&r===0)&&!(i<0&&r+t[0].clientHeight==t[0].scrollHeight)){e.preventDefault();this.verticalScrollbar.scrollTop(r+-i)}},_scroll:function(e){var t=this,r=!t.options.prefetch,i=e.currentTarget.scrollTop,a=t.dataSource,l=t.itemHeight,o=a.skip()||0,c=t._rangeStart||o,n=t.element.innerHeight(),s=!!(t._scrollbarTop&&t._scrollbarTop>i),d=g.max(g.floor(i/l),0),u=s?g.ceil(n/l):g.floor(n/l),f=g.max(d+u,0);if(t._preventScroll){t._preventScroll=false;return}t._prevScrollTop=t._scrollTop;t._scrollTop=i-c*l;t._scrollbarTop=i;t._scrolling=r;if(!t._fetch(d,f,s))t.wrapper[0].scrollTop=t._scrollTop;t.trigger(de);if(r){if(t._scrollingTimeout)clearTimeout(t._scrollingTimeout);t._scrollingTimeout=setTimeout(function(){t._scrolling=false;t._page(t._rangeStart,t.dataSource.take())},100)}},scrollToTop:function(){this._scrollTo(0)},scrollToBottom:function(){var e=this.verticalScrollbar;this._scrollTo(e[0].scrollHeight-e.height())},_scrollWrapperToTop:function(){this.wrapper.scrollTop(0)},_scrollWrapperToBottom:function(){this.wrapper.scrollTop(this.wrapper[0].scrollHeight)},_scrollWrapperOnColumnResize:function(){var e=this;var t=this.wrapper;var r=t.scrollTop();if(t[0].scrollWidth>t[0].clientWidth){if(!e._wrapperScrolled&&r||e._isScrolledToBottom()){t.scrollTop(r+D.support.scrollbar());e._scrollTop=t.scrollTop();e._wrapperScrolled=true}}else if(e._wrapperScrolled){if(!e._isWrapperScrolledToBottom()){t.scrollTop(r-D.support.scrollbar());e._scrollTop=t.scrollTop()}e._wrapperScrolled=false}},_scrollTo:function(e){var t=this;var r=t.verticalScrollbar;if(r.scrollTop()!==e)t._preventScroll=true;t.wrapper.scrollTop(e);t._scrollTop=t.wrapper.scrollTop();r.scrollTop(e);t._scrollbarTop=r.scrollTop()},_isScrolledToTop:function(){return this.verticalScrollbar.scrollTop()===0},_isScrolledToBottom:function(){var e=this.verticalScrollbar;var t=e.scrollTop();return t>0&&t>=parseInt(e[0].scrollHeight-e.height(),10)},_isWrapperScrolledToBottom:function(){var e=this.wrapper;return e.scrollTop()>=parseInt(e[0].scrollHeight-e.height(),10)},itemIndex:function(e){var t=this._rangeStart||this.dataSource.skip()||0;return t+e},position:function(e){var t=this._rangeStart||this.dataSource.skip()||0;var r=this.dataSource.pageSize();var i;if(e>t)i=e-t;else i=t-e-1;return i>r?r:i},scrollIntoView:function(e){var t=this.wrapper[0];var r=t.clientHeight;var i=!this._isScrolledToBottom()?this._scrollTop||t.scrollTop:t.scrollTop;var a=e[0].offsetTop;var l=e[0].offsetHeight;if(i>a)this.verticalScrollbar[0].scrollTop-=r/2;else if(a+l>=i+r)this.verticalScrollbar[0].scrollTop+=r/2},_fetch:function(e,t,c){var r=this,i=r.dataSource,a=r.itemHeight,l=i.take(),o=r._rangeStart||i.skip()||0,n=g.floor(e/l)*l,s=false,u=.33;var d=r.verticalScrollbar;var f=yt.webkit?1:0;var p=i._isGroupPaged()?i.groupsTotal(true):i.total();if(e<o){s=true;o=g.max(0,t-l);r._scrollTop=d.scrollTop()-o*a;r._page(o,l)}else if(t>=o+l&&!c){s=true;o=g.min(e,p-l);if(d.scrollTop()>=d[0].scrollHeight-d[0].offsetHeight-f)r._scrollTop=r.wrapper[0].scrollHeight-r.wrapper[0].offsetHeight;else if(r.dataSource._isGroupPaged()&&e>=p-l)r._scrollTop=r.wrapper[0].scrollHeight-r.wrapper[0].offsetHeight-(r._scrollTop-r._prevScrollTop);else r._scrollTop=a;r._page(o,l)}else if(!r._fetching&&r.options.prefetch){if(e<n+l-l*u&&e>l)i.prefetch(n-l,l,E.noop);if(t>n+l*u)i.prefetch(n+l,l,E.noop)}return s},fetching:function(){return this._fetching},_page:function(e,t,r){var i=this,a=!i.options.prefetch,l=i.dataSource,o=l._isGroupPaged();r=f(r)?r:E.noop;if(i.trigger(se,{skip:e,take:t}))return;clearTimeout(i._timeout);i._fetching=true;i._rangeStart=e;if(o&&l._groupRangeExists(e,e+t)||!o&&l.inRange(e,t)){i.trigger(ue);l.range(e,t,function(){i.trigger(fe);r();i.trigger(ne)},"page")}else{if(!a)i.trigger(ue);i._timeout=setTimeout(function(){if(!i._scrolling){if(a)i.trigger(ue);l.range(e,t,function(){i.trigger(fe);r();i.trigger(ne)})}},100)}},repaintScrollbar:function(e){var t=this,r="",i=t.options.maxScrollHeight,a=t.dataSource,l=!D.support.kineticScrollNeeded?D.support.scrollbar():0,o=t.wrapper[0],n,s,d;var c=t._isScrolledToBottom();d=t.itemHeight=t.options.itemHeight()||0;var u=o.scrollWidth>o.offsetWidth?l:0;n=(a._isGroupPaged()?a.groupsTotal(true):a.total())*d+u;for(s=0;s<g.floor(n/i);s++)r+='<div style="width:1px;height:'+i+'px"></div>';if(n%i)r+='<div style="width:1px;height:'+n%i+'px"></div>';t.verticalScrollbar.html(r);if(c&&!t._isScrolledToBottom()&&!t.dataSource._isGroupPaged())t.scrollToBottom();if(typeof t._scrollTop!=="undefined"&&!!e){o.scrollTop=t._scrollTop;t._scrollWrapperOnColumnResize()}},refresh:function(e){var t=this,r=t.dataSource,i=t._rangeStart;var a=(e||{}).action;var l=t._isScrolledToBottom()||!a||a!==oe&&a!==j&&a!==ce;t.trigger(fe);clearTimeout(t._timeout);t.repaintScrollbar(l);if(t.drag)t.drag.cancel();if(typeof i!=="undefined"&&!t._fetching){if(!a||a!==ce&&a!==oe&&a!=="expandGroup")t._rangeStart=r.skip();if(r.page()===1&&(!a||a!==ce&&a!==oe&&a!=="expandGroup"&&a!=="collapseGroup"))t.verticalScrollbar[0].scrollTop=0}t._fetching=false}});function Rt(e,t){return"["+D.attr(e)+"="+t+"]"}function It(e){return new Array(e+1).join('<td class="k-group-cell"> </td>')}function Et(e){var t,r=" ";if(e){if(typeof e===Ge)return e;for(t in e)if(e[t]!=="")r+=t+'="'+e[t]+'"'}return r}var Dt={create:{text:"Add new record",className:"k-grid-add",iconClass:"k-icon k-i-plus"},cancel:{text:"Cancel changes",className:"k-grid-cancel-changes",iconClass:"k-icon k-i-cancel"},save:{text:"Save changes",className:"k-grid-save-changes",iconClass:"k-icon k-i-check"},destroy:{text:"Delete",className:"k-grid-delete",iconClass:"k-icon k-i-close"},edit:{text:"Edit",className:"k-grid-edit",iconClass:"k-icon k-i-edit"},update:{text:"Update",className:"k-grid-update",iconClass:"k-icon k-i-check",themeColor:"primary"},canceledit:{text:"Cancel",className:"k-grid-cancel",iconClass:"k-icon k-i-cancel"},excel:{text:"Export to Excel",className:"k-grid-excel",iconClass:"k-icon k-i-file-excel"},pdf:{text:"Export to PDF",className:"k-grid-pdf",iconClass:"k-icon k-i-file-pdf"},search:{text:"Search...",className:"k-grid-search"}};function At(e,t){E("th, th .k-grid-filter, th .k-link",e).add(document.body).css("cursor",t)}function Ft(e,t,r,i,a){var l=t;t=E();a=a||1;for(var o=0;o<a;o++)t=t.add(e.eq(l+o));if(typeof r=="number")t[i?"insertBefore":"insertAfter"](e.eq(r));else t.appendTo(r)}function Lt(e,t,r){return E(e).add(t).find(r)}function zt(e,t,r){var i,a,l,o;r=!p(r)?[r]:r;for(i=0,a=r.length;i<a;i++){l=r[i];if(q(l)&&l.click){o=l.name||l.text;t.on(Pe+k,".k-grid-"+(o||"").replace(/\s/g,""),{commandName:o},l.click.bind(e))}}}function qt(e,i,a,l,o){return v(e,function(e){e=typeof e===Ge?{field:e}:e;var t;e.parentIds=o;if(!Kt(e)||a){e.attributes=Fr(e.attributes);e.footerAttributes=Fr(e.footerAttributes);e.headerAttributes=Fr(e.headerAttributes);t=true}var r=D.guid();if(l&&!e.locked)e.locked=l;e.headerAttributes=T({headers:o},e.headerAttributes);if(!e.headerAttributes.id){e.headerAttributes=T({id:r},e.headerAttributes);e.uid=r}else r=e.headerAttributes.id;if(e.columns)e.columns=qt(e.columns,i,t,e.locked,o?o+" "+r:r);return T({encoded:i,hidden:t,locked:l},e)})}function Mt(e,t){var r=[];Pt(e,t,r);return r[r.length-1]}function Pt(e,t,r){r=r||[];for(var i=0;i<t.length;i++)if(e===t[i])return true;else if(t[i].columns){var a=r.length;r.push(t[i]);if(!Pt(e,t[i].columns,r))r.splice(a,r.length-a);else return true}return false}function Wt(e,t){Vt(e,t,t)}function Vt(e,t,r){var i=r?zr:Fr;e.hidden=!t;e.attributes=i(e.attributes);e.footerAttributes=i(e.footerAttributes);e.headerAttributes=i(e.headerAttributes)}function Bt(e,t){Ot(e);var r=e._hideByMedia;Vt(e,t,r?e.matchesMedia:t)}function Ot(e){e.matchesMedia=Gt(e)}function Gt(e){return e&&($t(e.media)||!$t(e.media)&&D.matchesMedia(e.media))}function Nt(){return this.style.display!=="none"}function Ut(e){return E(e)[0].style.display!=="none"}function Kt(e){return x([e]).length>0}function x(e){return A(e,function(e){var t=!e.hidden&&e.matchesMedia!==false;if(t&&e.columns)t=x(e.columns).length>0;return t})}function jt(e){var t=[];var r;for(var i=0;i<e.length;i++){r=e[i];if(!$t(r.media)){if(!$t(r.minScreenWidth))throw new Error("Using 'media' and 'minScreenWidth' options at the same time is not supported.");t.push(r)}if(r.columns)t=t.concat(jt(r.columns))}return t}function $t(e){return typeof e==="undefined"}function Qt(e){return E(e).map(function(){return this.toArray()})}function Jt(e,t,r){var i=er(H(t));var a=er(_r(t));var l=e.rowSpan;if(r)if(i>a)e.rowSpan=l-(i-a)||1;else e.rowSpan=l+(a-i);else if(i>a)e.rowSpan=l+(i-a);else e.rowSpan=l-(a-i)||1}function Yt(e,t){for(var r=0;r<e.length;r++)if(e[r].field==t)return e[r]}function Xt(e,t,r,i,a,l,o,n){var s=er(e);var d=er([t]);if(s>d){var c=new Array(o+1).join('<th class="k-group-cell k-header" scope="col"> </th>');var u=l.children(":not(.k-filter-row)");E(new Array(s-d+1).join("<tr>"+c+"</tr>")).insertAfter(u.last())}pr(l,s-d);tr(r,i,a,l,n)}function Zt(e,t,r){r=r||0;var i;var a;var l=t;t=L(t);var o={};var n=e.find(">tr:not(.k-filter-row)");var s=function(){var e=E(this);return!e.hasClass("k-group-cell")&&!e.hasClass("k-hierarchy-cell")};for(var d=0,c=t.length;d<c;d++){i=rr(t[d],l);if(!o[i.row])o[i.row]=n.eq(i.row).find(".k-header").filter(s);a=o[i.row].eq(i.cell);a.attr(D.attr("index"),r+d)}return t.length}function er(e){var t=1;var r=0;for(var i=0;i<e.length;i++)if(e[i].columns){var a=er(e[i].columns);if(a>r)r=a}return t+r}function tr(e,t,r,i,a){var l=lr(e[0],t);var o=r.find(">tr:not(.k-filter-row)").eq(l.row).children("th.k-header");var n=E();var c=l.cell;var s;for(s=0;s<e.length;s++)n=n.add(o.eq(c+s));i.find(">tr:not(.k-filter-row)").eq(l.row)[a](n);var d=[];for(s=0;s<e.length;s++)if(e[s].columns)d=d.concat(e[s].columns);if(d.length)tr(d,t,r,i,a)}function rr(e,t,r,i){var a;var l;r=r||0;i=i||{};i[r]=i[r]||0;for(l=0;l<t.length;l++){if(t[l]==e){a={cell:i[r],row:r};break}else if(t[l].columns){a=rr(e,t[l].columns,r+1,i);if(a)break}i[r]++}return a}function ir(e,t,r,i){var a;var l=!!r.locked;var o;do{a=e[t];t+=i?1:-1;o=!!a.locked}while(a&&t>-1&&t<e.length&&a!=r&&!a.columns&&o===l);return a}function ar(e,t,r,i,a){if(t.columns){t=t.columns;return t[i?0:t.length-1]}else{var l=Mt(t,e);var o;if(l)o=l.columns;else o=e;var n=F(t,o);if(n===0&&i)n++;else if(n==o.length-1&&!i||!r.locked&&!t.columns&&!i)n--;else if(n>0||n===0&&!i)n++;var s=F(r,o);t=ir(o,n,r,s>n);var d=F(t,a);if(t.columns&&(!d||d===o.length-1))return null;if(t&&t!=r&&t.columns)return ar(e,t,r,i,a)}return null}function lr(e,t,r,i){var a;var l;r=r||0;i=i||{};i[r]=i[r]||0;for(l=0;l<t.length;l++){if(t[l]==e){a={cell:i[r],row:r};break}else if(t[l].columns){a=lr(e,t[l].columns,r+1,i);if(a)break}if(!t[l].hidden)i[r]++}return a}function or(e){var t=sr(H(e));return t.concat(sr(_r(e)))}function nr(e,t,r,i){var a=e[r];var l=e[i];var o=Mt(a,t);t=o?o.columns:t;return F(l,t)}function sr(e){var t=[];var r=[];for(var i=0;i<e.length;i++){t.push(e[i]);if(e[i].columns)r=r.concat(e[i].columns)}if(r.length)t=t.concat(sr(r));return t}function dr(e){var t=0;var r;for(var i=0;i<e.length;i++){r=e[i];if(r.columns)t+=dr(r.columns);else if(r.hidden)t++}return t}function cr(e){var t=0;for(var r=0,i=e.length;r<i;r++)if(!e[r].hidden)t+=parseInt(e[r].width,10);return t}function ur(e){var t,r=0;for(var i=0,a=e.length;i<a;i++){t=e[i].style.width;if(t&&t.indexOf("%")==-1)r+=parseInt(t,10)}return r}function fr(e,t){var r=e.find("tr:not(.k-filter-row) th:not(.k-group-cell,.k-hierarchy-cell)");var i;for(var a=0;a<r.length;a++){i=r[a].rowSpan;if(i>1)r[a].rowSpan=i-t||1}}function pr(e,t){var r=e.find("tr:not(.k-filter-row) th:not(.k-group-cell,.k-hierarchy-cell)");for(var i=0;i<r.length;i++)r[i].rowSpan+=t}function hr(e){var t=e.find("tr:not(.k-filter-row)");var r=t.filter(function(){return!E(this).children().length}).remove().length;var i=t.find("th:not(.k-group-cell,.k-hierarchy-cell)");for(var a=0;a<i.length;a++)if(i[a].rowSpan>1)i[a].rowSpan-=r;return t.length-r}function gr(e,t,r,i,a){var l,o,n,s=[];for(l=0,n=e.length;l<n;l++){o=r[i]||[];o.push(t.eq(a+l));r[i]=o;if(e[l].columns)s=s.concat(e[l].columns)}if(s.length)gr(s,t,r,i+1,a+e.length)}function mr(e,t,r){e.css({left:t,right:r})}function vr(e,t,r){e[t]=e[t]||{};e[t][r]=e[t][r]||""}function kr(e,t,r,i){vr(e,t,r);if(e[t][r]!=="")e[t][r]+=" "+i;else e[t][r]=i}function br(e,t,r,i){vr(e,t,r);e[t][r]=e[t][r].replace(i,"")}function H(e){return A(e,function(e){return e.locked})}function _r(e){return A(e,function(e){return!e.locked})}function wr(e){return A(e,function(e){return e.sticky&&!e.locked})}function Cr(e){return A(e,function(e){return e.sticky&&!e.locked&&Kt(e)})}function yr(e){return A(e,function(e){return!e.locked&&Kt(e)})}function Sr(e){return A(e,function(e){return e.locked&&Kt(e)})}function Tr(e){var t=[];for(var r=0;r<e.length;r++){if(e[r].hidden)continue;if(e[r].columns)t=t.concat(Tr(e[r].columns));else t.push(e[r])}return t}function xr(e){var t=[];for(var r=0;r<e.length;r++)if(e[r].columns)t=t.concat(e[r].columns);return t}function Hr(e){var t=xr(e);t=t.filter(function(e){return!e.hidden});return t}function L(e){var t=[];for(var r=0;r<e.length;r++){if(!e[r].columns){t.push(e[r]);continue}t=t.concat(L(e[r].columns))}return t}function Rr(e){var t=[];e=L(e);for(var r=0;r<e.length;r++)if(typeof e[r]==="string")t.push(e[r]);else if(e[r].field)t.push(e[r].field);return t}function Ir(e){var t=e.find(">tr:not(.k-filter-row)");var r=function(){var e=E(this);return!e.hasClass("k-group-cell")&&!e.hasClass("k-hierarchy-cell")};var i=E();if(t.length>1)i=t.find("th").filter(r).filter(function(){return this.rowSpan>1});i=i.add(t.last().find("th").filter(r));var a=D.attr("index");i.sort(function(e,t){e=E(e);t=E(t);var r=e.attr(a);var i=t.attr(a);if(r===R)r=E(e).index();if(i===R)i=E(t).index();r=parseInt(r,10);i=parseInt(i,10);return r>i?1:r<i?-1:0});return i}function Er(e){var c=e.closest("table");var t=E().add(e);var r=e.closest("tr");var i=c.find("tr:not(.k-filter-row)");var a=i.index(r);if(a>0){var u=i.eq(a-1);var l=u.find("th:not(.k-group-cell,.k-hierarchy-cell)").filter(function(){return!E(this).attr("rowspan")});var o=0;var n=r.find("th:not(.k-group-cell,.k-hierarchy-cell)").index(e);var f=e.prevAll(":not(.k-group-cell,.k-hierarchy-cell)").filter(function(){return this.colSpan>1});for(var s=0;s<f.length;s++)o+=f[s].colSpan||1;n+=Math.max(o-1,0);o=0;for(s=0;s<l.length;s++){var d=l.eq(s);if(d.attr("data-colspan"))o+=d[0].getAttribute("data-colspan");else o+=1;if(n>=s&&n<o){t=Er(d).add(t);break}}}return t}function Dr(e){var c=e.closest("thead");var t=E().add(e);var r=e.closest("tr");var i=c.find("tr:not(.k-filter-row)");var u=i.index(r)+e[0].rowSpan;var a=D.attr("colspan");if(u<=i.length-1){var l=r.next();var o=e.prevAll(":not(.k-group-cell,.k-hierarchy-cell)");var n;o=o.filter(function(){return!this.rowSpan||this.rowSpan===1});var s=0;for(n=0;n<o.length;n++)s+=parseInt(o.eq(n).attr(a),10)||1;var f=l.find("th:not(.k-group-cell,.k-hierarchy-cell)");var d=parseInt(e.attr(a),10)||1;n=0;while(n<d){l=f.eq(n+s);t=t.add(Dr(l));var p=parseInt(l.attr(a),10);if(p>1)d-=p-1;n++}}return t}function Ar(e,t,r,i){var a,l=e;if(i)e.empty();if(o)e[0].innerHTML=r;else{a=document.createElement("div");a.innerHTML="<table><tbody>"+r+"</tbody></table>";e=a.firstChild.firstChild;t[0].replaceChild(e,l[0]);e=E(e)}return e}function Fr(e){e=e||{};var t=e.style;if(!t)t="display:none";else{t=t.replace(/display:[^;]*/i,"display:none");if(!t.match(/display:/i))t=t.replace(/(.*)?/i,"display:none;$1")}return T({},e,{style:t})}function Lr(e){e=e||{};var t=e.style||"";return t.indexOf("display:none")!==-1}function zr(e){e=e||{};var t=e.style;if(t)e.style=t.replace(/(display\s*:\s*none\s*;?)*/gi,"");return e}function qr(e,t,r,i){var a=e.find(">colgroup"),l,o=v(t,function(e){l=e.width;if(l&&parseInt(l,10)!==0)return D.format('<col style="width:{0}"/>',typeof l===Ge?l:l+"px");return"<col />"});if(r||a.find(".k-hierarchy-col").length)o.splice(0,0,'<col class="k-hierarchy-col" />');if(a.length)a.remove();a=E(new Array(i+1).join('<col class="k-group-col">')+o.join(""));if(!a.is("colgroup"))a=E("<colgroup/>").append(a);e.prepend(a)}function Mr(e,t){var r=0;var i,a;var l=e.find("th:not(.k-group-cell)");for(i=0,a=t.length;i<a;i++)if(t[i].locked){l.eq(i).insertBefore(l.eq(r));l=e.find("th:not(.k-group-cell)");r++}}function Pr(e){var t={},r,i,a;for(i=0,a=e.length;i<a;i++){r=e[i];t[r.value]=r.text}return t}function Wr(e,t,r,i){var a=r&&r.length&&q(r[0])&&"value"in r[0],l=a?Pr(r)[e]:e;l=l!=null?l:"";return t?D.format(t,l):i===false?l:D.htmlEncode(l)}function Vr(e,t,r){var i=0,a,l=e[i];while(l){a=r?true:l.style.display!=="none";if(a&&!gt.test(l.className)&&--t<0){l.style.display=r?"":"none";break}l=e[++i]}}function Br(e,t){var r=0,i=e.length,a,l;for(;r<i;r+=1){l=e.eq(r);if(l.is(".k-grouping-row,.k-detail-row")){a=l.children(":not(.k-group-cell):first,.k-detail-cell").last();a.attr("colspan",parseInt(a.attr("colspan"),10)-1)}else{if(l.hasClass("k-grid-edit-row")&&(a=l.children(".k-edit-container")[0])){a=E(a);a.attr("colspan",parseInt(a.attr("colspan"),10)-1);a.find("col").eq(t).remove();l=a.find("tr").first()}Vr(l[0].cells,t,false)}}}function Or(e){var t=[];var r;for(var i=0;i<e.length;i++){r=e[i];if(!("field"in r&&"value"in r&&"items"in r))break;t.push(r);if(r.hasSubgroups)t=t.concat(Or(r.items))}return t}function Gr(e){var t=[];var r;for(var i=0;i<e.length;i++){r=e[i];if(!("field"in r&&"value"in r&&"items"in r))break;if(r.hasSubgroups)t=t.concat(Gr(r.items));t.push(r.aggregates)}return t}function Nr(e,t){var r=0,i=e.length,a,l,o;for(;r<i;r+=1){l=e.eq(r);if(l.is(".k-grouping-row,.k-detail-row")){a=l.children(":not(.k-group-cell):first,.k-detail-cell").last();a.attr("colspan",parseInt(a.attr("colspan"),10)+1)}else{if(l.hasClass("k-grid-edit-row")&&(a=l.children(".k-edit-container")[0])){a=E(a);a.attr("colspan",parseInt(a.attr("colspan"),10)+1);qr(a.find(">form>table"),x(o),false,0);l=a.find("tr").first()}Vr(l[0].cells,t,true)}}}function Ur(e,t,r){r=r||1;var i,a,l;for(a=0,l=e.length;a<l;a++){i=e.eq(a).children().last();i.attr("colspan",parseInt(i.attr("colspan"),10)+r);i=t.eq(a).children().last();i.attr("colspan",parseInt(i.attr("colspan"),10)-r)}}function Kr(e){var t,r,i=0;var a=e.find(">colgroup>col");for(t=0,r=a.length;t<r;t+=1)i+=parseInt(a[t].style.width,10);return i}var jr=D.ui.DataBoundWidget.extend({init:function(e,t,r){var i=this;t=p(t)?{dataSource:t}:t;n.fn.init.call(i,e,t);if(r)i._events=r;Ct=D.support.isRtl(e);i._element();i._aria();i._columns(E.extend(true,[],i.options.columns));if(i._foreignKeyPromises)E.when.apply(null,i._foreignKeyPromises).then(function(){i._foreignKeyPromises=null;i._continueInit()});else i._continueInit()},_continueInit:function(){var e=this;e._dataSource();e._stickyColumns();e._tbody();e._thead();e._groupable();e._toolbar();e._pageable();e._setContentHeight();e._templates();e._navigatable();e._selectable();e._clipboard();e._details();e._editable();e._attachCustomCommandsEvent();e._adaptiveColumns();e._minScreenSupport();if(e.options.autoBind)e.dataSource.fetch();else{e._group=e._groups()>0;e._footer()}if(e.lockedContent){e.wrapper.addClass("k-grid-lockedcolumns");e._resizeHandler=function(){e.resize()};E(window).on("resize"+k,e._resizeHandler)}D.notify(e)},events:[ee,"dataBinding","cancel",ie,ae,le,$,Q,Y,J,X,N,U,K,j,r,Z,Ee,De,re,te,Ae,Fe,Le,ze,qe,Me,"page","sort","filter","group","groupExpand","groupCollapse","kendoKeydown"],setDataSource:function(e){var t=this;var r=t.options.scrollable;var i;t.options.dataSource=e;t._dataSource();t._pageable();t._thead();if(r)if(r.virtual){i=t.content.find(">.k-virtual-scrollable-wrap");D.scrollLeft(i,ii(i,Ct))}else{i=t.tbody;D.scrollLeft(t.content,ii(i,Ct))}if(t.options.groupable)t._groupable();if(t.virtualScrollable)t.virtualScrollable.setDataSource(t.options.dataSource);if(t.options.navigatable)t._navigatable();if(t.options.selectable)t._selectable();if(t.options.autoBind)t.dataSource.fetch();else t._footer()},options:{name:"Grid",columns:[],toolbar:null,autoBind:true,filterable:false,scrollable:true,sortable:false,selectable:false,allowCopy:false,navigatable:false,pageable:false,persistSelection:false,editable:false,encodeTitles:false,groupable:false,rowTemplate:"",altRowTemplate:"",search:false,noRecords:false,dataSource:{},height:null,resizable:false,reorderable:false,columnMenu:false,detailTemplate:null,columnResizeHandleWidth:3,mobile:"",loaderType:"loadingPanel",messages:{editable:{cancelDelete:ot,confirmation:it,confirmDelete:lt},commands:{create:Dt.create.text,cancel:Dt.cancel.text,save:Dt.save.text,destroy:Dt.destroy.text,edit:Dt.edit.text,update:Dt.update.text,canceledit:Dt.canceledit.text,excel:Dt.excel.text,pdf:Dt.pdf.text,search:Dt.search.text},noRecords:at,expandCollapseColumnHeader:"",groupHeader:"Press ctrl + space to group",ungroupHeader:"Press ctrl + space to ungroup",itemsSelected:"items selected",dragHandleLabel:"Drag row"},width:null},destroy:function(){var e=this,t;e._angularItems("cleanup");e._destroyColumnAttachments();n.fn.destroy.call(e);if(this._navigatableTables){this._navigatableTables.off(k);this._navigatableTables=null;this._headertables=null}if(e._resizeHandler)E(window).off("resize"+k,e._resizeHandler);if(e.pager&&e.pager.element)e.pager.destroy();if(e.timer)clearTimeout(e.timer);if(e._progressTimeOut)clearTimeout(e._progressTimeOut);if(e._collapseGroupsTimeOut)clearTimeout(e._collapseGroupsTimeOut);if(e._endlessFetchTimeOut)clearTimeout(e._endlessFetchTimeOut);e.pager=null;e._destroyGroupable();if(e.options.reorderable===true||e.options.reorderable&&e.options.reorderable.columns)e.wrapper.data("kendoReorderable").destroy();if(e._hasReorderableRows())e.tbody.data("kendoReorderable").destroy();if(e.selectable&&e.selectable.element){e.selectable.destroy();e.clearArea();e._selectedIds=null;if(e.copyHandler){e.wrapper.off("keydown",e.copyHandler);e.unbind(e.copyHandler)}if(e.updateClipBoardState){e.unbind(e.updateClipBoardState);e.updateClipBoardState=null}if(e.clearAreaHandler)e.wrapper.off("keyup",e.clearAreaHandler)}e.selectable=null;if(e.resizable){e.resizable.destroy();if(e._resizeUserEvents){if(e._resizeHandleDocumentClickHandler)E(document).off("click",e._resizeHandleDocumentClickHandler);e._resizeUserEvents.destroy();e._resizeUserEvents=null}e.resizable=null}e._destroyVirtualScrollable();if(e.editableUserEvents){e.editableUserEvents.destroy();e.editableUserEvents=null}if(e._lockedContentUserEvents){e._lockedContentUserEvents.destroy();e._lockedContentUserEvents=null}e._destroyEditable();if(e.dataSource){e.dataSource.unbind(ee,e._refreshHandler).unbind(w,e._progressHandler).unbind(C,e._errorHandler).unbind(tt,e._clearSortClasses);e._refreshHandler=e._progressHandler=e._errorHandler=e._sortHandler=null}t=e.element.add(e.wrapper).add(e.table).add(e.thead).add(e.wrapper.find(">.k-grid-toolbar"));if(e.content)t=t.add(e.content).add(e.content.find(">.k-virtual-scrollable-wrap"));if(e.lockedHeader)e._removeLockedContainers();if(e.pane)e.pane.destroy();if(e._isMobile){e.wrapper.off("transitionend"+k);e.wrapper.off("contextmenu"+k)}if(e.minScreenResizeHandler)E(window).off("resize",e.minScreenResizeHandler);e._detachColumnMediaResizeHandler();if(e._draggableInstance&&e._draggableInstance.element)e._draggableInstance.destroy();e._draggableInstance=null;if(e._draggableRowsInstance&&e._draggableRowsInstance.element)e._draggableRowsInstance.destroy();e._draggableRowsInstance=null;t.off(k);D.destroy(e.wrapper);e.rowTemplate=e.altRowTemplate=e.lockedRowTemplate=e.lockedAltRowTemplate=e.detailTemplate=e.footerTemplate=e.groupFooterTemplate=e.lockedGroupFooterTemplate=e.noRecordsTemplate=null;e.scrollables=e.thead=e.tbody=e.element=e.table=e.content=e.footer=e.wrapper=e.lockedTable=e.lockedContent=e.lockedHeader=e.lockedFooter=e._groupableClickHandler=e._groupRows=e._setContentWidthHandler=null},getOptions:function(){var e=this.options;e.dataSource=null;var t=T(true,{},this.options);t.columns=D.deepExtend([],this.columns);var r=this.dataSource;var i=r.options.data&&r._data;r.options.data=null;t.dataSource=E.extend(true,{},r.options);r.options.data=i;t.dataSource.data=i;t.dataSource.page=r.page();t.dataSource.filter=E.extend(true,{},r.filter());t.dataSource.pageSize=r.pageSize();t.dataSource.sort=r.sort();t.dataSource.group=r.group();t.dataSource.aggregate=r.aggregate();if(t.dataSource.transport)t.dataSource.transport.dataSource=null;if(t.pageable&&t.pageable.pageSize)t.pageable.pageSize=r.pageSize();t.$angular=R;return t},setOptions:function(e){var t=this.getOptions();D.deepExtend(t,e);if(!e.dataSource)t.dataSource=this.dataSource;else if(e.dataSource.filter)t.dataSource.filter=e.dataSource.filter;var r=this.wrapper;var i=this._events;var a=this.element;this.destroy();this.options=null;if(this._isMobile){var l=r.closest(D.roleSelector("pane")).parent();l.after(r);l.remove();r.removeClass("k-grid-mobile")}if(r[0]!==a[0]){r.before(a);r.remove()}a.empty();this.init(a,t,i);this._setEvents(t)},items:function(){if(this.lockedContent)return this._items(this.tbody).add(this._items(this.lockedTable.children("tbody")));else return this._items(this.tbody)},_items:function(e,t){return e.children().filter(function(){var e=E(this);return(t?!e.hasClass("k-detail-row"):!e.hasClass("k-grouping-row"))&&!e.hasClass("k-detail-row")&&!e.hasClass("k-group-footer")})},dataItems:function(){var e=D.ui.DataBoundWidget.fn.dataItems.call(this);if(this.lockedContent){var t=e.length,r=new Array(2*t);for(var i=t;--i>=0;)r[i]=r[i+t]=e[i];e=r}return e},_destroyColumnAttachments:function(){var e=this;e.resizeHandle=null;if(!e.thead)return;this.angular("cleanup",function(){return{elements:e.thead.get()}});e.thead.add(e.lockedHeader).find("th").each(function(){var e=E(this),t=e.data("kendoFilterMenu"),r=e.data("kendoColumnSorter"),i=e.data("kendoColumnMenu");if(t)t.destroy();if(r)r.destroy();if(i)i.destroy()})},_attachCustomCommandsEvent:function(){var e=this,t=L(e.columns||[]),r,i,a;for(i=0,a=t.length;i<a;i++){r=t[i].command;if(r)zt(e,e.wrapper,r)}},_aria:function(){var e=this.element.attr("id")||"aria";if(e)this._cellId=e+"_active_cell"},_element:function(){var e=this,t=e.element;if(!t.is("table")){if(e.options.scrollable)t=e.element.find("> .k-grid-content > table");else t=e.element.children("table");if(!t.length)t=E("<table />").appendTo(e.element)}e.table=t.attr("role",e._hasDetails()?"treegrid":"grid");e._wrapper()},_createResizeHandle:function(e,t){var r=this;var c=r.options.columnResizeHandleWidth;var u=r.options.scrollable;var i=r.resizeHandle;var f=c*3/2;var a=0;var l;var p;var h;var g;var o;var m;var n;var s;var d;var v;if(i&&r.lockedContent&&i.data("th")[0]!==t[0]){i.off(k).remove();i=null}if(!i){i=r.resizeHandle=E('<div class="k-resize-handle"><div class="k-resize-handle-inner"></div></div>');e.append(i)}s=D.scrollLeft(e);if(Ct&&(yt.mozilla||yt.webkit&&yt.version>=85))s=s*-1;n=parseFloat(e.css("borderLeftWidth"));d=t.offset().left+s-parseFloat(t.css("marginLeft"))-(e.offset().left+n);if(!Ct)d+=t[0].offsetWidth;else if(u){a=d<=s?f:0;l=t.closest(".k-grid-header-wrap, .k-grid-header-locked");m=l[0].scrollWidth-l[0].offsetWidth;o=parseFloat(l.css("marginLeft"));p=yt.msie?2*D.scrollLeft(l)+n-o-a:0;h=-a;g=yt.mozilla?n-o-a:0;d-=h+g+p}v=t.offset().top-parseFloat(t.css("marginTop"))-(e.offset().top+parseFloat(e.css("borderTopWidth")));i.css({top:v,left:d-f,height:_(t),width:c*3-a}).data("th",t).show();i.off("dblclick"+k).on("dblclick"+k,function(){r._autoFitLeafColumn(parseInt(t.attr(D.attr("index")),10))})},_positionColumnResizeHandle:function(){var i=this,e=i.lockedHeader?i.lockedHeader.find("thead").first():E();i.thead.add(e).on("mousemove"+k,"tr:not(.k-filter-row) > th",function(e){var t=typeof e.buttons!=="undefined"?e.buttons:e.which||e.button;var r=E(this);if(r.hasClass("k-group-cell")||r.hasClass("k-hierarchy-cell"))return;if(typeof t!=="undefined"&&t!==0)return;if(r[0].hasAttribute(D.attr(Xe)))return;i._createResizeHandle(r.closest("div"),r)})},_resizeHandleDocumentClick:function(e){if(E(e.target).closest(".k-column-active").length)return;E(document).off(e);this._resetResizeHandleHeader();this._hideResizeHandle()},_resetResizeHandleHeader:function(){var e;if(!this.resizeHandle)return;e=E(this.resizeHandle).data("th");if(e){e.find(I+be).find(I+_e).show();e.find(I+we).show();e.find(I+ye).show();e.find(I+Se).show()}},_hideResizeHandle:function(){if(this.resizeHandle){this.resizeHandle.data("th").removeClass("k-column-active");if(this.lockedContent&&!this._isMobile){this.resizeHandle.off(k).remove();this.resizeHandle=null}else this.resizeHandle.hide()}},_positionColumnResizeHandleTouch:function(){var r=this,e=r.lockedHeader?r.lockedHeader.find("thead").first():E();r._resizeUserEvents=new D.UserEvents(e.add(r.thead),{filter:"th:not(.k-group-cell):not(.k-hierarchy-cell)",threshold:10,minHold:500,hold:function(e){var t=E(e.target);e.preventDefault();if(r.resizeHandle){r.resizeHandle.data("th").removeClass("k-column-active");r._resetResizeHandleHeader()}t.addClass("k-column-active");t.find(I+be).find(I+_e).hide();t.find(I+we).hide();t.find(I+ye).hide();t.find(I+Se).hide();r._createResizeHandle(t.closest("div"),t);if(!r._resizeHandleDocumentClickHandler)r._resizeHandleDocumentClickHandler=r._resizeHandleDocumentClick.bind(r);E(document).on("click",r._resizeHandleDocumentClickHandler)}})},resizeColumn:function(e,t){var r=this;var i=!!e.locked;var c=!!e.hidden;var u=this.options;var f=!D.support.mobileOS?D.support.scrollbar():0;var a=i?F(e,Sr(Tr(r.columns))):F(e,yr(Tr(r.columns)));var l=i?r.lockedTable:r.table;var p=r.footer||E();var h=i?r.lockedHeader.find("table"):r.thead.closest("table");var o=e.minResizableWidth||10;var n=i?z(l.find("tbody")):z(r.tbody);var s;if(c){e.width=t>o?t:o;return}if(r.footer&&r.lockedContent)p=i?r.footer.children(".k-grid-footer-locked"):r.footer.children(".k-grid-footer-wrap");if(u.scrollable)s=h.find("col:not(.k-group-col,.k-hierarchy-col)").eq(a).add(l.children("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col)").eq(a)).add(p.find("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col)").eq(a));else s=l.find("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col)").eq(a);if(u.scrollable){var g=false;var m=r.wrapper.width()-f;var d=t=t>o?t:o;if(i&&n-t+d>m){d=t+(m-n-f*2);if(d<0)d=t;g=true}if(d>10&&d>=o){s.css("width",d);if(n){if(g)d=m-f*2;else d=n+(t-e.width);l.add(h).add(p).css("width",d);if(!i)r._footerWidth=d}}r._scrollVirtualWrapperOnColumnResize()}else if(t>10&&t>=o)s.css("width",t);e.width=t;r._applyLockedContainersWidth();r._syncLockedContentHeight();r._syncLockedHeaderHeight();r._updateStickyColumns()},_resizable:function(){var d=this,c=d.options,e,u,f,p,h,o=this._isMobile,k=!D.support.mobileOS?D.support.scrollbar():0,g,m,v;if(c.resizable){e=c.scrollable?d.wrapper.find(".k-grid-header-wrap").first():d.wrapper;if(o)d._positionColumnResizeHandleTouch(e);else d._positionColumnResizeHandle(e);if(d.resizable)d.resizable.destroy();d.resizable=new b.Resizable(e.add(d.lockedHeader),{handle:(!!c.scrollable?"":">")+".k-resize-handle",hint:function(e){return E('<div class="k-grid-resize-indicator" />').css({height:_(e.data("th"))+d.tbody.attr("clientHeight")})},start:function(e){v=E(e.currentTarget).data("th");if(o)d._hideResizeHandle();var t=v.closest("table"),r=E.inArray(v[0],Ir(v.closest("thead")).filter(":visible"));g=t.parent().hasClass("k-grid-header-locked");var i=g?d.lockedTable:d.table,a=d.footer||E();if(d.footer&&d.lockedContent)a=g?d.footer.children(".k-grid-footer-locked"):d.footer.children(".k-grid-footer-wrap");At(d.wrapper,"col-resize");if(c.scrollable)m=t.find("col:not(.k-group-col):not(.k-hierarchy-col)").eq(r).add(i.children("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col)").eq(r)).add(a.find("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col)").eq(r));else m=i.children("colgroup").find("col:not(.k-group-col):not(.k-hierarchy-col)").eq(r);var l=E.map(d.columns,function(e){return!e.hidden&&(g&&e.locked||!g&&!e.locked)?e:null});u=e.x.location;f=z(v);p=L(l)[r].minResizableWidth||10;h=g?z(i.children("tbody")):z(d.tbody);if(yt.webkit)d.wrapper.addClass("k-grid-column-resizing")},resize:function(e){var t=Ct?-1:1,r=f+e.x.location*t-u*t;if(c.scrollable){var i;if(g&&d.lockedFooter)i=d.lockedFooter.children("table");else if(d.footer)i=d.footer.find(">.k-grid-footer-wrap>table");if(!i||!i[0])i=E();var a=v.closest("table");var l=g?d.lockedTable:d.table;var o=false;var n=d.wrapper.width()-k;var s=r;if(g&&h-f+s>n){s=f+(n-h-k*2);if(s<0)s=r;o=true}if(s>10&&s>=p){m.css("width",s);if(h){if(o)s=n-k*2;else s=h+e.x.location*t-u*t;l.add(a).add(i).css("width",s);if(!g)d._footerWidth=s}}d._scrollVirtualWrapperOnColumnResize()}else if(r>10&&r>=p)m.css("width",r)},resizeend:function(){var e=z(v),t,r;At(d.wrapper,"");if(yt.webkit)d.wrapper.removeClass("k-grid-column-resizing");if(f!=e){r=d.lockedHeader?d.lockedHeader.find("thead").first().find("tr").first().add(d.thead.find("tr").first()):v.parent();var i=v.attr(D.attr("index"));if(!i)i=r.find("th:not(.k-group-cell):not(.k-hierarchy-cell)").index(v);t=L(d.columns)[i];t.width=e;d.trigger(Ee,{column:t,oldWidth:f,newWidth:e});d._applyLockedContainersWidth();d._syncLockedContentHeight();d._syncLockedHeaderHeight();d._updateStickyColumns()}d._resetResizeHandleHeader();d._hideResizeHandle();v=null}})}},_draggable:function(){var t=this,e=t.options.reorderable;if(e===true||e&&e.columns){if(t._draggableInstance)t._draggableInstance.destroy();var r=t.wrapper.children(".k-grid-header");t._draggableInstance=t.wrapper.kendoDraggable({group:D.guid(),autoScroll:true,filter:t.content?".k-grid-header:first "+B:"table:first>.k-grid-header "+B,dragstart:function(){r.children(".k-grid-header-wrap").off("scroll"+k+"scrolling").on("scroll"+k+"scrolling",function(e){if(t.virtualScrollable)D.scrollLeft(t.content.find(">.k-virtual-scrollable-wrap"),this.scrollLeft);else D.scrollLeft(t.scrollables.not(e.currentTarget),this.scrollLeft)})},dragend:function(){t._resetResizeHandleHeader();r.children(".k-grid-header-wrap").off("scroll"+k+"scrolling")},drag:function(){t._hideResizeHandle()},hint:function(e){var t=e.attr(D.attr("title"));if(t)t=D.htmlEncode(t);return E('<div class="k-reorder-clue k-drag-clue" />').html(t||e.attr(D.attr("field"))||e.text()).prepend('<span class="k-icon k-drag-status k-i-cancel"></span>')}}).data("kendoDraggable")}},_reorderable:function(){var a=this,e=a.options.reorderable;if(e===true||e&&e.columns){if(a.wrapper.data("kendoReorderable"))a.wrapper.data("kendoReorderable").destroy();a.wrapper.kendoReorderable({draggable:a._draggableInstance,dropFilter:B,dragOverContainers:function(e,t){var r=or(a.columns);return r[e].lockable!==false&&nr(r,a.columns,e,t)>-1},inSameContainer:function(e){return E(e.source).parent()[0]===E(e.target).parent()[0]&&nr(or(a.columns),a.columns,e.sourceIndex,e.targetIndex)>-1},change:function(e){var t=or(a.columns);var r=t[e.oldIndex];var i=nr(t,a.columns,e.oldIndex,e.newIndex);a.trigger(De,{newIndex:i,oldIndex:F(r,t),column:r});a.reorderColumn(i,r,e.position==="before")}})}},_reorderHeader:function(e,t,r,c){var i=this;var a=rr(e[0],i.columns);var l=rr(t,i.columns);var o;var u;var n=[];for(var f=0;f<e.length;f++)if(e[f].columns)n=n.concat(e[f].columns);if(c)u=Lt(c,c,"tr:eq("+a.row+")>th.k-header:not(.k-group-cell,.k-hierarchy-cell)");else u=Lt(i.lockedHeader,i.thead,"tr:eq("+a.row+")>th.k-header:not(.k-group-cell,.k-hierarchy-cell)");var s=H(e).length;var d=H([t]).length;if(n.length){if(s>0&&d===0){o="prepend";Xt(e,t,n,i.columns,i.lockedHeader.find("thead"),i.thead,this._groups(),o)}else if(s===0&&d>0){o=l.cell===0&&e[0].columns&&!t.columns&&!i._group?"prepend":"append";Xt(e,t,n,_r(i.columns),i.thead,i.lockedHeader.find("thead"),this._groups(),o)}if(t.columns||a.cell-l.cell>1||l.cell-a.cell>1){t=ar(i.columns,t,e[0],r,i.columns);if(t)if(s>0&&d===0)i._reorderHeader(n,t,r,i.thead);else if(s===0&&d>0)i._reorderHeader(n,t,r,i.lockedHead);else i._reorderHeader(n,t,r)}}else if(s!==d)Jt(u[a.cell],i.columns,s);Ft(u,a.cell,l.cell,r,e.length)},_reorderContent:function(e,c,t){var r=this;var u=E();var f=e[0];var p=x(e);var i=F(f,L(r.columns));var a=F(c,L(r.columns));var l=F(p[0],Tr(r.columns));var o=F(c,Tr(r.columns));var h=H(r.columns).length;var g=!!c.locked;var n=r.footer||r.wrapper.find(".k-grid-footer");var s,m,d;s=m=o;if(c.hidden){var v=g?H(r.columns):_r(r.columns);if(x(v).length>0){s=m=o=this._findClosestVisibleColumnIndex(v,a);d=x(v.slice(a)).length>0}else if(g){o=r.lockedTable.find("colgroup");s=r.lockedHeader.find("colgroup");m=E(r.lockedFooter).find(">table>colgroup")}else{o=r.tbody.prev();s=r.thead.prev();m=n.find(".k-grid-footer-wrap").find(">table>colgroup")}}if(r._hasFilterRow())Ft(r.wrapper.find(".k-filter-row th:not(.k-group-cell,.k-hierarchy-cell)"),i,a,t,e.length);if(l>=0)Ft(Lt(r.lockedHeader,r.thead.prev(),V),l,s,d?d:t,p.length);if(r.options.scrollable)if(l>=0&&!r._hasVirtualColumns())Ft(Lt(r.lockedTable,r.tbody.prev(),V),l,o,d?d:t,p.length);if(n&&n.length){if(l>=0)Ft(Lt(r.lockedFooter,n.find(".k-grid-footer-wrap"),">table>colgroup>col:not(.k-group-col,.k-hierarchy-col)"),l,m,d?d:t,p.length);Ft(n.find(".k-footer-template>td:not(.k-group-cell,.k-hierarchy-cell)"),i,a,t,e.length)}var k=r.tbody.children(":not(.k-grouping-row,.k-detail-row)");if(r.lockedTable){if(h>a){if(h<=i)Ur(r.lockedTable.find(">tbody>tr.k-grouping-row"),r.table.find(">tbody>tr.k-grouping-row"),e.length)}else if(h>i)Ur(r.table.find(">tbody>tr.k-grouping-row"),r.lockedTable.find(">tbody>tr.k-grouping-row"),e.length);u=r.lockedTable.find(">tbody>tr:not(.k-grouping-row,.k-detail-row)")}for(var b=0,_=k.length;b<_;b+=1)Ft(Lt(u[b],k[b],">td:not(.k-group-cell,.k-hierarchy-cell)"),i,a,t,e.length)},_findClosestVisibleColumnIndex:function(e,t){var r=x(e.slice(t)).length>0?e.slice(t):e.slice(0,t+1).reverse(),i=x(r)[0];return F(i,x(this.columns))},_autoFitLeafColumn:function(e){this.autoFitColumn(L(this.columns)[e])},_hasReorderableRows:function(){return this._hasDragHandleColumn||this.options.reorderable&&this.options.reorderable.rows},_draggableRows:function(){var i=this,a=i._checkBoxSelection||i.options.selectable&&!D.ui.Selectable.parseOptions(i.options.selectable).cell;if(i._draggableRowsInstance)i._draggableRowsInstance.destroy();i._draggableRowsInstance=i.tbody.kendoDraggable({group:"row-draggable",autoScroll:true,filter:(a?" > .k-state-selected":" > "+W)+(i._hasDragHandleColumn?" > .k-drag-cell":""),hint:function(e){var r=E('<div class="k-reorder-clue k-drag-clue"><span class="k-icon k-drag-status k-i-cancel"></span></div>');if(a&&i.select().length>1)r.append("<span>"+i.select().length+" "+i.options.messages.itemsSelected+"</span>");else{var t=e.closest(W).clone();t.find("td.k-command-cell").remove();t.find("td").each(function(e,t){r.append("<span>"+t.innerText+" </span>")})}return r}}).data("kendoDraggable")},_reorderableRows:function(){var a=this,l=a._checkBoxSelection||a.options.selectable&&!D.ui.Selectable.parseOptions(a.options.selectable).cell;if(a.tbody.data("kendoReorderable"))a.tbody.data("kendoReorderable").destroy();a.tbody.kendoReorderable({smartPosition:false,draggable:a._draggableRowsInstance,dragOverContainers:function(e,t){var r=true,i=E(W,a.content).eq(t);if(l)r=!i.is(".k-state-selected");return r},inSameContainer:function(e){if(l)return!E(e.target).is(".k-state-selected");return true},dropFilter:"> "+W,allowIcon:"k-i-insert-middle",orientation:"vertical",reorderDropCue:E('<div class="k-drop-hint k-drop-hint-h"><div class="k-drop-hint-start"></div><div class="k-drop-hint-line"></div></div>'),positionDropCue:function(e,t){var r=D.getOffset(t.children(S).eq(0)).left;e.css({transform:"translate(0,-50%)",left:r})},externalDraggable:function(e){var t=e.draggable;if(t)return t},change:function(e){a._triggerRowRorder(e)}})},_triggerRowRorder:function(e){var t=this,r={newIndex:e.position==="after"?e.newIndex+1:e.newIndex,oldIndex:e.oldIndex},i=e.element,a=t._checkBoxSelection||t.options.selectable&&!D.ui.Selectable.parseOptions(t.options.selectable).cell;if(a&&t.select().length>1)r=T(r,{rows:t.select()});else r=T(r,{row:i});if(!t.trigger(qe,r))t.reorderRows(a?t.select():i,r.newIndex)},reorderRows:function(e,t){var r=this,i=r.dataSource,a=r.tbody.children(W).length,l=r.dataItem(r.tbody.children(W).eq(t)),o=e.toArray().map(function(e){return r.dataItem(e)});if(!l){l=r.dataItem(r.tbody.children(W).eq(a-1));t=i.indexOf(l)+1}else t=i.indexOf(l);if(t>=0){r._rowDropping=true;i.pushMove(t,o);r._rowDropping=false}},autoFitColumns:function(e){var t=this;e=e||t.columns;for(var r=0;r<e.length;r++){var i=e[r];if(i.columns)t.autoFitColumns(i.columns);else t.autoFitColumn(i)}},autoFitColumn:function(t){var e=this,c=e.options,u=e.columns,r,i,a,l,o,f=e.lockedHeader?Ir(e.lockedHeader.find(">table>thead")).filter(Nt).length:0,n,p,h,g,m="col:not(.k-group-col):not(.k-hierarchy-col)",v="td:visible:not(.k-group-cell):not(.k-hierarchy-cell)",k,b;if(typeof t=="number")t=u[t];else if(q(t))t=A(sr(u),function(e){return e===t})[0];else t=A(sr(u),function(e){return e.field===t})[0];if(!t||!Kt(t))return;l=L(u);p=t.minResizableWidth;r=F(t,l);o=t.locked;if(o)a=e.lockedHeader.children("table");else a=e.thead.parent();i=a.find("[data-index='"+r+"']");k=i.find("a.k-header-column-menu, a.k-grid-filter");var s=o?e.lockedTable:e.table,_=e.footer||E();if(e.footer&&e.lockedContent)_=o?e.footer.children(".k-grid-footer-locked"):e.footer.children(".k-grid-footer-wrap");var w=_.find("table").first();if(e.lockedHeader&&!o)r-=f;for(var C=0;C<l.length;C++)if(l[C]===t)break;else if(l[C].hidden)r--;if(c.scrollable){n=a.find(m).eq(r).add(s.children("colgroup").find(m).eq(r)).add(w.find("colgroup").find(m).eq(r));if(!o){h=s.parent();g=D.scrollLeft(h)}}else n=s.children("colgroup").find(m).e