/* * Kendo UI Beta v2013.2.716 (http://kendoui.com) * Copyright 2013 Telerik AD. All rights reserved. * * Kendo UI Beta license terms available at * http://www.kendoui.com/purchase/license-agreement/kendo-ui-beta.aspx */ ("function"==typeof define&&define.amd?define:function(e,t){return t()})(["./kendo.core.min"],function(){!function(e,t){var n=window.kendo,r=e.isArray,i=e.isPlainObject,o=e.map,a=e.each,f=e.extend,l=n.getter,d=n.Class,u=d.extend({init:function(e){var t,l,d,u=this,s=e.total,c=e.model,p=e.parse,m=e.errors,h=e.serialize,x=e.data;c&&(i(c)&&(c.fields&&a(c.fields,function(e,t){t=i(t)&&t.field?f(t,{field:u.getter(t.field)}):{field:u.getter(t)},c.fields[e]=t}),t=c.id,t&&(l={},l[u.xpathToMember(t,!0)]={field:u.getter(t)},c.fields=f(l,c.fields),c.id=u.xpathToMember(t)),c=n.data.Model.define(c)),u.model=c),s&&("string"==typeof s?(s=u.getter(s),u.total=function(e){return parseInt(s(e),10)}):"function"==typeof s&&(u.total=s)),m&&("string"==typeof m?(m=u.getter(m),u.errors=function(e){return m(e)||null}):"function"==typeof m&&(u.errors=m)),x&&("string"==typeof x?(x=u.xpathToMember(x),u.data=function(e){var t,n=u.evaluate(e,x);return n=r(n)?n:[n],u.model&&c.fields?(t=new u.model,o(n,function(e){if(e){var n,r={};for(n in c.fields)r[n]=t._parse(n,c.fields[n].field(e));return r}})):n}):"function"==typeof x&&(u.data=x)),"function"==typeof p&&(d=u.parse,u.parse=function(e){var t=p.call(u,e);return d.call(u,t)}),"function"==typeof h&&(u.serialize=h)},total:function(e){return this.data(e).length},errors:function(e){return e?e.errors:null},serialize:function(e){return e},parseDOM:function(e){var n,i,o,a,f,l,d,u={},s=e.attributes,c=s.length;for(d=0;c>d;d++)l=s[d],u["@"+l.nodeName]=l.nodeValue;for(i=e.firstChild;i;i=i.nextSibling)o=i.nodeType,3===o||4===o?u["#text"]=i.nodeValue:1===o&&(n=this.parseDOM(i),a=i.nodeName,f=u[a],r(f)?f.push(n):f=f!==t?[f,n]:n,u[a]=f);return u},evaluate:function(e,t){for(var n,i,o,a,f,l=t.split(".");n=l.shift();)if(e=e[n],r(e)){for(i=[],t=l.join("."),f=0,o=e.length;o>f;f++)a=this.evaluate(e[f],t),a=r(a)?a:[a],i.push.apply(i,a);return i}return e},parse:function(t){var n,r,i={};return n=t.documentElement||e.parseXML(t).documentElement,r=this.parseDOM(n),i[n.nodeName]=r,i},xpathToMember:function(e,t){return e?(e=e.replace(/^\//,"").replace(/\//g,"."),e.indexOf("@")>=0?e.replace(/\.?(@.*)/,t?"$1":'["$1"]'):e.indexOf("text()")>=0?e.replace(/(\.?text\(\))/,t?"#text":'["#text"]'):e):""},getter:function(e){return l(this.xpathToMember(e),!0)}});e.extend(!0,n.data,{XmlDataReader:u,readers:{xml:u}})}(window.kendo.jQuery)});