text: /*
  * Kendo UI v2014.3.1119 (http://www.telerik.com/kendo-ui)
  * Copyright 2014 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.datepicker.min","./kendo.numerictextbox.min","./kendo.dropdownlist.min"],e)}(function(){return function(e){function t(n,i){n.filters&&(n.filters=e.grep(n.filters,function(e){return t(e,i),e.filters?e.filters.length:e.field!=i}))}function n(e){var t,n,i,o,r,a;if(e&&e.length)for(a=[],t=0,n=e.length;n>t;t++)i=e[t],r=i.text||i.value||i,o=null==i.value?i.text||i:i.value,a[t]={text:r,value:o};return a}function i(t,n){return e.grep(t,function(t){return t.filters?(t.filters=e.grep(t.filters,function(e){return e.field!=n}),t.filters.length):t.field!=n})}var o=window.kendo,r=o.ui,a=e.proxy,s="kendoPopup",l="init",c=".kendoFilterMenu",h="Is equal to",d="Is not equal to",u={number:"numerictextbox",date:"datepicker"},f={string:"text",number:"number",date:"date"},p=o.isFunction,g=r.Widget,m='<div><div class="k-filter-help-text">#=messages.info#</div><label><input type="radio" data-#=ns#bind="checked: filters[0].value" value="true" name="filters[0].value"/>#=messages.isTrue#</label><label><input type="radio" data-#=ns#bind="checked: filters[0].value" value="false" name="filters[0].value"/>#=messages.isFalse#</label><div><button type="submit" class="k-button k-primary">#=messages.filter#</button><button type="reset" class="k-button">#=messages.clear#</button></div></div>',v='<div><div class="k-filter-help-text">#=messages.info#</div><select data-#=ns#bind="value: filters[0].operator" data-#=ns#role="dropdownlist">#for(var op in operators){#<option value="#=op#">#=operators[op]#</option>#}#</select>#if(values){#<select data-#=ns#bind="value:filters[0].value" data-#=ns#text-field="text" data-#=ns#value-field="value" data-#=ns#source=\'#=kendo.stringify(values).replace(/\'/g,"&\\#39;")#\' data-#=ns#role="dropdownlist" data-#=ns#option-label="#=messages.selectValue#"></select>#}else{#<input data-#=ns#bind="value:filters[0].value" class="k-textbox" type="text" #=role ? "data-" + ns + "role=\'" + role + "\'" : ""# />#}##if(extra){#<select class="k-filter-and" data-#=ns#bind="value: logic" data-#=ns#role="dropdownlist"><option value="and">#=messages.and#</option><option value="or">#=messages.or#</option></select><select data-#=ns#bind="value: filters[1].operator" data-#=ns#role="dropdownlist">#for(var op in operators){#<option value="#=op#">#=operators[op]#</option>#}#</select>#if(values){#<select data-#=ns#bind="value:filters[1].value" data-#=ns#text-field="text" data-#=ns#value-field="value" data-#=ns#source=\'#=kendo.stringify(values).replace(/\'/g,"&\\#39;")#\' data-#=ns#role="dropdownlist" data-#=ns#option-label="#=messages.selectValue#"></select>#}else{#<input data-#=ns#bind="value: filters[1].value" class="k-textbox" type="text" #=role ? "data-" + ns + "role=\'" + role + "\'" : ""#/>#}##}#<div><button type="submit" class="k-button k-primary">#=messages.filter#</button><button type="reset" class="k-button">#=messages.clear#</button></div></div>',_='<div data-#=ns#role="view" data-#=ns#init-widgets="false" class="k-grid-filter-menu"><div data-#=ns#role="header" class="k-header"><button class="k-button k-cancel">#=messages.cancel#</button>#=field#<button type="submit" class="k-button k-submit">#=messages.filter#</button></div><form class="k-filter-menu k-mobile-list"><ul class="k-filter-help-text"><li><span class="k-link">#=messages.info#</span><ul><li class="k-item"><label class="k-label">#=messages.operator#<select data-#=ns#bind="value: filters[0].operator">#for(var op in operators){#<option value="#=op#">#=operators[op]#</option>#}#</select></label></li><li class="k-item"><label class="k-label">#=messages.value##if(values){#<select data-#=ns#bind="value:filters[0].value"><option value="">#=messages.selectValue#</option>#for(var val in values){#<option value="#=values[val].value#">#=values[val].text#</option>#}#</select>#}else{#<input data-#=ns#bind="value:filters[0].value" class="k-textbox" type="#=inputType#" #=useRole ? "data-" + ns + "role=\'" + role + "\'" : ""# />#}#</label></li>#if(extra){#</ul><ul class="k-filter-help-text"><li><span class="k-link"></span><li class="k-item"><label class="k-label"><input type="radio" name="logic" class="k-check" data-#=ns#bind="checked: logic" value="and" />#=messages.and#</label></li><li class="k-item"><label class="k-label"><input type="radio" name="logic" class="k-check" data-#=ns#bind="checked: logic" value="or" />#=messages.or#</label></li></ul><ul class="k-filter-help-text"><li><span class="k-link"></span><li class="k-item"><label class="k-label">#=messages.operator#<select data-#=ns#bind="value: filters[1].operator">#for(var op in operators){#<option value="#=op#">#=operators[op]#</option>#}#</select></label></li><li class="k-item"><label class="k-label">#=messages.value##if(values){#<select data-#=ns#bind="value:filters[1].value"><option value="">#=messages.selectValue#</option>#for(var val in values){#<option value="#=values[val].value#">#=values[val].text#</option>#}#</select>#}else{#<input data-#=ns#bind="value:filters[1].value" class="k-textbox" type="#=inputType#" #=useRole ? "data-" + ns + "role=\'" + role + "\'" : ""# />#}#</label></li>#}#</ul></li><li class="k-button-container"><button type="reset" class="k-button">#=messages.clear#</button></li></ul></div></form></div>',w='<div data-#=ns#role="view" data-#=ns#init-widgets="false" class="k-grid-filter-menu"><div data-#=ns#role="header" class="k-header"><button class="k-button k-cancel">#=messages.cancel#</button>#=field#<button type="submit" class="k-button k-submit">#=messages.filter#</button></div><form class="k-filter-menu k-mobile-list"><ul class="k-filter-help-text"><li><span class="k-link">#=messages.info#</span><ul><li class="k-item"><label class="k-label"><input class="k-check" type="radio" data-#=ns#bind="checked: filters[0].value" value="true" name="filters[0].value"/>#=messages.isTrue#</label></li><li class="k-item"><label class="k-label"><input class="k-check" type="radio" data-#=ns#bind="checked: filters[0].value" value="false" name="filters[0].value"/>#=messages.isFalse#</label></li></ul></li><li class="k-button-container"><button type="reset" class="k-button">#=messages.clear#</button></li></ul></form></div>',y=g.extend({init:function(t,n){var i,r,s,l,h=this,d="string";g.fn.init.call(h,t,n),i=h.operators=n.operators||{},t=h.element,n=h.options,n.appendToElement||(s=t.addClass("k-with-icon k-filterable").find(".k-grid-filter"),s[0]||(s=t.prepend('<a class="k-grid-filter" href="#"><span class="k-icon k-filter"/></a>').find(".k-grid-filter")),s.attr("tabindex",-1).on("click"+c,a(h._click,h))),h.link=s||e(),h.dataSource=n.dataSource,h.field=n.field||t.attr(o.attr("field")),h.model=h.dataSource.reader.model,h._parse=function(e){return e+""},h.model&&h.model.fields&&(l=h.model.fields[h.field],l&&(d=l.type||"string",l.parse&&(h._parse=a(l.parse,l)))),n.values&&(d="enums"),h.type=d,i=i[d]||n.operators[d];for(r in i)break;h._defaultFilter=function(){return{field:h.field,operator:r||"eq",value:""}},h._refreshHandler=a(h.refresh,h),h.dataSource.bind("change",h._refreshHandler),n.appendToElement?h._init():h.refresh()},_init:function(){var t,n=this,i=n.options.ui,r=p(i);n.pane=n.options.pane,n.pane&&(n._isMobile=!0),r||(t=i||u[n.type]),n._isMobile?n._createMobileForm(t):n._createForm(t),n.form.on("submit"+c,a(n._submit,n)).on("reset"+c,a(n._reset,n)),r&&n.form.find(".k-textbox").removeClass("k-textbox").each(function(){i(e(this))}),n.form.find("["+o.attr("role")+"=numerictextbox]").removeClass("k-textbox").end().find("["+o.attr("role")+"=datetimepicker]").removeClass("k-textbox").end().find("["+o.attr("role")+"=timepicker]").removeClass("k-textbox").end().find("["+o.attr("role")+"=datepicker]").removeClass("k-textbox"),n.refresh(),n.trigger(l,{field:n.field,container:n.form})},_createForm:function(t){var i=this,r=i.options,l=i.operators||{},h=i.type;l=l[h]||r.operators[h],i.form=e('<form class="k-filter-menu"/>').html(o.template("boolean"===h?m:v)({field:i.field,format:r.format,ns:o.ns,messages:r.messages,extra:r.extra,operators:l,type:h,role:t,values:n(r.values)})),r.appendToElement?(i.element.append(i.form),i.popup=i.element.closest(".k-popup").data(s)):i.popup=i.form[s]({anchor:i.link,open:a(i._open,i),activate:a(i._activate,i),close:function(){i.options.closeCallback&&i.options.closeCallback(i.element)}}).data(s),i.form.on("keydown"+c,a(i._keydown,i))},_createMobileForm:function(t){var i=this,r=i.options,a=i.operators||{},s=i.type;a=a[s]||r.operators[s],i.form=e("<div />").html(o.template("boolean"===s?w:_)({field:i.field,format:r.format,ns:o.ns,messages:r.messages,extra:r.extra,operators:a,type:s,role:t,useRole:!o.support.input.date&&"date"===s||"number"===s,inputType:f[s],values:n(r.values)})),i.view=i.pane.append(i.form.html()),i.form=i.view.element.find("form"),i.view.element.on("click",".k-submit",function(e){i.form.submit(),e.preventDefault()}).on("click",".k-cancel",function(e){i._closeForm(),e.preventDefault()})},refresh:function(){var e=this,t=e.dataSource.filter()||{filters:[],logic:"and"};e.filterModel=o.observable({logic:"and",filters:[e._defaultFilter(),e._defaultFilter()]}),e.form&&o.bind(e.form.children().first(),e.filterModel),e._bind(t)?e.link.addClass("k-state-active"):e.link.removeClass("k-state-active")},destroy:function(){var e=this;g.fn.destroy.call(e),e.form&&(o.unbind(e.form),o.destroy(e.form),e.form.unbind(c),e.popup&&(e.popup.destroy(),e.popup=null),e.form=null),e.view&&(e.view.purge(),e.view=null),e.link.unbind(c),e._refreshHandler&&(e.dataSource.unbind("change",e._refreshHandler),e.dataSource=null),e.element=e.link=e._refreshHandler=e.filterModel=null},_bind:function(e){var t,n,i,o,r=this,a=e.filters,s=!1,l=0,c=r.filterModel;for(t=0,n=a.length;n>t;t++)o=a[t],o.field==r.field?(c.set("logic",e.logic),i=c.filters[l],i||(c.filters.push({field:r.field}),i=c.filters[l]),i.set("value",r._parse(o.value)),i.set("operator",o.operator),l++,s=!0):o.filters&&(s=s||r._bind(o));return s},_merge:function(n){var i,o,r,a=this,s=n.logic||"and",l=n.filters,c=a.dataSource.filter()||{filters:[],logic:"and"};for(t(c,a.field),l=e.grep(l,function(e){return""!==e.value&&null!=e.value}),o=0,r=l.length;r>o;o++)i=l[o],i.value=a._parse(i.value);return l.length&&(c.filters.length?(n.filters=l,"and"!==c.logic&&(c.filters=[{logic:c.logic,filters:c.filters}],c.logic="and"),c.filters.push(l.length>1?n:l[0])):(c.filters=l,c.logic=s)),c},filter:function(e){e=this._merge(e),e.filters.length&&this.dataSource.filter(e)},clear:function(){var t=this,n=t.dataSource.filter()||{filters:[]};n.filters=e.grep(n.filters,function(e){return e.filters?(e.filters=i(e.filters,t.field),e.filters.length):e.field!=t.field}),n.filters.length||(n=null),t.dataSource.filter(n)},_submit:function(e){e.preventDefault(),e.stopPropagation(),this.filter(this.filterModel.toJSON()),this._closeForm()},_reset:function(){this.clear(),this._closeForm()},_closeForm:function(){this._isMobile?this.pane.navigate("",this.options.animations.right):this.popup.close()},_click:function(e){e.preventDefault(),e.stopPropagation(),this.popup||this.pane||this._init(),this._isMobile?this.pane.navigate(this.view,this.options.animations.left):this.popup.toggle()},_open:function(){var t;e(".k-filter-menu").not(this.form).each(function(){t=e(this).data(s),t&&t.close()})},_activate:function(){this.form.find(":kendoFocusable:first").focus()},_keydown:function(e){e.keyCode==o.keys.ESC&&this.popup.close()},events:[l],options:{name:"FilterMenu",extra:!0,appendToElement:!1,type:"string",operators:{string:{eq:h,neq:d,startswith:"Starts with",contains:"Contains",doesnotcontain:"Does not contain",endswith:"Ends with"},number:{eq:h,neq:d,gte:"Is greater than or equal to",gt:"Is greater than",lte:"Is less than or equal to",lt:"Is less than"},date:{eq:h,neq:d,gte:"Is after or equal to",gt:"Is after",lte:"Is before or equal to",lt:"Is before"},enums:{eq:h,neq:d}},messages:{info:"Show items with value that:",isTrue:"is true",isFalse:"is false",filter:"Filter",clear:"Clear",and:"And",or:"Or",selectValue:"-Select value-",operator:"Operator",value:"Value",cancel:"Cancel"},animations:{left:"slide",right:"slide:right"}}});r.plugin(y)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t){t()});