@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
1 lines • 22.4 kB
JavaScript
module.exports=function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}({0:function(t,e,r){r(1530),t.exports=r(1530)},3:function(t,e){t.exports=function(){throw Error("define cannot be used indirect")}},1516:function(t,e){t.exports=require("./references")},1530:function(t,e,r){var n,i,s;!function(o,define){i=[r(1516)],n=o,s="function"==typeof n?n.apply(e,i):n,!(void 0!==s&&(t.exports=s))}(function(){"use strict";function t(e){return e instanceof t?e:void(this.code=e)}function e(t,e,r){for(var n,i=r(t),s=t;++t<e;)n=r(t),n>i&&(i=n,s=t);return s}function r(t,e){if(t.constructor!==e.constructor)return!1;if(t instanceof L)return t.sheet==e.sheet&&t.row==e.row&&t.col==e.col&&t.rel==e.rel;if(t instanceof N)return r(t.topLeft,e.topLeft)&&r(t.bottomRight,e.bottomRight)&&t.endSheet==e.endSheet;if(t instanceof F){var n=t.refs.length;if(n!=e.refs.length)return!1;for(;--n>=0;)if(!r(t.refs[n],e.refs[n]))return!1}return!0}function n(e,r){function n(t){var e,r,i,o,h;return f=t[0],e="{ ",Array.isArray(f)?(l+="while (i < args.length) { ",g+="while (i < args.length) { ",e+="xargs.push(tmp = []); stack.push(xargs); xargs = tmp; ",e+="while (i < args.length) { ",e+=t.map(n).join(""),e+="} ",e+="xargs = stack.pop(); ",g+="} ",l+="} "):"+"==f?(l+="while (i < args.length) { ",g+="while (i < args.length) { ",e+="if (i >= args.length) return new CalcError('N/A'); ",e+="xargs.push(tmp = []); stack.push(xargs); xargs = tmp; ",e+="do { ",e+=t.slice(1).map(n).join(""),e+="} while (i < args.length); ",e+="xargs = stack.pop(); ",g+="} ",l+="} "):"?"==f?e+="if (!("+u(t[1])+")) return new CalcError(err); ":(r=t[1],Array.isArray(r)&&/^#?collect/.test(r[0])?(i=/!$/.test(r[0]),o=r[2],s(),e+="try {var $"+f+" = this.cellValues(args.slice(i",o&&(e+=", i + "+o),e+=")"+(i?",true":"")+").reduce(function(ret, $"+f+"){ ","#"!=r[0].charAt(0)&&(e+="if ($"+f+" instanceof CalcError) throw $"+f+"; "),e+="if ("+u(r[1])+") ret.push($"+f+"); ",e+="return ret; ",e+="}.bind(this), []); ",e+=o?"i += "+o+"; ":"i = args.length; ",e+="xargs.push($"+f+")} catch(ex) { if (ex instanceof CalcError) return ex; throw ex; } ",g+="toResolve.push(args.slice(i)); "):"rest"==r?e+="xargs.push(args.slice(i)); i = args.length; ":((p=/^\*/.test(f))&&(w=!0,f=f.substr(1)),e+="var $"+f+" = args[i++]; ",h=!1,/!$/.test(r)?(r=r.substr(0,r.length-1),h=!0):e+="if ($"+f+" instanceof CalcError) return $"+f+"; ",e+=a(r,h)+"xargs.push($"+f+"); ")),e+="} "}function s(){return h?"$"+f:(y=!0,h=!0,g+="toResolve.push(args[i++]); ","($"+f+" = this.force($"+f+"))")}function o(t){return"("+(t?"(typeof "+s()+" == 'number' ? ($"+f+" = round($"+f+"), true) : false) || ":"(typeof "+s()+" == 'number') || ")+"(typeof $"+f+" == 'boolean' ? ($"+f+" = +$"+f+", true) : false) || (typeof $"+f+" == 'string' && !/^(?:=|true|false)/i.test($"+f+") ? (tmp = kendo.spreadsheet.calc.parse(0, 0, 0, $"+f+"), /^date|number|percent$/.test(tmp.type) ? ($"+f+" = +tmp.value, true) : false) : false))"}function a(t,e){h=!1;var r="if (!("+u(t)+")) { ";return h&&!e&&(r+=" if ($"+f+" instanceof CalcError) return $"+f+"; "),r+="return new CalcError(err); } ",h||(g+="i++; "),l+=p?"var $"+f+" = this._arrayArg(args[i]); if ($"+f+") { xargs.push($"+f+"); width = Math.max(width, $"+f+".width); height = Math.max(height, $"+f+".height); arrays.push(true) } else { xargs.push(args[i]); arrays.push(false); } i++; ":"xargs.push(args[i++]); arrays.push(false); ",r}function u(t){if(Array.isArray(t)){if("or"==t[0])return"("+t.slice(1).map(u).join(") || (")+")";if("and"==t[0])return"("+t.slice(1).map(u).join(") && (")+")";if("values"==t[0])return"("+t.slice(1).map(function(t){return s()+" === "+t}).join(") || (")+")";if("null"==t[0])return"("+u("null")+" ? (($"+f+" = "+t[1]+"), true) : false)";if("between"==t[0]||"[between]"==t[0])return"("+s()+" >= "+t[1]+" && $"+f+" <= "+t[2]+" ? true : ((err = 'NUM'), false))";if("(between)"==t[0])return"("+s()+" > "+t[1]+" && $"+f+" < "+t[2]+" ? true : ((err = 'NUM'), false))";if("(between]"==t[0])return"("+s()+" > "+t[1]+" && $"+f+" <= "+t[2]+" ? true : ((err = 'NUM'), false))";if("[between)"==t[0])return"("+s()+" >= "+t[1]+" && $"+f+" < "+t[2]+" ? true : ((err = 'NUM'), false))";if("assert"==t[0]){var e=t[2]||"N/A";return"(("+t[1]+") ? true : (err = "+JSON.stringify(e)+", false))"}if("not"==t[0])return"!("+u(t[1])+")";throw Error("Unknown array type condition: "+t[0])}if("number"==t||"datetime"==t)return o(!0);if("number!"==t)return"(typeof "+s()+" == 'number' ? ($"+f+" = round($"+f+"), true) : false)";if("integer"==t||"date"==t)return"("+o()+" && (($"+f+" |= 0), true))";if("divisor"==t)return"("+o(!0)+" && ($"+f+" == 0 ? ((err = 'DIV/0'), false) : true))";if("number+"==t)return"("+o(!0)+" && ($"+f+" >= 0 ? true : ((err = 'NUM'), false)))";if("integer+"==t)return"("+o()+" && (($"+f+" |= 0) >= 0 ? true : ((err = 'NUM'), false)))";if("number++"==t)return"("+o(!0)+" && ($"+f+" > 0 ? true : ((err = 'NUM'), false)))";if("integer++"==t)return"("+o()+" && (($"+f+" |= 0) > 0 ? true : ((err = 'NUM'), false)))";if("string"==t)return"((typeof "+s()+" == 'string' || typeof $"+f+" == 'boolean' || typeof $"+f+" == 'number') ? ($"+f+" += '', true) : ($"+f+" === undefined ? (($"+f+" = ''), true) : false))";if("boolean"==t)return"(typeof "+s()+" == 'boolean')";if("logical"==t)return"(typeof "+s()+" == 'boolean' || (typeof $"+f+" == 'number' ? ($"+f+" = !!$"+f+", true) : false))";if("matrix"==t)return s(),"((m = this.asMatrix($"+f+")) ? ($"+f+" = m) : false)";if("#matrix"==t)return"((m = this.asMatrix($"+f+")) ? ($"+f+" = m) : false)";if("ref"==t)return"($"+f+" instanceof kendo.spreadsheet.Ref)";if("area"==t)return"($"+f+" instanceof kendo.spreadsheet.CellRef || $"+f+" instanceof kendo.spreadsheet.RangeRef)";if("cell"==t)return"($"+f+" instanceof kendo.spreadsheet.CellRef)";if("null"==t)return"("+s()+" == null)";if("anyvalue"==t)return"("+s()+" != null && i <= args.length)";if("forced"==t)return"("+s()+", i <= args.length)";if("anything"==t)return"(i <= args.length)";if("blank"==t)return"("+s()+" == null || $"+f+" === '')";throw Error("Can't check for type: "+t)}var f,h,c,l="function arrayArgs(args) { var xargs = [], width = 0, height = 0, arrays = [], i = 0; ",g="function resolve(args, callback) { var toResolve = [], i = 0; ",d="'use strict'; function check(args) { var stack = [], tmp, xargs = [], i = 0, m, err = 'VALUE'; ",y=!1,p=!1,w=!1;return d+=r.map(n).join(""),d+="if (i < args.length) return new CalcError('N/A'); ",d+="return xargs; } ",l+="return { args: xargs, width: width, height: height, arrays: arrays }; } ",y?(g+="this.resolveCells(toResolve, callback); } ",c=Function("CalcError","round",d+g+l+" return { resolve: resolve, check: check, arrayArgs: arrayArgs };")):c=Function("CalcError","round",d+" return { check: check };"),c=c(t,i),w||delete c.arrayArgs,c}function i(t){return t===parseInt(t,10)?t:+t.toPrecision(14)}function s(t){return"number"==typeof t?i(t):t}function o(e,r,n){if(n instanceof t)return n;try{return r.apply(e,n)}catch(i){if(i instanceof t)return i;throw i}}function a(t,e,r,n){return function(i,s){function a(){var e,a,u,f,h,c;if(n&&(e=n.call(this,s),s=e.args,e.width>0&&e.height>0)){for(a=new U(this),u=0;u<e.height;++u)for(f=0;f<e.width;++f){for(h=[],c=0;c<s.length;++c)h[c]=e.arrays[c]?s[c].getNA(u,f):s[c];h=r.call(this,h),a.set(u,f,o(this,t,h))}return i(a)}h=r.call(this,s),i(o(this,t,h))}e?e.call(this,s,a):a.call(this)}}function u(e,r,n,i){return function(s,o){function a(){var r,a,u,f,h,c,l,g;if(i&&(r=i.call(this,o),o=r.args,r.width>0&&r.height>0))for(a=new U(this),u=r.width*r.height,f=function(t,e){return function(r){if(a.set(t,e,r),--u,0===u)return s(a)}},h=0;h<r.height&&u>0;++h)for(c=0;c<r.width&&u>0;++c){for(l=[],g=0;g<o.length;++g)l[g]=r.arrays[g]?o[g].getNA(h,c):o[g];if(l=n.call(this,l),l instanceof t){if(a.set(h,c,l),--u,0===u)return s(a)}else l.unshift(f(h,c)),e.apply(this,l)}else r=n.call(this,o),r instanceof t?s(r):(r.unshift(s),e.apply(this,r))}r?r.call(this,o,a):a.call(this)}}function f(t,e){return t=t.toLowerCase(),j[t]=e,{args:function(r,i){var s,o=n(t,r);return i&&(o.arrayArgs&&console.log(""+o.arrayArgs),o.resolve&&console.log(""+o.resolve),o.check&&console.log(""+o.check)),s=j[t]=a(e,o.resolve,o.check,o.arrayArgs),s.kendoSpreadsheetArgs=r,this},argsAsync:function(r,i){var s,o=n(t,r);return i&&(o.arrayArgs&&console.log(""+o.arrayArgs),o.resolve&&console.log(""+o.resolve),o.check&&console.log(""+o.check)),s=j[t]=u(e,o.resolve,o.check,o.arrayArgs),s.kendoSpreadsheetArgs=r,this}}}function h(t,e,r){return e++,(1461*(t+4800+((e-14)/12|0))/4|0)+(367*(e-2-12*((e-14)/12|0))/12|0)-(3*((t+4900+((e-14)/12|0))/100|0)/4|0)+r-32075}function c(t){var e,r,n,i,s,o,a;return e=t+68569,r=4*e/146097|0,e-=(146097*r+3)/4|0,i=4e3*(e+1)/1461001|0,e=e-(1461*i/4|0)+31,n=80*e/2447|0,o=e-(2447*n/80|0),e=n/11|0,s=n+2-12*e,a=100*(r-49)+i+e,s--,{year:a,month:s,date:o,day:(t+1)%7,ord:I[l(a)][s]+o}}function l(t){return t%4?0:t%100?1:t%400?0:1}function g(t){return l(t)?366:365}function d(t,e){return l(t)&&1==e?29:_[e]}function y(t,e,r){return e>=1&&e<=12&&r>=1&&r<=d(t,e-1)}function p(t){return c((0|t)+T)}function w(t,e,r){return h(t,e,r)-T}function v(t){var e,r,n,i,s=t-(0|t);return s<0&&s++,e=Math.round(q*s),r=Math.floor(e/Y),e-=r*Y,n=Math.floor(e/O),e-=n*O,i=Math.floor(e/1e3),e-=1e3*i,{hours:r,minutes:n,seconds:i,milliseconds:e}}function m(t){var e=p(t),r=v(t);return new Date(e.year,e.month,e.date,r.hours,r.minutes,r.seconds,r.milliseconds)}function M(t,e,r,n){return(t+(e+(r+n/1e3)/60)/60)/24}function b(t){var e=M(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds());return t=w(t.getFullYear(),t.getMonth(),t.getDate()),t<0?t-1+e:t+e}function x(t,e){return e&&(e=kendo.spreadsheet.formatting.makeDateFormat(e)),kendo.parseExactDate(t,e)||kendo.parseExactDate(t)||kendo.parseExactDate(t,["MMMM dd yyyy","MMMM dd yy","MMM dd yyyy","MMM dd yy","dd MMMM yyyy","dd MMMM yy","dd MMM yyyy","dd MMM yy","MMMM dd, yyyy","MMMM dd, yy","MMM dd, yyyy","MMM dd, yy","MMMM dd","MMM dd","MMMM yyyy","MMM yyyy","dd MMMM","dd MMM"])}function $(e){return function(r,n){return"string"==typeof r&&"string"!=typeof n&&(n=null==n?"":n+""),"string"!=typeof r&&"string"==typeof n&&(r=null==r?"":r+""),"number"==typeof r&&null==n&&(n=0),"number"==typeof n&&null==r&&(r=0),"string"==typeof r&&"string"==typeof n&&(r=r.toLowerCase(),n=n.toLowerCase()),typeof n==typeof r?e(r,n):new t("VALUE")}}var A,k,R,C,E,L,N,F,S,D,U,V,j,T,_,I,O,Y,q,J,P,H;kendo.support.browser.msie&&kendo.support.browser.version<9||(A={},k=kendo.spreadsheet,k.calc=A,R=A.runtime={},C=kendo.Class,E=k.Ref,L=k.CellRef,N=k.RangeRef,F=k.UnionRef,S=k.NULLREF,t.prototype.toString=function(){return"#"+this.code+("NAME"==this.code?"?":"!")},D=C.extend({init:function(t,e,r,n){this.callback=t,this.formula=e,this.ss=r,this.parent=n},resolve:function(t){var e=this;t instanceof E?e.resolveCells([t],function(){e._resolve(t)}):e._resolve(t)},error:function(e){return new t(e)},_resolve:function(t){t=void 0===t?null:Array.isArray(t)?this.asMatrix(t):s(t);var e=this.formula;e.arrayFormulaRange?t=this.asMatrix(t)||this.asMatrix([[t]]):t instanceof N&&(t=this._arrayArg(t)),e.value=t,this.ss.onFormula(e)&&this.callback&&this.callback.call(e,t)},resolveCells:function(t,e){function r(t){t.exec(o.ss,function(){--i||e.call(o)},o)}function n(t){var e,r;for(e=0;e<t.length;++e)r=t[e],r.formula&&a.push(r.formula);return!0}var i,s,o=this,a=[];if(function u(t){var e,r;for(e=0;e<t.length;++e)r=t[e],r instanceof E&&n(o.getRefCells(r)),Array.isArray(r)&&u(r)}(t),!a.length)return e.call(o);for(i=a.length,s=0;s<a.length;++s)r(a[s])},cellValues:function(t,e){var r,n,i=[];for(r=0;r<t.length;++r)n=t[r],n instanceof E?(n=this.getRefData(n,e),i=i.concat(n)):Array.isArray(n)?i=i.concat(this.cellValues(n,e)):n instanceof U?i=i.concat(this.cellValues(n.data,e)):i.push(n);return i},fetchName:function(e,r){var n,i=this.formula,s=this.ss.nameValue(e,i.sheet,i.row,i.col);s instanceof V?(s=s.clone(i.sheet,i.row,i.col,!0),n=new k.ValidationFormulaContext(this.ss.workbook),s.exec(n,r,this)):(s instanceof E&&(s=s.absolute(i.row,i.col),s.sheet||(s.sheet=i.sheet)),r(null==s?new t("NAME"):s))},force:function(t){return t instanceof E?this.getRefData(t):t},func:function(e,r,n){e=e.toLowerCase();var i=j[e];return i?i.call(this,r,n):void r(new t("NAME"))},bool:function(t){return t instanceof E&&(t=this.getRefData(t)),"string"==typeof t?"true"==t.toLowerCase():"number"==typeof t?0!==t:"boolean"==typeof t?t:null!=t},_arrayArg:function(e){var r=this.formula;return!r.arrayFormulaRange&&e instanceof N?1==e.height()&&r.col>=e.topLeft.col&&r.col<=e.bottomRight.col?this.getRefData(new L(e.topLeft.row,r.col).setSheet(e.sheet)):1==e.width()&&r.row>=e.topLeft.row&&r.row<=e.bottomRight.row?this.getRefData(new L(r.row,e.topLeft.col).setSheet(e.sheet)):new t("VALUE"):this.asMatrix(e)},asMatrix:function(t){var e,r,n,i,s,o,a;return t instanceof U?t:(e=this,t instanceof N?(r=t.topLeft,n=r.row,i=r.col,s=e.getRefCells(t),o=new U(e),isFinite(t.width())&&(o.width=t.width()),isFinite(t.height())&&(o.height=t.height()),isFinite(n)||(n=0),isFinite(i)||(i=0),s.forEach(function(t){o.set(t.row-n,t.col-i,t.value)}),o):Array.isArray(t)&&t.length>0?(o=new U(e),a=0,t.forEach(function(t){var r=0,n=1;t.forEach(function(t){var i=t instanceof N;t instanceof E&&!i&&(t=e.getRefData(t)),(i||Array.isArray(t))&&(t=e.asMatrix(t)),t instanceof U?(t.each(function(t,e,n){o.set(a+e,r+n,t)}),n=Math.max(n,t.height),r+=t.width):o.set(a,r++,t)}),a+=n}),o):void 0)},getRefCells:function(t,e,r){var n=this.formula;return this.ss.getRefCells(t,e,n.sheet,n.row,n.col,r)},getRefData:function(t,e){var r=this.formula;return this.ss.getData(t,r.sheet,r.row,r.col,e)},workbook:function(){return this.ss.workbook}}),U=C.extend({init:function(t){this.context=t,this.height=0,this.width=0,this.data=[]},clone:function(){var t=new U(this.context);return t.height=this.height,t.width=this.width,t.data=this.data.map(function(t){return t.slice()}),t},get:function(t,e){var r=this.data[t],n=r?r[e]:null;return n instanceof E?this.context.getRefData(n):n},getNA:function(e,r){return e<this.height&&r<this.width?this.get(e,r):new t("N/A")},set:function(t,e,r){var n=this.data[t];null==n&&(n=this.data[t]=[]),n[e]=r,t>=this.height&&(this.height=t+1),e>=this.width&&(this.width=e+1)},each:function(t,e){var r,n,i;for(r=0;r<this.height;++r)for(n=0;n<this.width;++n)if(i=this.get(r,n),(e||null!=i)&&(i=t.call(this.context,i,r,n),void 0!==i))return i},map:function(t,e){var r=new U(this.context);return this.each(function(e,n,i){r.set(n,i,t.call(this,e,n,i))},e),r},eachRow:function(t){var e,r;for(e=0;e<this.height;++e)if(r=t.call(this.context,e),void 0!==r)return r},eachCol:function(t){var e,r;for(e=0;e<this.width;++e)if(r=t.call(this.context,e),void 0!==r)return r},mapRow:function(t){var e=new U(this.context);return this.eachRow(function(r){e.set(r,0,t.call(this.context,r))}),e},mapCol:function(t){var e=new U(this.context);return this.eachCol(function(r){e.set(0,r,t.call(this.context,r))}),e},toString:function(){return JSON.stringify(this.data)},transpose:function(){var t=new U(this.context);return this.each(function(e,r,n){t.set(n,r,e)}),t},unit:function(t){var e,r,n,i;for(this.width=this.height=t,e=this.data=Array(t),r=t;--r>=0;)for(n=e[r]=Array(t),i=t;--i>=0;)n[i]=r==i?1:0;return this},multiply:function(e){var r,n,i,s,o,a,u=this,f=new U(u.context);for(r=0;r<u.height;++r)for(n=0;n<e.width;++n){for(i=0,s=0;s<u.width;++s){if(o=u.get(r,s),a=e.get(s,n),"number"!=typeof o||"number"!=typeof a)throw new t("VALUE");i+=o*a}f.set(r,n,i)}return f},adds:function(t,e){var r,n,i,s,o=this,a=new U(o.context),u=e?-1:1;for(r=0;r<o.height;++r)for(n=0;n<o.width;++n)i=o.get(r,n),s=t.get(r,n),a.set(r,n,i+u*s);return a},determinant:function(){var t,e,r,n,i,s=this.clone().data,o=s.length,a=1;for(t=0;t<o;t++){for(e=t;e<o&&!s[e][t];e++);if(e==o)return 0;if(e!=t)for(a=-a,n=t;n<o;n++)i=s[t][n],s[t][n]=s[e][n],s[e][n]=i;for(r=t+1;r<o;r++)for(n=t+1;n<o;n++)s[r][n]-=s[t][n]*s[r][t]/s[t][t];a*=s[t][t]}return a},inverse:function(){var t,r,n,i,s,o,a=this.width,u=this.augment(new U(this.context).unit(a)),f=u.data;for(r=0;r<a;++r){if(n=e(r,a,function(t){return f[t][r]}),!f[n][r])return null;for(r!=n&&(t=f[r],f[r]=f[n],f[n]=t),i=r+1;i<a;++i){for(s=r+1;s<2*a;++s)f[i][s]-=f[r][s]*f[i][r]/f[r][r];f[i][r]=0}}for(i=0;i<a;++i)for(o=f[i][i],s=0;s<2*a;++s)f[i][s]/=o;for(r=a;--r>=0;)for(i=r;--i>=0;)if(f[i][r])for(s=2*a;--s>=a;)f[i][s]-=f[r][s]*f[i][r];return u.slice(0,a,a,a)},augment:function(t){var e=this.clone(),r=e.width;return t.each(function(t,n,i){e.set(n,i+r,t)}),e},slice:function(t,e,r,n){var i,s,o=new U(this.context);for(i=0;i<r;++i)for(s=0;s<n;++s)o.set(i,s,this.get(t+i,e+s));return o}}),V=C.extend({init:function(t,e,r,n,i,s,o){this.refs=t,this.handler=e,this.print=r,this.absrefs=null,this.sheet=n,this.row=i,this.col=s,this.onReady=[],this.pending=!1,this.arrayFormulaRange=o},setArrayFormulaRange:function(t){this.arrayFormulaRange=t.clone().setSheet(this.sheet)},clone:function(t,e,r,n){var i=t.toLowerCase(),s=this.refs,o=this.arrayFormulaRange;return(n||i!=this.sheet.toLowerCase())&&(s=s.map(function(e){return e.hasSheet()||e.sheet&&e.sheet.toLowerCase()==i||(e=e.clone().setSheet(t)),e}),o&&(o=o.clone().setSheet(t))),new V(s,this.handler,this.print,t,e,r,o)},deepClone:function(){var t=this.refs.map(function(t){return t.clone()});return new V(t,this.handler,this.print,this.sheet,this.row,this.col,this.arrayFormulaRange)},resolve:function(t){this.pending=!1,this.onReady.forEach(function(e){e(t)})},exec:function(e,r,n){var i,s,o;if("value"in this)r&&r(this.value);else{for(r&&this.onReady.push(r),i=new D(this.resolve,this,e,n),s=0;n;){if(n.formula===this)return this.pending=!1,void i.resolve(new t("CIRCULAR"));n=n.parent,++s}if(this.pending)return;this.pending=!0,o=function(){this.absrefs||(this.absrefs=this.refs.map(function(t){return t.absolute(this.row,this.col)},this)),this.handler.call(i)}.bind(this),s<20?o():setTimeout(o,0)}},reset:function(){this.onReady=[],this.pending=!1,delete this.value},renameSheet:function(t,e){t=t.toLowerCase(),this.absrefs=null,this.sheet.toLowerCase()==t&&(this.sheet=e),this.refs.forEach(function(r){r.renameSheet(t,e)})},adjust:function(t,e,n,i){function s(r){return r===S?r:r.sheet.toLowerCase()!=t?(f&&("row"==e&&o>=n&&(r=r.relative(i,0)),"col"==e&&a>=n&&(r=r.relative(0,i))),r):r.adjust(o,a,h,c,"row"==e,n,i)}var o,a,u,f,h,c,l,g,d;if(t=t.toLowerCase(),o=this.row,a=this.col,u=this.sheet.toLowerCase(),f=!1,u==t&&("row"==e&&o>=n&&(this.row+=i,f=!0),"col"==e&&a>=n&&(this.col+=i,f=!0)),h=this.row,c=this.col,this.absrefs=null,l=this.refs,g=f,this.refs=l.map(function(t){var e=s(t);return g||r(e,t)||(g=!0),e}),d=this.arrayFormulaRange,d&&(this.arrayFormulaRange=s(d),g||r(d,this.arrayFormulaRange)||(g=!0)),g)return new V(l,this.handler,this.print,this.sheet,o,a,d)},toString:function(){return this.print(this.row,this.col)}}),j=Object.create(null),j["if"]=function(e,r){var n=this,i=r[0],s=r[1],o=r[2];this.resolveCells([i],function(){var r=n.asMatrix(i);r?s(function(i){o(function(s){var o=n.asMatrix(i),a=n.asMatrix(s);e(r.map(function(e,r,u){return e instanceof t?e:n.bool(e)?o?o.get(r,u):i:a?a.get(r,u):s}))})}):(i=this.force(i),i instanceof t?e(i):n.bool(i)?s(e):o(e))})},j["φ"]=function(t){t((1+Math.sqrt(5))/2)},T=h(1900,0,-1),_=[31,28,31,30,31,30,31,31,30,31,30,31],I=[[0,31,59,90,120,151,181,212,243,273,304,334],[0,31,60,91,121,152,182,213,244,274,305,335]],O=6e4,Y=60*O,q=24*Y,R.CalcError=t,R.Formula=V,R.Matrix=U,R.packDate=w,R.unpackDate=p,R.packTime=M,R.unpackTime=v,R.serialToDate=m,R.dateToSerial=b,R.daysInMonth=d,R.validDate=y,R.isLeapYear=l,R.daysInYear=g,R.parseDate=x,R.limitPrecision=i,k.dateToNumber=b,k.numberToDate=m,k.defineFunction=f,k.CalcError=t,R.defineFunction=f,R.defineAlias=function(t,e){var r=j[e];if(!r)throw Error("Function "+e+" is not yet defined");r.kendoSpreadsheetAliases||(r.kendoSpreadsheetAliases=[e]),r.kendoSpreadsheetAliases.push(t),j[t]=r},R.FUNCS=j,J=["or","number",["null",0]],P=[["*a",J],["*b",J]],H=[["*a",["or","anyvalue",["null",0]]],["*b",["or","anyvalue",["null",0]]]],f("binary+",function(t,e){return t+e}).args(P),f("binary-",function(t,e){return t-e}).args(P),f("binary*",function(t,e){return t*e}).args(P),f("binary/",function(t,e){return t/e}).args([["*a",J],["*b","divisor"]]),f("binary^",function(t,e){return Math.pow(t,e)}).args(P),f("binary&",function(t,e){return null==t&&(t=""),null==e&&(e=""),""+t+e}).args([["*a",["or","number","string","boolean","null"]],["*b",["or","number","string","boolean","null"]]]),f("binary=",function(t,e){return t="string"==typeof t?t.toLowerCase():t,e="string"==typeof e?e.toLowerCase():e,t===e}).args(H),f("binary<>",function(t,e){return t!==e}).args(H),f("binary<",$(function(t,e){return t<e})).args(H),f("binary<=",$(function(t,e){return t<=e})).args(H),f("binary>",$(function(t,e){return t>e})).args(H),f("binary>=",$(function(t,e){return t>=e})).args(H),f("unary+",function(t){return t}).args([["*a",J]]),f("unary-",function(t){return-t}).args([["*a",J]]),f("unary%",function(t){return t/100}).args([["*a",J]]),f("binary:",function(t,e){return new N(t,e).setSheet(t.sheet||this.formula.sheet,t.hasSheet())}).args([["a","cell"],["b","cell"]]),f("binary,",function(t,e){return new F([t,e])}).args([["a","ref"],["b","ref"]]),f("binary ",function(t,e){return t.intersect(e)}).args([["a","ref"],["b","ref"]]),f("not",function(t){return!this.bool(t)}).args([["*a",["or","anyvalue",["null",0]]]]),f("isblank",function(t){return t instanceof L&&(t=this.getRefData(t),null==t)}).args([["*value","anything!"]]),f("iserror",function(e){return e instanceof t}).args([["*value","forced!"]]),f("iserr",function(e){return e instanceof t&&"N/A"!=e.code}).args([["*value","forced!"]]),f("isna",function(e){return e instanceof t&&"N/A"==e.code}).args([["*value","forced!"]]),f("islogical",function(t){return"boolean"==typeof t}).args([["*value","forced!"]]),f("isnontext",function(t){return"string"!=typeof t}).args([["*value","forced!"]]),f("istext",function(t){return"string"==typeof t}).args([["*value","forced!"]]),f("isnumber",function(t){return"number"==typeof t}).args([["*value","forced!"]]),f("isref",function(t){return t instanceof L||t instanceof N}).args([["*value","anything!"]]),j[",getname"]=function(t,e){this.fetchName(e[0],t)})},r(3))}});