/** 
 * Kendo UI v2016.3.1118 (http://www.telerik.com/kendo-ui)                                                                                                                                              
 * Copyright 2016 Telerik AD. All rights reserved.                                                                                                                                                      
 *                                                                                                                                                                                                      
 * Kendo UI commercial licenses may be obtained at                                                                                                                                                      
 * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete                                                                                                                                  
 * If you do not own a commercial license, this file shall be governed by the trial license terms.                                                                                                      
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       

*/
!function(e,define){define("kendo.list.min",["kendo.data.min","kendo.popup.min"],e)}(function(){return function(e,t){function i(e,i){return e!==t&&""!==e&&null!==e&&("boolean"===i?e=!!e:"number"===i?e=+e:"string"===i&&(e=""+e)),e}function n(e){return e[e.length-1]}function a(e){var t=e.selectedIndex;return t>-1?e.options[t]:{}}function s(e,t){var i,n,a,s,r=t.length,l=e.length,o=[],u=[];if(l)for(a=0;a<l;a++){for(i=e[a],n=!1,s=0;s<r;s++)if(i===t[s]){n=!0,o.push({index:a,item:i});break}n||u.push(i)}return{changed:o,unchanged:u}}function r(t,i){var n,a=!1;return t.filters&&(n=e.grep(t.filters,function(e){return a=r(e,i),e.filters?e.filters.length:e.field!=i}),a||t.filters.length===n.length||(a=!0),t.filters=n),a}var l,o,u=window.kendo,d=u.ui,c=u._outerWidth,h=u._outerHeight,f=d.Widget,_=u.keys,p=u.support,g=u.htmlEncode,v=u._activeElement,m=u.data.ObservableArray,b="id",x="change",I="k-state-focused",S="k-state-hover",w="k-i-loading",y="k-loading-hidden",T="open",F="close",k="cascade",V="select",D="selected",C="requestStart",H="requestEnd",B="width",E=e.extend,P=e.proxy,q=e.isArray,A=p.browser,G=A.msie,W=G&&A.version<9,L=/"/g,O={ComboBox:"DropDownList",DropDownList:"ComboBox"},N=u.ui.DataBoundWidget.extend({init:function(t,i){var n,a=this,s=a.ns;f.fn.init.call(a,t,i),t=a.element,i=a.options,a._isSelect=t.is(V),a._isSelect&&a.element[0].length&&(i.dataSource||(i.dataTextField=i.dataTextField||"text",i.dataValueField=i.dataValueField||"value")),a.ul=e('<ul unselectable="on" class="k-list k-reset"/>').attr({tabIndex:-1,"aria-hidden":!0}),a.list=e("<div class='k-list-container'/>").append(a.ul).on("mousedown"+s,P(a._listMousedown,a)),n=t.attr(b),n&&(a.list.attr(b,n+"-list"),a.ul.attr(b,n+"_listbox")),a._header(),a._noData(),a._footer(),a._accessors(),a._initValue()},options:{valuePrimitive:!1,footerTemplate:"",headerTemplate:"",noDataTemplate:"No data found."},setOptions:function(e){f.fn.setOptions.call(this,e),e&&e.enable!==t&&(e.enabled=e.enable),this._header(),this._noData(),this._footer(),this._renderFooter(),this._renderNoData()},focus:function(){this._focused.focus()},readonly:function(e){this._editable({readonly:e===t||e,disable:!1})},enable:function(e){this._editable({readonly:!1,disable:!(e=e===t||e)})},_listOptions:function(t){var i=this,n=i.options,a=n.virtual,s=P(i._listBound,i);return a="object"==typeof a?a:{},t=e.extend({autoBind:!1,selectable:!0,dataSource:i.dataSource,click:P(i._click,i),change:P(i._listChange,i),activate:P(i._activateItem,i),deactivate:P(i._deactivateItem,i),dataBinding:function(){i.trigger("dataBinding")},dataBound:s,height:n.height,dataValueField:n.dataValueField,dataTextField:n.dataTextField,groupTemplate:n.groupTemplate,fixedGroupTemplate:n.fixedGroupTemplate,template:n.template},t,a),t.template||(t.template="#:"+u.expr(t.dataTextField,"data")+"#"),n.$angular&&(t.$angular=n.$angular),t},_initList:function(){var e=this,t=e._listOptions({selectedItemChange:P(e._listChange,e)});e.listView=e.options.virtual?new u.ui.VirtualList(e.ul,t):new u.ui.StaticList(e.ul,t),e.listView.bind("listBound",P(e._listBound,e)),e._setListValue()},_setListValue:function(e){e=e||this.options.value,e!==t&&this.listView.value(e).done(P(this._updateSelectionState,this))},_updateSelectionState:e.noop,_listMousedown:function(e){this.filterInput&&this.filterInput[0]===e.target||e.preventDefault()},_isFilterEnabled:function(){var e=this.options.filter;return e&&"none"!==e},_hideClear:function(){var e=this;e._clear&&this._clear.addClass(y)},_showClear:function(){var e=this;e._clear&&this._clear.removeClass(y)},_clearValue:function(){this.listView.value([]),this._clearText(),this._accessor(""),this._isFilterEnabled()&&this._filter({word:"",open:!1}),this._change()},_clearText:function(){this.text("")},_clearFilter:function(){this.options.virtual||this.listView.bound(!1),this._filterSource()},_filterSource:function(e,t){var i,n=this,a=n.options,s=n.dataSource,l=E({},s.filter()||{}),o=e||l.filters&&l.filters.length&&!e,u=r(l,a.dataTextField);(e||u)&&n.trigger("filtering",{filter:e})||(l={filters:l.filters||[],logic:"and"},e&&l.filters.push(e),n._cascading&&this.listView.setDSFilter(l),i=E({},{page:o?1:s.page(),pageSize:o?s.options.pageSize:s.pageSize(),sort:s.sort(),filter:s.filter(),group:s.group(),aggregate:s.aggregate()},{filter:l}),s[t?"read":"query"](s._mergeState(i)))},_angularElement:function(e,t){e&&this.angular(t,function(){return{elements:e}})},_noData:function(){var i=e(this.noData),n=this.options.noDataTemplate;return this.angular("cleanup",function(){return{elements:i}}),u.destroy(i),i.remove(),n?(this.noData=e('<div class="k-nodata" style="display:none"><div></div></div>').appendTo(this.list),this.noDataTemplate="function"!=typeof n?u.template(n):n,t):(this.noData=null,t)},_renderNoData:function(){var e=this.noData;e&&(this._angularElement(e,"cleanup"),e.children(":first").html(this.noDataTemplate({instance:this})),this._angularElement(e,"compile"))},_toggleNoData:function(t){e(this.noData).toggle(t)},_footer:function(){var i=e(this.footer),n=this.options.footerTemplate;return this._angularElement(i,"cleanup"),u.destroy(i),i.remove(),n?(this.footer=e('<div class="k-footer"></div>').appendTo(this.list),this.footerTemplate="function"!=typeof n?u.template(n):n,t):(this.footer=null,t)},_renderFooter:function(){var e=this.footer;e&&(this._angularElement(e,"cleanup"),e.html(this.footerTemplate({instance:this})),this._angularElement(e,"compile"))},_header:function(){var i,n=e(this.header),a=this.options.headerTemplate;return this._angularElement(n,"cleanup"),u.destroy(n),n.remove(),a?(i="function"!=typeof a?u.template(a):a,n=e(i({})),this.header=n[0]?n:null,this.list.prepend(n),this._angularElement(this.header,"compile"),t):(this.header=null,t)},_allowOpening:function(){return this.options.noDataTemplate||this.dataSource.flatView().length},_initValue:function(){var e=this,t=e.options.value;null!==t?e.element.val(t):(t=e._accessor(),e.options.value=t),e._old=t},_ignoreCase:function(){var e,t=this,i=t.dataSource.reader.model;i&&i.fields&&(e=i.fields[t.options.dataTextField],e&&e.type&&"string"!==e.type&&(t.options.ignoreCase=!1))},_focus:function(e){return this.listView.focus(e)},_filter:function(e){var t=this,i=t.options,n=i.ignoreCase,a=i.dataTextField,s={value:n?e.word.toLowerCase():e.word,field:a,operator:i.filter,ignoreCase:n};t._open=e.open,t._filterSource(s)},search:function(e){var t=this.options;e="string"==typeof e?e:this._inputValue(),clearTimeout(this._typingTimeout),(!t.enforceMinLength&&!e.length||e.length>=t.minLength)&&(this._state="filter",this._isFilterEnabled()?this._filter({word:e,open:!0}):this._searchByWord(e))},current:function(e){return this._focus(e)},items:function(){return this.ul[0].children},destroy:function(){var e=this,t=e.ns;f.fn.destroy.call(e),e._unbindDataSource(),e.listView.destroy(),e.list.off(t),e.popup.destroy(),e._form&&e._form.off("reset",e._resetHandler)},dataItem:function(i){var n=this;if(i===t)return n.listView.selectedDataItems()[0];if("number"!=typeof i){if(n.options.virtual)return n.dataSource.getByUid(e(i).data("uid"));i=e(n.items()).index(i)}return n.dataSource.flatView()[i]},_activateItem:function(){var e=this.listView.focus();e&&this._focused.add(this.filterInput).attr("aria-activedescendant",e.attr("id"))},_deactivateItem:function(){this._focused.add(this.filterInput).removeAttr("aria-activedescendant")},_accessors:function(){var e=this,t=e.element,i=e.options,n=u.getter,a=t.attr(u.attr("text-field")),s=t.attr(u.attr("value-field"));!i.dataTextField&&a&&(i.dataTextField=a),!i.dataValueField&&s&&(i.dataValueField=s),e._text=n(i.dataTextField),e._value=n(i.dataValueField)},_aria:function(e){var i=this,n=i.options,a=i._focused.add(i.filterInput);n.suggest!==t&&a.attr("aria-autocomplete",n.suggest?"both":"list"),e=e?e+" "+i.ul[0].id:i.ul[0].id,a.attr("aria-owns",e),i.ul.attr("aria-live",i._isFilterEnabled()?"polite":"off")},_blur:function(){var e=this;e._change(),e.close()},_change:function(){var e,n=this,a=n.selectedIndex,s=n.options.value,r=n.value();n._isSelect&&!n.listView.bound()&&s&&(r=s),r!==i(n._old,typeof r)?e=!0:a!==t&&a!==n._oldIndex&&(e=!0),e&&(n._old=r,n._oldIndex=a,n._typing||n.element.trigger(x),n.trigger(x)),n.typing=!1},_data:function(){return this.dataSource.view()},_enable:function(){var e=this,i=e.options,n=e.element.is("[disabled]");i.enable!==t&&(i.enabled=i.enable),!i.enabled||n?e.enable(!1):e.readonly(e.element.is("[readonly]"))},_dataValue:function(e){var i=this._value(e);return i===t&&(i=this._text(e)),i},_offsetHeight:function(){var t=0,i=this.listView.content.prevAll(":visible");return i.each(function(){var i=e(this);t+=h(i.hasClass("k-list-filter")?i.children():i)}),t},_height:function(i){var n,a,s,r=this,l=r.list,o=r.options.height,u=r.popup.visible();if(i||r.options.noDataTemplate){if(a=l.add(l.parent(".k-animation-container")).show(),!l.is(":visible"))return a.hide(),t;o=r.listView.content[0].scrollHeight>o?o:"auto",a.height(o),"auto"!==o&&(n=r._offsetHeight(),s=h(e(r.footer))||0,o=o-n-s),r.listView.content.height(o),u||a.hide()}return o},_adjustListWidth:function(){var e,t,i=this.list,n=i[0].style.width,a=this.wrapper;if(i.data(B)||!n)return e=window.getComputedStyle?window.getComputedStyle(a[0],null):0,t=parseFloat(e&&e.width)||c(a),e&&A.msie&&(t+=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight)+parseFloat(e.borderLeftWidth)+parseFloat(e.borderRightWidth)),n="border-box"!==i.css("box-sizing")?t-(c(i)-i.width()):t,i.css({fontFamily:a.css("font-family"),width:this.options.autoWidth?"auto":n,minWidth:n}).data(B,n),!0},_openHandler:function(e){this._adjustListWidth(),this.trigger(T)?e.preventDefault():(this._focused.attr("aria-expanded",!0),this.ul.attr("aria-hidden",!1))},_closeHandler:function(e){this.trigger(F)?e.preventDefault():(this._focused.attr("aria-expanded",!1),this.ul.attr("aria-hidden",!0))},_focusItem:function(){var e=this.listView,i=!e.focus(),a=n(e.select());a===t&&this.options.highlightFirst&&i&&(a=0),a!==t?e.focus(a):i&&e.scrollToIndex(0)},_calculateGroupPadding:function(e){var t=this.ul.children(".k-first:first"),i=this.listView.content.prev(".k-group-header"),n=0;i[0]&&"none"!==i[0].style.display&&("auto"!==e&&(n=u.support.scrollbar()),n+=parseFloat(t.css("border-right-width"),10)+parseFloat(t.children(".k-group").css("padding-right"),10),i.css("padding-right",n))},_calculatePopupHeight:function(e){var t=this._height(this.dataSource.flatView().length||e);this._calculateGroupPadding(t)},_resizePopup:function(e){this.options.virtual||(this.popup.element.is(":visible")?this._calculatePopupHeight(e):this.popup.one("open",function(e){return P(function(){this._calculatePopupHeight(e)},this)}.call(this,e)))},_popup:function(){var e=this;e.popup=new d.Popup(e.list,E({},e.options.popup,{anchor:e.wrapper,open:P(e._openHandler,e),close:P(e._closeHandler,e),animation:e.options.animation,isRtl:p.isRtl(e.wrapper)}))},_makeUnselectable:function(){W&&this.list.find("*").not(".k-textbox").attr("unselectable","on")},_toggleHover:function(t){e(t.currentTarget).toggleClass(S,"mouseenter"===t.type)},_toggle:function(e,i){var n=this,a=p.mobileOS&&(p.touch||p.MSPointers||p.pointers);e=e!==t?e:!n.popup.visible(),i||a||n._focused[0]===v()||(n._prevent=!0,n._focused.focus(),n._prevent=!1),n[e?T:F]()},_triggerCascade:function(){var e=this;e._cascadeTriggered&&e._old===e.value()&&e._oldIndex===e.selectedIndex||(e._cascadeTriggered=!0,e.trigger(k,{userTriggered:e._userTriggered}))},_triggerChange:function(){this._valueBeforeCascade!==this.value()&&this.trigger(x)},_unbindDataSource:function(){var e=this;e.dataSource.unbind(C,e._requestStartHandler).unbind(H,e._requestEndHandler).unbind("error",e._errorHandler)},requireValueMapper:function(e,t){var i=(e.value instanceof Array?e.value.length:e.value)||(t instanceof Array?t.length:t);if(i&&e.virtual&&"function"!=typeof e.virtual.valueMapper)throw Error("ValueMapper is not provided while the value is being set. See http://docs.telerik.com/kendo-ui/controls/editors/combobox/virtualization#the-valuemapper-function")}});E(N,{inArray:function(e,t){var i,n,a=t.children;if(!e||e.parentNode!==t)return-1;for(i=0,n=a.length;i<n;i++)if(e===a[i])return i;return-1},unifyType:i}),u.ui.List=N,d.Select=N.extend({init:function(e,t){N.fn.init.call(this,e,t),this._initial=this.element.val()},setDataSource:function(e){var t,i=this;i.options.dataSource=e,i._dataSource(),i.listView.bound()&&(i._initialIndex=null),i.listView.setDataSource(i.dataSource),i.options.autoBind&&i.dataSource.fetch(),t=i._parentWidget(),t&&i._cascadeSelect(t)},close:function(){this.popup.close()},select:function(e){var i=this;return e===t?i.selectedIndex:i._select(e).done(function(){i._old=i._accessor(),i._oldIndex=i.selectedIndex})},_accessor:function(e,t){return this[this._isSelect?"_accessorSelect":"_accessorInput"](e,t)},_accessorInput:function(e){var i=this.element[0];return e===t?i.value:(null===e&&(e=""),i.value=e,t)},_accessorSelect:function(e,i){var n,s=this.element[0];return e===t?a(s).value||"":(a(s).selected=!1,i===t&&(i=-1),n=null!==e&&""!==e,n&&i==-1?this._custom(e):e?s.value=e:s.selectedIndex=i,t)},_custom:function(t){var i=this,n=i.element,a=i._customOption;a||(a=e("<option/>"),i._customOption=a,n.append(a)),a.text(t),a[0].selected=!0},_hideBusy:function(){var e=this;clearTimeout(e._busy),e._arrow.removeClass(w),e._focused.attr("aria-busy",!1),e._busy=null,e._showClear()},_showBusy:function(){var e=this;e._request=!0,e._busy||(e._busy=setTimeout(function(){e._arrow&&(e._focused.attr("aria-busy",!0),e._arrow.addClass(w),e._hideClear())},100))},_requestEnd:function(){this._request=!1,this._hideBusy()},_dataSource:function(){var t,i=this,n=i.element,a=i.options,s=a.dataSource||{};s=e.isArray(s)?{data:s}:s,i._isSelect&&(t=n[0].selectedIndex,t>-1&&(a.index=t),s.select=n,s.fields=[{field:a.dataTextField},{field:a.dataValueField}]),i.dataSource?i._unbindDataSource():(i._requestStartHandler=P(i._showBusy,i),i._requestEndHandler=P(i._requestEnd,i),i._errorHandler=P(i._hideBusy,i)),i.dataSource=u.data.DataSource.create(s).bind(C,i._requestStartHandler).bind(H,i._requestEndHandler).bind("error",i._errorHandler)},_firstItem:function(){this.listView.focusFirst()},_lastItem:function(){this.listView.focusLast()},_nextItem:function(){this.listView.focusNext()},_prevItem:function(){this.listView.focusPrev()},_move:function(e){var i,n,a,s,r,l=this,o=l.listView,u=e.keyCode,d=u===_.DOWN;if(u===_.UP||d){if(e.altKey)l.toggle(d);else{if(!o.bound())return l._fetch||(l.dataSource.one(x,function(){l._fetch=!1,l._move(e)}),l._fetch=!0,l._filterSource()),e.preventDefault(),!0;if(a=l._focus(),l._fetch||a&&!a.hasClass("k-state-selected")||(d?(l._nextItem(),l._focus()||l._lastItem()):(l._prevItem(),l._focus()||l._firstItem())),i=o.dataItemByIndex(o.getElementIndex(l._focus())),l.trigger(V,{dataItem:i,item:l._focus()}))return l._focus(a),t;l._select(l._focus(),!0).done(function(){l.popup.visible()||l._blur()})}e.preventDefault(),n=!0}else if(u===_.ENTER||u===_.TAB){if(l.popup.visible()&&e.preventDefault(),a=l._focus(),i=l.dataItem(),l.popup.visible()||i&&l.text()===l._text(i)||(a=null),s=l.filterInput&&l.filterInput[0]===v(),a){if(i=o.dataItemByIndex(o.getElementIndex(a)),l.trigger(V,{dataItem:i,item:a}))return;l._select(a)}else l.input&&(l._accessor(l.input.val()),l.listView.value(l.input.val()));l._focusElement&&l._focusElement(l.wrapper),s&&u===_.TAB?l.wrapper.focusout():l._blur(),l.close(),n=!0}else u===_.ESC?(l.popup.visible()&&e.preventDefault(),l.close(),n=!0):!l.popup.visible()||u!==_.PAGEDOWN&&u!==_.PAGEUP||(e.preventDefault(),r=u===_.PAGEDOWN?1:-1,o.scrollWith(r*o.screenHeight()),n=!0);return n},_fetchData:function(){var e=this,t=!!e.dataSource.view().length;e._request||e.options.cascadeFrom||e.listView.bound()||e._fetch||t||(e._fetch=!0,e.dataSource.fetch().done(function(){e._fetch=!1}))},_options:function(e,i,n){var s,r,l,o,u=this,d=u.element,c=d[0],h=e.length,f="",_=0;for(i&&(f=i);_<h;_++)s="<option",r=e[_],l=u._text(r),o=u._value(r),o!==t&&(o+="",o.indexOf('"')!==-1&&(o=o.replace(L,"&quot;")),s+=' value="'+o+'"'),s+=">",l!==t&&(s+=g(l)),s+="</option>",f+=s;d.html(f),n!==t&&(c.value=n,c.value&&!n&&(c.selectedIndex=-1)),c.selectedIndex!==-1&&(s=a(c),s&&s.setAttribute(D,D))},_reset:function(){var t=this,i=t.element,n=i.attr("form"),a=n?e("#"+n):i.closest("form");a[0]&&(t._resetHandler=function(){setTimeout(function(){t.value(t._initial)})},t._form=a.on("reset",t._resetHandler))},_parentWidget:function(){var t,i,n=this.options.name;if(this.options.cascadeFrom)return t=e("#"+this.options.cascadeFrom),i=t.data("kendo"+n),i||(i=t.data("kendo"+O[n])),i},_cascade:function(){var e,t=this,i=t.options,n=i.cascadeFrom;if(n){if(e=t._parentWidget(),!e)return;t._cascadeHandlerProxy=P(t._cascadeHandler,t),t._cascadeFilterRequests=[],i.autoBind=!1,e.bind("set",function(){t.one("set",function(e){t._selectedValue=e.value})}),e.first(k,t._cascadeHandlerProxy),e.listView.bound()?(t._toggleCascadeOnFocus(),t._cascadeSelect(e)):(e.one("dataBound",function(){t._toggleCascadeOnFocus()}),e.value()||t.enable(!1))}},_toggleCascadeOnFocus:function(){var e=this,t=e._parentWidget(),i=G?"blur":"focusout";t._focused.add(t.filterInput).bind("focus",function(){t.unbind(k,e._cascadeHandlerProxy),t.first(x,e._cascadeHandlerProxy)}),t._focused.add(t.filterInput).bind(i,function(){t.unbind(x,e._cascadeHandlerProxy),t.first(k,e._cascadeHandlerProxy)})},_cascadeHandler:function(e){var t=this._parentWidget(),i=this.value();this._userTriggered=e.userTriggered,this.listView.bound()&&this._clearSelection(t,!0),this._cascadeSelect(t,i)},_cascadeChange:function(e){var t=this,i=t._accessor()||t._selectedValue;t._cascadeFilterRequests.length||(t._selectedValue=null),t._userTriggered?t._clearSelection(e,!0):i?(i!==t.listView.value()[0]&&t.value(i),t.dataSource.view()[0]&&t.selectedIndex!==-1||t._clearSelection(e,!0)):t.dataSource.flatView().length&&t.select(t.options.index),t.enable(),t._triggerCascade(),t._triggerChange(),t._userTriggered=!1},_cascadeSelect:function(e,i){var n,a,s=this,l=e.dataItem(),o=l?e._value(l):null,u=s.options.cascadeFromField||e.options.dataValueField;s._valueBeforeCascade=i!==t?i:s.value(),o||0===o?(n=s.dataSource.filter()||{},r(n,u),a=function(){var t=s._cascadeFilterRequests.shift();t&&s.unbind("dataBound",t),t=s._cascadeFilterRequests[0],t&&s.first("dataBound",t),s._cascadeChange(e)},s._cascadeFilterRequests.push(a),1===s._cascadeFilterRequests.length&&s.first("dataBound",a),s._cascading=!0,s._filterSource({field:u,operator:"eq",value:o}),s._cascading=!1):(s.enable(!1),s._clearSelection(e),s._triggerCascade(),s._triggerChange(),s._userTriggered=!1)}}),l=".StaticList",o=u.ui.DataBoundWidget.extend({init:function(t,i){f.fn.init.call(this,t,i),this.element.attr("role","listbox").on("click"+l,"li",P(this._click,this)).on("mouseenter"+l,"li",function(){e(this).addClass(S)}).on("mouseleave"+l,"li",function(){e(this).removeClass(S)}),this.content=this.element.wrap("<div class='k-list-scroller' unselectable='on'></div>").parent(),this.header=this.content.before('<div class="k-group-header" style="display:none"></div>').prev(),this.bound(!1),this._optionID=u.guid(),this._selectedIndices=[],this._view=[],this._dataItems=[],this._values=[];var n=this.options.value;n&&(this._values=e.isArray(n)?n.slice(0):[n]),this._getter(),this._templates(),this.setDataSource(this.options.dataSource),this._onScroll=P(function(){var e=this;clearTimeout(e._scrollId),e._scrollId=setTimeout(function(){e._renderHeader()},50)},this)},options:{name:"StaticList",dataValueField:null,valuePrimitive:!1,selectable:!0,template:null,groupTemplate:null,fixedGroupTemplate:null},events:["click",x,"activate","deactivate","dataBinding","dataBound","selectedItemChange"],setDataSource:function(t){var i,n=this,a=t||{};a=e.isArray(a)?{data:a}:a,a=u.data.DataSource.create(a),n.dataSource?(n.dataSource.unbind(x,n._refreshHandler),i=n.value(),n.value([]),n.bound(!1),n.value(i)):n._refreshHandler=P(n.refresh,n),n.setDSFilter(a.filter()),n.dataSource=a.bind(x,n._refreshHandler),n._fixedHeader()},skip:function(){return this.dataSource.skip()},setOptions:function(e){f.fn.setOptions.call(this,e),this._getter(),this._templates(),this._render()},destroy:function(){this.element.off(l),this._refreshHandler&&this.dataSource.unbind(x,this._refreshHandler),clearTimeout(this._scrollId),f.fn.destroy.call(this)},dataItemByIndex:function(e){return this.dataSource.flatView()[e]},screenHeight:function(){return this.content[0].clientHeight},scrollToIndex:function(e){var t=this.element[0].children[e];t&&this.scroll(t)},scrollWith:function(e){this.content.scrollTop(this.content.scrollTop()+e)},scroll:function(e){if(e){e[0]&&(e=e[0]);var t=this.content[0],i=e.offsetTop,n=e.offsetHeight,a=t.scrollTop,s=t.clientHeight,r=i+n;a>i?a=i:r>a+s&&(a=r-s),t.scrollTop=a}},selectedDataItems:function(e){return e===t?this._dataItems.slice():(this._dataItems=e,this._values=this._getValues(e),t)},_getValues:function(t){var i=this._valueGetter;return e.map(t,function(e){return i(e)})},focusNext:function(){var e=this.focus();e=e?e.next():0,this.focus(e)},focusPrev:function(){var e=this.focus();e=e?e.prev():this.element[0].children.length-1,this.focus(e)},focusFirst:function(){this.focus(this.element[0].children[0])},focusLast:function(){this.focus(n(this.element[0].children))},focus:function(i){var a,s=this,r=s._optionID;return i===t?s._current:(i=n(s._get(i)),i=e(this.element[0].children[i]),s._current&&(s._current.removeClass(I).removeAttr("aria-selected").removeAttr(b),s.trigger("deactivate")),a=!!i[0],a&&(i.addClass(I),s.scroll(i),i.attr("id",r)),s._current=a?i:null,s.trigger("activate"),t)},focusIndex:function(){return this.focus()?this.focus().index():t},skipUpdate:function(e){this._skipUpdate=e},select:function(i){var a,s,r,l=this,o=l.options.selectable,u="multiple"!==o&&o!==!1,d=l._selectedIndices,c=[],h=[];return i===t?d.slice():(i=l._get(i),1===i.length&&i[0]===-1&&(i=[]),s=e.Deferred().resolve(),r=l.isFiltered(),r&&!u&&l._deselectFiltered(i)?s:u&&!r&&e.inArray(n(i),d)!==-1?(l._dataItems.length&&l._view.length&&(l._dataItems=[l._view[d[0]].item]),s):(a=l._deselect(i),h=a.removed,i=a.indices,i.length&&(u&&(i=[n(i)]),c=l._select(i)),(c.length||h.length)&&(l._valueComparer=null,l.trigger(x,{added:c,removed:h})),s))},removeAt:function(e){return this._selectedIndices.splice(e,1),this._values.splice(e,1),this._valueComparer=null,{position:e,dataItem:this._dataItems.splice(e,1)[0]}},setValue:function(t){t=e.isArray(t)||t instanceof m?t.slice(0):[t],this._values=t,this._valueComparer=null},value:function(i){var n,a=this,s=a._valueDeferred;return i===t?a._values.slice():(a.setValue(i),s&&"resolved"!==s.state()||(a._valueDeferred=s=e.Deferred()),a.bound()&&(n=a._valueIndices(a._values),"multiple"===a.options.selectable&&a.select(-1),a.select(n),s.resolve()),a._skipUpdate=!1,s)},items:function(){return this.element.children(".k-item")},_click:function(t){t.isDefaultPrevented()||this.trigger("click",{item:e(t.currentTarget)})||this.select(t.currentTarget)},_valueExpr:function(e,t){var n,a,s=this,r=0,l=[];if(!s._valueComparer||s._valueType!==e){for(s._valueType=e;r<t.length;r++)l.push(i(t[r],e));n="for (var idx = 0; idx < "+l.length+"; idx++) { if (current === values[idx]) {   return idx; }} return -1;",a=Function("current","values",n),s._valueComparer=function(e){return a(e,l)}}return s._valueComparer},_dataItemPosition:function(e,t){var i=this._valueGetter(e),n=this._valueExpr(typeof i,t);return n(i)},_getter:function(){this._valueGetter=u.getter(this.options.dataValueField)},_deselect:function(t){var i,n,a,s=this,r=s.element[0].children,l=s.options.selectable,o=s._selectedIndices,u=s._dataItems,d=s._values,c=[],h=0,f=0;if(t=t.slice(),l!==!0&&t.length){if("multiple"===l)for(;h<t.length;h++)if(n=t[h],e(r[n]).hasClass("k-state-selected"))for(i=0;i<o.length;i++)if(a=o[i],a===n){e(r[a]).removeClass("k-state-selected"),c.push({position:i+f,dataItem:u.splice(i,1)[0]}),o.splice(i,1),t.splice(h,1),d.splice(i,1),f+=1,h-=1,i-=1;break}}else{for(;h<o.length;h++)e(r[o[h]]).removeClass("k-state-selected"),c.push({position:h,dataItem:u[h]});s._values=[],s._dataItems=[],s._selectedIndices=[]}return{indices:t,removed:c}},_deselectFiltered:function(t){for(var i,n,a,s=this.element[0].children,r=[],l=0;l<t.length;l++)n=t[l],i=this._view[n].item,a=this._dataItemPosition(i,this._values),a>-1&&(r.push(this.removeAt(a)),e(s[n]).removeClass("k-state-selected"));return!!r.length&&(this.trigger(x,{added:[],removed:r}),!0)},_select:function(t){var i,a,s=this,r=s.element[0].children,l=s._view,o=[],u=0;for(n(t)!==-1&&s.focus(t);u<t.length;u++)a=t[u],i=l[a],a!==-1&&i&&(i=i.item,s._selectedIndices.push(a),s._dataItems.push(i),s._values.push(s._valueGetter(i)),e(r[a]).addClass("k-state-selected").attr("aria-selected",!0),o.push({dataItem:i}));return o},getElementIndex:function(t){return e(t).data("offset-index")},_get:function(e){return"number"==typeof e?e=[e]:q(e)||(e=this.getElementIndex(e),e=[e!==t?e:-1]),e},_template:function(){var e=this,t=e.options,i=t.template;return i?(i=u.template(i),i=function(e){return'<li tabindex="-1" role="option" unselectable="on" class="k-item">'+i(e)+"</li>"}):i=u.template('<li tabindex="-1" role="option" unselectable="on" class="k-item">${'+u.expr(t.dataTextField,"data")+"}</li>",{useWithBlock:!1}),i},_templates:function(){var e,t,i=this.options,n={template:i.template,groupTemplate:i.groupTemplate,fixedGroupTemplate:i.fixedGroupTemplate};for(t in n)e=n[t],e&&"function"!=typeof e&&(n[t]=u.template(e));this.templates=n},_normalizeIndices:function(e){for(var i=[],n=0;n<e.length;n++)e[n]!==t&&i.push(e[n]);return i},_valueIndices:function(e,t){var i,n=this._view,a=0;if(t=t?t.slice():[],!e.length)return[];for(;a<n.length;a++)i=this._dataItemPosition(n[a].item,e),i!==-1&&(t[i]=a);return this._normalizeIndices(t)},_firstVisibleItem:function(){for(var t=this.element[0],i=this.content[0],n=i.scrollTop,a=e(t.children[0]).height(),s=Math.floor(n/a)||0,r=t.children[s]||t.lastChild,l=r.offsetTop<n;r;)if(l){if(r.offsetTop+a>n||!r.nextSibling)break;r=r.nextSibling}else{if(r.offsetTop<=n||!r.previousSibling)break;r=r.previousSibling}return this._view[e(r).data("offset-index")]},_fixedHeader:function(){this.isGrouped()&&this.templates.fixedGroupTemplate?(this.header.show(),this.content.scroll(this._onScroll)):(this.header.hide(),this.content.off("scroll",this._onScroll))},_renderHeader:function(){var e,t=this.templates.fixedGroupTemplate;t&&(e=this._firstVisibleItem(),e&&this.header.html(t(e.group)))},_renderItem:function(e){var t='<li tabindex="-1" role="option" unselectable="on" class="k-item',i=e.item,n=0!==e.index,a=e.selected;return n&&e.newGroup&&(t+=" k-first"),a&&(t+=" k-state-selected"),t+='"'+(a?' aria-selected="true"':"")+' data-offset-index="'+e.index+'">',t+=this.templates.template(i),n&&e.newGroup&&(t+='<div class="k-group">'+this.templates.groupTemplate(e.group)+"</div>"),t+"</li>"},_render:function(){var e,t,i,n,a="",s=0,r=0,l=[],o=this.dataSource.view(),u=this.value(),d=this.isGrouped();if(d)for(s=0;s<o.length;s++)for(t=o[s],i=!0,n=0;n<t.items.length;n++)e={selected:this._selected(t.items[n],u),item:t.items[n],group:t.value,newGroup:i,index:r},l[r]=e,r+=1,a+=this._renderItem(e),i=!1;else for(s=0;s<o.length;s++)e={selected:this._selected(o[s],u),item:o[s],index:s},l[s]=e,a+=this._renderItem(e);this._view=l,this.element[0].innerHTML=a,d&&l.length&&this._renderHeader()},_selected:function(e,t){var i=!this.isFiltered()||"multiple"===this.options.selectable;return i&&this._dataItemPosition(e,t)!==-1},setDSFilter:function(e){this._lastDSFilter=E({},e)},isFiltered:function(){return this._lastDSFilter||this.setDSFilter(this.dataSource.filter()),!u.data.Query.compareFilters(this.dataSource.filter(),this._lastDSFilter)},refresh:function(e){var t,i=this,n=e&&e.action,a=i.options.skipUpdateOnBind,r="itemchange"===n;i.trigger("dataBinding"),i._angularItems("cleanup"),i._fixedHeader(),i._render(),i.bound(!0),r||"remove"===n?(t=s(i._dataItems,e.items),t.changed.length&&(r?i.trigger("selectedItemChange",{items:t.changed}):i.value(i._getValues(t.unchanged)))):i.isFiltered()||i._skipUpdate?(i.focus(0),i._skipUpdate&&(i._skipUpdate=!1,i._selectedIndices=i._valueIndices(i._values,i._selectedIndices))):a||n&&"add"!==n||i.value(i._values),i._valueDeferred&&i._valueDeferred.resolve(),i._angularItems("compile"),i.trigger("dataBound")},bound:function(e){return e===t?this._bound:(this._bound=e,t)},isGrouped:function(){return(this.dataSource.group()||[]).length}}),d.plugin(o)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,i){(i||t)()});
//# sourceMappingURL=kendo.list.min.js.map
