UNPKG

@boldreports/javascript-reporting-controls

Version:

The Bold Reports by Syncfusion controls for JavaScript contains ReportViewer and ReportDesigner HTML5 and JavaScript reporting controls for enterprise web development

10 lines 65.6 kB
/*! * filename: ej2-data.min.js * version : 17.4.47 * Copyright Syncfusion Inc. 2001 - 2025. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing * licensing@syncfusion.com. Any infringement will be prosecuted under * applicable laws. */ this.ej=this.ej||{},this.ej.data=function(e,t){"use strict";var r=function(){function e(e){return this.subQuery=null,this.isChild=!1,this.distincts=[],this.queries=[],this.key="",this.fKey="","string"==typeof e?this.fromTable=e:e&&e instanceof Array&&(this.lookups=e),this.expands=[],this.sortedColumns=[],this.groupedColumns=[],this.subQuery=null,this.isChild=!1,this.params=[],this}return e.prototype.setKey=function(e){return this.key=e,this},e.prototype.using=function(e){return this.dataManager=e,this},e.prototype.execute=function(e,t,r,n){return e=e||this.dataManager,e?e.executeQuery(this,t,r,n):a.throwError('Query - execute() : dataManager needs to be is set using "using" function or should be passed as argument')},e.prototype.executeLocal=function(e){return e=e||this.dataManager,e?e.executeLocal(this):a.throwError('Query - executeLocal() : dataManager needs to be is set using "using" function or should be passed as argument')},e.prototype.clone=function(){var t=new e;return t.queries=this.queries.slice(0),t.key=this.key,t.isChild=this.isChild,t.dataManager=this.dataManager,t.fromTable=this.fromTable,t.params=this.params.slice(0),t.expands=this.expands.slice(0),t.sortedColumns=this.sortedColumns.slice(0),t.groupedColumns=this.groupedColumns.slice(0),t.subQuerySelector=this.subQuerySelector,t.subQuery=this.subQuery,t.fKey=this.fKey,t.isCountRequired=this.isCountRequired,t.distincts=this.distincts.slice(0),t},e.prototype.from=function(e){return this.fromTable=e,this},e.prototype.addParams=function(e,t){return"function"==typeof t?this.params.push({key:e,fn:t}):this.params.push({key:e,value:t}),this},e.prototype.distinct=function(e){return this.distincts="string"==typeof e?[].slice.call([e],0):e.slice(0),this},e.prototype.expand=function(e){return this.expands="string"==typeof e?[].slice.call([e],0):e.slice(0),this},e.prototype.where=function(e,t,r,o,a){t=t?t.toLowerCase():null;var s=null;return"string"==typeof e?s=new n(e,t,r,o,a):e instanceof n&&(s=e),this.queries.push({fn:"onWhere",e:s}),this},e.prototype.search=function(e,t,r,n,o){"string"==typeof t&&(t=[t]),r=r||"contains";var s=a.fnOperators[r];return this.queries.push({fn:"onSearch",e:{fieldNames:t,operator:r,searchKey:e,ignoreCase:n,ignoreAccent:o,comparer:s}}),this},e.prototype.sortBy=function(t,r,n){var o,s,i="ascending";if("string"==typeof t&&a.endsWith(t.toLowerCase()," desc")&&(t=t.replace(/ desc$/i,""),r="descending"),r&&"string"!=typeof r||(i=r?r.toLowerCase():"ascending",r=a.fnSort(r)),n){o=e.filterQueries(this.queries,"onSortBy");for(var u=0;u<o.length;u++)if("string"==typeof(s=o[u].e.fieldName)){if(s===t)return this}else if(s instanceof Array)for(var c=0;c<s.length;c++)if(s[c]===t||t.toLowerCase()===s[c]+" desc")return this}return this.queries.push({fn:"onSortBy",e:{fieldName:t,comparer:r,direction:i}}),this},e.prototype.sortByDesc=function(e){return this.sortBy(e,"descending")},e.prototype.group=function(e,t,r){return this.sortBy(e,null,!0),this.queries.push({fn:"onGroup",e:{fieldName:e,comparer:t||null,format:r||null}}),this},e.prototype.page=function(e,t){return this.queries.push({fn:"onPage",e:{pageIndex:e,pageSize:t}}),this},e.prototype.range=function(e,t){return this.queries.push({fn:"onRange",e:{start:e,end:t}}),this},e.prototype.take=function(e){return this.queries.push({fn:"onTake",e:{nos:e}}),this},e.prototype.skip=function(e){return this.queries.push({fn:"onSkip",e:{nos:e}}),this},e.prototype.select=function(e){return"string"==typeof e&&(e=[].slice.call([e],0)),this.queries.push({fn:"onSelect",e:{fieldNames:e}}),this},e.prototype.hierarchy=function(e,t){return this.subQuerySelector=t,this.subQuery=e,this},e.prototype.foreignKey=function(e){return this.fKey=e,this},e.prototype.requiresCount=function(){return this.isCountRequired=!0,this},e.prototype.aggregate=function(e,t){return this.queries.push({fn:"onAggregates",e:{field:t,type:e}}),this},e.filterQueries=function(e,t){return e.filter(function(e){return e.fn===t})},e.filterQueryLists=function(e,t){for(var r=e.filter(function(e){return-1!==t.indexOf(e.fn)}),n={},o=0;o<r.length;o++)n[r[o].fn]||(n[r[o].fn]=r[o].e);return n},e}(),n=function(){function e(t,r,n,o,s){return void 0===o&&(o=!1),this.ignoreAccent=!1,this.isComplex=!1,"string"==typeof t?(this.field=t,this.operator=r.toLowerCase(),this.value=n,this.ignoreCase=o,this.ignoreAccent=s,this.isComplex=!1,this.comparer=a.fnOperators.processOperator(this.operator)):(t instanceof e&&n instanceof e||n instanceof Array)&&(this.isComplex=!0,this.condition=r.toLowerCase(),this.predicates=[t],n instanceof Array?[].push.apply(this.predicates,n):this.predicates.push(n)),this}return e.and=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.combinePredicates([].slice.call(t,0),"and")},e.prototype.and=function(t,r,n,o,a){return e.combine(this,t,r,n,"and",o,a)},e.or=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.combinePredicates([].slice.call(t,0),"or")},e.prototype.or=function(t,r,n,o,a){return e.combine(this,t,r,n,"or",o,a)},e.fromJson=function(e){if(e instanceof Array){for(var t=[],r=0,n=e.length;r<n;r++)t.push(this.fromJSONData(e[r]));return t}var o=e;return this.fromJSONData(o)},e.prototype.validate=function(e){var t,r,n=this.predicates?this.predicates:[];if(!this.isComplex&&this.comparer)return this.comparer.call(this,a.getObject(this.field,e),this.value,this.ignoreCase,this.ignoreAccent);t="and"===this.condition;for(var o=0;o<n.length;o++)if(r=n[o].validate(e),t){if(!r)return!1}else if(r)return!0;return t},e.prototype.toJson=function(){var e,t;if(this.isComplex){e=[],t=this.predicates;for(var r=0;r<t.length;r++)e.push(t[r].toJson())}return{isComplex:this.isComplex,field:this.field,operator:this.operator,value:this.value,ignoreCase:this.ignoreCase,ignoreAccent:this.ignoreAccent,condition:this.condition,predicates:e}},e.combinePredicates=function(t,r){if(1===t.length){if(!(t[0]instanceof Array))return t[0];t=t[0]}return new e(t[0],r,t.slice(1))},e.combine=function(t,r,n,o,s,i,u){return r instanceof e?e[s](t,r):"string"==typeof r?e[s](t,new e(r,n,o,i,u)):a.throwError("Predicate - "+s+" : invalid arguments")},e.fromJSONData=function(t){for(var r=t.predicates||[],n=r.length,o=[],a=0;a<n;a++)o.push(this.fromJSONData(r[a]));return t.isComplex?new e(o[0],t.condition,o.slice(1)):new e(t.field,t.operator,t.value,t.ignoreCase,t.ignoreAccent)},e}(),o={GroupGuid:"{271bbba0-1ee7}"},a=function(){function e(){}return e.getValue=function(e,t){return"function"==typeof e?e.call(t||{}):e},e.endsWith=function(e,t){return e.slice&&e.slice(-t.length)===t},e.startsWith=function(e,t){return e.slice(0,t.length)===t},e.fnSort=function(t){return t=t?e.toLowerCase(t):"ascending","ascending"===t?this.fnAscending:this.fnDescending},e.fnAscending=function(e,r){return t.isNullOrUndefined(e)&&t.isNullOrUndefined(r)?-1:null===r||void 0===r?-1:"string"==typeof e?e.localeCompare(r):null===e||void 0===e?1:e-r},e.fnDescending=function(e,r){return t.isNullOrUndefined(e)&&t.isNullOrUndefined(r)?-1:null===r||void 0===r?1:"string"==typeof e?-1*e.localeCompare(r):null===e||void 0===e?-1:r-e},e.extractFields=function(e,t){for(var r={},n=0;n<t.length;n++)r=this.setValue(t[n],this.getObject(t[n],e),r);return r},e.select=function(e,t){for(var r=[],n=0;n<e.length;n++)r.push(this.extractFields(e[n],t));return r},e.group=function(r,n,a,s,i,u){s=s||1;var c=r;if(c.GroupGuid===o.GroupGuid){for(var l=this,p=0;p<c.length;p++)!function(e){if(t.isNullOrUndefined(i))c[e].items=l.group(c[e].items,n,a,c.level+1,null,u),c[e].count=c[e].items.length;else{var r=-1,o=i.filter(function(t){return t.key===c[e].key});r=i.indexOf(o[0]),c[e].items=l.group(c[e].items,n,a,c.level+1,i[r].items,u),c[e].count=i[r].count}}(p);return c.childLevels+=1,c}var d={},h=[];h.GroupGuid=o.GroupGuid,h.level=s,h.childLevels=0,h.records=c;for(var f=this,g=0;g<c.length;g++)!function(e){var r=f.getVal(c,e,n);if(t.isNullOrUndefined(u)||(r=u(r,n)),!d[r]&&(d[r]={key:r,count:0,items:[],aggregates:{},field:n},h.push(d[r]),!t.isNullOrUndefined(i))){var o=i.filter(function(e){return e.key===d[r].key});d[r].count=o[0].count}d[r].count=t.isNullOrUndefined(i)?d[r].count+=1:d[r].count,d[r].items.push(c[e])}(g);if(a&&a.length)for(g=0;g<h.length;g++)!function(r){for(var n={},o=void 0,s=a,u=0;u<a.length;u++)if(o=e.aggregates[a[u].type],t.isNullOrUndefined(i))o&&(n[s[u].field+" - "+s[u].type]=o(h[r].items,s[u].field));else{var c=i.filter(function(e){return e.key===h[r].key});o&&(n[s[u].field+" - "+s[u].type]=o(c[0].items,s[u].field))}h[r].aggregates=n}(g);return c.length&&h||c},e.buildHierarchy=function(e,t,r,n,o){var a,s={};for(n.result&&(n=n.result),n.GroupGuid&&this.throwError("DataManager: Do not have support Grouping in hierarchy"),a=0;a<n.length;a++)(s[i=this.getObject(e,n[a])]||(s[i]=[])).push(n[a]);for(a=0;a<r.length;a++){var i=this.getObject(o||e,r[a]);r[a][t]=s[i]}},e.getFieldList=function(e,t,r){if(void 0===r&&(r=""),void 0===t||null===t)return this.getFieldList(e,[],r);for(var n=e,o=0,a=Object.keys(e);o<a.length;o++){var s=a[o];"object"!=typeof n[s]||n[s]instanceof Array?t.push(r+s):this.getFieldList(n[s],t,r+s+".")}return t},e.getObject=function(e,t){if(!e)return t;if(t){if(-1===e.indexOf("."))return t[e];for(var r=t,n=e.split("."),o=0;o<n.length&&null!=r;o++)r=r[n[o]];return r}},e.setValue=function(e,r,n){var o,a,s=e.toString().split("."),i=n||{},u=i,c=s.length;for(o=0;o<c;o++)a=s[o],o+1===c?u[a]=void 0===r?void 0:r:t.isNullOrUndefined(u[a])&&(u[a]={}),u=u[a];return i},e.sort=function(e,t,r){if(e.length<=1)return e;var n=parseInt((e.length/2).toString(),10),o=e.slice(0,n),a=e.slice(n);return o=this.sort(o,t,r),a=this.sort(a,t,r),this.merge(o,a,t,r)},e.ignoreDiacritics=function(t){return"string"!=typeof t?t:t.split("").map(function(t){return t in e.diacritics?e.diacritics[t]:t}).join("")},e.merge=function(e,t,r,n){for(var o,a=[];e.length>0||t.length>0;)o=e.length>0&&t.length>0?n?n(this.getVal(e,0,r),this.getVal(t,0,r),e[0],t[0])<=0?e:t:e[0][r]<e[0][r]?e:t:e.length>0?e:t,a.push(o.shift());return a},e.getVal=function(e,t,r){return r?this.getObject(r,e[t]):e[t]},e.toLowerCase=function(e){return e?"string"==typeof e?e.toLowerCase():e.toString():0===e||!1===e?e.toString():""},e.callAdaptorFunction=function(e,r,n,o){if(r in e){var a=e[r](n,o);t.isNullOrUndefined(a)||(n=a)}return n},e.getAddParams=function(t,r,n){var o={};return e.callAdaptorFunction(t,"addParams",{dm:r,query:n,params:n.params,reqParams:o}),o},e.isPlainObject=function(e){return!!e&&e.constructor===Object},e.isCors=function(){var e=null;try{e=new window.XMLHttpRequest}catch(e){}return!!e&&"withCredentials"in e},e.getGuid=function(e){var t;return(e||"")+"00000000-0000-4000-0000-000000000000".replace(/0/g,function(e,r){if("crypto"in window&&"getRandomValues"in crypto){var n=new Uint8Array(1);window.crypto.getRandomValues(n),t=n[0]%16|0}else t=16*Math.random()|0;return"0123456789abcdef"[19===r?3&t|8:t]})},e.isNull=function(e){return void 0===e||null===e},e.getItemFromComparer=function(r,n,o){var a,s,i,u=0,c="string"==typeof e.getVal(r,0,n);if(r.length)for(;t.isNullOrUndefined(a)&&u<r.length;)a=e.getVal(r,u,n),i=r[u++];for(;u<r.length;u++)s=e.getVal(r,u,n),t.isNullOrUndefined(s)||(c&&(a=+a,s=+s),o(a,s)>0&&(a=s,i=r[u]));return i},e.distinct=function(r,n,o){o=!t.isNullOrUndefined(o)&&o;var a,s=[],i={};return r.forEach(function(t,u){(a="object"==typeof r[u]?e.getVal(r,u,n):r[u])in i||(s.push(o?r[u]:a),i[a]=1)}),s},e.serverTimezoneOffset=null,e.timeZoneHandling=!0,e.throwError=function(e){try{throw new Error(e)}catch(e){throw e.message+"\n"+e.stack}},e.aggregates={sum:function(t,r){for(var n,o=0,a="number"!=typeof e.getVal(t,0,r),s=0;s<t.length;s++)n=e.getVal(t,s,r),isNaN(n)||null===n||(a&&(n=+n),o+=n);return o},average:function(t,r){return e.aggregates.sum(t,r)/t.length},min:function(t,r){var n;return"function"==typeof r&&(n=r,r=null),e.getObject(r,e.getItemFromComparer(t,r,n||e.fnAscending))},max:function(t,r){var n;return"function"==typeof r&&(n=r,r=null),e.getObject(r,e.getItemFromComparer(t,r,n||e.fnDescending))},truecount:function(e,t){return new y(e).executeLocal((new r).where(t,"equal",!0,!0)).length},falsecount:function(e,t){return new y(e).executeLocal((new r).where(t,"equal",!1,!0)).length},count:function(e,t){return e.length}},e.operatorSymbols={"<":"lessthan",">":"greaterthan","<=":"lessthanorequal",">=":"greaterthanorequal","==":"equal","!=":"notequal","*=":"contains","$=":"endswith","^=":"startswith"},e.odBiOperator={"<":" lt ",">":" gt ","<=":" le ",">=":" ge ","==":" eq ","!=":" ne ",lessthan:" lt ",lessthanorequal:" le ",greaterthan:" gt ",greaterthanorequal:" ge ",equal:" eq ",notequal:" ne "},e.odUniOperator={"$=":"endswith","^=":"startswith","*=":"substringof",endswith:"endswith",startswith:"startswith",contains:"substringof"},e.odv4UniOperator={"$=":"endswith","^=":"startswith","*=":"contains",endswith:"endswith",startswith:"startswith",contains:"contains"},e.diacritics={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"},e.fnOperators={equal:function(t,r,n,o){return o&&(t=e.ignoreDiacritics(t),r=e.ignoreDiacritics(r)),n?e.toLowerCase(t)===e.toLowerCase(r):t===r},notequal:function(t,r,n,o){return o&&(t=e.ignoreDiacritics(t),r=e.ignoreDiacritics(r)),!e.fnOperators.equal(t,r,n)},lessthan:function(t,r,n){return n?e.toLowerCase(t)<e.toLowerCase(r):t<r},greaterthan:function(t,r,n){return n?e.toLowerCase(t)>e.toLowerCase(r):t>r},lessthanorequal:function(t,r,n){return n?e.toLowerCase(t)<=e.toLowerCase(r):t<=r},greaterthanorequal:function(t,r,n){return n?e.toLowerCase(t)>=e.toLowerCase(r):t>=r},contains:function(r,n,o,a){return a&&(r=e.ignoreDiacritics(r),n=e.ignoreDiacritics(n)),o?!t.isNullOrUndefined(r)&&!t.isNullOrUndefined(n)&&-1!==e.toLowerCase(r).indexOf(e.toLowerCase(n)):!t.isNullOrUndefined(r)&&!t.isNullOrUndefined(n)&&-1!==r.toString().indexOf(n)},notnull:function(e){return null!==e},isnull:function(e){return null===e},startswith:function(t,r,n,o){return o&&(t=e.ignoreDiacritics(t),r=e.ignoreDiacritics(r)),n?t&&r&&e.startsWith(e.toLowerCase(t),e.toLowerCase(r)):t&&r&&e.startsWith(t,r)},endswith:function(t,r,n,o){return o&&(t=e.ignoreDiacritics(t),r=e.ignoreDiacritics(r)),n?t&&r&&e.endsWith(e.toLowerCase(t),e.toLowerCase(r)):t&&r&&e.endsWith(t,r)},processSymbols:function(t){var r=e.operatorSymbols[t];return r?e.fnOperators[r]:e.throwError("Query - Process Operator : Invalid operator")},processOperator:function(t){var r=e.fnOperators[t];return r||e.fnOperators.processSymbols(t)}},e.parse={parseJson:function(t){return"string"==typeof t?t=JSON.parse(t,e.parse.jsonReviver):t instanceof Array?e.parse.iterateAndReviveArray(t):"object"==typeof t&&null!==t&&e.parse.iterateAndReviveJson(t),t},iterateAndReviveArray:function(t){for(var r=0;r<t.length;r++)"object"==typeof t[r]&&null!==t[r]?e.parse.iterateAndReviveJson(t[r]):"string"!=typeof t[r]||/^[\s]*\[|^[\s]*\{(.)+:|\"/g.test(t[r])?t[r]=e.parse.parseJson(t[r]):t[r]=e.parse.jsonReviver("",t[r])},iterateAndReviveJson:function(t){for(var r,n=0,o=Object.keys(t);n<o.length;n++){var a=o[n];e.startsWith(a,"__")||("object"==typeof(r=t[a])?r instanceof Array?e.parse.iterateAndReviveArray(r):r&&e.parse.iterateAndReviveJson(r):t[a]=e.parse.jsonReviver(t[a],r))}},jsonReviver:function(t,r){if("string"==typeof r){var n=/^\/Date\(([+-]?[0-9]+)([+-][0-9]{4})?\)\/$/.exec(r),o=e.timeZoneHandling?e.serverTimezoneOffset:null;if(n)return e.dateParse.toTimeZone(new Date(parseInt(n[1],10)),o,!0);if(/^(\d{4}\-\d\d\-\d\d([tT][\d:\.]*){1})([zZ]|([+\-])(\d\d):?(\d\d))?$/.test(r)){var a=r.indexOf("Z")>-1||r.indexOf("z")>-1,s=r.split(/[^0-9.]/);if(a)r=e.dateParse.toTimeZone(new Date(parseInt(s[0],10),parseInt(s[1],10)-1,parseInt(s[2],10),parseInt(s[3],10),parseInt(s[4],10),parseInt(s[5],10)),e.serverTimezoneOffset,!1);else{var i=new Date(parseInt(s[0],10),parseInt(s[1],10)-1,parseInt(s[2],10),parseInt(s[3],10),parseInt(s[4],10),parseInt(s[5],10)),u=parseInt(s[6],10),c=parseInt(s[7],10);if(isNaN(u)&&isNaN(c))return i;r.indexOf("+")>-1?i.setHours(i.getHours()-u,i.getMinutes()-c):i.setHours(i.getHours()+u,i.getMinutes()+c),r=e.dateParse.toTimeZone(i,e.serverTimezoneOffset,!1)}null==e.serverTimezoneOffset&&(r=e.dateParse.addSelfOffset(r))}}return r},isJson:function(t){return"string"==typeof t[0]?t:e.parse.parseJson(t)},isGuid:function(e){return null!=/[A-Fa-f0-9]{8}(?:-[A-Fa-f0-9]{4}){3}-[A-Fa-f0-9]{12}/i.exec(e)},replacer:function(t,r){return e.isPlainObject(t)?e.parse.jsonReplacer(t,r):t instanceof Array?e.parse.arrayReplacer(t):t instanceof Date?e.parse.jsonReplacer({val:t},r).val:t},jsonReplacer:function(t,r){for(var n,o=0,a=Object.keys(t);o<a.length;o++){var s=a[o];if((n=t[s])instanceof Date){var i=n;null==e.serverTimezoneOffset?t[s]=e.dateParse.toTimeZone(i,null).toJSON():(i=new Date(+i+36e5*e.serverTimezoneOffset),t[s]=e.dateParse.toTimeZone(e.dateParse.addSelfOffset(i),null).toJSON())}}return t},arrayReplacer:function(t){for(var r=0;r<t.length;r++)e.isPlainObject(t[r])?t[r]=e.parse.jsonReplacer(t[r]):t[r]instanceof Date&&(t[r]=e.parse.jsonReplacer({date:t[r]}).date);return t},jsonDateReplacer:function(t,r){if("value"===t&&r){if("string"==typeof r){var n=/^\/Date\(([+-]?[0-9]+)([+-][0-9]{4})?\)\/$/.exec(r);if(n)r=e.dateParse.toTimeZone(new Date(parseInt(n[1],10)),null,!0);else if(/^(\d{4}\-\d\d\-\d\d([tT][\d:\.]*){1})([zZ]|([+\-])(\d\d):?(\d\d))?$/.test(r)){var o=r.split(/[^0-9]/);r=e.dateParse.toTimeZone(new Date(parseInt(o[0],10),parseInt(o[1],10)-1,parseInt(o[2],10),parseInt(o[3],10),parseInt(o[4],10),parseInt(o[5],10)),null,!0)}}if(r instanceof Date)return r=e.dateParse.addSelfOffset(r),null===e.serverTimezoneOffset?e.dateParse.toTimeZone(e.dateParse.addSelfOffset(r),null).toJSON():(r=e.dateParse.toTimeZone(r,r.getTimezoneOffset()/60*2-e.serverTimezoneOffset,!1)).toJSON()}return r}},e.dateParse={addSelfOffset:function(e){return new Date(+e-6e4*e.getTimezoneOffset())},toUTC:function(e){return new Date(+e+6e4*e.getTimezoneOffset())},toTimeZone:function(t,r,n){if(null===r)return t;var o=n?e.dateParse.toUTC(t):t;return new Date(+o-36e5*r)},toLocalTime:function(e){var t=e,r=-t.getTimezoneOffset(),n=r>=0?"+":"-",o=function(e){var t=Math.floor(Math.abs(e));return(t<10?"0":"")+t};return t.getFullYear()+"-"+o(t.getMonth()+1)+"-"+o(t.getDate())+"T"+o(t.getHours())+":"+o(t.getMinutes())+":"+o(t.getSeconds())+n+o(r/60)+":"+o(r%60)}},e}(),s=function(){var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),i=function(){function e(t){this.options={from:"table",requestType:"json",sortBy:"sorted",select:"select",skip:"skip",group:"group",take:"take",search:"search",count:"requiresCounts",where:"where",aggregates:"aggregates",expand:"expand"},this.type=e,this.dataSource=t,this.pvt={}}return e.prototype.processResponse=function(e,t,r,n){return e},e}(),u=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return s(n,e),n.prototype.processQuery=function(e,t){for(var r,n,o=e.dataSource.json.slice(0),a=o.length,s=!0,i={},u=0;u<t.queries.length;u++)r=this[(n=t.queries[u]).fn].call(this,o,n.e,t),"onAggregates"===n.fn?i[n.e.field+" - "+n.e.type]=r:o=void 0!==r?r:o,"onPage"!==n.fn&&"onSkip"!==n.fn&&"onTake"!==n.fn&&"onRange"!==n.fn||(s=!1),s&&(a=o.length);return t.isCountRequired&&(o={result:o,count:a,aggregates:i}),o},n.prototype.batchRequest=function(e,t,r){var n,o=t.deletedRecords.length;for(n=0;n<t.addedRecords.length;n++)this.insert(e,t.addedRecords[n]);for(n=0;n<t.changedRecords.length;n++)this.update(e,r.key,t.changedRecords[n]);for(n=0;n<o;n++)this.remove(e,r.key,t.deletedRecords[n]);return t},n.prototype.onWhere=function(e,t){return e&&e.length?e.filter(function(e){if(t)return t.validate(e)}):e},n.prototype.onAggregates=function(e,t){var r=a.aggregates[t.type];return e&&r&&0!==e.length?r(e,t.field):null},n.prototype.onSearch=function(e,t){return e&&e.length?(0===t.fieldNames.length&&a.getFieldList(e[0],t.fieldNames),e.filter(function(e){for(var r=0;r<t.fieldNames.length;r++)if(t.comparer.call(e,a.getObject(t.fieldNames[r],e),t.searchKey,t.ignoreCase,t.ignoreAccent))return!0;return!1})):e},n.prototype.onSortBy=function(e,t,r){if(!e||!e.length)return e;var n,o=a.getValue(t.fieldName,r);if(!o)return e.sort(t.comparer);if(o instanceof Array){for(var s=(o=o.slice(0)).length-1;s>=0;s--)o[s]&&(n=t.comparer,a.endsWith(o[s]," desc")&&(n=a.fnSort("descending"),o[s]=o[s].replace(" desc","")),e=a.sort(e,o[s],n));return e}return a.sort(e,o,t.comparer)},n.prototype.onGroup=function(e,t,n){if(!e||!e.length)return e;var o=r.filterQueries(n.queries,"onAggregates"),s=[];if(o.length)for(var i=void 0,u=0;u<o.length;u++)i=o[u].e,s.push({type:i.type,field:a.getValue(i.field,n)});return a.group(e,a.getValue(t.fieldName,n),s,null,null,t.comparer)},n.prototype.onPage=function(e,t,r){var n=a.getValue(t.pageSize,r),o=(a.getValue(t.pageIndex,r)-1)*n,s=o+n;return e&&e.length?e.slice(o,s):e},n.prototype.onRange=function(e,t){return e&&e.length?e.slice(a.getValue(t.start),a.getValue(t.end)):e},n.prototype.onTake=function(e,t){return e&&e.length?e.slice(0,a.getValue(t.nos)):e},n.prototype.onSkip=function(e,t){return e&&e.length?e.slice(a.getValue(t.nos)):e},n.prototype.onSelect=function(e,t){return e&&e.length?a.select(e,a.getValue(t.fieldNames)):e},n.prototype.insert=function(e,r,n,o,a){return t.isNullOrUndefined(a)?e.dataSource.json.push(r):e.dataSource.json.splice(a,0,r)},n.prototype.remove=function(e,t,r,n){var o,a=e.dataSource.json;for("object"!=typeof r||r instanceof Date||(r=r[t]),o=0;o<a.length&&a[o][t]!==r;o++);return o!==a.length?a.splice(o,1):null},n.prototype.update=function(e,r,n,o){var a,s,i=e.dataSource.json;for(t.isNullOrUndefined(r)||(s=t.getValue(r,n)),a=0;a<i.length&&(t.isNullOrUndefined(r)||t.getValue(r,i[a])!==s);a++);return a<i.length?t.merge(i[a],n):null},n}(i),c=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return s(o,e),o.prototype.processQuery=function(e,t,n){var o,s,i=this.getQueryRequest(t),u=r.filterQueryLists(t.queries,["onSelect","onPage","onSkip","onTake","onRange"]),c=t.params,l=e.dataSource.url,p=null,d=this.options,h={sorts:[],groups:[],filters:[],searches:[],aggregates:[]};"onPage"in u?(o=u.onPage,s=((s=a.getValue(o.pageIndex,t))-1)*(p=a.getValue(o.pageSize,t))):"onRange"in u&&(s=(o=u.onRange).start,p=o.end-o.start);for(y=0;y<i.sorts.length;y++)o=a.getValue(i.sorts[y].e.fieldName,t),h.sorts.push(a.callAdaptorFunction(this,"onEachSort",{name:o,direction:i.sorts[y].e.direction},t));n&&(o=this.getFiltersFrom(n,t))&&h.filters.push(a.callAdaptorFunction(this,"onEachWhere",o.toJson(),t));for(y=0;y<i.filters.length;y++){h.filters.push(a.callAdaptorFunction(this,"onEachWhere",i.filters[y].e.toJson(),t));for(var f=0,g="object"==typeof h.filters[y]?Object.keys(h.filters[y]):[];f<g.length;f++){O=g[f];a.isNull(h[O])&&delete h[O]}}for(y=0;y<i.searches.length;y++)o=i.searches[y].e,h.searches.push(a.callAdaptorFunction(this,"onEachSearch",{fields:o.fieldNames,operator:o.operator,key:o.searchKey,ignoreCase:o.ignoreCase},t));for(y=0;y<i.groups.length;y++)h.groups.push(a.getValue(i.groups[y].e.fieldName,t));for(var y=0;y<i.aggregates.length;y++)o=i.aggregates[y].e,h.aggregates.push({type:o.type,field:a.getValue(o.field,t)});var v={};this.getRequestQuery(d,t,u,h,v),a.callAdaptorFunction(this,"addParams",{dm:e,query:t,params:c,reqParams:v});for(var m=0,S=Object.keys(v);m<S.length;m++){var O=S[m];(a.isNull(v[O])||""===v[O]||0===v[O].length)&&delete v[O]}d.skip in v&&d.take in v||null===p||(v[d.skip]=a.callAdaptorFunction(this,"onSkip",s,t),v[d.take]=a.callAdaptorFunction(this,"onTake",p,t));var b=this.pvt;return this.pvt={},"json"===this.options.requestType?{data:JSON.stringify(v,a.parse.jsonDateReplacer),url:l,pvtData:b,type:"POST",contentType:"application/json; charset=utf-8"}:(o=this.convertToQueryString(v,t,e),o=(-1!==e.dataSource.url.indexOf("?")?"&":"/")+o,{type:"GET",url:o.length?l.replace(/\/*$/,o):l,pvtData:b})},o.prototype.getRequestQuery=function(e,t,r,n,o){var s=o;s[e.from]=t.fromTable,e.apply&&t.distincts.length&&(s[e.apply]="onDistinct"in this?a.callAdaptorFunction(this,"onDistinct",t.distincts):""),!t.distincts.length&&e.expand&&(s[e.expand]="onExpand"in this&&"onSelect"in r?a.callAdaptorFunction(this,"onExpand",{selects:a.getValue(r.onSelect.fieldNames,t),expands:t.expands},t):t.expands),s[e.select]="onSelect"in r&&!t.distincts.length?a.callAdaptorFunction(this,"onSelect",a.getValue(r.onSelect.fieldNames,t),t):"",s[e.count]=t.isCountRequired?a.callAdaptorFunction(this,"onCount",t.isCountRequired,t):"",s[e.search]=n.searches.length?a.callAdaptorFunction(this,"onSearch",n.searches,t):"",s[e.skip]="onSkip"in r?a.callAdaptorFunction(this,"onSkip",a.getValue(r.onSkip.nos,t),t):"",s[e.take]="onTake"in r?a.callAdaptorFunction(this,"onTake",a.getValue(r.onTake.nos,t),t):"",s[e.where]=n.filters.length||n.searches.length?a.callAdaptorFunction(this,"onWhere",n.filters,t):"",s[e.sortBy]=n.sorts.length?a.callAdaptorFunction(this,"onSortBy",n.sorts,t):"",s[e.group]=n.groups.length?a.callAdaptorFunction(this,"onGroup",n.groups,t):"",s[e.aggregates]=n.aggregates.length?a.callAdaptorFunction(this,"onAggregates",n.aggregates,t):"",s.param=[]},o.prototype.convertToQueryString=function(e,t,r){return""},o.prototype.processResponse=function(e,t,r,n,o,s){if(n&&n.getResponseHeader("Content-Type")&&-1!==n.getResponseHeader("Content-Type").indexOf("application/json")){var i=a.timeZoneHandling;t&&!t.timeZoneHandling&&(a.timeZoneHandling=!1),e=a.parse.parseJson(e),a.timeZoneHandling=i}var u=o,c=u.pvtData||{},l=e?e.groupDs:[];if(n&&n.getResponseHeader("Content-Type")&&-1!==n.getResponseHeader("Content-Type").indexOf("xml"))return r.isCountRequired?{result:[],count:0}:[];var p=JSON.parse(u.data);if(p&&"batch"===p.action&&e&&e.addedRecords)return s.addedRecords=e.addedRecords,s;e&&e.d&&(e=e.d);var d={};return e&&"count"in e&&(d.count=e.count),d.result=e&&e.result?e.result:e,this.getAggregateResult(c,e,d,l,r),a.isNull(d.count)?d.result:{result:d.result,count:d.count,aggregates:d.aggregates}},o.prototype.onGroup=function(e){return this.pvt.groups=e,e},o.prototype.onAggregates=function(e){this.pvt.aggregates=e},o.prototype.batchRequest=function(e,r,n,o,s){return{type:"POST",url:e.dataSource.batchUrl||e.dataSource.crudUrl||e.dataSource.removeUrl||e.dataSource.url,contentType:"application/json; charset=utf-8",dataType:"json",data:JSON.stringify(t.extend({},{changed:r.changedRecords,added:r.addedRecords,deleted:r.deletedRecords,action:"batch",table:n[void 0],key:n[void 0]},a.getAddParams(this,e,o)))}},o.prototype.beforeSend=function(e,t){},o.prototype.insert=function(e,r,n,o){return{url:e.dataSource.insertUrl||e.dataSource.crudUrl||e.dataSource.url,data:JSON.stringify(t.extend({},{value:r,table:n,action:"insert"},a.getAddParams(this,e,o)))}},o.prototype.remove=function(e,r,n,o,s){return{type:"POST",url:e.dataSource.removeUrl||e.dataSource.crudUrl||e.dataSource.url,data:JSON.stringify(t.extend({},{key:n,keyColumn:r,table:o,action:"remove"},a.getAddParams(this,e,s)))}},o.prototype.update=function(e,r,n,o,s){return{type:"POST",url:e.dataSource.updateUrl||e.dataSource.crudUrl||e.dataSource.url,data:JSON.stringify(t.extend({},{value:n,action:"update",keyColumn:r,key:n[r],table:o},a.getAddParams(this,e,s)))}},o.prototype.getFiltersFrom=function(e,t){var r,o=t.fKey,s=o,i=t.key,u=[];"object"!=typeof e[0]&&(s=null);for(var c=0;c<e.length;c++)r="object"==typeof e[0]?a.getObject(i||s,e[c]):e[c],u.push(new n(o,"equal",r));return n.or(u)},o.prototype.getAggregateResult=function(e,n,o,s,i){var u=n;if(n&&n.result&&(u=n.result),e&&e.aggregates&&e.aggregates.length){var c=e.aggregates,l=void 0,p=u,d={};n.aggregate&&(p=n.aggregate);for(f=0;f<c.length;f++)(l=a.aggregates[c[f].type])&&(d[c[f].field+" - "+c[f].type]=l(p,c[f].field));o.aggregates=d}if(e&&e.groups&&e.groups.length){for(var h=e.groups,f=0;f<h.length;f++){t.isNullOrUndefined(s)||(s=a.group(s,h[f]));var g=r.filterQueries(i.queries,"onGroup")[f].e;u=a.group(u,h[f],e.aggregates,null,s,g.comparer)}o.result=u}return o},o.prototype.getQueryRequest=function(e){var t={sorts:[],groups:[],filters:[],searches:[],aggregates:[]};return t.sorts=r.filterQueries(e.queries,"onSortBy"),t.groups=r.filterQueries(e.queries,"onGroup"),t.filters=r.filterQueries(e.queries,"onWhere"),t.searches=r.filterQueries(e.queries,"onSearch"),t.aggregates=r.filterQueries(e.queries,"onAggregates"),t},o.prototype.addParams=function(e){var t=e.reqParams;e.params.length&&(t.params={});for(var r=0,n=e.params;r<n.length;r++){var o=n[r];if(t[o.key])throw new Error("Query() - addParams: Custom Param is conflicting other request arguments");t[o.key]=o.value,o.fn&&(t[o.key]=o.fn.call(e.query,o.key,e.query,e.dm)),t.params[o.key]=t[o.key]}},o}(i),l=function(e){function r(r){var n=e.call(this)||this;return n.options=t.extend({},n.options,{requestType:"get",accept:"application/json;odata=light;q=1,application/json;odata=verbose;q=0.5",multipartAccept:"multipart/mixed",sortBy:"$orderby",select:"$select",skip:"$skip",take:"$top",count:"$inlinecount",where:"$filter",expand:"$expand",batch:"$batch",changeSet:"--changeset_",batchPre:"batch_",contentId:"Content-Id: ",batchContent:"Content-Type: multipart/mixed; boundary=",changeSetContent:"Content-Type: application/http\nContent-Transfer-Encoding: binary ",batchChangeSetContentType:"Content-Type: application/json; charset=utf-8 ",updateType:"PUT"}),t.extend(n.options,r||{}),n}return s(r,e),r.prototype.getModuleName=function(){return"ODataAdaptor"},r.prototype.onPredicate=function(e,n,o){var s,i,u="",c=e.value,l=typeof c,p=e.field?r.getField(e.field):null;if(c instanceof Date&&(c="datetime'"+a.parse.replacer(c)+"'"),"string"===l&&(c="'"+(c=encodeURIComponent(c))+"'",o&&(p="cast("+p+", 'Edm.String')"),a.parse.isGuid(c)&&(i="guid"),e.ignoreCase&&(i||(p="tolower("+p+")"),c=c.toLowerCase())),s=a.odBiOperator[e.operator])return u+=p,u+=s,i&&(u+=i),u+c;if("substringof"===(s=t.isNullOrUndefined(this.getModuleName)||"ODataV4Adaptor"!==this.getModuleName()?a.odUniOperator[e.operator]:a.odv4UniOperator[e.operator])){var d=c;c=p,p=d}return u+=s+"(",u+=p+",",i&&(u+=i),u+=c+")"},r.prototype.addParams=function(t){e.prototype.addParams.call(this,t),delete t.reqParams.params},r.prototype.onComplexPredicate=function(e,t,r){for(var n=[],o=0;o<e.predicates.length;o++)n.push("("+this.onEachWhere(e.predicates[o],t,r)+")");return n.join(" "+e.condition+" ")},r.prototype.onEachWhere=function(e,t,r){return e.isComplex?this.onComplexPredicate(e,t,r):this.onPredicate(e,t,r)},r.prototype.onWhere=function(e){return this.pvt.search&&e.push(this.onEachWhere(this.pvt.search,null,!0)),e.join(" and ")},r.prototype.onEachSearch=function(e){e.fields&&0===e.fields.length&&a.throwError("Query() - Search : oData search requires list of field names to search");for(var t=this.pvt.search||[],r=0;r<e.fields.length;r++)t.push(new n(e.fields[r],e.operator,e.key,e.ignoreCase));this.pvt.search=t},r.prototype.onSearch=function(e){return this.pvt.search=n.or(this.pvt.search),""},r.prototype.onEachSort=function(e){var t=[];if(e.name instanceof Array)for(var n=0;n<e.name.length;n++)t.push(r.getField(e.name[n])+("descending"===e.direction?" desc":""));else t.push(r.getField(e.name)+("descending"===e.direction?" desc":""));return t.join(",")},r.prototype.onSortBy=function(e){return e.reverse().join(",")},r.prototype.onGroup=function(e){return this.pvt.groups=e,[]},r.prototype.onSelect=function(e){for(var t=0;t<e.length;t++)e[t]=r.getField(e[t]);return e.join(",")},r.prototype.onAggregates=function(e){return this.pvt.aggregates=e,""},r.prototype.onCount=function(e){return!0===e?"allpages":""},r.prototype.beforeSend=function(e,t,r){a.endsWith(r.url,this.options.batch)&&"post"===r.type.toLowerCase()?(t.setRequestHeader("Accept",this.options.multipartAccept),t.setRequestHeader("DataServiceVersion","2.0"),t.overrideMimeType("text/plain; charset=x-user-defined")):t.setRequestHeader("Accept",this.options.accept),t.setRequestHeader("DataServiceVersion","2.0"),t.setRequestHeader("MaxDataServiceVersion","2.0")},r.prototype.processResponse=function(e,r,n,o,s,i){if(s&&"GET"===s.type&&!this.rootUrl&&e["odata.metadata"]){var u=e["odata.metadata"].split("/$metadata#");this.rootUrl=u[0],this.resourceTableName=u[1]}if(!t.isNullOrUndefined(e.d)){var c=n&&n.isCountRequired?e.d.results:e.d;if(!t.isNullOrUndefined(c))for(var l=0;l<c.length;l++)t.isNullOrUndefined(c[l].__metadata)||delete c[l].__metadata}var p=s&&s.pvtData,d=this.processBatchResponse(e,n,o,s,i);if(d)return d;var h=o&&s.getResponseHeader("DataServiceVersion"),f=null,g=h&&parseInt(h,10)||2;if(n&&n.isCountRequired){(e.__count||e["odata.count"])&&(f=e.__count||e["odata.count"]),e.d&&(e=e.d),(e.__count||e["odata.count"])&&(f=e.__count||e["odata.count"])}3===g&&e.value&&(e=e.value),e.d&&(e=e.d),g<3&&e.results&&(e=e.results);var y={};return y.count=f,y.result=e,this.getAggregateResult(p,e,y,null,n),a.isNull(f)?y.result:{result:y.result,count:y.count,aggregates:y.aggregates}},r.prototype.convertToQueryString=function(e,t,r){var n=[],o=e.table||"";delete e.table,r.dataSource.requiresFormat&&(e.$format="json");for(var a=0,s=Object.keys(e);a<s.length;a++){var i=s[a];n.push(i+"="+e[i])}return n=n.join("&"),r.dataSource.url&&-1!==r.dataSource.url.indexOf("?")&&!o?n:n.length?o+"?"+n:o||""},r.prototype.localTimeReplacer=function(e,r){for(var n=0,o=t.isNullOrUndefined(r)?[]:Object.keys(r);n<o.length;n++){var s=o[n];r[s]instanceof Date&&(r[s]=a.dateParse.toLocalTime(r[s]))}return r},r.prototype.insert=function(e,t,r){return{url:(e.dataSource.insertUrl||e.dataSource.url).replace(/\/*$/,r?"/"+r:""),data:JSON.stringify(t,this.options.localTime?this.localTimeReplacer:null)}},r.prototype.remove=function(e,t,r,n){var o;return o="string"!=typeof r||a.parse.isGuid(r)?"("+r+")":"('"+r+"')",{type:"DELETE",url:(e.dataSource.removeUrl||e.dataSource.url).replace(/\/*$/,n?"/"+n:"")+o}},r.prototype.update=function(e,r,n,o,s,i){"PATCH"!==this.options.updateType||t.isNullOrUndefined(i)||(n=this.compareAndRemove(n,i,r));var u;return u="string"!=typeof n[r]||a.parse.isGuid(n[r])?"("+n[r]+")":"('"+n[r]+"')",{type:this.options.updateType,url:(e.dataSource.updateUrl||e.dataSource.url).replace(/\/*$/,o?"/"+o:"")+u,data:JSON.stringify(n,this.options.localTime?this.localTimeReplacer:null),accept:this.options.accept}},r.prototype.batchRequest=function(e,t,r,n,o){var s=r.guid=a.getGuid(this.options.batchPre),i=this.rootUrl?this.rootUrl+"/"+this.options.batch:e.dataSource.url.replace(/\/*$/,"/"+this.options.batch);r.url=this.resourceTableName?this.resourceTableName:r.url;var u={url:r.url,key:r.key,cid:1,cSet:a.getGuid(this.options.changeSet)},c="--"+s+"\n";return c+="Content-Type: multipart/mixed; boundary="+u.cSet.replace("--","")+"\n",this.pvt.changeSet=0,c+=this.generateInsertRequest(t.addedRecords,u,e),c+=this.generateUpdateRequest(t.changedRecords,u,e,o?o.changedRecords:[]),c+=this.generateDeleteRequest(t.deletedRecords,u,e),c+=u.cSet+"--\n",c+="--"+s+"--",{type:"POST",url:i,dataType:"json",contentType:"multipart/mixed; charset=UTF-8;boundary="+s,data:c}},r.prototype.generateDeleteRequest=function(e,t,r){if(!e)return"";var n={method:"DELETE ",url:function(e,t,r){var n=a.getObject(r,e[t]);return"number"==typeof n||a.parse.isGuid(n)?"("+n+")":n instanceof Date?"("+e[t][r].toJSON()+")":"('"+n+"')"},data:function(e,t){return""}};return this.generateBodyContent(e,t,n,r)+"\n"},r.prototype.generateInsertRequest=function(e,t,r){if(!e)return"";var n={method:"POST ",url:function(e,t,r){return""},data:function(e,t){return JSON.stringify(e[t])+"\n\n"}};return this.generateBodyContent(e,t,n,r)},r.prototype.generateUpdateRequest=function(e,t,r,n){var o=this;if(!e)return"";e.forEach(function(e){return e=o.compareAndRemove(e,n.filter(function(r){return a.getObject(t.key,r)===a.getObject(t.key,e)})[0],t.key)});var s={method:this.options.updateType+" ",url:function(e,t,r){return"number"==typeof e[t][r]||a.parse.isGuid(e[t][r])?"("+e[t][r]+")":e[t][r]instanceof Date?"("+e[t][r].toJSON()+")":"('"+e[t][r]+"')"},data:function(e,t){return JSON.stringify(e[t])+"\n\n"}};return this.generateBodyContent(e,t,s,r)},r.getField=function(e){return e.replace(/\./g,"/")},r.prototype.generateBodyContent=function(e,r,n,o){for(var a="",s=0;s<e.length;s++)a+="\n"+r.cSet+"\n",a+=this.options.changeSetContent+"\n\n",a+=n.method,"POST "===n.method?a+=(o.dataSource.insertUrl||o.dataSource.crudUrl||r.url)+n.url(e,s,r.key)+" HTTP/1.1\n":"PUT "===n.method||"PATCH "===n.method?a+=(o.dataSource.updateUrl||o.dataSource.crudUrl||r.url)+n.url(e,s,r.key)+" HTTP/1.1\n":"DELETE "===n.method&&(a+=(o.dataSource.removeUrl||o.dataSource.crudUrl||r.url)+n.url(e,s,r.key)+" HTTP/1.1\n"),a+="Accept: "+this.options.accept+"\n",a+="Content-Id: "+this.pvt.changeSet+++"\n",a+=this.options.batchChangeSetContentType+"\n",t.isNullOrUndefined(e[s]["@odata.etag"])?a+="\n":(a+="If-Match: "+e[s]["@odata.etag"]+"\n\n",delete e[s]["@odata.etag"]),a+=n.data(e,s);return a},r.prototype.processBatchResponse=function(e,r,n,o,s){if(n&&n.getResponseHeader("Content-Type")&&-1!==n.getResponseHeader("Content-Type").indexOf("xml"))return r.isCountRequired?{result:[],count:0}:[];if(o&&this.options.batch&&a.endsWith(o.url,this.options.batch)&&"post"===o.type.toLowerCase()){var i=n.getResponseHeader("Content-Type"),u=void 0,c=void 0,l=e+"";if(i=i.substring(i.indexOf("=batchresponse")+1),(l=l.split(i)).length<2)return{};l=l[1];var p=/(?:\bContent-Type.+boundary=)(changesetresponse.+)/i.exec(l);p&&l.replace(p[0],"");for(var d=p?p[1]:"",h=(l=l.split(d)).length;h>-1;h--)/\bContent-ID:/i.test(l[h])&&/\bHTTP.+201/.test(l[h])&&(u=parseInt(/\bContent-ID: (\d+)/i.exec(l[h])[1],10),s.addedRecords[u]&&(c=a.parse.parseJson(/^\{.+\}/m.exec(l[h])[0]),t.extend({},s.addedRecords[u],this.processResponse(c))));return s}return null},r.prototype.compareAndRemove=function(e,r,n){var o=this;return t.isNullOrUndefined(r)?e:(Object.keys(e).forEach(function(t){t!==n&&"@odata.etag"!==t&&(a.isPlainObject(e[t])?(o.compareAndRemove(e[t],r[t]),0===Object.keys(e[t]).filter(function(e){return"@odata.etag"!==e}).length&&delete e[t]):e[t]===r[t]?delete e[t]:e[t]&&r[t]&&e[t].valueOf()===r[t].valueOf()&&delete e[t])}),e)},r}(c),p=function(e){function r(r){var n=e.call(this,r)||this;return n.options=t.extend({},n.options,{requestType:"get",accept:"application/json, text/javascript, */*; q=0.01",multipartAccept:"multipart/mixed",sortBy:"$orderby",select:"$select",skip:"$skip",take:"$top",count:"$count",search:"$search",where:"$filter",expand:"$expand",batch:"$batch",changeSet:"--changeset_",batchPre:"batch_",contentId:"Content-Id: ",batchContent:"Content-Type: multipart/mixed; boundary=",changeSetContent:"Content-Type: application/http\nContent-Transfer-Encoding: binary ",batchChangeSetContentType:"Content-Type: application/json; charset=utf-8 ",updateType:"PATCH",localTime:!1,apply:"$apply"}),t.extend(n.options,r||{}),n}return s(r,e),r.prototype.getModuleName=function(){return"ODataV4Adaptor"},r.prototype.onCount=function(e){return!0===e?"true":""},r.prototype.onPredicate=function(t,r,n){var o="",s=t.value,i=s instanceof Date;return o=e.prototype.onPredicate.call(this,t,r,n),i&&(o=o.replace(/datetime'(.*)'$/,"$1")),a.parse.isGuid(s)&&(o=o.replace("guid","").replace(/'/g,"")),o},r.prototype.onEachSearch=function(e){var t=this.pvt.searches||[];t.push(e.key),this.pvt.searches=t},r.prototype.onSearch=function(e){return this.pvt.searches.join(" OR ")},r.prototype.onExpand=function(e){var t=this,r={},n={},o=e.expands.slice(),a=[];return e.selects.filter(function(e){return e.indexOf(".")>-1}).forEach(function(e){var t=e.split(".");t[0]in r||(r[t[0]]=[]),r[t[0]].push(t[1])}),Object.keys(r).forEach(function(e){-1===o.indexOf(e)&&o.push(e)}),o.forEach(function(e){n[e]=e in r?e+"("+t.options.select+"="+r[e].join(",")+")":e}),Object.keys(n).forEach(function(e){return a.push(n[e])}),a.join(",")},r.prototype.onDistinct=function(e){return"groupby(("+e.map(function(e){return l.getField(e)}).join(",")+"))"},r.prototype.onSelect=function(t){return e.prototype.onSelect.call(this,t.filter(function(e){return-1===e.indexOf(".")}))},r.prototype.beforeSend=function(e,t,r){"POST"!==r.type&&"PUT"!==r.type&&"PATCH"!==r.type||t.setRequestHeader("Prefer","return=representation"),t.setRequestHeader("Accept",this.options.accept)},r.prototype.processResponse=function(r,n,o,s,i,u){if(i&&"GET"===i.type&&!this.rootUrl&&r["@odata.context"]){var c=r["@odata.context"].split("/$metadata#");this.rootUrl=c[0],this.resourceTableName=c[1]}var l=i&&i.pvtData,p=e.prototype.processBatchResponse.call(this,r,o,s,i,u);if(p)return p;var d=null;o&&o.isCountRequired&&"@odata.count"in r&&(d=r["@odata.count"]),r=t.isNullOrUndefined(r.value)?r:r.value;var h={};return h.count=d,h.result=r,this.getAggregateResult(l,r,h,null,o),a.isNull(d)?h.result:{result:h.result,count:d,aggregates:h.aggregates}},r}(l),d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return s(t,e),t.prototype.getModuleName=function(){return"WebApiAdaptor"},t.prototype.insert=function(e,t,r){return{type:"POST",url:e.dataSource.url,data:JSON.stringify(t)}},t.prototype.remove=function(e,t,r,n){return{type:"DELETE",url:e.dataSource.url+"/"+r,data:JSON.stringify(r)}},t.prototype.update=function(e,t,r,n){return{type:"PUT",url:e.dataSource.url,data:JSON.stringify(r)}},t.prototype.batchRequest=function(e,t,r){var n=this,o=r.guid=a.getGuid(this.options.batchPre),s=e.dataSource.url.replace(/\/*$/,"/"+this.options.batch);r.url=this.resourceTableName?this.resourceTableName:r.url;for(var i=[],u=0,c=t.addedRecords.length;u<c;u++)!function(n,a){t.addedRecords.forEach(function(a,s){var u={method:"POST ",url:function(e,t,r){return""},data:function(e,t){return JSON.stringify(e[t])+"\n\n"}};i.push("--"+o),i.push("Content-Type: application/http; msgtype=request",""),i.push("POST /api/"+(e.dataSource.insertUrl||e.dataSource.crudUrl||r.url)+u.url(t.addedRecords,n,r.key)+" HTTP/1.1"),i.push("Content-Type: application/json; charset=utf-8"),i.push("Host: "+location.host),i.push("",a?JSON.stringify(a):"")})}(u);for(var u=0,c=t.changedRecords.length;u<c;u++)!function(a,s){t.changedRecords.forEach(function(s,u){var c={method:n.options.updateType+" ",url:function(e,t,r){return""},data:function(e,t){return JSON.stringify(e[t])+"\n\n"}};i.push("--"+o),i.push("Content-Type: application/http; msgtype=request",""),i.push("PUT /api/"+(e.dataSource.updateUrl||e.dataSource.crudUrl||r.url)+c.url(t.changedRecords,a,r.key)+" HTTP/1.1"),i.push("Content-Type: application/json; charset=utf-8"),i.push("Host: "+location.host),i.push("",s?JSON.stringify(s):"")})}(u);for(var u=0,c=t.deletedRecords.length;u<c;u++)!function(n,s){t.deletedRecords.forEach(function(s,u){var c={mtd:"DELETE ",url:function(e,t,r){var n=a.getObject(r,e[t]);return"number"==typeof n||a.parse.isGuid