/*! For license information please see ss.mobile.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.OF=t():e.OF=t()}("undefined"!=typeof self?self:this,(function(){return(()=>{var e={25548:e=>{var t=function(){var e=function(e,t,r,n){for(r=r||{},n=e.length;n--;r[e[n]]=t);return r},t=[1,3],r=[1,4],n=[1,5],i=[1,7],o=[1,19],a=[1,11],s=[1,12],l=[1,13],u=[1,14],c=[1,15],h=[1,16],d=[1,17],f=[1,18],g=[1,20],p=[1,27],m=[1,26],v=[1,22],y=[1,23],C=[1,24],x=[1,25],w=[1,28],_=[1,29],R=[1,30],S=[1,31],b=[1,32],I=[1,33],A=[1,34],T=[1,35],E=[5,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,38],M=[1,43],k=[1,44],N=[5,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,25,36,38],O=[5,7,8,9,11,12,13,14,15,16,17,18,19,20,21,38],D=[25,36],L=[1,66],P=[25,36,38],F=[7,38],B=[5,7,8,9,12,13,14,15,16,17,18,19,20,38],V=[5,7,8,9,14,15,16,17,18,19,20,38],H=[5,7,15,16,17,18,19,20,38],U={trace:function(){},yy:{},symbols_:{error:2,formula:3,expression:4,EOF:5,"(":6,")":7,"-":8,"+":9,":":10,"^":11,"*":12,"/":13,"&":14,"<>":15,"<=":16,">=":17,"=":18,"<":19,">":20,"%":21,constant:22,"{":23,listrows:24,"}":25,cellref:26,FUNC_NAME:27,arglist:28,name:29,FUNCTION:30,ERROR:31,LOGIC:32,NUMBER:33,STRING:34,listrow:35,SEMICOLON:36,listelem:37,COMMA:38,CELL:39,COLRANGECELL:40,ROWRANGECELL:41,SHEETNAME:42,VARIABLE:43,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",6:"(",7:")",8:"-",9:"+",10:":",11:"^",12:"*",13:"/",14:"&",15:"<>",16:"<=",17:">=",18:"=",19:"<",20:">",21:"%",23:"{",25:"}",30:"FUNCTION",31:"ERROR",32:"LOGIC",33:"NUMBER",34:"STRING",36:"SEMICOLON",38:"COMMA",39:"CELL",40:"COLRANGECELL",41:"ROWRANGECELL",42:"SHEETNAME",43:"VARIABLE"},productions_:[0,[3,2],[4,3],[4,2],[4,2],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,2],[4,1],[4,3],[4,1],[4,4],[4,1],[27,1],[22,1],[22,1],[22,1],[22,1],[24,1],[24,3],[35,1],[35,3],[37,1],[37,2],[37,2],[28,0],[28,1],[28,2],[28,3],[26,1],[26,1],[26,1],[26,2],[26,2],[26,2],[29,1],[29,2]],performAction:function(e,t,r,n,i,o,a){var s=o.length-1;switch(i){case 1:return o[s-1];case 2:this.$=o[s-1];break;case 3:this.$=n.handler.callOperator("invert",[o[s]]);break;case 4:this.$=n.handler.callOperator("plus",[o[s]]);break;case 5:n.handler.addCellRef(o[s-2],o[s]),this.$=o[s-2];break;case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:this.$=n.handler.callOperator(o[s-1],[o[s-2],o[s]]);break;case 18:this.$=n.handler.callOperator(o[s],[o[s-1]]);break;case 19:this.$=n.handler.createExpr(o[s]);break;case 20:this.$=n.handler.createConstantArrayExpr(o[s-1]);break;case 21:case 23:case 33:this.$=o[s];break;case 22:n.handler.leaveFunction(o[s-3]),this.$=n.handler.callFunction(o[s-3],o[s-1],n);break;case 24:this.$=o[s],n.handler.enterFunction(o[s]);break;case 25:this.$=n.handler.getErrorFromText(o[s].toUpperCase());break;case 26:this.$="TRUE"===o[s].toUpperCase();break;case 27:case 35:this.$=n.handler.numberify(o[s]);break;case 28:this.$=n.handler.extractString(o[s]);break;case 29:case 31:this.$=[o[s]];break;case 30:case 32:o[s-2].push(o[s]),this.$=o[s-2];break;case 34:this.$=-n.handler.numberify(o[s]);break;case 36:this.$=n.handler.createArgs();break;case 37:this.$=n.handler.createArgs(o[s]);break;case 38:0===o[s-1].length&&n.handler.pushArgs(o[s-1],n.handler.createExpr()),n.handler.pushArgs(o[s-1],n.handler.createExpr());break;case 39:0===o[s-2].length&&n.handler.pushArgs(o[s-2],n.handler.createExpr()),n.handler.pushArgs(o[s-2],o[s]);break;case 40:this.$=n.handler.createCellRefExpr(o[s]);break;case 41:this.$=n.handler.createColRefExpr(o[s]);break;case 42:this.$=n.handler.createRowRefExpr(o[s]);break;case 43:this.$=n.handler.createCellRefExpr(o[s],o[s-1]);break;case 44:this.$=n.handler.createColRefExpr(o[s],o[s-1]);break;case 45:this.$=n.handler.createRowRefExpr(o[s],o[s-1]);break;case 46:this.$=n.handler.getVariableExpr(o[s]);break;case 47:this.$=n.handler.getVariableExpr(o[s],o[s-1].slice(0,-1))}},table:[{3:1,4:2,6:t,8:r,9:n,22:6,23:i,26:8,27:9,29:10,30:o,31:a,32:s,33:l,34:u,39:c,40:h,41:d,42:f,43:g},{1:[3]},{5:[1,21],8:p,9:m,10:v,11:y,12:C,13:x,14:w,15:_,16:R,17:S,18:b,19:I,20:A,21:T},{4:36,6:t,8:r,9:n,22:6,23:i,26:8,27:9,29:10,30:o,31:a,32:s,33:l,34:u,39:c,40:h,41:d,42:f,43:g},{4:37,6:t,8:r,9:n,22:6,23:i,26:8,27:9,29:10,30:o,31:a,32:s,33:l,34:u,39:c,40:h,41:d,42:f,43:g},{4:38,6:t,8:r,9:n,22:6,23:i,26:8,27:9,29:10,30:o,31:a,32:s,33:l,34:u,39:c,40:h,41:d,42:f,43:g},e(E,[2,19]),{8:M,9:k,22:42,24:39,31:a,32:s,33:l,34:u,35:40,37:41},e(E,[2,21]),{6:[1,45]},e(E,[2,23]),e(N,[2,25]),e(N,[2,26]),e(N,[2,27]),e(N,[2,28]),e(E,[2,40]),e(E,[2,41]),e(E,[2,42]),{39:[1,46],40:[1,47],41:[1,48],43:[1,49]},{6:[2,24]},e(E,[2,46]),{1:[2,1]},{4:50,6:t,8:r,9:n,22:6,23:i,26:8,27:9,29:10,30:o,31:a,32:s,33:l,34:u,39:c,40:h,41:d,42:f,43:g},{4:51,6:t,8:r,9:n,22:6,23:i,26:8,27:9,29:10,30:o,31:a,32:s,33:l,34:u,39:c,40:h,41:d,42:f,43:g},{4:52,6:t,8:r,9:n,22:6,23:i,26:8,27:9,29:10,30:o,31:a,32:s,33:l,34:u,39:c,40:h,41:d,42:f,43:g},{4:53,6:t,8:r,9:n,22:6,23:i,26:8,27:9,29:10,30:o,31:a,32:s,33:l,34:u,39:c,40:h,41:d,42:f,43:g},{4:54,6:t,8:r,9:n,22:6,23:i,26:8,27:9,29:10,30:o,31:a,32:s,33:l,34:u,39:c,40:h,41:d,42:f,43:g},{4:55,6:t,8:r,9:n,22:6,23:i,26:8,27:9,29:10,30:o,31:a,32:s,33:l,34:u,39:c,40:h,41:d,42:f,43:g},{4:56,6:t,8:r,9:n,22:6,23:i,26:8,27:9,29:10,30:o,31:a,32:s,33:l,34:u,39:c,40:h,41:d,42:f,43:g},{4:57,6:t,8:r,9:n,22:6,23:i,26:8,27:9,29:10,30:o,31:a,32:s,33:l,34:u,39:c,40:h,41:d,42:f,43:g},{4:58,6:t,8:r,9:n,22:6,23:i,26:8,27:9,29:10,30:o,31:a,32:s,33:l,34:u,39:c,40:h,41:d,42:f,43:g},{4:59,6:t,8:r,9:n,22:6,23:i,26:8,27:9,29:10,30:o,31:a,32:s,33:l,34:u,39:c,40:h,41:d,42:f,43:g},{4:60,6:t,8:r,9:n,22:6,23:i,26:8,27:9,29:10,30:o,31:a,32:s,33:l,34:u,39:c,40:h,41:d,42:f,43:g},{4:61,6:t,8:r,9:n,22:6,23:i,26:8,27:9,29:10,30:o,31:a,32:s,33:l,34:u,39:c,40:h,41:d,42:f,43:g},{4:62,6:t,8:r,9:n,22:6,23:i,26:8,27:9,29:10,30:o,31:a,32:s,33:l,34:u,39:c,40:h,41:d,42:f,43:g},e(E,[2,18]),{7:[1,63],8:p,9:m,10:v,11:y,12:C,13:x,14:w,15:_,16:R,17:S,18:b,19:I,20:A,21:T},e(O,[2,3],{10:v}),e(O,[2,4],{10:v}),{25:[1,64],36:[1,65]},e(D,[2,29],{38:L}),e(P,[2,31]),e(P,[2,33]),{33:[1,67]},{33:[1,68]},e(F,[2,36],{22:6,26:8,27:9,29:10,28:69,4:70,6:t,8:r,9:n,23:i,30:o,31:a,32:s,33:l,34:u,39:c,40:h,41:d,42:f,43:g}),e(E,[2,43]),e(E,[2,44]),e(E,[2,45]),e(E,[2,47]),e(E,[2,5]),e([5,7,8,9,11,12,13,14,15,16,17,18,19,20,38],[2,6],{10:v,21:T}),e(B,[2,7],{10:v,11:y,21:T}),e(B,[2,8],{10:v,11:y,21:T}),e(V,[2,9],{10:v,11:y,12:C,13:x,21:T}),e(V,[2,10],{10:v,11:y,12:C,13:x,21:T}),e([5,7,14,15,16,17,18,19,20,38],[2,11],{8:p,9:m,10:v,11:y,12:C,13:x,21:T}),e(H,[2,12],{8:p,9:m,10:v,11:y,12:C,13:x,14:w,21:T}),e(H,[2,13],{8:p,9:m,10:v,11:y,12:C,13:x,14:w,21:T}),e(H,[2,14],{8:p,9:m,10:v,11:y,12:C,13:x,14:w,21:T}),e(H,[2,15],{8:p,9:m,10:v,11:y,12:C,13:x,14:w,21:T}),e(H,[2,16],{8:p,9:m,10:v,11:y,12:C,13:x,14:w,21:T}),e(H,[2,17],{8:p,9:m,10:v,11:y,12:C,13:x,14:w,21:T}),e(E,[2,2]),e(E,[2,20]),{8:M,9:k,22:42,31:a,32:s,33:l,34:u,35:71,37:41},{8:M,9:k,22:42,31:a,32:s,33:l,34:u,37:72},e(P,[2,34]),e(P,[2,35]),{7:[1,73],38:[1,74]},e(F,[2,37],{8:p,9:m,10:v,11:y,12:C,13:x,14:w,15:_,16:R,17:S,18:b,19:I,20:A,21:T}),e(D,[2,30],{38:L}),e(P,[2,32]),e(E,[2,22]),e(F,[2,38],{22:6,26:8,27:9,29:10,4:75,6:t,8:r,9:n,23:i,30:o,31:a,32:s,33:l,34:u,39:c,40:h,41:d,42:f,43:g}),e(F,[2,39],{8:p,9:m,10:v,11:y,12:C,13:x,14:w,15:_,16:R,17:S,18:b,19:I,20:A,21:T})],defaultActions:{19:[2,24],21:[2,1]},parseError:function(e,t){if(!t.recoverable){var r=new Error(e);throw r.hash=t,r}this.trace(e)},parse:function(e){var t=this,r=[0],n=[null],i=[],o=this.table,a="",s=0,l=0,u=0,c=2,h=1,d=i.slice.call(arguments,1),f=Object.create(this.lexer),g={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(g.yy[p]=this.yy[p]);f.setInput(e,g.yy),g.yy.lexer=f,g.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var m=f.yylloc;i.push(m);var v=f.options&&f.options.ranges;"function"==typeof g.yy.parseError?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var y,C,x,w,_,R,S,b,I,A=function(){var e;return"number"!=typeof(e=f.lex()||h)&&(e=t.symbols_[e]||e),e},T={};;){if(x=r[r.length-1],this.defaultActions[x]?w=this.defaultActions[x]:(null==y&&(y=A()),w=o[x]&&o[x][y]),void 0===w||!w.length||!w[0]){var E="";for(R in I=[],o[x])this.terminals_[R]&&R>c&&I.push("'"+this.terminals_[R]+"'");E=f.showPosition?"Parse error on line "+(s+1)+":\n"+f.showPosition()+"\nExpecting "+I.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(s+1)+": Unexpected "+(y==h?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(E,{text:f.match,token:this.terminals_[y]||y,line:f.yylineno,loc:m,expected:I})}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+y);switch(w[0]){case 1:r.push(y),n.push(f.yytext),i.push(f.yylloc),r.push(w[1]),y=null,C?(y=C,C=null):(l=f.yyleng,a=f.yytext,s=f.yylineno,m=f.yylloc,u>0&&u--);break;case 2:if(S=this.productions_[w[1]][1],T.$=n[n.length-S],T._$={first_line:i[i.length-(S||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(S||1)].first_column,last_column:i[i.length-1].last_column},v&&(T._$.range=[i[i.length-(S||1)].range[0],i[i.length-1].range[1]]),void 0!==(_=this.performAction.apply(T,[a,l,s,g.yy,w[1],n,i].concat(d))))return _;S&&(r=r.slice(0,-1*S*2),n=n.slice(0,-1*S),i=i.slice(0,-1*S)),r.push(this.productions_[w[1]][0]),n.push(T.$),i.push(T._$),b=o[r[r.length-2]][r[r.length-1]],r.push(b);break;case 3:return!0}}return!0}};function z(){this.yy={}}return z.prototype=U,U.Parser=z,new z}();e.exports=t},48513:(e,t,r)=>{const n=r(44563);e.exports={syntax:n}},44563:e=>{const t=["number1","number2, ...?"],r=["text1","text2, ...?"],n=["value1","value2, ...?"],i=["criteria_range1","criteria1","criteria_range2, ...?","criteria2, ...?"],o={ABS:["number"],ADDRESS:["row_num","column_num","abs_num?","a1?","sheet_text?"],ACCRINT:["issue","first","settlement","rate","par","frequency","basis?","calc_method?"],ACOS:["number"],ACOSH:["number"],ACOT:["number"],ACOTH:["number"],AND:["logical1","logical2, ...?"],ARABIC:["text"],ASIN:["number"],ASINH:["number"],ATAN:["number"],ATAN2:["number_x","number_y"],ATANH:["number"],AVEDEV:t,AVERAGE:t,AVERAGEA:t,AVERAGEIF:["range","criteria","average_range?"],AVERAGEIFS:["average_range",...i],BASE:["number","radix","min_length?"],BESSELI:["x","n"],BESSELJ:["x","n"],BESSELK:["x","n"],BESSELY:["x","n"],"BETA.DIST":["x","alpha","beta","cumulative","A?","B?"],"BETA.INV":["probability","alpha","beta","A?","B?"],BETADIST:["x","alpha","beta","A?","B?"],BETAINV:["probability","alpha","beta","A?","B?"],BIN2DEC:["number"],BIN2HEX:["number","places?"],BIN2OCT:["number","places?"],"BINOM.DIST":["successes","trials","probability","cumulative"],"BINOM.INV":["trials","probability","alpha"],BINOMDIST:["successes","trials","probability","cumulative"],BITAND:["number1","number2"],BITLSHIFT:["number","shift"],BITOR:["number1","number2"],BITRSHIFT:["number","shift"],BITXOR:["number1","number2"],CEILING:["number","significance"],"CEILING.MATH":["number","significance?","mode?"],"CEILING.PRECISE":["number","significance?"],CHAR:["number"],CHIDIST:["x","k"],CHIINV:["p","k"],"CHISQ.DIST":["x","k","cumulative?"],"CHISQ.DIST.RT":["x","k"],"CHISQ.INV":["probability","k"],"CHISQ.INV.RT":["p","k"],"CHISQ.TEST":["observed","expected"],CHITEST:["observed","expected"],CHOOSE:["index_num","value1","value2, ...?"],CLEAN:["text"],CODE:["text"],COLUMN:["reference?"],COLUMNS:["array"],COMBIN:["number","number_chosen"],COMBINA:["number","number_chosen"],COMPLEX:["real","imaginary","suffix?"],CONCAT:r,CONCATENATE:r,CONFIDENCE:["alpha","standard_dev","size"],"CONFIDENCE.NORM":["alpha","standard_dev","size"],"CONFIDENCE.T":["alpha","standard_dev","size"],CORREL:["array1","array2"],COS:["number"],COSH:["number"],COT:["number"],COTH:["number"],COUNT:n,COUNTA:n,COUNTBLANK:["range"],COUNTIF:["range","criteria"],COUNTIFS:i,COVAR:["array1","array2"],"COVARIANCE.P":["array1","array2"],"COVARIANCE.S":["array1","array2"],CRITBINOM:["trials","probability","alpha"],CSC:["number"],CSCH:["number"],CUMIPMT:["rate","nper","pv","start_period","end_period","type"],CUMPRINC:["rate","nper","pv","start_period","end_period","type"],DATE:["year","month","day"],DATEDIF:["start_date","end_date","unit"],DATEVALUE:["date_text"],DAY:["serial_number"],DAYS:["end_date","start_date"],DAYS360:["end_date","start_date","method?"],DB:["cost","salvage","life","period","month?"],DDB:["cost","salvage","life","period","factor?"],DEC2BIN:["number","places?"],DEC2HEX:["number","places?"],DEC2OCT:["number","places?"],DECIMAL:["number","radix"],DEGREES:["angle"],DELTA:["number1","number2?"],DEVSQ:t,DOLLAR:["number","decimals?"],DOLLARDE:["dollar","fraction"],DOLLARFR:["dollar","fraction"],EDATE:["start_date","months"],EFFECT:["nominal_rate","npery"],EOMONTH:["start_date","months"],ERF:["lower_limit","upper_limit?"],"ERF.PRECISE":["x"],ERFC:["x"],"ERFC.PRECISE":["x"],"ERROR.TYPE":["error_val"],EVEN:["number"],EXACT:["text1","text2"],EXP:["number"],"EXPON.DIST":["x","lambda","cumulative"],EXPONDIST:["x","lambda","cumulative"],FALSE:[],"F.DIST":["x","deg_freedom1","deg_freedom2","cumulative"],"F.DIST.RT":["x","deg_freedom1","deg_freedom2"],"F.INV":["probability","deg_freedom1","deg_freedom2"],"F.INV.RT":["probability","deg_freedom1","deg_freedom2"],"F.TEST":["array1","array2"],FACT:["number"],FACTDOUBLE:["number"],FDIST:["x","deg_freedom1","deg_freedom2","cumulative?"],FILTER:["array","include","if_empty?"],FIND:["find_text","within_text","start_num?"],FINV:["probability","deg_freedom1","deg_freedom2"],FISHER:["x"],FISHERINV:["y"],FIXED:["number","decimals?","no_commas?"],FLOOR:["number","significance"],"FLOOR.MATH":["number","significance?","mode?"],"FLOOR.PRECISE":["number","significance?"],FORECAST:["x","data_y","data_x"],FTEST:["array1","array2"],FV:["rate","periods","payment","value?","type?"],FVSCHEDULE:["principal","schedule"],GAMMA:["x"],"GAMMA.DIST":["x","alpha","beta","cumulative"],"GAMMA.INV":["probability","alpha","beta"],GAMMADIST:["x","alpha","beta","cumulative"],GAMMAINV:["probability","alpha","beta"],GAMMALN:["x"],"GAMMALN.PRECISE":["x"],GAUSS:["x"],GCD:t,GEOMEAN:t,GESTEP:["number","step?"],HARMEAN:t,HEX2BIN:["number","places?"],HEX2DEC:["number"],HEX2OCT:["number","places?"],HLOOKUP:["lookup_value","table_array","row_index_num","is_sorted?"],HOUR:["serial_number"],HYPERLINK:["link_location","friendly_name?"],"HYPGEOM.DIST":["sample_s","number_sample","population_s","number_pop","cumulative"],HYPGEOMDIST:["sample_s","number_sample","population_s","number_pop"],IF:["logical_test","value_if_true","value_if_false?"],IFERROR:["value","value_if_error"],IFNA:["value","value_if_na"],IFS:["logical_test1","value_if_true1","logical_test2, ...?","value_if_true2, ...?"],IMABS:["inumber"],IMAGINARY:["inumber"],IMARGUMENT:["inumber"],IMCONJUGATE:["inumber"],IMCOS:["inumber"],IMCOSH:["inumber"],IMCOT:["inumber"],IMCSC:["inumber"],IMCSCH:["inumber"],IMDIV:["inumber1","inumber2"],IMEXP:["inumber"],IMLN:["inumber"],IMLOG10:["inumber"],IMLOG2:["inumber"],IMPORTRANGE:["spreadsheet_url","range_string"],IMPOWER:["inumber","number"],IMPRODUCT:["inumber1","inumber2, ...?"],IMREAL:["inumber"],IMSEC:["inumber"],IMSECH:["inumber"],IMSIN:["inumber"],IMSINH:["inumber"],IMSQRT:["inumber"],IMSUB:["inumber1","inumber2"],IMSUM:["inumber1","inumber2, ...?"],IMTAN:["inumber"],INDEX:["reference","row_num","column_num?","area_num?"],INDIRECT:["ref_text","a1?"],INT:["number"],INTERCEPT:["known_y","known_x"],IPMT:["rate","period","periods","present","future?","type?"],IRR:["values","guess?"],ISBLANK:["value"],ISDATE:["value"],ISERR:["value"],ISERROR:["value"],ISEVEN:["number"],ISLOGICAL:["value"],ISNA:["value"],ISODD:["number"],ISNONTEXT:["value"],ISNUMBER:["value"],"ISO.CEILING":["number","significance?"],ISOWEEKNUM:["date"],ISPMT:["rate","period","periods","value"],ISTEXT:["value"],TEXT:["value","format_text"],KURT:t,LARGE:["array","k"],LCM:t,LEFT:["text","num_chars?"],LEN:["text"],LN:["number"],LOG:["number","base?"],LOG10:["number"],LOGINV:["probability","mean","standard_dev"],"LOGNORM.DIST":["x","mean","standard_dev","cumulative"],"LOGNORM.INV":["probability","mean","standard_dev"],LOGNORMDIST:["x","mean","standard_dev"],LOWER:["text"],MATCH:["lookup_value","lookup_array","match_type?"],MAX:t,MAXA:n,MAXIFS:["max_range",...i],MEDIAN:t,MID:["text","start_num","num_chars"],MIN:t,MINA:n,MINIFS:["min_range",...i],MINUTE:["serial_number"],MIRR:["values","finance_rate","reinvest_rate"],MOD:["number","divisor"],MODE:t,"MODE.SNGL":t,MONTH:["serial_number"],MROUND:["number","multiple"],MULTINOMIAL:t,N:["value"],NA:[],"NEGBINOM.DIST":["number_f","number_s","probability_s","cumulative"],NEGBINOMDIST:["number_f","number_s","probability_s"],NETWORKDAYS:["start_date","end_date","holidays?"],"NETWORKDAYS.INTL":["start_date","end_date","weekend?","holidays?"],NOMINAL:["effect_rate","periods"],"NORM.DIST":["x","mean","standard_dev","cumulative"],"NORM.INV":["probability","mean","standard_dev"],"NORM.S.DIST":["z","cumulative?"],"NORM.S.INV":["probability"],NORMDIST:["x","mean","standard_dev","cumulative"],NORMINV:["x","mean","standard_dev"],NORMSDIST:["z"],NORMSINV:["x"],NOT:["logical"],NOW:[],NPER:["rate","payment","present","future?","type?"],NPV:["rate","value1","value2, ...?"],OCT2BIN:["number","places?"],OCT2DEC:["number"],OCT2HEX:["number","places?"],ODD:["number"],OFFSET:["reference","rows","cols","height?","width?"],OR:["logical1","logical2, ...?"],PDURATION:["rate","present","future"],PEARSON:["array1","array2"],PERCENTILE:["array","k"],"PERCENTILE.EXC":["array","k"],"PERCENTILE.INC":["array","k"],PERCENTRANK:["array","x","significance?"],"PERCENTRANK.EXC":["array","x","significance?"],"PERCENTRANK.INC":["array","x","significance?"],PERMUT:["number","number_chosen"],PERMUTATIONA:["number","number_chosen"],PHI:["x"],PI:[],PMT:["rate","periods","present","future?","type?"],POISSON:["x","mean","cumulative?"],"POISSON.DIST":["x","mean","cumulative?"],POWER:["number","power"],PPMT:["rate","periods","nperiods","future?","type?"],PROB:["x_range","prob_range","lower_limit","upper_limit?"],PRODUCT:t,PROPER:["text"],PV:["rate","periods","payment","future?","type?"],QUARTILE:["array","quart"],"QUARTILE.EXC":["array","quart"],"QUARTILE.INC":["array","quart"],QUOTIENT:["numerator","denominator"],RADIANS:["angle"],RAND:[],RANDARRAY:["rows?","columns?","min?","max?","whole_number?"],RANDBETWEEN:["bottom","top"],RANK:["number","ref","order?"],"RANK.AVG":["number","ref","order?"],"RANK.EQ":["number","ref","order?"],RATE:["periods","payment","present","future?","type?","guess?"],REPLACE:["old_text","start_num","num_chars","new_text"],REPT:["text","number_times"],RIGHT:["text","num_chars?"],ROMAN:["number","form?"],ROUND:["number","num_digits"],ROUNDDOWN:["number","num_digits"],ROUNDUP:["number","num_digits"],ROW:["reference?"],ROWS:["array"],RRI:["periods","present","future"],RSQ:["data_y","data_x"],SEARCH:["fin_text","within_text","start_num?"],SEC:["number"],SECH:["number"],SECOND:["serial_number"],SERIESSUM:["x","n","m","coefficients"],SEQUENCE:["rows","columns?","start?","step?"],SIGN:["number"],SIN:["number"],SINH:["number"],SKEW:t,"SKEW.P":t,SLN:["cost","salvage","life"],SLOPE:["data_y","data_x"],SMALL:["array","k"],SORT:["array","sort_index?","sort_order?","by_col?"],SORTBY:["array","by_array1","sort_order1?","by_array2, ...?","sort_order2, ...?"],SQRT:["number"],SQRTPI:["number"],STANDARDIZE:["x","mean","standard_dev"],STDEV:t,"STDEV.P":t,"STDEV.S":t,STDEVA:n,STDEVP:t,STDEVPA:n,STEYX:["data_y","data_x"],SUBSTITUTE:["text","old_text","new_text","instance_num?"],SUBTOTAL:["function_num","ref1","ref2, ...?"],SUM:t,SUMIF:["range","criteria","sum_range?"],SUMIFS:["sum_range",...i],SUMPRODUCT:["array1","array2, ...?"],SUMSQ:t,SUMX2MY2:["array_x","array_y"],SUMX2PY2:["array_x","array_y"],SUMXMY2:["array_x","array_y"],SYD:["cost","salvage","life","per"],T:["value"],"T.DIST":["x","deg_freedom","cumulative"],"T.DIST.2T":["x","deg_freedom"],"T.DIST.RT":["x","deg_freedom"],"T.INV":["probability","deg_freedom"],"T.INV.2T":["probability","deg_freedom"],"T.TEST":["array1","array2","tails","type"],TAN:["number"],TANH:["number"],TBILLEQ:["settlement","maturity","discount"],TBILLPRICE:["settlement","maturity","discount"],TBILLYIELD:["settlement","maturity","pr"],TDIST:["x","deg_freedom","tails"],TIME:["hour","minute","second"],TIMEVALUE:["time_text"],TINV:["probability","deg_freedom"],TODAY:[],TRANSPOSE:["array"],TRIM:["text"],TRIMMEAN:["array","percent"],TRUE:[],TRUNC:["number","num_digits?"],TTEST:["array1","array2","tails","type"],TYPE:["value"],UNICHAR:["number"],UNICODE:["text"],UNIQUE:["array","by_col?","exactly_once?"],UPPER:["text"],VALUE:["text"],VAR:t,"VAR.P":t,"VAR.S":t,VARA:n,VARP:t,VARPA:n,VLOOKUP:["lookup_value","table_array","col_index_num","is_sorted?"],WEEKDAY:["serial_number","return_type?"],WEEKNUM:["serial_number","return_type?"],WEIBULL:["x","alpha","beta","cumulative"],"WEIBULL.DIST":["x","alpha","beta","cumulative"],WORKDAY:["start_date","days","holidays?"],"WORKDAY.INTL":["start_date","days","weekend?","holidays?"],XIRR:["values","dates","guess?"],XLOOKUP:["lookup_value","lookup_array","return_array","if_not_found?","match_mode?","search_mode?"],XNPV:["rate","values","dates"],XOR:["logical1","logical2, ...?"],YEAR:["serial_number"],YEARFRAC:["start_date","end_date","basis?"],"Z.TEST":["array","x","sigma?"],ZTEST:["array","x","sigma?"]};e.exports=o},94442:(e,t,r)=>{"use strict";r.d(t,{default:()=>m});var n=r(37226),i=r(82477),o=r(25357),a=r(39381),s=r(84474),l=r(32241),u=r(95498),c=r(25254),h=r(6796),d=r(40147),f=r(28212);const g=[i.PlotArea,i.Chart,o.Scaling,o.MajorGridLines,o.Axis,a.Marker,a.LineStyle,a.Series,s.Legend,l.Label,u.Title,c.TextStyle,h.Layout].reduce((function(e,t){return e[t.configName]=t,e}),Object.create(null)),p=["#509BE6","#FFC100","#F26166","#AD70CC","#4DBF4D","#FF8F3D","#8E6F69","#00B6CE","#E25FBC","#4D5FFF","#27D790","#3B8795"],m=class{constructor(e,t){this.readChartCfg(e),this.readOptionCfg(t),this._options=t}getConfigMap(){return g}getConfigCls(e){return this.getConfigMap()[e]}readChartCfg(e){this._config=new(this.getConfigCls("chart"))(this,e)}readOptionCfg(e){}getUseRowHeader(){return this.ensurePlotArea().getUseRowHeader()}getUseColumnHeader(){return this.ensurePlotArea().getUseColumnHeader()}getSwitchRowColumn(){return this.ensurePlotArea().getSwitchRowColumn()}dataHasCat(){return this.getSwitchRowColumn()?this.getUseColumnHeader():this.getUseRowHeader()}dataHasTx(){return this.getSwitchRowColumn()?this.getUseRowHeader():this.getUseColumnHeader()}setRawData(e){this.data=e}getRawData(){return this.data}cloneRawData(e){const t=this.getRawData();if(!t)return t;if(e){const e=[],r=this._getDataColNumber(t),n=this._getDataRowNumber(t);for(let i=0;ie.slice()))}_getData(e,t,r){const n=e&&e[t]&&e[t][r];return null!=n?n:null}getData(e,t){return this._getData(this.getRawData(),e,t)}_getDataRowNumber(e){return e?e.length:0}getDataRowNumber(){return this._getDataRowNumber(this.getRawData())}_getDataColNumber(e){return e&&e[0]?e[0].length:0}getDataColNumber(){return this._getDataColNumber(this.getRawData())}ensureChart(){return this._config}ensureChartTitle(){return this.ensureChart().ensureTitle()}ensureChartSubtitle(){return this.ensureChart().ensureSubtitle()}ensureChartLegend(){return this.ensureChart().ensureLegend()}ensureChartLegendStyle(){return this.ensureChartLegend().ensureTextStyle()}ensureGlobalTextStyle(){return this.ensureChart().ensureTextStyle()}ensurePlotArea(){return this.ensureChart().ensurePlotArea()}ensureSeries(e){return this.ensurePlotArea().ensureSeries(e)}ensureSeriesLabel(e){return this.ensureSeries(e).ensureLabel()}ensureSeriesLabelStyle(e){return this.ensureSeriesLabel(e).ensureTextStyle()}ensurePieSeries(){return this.ensureSeries(0)}ensurePieLabel(){return this.ensurePieSeries().ensureLabel()}ensurePieLabelStyle(){return this.ensurePieLabel().ensureTextStyle()}ensureTitle(e){switch(e){case"title":return this.ensureChartTitle();case"subtitle":return this.ensureChartSubtitle();case"xTitle":return this.ensureXAxis().ensureTitle();case"yTitle":return this.ensureYAxis().ensureTitle();case"y2Title":return this.ensureYAxis2().ensureTitle();default:return null}}ensureTitleStyle(e){const t=this.ensureTitle(e);return t&&t.ensureTextStyle()}ensureXAxis(){return this.ensurePlotArea().ensureXAxis()}ensureYAxis(){return this.ensurePlotArea().ensureYAxis()}ensureYAxis2(){return this.ensurePlotArea().ensureYAxis2()}ensureAxis(e){switch(e){case"x":return this.ensureXAxis();case"y":return this.ensureYAxis();case"y2":return this.ensureYAxis2();default:return null}}ensureAxisScaling(e){const t=this.ensureAxis(e);return t&&t.ensureScaling()}ensureAxisMajorGridLines(e){const t=this.ensureAxis(e);return t&&t.ensureMajorGridLines()}ensureAxisLabel(e){const t=this.ensureAxis(e);return t&&t.ensureLabel()}ensureAxisLabelStyle(e){const t=this.ensureAxisLabel(e);return t&&t.ensureTextStyle()}build(){return this.ensureChart().build()}compute(e){return this.ensureChart().compute(e)}getChartSetting(){const e=this.ensureChart();return this.filterChartSetting(e.getType(),e.getBarDir(),e.getGrouping(),!0)}getSeriesCat(e){const t=this.dataHasTx()?1:0;if((0,d.isNumber)(e))return this.dataHasCat()?(0,d.ensureString)(this.getData(0,t+e)):"";{const e=this.getDataColNumber(),r=new Array(e-t);if(this.dataHasCat())for(let n=t;n{this._handleTitle(e,t,r)}))}_handleAxis(e,t,r){const n=this.ensureAxis(e);n&&t.call(r,n,e)}handleAxis(e,t,r){e?this._handleAxis(e,t,r):["x","y","y2"].forEach((e=>{this._handleAxis(e,t,r)}))}getAllColors(){const e=[];function t(t){t&&e.push(t.substr(1).toLowerCase())}return t(this.ensureChart().getBackgroundColor(!0)),this.handleTitle(null,(function(e){t(e.ensureTextStyle().getColor(!0))}),this),this.forEachSeries((function(e){t(e.getColor(!0)),t(e.getPieBorderColor(!0)),t(e.ensureLabel().ensureTextStyle().getColor(!0)),(e.getPieColors(!0)||[]).forEach(t)}),this,!0),t(this.ensureChartLegendStyle().getColor(!0)),this.handleAxis(null,(function(e){t(e.ensureLabel().ensureTextStyle().getColor(!0)),t(e.ensureMajorGridLines().getColor(!0))}),this),e}static checkCmdName(e){return e&&e in this.prototype&&"apply"!==e&&(e.startsWith("apply")||e.startsWith("_apply"))}apply(e,t){return!!this.constructor.checkCmdName(e)&&(this[e].apply(this,t),!0)}invert(e,t){if(!this.constructor.checkCmdName(e))return!1;let r=this[e.replace("apply","invert")].apply(this,t);return Array.isArray(r)||(r=[r]),r.forEach((t=>{t.name||(t.name=e)})),r}applyChartSetting(e,t,r){if(({type:e,barDir:t,grouping:r}=this.filterChartSetting(e,t,r)),this._applyChartType(e),e===f.CHART_TYPE.HYBRID){const e=this.getSeriesCount()/2;this.forEachSeries((function(t,r){t.setType(r=a||o>=s)return!1;for(e=i;e0))return!0;return!1}getEmptyCategory(){const e=this.getSeriesCat(),t=this.getSeriesCount();return e.map(((r,n)=>{if(!(0,d.isEmpty)(e[n]))return!1;for(let e=0;ethis.getSeriesVal(t).every((e=>(0,d.isEmpty)(e)))))}calcSeriesData(e){const t=[];for(let e=0,r=this.getSeriesCount();e{"use strict";r.d(t,{default:()=>i});var n=r(22373);class i extends n.default{_convertSeries(e,t){const r=super._convertSeries(e,t);return r.areaStyle={opacity:e.getOpacity()},r}}},69145:(e,t,r)=>{"use strict";r.d(t,{default:()=>o});var n=r(37224),i=r(28212);class o extends n.default{convertXaxis(e){return this.chartInfo.ensureChart().getBarDir()===i.DEFAULT.BAR_DIR?super.convertXaxis(e):super.convertYaxis(e)}convertYaxis(e){return this.chartInfo.ensureChart().getBarDir()===i.DEFAULT.BAR_DIR?super.convertYaxis(e):super.convertXaxis(e)}_convertSeries(e,t){const r=super._convertSeries(e,t);return this.chartInfo.ensureChart().getBarDir()!==i.DEFAULT.BAR_DIR&&r.yAxisIndex&&(r.xAxisIndex=r.yAxisIndex,delete r.yAxisIndex),o.fillSeriesOption(r,this.chartInfo,e,t)}_switchSeriesLabelPosition(e){const t=this.chartInfo.ensureChart().getBarDir()!==i.DEFAULT.BAR_DIR;let r=t?"right":"top";switch(e.getPosition()){case"inBase":r=t?"insideLeft":"insideBottom";break;case"inCenter":r="inside";break;case"inEnd":r=t?"insideRight":"insideTop"}return r}static fillSeriesOption(e){return e.type="bar",e}}},59924:(e,t,r)=>{"use strict";r.d(t,{default:()=>i});var n=r(40147);class i{constructor(e){this.chartInfo=e}initData(){const e=this.chartInfo.getEmptyCategory(),t=this.chartInfo.getEmptySeries();function r(e){const t=[];for(let r=0;r!e[r];i=i.filter(((e,r)=>!t[r])),n=n.filter(o);for(const e of i)e.data=e.data.filter(o);this._category=this._processCategory(n),this._data=this._processData(i)}_getNullValue(){return null}_processCategory(e){for(let t=0,r=e.length;t({name:e.name,icon:"rect"})))}convertSeries(){return this._data.map(((e,t)=>this._convertSeries(this.chartInfo.ensureSeries(this._seriesIndexMap[t]),e)))}_convertSeries(e,t){const r={name:t.name,data:t.data,emphasis:this._convertSeriesEmphasis(),tooltip:{formatter:this._convertSeriesTooltipFormatter(e)}},n=e.ensureLabel();return n.getHidden()||(r.label=this._convertSeriesLabel(n,e)),r}_convertSeriesEmphasis(){return{itemStyle:{shadowColor:"rgba(0,0,0,0.5)",shadowBlur:6,shadowOffsetY:2}}}_convertSeriesLabel(e,t){const r=Object.assign({show:!0,position:this._switchSeriesLabelPosition(e,t),textBorderWidth:3},this.convertTextStyle(e.ensureTextStyle()));return r.textBorderColor=r.position.startsWith("inside")?"auto":this.chartInfo.ensureChart().getBackgroundColor(),r}_switchSeriesLabelPosition(e){let t="top";switch(e.getPosition()){case"r":t="right";break;case"b":t="bottom";break;case"l":t="left"}return t}convertColor(){const e=this.chartInfo.getSeriesThemeColors();return this._data.map(((t,r)=>(r=this._seriesIndexMap[r],this.chartInfo.getSeriesColor(r)||e[r%e.length])))}convertBackground(){return(0,n.parseHexColor)(this.chartInfo.ensureChart().getBackgroundColor())}convertTextStyle(e){return{fontFamily:e.getFontFamily(),fontSize:e.getFontSize(),fontStyle:e.getItalic()?"italic":"normal",fontWeight:e.getBold()?"bold":"normal",color:e.getColor()}}convertTooltip(){return{show:!0,position:"top",transitionDuration:0,padding:[4,12],backgroundColor:"#606264",borderWidth:1,borderColor:"#FFF",extraCssText:"box-shadow: 0 1px 4px rgba(0,0,0,0.1); border-radius: 3px;"}}_convertSeriesTooltipFormatter(e){return t=>{let r="";t.name&&(r+=`${t.name}
`),r+=``;const n=this._getOriginName(t.seriesName);return r+=`${n?n+": ":""}${this._tooltipValueFormatter(t.value,e.getRightAxis()?"y2":"y1")}`,r}}_tooltipValueFormatter(e,t){return this._dataFormatter(e,t)}_dataFormatter(e,t){return(0,n.isFunction)(this.chartInfo.dataFormatter)?this.chartInfo.dataFormatter(e,t):e}_uniquifyName(e,t){return(1e3+t).toString().substr(1)+e}_getOriginName(e){return e.substr(3)}}},37226:(e,t,r)=>{"use strict";r.d(t,{default:()=>c});var n=r(28212),i=r(22373),o=r(89826),a=r(69145),s=r(90662),l=r(11489),u=r(75712);function c(e){switch(e.ensureChart().getType()){case n.CHART_TYPE.LINE:return new i.default(e);case n.CHART_TYPE.AREA:return new o.default(e);case n.CHART_TYPE.BAR:return new a.default(e);case n.CHART_TYPE.PIE:return new s.default(e);case n.CHART_TYPE.SCATTER:return new l.default(e);case n.CHART_TYPE.HYBRID:return new u.default(e)}}},72943:(e,t,r)=>{"use strict";r.d(t,{default:()=>a});var n=r(59924),i=r(28212),o=r(40147);class a extends n.default{constructor(e){super(e);const t=this.chartInfo.calcAxisBias();this._useAxis=[t<=0,t>=0]}_getGridSpace(e){return e&&e.getText()?(0,o.getFontHeight)(e.ensureTextStyle().getFontSize()||this.chartInfo.ensureGlobalTextStyle().getFontSize())+12:0}_calcGridBound(){let{top:e,left:t,right:r,bottom:n}=this._plotBound;return n+=this._getGridSpace(this.chartInfo.ensureXAxis().ensureTitle()),t+=this._getGridSpace(this._useAxis[0]&&this.chartInfo.ensureYAxis().ensureTitle()),r+=this._getGridSpace(this._useAxis[1]&&this.chartInfo.ensureYAxis2().ensureTitle()),{top:e,left:t,right:r,bottom:n}}convert(e,t){const r=super.convert(e,t);return r.grid=this.convertGrid(),r.xAxis=this.convertXaxis(!1),r.yAxis=this.convertYaxis(!0),r}convertGrid(){return Object.assign({containLabel:!0},this._calcGridBound())}convertXaxis(e){return this.convertCategoryAxis(this.chartInfo.ensureXAxis(),e)}convertYaxis(e){return[this.chartInfo.ensureYAxis(),this.chartInfo.ensureYAxis2()].map(((t,r)=>this.convertValueAxis(this._useAxis[r]&&t,e,"y"+(r+1))))}convertCategoryAxis(e,t){return Object.assign({type:"category",data:this._category,inverse:e.ensureScaling().getRevert()},this.convertAxis(e,t))}convertValueAxis(e,t,r){if(!e)return{show:!1};const n=Object.assign({splitNumber:e.getTickNumber(),scale:!0},this.convertAxis(e,t),this.convertAxisScale(e.ensureScaling()));return!1!==n.axisLabel.show&&(n.axisLabel.formatter=e=>this._dataFormatter(e,r)),n}convertAxisScale(e){return{type:e.getLog()&&this.chartInfo.ensureChart().getGrouping()===i.GROUPING.STANDARD?"log":"value",min:e.getMin(),max:e.getMax()}}convertAxis(e,t){return Object.assign({axisLine:{show:!1},axisTick:{show:!1},axisLabel:this.convertAxisLabel(e.ensureLabel(),t),splitLine:{lineStyle:this.convertAxisLine(e.ensureMajorGridLines(),t)}},this.convertAxisTitle(e.ensureTitle(),t))}convertAxisLine(e,t){return{color:e.getHidden()?"transparent":e.getColor()}}convertAxisTitle(e,t){return e&&e.getText()&&!e.getHidden()?{name:e.getText(),nameTextStyle:this.convertTextStyle(e.ensureTextStyle()),nameLocation:"center",nameGap:t?56:28}:{}}convertAxisLabel(e,t){return!e||e.getHidden()?{show:!1}:Object.assign({show:!0,rotate:e.getRotate(),margin:t?12:4},this.convertTextStyle(e.ensureTextStyle()))}convertLegend(){const e=super.convertLegend(),t=this.chartInfo.ensureChartLegend().getPosition();return"l"!==t&&"r"!==t||(e.top=this._plotBound.top),e}_convertSeries(e,t){const r=super._convertSeries(e,t);return e.getRightAxis()&&(r.yAxisIndex=1),r.label&&(r.label.formatter=t=>this._labelValueFormmater(t.value,e.getRightAxis()?"y2":"y1")),r}_labelValueFormmater(e,t){return this._dataFormatter(e,t)}}},75712:(e,t,r)=>{"use strict";r.d(t,{default:()=>s});var n=r(69145),i=r(72943),o=r(22373),a=r(28212);class s extends i.default{_convertSeries(e,t){const r=super._convertSeries(e,t);return e.getType(!0)===a.CHART_TYPE.BAR?n.default.fillSeriesOption(r,this.chartInfo,e,t):o.default.fillSeriesOption(r,this.chartInfo,e,t)}_convertLegendIcon(){const e=super._convertLegendIcon();return e.forEach(((e,t)=>{const r=this.chartInfo.ensureSeries(t);r.getType()===a.CHART_TYPE.LINE&&(e.icon=o.default.switchLegendIcon(r.ensureMarker().getSymbol()))})),e}_switchSeriesLabelPosition(e,t){return t.getType()===a.CHART_TYPE.BAR?n.default.prototype._switchSeriesLabelPosition.call(this,e,t):super._switchSeriesLabelPosition(e,t)}}},22373:(e,t,r)=>{"use strict";r.d(t,{default:()=>o});var n=r(37224),i=r(28212);class o extends n.default{_convertSeries(e,t){const r=super._convertSeries(e,t);return o.fillSeriesOption(r,this.chartInfo,e,t)}_convertLegendIcon(){const e=super._convertLegendIcon();return e.forEach(((e,t)=>{e.icon=o.switchLegendIcon(this.chartInfo.ensureSeries(t).ensureMarker().getSymbol())})),e}static fillSeriesOption(e,t,r,n){e.type="line";const a=r.ensureMarker();e.symbol=o.switchSeriesMarker(a.getSymbol()),e.symbolSize=a.getSize();const s=r.ensureLineStyle();let l=s.getType();switch(l){case"dot":l="dotted";break;case"dash":l="dashed";break;default:l="solid"}return e.lineStyle={type:l,width:s.getWidth()},r.getSmooth()&&(e.smooth=!0),t.ensurePlotArea().getBlankAs()===i.BLANK_AS.SPAN&&(e.connectNulls=!0),e}static switchSeriesMarker(e){let t;switch(e){case i.MARKER_SYMBOL.NONE:t="image://data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=";break;case i.MARKER_SYMBOL.DIAMOND:t="diamond";break;case i.MARKER_SYMBOL.TRIANGLE:t="triangle";break;case i.MARKER_SYMBOL.SQUARE:t="rect";break;default:t="circle"}return t}static switchLegendIcon(e){let t="line";switch(e){case i.MARKER_SYMBOL.CIRCLE:t="circle";break;case i.MARKER_SYMBOL.DIAMOND:t="diamond";break;case i.MARKER_SYMBOL.TRIANGLE:t="triangle";break;case i.MARKER_SYMBOL.SQUARE:t="rect"}return t}}},90662:(e,t,r)=>{"use strict";r.d(t,{default:()=>o});var n=r(59924),i=r(40147);class o extends n.default{constructor(e){super(e)}_processCategory(e){for(let t=0,r=(e=super._processCategory(e)).length;t({name:e,icon:"rect"})))}convertSeries(){return[this._convertSeries(this.chartInfo.ensurePieSeries(),this._data[0])]}_convertSeries(e,t){const r=this._containerWidth-this._plotBound.left-this._plotBound.right,n=this._containerHeight-this._plotBound.top-this._plotBound.bottom,o=Math.min(r,n)/2;return{type:"pie",data:t.data,emphasis:this._convertSeriesEmphasis(),selectedMode:!1,center:[this._plotBound.left+r/2,this._plotBound.top+n/2],radius:[e.getPieHoleSize()/100*o,o],itemStyle:{borderColor:(0,i.parseHexColor)(e.getPieBorderColor())},tooltip:{formatter:this._convertSeriesTooltipFormatter(e)},label:this._convertSeriesLabel(e.ensureLabel())}}_convertSeriesLabel(e){return Object.assign({show:e.getShowCat()||e.getShowVal()||e.getShowPercent(),formatter:t=>{const r=[];return e.getShowCat()&&r.push(this._getOriginName(t.name)),e.getShowVal()&&r.push(this._dataFormatter(t.value,"y1")),e.getShowPercent()&&r.push(r.length?`(${t.percent}%)`:`${t.percent}%`),r.join(" ")}},this.convertTextStyle(e.ensureTextStyle()))}_convertSeriesTooltipFormatter(){return e=>{let t="";const r=this._getOriginName(e.name);return r&&(t+=`${r}
`),t+=``,t+=`${this._tooltipValueFormatter(e.value,"y1")}`,t}}}},11489:(e,t,r)=>{"use strict";r.d(t,{default:()=>a});var n=r(72943),i=r(22373),o=r(40147);class a extends n.default{_processCategory(e){if(this._xHasNumber=!1,this.chartInfo.ensureXAxis().getTreatAsText())return super._processCategory(e);for(let t=0,r=e.length;tthis._xHasNumber?[this._category[t],e]:[t,e])));const n=e.ensureMarker();return r.symbol=i.default.switchSeriesMarker(n.getSymbol()),r.symbolSize=n.getSize(),r}_convertLegendIcon(){const e=super._convertLegendIcon();return e.forEach(((e,t)=>{const r=i.default.switchLegendIcon(this.chartInfo.ensureSeries(t).ensureMarker().getSymbol());e.icon="line"===r?"rect":r})),e}_tooltipValueFormatter(e,t){return Array.isArray(e)?`${this._dataFormatter(e[0],"x")},${this._dataFormatter(e[1],t)}`:this._dataFormatter(e,t)}_labelValueFormmater(e,t){const r=Array.isArray(e)?e[1]:e;return this._dataFormatter(r,t)}}},37224:(e,t,r)=>{"use strict";r.d(t,{default:()=>o});var n=r(72943),i=r(28212);class o extends n.default{constructor(e){super(e),this.stacked=this.chartInfo.ensureChart().getGrouping()===i.GROUPING.STACKED}_getNullValue(){return this.stacked?0:null}convertValueAxis(e,t,r){const n=super.convertValueAxis(e,t,r);return this.stacked&&n.scale&&(n.scale=!1),n}_convertSeries(e,t){const r=super._convertSeries(e,t);return this.stacked&&(r.stack=e.getRightAxis()?"s0":"s1"),r}}},28212:(e,t,r)=>{"use strict";r.r(t),r.d(t,{BLANK_AS:()=>d,CHART_TYPE:()=>o,DEFAULT:()=>n,DIRECTION:()=>i,GROUPING:()=>a,LABEL_POSITION:()=>c,LEGEND_POSITION:()=>u,LINE_DASH:()=>h,MARKER_SYMBOL:()=>l,ORIENTATION:()=>s});const n={TYPE:"bar",BAR_DIR:"col",GROUPING:"standard",DATA_DIR:"row",ORIENTATION:"minMax",MARKER_SYMBOL:"circle",LEGEND_POSITION:"r",LABEL_POSITION:"t",LINE_DASH:"solid",BLANK_AS:"gap",BACKGROUND:"#FFFFFF"},i={ROW:"row",COL:"col"},o={BAR:"bar",LINE:"line",AREA:"area",PIE:"pie",SCATTER:"scatter",HYBRID:"hybrid"},a={STANDARD:"standard",STACKED:"stacked",PERCENTAGE:"percentageStacked"},s={SEQUENCE:"minMax",REVERSE:"maxMin"},l={CIRCLE:"circle",DIAMOND:"diamond",TRIANGLE:"triangle",SQUARE:"square",NONE:"none"},u={TOP:"t",LEFT:"l",RIGHT:"r",BOTTOM:"b"},c={TOP:"t",LEFT:"l",RIGHT:"r",BOTTOM:"b",INSIDE_BASE:"inBase",INSIDE_END:"inEnd",INSIDE_CENTER:"inCenter"},h={SOLID:"solid",DASH:"dash",DOT:"dot"},d={ZERO:"zero",GAP:"gap",SPAN:"span"}},59084:(e,t,r)=>{"use strict";r.d(t,{Chart:()=>a.Chart,ChartInfo:()=>n.default,Enum:()=>i,Utils:()=>o});var n=r(94442),i=r(28212),o=r(40147),a=r(82477);r(25357),r(39381),r(84474),r(32241),r(95498),r(25254)},25357:(e,t,r)=>{"use strict";r.d(t,{Axis:()=>d,MajorGridLines:()=>h,Scaling:()=>c});var n=r(67894),i=r(40147),o=r(28212);const a=["min","max","orientation","logBase"],s=["hidden","color"],l=["title","label","scaling","majorGridLines"],u=["tickNumber","treatAsText"];class c extends n.ChartConfig{static get configName(){return"scaling"}static get configList(){return a}getMin(e){return this.getConfig("min",null,e)}setMin(e){return this.setConfig("min",(0,i.isNumber)(e)?e:null)}getMax(e){return this.getConfig("max",null,e)}setMax(e){return this.setConfig("max",(0,i.isNumber)(e)?e:null)}getOrientation(e){return this.getConfig("orientation",o.DEFAULT.ORIENTATION,e)}setOrientation(e){return this.setConfig("orientation",e)}getLogBase(e){return this.getConfig("logBase",null,e)}setLogBase(e){return this.setConfig("logBase",(0,i.isNumber)(e)?e:null)}getRevert(){return this.getOrientation()===o.ORIENTATION.REVERSE}setRevert(e){return this.setOrientation(e?o.ORIENTATION.REVERSE:o.ORIENTATION.SEQUENCE)}getLog(){return!!(0,i.isDefined)(this.getLogBase())}setLog(e){return this.setLogBase(e?10:null)}}class h extends n.ChartConfig{static get configName(){return"majorGridLines"}static get configList(){return s}getHidden(e){return this.getConfig("hidden",!1,e)}setHidden(e){return this.setConfig("hidden",!!e)}getColor(e){return this.getConfig("color","#CCCCCC",e)}setColor(e){return this.setConfig("color",e)}}class d extends n.ChartConfig{static get configName(){return"axis"}static get subConfigList(){return l}static get configList(){return u}getTitle(){return this.getSubConfig("title")}ensureTitle(e){return this.getTitle()||this.setSubConfig("title",[e,"axisTitle"])}getLabel(){return this.getSubConfig("label")}ensureLabel(e){return this.getLabel()||this.setSubConfig("label",[e])}getScaling(){return this.getSubConfig("scaling")}ensureScaling(e){return this.getScaling()||this.setSubConfig("scaling",[e])}getMajorGridLines(){return this.getSubConfig("majorGridLines")}ensureMajorGridLines(e){return this.getMajorGridLines()||this.setSubConfig("majorGridLines",[e])}getTickNumber(e){return this.getConfig("tickNumber",5,e)}setTickNumber(e){return this.setConfig("tickNumber",(0,i.isNumber)(e)?e:null)}getTreatAsText(e){return this.getConfig("treatAsText",!1,e)}setTreatAsText(e){return this.setConfig("treatAsText",!!e)}}},82477:(e,t,r)=>{"use strict";r.d(t,{Chart:()=>h,PlotArea:()=>c});var n=r(67894),i=r(40147),o=r(28212);const a=["xAxis","yAxis","yAxis2","series","layout"],s=["blankAs","useRowHeader","useColumnHeader","switchRowColumn"],l=["plotArea","title","subtitle","legend","textStyle"],u=["backgroundColor","chartType","barDir","grouping"];class c extends n.ChartConfig{static get configName(){return"plotArea"}static get subConfigList(){return a}static get configList(){return s}initSubConfig(e){super.initSubConfig(this.fixConfig(e))}fixConfig(e){const{nonNumericAsZero:t,zeroStart:r,xAxisTitle:n,yAxisTitle:a}=e;if(!((0,i.isDefined)(t)||r||n||a))return e;if(delete(e=this._cloneConfig(e)).nonNumericAsZero,delete e.zeroStart,delete e.xAxisTitle,delete e.yAxisTitle,!e.blankAs&&(0,i.isDefined)(t)&&(e.blankAs=t?o.BLANK_AS.ZERO:o.BLANK_AS.GAP),!e.xAxis&&(n||r)){const t=e.xAxis=Object.create(null);n&&(t.title=n),r&&(t.scaling={min:0})}if(!e.yAxis&&(a||r)){const t=e.yAxis=Object.create(null);a&&(t.title=a),r&&(t.scaling={min:0})}return!e.yAxis2&&r&&(e.yAxis2={scaling:{min:0}}),e}getXAxis(){return this.getSubConfig("xAxis")}ensureXAxis(e){return this.getXAxis()||this.setSubConfig("xAxis",this.createSubConfig("axis",[e]),!0)}getYAxis(){return this.getSubConfig("yAxis")}ensureYAxis(e){return this.getYAxis()||this.setSubConfig("yAxis",this.createSubConfig("axis",[e]),!0)}getYAxis2(){return this.getSubConfig("yAxis2")}ensureYAxis2(e){return this.getYAxis2()||this.setSubConfig("yAxis2",this.createSubConfig("axis",[e]),!0)}_getSeries(){return this.getSubConfig("series")}_ensureSeries(e){return this._getSeries()||this.setSubConfig("series",Array.isArray(e)?e.map(((e,t)=>this.createSubConfig("series",[e,t]))):[],!0)}getSeries(e){const t=this._getSeries();return t?(0,i.isNumber)(e)?t[e]:t:null}ensureSeries(e,t){const r=this._ensureSeries();return(0,i.isNumber)(e)?r[e]||(r[e]=this.createSubConfig("series",[t,e])):r}getSeriesCount(){return this.getChartInfo().getSeriesCount()}getLayout(){return this.getSubConfig("layout")}ensureLayout(e){return this.getLayout()||this.setSubConfig("layout",this.createSubConfig("layout",[e]),!0)}getBlankAs(e){return this.getConfig("blankAs",o.DEFAULT.BLANK_AS,e)}setBlankAs(e){return this.setConfig("blankAs",e)}getUseRowHeader(){return this.getConfig("useRowHeader",!0)}setUseRowHeader(e){return this.setConfig("useRowHeader",!!e)}getUseColumnHeader(){return this.getConfig("useColumnHeader",!0)}setUseColumnHeader(e){return this.setConfig("useColumnHeader",!!e)}getSwitchRowColumn(){return this.getConfig("switchRowColumn",!1)}setSwitchRowColumn(e){return this.setConfig("switchRowColumn",!!e)}}class h extends n.ChartConfig{static get configName(){return"chart"}static get subConfigList(){return l}static get configList(){return u}initSubConfig(e){super.initSubConfig(this.fixConfig(e))}fixConfig(e){let t=e.plotArea;if(!t||t.series)return e;const r=t.subCharts;if(!r||!r.length)return e;t=(e=this._cloneConfig(e)).plotArea=this._cloneConfig(t),delete t.subCharts;const n=t.series=[];for(let t=0,i=r.length;t1?"hybrid":r[0].type,e}getPlotArea(){return this.getSubConfig("plotArea")}ensurePlotArea(e){return this.getPlotArea()||this.setSubConfig("plotArea",[e])}getTitle(){return this.getSubConfig("title")}ensureTitle(e){return this.getTitle()||this.setSubConfig("title",[e,"title"])}getSubtitle(){return this.getSubConfig("subtitle")}ensureSubtitle(e){return this.getSubtitle()||this.setSubConfig("subtitle",this.createSubConfig("title",[e,"subtitle"]),!0)}getLegend(){return this.getSubConfig("legend")}ensureLegend(e){return this.getLegend()||this.setSubConfig("legend",[e])}getTextStyle(){return this.getSubConfig("textStyle")}ensureTextStyle(e){return this.getTextStyle()||this.setSubConfig("textStyle",[e,"global"])}getBackgroundColor(e){return this.getConfig("backgroundColor",o.DEFAULT.BACKGROUND,e)}setBackgroundColor(e){return this.setConfig("backgroundColor",e)}getChartType(e){return this.getConfig("chartType",o.DEFAULT.TYPE,e)}setChartType(e){return this.setConfig("chartType",e)}getBarDir(e){return this.getConfig("barDir",o.DEFAULT.BAR_DIR,e)}setBarDir(e){return this.setConfig("barDir",e)}getGrouping(e){return this.getConfig("grouping",o.DEFAULT.GROUPING,e)}setGrouping(e){return this.setConfig("grouping",e)}getType(e){return this.getChartType(e)}setType(e){return this.setChartType(e)}}function d(e,t){return e.index-t.index}},67894:(e,t,r)=>{"use strict";r.d(t,{ChartConfig:()=>a});var n=r(40147);const i=Object.prototype.hasOwnProperty;function o(e,t){const r=Math.max(e?e.length:0,t?t.length:0);for(let n=0;n{e[t]=!0})),t=this.subConfigList,t&&t.forEach((t=>{e[t]=!0})),e}initSubConfig(e){const t=this.constructor.subConfigList;if(t)for(let r=0,i=t.length;re&&e.build()))),l.length||(l=null)):l=s&&s.build(),(t&&i in t?l&&(u?o(l,t[i]):l===t[i]):!l)||(e||(e=this._cloneConfig(t)),l?e[i]=l:delete e[i])}return e&&(t=e),t&&!function(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}(t)&&(t=null),this.setRawConfig(t),t}compute(e){const t=Object.create(null);let r;if(r=this.constructor.subConfigList,r&&r.length)for(let i=0,o=r.length;i{"use strict";r.d(t,{Label:()=>s});var n=r(67894),i=r(28212);const o=["textStyle"],a=["hidden","position","rotate","showVal","showCat","showPercent"];class s extends n.ChartConfig{static get configName(){return"label"}static get subConfigList(){return o}static get configList(){return a}getTextStyle(){return this.getSubConfig("textStyle")}ensureTextStyle(e){return this.getTextStyle()||this.setSubConfig("textStyle",[e])}getHidden(e){return this.getConfig("hidden",!1,e)}setHidden(e){return this.setConfig("hidden",!!e)}getPosition(e){return this.getConfig("position",i.DEFAULT.LABEL_POSITION,e)}setPosition(e){return this.setConfig("position",e)}getRotate(e){return this.getConfig("rotate",0,e)}setRotate(e){return this.setConfig("rotate",e)}getShowVal(e){return this.getConfig("showVal",!1,e)}setShowVal(e){return this.setConfig("showVal",!!e)}getShowCat(e){return this.getConfig("showCat",!1,e)}setShowCat(e){return this.setConfig("showCat",!!e)}getShowPercent(e){return this.getConfig("showPercent",!1,e)}setShowPercent(e){return this.setConfig("showPercent",!!e)}}},6796:(e,t,r)=>{"use strict";r.d(t,{Layout:()=>o});var n=r(67894);const i=["enabled","top","left","right","bottom"];class o extends n.ChartConfig{static get configName(){return"layout"}static get configList(){return i}getEnabled(e){return this.getConfig("enabled",!1,e)}setEnabled(e){return this.setConfig("enabled",e)}getLeft(e){return this.getConfig("left",null,e)}setLeft(e){return this.setConfig("left",e)}getTop(e){return this.getConfig("top",null,e)}setTop(e){return this.setConfig("top",e)}getRight(e){return this.getConfig("right",null,e)}setRight(e){return this.setConfig("right",e)}getBottom(e){return this.getConfig("bottom",null,e)}setBottom(e){return this.setConfig("bottom",e)}}},84474:(e,t,r)=>{"use strict";r.d(t,{Legend:()=>s});var n=r(67894),i=r(28212);const o=["textStyle"],a=["hidden","position"];class s extends n.ChartConfig{static get configName(){return"legend"}static get subConfigList(){return o}static get configList(){return a}getTextStyle(){return this.getSubConfig("textStyle")}ensureTextStyle(e){return this.getTextStyle()||this.setSubConfig("textStyle",[e])}getHidden(e){return this.getConfig("hidden",!1,e)}setHidden(e){return this.setConfig("hidden",!!e)}getPosition(e){return this.getConfig("position",i.DEFAULT.LEGEND_POSITION,e)}setPosition(e){return this.setConfig("position",e)}}},39381:(e,t,r)=>{"use strict";r.d(t,{LineStyle:()=>h,Marker:()=>c,Series:()=>d});var n=r(67894),i=r(40147),o=r(28212);const a=["symbol","size"],s=["type","width"],l=["label","marker","lineStyle"],u=["type","color","axis2","smooth","opacity","holeSize","pieColors","pieBorderColor"];class c extends n.ChartConfig{constructor(e,t){!0===t?t=null:!1===t&&(t={symbol:o.MARKER_SYMBOL.NONE}),super(e,t)}static get configName(){return"marker"}static get configList(){return a}getSymbol(e){return this.getConfig("symbol",o.DEFAULT.MARKER_SYMBOL,e)}setSymbol(e){return this.setConfig("symbol",e)}getSize(e){return this.getConfig("size",5,e)}setSize(e){return this.setConfig("size",(0,i.isNumber)(e)?e:null)}}class h extends n.ChartConfig{static get configName(){return"lineStyle"}static get configList(){return s}getType(e){return this.getConfig("type",o.DEFAULT.LINE_DASH,e)}setType(e){return this.setConfig("type",e)}getWidth(e){return this.getConfig("width",2,e)}setWidth(e){return this.setConfig("width",(0,i.isNumber)(e)?e:null)}}class d extends n.ChartConfig{constructor(e,t,r){super(e,t),this.index=(0,i.isNumber)(r)?r:0}static get configName(){return"series"}static get subConfigList(){return l}static get configList(){return u}getDefaultType(){const e=this.getChartInfo().ensureChart().getType();return e===o.CHART_TYPE.HYBRID?o.CHART_TYPE.BAR:e}getDefaultColor(e){const t=this.getChartInfo().getSeriesThemeColors();return t[e%t.length]}compute(e){const t=super.compute(e);if(e){const e=this.getChartInfo();e.dataHasCat()&&(t.cat=e.getSourceSeriesCat()),e.dataHasTx()&&(t.tx=e.getSourceSeriesTx(this.index)),t.val=e.getSourceSeriesVal(this.index)}return t}getLabel(){return this.getSubConfig("label")}ensureLabel(e){return this.getLabel()||this.setSubConfig("label",[e])}getMarker(){return this.getSubConfig("marker")}ensureMarker(e){return this.getMarker()||this.setSubConfig("marker",[e])}getLineStyle(){return this.getSubConfig("lineStyle")}ensureLineStyle(e){return this.getLineStyle()||this.setSubConfig("lineStyle",[e])}getType(e){const t=this.getConfig("type",null,e);return e||t?t:this.getDefaultType()}setType(e){return this.setConfig("type",e)}getColor(e){const t=this.getConfig("color",null,e);return e||t?t:this.getDefaultColor(this.index)}setColor(e){return this.setConfig("color",e)}getAxis2(e){return this.getConfig("axis2",!1,e)}setAxis2(e){return this.setConfig("axis2",!!e)}getSmooth(e){return this.getConfig("smooth",!1,e)}setSmooth(e){return this.setConfig("smooth",!!e)}getOpacity(e){return this.getConfig("opacity",.2,e)}setOpacity(e){return this.setConfig("opacity",(0,i.isNumber)(e)?e:null)}getHoleSize(e){return this.getConfig("holeSize",0,e)}setHoleSize(e){return this.setConfig("holeSize",e)}getPieColors(e){return this.getConfig("pieColors",null,e)}setPieColors(e){return this.setConfig("pieColors",Array.isArray(e)?(0,i.trimArray)(e,!0):null)}getPieBorderColor(e){return this.getConfig("pieBorderColor","#FFFFFF00",e)}setPieBorderColor(e){return this.setConfig("pieBorderColor",e)}getRightAxis(e){return this.getAxis2(e)}setRightAxis(e){return this.setAxis2(e)}getLineSmooth(e){return this.getSmooth(e)}setLineSmooth(e){return this.setSmooth(e)}getAreaOpacity(e){return this.getOpacity(e)}setAreaOpacity(e){return this.setOpacity(e)}getPieHoleSize(e){return this.getHoleSize(e)}setPieHoleSize(e){return this.setHoleSize(e)}getPieColor(e,t){const r=this.getPieColors(t);return r&&Array.isArray(r)?(0,i.isNumber)(e)?r[e]||this.getDefaultColor(e):r:null}setPieColor(e,t){if((0,i.isNumber)(e)){let r=this.getPieColors();r=r?r.slice():[],r[e]=t,t=(0,i.trimArray)(r)}return this.setPieColors(t)}}},25254:(e,t,r)=>{"use strict";r.d(t,{TextStyle:()=>s});var n=r(67894),i=r(40147);const o={title:{fontSize:16,bold:!0},subtitle:{fontSize:13,color:"#7E8082"},axisTitle:{bold:!0},global:{fontFamily:"Arial",fontSize:12,italic:!1,bold:!1,color:"#000000"}},a=["fontFamily","fontSize","italic","bold","color"];class s extends n.ChartConfig{constructor(e,t,r){super(e,t),this.defaultStyle=o[r]}static get configName(){return"textStyle"}static get configList(){return a}getStyleConfig(e,t){const r=this.getConfig(e,null,t);if(t||(0,i.isDefined)(r))return r;const n=this.defaultStyle&&this.defaultStyle[e];return(0,i.isDefined)(n)?n:this.getChartInfo().ensureGlobalTextStyle()["get"+(0,i.capitalize)(e)]()}getFontFamily(e){return this.getStyleConfig("fontFamily",e)}setFontFamily(e){return this.setConfig("fontFamily",e)}getFontSize(e){return this.getStyleConfig("fontSize",e)}setFontSize(e){return this.setConfig("fontSize",e)}getItalic(e){return this.getStyleConfig("italic",e)}setItalic(e){return this.setConfig("italic",!!e)}getBold(e){return this.getStyleConfig("bold",e)}setBold(e){return this.setConfig("bold",!!e)}getColor(e){return this.getStyleConfig("color",e)}setColor(e){return this.setConfig("color",e)}}},95498:(e,t,r)=>{"use strict";r.d(t,{Title:()=>s});var n=r(67894),i=r(40147);const o=["textStyle"],a=["hidden","text"];class s extends n.ChartConfig{constructor(e,t,r){(0,i.isString)(t)&&(t={text:t}),super(e,t,r)}fillArgs(e,t,r){super.fillArgs(...arguments),this.styleKey=r}static get configName(){return"title"}static get subConfigList(){return o}static get configList(){return a}getTextStyle(){return this.getSubConfig("textStyle")}ensureTextStyle(e){return this.getTextStyle()||this.setSubConfig("textStyle",[e,this.styleKey])}getHidden(e){return this.getConfig("hidden",!1,e)}setHidden(e){return this.setConfig("hidden",!!e)}getText(e){return this.getConfig("text","",e)}setText(e){return this.setConfig("text",e)}}},40147:(e,t,r)=>{"use strict";function n(e){return null==e||""===e}function i(e){return null!=e}function o(e){return"[object Function]"===Object.prototype.toString.call(e)}function a(e){return"number"==typeof e&&isFinite(e)}function s(e){return"string"==typeof e}r.r(t),r.d(t,{PLOT_STYLE:()=>l,capitalize:()=>c,ensureString:()=>d,getFontHeight:()=>u,isDefined:()=>i,isEmpty:()=>n,isFunction:()=>o,isNumber:()=>a,isString:()=>s,parseHexColor:()=>f,trimArray:()=>h});const l={titleGap:8,legendWidth:72,padding:{top:32,bottom:32,left:16,right:16},plotGap:12,cm2pxMultiplier:72/2.54/.75};function u(e){return 1.4*e}function c(e){return e[0].toUpperCase()+e.slice(1)}function h(e,t){let r;for(;(r=e.length)&&null==e[r-1];)t&&(e=e.slice(),t=!1),e.pop();return e}function d(e){return i(e)?String(e):""}function f(e){return e.length<=7?e:`rgba(${parseInt(e.substr(1,2),16)},${parseInt(e.substr(3,2),16)},${parseInt(e.substr(5,2),16)},${Math.round(parseInt(e.substr(7,2),16)/255*100)/100})`}},1486:(e,t,r)=>{"use strict";r.d(t,{Comment:()=>s,Reply:()=>a});var n=r(29912),i=r(88868);class o{constructor(e){if(void 0===e.status)throw new Error("not given a status");this.id=e.id,"number"==typeof e.author?(this.author=e.author,this.authorName=e.authorName||""):(this.author=0,this.authorName=e.authorName||e.author||""),this.status=e.status,this.text=e.text||"",this.timestamp=e.timestamp||0,this.lastModified=e.lastModified||0}isOpened(){return this.status===n.STATUS_OPEN}isResolved(){return this.status===n.STATUS_RESOLVED}isAuthor(e){return 0===e||this.author===e}editText(e){if(!e.text)throw new Error("empty string is not allowed");return this.copy({text:e.text,lastModified:e.lastModified})}toJSON(){return{id:this.id,author:this.author,authorName:this.authorName||void 0,status:this.status,text:this.text,timestamp:this.timestamp,lastModified:this.lastModified}}static fromJSON(e){throw new Error("BaseComment is not constructable.")}}class a extends o{constructor(e){super(e)}isReopened(){return this.status===n.STATUS_REOPENED}copy(e){return new this.constructor(Object.assign(this.toObject(),e))}toObject(){return this.toJSON()}static fromJSON(e){return new this(e)}}class s extends o{constructor(e){super(e),this.type=e.type,this.replies=e.replies||[]}isDiscussion(){return this.type===n.TYPE_DISCUSSION}isSuggestion(){return this.type===n.TYPE_SUGGESTION}getReply(e){return this._ensureReplyIndexInBound(e),this.replies[e]}_ensureReplyIndexInBound(e){if(e<0||e>=this.replies.length)throw i.CommentError.ReplyNotFound(e,this.replies.length)}reply(e,t){const r=this.status===n.STATUS_RESOLVED?this.reopen(t):this;return r.copy({lastModified:t.lastModified,replies:r.replies.concat(e)})}resolve(e){return this._setStatus(e,n.STATUS_RESOLVED,n.STATUS_RESOLVED)}reopen(e){return this._setStatus(e,n.STATUS_OPEN,n.STATUS_REOPENED)}_setStatus(e,t,r){return this.status===t?this:this.copy({status:t,lastModified:e.lastModified,replies:this.replies.concat(this.constructor.createReply({id:e.id,author:e.author,status:r,text:"",timestamp:e.timestamp,lastModified:e.lastModified}))})}removeReply(e,t){this._ensureReplyIndexInBound(e);const r=this.replies.slice();return r.splice(e,1),this.copy({lastModified:t.lastModified,replies:r})}editReplyText(e,t){this._ensureReplyIndexInBound(e);const r=this.replies.slice();return r[e]=r[e].editText(t),this.copy({lastModified:t.lastModified,replies:r})}copy(e){return new this.constructor(Object.assign(this.toObject(),e))}toObject(){return Object.assign(super.toJSON(),{type:this.type,replies:this.replies.slice()})}toJSON(){return Object.assign(super.toJSON(),{type:this.type,replies:this.replies.map((e=>e.toJSON()))})}static fromJSON(e){return new this({...e,replies:(e.replies||[]).map(this.createReply,this)})}static createReply(e){return a.fromJSON(e)}}},88868:(e,t,r)=>{"use strict";r.d(t,{CommentError:()=>n});class n{static CommentNotFound(e){return new Error(`Comment id: "${e}" Not Found`)}static ReplyNotFound(e,t){return new Error(`Request #${e}, only ${t} replies`)}}},56768:(e,t,r)=>{"use strict";r.d(t,{CommentStore:()=>s});var n=r(1486),i=r(29912),o=r(88868),a=r(26729);class s extends a.EventEmitter{constructor(e){super(),this.comments=e||Object.create(null)}getCommentById(e,t){void 0===t&&(t=!1);const r=this.comments[e]||null;if(!r&&t)throw o.CommentError.CommentNotFound(e);return r}getBy(e,t){return this.getCommentById(e,t)}getCommentByIdWithThrow(e){const t=this.getCommentById(e);if(t)return t;throw o.CommentError.CommentNotFound(e)}getComments(){return this.comments}getAllCommentIds(){return Object.keys(this.comments)}getAllCommentValues(){return Object.values(this.comments)}getCommentCount(){return this.getAllCommentIds().length}forEach(e,t){const r=this.comments;for(const n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&e.call(t,r[n],n,r))break}copy(){return Object.assign(Object.create(Object.getPrototypeOf(this)),this,{comments:Object.assign({},this.comments)})}setCommentAndReturnCopy(e){if(!(e instanceof n.Comment))throw new Error("should pass a comment");const t=this.copy();return t.comments[e.id]=e,this.emit("commentChanged",[[e.id,e.toJSON()]]),t}createComment(e,t){if(this.getCommentById(t.id))throw new Error(`Comment id "${t.id}" already exists in store`);if(e!==t.author)throw new Error("Can only create comment by yourself");if(t.type===i.TYPE_DISCUSSION&&t.status!==i.STATUS_OPEN)throw new Error("Can only create open status discussion.");const r=this.constructor.createComment(t);return this.setCommentAndReturnCopy(r)}removeComment(e,t){if(!this.getCommentByIdWithThrow(t.target).isAuthor(e))throw new Error("Can only remove comment created by self");const r=this.copy();return delete r.comments[t.target],this.emit("commentChanged",[[t.target,null]]),r}reply(e,t){const r=this.getCommentByIdWithThrow(t.target),n=r.constructor.createReply(t);return this.setCommentAndReturnCopy(r.reply(n,t))}removeReply(e,t){const r=this.getCommentByIdWithThrow(t.target);if(!r.isOpened())throw new Error(`Unable to remove reply in a resolved comment \`${r.id}\`.`);const n=r.getReply(t.replyIndex);if(!n.isAuthor(e))throw new Error(`No permission to remove reply in reply \`${n.id}\` of comment \`${r.id}\` by uid ${e}.`);return this.setCommentAndReturnCopy(r.removeReply(t.replyIndex,t))}resolve(e,t){const r=this.getCommentByIdWithThrow(t.target);return this.setCommentAndReturnCopy(r.resolve(t))}reopen(e,t){const r=this.getCommentByIdWithThrow(t.target);return this.setCommentAndReturnCopy(r.reopen(t))}editCommentText(e,t){const r=this.getCommentByIdWithThrow(t.target);if(!r.isOpened())throw new Error(`Unable to edit comment text in a resolved comment \`${r.id}\`.`);if(!r.isAuthor(e))throw new Error(`No permission to edit comment text in comment \`${r.id}\` by uid ${e}.`);return this.setCommentAndReturnCopy(r.editText(t))}editReplyText(e,t){const r=this.getCommentByIdWithThrow(t.target);if(!r.isOpened())throw new Error(`Unable to edit reply text in a resolved comment \`${r.id}\`.`);const n=r.getReply(t.replyIndex);if(!n.isOpened())throw new Error(`Unable to edit reply text in a resolved/reopened reply \`${n.id}\` of comment \`${r.id}\`.`);if(!n.isAuthor(e))throw new Error(`No permission to edit reply text in reply \`${n.id}\` of comment \`${r.id}\` by uid ${e}.`);return this.setCommentAndReturnCopy(r.editReplyText(t.replyIndex,t))}toJSON(){return Object.keys(this.comments).map((e=>this.comments[e].toJSON()))}static fromJSON(e){return new this(this.createComments(e||[]))}static createComment(e){return n.Comment.fromJSON(e)}static createComments(e){return e.reduce(((e,t)=>{const r=this.createComment(t);return e[r.id]=r,e}),Object.create(null))}}},97181:()=>{},29912:(e,t,r)=>{"use strict";r.r(t),r.d(t,{STATUS_OPEN:()=>o,STATUS_REOPENED:()=>s,STATUS_RESOLVED:()=>a,TYPE_DISCUSSION:()=>n,TYPE_SUGGESTION:()=>i});const n=0,i=1,o=0,a=1,s=2},14633:(e,t,r)=>{"use strict";r.d(t,{Enum:()=>n});var n=r(29912),i=r(97181);r.o(i,"Comment")&&r.d(t,{Comment:function(){return i.Comment}}),r.o(i,"CommentStore")&&r.d(t,{CommentStore:function(){return i.CommentStore}}),r.o(i,"Reply")&&r.d(t,{Reply:function(){return i.Reply}}),r.o(i,"createModule")&&r.d(t,{createModule:function(){return i.createModule}});var o=r(1486);r.o(o,"Comment")&&r.d(t,{Comment:function(){return o.Comment}}),r.o(o,"CommentStore")&&r.d(t,{CommentStore:function(){return o.CommentStore}}),r.o(o,"Reply")&&r.d(t,{Reply:function(){return o.Reply}}),r.o(o,"createModule")&&r.d(t,{createModule:function(){return o.createModule}});var a=r(56768);r.o(a,"Comment")&&r.d(t,{Comment:function(){return a.Comment}}),r.o(a,"CommentStore")&&r.d(t,{CommentStore:function(){return a.CommentStore}}),r.o(a,"Reply")&&r.d(t,{Reply:function(){return a.Reply}}),r.o(a,"createModule")&&r.d(t,{createModule:function(){return a.createModule}});var s=r(88868);r.o(s,"Comment")&&r.d(t,{Comment:function(){return s.Comment}}),r.o(s,"CommentStore")&&r.d(t,{CommentStore:function(){return s.CommentStore}}),r.o(s,"Reply")&&r.d(t,{Reply:function(){return s.Reply}}),r.o(s,"createModule")&&r.d(t,{createModule:function(){return s.createModule}});var l=r(84896);r.o(l,"Comment")&&r.d(t,{Comment:function(){return l.Comment}}),r.o(l,"CommentStore")&&r.d(t,{CommentStore:function(){return l.CommentStore}}),r.o(l,"Reply")&&r.d(t,{Reply:function(){return l.Reply}}),r.o(l,"createModule")&&r.d(t,{createModule:function(){return l.createModule}})},84896:(e,t,r)=>{"use strict";r.d(t,{createModule:()=>l});var n=r(98697),i=r(60673);function o(e){return Object.assign({comments:[]},e)}function a(e){return Object.assign({getCommentById:e=>{let{comments:t}=e;return e=>t.find((t=>t.id===e))??null}},e)}function s(e){const t={flush(e,t){t.comments&&(e.comments=(0,n.default)(t.comments,["id"]))},updateByDelta(e,t){let{comments:r}=e;for(const[e,n]of t){const t=(0,i.default)(r,{id:e},"id"),o=r[t]?.id===e;n?r.splice(t,o?1:0,n):o&&r.splice(t,1)}}};return Object.assign(t,e)}function l(e){let{state:t,getters:r,mutations:n}=e;return{namespaced:!0,state:o(t),getters:a(r),mutations:s(n)}}},16928:(e,t,r)=>{"use strict";var n=r(56543);r.o(n,"capitalize")&&r.d(t,{capitalize:function(){return n.capitalize}});var i=r(27641);r.o(i,"capitalize")&&r.d(t,{capitalize:function(){return i.capitalize}});var o=r(63210);r.o(o,"capitalize")&&r.d(t,{capitalize:function(){return o.capitalize}});var a=r(2991);r.o(a,"capitalize")&&r.d(t,{capitalize:function(){return a.capitalize}});var s=r(54845);r.o(s,"capitalize")&&r.d(t,{capitalize:function(){return s.capitalize}});var l=r(19847);r.o(l,"capitalize")&&r.d(t,{capitalize:function(){return l.capitalize}});var u=r(99311);r.o(u,"capitalize")&&r.d(t,{capitalize:function(){return u.capitalize}});var c=r(55960);r.o(c,"capitalize")&&r.d(t,{capitalize:function(){return c.capitalize}});var h=r(21770);r.o(h,"capitalize")&&r.d(t,{capitalize:function(){return h.capitalize}});var d=r(89492);r.o(d,"capitalize")&&r.d(t,{capitalize:function(){return d.capitalize}})},19847:(e,t,r)=>{"use strict";function n(e){return e?e[0].toUpperCase()+e.slice(1):""}r.d(t,{capitalize:()=>n})},54845:(e,t,r)=>{},99311:(e,t,r)=>{},27641:(e,t,r)=>{},56543:(e,t,r)=>{},2991:(e,t,r)=>{},63210:(e,t,r)=>{},89492:(e,t,r)=>{},55960:(e,t,r)=>{},21770:(e,t,r)=>{},55241:(e,t,r)=>{"use strict";r.d(t,{isFirefox:()=>l,isSafari:()=>s});var n=r(28692);const i="undefined"==typeof navigator?null:(o=navigator.userAgent,(0,n.matchUserAgent)(o,[["opera",/opera/i],["chrome",/chrome/i],["safari",/safari/i],["firefox",/gecko\/\d/i]]));var o;function a(e){return i===e}function s(){return a("safari")}function l(){return a("firefox")}},28213:(e,t,r)=>{"use strict";var n=r(55241);r.o(n,"isFirefox")&&r.d(t,{isFirefox:function(){return n.isFirefox}}),r.o(n,"isSafari")&&r.d(t,{isSafari:function(){return n.isSafari}});var i=r(10853);r.o(i,"isFirefox")&&r.d(t,{isFirefox:function(){return i.isFirefox}}),r.o(i,"isSafari")&&r.d(t,{isSafari:function(){return i.isSafari}})},10853:(e,t,r)=>{"use strict";var n=r(28692);"undefined"==typeof navigator||(e=>{const t=[["ios",()=>/iPhone|iPad|iPod/i.test(navigator.platform)||/MacIntel/i.test(navigator.platform)&&navigator.maxTouchPoints>1],["android",/android/i],["windows",/windows|win32/i],["linux",/linux/i],["mac",/Mac_PowerPC|Macintosh/i]];(0,n.matchUserAgent)(e,t)})(navigator.userAgent)},28692:(e,t,r)=>{"use strict";function n(e,t){const r=t.find((t=>{let[r,n]=t;return n instanceof RegExp?n.test(e):"function"==typeof n&&n(e)}));return r?r[0]:null}r.d(t,{matchUserAgent:()=>n})},43733:(e,t,r)=>{"use strict";r.d(t,{SS:()=>n.default});var n=r(66798),i=r(33112),o=r(91022),a=r(50213),s=r(75392),l=r(71227),u=r(92159),c=r(82430),h=r(20094),d=r(78598),f=r(62033),g=r(3058),p=r(48062),m=r(92428),v=r(42370),y=r(92967),C=r(51184),x=r(28178);n.default.plugins=[i.default,o.default,a.default,s.default,l.default,u.default,c.default,h.default,d.default,f.default,g.default,p.default,m.default,v.default,y.default,C.default],Object.assign(n.default.MODEL,{Sheet:x.default})},21497:(e,t,r)=>{"use strict";r.d(t,{BaseAction:()=>N,default:()=>O});var n=r(73321),i=r(3521),o=r(9031),a=r(64145),s=r(84499),l=r(13574),u=r(55180),c=r(31641),h=r(87984),d=r(42443),f=r(54770),g=r(85031),p=r(4263),m=r(37873),v=r(58835),y=r(47796),C=r(16607),x=r(7996),w=r(15641),_=r(935),R=r(90783),S=r(96687),b=r(88059),I=r(2031),A=r(5501),T=r(65180),E=r(28178),M=r(15343),k=r(33506);class N{async execCompound(e,t){await this._recordSels((async()=>{const t=await e();t.length>0&&await this.execCommand(1===t.length?t[0]:A.createCompoundCommand(t))}),t)}async execCommand(e){const t=await this._getDataBridge().execCommand(e);t&&(n.default.getUndoRedo().done(t),t.needSync()&&i.default.getTransport().sendCommand(t))}async _recordSels(e,t){const r=(0,_.default)(n.default.getUndoRedo().doneActions);t=t||this._getUserSelections(),await e();const i=(0,_.default)(n.default.getUndoRedo().doneActions);r!==i&&i.setSelections(t)}_getUserSelections(){const e=n.default.getView();return e&&e.serializeSelections()}fail(e){return Promise.reject({message:e})}async done(e){return n.default.getUIBridge().onActionDone(e),!0}async _execValidator(e){const t=n.default.getUIBridge().getUserInfo();return await e(t)}async _iterativeCheck(e){const t=await this._execValidator(e);return this.protectionAlerts(t)}protectionAlerts(e){return(e=(0,u.makeArray)(e)).includes(C.VALIDATE_RESULT.REJECT)?n.default.getUIBridge().onAlert(a.default.PROTECTION_REJECT):e.includes(C.VALIDATE_RESULT.WARNING)?n.default.getUIBridge().onConfirm(a.default.PROTECTION_WARNING).catch((()=>!1)):Promise.resolve(!0)}async checkProtectedWorksheet(e,t){return await this._iterativeCheck((r=>this._getDataBridge().checkProtectedWorksheets([e],t,r)))}async checkProtectedWorksheets(e,t){return await this._iterativeCheck((r=>this._getDataBridge().checkProtectedWorksheets(e,t,r)))}async checkProtectedRanges(e,t){return this.protectionAlerts(await this._checkProtectedRangesResults(e,t))}async _checkProtectedChanges(e,t){return this.protectionAlerts(await this._checkProtectedChangesResults(e,t))}async _checkProtectedInsertable(e,t,r){return this.protectionAlerts(await this._checkProtectedInsertableResults(e,t,r))}async _checkProtectionResults(e,t){return await this._execValidator((r=>this._getDataBridge().checkProtection(e,t,r,{warning:!1})))}async _checkProtectRefRangeResults(e,t){return await this._execValidator((r=>this._getDataBridge().checkProtectRefRange(e,t,r)))}async _checkProtectedRangesResults(e,t){return e=(e=(0,u.makeArray)(e)).map((function(e){return e instanceof m.SynoCellRange&&(e=new p.default({sheetId:t},e.from,e.to,e.type)),e.toRange()})),await this._checkProtectRefRangeResults(e,t)}async _checkProtectedChangesResults(e,t){const r=e.map((e=>{let[t,r]=e;return{row:t,col:r}}));return await this._execValidator((e=>this._getDataBridge().checkProtectedCoords(t,r,e,{warning:!1})))}async _checkProtectedInsertableResults(e,t,r){return await this._execValidator((n=>this._getDataBridge().checkProtectedInsertable(e,t,r,n,{warning:!1})))}async isCellEditable(e,t,r){return!this._getWorkbook().isReadonly()&&C.VALIDATE_RESULT.REJECT!==await this._execValidator((n=>this._getDataBridge().checkProtectedCoords([{row:t,col:r}],e,n,{warning:!0})))}async setValues(e,t,r){const i=this._getUserSelections();return this._getWorkbook().hasSheet(e)&&await this._checkProtectedChanges(t,e)?(await this.execCompound((async()=>{const i=[];if(1===t.length&&!(0,s.isEmptyValue)(t[0][2])){const[r,n]=t[0];i.push(A.createExpandFilterRangeCommand(e,r,n))}i.push(A.createValueCommand(e,t,r));for(const[r,o,a]of t){const t=(await n.default.getDataBridge().getRangeHyperlink(e,{row:r,col:o},{row:r,col:o}))?.[0][0];t&&(0,s.isEmptyValue)(a)&&i.push(A.createRemoveInternalLinkCommand(e,t.id))}return i}),i),this.done()):this.fail()}async setStyleMeta(e,t,r,i,a){if(!this._getWorkbook().hasSheet(e)||!await this.checkProtectedRanges(t,e))return this.fail();t=t.map((e=>e.clone().normalize()));const{rowCount:s,colCount:l}=await n.default.getDataBridge().getSheetDimension(e);let u=s-1,c=0;for(const e of t)u=Math.min(u,e.from.row),c=Math.max(c,e.to.row);const h=new Array(u).fill(!1).concat(...await n.default.getDataBridge().getFilteredRows(e,u,c));return await this.execCompound((async()=>{const u={[i]:a},c=await(0,o.default)({cls:r,value:u,sheetId:e,rowCount:s,colCount:l,multiRange:t,skip:{filtered:h}});if("Font"!==r)return c;const f=[];for(const[r,i,o,a]of(0,d.unionRanges)(t.map((e=>e.toArray())))){const t=await n.default.getDataBridge().getRangeData(e,{row:r,col:i},{row:o,col:a}),s=await n.default.getDataBridge().getFilteredRows(e,r,o);for(let e=r;e<=o;e++)if(!s[e-r])for(let n=i;n<=a;n++){const o=t[e-r][n-i];if((0,v.isRichTextJSON)(o)){const t=T.default.fromJSON(o).setCellStyle(u);f.push([e,n,(0,v.normalizeRichtText)(t)])}}}return f.length>0&&c.push(A.createValueCommand(e,f,S.SourceType.Format)),c})),this.done()}async setDataAndFormat(e,t,r,i){if(!this._getWorkbook().hasSheet(e)||!await this.checkProtectedRanges(t,e))return this.fail();const{rowCount:a,colCount:s}=await n.default.getDataBridge().getSheetDimension(e);return await this.execCompound((async()=>{const n=await(0,o.default)({cls:"Format",value:i,sheetId:e,rowCount:a,colCount:s,multiRange:t});return 0await n.default.getDataBridge().getRangeCellByKey(e,t,r,["v","renderDesc"])),((e,t,n)=>{let{v:o,renderDesc:a}=n;if(null==o||(0,c.isFormula)(o))return;let s="string"==typeof o;(0,v.isRichTextJSON)(o)&&(o=new T.default(o.v).getText(),s=!0),"@"!==r||s?"@"!==r&&s&&i.push([e,t,o]):i.push([e,t,a.v])}),(async(t,r)=>await n.default.getDataBridge().getFilteredRows(e,t,r))),this.setDataAndFormat(e,t,i,r)}async fillDatetime(e,t,r,i){if(!this._getWorkbook().hasSheet(e))return this.fail();const o=[];return await(0,d.multiRangeEachCellAsync)(r,((e,t)=>new Array(t.row-e.row+1).fill([])),((e,r)=>{o.push([e,r,t])}),(async(t,r)=>await n.default.getDataBridge().getFilteredRows(e,t,r))),this.setDataAndFormat(e,r,o,i)}async clearFormat(e,t){if(!this._getWorkbook().hasSheet(e)||!await this.checkProtectedRanges(t,e))return this.fail();const r=[];await(0,d.multiRangeEachCellAsync)(t,(async(t,r)=>await n.default.getDataBridge().getRangeData(e,t,r)),((e,t,n)=>{(0,v.isRichTextJSON)(n)&&r.push([e,t,new T.default(n.v).getText()])}),(async(t,r)=>await n.default.getDataBridge().getFilteredRows(e,t,r)));const{rowCount:i,colCount:a}=await n.default.getDataBridge().getSheetDimension(e),s={value:null,sheetId:e,rowCount:i,colCount:a,multiRange:t,overwrite:!0};return await this.execCompound((async()=>{const t=await(0,o.default)((0,l.extend)(s,{cls:"Font"}));return t.push(...await(0,o.default)((0,l.extend)(s,{cls:"Fill"}))),t.push(...await(0,o.default)((0,l.extend)(s,{cls:"Alignment"}))),t.push(...await(0,o.default)((0,l.extend)(s,{cls:"Border"}))),r.length>0&&t.push(A.createValueCommand(e,r,S.SourceType.ClearFormat)),t})),this.done()}async setBorder(e,t,r,i){if(!this._getWorkbook().hasSheet(e)||0===t.length||!await this.checkProtectedRanges(t,e))return this.fail();const o=r.split("_")[0];if(["top","right","bottom","left","outer","horizontal","vertical","inner"].indexOf(o)<0)return this.fail();const a=[],{rowCount:s,colCount:l}=await n.default.getDataBridge().getSheetDimension(e);for(const r of t){const t=r.getTopLeftCorner(),u=r.getBottomRightCorner(),c={row:Math.max(t.row-1,0),col:Math.max(t.col-1,0)},h=await n.default.getDataBridge().getRangeComputedStyle(e,c,{row:u.row+1,col:u.col+1});a.push(...(0,w.getRangeBorderChanges)(s,l,r,o,i,((e,t)=>h[e-c.row][t-c.col].border.b)))}return await this._recordSels((async()=>{await this.execCommand(A.createStyleCommand(e,"Border",a,!0))})),this.done()}async setAllBorder(e,t,r){if(!this._getWorkbook().hasSheet(e)||0===t.length||!await this.checkProtectedRanges(t,e))return this.fail();const i=[],a=[],{rowCount:s,colCount:l}=await n.default.getDataBridge().getSheetDimension(e);for(const r of t)await this.isMerged(e,r)?i.push(r):a.push(r);const u=[];for(const t of i)u.push(...(0,w.getRangeBorderChanges)(s,l,t,"outer",r,await this._genBorderGetter(e,t)));return await this.execCompound((async()=>{const t=[];return u.length>0&&t.push(A.createStyleCommand(e,"Border",u,!0)),t.push(...await(0,o.default)({cls:"Border",value:[r,r,r,r],sheetId:e,rowCount:s,colCount:l,multiRange:a,overwrite:!0,skip:{cell:!0}},(async t=>{if(t.all.length>0)return[];const{rows:n,cols:i,normals:o}=t,a=[];for(let t=0;tawait(0,o.default)({cls:"Border",value:null,sheetId:e,rowCount:r,colCount:i,multiRange:t,overwrite:!0,skip:{cell:!0}},(async t=>{if(t.all.length>0)return[];const n=[],{rows:o,cols:a,normals:s}=t;for(let t=0;tt.includesRange(e)))?null:a.default.MERGE_PARTIAL}async mergeCells(e,t){if(!t)return this.fail();if(1===(t=t.clone().normalize()).getWidth()&&1===t.getHeight())return this.fail();if(!this._getWorkbook().hasSheet(e)||!await this.checkProtectedRanges(t,e))return this.fail();const r=await n.default.getDataBridge().checkMergeRangeError(e,t)??await this.checkMergeOverlapping(e,t);if(r)return this.fail(r);const{from:i,to:o}=t,u=[],c={font:[],fill:[],alignment:[],border:[]};let h=null;const d=await n.default.getDataBridge().getRangeData(e,i,o);for(let e=i.row;e<=o.row;e++)for(let t=i.col;t<=o.col;t++)(0,s.isEmptyValue)(d[e-i.row][t-i.col])||(h?u.push([e,t,null]):h={row:e,col:t});const f=h&&u.length>0;if(h||(h={row:i.row,col:i.col}),h.row!==i.row||h.col!==i.col){const e=d[h.row-i.row][h.col-i.col];u.push([h.row,h.col,null],[i.row,i.col,(0,v.isRichTextJSON)(e)?T.default.fromJSON(e):e])}const g=(await n.default.getDataBridge().getRangeValidId(e,h,h))[0][0],p=Math.max(i.row-1,0),m=Math.max(i.col-1,0),y=await n.default.getDataBridge().getRangeComputedStyle(e,{row:p,col:m},{row:o.row+1,col:o.col+1}),C=y[h.row-p][h.col-m],x=0===Object.keys(C.font).length?null:C.font,_=0===Object.keys(C.fill).length?null:C.fill,R=0===Object.keys(C.font).length?null:C.alignment;if(t.forAll(((e,t)=>{c.border.push([e,t,null]),h.row===e&&h.col===t||(c.font.push([e,t,x]),c.fill.push([e,t,_]),c.alignment.push([e,t,R]))})),f&&!await n.default.getUIBridge().onConfirm(a.default.CLEAR_MERGE_DATA))return this.fail();const{rowCount:b,colCount:I}=await n.default.getDataBridge().getSheetDimension(e);return await this.execCompound((()=>{const r=(0,l.extend)({data:u},c),n=[];n.push(A.createUnmergeOverlapsCommand(e,t));const i=S.SourceType.MergeCell;if(r.data&&0y[e-p][t-m].border.b));n.push(A.createStyleCommand(e,"Border",i,!0))}return n.push(A.createRemoveAllValidationCommand(e,t)),g&&n.push(A.createAddValidationRangeCommand(e,g,t)),n.push(A.createMergeCommand(e,!0,t)),n})),this.done()}async unmergeCells(e,t){return t&&this._getWorkbook().hasSheet(e)&&await this.checkProtectedRanges(t,e)?(await this.execCompound((()=>[A.createUnmergeOverlapsCommand(e,t)])),this.done()):this.fail()}async isMerged(e,t){if(!t||!this._getWorkbook().hasSheet(e))return!0;Array.isArray(t)&&(t=(0,s.createRange)(...t));const r=t.getTopLeftCorner();return(await n.default.getDataBridge().getMergedRange(e,r.row,r.col))?.isEqual(t)??!1}async fixRow(e,t){if("number"!=typeof t||t<0)return this.fail();if(!this._getWorkbook().hasSheet(e)||!await this.checkProtectedWorksheet(e))return this.fail();const r=n.default.getDataBridge(),{colCount:i}=await r.getSheetDimension(e);if(t>0){const n=new m.SynoCellRange(t,0,t,i-1);if((await r.getMergedOverlap(e,n)).some((e=>e.from.row=t)))return this.fail(a.default.FREEZE_MERGED)}return await this._recordSels((async()=>{await this.execCommand(A.createFixCommand(e,"row",t))})),this.done()}async fixCol(e,t){if("number"!=typeof t||t<0)return this.fail();if(!this._getWorkbook().hasSheet(e)||!await this.checkProtectedWorksheet(e))return this.fail();const r=n.default.getDataBridge(),{rowCount:i}=await r.getSheetDimension(e);if(t>0){const n=new m.SynoCellRange(0,t,i-1,t);if((await r.getMergedOverlap(e,n)).some((e=>e.from.col=t)))return this.fail(a.default.FREEZE_MERGED)}return await this._recordSels((async()=>{await this.execCommand(A.createFixCommand(e,"col",t))})),this.done()}async hideRows(e,t){if(!this._getWorkbook().hasSheet(e)||0===t.length||!await this.checkProtectedRanges(t,e))return this.fail();const r=await n.default.getDataBridge().getRowInfo(e),{rowCount:i}=await n.default.getDataBridge().getSheetDimension(e),o=(0,d.multiRangeCompactFilter)(t,"row",(e=>!r[e]?.hidden));return(0,E.containsAllVisibleRanges)(o,(e=>r[e]?.hidden??!1),i)?this.fail(a.default.HIDE_ALL_ROW):(await this.execCompound((()=>o.map((t=>A.createHiddenCommand(e,!0,"row",t.from,t.to))))),this.done())}async hideCols(e,t){if(!this._getWorkbook().hasSheet(e)||0===t.length||!await this.checkProtectedRanges(t,e))return this.fail();const r=await n.default.getDataBridge().getColInfo(e),{colCount:i}=await n.default.getDataBridge().getSheetDimension(e),o=(0,d.multiRangeCompact)(t,"col");return(0,E.containsAllVisibleRanges)(o,(e=>r[e]?.hidden??!1),i)?this.fail(a.default.HIDE_ALL_COL):(await this.execCompound((()=>o.map((t=>A.createHiddenCommand(e,!0,"col",t.from,t.to))))),this.done())}async showRows(e,t){if(!this._getWorkbook().hasSheet(e)||0===t.length||!await this.checkProtectedRanges(t,e))return this.fail();let r=t[0].from.row,i=0;for(const e of t)r=Math.min(e.getTopLeftCorner().row,r),i=Math.max(e.getBottomRightCorner().row,i);const o=await n.default.getDataBridge().getFilteredRows(e,r,i),a=(0,d.multiRangeCompactFilter)(t,"row",(e=>!o[e-r]));return await this.execCompound((()=>a.map((t=>A.createHiddenCommand(e,!1,"row",t.from,t.to))))),this.done()}async showCols(e,t){if(!this._getWorkbook().hasSheet(e)||0===t.length||!await this.checkProtectedRanges(t,e))return this.fail();const r=await n.default.getDataBridge().getColInfo(e),i=(0,d.multiRangeCompactFilter)(t,"col",(e=>r[e]?.hidden??!1));return await this.execCompound((()=>i.map((t=>A.createHiddenCommand(e,!1,"col",t.from,t.to))))),this.done()}async _getAutoFilterRange(e,t){return t&&(t=await n.default.getDataBridge().getAutoFilterRange(e,t)),t}async createFilter(e,t){if(!this._getWorkbook().hasSheet(e))return this.fail();t=await this._getAutoFilterRange(e,t);const r=await this._checkFilterRange(e,t);function n(){return{range:t}}return r?this.fail(r).then(n,n):await this.checkProtectedRanges(t,e)?(await this._recordSels((async()=>{const r=(0,c.randomString)();await this.execCommand(A.createCreateFilterCommand(e,r,t))})),this.done().then(n)):this.fail()}async _checkProtectedFilter(e,t){const r=await n.default.getDataBridge().getActiveFilterData(t);return!r||e!==r.id||this.checkProtectedRanges(r.range,t)}async disableFilter(e,t){if(!this._getWorkbook().hasSheet(e)||!await this._checkProtectedFilter(t,e))return this.fail();const r=await n.default.getDataBridge().getActiveFilterData(e);return await this.execCompound((()=>{const n=[];return t===r?.id?n.push(A.createEnableFilterCommand(e,t,!1,!1)):t===r?.activeId?(n.push(A.createSetActiveFilterViewCommand(e,null)),n.push(A.createEnableFilterCommand(e,t,!1,!0))):n.push(A.createEnableFilterCommand(e,t,!1,!0)),n})),this.done()}async setFilter(e,t,r,i){if(!this._getWorkbook().hasSheet(e)||!await this._checkProtectedFilter(t,e))return this.fail();const o=await n.default.getDataBridge().getActiveFilterData(e);return await this._recordSels((async()=>{t===o?.id?await this.execCommand(A.createSetFilterCommand(e,t,!1,r,i)):await this.execCommand(A.createSetFilterCommand(e,t,!0,r,i))})),this.done()}async createFilterView(e,t,r,n){if(!this._getWorkbook().hasSheet(e))return this.fail();r=await this._getAutoFilterRange(e,r);const i=await this._checkFilterRange(e,r);function o(){return{range:r}}return i?this.fail(i).then(o,o):(await this.execCompound((()=>[A.createCreateFilterViewCommand(e,t,r,n),A.createSetActiveFilterViewCommand(e,t)])),this.done().then(o))}async updateFilterViewName(e,t,r){return this._getWorkbook().hasSheet(e)&&r?(await this._recordSels((async()=>{await this.execCommand(A.createUpdateFilterViewNameCommand(e,t,r))})),this.done()):this.fail()}async updateFilterViewRange(e,t,r){if(!this._getWorkbook().hasSheet(e))return this.fail();const n=await this._checkFilterRange(e,r);return n?this.fail(n):(await this._recordSels((async()=>{await this.execCommand(A.createUpdateFilterRangeCommand(e,t,!0,r))})),this.done())}async setActiveFilterView(e,t){return this._getWorkbook().hasSheet(e)?(await this._recordSels((async()=>{await this.execCommand(A.createSetActiveFilterViewCommand(e,t))})),this.done()):this.fail()}async applyLink(e,t,r,i,o){if(!this._getWorkbook().hasSheet(e)||!(t>=0&&r>=0)||!await this._checkProtectedChanges([[t,r]],e))return this.fail();i||(i=o),(0,h.isEmail)(o)?o="mailto:"+o:0>o.indexOf("://")&&0!==o.indexOf("#tid=")&&0!==o.indexOf("#dlink=")&&(o="http://"+o);const a=(await n.default.getDataBridge().getRangeStyle(e,{row:t,col:r},{row:t,col:r}))[0][0];return await this.execCompound((async()=>{const s=S.SourceType.ApplyLink,l=[];a?.nf.fc&&l.push(A.createFormatCommand(e,[[t,r,null]],!0,s));const u=`=HYPERLINK("${o}", "${i}")`,c=(await n.default.getDataBridge().getRangeHyperlink(e,{row:t,col:r},{row:t,col:r}))?.[0][0];return c&&l.push(A.createRemoveInternalLinkCommand(e,c.id)),l.push(A.createValueCommand(e,[[t,r,u]],s)),l})),this.done()}async applyInternalLink(e,t,r,i,o){let{sheetId:a,range:s}=o;const l=this._getWorkbook();if(!this._getWorkbook().hasSheet(e)||!this._getWorkbook().hasSheet(a)||!await this._checkProtectedChanges([[t,r]],e))return this.fail();const u=`${(0,x.escapeSheetName)(l.getNameById(a))}!${s}`;return await this.execCompound((async()=>{const o=[];(await n.default.getDataBridge().getRangeStyle(e,{row:t,col:r},{row:t,col:r}))[0][0]?.nf.fc&&o.push(A.createFormatCommand(e,[[t,r,null]],!0)),o.push(A.createValueCommand(e,[[t,r,i]],S.SourceType.ApplyLink));const a=(await n.default.getDataBridge().getRangeHyperlink(e,{row:t,col:r},{row:t,col:r}))?.[0][0];if(a)a.location!==u&&o.push(A.createUpdateHyperlinkCommand(e,{id:a.id,display:i,location:u}));else{const n=(0,c.randomString)();o.push(A.createAddHyperlinkCommand(e,{id:n,row:t,col:r,display:i,location:u}))}return o})),this.done()}async removeLink(e,t){return this._getWorkbook().hasSheet(e)&&0!==t.length&&await this.checkProtectedRanges(t,e)?(await this.execCompound((async()=>{const r=[],i=[];return await(0,d.multiRangeEachCellAsync)(t,(async(t,r)=>await n.default.getDataBridge().getRangeCellByKey(e,t,r,["link","renderDesc"])),((t,n,o)=>{let{link:a,renderDesc:s}=o;s.t===M.CellDescType.LINK&&(i.push([t,n,s.v]),a&&r.push(A.createRemoveInternalLinkCommand(e,a.id)))}),(async(t,r)=>await n.default.getDataBridge().getFilteredRows(e,t,r))),0{n.push([e,t,r])})),await this._recordSels((async()=>{await this.execCommand(A.createNoteCommand(e,n))})),this.done()}async removeNote(e,t){if(!this._getWorkbook().hasSheet(e)||0===t.length||!await this.checkProtectedRanges(t,e))return this.fail();const r=[];return await(0,d.multiRangeEachCellAsync)(t,((e,t)=>new Array(t.row-e.row+1).fill([])),((e,t)=>{r.push([e,t,""])}),(async(t,r)=>await n.default.getDataBridge().getFilteredRows(e,t,r))),await this._recordSels((async()=>{await this.execCommand(A.createNoteCommand(e,r))})),this.done()}async sort(e,t,r,i,o){if(!this._getWorkbook().hasSheet(e)||!t||!await this.checkProtectedRanges(t,e))return this.fail();if(await n.default.getDataBridge().checkMergeOverlay(e,t,o||!0))return this.fail(a.default.SORT_MERGED);const s=await n.default.getDataBridge().getRowOrder(e,t,r,i);return s?(await this._recordSels((async()=>{const{rowOrder:t,range:r}=s;t.length>0&&await this.execCommand(A.createSortCommand(e,t,r))})),this.done()):this.fail()}_getNormalizedDataRange(e,t){const r=this._getWorkbook().getCurrentSheet().getMergePlugin(),n=e.clone().normalize();if(t){const e=n.clone();if(e.to.row=e.from.row,r.expandSelection(e),n.from.row=e.normalize().to.row+1,n.from.row>n.to.row)return null}return n}_getAlignedCellSize(e){const t=this._getWorkbook().getCurrentSheet().getMergePlugin(),[r,n,i,o]=e.toArray();let a=1,s=1;const l=t.getOverlap(e);if(l.length>0){a=l[0].getWidth(),s=l[0].getHeight();for(let e=r;e<=i;e+=s)for(let r=n;r<=o;r+=a){const n=new m.SynoCellRange(e,r,e,r),i=t.expandSelection(n);if(i.getHeight()!==s||i.getWidth()!==a)return null}}return[s,a]}getRemoveDuplicatesRanges(){const e=this._getView().selections.multiSelections.getMultiRange();if(e.length>1)return void this.fail(a.default.REMOVE_DUP_MULTI_RANGE);if(e.length<1)return void this.fail(a.default.REMOVE_DUP_NO_DATA);const t=e[0].clone().normalize(),[r,n]=this._getAlignedCellSize(t)||[];if(void 0===r)return void this.fail(a.default.REMOVE_DUP_NOT_ALIGNED);const i=this._getWorkbook().getCurrentSheet(),o=t.getHeight()/r==1,s=t.getWidth()/n==1,l=i.isEmptyRange(t);if(o||l){const e=m.SynoCellRange.fromArray(i.getNonEmptyNeighborRange(t.toArray()));return e.isEqual(t)?void this.fail(l?a.default.REMOVE_DUP_NO_DATA:a.default.REMOVE_DUP_ONE_ROW):(this._getView().selectCell(...e.toArray(),!1),this.getRemoveDuplicatesRanges())}if(s&&!l){const e=m.SynoCellRange.fromArray(i.getNonEmptyNeighborRange(t.toArray()));if(!e.isEqual(t))return{range:t,suggestRange:e}}return{range:t}}getRemoveDuplicatesResult(e,t,r){void 0===r&&(r=!1);const n=this._getNormalizedDataRange(e,r),[i,o]=this._getAlignedCellSize(n)||[];if(void 0===i)return{error:{message:a.default.REMOVE_DUP_NOT_ALIGNED}};const s=this._getWorkbook().getCurrentSheet().getRangeTexts(n,{rowStep:i,colStep:o});o>1&&(t=t.filter(((e,t)=>t%o==0)));const l=(0,I.findNonDuplicatedRowIndices)(s,t),u=l.length,c=s.length-u,h=s.map((e=>e.some((e=>e)))).lastIndexOf(!0),d=-1===h?s.length:h+1,f=l.filter((e=>e0?m.SynoCellRange.fromArray([p+l*d,v,y,C]):null,w=[],_=new Set(o.listRows());return s.forEach(((e,t)=>{const r=p+e*d,n=p+t*d,i=m.SynoCellRange.fromArray([r,v,r+d-1,C]),o=m.SynoCellRange.fromArray([n,v,n+d-1,C]);i.listRows().forEach((e=>_.delete(e))),e!==t&&w.push([i,o])})),Array.from(_).some((e=>f.isHiddenRow(e)))&&!await n.default.getUIBridge().onConfirm(a.default.REMOVE_DUP_HIDDEN_ROW).catch((()=>!1))?this.fail():(await this.execCompound((()=>{const e=[],t=f.sheetId;for(const[r,n]of w)e.push(A.createMoveRangeCommand(t,r,n,!1));return x&&e.push(A.createClearRangeRelatedCommand(t,x,!1,void 0),A.createClearRangeDataCommand(t,x,void 0)),e})),n.default.getUIBridge().onMessage(a.default.REMOVE_DUP_DONE,[(c-h)*d,h*d]),this.done())}async createValidation(e,t,r){if(!this._getWorkbook().hasSheet(e)||!await this.checkProtectedRanges(r,e))return this.fail();const i=this._getWorkbook().getNameById(e),o=await n.default.getDataBridge().checkExistValidation(e,t,[r]),a=r.getTopLeftCorner(),s=r.getBottomRightCorner();let l=!0;if(o&&(l=!(await n.default.getDataBridge().getRangeValidId(e,a,s)).every((e=>e.every((e=>e===o))))),!l)return this.fail();const u=new p.default({sheetId:e,shName:i},a,s,r.type).toLabel();return await this.execCompound((()=>[A.createRemoveAllValidationCommand(e,r),A.createCreateValidationCommand(e,t,u)])),this.done()}async removeValidation(e,t){return this._getWorkbook().hasSheet(e)&&await this.checkProtectedRanges(t,e)?(await this.execCompound((()=>t.map((t=>t?A.createRemoveAllValidationCommand(e,t):null)).filter(f.isNonNull))),this.done()):this.fail()}async insertImage(e,t,r){return this._getWorkbook().hasSheet(e)&&await this.checkProtectedWorksheet(e)?(await this.execCommand(A.createInsertImageCommand(e,t,r)),this.done()):this.fail()}async resizeImage(e,t,r){return this._getWorkbook().hasSheet(e)&&await this.checkProtectedWorksheet(e)?(await this.execCommand(A.createResizeImageCommand(e,t,r)),this.done()):this.fail()}async removeImage(e,t){return this._getWorkbook().hasSheet(e)&&await this.checkProtectedWorksheet(e)?(await this.execCommand(A.createRemoveImageCommand(e,t)),this.done()):this.fail()}async replaceImage(e,t,r,n){return this._getWorkbook().hasSheet(e)&&await this.checkProtectedWorksheet(e)?(await this.execCompound((()=>[A.createRemoveImageCommand(e,t),A.createInsertImageCommand(e,r,n)])),this.done()):this.fail()}async addCf(e,t){t.id||(t.id=(0,c.randomString)());const r=this._getWorkbook();if(!r.hasSheet(e))return this.fail();const n=(0,y.parseCfConfig)(t,r,e),i=n.ranges.map((t=>p.default.createByWorkbook(t,r,e)));return await this.checkProtectedRanges(i,e)?(await this._recordSels((async()=>{await this.execCommand(A.createCreateCfCommand(e,n))})),this.done()):this.fail()}async updateCf(e,t,r){const i=this._getWorkbook();if(!i.hasSheet(e))return this.fail();const o=(0,y.parseCfConfig)(r,i,e),a=o.ranges.map((t=>p.default.createByWorkbook(t,i,e)));if(!await this.checkProtectedRanges(a,e))return this.fail();let s=await n.default.getDataBridge().getCfIndexById(e,t);return await this.execCompound((()=>{const r=[];return s>-1?(r.push(A.createRemoveCfCommand(e,t)),o.cfId=t):(o.cfId=(0,c.randomString)(),s=void 0),r.push(A.createCreateCfCommand(e,o,s)),r})),this.done()}async updateCfRanges(e,t,r){const i=this._getWorkbook(),o=await n.default.getDataBridge().getCfJSONById(e,t);return o&&await this.checkProtectedRanges([...o.ranges.map((t=>p.default.createByWorkbook(t,i,e))),...r.map((t=>p.default.createByWorkbook(t,i,e)))],e)?(await this.execCommand(A.createUpdateCfRangesCommand(e,t,r)),this.done()):this.fail()}async reorderCf(e,t,r){const i=this._getWorkbook(),o=await n.default.getDataBridge().getCfJSONById(e,t);return o&&await this.checkProtectedRanges(o.ranges.map((t=>p.default.createByWorkbook(t,i,e))),e)?(await this.execCompound((()=>o?[A.createRemoveCfCommand(e,t),A.createCreateCfCommand(e,o,r)]:[])),this.done()):this.fail()}async removeCf(e,t){const r=this._getWorkbook(),i=await n.default.getDataBridge().getCfJSONById(e,t);return i&&await this.checkProtectedRanges(i.ranges.map((t=>p.default.createByWorkbook(t,r,e))),e)?(await this._recordSels((async()=>{await this.execCommand(A.createRemoveCfCommand(e,t))})),this.done()):this.fail()}async insertChart(e,t,r,n){return this._getWorkbook().hasSheet(e)&&await this.checkProtectedWorksheet(e)?(await this.execCommand(A.createInsertChartCommand(e,t,r,n)),this.done()):this.fail()}async resizeChart(e,t,r){return this._getWorkbook().hasSheet(e)&&await this.checkProtectedWorksheet(e)?(await this.execCommand(A.createResizeChartCommand(e,t,r)),this.done()):this.fail()}async adjustChart(e,t,r){return this._getWorkbook().hasSheet(e)&&await this.checkProtectedWorksheet(e)?(await this.execCommand(A.createAdjustChartCommand(e,t,r)),this.done()):this.fail()}async setChartConfig(e,t,r,n){return this._getWorkbook().hasSheet(e)&&await this.checkProtectedWorksheet(e)?(await this.execCommand(A.createSetChartConfigCommand(e,t,r,n)),this.done()):this.fail()}async removeChart(e,t){return this._getWorkbook().hasSheet(e)&&await this.checkProtectedWorksheet(e)?(await this.execCommand(A.createRemoveChartCommand(e,t)),this.done()):this.fail()}async convertChartToImage(e,t,r){const i=await n.default.getDataBridge().getChartPosition(e,t);return i&&await this.checkProtectedWorksheet(e)?(await this.execCompound((()=>[A.createRemoveChartCommand(e,t),A.createInsertImageCommand(e,r,i)])),this.done()):this.fail()}async replaceAll(e){const t=e.searchNextSheet?this._getWorkbook().getVisibleOrder():[this._getWorkbook().getCurrentSheet().sheetId];try{const r=await n.default.getDataBridge().getReplaceAllChanges(t,e),i=[];for(const[e,t]of r)i.push(await this._checkProtectedChangesResults(t,e));return await this.protectionAlerts(i)?(await this.execCompound((()=>r.map((e=>{let[t,r]=e;return A.createValueCommand(t,r,S.SourceType.Edit)})))),this.done()):this.fail()}catch(e){return this.fail()}}async resizeRows(e,t,r){if(!this._getWorkbook().hasSheet(e)||!await this.checkProtectedRanges(t,e))return this.fail();const i=await n.default.getDataBridge().getRowInfo(e),o=(0,d.multiRangeCompact)(t,"row"),a=this._createResizeChanges((e=>i[e]?.h??null),o,r);return await this.execCompound((()=>a.map((t=>{let{from:r,to:n,size:i}=t;return A.createResizeCommand(e,"row",r,n,i)})))),this.done()}async resizeCols(e,t,r){if(!this._getWorkbook().hasSheet(e)||!await this.checkProtectedRanges(t,e))return this.fail();const i=await n.default.getDataBridge().getColInfo(e),o=(0,d.multiRangeCompact)(t,"col"),a=this._createResizeChanges((e=>i[e]?.w??null),o,r);return await this.execCompound((()=>a.map((t=>{let{from:r,to:n,size:i}=t;return A.createResizeCommand(e,"col",r,n,i)})))),this.done()}_createResizeChanges(e,t,r){const n=[];return t.forEach(((t,i)=>{const o=Array.isArray(r)?r[i]:new Array(t.to-t.from+1).fill(r);let a;for(let r=t.from;r<=t.to;r++){const i=o[r-t.from];e(r)!==i&&(a&&r===a.to+1?(a.to++,a.size.push(i)):(a={from:r,to:r,size:[i]},n.push(a)))}})),n}async applyInsertRowCol(e,t,r,n,i){const o="insert_row"===t?"row":"col",s=this._getWorkbook();return this._getWorkbook().hasSheet(e)?n>("row"===o?s.getAvailableRowCount(e):s.getAvailableColCount(e))?this.fail(a.default.EXCEED_CELL_QUOTA):await this._checkProtectedInsertable(e,o,r)?(await this.execCompound((()=>[A.createModifyDrawingsByInsertCommand(e,o,r,n),A.createInsertRowColCommand(e,o,r,n,i)])),this.done({resetCopySelection:!1})):this.fail():this.fail()}async removeRowColByRanges(e,t,r){if(0===r.length)return this.fail();if(!this._getWorkbook().hasSheet(e)||!await this.checkProtectedRanges(r,e))return this.fail();let i;const o="remove_row"===t;if(o){const t=await n.default.getDataBridge().getRowInfo(e),{rowCount:o}=await n.default.getDataBridge().getSheetDimension(e),s=await n.default.getDataBridge().getFilteredRows(e,0,o-1);if(i=(0,d.multiRangeCompactFilter)(r,"row",(e=>!s[e])),(0,E.containsAllVisibleRanges)(i,(e=>t[e]?.hidden??!1),o))return this.fail(a.default.REMOVE_ALL_ROW)}else{const t=await n.default.getDataBridge().getColInfo(e),{colCount:o}=await n.default.getDataBridge().getSheetDimension(e);if(i=(0,d.multiRangeCompact)(r,"col"),(0,E.containsAllVisibleRanges)(i,(e=>t[e]?.hidden??!1),o))return this.fail(a.default.REMOVE_ALL_COL)}const s=o?"row":"col";return await this.execCompound((()=>{const t=[];for(let r=i.length-1;r>=0;r--){const{from:n,to:o}=i[r],a=o-n+1;t.push(A.createModifyDrawingsByRemoveCommand(e,s,n,a),A.createRemoveRowColCommand(e,s,n,a))}return t})),this.done({resetCopySelection:!1})}async createDefinedName(e,t,r){return await this._recordSels((async()=>{await this.execCommand(A.createCreateDefineCommand(e,t,r))})),this.done()}async removeDefinedName(e,t){return await this._recordSels((async()=>{await this.execCommand(A.createRemoveDefineCommand(e,t))})),this.done()}async modifyDefinedName(e,t,r){return await this._recordSels((async()=>{await this.execCommand(A.createModifyDefineCommand(e,t,r))})),this.done()}async _checkRuleCommand(e){return await this._iterativeCheck((t=>this._getDataBridge().validateRuleCommand(e,t)))}async createRule(e){e.ruleId=(0,c.randomString)();const t=A.createCreateRuleCommand(e);return await this._checkRuleCommand(t)?(await this._recordSels((async()=>{await this.execCommand(t)})),this.done()):this.fail()}async updateRule(e,t){const r=A.createUpdateRuleCommand(e,t);return await this._checkRuleCommand(r)?(await this._recordSels((async()=>{await this.execCommand(A.createUpdateRuleCommand(e,t))})),this.done()):this.fail()}async deleteRule(e){const t=A.createRemoveRuleCommand(e);return await this._getDataBridge().validateRuleCommand(t,n.default.getUIBridge().getUserInfo())===C.VALIDATE_RESULT.NOTHING&&await n.default.getUIBridge().onConfirm(a.default.PROTECTION_DELETE)?(await this._recordSels((async()=>{await this.execCommand(t)})),this.done()):this.fail()}async moveRow(e,t,r,i,o){if(!this._getWorkbook().hasSheet(e))return this.fail();const a=await n.default.getDataBridge().checkMoveEnable(e,"row",t,r,i,o);if(a)return this.fail(a);const s=new m.SynoCellRange(t,-1,t+r-1,-1,m.RangeType.row),l=t+r+i;return await this.protectionAlerts([await this._checkProtectedRangesResults(s,e),await this._checkProtectedInsertableResults(e,"row",l)])?(await this.execCompound((()=>[A.createModifyDrawingsByMoveCommand(e,"row",t,r,i,o),A.createMoveCommand(e,"row",t,r,i,o)])),this.done()):this.fail()}async moveCol(e,t,r,i,o){if(!this._getWorkbook().hasSheet(e))return this.fail();const a=await n.default.getDataBridge().checkMoveEnable(e,"col",t,r,i,o);if(a)return this.fail(a);const s=new m.SynoCellRange(-1,t,-1,t+r-1,m.RangeType.col),l=t+r+i;return await this.protectionAlerts([await this._checkProtectedRangesResults(s,e),await this._checkProtectedInsertableResults(e,"col",l)])?(await this.execCompound((()=>[A.createModifyDrawingsByMoveCommand(e,"col",t,r,i,o),A.createMoveCommand(e,"col",t,r,i,o)])),this.done()):this.fail()}async moveRange(e,t,r,i){const o=this._getWorkbook();if(!this._getWorkbook().hasSheet(e)||!this._getWorkbook().hasSheet(r))return this.fail();const l=[await this._checkProtectedRangesResults(t,e),await this._checkProtectedRangesResults(i,r)];if(!await this.protectionAlerts(l))return this.fail();if(!o.isDimensionAvailable(r,i.to.row+1,i.to.col+1))return this.fail(a.default.EXCEED_CELL_QUOTA);const u=await n.default.getDataBridge().getAutofillObject(e,t.getTopLeftCorner(),t.getBottomRightCorner(),k.getAutofillDataKeys,"down",!1,S.SourceType.Cut),{mergedBorders:c,mergeRangeChanges:h}=await n.default.getDataBridge().getMergedCellFormatChanges(r,i,u),f=await this.checkMergeRangesError(r,h?.map((e=>{let[t]=e;return(0,s.createRange)(...t)})));if(f)return this.fail(f);u.mergedBorders=c,u.mergeRanges=h;let g=[t];return e===r&&({newRanges:g}=(0,d.removePartialRange)(g,i)),await this.execCompound((()=>[A.createClearRangeRelatedCommand(e,t),...g.map((t=>A.createClearRangeDataCommand(e,t))),A.createPasteAutofillDataCommand(r,i,u,!1,S.SourceType.Cut),A.createMoveFormlaRangeCommand(e,t,r,i)]),{ranges:[i.toArray()],activeIndex:0}),this.done()}async pasteRange(e,t,r){const i=this._getWorkbook();if(!this._getWorkbook().hasSheet(e)||!await this.checkProtectedRanges(t,e))return this.fail();if(!i.isDimensionAvailable(e,t.to.row+1,t.to.col+1))return this.fail(a.default.EXCEED_CELL_QUOTA);const{mergedBorders:o,mergeRangeChanges:l}=await n.default.getDataBridge().getMergedCellFormatChanges(e,t,r),u=await this.checkMergeRangesError(e,l?.map((e=>{let[t]=e;return(0,s.createRange)(...t)})));return u?this.fail(u):(r.mergedBorders=o,r.mergeRanges=l,await this.execCompound((()=>[A.createPasteAutofillDataCommand(e,t,r)]),{ranges:[t.toArray()],activeIndex:0}),this.done({resetCopySelection:!1}))}async insertCells(e,t,r){const i=this._getWorkbook();if(!this._getWorkbook().hasSheet(e)||!t)return this.fail();const{rowCount:o,colCount:s}=await n.default.getDataBridge().getSheetDimension(e);t=t.clone().normalize();const l="right"===r?"col":"row",u="col"===l?s:o,c="col"===l?t.getWidth():t.getHeight(),h=t.clone();h.to[l]=u-1;const d=h.clone().shift(l,c),f=h.clone();if(f.to[l]=f.from[l],!await this.checkProtectedRanges(h,e))return this.fail();const g=n.default.getDataBridge();if(await g.checkIncompleteMergedCells(e,h))return this.fail(a.default.MOVE_MERGE_CELL);if(!i.isDimensionAvailable(e,d.to.row+1,d.to.col+1))return this.fail(a.default.EXCEED_CELL_QUOTA);const p=await n.default.getDataBridge().getAutofillObject(e,f.from,f.to,k.getAutofillFormatKeys,"down",!1);return await this.execCompound((()=>[A.createMoveRangeCommand(e,h,d),A.createPasteAutofillDataCommand(e,t,p,!1)])),this.done()}async removeCells(e,t,r){if(!this._getWorkbook().hasSheet(e)||!t)return this.fail();const{rowCount:i,colCount:o}=await n.default.getDataBridge().getSheetDimension(e),s="left"===r?"col":"row",l="col"===s?o:i,u="col"===s?t.getWidth():t.getHeight(),c=t.clone().normalize(),h=c.clone(),d=c.clone(),f=c.to[s]f?[A.createMoveRangeCommand(e,h,d)]:[A.createClearRangeRelatedCommand(e,c,!0,void 0),A.createClearRangeDataCommand(e,c,void 0)])),this.done())}async _checkFilterRange(e,t){let r;if(!t||t.isSingle())r=a.default.FILTER_AT_LEAST_TWO;else{const i=await n.default.getDataBridge().getMergedOverlap(e,t);for(let e=0;e1?r=a.default.FILTER_VERT_MERGED:t.from.row===n.from.row&&(r=a.default.MERGE_CROSS_FILTER)}}return r}async autofill(e,t,r,i,o){const a=new m.SynoCellRange(t.row,t.col,r.row,r.col);if(!this._getWorkbook().hasSheet(e)||!await this.checkProtectedRanges(a,e))return this.fail();if(!(t&&t.row>-1&&t.col>-1))return this.fail();const l=await n.default.getDataBridge().getAutofillObject(e,i.getTopLeftCorner(),i.getBottomRightCorner(),["data","format","validation","cf"],o,!0);l.mergeRanges=(await n.default.getDataBridge().getMergedCellFormatChanges(e,a,l))?.mergeRangeChanges;for(const[t]of l.mergeRanges){const r=(0,s.createRange)(...t),i=await n.default.getDataBridge().checkMergeRangeError(e,r)??await this.checkMergeOverlapping(e,r);if(i)return this.fail(i)}return await this.execCompound((()=>[A.createAutofillDataCommand(e,new m.SynoCellRange(t.row,t.col,r.row,r.col),l,o,S.SourceType.Autofill)])),this.done()}async splitTextOfRange(e,t){if(1!==e?.getWidth())return this.fail();e=e.clone().normalize();const r=this._getWorkbook().getCurrentSheet();if(!r)return this.fail();const i=r.sheetId,o=(await n.default.getDataBridge().getRangeRenderedTexts(i,e.from,e.to)).map((e=>e[0]));if(0===o.length)return this.fail();const a=o.map((e=>(0,b.splitTextByDelimiter)(e,t))),s=(0,R.default)(a.map((e=>e.length)));a.forEach((e=>{e.length=s}));const l=new m.SynoCellRange(e.from.row,e.from.col,e.to.row,e.from.col+s-1),u=this._getView().getMultiSelectedRange().map((e=>e.toArray()));if(this._getView().selectRanges([l.toArray()]),!await this.checkProtectedRanges(l,i))return this._getView().selectRanges(u),this.fail();const c=r.getWorkbook().getLocale().getInputParser(),h=[],d=[];for(const e of a){const t=new Array(e.length),r=new Array(e.length);h.push(t),d.push(r);for(let n=0;n{const e=r.sheetId;return[A.createUnmergeOverlapsCommand(e,l),A.createAutofillDataCommand(e,l,{format:f,data:d}),A.createAutofillNumberFormatCommand(e,l,h)]})),this.done()):this.fail()}async createComment(e,t){return await this._recordSels((async()=>{await this.execCommand(A.createCreateCommentCommand(e,t,!0))})),this.done()}async replyComment(e,t){return await this._recordSels((async()=>{await this.execCommand(A.createReplyCommentCommand(e,t,!1))})),this.done()}async reopenComment(e,t){return await this._recordSels((async()=>{await this.execCommand(A.createCommentStatusCommand(e,t,!0))})),this.done()}async resolveComment(e,t){return await this._recordSels((async()=>{await this.execCommand(A.createCommentStatusCommand(e,t,!1))})),this.done()}async editComment(e,t,r,n){return await this._recordSels((async()=>{await this.execCommand(A.createEditCommentCommand(e,t,r,n))})),this.done()}async updateExternal(e,t){const r=await this._getDataBridge().calculateExternalChanges(e,t);r&&await this.execCommand(A.createUpdateExternalLinksCommand([[e,r]]))}async unlinkExternal(e){const t=await this._getDataBridge().getUnlinkChanges(e);await this.execCompound((()=>t.map((e=>{let[t,r]=e;return A.createValueCommand(t,r)}))))}async removeExternalLinks(e){await this.execCommand(A.createRemoveExternalLinksCommand(e))}async clearEmptyExternalLinks(){const e=await this._getDataBridge().calculateEmptyRefExternalChanges();await this.execCommand(A.createUpdateExternalLinksCommand(e))}_rpc(e){return new Promise(((t,r)=>{i.default.getTransport().sendCommand(new g.RPCAction(e),((e,n,i)=>{n&&i?t(i):r()}))}))}async createSheet(e){const t=this._getWorkbook(),{id:r,pos:i,title:o}=await this._rpc(A.createServerCreateWorksheetCommand(t.getSheetCount(),e));return await this.execCommand(A.createCreateWorksheetCommand(r,i,o)),n.default.getUndoRedo().done(new g.UndeleteWorksheetAction(r)),await this.done(),r}async dupSheet(e,t,r){const{id:i,pos:o}=await this._rpc(A.createServerDupWorksheetCommand(e,t,r));return await this.execCommand(A.createDupWorksheetCommand(e,o,r,i)),n.default.getUndoRedo().done(new g.UndeleteWorksheetAction(i)),await this.done(),e}async renameSheet(e,t){return await this.checkProtectedWorksheet(e)?(await this.execCommand(A.createRenameWorksheetCommand(e,t)),this.done()):this.fail()}async removeSheets(e){if(!await this.checkProtectedWorksheets(e,!0))return this.fail();for(const t of e)await this.execCommand(A.createDeleteWorksheetCommand(t));return this.done()}async removeSheet(e){return await this.checkProtectedWorksheet(e,!0)?(await this.execCommand(A.createDeleteWorksheetCommand(e)),this.done()):this.fail()}async setSheetsHidden(e,t){if(!await this.checkProtectedWorksheets(e,!0))return this.fail();for(const r of e)await this.execCommand(A.createSetWorksheetHiddenCommand(r,t));return this.done()}async setSheetHidden(e,t){return await this.checkProtectedWorksheet(e)?(await this.execCommand(A.createSetWorksheetHiddenCommand(e,t)),this.done()):this.fail()}async setSheetsColor(e,t){if(!await this.checkProtectedWorksheets(e,!0))return this.fail();for(const r of e)await this.execCommand(A.createSetWorksheetColorCommand(r,t));return this.done()}async setSheetColor(e,t){return await this.checkProtectedWorksheet(e)?(await this.execCommand(A.createSetWorksheetColorCommand(e,t)),this.done()):this.fail()}async reorderSheet(e){return await this.execCommand(A.createReorderWorksheetCommand(e)),this.done()}async _genBorderGetter(e,t){const r=t.getTopLeftCorner(),n=t.getBottomRightCorner(),i={row:Math.max(0,r.row-1),col:Math.max(0,r.col-1)},o={row:n.row+1,col:n.col+1},a=await this._getDataBridge().getRangeComputedStyle(e,i,o);return(e,t)=>a[e-i.row][t-i.col].border.b}getCommandFactory(){return A}_getDataBridge(){return n.default.getDataBridge()}_getWorkbook(){return n.default.getDataBridge().getWorkbook()}_getView(){return n.default.getView()}}const O=class extends N{fail(e){return super.fail(e).catch((async e=>{let{message:t}=e;return t&&await n.default.getUIBridge().onAlert(t),!1}))}async done(e){return await super.done(e??{resetCopySelection:!0}),!0}}},56023:(e,t,r)=>{"use strict";let n;r.d(t,{FLUSH_TYPE:()=>n}),function(e){e[e.EDITOR=1]="EDITOR",e[e.WORKBOOK=2]="WORKBOOK",e[e.FILTER=4]="FILTER",e[e.CF=8]="CF",e[e.DEFINE=16]="DEFINE",e[e.IMAGE=32]="IMAGE",e[e.CHART=64]="CHART",e[e.RULE=128]="RULE",e[e.VIEWPORT=256]="VIEWPORT",e[e.SEARCH=512]="SEARCH",e[e.COMMENT=1024]="COMMENT",e[e.ALL=2047]="ALL"}(n||(n={}))},64145:(e,t,r)=>{"use strict";var n;r.d(t,{default:()=>i}),function(e){e[e.MERGE_FREEZED=2]="MERGE_FREEZED",e[e.CLEAR_MERGE_DATA=3]="CLEAR_MERGE_DATA",e[e.FREEZE_MERGED=4]="FREEZE_MERGED",e[e.HIDE_ALL_ROW=5]="HIDE_ALL_ROW",e[e.HIDE_ALL_COL=6]="HIDE_ALL_COL",e[e.VERT_MERGE_IN_FILTER=7]="VERT_MERGE_IN_FILTER",e[e.FILTER_VERT_MERGED=8]="FILTER_VERT_MERGED",e[e.REMOVE_ALL_ROW=9]="REMOVE_ALL_ROW",e[e.REMOVE_ALL_COL=10]="REMOVE_ALL_COL",e[e.SORT_MERGED=11]="SORT_MERGED",e[e.MOVE_FIRST_FILTER=12]="MOVE_FIRST_FILTER",e[e.MOVE_MERGE_CELL=13]="MOVE_MERGE_CELL",e[e.MERGE_PARTIAL=14]="MERGE_PARTIAL",e[e.EXCEED_CELL_QUOTA=15]="EXCEED_CELL_QUOTA",e[e.FILTER_AT_LEAST_TWO=16]="FILTER_AT_LEAST_TWO",e[e.MERGE_CROSS_FILTER=17]="MERGE_CROSS_FILTER",e[e.PROTECTION_WARNING=18]="PROTECTION_WARNING",e[e.PROTECTION_REJECT=19]="PROTECTION_REJECT",e[e.PROTECTION_DELETE=20]="PROTECTION_DELETE",e[e.REMOVE_DUP_NO_DATA=21]="REMOVE_DUP_NO_DATA",e[e.REMOVE_DUP_NOT_ALIGNED=22]="REMOVE_DUP_NOT_ALIGNED",e[e.REMOVE_DUP_MULTI_RANGE=23]="REMOVE_DUP_MULTI_RANGE",e[e.REMOVE_DUP_ONE_ROW=24]="REMOVE_DUP_ONE_ROW",e[e.REMOVE_DUP_DONE=25]="REMOVE_DUP_DONE",e[e.REMOVE_DUP_HIDDEN_ROW=26]="REMOVE_DUP_HIDDEN_ROW",e[e.INVALID_CHANGE=27]="INVALID_CHANGE"}(n||(n={}));const i=n},9031:(e,t,r)=>{"use strict";r.d(t,{default:()=>o});var n=r(42443),i=r(5501);async function o(e,t){let{cls:r,value:o,sheetId:a,rowCount:s,colCount:l,multiRange:u,overwrite:c,skip:h}=e;if(c=!!c,h=h||{},!u||0===u.length)return[];const d=(0,n.multiRangeClassify)(u,s,l),f=[];if(d.all.length>0&&!h.global)f.push(i.createGlobalStyleCommand(a,r,o,!1));else{let e,t,n;const s=[],l=[],u=[];if(!h.row)for(e=0;e0)for(e=0;e0&&f.push(i.createDimensionStyleCommand(a,"row",r,s,!1)),l.length>0&&f.push(i.createDimensionStyleCommand(a,"col",r,l,!1)),u.length>0&&f.push(i.createStyleCommand(a,r,u,c))}return t&&f.push(...await t(d)),f}},73754:(e,t,r)=>{"use strict";r.d(t,{default:()=>a});var n=r(56023),i=r(64145);function o(){}class a{constructor(){this.editor=this.createEditorHandler()}createEditorHandler(){return{filter:{show:o},imageFloat:{show:o,hide:o},chartMenu:{show:o,hide:o},validationList:{show:o,hide:o},validationTip:{show:o,hide:o},datePicker:{show:o,hide:o},contextMenu:{show:o},onTextSelectionChange:o}}async onAlert(e){}async onConfirm(e){return!1}onCommentChanged(e){}onBeforeUndo(e){}onAfterUndo(e){}onBeforeRedo(e){}onAfterRedo(e){}onAfterDoneQueueChange(){}onBeforeSync(){}onAfterSync(){}onLockUI(){}onReleaseUI(){}onFlushUI(e){}onSelectImage(){}onTextSelectionChanged(e){}onFilterViewUpdated(e){}onEditorRender(e){}onActionDone(e){}onResetCopy(e){}onFinishEditing(e,t){}onCurrentChanged(e){}insertImage(e){}getPeerTooltip(e){return""}onActiveChartChange(e,t){}onActiveImageChange(e,t){}openChartEditor(e){}openImageFormatPanel(e){}onExternalRequest(e){}}a.Message=i.default,a.FLUSH_TYPE=n.FLUSH_TYPE},74987:(e,t,r)=>{"use strict";r.d(t,{NameManagerAdapter:()=>n});class n{constructor(e){this.workbook=e}getVariable(e,t){return this.workbook.getStoreGetter("nameManager/getVariable")(e,t)}}},16204:(e,t,r)=>{"use strict";r.d(t,{default:()=>v});var n=r(96803),i=r(89044),o=r(58835),a=r(79161),s=r(61947),l=r(96310),u=r(80585),c=r(48121),h=r(26630),d=r(87047),f=r(35956),g=r(19005),p=r(86401),m=r(15343);class v{constructor(e){this.workbook=e,this.hidden=new l.HiddenPluginAdapter(this),this.filter=new u.FilterPluginAdapter(this),this.merge=new d.MergePluginAdapter(this),this.validation=new p.ValidationPluginAdapter(this),this.cf=new s.CfPluginAdapter(this),this.freeze=new c.FreezePluginAdapter(this),this.rowResize=new g.RowResizePluginAdapter(this),this.colResize=new f.ColResizePluginAdapter(this),this.drawing=new h.DrawingPluginAdapter(this)}get sheetId(){return this.getWorkbook().getWorkbookState().current}get id(){return this.sheetId.slice(3)}getWorksheetState(){return this.workbook.getWorkbookState().worksheet}isEmptyCell(e,t){return this.workbook.getStoreGetter("worksheet/isEmptyCell")(e,t)}isEmptyRange(e){return this.workbook.getStoreGetter("worksheet/isEmptyRange")(e)}getDataAtCell(e,t){return this.workbook.getStoreGetter("worksheet/getDataAtCell")(e,t)}getCellStyle(e,t){const r=this.getCellProperty(e,t,"s");return null==r?null:this.workbook.getStyleManager().getCellStyle(r)??null}getComputedCellStyle(e,t){const r=this.workbook.getStoreGetter("worksheet/getComputedXf")(e,t),n=this.workbook.getStyleManager();return n.getCellStyle(r)??n.getDefaultStyle()}getCellProperty(e,t,r){return this.workbook.getStoreGetter("worksheet/getCellProperty")(e,t,r)??null}getCellNote(e,t){return this.getCellProperty(e,t,"n")}getCellHyperlinkState(e,t){return this.getCellProperty(e,t,"link")}getSpillRange(e,t){return this.getWorkbook().getStoreGetter("worksheet/getSpillRange")(e,t)}getCellFormulaValue(e,t){return this.getWorkbook().getStoreGetter("worksheet/getCellFormulaValue")(e,t)}getCellTextDesc(e,t){return this.getCellProperty(e,t,"renderDesc")}getWorkbook(){return this.workbook}getCellFormulaItemState(e,t){return this.getCellProperty(e,t,"formulaItem")}countRows(){return this.getWorksheetState().rowCount}countCols(){return this.getWorksheetState().colCount}isReadonly(){return this.workbook.isReadonly()}isCommentable(){return this.workbook.isCommentable()}getName(){return this.workbook.getNameById(this.sheetId)}getColWidth(e){return this.getWorksheetState().cols[e]?.w??0}getRowHeight(e){return this.isHiddenRow(e)?0:this.getWorkbook().getStoreGetter("worksheet/rowHeight")[e]??0}isHiddenRowExcludeFilter(e){return this.hidden.isHiddenRow(e)&&!this.getFilterPlugin().isFilteredRow(e,!1)}isFilteredRow(e){const t=this.getFilterPlugin();return t.isInViewState()?t.isFilteredRow(e,!0):this.getHiddenPlugin().isHiddenRow(e)&&t.isFilteredRow(e,!1)}isHiddenRow(e){return this.isHiddenRowExcludeFilter(e)||this.isFilteredRow(e)}isHiddenCol(e){return this.getWorksheetState().cols[e]?.hidden??!1}getHiddenPlugin(){return this.hidden}getFilterPlugin(){return this.filter}getMergePlugin(){return this.merge}getValidationPlugin(){return this.validation}getCfPlugin(){return this.cf}getFreezePlugin(){return this.freeze}getDrawingPlugin(){return this.drawing}getRowResizePlugin(){return this.rowResize}getColResizePlugin(){return this.colResize}getComputedBackgroundColor(e,t){const r=this.getCellProperty(e,t,"cfStyle");if(r?.bgColor)return r.bgColor;const i=this.getComputedCellStyle(e,t)?.getFill();return i?.bg||n.default.DEFAULT_FILL_COLOR}getComputedTextColors(e,t){const r=this.getCellProperty(e,t,"cfStyle");if(r?.color)return[r.color];const a=this.getCellProperty(e,t,"renderDesc"),s=a?.c;if(s){const e=(0,i.color2hex)(`#${s}`);if(e)return[e.toLowerCase()]}const l=this.getComputedCellStyle(e,t)?.getFont();if(a?.t===m.CellDescType.LINK)return[l?.color||n.default.HYPER_LINK_COLOR];const u=l?.color||n.default.DEFAULT_FONT_COLOR,c=this.getWorkbook().getStoreGetter("worksheet/getDataAtCell")(e,t);return(0,o.isRichTextValue)(c)?(0,o.getRichTextColors)(c,u):[u]}getVisibleRangeValues(e){let t;const r=[];for(let n=e.from.row;n<=e.to.row;n++){if(this.isHiddenRow(n))continue;const i=[];for(let r=e.from.col;r<=e.to.col;r++)this.isHiddenCol(r)||(i.push(this.getCellFormulaValue(n,r)),t||(t=this.getWorkbook().getStoreGetter("worksheet/getCellProperty")(n,r,"formulaItem")?.nfId||this.getCellStyle(n,r)?.nfId));r.push(i)}return{values:r,nfId:t}}getRangeTexts(e,t){return this.workbook.getStoreGetter("worksheet/getRangeTexts")(e,t)}getAllTexts(e){return this.workbook.getStoreGetter("worksheet/getAllTexts")(e)}findClosestCell(e,t){return(0,a.findClosestCell)(this,e,t)}getNonEmptyNeighborRange(e){return(0,a.getNonEmptyNeighborRange)(this,e)}setRenderHeights(e){this.getWorkbook().commitStore("worksheet/updateRenderedHeights",e)}}},89594:(e,t,r)=>{"use strict";r.d(t,{StyleManagerAdapter:()=>o});var n=r(64260),i=r(97671);class o{constructor(e){this.workbook=e,this._styles=[],this.fonts=[],this.fills=[],this.alignments=[],this.borders=[],this.numberFormats=[]}get styles(){const e=this.workbook.getStyleManagerState().styles;for(let t=this._styles.length;t0,n._sm=this,n.setIndex(t),this._styles.push(n)}return this._styles}getStyle(e,t,r,n){if(!t[e]){const i=this.workbook.getStyleManagerState()[n][e];if(!i)return;t[e]=(new r).assign(i),t[e].setIndex(e)}return t[e]}getDefaultStyle(){return this.styles[0]}getFont(e){return this.getStyle(e,this.fonts,n.Font,"fonts")}getFill(e){return this.getStyle(e,this.fills,n.Fill,"fills")}getAlignment(e){return this.getStyle(e,this.alignments,n.Alignment,"alignments")}getBorder(e){return this.getStyle(e,this.borders,n.Border,"borders")}getNumberFormat(e){return this.getStyle(e,this.numberFormats,n.NumberFormat,"numberFormats")}getCellStyle(e){return this.styles[e]}}},37802:(e,t,r)=>{"use strict";r.d(t,{default:()=>l});var n=r(16204),i=r(74987),o=r(89594),a=r(55060),s=r(94455);class l{constructor(e,t){this.store=e,this.locale=t,this.current=new n.default(this),this.styleManager=new o.StyleManagerAdapter(this),this.nameManager=new i.NameManagerAdapter(this)}getStore(){return this.store}getWorkbookState(){return this.store.state.workbook}getStoreGetter(e){return this.store.getters[`${s.workbookNamespace}/${e}`]}commitStore(e,t){this.store.commit(`${s.workbookNamespace}/${e}`,t)}getCurrentSheet(){return this.current.sheetId?this.current:void 0}hasSheet(e){return this.getStoreGetter("hasSheet")(e)}getNameById(e){return this.getStoreGetter("sheetsInfo").get(e)?.title}getIdByName(e){return this.getStoreGetter("nameMap").get(e)}getSheetColor(e){return this.getStoreGetter("sheetsInfo").get(e)?.tabColor}getRemainingCellCount(){return this.getStoreGetter("remainingCellCount")}getSheetDimension(e){return this.getStoreGetter("getSheetDimension")(e)}getAvailableRowCount(e){return this.getStoreGetter("getAvailableRowCount")(e)}getAvailableColCount(e){return this.getStoreGetter("getAvailableColCount")(e)}getAvailableMaxRow(e){return this.getStoreGetter("getAvailableMaxRow")(e)}getAvailableMaxCol(e){return this.getStoreGetter("getAvailableMaxCol")(e)}isDimensionAvailable(e,t,r){return this.getStoreGetter("isDimensionAvailable")(e,t,r)}isNewSheetAvailable(e){return this.getStoreGetter("isNewSheetAvailable")(e)}getOrder(){return this.getWorkbookState().order}getPrevSheet(e,t){return this.getStoreGetter("getPrevSheet")(e,t)}getNextSheet(e,t){return this.getStoreGetter("getNextSheet")(e,t)}getSiblingSheet(e){return this.getStoreGetter("getSiblingSheet")(e)}getSheetCount(){return this.getOrder().length}getSheetPos(e){return this.getStoreGetter("getSheetPos")(e)}isSheetHidden(e){return this.getStoreGetter("isHiddenSheet")(e)}getNameManager(){return this.nameManager}getStyleManager(){return this.styleManager}createBaseFormulaItem(){return new a.BaseItem}getVisibleOrder(){return this.getStoreGetter("visibleOrder")}isReadonly(){return this.getWorkbookState().readonly}isCommentable(){return this.getWorkbookState().commentable}isHistoryMode(){return!1}getVersion(){return this.getWorkbookState().version}getNameManagerState(){return this.getWorkbookState().nameManager}getRuleStoreState(){return this.getWorkbookState().ruleStore}getCommentStoreState(){return this.getWorkbookState().commentStore}getStyleManagerState(){return this.getWorkbookState().styleManager}getLocale(){return this.locale}moveSearchResult(e,t){const r=e.length,n=this.getWorkbookState().current;let i=n?e.indexOf(n):0;const o=e[i];let a=this.getStoreGetter("search/getResultBy")(o,t);if(!a){const n=i;do{"prev"===t?(i=(i-1+r)%r,a=this.getStoreGetter("search/getLastResult")(e[i])):(i=(i+1)%r,a=this.getStoreGetter("search/getFirstResult")(e[i]))}while(!a&&i!==n)}let s=0,l=0;if(a){this.commitStore("search/moveSearchResult",{sheetId:e[i],moveTo:{row:a.row,col:a.col}});for(let t=0;t{"use strict";r.d(t,{default:()=>c});var n=r(31641),i=r(84499),o=r(58835),a=r(4263),s=r(54770),l=r(96687),u=r(33506);class c{constructor(e){this.workbook=e}process(e){if(function(e){return"compound"===e.cmd}(e))for(let t=0;ta.default.textToRange(e,i))).filter(s.isNonNull));break}case"sort":{const{rowOrder:t,range:r,applyData:n}=e;c.applyRowOrder(t,h(r),n);break}case"insert_image":{const{imageId:t,position:r}=e;c.insertImage(t,r);break}case"remove_image":{const{imageId:t}=e;c.removeImage(t);break}case"resize_image":{const{imageId:t,position:r}=e;c.resizeImage(t,r);break}case"insert_chart":{const{chartId:t,position:r,chartObj:n}=e;c.insertChart(t,r,n);break}case"remove_chart":{const{chartId:t}=e;c.removeChart(t);break}case"resize_chart":{const{chartId:t,position:r}=e;c.resizeChart(t,r);break}case"adjust_chart":{const{chartId:t,chartObj:r}=e;c.adjustChart(t,r);break}case"set_chart_config":{const{chartId:t,name:r,args:n}=e;c.setChartConfig(t,r,n);break}case"modify_drawings_by_insert":{const{type:t,index:r,amount:n}=e;c.modifyDrawingsByInsertRowCol(t,r,n);break}case"modify_drawings_by_remove":{const{type:t,index:r,amount:n}=e;c.modifyDrawingByRemoveRowCol(t,r,n);break}case"modify_drawings_by_move":{const{type:t,start:r,amount1:n,amount2:i,isBackward:o}=e;c.modifyDrawingsByMoveRowCol(t,r,n,i,o);break}case"move_row":{const{start:t,amount1:r,amount2:n,isBackward:i,data:o}=e;c.moveRow(t,r,n,i,o);break}case"move_col":{const{start:t,amount1:r,amount2:n,isBackward:i,data:o}=e;c.moveCol(t,r,n,i,o);break}case"move_range":{const{srcRange:t,targetRange:r,clearMerge:n}=e;c.moveRange(h(t),h(r),n);break}case"clear_range_data":{const{range:t,source:r}=e;c.clearRangeData(h(t),r);break}case"clear_range_related":{const{range:t,source:r,clearMerge:n}=e;c.clearRangeRelated(h(t),n,r);break}case"move_formula_range":{const{srcRange:t,targetSheetId:r,targetRange:n,applyData:i}=e;c.moveFormulaRange(h(t),r,h(n),i);break}case"add_internal_link":{const{json:t}=e;c.addInternalLink(t);break}case"update_internal_link":{const{json:t}=e;c.updateInternalLink(t);break}case"remove_internal_link":{const{linkId:t}=e;c.removeInternalLink(t);break}}}_processComment(e){const t=this.workbook.getController().commentController;let r=!0;switch(e.cmd){case"create_comment":t.createCommentFromJSON(e.json);break;case"create_comment_local":{const{author:r,config:n}=e;t.createComment(r,n);break}case"reply_comment":t.replyCommentFromJSON(e.json);break;case"reply_comment_local":{const{author:r,config:n}=e;t.replyComment(r,n);break}case"reopen_comment":t.reopenCommentFromJSON(e.json);break;case"reopen_comment_local":{const{author:r,threadId:n}=e;t.reopenComment(r,n);break}case"resolve_comment":t.resolveCommentFromJSON(e.json);break;case"resolve_comment_local":{const{author:r,threadId:n}=e;t.resolveComment(r,n);break}case"edit_comment":t.changeCommentFromJSON(e.json);break;case"edit_comment_local":{const{author:r,threadId:n,replyId:i,text:o}=e;t.editComment(r,n,i,o);break}case"paste_comment":t.pasteCommentFromJson(e.jsonArray);break;case"clear_comment":t.clearCommentFromJson(e.jsonArray);break;default:r=!1}return r}_processDefinedName(e){let t=!0;const r=this.workbook.getController().nameController;switch(e.cmd){case"create_define":{const{name:t,value:n,scope:i}=e;r.create(t,n,i);break}case"remove_define":{const{name:t,scope:n}=e;r.remove(t,n);break}case"modify_define":{const{name:t,change:n,scope:i}=e;r.modify(t,n,i);break}default:t=!1}return t}_processProtection(e){let t=!0;const r=this.workbook.getController().ruleController;switch(e.cmd){case"create_rule":{const{rule:t}=e;r.create(t);break}case"update_rule":{const{ruleId:t,props:n}=e;r.update(t,n);break}case"remove_rule":{const{ruleId:t}=e;r.delete(t);break}default:t=!1}return t}_processExternalLinks(e){switch(e.cmd){case"update_external_links":return this.workbook.getController().updateExternalLinks(e.entry),!0;case"remove_external_links":return this.workbook.getController().removeExternalLinks(e.linkIds),!0}return!1}_processWorksheet(e){const t=e.cmd;if(!t||!t.startsWith("worksheet."))return!1;const r=this.workbook.getController();switch(t){case"worksheet.create":{const{id:t,pos:n,title:i,tabColor:o,content:a}=e;r.createWorksheet(t,n,{title:i,tabColor:o},a);break}case"worksheet.dup":{const{id:t,pos:n,title:i,newId:o}=e;r.dupWorksheet(t,n,i,o);break}case"worksheet.undelete":{const{id:t,pos:n,info:i,content:o}=e;r.undeleteWorksheet(t,n,i,o);break}case"worksheet.delete":{const{id:t,includeSnapshotData:n}=e;r.deleteWorksheet(t,n);break}case"worksheet.rename":{const{id:t,title:n}=e;r.renameWorksheet(t,n);break}case"worksheet.set_order":{const{order:t}=e;r.reorderWorksheet(t);break}case"worksheet.set_hidden":{const{id:t,hidden:n}=e;r.setWorksheetHidden(t,n);break}case"worksheet.set_color":{const{id:t,color:n}=e;r.setWorksheetColor(t,n);break}}return!0}}function h(e){return(0,i.createRange)(e[0],e[1],e[2],e[3])}},5501:(e,t,r)=>{"use strict";r.r(t),r.d(t,{createAddHyperlinkCommand:()=>ae,createAddValidationRangeCommand:()=>P,createAdjustChartCommand:()=>K,createAutofillDataCommand:()=>w,createAutofillNumberFormatCommand:()=>R,createCellValueCommand:()=>l,createClearCommentCommand:()=>Ce,createClearRangeDataCommand:()=>ne,createClearRangeRelatedCommand:()=>ie,createCommentStatusCommand:()=>he,createCompoundCommand:()=>a,createCreateCfCommand:()=>H,createCreateCommentCommand:()=>ue,createCreateDefineCommand:()=>_e,createCreateFilterCommand:()=>T,createCreateFilterViewCommand:()=>N,createCreateJsonCommentCommand:()=>fe,createCreateRuleCommand:()=>Te,createCreateValidationCommand:()=>F,createCreateWorksheetCommand:()=>Ne,createDeleteWorksheetCommand:()=>Pe,createDimensionStyleCommand:()=>C,createDupWorksheetCommand:()=>De,createEditCommentCommand:()=>de,createEditJsonCommentCommand:()=>ve,createEnableFilterCommand:()=>E,createExpandFilterRangeCommand:()=>D,createFixColumnCommand:()=>b,createFixCommand:()=>I,createFixRowCommand:()=>S,createFormatCommand:()=>v,createGlobalStyleCommand:()=>x,createHiddenCommand:()=>A,createInsertChartCommand:()=>X,createInsertImageCommand:()=>G,createInsertRowColCommand:()=>f,createMergeCommand:()=>p,createModifyDefineCommand:()=>Se,createModifyDrawingsByInsertCommand:()=>Z,createModifyDrawingsByMoveCommand:()=>ee,createModifyDrawingsByRemoveCommand:()=>Q,createMoveCommand:()=>te,createMoveFormlaRangeCommand:()=>oe,createMoveRangeCommand:()=>re,createNoteCommand:()=>u,createOpenJsonCommentCommand:()=>pe,createPasteAutofillDataCommand:()=>_,createPasteCommentCommand:()=>ye,createRemoveAllValidationCommand:()=>V,createRemoveCfCommand:()=>U,createRemoveChartCommand:()=>$,createRemoveDefineCommand:()=>Re,createRemoveExternalLinksCommand:()=>we,createRemoveImageCommand:()=>Y,createRemoveInternalLinkCommand:()=>le,createRemoveRowColCommand:()=>g,createRemoveRuleCommand:()=>Me,createRemoveValidationCommand:()=>B,createRenameWorksheetCommand:()=>Fe,createReorderWorksheetCommand:()=>Be,createReplyCommentCommand:()=>ce,createReplyJsonCommentCommand:()=>ge,createResizeChartCommand:()=>q,createResizeColumnCommand:()=>h,createResizeCommand:()=>d,createResizeImageCommand:()=>j,createResizeRowCommand:()=>c,createResolveJsonCommentCommand:()=>me,createServerCreateWorksheetCommand:()=>ke,createServerDupWorksheetCommand:()=>Oe,createSetActiveFilterViewCommand:()=>L,createSetChartConfigCommand:()=>J,createSetFilterCommand:()=>M,createSetWorksheetColorCommand:()=>He,createSetWorksheetHiddenCommand:()=>Ve,createSortCommand:()=>W,createStyleCommand:()=>y,createUndeleteWorksheetCommand:()=>Le,createUnmergeOverlapsCommand:()=>m,createUpdateCfRangesCommand:()=>z,createUpdateExternalLinksCommand:()=>xe,createUpdateFilterRangeCommand:()=>k,createUpdateFilterViewNameCommand:()=>O,createUpdateHyperlinkCommand:()=>se,createUpdateRuleCommand:()=>Ee,createValueCommand:()=>s,isCreateRuleCommand:()=>be,isRemoveRuleCommand:()=>Ae,isUpdateRuleCommand:()=>Ie});var n=r(58835),i=r(33506);function o(e){return Array.isArray(e)?e:e.toArray()}function a(e){return{cmd:"compound",actions:e}}function s(e,t,r){return{cmd:"value",id:e,changes:(0,n.serilizeRichTextInChanges)(t),source:r}}function l(e,t,r,n){return{cmd:"value",id:e,changes:t,nfRefs:r,nfs:n}}function u(e,t){return{cmd:"note",id:e,changes:t}}function c(e,t,r,n){return{cmd:"resize_row",id:e,from:t,to:r,height:n}}function h(e,t,r,n){return{cmd:"resize_col",id:e,from:t,to:r,width:n}}function d(e,t,r,n,i){return"row"===t?c(e,r,n,i):h(e,r,n,i)}function f(e,t,r,n,i,o){return{cmd:`insert_${t}`,id:e,index:r,amount:n,refIndex:i,data:o}}function g(e,t,r,n,i,o){return{cmd:`remove_${t}`,id:e,index:r,amount:n,refIndex:i,data:o}}function p(e,t,r){return{cmd:t?"merge":"unmerge",id:e,range:Array.isArray(r)?r:r.toArray()}}function m(e,t){return{cmd:"unmerge_overlaps",id:e,range:t.toArray()}}function v(e,t,r,n){return{cmd:"format",id:e,changes:t,overwrite:r,source:n}}function y(e,t,r,n,i){return{cmd:t.toLowerCase(),id:e,changes:r,overwrite:n,source:i}}function C(e,t,r,n,i,o,a){return{cmd:`${t}_style`,id:e,type:r.toLowerCase(),changes:n,revert:i,cellChanges:o,source:a}}function x(e,t,r,n,i,o,a,s){return{cmd:"global_style",id:e,type:t.toLowerCase(),value:r,revert:n,rowChanges:o,colChanges:a,cellChanges:i}}function w(e,t,r,n,o){return{cmd:"populate_autofill_data",id:e,range:t.toArray(),data:(0,i.toTransferableData)(r),direction:n,source:o}}function _(e,t,r,n,o){return{cmd:"paste_autofill_data",id:e,range:t.toArray(),data:(0,i.toTransferableData)(r),expandFilter:n,source:o}}function R(e,t,r,n,i){return{cmd:"autofill_number_format",id:e,range:t.toArray(),fc:r,direction:n,source:i}}function S(e,t){return{cmd:"fix_row",id:e,row:t}}function b(e,t){return{cmd:"fix_col",id:e,col:t}}function I(e,t,r){return"row"===t?S(e,r):b(e,r)}function A(e,t,r,n,i){return{cmd:`${t?"hide":"show"}_${r}s`,id:e,from:n,to:i}}function T(e,t,r){return{cmd:"create_filter",id:e,filterId:t,range:o(r)}}function E(e,t,r,n,i){return{cmd:`${r?"enable":"disable"}_filter${n?"_view":""}`,id:e,filterId:t,hiddenInfo:i}}function M(e,t,r,n,i,o){return{cmd:"set_filter"+(r?"_view_condition":""),id:e,filterId:t,col:n,condition:i,hiddenInfo:o}}function k(e,t,r,n,i){return{cmd:`update_filter${r?"_view":""}_range`,id:e,filterId:t,range:n?o(n):null,conditions:i}}function N(e,t,r,n){return{cmd:"create_filter_view",id:e,filterId:t,range:o(r),name:n}}function O(e,t,r){return{cmd:"update_filter_view_name",id:e,filterId:t,name:r}}function D(e,t,r){return{cmd:"expand_filter_range",id:e,range:[t,r,t,r]}}function L(e,t){return{cmd:"set_active_filter_view",id:e,filterId:t}}function P(e,t,r){return{cmd:"add_validation_range",id:e,validId:t,range:r.toArray()}}function F(e,t,r){return{cmd:"create_validation",id:e,validation:t,range:r}}function B(e,t,r){return{cmd:"remove_validation",id:e,validId:t,range:r}}function V(e,t){return{cmd:"remove_all_validation",id:e,range:t.toArray()}}function H(e,t,r){return{cmd:"create_cf",id:e,cf:t,index:r}}function U(e,t){return{cmd:"remove_cf",id:e,cfId:t}}function z(e,t,r){return{cmd:"update_cf_ranges",id:e,cfId:t,ranges:r}}function W(e,t,r,n){return{cmd:"sort",id:e,rowOrder:t,range:o(r),applyData:n}}function G(e,t,r){return{cmd:"insert_image",id:e,imageId:t,position:r}}function j(e,t,r){return{cmd:"resize_image",id:e,imageId:t,position:r}}function Y(e,t){return{cmd:"remove_image",id:e,imageId:t}}function X(e,t,r,n){return{cmd:"insert_chart",id:e,chartId:t,position:r,chartObj:n}}function $(e,t){return{cmd:"remove_chart",id:e,chartId:t}}function q(e,t,r){return{cmd:"resize_chart",id:e,chartId:t,position:r}}function K(e,t,r){return{cmd:"adjust_chart",id:e,chartId:t,chartObj:r}}function J(e,t,r,n){return{cmd:"set_chart_config",id:e,chartId:t,name:r,args:n}}function Z(e,t,r,n){return{cmd:"modify_drawings_by_insert",id:e,type:t,index:r,amount:n}}function Q(e,t,r,n){return{cmd:"modify_drawings_by_remove",id:e,type:t,index:r,amount:n}}function ee(e,t,r,n,i,o){return{cmd:"modify_drawings_by_move",id:e,type:t,start:r,amount1:n,amount2:i,isBackward:o}}function te(e,t,r,n,i,o,a){return{cmd:`move_${t}`,id:e,start:r,amount1:n,amount2:i,isBackward:o,data:a}}function re(e,t,r,n){return{cmd:"move_range",id:e,srcRange:t.toArray(),targetRange:r.toArray(),clearMerge:n}}function ne(e,t,r){return{cmd:"clear_range_data",id:e,range:t.toArray(),source:r}}function ie(e,t,r,n){return{cmd:"clear_range_related",id:e,range:t.toArray(),source:n,clearMerge:r}}function oe(e,t,r,n,i){return{cmd:"move_formula_range",id:e,srcRange:o(t),targetSheetId:r,targetRange:o(n),applyData:i}}function ae(e,t){return{cmd:"add_internal_link",id:e,json:t}}function se(e,t){return{cmd:"update_internal_link",id:e,json:t}}function le(e,t){return{cmd:"remove_internal_link",id:e,linkId:t}}function ue(e,t){return{cmd:"create_comment_local",author:e,config:t}}function ce(e,t){return{cmd:"reply_comment_local",author:e,config:t}}function he(e,t,r){return{cmd:(r?"reopen":"resolve")+"_comment_local",author:e,threadId:t}}function de(e,t,r,n){return{cmd:"edit_comment_local",author:e,threadId:t,replyId:r,text:n}}function fe(e){return{cmd:"create_comment",json:e}}function ge(e){return{cmd:"reply_comment",json:e}}function pe(e){return{cmd:"reopen_comment",json:e}}function me(e){return{cmd:"resolve_comment",json:e}}function ve(e){return{cmd:"edit_comment",json:e}}function ye(e){return{cmd:"paste_comment",jsonArray:e}}function Ce(e){return{cmd:"clear_comment",jsonArray:e}}function xe(e){return{cmd:"update_external_links",entry:e}}function we(e){return{cmd:"remove_external_links",linkIds:e}}function _e(e,t,r){return{cmd:"create_define",name:e,value:t,scope:r}}function Re(e,t){return{cmd:"remove_define",name:e,scope:t}}function Se(e,t,r){return{cmd:"modify_define",name:e,scope:r,change:t}}function be(e){return"create_rule"===e.cmd}function Ie(e){return"update_rule"===e.cmd}function Ae(e){return"remove_rule"===e.cmd}function Te(e){return{cmd:"create_rule",rule:e}}function Ee(e,t){return{cmd:"update_rule",ruleId:e,props:t}}function Me(e){return{cmd:"remove_rule",ruleId:e}}function ke(e,t){return{cmd:"worksheet.create",pos:e,titleTpl:t}}function Ne(e,t,r,n,i){return{cmd:"worksheet.create",id:e,pos:t,title:r,tabColor:n,content:i}}function Oe(e,t,r){return{cmd:"worksheet.dup",id:e,pos:t,title:r}}function De(e,t,r,n){return{cmd:"worksheet.dup",id:e,pos:t,title:r,newId:n}}function Le(e,t,r,n){return{cmd:"worksheet.undelete",id:e,pos:t,info:r,content:n}}function Pe(e,t){return{cmd:"worksheet.delete",id:e,includeSnapshotData:t}}function Fe(e,t){return{cmd:"worksheet.rename",id:e,title:t}}function Be(e){return{cmd:"worksheet.set_order",order:e}}function Ve(e,t){return{cmd:"worksheet.set_hidden",id:e,hidden:t}}function He(e,t){return{cmd:"worksheet.set_color",id:e,color:t}}},15443:(e,t,r)=>{"use strict";r.d(t,{SheetComment:()=>i});var n=r(14633);class i extends n.Comment{constructor(e){super(e),this.row=e.row,this.col=e.col,this.sheetId=e.sheetId,this.cellText=e.cellText}toJSON(){return Object.assign(super.toJSON(),this._getProperties())}toObject(){return Object.assign(super.toObject(),this._getProperties())}_getProperties(){return{row:this.row,col:this.col,sheetId:this.sheetId,cellText:this.cellText}}static createReply(e){return o.fromJSON(e)}getReplyIndex(e){for(let t=0;t{"use strict";r.d(t,{default:()=>a});var n=r(14633),i=r(15443);class o extends n.CommentStore{static createComment(e){return i.SheetComment.fromJSON(e)}canReopen(e){const{row:t,col:r,sheetId:i}=e,o=this.filterBySheet(i);for(let e=0;er.sheetId===e&&(!t||r.status===n.Enum.STATUS_OPEN)))}createRowCol(e,t,r,n){const i=[];for(const o in this.comments){const a=this.comments[o];a.sheetId===e&&a[t]>=r&&(a[t]+=n,i.push([a.id,a.toJSON()]))}i.length>0&&this.emit("commentChanged",i)}removeRowCol(e,t,r,n){const i=[];for(const o in this.comments){const a=this.comments[o];a.sheetId!==e||a[t]0&&this.emit("commentChanged",i)}sort(e,t,r){const i=this.getAllCommentValues().filter((t=>t.sheetId===e&&r.includes(t)));if(0===i.length)return[];const o=[],a=r.getTopLeftCorner().row,s=[];for(let e=0;e0&&this.emit("commentChanged",o),s}moveRow(e,t){this._moveRowCol("row",e,t)}moveCol(e,t){this._moveRowCol("col",e,t)}_moveRowCol(e,t,r){const n=[];this.getAllCommentValues().forEach((i=>{i.sheetId!==t||i[e]r.sec[1].end||(i[e]0&&this.emit("commentChanged",n)}copy(){return this}getStateJSON(){return{comments:this.toJSON()}}}const a=o},15641:(e,t,r)=>{"use strict";var n;r.d(t,{getColOverlapBorderChanges:()=>u,getRangeBorderChanges:()=>s,getRowOverlapBorderChanges:()=>l}),function(e){e[e.NONE=0]="NONE",e[e.TOP=1]="TOP",e[e.RIGHT=2]="RIGHT",e[e.BOTTOM=4]="BOTTOM",e[e.LEFT=8]="LEFT",e[e.OUTER=15]="OUTER",e[e.HORIZONTAL=16]="HORIZONTAL",e[e.VERTICAL=32]="VERTICAL",e[e.INNER=48]="INNER",e[e.ALL=63]="ALL"}(n||(n={}));const i=["TOP","RIGHT","BOTTOM","LEFT"];function o(e){return Array.isArray(e)?e:[e=e||void 0,e,e,e]}function a(e){return!e||!(e[0]||e[1]||e[2]||e[3])}function s(e,t,r,s,l,u){const c=[],h=n[s.toUpperCase()]||n.NONE;if(function(e,t){return t===n.HORIZONTAL&&1===e.getHeight()||t===n.VERTICAL&&1===e.getWidth()||t===n.INNER&&1===e.getHeight()&&1===e.getWidth()}(r,h))return c;const d=o(l);return r.normalize().forAll(((e,t)=>{const s=function(e,t,r,i){let o=n.NONE;return e===r.from.row&&(o|=i&n.TOP),t===r.to.col&&(o|=i&n.RIGHT),e===r.to.row&&(o|=i&n.BOTTOM),t===r.from.col&&(o|=i&n.LEFT),i&n.HORIZONTAL&&(e>r.from.row&&(o|=n.TOP),er.from.col&&(o|=n.LEFT),t{const n=l(e,t);if(n&&null!==n[r]&&n[r]!==o[r]){const i=[...n];i[r]=null,s.push([e,t,a(i)?null:i])}};if(i&n.TOP&&u.row>0){const e=u.row-1;for(let t=u.col;t<=c.col;t++)h(e,t,2)}if(i&n.RIGHT&&c.col+10){const e=u.col-1;for(let t=u.row;t<=c.row;t++)h(t,e,1)}}(e,t,r,h,d,c,u),c}function l(e,t,r,i){const o=[],a=n[r.toUpperCase()]||n.NONE,s=t.getTopLeftCorner(),l=t.getBottomRightCorner();return a&n.TOP&&s.row>0&&o.push([s.row-1,[void 0,void 0,i,void 0]]),a&n.BOTTOM&&l.row+10&&o.push([s.col-1,[void 0,i,void 0,void 0]]),a&n.RIGHT&&l.col+1{"use strict";r.d(t,{default:()=>o});var n=r(14633),i=r(31641);const o=class{constructor(e){this.wbController=e}getWorkbook(){return this.wbController.workbook}getCommentStore(){return this.getWorkbook().getCommentStore()}_notify(e,t){if(e&&e.sheetId){const o=this.getWorkbook().getSheetById(e.sheetId);if(o){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i0&&t.add(r),e.replies?.forEach((e=>{"number"==typeof e.author&&e.author>0&&t.add(e.author)})),Array.from(t)}replyCommentFromJSON(e){this.getCommentStore().reply(e.author,e)}reopenComment(e,t){const r=this.fillJSON(e,{target:t});this.reopenCommentFromJSON(r),this.wbController.emit("afterReopenComment",r)}reopenCommentFromJSON(e){const t=this.getCommentStore().getCommentById(e.target);t&&(this.getCommentStore().reopen(e.author,e),this._notify(t,"afterReopenComment",t))}resolveComment(e,t){const r=this.fillJSON(e,{target:t});this.resolveCommentFromJSON(r),this.wbController.emit("afterResolveComment",r)}resolveCommentFromJSON(e){const t=this.getCommentStore().getCommentById(e.target);t&&(this.getCommentStore().resolve(e.author,e),this._notify(t,"afterResolveComment",t))}editComment(e,t,r,n){const i={author:e,replyId:r,text:n,lastModified:Date.now(),threadId:t};this.changeCommentFromJSON(i),this.wbController.emit("afterEditComment",i)}changeCommentFromJSON(e){const{author:t,replyId:r,text:n,lastModified:i,threadId:o}=e,a=this.getReplyIndex(o,r),s=`${n?"edit":"remove"}${o===r?"Comment":"Reply"}FromJSON`;switch(s){case"editCommentFromJSON":return this[s]({author:t,target:o,text:n,lastModified:i});case"editReplyFromJSON":return this[s]({author:t,target:o,text:n,replyIndex:a,lastModified:i});case"removeCommentFromJSON":return this[s]({author:t,target:o});case"removeReplyFromJSON":return this[s]({author:t,target:o,replyIndex:a,lastModified:i})}}editCommentFromJSON(e){this.getCommentStore().getCommentById(e.target)&&this.getCommentStore().editCommentText(e.author,e)}editReplyFromJSON(e){this.getCommentStore().getCommentById(e.target)&&e.replyIndex>=0&&this.getCommentStore().editReplyText(e.author,e)}removeCommentFromJSON(e){const t=this.getCommentStore().getCommentById(e.target);t&&(this.getCommentStore().removeComment(e.author,e),this._notify(t,"afterRemoveComment",t))}removeReplyFromJSON(e){this.getCommentStore().getCommentById(e.target)&&e.replyIndex>=0&&this.getCommentStore().removeReply(e.author,e)}clearCommentFromJson(e){if(0!==e.length){for(const t of e)this.removeCommentFromJSON({author:t.author,target:t.id});this.wbController.emit("afterClearComment",e)}}pasteCommentFromJson(e){if(0!==e.length){for(const t of e)this.createCommentFromJSON(t);this.wbController.emit("afterPasteComment",e)}}}},82651:(e,t,r)=>{"use strict";r.d(t,{default:()=>c});var n=r(56213),i=r(13574),o=r(42443),a=r(26832),s=r(58835),l=r(96687);class u extends n.default{constructor(e){super(e)}setDataAtCell(e,t){if(0===e.length)return;const r=[];for(let t=0,n=e.length;tr-1&&this._createRow(r,e[t][0]-(r-1),r-1,!0);const n=this.sheet.countCols();e[t][1]>n-1&&this._createCol(n,e[t][1]-(n-1),n-1,!0),this.sheet.setDataAtCell(e[t][0],e[t][1],e[t][3])}this.sheet.runHooks("afterChange",e,t||l.SourceType.Edit)}_applyCompoundChanges(e,t){if(void 0===e)return;const[r,n,i]=e,o=t!==l.SourceType.Format&&r.length>0,a=n.length>0,s=i.length>0;(o||a||s)&&(o&&this.setFormat(r,!0,t),a&&this.setQuotePrefix(n,!0,t),s&&this.setFont(i,!0,t))}addInternalLink(e){this.sheet.getHyperlinkModel().addInternalLink(e)}updateInternalLink(e){this.sheet.getHyperlinkModel().updateInternalLink(e)}removeInternalLink(e){this.sheet.getHyperlinkModel().removeInternalLink(e)}removeRangeInternalLink(e){e.forAll(((e,t)=>{const r=this.sheet.getCellMeta(e,t)?.link?.getId();r&&this.removeInternalLink(r)}))}setNote(e,t){const r=[];t=t||"",e.forEach((e=>{const t=e[0],n=e[1],i=e[2]||"",o=this.sheet.getCellNote(t,n)??"";o!==i&&(this.sheet.setCellNote(t,n,""===i?void 0:i),r.push([t,n,o,i]))})),r.length>0&&this.sheet.runHooks("afterNoteChange",r,t)}mergeCells(e,t){e.normalize(),this.sheet.getPlugin("synoMergeCell").mergeRange(e,t)}unmergeCells(e,t){e.normalize(),this.sheet.getPlugin("synoMergeCell").unmergeRange(e,t)}resizeRow(e,t,r){this.sheet.getPlugin("synoManualRowResize").applyResizeChange(e,t,r)}resizeColumn(e,t,r){this.sheet.getPlugin("synoManualColumnResize").applyResizeChange(e,t,r)}alterGrid(e,t,r,n,o){const a=(0,i.deepClone)(o);switch(e){case"insert_row":this._createRow(t,r,n,!1,a);break;case"insert_col":this._createCol(t,r,n,!1,a);break;case"remove_row":this._removeRow(t,r);break;case"remove_col":this._removeCol(t,r);break;default:return}if(a){let n,i;const o="inserted_data";if(a.format.font.length>0&&this.setFont(a.format.font,!0,o),a.format.fill.length>0&&this.setFill(a.format.fill,!0,o),a.format.alignment.length>0&&this.setAlignment(a.format.alignment,!0,o),a.format.border.length>0&&this.setBorder(a.format.border,!0,o),a.format.numberFormat.length>0&&this.setFormat(a.format.numberFormat,!0,o),a.format.quotePrefix.length>0&&this.setQuotePrefix(a.format.quotePrefix,!0,o),a.changes&&this.setDataAtCell((0,s.deserializeRichTextInChanges)(a.changes),o),a.notes&&this.setNote(a.notes,o),a.hyperlinks)for(const e of a.hyperlinks)this.addInternalLink(e);const l=a.info;if("insert_row"===e)for(n=0;no)&&(e=o),(t=t||1)<0?0:(this.sheet.runHooks("beforeCreateRow",e,t,r,n,i),this.sheet.createRow(e,t,r),this.sheet.getHyperlinkModel().createRowCol("row",e,t),this.sheet.runHooks("afterCreateRow",e,t,r,n,i),t)}_createCol(e,t,r,n,i){const o=this.sheet.countCols();return(e<0||e>o)&&(e=o),(t=t||1)<0?0:(this.sheet.runHooks("beforeCreateCol",e,t,r,n,i),this.sheet.createCol(e,t,r),this.sheet.getHyperlinkModel().createRowCol("col",e,t),this.sheet.runHooks("afterCreateCol",e,t,r,n,i),t)}_removeRow(e,t){const r=this.sheet.countRows();return t=t||1,(e<0||e>=r)&&(e=-t),e=(r+e)%r,r-t<=0&&(t=r-1),t<=0?0:(this.sheet.runHooks("beforeRemoveRow",e,t),this.sheet.removeRow(e,t),this.sheet.getHyperlinkModel().removeRowCol("row",e,t),this.sheet.runHooks("afterRemoveRow",e,t),t)}_removeCol(e,t){const r=this.sheet.countCols();return t=t||1,(e<0||e>=r)&&(e=-t),e=(r+e)%r,r-t<=0&&(t=r-1),t<=0?0:(this.sheet.runHooks("beforeRemoveCol",e,t),this.sheet.removeCol(e,t),this.sheet.getHyperlinkModel().removeRowCol("col",e,t),this.sheet.runHooks("afterRemoveCol",e,t),t)}repairCrossData(e){let{crossInfo:t,define:r}=e;if(t){const e=this.sheet.getWorkbook();(0,i.objectEach)(t,((t,r)=>{const n=e.getSheetById(r);n&&(n.runHooks("repairCross",t),n.getHyperlinkModel().repairCross(t.hyperlink))}))}r&&this.sheet.getWorkbook().getController().nameController.repair(r)}_unmergeOverlaps(e,t){const r=this.sheet.getPlugin("synoMergeCell"),n=r.getOverlap(e);for(let e=0;e{const n=this.sheet.getCellMeta(e,r);if(n&&n.refCf)for(const e of n.refCf)t.has(e)||t.add(e)}));for(const r of t){const{newRanges:t}=(0,o.removePartialRange)(r.ranges,e);0===t.length?this.removeCf(r.id):this.updateCfRanges(r.id,(0,o.refactorRanges)(t))}}insertImage(e,t){this.sheet.getPlugin("synoDrawingController").insertImage(e,t)}removeImage(e){this.sheet.getPlugin("synoDrawingController").removeImage(e)}resizeImage(e,t){this.sheet.getPlugin("synoDrawingController").resizeImage(e,t)}insertChart(e,t,r){this.sheet.getPlugin("synoDrawingController").insertChart(e,t,r)}removeChart(e){this.sheet.getPlugin("synoDrawingController").removeChart(e)}resizeChart(e,t){this.sheet.getPlugin("synoDrawingController").resizeChart(e,t)}adjustChart(e,t){this.sheet.getPlugin("synoDrawingController").adjustChart(e,t)}setChartConfig(e,t,r){this.sheet.getPlugin("synoDrawingController").setChartConfig(e,t,r)}modifyDrawingsByInsertRowCol(e,t,r){this.sheet.getPlugin("synoDrawingController").modifyDrawingsByInsertRowCol(e,t,r)}modifyDrawingByRemoveRowCol(e,t,r){this.sheet.getPlugin("synoDrawingController").modifyDrawingsByRemoveRowCol(e,t,r)}modifyDrawingsByMoveRowCol(e,t,r,n,i){this.sheet.getPlugin("synoDrawingController").modifyDrawingsByMoveRowCol(e,t,r,n,i)}moveRow(e,t,r,n,i){this.sheet.getPlugin("synoManualMove").moveRow(e,t,r,n,i)}moveCol(e,t,r,n,i){this.sheet.getPlugin("synoManualMove").moveCol(e,t,r,n,i)}moveRange(e,t,r){void 0===r&&(r=!0);const n=this.sheet,i=n.getPlugin("synoAutofill").getAutofillData(e,(()=>!1),l.SourceType.Cut),{mergedBorders:a,mergeRangeChanges:s}=n.getMergedCellFormatChanges(t,i);i.mergedBorders=a,i.mergeRanges=s,n.controller.clearRangeRelated(e,r,void 0);const{newRanges:u}=(0,o.removePartialRange)([e],t);for(const e of u)n.controller.clearRangeData(e,void 0);n.controller.pasteAutofillData(t,i,!1),n.controller.moveFormulaRange(e,n.sheetId,t,null)}moveFormulaRange(e,t,r,n){const i={};n?this.repairCrossData(n):this.sheet.formula.moveFormulaRange(e,t,r,i),this.sheet.sheetId===t&&this.sheet.getPlugin("synoFilter").notifyMoveRange(e,r,n?.filter,i),this.sheet.runHooks("afterMoveFormulaRange",e,t,r,n,i)}pasteAutofillData(e,t,r,n){void 0===r&&(r=!0),this.ensureRowColExisted(e.to),r&&t.data&&this.sheet.getPlugin("synoFilter").expandRangeByData(e),this.sheet.getPlugin("synoAutofill").populateAutofillData(e.from,e.to,t,void 0,n)}populateAutofillData(e,t,r,n){this.sheet.getPlugin("synoAutofill").populateAutofillData(e.from,e.to,t,r,n)}autofillNumberFormat(e,t,r,n){this.sheet.getPlugin("synoAutofill").fillNumberFormat(e.from,e.to,t,r,n)}ensureRowColExisted(e){let{row:t,col:r}=e;const n=this.sheet.countRows(),i=this.sheet.countCols();t>=n&&this.alterGrid("insert_row",n,t-n+1,n-1,null),r>=i&&this.alterGrid("insert_col",i,r-i+1,i-1,null)}clearRangeData(e,t){const r=[],n=[],i=[],o=[],a=[],s=[],l=[];e.forAll(((e,t)=>{r.push([e,t,null]),n.push([e,t,null]),i.push([e,t,null]),o.push([e,t,null]),a.push([e,t,null]),s.push([e,t,null]),l.push([e,t,null])})),this.setFont(n,!0,t),this.setFill(i,!0,t),this.setAlignment(o,!0,t),this.setBorder(l,!0,t),this.setFormat(a,!0,t),this.setNote(s,t),this.setDataAtCell(r,t)}clearRangeRelated(e,t,r){this.removeAllValidation(e),this.removeRangeCf(e),this.removeRangeInternalLink(e),this.sheet.getWorkbook().getController().commentController.clearRangeComment(this.sheet.sheetId,e),!1!==t&&this._unmergeOverlaps(e,r)}}const c=u},26832:(e,t,r)=>{"use strict";r.d(t,{default:()=>d});var n=r(31641),i=r(84499),o=r(58835),a=r(96687),s=r(3288);const l=[a.SourceType.Edit,a.SourceType.Format,a.SourceType.Validation,a.SourceType.RemoveValue];function u(e,t,r,i,o){const s=[e,t,r.fc];return o===a.SourceType.Validation?s:i.isDefault()?(0,n.isGeneralFc)(r.fc)?null:s:i.isDate()?r.d?null:s:i.isTime()?r.t?null:s:i.isDateTime()?r.datetime?null:s:r.numeric||(0,n.isGeneralFc)(r.fc)?null:s}function c(e){const t="IMPORTRANGE";if(!e.toUpperCase().includes(t+"("))return e;let r=!1;const n=(0,s.tokenize)(e);for(let e=0;e{"use strict";r.d(t,{default:()=>a});var n=r(16607),i=r(56023);class o extends n.default{constructor(e){super(),this.wbController=e}init(){this.registerHookListeners()}registerHookListeners(){const e=this.wbController.workbook.hooks,t=this;e.add("afterCreateRow",(function(e,r,n){t.onInsertRowCol(this.sheetId,"row",e,r,n)})),e.add("afterCreateCol",(function(e,r,n){t.onInsertRowCol(this.sheetId,"col",e,r,n)})),e.add("afterRemoveRow",(function(e,r){t.onRemoveRowCol(this.sheetId,"row",e,r)})),e.add("afterRemoveCol",(function(e,r){t.onRemoveRowCol(this.sheetId,"col",e,r)})),e.add("afterMoveRow",(function(e){t.onMoveRowCol(this.sheetId,"row",e)})),e.add("afterMoveCol",(function(e){t.onMoveRowCol(this.sheetId,"col",e)}))}getStore(){return this.wbController.workbook.getRuleStore()}list(){return this.getStore().toJSON()}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n{"use strict";r.d(t,{default:()=>u});var n=r(85978),i=r(3288),o=r(56023),a=r(59162),s=r(31641),l=r(55180);const u=class{constructor(e){this.wbController=e}getWorkbook(){return this.wbController.workbook}getNameManager(){return this.getWorkbook().getNameManager()}init(){this.registerHookListener()}registerHookListener(){const e=this,t=this.getWorkbook();t.hooks.add("afterCreateRow",(function(t,r){e.afterAlterGrid(this,"row",t,r)})),t.hooks.add("afterCreateCol",(function(t,r){e.afterAlterGrid(this,"col",t,r)})),t.hooks.add("afterRemoveRow",(function(t,r){e.afterAlterGrid(this,"row",t,-r)})),t.hooks.add("afterRemoveCol",(function(t,r){e.afterAlterGrid(this,"col",t,-r)})),t.hooks.add("beforeMoveRow",(function(t,r,n){e.beforeMove(this,"row",t,r,n)})),t.hooks.add("beforeMoveCol",(function(t,r,n){e.beforeMove(this,"col",t,r,n)}))}create(e,t,r){r=r||this.getNameManager().getWorkbookScope(),void 0===this.getNameManager().get(e,r)&&(this.getNameManager().set(e,t,r),this.wbController.emit("afterCreateDefinedName",e,t,r),this._notifyUpdate([[e,r]]))}remove(e,t){t=t||this.getNameManager().getWorkbookScope();const r=this.getNameManager().remove(e,t);return void 0!==r&&(this.wbController.emit("afterRemoveDefinedName",e,r,t),this._notifyUpdate([[e,t]])),r}modify(e,t,r){r=r||this.getNameManager().getWorkbookScope();const n=e,i=this.getNameManager().get(e,r);if(void 0===i||!t)return;const o=[],{name:a,value:s}=t;if(n!==a){if(this.getNameManager().get(a,r))return;this.getNameManager().remove(e,r),o.push([e,r])}(o.length>0||i!==s)&&(o.push([a,r]),this.getNameManager().set(a,s,r),this.wbController.emit("afterModifyDefinedName",{name:[n,a],value:[i,s],scope:r}),this._notifyUpdate(o))}afterAlterGrid(e,t,r,i){const o=[],a={delta:i,start:{[t]:r}};this.getNameManager().list().forEach((t=>{const{name:r,value:i,scope:s}=t,l=n.utils.changeFormula(i,a,e.getName());i!==l&&(o.push([r,s]),this.getNameManager().set(r,l,s))})),this._notifyUpdate(o)}collectRemovedInfo(e,t,r){const n=[],i=`isBetween${(0,s.toUpperCaseFirst)(e)}`;return this.getNameManager().list().forEach((e=>{const o=(0,a.parseFormulaRange)(e.value);for(let a=0;a{const{name:o,value:c,scope:h}=i;let d=a[h]&&a[h][o];const f=void 0===d;f&&(d=n.utils.moveFormula(t,c,r,e.getName())),c!==d&&(s.push([o,h]),this.getNameManager().set(o,d,h),f&&(u=!0,l[h]=l[h]||{},l[h][o]=c))})),u&&(o.synoDefinedName=l),this._notifyUpdate(s)}moveFormulaRange(e,t,r){const i=[],o=[];this.getNameManager().list().forEach((r=>{let{name:a,value:s,scope:l}=r;const u=n.utils.changeFormulaRange(s,e,t,"");s!==u&&(o.push({name:a,value:s,scope:l}),i.push([a,l]),this.getNameManager().set(a,u,l))})),r.define=o,this._notifyUpdate(i)}_updateDependencies(e){let t=[],r=[];const n=this.getNameManager().getContainer();for(let i=0;i0&&(this._updateDependencies(e),this.wbController.emit("afterUpdateDefinedName"),this.getWorkbook().notifyDataChange(o.FLUSH_TYPE.DEFINE))}onRenameSheet(e,t){this.getNameManager().each((r=>{const{value:n}=r,o=(0,i.changeSheetName)(n,e,t);n!==o&&(r.value=o)}))}}},16607:(e,t,r)=>{"use strict";r.d(t,{VALIDATE_RESULT:()=>a,default:()=>d});var n=r(44499),i=r(5501),o=r(55180);let a;function s(e,t){return e.isRangeAllowed(t)}function l(e,t,r){return s(e,new n.RowRange(t,r))}function u(e,t,r){return s(e,new n.ColRange(t,r))}function c(e,t){const r=(0,n.parseRefRange)(t);return r&&s(e,r)}function h(e,t,r){return e.isInsertable(t,r)}!function(e){e[e.NOTHING=0]="NOTHING",e[e.WARNING=1]="WARNING",e[e.REJECT=2]="REJECT"}(a||(a={}));const d=class{isGrantable(e,t,r){const n=this.getStore().find(e);return!!n&&n.isGrantable(t,r)}create(e){this.getStore().create(e)&&this.emit("createRule",e)}delete(e){const t=this.getStore().delete(e);t&&this.emit("removeRule",t)}update(e,t){const r=this.getStore().find(e);if(!r)return;const n=r.getProps();this.getStore().update(e,t)&&this.emit("updateRule",r.id,n,t)}isEmpty(){return 0===this.getStore().list().length}getNonPermittedRules(e,t,r){return this.getStore().list().filter((n=>n.isACLMode()&&n.getSheetId()===e&&!n.validateACL(t,r)))}getWarningRules(e){return this.getStore().list().filter((t=>!t.isACLMode()&&t.getSheetId()===e))}validateCommand(e,t,r,i){if("compound"===e.cmd)return e.actions&&e.actions.every((e=>this.validateCommand(e,t,r,i)));const o=e.id;return(!o||!this.getNonPermittedRules(o,t,r).some((t=>!function(e,t){switch(t.cmd){case"value":case"font":case"fill":case"alignment":case"border":case"format":case"quotePrefix":case"note":return function(e,t){return!!Array.isArray(t)&&t.every((t=>{let[r,n]=t;return e.isCoordsAllowed(r,n)}))}(e,t.changes);case"create_row":return l(e,t.index,t.index);case"create_col":return u(e,t.index,t.index);case"remove_row":return l(e,t.index,t.index+t.amount-1);case"remove_col":return u(e,t.index,t.index+t.amount-1);case"resize_row":case"hide_rows":case"show_rows":return l(e,t.from,t.to);case"resize_col":case"hide_cols":case"show_cols":return u(e,t.from,t.to);case"merge":case"unmerge":case"sort":case"create_filter":return function(e,t){let[r,i,o,a]=t;return s(e,new n.CellRange({row:r,col:i},{row:o,col:a}))}(e,t.range);case"enable_filter":case"disable_filter":case"set_filter":return function(e,t){if(!t)return!1;function r(t){return l(e,t.from,t.to)}return!(Array.isArray(t.show)&&!t.show.every(r))&&!(Array.isArray(t.hide)&&!t.hide.every(r))}(e,t.hiddenInfo);case"create_validation":case"remove_validation":return c(e,t.range);case"create_cf":return t.cf&&Array.isArray(t.cf.ranges)&&t.cf.ranges.every((t=>c(e,t)));case"row_style":return Array.isArray(t.changes)&&t.changes.every((t=>l(e,t[0],t[0])));case"col_style":return Array.isArray(t.changes)&&t.changes.every((t=>u(e,t[0],t[0])));case"global_style":case"worksheet.delete":return!1;case"move_row":return l(e,t.start,t.start+t.amount1-1)&&h(e,"row",t.start+t.amount1+t.amount2);case"move_col":return u(e,t.start,t.start+t.amount1-1)&&h(e,"col",t.start+t.amount1+t.amount2);case"worksheet.rename":case"worksheet.set_hidden":case"worksheet.set_color":return"worksheet"!==e.getType()}return!0}(t,e))))&&(!["update_rule","remove_rule","create_rule"].includes(e.cmd)||this.validateRuleCommand(e,{uid:t,gids:r,canOrganize:i})function(e,t){return t.every((t=>s(e,t)))}(e,i)),t,r,{ruleId:n})}checkProtectedWorksheet(e,t,r,n){return this.checkProtection((e=>!t&&"worksheet"!==e.getType()),e,r,{ruleId:n})}checkProtectedWorksheets(e,t,r,n){const i=e.map((e=>this.checkProtectedWorksheet(e,t,r,n)));return Math.max(...i)}checkProtectedCoords(e,t,r,n){return this.checkProtection((e=>function(e,t){return t.every((t=>{let{row:r,col:n}=t;return e.isCoordsAllowed(r,n)}))}(e,t)),e,r,n)}checkProtectedInsertable(e,t,r,n,i){return this.checkProtection((e=>h(e,t,r)),e,n,i)}checkProtection(e,t,r,n){if(void 0===n&&(n={}),this.isEmpty())return a.NOTHING;const i=n.ruleId?t=>n.ruleId===t.id||e(t):e,{uid:o,gids:s,canOrganize:l}=r;return l||this.getNonPermittedRules(t,o,s).every(i)?n.warning||this.getWarningRules(t).every(i)?a.NOTHING:a.WARNING:a.REJECT}}},96687:(e,t,r)=>{"use strict";let n;r.d(t,{SourceType:()=>n}),function(e){e.Alter="alter",e.ApplyLink="applyLink",e.Autofill="autofill",e.ClearFormat="clearFormat",e.Cut="cut",e.Edit="edit",e.Format="format",e.Formula="formula",e.InsertedData="inserted_data",e.MergeCell="merge_cell",e.Paste="paste",e.PopulateData="populateData",e.Redo="redo",e.Remote="remote",e.RemoveLink="removeLink",e.RemoveValue="removeValue",e.Undo="undo",e.Validation="validation"}(n||(n={}))},56213:(e,t,r)=>{"use strict";r.d(t,{default:()=>s});var n=r(39837),i=r(31641);function o(e){return(0,i.isGeneralFc)(e)?null:e}function a(e,t,r,i,o){const a=e.worksheet,s=e.getStyleManager(),l=n["apply"+r],u="row"===t?a.getRowInfo:a.getColInfo,c=[],h=a.getGlobalXf();for(let r=0,d=i.length;r0){const t="after"+e+"Change";this.sheet.runHooks(t,l,i,o)}}setRowStyle(e,t,r,n,i){if(r=!!r,i=i||"",!Array.isArray(t))return;const o=this.sheet.worksheet;let s,l,u;if(!r){n=[];const e=function(e,t){e&&e.s&&void 0!==u&&n.push([s,t,u])};for(let r=0,i=t.length;r0&&this.setStyleByType(e,n,r,i,(function(e){c=e}));const h=a(this.sheet,"row",e,t,r);this.sheet.runHooks("afterRowStyleChange",e,h,r,{cellChanges:c},i)}setColStyle(e,t,r,n,i){if(r=!!r,i=i||"",!Array.isArray(t))return;const o=this.sheet.worksheet;let s,l,u;if(!r){n=[];const e=function(e){e&&e.s&&void 0!==u&&n.push([s,l,u])},r=Math.min(Math.max(o.getRowLength(),o.rowInfos.length),this.sheet.countRows());for(s=0;s0&&this.setStyleByType(e,n,r,i,(function(e){c=e}));const h=a(this.sheet,"col",e,t,r);this.sheet.runHooks("afterColStyleChange",e,h,r,{cellChanges:c},i)}setGlobalStyle(e,t,r,i,o,s,l){r=!!r,l=l||"";const u=this.sheet.worksheet,c=this.sheet.getStyleManager(),h=u.getGlobalInfo();if(void 0===t)return;let d=[],f=[],g=[];if(!r){s=[];for(let e=0;e0&&this.setStyleByType(e,s,r,l,(function(e){g=e})),r||(i=[],u.rowInfos.forEach((function(e,r){e&&e.s&&i.push([r,t])})),o=[],u.colInfos.forEach((function(e,r){e&&o.push([r,t])}),this)),d=a(this.sheet,"row",e,i||[],r),f=a(this.sheet,"col",e,o||[],r);const p=[null,t],m=h.s||0,v=n["apply"+e](c,m,t,r);v&&(h.s=v[1],p[0]=v[2]),this.sheet.runHooks("afterGlobalStyleChange",e,p,r,{rowChanges:d,colChanges:f,cellChanges:g},l)}}},39837:(e,t,r)=>{"use strict";function n(e,t,r,n){const i=e.getCellStyle(t).getFont();if(null===r&&i.isDefault())return;const o=i.isDefault()?null:i.toJSON();let a;a=null===r?e.getFont(0).clone():n?e.createFont(r):i.clone().assign(r);const s=e.addFont(a);return[t,u(e,t,"fontId",s),o,r]}function i(e,t,r,n){const i=e.getCellStyle(t).getFill();if(null===r&&i.isDefault())return;const o=i.isDefault()?null:i.toJSON();let a;a=null===r?e.getFill(0).clone():n?e.createFill(r):i.clone().assign(r);const s=e.addFill(a);return[t,u(e,t,"fillId",s),o,r]}function o(e,t,r,n){const i=e.getCellStyle(t).getAlignment();if(null===r&&i.isDefault())return;const o=i.isDefault()?null:i.toJSON();let a;a=null===r?e.getAlignment(0).clone():n?e.createAlignment(r):i.clone().assign(r);const s=e.addAlignment(a);return[t,u(e,t,"alignmentId",s),o,r]}function a(e,t,r){const n=e.getCellStyle(t).getNumberFormat().fc;if(r===n)return;let i;i=null===r?e.getNumberFormat(0).clone():e.createNumberFormat({fc:r});const o=e.addNumberFormat(i);return[t,u(e,t,"nfId",o),n,r]}function s(e,t,r,n){const i=e.getCellStyle(t).getBorder(),o=i.isDefault()?null:i.b;let a,s=r;if(function(e,t){const r=Array.isArray(e),n=Array.isArray(t);if(r&&n){for(let r=0;r0),n,r]}function u(e,t,r,n){const i=e.getCellStyle(t);if(n===i[r])return t;const o=i.clone();return o[r]=n,e.addCellStyle(o)}r.r(t),r.d(t,{applyAlignment:()=>o,applyBorder:()=>s,applyFill:()=>i,applyFont:()=>n,applyFormat:()=>a,applyQuotePrefix:()=>l})},48152:(e,t,r)=>{"use strict";r.d(t,{default:()=>m});var n=r(26729),i=r(60790),o=r(5558),a=r(9231),s=r(56023),l=r(94061),u=r(13574),c=r(55180),h=r(18912),d=r(3288);class f extends n.EventEmitter{constructor(e){super(),this.workbook=e,this.nameController=new i.default(this),this.commentController=new o.default(this),this.ruleController=new a.default(this)}init(){this.nameController.init(),this.ruleController.init()}createWorksheet(e,t,r,n){const i=this.insertWorksheet(e,t,r,n);return i&&this.workbook.setMaxIndex(this.workbook.getMaxIndex()+1),i}deleteWorksheet(e,t){const r=this.workbook;if(!r.hasSheet(e)||1===r.getSheetCount())return!1;let n,i,o;if(!t){n=r.getSheetPos(e);const t=r.getSheetInfo(e);i={title:t.name,tabColor:t.color},o=this.workbook.generateWorksheetContent(e)||void 0}const a=r.removeSheet(e);if(a){const{items:t,conds:r,units:l}=a.getFormulaDepManager().getNotMyOwnItems(a);a.destroy(),this.recalcCrossReferences(t,"renew");for(const e of r)e.notifyUpdate();for(const e of l)e.notifyDeleteSheet();this.emit("deleteWorksheet",e,n,i,o),this.workbook.notifyDataChange(s.FLUSH_TYPE.WORKBOOK)}return!!a}dupWorksheet(e,t,r,n){const i=this.workbook.getSheetById(e);if(!i)return null;const o={tabColor:this.workbook.getSheetColor(e),title:r},a={ws:g(this.workbook.getWorksheetSnapshotSync(i),i.getName()||"",r)};return this.createWorksheet(n,t,o,a)?n:null}undeleteWorksheet(e,t,r,n){let i=r.title;if(!i)return!1;for(;this.workbook.hasSheetName(i);)i=`${i}_conflict_${Math.floor(Date.now()/1e3)}`;i!==r.title&&(n.ws=g(n.ws,r.title,i));const o=this.insertWorksheet(e,t,{title:i,tabColor:r.tabColor},n);return o&&(this.emit("undeleteWorksheet",e,t,r,n),this.workbook.notifyDataChange(s.FLUSH_TYPE.WORKBOOK)),o}reorderWorksheet(e){if(!Array.isArray(e))return!1;const t=this.workbook.getOrder(),r=this.workbook.setOrder(e);return r&&(this.emit("reorderWorksheet",t,e),this.workbook.notifyDataChange(s.FLUSH_TYPE.WORKBOOK)),r}renameWorksheet(e,t){const r=this.workbook.getSheetById(e);if(!t||this.workbook.hasSheetName(t)||!r)return!1;const n=r.getName()||"",i=this.workbook.rename(e,t);return i&&(this.nameController.onRenameSheet(n,t),r.formula.renameFormulaItems(n,t),this.recalcWhenSheetAdded(r),this.emit("renameWorksheet",e,n,t),this.workbook.notifyDataChange(s.FLUSH_TYPE.WORKBOOK|s.FLUSH_TYPE.RULE)),i}setWorksheetHidden(e,t){const r=this.workbook.setSheetHidden(e,t);return r&&(this.emit("setWorksheetHidden",e,t),this.workbook.notifyDataChange(s.FLUSH_TYPE.WORKBOOK)),r}setWorksheetColor(e,t){const r=this.workbook.getSheetColor(e),n=this.workbook.setSheetColor(e,t);return n&&(this.emit("setWorksheetColor",e,r,t),this.workbook.notifyDataChange(s.FLUSH_TYPE.WORKBOOK)),n}insertWorksheet(e,t,r,n){let i={},o=null;if(n)try{i=JSON.parse(n.ws),n.rewriteTitle&&p(i,n.rewriteTitle,r.title),n.style&&(o=JSON.parse(n.style))}catch(e){return!1}if(o){const e=this.workbook.getStyleManager().addParts(o);i=(0,h.replaceWorksheetXf)(i,e)}const a={sheetId:e,snapshot:i},u=(0,l.createSheet)(this.workbook,a,t,r);return!!u&&(this.recalcWhenSheetAdded(u),this.workbook.notifyDataChange(s.FLUSH_TYPE.WORKBOOK),!0)}recalcWhenSheetAdded(e){const t=this.workbook.getNameById(e.sheetId),r=this.workbook.getUnknownRefManager(),n=r.getByName(t);n.length>0&&(r.removeBucket(t),this.recalcCrossReferences(n,"renew"));const i=this.workbook.getUnitUnknownRefManager(),o=i.getByName(t);i.removeBucket(t);for(const e of o)e.notifyRecalcUnknown()}recalcUnknownRefs(e){const t=[],r=e.getWorkbook(),n=r.getUnknownRefManager();r.forAll(((i,o)=>{const a=r.getNameById(o),s=n.getByName(a);for(let r=0;r0;return i&&e.formula.generateChangeDep(t,"renew"),i}recalcCrossReferences(e,t){const r=(0,c.arrayReduce)(e,((e,t)=>{const r=t.sheet.sheetId;return(e[r]||(e[r]=[])).push([t.row,t.col]),e}),{});(0,u.objectEach)(r,((e,r)=>{this.workbook.getSheetById(r).formula.generateChangeDep(e,t)}))}updateExternalLinks(e){for(const[t,r]of e)this.workbook.getExternalManager().updateExternal(t,r);this.emit("afterUpdateExternalLinks",e)}removeExternalLinks(e){this.workbook.getExternalManager().removeExternal(e),this.emit("afterRemoveExternalLinks",e)}}function g(e,t,r){let n=null;try{n=JSON.parse(e),p(n,t,r)}catch(e){}return n?JSON.stringify(n):""}function p(e,t,r){t!==r&&(0,h.changeWorksheetFormula)(e,(e=>(0,d.changeSheetName)(e,t,r)))}const m=f},60083:(e,t,r)=>{"use strict";r.d(t,{DataBridge:()=>o});var n=r(26729),i=r.n(n);r(94061);class o extends(i()){notify(e){this.emit(e)}async forceUpdate(){}async execCommand(e){const t=await this._execCommand(e);return t&&this.emit("afterCommand",t.toData()),t}async execRemoteCommand(e){await this._execRemoteCommand(e),this.emit("afterCommand",e)}async flushDirty(){}}},51725:(e,t,r)=>{"use strict";r.d(t,{dataBridgeFactory:()=>l});var n=r(50312),i=r(16139),o=r(79697),a=r(49347),s=r(26637);function l(e,t,r,l,u){let{locale:c,locale_info:h}=e;void 0===u&&(u="workbook");const d=new a.default(c,h);if("worker"===u)return new n.WorkerDataBridge(d,t,r,l);const f=new s.default(d,t,r),g=new o.WorkbookDataBridge(f);return f.setNotifier(new i.DataBridgeNotifier(g,l)),g}},16139:(e,t,r)=>{"use strict";r.d(t,{DataBridgeNotifier:()=>o});var n=r(56023),i=r(21542);class o extends i.WorkbookNotifier{constructor(e,t){super(),this.dataBridge=e,this.uiBridge=t}onFlushUI(e){e&n.FLUSH_TYPE.VIEWPORT?this.dataBridge.notify("flush:viewport"):e&n.FLUSH_TYPE.SEARCH&&this.dataBridge.notify("flush:search"),this.uiBridge.onFlushUI(e)}notifyDataChange(e){this.onFlushUI(e)}onCurrentSheetChange(e){this._onCurrentSheetChange(e)}_onCurrentSheetChange(e){this.dataBridge.notify("flush:current"),this.uiBridge.onCurrentChanged(e)}onCommentChanged(e){this.uiBridge.onCommentChanged(e)}onFilterViewUpdated(e){this._onFilterViewUpdated(e)}_onFilterViewUpdated(e){this.uiBridge.onFilterViewUpdated(e)}onExternalRequest(e){this.uiBridge.onExternalRequest(e)}onAlterGrid(e,t,r){this.dataBridge.getWorkbook().getCurrentSheet()?.sheetId===e&&this.onFlushUI(n.FLUSH_TYPE.VIEWPORT)}onSheetChanges(e,t){this.dataBridge.getWorkbook().getCurrentSheet()?.sheetId===e&&this._onSheetChanges(e,t)}_onSheetChanges(e,t){t.some((e=>["rows","cols","rowCount","colCount"].includes(e)))&&this.onFlushUI(n.FLUSH_TYPE.VIEWPORT)}onSheetPluginChanges(e,t){this.dataBridge.getWorkbook().getCurrentSheet()?.sheetId===e&&this._onSheetPluginChanges(e,t)}_onSheetPluginChanges(e,t){let r=0;t.includes("filter")&&(this._onFilterViewUpdated(e),r|=n.FLUSH_TYPE.VIEWPORT),t.includes("drawing")&&(r|=n.FLUSH_TYPE.IMAGE|n.FLUSH_TYPE.CHART),r>0&&this.onFlushUI(r)}onRenderHeightChange(e){this.dataBridge.getWorkbook().getCurrentSheet()?.sheetId===e&&this._onSheetChanges(e,["rows"])}onAlert(e){return this.uiBridge.onAlert(e)}}},72748:(e,t,r)=>{"use strict";r.d(t,{StoreUpdater:()=>d});var n=r(111),i=r(16928),o=r(56023),a=r(58530),s=r(20634),l=r(54770),u=r(94455),c=r(16139);class h{constructor(){this.coords=[],this.wholeWorksheet=!1,this.dirty={},this.pluginsDirty={},this.workbookDirty={}}reset(){this.clearWorkbookDirty(),this.clearWorksheet(),this.sheetId=void 0}setWorkbookDirty(e){this.workbookDirty[e]=!0}getWorkbookDirty(){return this.workbookDirty}clearWorkbookDirty(){this.workbookDirty={}}getSheetId(){return this.sheetId}isWholeWorksheetDirty(){return this.wholeWorksheet}getCoords(){return this.coords}getAllDirtyAttribute(){return Object.entries(this.dirty).map((e=>{let[t,r]=e;return r?t:null})).filter(l.isNonNull)}getAllDirtyPlugins(){return Object.entries(this.pluginsDirty).map((e=>{let[t,r]=e;return r?t:null})).filter(l.isNonNull)}clearWorksheet(){this.wholeWorksheet=!1,this.coords=[],this.dirty={},this.pluginsDirty={}}renewSheet(e){this.sheetId=e,this.clearWorksheet()}setWorksheetDirty(){this.wholeWorksheet=!0}addCoords(e){if(!this.dirty.cells)for(const t of e)(0,s.insertCoord)(this.coords,t)}setDirtyAttributes(e){for(const t of e)this.dirty[t]=!0,"cells"===t&&(this.coords=[])}setDirtyPlugins(e){for(const t of e)this.pluginsDirty[t]=!0}}class d extends c.DataBridgeNotifier{constructor(e,t){super(e,t),this.store=(0,u.createStore)(),this.dirty=new h,this.flushGuard=new a.AsyncGuard((()=>this._flushDirty())),this.throttleUpdate=(0,n.default)((async()=>{await this.flushDirty()}),16,{leading:!1})}getStore(){return this.store}getState(){return this.store.state.workbook}async initData(){this.dirty.reset(),await this.updateData(o.FLUSH_TYPE.ALL),await this.updateStyleManager(),await this.updateExternalManager(),await this.updateCurrentSheetStore(),this.onFlushUI(o.FLUSH_TYPE.ALL)}async updateData(e){e&o.FLUSH_TYPE.WORKBOOK&&await this.updateWorkbookData(),e&o.FLUSH_TYPE.DEFINE&&await this.updateNameManager(),e&o.FLUSH_TYPE.RULE&&await this.updateRuleStore(),e&o.FLUSH_TYPE.COMMENT&&await this.updateCommentStore()}async updateWorkbookData(){this.store.commit(`${u.workbookNamespace}/flushData`,await this.dataBridge.getWorkbookDataView())}async updateNameManager(){this.store.commit(`${u.workbookNamespace}/nameManager/flush`,await this.dataBridge.getNameManagerDataView())}async updateRuleStore(){const{uid:e,gids:t}=this.uiBridge.getUserInfo();this.store.commit(`${u.workbookNamespace}/ruleStore/flush`,await this.dataBridge.getRuleStoreDataView(e,t))}async updateCommentStore(){this.store.commit(`${u.workbookNamespace}/commentStore/flush`,await this.dataBridge.getCommentStoreDataView())}async updateStyleManager(){const e=this.store.state.workbook.styleManager,t={styles:e.styles.length,fonts:e.fonts.length,fills:e.fills.length,alignments:e.alignments.length,borders:e.borders.length,numberFormats:e.numberFormats.length},r=await this.dataBridge.getStyleManagerDataView(t);this.store.commit(`${u.workbookNamespace}/styleManager/appendStyles`,{appendData:r,indexes:t})}async updateColors(){const e=await this.dataBridge.collectColors();this.store.commit(`${u.workbookNamespace}/flushData`,{colors:e})}async updateExternalManager(){const e=await this.dataBridge.listExternalLinkInfo();this.store.commit(`${u.workbookNamespace}/externalManager/flushLinkInfo`,e)}async updateCurrentSheetStore(){const e=this.getState().current;if(!e)return;this.dirty.renewSheet(e);const t=await this.dataBridge.getSheetDataView(e);if(t){this.store.commit(`${u.workbookNamespace}/worksheet/flush`,t.worksheet),this.store.commit(`${u.workbookNamespace}/worksheet/clearAllRenderHeight`);for(const[e,r]of Object.entries(t.plugins))this.store.commit(`${u.workbookNamespace}/worksheet/${e}/flush`,r);this._onCurrentSheetChange(e)}}flushDirty(){return this.flushGuard.run()}async _flushDirty(){const{style:e,colors:t}=this.dirty.getWorkbookDirty();this.dirty.clearWorkbookDirty(),e&&await this.updateStyleManager(),t&&await this.updateColors();const r=this.getState().current;if(!r)return;if(this.dirty.isWholeWorksheetDirty())return void await this.updateCurrentSheetStore();let n=!1;const i=this.dirty.getCoords(),a=this.dirty.getAllDirtyAttribute(),s=this.dirty.getAllDirtyPlugins();if(this.dirty.clearWorksheet(),i.length>0){const e=await this.dataBridge.getSheetScatterCellsDataView(r,i);if(e){const t=this.getState().worksheet.renderedHeight,r=i.some((e=>{let{row:r,col:n}=e;return t[r]?.col===n}));this.store.commit(`${u.workbookNamespace}/worksheet/updateScatterCells`,{coords:i,cells:e}),r&&this.onFlushUI(o.FLUSH_TYPE.VIEWPORT),n=!0}}if(a.length>0){const e=await this.dataBridge.getSheetPartialDataView(r,a);e&&(this.store.commit(`${u.workbookNamespace}/worksheet/flush`,e),a.some((e=>["rows","cols","rowCount","colCount"].includes(e)))&&this.onFlushUI(o.FLUSH_TYPE.VIEWPORT)),this._onSheetChanges(r,a),n=!0}if(s.length>0){const e=await this.dataBridge.getSheetPluginDataView(r,s);if(e){for(const t of s)e[t]&&this.store.commit(`${u.workbookNamespace}/worksheet/${t}/flush`,e[t]);this._onSheetPluginChanges(r,s),n=!0}}n&&this.onFlushUI(o.FLUSH_TYPE.EDITOR)}setRenderHeights(e,t){e===this.getState().current&&t.some((e=>e.height>this.store.getters[`${u.workbookNamespace}/worksheet/rowHeight`][e.row]))&&(this.store.commit(`${u.workbookNamespace}/worksheet/updateRenderedHeights`,t),this.onFlushUI(o.FLUSH_TYPE.VIEWPORT))}async notifyDataChange(e){await this.updateData(e),super.notifyDataChange(e)}async onStyleAdded(){this.dirty.setWorkbookDirty("style"),this.throttleUpdate()}onColorAdded(){this.dirty.setWorkbookDirty("colors"),this.throttleUpdate()}onCurrentSheetChange(e){this.store.commit(`${u.workbookNamespace}/flushData`,{current:e}),this.dirty.setWorksheetDirty(),this.throttleUpdate()}onCommentChanged(e){this.store.commit(`${u.workbookNamespace}/commentStore/updateByDelta`,e),super.onCommentChanged(e)}onFilterViewUpdated(e){this.onSheetPluginChanges(e,["filter"])}onExternalChanged(e,t){t?this.store.commit(`${u.workbookNamespace}/externalManager/updateLinkInfo`,t):this.store.commit(`${u.workbookNamespace}/externalManager/removeLinkInfo`,e)}async onCoordsChanges(e,t){e===this.dirty.getSheetId()&&(this.dirty.addCoords(t),this.throttleUpdate())}onAlterGrid(e,t,r){this.store.commit(`${u.workbookNamespace}/updateSheetDimension`,{sheetId:e,rowCount:t,colCount:r}),e===this.dirty.getSheetId()&&(this.dirty.setDirtyAttributes(["cells","rows","cols","rowCount","colCount"]),this.throttleUpdate())}async onSheetChanges(e,t){e===this.dirty.getSheetId()&&(this.dirty.setDirtyAttributes(t),this.throttleUpdate())}onSheetPluginChanges(e,t){e===this.dirty.getSheetId()&&(this.dirty.setDirtyPlugins(t),this.throttleUpdate())}onSearchResultChange(e,t){this.store.commit(`${u.workbookNamespace}/search/${e}`,t),this.onFlushUI(o.FLUSH_TYPE.EDITOR)}onClearRenderHeight(e,t){e===this.getState().current&&(this.store.commit(`${u.workbookNamespace}/worksheet/clearRenderHeight`,t),this.onFlushUI(o.FLUSH_TYPE.VIEWPORT))}onRenderHeightAlterGrid(e,t,r,n){e===this.getState().current&&(this.store.commit(`${u.workbookNamespace}/worksheet/modifyRenderHeightByAlter${(0,i.capitalize)(t)}`,{index:r,amount:n}),this.onFlushUI(o.FLUSH_TYPE.VIEWPORT))}onRenderHeightMove(e,t,r){e===this.getState().current&&(this.store.commit(`${u.workbookNamespace}/worksheet/modifyRenderHeightByMove${(0,i.capitalize)(t)}`,{moveArg:r}),this.onFlushUI(o.FLUSH_TYPE.VIEWPORT))}}},79697:(e,t,r)=>{"use strict";r.d(t,{WorkbookDataBridge:()=>f});var n=r(85978),i=r(60083),o=r(64145),a=r(75610),s=r(94061),l=r(55180),u=r(58835),c=r(37873),h=r(55060),d=r(98274);class f extends i.DataBridge{constructor(e){super(),this.workbook=e,this.commandExecutor=new a.default(this.workbook),this.actionAccumulator=new d.default(this.workbook)}async asyncInit(e,t){return(0,s.asyncInit)(this.workbook,e,t)}syncInit(e,t){return void 0===t&&(t={}),(0,s.syncInit)(this.workbook,e,t)}getWorkbook(){return this.workbook}async setCurrent(e){this.workbook.setCurrent(e)}async setReadonly(e){this.workbook.setReadonly(e)}async setCommentable(e){this.workbook.setCommentable(e)}async _execCommand(e){let t;try{t=this.actionAccumulator.accumulate((()=>this.commandExecutor.process(e)))}catch(e){const t=this.actionAccumulator.getUndoneActions();this.actionAccumulator.clear();try{for(const e of t.reverse())this.commandExecutor.process(e.getUndoCommand())}catch{}throw e}return t}async _execRemoteCommand(e){this.commandExecutor.process(e)}async*iteratePrintSheet(e){for(const t of e){const e=this.workbook.getSheetById(t.sheetId);e&&(yield[e,t])}}async generateWorksheetContent(e){return this.workbook.generateWorksheetContent(e)}async validateRuleCommand(e,t){return this.workbook.getController().ruleController.validateRuleCommand(e,t)}async checkProtectRefRange(e,t,r,n){return this.workbook.getController().ruleController.checkProtectRefRange(e,t,r,n)}async checkProtectedWorksheets(e,t,r,n){return this.workbook.getController().ruleController.checkProtectedWorksheets(e,t,r,n)}async checkProtectedCoords(e,t,r,n){return this.workbook.getController().ruleController.checkProtectedCoords(e,t,r,n)}async checkProtectedInsertable(e,t,r,n,i){return this.workbook.getController().ruleController.checkProtectedInsertable(e,t,r,n,i)}async checkCommand(e,t,r,n){return this.workbook.getController().ruleController.validateCommand(e,t,r,n)}async checkMergeRangeError(e,t){const r=this.workbook.getSheetById(e);if(!r)return null;const{from:n,to:i}=t,a=r.getFilterPlugin(),s=a.filterView.filter((e=>e?.isFilterEnabled()));if(a.filter?.isFilterEnabled()&&s.push(a.filter),t.getHeight()>1){if(s.some((e=>e.getRange().overlaps(t))))return o.default.VERT_MERGE_IN_FILTER}else if(s.some((e=>{const r=e.getRange();return n.row===r.from.row&&r.includesRange(t)||(r.from.col<=n.col&&n.col<=r.to.col)!=(r.from.col<=i.col&&i.col<=r.to.col)&&r.overlaps(t)})))return o.default.MERGE_CROSS_FILTER;const l=r.getPlugin("synoFreezeBar");return l.fixedRowsTop>n.row&&l.fixedRowsTop<=i.row||l.fixedColumnsLeft>n.col&&l.fixedColumnsLeft<=i.col?o.default.MERGE_FREEZED:null}async checkMergeOverlay(e,t,r){return this.workbook.getSheetById(e)?.getMergePlugin().checkMergeOverlay(t,r)??!1}async checkIncompleteMergedCells(e,t){return this.workbook.getSheetById(e)?.getMergePlugin().containsIncompleteMergedCells(t)??!1}async checkMoveEnable(e,t,r,n,i,a){const s=this.workbook.getSheetById(e);if(s)return"row"!==t||s.getFilterPlugin().checkMoveEnable(r,n,i,a)?s.getPlugin("synoMergeCell").checkMoveEnable(t,r,n,i)?void 0:o.default.MOVE_MERGE_CELL:o.default.MOVE_FIRST_FILTER}async checkExistValidation(e,t,r){const n=this.workbook.getSheetById(e);if(!n)return null;const i=n.getValidationPlugin(),o=i.getValidationFromJson(t,r);return o?i.checkExistValid(o):null}async previewFormula(e,t){const r=new h.BaseItem,n=this.workbook.getFormulaParser().exec(e,{sheetId:t,item:r}).result;return{result:Array.isArray(n)?null:n,nfId:r.nfId,isLink:r.isLink()}}async parseRange(e,t){return this.workbook.getFormulaParser().parseRange(e,{sheetId:t})}async validateFormula(e,t){return this.workbook.getFormulaParser().exec(e,{sheetId:t}).error!==n.Exception.ERROR}async setRenderHeights(e,t){const r=this.workbook.getSheetById(e);r&&r.getPlugin("synoRenderCache").setRenderHeights(t)}async calcRenderRanges(e,t){const r=this.workbook.getSheetById(e);r&&r.calcRenderRanges(t)}async getSheetDimension(e){const t=this.workbook.getSheetById(e);return t?t.getDimensionStateJSON():{rowCount:0,colCount:0}}async getRangeStyle(e,t,r){const n=this.workbook.getSheetById(e);return n?(0,l.generate2DArray)(r.row-t.row+1,r.col-t.col+1,((e,r)=>n.getCellStyle(e+t.row,r+t.col)?.toStyleJSON()??null)):[]}async getRangeComputedStyle(e,t,r){const n=this.workbook.getSheetById(e);return(0,l.generate2DArray)(r.row-t.row+1,r.col-t.col+1,((e,r)=>(n?n.getDataModel().getComputedCellStyle(e+t.row,r+t.col):this.workbook.getStyleManager().getDefaultStyle()).toStyleJSON()))}async getRangeCellByKey(e,t,r,n){const i=this.workbook.getSheetById(e);return i?(0,l.generate2DArray)(r.row-t.row+1,r.col-t.col+1,((e,r)=>{const o={},a=e+t.row,s=r+t.col;for(const e of n)switch(e){case"v":{const e=i.getDataAtCell(a,s);o.v=(0,u.isRichTextValue)(e)?e.toJSON():e;break}case"renderDesc":o.renderDesc=i.getCellTextDesc(a,s).getState();break;case"link":o.link=i.getCellMeta(a,s)?.link?.toJSON();break;case"xf":o.xf=i.getCellModel(a,s)?.getXfId()??null;break;case"formulaValue":o.formulaValue=i.getCellFormulaValue(a,s)}return o})):[]}async getRangeData(e,t,r){const n=this.workbook.getSheetById(e);return n?(0,l.generate2DArray)(r.row-t.row+1,r.col-t.col+1,((e,r)=>{const i=n.getDataAtCell(e+t.row,r+t.col);return(0,u.isRichTextValue)(i)?i.toJSON():i})):[]}async getRangeRenderedTexts(e,t,r){const n=this.workbook.getSheetById(e);return n?(0,l.generate2DArray)(r.row-t.row+1,r.col-t.col+1,((e,r)=>n.renderCache.getCellText(e+t.row,r+t.col))):[]}async getRangeHyperlink(e,t,r){const n=this.workbook.getSheetById(e);return(0,l.generate2DArray)(r.row-t.row+1,r.col-t.col+1,((e,r)=>n?.getCellMeta(e+t.row,r+t.col)?.link?.toJSON()??null))}async getRangeValidId(e,t,r){const n=this.workbook.getSheetById(e);return(0,l.generate2DArray)(r.row-t.row+1,r.col-t.col+1,((e,r)=>n?.getCellMeta(e+t.row,r+t.col)?.validId??null))}async getRowInfo(e){return this.workbook.getSheetById(e)?.getRowsStateJSON()??[]}async getColInfo(e){return this.workbook.getSheetById(e)?.getColsStateJSON()??[]}async getActiveFilterData(e){const t=this.workbook.getSheetById(e);if(!t)return null;const r=t.getFilterPlugin(),n=r.filter?.getId(),i=r.filter?.getRange();return n&&i?{id:n,range:i,activeId:r.getActiveId()}:null}async getFilteredRows(e,t,r){const n=this.workbook.getSheetById(e);return n?Array.from({length:r-t+1},((e,r)=>n.isFilteredRow(r+t))):[]}async getAutoFilterRange(e,t){const r=this.workbook.getSheetById(e);if(!r)return t;const n=new c.SynoCellRange(...r.getFilterPlugin().getAutoFilterRange(t.toArray()));return r.getMergePlugin().expandSelection(n),n}async getMergedRange(e,t,r){return this.workbook.getSheetById(e)?.getMergePlugin().getMergedRange(t,r)}async getMergedOverlap(e,t){return this.workbook.getSheetById(e)?.getMergePlugin().getOverlap(t)??[]}async createListRangeItems(e,t,r,n){const i=this.workbook.getSheetById(e)?.getValidationPlugin().getValidation(t);return i?.createListRangeItems(r,n)??[]}async calculateExternalChanges(e,t){const r=this.getWorkbook();return await r.getExternalManager().calculateChanges(e,t,r)}async calculateEmptyRefExternalChanges(){const e=this.getWorkbook();return e.forAll((e=>{e.sheet.formula.calculateAllImoprtItem()})),e.getExternalManager().calculateEmptyRefChanges()}async getUnlinkChanges(e){const t=[];return this.getWorkbook().forAll(((r,n)=>{const i=r.sheet.formula.getUnlinkChanges(e);i.length>0&&t.push([n,i])})),t}async listExternalLinkIds(){return this.getWorkbook().getExternalManager().listLinkIds()}async getAutofillObject(e,t,r,n,i,o,a){const s=this.workbook.getSheetById(e);if(!s)return null;const l=o?e=>s.isFilteredRow(e):()=>!1;return s.getPlugin("synoAutofill").getAutofillObject(t,r,n,l,i,a)}async getCfJSONById(e,t){return this.workbook.getSheetById(e)?.getPlugin("synoConditionalFormat").findCfJSON(t)}async getCfIndexById(e,t){return this.workbook.getSheetById(e)?.getPlugin("synoConditionalFormat").findIndexById(t)??-1}async setSearching(e){this.workbook.getCurrentSheet()?.getPlugin("synoSearch").setSearching(e)}async searchAll(e,t){await Promise.all(e.map((async e=>{const r=this.workbook.getSheetById(e);await(r?.getPlugin("synoSearch").searchAll(t))})))}async getReplaceChanges(e,t){return this.workbook.getSheetById(e)?.getPlugin("synoSearch").getReplaceChanges(t)??[]}async getRowOrder(e,t,r,n){return this.workbook.getSheetById(e)?.getPlugin("synoSort").getRowOrder(t,r,n)??null}async getReplaceAllChanges(e,t){return Promise.all(e.map((e=>{const r=this.workbook.getSheetById(e);return r?r.getPlugin("synoSearch").getReplaceAllChanges(t):[e,[]]})))}async getChartPosition(e,t){return this.workbook.getSheetById(e)?.getDrawingPlugin().getChartById(t)?.position??null}async getImagesJSON(e){return this.workbook.getSheetById(e)?.getDrawingPlugin().getImagesJSON()??[]}async getMergedCellFormatChanges(e,t,r){return this.workbook.getSheetById(e)?.getMergedCellFormatChanges(t,r)??{}}async getMergedRangesArray(e){const t=this.workbook.getSheetById(e);return t?t.getMergePlugin().serialize():[]}async getFrozenRowColumn(e){const t=this.workbook.getSheetById(e);if(!t)return{row:0,col:0};const r=t.getPlugin("synoFreezeBar");return{row:r.fixedRowsTop,col:r.fixedColumnsLeft}}}},50312:(e,t,r)=>{"use strict";r.d(t,{WorkerDataBridge:()=>h});var n=r(54375),i=r(60083),o=r(72748),a=r(37802),s=r(94061),l=r(94455),u=r(65880),c=r(84406);class h extends i.DataBridge{constructor(e,t,r,i){super();const s=new Worker("webman/3rdparty/Spreadsheet//lib/sheet.worker.js?v=1670925136418");this.storeUpdater=new o.StoreUpdater(this,i),this.worker=(0,n.wrap)(s),this.worker.initWorkbook(e.getCode(),e.getData(),r),this.workbook=new a.default(this.storeUpdater.getStore(),e),s.addEventListener("message",(e=>this.handleWorkerEvent(e)))}handleWorkerEvent(e){if(!(0,c.isNotifierMessage)(e))return;const t=e.data;switch(t.cmd){case"notifyDataChange":this.storeUpdater.notifyDataChange(...t.args);break;case"onAlert":this.storeUpdater.onAlert(...t.args);break;case"onAlterGrid":this.storeUpdater.onAlterGrid(...t.args);break;case"onColorAdded":this.storeUpdater.onColorAdded(...t.args);break;case"onCoordsChanges":this.storeUpdater.onCoordsChanges(...t.args);break;case"onFilterViewUpdated":this.storeUpdater.onFilterViewUpdated(...t.args);break;case"onCurrentSheetChange":this.storeUpdater.onCurrentSheetChange(...t.args);break;case"onCommentChanged":this.storeUpdater.onCommentChanged(...t.args);break;case"onExternalRequest":this.storeUpdater.onExternalRequest(...t.args);break;case"onSearchResultChange":this.storeUpdater.onSearchResultChange(...t.args);break;case"onSheetChanges":this.storeUpdater.onSheetChanges(...t.args);break;case"onSheetPluginChanges":this.storeUpdater.onSheetPluginChanges(...t.args);break;case"onStyleAdded":this.storeUpdater.onStyleAdded(...t.args);break;case"onExternalChanged":this.storeUpdater.onExternalChanged(...t.args);break;case"onClearRenderHeight":this.storeUpdater.onClearRenderHeight(...t.args);break;case"onRenderHeightAlterGrid":this.storeUpdater.onRenderHeightAlterGrid(...t.args);break;case"onRenderHeightMove":this.storeUpdater.onRenderHeightMove(...t.args)}}async asyncInit(e,t){const r=await this.worker.asyncInit(e,t.activeId);return(0,s.handleInitGenerator)(r,(async()=>{t.onActiveInit&&(await this.storeUpdater.initData(),t.onActiveInit())}))}async forceUpdate(){await this.worker.flushThrottle(),await this.storeUpdater.flushDirty()}async startObserve(){return Promise.all([this.worker.startObserve(),this.storeUpdater.initData()])}getWorkbook(){return this.workbook}async setCurrent(e){await this.worker.setCurrent(e),await this.forceUpdate()}async setReadonly(e){await this.worker.setReadonly(e)}async setCommentable(e){await this.worker.setCommentable(e)}async _execCommand(e){const t=await this.worker.execCommand(e);return t?u.converter.action.fromData(t)??void 0:void 0}async _execRemoteCommand(e){await this.worker.execRemoteCommand(e)}async*iteratePrintSheet(e){const t=new a.default((0,l.createStore)(),this.getWorkbook().getLocale()),r={styles:1,fonts:1,fills:1,alignments:1,borders:1,numberFormats:1},n=await this.getStyleManagerDataView(r);t.commitStore("styleManager/appendStyles",{appendData:n,indexes:r});for(const r of e){const e=await this.getSheetDataView(r.sheetId);if(e){t.commitStore("flushData",{current:r.sheetId}),t.commitStore("worksheet/flush",e.worksheet);for(const[r,n]of Object.entries(e.plugins))t.commitStore(`worksheet/${r}/flush`,n);yield[t.getCurrentSheet(),r]}}}async generateWorksheetContent(e){return await this.worker.generateWorksheetContent(e)}async validateRuleCommand(e,t){return await this.worker.validateRuleCommand(e,t)}async checkProtectRefRange(e,t,r,n){const i=Array.isArray(e)?e.map(u.converter.refRange.toData):u.converter.refRange.toData(e);return this.worker.checkProtectRefRange(i,t,r,n)}async checkProtectedWorksheets(e,t,r,n){return await this.worker.checkProtectedWorksheets(e,t,r,n)}async checkProtectedCoords(e,t,r,n){return await this.worker.checkProtectedCoords(e,t,r,n)}async checkProtectedInsertable(e,t,r,n,i){return await this.worker.checkProtectedInsertable(e,t,r,n,i)}async checkCommand(e,t,r,n){return await this.worker.checkCommand(e,t,r,n)}async checkMergeRangeError(e,t){return await this.worker.checkMergeRangeError(e,u.converter.range.toData(t))}async checkMergeOverlay(e,t,r){return await this.worker.checkMergeOverlay(e,u.converter.range.toData(t),r)}async checkIncompleteMergedCells(e,t){return await this.worker.checkIncompleteMergedCells(e,u.converter.range.toData(t))}async checkMoveEnable(e,t,r,n,i,o){return await this.worker.checkMoveEnable(e,t,r,n,i,o)}async checkExistValidation(e,t,r){return this.worker.checkExistValidation(e,t,r.map(u.converter.range.toData))}async previewFormula(e,t){return await this.worker.previewFormula(e,t)}async parseRange(e,t){const r=await this.worker.parseRange(e,t);return r?u.converter.refRange.fromData(r):null}async validateFormula(e,t){return await this.worker.validateFormula(e,t)}async getWorkbookDataView(){return this.worker.getWorkbookDataView()}async getNameManagerDataView(){return await this.worker.getNameManagerDataView()}async getRuleStoreDataView(e,t){return await this.worker.getRuleStoreDataView(e,t)}async getCommentStoreDataView(){return Object.freeze(await this.worker.getCommentStoreDataView())}async getStyleManagerDataView(e){return await this.worker.getStyleManagerDataView(e)}async collectColors(){return this.worker.collectColors()}async listExternalLinkInfo(){return await this.worker.listExternalLinkInfo()}async getSheetDataView(e){return await this.worker.getSheetDataView(e)}async getSheetScatterCellsDataView(e,t){return await this.worker.getSheetScatterCellsDataView(e,t)}async getSheetPartialDataView(e,t){return await this.worker.getSheetPartialDataView(e,t)}async getSheetPluginDataView(e,t){return await this.worker.getSheetPluginDataView(e,t)}async flushDirty(){await this.storeUpdater.flushDirty()}async setRenderHeights(e,t){this.storeUpdater.setRenderHeights(e,t)}async calcRenderRanges(e,t){await this.worker.calcRenderRanges(e,t.map(u.converter.range.toData))}async getSheetDimension(e){return await this.worker.getSheetDimension(e)}async getRangeStyle(e,t,r){return await this.worker.getRangeStyle(e,t,r)}async getRangeComputedStyle(e,t,r){return await this.worker.getRangeComputedStyle(e,t,r)}async getRangeCellByKey(e,t,r,n){return(await this.worker.getRangeCellByKey(e,t,r,n)).map((e=>e.map(u.converter.cellData.fromData)))}async getRangeData(e,t,r){return await this.worker.getRangeData(e,t,r)}async getRangeRenderedTexts(e,t,r){return await this.worker.getRangeRenderedTexts(e,t,r)}async getRangeHyperlink(e,t,r){return await this.worker.getRangeHyperlink(e,t,r)}async getRangeValidId(e,t,r){return await this.worker.getRangeValidId(e,t,r)}async getRowInfo(e){return await this.worker.getRowInfo(e)}async getColInfo(e){return await this.worker.getColInfo(e)}async getActiveFilterData(e){const t=await this.worker.getActiveFilterData(e);return t?{...t,range:u.converter.range.fromData(t.range)}:t}async getFilteredRows(e,t,r){return await this.worker.getFilteredRows(e,t,r)}async getAutoFilterRange(e,t){const r=await this.worker.getAutoFilterRange(e,u.converter.range.toData(t));return u.converter.range.fromData(r)}async getMergedRange(e,t,r){const n=await this.worker.getMergedRange(e,t,r);return n?u.converter.range.fromData(n):void 0}async getMergedOverlap(e,t){return(await this.worker.getMergedOverlap(e,u.converter.range.toData(t))).map(u.converter.range.fromData)}async createListRangeItems(e,t,r,n){return await this.worker.createListRangeItems(e,t,r,n)}async calculateExternalChanges(e,t){return await this.worker.calculateExternalChanges(e,t)}async calculateEmptyRefExternalChanges(){return await this.worker.calculateEmptyRefExternalChanges()}async getUnlinkChanges(e){return await this.worker.getUnlinkChanges(e)}async listExternalLinkIds(){return await this.worker.listExternalLinkIds()}async getAutofillObject(e,t,r,n,i,o,a){const s=await this.worker.getAutofillObject(e,t,r,n,i,o,a);return s?u.converter.autofillData.fromData(s):null}async getCfJSONById(e,t){return await this.worker.getCfJSONById(e,t)}async getCfIndexById(e,t){return await this.worker.getCfIndexById(e,t)}async setSearching(e){return await this.worker.setSearching(e)}async searchAll(e,t){return await this.worker.searchAll(e,u.converter.objRange.toData(t))}async getReplaceChanges(e,t){return await this.worker.getReplaceChanges(e,u.converter.objRange.toData(t))}async getReplaceAllChanges(e,t){return await this.worker.getReplaceAllChanges(e,u.converter.objRange.toData(t))}async getRowOrder(e,t,r,n){const i=await this.worker.getRowOrder(e,u.converter.range.toData(t),r,n);return i?{...i,range:u.converter.range.fromData(i.range)}:null}async getChartPosition(e,t){return await this.worker.getChartPosition(e,t)}async getImagesJSON(e){return await this.worker.getImagesJSON(e)}async getMergedCellFormatChanges(e,t,r){return await this.worker.getMergedCellFormatChanges(e,u.converter.range.toData(t),u.converter.autofillData.toData(r))}async getMergedRangesArray(e){return await this.worker.getMergedRangesArray(e)}async getFrozenRowColumn(e){return await this.worker.getFrozenRowColumn(e)}}},96803:(e,t,r)=>{"use strict";r.d(t,{default:()=>n});const n={DEFAULT_ROW_COUNT:100,DEFAULT_COL_COUNT:30,ROW_HEIGHT:21,COL_WIDTH:101,MIN_COL_WIDTH:20,MAX_COL_WIDTH:2e3,MIN_ROW_HEIGHT:21,MAX_ROW_HEIGHT:2e3,ROW_HEADER_WIDTH:50,COL_HEADER_HEIGHT:25,SCHEMA_VERSION:5,DEFAULT_FONT_SIZE:10,DEFAULT_FONT_NAME:"Arial",DEFAULT_FONT_COLOR:"000000",DEFAULT_FILL_COLOR:"FFFFFF",HYPER_LINK_COLOR:"0086E5"}},28178:(e,t,r)=>{"use strict";r.d(t,{containsAllVisibleRanges:()=>m,default:()=>v});var n=r(85978),i=r(2141),o=r(96803),a=r(79161),s=r(55180),l=r(89044),u=r(58835),c=r(84499),h=r(15343),d=r(4263),f=r(37873),g=r(54770);class p extends i.default{getColWidth(e){let t=o.default.COL_WIDTH;const r=this.worksheet.getColInfo(e);return r&&(!0===r.hidden?t=0:r.w&&(t=r.w)),t}getRowHeight(e){if(this.isHiddenRow(e))return 0;const t=this.worksheet.getRowInfo(e);return t&&t.h?t.h:this.renderCache.modifyRowHeight(e,o.default.ROW_HEIGHT)}isHiddenRowExcludeFilter(e){const t=this.getPlugin("synoFilter");return this.hidden.isHiddenRow(e)&&!t.isFilteredRow(e,!1)}isFilteredRow(e){const t=this.getPlugin("synoFilter");return t.isInViewState()?t.isViewHidden(e)&&t.isFilteredRow(e,!0):this.hidden.isHiddenRow(e)&&t.isFilteredRow(e,!1)}isHiddenRow(e){return this.isHiddenRowExcludeFilter(e)||this.isFilteredRow(e)}isHiddenCol(e){return this.hidden.isHiddenCol(e)}isHiddenCell(e,t){return this.isHiddenRow(e)||this.isHiddenCol(t)}isRowHidable(e,t){for(let t=0;tt;e--)if(!this.isHiddenRow(e))return!0;return!1}isColHidable(e,t){for(let t=0;tt;e--)if(!this.isHiddenCol(e))return!0;return!1}getHiddenPlugin(){return this.hidden}getFilterPlugin(){return this.getPlugin("synoFilter")}getMergePlugin(){return this.getPlugin("synoMergeCell")}getValidationPlugin(){return this.getPlugin("synoValidation")}getCfPlugin(){return this.getPlugin("synoConditionalFormat")}getFreezePlugin(){return this.getPlugin("synoFreezeBar")}getRowResizePlugin(){return this.getPlugin("synoManualRowResize")}getColResizePlugin(){return this.getPlugin("synoManualColumnResize")}getDrawingPlugin(){return this.getPlugin("synoDrawingController")}containsAllVisibleRanges(e,t){return m(e,("row"===t?this.isHiddenRow:this.isHiddenCol).bind(this),"row"===t?this.countRows():this.countCols())}findClosestCell(e,t){return(0,a.findClosestCell)(this,e,t)}getNonEmptyNeighborRange(e){return(0,a.getNonEmptyNeighborRange)(this,e)}setRenderHeights(e){this.getPlugin("synoRenderCache").setRenderHeights(e)}calcRenderRanges(e){for(const t of e)t.forAll(((e,t)=>{const r=this.getCellModel(e,t);if(r)if(this.isEmptyCell(e,t)){const n=r.getProperties();this.getPlugin("synoConditionalFormat").afterDataRenderer(e,t,r,n)}else{const n=this.getFormulaItem(e,t);n&&this.formula.updateItem(n),this.renderCache.renderData(e,t,r)}}));this.getFilterPlugin().calcRenderRanges(e),this.getDrawingPlugin().updateAllChartData()}getComputedBackgroundColor(e,t){const r=this.getCellModel(e,t),n=r&&this.getPlugin("synoConditionalFormat").getCfStyle(e,t,r,r.getProperties());if(n?.bgColor)return n.bgColor;const i=this.worksheet.getComputedCellStyle(e,t)?.getFill();return i?.bg||o.default.DEFAULT_FILL_COLOR}getComputedTextColors(e,t){const r=this.getCellModel(e,t);if(!r||!r.value)return[];const n=this.getPlugin("synoConditionalFormat").getCfStyle(e,t,r,r.getProperties());if(n?.color)return[n.color];const i=this.renderCache.getCellTextDesc(e,t),a=i?.getColor();if(a){const e=(0,l.color2hex)(`#${a}`);if(e)return[e.toLowerCase()]}const s=this.worksheet.getComputedCellStyle(e,t)?.getFont();if(i&&i.t===h.CellDesc.Type.LINK)return[s?.color||o.default.HYPER_LINK_COLOR];const c=s?.color||o.default.DEFAULT_FONT_COLOR;return(0,u.isRichTextValue)(r.value)?(0,u.getRichTextColors)(r.value,c):[c]}getVisibleRangeValues(e){const t=this.getWorkbook(),r=t.createBaseFormulaItem(),i=(new n.VisibleResolveOption).assign({keepNull:!0,keepNfId:!0,keepLink:!1,skipHiddenRow:!0,skipHiddenCol:!0,skipFiltered:!0});return{values:t.getFormulaParser().getRangeValues(e,{sheetId:this.sheetId,item:r},i),nfId:r.nfId}}getRangeTexts(e,t){let{rowStep:r=1,colStep:n=1}=void 0===t?{}:t;const i=[],[o,a,s,l]=e.toArray();let u;for(let e=o;e<=s;e+=r){i.push(u=[]);for(let t=a;t<=l;t+=n){const r=this.renderCache.getCellText(e,t);u.push(r)}}return i}getAllTexts(e){void 0===e&&(e=!1);const t=new f.SynoCellRange(0,0,this.countRows()-1,this.countCols()-1),r=this.getRangeTexts(t);return e&&(0,s.trim2DArray)(r),r}getCellTextDesc(e,t){return this.renderCache.getCellTextDesc(e,t)}getSpillRange(e,t){const r=this.formula.getSpillItem(e,t);return r?d.default.createFromRange(r.getSpillRange()?.getRange(),this)?.toSynoRange()??null:null}getCellFormulaValue(e,t){return this.formula.getCellValue(e,t)}getPartialStateJSON(e){const t={};for(const r of e)switch(r){case"cells":t[r]=this.getCellsStateJSON();break;case"rows":t[r]=this.getRowsStateJSON();break;case"cols":t[r]=this.getColsStateJSON();break;case"rowCount":t[r]=this.countRows();break;case"colCount":t[r]=this.countCols();break;case"global":t[r]=this.worksheet.getGlobalInfo();break;case"formulaDimensions":t[r]=this.getFormulaDimensions()}return t}getPluginStateJSON(e){const t={};for(const r of e)switch(r){case"filter":t[r]=this.getFilterPlugin().getStateJSON();break;case"merge":t[r]=this.getPlugin("synoMergeCell").getStateJSON();break;case"validation":t[r]=this.getValidationPlugin().getStateJSON();break;case"cf":t[r]=this.getCfPlugin().getStateJSON();break;case"freeze":t[r]=this.getFreezePlugin().getStateJSON();break;case"drawing":t[r]=this.getDrawingPlugin().getStateJSON()}return t}getStateJSON(){return{worksheet:this.getPartialStateJSON(["rowCount","colCount","rows","cols","global","cells","formulaDimensions"]),plugins:this.getPluginStateJSON(["freeze","merge","cf","filter","validation","drawing"])}}getDimensionStateJSON(){return{rowCount:this.countRows(),colCount:this.countCols()}}getRowsStateJSON(){return Array.from({length:this.countRows()},((e,t)=>{const r=this.worksheet.getRowInfo(t),n={hidden:this.hidden.isHiddenRow(t)};return r?.h&&(n.h=r.h),r?.s&&(n.s=r.s),n}))}getColsStateJSON(){return Array.from({length:this.countCols()},((e,t)=>{const r={hidden:this.hidden.isHiddenCol(t),w:this.getColWidth(t)},n=this.worksheet.getColInfo(t);return n?.s&&(r.s=n.s),r}))}getCellsStateJSON(){return this.getRangeCellsStateJSON({row:0,col:0},{row:this.countRows(),col:this.countCols()})}getRangeCellsStateJSON(e,t){return(0,s.generate2DArray)(t.row-e.row+1,t.col-e.col+1,((t,r)=>this.getCellStateJSON(t+e.row,r+e.col)))}getScatterCellsStateJSON(e){return e.map((e=>{let{row:t,col:r}=e;return this.getCellStateJSON(t,r)}))}getCellStateJSON(e,t){const r=this.getCellModel(e,t),i=r?.getValue(),o=(0,c.isEmptyValue)(i)?this.formula.getSpillItem(e,t):null;if(!r&&(!o||o.needUpdate||o.needCheckSpill||o.spillError))return null;const a=r?.getProperties();let s=o?this.formula.getSpillValue(o.getValue(),e-o.row,t-o.col):r?.getFormulaItem()?.getValue()??null;for(;Array.isArray(s);)s=s[0];return{v:(0,u.isRichTextValue)(i)?i.toJSON():i,n:r?.note,s:r?.xfId,link:a?.link?.getStateJSON()??null,comment:a?.comment,cfStyle:a?.cfStyle,validId:a?.validId,synoInvalid:a?.synoInvalid,formulaItem:r?.getFormulaItem()?.getStateJSON(),cellFormulaValue:(0,n.serializeFormulaValue)(s),renderDesc:this.renderCache.getCellDescState(e,t)}}getFormulaDimensions(){return this.getFormulaDepManager().getSpillContainer().getAllFormulaRanges().map((e=>{if(!e.getSpillItem())return null;const t=e.getRange();return[t.from.row,t.from.col,t.to.row,t.to.col]})).filter(g.isNonNull)}}function m(e,t,r){const n=e[Symbol.iterator]();let i=n.next();for(let e=0;ee))return!1}return!0}const v=p},66798:(e,t,r)=>{"use strict";r.d(t,{default:()=>h});var n=r(57312),i=r(69655),o=r(96803),a=r(4263),s=r(47649),l=r(94061),u=r(73321),c=r(51725);const h={MODEL:n.default,Define:o.default,dataBridgeFactory:c.dataBridgeFactory,editor:u.default,Sync:i.default,BoundRange:a.default,Initializer:l,initGlobalInstance:s.initGlobalInstance,plugins:null,viewPlugins:null}},47649:(e,t,r)=>{"use strict";r.d(t,{initGlobalInstance:()=>a});var n=r(73321),i=r(57312),o=r(20404);function a(e,t,r){return n.default.init({undoRedo:new o.default,bridge:e,dataBridge:t,action:r||new i.default.Action}),n.default}},94061:(e,t,r)=>{"use strict";r.r(t),r.d(t,{INIT_STATE:()=>u,asyncGeneratorInit:()=>c,asyncInit:()=>d,createSheet:()=>l,handleInitGenerator:()=>h,initStyle:()=>f,remapStylesheet:()=>m,syncInit:()=>p});var n=r(80442),i=r(57312),o=r(36978),a=r(55180),s=r(40328);function l(e,t,r,n){const o=t.sheetId;if(e.hasSheet(o))return null;const a=(0,i.sheetFactory)(e);return e.addSheet(t.sheetId,a,n.title,r,n.tabColor,n.hidden),a.init(Object.assign({plugins:e.getEnabledPlugins()},t)),a}let u;async function*c(e,t,r){function n(r){const n=t.index.order.indexOf(r),i=t.index.sheets[r];return l(e,{sheetId:r,snapshot:t[r],deferInit:!0},n,i)}g(e,t);const i=t.index.order.slice(0),o=function(e,t){const r=t.order;let n="string"==typeof e?r.indexOf(e):-1;function i(e){return e&&!e.hidden}n=n<0?0:n;for(let e=n;e>=0;e--)if(i(t.sheets[r[e]]))return e;for(let e=n+1;e{e.sheet.getHyperlinkModel().recalcUnknownRefs()})),function(e){let t=!1;const r=["synoValidation","synoDrawingController","synoFilter","synoConditionalFormat"],{sheet:n,settings:i}=e;for(let e=0;e{let n=await e.next();for(;!n.done&&n.value.state!==u.ALL_SHEET_READY;){if(r)return;n.value.state===u.FIRST_READY&&t?.(),n=await e.next()}})();return{processDelayInfo:()=>n.then((async()=>{let t=await e.next();for(;!t.done;)t=await e.next();return t.value})),abort:function(){r=!0}}}function d(e,t,r){let{activeId:n,onActiveInit:i,runCalculator:o=!0}=r;const{abort:a,processDelayInfo:s}=h(c(e,t,n),i);return{abort:a,processDelayInfo:async()=>{const t=await s();return o&&e.getAsyncCalculator().start(),t}}}function f(e,t){t.fonts=t.fonts.map((e=>(0,n.recoverFontObject)(e))),t.alignments=t.alignments.map((e=>(0,n.recoverAlignmentObject)(e))),e.init(t)}function g(e,t){f(e.getStyleManager(),t.style),e.getNameManager().init(t.define);const r=o.default.fromJSON(t.comment||[]);e.setCommentStore(r),e.getRuleStore().init(t.protection||[]),e.getExternalManager().init(t.externals),e.setMaxIndex(t.index.maxIndex||0),t.index.order=(0,a.arrayUnique)(t.index.order)}function p(e,t,r){let{runCalculator:n=!0}=r;g(e,t);const i=t.index.order;for(let r=0;r{e.sheet.notifyDataReady()})),e.forAll((e=>{e.sheet.notifyPluginsReady()})),n&&e.getAsyncCalculator().start()}function m(e,t,r){const n=e.createStyleManager();f(n,r);const i=e.getStyleManager().transform(n);if(i){for(const e in t.cells)for(const r in t.cells[e]){const n=t.cells[e][r];n&&n.s&&(n.s=i[n.s])}for(const e in t.rows){const r=t.rows[e];r.s&&(r.s=i[r.s])}for(const e in t.cols){const r=t.cols[e];r.s&&(r.s=i[r.s])}}}!function(e){e[e.FIRST_READY=0]="FIRST_READY",e[e.PROCESSING_OTHER_SHEET=1]="PROCESSING_OTHER_SHEET",e[e.ALL_SHEET_READY=2]="ALL_SHEET_READY"}(u||(u={}))},73321:(e,t,r)=>{"use strict";r.d(t,{default:()=>n});const n=new class{constructor(){this._action=null,this._bridge=null,this._dataBridge=null,this._undoRedo=null,this._hot=null}init(e){let{action:t,bridge:r,dataBridge:n,undoRedo:i}=e;this._action=t,this._bridge=r,this._dataBridge=n,this._undoRedo=i}getWorkbook(){return this.getDataBridge().getWorkbook()}getAction(){return this._action}getUIBridge(){return this._bridge}getDataBridge(){return this._dataBridge}getUndoRedo(){return this._undoRedo}setView(e){this._hot=e}getView(){return this._hot}}},57312:(e,t,r)=>{"use strict";r.d(t,{default:()=>u,sheetFactory:()=>l});var n=r(26637),i=r(2141),o=r(21497),a=r(73754);const s={Workbook:n.default,Sheet:i.default,BaseAction:o.BaseAction,Action:o.default,BaseUIBridge:a.default};function l(e){return new s.Sheet(e)}const u=s},55180:(e,t,r)=>{"use strict";r.d(t,{arrayAlloc:()=>d,arrayConcat:()=>u,arrayEach:()=>o,arrayInsert:()=>f,arrayReduce:()=>i,arrayUnique:()=>a,findNext:()=>v,findPrev:()=>m,forEach2D:()=>g,generate2DArray:()=>y,indexOfLowerBoundBy:()=>c,indexOfUpperBound:()=>h,makeArray:()=>p,moveElement:()=>l,sparseArrayToObject:()=>s,trim2DArray:()=>C});var n=r(27601);function i(e,t,r,n){let i=-1;const o=e.length;for(n&&o&&(r=e[++i]);++i>1;r(e[o],t)?n=o+1:i=o}return n}function h(e,t){let r=0,n=e.length;for(;r>1;e[i]<=t?r=i+1:n=i}return r}function d(e,t,r){const n=e.splice(t);e.length+=r;for(let t=0;t=a;t--){const n=e[(t+i)%i];if(!r(n))return n}}function v(e,t,r,n){const i=e.length,o=e.indexOf(t),a=n?o+1+i:i;for(let t=o+1;tArray.from({length:t},((e,t)=>r(n,t)))))}function C(e,t){void 0===t&&(t=n.default);let r=0,i=0;for(let n=e.length-1;n>=0;n--)for(let o=e[n].length-1;o>=r;o--)t(e[n][o])||(i=Math.max(i,n+1),r=Math.max(r,o+1));e.length=i,e.forEach((e=>e.length=r))}},4263:(e,t,r)=>{"use strict";r.d(t,{default:()=>u,multiRangesToText:()=>c,textToMultiRanges:()=>h,textToMultiRangesByWorkbook:()=>d});var n=r(44499),i=r(59162),o=r(84499),a=r(37873),s=r(54770);class l{constructor(e,t,r,n){this.sheetInfo=e??void 0,this.from=t,this.to=r,this.type=n}toRange(){const e=this.sheetInfo?.shName;switch(this.type){case a.RangeType.all:case a.RangeType.row:return new n.RowRange(this.from.row,this.to.row,e);case a.RangeType.col:return new n.ColRange(this.from.col,this.to.col,e);default:return new n.CellRange(this.from,this.to,e)}}toSynoRange(){return(0,o.createRange)(this.from.row,this.from.col,this.to.row,this.to.col,this.type)}toLabel(){return this.toRange().toLabel()}getWidth(){return this.to.col-this.from.col+1}getHeight(){return this.to.row-this.from.row+1}eachCell(e){for(let t=this.from.row;t<=this.to.row;t++)for(let r=this.from.col;r<=this.to.col&&!1!==e(t,r);r++);}static create(e,t){return l.createByWorkbook(e,t.getWorkbook(),t.sheetId)}static createByWorkbook(e,t,r){const n=t.getNameManager().getVariable(e)?.value??e,o=(0,i.parseRange)(n);return o?l.createFromRangeByWorkbook(o,t,r):null}static toLabel(e,t){const r=t?{sheetId:t.sheetId,shName:t.getName()}:null;return new l(r,e.from,e.to,e.type).toLabel()}static createFromRange(e,t){const r=t.getWorkbook(),n=r.getIdByName(e.shName??"")??t.sheetId;return l.createFromRangeByWorkbook(e,r,n)}static createFromRangeByWorkbook(e,t,r){if(e.shName){const n=t.getIdByName(e.shName);if(!n)return null;r=n}if(!t.hasSheet(r))return null;const i=e.shName??t.getNameById(r),{rowCount:o,colCount:s}=t.getSheetDimension(r);let u,c;if((0,n.isCellRange)(e))u={...e.from},c={...e.to};else if((0,n.isRowRange)(e))u={row:e.from,col:0},c={row:e.to,col:s-1};else{if(!(0,n.isColRange)(e))return null;u={row:0,col:e.from},c={row:o-1,col:e.to}}if(u.row>=o||u.col>=s)return null;c.row>=o&&(c.row=o-1),c.col>=s&&(c.col=s-1);const h=0===u.col&&c.col===s-1,d=0===u.row&&c.row===o-1,f=(h?a.RangeType.row:a.RangeType.cell)|(d?a.RangeType.col:a.RangeType.cell);return new l({sheetId:r,shName:i},u,c,f)}static createFromCoords(e,t,r){return l.createFromSynoRange((0,o.createRange)(e,t,e,t),r)}static eachCell(e,t,r){const n=l.create(e,t);null!==n&&n.eachCell(r)}static textToRange(e,t){const r=(0,i.parseRange)(e);if(!r||!t)return;const n=l.createFromRange(r,t);return n?n.toSynoRange():void 0}static textToRangeByWorkbook(e,t,r){const n=(0,i.parseRange)(e);if(n)return l.createFromRangeByWorkbook(n,t,r)?.toSynoRange()}static createFromSynoRange(e,t){return new l(t?{sheetId:t.sheetId,shName:t.getName()}:null,e.from,e.to,e.type)}}const u=l;function c(e){return e.map((e=>l.toLabel(e)))}function h(e,t){return(0,i.splitMultiRanges)(e).map((e=>l.textToRange(e,t))).filter(s.isNonNull)}function d(e,t,r){return(0,i.splitMultiRanges)(e).map((e=>l.textToRangeByWorkbook(e,t,r))).filter(s.isNonNull)}},89044:(e,t,r)=>{"use strict";r.d(t,{color2hex:()=>s});var n=r(19818),i=r.n(n),o=r(76360),a=r.n(o);function s(e){if(!e||["initial","transparent"].includes(e))return null;if(["windowtext"].includes(e))return"000000";try{const t=i().get(e);if(null===t||0===t.value[t.value-1])return null;const r="rgb"===t.model?t.value:a()[t.model].rgb(t.value);return a().rgb.hex(r)}catch(e){return null}}},30471:(e,t,r)=>{"use strict";r.d(t,{conditionCheck:()=>h,getRelativeFormulaRange:()=>c,numberConditionFormula:()=>s,textConditionFormula:()=>a});var n=r(59162),i=r(85978),o=r(44499);function a(e,t,r){let n="";switch("number"==typeof r&&(r='"'+r+'"'),e){case"containsBlanks":n=`LEN(TRIM(${t}))=0`;break;case"notContainsBlanks":n=`LEN(TRIM(${t}))>0`;break;case"containsText":n=`NOT(ISERROR(SEARCH((${r}),(${t}))))`;break;case"notContainsText":n=`ISERROR(SEARCH((${r}),(${t})))`;break;case"beginsWith":n=`LEFT((${t}),LEN(${r}))=(${r})`;break;case"endsWith":n=`RIGHT((${t}),LEN(${r}))=(${r})`;break;case"exactText":n=`EXACT((${t}), (${r}))`}return n}function s(e,t,r,n){let i;switch(e){case"greaterThan":i=`(${t})>(${r})`;break;case"greaterThanOrEqual":i=`(${t})>=(${r})`;break;case"lessThan":i=`(${t})<(${r})`;break;case"lessThanOrEqual":i=`(${t})<=(${r})`;break;case"equal":i=`(${t})=(${r})`;break;case"notEqual":i=`(${t})<>(${r})`;break;case"between":i=`AND((${t})>=(${r}),(${t})<=(${n}))`;break;case"notBetween":i=`OR((${t})<(${r}),(${t})>(${n}))`;break;default:i=`${r}`}return i}function l(e,t){return e.constructor===t.constructor&&e.equals(t)&&(!e.shName||e.shName===t.shName)}function u(e,t){const r=[];for(let n=0;n{"use strict";let n;function i(e){return"type"in e&&null!=e.type}function o(e){return e.type===n.Absolute}function a(e){return e.type===n.OneAnchor}function s(e){return e.type===n.TwoAnchor}function l(e,t){return e.row===t.row&&e.col===t.col&&e.rowOffset===t.rowOffset&&e.colOffset===t.colOffset}function u(e,t){return e.type===t.type&&(o(e)&&o(t)?e.top===t.top&&e.left===t.left&&e.width===t.width&&e.height===t.height:a(e)&&a(t)?!!e.from==!!t.from&&l(e.from,t.from)&&e.width===t.width&&e.height===t.height:!(!s(e)||!s(t))&&!!e.from==!!t.from&&l(e.from,t.from)&&!!e.to==!!t.to&&l(e.to,t.to))}function c(e,t){return e.top<=t.top&&e.bottom>=t.bottom&&e.left<=t.left&&e.right>=t.right}function h(e,t){return e.topn,bboxContains:()=>c,bboxIntersect:()=>h,isAbsolutePosition:()=>o,isDrawingPosition:()=>i,isEqualDrawingPosition:()=>u,isOneAnchorPosition:()=>a,isTwoAnchorPosition:()=>s}),function(e){e[e.Absolute=0]="Absolute",e[e.OneAnchor=1]="OneAnchor",e[e.TwoAnchor=2]="TwoAnchor"}(n||(n={}))},59162:(e,t,r)=>{"use strict";r.d(t,{calcR1C1Bound:()=>p,createRangeFromToken:()=>c,fromA1ToR1C1:()=>a,fromR1C1ToA1:()=>s,isFormulaAbsolute:()=>l,isFormulaReferneceSelfOnly:()=>m,parseFormulaRange:()=>h,parseRange:()=>d,splitMultiRanges:()=>g});var n=r(44499),i=r(85978),o=r(3288);const{fromA1ToR1C1:a,fromR1C1ToA1:s,isFormulaAbsolute:l,transposeR1C1:u}=i.utils;function c(e){let t,r=null;switch(e.symbol){case o.SYMBOL.CELL:t=i.utils.rangeToCoords(e.getValue()),r=new n.CellRange(t[0],t[1],e.getSheetName());break;case o.SYMBOL.ROWRANGECELL:t=i.utils.rangeToCoords(e.getValue()),r=new n.RowRange(t[0].row,t[1].row,e.getSheetName());break;case o.SYMBOL.COLRANGECELL:t=i.utils.rangeToCoords(e.getValue()),r=new n.ColRange(t[0].col,t[1].col,e.getSheetName());break;case o.SYMBOL.VARIABLE:t=e.getValue().toLowerCase(),r=new n.NameRange(t,e.getSheetName())}return r}function h(e){const t=[],r=(0,o.tokenize)(e);for(let e=0,n=r.size();e0;e=e.trim()){const r=f.exec(e),n=e.indexOf(",",r?r[0].length:0),i=n<0?e:e.slice(0,n);t.push(i.trim()),e=e.slice(i.length+1)}return t}function p(e,t){const r=i.utils.getFormulaBound([e,t],!0);return{row:r.row||0,col:r.col||0}}function m(e){const t=(0,o.tokenize)(e,"R1C1");for(let e=0;e{"use strict";r.d(t,{getCellEditorValue:()=>u,parseValue:()=>h,parseValueInvert:()=>d});var n=r(31641),i=r(84499),o=r(58835),a=r(290),s=r(73505),l=r(27601);function u(e,t,r,n){const o=e.getDataAtCell(t,r),a=e.getCellStyle(t,r);if((0,i.isEmptyValue)(o)&&!a)return(0,i.isEmptyValue)(n)?"":n.toString();arguments.length<4&&(n=o);const s=a?.getNumberFormat(),l=a?.getQuotePrefix()??!1;return c(n,s,l,e.getWorkbook().getLocale())}function c(e,t,r,a){(0,i.isEmptyValue)(e)&&(e="");const u=a.getSSF(),c=a.getData();return(0,o.isRichTextValue)(e)?(e=e.clone(),r?e.insertFirst("'"):e):r?"'"+e:t?.isDate()?u.render(c.short_date,e):t?.isDuration()?u.render(c.duration,e):t?.isTime()&&!(0,l.default)(e)&&e<1?u.render(c.long_time,e):t?.isDateTime()?u.render(c.datetime,e):(0,s.default)(e)?e?"TRUE":"FALSE":t?.fc&&(0,n.isPercentFc)(t.fc)?u.render(t.fc,e):a.getLocaleConverter().localize(e).toString()}function h(e,t,r){if((0,n.isFormula)(t))return t.substr(1);const i=r&&r.text?null:e.getInputParser().parse(t)?.v;return(0,a.default)(i)||(0,s.default)(i)?i:t?'"'+t+'"':void 0}function d(e,t,r){if((0,a.default)(t)){if(r&&r.date){const r=e.getData().short_date;try{const n=e.getSSF().format(r,t);if(n.d)return n.v}catch(e){}}return t.toString()}return(0,s.default)(t)?t?"TRUE":"FALSE":(0,n.isFormulaString)(t)?t.substr(1,t.length-2):t?"="+t:void 0}new RegExp("^"+/(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/.source+"$")},58025:(e,t,r)=>{"use strict";function n(e,t){const r=e[Symbol.iterator](),n=[];for(let e=0;en})},40328:(e,t,r)=>{"use strict";function n(e){switch(typeof e){case"string":case"number":return e+"";case"object":return null===e?"":e.toString();case"undefined":return"";default:return e.toString()}}function i(){return new Promise((e=>setTimeout(e,0)))}r.d(t,{nextTick:()=>i,stringify:()=>n})},42443:(e,t,r)=>{"use strict";r.d(t,{RangePacker:()=>f,addPartialRange:()=>c,multiRangeClassify:()=>l,multiRangeCompact:()=>o,multiRangeCompactFilter:()=>a,multiRangeEachCellAsync:()=>s,refactorRanges:()=>u,removePartialRange:()=>h,unionRanges:()=>d});var n=r(30467),i=r(37873);function o(e,t){const r=[];let n={from:-2,to:-2};return e.map((e=>{const r=e.getTopLeftCorner(),n=e.getBottomRightCorner();return{from:r[t],to:n[t]}})).sort(((e,t)=>e.from-t.from)).forEach((e=>{1{for(let t=e.from;t<=e.to;t++)!0===r(t)&&n.push(t)})),n.getResult()}async function s(e,t,r,n){for(const i of e){const e=i.getTopLeftCorner(),o=i.getBottomRightCorner(),a=await t(e,o),s=await n(e.row,o.row);for(let t=e.row;t<=o.row;t++)if(!s[t-e.row])for(let n=e.col;n<=o.col;n++)r(t,n,a[t-e.row][n-e.col])}}function l(e,t,r){const n={rows:[],cols:[],all:[],normals:[]};for(let i=0;i{const r=[],n=[];for(const o of e)o.from.rowt-1?(r.push(new i.SynoCellRange(o.from.row,o.from.col,t-1,o.to.col)),n.push(new i.SynoCellRange(t,o.from.col,o.to.row,o.to.col))):o.to.row===t-1&&r.push(o):n.push(o);return{result:r,remain:n}},r=e=>{if(0===e.length)return[];const t=[];e.sort(((e,t)=>e.from.col-t.from.col));let r=e[0];t.push(r);for(let n=1;ne.clone().normalize())).sort(((e,t)=>e.from.row-t.from.row||e.from.col-t.from.col))).reduce(((e,t)=>(e.push(t.from.row,t.to.row+1),e)),[]).sort(((e,t)=>e-t));for(const i of o){const{result:o,remain:a}=t(e,i);e=a,n=n.concat(r(o))}return(e=>{const t=[];for(let r=0;rn.to.row+1)break;n.isVertiMergeable(r)&&(n.expandRow(r.from.row,r.to.row),e[t]=null)}}}}return t})(n)}function c(e,t){let r=!1;e=e.map((e=>e.clone()));for(const n of e){if(n.isVertiMergeable(t,!1)){n.expandRow(t.from.row,t.to.row),r=!0;break}if(n.isHoriMergeable(t,!1)){n.expandCol(t.from.col,t.to.col),r=!0;break}}return r||e.push(t),e}function h(e,t){const r=[],n=[];for(const o of e.map((e=>e.clone())))o.overlaps(t)?(o.from.rowt.to.row&&(r.push(new i.SynoCellRange(t.to.row+1,o.from.col,o.to.row,o.to.col)),o.to.row=t.to.row),o.from.colt.to.col&&(r.push(new i.SynoCellRange(o.from.row,t.to.col+1,o.to.row,o.to.col)),o.to.col=t.to.col),n.push(o)):r.push(o);return{newRanges:r,removeRanges:n}}function d(e){const t=e.reduce(((e,t)=>(e.push({coord:t[1]+0,start:!0,range:[t[0],t[2]+1]}),e.push({coord:t[3]+1,start:!1,range:[t[0],t[2]+1]}),e)),[]).sort(((e,t)=>e.coord-t.coord)),r=Object.keys(e.reduce(((e,t)=>(e[t[0]]=e[t[2]+1]=!0,e)),{})).map((e=>+e)).sort(((e,t)=>e-t)),i=[],o=new n.default(r);for(let e=0,r=0;e{const t=a.length;let r=null;s.forEach((t=>{return t[3]a.push(e))),a}class f{constructor(e){this._result=[],this._frag={from:-2,to:-2},this._init(e)}_init(e){if(Array.isArray(e))for(let t=0;t{"use strict";function n(e,t){return l(t,(function(t,r){e[r]=t})),e}function i(e){return null!==e&&"object"==typeof e?JSON.parse(JSON.stringify(e)):e}function o(e){return"[object Object]"==Object.prototype.toString.call(e)}function a(e,t,r,n){n.value=r,n.writable=!1!==n.writable,n.enumerable=!1!==n.enumerable,n.configurable=!1!==n.configurable,Object.defineProperty(e,t,n)}function s(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function l(e,t){for(const r in e)if(s(e,r)&&!1===t(e[r],r,e))break;return e}r.d(t,{deepClone:()=>i,defineGetter:()=>a,extend:()=>n,isObject:()=>o,objectEach:()=>l,objectHasOwnProperty:()=>s})},14345:(e,t,r)=>{"use strict";r(96803),r(73321),r(89044)},78051:(e,t,r)=>{"use strict";r.d(t,{offsetSearch:()=>i});var n=r(55180);function i(e,t){const r=(0,n.indexOfUpperBound)(e,t)-1;return r>e.length-2?e.length-2:r<0?0:r}},58530:(e,t,r)=>{"use strict";r.d(t,{AsyncGuard:()=>n});class n{constructor(e){this.fn=e,this.running=null,this.waiting=null}run(){return this.waiting?this.waiting:this.running?(this.waiting=this.running.finally((()=>(this.waiting=null,this._run()))),this.waiting):this._run()}_run(){return this.running=this.fn().finally((()=>{this.running=null})),this.running}}},87984:(e,t,r)=>{"use strict";r.d(t,{escapeRegExp:()=>o,isEmail:()=>i});const n=/^[a-zA-Z0-9!#$%&'*+\-/=?^_`{|}~."\\,()<>]+@([a-zA-Z0-9_&%!#+\-.]+)$/;function i(e){return n.test(e)}function o(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}},2031:(e,t,r)=>{"use strict";r.d(t,{findNonDuplicatedRowIndices:()=>i});var n=r(85978);function i(e,t){const r=e.map((e=>e.filter(((e,r)=>t[r])))),i=n.utils.findUnique(r),o=[];for(let e=0;e{"use strict";r.d(t,{deserializeCellHistoryValue:()=>g,deserializeRichTextInChanges:()=>u,getRichTextColors:()=>f,isRichTextJSON:()=>s,isRichTextValue:()=>a,normalizeRichtText:()=>h,richTextStyleToConfig:()=>d,serilizeRichTextInChanges:()=>l});var n=r(13574),i=r(65180),o=r(96803);function a(e){return e&&e.constructor===i.default}function s(e){return e&&(0,n.isObject)(e)&&"r"===e.t}function l(e){return e.map((e=>[e[0],e[1],a(e[2])?e[2].toJSON():e[2]]))}function u(e){for(let t=0;t0;){const t=n[i],r=n[i-1],l=t.tx,u=t.s,c=r.s;(0===l.length||(s=c,null===(a=u)||null===s?a===s:a.equals(s))||null===u&&o.test(l))&&(r.tx+=t.tx,e.splice(i,1)),i--}var a,s}(e.v),e}function d(e){if(!e)return null;const t=e.clone();t.name===o.default.DEFAULT_FONT_NAME&&(t.name=null),t.size===o.default.DEFAULT_FONT_SIZE&&(t.size=null),t.color===o.default.DEFAULT_FONT_COLOR&&(t.color=null);const r=t.toJSON();return Object.keys(r).length>0?r:null}function f(e,t){const r=new Set;for(const n of e.v)r.add(n.s?.color||t);return Array.from(r)}function g(e){if(null===e)return e;function t(e){try{const t=JSON.parse(e);return s(t)?i.default.fromJSON(t).getText():t}catch{return null}}return e.value=t(e.value),e.previous&&(e.previous.value=t(e.previous.value)),e}},30467:(e,t,r)=>{"use strict";r.d(t,{default:()=>n});const n=class{constructor(e){this.values=e,this.ranges=this.createTree(this.values.length),this.counts=new Array(this.ranges.length).fill(0)}createTree(e){let t=0;const r=e-1;for(let e=1;e=u?this.updateFromIndex(e,t,r,2*n+2):(this.updateFromIndex(e,u,r,2*n+1),this.updateFromIndex(u,t,r,2*n+2)),this.mergeNode(n)}splitNode(e){const t=2*e+1,r=2*e+2;r[this.values[e[0]],this.values[e[1]]]))}queryFromIndex(e){if(0!==this.counts[e])return this.counts[e]?[this.ranges[e]]:[];const t=this.queryFromIndex(2*e+1),r=this.queryFromIndex(2*e+2);return this.mergeRangeList(t,r)}mergeRangeList(e,t){return e.length>0&&t.length>0&&e[e.length-1][1]===t[0][0]&&(t[0]=[e.pop()[0],t[0][1]]),e.concat(t)}}},18912:(e,t,r)=>{"use strict";function n(e,t){function r(e){e&&e.s&&(e.s=t.get(e.s))}for(const t in e.cells){const n=e.cells[t];if(n)for(const e in n)r(n[e])}return o(e.rows,r),o(e.cols,r),r(e.global),e}function i(e,t){function r(e,r){if(Object.prototype.hasOwnProperty.call(e,r)){const n=e[r];"string"==typeof n&&(e[r]=t(n))}}for(const r in e.cells){const n=e.cells[r];if(!n)return;for(const e in n){const r=n[e];r&&"string"==typeof r.v&&"="===r.v[0]&&(r.v="="+t(r.v.slice(1)))}}for(const t in e.validation)r(e.validation[t],"f1"),r(e.validation[t],"f2");e.cfs.forEach((e=>{r(e,"f1"),r(e,"f2")}));for(const t of e.drawing)if("chart"===t.type){r(t.chartObj,"displayRange");for(const e of t.chartObj.plotArea?.series??[])r(e,"tx"),r(e,"cat"),r(e,"val")}}function o(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&!1===t(e[r],parseInt(r,10)))break}r.d(t,{changeWorksheetFormula:()=>i,replaceWorksheetXf:()=>n,sparseMapEach:()=>o})},20634:(e,t,r)=>{"use strict";r.d(t,{insertCoord:()=>i});var n=r(55180);function i(e,t){const r=(0,n.indexOfLowerBoundBy)(e,t,((e,t)=>e.row=e.length?e.push(t):e[r].row===t.row&&e[r].col===t.col||e.splice(r,0,t)}},88059:(e,t,r)=>{"use strict";r.d(t,{splitTextByDelimiter:()=>a});var n=r(87984);let i;function o(e,t){if(e[0]!==t)return e;const r=[];let n=!0,i=!1;for(const o of e.slice(1))n?o===t?i?(r.push(t),i=!1):i=!0:(i&&(n=!1),r.push(o)):r.push(o);return r.join("")}function a(e,t){const r=t.delimiters||[","],i=t.trimWhitespaces??!0,a=t.consecutiveAsOne??!1,s=(0,n.escapeRegExp)('"'),l="("+r.map((e=>(0,n.escapeRegExp)(e))).join("|")+")",u=`(?!${l})`,c=`(${u}.)`,h=a?"+":"",d=new RegExp(`^$|(${l}${h})|((${i?`(${u}\\s)*`:""}${u}${s}([^${s}]|(${s}${s}))*(${s}|$)${c}*)|${c}+)`,"gs"),f=e.match(d)||[],g=e=>!!e.match(new RegExp(`^${l}${h}$`,"s")),p=[];for(let e=0;e{"use strict";function n(e){return e[0].toUpperCase()+e.substr(1)}function i(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+e()+e()}function o(e){let t=e.length-1;for(;t>=0&&(e[t]<"0"||"9"o,isFormula:()=>a,isFormulaCondition:()=>l,isFormulaString:()=>s,isGeneralFc:()=>u,isPercentFc:()=>c,isQuotePrefix:()=>h,randomString:()=>i,toUpperCaseFirst:()=>n});new RegExp(/[&<>"'`]/g.source)},84499:(e,t,r)=>{"use strict";r.d(t,{addCrossChange:()=>f,addCrossRepairData:()=>d,createRange:()=>s,isEmptyValue:()=>l,isValueChanged:()=>u,splitNumber:()=>g,translateItemNfId:()=>h});var n=r(31641),i=r(58835),o=r(37873),a=r(13574);function s(e,t,r,n,i){return new o.SynoCellRange(e,t,r,n,i)}function l(e){return null==e||""===e}function u(e){return t=e[2],r=e[3],!(t===r||l(t)&&l(r)||(0,i.isRichTextValue)(t)&&(0,i.isRichTextValue)(r)&&t.equals(r));var t,r}const c=new Map([[-1,"datetime"],[-2,"short_date"],[-3,"long_time"],[-4,"current_format"]]);function h(e,t){if(-5===t)return"0.00%";if(t>0)return e.getStyleManager().getNumberFormat(t).fc;const r=c.get(t);return e.getLocale().getData()[r]||""}function d(e,t,r,n){(0,a.objectHasOwnProperty)(e,t)||(e[t]={}),(0,a.objectHasOwnProperty)(e[t],r)||(e[t][r]=[]),e[t][r].push(n)}function f(e,t,r){(0,a.objectHasOwnProperty)(e,t)||(e[t]=[]),e[t].push(r)}function g(e){switch(typeof e){case"number":return[void 0,e];case"string":if(!(0,n.isFormula)(e)){const t=/\d+$/.exec(e);if(null!==t)return[e.substr(0,e.length-t[0].length),parseInt(t[0],10)]}}return[]}},37873:(e,t,r)=>{"use strict";let n;r.d(t,{RangeType:()=>n,SynoCellRange:()=>i,getRangeBound:()=>s,iterateCellCoords:()=>a}),function(e){e[e.cell=0]="cell",e[e.row=1]="row",e[e.col=2]="col",e[e.all=3]="all"}(n||(n={}));class i{constructor(e,t,r,i,o){this.from={row:e,col:t},this.to={row:r,col:i},this.type=o||n.cell}isSingle(){return this.from.row===this.to.row&&this.from.col===this.to.col}isRowType(){return!!(this.type&n.row)}isColType(){return!!(this.type&n.col)}getHeight(){return Math.max(this.from.row,this.to.row)-Math.min(this.from.row,this.to.row)+1}getWidth(){return Math.max(this.from.col,this.to.col)-Math.min(this.from.col,this.to.col)+1}clone(){return new i(this.from.row,this.from.col,this.to.row,this.to.col,this.type)}isEqual(e){if(e.type!==this.type)return!1;const t=this.getTopLeftCorner(),r=this.getBottomRightCorner(),i=e.getTopLeftCorner(),o=e.getBottomRightCorner();return this.type===n.all||(this.type&n.row?i.row===t.row&&o.row===r.row:this.type&n.col?i.col===t.col&&o.col===r.col:t.row===i.row&&t.col===i.col&&r.row===o.row&&r.col===o.col)}includes(e){const t=this.getTopLeftCorner(),r=this.getBottomRightCorner(),i=e.row<0?0:e.row,o=e.col<0?0:e.col;return this.type===n.all||(this.type&n.row?t.row<=i&&i<=r.row:this.type&n.col?t.col<=o&&o<=r.col:t.row<=i&&i<=r.row&&t.col<=o&&o<=r.col)}includesRange(e){return!(e.type&~this.type)&&this.includes(e.getTopLeftCorner())&&this.includes(e.getBottomRightCorner())}overlaps(e){const t=this.getTopLeftCorner(),r=this.getBottomRightCorner(),i=e.getTopLeftCorner(),o=e.getBottomRightCorner(),a=Boolean((e.type|this.type)&n.col)||t.row<=o.row&&r.row>=i.row,s=Boolean((e.type|this.type)&n.row)||t.col<=o.col&&r.col>=i.col;return a&&s}expand(e){const t=this.getTopLeftCorner(),r=this.getBottomRightCorner();return(e.rowr.row||e.col>r.col)&&(this.from={row:Math.min(t.row,e.row),col:Math.min(t.col,e.col)},this.to={row:Math.max(r.row,e.row),col:Math.max(r.col,e.col)},!0)}expandByRange(e){if(this.includesRange(e))return!1;const t=this.getDirection(),r=this.getTopLeftCorner(),n=this.getBottomRightCorner(),i=e.getTopLeftCorner(),o=e.getBottomRightCorner();return this.from.row=Math.min(r.row,i.row),this.from.col=Math.min(r.col,i.col),this.to.row=Math.max(n.row,o.row),this.to.col=Math.max(n.col,o.col),this.setDirection(t),!0}getDirection(){return this.from.row<=this.to.row&&this.from.col<=this.to.col?"NW-SE":this.from.row<=this.to.row&&this.from.col>=this.to.col?"NE-SW":this.from.row>=this.to.row&&this.from.col>=this.to.col?"SE-NW":this.from.row>=this.to.row&&this.from.col<=this.to.col?"SW-NE":"NW-SE"}setDirection(e){let t,r;switch(e){case"NW-SE":t=this.getTopLeftCorner(),r=this.getBottomRightCorner(),this.from=t,this.to=r;break;case"NE-SW":t=this.getTopRightCorner(),r=this.getBottomLeftCorner(),this.from=t,this.to=r;break;case"SE-NW":t=this.getBottomRightCorner(),r=this.getTopLeftCorner(),this.from=t,this.to=r;break;case"SW-NE":t=this.getBottomLeftCorner(),r=this.getTopRightCorner(),this.from=t,this.to=r}}getTopLeftCorner(){return{row:Math.min(this.from.row,this.to.row),col:Math.min(this.from.col,this.to.col)}}getBottomRightCorner(){return{row:Math.max(this.from.row,this.to.row),col:Math.max(this.from.col,this.to.col)}}getTopRightCorner(){return{row:Math.min(this.from.row,this.to.row),col:Math.max(this.from.col,this.to.col)}}getBottomLeftCorner(){return{row:Math.max(this.from.row,this.to.row),col:Math.min(this.from.col,this.to.col)}}getBordersSharedWith(e){if(!this.includesRange(e))return[];const t=Math.min(this.from.row,this.to.row),r=Math.max(this.from.row,this.to.row),n=Math.min(this.from.col,this.to.col),i=Math.max(this.from.col,this.to.col),o=Math.min(e.from.row,e.to.row),a=Math.max(e.from.row,e.to.row),s=Math.min(e.from.col,e.to.col),l=Math.max(e.from.col,e.to.col),u=[];return t===o&&u.push("top"),i===l&&u.push("right"),r===a&&u.push("bottom"),n===s&&u.push("left"),u}forAll(e){const t=this.getTopLeftCorner(),r=this.getBottomRightCorner();for(let n=t.row;n<=r.row;n++)for(let i=t.col;i<=r.col;i++)if(!1===e(n,i))return!1}normalize(){const e=this.getTopLeftCorner(),t=this.getBottomRightCorner();return this.from=e,this.to=t,this}expandRowCol(e,t,r){this.from[e]=Math.min(t,this.from[e]),this.to[e]=Math.max(r,this.to[e])}expandRow(e,t){this.expandRowCol("row",e,t)}expandCol(e,t){this.expandRowCol("col",e,t)}isMergeable(e,t,r){return"row"===e?this.isVertiMergeable(t,r):this.isHoriMergeable(t,r)}isHoriMergeable(e,t){const r=this.getTopLeftCorner(),n=this.getBottomRightCorner(),i=e.getTopLeftCorner(),o=e.getBottomRightCorner();if(r.row===i.row&&n.row===o.row){if(!t&&r.col<=o.col+1&&i.col<=n.col+1)return!0;if(t&&(r.col===o.col+1||i.col===n.col+1))return!0}return!1}isVertiMergeable(e,t){const r=this.getTopLeftCorner(),n=this.getBottomRightCorner(),i=e.getTopLeftCorner(),o=e.getBottomRightCorner();if(r.col===i.col&&n.col===o.col){if(!t&&r.row<=o.row+1&&i.row<=n.row+1)return!0;if(t&&(r.row===o.row+1||i.row===n.row+1))return!0}return!1}insertAndSplit(e,t,r){const n=this.getDirection();let i=null;return this.normalize(),this.from[e]>=t?(this.from[e]+=r,this.to[e]+=r):this.to[e]>=t&&(i=this.clone(),i.from[e]=t+r,i.to[e]+=r,this.to[e]=t-1),this.setDirection(n),i}getOverlap(e){if(!this.overlaps(e))return null;const t=this.getTopLeftCorner(),r=this.getBottomRightCorner(),n=e.getTopLeftCorner(),o=e.getBottomRightCorner(),a=Math.max(t.row,n.row),s=Math.min(r.row,o.row),l=Math.max(t.col,n.col),u=Math.min(r.col,o.col);return new i(a,l,s,u)}toArray(){const e=this.getTopLeftCorner(),t=this.getBottomRightCorner();return[e.row,e.col,t.row,t.col]}diff(e,t,r){const n=this.clone().normalize();if(t>this.to[e]||r<=0)return n;const i=t+r-1,o=Math.max(t,n.from[e]),a=Math.min(i,n.to[e])-o+1;return("row"===e?n.getHeight():n.getWidth())<=a?null:(i=t.sec[0].start&&n<=t.sec[0].end?!t.isBackward&&i>=t.sec[1].start&&i<=t.sec[1].end?n=t.sec[0].start:n+=t.sec[1].amount:n>=t.sec[1].start&&n<=t.sec[1].end&&(n-=t.sec[0].amount),i>=t.sec[0].start&&i<=t.sec[0].end?i+=t.sec[1].amount:i>=t.sec[1].start&&i<=t.sec[1].end&&(t.isBackward&&this.from[e]>=t.sec[0].start&&this.from[e]<=t.sec[0].end?i=t.sec[1].end:i-=t.sec[0].amount);let o=null;if(i-n+1!==("row"===e?this.getHeight():this.getWidth())){let r;o=this.clone(),r=nthis.from[e]&&i>this.to[e]&&(o.to[e]=this.to[e])}return this.from[e]=n,this.to[e]=i,this.setDirection(r),o}moveAndSplit(e,t){const r=this.getDirection();this.normalize();let i=null,o=null,a=null;const s=t.isBackward?t.sec[1]:t.sec[0],l="row"===e&&this.type&n.col||"col"===e&&this.type&n.row;if(this.from[e]>t.sec[1].end||this.to[e]=t&&(this.from[e]+=r),this.to[e]>=t&&(this.to[e]+=r))}removeRowCol(e,t,r){return o(this.from,e,t,r),o(this.to,e,t,r),!(this.from[e]<0&&this.to[e]<0||(this.from[e]<0&&(this.from[e]=this.to[e]>=t?t:t-1),this.to[e]<0&&(this.to[e]=this.from[e]>=t?t:t-1),0))}static fromArray(e){return new i(e[0],e[1],e[2],e[3])}static fromRange(e){return new i(e.from.row,e.from.col,e.to.row,e.to.col)}}function o(e,t,r,n){const i=r+n-1;e[t]>i?e[t]-=n:e[t]>=r&&(e[t]=-1)}function*a(e){const[t,r,n,i]=e.toArray(),o=t<=n?1:-1,a=r<=i?1:-1,s=e.getHeight(),l=e.getWidth();for(let e=0;e{"use strict";function n(e){return null!=e}r.d(t,{isNonNull:()=>n})},60459:(e,t,r)=>{},43246:(e,t,r)=>{"use strict";r.d(t,{WorkbookHooks:()=>o});var n=r(13574);function i(e,t,r,n){const i=e[r];if(!i)return;let o=!1;for(let e=0,r=i.length;e!e.once)))}class o extends class{constructor(){this.contextPool=new WeakMap}getBucket(e){return this.contextPool.get(e)}getOrCreateBucket(e){let t=this.getBucket(e);return t||(t=Object.create(null),this.contextPool.set(e,t)),t}add(e,t,r){const n=this.getOrCreateBucket(r);if(!n)return;let i=n[e];void 0===i&&(i=n[e]=[]),i.includes(t)||i.push(t)}once(e,t,r){t.once=!0,this.add(e,t,r)}remove(e,t,r){const n=this.getBucket(r);if(!n||!n[e])return;const i=n[e].indexOf(t);i>-1&&n[e].splice(i,1)}has(e,t){const r=this.getBucket(t);return!(!r||!r[e])&&r[e].length>0}runWithArgs(e,t,r){if(!e)return;const n=this.getBucket(e);n&&i(n,e,t,r)}run(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;ir[t].length=0))}destroy(){}}{constructor(){super(),this.globalBucket=Object.create(null)}getBucket(e){return e?super.getBucket(e):this.globalBucket}getOrCreateBucket(e){return e?super.getOrCreateBucket(e):this.globalBucket}runWithArgs(e,t,r){e&&(super.runWithArgs(e,t,r),i(this.globalBucket,e,t,r))}destroy(){super.destroy(),this.removeContext(null)}}},19953:(e,t,r)=>{"use strict";r.d(t,{default:()=>i});var n=r(11607);class i{constructor(e){this.sheet=e,this.hyperlinks=new Map}init(e){for(const t of e)this.addHyperlink(t)}addInternalLink(e){this.addHyperlink(e),this.sheet.runHooks("afterAddInternalLink",e)}updateInternalLink(e){const t=this.hyperlinks.get(e.id);if(!t)return;const r={id:e.id,display:t.getDisplay(),location:t.getLocation()};t.setDisplay(e.display),t.setLocation(e.location),this.sheet.runHooks("afterUpdateInternalLink",e,r);const{row:n,col:i}=t.getCoords();this.sheet.notifyCellChanges(n,i)}removeInternalLink(e){const t=this.removeHyperlink(e);t&&this.sheet.runHooks("afterRemoveInternalLink",t.toJSON())}toJSON(){return Array.from(this.hyperlinks.values()).map((e=>e.toJSON()))}addHyperlink(e){const t=new n.default(e,this.sheet);this.hyperlinks.set(e.id,t),this.sheet.setCellMeta(e.row,e.col,[["link",t]])}removeHyperlink(e){const t=this.hyperlinks.get(e);if(!t)return null;this.hyperlinks.delete(e);const{row:r,col:n}=t.getCoords(),i=this.sheet.getCellMeta(r,n);return i&&i.link&&this.sheet.setCellMeta(r,n,[["link",null]]),t}createRowCol(e,t,r){for(const[,n]of this.hyperlinks){const i=n.getCoords();i[e]>=t&&(i[e]+=r,n.updateCoords(i))}}removeRowCol(e,t,r){for(const[n,i]of this.hyperlinks){const o=i.getCoords();o[e]{const i=n.getCoords();return t<=i[e]&&i[e]<=r})).map((e=>e.toJSON()))}collectRangeInfo(e,t){void 0===t&&(t=()=>!1);const r=[];for(let n=e.from.row;n<=e.to.row;n++){if(t(n))continue;const i=new Array(e.getWidth());for(let t=e.from.col;t<=e.to.col;t++)i[t-e.from.col]=this.sheet.getCellMeta(n,t)?.link?.toJSON();r.push(i)}return r}repairCross(e){if(e)for(const{id:t,location:r}of e)this.hyperlinks.get(t)?.repair({location:r})}recalcUnknownRefs(){for(const e of this.hyperlinks.values())e.recalcUnknownRefs()}}},79161:(e,t,r)=>{"use strict";r.d(t,{findClosestCell:()=>i,getNonEmptyNeighborRange:()=>o});var n=r(37873);function i(e,t,r){let n=t,i=r,o=1;for(;e.isHiddenRow(n);)if(n+=o,e.countRows()===n&&(o=-1,n=t-1),-1===n){n=t;break}for(o=1;e.isHiddenCol(i);)if(i+=o,e.countCols()===i&&(o=-1,i=r-1),-1===i){i=r;break}return{row:n,col:i}}function o(e,t){const r=e.getMergePlugin(),i=new Map,o=t=>{for(const{row:o,col:a}of(0,n.iterateCellCoords)(t)){const t=r.getMergedRange(o,a)?.from,n=t?.row??o,s=t?.col??a,l=`${n},${s}`;let u=i.get(l);if(void 0===u&&(u=e.isEmptyCell(n,s),i.set(l,u)),!u)return!1}return!0},a=e.countRows(),s=e.countCols();let l,u,[c,h,d,f]=t,g=!0;for(;g;){if(g=!1,l=c-1,l>=0){const e=n.SynoCellRange.fromArray([l,h,l,f]);o(e)||(g=!0,[c,h,,f]=e.toArray())}if(u=h-1,u>=0){const e=n.SynoCellRange.fromArray([c,u,d,u]);o(e)||(g=!0,[c,h,d]=e.toArray())}if(l=d+1,l{"use strict";r.d(t,{default:()=>o});var n=r(65804),i=r(16187);const o=class{constructor(e,t,r){this.d1900Jan0=new Date(1900,0,0);const o=n.default.preBuild(e);this.dateRules=t.map((e=>new n.default(e,o)));const a=i.default.preBuild(e);this.timeRules=r.map((e=>new i.default(e,a)))}parse(e,t){let r,n,i=null,o=null;const a=e.split(/\s+/);for(let e=0;e{"use strict";r.d(t,{default:()=>i});var n=r(87984);class i{constructor(e,t){this.sep="/",this.prebuilt=t,this.fields={},this.order=[],this.regex=this._parse(e)}static preBuild(e){const t=[];e.months.forEach((function(e){const r=e[2].toLowerCase();t.push(r);const n=e[1];"."===n.charAt(n.length-1)&&n.replace(/\.$/,"\\.?"),n!==r&&t.push(n.toLowerCase())})),t.sort((function(e,t){return t.length-e.length}));const r={_rawMonthRegex:"(\\d\\d?|"+t.join("|")+")",monthsMap:{},abbrMonthsMap:{}};return e.months.forEach((function(e,t){r.abbrMonthsMap[e[1].replace(/\.$/,"").toLowerCase()]=t,r.monthsMap[e[2].toLowerCase()]=t})),r}_parse(e){const t=e.length;for(let r=0;r31||1900!==i&&0===a)return null;c=2===s.length&&a<10?2:1}else a=n.getDate();if(this.fields.m)if(s=r[this.fields.m],/^\d+$/.test(s))o=parseInt(s,10)-1,u=2===s.length&&o<9?2:1;else{const{monthsMap:e,abbrMonthsMap:t}=this.prebuilt;s=s.replace(/\.$/,"").toLowerCase(),s in e?(o=e[s],u=4):s in t&&(o=t[s],u=3)}if(void 0===o||isNaN(o)||!(o>=0&&o<12))return null;const h={v:new Date(i,o,a,0),d:!0};return t&&(h.fc=this._getFc(l,u,c)),h}_getFc(e,t,r){return this.order.reduce(((n,i)=>("y"===i?n.push("y".repeat(e)):"m"===i?n.push("m".repeat(t)):"d"===i&&n.push("d".repeat(r)),n)),[]).join(this.sep)}}},16187:(e,t,r)=>{"use strict";r.d(t,{default:()=>i});var n=r(87984);class i{constructor(e,t){this.prebuilt=t,this.format=e,this.regex=this.parse(e,t)}static preBuild(e){const{long_day_period:t,short_day_period:r}=e;return{tokens:/"[^"]*"|AM\\\/PM|hh|mm|ss|h|m|s|\s+/g,rawPeriodRegex:["(",t.concat(r).sort((function(e,t){return t.length-e.length})).map((function(e){return(0,n.escapeRegExp)(e)})).join("|"),")"].join(""),rawNumberRegex:"(\\d+(?:\\.\\d+)?)",periodMap:{[r[0].toLowerCase()]:"A",[r[1].toLowerCase()]:"P",[t[0].toLowerCase()]:"AM",[t[1].toLowerCase()]:"PM"}}}parse(e,t){const r=(0,n.escapeRegExp)(e).replace(t.tokens,(e=>0===e.trim().length?"\\s+":"AM\\/PM"===e?t.rawPeriodRegex:34===e.charCodeAt(0)&&34===e.charCodeAt(e.length-1)?e.slice(1,-1).replace(/\s+/g,"\\s+"):"ss"===e||"s"===e?t.rawNumberRegex:"(\\d+)"));return new RegExp("^"+r+"$","i")}match(e,t){const r=e.match(this.regex);if(!r)return null;const n=this.prebuilt.periodMap;let i,o,a,s;const l=r.length;if(void 0!==(s=n[r[1].toLowerCase()])?(i=parseInt(r[2],10),o=parseInt(r[3],10),a=r[4]?parseInt(r[4],10):0):void 0!==(s=n[r[l-1].toLowerCase()])?(i=parseInt(r[1],10),o=parseInt(r[2],10),a=r[4]?parseInt(r[3],10):0):(i=parseInt(r[1],10),o=parseInt(r[2],10),a=r[3]?parseInt(r[3],10):0),isNaN(i)||isNaN(o)||isNaN(a)||s&&i>12)return null;("P"===s||"PM"===s)&&i<12?i+=12:"A"!==s&&"AM"!==s||12!==i||(i-=12);const u={v:new Date(1900,0,0,i,o,a),t:!0};return t&&(u.fc=this.getFc(this.format,i,o,a)),u}getFc(e,t,r,n){return 3600*t+60*r+n<86400?this.format:this.format.replace(/hh|h/,(function(e){return"["+e+"]"}))}}},23532:(e,t,r)=>{"use strict";r.d(t,{default:()=>a});var n=r(93302),i=r.n(n),o=r(85978);const a=class{constructor(e){this.nbsp=new RegExp(String.fromCharCode(160),"g"),this.localeHelper=e}getValidNumber(e){let t=parseFloat(e);if(Number.isNaN(t))return t;t=o.type.number.toEffective(t);try{e="+"===e.charAt(0)?e.slice(1):e;const r=new(i())(e);return r.eq(t)?t:parseFloat(r.toPrecision(15))}catch(e){}return NaN}normalizeNumericString(e){const t=this._getLocaleData(),r=this.localeHelper.getLocaleConverter().localeNumberSymbol;return r?e.replace(r,(function(e){return e===t.dec_sym?".":""})):e}parseNumericString(e){e=e.trim();const t=this.localeHelper.getLocaleConverter();let r,n;return null!==(r=t.localeRegularNum.exec(e))?(n=this.getValidNumber(this.normalizeNumericString(e)),isNaN(n)?null:r[3]?r[3].indexOf("+")<0&&r[3].indexOf("-")<0?{v:n,fc:"0.00E-00"}:{v:n,fc:"0.00E+00"}:{v:n}):null!==(r=t.localeGroupedNum.exec(e))?(n=this.getValidNumber(this.normalizeNumericString(e)),isNaN(n)?null:r.pop()?{v:n,fc:"#,##0.00"}:{v:n,fc:"#,##0"}):null}parsePercentageString(e){let t;const r=this._getLocaleData().dec_sym;if(e.length<=1||"%"!==e.charAt(e.length-1))return null;if(t=this.parseNumericString(e.slice(0,-1))){if(t.fc=t.fc||(e.indexOf(r)<0?"0":"0.00"),t.v=+(t.v/100).toPrecision(15),t.fc.indexOf("E")>=0)return t;t.fc+="%"}return t||null}_parseCurrencyString(e,t,r,n){const i=e.indexOf(t);if(-1===i)return null;let o,a=!1,s=null;const l=i+t.length;if(0===i?o=e.slice(l):1!==i||"+"!==e[0]&&"-"!==e[0]?n&&l===e.length&&(o=e.slice(0,i),a=!0):o=e[0]+e.slice(l).trim(),o&&(s=this.parseNumericString(o)),s){const n=`[$${t}]`,i=s.fc||(e.includes(r)?"#,##0.00":"#,##0");s.fc=a?i+n:n+i}return s}_isUSCurrencyNeeded(){const e=this.localeHelper.getCode();return"en_US"===e||["zh","ja","ko"].includes(e.slice(0,e.indexOf("_")))}parseCurrencyString(e){const{currency_sym:t,dec_sym:r}=this._getLocaleData();let n=this._parseCurrencyString(e,t,r,!0);return!n&&this._isUSCurrencyNeeded()&&(n=this._parseCurrencyString(e,"US$",r,!1)),n||null}parseFinancialString(e){let t;if(e.length<=2||"()"!==e.charAt(0)+e.charAt(e.length-1))return null;if(!(t=this.parseNumericString(e.slice(1,-1)))||t.v<0)return null;const r=this._getLocaleData().dec_sym;return t.v=-t.v,t.fc=t.fc||(e.indexOf(r)<0?"#,##0":"#,##0.00"),t.fc=t.fc+";("+t.fc+")",t}parseDateTimeString(e){const t=this.localeHelper.getDateParser().parse(e,!0);return t?{...t,v:o.type.date.serialize(t.v)}:t}parseBooleanString(e){const t=e.toUpperCase();return"TRUE"===t||"FALSE"===t?{v:"TRUE"===t}:null}parse(e){let t;if("string"!=typeof e)return null;const r=e.trim().replace(this.nbsp," ");return(t=this.parseBooleanString(r))||(t=this.parsePercentageString(r))||(t=this.parseCurrencyString(r))||(t=this.parseFinancialString(r))?t:(t=this.parseNumericString(r))?(t.numeric=!0,t):(t=this.parseDateTimeString(r))?(t.datetime=!0,t):null}_getLocaleData(){return this.localeHelper.getData()}}},41947:(e,t,r)=>{"use strict";r.d(t,{default:()=>s});var n=r(87984),i=r(31641),o=r(3288);function a(e){return null==e||""===e}class s{constructor(e){let{dec_sym:t,group_sym:r}=e;this.decSymbol=t,this.groupSymbol=r;const i=(0,n.escapeRegExp)(this.decSymbol),a=(0,n.escapeRegExp)(this.groupSymbol),s="^([+-]?)(\\d+\\.?\\d*|\\.\\d+)([eE][+-]?\\d+)?$",l="^([+-]?)(\\d{1,3})(,\\d{3})*(\\.\\d+)?$";if(this.normalNumberSymbol=/[.,]/g,this.normalRegularNum=new RegExp(s),this.normalGroupedNum=new RegExp(l),"."===this.decSymbol){this.localizeToken=this.normalizeToken=e=>e.getText();const e=e=>e;this.localizeFormula=this.normalizeFormula=e,this.localizeNumeric=this.normalizeNumeric=e,this.localeNumberSymbol=this.normalNumberSymbol,this.localeRegularNum=this.normalRegularNum,this.localeGroupedNum=this.normalGroupedNum,this.localeFormulaNum=new RegExp(s.slice(0,-1)),this.localeTokenize=o.tokenize}else{const e=s.replace(/\\\./g,i),t=l.replace(/\(,|\\\./g,(e=>"(,"===e?`(${a}`:i));this.localeNumberSymbol=new RegExp("["+i+a+"]","g"),this.localeRegularNum=new RegExp(e),this.localeGroupedNum=new RegExp(t),this.localeFormulaNum=new RegExp(e.slice(0,-1))}}localeLex(e,t){t=t&&t.symbol;const r=e._input.charAt(0);if("\\"===r)return t!==o.SYMBOL["{"]?e.parseError(`Unrecognized text: ${e._input}`):(e.yytext=r,e._input=e._input.substr(1),e.matched=e.matched+e.yytext,o.SYMBOL.COMMA);if(";"===r)return e.yytext=r,e._input=e._input.substr(1),e.matched=e.matched+e.yytext,t===o.SYMBOL["("]?o.SYMBOL.COMMA:o.SYMBOL.SEMICOLON;const n=this.localeFormulaNum.exec(e._input);return null!==n?(e.yytext=n[0],e._input=e._input.substr(n[0].length),e.matched=e.matched+e.yytext,o.SYMBOL.NUMBER):","===r||"."===r?e.parseError(`Unrecognized text: ${e._input}`):e.next()}localeTokenize(e){const t=new o.TokenList;for(o.lexer.setInput(e);!o.lexer.done;){const e=this.localeLex(o.lexer,t.getTopScope());o.lexer.yytext&&t.append(e,o.lexer.yytext)}return t}normalizeToken(e){const t=e.getText();switch(e.symbol){case o.SYMBOL.COMMA:return",";case o.SYMBOL.NUMBER:return this.normalizeNumeric(t)}return t}normalizeFormula(e){let t="";const r=this.localeTokenize(e);for(let e=0,n=r.size();ee===t?".":","))}localizeNumeric(e){return e.replace(this.normalNumberSymbol,(e=>"."===e?this.decSymbol:this.groupSymbol))}normalize(e){return a(e)?e:"number"==typeof e?e.toString():(0,i.isFormula)(e)?this.normalizeFormula(e):this.localeRegularNum.test(e)||this.localeGroupedNum.test(e)?this.normalizeNumeric(e):e.toString()}localize(e){return a(e)?e:"number"==typeof e?this.localizeNumeric(e.toString()):!0===e||!1===e?e?"TRUE":"FALSE":(0,i.isFormula)(e)?this.localizeFormula(e):this.normalRegularNum.test(e)||this.normalGroupedNum.test(e)?this.localizeNumeric(e):e.toString()}}},49347:(e,t,r)=>{"use strict";r.d(t,{default:()=>s});var n=r(50137),i=r(73317),o=r(41947),a=r(23532);const s=class{constructor(e,t){void 0===e&&(e="en_US"),void 0===t&&(t={}),this.code=e,this.collator=new Intl.Collator(e.replace("_","-"),{sensitivity:"accent"}),this.ssf=new n.default,this.localeData=this.initLocale(t),this.dateParser=this.createDateParser(this.localeData),this.localeConverter=new o.default(this.localeData),this.inputParser=new a.default(this)}getCode(){return this.code}getCollator(){return this.collator}getSSF(){return this.ssf}getDateParser(){return this.dateParser}getLocaleConverter(){return this.localeConverter}getInputParser(){return this.inputParser}getData(){return this.localeData}initLocale(e){const t=new Map([["months","MONTHS"],["days","DAYS"],["dec_sym","DEC"],["group_sym","GROUP"],["long_day_period","AMPM"],["short_day_period","SHORT_AMPM"],["currency_sym","CURRENCY_SYM"]]),r=Object.entries(e).filter((e=>t.has(e[0]))).map((e=>[t.get(e[0]),e[1]])),n=Object.assign(this.ssf.getLocaleData(),Object.fromEntries(r)),i=Object.assign({months:n.MONTHS,days:n.DAYS,dec_sym:n.DEC,group_sym:n.GROUP,currency_sym:n.CURRENCY_SYM,date_patterns:["M/D/Y","M/D"],long_time:"hh:mm:ss AM/PM",long_day_period:n.AMPM,short_time:"hh:mm AM/PM",short_date:"M/d/YYYY",short_day_period:n.SHORT_AMPM},e);return Object.assign(this.createLocaleExt(i),i)}createLocaleExt(e){const t=e.short_time,r=t.charAt(t.lastIndexOf("h")+1)||":";return{time_sym:r,datetime:e.short_date+" "+["hh","mm","ss"].join(r),duration:["[hh]","mm","ss"].join(r)}}createDateParser(e){const t=e.date_patterns||[];["Y-M-D","Y/M/D"].forEach((e=>{t.includes(e)||t.push(e)}));const r=[e.long_time,e.short_time],n=e.time_sym;return[["hh","mm","ss"].join(n),["hh","mm"].join(n)].forEach((e=>{r.includes(e)||r.push(e)})),new i.default(e,t,r)}}},2567:(e,t,r)=>{"use strict";r.d(t,{AsyncCalculator:()=>s});var n=r(94883),i=r(64613),o=r(40328),a=r(58114);class s{constructor(e,t){void 0===t&&(t=!1),this.taskHandlers=[this.formulaRecalculator=new a.FormulaRecalculator],t&&this.taskHandlers.push(new n.CellDescRenderer(e)),this.taskHandlers.push(this.formulaDimensioner=new i.default(e));for(const e of this.taskHandlers)e.on("add",(()=>this.runTask()));this.taskPromise=null,this.run=!1}start(){return this.run=!0,this.runTask()}stop(){this.run=!1}async runTask(){return this.taskPromise?this.taskPromise:this.run&&this.needCalculate()?this.taskPromise=(0,o.nextTick)().then((()=>(this.calculate(),this.taskPromise=null,this.runTask()))):void 0}needCalculate(){return this.taskHandlers.some((e=>e.hasTask()))}calculate(){this.formulaDimensioner.updateCalculated();const e=this.taskHandlers.find((e=>e.hasTask()));if(!e)return;const t=Date.now(),r=e.runTask();for(;!(r.next().done||Date.now()-t>4););}getFormulaDimensioner(){return this.formulaDimensioner}getFormulaRecalculator(){return this.formulaRecalculator}}},94883:(e,t,r)=>{"use strict";r.d(t,{CellDescRenderer:()=>i});var n=r(14868);class i extends n.TaskHandler{constructor(e){super(),this.workbook=e}hasTask(){return null!==this.findCalculateSheet()}*runTask(){const e=this.findCalculateSheet();e&&(yield*e.renderCache.calcNeedRenderCell())}findCalculateSheet(){for(const e of this.iteraterSheet())if(e&&e.renderCache.getNeedRenderSize()>0)return e;return null}*iteraterSheet(){const e=this.workbook.current?.sheetId;e&&(yield this.workbook.current);for(const t of this.workbook.getOrder())t!==e&&(yield this.workbook.getSheetById(t))}}},64613:(e,t,r)=>{"use strict";r.d(t,{default:()=>o});var n=r(44499),i=r(14868);class o extends i.TaskHandler{constructor(e){super(),this.workbook=e,this.needDimensionItemMap=new Map,this.calculatedItem=new Set}hasTask(){return this.calculatedItem.size>0||!!this.findCalculateTarget()}*runTask(){let e=this.workbook.current?this.needDimensionItemMap.get(this.workbook.current.sheetId):null;e&&0!==e.size||(e=this.findCalculateTarget());const t=e?Array.from(e):[];for(const e of t)this.checkArrayDimension(e),yield}findCalculateTarget(){for(const e of this.needDimensionItemMap.values())if(e.size>0)return e;return null}updateCalculated(){for(const e of this.calculatedItem){if(e.needUpdate)continue;const t=e.getValue();let r=0,n=0;Array.isArray(t)&&(r=t.length,Array.isArray(t[0])&&(n=t[0].length)),this.updateItemDimension(e,r,n)}this.calculatedItem.clear()}addCalculatedItem(e){this.calculatedItem.add(e),this.fireAddEvent()}updateItemSpillRange(e,t){e.setSpillRange(t)}updateItemDimension(e,t,r){if(!e.needDimension)return;const i=[],o=e.sheet,a=e.getSpillRange()?.getRange()??null,s=t<1||r<1;if(!(!a&&s||a&&a.to.row-a.from.row+1===t&&a.to.col-a.from.col+1===r)){if(s)this.updateItemSpillRange(e,null);else{const s=new n.CellRange({row:e.row,col:e.col},{row:e.row+t-1,col:e.col+r-1},o.getName()),l=o.getFormulaDepManager().getSpillContainer().getOrCreateFormulaRange(s);this.updateItemSpillRange(e,l);const u=a?a.to.row:-1,c=a?a.to.col:-1;for(let e=s.from.row;e<=s.to.row;e++)for(let t=s.from.col;t<=s.to.col;t++)(e>u||t>c)&&i.push({row:e,col:t})}i.length>0&&o.formula.fireUpdateEvent(i),o.notifySheetChanges(["formulaDimensions"])}}setNeedDimension(e){e.needDimension=!0;const t=e.sheet.sheetId;this.needDimensionItemMap.has(t)||this.needDimensionItemMap.set(t,new Set),this.needDimensionItemMap.get(t).add(e),this.fireAddEvent()}removeNeedDimension(e){e.needDimension=!1;const t=e.sheet.sheetId;this.needDimensionItemMap.get(t)?.delete(e),this.calculatedItem.delete(e)}checkArrayDimension(e){if(!e.needDimension)return;const{height:t,width:r}=this.workbook.getFormulaParser().execArrayDimension(e.formula,{sheetId:e.sheet.sheetId});this.updateItemDimension(e,t,r),this.removeNeedDimension(e)}}},58114:(e,t,r)=>{"use strict";r.d(t,{FormulaRecalculator:()=>i});var n=r(14868);class i extends n.TaskHandler{constructor(){super(),this.recalculateSet=new Set}hasTask(){return this.recalculateSet.size>0}*runTask(){for(const e of Array.from(this.recalculateSet)){const t=e.sheet.formula;t.generateChangeDep([[e.row,e.col]],"reset"),t.updateItem(e),this.removeTask(e),yield}}addTask(e){this.recalculateSet.add(e)}removeTask(e){this.recalculateSet.delete(e)}}},14868:(e,t,r)=>{"use strict";r.d(t,{TaskHandler:()=>i});var n=r(26729);class i extends n.EventEmitter{fireAddEvent(){this.emit("add")}}},34148:(e,t,r)=>{"use strict";r.d(t,{default:()=>i});class n{constructor(e,t,r,n){this.sheet=e,this.name=t,this.color=r||"",this.hidden=!!n}}const i=class{constructor(){this.sheetsInfo=new Map,this.sheetsOrder=[],this.nameMap=new Map,this.maxIndex=0}destroy(){this.sheetsInfo.forEach((e=>{e.sheet.destroy()}))}hasSheet(e){return this.sheetsInfo.has(e)}addSheet(e,t,r,i,o,a){return!this.hasSheet(e)&&(t.id=e.slice(3),this.sheetsInfo.set(e,new n(t,r,o,a)),i>=this.sheetsOrder.length?this.sheetsOrder.push(e):this.sheetsOrder.splice(i,0,e),this.nameMap.set(r,e),!0)}removeSheet(e){const t=this.sheetsInfo.get(e);return t&&(this.sheetsInfo.delete(e),this.nameMap.delete(t.name)),this.sheetsOrder=this.sheetsOrder.filter((t=>t!==e)),t&&t.sheet}hasSheetName(e){return this.nameMap.has(e)}getSheetByName(e){const t=this.nameMap.get(e);return"string"==typeof t?this.getSheetById(t):void 0}getSheetById(e){const t=this.sheetsInfo.get(e);return t&&t.sheet}getNameById(e){const t=this.sheetsInfo.get(e);return t&&t.name}getIdByName(e){return this.nameMap.get(e)}rename(e,t){const r=this.sheetsInfo.get(e);return r&&(this.nameMap.delete(r.name),r.name=t,this.nameMap.set(t,e)),!!r}setSheetHidden(e,t){const r=this.sheetsInfo.get(e);return r&&(r.hidden=!!t),!!r}isSheetHidden(e){const t=this.sheetsInfo.get(e);return!!t&&t.hidden}setSheetColor(e,t){const r=this.sheetsInfo.get(e);return r&&(r.color=t),!!r}getSheetColor(e){const t=this.sheetsInfo.get(e);return t&&t.color}setOrder(e){const t=new Set(e).size;return e.length===t&&this.getSheetCount()===t&&(this.sheetsOrder=e.slice(),!0)}getOrder(){return this.sheetsOrder.slice()}getSheetCount(){return this.sheetsOrder.length}getSheetPos(e){return this.sheetsOrder.indexOf(e)}getSheetInfo(e){return this.sheetsInfo.get(e)}getMaxIndex(){return this.maxIndex}setMaxIndex(e){this.maxIndex=e}}},31569:(e,t,r)=>{"use strict";r.d(t,{Cell:()=>n});class n{constructor(e,t){this.value=e,this.xfId=t,this.properties={}}getValue(){return this.value}setValue(e){this.value=e}setXfId(e){this.xfId=e}getXfId(){return this.xfId}getCellStyle(){return this._sm.getCellStyle(this.xfId)}isDefaultCellStyle(){return 0===this.xfId}setNote(e){this.note=e}getNote(){return this.note}setProperty(e,t){this.properties[e]=t}getProperties(){return this.properties}getFormulaItem(){return this.getProperties().formulaItem}getLink(){const e=this.getFormulaItem();return e&&e.href||""}}},18436:(e,t,r)=>{"use strict";r.d(t,{SheetChartInfoBase:()=>s});var n=r(59084);const i=n.Chart.configList.concat(["displayRange"]);class o extends n.Chart{static get configList(){return i}getDisplayRange(){return this.getConfig("displayRange")}setDisplayRange(e){return this.setConfig("displayRange",e)}}const a=Object.assign(Object.create(null),n.ChartInfo.prototype.getConfigMap(),{[o.configName]:o});class s extends n.ChartInfo{getConfigMap(){return a}}},5287:(e,t,r)=>{"use strict";r.d(t,{default:()=>p});var n=r(59084),i=r(18436),o=r(13574),a=r(4263),s=r(59162);const{DIRECTION:l,DEFAULT:u,CHART_TYPE:c}=n.Enum,{isDefined:h}=n.Utils;class d extends i.SheetChartInfoBase{constructor(e,t){!function(e,t){const r=t.sheet,n=e.plotArea,i=n&&n.series;if(!i||!Array.isArray(i)||!i.length)return;let o=!1;i.forEach((e=>{e&&(e.cat||e.tx||e.val)&&(e.cat=e.cat?f(e.cat,r):[],e.tx=e.tx?f(e.tx,r):[],e.val=e.val?f(e.val,r):[],o=!0)})),o&&(h(n.switchRowColumn)||function(e){function t(e){if(0===e.length)return null;let t=null;const r=e[0];if(r.getWidth()>1)t=l.ROW;else if(r.getHeight()>1)t=l.COL;else if(e.length>1){const n=e[1];r.to.row0){if(n=t(o.val),null!==n)break;i=i.concat(o.val)}}!n&&10&&(r=!0),i.tx.length>0&&(n=!0),r&&n))break}const i=e.plotArea.switchRowColumn;e.plotArea.useRowHeader=i?n:r,e.plotArea.useColumnHeader=i?r:n}(e),e.displayRange||function(e){const t=[],r=e.plotArea.series,n=e.plotArea.switchRowColumn,i=n?"row":"col",o=n?"col":"row";let s,l,u,c=!1,h=!1;if(r.forEach((e=>{if(0===e.val.length)return;const r=e.val;if(e.tx.length>0){const t=e.tx[0];t.sheetInfo?.sheetId===r[0].sheetInfo?.sheetId&&t.to[i]+1===r[0].from[i]?(r[0].from[i]-=1,c=!0):(r.unshift(t),c=!0)}t.push(r),!s&&e.cat.length>0&&(s=e.cat,t.unshift(s),h=!0)})),0===t.length)return void(e.displayRange="");if(h&&c){const e=t[1];if(1===e.length||1g(e))).join(",")}(e))}(e,t),super(e,t),this.data=[],this.drawableData=[],this.init()}readOptionCfg(e){this.sheet=e&&e.sheet}init(){this.rectRange=this.checkRectRange(),this.fillDataByRanges()}getDrawableData(){return this.drawableData.map(((e,t)=>e.map(((e,r)=>this._getDataFromCoord(e,t,r)))))}getRawData(e){return e?this.data:this.drawableData}getData(e,t,r){const n=this.getDataCoord(e,t,r);return this._getDataFromCoord(n,e,t)}_getDataFromCoord(e,t,r){const n=this.dataHasCat()&&0===t&&this.ensureChart().getType()!==c.SCATTER,i=this.dataHasTx()&&0===r;return(0,o.isObject)(e)?this.getSheetData(e.id,e.row,e.col,n||i):e}getDataCoord(e,t,r){return this._getData(this.getRawData(r),e,t)}getDataRowNumber(e){return this._getDataRowNumber(this.getRawData(e))}getDataColNumber(e){return this._getDataColNumber(this.getRawData(e))}setData(e,t,r){const n=this.getRawData(!0);n[e]||(n[e]=[]),n[e][t]=r}setDataByRange(e,t,r,n){const i=n.from.row,o=n.from.col;let a,s;const l=this.getSwitchRowColumn();n.forAll(function(n,u){a=l?u-o:n-i,s=l?n-i:u-o,this.setData(t+a,r+s,{row:n,col:u,id:e})}.bind(this))}_completeData(e){let t,r=0;for(e.forEach((function(e){e&&(r=Math.max(r,e.length))})),e[0]||(e[0]=[]),t=0;t[]));e.forEach((e=>{for(let r=n;r<=o;r++){const o={from:{row:e.from.row,col:e.from.col},to:{row:e.to.row,col:e.to.col}};o.from[t]=o.to[t]=r,s[r-n].push(new a.default(e.sheetInfo||i,o.from,o.to))}})),Array.prototype.push.apply(r,s)}const s=this.rectRange?this.rectRange.blocks:f(this.ensureDisplayRange(),this.sheet);if(this.rectRange&&this.getSwitchRowColumn())for(let e=0,t=s[0].length;eo(e)));const l=this.dataHasTx(),u="row"===t?"col":"row";function c(e){let t="",r="";if(l){const r=e[0];r.from[u]===r.to[u]?(t=r.toLabel(),e.shift()):(t=new a.default(r.sheetInfo,r.from,r.from).toLabel(),r.from[u]+=1)}return r=g(e),{tx:t,val:r}}const h={cat:"",tx:[],val:[]};let d=0;this.dataHasCat()&&(h.cat=c(r[0]).val,d+=1);for(let e=r.length;d{if(!e)return null;const t=this._getSheet(e.id);if(!t)return null;const r=t.worksheet.getComputedCellStyle(e.row,e.col).getNumberFormat();return r.isDefault()?null:r.fc},r="General";if("x"===e)this._fc.x=this.dataHasCat()?t(this.getDataCoord(0,this.dataHasTx()?1:0)):r;else if(e.startsWith("y")){const n=this.forEachSeries((function(t,r){const n=t.getAxis2();return n&&"y2"===e||!n&&"y2"!==e?r:null}));this._fc[e]=h(n)?t(this.getDataCoord(n+(this.dataHasCat()?1:0),this.dataHasTx()?1:0)):r}return this._fc[e]||r}getAxisFc(){return{x:this._retriveFormatCode("x"),y1:this._retriveFormatCode("y1"),y2:this._retriveFormatCode("y2")}}dataFormatter(e,t){const r=this.sheet.getWorkbook().getLocale().getSSF(),n=this._retriveFormatCode(t);return r.render(n,e)}getSourceSeriesCat(){return this._seriesData.cat}getSourceSeriesTx(e){return this._seriesData.tx[e]}getSourceSeriesVal(e){return this._seriesData.val[e]}_getSheet(e){return this.sheet.getWorkbook().getSheetById(e)}getOptionCfg(){return{sheet:this.sheet}}}function f(e,t){const r=(0,s.splitMultiRanges)(e),n=[];for(let e=0;e{"use strict";r.d(t,{default:()=>o});var n=r(5287);class i extends n.default{fillDrawableData(){let e,t,r,n;const i=this.getDataRowNumber(!0),o=this.getDataColNumber(!0),a=this.dataHasCat()?1:0,s=this.dataHasTx()?1:0,l=this.sheet.getWorkbook();function u(e){const t=l.getSheetById(e.id);return t&&!t.isHiddenCell(e.row,e.col)}for(this.drawableData=[],e=0;e{"use strict";r.d(t,{DataChartInfo:()=>i});var n=r(18436);class i extends n.SheetChartInfoBase{constructor(e,t,r,n,i){super(e,t),this.data=r,this.fc=n,this.ssf=i}getRawData(){return this.data}ensureDisplayRange(){return this.ensureChart().getConfig("displayRange")}dataFormatter(e,t){return this.ssf.render(this.fc[t]??"General",e)}}},35983:(e,t,r)=>{"use strict";r.d(t,{ExternalItem:()=>s});var n=r(77226),i=r(26729),o=r(85978);function a(e,t){const r=Array.isArray(e),i=Array.isArray(t);return r&&i?e.length===t.length&&e.every(((e,r)=>a(e,t[r]))):!r&&(0,n.default)(e)&&!i&&(0,n.default)(t)?e.message===t.error:e===t}class s extends i.EventEmitter{constructor(e,t){void 0===t&&(t=!1),super(),this.value=(0,o.deserializeFormulaValue)(e.value),this.fc=e.fc,this.loading=t,this.formulaItems=new Set}isLoading(){return this.loading}isEqual(e){let{value:t,fc:r}=e;return a(this.value,t)&&this.fc===r}updateValue(e,t){let{value:r,fc:n}=e;void 0===t&&(t=!1),this.value=(0,o.deserializeFormulaValue)(r),this.fc=n,this.loading=t;for(const e of Array.from(this.formulaItems))e.sheet.formula.generateChangeDep([[e.row,e.col]],"renew")}getValue(){return this.value}getFc(){return this.fc}addFormulaItem(e){this.formulaItems.add(e),this.emit("external_changed")}deleteFormulaItem(e){this.formulaItems.delete(e),this.emit("external_changed")}getReferenceCount(){return this.formulaItems.size}*iterateReference(){for(const e of this.formulaItems)yield e}toJSON(){const e={value:(0,o.serializeFormulaValue)(this.value)};return this.fc&&(e.fc=this.fc),e}}},72115:(e,t,r)=>{"use strict";r.d(t,{ExternalLink:()=>d});var n=r(26729),i=r(85978),o=r(35983),a=r(59162),s=r(40328),l=r(20634),u=r(84499),c=r(55060),h=r(47160);class d extends n.EventEmitter{constructor(e){super();const t=e?.entry??[];this.externalItemMap=new Map(t.map((e=>{let[t,r]=e;return[t,this.createExternalitem(r)]}))),this.identifier=e?.identifier??"",this.rev=e?.rev??-1,this.title=e?.title??"",this.updateTime=e?.updateTime??0}createExternalitem(e,t){const r=new o.ExternalItem(e,t);return r.on("external_changed",(()=>this.emit("external_changed"))),r}setupWorkbookNotFound(){for(const[,e]of this.externalItemMap)e.isLoading()&&e.updateValue({value:(0,i.serializeFormulaValue)(i.Exception.REF)})}async calculateChanges(e,t){if(!e)return this.setupWorkbookNotFound(),null;const{title:r,updateTime:n,snapshot:i,commandQueueInfo:o}=e,a=o.identifier,l=o.rev;if(a===this.identifier&&l===this.rev&&Array.from(this.externalItemMap.values()).every((e=>!e.isLoading())))return n===this.updateTime&&r===this.title?null:{identifier:a,rev:l,title:r,updateTime:n,changes:[]};const u=await(0,h.createExternalWorkbook)(i,o.commands,t),c=[];for(const[e,t]of this.externalItemMap){const r=this.getWorkbookValue(u,e);t.isEqual(r)||c.push([e,r]),await(0,s.nextTick)()}return{identifier:a,rev:l,title:r,updateTime:n,changes:c}}calculateEmptyRefChanges(){const e=[];for(const[t,r]of this.externalItemMap)0===r.getReferenceCount()&&e.push([t,null]);return e.length>0?{identifier:this.identifier,rev:this.rev,title:this.title,updateTime:this.updateTime,changes:e}:null}getWorkbookValue(e,t){const r=(0,a.parseRange)(t);if(!r||!r.shName)return{value:(0,i.serializeFormulaValue)(i.Exception.REF)};const n=e.getSheetByName(r.shName);if(!n)return{value:(0,i.serializeFormulaValue)(i.Exception.REF)};const o=new c.BaseItem,s=e.getFormulaParser().exec(t,{item:o,sheetId:n.sheetId}),l={value:(0,i.serializeFormulaValue)(s.error||s.result)};return o.nfId&&(l.fc=(0,u.translateItemNfId)(e,o.nfId)),l}updateEntries(e){let{identifier:t,rev:r,title:n,updateTime:i,changes:o}=e;for(const[e,t]of o)if(t){const r=this.externalItemMap.get(e);r?r.updateValue(t):this.externalItemMap.set(e,this.createExternalitem(t))}else this.externalItemMap.delete(e);this.identifier=t,this.rev=r,this.title=n,this.updateTime=i,this.emit("external_changed")}hasValue(e){return!!this.externalItemMap.get(e)}getValue(e){let t=this.externalItemMap.get(e);return t||(t=this.createExternalitem({value:(0,i.serializeFormulaValue)(i.Exception.LOADING)},!0),this.externalItemMap.set(e,t)),t}toJSON(){return{entry:Array.from(this.externalItemMap).filter((e=>{let[,t]=e;return!t.isLoading()})).map((e=>{let[t,r]=e;return[t,r.toJSON()]})),identifier:this.identifier,rev:this.rev,title:this.title,updateTime:this.updateTime}}getExternalCount(){return this.externalItemMap.size}getLinkInfo(){const e={};for(const t of this.externalItemMap.values())for(const r of t.iterateReference())e[r.sheet.sheetId]||(e[r.sheet.sheetId]=[]),(0,l.insertCoord)(e[r.sheet.sheetId],{row:r.row,col:r.col});return{title:this.title,updateTime:this.updateTime,ref:e}}}},20146:(e,t,r)=>{"use strict";r.d(t,{ExternalManager:()=>o});var n=r(26729),i=r(72115);class o extends n.EventEmitter{constructor(){super(),this.externalMap=new Map}init(e){e&&(this.externalMap=new Map(e.entry.map((e=>{let[t,r]=e;return[t,this.createExternalLink(t,r)]}))))}createExternalLink(e,t){const r=new i.ExternalLink(t);return r.on("external_changed",(()=>this.emitExternalChanged(e))),r}getOrCreateExternalModel(e){let t=this.externalMap.get(e);return t||(t=this.createExternalLink(e),this.externalMap.set(e,t),this.emitExternalChanged(e)),t}emitExternalChanged(e){this.emit("external_changed",e,this.getLinkInfo(e))}async calculateChanges(e,t,r){return this.externalMap.get(e)?.calculateChanges(t,r)??null}calculateEmptyRefChanges(){const e=[];for(const[t,r]of this.externalMap){const n=r.calculateEmptyRefChanges();n&&e.push([t,n])}return e}updateExternal(e,t){this.getOrCreateExternalModel(e).updateEntries(t)}removeExternal(e){for(const t of e)this.externalMap.delete(t),this.emit("external_changed",t,null)}hasExternalValue(e,t){return this.externalMap.get(e)?.hasValue(t)??!1}getExternalValue(e,t){return this.getOrCreateExternalModel(e).getValue(t)}listLinkIds(){return Array.from(this.externalMap.keys())}listLinkInfo(){return Array.from(this.externalMap.entries()).map((e=>{let[t,r]=e;return{linkId:t,...r.getLinkInfo()}}))}getLinkInfo(e){const t=this.externalMap.get(e);return t&&0!==t.getExternalCount()?{...t.getLinkInfo(),linkId:e}:null}toJSON(){return{entry:Array.from(this.externalMap).map((e=>{let[t,r]=e;return[t,r.toJSON()]})).filter((e=>{let[t,r]=e;return r.entry.length>0}))}}}},47160:(e,t,r)=>{"use strict";r.d(t,{createExternalWorkbook:()=>u});var n=r(26637),i=r(75610),o=r(94061),a=r(40328),s=r(49347),l=r(80442);async function u(e,t,r){const u=new n.default(new s.default(e.locale,e.locale_info),r.getEnabledPlugins(),r.getConstants());if(await(0,o.asyncInit)(u,e,{}).processDelayInfo(),t.length>0){const e=new i.default(u);for(const r of t)e.process((0,l.extract)(r)),await(0,a.nextTick)()}return u}},57138:(e,t,r)=>{"use strict";r.d(t,{ColRangeContainer:()=>u,RangeContainer:()=>s,RowRangeContainer:()=>l});var n=r(33014),i=r(55180),o=r(55248);class a{constructor(){this.blocks=[]}getFormulaRange(e){const t=this._getFirstBlock(e);return t&&t.getFormulaRange(e)}getOrCreateFormulaRange(e){const t=this.getFormulaRange(e);if(t)return t;const r=new o.FormulaRange(e);return this.addFormulaRange(r),r}addFormulaRange(){}_getFirstBlock(e){return this._getBlock(e.from)}_getBlock(){}_getBlockByIndex(){}matchFormulaRanges(e,t){return this._getBlock(e,t)?.matchFormulaRanges(e,t)??[]}getCoverFormulaRanges(e,t){return this._getBlock(e.row,e.col)?.getCoverFormulaRanges(e,t)??[]}getRefItemsToRow(){}getRefItemsToColumn(){}_each(e){for(let t=0;t{const n=r.getAllFormulaRanges();for(let r=0;r>7;const t=Math.floor(Math.log(e)/Math.log(2))-14;return 256+(e-(1<<14+t)>>7+t)+128*(t-1)}function h(e){return e>>4}},98997:(e,t,r)=>{"use strict";r.d(t,{FormulaError:()=>n});class n{constructor(e){this.err=e}getValue(){return this.err.message}}},2148:(e,t,r)=>{"use strict";r.d(t,{FormulaDepManager:()=>s});var n=r(57138),i=r(55180),o=r(4263),a=r(55060);class s{constructor(e){this.container=new n.RangeContainer,this.rowContainer=new n.RowRangeContainer,this.colContainer=new n.ColRangeContainer,this.nameContainer=e.getNameManager().getContainer(),this.spillContainer=new n.RangeContainer}getContainer(){return this.container}getRowContainer(){return this.rowContainer}getColContainer(){return this.colContainer}getNameContainer(){return this.nameContainer}getSpillContainer(){return this.spillContainer}matchFormulaRanges(e,t,r){const n=[];let o;return(o=this.container.matchFormulaRanges(e,t))&&(0,i.arrayConcat)(n,o),(o=this.rowContainer.matchFormulaRanges(e,0))&&(0,i.arrayConcat)(n,o),(o=this.colContainer.matchFormulaRanges(0,t))&&(0,i.arrayConcat)(n,o),(o=this.nameContainer.matchFormulaRanges(e,t,r))&&(0,i.arrayConcat)(n,o),(o=this.spillContainer.matchFormulaRanges(e,t))&&(0,i.arrayConcat)(n,o),n}getDependencies(e,t,r){const n=[],i=new Set,s=new Set,l=[],u=new Set,c=[],h=new Set,d=new Set,f=[];function g(e){for(let t=0;t{g(r.getFormulaDepManager().matchFormulaRanges(e,t,r.getName()))})),c.push(t)}}for(;f.length>0;){const e=f.pop();p(e.getRegisteredItems());const t=e.getRegisteredConds();for(let e=0;et.sheet!==e;return{items:r.filter((e=>!(0,a.isVectorItem)(e)&&o(e))),conds:n.filter(o),units:i.filter((t=>t.getSheet()!==e))}}getRenameRelatedItems(){const e=this.container.getAllFormulaRanges().concat(this.rowContainer.getAllFormulaRanges(),this.colContainer.getAllFormulaRanges()),t=[],r=[],n=new Set;for(let n=0;n!(0,a.isVectorItem)(e)))),(0,i.arrayConcat)(r,e[n].getRegisteredUnits());for(const e of this.spillContainer.getAllFormulaRanges()){const t=e.getSpillItem();t&&n.add(t)}return{deps:(0,i.arrayUnique)(t),units:(0,i.arrayUnique)(r),spills:n}}}},55248:(e,t,r)=>{"use strict";r.d(t,{FormulaRange:()=>n});class n{constructor(e){this._range=e,this.formulaItems=[],this.condItems=[],this.unitItems=[],this.spillItem=null}getRange(){return this._range}register(e){this.formulaItems.push(e)}unregister(e){const t=this.formulaItems.indexOf(e);t>=0&&this.formulaItems.splice(t,1)}getRegisteredItems(){return this.formulaItems}registerCond(e){this.condItems.push(e)}unregisterCond(e){const t=this.condItems.indexOf(e);t>=0&&this.condItems.splice(t,1)}getRegisteredConds(){return this.condItems}registerUnit(e){this.unitItems.push(e)}unregisterUnit(e){const t=this.unitItems.indexOf(e);t>=0&&this.unitItems.splice(t,1)}getRegisteredUnits(){return this.unitItems}registerSpillItem(e){if(this.spillItem)throw new Error("need unregister spill item first");this.spillItem=e}unregisterSpillItem(){this.spillItem=null}getSpillItem(){return this.spillItem}rangeEqual(e){return this._range.equals(e)}hasCoord(e,t){return this._range.includes(e,t)}isBetweenRow(e,t){return this._range.isBetweenRow(e,t)}isBetweenCol(e,t){return this._range.isBetweenCol(e,t)}isWithinRow(e,t){return this._range.isWithinRow(e,t)}isWithinCol(e,t){return this._range.isWithinCol(e,t)}}},54273:(e,t,r)=>{"use strict";r.d(t,{NameContainer:()=>s});var n=r(59162),i=r(55180),o=r(31641);class a{constructor(e,t){this.name=e,this.shId=t,this.deps=[]}static createId(e,t){return`${t},${e}`}}class s{constructor(e){this.blocks={},this.itemCollection={},this.workbook=e}getFormulaRange(e){const t=e.name,r=this.getIdByRange(e);return this._getFormulaRange(t,r)}getIdByRange(e){const{name:t,shName:r}=e,n=r&&this.workbook.getIdByName(r);if(void 0===n)return this.workbook.getNameManager().getWorkbookScope();const i=a.createId(t,n);return void 0===this.itemCollection[i]?this.workbook.getNameManager().getWorkbookScope():n}_getFormulaRange(e,t){return this.blocks[t]&&this.blocks[t][e]}addFormulaRange(e){const t=e._range.name,r=this.getIdByRange(e._range);void 0===this.blocks[r]&&(this.blocks[r]={}),this.blocks[r][t]=e}matchFormulaRanges(e,t,r){const n=this._getCoordDeps(e,t,r);this._addIndirectDeps(n);const i=[];for(let e=0;e{if(i.includes(e,t)&&i.shName===r)return n.push(o),!1})),n}_getNameDeps(e,t){const r=[];return this.forAllRange(((n,i)=>{if(n.name===e&&this.getIdByRange(n)===t)return r.push(i),!1})),r}_addIndirectDeps(e){const t=new Set;for(let r=0;r{if(e[a](t,r))return n.push(i),!1}));const s=[];this._addIndirectDeps(n);for(let e=0;e{"use strict";r.d(t,{RangeBlock:()=>n});class n{constructor(){this.fRanges=new Map}add(e){const t=e._range.key();this.fRanges.has(t)||this.fRanges.set(t,e)}getFormulaRange(e){return this.fRanges.get(e.key())}matchFormulaRanges(e,t){const r=[];return this.fRanges.forEach((n=>{n.hasCoord(e,t)&&r.push(n)})),r}getCoverFormulaRanges(e,t){const r=[];return this.fRanges.forEach((n=>{n.isWithinRow(e.row,t.row)&&n.isWithinCol(e.col,t.col)&&r.push(n)})),r}getAllFormulaRanges(){const e=new Array(this.fRanges.size);let t=0;return this.fRanges.forEach((r=>{e[t++]=r})),e}getFormulaRangeBetweenRow(e,t){const r=[];return this.fRanges.forEach((n=>{n.isBetweenRow(e,t)&&r.push(n)})),r}getFormulaRangeBetweenCol(e,t){const r=[];return this.fRanges.forEach((n=>{n.isBetweenCol(e,t)&&r.push(n)})),r}}},21523:(e,t,r)=>{"use strict";r.d(t,{default:()=>n});const n=class{constructor(){this.buckets={}}getByName(e){return this.buckets[e]||[]}addItem(e,t){Array.isArray(this.buckets[e])||(this.buckets[e]=[]),this.buckets[e].push(t)}removeItem(e,t){const r=this.index(e,t);-1!==r&&this.buckets[e].splice(r,1)}index(e,t){const r=this.buckets[e];return r?r.indexOf(t):-1}removeBucket(e){this.buckets[e]&&delete this.buckets[e]}}},11607:(e,t,r)=>{"use strict";r.d(t,{default:()=>u});var n=r(55060),i=r(55248),o=r(59162),a=r(84499),s=r(85978),l=r(3288);class u{constructor(e,t){this.sheet=t,this.id=e.id,this.row=e.row,this.col=e.col,this.display=e.display,this.location=e.location,this.item=new n.UnitItem(this),this.hash="#",this.registerItem()}toJSON(){return{id:this.id,row:this.row,col:this.col,display:this.display,location:this.location}}getStateJSON(){return Object.assign(this.toJSON(),{hash:this.getHash()})}registerItem(){this.item.unregister();const e=(0,o.parseRange)(this.location),t=e?.shName&&this.sheet.getWorkbook().getSheetByName(e.shName);if(!t)return void(this.hash="#");const r=e.getContainer(t.getFormulaDepManager());let n=r.getFormulaRange(e);n||(n=new i.FormulaRange(e),r.addFormulaRange(n)),this.hash=`#tid=${t.sheetId.slice(3)}&range=${this.location.slice(this.location.lastIndexOf("!")+1)}`,this.item.register([n])}getId(){return this.id}getDisplay(){return this.display}setDisplay(e){this.display=e}getLocation(){return this.location}setLocation(e){this.location=e,this.registerItem()}getHash(){return this.hash}getCoords(){return{row:this.row,col:this.col}}updateCoords(e){let{row:t,col:r}=e;this.row=t,this.col=r}repair(e){let{location:t}=e;this.setLocation(t)}changeLocationBy(e,t){const r=e(this.location);r!==this.location&&((0,a.addCrossRepairData)(t,this.sheet.sheetId,"hyperlink",{id:this.id,location:this.location}),this.location=r,this.registerItem())}notifyAlterGrid(e,t,r,n,i,o){this.changeLocationBy((i=>{const o={delta:n,start:{[e]:r}};return s.utils.changeFormula(i,o,t.getName())}),o)}notifyMove(e,t,r,n){this.changeLocationBy((n=>s.utils.moveFormula(e,n,r,t.getName(),this.sheet.getName())),n)}notifyRename(e,t,r){this.changeLocationBy((r=>(0,l.changeSheetName)(r,e,t)),r)}notifyMoveFormulaRange(e,t,r){this.changeLocationBy((r=>s.utils.changeFormulaRange(r,e,t,this.sheet.getName())),r)}notifyRecalcUnknown(){}notifyDeleteSheet(){}getSheet(){return this.sheet}recalcUnknownRefs(){"#"===this.hash&&this.registerItem()}}},35261:(e,t,r)=>{"use strict";r.d(t,{NameManager:()=>o});var n=r(13574),i=r(54273);class o{constructor(e){this.variables={},this.container=new i.NameContainer(e)}init(e){(0,n.objectEach)(e,((e,t)=>{for(const r in e)e[r]&&this.set(r,e[r],t)}))}getContainer(){return this.container}getWorkbookScope(){return"global"}getVariable(e,t){return this.variables[t]?.[e.toLowerCase()]}setVariable(e,t,r){if(void 0===this.variables[r]){if(void 0===t)return;this.variables[r]={}}const n=e.toLowerCase(),i=this.variables[r][n];return void 0===t?delete this.variables[r][n]:this.variables[r][n]={name:e,value:t},i}get(e,t){return t=t||this.getWorkbookScope(),this.getVariable(e,t)?.value}set(e,t,r){r=r||this.getWorkbookScope(),this.container.update(e,t,r);const n=this.setVariable(e,t,r);return n&&n.value}remove(e,t){t=t||this.getWorkbookScope(),this.container.remove(e,t);const r=this.setVariable(e,void 0,t);return r&&r.value}list(){const e=[];return this.each(((t,r)=>{const{name:n,value:i}=t;e.push({name:n,value:i,scope:r})})),e}each(e){for(const t in this.variables)if((0,n.objectHasOwnProperty)(this.variables,t)){const r=this.variables[t];for(const n in r)if(void 0!==r[n]&&!1===e(r[n],t))return}}toJSON(){const e={};return(0,n.objectEach)(this.variables,((t,r)=>{e[r]={};for(const i in t)if((0,n.objectHasOwnProperty)(t,i)){const n=t[i];e[r][n.name]=n.value}})),e}getStateJSON(){return{workbookScope:this.getWorkbookScope(),list:this.list()}}}},21542:(e,t,r)=>{"use strict";r.d(t,{WorkbookNotifier:()=>n});class n{onFlushUI(e){}notifyDataChange(e){}onCurrentSheetChange(e){}onCommentChanged(e){}onFilterViewUpdated(e){}onAlert(e){}onStyleAdded(){}onColorAdded(){}onExternalChanged(e,t){}onCoordsChanges(e,t){}onAlterGrid(e,t,r){}onSheetChanges(e,t){}onSheetPluginChanges(e,t){}onRenderHeightChange(e){}onClearRenderHeight(e,t){}onRenderHeightAlterGrid(e,t,r,n){}onRenderHeightMove(e,t,r){}onSearchResultChange(e,t){}onExternalRequest(e){}}},82476:(e,t,r)=>{"use strict";r.d(t,{RangeRule:()=>o,WorksheetRule:()=>a});var n=r(44499);class i{constructor(e){let{ruleId:t,sheetId:r,creator:n,range:i,description:o,acl:a}=e;this.id=t,this.sheetId=r,this.creator=n,this.description=o,this.acl=a||null,this.initRange(i)}isGrantable(e,t){return!this.isACLMode()||this.validateACL(e,t)}validateACL(e,t){return this.creator===e||null!==this.acl&&(this.acl.uids.includes(e)||this.acl.gids.some((e=>t.includes(e))))}update(e){void 0!==e.acl&&(this.acl=e.acl),void 0!==e.description&&(this.description=e.description),void 0!==e.range&&this.initRange(e.range),void 0!==e.sheetId&&(this.sheetId=e.sheetId)}getSheetId(){return this.sheetId}isACLMode(){return null!==this.acl}_toJSON(e){return{ruleId:this.id,type:this.getType(),sheetId:this.sheetId,creator:this.creator,range:e,acl:this.acl,description:this.description}}getProps(){const e=this.toJSON();return{acl:e.acl,description:e.description||"",range:e.range,sheetId:e.sheetId}}}class o extends i{getType(){return"range"}isCoordsAllowed(e,t){return!this.cellRange||!this.cellRange.includes(e,t)}isRangeAllowed(e){if(!this.cellRange)return!0;const[t,r,n,i]=s(this.cellRange);return!(e.isBetweenRow(t,n)&&e.isBetweenCol(r,i))}isInsertable(e,t){return!(this.cellRange&&this.cellRange.willBeExpanded(e,t))}toJSON(){return this._toJSON(this.cellRange&&this.cellRange.toLabel())}initRange(e){this.cellRange=(0,n.parseRefRange)(e)}onInsertRowCol(e,t,r,n){this.cellRange&&(this.cellRange=this.cellRange.insert(e,t,r,n))}onRemoveRowCol(e,t,r){if(!this.cellRange)return!0;const n=this.cellRange.remove(e,t,r);return null!==n&&(this.cellRange=n,!0)}onMoveRowCol(e,t){this.cellRange&&(this.cellRange=this.cellRange.move(e,t))}}class a extends i{getType(){return"worksheet"}isCoordsAllowed(e,t){return 0!==this.excludes.length&&this.excludes.some((r=>r.includes(e,t)))}isRangeAllowed(e){if(0===this.excludes.length)return!1;const[t,r,n,i]=s(e);return this.excludes.some((e=>e.includes(t,r)&&e.includes(n,i)))}isInsertable(e,t){return 0!==this.excludes.length&&this.excludes.some((r=>r.isInsertionWithin(e,t)))}initRange(e){this.excludes=e.map((e=>(0,n.parseRefRange)(e))).filter((e=>e))}toJSON(){return this._toJSON(this.excludes.map((e=>e.toLabel())))}onInsertRowCol(e,t,r,n){this.excludes=this.excludes.map((i=>i.insert(e,t,r,n)))}onRemoveRowCol(e,t,r){return this.excludes=this.excludes.reduce(((n,i)=>{const o=i.remove(e,t,r);return o&&n.push(o),n}),[]),!0}onMoveRowCol(e,t){this.excludes=this.excludes.map((r=>r.move(e,t)))}}function s(e){let t=-1,r=-1,i=-1,o=-1;return e.constructor===n.CellRange?(t=e.from.row,r=e.from.col,i=e.to.row,o=e.to.col):e.constructor===n.RowRange?(t=e.from,r=0,t=e.to,o=Number.MAX_VALUE):e.constructor===n.ColRange&&(t=0,r=e.from,i=Number.MAX_VALUE,o=e.to),[t,r,i,o]}},19870:(e,t,r)=>{"use strict";r.d(t,{default:()=>o});var n=r(82476);class i{constructor(){this.rules=[]}init(e){this.rules=e.map((e=>i.createRule(e))).filter((e=>!!e))}list(){return this.rules}create(e){if(!e||this.find(e.ruleId))return null;const t=i.createRule(e);return t&&this.rules.push(t),t}update(e,t){const r=this.find(e);return r?(r.update(t),r):null}find(e){return this.rules.find((t=>t.id===e))}delete(e){const t=this.rules.findIndex((t=>t.id===e));if(-1!==t){const e=this.rules[t];return this.rules.splice(t,1),e}return null}toJSON(){return this.rules.map((e=>e.toJSON()))}onInsertRowCol(e,t,r,n,i){for(const o of this.rules)o.getSheetId()===e&&o.onInsertRowCol(t,r,n,i)}onRemoveRowCol(e,t,r,n){this.rules=this.rules.filter((i=>i.getSheetId()!==e||i.onRemoveRowCol(t,r,n)))}onMoveRowCol(e,t,r){this.rules.forEach((n=>{n.getSheetId()===e&&n.onMoveRowCol(t,r)}))}getStateJSON(e,t){return{rules:this.rules.map((r=>({...r.toJSON(),isGrantable:r.isGrantable(e,t)})))}}static createRule(e){switch(e.type){case"range":return new n.RangeRule(e);case"worksheet":return new n.WorksheetRule(e);default:return null}}}const o=i},65180:(e,t,r)=>{"use strict";r.d(t,{default:()=>o});var n=r(80442),i=r(64260);class o{constructor(e){this.v=e||[]}getText(){let e="";for(let t=0;t{"use strict";r.d(t,{Row:()=>n});class n{constructor(){this.cells=[]}addCell(e,t){this.cells[e]=t}getCell(e){return this.cells[e]||null}_getCells(){return this.cells}getColLength(){return this.cells.length}forEach(e,t){this.cells.forEach(e,t)}}},52245:(e,t,r)=>{"use strict";r.d(t,{default:()=>a});var n=r(19363),i=r(53250);class o extends n.default{_insertRangeNode(e){const t=e.getRange(),r=(0,i.findMinExpandNode)(this.children,t).insert(e);r?this._appendNode(r):(this.assertRange(),this.range.expandByRange(t))}_checkChildDeletion(e,t){return this.children[e].delete(t)}_adjustOnDeletion(e){const t=this.children[e];if(t.getChildren().length>=i.MAX_CHILDREN_COUNT/2)return;const r=this.children[e-1],n=this.children[e+1],o=r?t:n,a=r?e:e+1,s=(r||t).mergeNextSibling(o);s?this.children[a]=s:this.children.splice(a,1)}getOverlap(e){return this.assertRange(),this.range.overlaps(e)?this.children.reduce(((t,r)=>t.concat(r.getOverlap(e))),[]):[]}getFirstRangeNode(){return this.children.length?this.children[0].getFirstRangeNode():null}getLastRangeNode(){return this.children.length?this.children[this.children.length-1].getLastRangeNode():null}_createSibling(e){return new o(e)}}const a=o},66456:(e,t,r)=>{"use strict";r.d(t,{default:()=>o});var n=r(19363);class i extends n.default{_insertRangeNode(e){this._appendNode(e)}_checkChildDeletion(e,t){return this.children[e].search(t)}_adjustOnDeletion(e){const t=this.children[e],r=t.prev,n=t.next;r&&(r.next=n),n&&(n.prev=r),this.children.splice(e,1)}getOverlap(e){return this.children.map((e=>e.getRange())).filter((t=>t.overlaps(e)))}getFirstRangeNode(){return this.children.length?this.children[0]:null}getLastRangeNode(){return this.children.length?this.children[this.children.length-1]:null}_createSibling(e){return new i(e)}}const o=i},57231:(e,t,r)=>{"use strict";r.d(t,{default:()=>a});var n=r(37873),i=r(96846);class o extends i.default{constructor(e,t,r){super(n.SynoCellRange.fromArray(e.toArray())),this.prev=t||null,this.next=r||null}}const a=o},96846:(e,t,r)=>{"use strict";r.d(t,{default:()=>n});const n=class{constructor(e){this.range=e}assertRange(){if(!this.range)throw new Error("range is missing.")}getRange(){return this.assertRange(),this.range.clone()}search(e){return this.assertRange(),this.range.isEqual(e)}hasOverlap(e){return this.assertRange(),this.range.overlaps(e)}onCreateRowCol(e,t,r){this.assertRange(),this.range.createRowCol(e,t,r)}onRemoveRowCol(e,t,r){this.assertRange(),this.range.removeRowCol(e,t,r)}}},13400:(e,t,r)=>{"use strict";r.d(t,{default:()=>f});var n=r(57231),i=r(19363),o=r(66456),a=r(52245),s=r(53250);function l(e,t,r){if(e.length<=s.MAX_CHILDREN_COUNT)return new o.default(e.map((e=>new n.default(e))));const i=new Array(Math.floor(e.length/r)).fill(r),f=e.length%r;if(f>0){const e=Math.floor((f+r)/2);i[i.length-1]=f+r-e,i.push(e)}const g="row"===t?e:e.slice().sort(u),p="col"===t?e:e.slice().sort(c),m=h(g,i),v=h(p,i);return d(m)<=d(v)?new a.default(m.map((e=>l(e,"row",r/s.MAX_CHILDREN_COUNT)))):new a.default(v.map((e=>l(e,"col",r/s.MAX_CHILDREN_COUNT))))}function u(e,t){return e.from.row-t.from.row||e.to.row-t.to.row}function c(e,t){return e.from.col-t.from.col||e.to.col-t.to.col}function h(e,t){const r=[];let n=0;for(let i=0,o=t.length;i{const i=n.clone();i.removeRowCol(e,t,r)&&!i.isSingle()||this.delete(n)})),this.root&&this.root.onRemoveRowCol(e,t,r)}onMoveRowCol(e,t){if(!this.root)return;const r=this.root.getRange();r.from[e]=t.sec[0].start,r.to[e]=t.sec[0].end;const n=this.getOverlap(r);n.forEach((e=>this.delete(e))),r.from[e]=t.sec[1].start,r.to[e]=t.sec[1].end;const i=this.getOverlap(r);i.forEach((e=>this.delete(e))),n.forEach((r=>{t.sec[0].start<=r.from[e]&&r.to[e]<=t.sec[0].end&&(r.from[e]+=t.sec[1].amount,r.to[e]+=t.sec[1].amount,this.insert(r))})),i.forEach((r=>{t.sec[1].start<=r.from[e]&&r.to[e]<=t.sec[1].end&&(r.from[e]-=t.sec[0].amount,r.to[e]-=t.sec[0].amount,this.insert(r))}))}_createTreeByRanges(e){const t=e.length;if(0===t)return null;const r=Math.ceil(Math.log(t)/Math.log(s.MAX_CHILDREN_COUNT))-1,n=Math.pow(s.MAX_CHILDREN_COUNT,r);return l(e.sort(u),"row",n)}}},19363:(e,t,r)=>{"use strict";r.d(t,{default:()=>s});var n=r(96846),i=r(53250);function o(e,t){const r=e&&e.getLastRangeNode?e.getLastRangeNode():e,n=t&&t.getFirstRangeNode?t.getFirstRangeNode():t;r&&(r.next=n),n&&(n.prev=r)}class a extends n.default{constructor(e){super(null),this.children=e||[],this._updateInfo()}insert(e){return this._insertRangeNode(e),this._isOverflow()?this._splitNodeOnOverflow():null}delete(e){if(!this.range||!this.range.includesRange(e))return!1;let t=-1;for(let r=0;rt.search(e)))}hasOverlap(e){return this.assertRange(),!!this.range.overlaps(e)&&this.children.some((t=>t.hasOverlap(e)))}onCreateRowCol(e,t,r){if(this.range&&!(t>this.range.to[e])){super.onCreateRowCol(e,t,r);for(let n=0,i=this.children.length;nthis.range.to[e])){super.onRemoveRowCol(e,t,r);for(let n=0,i=this.children.length;ni.MAX_CHILDREN_COUNT}_updateInfo(){this._updateRange();const e=this.children.length;let t=null;for(let r=0;r0){const t=this.getLastRangeNode(),r=t.next;o(t,e),o(e,r)}this.children.push(e),this.range?this.range.expandByRange(e.getRange()):this.range=e.getRange()}}const s=a},53250:(e,t,r)=>{"use strict";r.d(t,{MAX_CHILDREN_COUNT:()=>n,calcRangeArea:()=>i,findMinExpandNode:()=>a,reDistributeNodes:()=>o});const n=3;function i(e){return(e.to.row-e.from.row+1)*(e.to.col-e.from.col+1)}function o(e){let t=e.length;if(0===t)return[[],[]];if(1===t)return[[e[0]],[]];let r=0,n=0,o=1;for(let a=0;ar&&(r=l,n=a,o=s)}const a=[[e[n]],[e[o]]],s=[e[n].getRange(),e[o].getRange()];e[o]=e[--t],e[n]=e[--t];let l=0;for(;t>0;){let r=Number.MAX_VALUE,n=0;const o=i(s[l]);for(let a=0;a0;o++){const a=e[o].getRange(),s=i(a);a.expandByRange(t);const l=i(a);l-s{"use strict";r.d(t,{Alignment:()=>s,Border:()=>l,Fill:()=>a,Font:()=>o,NumberFormat:()=>u});var n=r(50137);class i{constructor(){this.index=void 0}getIndex(){return this.index}setIndex(e){this.index=e}isDefault(){return 0===this.index}clone(){const e=new this.constructor;return e.assign(this),e}assign(e){if(e){const t=this.constructor.attrs;for(let r=0;r{"use strict";r.d(t,{CellStyle:()=>u,default:()=>h});var n=r(26729),i=r.n(n),o=r(64260),a=r(31569),s=r(80442),l=r(65180);class u{constructor(){this.fontId=0,this.fillId=0,this.alignmentId=0,this.borderId=0,this.nfId=0,this.quotePrefix=!1,this._refCount=0,this.index=0}equals(e){return e.fontId===this.fontId&&e.fillId===this.fillId&&e.alignmentId===this.alignmentId&&e.borderId===this.borderId&&e.nfId===this.nfId&&e.quotePrefix===this.quotePrefix}clone(){const e=new this.constructor;return e.fontId=this.fontId,e.fillId=this.fillId,e.alignmentId=this.alignmentId,e.borderId=this.borderId,e.nfId=this.nfId,e.quotePrefix=this.quotePrefix,e}isDefault(){return this===this._sm.getDefaultStyle()}getFont(){return this._sm.getFont(this.fontId)}getFill(){return this._sm.getFill(this.fillId)}getAlignment(){return this._sm.getAlignment(this.alignmentId)}getBorder(){return this._sm.getBorder(this.borderId)}getNumberFormat(){return this._sm.getNumberFormat(this.nfId)}getQuotePrefix(){return this.quotePrefix}setIndex(e){this.index=e}getIndex(){return this.index}toJSON(){return[this._refCount,this.fontId,this.fillId,this.alignmentId,this.borderId,this.nfId,this.quotePrefix?1:0]}toStyleJSON(){return{font:this.getFont().toJSON(),fill:this.getFill().toJSON(),alignment:this.getAlignment().toJSON(),border:this.getBorder().toJSON(),nf:this.getNumberFormat().toJSON(),quoteprefix:!!this.quotePrefix}}}class c extends(i()){constructor(){super(),this._cellStyleCls=this._createRefCellStyleClass(),this._cellCls=this._createRefCellClass(),this.fonts=[this.createFont()],this.fills=[this.createFill()],this.alignments=[this.createAlignment()],this.borders=[this.createBorder()],this.numberFormats=[this.createNumberFormat()],this.styles=[new this._cellStyleCls],this.fonts[0].setIndex(0),this.fills[0].setIndex(0),this.alignments[0].setIndex(0),this.borders[0].setIndex(0),this.numberFormats[0].setIndex(0)}getStyle(e){return this[e]}_createRefCellStyleClass(){class e extends u{}return e.prototype._sm=this,e}_createRefCellClass(){class e extends a.Cell{}return e.prototype._sm=this,e}createRefCell(e,t){return new this._cellCls(e,t)}getCellStyle(e){return this.styles[e]}addCellStyle(e){let t=this._getXfId(e);return-1===t&&(t=this.styles.push(e)-1,e.setIndex(t),this.emit("style_added")),t}getDefaultStyle(){return this.getCellStyle(0)}getFont(e){return this.fonts[e]}getFill(e){return this.fills[e]}getAlignment(e){return this.alignments[e]}getBorder(e){return this.borders[e]}getNumberFormat(e){return this.numberFormats[e]}createFont(e){return(new o.Font).assign(e)}createFill(e){return(new o.Fill).assign(e)}createAlignment(e){return(new o.Alignment).assign(e)}createBorder(e){return(new o.Border).assign(e)}createNumberFormat(e){return(new o.NumberFormat).assign(e)}createRichText(e){return l.default.fromJSON(e)}addFont(e){let t=this._getFontId(e);return-1===t&&(t=this.fonts.push(e)-1,e.setIndex(t),this.emit("color_added")),t}addFill(e){let t=this._getFillId(e);return-1===t&&(t=this.fills.push(e)-1,e.setIndex(t),this.emit("color_added")),t}addAlignment(e){let t=this._getAlignmentId(e);return-1===t&&(t=this.alignments.push(e)-1,e.setIndex(t)),t}addBorder(e){let t=this._getBorderId(e);return-1===t&&(t=this.borders.push(e)-1,e.setIndex(t),this.emit("color_added")),t}addNumberFormat(e){let t=this._getNumberFormatId(e);return-1===t&&(t=this.numberFormats.push(e)-1,e.setIndex(t)),t}_getFontId(e){return this._findIndexOf("fonts",e)}_getFillId(e){return this._findIndexOf("fills",e)}_getAlignmentId(e){return this._findIndexOf("alignments",e)}_getBorderId(e){return this._findIndexOf("borders",e)}_getNumberFormatId(e){return this._findIndexOf("numberFormats",e)}_getXfId(e){return this._findIndexOf("styles",e)}_findIndexOf(e,t){const r=this[e];for(let e=0,n=r.length;e0,t}init(e){e.fonts.forEach(((e,t)=>{const r=this.createFont(e);r.setIndex(t+1),this.fonts.push(r)})),e.fills.forEach(((e,t)=>{const r=this.createFill(e);r.setIndex(t+1),this.fills.push(r)})),e.alignments.forEach(((e,t)=>{const r=this.createAlignment(e);r.setIndex(t+1),this.alignments.push(r)})),e.borders.forEach(((e,t)=>{const r=this.createBorder(e);r.setIndex(t+1),this.borders.push(r)})),e.numberFormats.forEach(((e,t)=>{const r=this.createNumberFormat(e);r.setIndex(t+1),this.numberFormats.push(r)})),e.styles.forEach((e=>{const t=this.createStyle(e),r=this.styles.push(t)-1;t.setIndex(r)}))}getParts(e){const t={styles:[],fonts:[],fills:[],alignments:[],borders:[],numberFormats:[]};function r(e){return new Array(e.length).fill(!1)}const n=r(this.fonts),i=r(this.fills),o=r(this.alignments),a=r(this.borders),s=r(this.numberFormats);e.forEach((e=>{const r=this.getCellStyle(e);t.styles.push([e,r.toJSON()]),n[r.fontId]=!0,i[r.fillId]=!0,o[r.alignmentId]=!0,a[r.borderId]=!0,s[r.nfId]=!0}));const l=this;function u(e,t){return e[0]=!1,e.reduce(((e,r,n)=>(r&&e.push([n,t.call(l,n)]),e)),[])}return t.fonts=u(n,this.getFont),t.fills=u(i,this.getFill),t.alignments=u(o,this.getAlignment),t.borders=u(a,this.getBorder),t.numberFormats=u(s,this.getNumberFormat),t}addParts(e){const t=new Map;e.fonts.forEach((e=>{let[r,n]=e;t.set(r,this.addFont(this.createFont(n)))}));const r=new Map;e.fills.forEach((e=>{let[t,n]=e;r.set(t,this.addFill(this.createFill(n)))}));const n=new Map;e.alignments.forEach((e=>{let[t,r]=e;n.set(t,this.addAlignment(this.createAlignment(r)))}));const i=new Map;e.borders.forEach((e=>{let[t,r]=e;i.set(t,this.addBorder(this.createBorder(r)))}));const o=new Map;e.numberFormats.forEach((e=>{let[t,r]=e;o.set(t,this.addNumberFormat(this.createNumberFormat(r)))}));const a=new Map;return e.styles.forEach((e=>{let[s,l]=e;const u=this.createStyle(l);u.fontId>0&&(u.fontId=t.get(u.fontId)||0),u.fillId>0&&(u.fillId=r.get(u.fillId)||0),u.alignmentId>0&&(u.alignmentId=n.get(u.alignmentId)||0),u.borderId>0&&(u.borderId=i.get(u.borderId)||0),u.nfId>0&&(u.nfId=o.get(u.nfId)||0),a.set(s,this.addCellStyle(u))})),a}transform(e){const t=this._checkExtendable(e);return t.every((e=>e))?(this._extend(e),null):this._remap(e,t)}_checkExtendable(e){const t=c.attrs,r=[this.styles.every(((t,r)=>t.equals(e.styles[r])))];for(const n of t){const t=this.getStyle(n),i=e.getStyle(n);r.push(t.every(((e,t)=>e.equals(i[t]))))}return r}_extend(e){for(const t of c.attrs){const r=this.getStyle(t),n=e.getStyle(t);r.push(...n.slice(r.length))}e.styles.slice(this.styles.length).forEach((e=>{const t=this.createStyle(e.toJSON()),r=this.styles.push(t)-1;t.setIndex(r),this.emit("style_added")}))}_remap(e,t){const r=c.attrs,n=t.slice(1),i={fonts:"fontId",fills:"fillId",alignments:"alignmentId",borders:"borderId",numberFormats:"nfId"},o=e.styles;return r.forEach(((t,r)=>{const a=this.getStyle(t),s=e.getStyle(t);if(n[r])return void a.push(...s.slice(a.length));const l=i[t],u=this._remapStyle(t,s);for(const e of o)e[l]=u[e[l]]||0})),o.map((e=>this.addCellStyle(this.createStyle(e.toJSON()))))}_remapStyle(e,t){switch(e){case"fonts":return t.map((e=>this.addFont(e)));case"fills":return t.map((e=>this.addFill(e)));case"alignments":return t.map((e=>this.addAlignment(e)));case"borders":return t.map((e=>this.addBorder(e)));case"numberFormats":return t.map((e=>this.addNumberFormat(e)))}throw new Error("unexpected style key")}collectColor(e){return this.fonts.forEach((t=>{t.color&&e.add(t.color.toLowerCase())})),this.fills.forEach((t=>{t.bg&&e.add(t.bg.toLowerCase())})),this.borders.forEach((t=>{const r=t.b;if(r)for(const t of r)t&&e.add(t.replace("#","").toLowerCase())})),e}getStateJSON(e){const t={styles:[],fonts:[],fills:[],alignments:[],borders:[],numberFormats:[]};for(const[r,n]of Object.entries(e)){const e="styles"===r?this.styles:this.getStyle(r);for(let i=n;i(0,s.compactFontObject)(e))),fills:e(t.fills),borders:e(t.borders),alignments:e(t.alignments).map((e=>(0,s.compactAlignmentObject)(e))),numberFormats:e(t.numberFormats)}}}c.attrs=["fonts","fills","alignments","borders","numberFormats"];const h=c},26637:(e,t,r)=>{"use strict";r.d(t,{default:()=>x});var n,i=r(2567),o=r(34148),a=r(20146),s=r(97671),l=r(56023),u=r(96803),c=r(55060),h=r(35261),d=r(21523),f=r(85978),g=r(43246),p=r(48152),m=r(19870),v=r(55180),y=r(15901);!function(e){e[e.NORMAL=0]="NORMAL",e[e.HISTORY=1]="HISTORY"}(n||(n={}));class C extends o.default{constructor(e,t,r,o){void 0===o&&(o=!1),super(),this.nameManager=new h.NameManager(this),this.styleManager=this.createStyleManager(),this.parser=new f.Parser(this),this.calculator=new i.AsyncCalculator(this,o),this.current=null,this.commentStore=null,this.readonly=!1,this.editorMode=n.NORMAL,this.unknownRefManager=new d.default,this.unitUnknownRefManager=new d.default,this.hooks=new g.WorkbookHooks,this.wbController=new p.default(this),this.ruleStore=new m.default,this.externalManager=new a.ExternalManager,this.commentable=!1,this.localeHelper=e,this.notifier=null,this.enabledPlugins=t,this.constants=r,this.wbController.init(),this.styleManager.on("style_added",(()=>this.notifier?.onStyleAdded())),this.styleManager.on("color_added",(()=>this.notifier?.onColorAdded())),this.externalManager.on("external_changed",((e,t)=>this.notifier?.onExternalChanged(e,t)))}destroy(){super.destroy(),this.current=null,this.hooks.destroy()}setCurrent(e){e!==this.current?.sheetId&&(this.current=this.getSheetById(e)||null,this.current&&this.getNotifier()?.onCurrentSheetChange(e))}getCurrentSheet(){return this.current}setCommentStore(e){this.commentStore=e,e.on("commentChanged",(e=>this.notifier?.onCommentChanged(e)))}getCommentStore(){return this.commentStore}getController(){return this.wbController}removeSheet(e){const t=super.removeSheet(e);return this.current?.sheetId!==e||this.hasSheet(e)||this.setCurrent(this.getVisibleOrder()[0]),t}setSheetHidden(e,t){const r=super.setSheetHidden(e,t);if(this.current?.sheetId===e&&this.isSheetHidden(e)){const t=this.getSiblingSheet(e);t&&this.setCurrent(t)}return r}setSheetColor(e,t){const r=super.setSheetColor(e,t);return r&&this.notifier?.onColorAdded(),r}getVisibleOrder(){const e=[];for(let t=0;tthis.isSheetHidden(e)),t)}getNextSheet(e,t){return(0,v.findNext)(this.sheetsOrder,e,(e=>this.isSheetHidden(e)),t)}getSiblingSheet(e){return this.getPrevSheet(e)||this.getNextSheet(e)}forAll(e){for(let t=0;t{e+=t.sheet.countRows()*t.sheet.countCols()})),Math.max(this.getMaxCellCount()-e,0)}getSheetDimension(e){const t=this.getSheetById(e);return{rowCount:t?.countRows()??0,colCount:t?.countCols()??0}}getAvailableRowCount(e){const t=this.getSheetById(e);return t?Math.floor(this.getRemainingCellCount()/t.countCols()):0}getAvailableColCount(e){const t=this.getSheetById(e);return t?Math.floor(this.getRemainingCellCount()/t.countRows()):0}getAvailableMaxRow(e){const t=this.getSheetById(e);return t?t.countRows()+this.getAvailableRowCount(e):0}getAvailableMaxCol(e){const t=this.getSheetById(e);return t?t.countCols()+this.getAvailableColCount(e):0}isDimensionAvailable(e,t,r){const n=this.getSheetById(e);if(!n)return!1;const i=n.countRows(),o=n.countCols(),a=(t=Math.max(t,i))*(r=Math.max(r,o))-i*o;return 0===a||this.getRemainingCellCount()>=a}isNewSheetAvailable(e){const t=e?this.getSheetById(e):null,r=t?t.countRows()*t.countCols():u.default.DEFAULT_ROW_COUNT*u.default.DEFAULT_COL_COUNT;return this.getRemainingCellCount()>=r}getFormulaParser(){return this.parser}getAsyncCalculator(){return this.calculator}createStyleManager(){return new s.default}getStyleManager(){return this.styleManager}createBaseFormulaItem(){return new c.BaseItem}setReadonly(e){this.readonly=e,this.notifyDataChange(l.FLUSH_TYPE.WORKBOOK)}isReadonly(){return this.readonly}setCommentable(e){this.commentable=e,this.notifyDataChange(l.FLUSH_TYPE.WORKBOOK)}isCommentable(){return this.commentable}setEditorMode(e){this.editorMode=e}isHistoryMode(){return this.editorMode===n.HISTORY}setVersion(e){this.version=e}getVersion(){return this.version}getNameManager(){return this.nameManager}getUnknownRefManager(){return this.unknownRefManager}getUnitUnknownRefManager(){return this.unitUnknownRefManager}getRuleStore(){return this.ruleStore}getExternalManager(){return this.externalManager}getLocale(){return this.localeHelper}setNotifier(e){this.notifier=e}getNotifier(){return this.notifier}notifyDataChange(e){this.notifier?.notifyDataChange(e)}getEnabledPlugins(){return this.enabledPlugins}getConstants(){return this.constants}getWorksheetSnapshotSync(e){const t=new y.default(this).getWorksheetGenerator(e);let r="",n=t.next();for(;!n.done;)r+=n.value,n=t.next();return r}generateWorksheetContent(e){const t=this.getSheetById(e);if(!t)return null;const r=new Set,n=t.getDataModel();for(let e=0,t=n.getRowLength();e0&&r.add(n.getXfId())}}function i(e){e&&e.s>0&&r.add(e.s)}return n.rowInfos.forEach(i),n.colInfos.forEach(i),i(n.getGlobalInfo()),{ws:this.getWorksheetSnapshotSync(t),style:JSON.stringify(this.getStyleManager().getParts(r))}}moveSearchResult(e,t){const r=e.length;let n=this.current?e.indexOf(this.current.sheetId):0;const i=e[n];let o=this.getSheetById(i)?.getPlugin("synoSearch").moveSearchResult(t);if(!o){const i=n;do{"prev"===t?(n=(n-1+r)%r,o=this.getSheetById(e[n])?.getPlugin("synoSearch").getLastResult()):(n=(n+1)%r,o=this.getSheetById(e[n])?.getPlugin("synoSearch").getFirstResult())}while(!o&&n!==i)}let a=0,s=0;if(o)for(let t=0;t{t.color&&e.add(t.color.toLowerCase());const r=t.sheet;r.getPlugin("synoDrawingController").collectColor(e),r.getPlugin("synoConditionalFormat").collectColor(e)})),e}getStateJSON(){const e={};for(const[t,r]of this.sheetsInfo.entries())e[t]={title:r.name,hidden:r.hidden,tabColor:r.color,rowCount:r.sheet.countRows(),colCount:r.sheet.countCols()};return{current:this.current?.sheetId,version:this.getVersion(),order:this.getOrder(),sheets:e,readonly:this.readonly,commentable:this.commentable,colors:Array.from(this.collectColor()),constants:this.constants}}}C.EDITOR_MODE=n;const x=C},77778:(e,t,r)=>{"use strict";r.d(t,{Worksheet:()=>c});var n=r(27601),i=r(35195),o=r(55180),a=r(58835),s=r(13574),l=r(18912),u=r(65180);class c{constructor(e,t){this.cellCollections=[],this.rowInfos=[],this.colInfos=[],this.globalInfo={},this.rowCount=t.rowCount||0,this.colCount=t.colCount||0,this.workbook=e,this.initRowCol(t),this.initData(t),this.initNote(t),["rowCount","colCount","rows","cols","global","cells"].forEach((e=>{delete t[e]}))}initRowCol(e){(0,l.sparseMapEach)(e.rows,((e,t)=>{(0,n.default)(t)||(e.h&&this.updateRowAttr(t,"h",e.h),e.hidden&&this.updateRowAttr(t,"hidden",!0),"number"==typeof e.s&&this.updateRowAttr(t,"s",e.s))})),(0,l.sparseMapEach)(e.cols,((e,t)=>{(0,n.default)(t)||(e.w&&this.updateColAttr(t,"w",e.w),e.hidden&&this.updateColAttr(t,"hidden",!0),"number"==typeof e.s&&this.updateColAttr(t,"s",e.s))})),e.global&&e.global.s&&(this.getGlobalInfo().s=e.global.s)}initData(e){const t=e.cells;for(const e in t)if((0,s.objectHasOwnProperty)(t,e)){const r=parseInt(e,10);for(const n in t[e])if((0,s.objectHasOwnProperty)(t[e],n)){const i=t[e][n];if(null===i)continue;const o=parseInt(n,10),s=this.getOrCreateCell(r,o,i.s||0);if("v"in i){const e=(0,a.isRichTextJSON)(i.v)?u.default.fromJSON(i.v):i.v;s.setValue(e??null)}i.n&&s.setNote(i.n)}}}initNote(e){const t=e.notes||[];for(const e of t)this.getOrCreateCell(e.row,e.col).setNote(e.text)}getRow(e){return this.cellCollections[e]||null}updateRow(e,t){let{data:r,info:n}=t;this.rowInfos[e]=n,this.cellCollections[e]=r}getRowLength(){return this.cellCollections.length}getCell(e,t){const r=this.getRow(e);return r?r.getCell(t):null}createRowModel(e){const t=new i.Row;return this.cellCollections[e]=t,t}getOrCreateCell(e,t,r){let n=this.cellCollections[e];n||(n=this.createRowModel(e));let i=n.getCell(t);return i||(i=this.workbook.getStyleManager().createRefCell(null,r??this.getEmptyXf(e,t)),n.addCell(t,i)),i}getComputedCellStyle(e,t){const r=this.getCell(e,t);return r?r.getCellStyle():this.getEmptyStyle(e,t)}getEmptyStyle(e,t){return this.workbook.getStyleManager().getCellStyle(this.getEmptyXf(e,t))}getEmptyXf(e,t){return this.rowInfos[e]?.s?this.rowInfos[e]?.s??0:this.colInfos[t]?this.colInfos[t]?.s??0:this.globalInfo.s?this.globalInfo.s:0}getGlobalXf(){return this.getGlobalInfo().s||0}createRow(e,t,r){t>0&&((0,o.arrayAlloc)(this.cellCollections,e,t),(0,o.arrayAlloc)(this.rowInfos,e,t),r>=0&&this._populateAfterRowCreate(e,t,r),this.rowCount+=t)}createCol(e,t,r){if(t>0){for(let r=0;r=0&&this._populateAfterColCreate(e,t,r),this.colCount+=t}}collectRangeNote(e,t){let{from:r,to:n}=e;void 0===t&&(t=()=>!1);const{row:i,col:o}=r,{row:a,col:s}=n,l=[];for(let e=i;e<=a;e++){if(t&&t(e))continue;const r=[];for(let t=o;t<=s;t++)r.push(this.getCell(e,t)?.getNote()??"");l.push(r)}return l}removeRow(e,t){t>0&&(this.cellCollections.splice(e,t),this.rowInfos.splice(e,t),this.rowCount-=t)}removeCol(e,t){if(t>0){for(let r=0;r=e&&(r+=t);const i=e+t,o=this.getRowInfo(r);if(o){if((o.s??0)>0)for(n=e;n{const o=t?t.getXfId():-1;if(!(o<0))for(n=e;n=e&&(r+=t);const o=e+t,a=this.getColInfo(r);if(a){if((a.s??0)>0)for(n=e;n{e&&(i=e.getCell(r))&&i.getXfId()>=0&&s.push([t,i.getXfId()])})),s.forEach((t=>{let[r,i]=t;for(n=e;n0&&(n.s=t)}n[t]=r}getWorkbook(){return this.workbook}}},16395:(e,t,r)=>{"use strict";r.d(t,{DelayablePlugin:()=>s,default:()=>l});var n=r(13574),i=r(55180);const o=new WeakMap;class a{constructor(e,t){this.sheet=e,(0,n.defineGetter)(this,"sheet",e,{writable:!1}),o.set(this,{}),this.pluginName=t,this.addHook("beforeInit",(()=>this.init()))}init(){this.enablePlugin()}enablePlugin(){}addHook(e,t){const r=o.get(this)[e]||[];this.sheet.addHook(e,t),r.push(t),o.get(this)[e]=r}removeHooks(e){(0,i.arrayEach)(o.get(this)[e]||[],(t=>{this.sheet.removeHook(e,t)}))}_clearHooks(){const e=o.get(this);Object.keys(e).forEach((e=>this.removeHooks(e))),e.length=0}destroy(){this._clearHooks(),Object.keys(this).forEach((e=>{"sheet"!==e&&(this[e]=null)})),delete this.sheet}}class s extends a{}const l=a},33506:(e,t,r)=>{"use strict";r.d(t,{fromTransferableData:()=>s,getAutofillDataKeys:()=>o,getAutofillFormatKeys:()=>a,toTransferableData:()=>l});var n=r(58835),i=r(65180);const o=["data","format","notes","validation","cf","hyperlink","comment"],a=["format","validation","cf"];function s(e){if(!e.data)return e;const t=e.data.map((e=>e.map((e=>(0,n.isRichTextJSON)(e)?i.default.fromJSON(e):e))));return{...e,data:t}}function l(e){if(!e.data)return e;const t=e.data.map((e=>e.map((e=>(0,n.isRichTextValue)(e)?e.toJSON():e))));return{...e,data:t}}},23853:(e,t,r)=>{"use strict";r.d(t,{getAutoFillValue:()=>s,getDeltas:()=>a});var n=r(31641),i=r(84499);function o(e){const[t,r]=e[0];if(1===e.length)return void 0===t?0:1;const n=e.length-1,[,i]=e[1],[o,a]=e[n];var s,l;return void 0!==a&&o===t&&void 0!==r&&void 0!==i&&(2===e.length||(s=a-r,l=(i-r)*n,Math.abs(s-l)<=1e-15))?a-r+(i-r):void 0}function a(e,t){const r=e?e.length:0,n=e&&e[0]?e[0].length:0;if(!t)return[];const a=[];if(["up","down"].indexOf(t)>=0)for(let t=0;t=0)for(let t=0;t{"use strict";r.d(t,{default:()=>_});var n=r(33506),i=r(16395),o=r(13574),a=r(15641),s=r(37873),l=r(31641),u=r(59162),c=r(84499),h=r(42443),d=r(4263),f=r(23853),g=r(96687),p=r(57899);const m=()=>!1;class v extends i.default{constructor(e){super(e,"synoAutofill")}getAutofillObject(e,t,r,n,i,o){void 0===n&&(n=m);const a=new s.SynoCellRange(e.row,e.col,t.row,t.col),l={};return r.includes("data")&&(l.data=this.getData(e,t,n,o)),r.includes("format")&&(l.format=this.getFormat(e,t,n)),r.includes("notes")&&(l.notes=this.sheet.getDataModel().collectRangeNote(a,n)),r.includes("validation")&&(l.validation=this.sheet.getPlugin("synoValidation").collectRangeInfo(a,n)),r.includes("cf")&&(l.cf=this.sheet.getPlugin("synoConditionalFormat").collectRangeInfo(a,n)),r.includes("hyperlink")&&(l.hyperlink=this.sheet.getHyperlinkModel().collectRangeInfo(a,n)),r.includes("comment")&&(l.comment=this.sheet.getPlugin("synoComment").collectRangeInfo(a,n)),l}getAutofillData(e,t,r){return void 0===t&&(t=m),this.getAutofillObject(e.from,e.to,n.getAutofillDataKeys,t,"down",r)}getAutofillFormat(e,t,r){return void 0===t&&(t=m),this.getAutofillObject(e.from,e.to,n.getAutofillFormatKeys,t,"down",r)}populateAutofillData(e,t,r,n,i){const{format:o,mergedBorders:a,mergeRanges:l,data:u,notes:c,validation:h,cf:d,comment:f,hyperlink:g}=r;o&&(this.populateFormat(e,t,o,n,i),a&&this.sheet.controller.setBorder(a,!0,i),l&&this.applyMergeRanges(new s.SynoCellRange(e.row,e.col,t.row,t.col),l,i)),u&&this.populateData(e,t,u,n,i),c&&this.populateNotes(e,t,c,n,i),h&&this.populateValidation(e,t,h,n,i),d&&this.populateCfs(e,t,d,n,i),f&&this.populateComment(e,t,f,n,i),g&&this.populateHyperlink(e,t,g,n,i)}populateFormat(e,t,r,n,i){if(null===r.font||null===r.border)return;const a=this.sheet.controller,s=[],l=[],u=[],c=[],h=[],d=[];y({start:e,end:t,direction:n,data:r.font,perRowCallback:this._getRowCallbackFn(i)},((e,t,n,i)=>{s.push([e,t,(0,o.deepClone)(r.font[n][i])]),l.push([e,t,(0,o.deepClone)(r.fill[n][i])]),u.push([e,t,(0,o.deepClone)(r.alignment[n][i])]),c.push([e,t,r.border[n][i]?.b?.slice(0)??null]),h.push([e,t,r.numberFormat[n][i]?.fc??null]),d.push([e,t,r.quotePrefix[n][i]])})),s.length>0&&a.setFont(s,!0,i),l.length>0&&a.setFill(l,!0,i),u.length>0&&a.setAlignment(u,!0,i),c.length>0&&a.setBorder(c,!0,i),h.length>0&&a.setFormat(h,!0,i),d.length>0&&a.setQuotePrefix(d,!0,i),r.rowHeight&&a.resizeRow(e.row,t.row,r.rowHeight),r.colWidth&&a.resizeColumn(e.col,t.col,r.colWidth)}fillNumberFormat(e,t,r,n,i){const o=[];y({start:e,end:t,direction:n,data:r,perRowCallback:this._getRowCallbackFn(i)},((e,t,n,i)=>{r[n][i]&&o.push([e,t,r[n][i]])})),o.length>0&&this.sheet.controller.setFormat(o,!0,i)}populateNotes(e,t,r,n,i){const o=[];y({start:e,end:t,direction:n,data:r,perRowCallback:this._getRowCallbackFn(i)},((e,t,n,i)=>{o.push([e,t,r[n][i]])})),o.length>0&&this.sheet.controller.setNote(o,i)}populateComment(e,t,r,n,i){const o=[];y({start:e,end:t,direction:n,data:r,perRowCallback:this._getRowCallbackFn(i)},((e,t,n,i)=>{const a=r[n][i];a&&o.push(Object.assign({},a,{sheetId:this.sheet.sheetId,row:e,col:t}))}));const a=this.sheet.getWorkbook().getController().commentController;a.clearRangeComment(this.sheet.sheetId,new s.SynoCellRange(e.row,e.col,t.row,t.col)),a.populateComment(o)}getMappingMergeRanges(e,t,r,n,i){const o=[];return y({start:e,end:t,direction:n,data:r,perRowCallback:this._getRowCallbackFn(i)},((e,n,i,a)=>{if(!Array.isArray(r[i][a])||r[i][a].length<2)return;const[s,l,u]=r[i][a];n+l-1>t.col||e+s-1>t.row||o.push([[e,n,e+s-1,n+l-1],u])})),o}populateData(e,t,r,n,i){if(0===r.length)return!1;const o=this._getMergePlugin(),a=i===g.SourceType.Paste,s=i===g.SourceType.Autofill,l=r.length,c=r[0].length,h=[],d=s?(0,f.getDeltas)(r,n):null;y({start:e,end:t,direction:n,data:r,perRowCallback:this._getRowCallbackFn(i)},((t,i,g,m,v,y)=>{if(o.isMergeHidden(t,i))return;let C=r[g][m];const x=t-e.row,w=i-e.col;if(C?.type===p.DataType.R1C1)C=(0,u.fromR1C1ToA1)(C.formula,t,i);else if(s||a&&x>=l||w>=c){const e=(0,f.getAutoFillValue)({row:g,col:m},{row:v,col:y},n,r,d);void 0!==e&&(C=e)}h.push([t,i,C])})),this.sheet.controller.setDataAtCell(h,i||g.SourceType.PopulateData)}populateValidation(e,t,r,n,i){const o=this.sheet.controller;if(o.removeAllValidation((0,c.createRange)(e.row,e.col,t.row,t.col)),0===r.validations.length)return;const a=r.validIds,s={};r.validations.forEach((function(e){s[e.validId]=[]}));const h=this._getRowCallbackFn(i);let d,f,g,p,m;y({start:e,end:t,data:a,direction:n,perRowCallback:e=>(d=null,h(e))},((e,t,r,n)=>{const i=a[r][n];i?d&&f===i?d.to.col=t:(d=(0,c.createRange)(e,t,e,t),f=i,s[i].push(d)):d=null})),r.validations.forEach((function(e){const t=s[e.validId];if(0!==t.length){for(m=1,g=1;g{const i=p[r][n]||[];for(let r of i){let n=null;if(o.has(r)?n=o.get(r):(n=C===this.sheet.sheetId?this.sheet.getPlugin("synoConditionalFormat").findCfById(r):this.sheet.getPlugin("synoConditionalFormat").findCfByJSON(m[r]),o.set(r,n)),n&&(r=n.id),!f.has(r))if(n)f.set(r,n.getRangeBound());else{const e=(0,l.isFormulaCondition)(m[r].f1)?m[r].f1:null,t=(0,l.isFormulaCondition)(m[r].f2)?m[r].f2:null;f.set(r,(0,u.calcR1C1Bound)(e,t))}let i=a.get(r);i||(n?(i=n.ranges.slice(),a.set(r,i)):c.has(r)?i=c.get(r):(i=[],c.set(r,i)));const h=f.get(r);e{const n=t[0].from,i=(0,l.isFormulaCondition)(e.f1)?(0,u.fromR1C1ToA1)(e.f1,n.row,n.col):e.f1,o=(0,l.isFormulaCondition)(e.f2)?(0,u.fromR1C1ToA1)(e.f2,n.row,n.col):e.f2,a=(0,l.isFormula)(e.text)?(0,u.fromR1C1ToA1)(e.text,n.row,n.col):e.text,s=Object.assign({},e,{cfId:(0,l.randomString)(),ranges:(0,h.refactorRanges)(t).map((e=>d.default.toLabel(e,this.sheet))),f1:i,f2:o,text:a});this.sheet.controller.addCf(s,C===this.sheet.sheetId?r:void 0)};let w=0;v.forEach(((e,t)=>{c.has(e)&&x(m[e],c.get(e),t+w),g.has(e)&&(x(m[e],g.get(e),t+w+1),w+=1)}))}populateHyperlink(e,t,r,n,i){this.sheet.controller.removeRangeInternalLink(new s.SynoCellRange(e.row,e.col,t.row,t.col)),y({start:e,end:t,direction:n,data:r,perRowCallback:this._getRowCallbackFn(i)},((e,t,n,i)=>{const o=r[n][i];o&&this.sheet.controller.addInternalLink(Object.assign({},o,{id:(0,l.randomString)(),row:e,col:t}))}))}applyMergeRanges(e,t,r){const n=this.sheet.controller,i=this._getMergePlugin(),o=r===g.SourceType.Paste,l=[];let u=[];n._unmergeOverlaps(e,r);const c=(e,t)=>this.sheet.getDataModel().getComputedCellStyle(e,t).getBorder().b;for(let e=0;e0&&n.setDataAtCell(l,g.SourceType.MergeCell),u.length>0&&n.setBorder(u,!0,r)}getData(e,t,r,n){void 0===r&&(r=m);const[i,o,a,s]=this.sheet.getRangeBound(e,t),c=this.sheet.getDataModel(),h=[];for(let e=i;e<=a;e++){if(r(e))continue;const t=[];for(let r=o;r<=s;r++){const i=c.getValue(e,r);if(n!==g.SourceType.Cut&&(0,l.isFormula)(i)){const n=(0,u.fromA1ToR1C1)(i,e,r);t.push({formula:n,type:p.DataType.R1C1})}else t.push(i)}h.push(t)}return h}getFormat(e,t,r){void 0===r&&(r=m);const[n,i,o,a]=this.sheet.getRangeBound(e,t),s={font:[],fill:[],alignment:[],border:[],numberFormat:[],mergeCells:[],quotePrefix:[]},l=[];for(let e=n,t=0;e<=o;e++){if(r(e))continue;l[e-n]=t++;const o=[],u=[],c=[],h=[],d=[],f=[];for(let t=i;t<=a;t++){const r=this.sheet.getCellModel(e,t),n=r?r.getCellStyle():this.sheet.getDataModel().getEmptyStyle(e,t);let i=null,a=null,s=null,l=null,g=null;n.isDefault()||(n.getFont().isDefault()||(i=n.getFont().toJSON()),n.getFill().isDefault()||(a=n.getFill().toJSON()),n.getAlignment().isDefault()||(s=n.getAlignment().toJSON()),n.getBorder().isDefault()||(l=n.getBorder().toJSON()),n.getNumberFormat().isDefault()||(g=n.getNumberFormat().toJSON())),o.push(i),u.push(a),c.push(s),h.push(l),d.push(g),f.push(n.getQuotePrefix())}s.font.push(o),s.fill.push(u),s.alignment.push(c),s.border.push(h),s.numberFormat.push(d),s.quotePrefix.push(f),s.mergeCells.push(new Array(o.length))}if(this._getMergePlugin().getOverlap((0,c.createRange)(n,i,o,a)).forEach((e=>{if(e.from.row>=n&&e.from.row<=o&&e.from.col>=i&&e.from.col<=a){const t=e.from.row-n;if(void 0===l[t])return;s.mergeCells[l[t]][e.from.col-i]=[e.getHeight(),e.getWidth()]}})),0===n&&o===this.sheet.countRows()-1){const e=this.sheet.getPlugin("synoManualColumnResize");s.colWidth=new Array(a-i+1).fill(null).map(((t,r)=>e.getManualSize(i+r)))}if(0===i&&a===this.sheet.countCols()-1){const e=this.sheet.getPlugin("synoManualRowResize");s.rowHeight=new Array(o-n+1).fill(null).map(((t,r)=>e.getManualSize(n+r)))}return s}_getFilterPlugin(){return this.sheet.getPlugin("synoFilter")}_getMergePlugin(){return this.sheet.getPlugin("synoMergeCell")}_getRowCallbackFn(e){if(e===g.SourceType.Cut)return function(){return!0};const t=this._getFilterPlugin();return function(e){return!t.isHiddenRow(e)}}}function y(e,t){let{start:r,end:n,direction:i,data:o,perRowCallback:a}=e;const s=o.length,l=o[0].length,u="up"===i,c="left"===i;let{row:h,col:d}=r,{row:f,col:g}=n,p=1,m=1;u&&([h,f]=[f,h],p=-1),c&&([d,g]=[g,d],m=-1);const v=C.getInstance(s,u,i);for(let e=h;e!==f+p;e+=p){const r=v.get();if(a&&!1===a(e,r))continue;const n=C.getInstance(l,c,i);for(let i=d;i!==g+m;i+=m)t(e,i,r,n.get(),v.getCycle(),n.getCycle()),n.next();v.next()}}class C{constructor(e,t){this.limit=e-1,this.cycle=t,this.n=0}getCycle(){return this.cycle}get(){return this.n}static getInstance(e,t,r){const n=r?1:0;return t?new w(e,n):new x(e,n)}}class x extends C{constructor(e,t){super(e,t),this.n=0}next(){const e=this.n;return e0?this.n=e-1:(this.n=this.limit,this.cycle++),this.n}}const _=v},14910:(e,t,r)=>{"use strict";r.d(t,{default:()=>o});var n=r(16395);class i extends n.default{constructor(e){super(e,"synoComment")}enablePlugin(){this.addHook("afterCreateRow",((e,t)=>this.afterCreateRow(e,t))),this.addHook("afterCreateCol",((e,t)=>this.afterCreateCol(e,t))),this.addHook("afterRemoveRow",((e,t)=>this.afterRemoveRow(e,t))),this.addHook("afterRemoveCol",((e,t)=>this.afterRemoveCol(e,t))),this.addHook("afterSort",((e,t)=>this.afterSort(e,t))),this.addHook("beforeMoveRow",(e=>this.beforeMoveRow(e))),this.addHook("beforeMoveCol",(e=>this.beforeMoveCol(e))),super.enablePlugin()}afterCreateRow(e,t){this.getCommentStore().createRowCol(this.sheet.sheetId,"row",e,t)}afterCreateCol(e,t){this.getCommentStore().createRowCol(this.sheet.sheetId,"col",e,t)}afterRemoveRow(e,t){this.getCommentStore().removeRowCol(this.sheet.sheetId,"row",e,t)}afterRemoveCol(e,t){this.getCommentStore().removeRowCol(this.sheet.sheetId,"col",e,t)}afterSort(e,t){this._sortComments(e,t)}_sortComments(e,t){return this.getCommentStore().sort(this.sheet.sheetId,e,t)}beforeMoveRow(e){this.getCommentStore().moveRow(this.sheet.sheetId,e)}beforeMoveCol(e){this.getCommentStore().moveCol(this.sheet.sheetId,e)}getCommentStore(){return this.sheet.getWorkbook().getCommentStore()}}const o=i},91022:(e,t,r)=>{"use strict";r.d(t,{default:()=>a});var n=r(14910),i=r(55180);class o extends n.default{enablePlugin(){this.addHook("afterInit",(()=>this.afterInit())),this.addHook("afterCreateComment",(e=>this._addCommentMeta(e))),this.addHook("afterReopenComment",(e=>this._addCommentMeta(e))),this.addHook("afterResolveComment",(e=>this._removeCommentMeta(e))),this.addHook("afterRemoveComment",(e=>this._removeCommentMeta(e))),super.enablePlugin()}afterInit(){const e=this.getCommentStore();(0,i.arrayEach)(e.filterBySheet(this.sheet.sheetId,!0),(e=>{this._addCommentMeta(e)}))}_addCommentMeta(e){this._setCommentMeta(e.row,e.col,e.id)}_removeCommentMeta(e){this._setCommentMeta(e.row,e.col,void 0)}_setCommentMeta(e,t,r){void 0!==e&&void 0!==t&&this.sheet.setCellMeta(e,t,[["comment",r]])}_sortComments(e,t){const r=super._sortComments(e,t);return r.forEach((e=>{let[t,r]=e;return this._setCommentMeta(r,t.col,void 0)})),r.forEach((e=>{let[t]=e;return this._addCommentMeta(t)})),r}collectRangeInfo(e,t){void 0===t&&(t=()=>!1);const r=[];for(let n=e.from.row;n<=e.to.row;n++){if(t(n))continue;const i=new Array(e.getWidth());for(let t=e.from.col;t<=e.to.col;t++){const r=this.sheet.getCellMeta(n,t);r&&r.comment&&(i[t-e.from.col]=this.getCommentStore().getCommentById(r.comment)?.toJSON())}r.push(i)}return r}}const a=o},61947:(e,t,r)=>{"use strict";r.d(t,{CfPluginAdapter:()=>o});var n=r(23701);class i{constructor(e){this.sheet=e}getComputedCfStyle(e,t){return this.sheet.getCellProperty(e,t,"cfStyle")}getCfsJSON(){return this.sheet.getWorksheetState().cf.cfs}findCfJSON(e){return this.sheet.getWorkbook().getStoreGetter("worksheet/cf/findCfJSON")(e)}}class o extends((0,n.mixinCf)(i)){}},28875:(e,t,r)=>{"use strict";r.d(t,{Cf:()=>p,EditorCf:()=>m,moveCfRanges:()=>g,setCfMetaRecalc:()=>v});var n=r(74102),i=r(55060),o=r(84499),a=r(30471),s=r(31641),l=r(85978),u=r(7996),c=r(4263),h=r(59162),d=r(3288),f=r(290);function g(e,t,r){const n=t.ranges.length,i=[],o=[];let a=!1;const s=!t.isReferenceSelfOnly();for(let l=0;l0&&o[o.length-1].isMergeable(e,c);){const t=o.pop();c.expandRowCol(e,t.from[e],t.to[e])}o.push(c)}}return{newRanges:i,nextRanges:o,rangesChanged:a}}class p{constructor(e,t,r,n,o,a,s,l,u,c){this.sheet=e,this.id=t,this.type=r,this.op=n,this.ranges=o,this.style=a,this.f1=s,this.f2=l,this.text=u,this.altType=c,this.priority=0,this._isFormulaInput=void 0,this.conditionFormula=void 0,this.relativeCondition={},this.unitItem=new i.UnitItem(this)}init(){this.priority=0,this.initRelativeCondition(),this.resetCache()}getRefCell(){return this.ranges[0].from}refCellEqualsTo(e){const t=this.getRefCell();return t.row===e.row&&t.col===e.col}initRelativeCondition(){const{row:e,col:t}=this.getRefCell(),r={};this.f1&&(0,s.isFormulaCondition)(this.f1)&&(r.f1=(0,h.fromA1ToR1C1)(this.f1,e,t)),this.f2&&(0,s.isFormulaCondition)(this.f2)&&(r.f2=(0,h.fromA1ToR1C1)(this.f2,e,t)),this.text&&(0,s.isFormula)(this.text)&&(r.text=(0,h.fromA1ToR1C1)(this.text,e,t)),this.relativeCondition=r}registerUnitItem(){if(!this.isFormula())return;this.unitItem.unregister();const e=(0,h.parseFormulaRange)(this.conditionFormula),t=this.sheet.formula.checkCrossRefError(e);if(t)this.sheet.getWorkbook().getUnitUnknownRefManager().addItem(t,this.unitItem);else{const t=this.sheet.formula.mapFormulaRange(e);this.unitItem.register(t)}}serializeBasic(){return{cfId:this.id,type:this.type,op:this.op,style:Object.assign({},this.style),f1:this.f1,f2:this.f2,text:this.text,altType:this.altType,ranges:(0,c.multiRangesToText)(this.ranges)}}serialize(){const e=this.serializeBasic();if(this.isFormula()){const{row:t,col:r}=this.getRefCell(),{f1:n,f2:i,text:o}=this.relativeCondition;n&&(e.f1=(0,h.fromR1C1ToA1)(n,t,r)),i&&(e.f2=(0,h.fromR1C1ToA1)(i,t,r)),o&&(e.text=(0,h.fromR1C1ToA1)(o,t,r))}return e}serializeRelative(){return this.isFormula()?Object.assign(this.serializeBasic(),this.relativeCondition):this.serialize()}isRelativeEqual(e){const t=(e,t,r)=>r.every((r=>e[r]===t[r])),r=this.serializeRelative();return t(r,e,["type","op","altType","f1","f2","text"])&&Object.keys(r.style).length===Object.keys(e.style).length&&t(r.style,e.style,Object.keys(r.style))}isReferenceSelfOnly(){if(!this.isFormula()||!this.isFormulaInput())return!0;const{f1:e,f2:t}=this.relativeCondition;return(!e||(0,h.isFormulaReferneceSelfOnly)(e))&&(!t||(0,h.isFormulaReferneceSelfOnly)(t))}isFormulaInput(){if(void 0===this._isFormulaInput){let e=!0;switch(this.type){case"cellIs":e=(0,s.isFormulaCondition)(this.f1)||!(!this.f2||!(0,s.isFormulaCondition)(this.f2));break;case"containsBlanks":case"notContainsBlanks":e=!1;break;case"containsText":case"beginsWith":case"endsWith":case"notContainsText":e=(0,s.isFormula)(this.text)}this._isFormulaInput=e}return this._isFormulaInput}isFormula(){return!(!this.relativeCondition.f1&&!this.relativeCondition.f2)}updateConditionFormula(){if(!this.isFormula())return;const e=this.conditionFormula,t=this.getRefCell(),r=this.relativeCondition.f1?(0,h.fromR1C1ToA1)(this.relativeCondition.f1,t.row,t.col):this.f1,n=this.relativeCondition.f2?(0,h.fromR1C1ToA1)(this.relativeCondition.f2,t.row,t.col):this.f2;this.conditionFormula="cellIs"===this.type?(0,a.numberConditionFormula)(this.op,(0,u.coordToLabel)(t),r,n):r,e!==this.conditionFormula&&this.registerUnitItem()}destroy(){this.unitItem.unregister()}resetCache(){this.updateConditionFormula()}getRangeBound(){const{f1:e,f2:t}=this.relativeCondition;return(0,h.calcR1C1Bound)(e,t)}updateRanges(e){this.ranges=e,this.updateConditionFormula(),this.sheet.notifyPluginChanges(["cf"])}notifyAlterGrid(e,t,r,n,i,a){let s=this.getRefCell();if(t===this.sheet&&n<0&&(s=function(e,t,r,n){for(let i=0,o=e.length;i=t+r)return s;if(s[n]=t+r,o.includes(s))return s}}(this.ranges,r,-n,e)),!s)return;const u={...s};t===this.sheet&&r<=u[e]&&(u[e]+=n);const c={[e]:r},h=this.changeFormulaBy((e=>l.utils.changeFormula(e,{delta:n,start:c},t.getName(),this.sheet.getName())),s,u);(h.f1||h.f2)&&(0,o.addCrossRepairData)(a,this.sheet.sheetId,"synoConditionalFormat",h)}notifyMove(e,t,r,n){let i=this.getRefCell();if(t===this.sheet){const{newRanges:t,nextRanges:n}=g(e,this,r);i=0==n.length?t[0].from:n[0].from}const a={...i};t===this.sheet&&a[e]>=r.sec[0].start&&a[e]<=r.sec[1].end&&(a[e]l.utils.moveFormula(e,t,r,s,u)),a,i);(c.f1||c.f2)&&(0,o.addCrossRepairData)(n,this.sheet.sheetId,"synoConditionalFormat",c)}notifyRename(e,t,r){const n=this.defaultChangeFormulaBy((r=>(0,d.changeSheetName)(r,e,t)));(n.f1||n.f2)&&(0,o.addCrossRepairData)(r,this.sheet.sheetId,"synoConditionalFormat",n)}notifyMoveFormulaRange(e,t,r){const n=this.getRefCell();if(this.sheet.getName()===t.shName&&t.includes(n.row,n.col))return;const i=this.sheet.getName(),a=this.defaultChangeFormulaBy((r=>l.utils.changeFormulaRange(r,e,t,i)));(a.f1||a.f2)&&(0,o.addCrossRepairData)(r,this.sheet.sheetId,"synoConditionalFormat",a)}notifyRecalcUnknown(){this.registerUnitItem(),this.resetCache()}notifyDeleteSheet(){this.registerUnitItem(),this.resetCache()}getSheet(){return this.sheet}defaultChangeFormulaBy(e){const t=this.getRefCell();return this.changeFormulaBy(e,t,t)}changeFormulaBy(e,t,r){const n={cfId:this.id},i={},{f1:o,f2:a,text:s}=this.relativeCondition;function l(n){return n=(0,h.fromR1C1ToA1)(n,t.row,t.col),n=e(n),(0,h.fromA1ToR1C1)(n,r.row,r.col)}if(o){const e=l(o);e!==o&&(n.f1=o,i.f1=e)}if(a){const e=l(a);e!==a&&(n.f2=a,i.f2=e)}if(s){const e=l(s);e!==s&&(n.text=s,i.text=e)}return this.updateByRelativeFormula(i),n}updateByRelativeFormula(e){let{f1:t,f2:r,text:n}=e;if(!t&&!r&&!n)return;const i=this.relativeCondition;t&&(i.f1=t),r&&(i.f2=r),n&&(i.text=n),this.sheet.notifyPluginChanges(["cf"]),this.resetCache()}repairCross(e){this.updateByRelativeFormula(e)}}class m extends p{constructor(e,t,r,n,i,o,a,s,l,u){super(e,t,r,n,i,o,a,s,l,u),this.matrix=null}resetCache(){this.matrix?(this.matrix.clear(),this.resetAllCell()):this.matrix=new n.CondMatrix,super.resetCache()}getConditionObject(e,t){const r={isFormula:this.isFormula(),operator:this.op,formula1:this.isFormula()?this.conditionFormula:this.f1,formula2:this.f2};if(this.isFormula()){const n=this.getRefCell();r.delta={row:e-n.row,col:t-n.col}}else{let{f1:e,f2:t}=this;(0,f.default)(this.f1)&&(0,f.default)(this.f2)&&this.f1>this.f2&&(e=this.f2,t=this.f1),"string"==typeof e&&(0,s.isFormulaString)(e)&&(e=e.slice(1,e.length-1)),"string"==typeof t&&(0,s.isFormulaString)(t)&&(t=t.slice(1,t.length-1)),r.formula1=e,r.formula2=t}return r}resetAllCell(){this.forAllCell(((e,t)=>this.resetCellCf(e,t)))}forAllCell(e){for(let t=0,r=this.ranges.length;t{"use strict";r.d(t,{parseCfConfig:()=>s});var n=r(30471),i=r(3832),o=r(4263),a=r(7996);function s(e,t,r){const{ranges:s,text:l,altType:u}=e;let{type:c,operator:h,f1:d,f2:f}=e;if("cellIs"===c)switch(h){case"beginsWith":case"containsText":case"endsWith":c=h;break;case"notContains":h=c="notContainsText"}const g=(0,o.textToMultiRangesByWorkbook)(s,t,r),p=t.getLocale();if(d)d=(0,i.parseValue)(p,d),f=(0,i.parseValue)(p,f);else{const e=(0,a.coordToLabel)(g[0].from);d=(0,n.textConditionFormula)(c,e,(0,i.parseValue)(p,l,{text:!0}))}return{cfId:e.id,type:c,op:h,ranges:(0,o.multiRangesToText)(g),style:e.style,f1:d,f2:f,text:l,altType:u}}},11045:(e,t,r)=>{"use strict";r.d(t,{default:()=>d});var n=r(16395),i=r(55180),o=r(4263),a=r(28875),s=r(37873),l=r(31641),u=r(85978),c=r(59162);class h extends n.DelayablePlugin{constructor(e){super(e,"synoConditionalFormat"),this.cfs=[],this.cfNextRanges=null,this._nextRanges=new Map,this._additionCfs=[]}enablePlugin(){super.enablePlugin(),this.addHook("afterInit",(e=>this.initData(e))),this._registerHookListener()}_registerHookListener(){this.addHook("afterCreateRow",((e,t,r)=>this._afterCreate("row",e,t,r))),this.addHook("afterCreateCol",((e,t,r)=>this._afterCreate("col",e,t,r))),this.addHook("beforeRemoveRow",((e,t)=>this._beforeRemove("row",e,t))),this.addHook("beforeRemoveCol",((e,t)=>this._beforeRemove("col",e,t))),this.addHook("afterRemoveRow",((e,t)=>this._afterRemove("row",e,t))),this.addHook("afterRemoveCol",((e,t)=>this._afterRemove("col",e,t))),this.addHook("beforeMoveRow",((e,t,r)=>this.beforeMove("row",e,t,r))),this.addHook("afterMoveRow",((e,t)=>this.afterMove("row",e,t))),this.addHook("beforeMoveCol",((e,t,r)=>this.beforeMove("col",e,t,r))),this.addHook("afterMoveCol",((e,t)=>this.afterMove("col",e,t))),this.addHook("repairCross",(e=>this.repairCross(e)))}destroy(){(0,i.arrayEach)(this.cfs,(e=>e.destroy())),super.destroy()}cfFactory(){return a.Cf}initData(e){const t=e.synoConditionalFormat;return!!Array.isArray(t)&&((0,i.arrayEach)(t,(e=>{this.addCf(e,void 0,!0)})),e.synoConditionalFormat=null,!0)}collectColor(e){for(const t of this.cfs)t.style.color&&e.add(t.style.color),t.style.bgColor&&e.add(t.style.bgColor)}_getCfFromJSON(e){const t=e.ranges.map((e=>o.default.textToRange(e,this.sheet))).filter((e=>!!e));return new(this.cfFactory())(this.sheet,e.cfId,e.type,e.op,t,e.style,e.f1,e.f2,e.text,e.altType)}addCf(e,t,r){const n=this._getCfFromJSON(e);n.init(),"number"==typeof t&&t{e.priority=t+1})),this._onAfterAddCf(n,e,t,r),this.sheet.notifyPluginChanges(["cf"]),this.sheet.getWorkbook().getNotifier()?.onColorAdded()}removeCf(e,t){const r=this.findIndexById(e);if(r<=-1)return;const n=this.cfs[r];n.destroy(),this.cfs.splice(r,1),this._onAfterRemoveCf(n,r,t),this.sheet.notifyPluginChanges(["cf"])}updateCfRanges(e,t){const r=this.findIndexById(e);r<0||this.cfs[r].updateRanges(t)}findIndexById(e){for(let t=0,r=this.cfs.length;t{const o=t+r-1,a=i.ranges;if(n>=0)for(let s=0;s=t&&(l.from[e]+=r,l.to[e]+=r,0===s&&i.isFormula()&&i.resetCache(),this.sheet.notifyPluginChanges(["cf"]))}this._onAfterCfExpand(i,e,t,r)}))}_beforeRemove(e,t,r){const n="row"===e?s.SynoCellRange.prototype.diffRow:s.SynoCellRange.prototype.diffCol;this.cfNextRanges=new Array(this.cfs.length),(0,i.arrayEach)(this.cfs,((e,i)=>{const o=[];let a=!1;for(let i=0;i{const a=this.cfNextRanges?.[o];a&&0===a.length?n[o]=null:(null!=a&&i.updateRanges(a),this._onAfterCfShrink(i,e,t,r))})),this.cfs=n.filter((e=>null!==e)),this.cfNextRanges=null,this.sheet.notifyPluginChanges(["cf"])}_onAfterAddCf(e,t,r,n){}_onAfterRemoveCf(e,t,r){}_onAfterCfExpand(e,t,r,n){}_onAfterCfShrink(e,t,r,n){}_onMoveToNewRanges(e,t,r,n){}_removeCfMeta(e){}_resetCf(e){}_expandToNewRange(e,t){}_moveCf(e,t,r){if(t.isReferenceSelfOnly()){const{nextRanges:n,rangesChanged:i}=(0,a.moveCfRanges)(e,t,r);return{changed:i,nextRanges:n}}const n=r.isBackward?r.sec[1]:r.sec[0];let i=null;const s=t.getRefCell();n.start<=s[e]&&n.end>=s[e]&&(i=t.serializeRelative());const{newRanges:l,nextRanges:h,rangesChanged:d}=(0,a.moveCfRanges)(e,t,r);if(l.length>0&&!i&&(i=t.serializeRelative()),this._resetCf(t),d)if(0===h.length)i=null;else if(l.length>0){if(this._onMoveToNewRanges(e,r,t,l),t.isFormula()){const t={...l[0].from};t[e]-=r.delta,i.f1&&(i.f1=u.utils.moveFormula(e,(0,c.fromR1C1ToA1)(i.f1,t.row,t.col),r)),i.f2&&(i.f2=u.utils.moveFormula(e,(0,c.fromR1C1ToA1)(i.f2,t.row,t.col),r)),i.text&&(i.text=u.utils.moveFormula(e,(0,c.fromR1C1ToA1)(i.text,t.row,t.col),r))}i.ranges=(0,o.multiRangesToText)(l)}return{changed:d,additionCf:i,nextRanges:0===h.length?l:h}}beforeMove(e,t,r,n){const i=r&&r[this.pluginName]||{},a={},s=new Set;for(let r=this.cfs.length-1;r>=0;r--){const n=this.cfs[r];if(s.add(n.id),n.id in i)i[n.id]?(this._removeCfMeta(n),this._nextRanges.set(n,i[n.id].ranges.map((e=>o.default.textToRange(e,this.sheet))).filter((e=>!!e)))):this.removeCf(n.id,!0);else{const{ranges:r}=n.serialize(),{additionCf:i,changed:o,nextRanges:s}=this._moveCf(e,n,t);o&&(a[n.id]={ranges:r},this._nextRanges.set(n,s)),i&&this._additionCfs.push(i)}}for(let e=this._additionCfs.length-1;e>=0;e--){const t=this._additionCfs[e];for(;s.has(t.cfId);)t.cfId=(0,l.hashId)(t.cfId);s.add(t.cfId),a[t.cfId]=null}n[this.pluginName]=a}afterMove(e,t,r){for(let e=0;e{const t=e.cf;this.removeCf(t.cfId,!0),this.addCf(t,e.index,!0)}))}repairRow(e,t,r){this._repair(e,t,r)}repairCol(e,t,r){this._repair(e,t,r)}repairCross(e){const t=e[this.pluginName];if(t)for(let e=0;e=0&&this.cfs[r].repairCross(t[e])}}}const d=h},23701:(e,t,r)=>{"use strict";r.d(t,{mixinCf:()=>o});var n=r(3832),i=r(31641);const o=e=>class extends e{getGridData(){const e=this.getCfsJSON();return{total:e.length,cfs:e.map((e=>this._localizeSerializedCf(e)))}}_localizeSerializedCf(e){const t=e.f1,r=e.f2,o=this.sheet.getWorkbook().getLocale(),a=o.getLocaleConverter();return"date"===e.altType?(0,i.isFormula)((0,n.parseValueInvert)(o,t,{date:!0}))&&(e.f1=a.localizeFormula(t)):(e.f1=this._localizeValue(t),e.f2=this._localizeValue(r),(0,i.isFormula)(e.text)&&(e.text=a.localizeFormula(e.text))),e}_localizeValue(e){const t=this.sheet.getWorkbook().getLocale(),r=t.getLocaleConverter();return"string"!=typeof e?r.localize(e):(0,i.isFormula)((0,n.parseValueInvert)(t,e))?r.localizeFormula(e):e}}},50213:(e,t,r)=>{"use strict";r.d(t,{default:()=>p});var n=r(11045),i=r(13574),o=r(55180),a=r(30471),s=r(4263),l=r(28875),u=r(23701),c=r(56023),h=r(42443);class d extends n.default{_registerHookListener(){super._registerHookListener(),this.addHook("afterChangeResolve",(e=>this.afterChangeResolve(e))),this.addHook("afterSort",((e,t)=>this.afterSort(e,t))),this.addHook("collectRemovedRowInfo",(e=>this._collectRemovedInfo("row",e))),this.addHook("collectRemovedColInfo",(e=>this._collectRemovedInfo("col",e)))}cfFactory(){return l.EditorCf}_onAfterAddCf(e,t,r,n){this._addCfMeta(e),!0!==n&&this.sheet.runHooks("afterCreateConditionalFormat",t,r),this.sheet.getWorkbook().notifyDataChange(c.FLUSH_TYPE.CF)}_onAfterRemoveCf(e,t,r){this._removeCfMeta(e),!0!==r&&this.sheet.runHooks("afterRemoveConditionalFormat",e.id,e.serialize(),t),this.sheet.getWorkbook().notifyDataChange(c.FLUSH_TYPE.CF)}updateCfRanges(e,t){const r=this.findCfById(e);if(!r)return;let n=r.ranges;for(const e of t)n=(0,h.removePartialRange)(n,e).newRanges;let i=t;for(const e of r.ranges)i=(0,h.removePartialRange)(i,e).newRanges;const o=(0,s.multiRangesToText)(r.ranges);for(const e of n)this.removeRangeCfMeta(r,e);super.updateCfRanges(e,t);for(const e of i)this.addRangeCfMeta(r,e);this.sheet.runHooks("afterUpdateCfRanges",e,(0,s.multiRangesToText)(r.ranges),o),this.sheet.getWorkbook().notifyDataChange(c.FLUSH_TYPE.CF)}_onAfterCfExpand(e,t,r,n){this._resetItemWithDeps(e,t,r,n)}_onAfterCfShrink(e,t,r,n){this._resetItemWithDeps(e,t,r,-n)}_resetCf(e){e.resetAllCell()}_onMoveToNewRanges(e,t,r,n){const i="row"===e?t.delta:0,o="col"===e?t.delta:0;for(let e=0;er!==e)))}}afterMove(e,t,r){super.afterMove(e,t,r);const n=r&&r[this.pluginName]||{};for(let e=0;ethis.addCellCfMeta(e,t,r)))}addRangeCfMeta(e,t){t.forAll(((t,r)=>this.addCellCfMeta(e,t,r)))}addCellCfMeta(e,t,r){const n=this.sheet.getOrCreateCell(t,r).getProperties();if(n.needRecalcCf=!0,f(n)){for(let t=n.refCf.length;t>=0;t--)if(0===t||n.refCf[t-1].prioritythis.removeCellCfMeta(e,t,r)))}removeRangeCfMeta(e,t){t.forAll(((t,r)=>this.removeCellCfMeta(e,t,r)))}removeCellCfMeta(e,t,r){const n=this.sheet.getCellMeta(t,r);if(!n)return;const i=[];if(f(n)){const t=n.refCf.filter((t=>e!==t));0===t.length?i.push(["refCf",null],["needRecalcCf",!1]):i.push(["refCf",t],["needRecalcCf",!0])}n.cfStyle&&i.push(["cfStyle",null]),this.sheet.setCellMeta(t,r,i)}findCfById(e){const t=this.findIndexById(e);return-1!==t?this.cfs[t]:null}findCfJSON(e){return this.findCfById(e)?.serialize()}findCfByJSON(e){for(const t of this.cfs)if(t.isRelativeEqual(e))return t;return null}_recalcCellCf(e,t,r){const n={};let o=!1;for(let s=r.refCf.length-1;s>=0;s--){const l=r.refCf[s],u=l.getConditionObject(e,t);if(u.isFormula){const r=l.matrix.createItem(this.sheet,e,t,l);u.item=r}(0,a.conditionCheck)(this.sheet,e,t,u)&&(o=!0,(0,i.extend)(n,l.style)),u.item&&(u.item.needUpdate=!1)}const s=[];o&&s.push(["cfStyle",n]),s.push(["needRecalcCf",!1]),this.sheet.setCellMeta(e,t,s)}afterChangeResolve(e){if(0!==this.cfs.length)for(let t=0,r=e.length;t{let n=!1;for(let i=0;i{const n=this.sheet.getOrCreateCell(t,r).getProperties();n.needRecalcCf=!0,(f(n)?n.refCf:n.refCf=[]).push(e)}))}_afterCreate(e,t,r,n){super._afterCreate(e,t,r,n),this.sheet.getWorkbook().notifyDataChange(c.FLUSH_TYPE.CF)}_afterRemove(e,t,r){super._afterRemove(e,t,r),this.sheet.getWorkbook().notifyDataChange(c.FLUSH_TYPE.CF)}_getRemovedInfo(){const e=[];return(0,o.arrayEach)(this.cfs,((t,r)=>{null!==this.cfNextRanges[r]&&e.push({cf:t.serialize(),index:r})})),e}_collectRemovedInfo(e,t){const r=this._getRemovedInfo();if(r.length>0){const n=e+"Info";t.push({pluginName:this.pluginName,[n]:r})}}collectRangeInfo(e,t){void 0===t&&(t=()=>!1);const r=[],n={};for(let i=e.from.row;i<=e.to.row;i++){if(t(i))continue;const o=new Array(e.getWidth());for(let t=e.from.col;t<=e.to.col;t++){const r=this.sheet.getCellMeta(i,t)?.refCf;if(r){o[t-e.from.col]=r.map((e=>e.id));for(const e of r)n[e.id]||(n[e.id]=e.serializeRelative())}else o[t-e.from.col]=null}r.push(o)}return{cfIds:r,cfs:n,sheetId:this.sheet.sheetId,order:this.cfs.map((e=>e.id))}}_repair(e,t,r){super._repair(e,t,r),this.sheet.getWorkbook().notifyDataChange(c.FLUSH_TYPE.CF)}_resetItemWithDeps(e,t,r,n){e.matrix.filterSafeAndShift(t,r,n,(t=>{e.resetCellCf(t.row,t.col)}))}getCfsJSON(){return this.cfs.map((e=>e.serialize()))}getStateJSON(){return{cfs:this.getCfsJSON()}}getComputedCfStyle(e,t){const r=this.sheet.getCellModel(e,t);return this.getCfStyle(e,t,r,r?.getProperties())}getCfStyle(e,t,r,n){return this.afterDataRenderer(e,t,r,n),n?.cfStyle}afterDataRenderer(e,t,r,n){return!(!n||!n.refCf||(!0===n.needRecalcCf&&this._recalcCellCf(e,t,n),0))}}function f(e){return Array.isArray(e.refCf)}class g extends((0,u.mixinCf)(d)){}const p=g},68279:(e,t,r)=>{"use strict";r.d(t,{createCfModule:()=>a});var n=r(15168);const i={findCfJSON(e){let{cfs:t}=e;return e=>t.find((t=>t.cfId===e))}},o={flush(e,t){Object.assign(e,(0,n.freezeAllKey)(t))}};function a(){return{namespaced:!0,state:()=>({cfs:[]}),getters:i,mutations:o}}},57899:(e,t,r)=>{"use strict";r.d(t,{DataType:()=>n,isSingleMergedCell:()=>i}),r(3832),r(58835),r(64260),r(14345);let n;function i(e){const t=e?.mergeCells;if(!t)return!1;const r=t[0][0];return 1===t.length&&1===t[0].length||r&&r[0]===t.length&&r[1]===t[0].length}!function(e){e[e.Normal=0]="Normal",e[e.RichText=1]="RichText",e[e.R1C1=2]="R1C1",e[e.SheetValue=3]="SheetValue"}(n||(n={}))},80585:(e,t,r)=>{"use strict";r.d(t,{FilterPluginAdapter:()=>o});var n=r(16252);class i{constructor(e){this.sheet=e}isInViewState(){return this.sheet.getWorkbook().getStoreGetter("worksheet/filter/isInViewState")}isFilteredRow(e,t){return this.sheet.getWorkbook().getStoreGetter("worksheet/filter/isFilteredRow")(e,t)}ensureHiddenCellValue(e,t,r){const n=r?this.getActiveFilterJSON()?.range:this.getFilterJSON()?.range;return!!n&&(this.sheet.getWorksheetState().filter[r?"viewHiddenCells":"hiddenCells"][e-n[0]]?.[t-n[1]]??!1)}hasDropdown(e,t){return this.sheet.getWorkbook().getStoreGetter("worksheet/filter/hasDropdown")(e,t)}hasCondition(e){return this.sheet.getWorkbook().getStoreGetter("worksheet/filter/hasCondition")(e)}getFilterJSON(){return this.sheet.getWorksheetState().filter.filter}getActiveFilterJSON(){return this.sheet.getWorkbook().getStoreGetter("worksheet/filter/activeFilter")}listFilterViewInfo(){return this.sheet.getWorksheetState().filter.filterView}}class o extends((0,n.mixinFilter)(i)){}},73083:(e,t,r)=>{"use strict";r.d(t,{default:()=>m,isColorCondition:()=>f,isCustomCondition:()=>d,isTextCondition:()=>h,isValueCondition:()=>c});var n=r(26729),i=r(3058),o=r(55180),a=r(4263),s=r(13574),l=r(84499);let u;function c(e){return e.type===u.VALUE}function h(e){return e.type===u.TEXT}function d(e){return e.type===u.CUSTOM}function f(e){return e.type===u.COLOR}function g(e){if(null===e)throw new Error("Range is null")}!function(e){e.VALUE="value",e.TEXT="text",e.CUSTOM="custom",e.COLOR="color"}(u||(u={}));class p extends n.EventEmitter{constructor(e,t,r,n,i){super(),this.id=e,this.range=t||null,this.conditions=r||[],this.enabled=!!n,this.name=i||""}toJSON(){return{id:this.id,range:this.range?.toArray()||null,enabled:this.enabled,filters:(0,s.deepClone)(this.conditions),name:this.name}}afterCreateRow(e,t){if(!(!this.range||e>this.range.to.row||t<=0)){if(e<=this.range.from.row)return this.range.shift("row",t),void this.emit("rangeChange");this._insertRowRange(e-this.range.from.row,t),this.range.to.row+=t,this.emit("rangeChange")}}afterCreateCol(e,t){if(!(!this.range||e>this.range.to.col||t<=0)){if(e<=this.range.from.col)return this.range.shift("col",t),void this.emit("rangeChange");this._insertColRange(e-this.range.from.col,t),this.range.to.col+=t,this.emit("rangeChange")}}afterRemoveRow(e,t){if(!this.range||e>this.range.to.row||t<=0)return;if(e+t-1this.range.to.col||t<=0)return;if(e+t-1=this.range.from.col&&r.to.col+t<=this.range.to.col))return}else r.shift("col",t),this.setRange(r);e.filters&&(0,o.arrayEach)(e.filters,((e,n)=>{this.setCondition(n+r.from.col+t,e)}))}repairRow(e,t){if(!e.range)return;const r=(0,l.createRange)(e.range[0],e.range[1],e.range[2],e.range[3]);this.range?r.to.row+t+1===this.range.from.row?(this._insertRowRange(0,r.getHeight()),this.range.from.row=r.from.row+t,this.emit("rangeChange")):r.from.row+t===this.range.to.row+1&&(this._insertRowRange(this.range.getHeight(),r.getHeight()),this.range.to.row=r.to.row+t,this.emit("rangeChange")):(r.shift("row",t),this.setRange(r),e.filters&&(0,o.arrayEach)(e.filters,((e,t)=>{this.setCondition(t+r.from.col,e)})))}checkMoveEnable(e,t,r,n){if(!this.isFilterEnabled())return!0;g(this.range);const i=this.range.from.row;return(n?e+t:e)>i||i>(n?e+t+r-1:e+t-1)}beforeMove(e,t,r){return this.isFilterEnabled()?r?(this._applyMoveData(e,r),null):this._beforeMove(e,t):null}_applyMoveData(e,t){if(g(this.range),t.shift&&this.range.shift(e,t.shift),t.amount&&(this.range.to[e]+=t.amount,this.emit("rangeChange"),this._insertRange(e,t.index,t.amount),t.filters))for(let e=0;e=r&&o.to[e]<=n?(i={filterId:this.id,index:o.from[e]-r,amount:o.to[e]-o.from[e]+1,shift:r-this.range.from[e]},"col"===e&&(i.filters=this.conditions.slice(i.index,i.index+i.amount)),this._removeRange(e,o.from[e]-r,o.to[e]-o.from[e]+1)):o.from[e]n&&this._insertRange(e,t.sec[0].start-r,o.to[e]-o.from[e]+1):r=this.conditions.length?this.conditions.length=e:this.conditions.splice(e,t),this.emit("removeColRange",e,t)}_moveRange(e,t,r,n){return"row"===e?this._moveRowRange(t,r,n):this._moveColRange(t,r,n)}_moveRowRange(e,t,r){this.emit("moveRowRange",e,t,r)}_moveColRange(e,t,r){(0,o.moveElement)(this.conditions,e,t,r),this.emit("moveColRange",e,t,r)}isFilterEnabled(){return this.enabled&&null!==this.range}getId(){return this.id}getName(){return this.name}getCondition(e){return this.isFilterEnabled()?(g(this.range),this.conditions[e-this.range.from.col]):null}getAllConditions(){return this.isFilterEnabled()?this.conditions.slice(0):[]}setCondition(e,t,r){if(void 0===r&&(r=!1),!this.isFilterEnabled())return!1;if(g(this.range),ethis.range.to.col)return!1;const n=e-this.range.from.col;return this.conditions[n]=t,r||this.emit("setCondition",n),!0}setRange(e){if(null===this.range&&null===e)return;if(null===this.range)return g(e),this._insertRowRange(0,e.getHeight()),this._insertColRange(0,e.getWidth()),this.range=e.clone(),void this.emit("rangeChange");if(null===e)return this._removeColRange(0,this.range.getWidth()),this._removeRowRange(0,this.range.getHeight()),this.range=null,void this.emit("rangeChange");if(this.range.isEqual(e))return;const t=this.range.clone();e.from.rowt.to.row&&(this._insertRowRange(t.getHeight(),e.to.row-t.to.row),t.to.row=e.to.row),e.from.row>t.from.row&&(this._removeRowRange(0,e.from.row-t.from.row),t.from.row=e.from.row),e.to.rowt.to.col&&(this._insertColRange(t.getWidth(),e.to.col-t.to.col),t.to.col=e.to.col),e.from.col>t.from.col&&(this._removeColRange(0,e.from.col-t.from.col),t.from.col=e.from.col),e.to.col=this.range.from.col&&t<=this.range.to.col&&e===this.range.from.row)}hasRange(){return null!==this.range}getRange(){return this.range}cloneRange(){return this.range?.clone()??null}hasCondition(e){return this.isFilterEnabled()&&!!this.getCondition(e)}getDataView(){const e={};if(!this.isFilterEnabled())return e;const t=this.range&&a.default.toLabel(this.range);return t&&(e.range=t),e.conditions=this.conditions.map((e=>!!e)),e}}const m=p},92072:(e,t,r)=>{"use strict";r.d(t,{default:()=>u});var n=r(16395),i=r(37873),o=r(73083),a=r(55180),s=r(84499);class l extends n.DelayablePlugin{constructor(e){super(e,"synoFilter"),this.filter=null,this.filterView=[]}enablePlugin(){this.addHook("afterInit",(e=>this.afterInit(e))),this.addHook("afterCreateRow",((e,t)=>this.afterCreateRow(e,t))),this.addHook("afterCreateCol",((e,t)=>this.afterCreateCol(e,t))),this.addHook("afterRemoveRow",((e,t)=>this.afterRemoveRow(e,t))),this.addHook("afterRemoveCol",((e,t)=>this.afterRemoveCol(e,t))),this.addHook("beforeMoveRow",((e,t,r)=>this.beforeMove("row",e,t,r))),this.addHook("beforeMoveCol",((e,t,r)=>this.beforeMove("col",e,t,r))),super.enablePlugin()}initData(e){const t=e.synoFilter;if(e.synoFilter=null,!t)return!1;if(t.id){const e=t.range?i.SynoCellRange.fromArray(t.range):null;this._fixFilterOperator(t.filters||[]),this.filter=this._createFilter(t.id,e,t.filters||[],t.enabled||!1)}return t.filterView&&(this.filterView=t.filterView.map((e=>{const t=e.range?i.SynoCellRange.fromArray(e.range):null;return this._fixFilterOperator(e.filters),this._createFilter(e.id,t,e.filters,e.enabled,e.name)}))),!1}_fixFilterOperator(e){const t={containsTexts:"containsText",notContainsTexts:"notContainsText",exactTexts:"exactText"};for(const r of e)if(r&&(0,o.isTextCondition)(r))for(let e=0;e{r.afterCreateRow(e,t)}))}afterCreateCol(e,t){this.filter&&this.filter.afterCreateCol(e,t),(0,a.arrayEach)(this.filterView,(r=>{r.afterCreateCol(e,t)}))}afterRemoveRow(e,t){this.filter&&this.filter.afterRemoveRow(e,t),(0,a.arrayEach)(this.filterView,(r=>{r.afterRemoveRow(e,t)}))}afterRemoveCol(e,t){this.filter&&this.filter.afterRemoveCol(e,t),(0,a.arrayEach)(this.filterView,(r=>{r.afterRemoveCol(e,t)}))}repairCol(e,t){const r=this.filter;if(e.filter&&r&&e.filter.filterId===r.getId()&&r.repairCol(e.filter,t),e.view)for(let r=0;rn.beforeMove(e,t,r?.filter?.filterId===n.getId()?r.filter:r?.view?.[n.getId()]??null)))}notifyMoveRange(e,t,r,n){const i=this.collectMoveData((n=>n.notifyMoveRange(e,t,r?.filter?.filterId===n.getId()?r.filter:r?.view?.[n.getId()])));i&&(n.filter=i)}collectMoveData(e){const t={};if(this.filter){const r=e(this.filter);r&&(t.filter=r)}const r={};for(const n of this.filterView){const i=e(n);i&&(r[n.getId()]=i,t.view=r)}return t.filter||t.view?t:null}createFilter(e,t){return!(this.filter&&this.filter.isFilterEnabled()||(this.filter=this._createFilter(t,e,[],!0,""),0))}enableFilter(e,t){return!(!this.filter||e!==this.filter.getId()||!this.filter.hasRange()||(this.filter.setEnabled(!0),t&&this.setHiddenInfo(t),0))}disableFilter(e,t){return!(!this.filter||e!==this.filter.getId()||!this.filter.isFilterEnabled()||(this.filter.setEnabled(!1),t&&this.setHiddenInfo(t),0))}updateFilterRange(e,t,r){return!(!this.filter||e!==this.filter.getId()||!this.filter.isFilterEnabled()||(this._updateFilterRange(this.filter,t,r),0))}_updateFilterRange(e,t,r){if(e.setRange(t),t&&r)for(let n=0;n{if(!t.isFilterEnabled())return;const n=t.cloneRange();n&&this._checkNeedExpand(n,e)&&(n.to.row=e.to.row,r?this.updateFilterViewRange(t.getId(),n):this.updateFilterRange(t.getId(),n))};this.filter&&t(this.filter,!1),this.filterView.forEach((e=>{t(e,!0)}))}_checkNeedExpand(e,t){if(t.from.row{"use strict";r.d(t,{mixinFilter:()=>n});const n=e=>class extends e{getColValues(e){const t=this.getActiveFilterJSON();if(!t?.enabled)return null;const r=t.range;if(!r)return null;const[n,,i]=r,o=this.isInViewState(),a=new Set,s=new Set;for(let t=n+1;t<=i;t++){const r=this.sheet.getCellTextDesc(t,e)?.v.trim()??"";this.isFilteredRow(t,o)&&!this.ensureHiddenCellValue(t,e,o)?s.add(r):a.add(r)}return{value:a,filtered:s}}getColColors(e,t){const r=new Set,n=this.getActiveFilterJSON(),i=n?.range;if(!i||!n?.enabled)return r;const[o,,a]=i;for(let n=o+1;n<=a;n++){const i=t?[this.sheet.getComputedBackgroundColor(n,e)]:this.sheet.getComputedTextColors(n,e);for(const e of i)r.add(e.toLowerCase())}return r}}},75392:(e,t,r)=>{"use strict";r.d(t,{default:()=>f});var n=r(92072),i=r(73083),o=r(16252),a=r(56023),s=r(30471),l=r(42443),u=r(55180),c=r(7996);class h extends n.default{constructor(e){super(e),this.activeFilter=null,this.origHiddenCells=[],this.origHiddenRows=[],this.viewHiddenCells=[],this.viewHiddenRows=[],this.viewHiddenResult=[]}enablePlugin(){this.addHook("collectRemovedColInfo",((e,t,r)=>this.collectRemovedColInfo(e,t,r))),this.addHook("collectRemovedRowInfo",((e,t,r)=>this.collectRemovedRowInfo(e,t,r))),this.addHook("afterShowRows",((e,t)=>this.setHiddenResult(e,t,!1))),this.addHook("afterHideRows",((e,t)=>this.setHiddenResult(e,t,!0))),super.enablePlugin()}initData(e){return super.initData(e),this.filter&&(this.filter.isFilterEnabled()&&this.updateActiveFilter(this.filter),this.resetHiddenResult(!1)),!!this.activeFilter}_createFilter(e,t,r,n,i){const o=super._createFilter(e,t,r,n,i);return o.on("insertRowRange",((e,t)=>this._insertRowRange(o,e,t))),o.on("insertColRange",((e,t)=>this._insertColRange(o,e,t))),o.on("removeRowRange",((e,t)=>this._removeRowRange(o,e,t))),o.on("removeColRange",((e,t)=>this._removeColRange(o,e,t))),o.on("moveRowRange",((e,t,r)=>this._moveRowRange(o,e,t,r))),o.on("moveColRange",((e,t,r)=>this._moveColRange(o,e,t,r))),o.on("setCondition",(e=>this._afterSetCondition(o,e))),o.on("rangeChange",(()=>this._afterRangeChanged(o))),o}isInViewState(){return!!this.activeFilter&&this.activeFilter!==this.filter}getFilterJSON(){return this.filter?.toJSON()}getActiveFilterJSON(){return this.activeFilter?.toJSON()}listFilterViewInfo(){return this.filterView.filter((e=>e.isFilterEnabled())).map((e=>({id:e.getId(),name:e.getName()})))}getActiveId(){return this.activeFilter?.getId()}getActiveRange(){return this.activeFilter?.getRange()??null}updateActiveFilter(e){this.activeFilter=e,this.sheet.notifyPluginChanges(["filter"])}isFilteredRow(e,t){const r=t?this.activeFilter:this.filter,n=r?.getRange();if(!n||!r?.isFilterEnabled()||en.to.row)return!1;const i=e-n.from.row,o=t?this.viewHiddenRows:this.origHiddenRows;return void 0===o[i]&&this._calcHiddenRow(e,t),!!o[i]}isHiddenRow(e){return this.sheet.isFilteredRow(e)}isViewHidden(e){return this.viewHiddenResult[e]}afterCreateRow(e,t){this.viewHiddenResult=(0,u.arrayInsert)(this.viewHiddenResult,e,new Array(t).fill(!1)),super.afterCreateRow(e,t),this.sheet.notifyPluginChanges(["filter"])}afterRemoveRow(e,t){this.viewHiddenResult.splice(e,t),super.afterRemoveRow(e,t),this.isInViewState()&&!this.activeFilter?.hasRange()&&this.leaveViewState(),this.sheet.notifyPluginChanges(["filter"])}afterRemoveCol(e,t){super.afterRemoveCol(e,t),this.isInViewState()&&!this.activeFilter?.hasRange()&&this.leaveViewState()}collectRemovedColInfo(e,t,r){const n={},i=this.filter?.collectRemovedColInfo(t,r);i&&(n.filter=i);const o=[];(0,u.arrayEach)(this.filterView,(e=>{const n=e.collectRemovedColInfo(t,r);n&&o.push(n)})),o.length>0&&(n.view=o),(n.filter||n.view)&&e.push({pluginName:this.pluginName,colInfo:n})}collectRemovedRowInfo(e,t,r){const n={},i=this.filter?.collectRemovedRowInfo(t,r);i&&(n.filter=i);const o=[];(0,u.arrayEach)(this.filterView,(e=>{const n=e.collectRemovedRowInfo(t,r);n&&o.push(n)})),o.length>0&&(n.view=o),this.isInViewState()&&this.activeFilter&&(n.calc={id:this.activeFilter.getId(),result:this.viewHiddenResult.slice(t,t+r)}),(n.filter||n.view||n.calc)&&e.push({pluginName:this.pluginName,rowInfo:n})}repairRow(e,t){const{calc:r,...n}=e;if(super.repairRow(n,t),!r||!this.activeFilter||r.id!==this.activeFilter.getId())return;const{result:i}=r;for(let e=0;e{(0,u.arrayAlloc)(e,t,r)})),this.sheet.notifyPluginChanges(["filter"])}_removeRowRange(e,t,r){if(e!==this.filter&&e!==this.activeFilter)return;const n=e===this.filter?this.origHiddenCells:this.viewHiddenCells,i=e===this.filter?this.origHiddenRows:this.viewHiddenRows;t+r>=n.length?(i.length=t,n.length=t):(i.splice(t,r),n.splice(t,r)),this.sheet.notifyPluginChanges(["filter"])}_removeColRange(e,t,r){if(e!==this.filter&&e!==this.activeFilter)return;const n=e===this.filter?this.origHiddenCells:this.viewHiddenCells,i=e===this.filter?this.origHiddenRows:this.viewHiddenRows;for(let e=0;e{e.splice(t,r)})),this.sheet.notifyPluginChanges(["filter"]),e===this.activeFilter&&this.onHiddenChanged()}_moveRowRange(e,t,r,n){if(e!==this.filter&&e!==this.activeFilter)return;const i=e===this.filter?this.origHiddenCells:this.viewHiddenCells,o=e===this.filter?this.origHiddenRows:this.viewHiddenRows;(0,u.moveElement)(o,t,r,n),(0,u.moveElement)(i,t,r,n),this.sheet.notifyPluginChanges(["filter"])}_moveColRange(e,t,r,n){if(e!==this.filter&&e!==this.activeFilter)return;const i=e===this.filter?this.origHiddenCells:this.viewHiddenCells;(0,u.arrayEach)(i,(e=>{(0,u.moveElement)(e,t,r,n)})),this.sheet.notifyPluginChanges(["filter"])}_afterSetCondition(e,t){if(e!==this.filter&&e!==this.activeFilter)return;const r=e===this.filter?this.origHiddenCells:this.viewHiddenCells,n=e===this.filter?this.origHiddenRows:this.viewHiddenRows;e===this.activeFilter&&0!==n.length&&this.onHiddenChanged(),n.length=0,(0,u.arrayEach)(r,(e=>{e.length>t&&(e[t]=void 0)})),this.sheet.notifyPluginChanges(["filter"])}_afterRangeChanged(e){this.sheet.notifyPluginChanges(["filter"])}createFilter(e,t){return!!super.createFilter(e,t)&&(this.activeFilter||this.updateActiveFilter(this.filter),this.resetHiddenResult(!1),this.sheet.runHooks("afterCreateFilter",e,t),!0)}resetHiddenResult(e){const t=e?this.viewHiddenCells:this.origHiddenCells,r=e?this.viewHiddenRows:this.origHiddenRows;t.length=0,r.length=0;const n=(e?this.activeFilter:this.filter)?.getRange()?.getHeight()||0;for(let e=0;e{for(let r=e.from;r<=e.to;r++)this.origHiddenRows[r-t.from.row]=!1})),n&&(0,u.arrayEach)(n,(e=>{for(let r=e.from;r<=e.to;r++)this.origHiddenRows[r-t.from.row]=!0})),this.sheet.notifyPluginChanges(["filter"])}_calcHiddenCol(e,t){const r=(t?this.activeFilter:this.filter)?.getRange();if(!r)return{show:[],hide:[]};const n=new l.RangePacker,i=new l.RangePacker,o=t?this.viewHiddenRows:this.origHiddenRows,a=t?this.viewHiddenCells:this.origHiddenCells,s=e-r.from.col;for(let l=r.from.row+1;l<=r.to.row;l++){const u=l-r.from.row,c=o[u];this._calcHiddenCell(l,e,t)?(a[u][s]=!0,o[u]=!0,i.push(l)):(a[u][s]=!1,c&&(o[u]=void 0,this.isFilteredRow(l,t)||n.push(l)))}return this.sheet.notifyPluginChanges(["filter"]),{show:n.getResult(),hide:i.getResult()}}_calcHiddenRow(e,t){const r=t?this.activeFilter?.getRange():this.filter?.getRange();if(!r)return;const n=t?this.viewHiddenRows:this.origHiddenRows,i=e-r.from.row;if(n[i]=!1,i<=0)this.sheet.notifyPluginChanges(["filter"]);else{for(let o=r.from.col;o<=r.to.col;o++)this.ensureHiddenCellValue(e,o,t)&&(n[i]=!0);this.sheet.notifyPluginChanges(["filter"])}}ensureHiddenCellValue(e,t,r){const n=r?this.activeFilter?.getRange():this.filter?.getRange();if(!n)return!1;const i=r?this.viewHiddenCells:this.origHiddenCells,o=e-n.from.row,a=t-n.from.col;return void 0===i[o][a]&&(i[o][a]=this._calcHiddenCell(e,t,r),this.sheet.notifyPluginChanges(["filter"])),i[o][a]}_calcHiddenCell(e,t,r){const n=r?this.activeFilter:this.filter,o=n?.getRange();if(!n||!o||e-o.from.row<=0)return!1;const a=n.getCondition(t);if(!a)return!1;if((0,i.isValueCondition)(a))return a.value.indexOf(this.sheet.renderCache.getCellText(e,t).trim())<0;if((0,i.isTextCondition)(a)){const r=(0,c.coordToLabel)({row:e,col:t}),n=(0,s.textConditionFormula)(a.operator[0],r,'"'+a.value[0]+'"');return!(0,s.conditionCheck)(this.sheet,e,t,{isFormula:!0,delta:{row:0,col:0},operator:a.operator[0],formula1:n})}if((0,i.isCustomCondition)(a)){let r=a.and||!1;for(let n=0;ne.toLowerCase())).includes(r)}return!1}hasDropdown(e,t){return!!this.activeFilter&&this.activeFilter.isFirstRow(e,t)}hasCondition(e){return!!this.activeFilter&&this.activeFilter.hasCondition(e)}getAutoFilterRange(e){let[t,r,n,i]=e;if(t===n&&r===i)[t,r,n,i]=this.sheet.getNonEmptyNeighborRange(e);else if(t===n&&r!==i){const e=this.sheet.countRows();for(let t=n+1;te.isFilterEnabled())).map((e=>e.toJSON())),hiddenRows:this.origHiddenRows.map((e=>e??!1)),hiddenCells:this.origHiddenCells.map((e=>e.map((e=>e??!1)))),viewHiddenCells:this.viewHiddenCells.map((e=>e.map((e=>e??!1)))),viewHiddenResult:this.viewHiddenResult}}calcRenderRanges(e){for(const t of e)for(let e=t.from.row;e<=t.to.row;e++)this.isFilteredRow(e,!1),this.isInViewState()&&this.isFilteredRow(e,!0)}}class d extends((0,o.mixinFilter)(h)){}const f=d},52866:(e,t,r)=>{"use strict";r.d(t,{createFilterModule:()=>a});var n=r(15168);const i={activeFilter(e){let{filter:t,filterView:r,activeId:n}=e;return n?t?.id===n?t:r.find((e=>e.id===n)):null},viewHiddenRows(e){let{viewHiddenCells:t}=e;return t.map((e=>e.some((e=>e))))},isInViewState(e,t){let{filter:r}=e,{activeFilter:n}=t;return!!n&&r!==n},isFilteredRow(e,t){let{filter:r,hiddenRows:n,viewHiddenResult:i}=e,{activeFilter:o,viewHiddenRows:a}=t;return(e,t)=>{const s=t?o:r;return!(!s||!s.range||s.range[0]>e||s.range[2]{const n=r?.range;return!!n&&n[0]===e&&n[1]<=t&&t<=n[3]}},hasCondition(e,t){let{activeFilter:r}=t;return e=>{const t=r?.range;return!!t&&!!r?.filters[e-t[1]]}}},o={flush(e,t){Object.assign(e,(0,n.freezeAllKey)(t))}};function a(){return{namespaced:!0,state:()=>({filter:null,filterView:[],activeId:null,hiddenRows:[],hiddenCells:[],viewHiddenCells:[],viewHiddenResult:[]}),getters:i,mutations:o}}},55060:(e,t,r)=>{"use strict";r.d(t,{BaseItem:()=>i,CondItem:()=>g,CondRangeItem:()=>p,FormulaItem:()=>h,ImportRangeItem:()=>o,RangeItem:()=>m,UnitItem:()=>v,VectorItem:()=>u,isFormulaItem:()=>d,isImportRangeItem:()=>a,isVectorItem:()=>c});var n=r(4263);class i{constructor(e){this.href=void 0,this.circularRef=!1,this.isSubtotal=void 0,this.needUpdate=!!e,this.nfId=void 0,this.unknownName=void 0}markSubtotal(){this.isSubtotal=!0}setNfIdHint(e,t){void 0===t&&(t=!1),this.nfId&&!t||(this.nfId=e||0)}resetNfIdHint(){this.nfId&&(this.nfId=void 0)}reset(){this.href=void 0,this.resetNfIdHint(),this.circularRef=!1,this.unknownName=void 0}isLink(){return void 0!==this.href}markCircularReference(){this.circularRef=!0}setUnknownName(e){this.unknownName=e}setSelfImplicit(){}}class o extends i{setLinkId(e){this.linkId=e}getLinkId(){return this.linkId}}function a(e){return e.constructor===o}class s{register(e){this.unregister();for(let t=0;t0}isRegistered(e){return this.deps.indexOf(e)>=0||void 0!==this.implicitDeps&&this.implicitDeps.indexOf(e)>=0}register(e){s.prototype.register.call(this,e)}unregister(){s.prototype.unregister.call(this)}registerRange(e){e.register(this)}unregisterRange(e){e.unregister(this)}unregisterAll(){this.unregister(),this.unregisterImplicit()}}class u extends l{constructor(e){super(),this.value=[],this.formulaItems=new Set,this.register([e])}getFormulaItems(){return this.formulaItems}addFormulaItem(e){this.formulaItems.add(e)}getValueAt(e,t,r){return this.value[e]||(this.value[e]=[]),void 0===this.value[e][t]&&(this.value[e][t]=r()),this.value[e][t]}clear(){this.value=[],this.formulaItems.clear(),this.unregisterAll()}}function c(e){return e.constructor===u}class h extends l{constructor(e,t,r,n,i){super(i),this.sheet=e,this.row=t,this.col=r,this.formula=n,this.value=null,this.needDimension=!0,this.spillRange=null,this.externalRef=null,this.needCheckSpill=!1,this.spillError=null,this.selfImplicit=!1}notifySpillRange(){if(!this.spillRange)return;const e=n.default.createFromRange(this.spillRange.getRange(),this.sheet);e&&this.sheet.notifyRangeChanges(e.toSynoRange())}setSpillRange(e){this.spillRange&&e&&this.spillRange.rangeEqual(e.getRange())||this.spillRange===e||(this.spillRange&&(this.spillRange.unregisterSpillItem(),this.notifySpillRange()),this.spillRange=e,e&&(e.registerSpillItem(this),this.notifySpillRange()),this.sheet.notifySheetChanges(["formulaDimensions"]),this.needCheckSpill=!0)}getSpillRange(){return this.spillRange}setSpillError(e){this.spillError=e}setSpillResult(e){!this.spillError!=!e&&this.notifySpillRange(),this.setSpillError(e),this.needCheckSpill=!1}getSpillErrorValue(){if(!this.spillError)throw new Error("need check spill error first");return this.spillError.err}addExternalRef(e){this.externalRef||(this.externalRef=new Set),this.externalRef.add(e),e.addFormulaItem(this)}clearExternalRef(){if(this.externalRef){for(const e of this.externalRef)e.deleteFormulaItem(this);this.externalRef.clear()}}unregisterAll(){super.unregisterAll(),this.setSpillRange(null),this.clearExternalRef()}isDependSelfOnly(){return 0===this.deps.length}getValue(){return void 0===this.error?this.value:this.error.err}getPosition(){return{row:this.row,col:this.col}}reset(){super.reset(),this.needUpdate=!0,this.error&&(this.error=void 0),this.clearExternalRef(),this.unregisterImplicit()}setUnknownName(e){super.setUnknownName(e),this.sheet.getWorkbook().getUnknownRefManager().addItem(e,this)}setSelfImplicit(){this.selfImplicit=!0}getStateJSON(){return{previewValue:Array.isArray(this.value)?null:this.value,href:this.href,nfId:this.nfId,formula:this.formula,hasSpillError:!!this.spillError}}static createId(e,t){return`${e},${t}`}}function d(e){return e instanceof h}class f{registerRange(e){e.registerCond(this)}unregisterRange(e){e.unregisterCond(this)}}class g extends h{constructor(e,t,r,n){super(e,t,r,"",!0),this.cond=n}notifyUpdate(){this.cond.onDepUpdate(this.row,this.col)}registerRange(e){f.prototype.registerRange.call(this,e)}unregisterRange(e){f.prototype.unregisterRange.call(this,e)}}class p extends g{constructor(e,t,r,n){super(e,t,r,n),this.resultDep=null}registerResult(e){this.unregisterResult(),this.resultDep=e,this.registerRange(e)}unregisterResult(){this.resultDep&&(this.unregisterRange(this.resultDep),this.resultDep=null)}unregisterAll(){super.unregisterAll(),this.unregisterResult()}}class m extends s{constructor(e){super(),this.cond=e,this.deps=[]}notifyUpdate(){this.cond.onDepUpdate()}registerRange(e){f.prototype.registerRange.call(this,e)}unregisterRange(e){f.prototype.unregisterRange.call(this,e)}}class v extends s{constructor(e){super(),this.unit=e,this.deps=[]}notifyAlterGrid(e,t,r,n,i,o){this.unit.notifyAlterGrid(e,t,r,n,i,o)}notifyMove(e,t,r,n){this.unit.notifyMove(e,t,r,n)}notifyRename(e,t,r){this.unit.notifyRename(e,t,r)}notifyMoveFormulaRange(e,t,r){this.unit.notifyMoveFormulaRange(e,t,r)}notifyRecalcUnknown(){this.unit.notifyRecalcUnknown()}notifyDeleteSheet(){this.unit.notifyDeleteSheet()}getSheet(){return this.unit.getSheet()}registerRange(e){e.registerUnit(this)}unregisterRange(e){e.unregisterUnit(this)}}},74102:(e,t,r)=>{"use strict";r.d(t,{CondMatrix:()=>s,CondRangeMatrix:()=>l,FormulaMatrix:()=>a});var n=r(55060),i=r(31641);class o{constructor(e){this.matrix=new Map,this.removeHandler=e||(e=>e.unregisterAll())}getCount(){return this.matrix.size}_add(e){const t=n.FormulaItem.createId(e.row,e.col);return this.matrix.set(t,e),e}remove(e){const t=this.matrix.get(e);return t&&this.matrix.delete(e)&&this.removeHandler(t),t}each(e){this.matrix.forEach(e)}filter(e){const t=this.matrix;this.matrix=new Map,t.forEach((t=>{e(t)?this._add(t):this.removeHandler(t)}))}shift(e,t,r){this.filter((n=>{if(n[e]>=t){if(n[e]+r(r[e]>=t.sec[0].start&&r[e]<=t.sec[1].end&&(r[e]<=t.sec[0].end?r[e]+=t.sec[1].amount:r[e]-=t.sec[0].amount),!0)))}sort(e,t,r){const[n,i,o,a]=e;this.filter((e=>{const{row:s,col:l}=e;if(!(n<=s&&s<=o&&i<=l&&l<=a))return!0;const u=s-n,c=u===t[u];return!c&&r&&r(e),c}))}clear(){this.matrix.forEach(this.removeHandler),this.matrix.clear()}}class a extends o{createItem(e,t,r,i,o){return this._add(new n.FormulaItem(e,t,r,i,o))}}class s extends o{createItem(e,t,r,i){return this.matrix.get(n.FormulaItem.createId(t,r))||this._add(this._createItem(e,t,r,i))}_createItem(e,t,r,i){return new n.CondItem(e,t,r,i)}filterSafeAndShift(e,t,r,n){this.filter((o=>{if(o[e]>=t&&o[e]+r=t&&(o[e]+=r),s||n(o),s}))}onAlterGrid(e,t,r,n){this.filter((i=>i[e]{"use strict";r.d(t,{default:()=>y});var n=r(16395),i=r(74102),o=r(31641),a=r(59162),s=r(44499),l=r(98997),u=r(55248),c=r(3288),h=r(85978),d=r(55060),f=r(84499),g=r(13574),p=r(96687),m=r(37873);class v extends n.default{constructor(e){super(e,"synoFormula"),this.matrix=new i.FormulaMatrix((e=>this.handleItemRemove(e)))}enablePlugin(){this.sheet.formula=this,this.addHook("init",(()=>this.onInit())),this.addHook("beforeCreateRow",((e,t,r)=>this.onAlterGrid("row",e,t,r))),this.addHook("beforeCreateCol",((e,t,r)=>this.onAlterGrid("col",e,t,r))),this.addHook("beforeRemoveRow",((e,t)=>this.onAlterGrid("row",e,-t,-1))),this.addHook("beforeRemoveCol",((e,t)=>this.onAlterGrid("col",e,-t,-1))),this.addHook("repairCross",(e=>this.repairCross(e))),this.addHook("beforeMoveRow",((e,t,r)=>this.beforeMove("row",e,t,r))),this.addHook("beforeMoveCol",((e,t,r)=>this.beforeMove("col",e,t,r))),this.addHook("afterQuotePrefixChange",(e=>this.generateChangeDep(e))),super.enablePlugin()}onInit(){const e=this.sheet.getDataModel(),t=e.getRowLength();for(let r=0;rn[a]+r||l.push([n[0],n[1],n[3]])}this.updateFormula(n,l)}this.matrix.shift(e,t,r),r<0&&(this.collectedInfo=i)}getFormulaChanges(e,t,r,n){const i=("row"===e?this.sheet.countRows():this.sheet.countCols())-1,{deps:o,conds:a,units:s,spills:l}=this.sheet.getFormulaDepManager().getRefItemsToRowCol(e,t,i),u={},c={},p={[e]:t},m=this.sheet.getName();for(let t=0;t=r&&this.sheet.getWorkbook().getAsyncCalculator().getFormulaDimensioner().setNeedDimension(n)}}this.resetItemByChanges(c);for(let e=0;e{let{deps:t,units:r}=e;for(const e of t)(0,d.isVectorItem)(e)?this.clearVectorItem(e):p.add(e);for(const e of r)v.add(e)},C=Array.from((0,m.iterateCellCoords)(r)),x=Array.from((0,m.iterateCellCoords)(e));y(o.getFormulaDepManager().getItemsByCoords(C)),y(a.getFormulaDepManager().getItemsByCoords(x));for(const{row:e,col:t}of(0,m.iterateCellCoords)(r)){const r=o.getFormulaItem(e,t);y({deps:r?[r]:[],units:[]})}const w={};for(const e of p){let t=e.formula;const r=a!==o&&e.sheet===o&&u.includes(e.row,e.col),n=r?a.getName():e.sheet.getName();t=h.utils.changeFormulaRange(t,l,u,n,r),e.formula!==t&&((0,f.addCrossRepairData)(w,e.sheet.sheetId,this.pluginName,[e.row,e.col,"="+e.formula]),(0,f.addCrossChange)(c,e.sheet.sheetId,[e.row,e.col,"="+t]))}for(const e in c)if((0,g.objectHasOwnProperty)(c,e)){const t=i.getSheetById(e);t&&this.updateFormula(t,c[e])}for(const e of v)e.notifyMoveFormulaRange(l,u,w);n.crossInfo=w,i.getController().nameController.moveFormulaRange(l,u,n)}resetItemByChanges(e){const t=this.sheet.getWorkbook();for(const r in e)if((0,g.objectHasOwnProperty)(e,r)){const n=t.getSheetById(r);n&&n.formula.generateChangeDep(e[r],"reset")}}generateChangeDep(e,t){const r=[];let n=null;"reset"===t?n=this.resetFormulaItem:"renew"===t&&(n=this.renewFormulaItem);for(let t=0,i=e.length;t{e.error&&e.unknownName&&n.removeItem(e.unknownName,e)}));for(let e=0;e{t.error&&t.unknownName&&e.removeItem(t.unknownName,t)})),this.matrix.clear(),super.destroy()}}const y=v},71227:(e,t,r)=>{"use strict";r.d(t,{default:()=>_});var n=r(77660),i=r.n(n),o=r(72048),a=r(85978),s=r(3288),l=r(44499),u=r(5883),c=r(55180),h=r(59162),d=r(31641),f=r(58835),g=r(55248),p=r(84499),m=r(98997),v=r(4263),y=r(74414),C=r(55060);class x{constructor(){this.cache=new(i())({max:10,dispose:e=>e.clear()}),this.keyMap=new WeakMap}getVectorItem(e){const t=e.getRange().key();let r=this.cache.get(t);return r||(r=new C.VectorItem(e),this.cache.set(t,r),this.keyMap.set(r,t),r)}removeVectorItem(e){const t=this.keyMap.get(e);t?this.cache.delete(t):e.clear()}}class w extends u.default{constructor(e){super(e),this.itemCache=new x,this.importRangeItem=new Set,this.hiddenPlugin=null,this.filterPlugin=null}enablePlugin(){super.enablePlugin(),this.addHook("afterShowRows",((e,t)=>this.afterHiddenChange(e,t))),this.addHook("afterHideRows",((e,t)=>this.afterHiddenChange(e,t))),this.addHook("filterHiddenChange",((e,t)=>this.afterHiddenChange(e,t)));const e=e=>this.generateChangeDep(e,"reset"),t=(t,r,n,i)=>{const o=i.cellChanges;"Format"===t&&o&&o.length>0&&e(o)};this.addHook("afterFormatChange",e),this.addHook("afterRowStyleChange",t),this.addHook("afterColStyleChange",t),this.addHook("afterGlobalStyleChange",t),this.hiddenPlugin=this.sheet.getPlugin("synoHideRowCol"),this.filterPlugin=this.sheet.getPlugin("synoFilter")}initItem(e,t,r){const n=(0,s.tokenize)(r),i=[];let o=!1;for(const e of n)e.isRange()||e.isVariable()?i.push((0,h.createRangeFromToken)(e)):e.isFunction()&&"IMPORTRANGE"===e.getText().toUpperCase()&&(o=!0);const a=this.createItem(e,t,r,i);return o&&this.importRangeItem.add(a),a}handleItemRemove(e){super.handleItemRemove(e),this.importRangeItem.delete(e),this.sheet.getWorkbook().getAsyncCalculator().getFormulaRecalculator().removeTask(e)}scheduleRecalculateItem(e){this.sheet.getWorkbook().getAsyncCalculator().getFormulaRecalculator().addTask(e)}exec(e){const t=this.sheet.getWorkbook().getFormulaParser().exec(e.formula,{sheetId:this.sheet.sheetId,item:e});if(e.value=t.result,t.error&&(e.error=new m.FormulaError(t.error),t.delayCalc&&Promise.resolve().then((()=>{this.scheduleRecalculateItem(e)}))),e.needUpdate=!1,e.selfImplicit){const{row:t,col:r}=e;this.addImplicitDep(e,new l.CellRange({row:t,col:r},{row:t,col:r}))}return this.sheet.notifyCellChanges(e.row,e.col),t}checkSpill(e){const t=e.getSpillRange();if(!t||!e.needCheckSpill)return;let r=null;const n=v.default.createFromRange(t.getRange(),this.sheet);n?(n.eachCell(((e,t)=>!!(e===n.from.row&&t===n.from.col||(0,p.isEmptyValue)(this.sheet.getDataAtCell(e,t)))||(r=new m.FormulaError(a.Exception.SPILL),!1))),e.setSpillResult(r),this.sheet.notifyRangeChanges(n.toSynoRange())):e.needCheckSpill=!1}updateItem(e){e.needUpdate&&(this.exec(e),e.needDimension&&this.sheet.getWorkbook().getAsyncCalculator().getFormulaDimensioner().addCalculatedItem(e)),e.needCheckSpill&&this.checkSpill(e)}getSpillItem(e,t){const r=this.sheet.getFormulaDepManager().getSpillContainer().matchFormulaRanges(e,t);let n;for(const i of r){const r=i.getSpillItem();if(r){if(r.row===e&&r.col===t)return r;!r.spillError&&(!n||r.row{e.isSubtotal&&e.notifyUpdate()}))}calculateAllImoprtItem(){for(const e of this.importRangeItem)this.updateItem(e)}getExternalValue(e,t,r){const n=r.item,i=this.sheet.getWorkbook();if(!(n&&(0,C.isFormulaItem)(n)||i.getExternalManager().hasExternalValue(e,t)))return a.Exception.LOADING;const o=i.getExternalManager().getExternalValue(e,t);return n&&((0,C.isImportRangeItem)(n)?n.setLinkId(e):(0,C.isFormulaItem)(n)&&(n.addExternalRef(o),o.isLoading()&&i.getNotifier()?.onExternalRequest(e))),o.getValue()}getUnlinkChanges(e){const t=[];for(const r of this.importRangeItem){const n=(0,s.tokenize)(r.formula);let i={text:[],parenthesisCount:0};const l=[i];for(const t of n){let r=t.getText();if(t.isFunction()&&"IMPORTRANGE"===t.getText().toUpperCase())i={text:[],parenthesisCount:0},l.push(i);else if(t.isLeftParenthesis())i.parenthesisCount+=1;else if(t.isRightParenthesis()&&(i.parenthesisCount-=1,l.length>1&&0===i.parenthesisCount)){const t=new C.ImportRangeItem;r=i.text.join("")+r;const n=this.sheet.getWorkbook().getFormulaParser().exec(r,{sheetId:this.sheet.sheetId,item:t}),s=t.getLinkId();s&&e.includes(s)&&(r=n.error===a.Exception.LOADING?(0,a.toFormulaString)(a.Exception.REF):(0,a.toFormulaString)(n.error||n.result)),l.pop(),i=(0,o.last)(l)}i.text.push(r)}const u=i.text.join("");r.formula!==u&&t.push([r.row,r.col,`=${u}`])}return t}cellValue(e,t,r,n){let i="",o="";const{keepNull:a,keepNfId:s}=n,u=this.sheet.getCellModel(e,t);let c=null;u?(o=u.getValue(),c=u.getCellStyle()):s&&(c=this.sheet.worksheet.getEmptyStyle(e,t));const h=r.item;h&&s&&h.setNfIdHint(c?.nfId??0);const g=c&&c.getQuotePrefix();if((0,p.isEmptyValue)(o)){const r=this.getSpillItem(e,t);if(r&&(this.updateItem(r),r.spillError||(i=this.getSpillValue(r.getValue(),e-r.row,t-r.col)),h)){const{row:e,col:t,sheet:n}=r;this.addImplicitDep(h,new l.CellRange({row:e,col:t},{row:e,col:t},n.getName()))}""===i&&a&&(i=null)}else if(!g&&(0,d.isFormula)(o)){const r=u?.getFormulaItem()||this.initItem(e,t,i);this.updateItem(r),i=r.getValue(),r.getSpillRange()&&(i=r.spillError?r.getSpillErrorValue():this.getSpillValue(i,0,0)),h&&(s&&h.setNfIdHint(r.nfId??0),n.keepLink&&void 0!==r.href&&void 0===h.href&&(h.href=r.href))}else i=(0,f.isRichTextValue)(o)?o.getText():o;return null!==i||a&&!g||(i=""),i}rangeValue(e,t,r,n){const i=Math.max(e.row,0),o=Math.max(e.col,0),a=Math.min(t.row,this.sheet.countRows()-1),s=Math.min(t.col,this.sheet.countCols()-1),l=new Array(a-i+1);for(let e=i;e<=a;e++){const t=new Array(s-o+1);for(let i=o;i<=s;i++)t[i-o]=this.cellValue(e,i,r,n);l[e-i]=t}return l}visibleCellValue(e,t,r,n){const i=n.keepNull?null:"";if(n.skipHiddenRow&&this.sheet.isHiddenRow(e)||n.skipHiddenCol&&this.hiddenPlugin.isHiddenCol(e)||n.skipFiltered&&this.filterPlugin.isHiddenRow(e))return i;const o=this.cellValue(e,t,r,n);return n.skipSubtotal&&this.sheet.getFormulaItem(e,t)?.isSubtotal?i:o}visibleRangeValue(e,t,r,n){const i=Math.max(e.row,0),o=Math.max(e.col,0),a=Math.min(t.row,this.sheet.countRows()-1),s=Math.min(t.col,this.sheet.countCols()-1),{skipHiddenRow:l,skipHiddenCol:u,skipFiltered:c,skipSubtotal:h}=n,d=[];for(let e=i;e<=a;e++){if(l&&this.sheet.isHiddenRow(e)||c&&this.filterPlugin.isHiddenRow(e))continue;const t=[];for(let i=o;i<=s;i++){if(u&&this.hiddenPlugin.isHiddenCol(i))continue;const o=this.cellValue(e,i,r,n);h&&this.sheet.getCellModel(e,i)?.getFormulaItem()?.isSubtotal||t.push(o)}d.push(t)}return d}_createVector(e,t,r,n){const i=v.default.createFromRange(e,this.sheet);if(!i)throw new Error("Range is not allowed");const o=new n(i,this,t,r);if(o.getSize()>=1e3){const e=new l.CellRange(i.from,i.to,this.sheet.getName()),r=this.itemCache.getVectorItem(this.sheet.getFormulaDepManager().getContainer().getOrCreateFormulaRange(e)),n=t.item;n&&(0,C.isFormulaItem)(n)&&r.addFormulaItem(n),o.setVectorItem(r)}return o}createRowVector(e,t,r){return this._createVector(e,t,r,y.RowVector)}createColumnVector(e,t,r){return this._createVector(e,t,r,y.ColumnVector)}createRangeVector(e,t,r){return this._createVector(e,t,r,y.RangeVector)}addImplicitDep(e,t){if(!e.registerImplicit)return;const r=t.getContainer(this.sheet.getFormulaDepManager());let n=r.getFormulaRange(t);n||(n=new g.FormulaRange(t),r.addFormulaRange(n)),e.registerImplicit(n)}getNumberFormatHint(e,t){return this.sheet.getFormulaItem(e,t)?.nfId}}const _=w},74414:(e,t,r)=>{"use strict";r.d(t,{ColumnVector:()=>o,RangeVector:()=>a,RowVector:()=>i});class n{constructor(e,t,r,n,i){this._rowOffset=e.from.row,this._colOffset=e.from.col,this._length=t,this._source=r,this._context=n,this._options=i,this._item=null}getCellValue(e,t){return this._item?this._item.getValueAt(e-this._rowOffset,t-this._colOffset,(()=>this._source.cellValue(e,t,{item:this._item},this._options))):this._source.cellValue(e,t,this._context,this._options)}getLength(){return this._length}getSize(){return this.getLength()}setVectorItem(e){this._item=e}}class i extends n{constructor(e,t,r,n){super(e,e.to.col-e.from.col+1,t,r,n)}getValue(e){return this.getCellValue(this._rowOffset,this._colOffset+e)}getStartOffset(){return this._colOffset}}class o extends n{constructor(e,t,r,n){super(e,e.to.row-e.from.row+1,t,r,n)}getValue(e){return this.getCellValue(this._rowOffset+e,this._colOffset)}getStartOffset(){return this._rowOffset}}class a extends n{constructor(e,t,r,n){super(e,e.to.row-e.from.row+1,t,r,n),this._width=e.to.col-e.from.col+1}getCellValue(e,t){let r=super.getCellValue(e,t);for(;Array.isArray(r);)r=r[0];return r}getWidth(){return this._width}getHeight(){return this.getLength()}getSize(){return this.getWidth()*this.getHeight()}getRowOffset(){return this._rowOffset}getColOffset(){return this._colOffset}}},48121:(e,t,r)=>{"use strict";r.d(t,{FreezePluginAdapter:()=>n});class n{constructor(e){this.sheet=e}get fixedRowsTop(){return this.sheet.getWorksheetState().freeze.fixedRowsTop}get fixedColumnsLeft(){return this.sheet.getWorksheetState().freeze.fixedColumnsLeft}}},85775:(e,t,r)=>{"use strict";r.d(t,{default:()=>o});var n=r(16395);class i extends n.default{constructor(e){super(e,"synoFreezeBar"),this.fixedRowsTop=0,this.fixedColumnsLeft=0}enablePlugin(){this.addHook("afterInit",(e=>this.afterInit(e))),this.addHook("afterCreateRow",((e,t)=>this.afterCreateRow(e,t))),this.addHook("afterCreateCol",((e,t)=>this.afterCreateCol(e,t))),this.addHook("afterRemoveRow",((e,t)=>this.afterRemoveRow(e,t))),this.addHook("afterRemoveCol",((e,t)=>this.afterRemoveCol(e,t))),this.addHook("beforeMoveRow",((e,t,r)=>this.beforeMove("row",e,t,r))),this.addHook("beforeMoveCol",((e,t,r)=>this.beforeMove("col",e,t,r))),super.enablePlugin()}afterInit(e){this.fixedRowsTop=e.fixedRowsTop||0,this.fixedColumnsLeft=e.fixedColumnsLeft||0}fixedRow(e){if(e===this.fixedRowsTop)return;const t=this.fixedRowsTop;this._fixedRow(e),this.sheet.runHooks("afterFixedRow",e,t)}_fixedRow(e){this.fixedRowsTop=e,this.sheet.notifyPluginChanges(["freeze"])}fixedCol(e){if(e===this.fixedColumnsLeft)return;const t=this.fixedColumnsLeft;this._fixedCol(e),this.sheet.runHooks("afterFixedCol",e,t)}_fixedCol(e){this.fixedColumnsLeft=e,this.sheet.notifyPluginChanges(["freeze"])}afterCreateRow(e,t){this.fixedRowsTop&&e=a||t.sec[1].end{"use strict";r.d(t,{default:()=>o});var n=r(85775);class i extends n.default{getDataView(){return{fixedRowsTop:this.fixedRowsTop,fixedColumnsLeft:this.fixedColumnsLeft}}getStateJSON(){return this.getDataView()}}const o=i},45486:(e,t,r)=>{"use strict";r.d(t,{createFreezeModule:()=>o});var n=r(15168);const i={flush(e,t){Object.assign(e,(0,n.freezeAllKey)(t))}};function o(){return{namespaced:!0,state:()=>({fixedRowsTop:0,fixedColumnsLeft:0}),mutations:i}}},96310:(e,t,r)=>{"use strict";r.d(t,{HiddenPluginAdapter:()=>o});var n=r(15715);class i{constructor(e){this.sheet=e}isHiddenRow(e){return this.sheet.getWorksheetState().rows[e]?.hidden??!1}isHiddenCol(e){return this.sheet.getWorksheetState().cols[e]?.hidden??!1}}class o extends((0,n.mixinHidden)(i)){}},65624:(e,t,r)=>{"use strict";r.d(t,{default:()=>a});var n=r(16395),i=r(96687);class o extends n.default{constructor(e){super(e,"synoHideRowCol")}enablePlugin(){this.sheet.hidden=this,super.enablePlugin()}hideRows(e,t,r){for(let r=e;r<=t;r++)this.sheet.worksheet.updateRowAttr(r,"hidden",!0);this.sheet.runHooks("afterHideRows",e,t,r),this.sheet.notifySheetChanges(["rows"])}hideCols(e,t,r){for(let r=e;r<=t;r++)this.sheet.worksheet.updateColAttr(r,"hidden",!0);this.sheet.runHooks("afterHideCols",e,t,r),this.sheet.notifySheetChanges(["cols"])}showRows(e,t,r){for(let r=e;r<=t;r++)this.sheet.worksheet.updateRowAttr(r,"hidden",void 0);this.sheet.runHooks("afterShowRows",e,t,r),this.sheet.notifySheetChanges(["rows"])}showCols(e,t,r){for(let r=e;r<=t;r++)this.sheet.worksheet.updateColAttr(r,"hidden",void 0);this.sheet.runHooks("afterShowCols",e,t,r),this.sheet.notifySheetChanges(["cols"])}isHiddenRow(e){return!0===this.sheet.worksheet.getRowInfo(e)?.hidden}isHiddenCol(e){return!0===this.sheet.worksheet.getColInfo(e)?.hidden}_repair(e,t,r){if(t)for(let n=0;n{"use strict";r.d(t,{mixinHidden:()=>n});const n=e=>class extends e{hasUpArrow(e){const t=this.sheet.countRows();for(;e0;)if(e-=1,!this.sheet.isFilteredRow(e))return this.sheet.isHiddenRowExcludeFilter(e);return!1}hasLeftArrow(e){return this.isHiddenCol(e+1)}hasRightArrow(e){return this.isHiddenCol(e-1)}getVisibleRowIndexes(e){const{from:{row:t},to:{row:r}}=e,n=[];for(let e=t;e<=r;e++)this.isHiddenRow(e)||n.push(e);return n}getVisibleColIndexes(e){const{from:{col:t},to:{col:r}}=e,n=[];for(let e=t;e<=r;e++)this.isHiddenCol(e)||n.push(e);return n}}},82430:(e,t,r)=>{"use strict";r.d(t,{default:()=>s});var n=r(65624),i=r(15715);class o extends n.default{constructor(e){super(e)}}class a extends((0,i.mixinHidden)(o)){constructor(e){super(e),this.minHideRow=-1,this.minHideCol=-1,this.maxHideRow=-1,this.maxHideCol=-1}enablePlugin(){this.addHook("afterInit",(()=>this.afterInit())),this.addHook("afterCreateRow",((e,t)=>this.afterCreateRow(e,t))),this.addHook("afterRemoveRow",((e,t)=>this.afterRemoveRow(e,t))),this.addHook("afterCreateCol",((e,t)=>this.afterCreateCol(e,t))),this.addHook("afterRemoveCol",((e,t)=>this.afterRemoveCol(e,t))),this.addHook("afterMoveRow",(e=>this.afterMoveRow(e))),this.addHook("afterMoveCol",(e=>this.afterMoveCol(e))),this.addHook("collectRemovedRowInfo",((e,t,r)=>this._collectRemovedInfo("row",e,t,r))),this.addHook("collectRemovedColInfo",((e,t,r)=>this._collectRemovedInfo("col",e,t,r))),super.enablePlugin()}afterInit(){this.updateMinMaxRow(),this.updateMinMaxCol()}updateMinMaxRow(){const e=this.sheet.worksheet.rowInfos;this.minHideRow=this.sheet.countRows();for(let t=0;t=0;t--)if(this.isHiddenRow(t)){this.maxHideRow=t;break}}updateMinMaxCol(){const e=this.sheet.worksheet.colInfos;this.minHideCol=this.sheet.countCols();for(let t=0;t=0;t--)if(this.isHiddenCol(t)){this.maxHideCol=t;break}}hideRows(e,t,r){t>this.maxHideRow&&(this.maxHideRow=t),ethis.maxHideCol&&(this.maxHideCol=t),e=i&&t<=o)for(let e=o;e>=i;e--)if(this[n](e)){t=e;break}if(r>=i&&r<=o)for(let e=i;e<=o;e++)if(this[n](e)){r=e;break}return[t,r]}afterMoveRow(e){[this.maxHideRow,this.minHideRow]=this._afterMove(e,this.maxHideRow,this.minHideRow,"isHiddenRow")}afterMoveCol(e){[this.maxHideCol,this.minHideCol]=this._afterMove(e,this.maxHideCol,this.minHideCol,"isHiddenCol")}_collectRemovedInfo(e,t,r,n){const i="row"===e?this.isHiddenRow:this.isHiddenCol,o=new Array(n);for(let e=0;ee))&&("row"===e?t.push({pluginName:this.pluginName,rowInfo:o}):t.push({pluginName:this.pluginName,colInfo:o}))}}const s=a},26630:(e,t,r)=>{"use strict";r.d(t,{DrawingPluginAdapter:()=>i});var n=r(25024);class i{constructor(e){this.sheet=e}getImagesJSON(){return this.sheet.getWorksheetState().drawing.images}getChartsJSON(){return this.sheet.getWorksheetState().drawing.charts.map((e=>this.convertChartStateToJSON(e)))}getImageJSONById(e){return this.sheet.getWorkbook().getStoreGetter("worksheet/drawing/getImageById")(e)}getChartJSONById(e){const t=this.sheet.getWorkbook().getStoreGetter("worksheet/drawing/getChartById")(e);return t?this.convertChartStateToJSON(t):null}convertChartStateToJSON(e){return{id:e.id,position:e.position,chartInfo:new n.DataChartInfo(e.config,{},e.data,e.fc,this.sheet.getWorkbook().getLocale().getSSF())}}}},28431:(e,t,r)=>{"use strict";r.d(t,{SynoChart:()=>h,SynoImage:()=>c});var n=r(66840),i=r(13574),o=r(47970);function a(e){let{height:t,width:r}=e;return{height:Math.round(t)||0,width:Math.round(r)||0}}function s(e){return{row:Math.round(e?.row)||0,col:Math.round(e?.col)||0,rowOffset:Math.round(e?.rowOffset)||0,colOffset:Math.round(e?.colOffset)||0}}function l(e){return(0,o.isAbsolutePosition)(e)?{type:o.DrawingPositionType.Absolute,top:Math.round(e.top)||0,left:Math.round(e.left)||0,...a(e)}:(0,o.isOneAnchorPosition)(e)?{type:o.DrawingPositionType.OneAnchor,from:s(e.from),...a(e)}:{type:o.DrawingPositionType.TwoAnchor,from:s(e.from),to:s(e.to)}}class u{constructor(e,t){this.id=e,null==t.type&&(t.type=o.DrawingPositionType.Absolute),this.position=l(t)}destroy(){}getPosition(){return(0,i.deepClone)(this.position)}setPosition(e){this.position=l(e)}}class c extends u{constructor(e,t,r){super(e,t),this.path=r.path}getJSON(){return{id:this.id,position:this.getPosition(),path:this.path}}}class h extends u{constructor(e,t,r){super(e,t),this.infoHandler=new n.default(this,r.chartInfo),this.sheet=r.sheet}getJSON(){return{id:this.id,position:this.getPosition(),chartInfo:this.infoHandler.getInfo()}}destroy(){this.infoHandler.destroy(),super.destroy()}}},17250:(e,t,r)=>{"use strict";r.d(t,{DRAWING_TYPE:()=>c,default:()=>C});var n=r(16395),i=r(55180),o=r(28431),a=r(5287),s=r(47970),l=r(96803),u=r(3058);let c;function h(e){return e instanceof o.SynoChart||!!e.infoHandler}!function(e){e.IMAGE="img",e.CHART="chart"}(c||(c={}));class d extends n.default{constructor(e){super(e,"synoDrawingController"),this.images=[],this.charts=[]}drawings(){return this.images.concat(this.charts)}getImages(){return this.images}getCharts(){return this.charts}enablePlugin(){this.addHook("afterInit",(e=>this.initData(e))),this.addHook("repairCross",(e=>this.repairCross(e))),super.enablePlugin()}destroy(){for(let e=0;e0;return r&&(0,i.arrayEach)(t,(e=>{null==e.pos.type&&(e.pos.type=s.DrawingPositionType.Absolute,e.pos.top-=l.default.COL_HEADER_HEIGHT,e.pos.left-=l.default.ROW_HEADER_WIDTH),e.type===c.IMAGE?this.images.push(this._createImage(e.id,e.pos,e.path||e.id)):e.type===c.CHART&&this.charts.push(this._createChart(e.id,e.pos,e.chartObj))})),r}collectColor(e){for(const t of this.charts)t.infoHandler.getInfo().getAllColors().forEach((t=>{e.add(t)}));return e}_createImage(e,t,r){return new o.SynoImage(e,t,{path:r})}insertImage(e,t,r){void 0===r&&(r=!0);let n=this.getImageById(e);n||(n=this._createImage(e,t,e),this.images.push(n),r&&this.sheet.runHooks("afterInsertImage",e,t),this.sheet.notifyPluginChanges(["drawing"]))}removeImage(e,t){void 0===t&&(t=!0);const r=this.images.findIndex((t=>t.id===e));if(r<0)return;const n=this.images[r],i=n.getPosition();n.destroy(),this.images.splice(r,1),t&&this.sheet.runHooks("afterRemoveImage",e,i),this.sheet.notifyPluginChanges(["drawing"])}resizeImage(e,t){const r=this.getImageById(e);if(!r)return;const n=r.getPosition();r.setPosition(t),this.sheet.runHooks("afterResizeImage",e,n,r.getPosition()),this.sheet.notifyPluginChanges(["drawing"])}_createChart(e,t,r){return new o.SynoChart(e,t,{chartInfo:this.convertChartInfo(r),sheet:this.sheet})}insertChart(e,t,r,n){void 0===n&&(n=!0);let i=this.getChartById(e);i||(i=this._createChart(e,t,r),this.charts.push(i),n&&(this.sheet.runHooks("afterInsertChart",e,t,i.infoHandler.getChartObj()),this.sheet.getWorkbook().getNotifier()?.onColorAdded()),this.sheet.notifyPluginChanges(["drawing"]))}removeChart(e,t){void 0===t&&(t=!0);const r=this.charts.findIndex((t=>t.id===e));if(r<0)return;const n=this.charts[r],i=n.getPosition(),o=n.infoHandler.getChartObj();n.destroy(),this.charts.splice(r,1),t&&this.sheet.runHooks("afterRemoveChart",e,i,o),this.sheet.notifyPluginChanges(["drawing"])}resizeChart(e,t){const r=this.getChartById(e);if(!r)return;const n=r.getPosition();r.setPosition(t),this.sheet.runHooks("afterResizeChart",e,n,r.getPosition()),this.sheet.notifyPluginChanges(["drawing"])}adjustChart(e,t){const r=this.getChartById(e);if(!r)return;const n=this.convertChartInfo(t),i=r.infoHandler.getChartObj();r.infoHandler.adjust(n),this.sheet.runHooks("afterAdjustChart",e,i,t),this.sheet.notifyPluginChanges(["drawing"])}setChartConfig(e,t,r){const n=this.getChartById(e);if(!n)return;const i=n.infoHandler.setChartConfig(t,r);this.sheet.runHooks("afterSetChartConfig",e,t,r,i),this.sheet.notifyPluginChanges(["drawing"]),this.sheet.getWorkbook().getNotifier()?.onColorAdded()}getImageById(e){return this._getDrawingById(this.images,e)}getChartById(e){return this._getDrawingById(this.charts,e)}_getDrawingById(e,t){let r=null;return(0,i.arrayEach)(e,(function(e){if(e.id===t)return r=e,!1})),r}repairCross(e){const t=e[this.pluginName];t&&(0,i.arrayEach)(t,(e=>{const t=this.getChartById(e.chartId);t&&e.displayRange&&t.infoHandler.updateDisplayRange(e.displayRange)}))}convertChartInfo(e){return new a.default(e,{sheet:this.sheet})}modifyDrawingsByInsertRowCol(e,t,r){this.drawings().forEach(((n,i)=>{if(!(0,s.isAbsolutePosition)(n.position)){const i=n.getPosition();this._changePositionByInsertRowCol(i,e,t,r),h(n)?this.resizeChart(n.id,i):this.resizeImage(n.id,i)}}))}modifyDrawingsByRemoveRowCol(e,t,r){const n={start:t,end:t+r-1},i=[];this.drawings().forEach(((o,a)=>{if(!(0,s.isAbsolutePosition)(o.position))if((0,s.isTwoAnchorPosition)(o.position)&&this.sectionContainImage(e,n,o.position))i.push([h(o),o.id]);else{const n=o.getPosition();this._changePositionByRemoveRowCol(n,e,t,r),h(o)?this.resizeChart(o.id,n):this.resizeImage(o.id,n)}})),i.forEach((e=>{let[t,r]=e;return t?this.removeChart(r):this.removeImage(r)}))}modifyDrawingsByMoveRowCol(e,t,r,n,i){const o="row"===e?this.sheet.countRows():this.sheet.countCols();if(t+r+n>o&&(n=o-t-r),n<0)return;const a=(0,u.createMoveArg)(t,r,n,i),l={start:a.sec[0].start,end:a.sec[1].end};this.drawings().forEach(((t,r)=>{if((0,s.isAbsolutePosition)(t.position)||!this.sectionIntersectImage(e,l,t.position))return;const n=t.getPosition();if(this.sectionContainImage(e,a.sec[0],n))this._changePositionByInsertRowCol(n,e,a.sec[0].start,a.sec[1].amount);else if(this.sectionContainImage(e,a.sec[1],n))this._changePositionByRemoveRowCol(n,e,a.sec[0].start,a.sec[0].amount);else{const t=a.sec[a.isBackward?1:0].amount,r=a.sec[a.isBackward?1:0].start,i=a.isBackward?a.sec[0].start:a.sec[0].start+a.sec[1].amount;this._changePositionByRemoveRowCol(n,e,r,t),this._changePositionByInsertRowCol(n,e,i,t)}h(t)?this.resizeChart(t.id,n):this.resizeImage(t.id,n)}))}_changePositionByInsertRowCol(e,t,r,n){!(0,s.isAbsolutePosition)(e)&&e.from[t]>=r&&(e.from[t]+=n),(0,s.isTwoAnchorPosition)(e)&&(e.to[t]>r||e.to[t]===r&&e.to[`${t}Offset`]>0)&&(e.to[t]+=n)}_changePositionByRemoveRowCol(e,t,r,n){const i=e=>{e[t]>=r+n?e[t]-=n:e[t]>=r&&(e[t]=r,e[`${t}Offset`]=0)};(0,s.isAbsolutePosition)(e)||i(e.from),(0,s.isTwoAnchorPosition)(e)&&i(e.to)}sectionContainImage(e,t,r){const n=f(e,t.start,t.end),i=g(r);return(0,s.bboxContains)(n,i)}sectionIntersectImage(e,t,r){const n=f(e,t.start,t.end),i=g(r);return(0,s.bboxIntersect)(n,i)}}function f(e,t,r){return"row"===e?{top:t*l.default.ROW_HEIGHT,left:Number.NEGATIVE_INFINITY,bottom:(r+1)*l.default.ROW_HEIGHT,right:Number.POSITIVE_INFINITY}:{top:Number.NEGATIVE_INFINITY,left:t*l.default.COL_WIDTH,bottom:Number.POSITIVE_INFINITY,right:(r+1)*l.default.COL_WIDTH}}function g(e,t){let r,n,i,o;return(0,s.isAbsolutePosition)(e)?({left:n,top:r}=e):({x:n,y:r}=p(e.from,t)),(0,s.isTwoAnchorPosition)(e)?({x:i,y:o}=p(e.to,t)):(i=n+e.width,o=r+e.height),{top:r,left:n,bottom:o,right:i}}function p(e,t){const{col:r,row:n,colOffset:i,rowOffset:o}=e;return{x:Math.min(v(r,t?.colOffset)+i,v(r+1,t?.colOffset)),y:Math.min(y(n,t?.rowOffset)+o,y(n+1,t?.rowOffset))}}function m(e,t,r){if(e<0)return 0;const n=t?.[e];return null!=n?n:e*r}function v(e,t){return void 0===t&&(t=[]),m(e,t,l.default.COL_WIDTH)}function y(e,t){return void 0===t&&(t=[]),m(e,t,l.default.ROW_HEIGHT)}const C=d},66840:(e,t,r)=>{"use strict";r.d(t,{default:()=>c});var n=r(55180),i=r(4263),o=r(59162),a=r(84499),s=r(55060),l=r(85978),u=r(3288);const c=class{constructor(e,t){this.chart=e,this.chartInfo=t,this.unitItem=new s.UnitItem(this),this.rangeItem=new s.RangeItem(this),this.bindDeps(this.chartInfo.ensureDisplayRange()),this.dataExpired=!1}destroy(){this.unbindDeps()}fireDataChanged(){this.chart.sheet.notifyPluginChanges(["drawing"]),this.dataExpired=!1}getChartObj(){return this.chartInfo.getChartCfg()}adjust(e){this.chartInfo.ensureDisplayRange()!==e.ensureDisplayRange()&&this.rebindDeps(e.ensureDisplayRange()),this.chartInfo=e,this.fireDataChanged()}setChartConfig(e,t){const r=this.chartInfo.invert(e,t);return this.chartInfo.apply(e,t),"applyDisplayRange"===e&&this.rebindDeps(this.chartInfo.ensureDisplayRange()),this.fireDataChanged(),r}updateDisplayRange(e){this.chartInfo.applyDisplayRange(e),this.rebindDeps(e)}_normalizeRangeArg(e){return"string"==typeof e?e=(0,i.textToMultiRanges)(e,this.chartInfo.sheet):Array.isArray(e)||(e=[e]),e}rebindDeps(e){this.unbindDeps(),this.bindDeps(e)}bindDeps(e){const t=this.chartInfo.sheet,r=(0,o.parseFormulaRange)(e),n=t.formula.checkCrossRefError(r);if(n)this.chartInfo.sheet.getWorkbook().getUnitUnknownRefManager().addItem(n,this.unitItem);else{const e=t.formula.mapFormulaRange(r);this.unitItem.register(e),this.rangeItem.register(e)}}unbindDeps(){this.unitItem.unregister(),this.rangeItem.unregister()}notifyAlterGrid(e,t,r,n,i,a){const s={[e]:r},u=this.chartInfo.ensureDisplayRange(),c=this.chartInfo.sheet;let h=l.utils.changeFormula(u,{delta:n,start:s},t.getName(),c.getName());if(h===u)return!1;if(n<0){this._addToCrossRepiarData(a);const e=/#REF!$/;h=(0,o.splitMultiRanges)(h).filter((t=>!e.test(t))).join(",")}return this.updateDisplayRange(h),this.setDataExpired(),!0}onDepUpdate(){this.setDataExpired()}afterHiddenChange(e,t,r){const i=this._normalizeRangeArg(this.chartInfo.ensureDisplayRange());let o=!1;(0,n.arrayEach)(i,(n=>{if(n.from[e]<=r&&n.to[e]>=t)return o=!0,!1})),o&&this.setDataExpired()}notifyMove(e,t,r){const n=this.chartInfo.ensureDisplayRange(),i=this.chartInfo.sheet,o=l.utils.moveFormula(e,n,r,t.getName(),i.getName());o!==n&&this.updateDisplayRange(o),this.setDataExpired()}notifyRename(e,t,r){const n=this.chartInfo.ensureDisplayRange(),i=(0,u.changeSheetName)(n,e,t);n!==i&&((0,a.addCrossRepairData)(r,this.chartInfo.sheet.sheetId,"synoDrawingController",{chartId:this.chart.id,displayRange:i}),this.updateDisplayRange(i),this.setDataExpired())}notifyMoveFormulaRange(e,t,r){const n=this.chartInfo.ensureDisplayRange(),i=this.chartInfo.sheet.getName(),o=l.utils.changeFormulaRange(n,e,t,i);n!==o&&(this._addToCrossRepiarData(r),this.updateDisplayRange(o),this.setDataExpired())}notifyRecalcUnknown(){this.rebindDeps(this.chartInfo.ensureDisplayRange()),this.setDataExpired()}notifyDeleteSheet(){this.rebindDeps(this.chartInfo.ensureDisplayRange()),this.setDataExpired()}getSheet(){return this.chartInfo.sheet}_addToCrossRepiarData(e){(0,a.addCrossRepairData)(e,this.chartInfo.sheet.sheetId,"synoDrawingController",{chartId:this.chart.id,displayRange:this.chartInfo.ensureDisplayRange()})}isDrawable(){return!this.dataExpired&&this.chartInfo.isDrawable()}getEchartParameters(e,t){return this.chartInfo.getEchartParameters(e,t)}setDataExpired(){this.dataExpired=!0}updateData(){return!!this.dataExpired&&(this.chartInfo.fillDataByRanges(),this.fireDataChanged(),!0)}getInfo(){return this.chartInfo}}},86296:(e,t,r)=>{"use strict";r.d(t,{default:()=>i});var n=r(47970);class i{constructor(e){this.offsetter=e}drawingPositionToBBox(e){let t,r,i,o;return(0,n.isAbsolutePosition)(e)?({left:r,top:t}=e):({x:r,y:t}=this.relativeOffsetToAbsolute(e.from)),(0,n.isTwoAnchorPosition)(e)?({x:i,y:o}=this.relativeOffsetToAbsolute(e.to)):(i=r+e.width,o=t+e.height),{top:t,left:r,bottom:o,right:i}}toAbsolutePosition(e){const{top:t,left:r,bottom:i,right:o}=this.drawingPositionToBBox(e);return{type:n.DrawingPositionType.Absolute,top:t,left:r,height:i-t,width:o-r}}toPositionOfType(e,t){let r,i,o,a,s,l;if((0,n.isDrawingPosition)(e)||(e={type:n.DrawingPositionType.Absolute,...e}),!(0,n.isDrawingPosition)(e))throw new Error("not a DrawingPosition");if(e.type===t)return e;if((0,n.isAbsolutePosition)(e)?(({left:i,top:r}=e),s=this.absoluteOffsetToRelative(i,r)):(s=e.from,({x:i,y:r}=this.relativeOffsetToAbsolute(s))),(0,n.isTwoAnchorPosition)(e)){const{x:t,y:n}=this.relativeOffsetToAbsolute(e.to);a=t-i,o=n-r}else({width:a,height:o}=e);if(t===n.DrawingPositionType.Absolute)return{type:t,top:r,left:i,height:o,width:a};if(t===n.DrawingPositionType.OneAnchor)return{type:t,from:s,height:o,width:a};{const e=i+a,n=r+o;return l=this.absoluteOffsetToRelative(e,n),{type:t,from:s,to:l}}}relativeOffsetToAbsolute(e){const{col:t,row:r,colOffset:n,rowOffset:i}=e;return{x:Math.min(this.offsetter.getColOffset(t)+n,this.offsetter.getColOffset(t+1)),y:Math.min(this.offsetter.getRowOffset(r)+i,this.offsetter.getRowOffset(r+1))}}absoluteOffsetToRelative(e,t){const r=this.offsetter.getColByOffset(e),n=this.offsetter.getRowByOffset(t);return{col:r,row:n,colOffset:e-this.offsetter.getColOffset(r),rowOffset:t-this.offsetter.getRowOffset(n)}}}},71800:(e,t,r)=>{"use strict";r.d(t,{RowColOffsetter:()=>a});var n=r(78051);function i(e,t){return e<0?0:e>=t.length?t[t.length-1]:t[e]}function o(e,t){return t{"use strict";r.d(t,{default:()=>s});var n=r(17250),i=r(55180),o=r(60041);class a extends n.default{enablePlugin(){super.enablePlugin(),this.addHook("afterShowRows",((e,t)=>this.afterHiddenChange("row",e,t))),this.addHook("afterShowCols",((e,t)=>this.afterHiddenChange("col",e,t))),this.addHook("afterHideRows",((e,t)=>this.afterHiddenChange("row",e,t))),this.addHook("afterHideCols",((e,t)=>this.afterHiddenChange("col",e,t))),this.addHook("filterHiddenChange",((e,t)=>this.afterHiddenChange("row",e,t)))}updateAllChartData(){(0,i.arrayEach)(this.charts,(e=>{e.infoHandler.updateData()}))}afterHiddenChange(e,t,r){(0,i.arrayEach)(this.charts,(n=>{n.infoHandler.afterHiddenChange(e,t,r)}))}getImageJSONById(e){return this.getImageById(e)?.getJSON()??null}getChartJSONById(e){return this.getChartById(e)?.getJSON()??null}getImagesJSON(){return this.images.map((e=>e.getJSON()))}getChartsJSON(){return this.charts.map((e=>e.getJSON()))}getStateJSON(){return{images:this.getImagesJSON(),charts:this.charts.map((e=>{const t=e.infoHandler.getChartObj(),r=e.infoHandler.getInfo().getDrawableData(),n=e.infoHandler.getInfo().getAxisFc();return{id:e.id,position:e.getPosition(),config:t,data:r,fc:n}}))}}getDataView(){function e(e){return{id:e.id,position:e.getPosition()}}return{images:this.images.map(e),charts:this.charts.map(e)}}convertChartInfo(e){return new o.default(e,{sheet:this.sheet})}}const s=a},79921:(e,t,r)=>{"use strict";r.d(t,{createDrawingModule:()=>a});var n=r(15168);const i={getImageById(e){let{images:t}=e;return e=>t.find((t=>t.id===e))??null},getChartById(e){let{charts:t}=e;return e=>t.find((t=>t.id===e))??null}},o={flush(e,t){Object.assign(e,(0,n.freezeAllKey)(t))}};function a(){return{namespaced:!0,state:()=>({images:[],charts:[]}),getters:i,mutations:o}}},35956:(e,t,r)=>{"use strict";r.d(t,{ColResizePluginAdapter:()=>n});class n{constructor(e){this.sheet=e}getManualSize(e){return this.sheet.getWorksheetState().cols[e]?.w??null}}},76443:(e,t,r)=>{"use strict";r.d(t,{default:()=>s});var n=r(16395),i=r(96687),o=r(96803);class a extends n.default{constructor(e){super(e,"synoManualColumnResize")}getManualSize(e){const t=this.sheet.worksheet.getColInfo(e);return t&&t.w?t.w:null}setManualSize(e,t){return"number"==typeof t&&(t=Math.round(t),t=Math.min(t,o.default.MAX_COL_WIDTH),t=Math.max(t,o.default.MIN_COL_WIDTH)),this.sheet.worksheet.updateColAttr(e,"w",t??void 0),this.sheet.notifySheetChanges(["cols"]),t}applyResizeChange(e,t,r,n){const i=Array.isArray(r)?r:[r];for(let r=e;r<=t;r++)this.setManualSize(r,i[(r-e)%i.length])}repairCol(e,t){e&&this.applyResizeChange(t,t+e.length-1,e,i.SourceType.InsertedData)}}const s=a},78598:(e,t,r)=>{"use strict";r.d(t,{default:()=>o});var n=r(76443);class i extends n.default{enablePlugin(){this.addHook("collectRemovedColInfo",((e,t,r)=>this._collectRemovedInfo(e,t,r))),super.enablePlugin()}applyResizeChange(e,t,r,n){const i=[];for(let r=e;r<=t;r++)i.push(this.getManualSize(r));super.applyResizeChange(e,t,r,n),this.sheet.runHooks("afterColumnResize",e,t,i,r,n)}_collectRemovedInfo(e,t,r){const n=new Array(r);for(let e=0;enull!==e))&&e.push({pluginName:this.pluginName,colInfo:n})}}const o=i},3058:(e,t,r)=>{"use strict";r.d(t,{createMoveArg:()=>o,default:()=>a});var n=r(16395);class i extends n.default{constructor(e){super(e,"synoManualMove")}moveRow(e,t,r,n,i){const a=this.sheet.countRows();if(e+t+r>a&&(r=a-e-t),r<=0)return;const s=o(e,t,r,n);i=i||{};const l={};this.sheet.runHooks("beforeMoveRow",s,i,l),this.sheet.getDataModel().moveRow(e,t,r),this.sheet.getHyperlinkModel().moveRowCol("row",s),this.sheet.runHooks("afterMoveRow",s,i,l),i.cross&&this.sheet.controller.repairCrossData({crossInfo:i.cross}),this.sheet.notifyAlterGrid()}moveCol(e,t,r,n,i){const a=this.sheet.countCols();if(e+t+r>a&&(r=a-e-t),r<=0)return;const s=o(e,t,r,n);i=i||{};const l={};this.sheet.runHooks("beforeMoveCol",s,i,l),this.sheet.getDataModel().moveCol(e,t,r),this.sheet.getHyperlinkModel().moveRowCol("col",s),this.sheet.runHooks("afterMoveCol",s,i,l),i.cross&&this.sheet.controller.repairCrossData({crossInfo:i.cross}),this.sheet.notifyAlterGrid()}}function o(e,t,r,n){return{sec:[{start:e,end:e+t-1,amount:t},{start:e+t,end:e+t+r-1,amount:r}],isBackward:n,delta:n?-t:r}}const a=i},19005:(e,t,r)=>{"use strict";r.d(t,{RowResizePluginAdapter:()=>n});class n{constructor(e){this.sheet=e}getManualSize(e){return this.sheet.getWorksheetState().rows[e]?.h??null}}},37751:(e,t,r)=>{"use strict";r.d(t,{default:()=>s});var n=r(16395),i=r(96687),o=r(96803);class a extends n.default{constructor(e){super(e,"synoManualRowResize")}getManualSize(e){const t=this.sheet.worksheet.getRowInfo(e);return t&&t.h?t.h:null}setManualSize(e,t){return"number"==typeof t&&(t=Math.round(t),t=Math.max(t,o.default.MIN_ROW_HEIGHT),t=Math.min(t,o.default.MAX_ROW_HEIGHT)),this.sheet.worksheet.updateRowAttr(e,"h",t??void 0),this.sheet.notifySheetChanges(["rows"]),t}applyResizeChange(e,t,r,n){const i=Array.isArray(r)?r:[r];for(let r=e;r<=t;r++)this.setManualSize(r,i[(r-e)%i.length])}repairRow(e,t){e&&this.applyResizeChange(t,t+e.length-1,e,i.SourceType.InsertedData)}}const s=a},62033:(e,t,r)=>{"use strict";r.d(t,{default:()=>o});var n=r(37751);class i extends n.default{enablePlugin(){this.addHook("collectRemovedRowInfo",((e,t,r)=>this._collectRemovedInfo(e,t,r))),super.enablePlugin()}applyResizeChange(e,t,r,n){const i=[];for(let r=e;r<=t;r++)i.push(this.getManualSize(r));super.applyResizeChange(e,t,r,n),this.sheet.runHooks("afterRowResize",e,t,i,r,n)}_collectRemovedInfo(e,t,r){const n=new Array(r);for(let e=0;enull!==e))&&e.push({pluginName:this.pluginName,rowInfo:n})}}const o=i},87047:(e,t,r)=>{"use strict";r.d(t,{MergePluginAdapter:()=>a});var n=r(9976),i=r(37873);class o{constructor(e){this.sheet=e}getMergedRange(e,t){return this.sheet.getWorkbook().getStoreGetter("worksheet/merge/getMergedRange")(e,t)}searchMerge(e){return this.sheet.getWorkbook().getStoreGetter("worksheet/merge/searchMerge")(e)}getOverlap(e){return this.sheet.getWorkbook().getStoreGetter("worksheet/merge/getOverlap")(e)}*traverseMergedRange(){for(const e of this.sheet.getWorksheetState().merge.mergeRanges)yield new i.SynoCellRange(...e)}}class a extends((0,n.mixinMerge)(o)){}},9976:(e,t,r)=>{"use strict";r.d(t,{mixinMerge:()=>n});const n=e=>class extends e{beforeGetCell(e){const t=this.getMergedRange(e.row,e.col);return t&&(e.row=t.from.row,e.col=t.from.col),e}isMultipleCells(e){return!e.isSingle()&&!this.searchMerge(e)}expandSelection(e){let t=!0;for(;t;){t=!1;const r=this.getOverlap(e);for(let n=0;no.row)n-=1;else if(n=a.row,i--,ia.col)return null;break;case"right":if(ia.row)return null;break;case"left":if(i>o.col)i-=1;else if(i=a.col,n--,n0&&i>0&&n{"use strict";r.d(t,{default:()=>u});var n=r(16395),i=r(96687),o=r(84499),a=r(37873),s=r(13400);class l extends n.default{constructor(e){super(e,"synoMergeCell"),this.rangeCollection=new s.default}enablePlugin(){this.addHook("afterInit",(e=>this.afterInit(e))),this.addHook("afterCreateCol",((e,t)=>this._afterCreateRowCol("col",e,t))),this.addHook("afterRemoveCol",((e,t)=>this._afterRemoveRowCol("col",e,t))),this.addHook("afterCreateRow",((e,t)=>this._afterCreateRowCol("row",e,t))),this.addHook("afterRemoveRow",((e,t)=>this._afterRemoveRowCol("row",e,t))),this.addHook("afterSort",((e,t)=>this._afterSort(e,t))),this.addHook("beforeMoveRow",(e=>this._beforeMove("row",e))),this.addHook("beforeMoveCol",(e=>this._beforeMove("col",e))),super.enablePlugin()}afterInit(e){const t=e.synoMergeCell;Array.isArray(t)&&this.rangeCollection.init(t.map((e=>a.SynoCellRange.fromArray(e))))}getMergedInfoCollection(){return this.rangeCollection}_afterCreateRowCol(e,t,r){this.rangeCollection.onCreateRowCol(e,t,r),this.sheet.notifyPluginChanges(["merge"])}_afterRemoveRowCol(e,t,r){this.rangeCollection.onRemoveRowCol(e,t,r),this.sheet.notifyPluginChanges(["merge"])}_afterSort(e,t){const r=this.rangeCollection.getOverlap(t),n=[];r.forEach((r=>{this.rangeCollection.delete(r),r.from.row===r.to.row&&t.from.col<=r.from.col&&r.to.col<=t.to.col&&(r.from.row=r.to.row=e[r.from.row-t.from.row]+t.from.row,n.push(r))})),n.forEach((e=>this.rangeCollection.insert(e))),this.sheet.notifyPluginChanges(["merge"])}_beforeMove(e,t){this.rangeCollection.onMoveRowCol(e,t),this.sheet.notifyPluginChanges(["merge"])}canMergeRange(e){return!e.isSingle()}mergeRange(e,t){this.canMergeRange(e)&&(this.sheet.getOrCreateCell(e.from.row,e.to.col),this._removeOverlapInfo(e),this.rangeCollection.insert(e),this.sheet.runHooks("afterMergeCells",e,t),this.sheet.notifyPluginChanges(["merge"]))}unmergeRange(e,t){this.rangeCollection.delete(e)&&(this.sheet.runHooks("afterUnmergeCells",e,t),this.sheet.notifyPluginChanges(["merge"]))}_repairFn(e){e.forEach((e=>this.mergeRange(a.SynoCellRange.fromArray(e),i.SourceType.InsertedData)))}repairRow(e){this._repairFn(e)}repairCol(e){this._repairFn(e)}isMergeHidden(e,t){const r=this.getMergedRange(e,t);return!!r&&(r.from.row!==e||r.from.col!==t)}_removeOverlapInfo(e){this.rangeCollection.getOverlap(e).forEach((e=>this.rangeCollection.delete(e))),this.sheet.notifyPluginChanges(["merge"])}getOverlap(e){return this.rangeCollection.getOverlap(e)}getMergedRange(e,t){return this.rangeCollection.getOverlap((0,o.createRange)(e,t,e,t))[0]}getCoverRange(){return this.rangeCollection.getCoverRange()}serialize(){return Array.from(this.rangeCollection.traverse(),(e=>e.toArray()))}}const u=l},48062:(e,t,r)=>{"use strict";r.d(t,{default:()=>s});var n=r(9976),i=r(92985);class o extends i.default{enablePlugin(){super.enablePlugin(),this.addHook("collectRemovedRowInfo",((e,t,r)=>this.collectRemovedRowInfo(e,t,r))),this.addHook("collectRemovedColInfo",((e,t,r)=>this.collectRemovedColInfo(e,t,r)))}_getRemovedInfo(e,t,r){const n=this.getCoverRange();return n?(n.from[e]=t,n.to[e]=t+r-1,this.rangeCollection.getOverlap(n).map((e=>e.toArray()))):[]}collectRemovedRowInfo(e,t,r){const n=this._getRemovedInfo("row",t,r);n.length>0&&e.push({pluginName:this.pluginName,rowInfo:n})}collectRemovedColInfo(e,t,r){const n=this._getRemovedInfo("col",t,r);n.length>0&&e.push({pluginName:this.pluginName,colInfo:n})}checkMoveEnable(e,t,r,n){const i=this.getCoverRange();return!i||(i.from[e]=t,i.to[e]=t+r-1,!this.rangeCollection.getOverlap(i).some((e=>!i.includesRange(e)))&&(i.from[e]=t+r,i.to[e]=t+r+n-1,!this.rangeCollection.getOverlap(i).some((e=>!i.includesRange(e)))))}checkMergeOverlay(e,t){const r=this.rangeCollection.getOverlap(e);if(0===r.length)return!1;if(t){const t=e.getTopLeftCorner(),n=e.getBottomRightCorner();return!r.every((e=>e.getHeight()<=1&&e.from.col>=t.col&&e.to.col<=n.col))}return!0}searchMerge(e){return this.rangeCollection.search(e)}traverseMergedRange(){return this.rangeCollection.traverse()}containsIncompleteMergedCells(e){return this.getOverlap(e).some((t=>!e.includesRange(t)))}getDataView(){return this.serialize()}getStateJSON(){return{mergeRanges:this.serialize()}}}class a extends((0,n.mixinMerge)(o)){}const s=a},30105:(e,t,r)=>{"use strict";r.d(t,{createMergeModule:()=>s});var n=r(37873),i=r(15168);const o={mergeGrid(e){let{mergeRanges:t}=e;const r=[];for(const[e,i,o,a]of t){const t=new n.SynoCellRange(e,i,o,a);for(let n=e;n<=o;n++){r[n]||(r[n]=[]);for(let e=i;e<=a;e++)r[n][e]=t}}return r},getMergedRange(e,t){let{mergeGrid:r}=t;return(e,t)=>r[e]?.[t]},searchMerge(e,t){let{mergeGrid:r}=t;return e=>{const t=r[e.from.row]?.[e.from.col];return t?.isEqual(e)??!1}},getOverlap(e,t){let{mergeGrid:r}=t;return e=>{const t=new Set;return e.forAll(((e,n)=>{const i=r[e]?.[n];i&&t.add(i)})),Array.from(t)}}},a={flush(e,t){Object.assign(e,(0,i.freezeAllKey)(t))}};function s(){return{namespaced:!0,state:()=>({mergeRanges:[]}),mutations:a,getters:o}}},92428:(e,t,r)=>{"use strict";r.d(t,{default:()=>c});var n=r(16395),i=r(58025),o=r(84499),a=r(15343);const s="_text",l=new a.CellDesc;class u extends n.default{constructor(e){super(e,"synoRenderCache"),this.needRenderMap=new Map}enablePlugin(){super.enablePlugin(),this.addHook("init",(()=>this.onInit())),this.addHook("afterChangeResolve",(e=>this.onAfterChangeResolve(e))),this.addHook("afterAddInternalLink",(e=>this.clearCellCache(e.row,e.col))),this.addHook("afterRemoveInternalLink",(e=>this.clearCellCache(e.row,e.col))),this.addHook("afterCreateRow",((e,t)=>this.adjustNeedRenderMapByAlterGrid("row",e,t))),this.addHook("afterRemoveRow",((e,t)=>this.adjustNeedRenderMapByAlterGrid("row",e,-t))),this.addHook("afterCreateCol",((e,t)=>this.adjustNeedRenderMapByAlterGrid("col",e,t))),this.addHook("afterRemoveCol",((e,t)=>this.adjustNeedRenderMapByAlterGrid("col",e,-t))),this.addHook("beforeMoveRow",(e=>this.adjustNeedRenderMapByMove("row",e))),this.addHook("beforeMoveCol",(e=>this.adjustNeedRenderMapByMove("col",e)))}onInit(){const e=this.sheet.getDataModel(),t=e.getRowLength();for(let r=0;r=t&&(o[e]+=r,o[e]=t.sec[0].start&&r[e]<=t.sec[1].end&&(r[e]<=t.sec[0].end?r[e]+=t.sec[1].amount:r[e]-=t.sec[0].amount)}*calcNeedRenderCell(){for(const[,{row:e,col:t}]of(0,i.getFirst)(this.needRenderMap,40))this.getCellTextDesc(e,t),yield}getNeedRenderSize(){return this.needRenderMap.size}getCellText(e,t){return this.getCellTextDesc(e,t).v}getCellDescState(e,t){const r=this.sheet.getCellModel(e,t);if(!r||(0,o.isEmptyValue)(r.getValue())){const r=this.sheet.formula.getSpillItem(e,t);return!r||r.needCheckSpill||r.spillError?l:(0,a.renderData)(this.sheet,e,t)}return r.getProperties()._text||l}getCellTextDesc(e,t){const r=this.sheet.getCellModel(e,t),n=!!r&&this.needRenderMap.delete(r);return!r||(0,o.isEmptyValue)(r.getValue())?this.sheet.formula.getSpillItem(e,t)?(0,a.renderData)(this.sheet,e,t):l:n?this._updateCellText(r,e,t):r.getProperties()._text??l}isCellBlank(e){return(0,o.isEmptyValue)(e.getValue())}_updateCellText(e,t,r){if(this.isCellBlank(e))return l;const n=(0,a.renderData)(this.sheet,t,r);return this.sheet.setCellMeta(t,r,[[s,n]]),n}renderData(e,t,r){const n=this.getCellTextDesc(e,t);return this.sheet.getPlugin("synoConditionalFormat").afterDataRenderer(e,t,r,r.getProperties()),this.sheet.getPlugin("synoValidation").afterDataRenderer(e,t,r,r.getProperties()),n}}const c=u},42370:(e,t,r)=>{"use strict";r.d(t,{default:()=>g});var n=r(16395),i=r(56023),o=r(84499),a=r(87984),s=r(55180),l=r(31641);const u=new WeakMap;class c extends n.default{constructor(e){super(e,"synoSearch"),this.lastQuery=null,this.lastResult=null}enablePlugin(){const e=()=>this._requery();this.addHook("afterChangeResolve",e),this.addHook("afterCreateRow",e),this.addHook("afterRemoveRow",e),this.addHook("afterCreateCol",e),this.addHook("afterRemoveCol",e),this.addHook("afterSort",e),this.addHook("beforeMoveRow",e),this.addHook("beforeMoveCol",e),super.enablePlugin()}notifyRender(){this.sheet.getWorkbook().notifyDataChange(i.FLUSH_TYPE.SEARCH)}notifySearchChange(e,t){this.sheet.getWorkbook().getNotifier()?.onSearchResultChange(e,t)}isSearching(){return!0===u.get(this.sheet.getWorkbook())}setSearching(e){u.set(this.sheet.getWorkbook(),!!e),this.notifySearchChange("setSearching",e)}async _requery(){if(this.lastQuery){if(this.isSearching()){const e={...this.lastQuery},t=this.lastResult&&this.lastResult.getCurrResult();this.clear(),await Promise.resolve();const r=await this._query(e);t&&r&&r.setIndexByCoord(t)}else this.clear();this.sheet.isActive()&&this.notifyRender()}}getSearchingResult(){return this.isSearching()&&this.lastResult?this.lastResult.getAllResult():[]}moveSearchResult(e){if(this.lastResult)return"prev"===e?this.lastResult.getPrevResult():"next"===e?this.lastResult.getNextResult():(this.lastResult.setIndexByCoord(e),this.lastResult.getCurrResult())}getLastResult(){return this.lastResult?.getLastResult()}getFirstResult(){return this.lastResult?.getFirstResult()}getSearchCount(){return{index:this.lastResult?.getIndex()??0,total:this.lastResult?.getResultCount()??0}}clear(){this.lastQuery=null,this.lastResult=null,this.notifySearchChange("updateSearchResult",{sheetId:this.sheet.sheetId,results:[]})}_search(e){return this.lastResult&&this.queryEqual(e,this.lastQuery)?Promise.resolve(this.lastResult):this._query(e)}getReplaceChanges(e){const t=[];if(!this.queryEqual(e,this.lastQuery))return t;const r=this.lastResult.getCurrResult(),n=h(e);return r&&n&&this.canReplace(r,e)&&t.push([r.row,r.col,r.cellText.replace(n,e.newValue)]),t}searchAll(e){return this._search(e)}getReplaceAllChanges(e){return this.searchAll(e).then((t=>{const r=[],n=h(e);return t&&n&&t.forAllResult((t=>{this.canReplace(t,e)&&r.push([t.row,t.col,t.cellText.replace(n,e.newValue)])})),[this.sheet.sheetId,r]}))}queryEqual(e,t){if(!e||!t)return e===t;let r=e.range===t.range;return e.range&&t.range&&(r=e.range.isEqual(t.range)),r&&e.queryStr===t.queryStr&&e.caseMatch===t.caseMatch&&e.contentMatch===t.contentMatch&&e.regex===t.regex&&e.withinFormulas===t.withinFormulas}_query(e){this.lastQuery=e,this.lastResult=new d,this.notifySearchChange("updateSearchResult",{sheetId:this.sheet.sheetId,results:[],coords:{row:0,col:0}});const t=!(0,o.isEmptyValue)(e.queryStr)&&h(e);if(!t)return Promise.resolve(this.lastResult);const r=e.range?e.range.from.row:0,n=e.range?e.range.to.row:this.sheet.countRows()-1,i=r,a=Math.min(n,r+100-1);return new Promise((r=>{const o=(i,a)=>{this.lastQuery===e?(this._queryPartial(t,e,i,a),a{o(a+1,Math.min(a+100,n))}),10):r(this.lastResult)):r(null)};o(i,a)}))}_queryPartial(e,t,r,n){const i=t.range?t.range.from.col:0,o=t.range?t.range.to.col:this.sheet.countCols()-1;let a=!1;for(let s=r;s<=n;s++)for(let r=i;r<=o;r++){const n=this.sheet.getCellModel(s,r),i=t.withinFormulas&&n&&(0,l.isFormula)(n.getValue(),n.getCellStyle())?n.getValue():this.sheet.renderCache.getCellText(s,r);this._match(e,i,t)&&(this.lastResult.add(s,r,i),a=!0)}a&&this.notifySearchChange("updateSearchResult",{sheetId:this.sheet.sheetId,results:this.lastResult?.getAllResult()??[]})}_match(e,t,r){let{contentMatch:n}=r;if((0,o.isEmptyValue)(t))return!1;const i=t.match(e);return!(!i||n&&i[0].length!==t.length)}canReplace(e,t){let{row:r,col:n}=e,{withinFormulas:i}=t;if(i)return!0;const o=this.sheet.getCellModel(r,n);return!(o&&(0,l.isFormula)(o.getValue(),o.getCellStyle()))}}function h(e){let{queryStr:t,caseMatch:r,regex:n}=e;try{return new RegExp(n?t:(0,a.escapeRegExp)(t),r?"g":"gi")}catch(e){return null}}class d{constructor(){this.results=[],this.index=-1}add(e,t,r){const n=this.findClosestIndex(e,t),i=this.results[n];i&&i.row===e&&i.col===t?this.results[n].cellText=r:(this.results.splice(n,0,{row:e,col:t,cellText:r}),this.index>=n&&(this.index+=1))}remove(e,t){const r=this.findIndex(e,t);r<0||(this.results.splice(r,1),this.index>=r&&(this.index-=1))}getFirstResult(){return this.setIndex(0),this.results[this.index]}getNextResult(){if(this.index!==this.results.length-1)return this.index+=1,this.results[this.index]}getCurrResult(){return this.results[this.index]}getPrevResult(){if(0!==this.index)return this.index-=1,this.results[this.index]}getLastResult(){return this.index=this.results.length-1,this.results[this.index]}getAllResult(){return this.results.slice()}findIndex(e,t){const r=this.findClosestIndex(e,t);return this.results[r]&&this.results[r].row===e&&this.results[r].col===t?r:-1}findClosestIndex(e,t){if(0===this.results.length)return-1;let r,n,i=0,o=this.results.length-1;const a={row:e,col:t};for(;i<=o;)if(r=Math.floor((i+o)/2),n=this.results[r],f(n,a)<0)i=r+1;else{if(0===r||f(this.results[r-1],a)<0)return r;o=r-1}return 0===i?-1:this.results.length}setIndexByCoord(e){const t=e?this.findClosestIndex(e.row,e.col):0;this.setIndex(t)}setIndex(e){this.index=Math.min(Math.max(e,0),this.results.length-1)}forAllResult(e){(0,s.arrayEach)(this.results,e)}getIndex(){return this.index}getResultCount(){return this.results.length}indexOf(e){return this.results.indexOf(e)}sort(){this.results.sort(f)}isEmpty(){return 0===this.results.length}}function f(e,t){return e.row!==t.row?e.row-t.row:e.col-t.col}const g=c},33941:(e,t,r)=>{"use strict";r.d(t,{default:()=>c});var n=r(36378),i=r(16395),o=r(31641),a=r(13574),s=r(37873),l=r(85978);class u extends i.default{constructor(e){super(e,"synoSort")}applyRowOrder(e,t,r){const n=this.sheet,i=n.getRangeBound(t.from,t.to),[o,a,l,u]=i,c={},h=0===a&&u===n.countCols()-1?this.reorderSheet(e,o,l,c,r):this.reorderRange(e,i,c,r);n.formula.onDataSorted(i,e,h),n.runHooks("afterSort",e,s.SynoCellRange.fromArray(i),c,r)}changeCellModelFormula(e,t){if(!e)return!1;const r=e.getValue();if(!(0,o.isFormula)(r,e.getCellStyle()))return!1;const n=l.utils.changeFormulaKeepSheet(r,{row:t});return n!==r&&(e.setValue(n),!0)}applyOrCollectData(e,t,r,i,o,s){if(!e)return;const l=e.getValue();s&&(0,a.objectHasOwnProperty)(s,t)&&(0,a.objectHasOwnProperty)(s[t],r)?e.setValue(s[t][r]):(0,n.default)(l)&&this.changeCellModelFormula(e,i-t)&&((0,a.objectHasOwnProperty)(o,i)||(o[i]={}),o[i][r]=l)}reorderRange(e,t,r,n){const i=this.sheet,[o,a,s,l]=t,u=[],c=i.getWorkbook().getStyleManager();for(let t=o;t<=s;t++){const s=t-o;if(s===e[s])continue;const h=[];for(let o=a;o<=l;o++){const l=i.getCellModel(t,o);if(!l)continue;const u=o-a,d=c.createRefCell(l.getValue(),l.getXfId());l.getNote()&&d.setNote(l.getNote()),this.applyOrCollectData(d,s,u,e[s],r,n),h[u]=d}u[e[s]]=h}const h=[],d=i.getDataModel();for(let e=o;e<=s;e++){const t=u[e-o];if(!t)continue;let r=d.getRow(e);if(0!==t.length||r&&0!==r.getColLength()){r||(r=d.createRowModel(e));for(let n=a;n<=l;n++){const i=t[n-a];(i||r.getCell(n))&&(r.addCell(n,i),h.push({row:e,col:n}))}}}return h}reorderSheet(e,t,r,n,i){const o=this.sheet.getDataModel(),a=this.sheet.countCols(),s=[],l=[];for(let u=t;u<=r;u++){const r=u-t,c=e[r]+t;if(u===c){s.push(null);continue}const h=o.getRow(u);for(let t=0;t{"use strict";r.d(t,{default:()=>s});var n=r(85978),i=r(33941),o=r(84499);class a extends i.default{getRowOrder(e,t,r){e=e.clone();const n=this._calcRowOrder(t,e.from.row,e.to.row,r);for(let e=n.length-1;e>=0&&n[e]===e;e--)n.pop();return 0===n.length||e.getHeight()>n.length&&(e.to.row=e.from.row+n.length-1),{rowOrder:n,range:e}}sort(e,t,r){const{range:n,rowOrder:i}=this.getRowOrder(e,t,r);this.applyRowOrder(i,n)}_calcRowOrder(e,t,r,i){const a=[],s=[];for(let n=t;n<=r;n++){if(this.sheet.isHiddenRow(n)){a.push(n-t);continue}const r=[];for(let t=0;ts[e][t]),s.length,e.length,this.sheet.getWorkbook().getLocale().getCollator(),i);for(const e of a){for(let t=0;t=e&&(l[t]+=1);l.splice(e,0,e)}return l}}const s=a},86401:(e,t,r)=>{"use strict";r.d(t,{ValidationPluginAdapter:()=>n});class n{constructor(e){this.sheet=e}getValidationView(e,t,r){return this.sheet.getWorkbook().getStoreGetter("worksheet/validation/getValidationView")(e,t,r)}isDropdownValidation(e){return this.sheet.getWorkbook().getStoreGetter("worksheet/validation/isDropdownValidation")(e)}}},92967:(e,t,r)=>{"use strict";r.d(t,{default:()=>d});var n=r(81674),i=r(64145),o=r(84499),a=r(31641),s=r(55180),l=r(58835),u=r(95778),c=r(96687);class h extends n.default{enablePlugin(){this.addHook("beforeChangeForValid",((e,t)=>this.beforeChangeForValid(e,t))),this.addHook("afterChangeResolve",(e=>this.afterChangeResolve(e))),this.addHook("collectRemovedColInfo",((e,t,r)=>this.collectRemovedColInfo(e,t,r))),this.addHook("collectRemovedRowInfo",((e,t,r)=>this.collectRemovedRowInfo(e,t,r))),this.addHook("afterSort",((e,t)=>this.afterSort(e,t))),super.enablePlugin()}beforeChangeForValid(e,t){if(!e||t===c.SourceType.Remote)return;let r=!1;for(let t=e.length-1;t>=0;t--){const n=e[t];if(!n)continue;const i=n[0],s=n[1],u=this.sheet.getCellMeta(i,s),c=u?.validId?this.validationMap[u.validId]:null;if(c&&c.isReject()){if(!(0,o.isValueChanged)(n)){!u.needValid&&u.synoInvalid&&(r=!0);continue}let h=n[3];if((0,l.isRichTextValue)(h)&&(h=h.getText()),(0,a.isFormula)(h)&&!n[5]){const{result:e,error:t}=this.sheet.getWorkbook().getFormulaParser().exec(h.substr(1),{sheetId:this.sheet.sheetId});h=t||e}c.preValidate(i,s,h)?this.sheet.setCellMeta(i,s,[["synoInvalid",!1],["needValid",!1]]):(e[t]=null,r=!0)}}r&&this.sheet.getWorkbook().getNotifier()?.onAlert(i.default.INVALID_CHANGE)}afterChangeResolve(e){for(let t=0;t!1);const r=[];let n=[];for(let i=e.from.row;i<=e.to.row;i++){if(t(i))continue;const o=new Array(e.getWidth());for(let t=e.from.col;t<=e.to.col;t++){const r=this.sheet.getCellMeta(i,t);r&&r.validId&&(o[t-e.from.col]=r.validId,n.push(r.validId))}r.push(o)}return n=(0,s.arrayUnique)(n).map((e=>this.validationMap[e].cloneRelative())),{validIds:r,validations:n}}collectRangeValidation(e,t){let r=[];for(let n=0;nthis.validationMap[e].cloneRelative())),r}removeBeforeCreate(e){e.forAll(((t,r)=>{const n=this.sheet.getCellMeta(t,r),i=n?n.validId:null,o=i?this.validationMap[i]:null;o&&o.removeValidRange(e)}))}getValidationView(e,t,r){const n=this.getValidation(e);if(n)return Object.assign(n.cloneRelative(),{displayF1:n.getDisplayF1(t,r),displayF2:n.getDisplayF2(t,r)})}isDropdownValidation(e){const t=this.validationMap[e];return!!t&&t.hasDropdown()}getCellInvalid(e,t){const r=this.sheet.getCellModel(e,t),n=r?.getProperties();return this.afterDataRenderer(e,t,r,n),n?.synoInvalid??!1}afterDataRenderer(e,t,r,n){if(!n||!n.validId)return!1;const i=this.validationMap[n.validId];return!!i&&(n.needValid&&this.sheet.setCellMeta(e,t,[["synoInvalid",!i.validate(e,t)],["needValid",!1]]),!0)}afterSort(e,t){for(const r in this.validationMap)this.validationMap[r]&&this.validationMap[r].afterSort(e,t)}getStateJSON(){return{validations:Object.fromEntries(Object.entries(this.validationMap).map((e=>{let[t,r]=e;return[t,Object.assign(r.cloneRelative(),r.getDisplayView())]})))}}}const d=h},44393:(e,t,r)=>{"use strict";function n(e,t,r){return e.reduce(((e,t)=>(e.row=Math.min(t.from.row,e.row),e.col=Math.min(t.from.col,e.col),e)),{row:t,col:r})}r.d(t,{calcRefCellFromArray:()=>n})},51263:(e,t,r)=>{"use strict";r.d(t,{ValidationType:()=>l,default:()=>s});var n=r(31641),i=r(55180),o=r(4263),a=r(42443);class s{constructor(e,t,r){this.validId=e.validId||(0,n.randomString)(),this.type=e.type,this.operator=e.operator,this.f1=e.f1,this.f2=e.f2,this.text=e.text,this.showHelp=e.showHelp||""!==e.message,this.message=e.message,this.reject=e.reject,this.sheet=r,this.ranges=t||[],this._nextRanges=null}init(){}destroy(){this.ranges=[],this._nextRanges=null}cloneConfigBasic(){return{validId:this.validId,type:this.type,operator:this.operator,text:this.text,f1:this.f1,f2:this.f2,showHelp:this.showHelp,message:this.message,reject:this.reject}}cloneConfig(){return this.cloneConfigBasic()}cloneRelative(){return this.cloneConfigBasic()}isActive(){return this.ranges.length>0}isEqual(e){return this.constructor===e.constructor&&this.type===e.type&&this.showHelp===e.showHelp&&(!this.showHelp||this.message===e.message)&&this.reject===e.reject&&this.operator===e.operator}isReject(){return this.reject}isShowHelp(){return this.showHelp}hasDropdown(){return!1}updateRanges(e){this.ranges=e}_createOnRange(e,t,r,n,i,o){if(o=o||(()=>{}),-1!==n&&i.from[e]<=n&&i.to[e]>=n||-1===n&&i.from[e]=t){i.to[e]+=r;const n=i.clone();n.from[e]=t,n.to[e]=t+r-1,o.call(this,n)}else i.from[e]>=t&&(i.from[e]+=r,i.to[e]+=r)}onCreateRowCol(e,t,r,n){this.isActive()&&(0,i.arrayEach)(this.ranges,(i=>{this._createOnRange(e,t,r,n,i,this.addToMeta)}))}_removeOnRange(e,t,r,n,i){if(i=i||(()=>{}),t+r-1{let i=!0;return this._removeOnRange(e,t,r,n,(e=>{i=!e})),i})))}collectRemovedInfo(e,t,r){}repair(e){(0,i.arrayEach)(e,(e=>{this.addValidRange(e)}))}repairCross(e){}_moveRange(e,t,r){const n=this.ranges.length,i=[],o=[];let a=!1;for(let s=0;s0&&i[i.length-1].isMergeable(e,u);){const t=i.pop();u.expandRowCol(e,t.from.row,t.to.row)}i.push(u)}else o.push(u)}return{nextRanges:i,newRanges:o,rangesChanged:a}}_move(e,t){const{nextRanges:r,rangesChanged:n}=this._moveRange(e,t,!0);return n&&(this._nextRanges=r),{changed:n}}beforeMove(e,t,r,n){if(this.isActive())if(r)this.setNeedValidAll(),this._nextRanges=r.ranges.map((e=>o.default.textToRange(e,this.sheet))).filter((e=>!!e));else{const r={ranges:(0,o.multiRangesToText)(this.ranges)},{changed:i}=this._move(e,t);i&&(n[this.validId]=r)}}afterMove(e){this._nextRanges&&this.updateRanges(this._nextRanges),this._nextRanges=null,this.handleMetaAfterMove(e)}handleMetaAfterMove(e){}afterSort(e,t){}addValidRange(e){this.updateRanges((0,a.addPartialRange)(this.ranges,e)),this.addToMeta(e)}removeValidRange(e){const{newRanges:t,removeRanges:r}=(0,a.removePartialRange)(this.ranges,e);for(const e of r)this.removeMeta(e);this.updateRanges(t)}forAllCell(e){for(let t=0;t{"use strict";r.d(t,{default:()=>o});var n=r(51263),i=r(3832);class o extends n.default{isEqual(e){return super.isEqual(e)&&this.conditionEqual(e)}getDisplayF1(e,t){return this._getDisplayValue(this.f1,e,t)}getDisplayF2(e,t){return this._getDisplayValue(this.f2,e,t)}_getDisplayValue(e,t,r){return(0,i.parseValueInvert)(this.sheet.getWorkbook().getLocale(),e,{date:this.type===n.ValidationType.DATE})||""}}},32329:(e,t,r)=>{"use strict";r.d(t,{default:()=>i});var n=r(4062);class i extends n.default{conditionEqual(e){return this.f1===e.f1&&this.f2===e.f2}}},74748:(e,t,r)=>{"use strict";r.d(t,{default:()=>h});var n=r(51263),i=r(73481),o=r(44395),a=r(70797),s=r(96158),l=r(32329),u=r(31641);function c(e,t){return t.length>0||!!e.refCell}function h(e,t,r){if(e.type===n.ValidationType.LIST){const n="listRange";return e.operator===n?c(e,t)?new i.default(e,t,r):null:new o.default(e,t,r)}return e.type!==n.ValidationType.TEXT||(0,u.isFormula)(e.text)?e.type===n.ValidationType.TEXT||e.type===n.ValidationType.CUSTOM||(0,u.isFormulaCondition)(e.f1)||(0,u.isFormulaCondition)(e.f2)?c(e,t)?new s.default(e,t,r):null:new l.default(e,t,r):new a.default(e,t,r)}},96158:(e,t,r)=>{"use strict";r.d(t,{default:()=>y});var n=r(4062),i=r(74748),o=r(44393),a=r(74102),s=r(55060),l=r(31641),u=r(84499),c=r(30471),h=r(85978),d=r(3288),f=r(7996),g=r(59162),p=r(4263),m=r(27601),v=r(51263);class y extends n.default{constructor(e,t,r){super(e,t,r),this.refCell=this.isActive()?this.calcRefCell():e.refCell,this.formula=null,this.matrix=null,this.rangeBound={row:0,col:0},this.relativeCondition={},this.unitItem=new s.UnitItem(this),this.operator||(0,m.default)(this.f1)||(0,m.default)(this.f2)||(this.operator="between"),this.initRelativeCondition()}init(){super.init(),this.fillFormula(),this.calcRangeBound(),this.matrix=this._createMatrix()}_createMatrix(){return new a.CondMatrix}destroy(){this.unitItem.unregister(),this.matrix.clear(),super.destroy()}cloneConfig(){const e=Object.assign(super.cloneConfig(),{refCell:this.refCell}),{row:t,col:r}=this.refCell,{f1:n,f2:i,text:o}=this.relativeCondition;return n&&(e.f1=(0,g.fromR1C1ToA1)(n,t,r)),i&&(e.f2=(0,g.fromR1C1ToA1)(i,t,r)),o&&(e.text=`=${(0,g.fromR1C1ToA1)(o,t,r)}`),e}conditionEqual(e){return this.relativeCondition.f1===e.relativeCondition.f1&&this.relativeCondition.f2===e.relativeCondition.f2&&this.relativeCondition.text===e.relativeCondition.text}isAbsRefOnly(){return(0,l.isFormulaCondition)(this.f1)&&(0,g.isFormulaAbsolute)(this.f1)&&(!this.f2||(0,l.isFormulaCondition)(this.f2)&&(0,g.isFormulaAbsolute)(this.f2))}updateRanges(e){super.updateRanges(e),this.updateRefCell(),this.updateByRelativeFormula(this.relativeCondition)}initRelativeCondition(){const{row:e,col:t}=this.refCell;this.relativeCondition={},(0,l.isFormulaCondition)(this.f1)&&(this.relativeCondition.f1=(0,g.fromA1ToR1C1)(this.f1,e,t)),(0,l.isFormulaCondition)(this.f2)&&(this.relativeCondition.f2=(0,g.fromA1ToR1C1)(this.f2,e,t)),(0,l.isFormula)(this.text)&&(this.relativeCondition.text=(0,g.fromA1ToR1C1)(this.text.slice(1),e,t))}updateByRelativeFormula(e){let{f1:t,f2:r,text:n}=e;if(!t&&!r&&!n)return;const i=this.relativeCondition;t&&(i.f1=t),r&&(i.f2=r),n&&(i.text=n),this.fillFormula(),this.onFormulaChange(),this.calcRangeBound()}fillFormula(){const e=this.formula,t=(0,f.coordToLabel)(this.refCell),{row:r,col:n}=this.refCell;if(this.type===v.ValidationType.CUSTOM)this.formula=(0,g.fromR1C1ToA1)(this.relativeCondition.f1,r,n);else if(this.type===v.ValidationType.TEXT)this.formula=(0,c.textConditionFormula)(this.operator,t,(0,g.fromR1C1ToA1)(this.relativeCondition.text,this.refCell.row,this.refCell.col));else{const e=this.relativeCondition.f1?(0,g.fromR1C1ToA1)(this.relativeCondition.f1,r,n):this.f1,i=this.relativeCondition.f2?(0,g.fromR1C1ToA1)(this.relativeCondition.f2,r,n):this.f2;this.formula=(0,c.numberConditionFormula)(this.operator,t,e,i)}e!==this.formula&&this.registerUnitItem()}registerUnitItem(){this.unitItem.unregister();const e=(0,g.parseFormulaRange)(this.formula),t=this.sheet.formula.checkCrossRefError(e);if(t)this.sheet.getWorkbook().getUnitUnknownRefManager().addItem(t,this.unitItem),this.formula="#REF!";else{const t=this.sheet.formula.mapFormulaRange(e);this.unitItem.register(t)}}onCreateRowCol(e,t,r,n){if(!this.isActive())return;super.onCreateRowCol(e,t,r,n);const i={...this.refCell};nthis.setNeedValid(e.row,e.col)))}onRemoveRowCol(e,t,r){super.onRemoveRowCol(e,t,r),this.isActive()&&(this.updateRefCell(),this.matrix.onAlterGrid(e,t,-r,(e=>this.setNeedValid(e.row,e.col))))}_genAdditionValid(e,t,r){const n=(0,o.calcRefCellFromArray)(r,this.sheet.countRows(),this.sheet.countCols()),i=this.cloneConfig();n[e]-=t.delta;const{row:a,col:s}=n;return this.relativeCondition.f1&&(i.f1=h.utils.moveFormula(e,(0,g.fromR1C1ToA1)(this.relativeCondition.f1,a,s),t)),this.relativeCondition.f2&&(i.f2=h.utils.moveFormula(e,(0,g.fromR1C1ToA1)(this.relativeCondition.f2,a,s),t)),this.relativeCondition.text&&(i.text=`=${h.utils.moveFormula(e,(0,g.fromR1C1ToA1)(this.relativeCondition.text,a,s),t)}`),[i,r]}_move(e,t){const{newRanges:r,nextRanges:n,rangesChanged:i}=this._moveRange(e,t,this.isAbsRefOnly()),o={changed:i,addition:null};return this.setNeedValidAll(),n.length>0&&r.length>0&&(o.addition=this._genAdditionValid(e,t,r)),i&&(this.ranges=n.length>0?n:r,this.updateRefCell(),this.matrix.clear()),o}beforeMove(e,t,r,n){if(!this.isActive())return;if(r)return super.beforeMove(e,t,r,n),this.updateRefCell(),void this.matrix.clear();const o={ranges:(0,p.multiRangesToText)(this.ranges)},{addition:a,changed:s}=this._move(e,t);return s&&(n[this.validId]=o),a?(0,i.default)(a[0],a[1],this.sheet):void 0}addValidRange(e){const t=[];if(this.rangeBound.row>e.to.row||this.rangeBound.col>e.to.col)return t.push(e.clone()),t;let r;return this.rangeBound.row>e.from.row&&(t.push((0,u.createRange)(e.from.row,e.from.col,this.rangeBound.row-1,e.to.col)),e.from.row=this.rangeBound.row),this.rangeBound.col>e.from.col&&(t.push((0,u.createRange)(e.from.row,e.from.col,e.to.row,this.rangeBound.col-1)),e.from.col=this.rangeBound.col),r=this.isActive()?{row:Math.min(e.from.row,this.refCell.row),col:Math.min(e.from.col,this.refCell.col)}:{row:e.from.row,col:e.from.col},super.addValidRange(e),this.updateRefCell(r),t}removeValidRange(e){super.removeValidRange(e),this.isActive()&&this.updateRefCell()}calcRangeBound(){this.rangeBound=(0,g.calcR1C1Bound)(this.relativeCondition.f1,this.relativeCondition.f2)}calcRefCell(){return this.isActive()?(0,o.calcRefCellFromArray)(this.ranges,this.sheet.countRows(),this.sheet.countCols()):this.refCell}updateRefCell(e){e=e||this.calcRefCell(),this.refCell.row===e.row&&this.refCell.col===e.col||(this.refCell=e,this.fillFormula(),this.onFormulaChange(),this.calcRangeBound())}getDisplayView(){return{displayF1:this.type===v.ValidationType.TEXT?`=${this.relativeCondition.text}`:`=${this.relativeCondition.f1}`,displayF2:this.relativeCondition.f2?`=${this.relativeCondition.f2}`:super.getDisplayF2(0,0)}}getDisplayF1(e,t){const r=this.type===v.ValidationType.TEXT?this.relativeCondition.text:this.relativeCondition.f1;return r?`=${(0,g.fromR1C1ToA1)(r,e,t)}`:super.getDisplayF1(e,t)}getDisplayF2(e,t){return this.relativeCondition.f2?`=${(0,g.fromR1C1ToA1)(this.relativeCondition.f2,e,t)}`:super.getDisplayF2(e,t)}onFormulaChange(){this.matrix.clear(),this.setNeedValidAll(),this.sheet.notifyPluginChanges(["validation"])}onDepUpdate(e,t){this.setNeedValid(e,t)}notifyAlterGrid(e,t,r,n,i,a){if(!this.isActive())return;let s={...this.refCell};if(t===this.sheet&&n<0){const t=this.ranges.map((t=>t.clone().diff(e,r,-n))).filter((e=>!!e));if(0===t.length)return;s=(0,o.calcRefCellFromArray)(t,this.sheet.countRows(),this.sheet.countCols()),r<=s[e]&&(s[e]-=n)}const l={...s};t===this.sheet&&r<=l[e]&&(l[e]+=n);const c={[e]:r},d=this.sheet.getName(),f=this.changeFormulaBy((e=>h.utils.changeFormula(e,{delta:n,start:c},t.getName(),d)),s,l);(f.f1||f.f2)&&(0,u.addCrossRepairData)(a,this.sheet.sheetId,"synoValidation",f)}repairCross(e){this.updateByRelativeFormula(e)}notifyMove(e,t,r,n){if(!this.isActive())return;let i={...this.refCell};t===this.sheet&&this._nextRanges&&(i=(0,o.calcRefCellFromArray)(this._nextRanges,this.sheet.countRows(),this.sheet.countCols()));const a={...i};t===this.sheet&&a[e]>=r.sec[0].start&&a[e]<=r.sec[1].end&&(a[e]h.utils.moveFormula(e,n,r,t.getName(),s)),a,i);(l.f1||l.f2)&&(0,u.addCrossRepairData)(n,this.sheet.sheetId,"synoValidation",l)}notifyRename(e,t,r){const n=this.refCell,i=this.changeFormulaBy((r=>(0,d.changeSheetName)(r,e,t)),n,n);(i.f1||i.f2)&&(0,u.addCrossRepairData)(r,this.sheet.sheetId,"synoValidation",i)}notifyMoveFormulaRange(e,t,r){if(!this.isActive()||t.includes(this.refCell.row,this.refCell.col))return;const n=this.refCell,i=this.changeFormulaBy((r=>h.utils.changeFormulaRange(r,e,t,this.sheet.getName())),n,n);(i.f1||i.f2)&&(0,u.addCrossRepairData)(r,this.sheet.sheetId,"synoValidation",i)}notifyRecalcUnknown(){this.isActive()&&(this.fillFormula(),this.onFormulaChange(),this.calcRangeBound())}notifyDeleteSheet(){this.isActive()&&(this.registerUnitItem(),this.onFormulaChange())}getSheet(){return this.sheet}changeFormulaBy(e,t,r){const n={validId:this.validId},i={},{f1:o,f2:a,text:s}=this.relativeCondition;function l(n){return n=(0,g.fromR1C1ToA1)(n,t.row,t.col),n=e(n),(0,g.fromA1ToR1C1)(n,r.row,r.col)}if(o){const e=l(o);e!==o&&(n.f1=o,i.f1=e)}if(a){const e=l(a);e!==a&&(n.f2=a,i.f2=e)}if(s){const e=l(s);e!==s&&(n.text=s,i.text=e)}return this.updateByRelativeFormula(i),n}}},44395:(e,t,r)=>{"use strict";r.d(t,{default:()=>i});var n=r(51263);class i extends n.default{constructor(e,t,r){super(e,t,r),this.refData=null,this.refText=null}destroy(){this.refData=null,this.refText=null,super.destroy()}isEqual(e){return super.isEqual(e)&&this.f1===e.f1}hasDropdown(){return!0}}},73481:(e,t,r)=>{"use strict";r.d(t,{default:()=>s});var n=r(96158),i=r(74102),o=r(59162);class a extends n.default{hasDropdown(){return!0}_createMatrix(){return new i.CondRangeMatrix}fillFormula(){const{row:e,col:t}=this.refCell;this.formula=(0,o.fromR1C1ToA1)(this.relativeCondition.f1,e,t),this.unitItem.unregister();const r=(0,o.parseFormulaRange)(this.formula);if(this.sheet.formula.checkCrossRefError(r))this.formula="#REF!";else{const e=this.sheet.formula.mapFormulaRange(r);this.unitItem.register(e)}}getDisplayView(){return{displayF1:this.relativeCondition.f1,displayF2:""}}getDisplayF1(e,t){return(0,o.fromR1C1ToA1)(this.relativeCondition.f1,e,t)}}const s=a},95778:(e,t,r)=>{"use strict";r.d(t,{setNeedValid:()=>x});var n=r(50137),i=r(51263),o=r(44395),a=r(32329),s=r(70797),l=r(96158),u=r(73481),c=r(55180),h=r(84499),d=r(30471),f=r(3832),g=r(59162),p=r(4263),m=r(58835),v=r(290);const y=i.default.prototype.destroy;function C(e,t){return Object.assign(e,t),t}function x(e){e&&e.validId&&(e.needValid=!0)}C(i.default.prototype,{init(){(0,c.arrayEach)(this.ranges,(e=>{this.addToMeta(e)}))},destroy(){this.setNeedValidAll(),y.call(this)},collectRemovedInfo(e,t,r){let n;return n="row"===e?(0,h.createRange)(t,0,t+r-1,this.sheet.countCols()-1):(0,h.createRange)(0,t,this.sheet.countRows()-1,t+r-1),this._collectRemovedInfo(e,t,r,n)},_collectRemovedInfo(e,t,r,n){const i=this._collectOverlap(n).map((e=>p.default.toLabel(e)));if(i.length>0)return{validId:this.validId,ranges:i}},_collectOverlap(e){const t=[];return(0,c.arrayEach)(this.ranges,(r=>{const n=r.getOverlap(e);n&&t.push(n)})),t},setNeedValid(e,t){x(this.sheet.getCellMeta(e,t))},setNeedValidAll(){this.forAllCell(((e,t)=>{this.setNeedValid(e,t)}))},addToMeta(e){const t=[["validId",this.validId],["needValid",!0]];e.forAll(((e,r)=>{this.sheet.setCellMeta(e,r,t)}))},removeMeta(e){e.forAll(((e,t)=>{const r=this.sheet.getCellMeta(e,t);r&&r.validId&&this.sheet.setCellMeta(e,t,[["validId",null],["needValid",!1],["synoInvalid",!1]])}))},handleMetaAfterMove(e){if(e)for(let e=0;e!0,preValidate(e,t,r){return(0,h.isEmptyValue)(r)||this._validate(e,t,r)}}),C(o.default.prototype,{init:function(){i.default.prototype.init.call(this),this.collectRefData()},_validate(e,t,r){return this.refData.has(r)},collectRefData(){this.refData=new Set;const e=[],t=this.f1.split(","),r=this.sheet.getWorkbook().getLocale(),i=r.getSSF(),o=r.getData();for(let a=0,s=t.length;a({text:e})))}}),C(a.default.prototype,{_getConditionTempalte(){const e=(0,v.default)(this.f2)&&this.f1>this.f2;return{isFormula:!1,operator:this.operator||"between",formula1:e?this.f2:this.f1,formula2:e?this.f1:this.f2}},_validate(e,t,r){return(this.type!==i.ValidationType.DECIMAL||"string"!=typeof r)&&(0,d.conditionCheck)(this.sheet,e,t,this._getConditionTempalte(),r)}}),C(s.default.prototype,{_validate(e,t,r){const n={isFormula:!0,formula1:this.formula,delta:{row:e,col:t}};return(0,d.conditionCheck)(this.sheet,e,t,n)},preValidate(e,t,r){if((0,h.isEmptyValue)(r))return!0;r='"'+r+'"';const n={isFormula:!0,formula1:(0,d.textConditionFormula)(this.operator,r,'"'+this.text+'"')};return(0,d.conditionCheck)(this.sheet,e,t,n)},cloneRelative(){const e=Object.getPrototypeOf(s.default).prototype.cloneRelative.call(this);return e.isFormula=!0,e.f1=(0,g.fromA1ToR1C1)(this.formula,0,0),e}}),C(l.default.prototype,{cloneRelative(){const e=Object.getPrototypeOf(l.default).prototype.cloneRelative.call(this);return e.isFormula=!0,this.relativeCondition.f1&&(e.f1=this.relativeCondition.f1),this.relativeCondition.f2&&(e.f2=this.relativeCondition.f2),this.relativeCondition.text&&(e.text=this.relativeCondition.text),e},_getConditionTempalte(){return{isFormula:!0,formula1:this.formula}},_validate(e,t,r){if(this.type===i.ValidationType.DECIMAL&&"string"==typeof r)return!1;const n=this._getConditionTempalte();n.delta={row:e-this.refCell.row,col:t-this.refCell.col},n.item=this.matrix.createItem(this.sheet,e,t,this);const o=(0,d.conditionCheck)(this.sheet,e,t,n,r);return n.item.needUpdate=!1,o},preValidate(e,t,r){if((0,h.isEmptyValue)(r))return!0;if("string"==typeof r){if(this.type===i.ValidationType.DECIMAL)return!1;r='"'+r+'"'}const n={isFormula:!0,formula1:(0,d.numberConditionFormula)(this.operator,r,this.f1,this.f2),delta:{row:e-this.refCell.row,col:t-this.refCell.col}};return(0,d.conditionCheck)(this.sheet,e,t,n,r)},afterSort(e,t){Object.getPrototypeOf(l.default).prototype.afterSort.call(this,e,t),this.ranges.some((e=>e.overlaps(t)))&&this.matrix.sort(t.toArray(),e)}}),C(u.default.prototype,{_validate(e,t,r,n){const i={row:e-this.refCell.row,col:t-this.refCell.col},o=n?null:this.matrix.createItem(this.sheet,e,t,this),a=(0,d.getRelativeFormulaRange)(this.sheet,this.formula,i,o);o&&(o.needUpdate=!1);let s=!1;const l=a&&p.default.createFromRange(a,this.sheet);if(l){const e=this.sheet.getWorkbook().getSheetById(l.sheetInfo?.sheetId);l.eachCell(((t,n)=>{let i=e.formula.getCellValue(t,n);return i instanceof Error&&(i=i.message||""),r!==i||(s=!0,!1)}))}return s},preValidate(e,t,r){return!!(0,h.isEmptyValue)(r)||this._validate(e,t,r,!0)},createListRangeItems(e,t){const r={row:e-this.refCell.row,col:t-this.refCell.col},n=(0,d.getRelativeFormulaRange)(this.sheet,this.formula,r),i=[],o=n&&p.default.createFromRange(n,this.sheet);if(o){const e=this.sheet.getWorkbook().getSheetById(o.sheetInfo?.sheetId),t=new Set;o.eachCell(((r,n)=>{const o=e.formula.getCellValue(r,n);let a;if(o instanceof Error)a=o.message||"";else{const t=(0,f.getCellEditorValue)(e,r,n,o);a=(0,m.isRichTextValue)(t)?t.getText():t}if(!(0,h.isEmptyValue)(a)&&!t.has(a)){t.add(a);const s={text:a};o instanceof Error||(s.value=o,s.formatCode=e.getCellStyle(r,n)?.getNumberFormat().fc),i.push(s)}return!0}))}return i}})},70797:(e,t,r)=>{"use strict";r.d(t,{default:()=>l});var n=r(4062),i=r(44393),o=r(31641),a=r(30471),s=r(7996);class l extends n.default{constructor(e,t,r){super(e,t,r),this.formula=(0,a.textConditionFormula)(this.operator,"A1",'"'+this.text+'"')}conditionEqual(e){return this.text===e.text}getDisplayF1(){return(0,o.isFormula)(this.text)?this.text.substr(1):this.text}getDisplayF2(){return""}cloneConfig(){const e=super.cloneConfig(),t=(0,i.calcRefCellFromArray)(this.ranges,this.sheet.countRows(),this.sheet.countCols());return e.f1=(0,a.textConditionFormula)(this.operator,(0,s.coordToLabel)(t),`"${this.text}"`),e}}},81674:(e,t,r)=>{"use strict";r.d(t,{default:()=>c});var n=r(16395),i=r(13574),o=r(4263),a=r(55180),s=r(31641),l=r(74748);class u extends n.DelayablePlugin{constructor(e){super(e,"synoValidation"),this.validationMap={},this._additionValids=[]}enablePlugin(){this.addHook("afterInit",(e=>this.afterInit(e))),this.addHook("afterCreateRow",((e,t,r)=>this._afterCreate("row",e,t,r))),this.addHook("afterCreateCol",((e,t,r)=>this._afterCreate("col",e,t,r))),this.addHook("afterRemoveRow",((e,t)=>this._afterRemove("row",e,t))),this.addHook("afterRemoveCol",((e,t)=>this._afterRemove("col",e,t))),this.addHook("beforeMoveRow",((e,t,r)=>this.beforeMove("row",e,t,r))),this.addHook("afterMoveRow",((e,t)=>this.afterMove(t))),this.addHook("beforeMoveCol",((e,t,r)=>this.beforeMove("col",e,t,r))),this.addHook("afterMoveCol",((e,t)=>this.afterMove(t))),this.addHook("repairCross",(e=>this.repairCross(e))),super.enablePlugin()}destroy(){for(const e in this.validationMap)this.validationMap[e]&&this.validationMap[e].destroy();super.destroy()}initData(e){const t=e.synoValidation;if(e.synoValidation=null,!(0,i.isObject)(t))return!1;const r=Object.keys(t);for(let e=0;e0}updateValidationMap(e,t){t?this.validationMap[e]=t:delete this.validationMap[e],this.sheet.notifyPluginChanges(["validation"])}getValidationFromJson(e,t){return(0,l.default)(e,t,this.sheet)}afterInit(e){this.initData(e)}_afterCreate(e,t,r,n){for(const i in this.validationMap)this.validationMap[i]&&this.validationMap[i].onCreateRowCol(e,t,r,n)}_afterRemove(e,t,r){for(const n in this.validationMap)this.validationMap[n]&&this.validationMap[n].onRemoveRowCol(e,t,r)}_checkRangeEmpty(e){let t=!0;return(0,i.objectEach)(this.validationMap,(r=>{const n=r.ranges;if(n)for(let r=0;r{const i=this.validationMap[t.validId],a=t.ranges;if(!i||!a)return;const s=[];for(let t=0;t0&&i.repair(s)}))}repairRow(e,t,r){this._repairFn("row",e,t,r)}repairCol(e,t,r){this._repairFn("col",e,t,r)}repairCross(e){const t=e[this.pluginName];if(t)for(let e=0;ee.validId>t.validId?1:e.validId0&&(this.createErrorValidation(r,n),n[0].includesRange(t)))return;this.sheet.runHooks("afterCreateValidation",r.cloneConfig(),t)}}createValidation(e,t){this.removeBeforeCreate(t);const r=this.getValidationFromJson(e,[t]),n=e.validId||this.checkExistValid(r);if(n&&this.validationMap[n])return this.addValidRange(n,t);r.init(),this.updateValidationMap(r.validId,r),this.sheet.runHooks("afterCreateValidation",r.cloneConfig(),t)}checkExistValid(e){for(const t in this.validationMap)if(this.validationMap[t]&&this.validationMap[t].isEqual(e))return t;return null}createErrorValidation(e,t){const r=e.cloneConfig(),n="#REF!";r.f1=n,r.f2&&(r.f2=n),r.validId=null,(0,a.arrayEach)(t,(e=>{this.createValidation(r,e)}))}removeBeforeCreate(e){}removeValidation(e,t){const r=this.validationMap[e];r&&(r.removeValidRange(t),this.sheet.runHooks("afterRemoveValidation",r.validId,t))}}const c=u},51340:(e,t,r)=>{"use strict";r.d(t,{createValidationModule:()=>c});var n=r(51263),i=r(59162),o=r(31641),a=r(15168);function s(e,t,r){return(0,o.isFormula)(e)?(0,i.fromR1C1ToA1)(e,t,r):e}const l={getValidationView(e){let{validations:t}=e;return(e,r,o)=>{const a=t[e];if(!a)return;const l=a.type===n.ValidationType.LIST&&"listRange"===a.operator?(0,i.fromR1C1ToA1)(a.displayF1,r,o):s(a.displayF1,r,o),u=s(a.displayF2,r,o);return{...a,displayF1:l,displayF2:u}}},isDropdownValidation(e){let{validations:t}=e;return e=>t[e]?.type===n.ValidationType.LIST}},u={flush(e,t){Object.assign(e,(0,a.freezeAllKey)(t))}};function c(){return{namespaced:!0,state:()=>({validations:{}}),getters:l,mutations:u}}},2141:(e,t,r)=>{"use strict";r.d(t,{default:()=>p});var n=r(935),i=r(15641),o=r(2148),a=r(77778),s=r(55180),l=r(13574),u=r(82651),c=r(19953),h=r(84499),d=r(37873),f=r(57899);const g=new WeakMap,p=class{constructor(e){this.formulaDepManager=new o.FormulaDepManager(e),this.hyperlinkCollection=new c.default(this),this.controller=new u.default(this),this.workbook=e,this.renderCache=null}init(e){this._snapshot=function(e){const t=function(e){let t=0;for(const r in e)if(e[r]){const e=parseInt(r,10);e>t&&(t=e)}return t+1}(e.cells);return{rowCount:(t>e.rowCount?t:e.rowCount)||100,colCount:e.colCount||30,rows:e.rows||[],cols:e.cols||[],cells:e.cells||{},global:e.global||{},synoMergeCell:e.mergeCells||[],fixedRowsTop:e.fixedRowTop||0,fixedColumnsLeft:e.fixedColumnLeft||0,synoConditionalFormat:e.cfs||[],synoFilter:e.filter||{},synoValidation:e.validation||{},synoDrawing:e.drawing||[],hyperlinks:e.hyperlinks||[],notes:e.notes||[]}}(e.snapshot),this._loadPlugins(e.plugins),this.runHooks("beforeInit"),this.sheetId=e.sheetId,this.worksheet=new a.Worksheet(this.workbook,this._snapshot),this.hyperlinkCollection.init(this._snapshot.hyperlinks),this.renderCache=this.getPlugin("synoRenderCache"),!0!==e.deferInit&&(this.notifyDataReady(),this.notifyPluginsReady())}notifyDataReady(){this.runHooks("init")}notifyPluginsReady(){this.runHooks("afterInit",this._snapshot),this._snapshot=void 0}destroy(){this.runHooks("beforeDestroy"),this._destroyPlugins(),this.runHooks("afterDestroy"),this.workbook.hooks.removeContext(this)}notifyCellChanges(e,t){this.getWorkbook().getNotifier()?.onCoordsChanges(this.sheetId,[{row:e,col:t}])}notifyRangeChanges(e){const t=[];e.forAll(((e,r)=>{t.push({row:e,col:r})})),this.getWorkbook().getNotifier()?.onCoordsChanges(this.sheetId,t)}notifyAlterGrid(){this.getWorkbook().getNotifier()?.onAlterGrid(this.sheetId,this.countRows(),this.countCols())}notifySheetChanges(e){this.getWorkbook().getNotifier()?.onSheetChanges(this.sheetId,e)}notifyPluginChanges(e){this.getWorkbook().getNotifier()?.onSheetPluginChanges(this.sheetId,e)}getFormulaDepManager(){return this.formulaDepManager}isActive(){return this.workbook.current===this}addHook(e,t){this.workbook.hooks.add(e,t,this)}addHookOnce(e,t){this.workbook.hooks.once(e,t,this)}removeHook(e,t){this.workbook.hooks.remove(e,t,this)}runHooks(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n{if(!this.isEmptyCell(e,t))return!1}))}getCellModel(e,t){return this.worksheet.getCell(e,t)}getOrCreateCell(e,t){return this.worksheet.getOrCreateCell(e,t)}setCellXf(e,t,r){this.getOrCreateCell(e,t).setXfId(r),this.notifyCellChanges(e,t)}getCellStyle(e,t){const r=this.getCellModel(e,t);return r?r.getCellStyle():null}getComputedCellStyle(e,t){return this.worksheet.getComputedCellStyle(e,t)}setCellMeta(e,t,r){if(0===r.length)return;const n=this.getOrCreateCell(e,t);for(const e of r){const[t,r]=e;n.setProperty(t,r)}this.notifyCellChanges(e,t)}getCellMeta(e,t){const r=this.getCellModel(e,t);return r?r.getProperties():null}getCellProperty(e,t,r){return this.getCellMeta(e,t)?.[r]||null}getCellNote(e,t){return this.getCellModel(e,t)?.note}setCellNote(e,t,r){this.getOrCreateCell(e,t).setNote(r),this.notifyCellChanges(e,t)}getCellHyperlinkState(e,t){return this.getCellMeta(e,t)?.link?.getStateJSON()}getCellFormulaItemState(e,t){return this.getFormulaItem(e,t)?.getStateJSON()}getDataModel(){return this.worksheet}getStyleManager(){return this.workbook.getStyleManager()}getWorkbook(){return this.workbook}getFormulaItem(e,t){const r=this.getCellModel(e,t);return r?r.getFormulaItem():void 0}setFormulaItem(e,t,r){this.setCellMeta(e,t,[["formulaItem",r]])}createRow(e,t,r){this.worksheet.createRow(e,t,r),this.notifyAlterGrid()}createCol(e,t,r){this.worksheet.createCol(e,t,r),this.notifyAlterGrid()}removeRow(e,t){this.worksheet.removeRow(e,t),this.notifyAlterGrid()}removeCol(e,t){this.worksheet.removeCol(e,t),this.notifyAlterGrid()}setDimensionStyle(e,t,r){"row"===e?(this.worksheet.updateRowAttr(t,"s",r),this.notifySheetChanges(["rows"])):(this.worksheet.updateColAttr(t,"s",r),this.notifySheetChanges(["cols"]))}countRows(){return this.worksheet.getRowCount()}countCols(){return this.worksheet.getColCount()}getPlugin(e){return g.get(this)[e]}_loadPlugins(e){const t={};(0,s.arrayEach)(e||[],(e=>{const r=new e(this);t[r.pluginName]=r})),g.set(this,t)}_destroyPlugins(){const e=g.get(this);(0,l.objectEach)(e,(e=>e.destroy())),g.delete(this)}isReadonly(){return this.workbook.readonly}isCommentable(){return this.workbook.commentable}getName(){return this.workbook.getNameById(this.sheetId)}getHyperlinkModel(){return this.hyperlinkCollection}getRangeBound(e,t){return(0,d.getRangeBound)(e,t,this.countRows()-1,this.countCols()-1)}getOverlapCellRanges(e){const t=this.getPlugin("synoMergeCell"),r={};return e.forAll(((e,n)=>{const i=t.getMergedRange(e,n)||new d.SynoCellRange(e,n,e,n),o=`${i.from.row},${i.from.col}`;r[o]||(r[o]=i)})),Object.values(r)}getMergedCellFormatChanges(e,t){const r=t?.format?.mergeCells;return Array.isArray(r)&&0!==r.length?!(0,f.isSingleMergedCell)(t.format)||e.isSingle()||this.getPlugin("synoMergeCell").isMultipleCells(e)?{mergeRangeChanges:this.getPlugin("synoAutofill").getMappingMergeRanges(e.from,e.to,r,"down")}:{mergedBorders:this.modifyByMerged(e,t.format)}:{}}modifyByMerged(e,t){const r=t.border;if(!r||0===r.length)return;const o=r[0][0],a=(0,n.default)((0,n.default)(r)),l=[o&&o.b[0],a&&a.b[1],a&&a.b[2],o&&o.b[3]];return(0,s.forEach2D)(r,((e,t,r,n)=>{n[t][r]=null})),(0,i.getRangeBorderChanges)(this.countRows(),this.countCols(),e,"OUTER",l,((e,t)=>this.getDataModel().getComputedCellStyle(e,t).getBorder().b))}}},15901:(e,t,r)=>{"use strict";r.d(t,{default:()=>s});var n=r(84499),i=r(4263),o=r(96803),a=r(17250);class s{constructor(e){this.workbook=e}getIndex(e){const t={gcVer:e.gcVer,maxIndex:this.workbook.getMaxIndex(),order:this.workbook.getOrder(),schemaVersion:o.default.SCHEMA_VERSION,sheets:{},ver:e.ver};return this.workbook.forAll(((e,r)=>{const n=t.sheets[r]={deleted:!1,title:e.name};e.color&&(n.tabColor=e.color),e.hidden&&(n.hidden=e.hidden)})),t}*getWorksheetGenerator(e){const t=[],r=JSON.stringify(this.getWorksheet(e));yield r.slice(0,-1),yield',"cells":',yield*this.getCellGenerator(e.worksheet,t),yield',"notes":',yield JSON.stringify(t),yield"}"}getStyle(){return this.workbook.getStyleManager().toJSON()}getDefine(){return this.workbook.getNameManager().toJSON()}getComment(){return this.workbook.getCommentStore().toJSON()}getProtection(){return this.workbook.getRuleStore().toJSON()}getExternalLinks(){return this.workbook.getExternalManager().listLinkIds().length>0?this.workbook.getExternalManager().toJSON():null}getFileList(){const e=new Set;this.workbook.forAll((t=>{const r=this.getDrawings(t.sheet);for(let t=0;tt.push(e))),t}getWorksheet(e){const t=e.getDataModel(),r=e.getPlugin("synoFreezeBar"),n={cfs:this.getCfs(e),colCount:e.countCols(),rowCount:e.countRows(),rows:{},cols:{},global:t.getGlobalXf()>0?{s:t.getGlobalXf()}:null,drawing:this.getDrawings(e).concat(this.getCharts(e)),filter:this.getFilter(e),fixedColumnLeft:r.fixedColumnsLeft,fixedRowTop:r.fixedRowsTop,mergeCells:this.getMergeCells(e),validation:this.getValidations(e),hyperlinks:this.getHyperlinks(e)};function i(e,t,r,n){let i=e[t];void 0===i&&(i=e[t]={}),i[r]=n}const o=n.cols;t.colInfos.forEach(((e,t)=>{e&&(e.hidden&&i(o,t,"hidden",e.hidden),"number"==typeof e.s&&e.s>=0&&i(o,t,"s",e.s),"number"==typeof e.w&&e.w>0&&i(o,t,"w",e.w))}));const a=n.rows;return t.rowInfos.forEach(((e,t)=>{e&&(e.hidden&&i(a,t,"hidden",e.hidden),"number"==typeof e.s&&e.s>=0&&i(a,t,"s",e.s),"number"==typeof e.h&&e.h>0&&i(a,t,"h",e.h))})),n}*getCellGenerator(e,t){yield"{";let r=0;for(let i=0,o=e.getRowLength();i0&&(a+=","),a+=`"${i}":{`);const u={};l.getXfId()>0&&(u.s=l.getXfId()),(0,n.isEmptyValue)(l.getValue())||(u.v=l.getValue());const c=l.getNote();c&&t.push({row:i,col:e,text:c}),s>0&&(a+=","),a+=`"${e}":${JSON.stringify(u)}`,s++}s>0&&(a+="}",r++,yield a)}yield"}"}getMergeCells(e){return e.getPlugin("synoMergeCell").serialize()}getCfs(e){return e.getPlugin("synoConditionalFormat").cfs.map((e=>e.serialize()))}getDrawings(e){return e.getPlugin("synoDrawingController").getImages().map((e=>({id:e.id,pos:e.getPosition(),type:a.DRAWING_TYPE.IMAGE})))}getCharts(e){return e.getPlugin("synoDrawingController").getCharts().map((e=>({id:e.id,pos:e.getPosition(),chartObj:e.infoHandler.getChartObj(),type:a.DRAWING_TYPE.CHART})))}getFilter(e){const t=e.getPlugin("synoFilter"),r=t.filter,n=t.filterView;let i={};return r&&(i=r.toJSON()),n.length>0&&(i.filterView=n.map((e=>e.toJSON()))),i}getValidations(e){const t=e.getPlugin("synoValidation"),r={},n=t.validationMap;return Object.keys(n).forEach((e=>{const t=n[e];r[e]=Object.assign(t.cloneConfig(),{ranges:t.ranges.map((e=>i.default.toLabel(e)))})})),r}getHyperlinks(e){return e.getHyperlinkModel().toJSON()}}},26831:(e,t,r)=>{"use strict";r.d(t,{createCommentStoreModule:()=>o});var n=r(14633);const i={canReopen:e=>{let{comments:t}=e;return e=>{let{row:r,col:i,sheetId:o}=e;return!t.find((e=>e.status===n.Enum.STATUS_OPEN&&e.row===r&&e.col===i&&e.sheetId===o))}}};function o(){return(0,n.createModule)({getters:i})}},3950:(e,t,r)=>{"use strict";r.d(t,{createExternalManagerModule:()=>a});var n=r(15168);const i={linkList(e){let{linkInfo:t,loadingList:r,notFoundList:n,noPermissionList:i}=e;const o=new Set(r),a=new Set(n),s=new Set(i);return t.map((e=>{let{linkId:t,title:r,updateTime:n,ref:i}=e;return{linkId:t,title:r,updateTime:n,ref:i,loading:o.has(t),notFound:a.has(t),noPermission:s.has(t)}}))},errorList(e){let{notFoundList:t,noPermissionList:r}=e;return t.concat(r)}},o={enableFetching(e){e.enabled=!0},setAutoUpdate(e,t){e.autoUpdate=t},flushLinkInfo(e,t){e.linkInfo=(0,n.freezeAllElement)(t)},updateLinkInfo(e,t){let{linkInfo:r}=e;const n=r.findIndex((e=>{let{linkId:r}=e;return r===t.linkId}));n<0?r.push(t):r.splice(n,1,t)},removeLinkInfo(e,t){let{linkInfo:r}=e;const n=r.findIndex((e=>t===e.linkId));n>=0&&r.splice(n,1)},addLoading:function(e,t){let{loadingList:r}=e;r.indexOf(t)<0&&r.push(t)},removeLoading(e,t){let{loadingList:r}=e;const n=r.indexOf(t);n>=0&&r.splice(n,1)},addNotFoundList(e,t){let{notFoundList:r}=e;r.indexOf(t)<0&&r.push(t)},addNoPermissionList(e,t){let{noPermissionList:r}=e;r.indexOf(t)<0&&r.push(t)}};function a(e){return{namespaced:!0,state:()=>({enabled:!1,autoUpdate:!1,linkInfo:[],loadingList:[],notFoundList:[],noPermissionList:[],...e}),getters:i,mutations:o}}},94455:(e,t,r)=>{"use strict";r.d(t,{createStore:()=>a,workbookNamespace:()=>o});var n=r(20629),i=r(21296);const o="workbook";function a(){return new n.Store({modules:{workbook:(0,i.createWorkbookModule)()}})}},15168:(e,t,r)=>{"use strict";function n(e,t){for(const r of Object.keys(e))t?.has(r)||Object.freeze(e[r]);return e}function i(e){for(const t of e)Object.freeze(t);return e}r.d(t,{freezeAllElement:()=>i,freezeAllKey:()=>n})},37016:(e,t,r)=>{"use strict";r.d(t,{createNameManagerModule:()=>a});var n=r(15168);const i={getVariable(e){let{workbookScope:t,list:r}=e;return function(e,n){void 0===n&&(n=t);const i=r.find((t=>t.name===e&&t.scope===n));if(i)return{name:i.name,value:i.value}}}},o={flush(e,t){Object.assign(e,(0,n.freezeAllKey)(t))}};function a(){return{namespaced:!0,state:()=>({workbookScope:"global",list:[]}),getters:i,mutations:o}}},90563:(e,t,r)=>{"use strict";r.d(t,{createRuleStoreModule:()=>a});var n=r(15168);const i={find(e){let{rules:t}=e;return e=>t.find((t=>t.ruleId===e))},isGrantable(e,t){let{find:r}=t;return e=>r(e)?.isGrantable??!1}},o={flush(e,t){Object.assign(e,(0,n.freezeAllKey)(t))}};function a(e){return{namespaced:!0,state:()=>e??{rules:[]},getters:i,mutations:o}}},44588:(e,t,r)=>{"use strict";r.d(t,{createSearchModule:()=>l});var n=r(36378),i=r(55180);function o(e,t){return e.rowt[e]?.results.length??0},searchIndex(e){let{resultRecords:t}=e;return e=>{const r=t[e];return r?Math.min((0,i.indexOfLowerBoundBy)(r.results,r.coords,o),r.results.length-1):-1}},getSearchingResults(e){let{isSearching:t,resultRecords:r}=e;return e=>t?r[e]?.results??[]:[]},getResultBy(e){let{resultRecords:t}=e;return(e,r)=>{const a=t[e];if(a){if((0,n.default)(r)){const e=(0,i.indexOfLowerBoundBy)(a.results,a.coords,o);return"prev"===r?a.results[e-1]:a.results[e+1]}{const e=(0,i.indexOfLowerBoundBy)(a.results,r,o);return a.results[e]}}}},getFirstResult(e){let{resultRecords:t}=e;return e=>t[e]?.results[0]},getLastResult(e){let{resultRecords:t}=e;return e=>{const r=t[e]?.results;return r?r[r.length-1]:void 0}}},s={setSearching(e,t){e.isSearching=t},updateSearchResult(e,t){let{resultRecords:r}=e,{sheetId:n,coords:i,results:o}=t;r[n]||(r[n]={results:[],coords:{row:0,col:0}}),r[n].results=o,i&&(r[n].coords=i)},moveSearchResult(e,t){let{resultRecords:r}=e,{sheetId:n,moveTo:a}=t;const s=r[n];if(!s||0===s.results.length)return;const l=Math.min((0,i.indexOfLowerBoundBy)(s.results,a,o),s.results.length-1);s.coords={row:s.results[l].row,col:s.results[l].col}}};function l(){return{namespaced:!0,state:()=>({isSearching:!1,resultRecords:{}}),getters:a,mutations:s}}},85612:(e,t,r)=>{"use strict";r.d(t,{createStyleManagerModule:()=>a});var n=r(15168);function i(e,t,r){const i=e.length-r;i>t.length||i<0||e.push(...(0,n.freezeAllElement)(t.slice(i)))}const o={appendStyles(e,t){let{appendData:r,indexes:n}=t;const{styles:o,fonts:a,fills:s,alignments:l,borders:u,numberFormats:c}=r;i(e.styles,o,n.styles),i(e.fonts,a,n.fonts),i(e.fills,s,n.fills),i(e.alignments,l,n.alignments),i(e.borders,u,n.borders),i(e.numberFormats,c,n.numberFormats)}};function a(e){return{namespaced:!0,state:()=>e??{styles:[[0,0,0,0,0,0,0]],fonts:[{}],fills:[{}],alignments:[{}],borders:[{b:[null,null,null,null]}],numberFormats:[{fc:""}]},mutations:o}}},21296:(e,t,r)=>{"use strict";r.d(t,{createWorkbookModule:()=>g});var n=r(55180),i=r(26831),o=r(3950),a=r(37016),s=r(90563),l=r(44588),u=r(85612),c=r(38821),h=r(96803);const d={colorSet:e=>{let{colors:t}=e;return new Set(t)},sheetsInfo:e=>{let{sheets:t}=e;return new Map(Object.entries(t))},nameMap:e=>{let{sheets:t}=e;const r=new Map;for(const[e,{title:n}]of Object.entries(t))r.set(n,e);return r},hasSheet:(e,t)=>{let{sheetsInfo:r}=t;return e=>r.has(e)},isHiddenSheet:(e,t)=>{let{sheetsInfo:r}=t;return e=>r.get(e)?.hidden??!1},visibleOrder:(e,t)=>{let{order:r}=e,{isHiddenSheet:n}=t;return r.filter((e=>!n(e)))},getSheetInfo:(e,t)=>{let{sheetsInfo:r}=t;return e=>r.get(e)},getPrevSheet:(e,t)=>{let{order:r}=e,{isHiddenSheet:i}=t;return(e,t)=>(0,n.findPrev)(r,e,(e=>i(e)),t)},getNextSheet:(e,t)=>{let{order:r}=e,{isHiddenSheet:i}=t;return(e,t)=>(0,n.findNext)(r,e,(e=>i(e)),t)},getSiblingSheet:(e,t)=>{let{getPrevSheet:r,getNextSheet:n}=t;return e=>r(e)||n(e)},getSheetPos:e=>{let{order:t}=e;return e=>t.indexOf(e)},remainingCellCount:e=>{let{sheets:t,constants:r}=e,n=0;for(const{rowCount:e,colCount:r}of Object.values(t))n+=e*r;return Math.max(r.MAX_CELL_COUNT-n,0)},getAvailableRowCount:(e,t)=>{let{sheetsInfo:r,remainingCellCount:n}=t;return e=>{const t=r.get(e)?.colCount;return t?Math.floor(n/t):0}},getAvailableColCount:(e,t)=>{let{sheetsInfo:r,remainingCellCount:n}=t;return e=>{const t=r.get(e)?.rowCount;return t?Math.floor(n/t):0}},getAvailableMaxRow:(e,t)=>{let{sheetsInfo:r,getAvailableRowCount:n}=t;return e=>{const t=r.get(e);return t?t.rowCount+n(e):0}},getAvailableMaxCol:(e,t)=>{let{sheetsInfo:r,getAvailableColCount:n}=t;return e=>{const t=r.get(e);return t?t.colCount+n(e):0}},getSheetDimension:(e,t)=>{let{sheetsInfo:r}=t;return e=>{const t=r.get(e);return{rowCount:t?.rowCount??0,colCount:t?.colCount??0}}},isDimensionAvailable:(e,t)=>{let{sheetsInfo:r,remainingCellCount:n}=t;return(e,t,i)=>{const o=r.get(e);if(!o)return!1;const{rowCount:a,colCount:s}=o,l=(t=Math.max(t,a))*(i=Math.max(i,s))-a*s;return 0===l||n>=l}},isNewSheetAvailable:(e,t)=>{let{sheetsInfo:r,remainingCellCount:n}=t;return e=>{const t=e?r.get(e):null,i=t?t.rowCount*t.colCount:h.default.DEFAULT_ROW_COUNT*h.default.DEFAULT_COL_COUNT;return n>=i}}},f={flushData(e,t){Object.assign(e,t)},updateSheetDimension(e,t){let{sheetId:r,rowCount:n,colCount:i}=t;e.sheets[r]&&(e.sheets[r].rowCount=n,e.sheets[r].colCount=i)}};function g(){return{namespaced:!0,state:()=>({order:[],sheets:{},readonly:!1,commentable:!1,colors:[],constants:{MAX_CELL_COUNT:0}}),getters:d,mutations:f,modules:{nameManager:(0,a.createNameManagerModule)(),ruleStore:(0,s.createRuleStoreModule)(),commentStore:(0,i.createCommentStoreModule)(),worksheet:(0,c.createWorksheetModule)(),search:(0,l.createSearchModule)(),styleManager:(0,u.createStyleManagerModule)(),externalManager:(0,o.createExternalManagerModule)()}}}},38821:(e,t,r)=>{"use strict";r.d(t,{createWorksheetModule:()=>w});var n=r(85978),i=r(15168),o=r(96803),a=r(55180),s=r(58835),l=r(84499),u=r(37873),c=r(65180),h=r(68279),d=r(52866),f=r(45486),g=r(79921),p=r(30105),m=r(51340);const v=new Set(["cells"]),y={rowHeight:e=>{let{rows:t,renderedHeight:r}=e;const n=[],i=Math.max(t.length,r.length);for(let e=0;e{let{cells:t}=e;return(e,r)=>{const n=t[e]?.[r]?.v;return(0,s.isRichTextJSON)(n)?c.default.fromJSON(n):n}},getCellProperty:e=>{let{cells:t}=e;return(e,r,n)=>t[e]?.[r]?.[n]},getComputedXf:e=>{let{cells:t,rows:r,cols:n,global:i}=e;return(e,o)=>t[e]?.[o]?.s??r[e]?.s??n[o]?.s??i?.s??0},isEmptyCell:e=>{let{cells:t}=e;return(e,r)=>(0,l.isEmptyValue)(t[e]?.[r]?.v)},isEmptyRange:(e,t)=>{let{isEmptyCell:r}=t;return e=>{let t=!0;return e.forAll(((e,n)=>(t&&(t=r(e,n)),t))),t}},getSpillRange:e=>{let{cells:t,rowCount:r,colCount:n,formulaDimensions:i}=e;return(e,o)=>{let a=null;for(const[r,n,s,l]of i){if(es||ol)continue;const i=t[r]?.[n]?.formulaItem;if(r===e&&n===o){a=i?new u.SynoCellRange(r,n,s,l):null;break}i&&!i.hasSpillError&&(!a||a.from.row>r||a.from.row===r&&a.from.col>n)&&(a=new u.SynoCellRange(r,n,s,l))}return a&&(a.to.row=Math.min(r-1,a.to.row),a.to.col=Math.min(n-1,a.to.col)),a}},getCellFormulaValue:e=>{let{cells:t}=e;return(e,r)=>{const i=t[e]?.[r]?.cellFormulaValue??null;if(!(0,l.isEmptyValue)(i))return(0,n.deserializeFormulaValue)(i);const o=t[e]?.[r]?.v??null;return(0,s.isRichTextJSON)(o)?o.v.map((e=>e.tx)).join(""):o}},getRangeTexts:e=>{let{cells:t}=e;return function(e,r){let{rowStep:n=1,colStep:i=1}=void 0===r?{}:r;const[o,s,l,u]=e.toArray(),c=l-o+1,h=u-s+1;return(0,a.generate2DArray)(Math.ceil(c/n),Math.ceil(h/i),((e,r)=>{const a=s+r*i;return t[o+e*n]?.[a]?.renderDesc?.v??""}))}},getAllTexts:(e,t)=>{let{rowCount:r,colCount:n}=e,{getRangeTexts:i}=t;return function(e){void 0===e&&(e=!1);const t=i(new u.SynoCellRange(0,0,r-1,n-1));return e&&(0,a.trim2DArray)(t,(e=>!e)),t}}};function C(e,t){if(t.length<0)return;const r=e.renderedHeight.slice();for(const[e,n]of t)r[e]=n;e.renderedHeight=Object.freeze(r)}const x={flush(e,t){if((0,i.freezeAllKey)(t,v),t.cells)for(const e of t.cells)(0,i.freezeAllElement)(e);Object.assign(e,t)},updateScatterCells(e,t){let{coords:r,cells:n}=t;const{cells:i}=e;for(let e=0;e[e,void 0])))},modifyRenderHeightByAlterRow(e,t){let{index:r,amount:n}=t;const i=e.renderedHeight.slice();n<0?i.splice(r,-n):(0,a.arrayAlloc)(i,r,n),e.renderedHeight=Object.freeze(i)},modifyRenderHeightByAlterCol(e,t){let{index:r,amount:n}=t;const{renderedHeight:i}=e,o=new Map;for(let e=0;e0&&C(e,Array.from(r))}};function w(){return{namespaced:!0,state:()=>({rowCount:0,colCount:0,rows:[],cols:[],global:null,cells:[],formulaDimensions:[],hyperlinks:[],renderedHeight:[]}),getters:y,mutations:x,modules:{filter:(0,d.createFilterModule)(),merge:(0,p.createMergeModule)(),validation:(0,m.createValidationModule)(),cf:(0,h.createCfModule)(),freeze:(0,f.createFreezeModule)(),drawing:(0,g.createDrawingModule)()}}}},69655:(e,t,r)=>{"use strict";r.d(t,{default:()=>s});var n=r(85208),i=r(80442),o=r(57086),a=r(3521);const s={instance:a.default,initInstance:function(e){let{transport:t}=e;a.default.init({transport:t,opHandler:new n.default})},BaseTransport:o.default,translator:i}},3521:(e,t,r)=>{"use strict";r.d(t,{default:()=>n});const n=new class{constructor(){this._opHandler=null,this._transport=null}init(e){let{opHandler:t,transport:r}=e;this._opHandler=t,this._transport=r}getOpHandler(){return this._opHandler}getTransport(){return this._transport}}},85208:(e,t,r)=>{"use strict";r.d(t,{default:()=>i});var n=r(3521);const i=class{listen(e){this._bindHotHook(e)}_bindHotHook(e){if(!e)return;const t=this;e.addHook("afterSelectionEnd",(function(e){t._sendPeerSelection("select",this.sheet,e.highlight)})),e.addHook("updatePeerSelection",(function(e){t._sendPeerSelection("update",this.sheet,e)})),e.addHook("afterDeselect",this.afterDeselect)}_sendPeerSelection(e,t,r){!t.isReadonly()&&r&&n.default.getTransport().notifyPeer({cmd:e,row:r.from.row,col:r.from.col,id:t.sheetId})}afterDeselect(){this.sheet.isReadonly()||n.default.getTransport().notifyPeer({cmd:"deselect",id:this.sheet.sheetId})}}},80442:(e,t,r)=>{"use strict";r.r(t),r.d(t,{compact:()=>h,compactAlignmentObject:()=>x,compactFontObject:()=>m,compressAlignment:()=>v,compressDimensionStyle:()=>R,compressFont:()=>f,compressGlobalStyle:()=>b,extract:()=>d,recoverAlignmentObject:()=>C,recoverFontObject:()=>p,uncompressAlignment:()=>y,uncompressDimensionStyle:()=>S,uncompressFont:()=>g,uncompressGlobalStyle:()=>I});var n=r(13574);const i={name:"n",size:"sz",bold:"b",italic:"i",strike:"s",underline:"u",color:"c"},o={halign:"h",valign:"v",wrap:"w"};function a(e){const t={};return(0,n.objectEach)(e,((e,r)=>{t[e]=r})),t}const s=a(i),l=a(o);function u(e,t){if(null===t)return t;const r={};for(const i in t)(0,n.objectHasOwnProperty)(t,i)&&(0,n.objectHasOwnProperty)(e,i)&&(r[e[i]]=t[i]);return r}function c(e,t,r){r=r||2;for(let n=0,i=t.length;n{"use strict";r.d(t,{default:()=>a});var n=r(73321),i=r(80442),o=r(58835);const a=class extends class{constructor(){this.commandQueue=[],this.remoteQueue=[],this.pendingCommand=null,this.rev=-1,this.identifier=null,this.callbackMap=new WeakMap}isSyncComplete(){return!this.pendingCommand&&0===this.commandQueue.length}async execCommand(e){await n.default.getDataBridge().execCommand(e)}async execRemoteCommand(e){await n.default.getDataBridge().execRemoteCommand((0,i.extract)(e))}sendCommand(e,t){this.rev++,e.rev=this.rev,this.commandQueue.push(e),t&&this._registerCallback(e,t),this.pendingCommand||this._sendNextCommand()}_sendNextCommand(){if(0===this.commandQueue.length)return void n.default.getUIBridge().onAfterSync();n.default.getUIBridge().onBeforeSync();const e=this.commandQueue.shift(),t=(0,i.compact)(e.toData());this.pendingCommand=e,this._emit("set",t,this._onAck.bind(this))}_adjustRev(e,t){const r=t-e,n=this.commandQueue;for(let e=0;e0?n[n.length-1].rev:t}_checkSyncingState(e,t,r){const n=this.pendingCommand?this.pendingCommand.rev-1:this.rev;this.identifier===e&&n===t?(this.onReconnectDone(r),this.pendingCommand&&(this.commandQueue.unshift(this.pendingCommand),this.pendingCommand=null),this._sendNextCommand(),this.onReadyDone()):this.onSyncError()}getUndoneCommands(){const e=[];return this.pendingCommand&&e.push(this.pendingCommand),e.concat(this.commandQueue)}async _resolveConflict(e){const t=this.getUndoneCommands();this._batchExecute("undo",t),this.remoteQueue.sort(((e,t)=>e.rev-t.rev));for(let e=0;e{this._emit("peek",this._checkSyncingState.bind(this))})).catch((e=>console.error(e)))}onReconnectDone(){}sayHello(){this._emit("say_hello",this.sayHelloDone.bind(this))}sayHelloDone(){}onInit(e,t){this.rev=e,this.identifier=t}onSyncError(){}_emit(){}getLastCommand(){return 0===this.commandQueue.length?this.pendingCommand:this.commandQueue[this.commandQueue.length-1]}scheduleSave(e,t){const r=this._emit.bind(this,"save",e,t||function(){});if(!this.pendingCommand)return r();this._registerCallback(this.getLastCommand(),r)}_registerCallback(e,t){let r=this.callbackMap.get(e);Array.isArray(r)||(r=[],this.callbackMap.set(e,r)),r.push(t)}removeAllCallbacks(e){this.callbackMap.delete(e)}}{constructor(){super(),this.socket=null,this.socketWrapper=null,this.isReadyForPeers=!1}registerEvents(e){this.socketWrapper=e,e.waitForReady().then((()=>this.onReadyDone())).catch((e=>this.onError(e)));const t=e.getSocket();t.io.on("reconnect",(()=>this.onReconnect())),t.on("disconnect",(()=>this.onDisconnect())),t.on("set",(e=>this.onRemoteCommand(e))),t.on("peer",(e=>{this.isReadyForPeers&&this.onPeer(e)})),t.on("set_info",(e=>this.onSetInfo(e))),t.on("reload",(e=>this.onReload(e))),t.on("kick",(e=>this.onKick(e))),t.on("error",(e=>this.onError(e)))}onReadyDone(){this.sayHello(),this.askPeers()}pullCommands(e){return this.socketWrapper.waitForReady(e).then((()=>new Promise((e=>{this._emit("init",((t,r,n)=>{this.onInit(r,t),n.length&&this.logCommands(n),e(n)}))}))))}async _resolveConflict(e){await super._resolveConflict(e),n.default.getUIBridge().onEditorRender()}askPeers(){this._emit("ask_peers",(e=>this.onInitPeers(e)))}_emit(){this.socketWrapper.getSocket().emit(...arguments)}notifyPeer(e){this._emit("peer",e)}queryCellHistory(e,t,r,n){return new Promise((i=>{this._emit("query_cell_history",e,t,r,n,(e=>{i((0,o.deserializeCellHistoryValue)(e))}))}))}onDisconnect(){this.onClearPeers()}onPeer(){}onSetInfo(){}onReload(){}onKick(){}logCommands(){}onError(e){}onSyncError(){this.socketWrapper.isConnected()&&this.socketWrapper.getSocket().disconnect()}onInitPeers(){this.isReadyForPeers=!0}onClearPeers(){this.isReadyForPeers=!1}}},15343:(e,t,r)=>{"use strict";r.d(t,{CellDesc:()=>u,CellDescType:()=>l,renderData:()=>c});var n=r(85978),i=r(31641),o=r(40328),a=r(58835),s=r(84499);let l;!function(e){e[e.TEXT=1]="TEXT",e[e.NUM=2]="NUM",e[e.BOOL=3]="BOOL",e[e.LINK=4]="LINK",e[e.RICH_TEXT=5]="RICH_TEXT"}(l||(l={}));class u{constructor(){this.v="",this.t=l.TEXT,this.c=void 0,this.e=void 0}getState(){return{v:this.v,t:this.t,c:this.c,e:this.e}}isLink(){return this.t===l.LINK}isNumber(){return this.t===l.NUM}isRichText(){return this.t===l.RICH_TEXT}getExtra(){return this.e}getText(){return this.v}getColor(){return this.c}generalRenderer(e,t,r){let n;r=r||"General";try{n=e.format(r,t)}catch(e){}n?(this.v=n.v,n.c&&(this.c=n.c)):this.v=(0,o.stringify)(t)}htmlRenderer(e,t){this.v=e.render("General",t)}textRenderer(e,t){this.t===l.NUM?this.v=e.render("General",t):this.v=(0,o.stringify)(t)}richTextRenderer(e){this.t=l.RICH_TEXT,this.v=e.getText()}}function c(e,t,r){const o=e.getCellModel(t,r);let c=o?.getValue()??"";const h=e.getDataModel().getComputedCellStyle(t,r),d=!!o?.getProperties()?.link,f=h.getNumberFormat(),g=new u,p=e.getWorkbook();let m=f.fc;function v(e){e.nfId&&f.isDefault()&&(m=(0,s.translateItemNfId)(p,e.nfId))}if(!o||(0,s.isEmptyValue)(c)){const i=e.formula.getSpillItem(t,r);if(i){v(i);const o=e.formula.getCellValue(t,r)??"";c=n.type.error.isError(o)?o.message:o}}else if((0,i.isFormula)(c,h)){const t=o.getFormulaItem();c=function(e,t,r){let i=e.formula.getCellValue(r.row,r.col)??"";return r.isLink()&&(t.t=l.LINK,t.e=r.href),r.error?i=r.error.getValue():r.getSpillRange()&&r.spillError&&(i=r.spillError.getValue()),null===i?"":n.type.error.isError(i)?i.message:i}(e,g,t),v(t)}else d&&(g.t=l.LINK);const y=p.getLocale().getSSF();return(0,a.isRichTextValue)(c)?g.richTextRenderer(c):f.isText()?(g.t=l.TEXT,g.textRenderer(y,c)):g.t===l.LINK&&f.isDefault()?g.htmlRenderer(y,c):"number"==typeof c?(g.t=l.NUM,g.generalRenderer(y,c,m)):"boolean"==typeof c?(g.t=l.BOOL,g.generalRenderer(y,c,m)):g.generalRenderer(y,c,m),g}u.Type=l},15043:(e,t,r)=>{"use strict";r.d(t,{ACTION_MAP:()=>We,Action:()=>s,AddInternalLinkAction:()=>Ne,AdjustChartAction:()=>se,ChangeAction:()=>h,ClearCommentAction:()=>ye,CompoundedAction:()=>l,CreateCfAction:()=>K,CreateColumnAction:()=>g,CreateCommentAction:()=>he,CreateDefinedNameAction:()=>Se,CreateFilterAction:()=>O,CreateFilterViewAction:()=>V,CreateRowAction:()=>f,CreateRuleAction:()=>Fe,CreateValidAction:()=>X,DimensionStyleChangeAction:()=>xe,DisableFilterAction:()=>L,DisableFilterViewAction:()=>U,EditCommentAction:()=>pe,EnableFilterAction:()=>D,EnableFilterViewAction:()=>H,FixedColAction:()=>b,FixedRowAction:()=>S,GlobalStyleChangeAction:()=>we,HideColsAction:()=>E,HideRowsAction:()=>A,InsertChartAction:()=>ie,InsertImageAction:()=>ee,MergeCellAction:()=>w,ModifyDefinedNameAction:()=>Ie,MoveColAction:()=>Ee,MoveFormulaRangeAction:()=>Me,MoveRowAction:()=>Te,NoteChangeAction:()=>N,PasteCommentAction:()=>ve,RemoveCfAction:()=>J,RemoveChartAction:()=>oe,RemoveColumnAction:()=>m,RemoveDefinedNameAction:()=>be,RemoveExternalLinksAction:()=>ze,RemoveImageAction:()=>te,RemoveInternalLinkAction:()=>De,RemoveRowAction:()=>p,RemoveRuleAction:()=>Ve,RemoveValidAction:()=>$,ReopenCommentAction:()=>fe,ReplyCommentAction:()=>de,ResizeChartAction:()=>ae,ResizeColumnAction:()=>C,ResizeImageAction:()=>re,ResizeRowAction:()=>y,ResolveCommentAction:()=>ge,SetActiveFilterViewAction:()=>j,SetChartConfigAction:()=>le,SetFilterAction:()=>P,SetFilterViewConditionAction:()=>z,ShowColsAction:()=>M,ShowRowsAction:()=>T,SortAction:()=>k,StyleChangeAction:()=>x,UnmergeCellAction:()=>_,UpdateCfRangesAction:()=>Z,UpdateExternalLinksAction:()=>Ue,UpdateFilterRangeAction:()=>F,UpdateFilterViewNameAction:()=>W,UpdateFilterViewRangeAction:()=>G,UpdateInternalLinkAction:()=>Oe,UpdateRuleAction:()=>Be});var n=r(96687),i=r(5501),o=r(13574),a=r(3058);class s{static getName(){return"Action"}constructor(){this.userSels=void 0,this.rev=0}pushToQueue(){return!0}_toData(){return this.getRedoCommand()}toData(){const e=this._toData();return e.rev=this.rev,e}needInstance(){return!0}needSync(){return!0}needLockUI(){return!1}setSelections(e){this.userSels=e}getSelections(){return this.userSels}serialize(){return{name:this.constructor.getName(),args:this.dumpArgs()}}}class l extends s{static getName(){return"CompoundedAction"}constructor(e){super(),this.actions=e}needInstance(){return this.actions.some((e=>e.needInstance()))}getUndoCommand(){return i.createCompoundCommand(this.actions.map((e=>e.getUndoCommand())).reverse())}getRedoCommand(){return i.createCompoundCommand(this.actions.map((e=>e.getRedoCommand())))}_toData(){return i.createCompoundCommand(this.actions.filter((e=>e.needSync())).map((e=>e.toData())))}*iterateActions(){for(const e of this.actions)yield e}dumpArgs(){return[this.actions.map((e=>e.serialize()))]}}class u{static getOld(e){const t=[];for(let r=0,n=e.length;r{let{name:t,args:r}=e;return i.createSetChartConfigCommand(this.sheetId,this.chartId,t,r)}));return 1===e.length?e[0]:i.createCompoundCommand(e.reverse())}getRedoCommand(){return i.createSetChartConfigCommand(this.sheetId,this.chartId,this.name,this.args)}dumpArgs(){return[this.sheetId,this.chartId,this.name,this.args,this.invertCmd]}}class ue extends s{needInstance(){return!1}}class ce extends ue{constructor(e){super(),this.json=e}pushToQueue(){return!1}dumpArgs(){return[this.json]}}class he extends ce{static getName(){return"CreateCommentAction"}getUndoCommand(){return i.createEditCommentCommand(this.json.author,this.json.id,this.json.id,null)}getRedoCommand(){return i.createCreateJsonCommentCommand(this.json)}}class de extends ce{static getName(){return"ReplyCommentAction"}getUndoCommand(){return i.createEditCommentCommand(this.json.author,this.json.target,this.json.id,null)}getRedoCommand(){return i.createReplyJsonCommentCommand(this.json)}}class fe extends ce{static getName(){return"ReopenCommentAction"}getUndoCommand(){throw new Error("cant undo")}getRedoCommand(){return i.createOpenJsonCommentCommand(this.json)}}class ge extends ce{static getName(){return"ResolveCommentAction"}getUndoCommand(){throw new Error("cant undo")}getRedoCommand(){return i.createResolveJsonCommentCommand(this.json)}}class pe extends ce{static getName(){return"EditCommentAction"}getUndoCommand(){throw new Error("cant undo")}getRedoCommand(){return i.createEditJsonCommentCommand(this.json)}}class me extends ue{constructor(e){super(),this.jsonArray=e}getClearCommand(){return i.createClearCommentCommand(this.jsonArray)}getPasteCommand(){return i.createPasteCommentCommand(this.jsonArray)}dumpArgs(){return[this.jsonArray]}}class ve extends me{static getName(){return"PasteCommentAction"}getUndoCommand(){return this.getClearCommand()}getRedoCommand(){return this.getPasteCommand()}}class ye extends me{static getName(){return"ClearCommentAction"}getUndoCommand(){return this.getPasteCommand()}getRedoCommand(){return this.getClearCommand()}}function Ce(e,t){return e.map((e=>[e[0],e[t]]))}class xe extends c{static getName(){return"DimensionStyleChangeAction"}constructor(e,t,r,n,i,o){super(e),this.type=r,this.dim=t,this.changes=n,this.revert=i,this.cellChanges=o}getUndoCommand(){return i.createDimensionStyleCommand(this.sheetId,this.dim,this.type,Ce(this.changes,1),!0,u.getOld(this.cellChanges),n.SourceType.Undo)}getRedoCommand(){return i.createDimensionStyleCommand(this.sheetId,this.dim,this.type,Ce(this.changes,2),!1,void 0,n.SourceType.Redo)}_toData(){return i.createDimensionStyleCommand(this.sheetId,this.dim,this.type,Ce(this.changes,2),this.revert,this.revert?u.getNew(this.cellChanges):void 0)}dumpArgs(){return[this.sheetId,this.dim,this.type,this.changes,this.revert,this.cellChanges]}}class we extends c{static getName(){return"GlobalStyleChangeAction"}constructor(e,t,r,n,i,o,a){super(e),this.type=t,this.change=r,this.revert=n,this.rowChanges=i,this.colChanges=o,this.cellChanges=a}getUndoCommand(){return i.createGlobalStyleCommand(this.sheetId,this.type,this.change[0],!0,u.getOld(this.cellChanges),Ce(this.rowChanges,1),Ce(this.colChanges,1),n.SourceType.Undo)}getRedoCommand(){return i.createGlobalStyleCommand(this.sheetId,this.type,this.change[1],!1,void 0,void 0,void 0,n.SourceType.Redo)}_toData(){return i.createGlobalStyleCommand(this.sheetId,this.type,this.change[1],this.revert,this.revert?u.getNew(this.cellChanges):void 0,this.revert?Ce(this.rowChanges,2):void 0,this.revert?Ce(this.colChanges,2):void 0)}dumpArgs(){return[this.sheetId,this.type,this.change,this.revert,this.rowChanges,this.colChanges,this.cellChanges]}}class _e extends s{needInstance(){return!1}}class Re extends _e{constructor(e,t,r){super(),this.name=e,this.value=t,this.scope=r}createRemoveDefineCommand(){return i.createRemoveDefineCommand(this.name,this.scope)}createCreateDefineCommand(){return i.createCreateDefineCommand(this.name,this.value,this.scope)}dumpArgs(){return[this.name,this.value,this.scope]}}class Se extends Re{static getName(){return"CreateDefinedNameAction"}getUndoCommand(){return this.createRemoveDefineCommand()}getRedoCommand(){return this.createCreateDefineCommand()}}class be extends Re{static getName(){return"RemoveDefinedNameAction"}getUndoCommand(){return this.createCreateDefineCommand()}getRedoCommand(){return this.createRemoveDefineCommand()}}class Ie extends _e{static getName(){return"ModifyDefinedNameAction"}constructor(e){super(),[this.oldName,this.newName]=e.name,[this.oldValue,this.newValue]=e.value,this.scope=e.scope}getUndoCommand(){return i.createModifyDefineCommand(this.newName,{name:this.oldName,value:this.oldValue},this.scope)}getRedoCommand(){return i.createModifyDefineCommand(this.oldName,{name:this.newName,value:this.newValue},this.scope)}dumpArgs(){return[{name:[this.oldName,this.newName],value:[this.oldValue,this.newValue]},this.scope]}}class Ae extends c{constructor(e,t,r,n,i){super(e),this.dim=t,this.start=r.sec[0].start,this.amount1=r.sec[0].amount,this.amount2=r.sec[1].amount,this.isBackward=r.isBackward,this.data=n,this.collectedData=i}getUndoCommand(){return i.createMoveCommand(this.sheetId,this.dim,this.start,this.amount2,this.amount1,!this.isBackward,this.collectedData)}getRedoCommand(){return i.createMoveCommand(this.sheetId,this.dim,this.start,this.amount1,this.amount2,this.isBackward)}_toData(){return i.createMoveCommand(this.sheetId,this.dim,this.start,this.amount1,this.amount2,this.isBackward,this.data)}dumpArgs(){return[this.sheetId,(0,a.createMoveArg)(this.start,this.amount1,this.amount2,this.isBackward),this.data,this.collectedData]}}class Te extends Ae{static getName(){return"MoveRowAction"}constructor(e,t,r,n){super(e,"row",t,r,n)}}class Ee extends Ae{static getName(){return"MoveColAction"}constructor(e,t,r,n){super(e,"col",t,r,n)}}class Me extends c{static getName(){return"MoveFormulaRangeAction"}constructor(e,t,r,n,i,o){super(e),this.srcSheetId=e,this.srcRange=t,this.targetSheetId=r,this.targetRange=n,this.applyData=i,this.collectedData=o}getUndoCommand(){return i.createMoveFormlaRangeCommand(this.targetSheetId,this.targetRange,this.srcSheetId,this.srcRange,this.collectedData)}getRedoCommand(){return i.createMoveFormlaRangeCommand(this.srcSheetId,this.srcRange,this.targetSheetId,this.targetRange)}_toData(){return i.createMoveFormlaRangeCommand(this.srcSheetId,this.srcRange,this.targetSheetId,this.targetRange,this.applyData)}dumpArgs(){return[this.sheetId,this.srcRange,this.targetSheetId,this.targetRange,this.applyData,this.collectedData]}}class ke extends c{constructor(e,t){super(e),this.json=t}createRemoveInternalLinkCommand(){return i.createRemoveInternalLinkCommand(this.sheetId,this.json.id)}createHyperlinkCommand(){return i.createAddHyperlinkCommand(this.sheetId,this.json)}dumpArgs(){return[this.sheetId,this.json]}}class Ne extends ke{static getName(){return"AddInternalLinkAction"}getUndoCommand(){return this.createRemoveInternalLinkCommand()}getRedoCommand(){return this.createHyperlinkCommand()}}class Oe extends c{static getName(){return"UpdateInternalLinkAction"}constructor(e,t,r){super(e),this.json=t,this.oldJson=r}getUndoCommand(){return i.createUpdateHyperlinkCommand(this.sheetId,this.oldJson)}getRedoCommand(){return i.createUpdateHyperlinkCommand(this.sheetId,this.json)}dumpArgs(){return[this.sheetId,this.json,this.oldJson]}}class De extends ke{static getName(){return"RemoveInternalLinkAction"}getUndoCommand(){return this.createHyperlinkCommand()}getRedoCommand(){return this.createRemoveInternalLinkCommand()}}class Le extends s{needInstance(){return!1}}class Pe extends Le{constructor(e){super(),this.rule=e}createRemoveRuleCommand(){return i.createRemoveRuleCommand(this.rule.ruleId)}createCreateRuleCommand(){return i.createCreateRuleCommand(this.rule)}dumpArgs(){return[this.rule]}}class Fe extends Pe{static getName(){return"CreateRuleAction"}getUndoCommand(){return this.createRemoveRuleCommand()}getRedoCommand(){return this.createCreateRuleCommand()}}class Be extends Le{static getName(){return"UpdateRuleAction"}constructor(e,t,r){super(),this.ruleId=e,this.originalProps=t,this.props=r}getUndoCommand(){return i.createUpdateRuleCommand(this.ruleId,this.originalProps)}getRedoCommand(){return i.createUpdateRuleCommand(this.ruleId,this.props)}dumpArgs(){return[this.ruleId,this.originalProps,this.props]}}class Ve extends Pe{static getName(){return"RemoveRuleAction"}getUndoCommand(){return this.createCreateRuleCommand()}getRedoCommand(){return this.createRemoveRuleCommand()}}class He extends s{pushToQueue(){return!1}getUndoCommand(){throw new Error("cant undo")}getRedoCommand(){throw new Error("cant redo")}}class Ue extends He{static getName(){return"UpdateExternalLinks"}constructor(e){super(),this.entry=e}_toData(){return i.createUpdateExternalLinksCommand(this.entry)}dumpArgs(){return[this.entry]}}class ze extends He{static getName(){return"RemoveExternalLinks"}constructor(e){super(),this.linkIds=e}_toData(){return i.createRemoveExternalLinksCommand(this.linkIds)}dumpArgs(){return[this.linkIds]}}const We=[h,f,p,g,m,y,C,x,w,_,S,b,A,T,E,M,k,N,O,D,L,P,F,V,H,U,z,W,G,j,X,$,K,J,Z,ee,te,re,ie,oe,ae,se,le,he,de,fe,ge,ve,ye,pe,xe,we,Te,Ee,Me,Ne,Oe,De,l,Se,be,Ie,Fe,Be,Ve,Ue,ze].reduce(((e,t)=>(e[t.getName()]=t,e)),{})},98274:(e,t,r)=>{"use strict";r.d(t,{default:()=>c});var n=r(96687),i=r(4263),o=r(47970),a=r(58835),s=r(84499),l=r(15043),u=r(85031);class c{constructor(e){this.actions=[],this.skip=!0,this.workbook=e,this.listen(e)}accumulate(e){return this.actions=[],this.skip=!1,e(),this.skip=!0,this.actions.map((e=>this.addHistoryTrackingInfo(e))),this.actions.length>1?new l.CompoundedAction(this.actions):this.actions[0]}getUndoneActions(){return this.actions}clear(){this.actions=[],this.skip=!0}listen(e){this.listenWorkbook(e),this.listenWorkbookController(e.getController())}listenWorkbook(e){this.addHook(e,"afterChange",this.afterChange),this.addHook(e,"afterRowResize",this.afterRowResize),this.addHook(e,"afterColumnResize",this.afterColumnResize),this.addHook(e,"afterCreateRow",this.afterCreateRow),this.addHook(e,"beforeRemoveRow",this.beforeRemoveRow),this.addHook(e,"afterCreateCol",this.afterCreateCol),this.addHook(e,"beforeRemoveCol",this.beforeRemoveCol),this.addHook(e,"afterMergeCells",this.afterMergeCells),this.addHook(e,"afterUnmergeCells",this.afterUnmergeCells),this.addHook(e,"afterFormatChange",this.afterFormatChange),this.addHook(e,"afterFontChange",this.afterFontChange),this.addHook(e,"afterFillChange",this.afterFillChange),this.addHook(e,"afterAlignmentChange",this.afterAlignmentChange),this.addHook(e,"afterBorderChange",this.afterBorderChange),this.addHook(e,"afterFixedRow",this.afterFixedRow),this.addHook(e,"afterFixedCol",this.afterFixedCol),this.addHook(e,"afterHideRows",this.afterHideRows),this.addHook(e,"afterShowRows",this.afterShowRows),this.addHook(e,"afterHideCols",this.afterHideCols),this.addHook(e,"afterShowCols",this.afterShowCols),this.addHook(e,"afterSort",this.afterSort),this.addHook(e,"afterNoteChange",this.afterNoteChange),this.addHook(e,"afterCreateFilter",this.afterCreateFilter),this.addHook(e,"afterEnableFilter",this.afterEnableFilter),this.addHook(e,"afterDisableFilter",this.afterDisableFilter),this.addHook(e,"afterSetFilter",this.afterSetFilter),this.addHook(e,"afterUpdateFilterRange",this.afterUpdateFilterRange),this.addHook(e,"afterCreateFilterView",this.afterCreateFilterView),this.addHook(e,"afterEnableFilterView",this.afterEnableFilterView),this.addHook(e,"afterDisableFilterView",this.afterDisableFilterView),this.addHook(e,"afterUpdateFilterViewRange",this.afterUpdateFilterViewRange),this.addHook(e,"afterUpdateFilterViewName",this.afterUpdateFilterViewName),this.addHook(e,"afterSetFilterViewCondition",this.afterSetFilterViewCondition),this.addHook(e,"afterActiveFilterChange",this.afterActiveFilterChange),this.addHook(e,"afterCreateValidation",this.afterCreateValidation),this.addHook(e,"afterRemoveValidation",this.afterRemoveValidation),this.addHook(e,"afterCreateConditionalFormat",this.afterCreateConditionalFormat),this.addHook(e,"afterRemoveConditionalFormat",this.afterRemoveConditionalFormat),this.addHook(e,"afterUpdateCfRanges",this.afterUpdateCfRanges),this.addHook(e,"afterInsertImage",this.afterInsertImage),this.addHook(e,"afterRemoveImage",this.afterRemoveImage),this.addHook(e,"afterResizeImage",this.afterResizeImage),this.addHook(e,"afterInsertChart",this.afterInsertChart),this.addHook(e,"afterRemoveChart",this.afterRemoveChart),this.addHook(e,"afterResizeChart",this.afterResizeChart),this.addHook(e,"afterAdjustChart",this.afterAdjustChart),this.addHook(e,"afterSetChartConfig",this.afterSetChartConfig),this.addHook(e,"afterRowStyleChange",this.afterRowStyleChange),this.addHook(e,"afterColStyleChange",this.afterColStyleChange),this.addHook(e,"afterGlobalStyleChange",this.afterGlobalStyleChange),this.addHook(e,"afterQuotePrefixChange",this.afterQuotePrefixChange),this.addHook(e,"afterMoveRow",this.afterMoveRow),this.addHook(e,"afterMoveCol",this.afterMoveCol),this.addHook(e,"afterMoveFormulaRange",this.afterMoveFormulaRange),this.addHook(e,"afterAddInternalLink",this.afterAddInternalLink),this.addHook(e,"afterUpdateInternalLink",this.afterUpdateInternalLink),this.addHook(e,"afterRemoveInternalLink",this.afterRemoveInternalLink)}listenWorkbookController(e){this.addWorkbookHook(e,"afterCreateDefinedName",this.afterCreateDefinedName),this.addWorkbookHook(e,"afterRemoveDefinedName",this.afterRemoveDefinedName),this.addWorkbookHook(e,"afterModifyDefinedName",this.afterModifyDefinedName),this.addWorkbookHook(e,"createRule",this.createRule),this.addWorkbookHook(e,"updateRule",this.updateRule),this.addWorkbookHook(e,"removeRule",this.removeRule),this.addWorkbookHook(e,"deleteWorksheet",this.deleteWorksheet),this.addWorkbookHook(e,"undeleteWorksheet",this.undeleteWorksheet),this.addWorkbookHook(e,"reorderWorksheet",this.reorderWorksheet),this.addWorkbookHook(e,"renameWorksheet",this.renameWorksheet),this.addWorkbookHook(e,"setWorksheetHidden",this.setWorksheetHidden),this.addWorkbookHook(e,"setWorksheetColor",this.setWorksheetColor),this.addWorkbookHook(e,"afterCreateComment",this.afterCreateComment),this.addWorkbookHook(e,"afterReplyComment",this.afterReplyComment),this.addWorkbookHook(e,"afterResolveComment",this.afterResolveComment),this.addWorkbookHook(e,"afterReopenComment",this.afterReopenComment),this.addWorkbookHook(e,"afterEditComment",this.afterEditComment),this.addWorkbookHook(e,"afterPasteComment",this.afterPasteComment),this.addWorkbookHook(e,"afterClearComment",this.afterClearComment),this.addWorkbookHook(e,"afterUpdateExternalLinks",this.afterUpdateExternalLinks),this.addWorkbookHook(e,"afterRemoveExternalLinks",this.afterRemoveExternalLinks)}addHook(e,t,r){const n=this;e.hooks.add(t,(function(){if(n.skip)return;for(var e=arguments.length,t=new Array(e),i=0;i[e[0],e[1],(0,a.isRichTextValue)(e[2])?e[2].toJSON():e[2],(0,a.isRichTextValue)(e[3])?e[3].toJSON():e[3]]));return 0===i.length?null:new l.ChangeAction(e.sheetId,i,[],[])}afterRowResize(e,t,r,i,o,a){return a===n.SourceType.InsertedData||e.isReadonly()?null:new l.ResizeRowAction(e.sheetId,t,r,i,o)}afterColumnResize(e,t,r,i,o,a){return a===n.SourceType.InsertedData||e.isReadonly()?null:new l.ResizeColumnAction(e.sheetId,t,r,i,o)}afterCreateRow(e,t,r,n,i,o){return i?null:new l.CreateRowAction(e.sheetId,t,r,n,o)}afterCreateCol(e,t,r,n,i,o){return i?null:new l.CreateColumnAction(e.sheetId,t,r,n,o)}beforeRemoveRow(e,t,r){const n={row:t,col:0},i={row:t+r-1,col:e.countCols()-1},o=e.getPlugin("synoAutofill").getFormat(n,i,(()=>!1)),a=[];e.runHooks("collectRemovedRowInfo",a,t,r);const s=e.getPlugin("synoFormula"),u=s.getCrossInfo();return s.removeCrossInfo(),new l.RemoveRowAction(e.sheetId,t,r,{format:h(o,t,0),changes:f(e,n,i),nfRefs:[],nfs:[],notes:d(e,n,i),info:a,crossInfo:u,hyperlinks:e.getHyperlinkModel().getHyperlinksByDim("row",n.row,i.row),define:e.getWorkbook().getController().nameController.collectRemovedInfo("row",t,r)})}beforeRemoveCol(e,t,r){const n={row:0,col:t},i={row:e.countRows()-1,col:t+r-1},o=e.getPlugin("synoAutofill").getFormat(n,i,(()=>!1)),a=[];e.runHooks("collectRemovedColInfo",a,t,r);const s=e.getPlugin("synoFormula"),u=s.getCrossInfo();return s.removeCrossInfo(),new l.RemoveColumnAction(e.sheetId,t,r,{format:h(o,0,t),changes:f(e,n,i),nfRefs:[],nfs:[],notes:d(e,n,i),info:a,crossInfo:u,hyperlinks:e.getHyperlinkModel().getHyperlinksByDim("col",n.col,i.col),define:e.getWorkbook().getController().nameController.collectRemovedInfo("col",t,r)})}afterMergeCells(e,t,r){return[n.SourceType.InsertedData].includes(r)?null:new l.MergeCellAction(e.sheetId,t.toArray())}afterUnmergeCells(e,t,r){return[n.SourceType.InsertedData].includes(r)?null:new l.UnmergeCellAction(e.sheetId,t.toArray())}afterFormatChange(e,t,r,i){return-1<[n.SourceType.InsertedData].indexOf(i)?null:new l.StyleChangeAction(e.sheetId,"Format",t,r)}afterFontChange(e,t,r,i){return-1<[n.SourceType.InsertedData].indexOf(i)?null:new l.StyleChangeAction(e.sheetId,"Font",t,r)}afterFillChange(e,t,r,i){return-1<[n.SourceType.InsertedData].indexOf(i)?null:new l.StyleChangeAction(e.sheetId,"Fill",t,r)}afterAlignmentChange(e,t,r,i){return-1<[n.SourceType.InsertedData].indexOf(i)?null:new l.StyleChangeAction(e.sheetId,"Alignment",t,r)}afterBorderChange(e,t,r,i){return-1<[n.SourceType.Alter,n.SourceType.InsertedData].indexOf(i)?null:new l.StyleChangeAction(e.sheetId,"Border",t,r)}afterFixedRow(e,t,r){return new l.FixedRowAction(e.sheetId,t,r)}afterFixedCol(e,t,r){return new l.FixedColAction(e.sheetId,t,r)}afterHideRows(e,t,r,i){return i===n.SourceType.InsertedData?null:new l.HideRowsAction(e.sheetId,t,r)}afterShowRows(e,t,r){return new l.ShowRowsAction(e.sheetId,t,r)}afterHideCols(e,t,r,i){return i===n.SourceType.InsertedData?null:new l.HideColsAction(e.sheetId,t,r)}afterShowCols(e,t,r){return new l.ShowColsAction(e.sheetId,t,r)}afterSort(e,t,r,n,i){return new l.SortAction(e.sheetId,t,r.toArray(),n,i)}afterNoteChange(e,t,r){return-1<[n.SourceType.InsertedData].indexOf(r)?null:new l.NoteChangeAction(e.sheetId,t)}afterCreateFilter(e,t,r){return new l.CreateFilterAction(e.sheetId,t.toArray(),r)}afterEnableFilter(e,t,r){return new l.EnableFilterAction(e.sheetId,t,r)}afterDisableFilter(e,t,r){return new l.DisableFilterAction(e.sheetId,t,r)}afterSetFilter(e,t,r,n,i,o){return new l.SetFilterAction(e.sheetId,t,r,n,i,o)}afterUpdateFilterRange(e,t,r,n,i,o){return new l.UpdateFilterRangeAction(e.sheetId,t,r?.toArray(),n?.toArray(),i,o)}afterCreateFilterView(e,t,r,n){return new l.CreateFilterViewAction(e.sheetId,t,r.toArray(),n)}afterEnableFilterView(e,t){return new l.EnableFilterViewAction(e.sheetId,t)}afterDisableFilterView(e,t){return new l.DisableFilterViewAction(e.sheetId,t)}afterSetFilterViewCondition(e,t,r,n,i){return new l.SetFilterViewConditionAction(e.sheetId,t,r,n,i)}afterActiveFilterChange(e,t,r){return new l.SetActiveFilterViewAction(e.sheetId,t,r)}afterUpdateFilterViewRange(e,t,r,n,i,o){return new l.UpdateFilterViewRangeAction(e.sheetId,t,r.toArray(),n.toArray(),i,o)}afterUpdateFilterViewName(e,t,r,n){return new l.UpdateFilterViewNameAction(e.sheetId,t,r,n)}afterCreateValidation(e,t,r){return new l.CreateValidAction(e.sheetId,t,i.default.toLabel(r))}afterRemoveValidation(e,t,r){return new l.RemoveValidAction(e.sheetId,t,i.default.toLabel(r))}afterCreateConditionalFormat(e,t,r){return new l.CreateCfAction(e.sheetId,t,r)}afterRemoveConditionalFormat(e,t,r,n){return void 0===r||-1===n?null:new l.RemoveCfAction(e.sheetId,r,n)}afterUpdateCfRanges(e,t,r,n){return new l.UpdateCfRangesAction(e.sheetId,t,r,n)}afterInsertImage(e,t,r){return new l.InsertImageAction(e.sheetId,t,r)}afterRemoveImage(e,t,r){return new l.RemoveImageAction(e.sheetId,t,r)}afterResizeImage(e,t,r,n){return(0,o.isEqualDrawingPosition)(r,n)?null:new l.ResizeImageAction(e.sheetId,t,r,n)}afterInsertChart(e,t,r,n){return new l.InsertChartAction(e.sheetId,t,r,n)}afterRemoveChart(e,t,r,n){return new l.RemoveChartAction(e.sheetId,t,r,n)}afterResizeChart(e,t,r,n){return(0,o.isEqualDrawingPosition)(r,n)?null:new l.ResizeChartAction(e.sheetId,t,r,n)}afterAdjustChart(e,t,r,n){return new l.AdjustChartAction(e.sheetId,t,r,n)}afterSetChartConfig(e,t,r,n,i){return new l.SetChartConfigAction(e.sheetId,t,r,n,i)}afterRowStyleChange(e,t,r,n,i,o){return new l.DimensionStyleChangeAction(e.sheetId,"row",t,r,n,i.cellChanges)}afterColStyleChange(e,t,r,n,i,o){return new l.DimensionStyleChangeAction(e.sheetId,"col",t,r,n,i.cellChanges)}afterGlobalStyleChange(e,t,r,n,i,o){return new l.GlobalStyleChangeAction(e.sheetId,t,r,n,i.rowChanges,i.colChanges,i.cellChanges)}afterQuotePrefixChange(e,t,r){return new l.StyleChangeAction(e.sheetId,"QuotePrefix",t,r)}afterCreateDefinedName(e,t,r){return new l.CreateDefinedNameAction(e,t,r)}afterRemoveDefinedName(e,t,r){return new l.RemoveDefinedNameAction(e,t,r)}afterModifyDefinedName(e){return new l.ModifyDefinedNameAction(e)}afterCreateComment(e){return new l.CreateCommentAction(e)}afterReplyComment(e){return new l.ReplyCommentAction(e)}afterResolveComment(e){return new l.ResolveCommentAction(e)}afterReopenComment(e){return new l.ReopenCommentAction(e)}afterEditComment(e){return new l.EditCommentAction(e)}afterPasteComment(e){return new l.PasteCommentAction(e)}afterClearComment(e){return new l.ClearCommentAction(e)}afterUpdateExternalLinks(e){return new l.UpdateExternalLinksAction(e)}afterRemoveExternalLinks(e){return new l.RemoveExternalLinksAction(e)}afterMoveRow(e,t,r,n){return new l.MoveRowAction(e.sheetId,t,r,n)}afterMoveCol(e,t,r,n){return new l.MoveColAction(e.sheetId,t,r,n)}afterMoveFormulaRange(e,t,r,n,i,o){return new l.MoveFormulaRangeAction(e.sheetId,t.toArray(),r,n.toArray(),i,o)}afterAddInternalLink(e,t){return new l.AddInternalLinkAction(e.sheetId,t)}afterUpdateInternalLink(e,t,r){return new l.UpdateInternalLinkAction(e.sheetId,t,r)}afterRemoveInternalLink(e,t){return new l.RemoveInternalLinkAction(e.sheetId,t)}createRule(e){return new l.CreateRuleAction(e)}updateRule(e,t,r){return new l.UpdateRuleAction(e,t,r)}removeRule(e){return new l.RemoveRuleAction(e.toJSON())}deleteWorksheet(e,t,r,n){return new u.DeleteWorksheetAction(e,t,r,n)}undeleteWorksheet(e,t,r,n){return new u.UndeleteWorksheetAction(e,t,r,n)}reorderWorksheet(e,t){return new u.SetWorksheetOrderAction(e,t)}renameWorksheet(e,t,r){return new u.RenameWorksheetAction(e,t,r)}setWorksheetHidden(e,t){return new u.SetWorksheetHiddenAction(e,t)}setWorksheetColor(e,t,r){return new u.SetWorksheetColorAction(e,t,r)}addHistoryTrackingInfo(e){(e instanceof l.ChangeAction||e instanceof l.CreateRowAction||e instanceof l.CreateColumnAction)&&this.addNumberFormatToChanges(e)}addNumberFormatToChanges(e){const t=this.workbook.getSheetById(e.sheetId);t&&e.fillNumberFormats(((e,r,n)=>{const i=new Map;r.length=0,n.length=0;for(const o of e){const[e,a]=o,s=t.getComputedCellStyle(e,a).getNumberFormat();if(!s||s.isDefault()){r.push(0);continue}const l=s.getIndex();let u=i.get(l);void 0===u&&(u=n.push(s.fc||""),i.set(l,u)),r.push(u)}}))}}function h(e,t,r){const n=["font","fill","alignment"],i={font:[],fill:[],alignment:[],border:[],numberFormat:[],quotePrefix:[]};for(let o=0;o!1)),i=[];for(let e=t.row;e<=r.row;e++)for(let o=t.col;o<=r.col;o++){const r=n[e-t.row][o-t.col];r&&i.push([e,o,r])}return i}function f(e,t,r){const n=[];for(let i=t.row;i<=r.row;i++)for(let o=t.col;o<=r.col;o++){const t=e.getDataAtCell(i,o);(0,s.isEmptyValue)(t)||n.push([i,o,(0,a.isRichTextValue)(t)?t.toJSON():t])}return n}},65254:(e,t,r)=>{"use strict";r.d(t,{deserializeAction:()=>a});var n=r(15043),i=r(85031),o=r(54770);function a(e){let{name:t,args:r}=e;if(!Array.isArray(r))return null;const s=n.ACTION_MAP[t]||i.WORKSHEETACTION_MAP[t];return s===n.CompoundedAction?new s(r[0].map(a).filter(o.isNonNull)):new s(...r)}},20404:(e,t,r)=>{"use strict";r.d(t,{default:()=>u});var n=r(15043),i=r(65254),o=r(73321),a=r(54770),s=r(3521),l=r(64145);const u=class{constructor(){this.doneActions=[],this.undoneActions=[],this.MAX_QUEUE_SIZE=100}async execCommand(e){const t=await o.default.getDataBridge().execCommand(e);if(t)return t.needSync()&&s.default.getTransport().sendCommand(t),t}async undo(e){if(!this.isUndoAvailable())return;const t=this.doneActions.pop();if(t){if(t.needInstance()){if(!this.hasInstance(t))return;o.default.getUIBridge().onBeforeUndo(t.sheetId)}if(t.needLockUI()&&o.default.getUIBridge().onLockUI(),t.needSync()&&!await this.validateUndo(t))o.default.getUIBridge().onAlert(l.default.PROTECTION_REJECT);else{const e=await this.execCommand(t.getUndoCommand());e&&(e.setSelections(t.getSelections()),this.undoneActions.push(e))}o.default.getUIBridge().onAfterUndo(t),o.default.getUIBridge().onAfterDoneQueueChange(),o.default.getUIBridge().onActionDone({resetCopySelection:!0}),t.needLockUI()&&o.default.getUIBridge().onReleaseUI()}}async redo(e){if(!this.isRedoAvailable())return;const t=this.undoneActions.pop();if(t){if(t.needInstance()){if(!this.hasInstance(t))return;o.default.getUIBridge().onBeforeRedo(t.sheetId)}if(t.needLockUI()&&o.default.getUIBridge().onLockUI(),t.needSync()&&!await this.validateUndo(t))o.default.getUIBridge().onAlert(l.default.PROTECTION_REJECT);else{const e=await this.execCommand(t.getUndoCommand());e&&(e.setSelections(t.getSelections()),this.doneActions.push(e))}o.default.getUIBridge().onAfterRedo(t),o.default.getUIBridge().onAfterDoneQueueChange(),o.default.getUIBridge().onActionDone({resetCopySelection:!0}),t.needLockUI()&&o.default.getUIBridge().onReleaseUI()}}done(e){e.pushToQueue()&&(this.doneActions.push(e),this.checkUndoLmit(),this.undoneActions.length=0,o.default.getUIBridge().onAfterDoneQueueChange())}isUndoAvailable(){return this.doneActions.length>0}isRedoAvailable(){return this.undoneActions.length>0}checkUndoLmit(){this.doneActions.length>this.MAX_QUEUE_SIZE&&this.doneActions.shift()}getDoneActionLength(){return this.doneActions.length}clear(){this.doneActions.length=0,this.undoneActions.length=0,o.default.getUIBridge().onAfterDoneQueueChange()}hasInstance(e){const t=o.default.getDataBridge().getWorkbook();if(e instanceof n.CompoundedAction){for(const r of e.iterateActions())if(r.needInstance()){const e=t.hasSheet(r.sheetId);if(e)return e}return!!t.getCurrentSheet()}return t.hasSheet(e.sheetId)}async recoverCommands(e){this.undoneActions=e.map(i.deserializeAction).filter(a.isNonNull).reverse();try{for(;this.isRedoAvailable();)await this.redo(!1)}catch(e){}}async validateUndo(e){const{uid:t,gids:r,canOrganize:n}=o.default.getUIBridge().getUserInfo();return n||await o.default.getDataBridge().checkCommand(e.getUndoCommand(),t,r,n)}}},85031:(e,t,r)=>{"use strict";r.d(t,{DeleteWorksheetAction:()=>l,RPCAction:()=>a,RenameWorksheetAction:()=>h,SetWorksheetColorAction:()=>f,SetWorksheetHiddenAction:()=>d,SetWorksheetOrderAction:()=>c,UndeleteWorksheetAction:()=>u,WORKSHEETACTION_MAP:()=>g});var n=r(15043),i=r(5501);class o extends n.Action{constructor(e){super(),this.sheetId=e}needLockUI(){return!0}}class a extends n.Action{constructor(e){super(),this.payload=e}needInstance(){return!1}getUndoCommand(){throw new Error("cant undo")}getRedoCommand(){throw new Error("cant redo")}_toData(){return this.payload}dumpArgs(){throw new Error("RPCAction should not dump")}}class s extends o{constructor(e,t,r,n){super(e),this.pos=t,this.info=r,this.content=n}createUndeleteWorksheetCommand(){return i.createUndeleteWorksheetCommand(this.sheetId,this.pos,this.info,this.content)}createDeleteWorksheetCommand(){return i.createDeleteWorksheetCommand(this.sheetId,!1)}needInstance(){return!1}dumpArgs(){return[this.sheetId,this.pos,this.info,this.content]}}class l extends s{static getName(){return"DeleteWorksheetAction"}getUndoCommand(){return this.createUndeleteWorksheetCommand()}getRedoCommand(){return this.createDeleteWorksheetCommand()}}class u extends s{static getName(){return"UndeleteWorksheetAction"}getUndoCommand(){return this.createDeleteWorksheetCommand()}getRedoCommand(){return this.createUndeleteWorksheetCommand()}}class c extends n.Action{static getName(){return"SetWorksheetOrderAction"}constructor(e,t){super(),this.oldOrder=e,this.newOrder=t}getUndoCommand(){return i.createReorderWorksheetCommand(this.oldOrder)}getRedoCommand(){return i.createReorderWorksheetCommand(this.newOrder)}needInstance(){return!1}dumpArgs(){return[this.oldOrder,this.newOrder]}}class h extends o{static getName(){return"RenameWorksheetAction"}constructor(e,t,r){super(e),this.oldTitle=t,this.newTitle=r}getUndoCommand(){return i.createRenameWorksheetCommand(this.sheetId,this.oldTitle)}getRedoCommand(){return i.createRenameWorksheetCommand(this.sheetId,this.newTitle)}dumpArgs(){return[this.sheetId,this.oldTitle,this.newTitle]}}class d extends o{static getName(){return"SetWorksheetHiddenAction"}constructor(e,t){super(e),this.hidden=t}getUndoCommand(){return i.createSetWorksheetHiddenCommand(this.sheetId,!this.hidden)}getRedoCommand(){return i.createSetWorksheetHiddenCommand(this.sheetId,this.hidden)}dumpArgs(){return[this.sheetId,this.hidden]}}class f extends o{static getName(){return"SetWorksheetColorAction"}constructor(e,t,r){super(e),this.oldColor=t,this.newColor=r}getUndoCommand(){return i.createSetWorksheetColorCommand(this.sheetId,this.oldColor)}getRedoCommand(){return i.createSetWorksheetColorCommand(this.sheetId,this.newColor)}dumpArgs(){return[this.sheetId,this.oldColor,this.newColor]}}const g=[l,u,c,h,d,f].reduce(((e,t)=>(e[t.getName()]=t,e)),{})},65880:(e,t,r)=>{"use strict";r.d(t,{converter:()=>u});var n=r(85978),i=r(37873),o=r(59162),a=r(33506);const s={fromData:r(65254).deserializeAction,toData:e=>e.serialize()},l={fromData:i.SynoCellRange.fromArray,toData:e=>e.toArray()},u={action:s,range:l,refRange:{fromData:e=>(0,o.parseRange)(e),toData:e=>e.toLabel()},autofillData:{fromData:e=>(0,a.fromTransferableData)(e),toData:e=>(0,a.toTransferableData)(e)},cellData:{fromData:e=>e.formulaValue?{...e,formulaValue:(0,n.deserializeFormulaValue)(e.formulaValue)}:e,toData:e=>e.formulaValue?{...e,formulaValue:(0,n.serializeFormulaValue)(e.formulaValue)}:e},objRange:{fromData:function(e){return{...e,range:e.range?l.fromData(e.range):null}},toData:function(e){return{...e,range:e.range?l.toData(e.range):null}}}}},84406:(e,t,r)=>{"use strict";function n(e){return"notifier"===e.data?.category}r.d(t,{isNotifierMessage:()=>n})},85978:(e,t,r)=>{"use strict";r.d(t,{Exception:()=>i.default,Parser:()=>n.default,VisibleResolveOption:()=>f.VisibleResolveOption,deserializeFormulaValue:()=>d.deserializeFormulaValue,serializeFormulaValue:()=>d.serializeFormulaValue,toFormulaString:()=>d.toFormulaString,type:()=>p,utils:()=>g});var n=r(68305),i=(r(32379),r(35821)),o=r(19303),a=r(28488),s=r(2813),l=r(81394),u=r(7996),c=r(49827),h=r(72208),d=r(69705),f=r(50039);const g=Object.assign({Comparator:o},a,u,s,l),p={date:{serialize:c.serialize,deserialize:c.deserialize},number:{toEffective:h.toEffective},error:{isError:h.isError}}},87851:(e,t,r)=>{"use strict";r.d(t,{default:()=>E});var n=r(72208),i=r(35821),o=r(50039),a=r(48961);const s=new o.ResolveOption,l=(new o.ResolveOption).assign({keepNull:!0}),u=(new o.ResolveOption).assign({keepNfId:!0});function c(e){if(!Array.isArray(e))return(0,n.isError)(e)?e:null;for(let t=0,r=e.length;t0){e[0]=e[0].resolve(t,s);const{height:r,width:n}=(0,a.getArrayDimension)(e[0],t);if(r>1||n>1)for(let r=1;r=2&&(e[1]=e[1].resolve(t,s)),e}function x(e,t){return e.length<2?e:[e[0].resolve(t,l),e[1]].concat(h(e.slice(2),t))}function w(e,t){return h(e,t,l)}function _(e,t){return p(e,t,u)}function R(e,t){return h(e,t,u)}function S(e,t,r){for(let n=e;n100,n.skipFiltered=!0,n.skipSubtotal=!0;let i=e.slice(1);for(let e=0;e1||i>1){for(let r=1;r2||n<1||(r[0]=r[0].toString(),r[1]=1===n||!1!==r[1]),r},ISDATE:m,INDEX:function(e,t){const r=p(e.slice(1),t);return r[0]=r[0]||0,r[1]=r[1]||0,[e[0]].concat(r)},SORT:A,SORTBY:A,"=":g,">":g,"<":g,">=":g,"<=":g,"<>":g,NOT:g,"+":R,"-":R},defaultResolver:h,checkerTable:{ROWS:f,COLUMNS:f,OFFSET:function(e){if(0===e.length)return;return(0,n.isError)(e.slice(1))||void 0},CHOOSE:y,SUBTOTAL:function(e){if(e.length<1)return i.default.NUM;if((0,n.isError)(e[0]))return e[0];let t;switch(e[0]%100){case 2:case 3:t=void e.slice(1);break;default:t=d(e.slice(1))}return t},SUMIF:f,AVERAGEIF:f,SUMIFS:f,AVERAGEIFS:f,MAXIFS:f,MINIFS:f,IF:y,IFS:f,COUNT:f,COUNTA:f,COUNTIF:f,COUNTIFS:f,ISBLANK:f,ISNA:f,ISERR:f,ISERROR:f,ISLOGICAL:f,ISNONTEXT:f,ISNUMBER:f,ISTEXT:f,IFERROR:f,IFNA:f,TYPE:f,MATCH:f,VLOOKUP:f,HLOOKUP:f,XLOOKUP:function(e){if(!(e.length<=4))return d(e.slice(4))},INDIRECT:function(e){const t=e.length;if(!Array.isArray(e)||t>2||t<1)return i.default.NA},ISDATE:f,INDEX:function(e){const t=d(e.slice(1));if(t)return t},"ERROR.TYPE":f},defaultChecker:d}},37136:(e,t,r)=>{"use strict";r.d(t,{checkArgumentCount:()=>o});var n=r(48513);n.syntax.IFERROR[1]+="?";const i={};function o(e,t){if(!n.syntax[e])return!0;const r=i[e]??(i[e]=function(e){const t=e.filter((e=>e.endsWith("...?"))).length,r=e.length-t;return{least:e.filter((e=>!e.endsWith("?"))).length,most:t>0?1/0:e.length,repeatableCount:t,nonRepeatableCount:r}}(n.syntax[e]));return t.length>=r.least&&t.length<=r.most&&(0===r.repeatableCount||t.slice(r.nonRepeatableCount).length%r.repeatableCount==0)}},71566:(e,t,r)=>{"use strict";r.d(t,{argumentTypeConvert:()=>O});var n=r(99613),i=r(26258);function o(e){return!!e?.repeat}function a(e){const t=i.toNumber.call(this,e);return t===n.value?e:t}function s(e){return function t(r){return null==r?r:Array.isArray(r)?r.map((e=>t.call(this,e))):e.call(this,r)}}function l(e){return{repeat:!0,converter:e}}const u=[],c=[null,l(null)],h=[null,l(null)],d=[null,null,l(null),l(null)],f=[s(i.toComplex),l(s(i.toComplex))],g=[null,l(null)];function p(e,t){return Array.from({length:t+1},((t,r)=>new Array(r).fill(e)))}const m=p(i.toNumber,6),v=p(i.toInteger,4),y=p(i.toString,2),C=p(i.toComplex,2),x=p(null,2),w={"num-int":[i.toNumber,i.toInteger],"num-num-int":[i.toNumber,i.toNumber,i.toInteger],"num-int-int":[i.toNumber,i.toInteger,i.toInteger],"num-int-int-bool":[i.toNumber,i.toInteger,i.toInteger,i.parseBool],"int-any":[i.toInteger,null],"int-int-num":[i.toInteger,i.toInteger,i.toNumber],"int-num-num":[i.toInteger,i.toNumber,i.toNumber],"num-num-bool":[i.toNumber,i.toNumber,i.parseBool],"num-num-num-bool":[i.toNumber,i.toNumber,i.toNumber,i.parseBool],"num-array-num":[i.toNumber,null,i.toNumber],"num-array-array":[i.toNumber,null,null],"array-num":[null,i.toNumber],"array-num-num":[null,null,i.toNumber],"array-num-int":[null,i.toNumber,i.toInteger],"array-int":[null,i.toInteger],"array-bool":[null,i.parseBool],"array-array-int-int":[null,null,i.toInteger,i.toInteger],"str-int":[i.toString,i.toInteger],"str-str-int":[i.toString,i.toString,i.toInteger]},_=m[1],R=x[2],S=[null,i.toInteger],b=[s(a),s(a)],I=[i.toInteger,i.toInteger,i.toNumber,i.parseBool],A=w["num-int"],T=w["num-num-bool"],E=w["num-num-bool"],M=[i.toInteger,i.toInteger,null],k=[i.toInteger,i.toInteger,null,null],N={ABS:m[1],ADDRESS:[i.toNumber,i.toNumber,i.toNumber,i.parseBool,i.toString],ACCRINT:[i.toInteger,i.toInteger,i.toInteger,i.toNumber,i.toNumber,i.toNumber,i.toNumber,null],ACOS:_,ACOSH:_,ACOT:_,ACOTH:_,AND:g,ARABIC:y[1],ASIN:_,ASINH:_,ATAN:_,ATAN2:m[2],ATANH:_,AVEDEV:c,AVERAGE:c,AVERAGEA:c,AVERAGEIF:[null,null,null],AVERAGEIFS:[null,...d],BASE:v[3],BESSELI:A,BESSELJ:A,BESSELK:A,BESSELY:A,"BETA.DIST":[i.toNumber,i.toNumber,i.toNumber,i.parseBool,i.toNumber,i.toNumber],"BETA.INV":m[5],BETADIST:m[5],BETAINV:m[5],BIN2DEC:x[1],BIN2HEX:S,BIN2OCT:S,"BINOM.DIST":I,"BINOM.INV":w["int-num-num"],BINOMDIST:I,BITAND:m[2],BITLSHIFT:w["num-int"],BITOR:m[2],BITRSHIFT:w["num-int"],BITXOR:m[2],CEILING:m[2],"CEILING.MATH":m[3],"CEILING.PRECISE":m[2],CHAR:v[1],CHIDIST:w["num-int"],CHIINV:w["num-int"],"CHISQ.DIST":[i.toNumber,i.toInteger,i.parseBool],"CHISQ.DIST.RT":w["num-int"],"CHISQ.INV":w["num-int"],"CHISQ.INV.RT":w["num-int"],"CHISQ.TEST":b,CHITEST:b,CHOOSE:[i.toInteger,null,l(null)],CLEAN:y[1],CODE:y[1],COLUMN:x[1],COLUMNS:x[1],COMBIN:v[2],COMBINA:v[2],COMPLEX:[i.toNumber,i.toNumber,null],CONCAT:[s(i.toString),l(s(i.toString))],CONCATENATE:[i.toString,l(i.toString)],CONFIDENCE:w["num-num-int"],"CONFIDENCE.NORM":w["num-num-int"],"CONFIDENCE.T":w["num-num-int"],CORREL:R,COS:_,COSH:_,COT:_,COTH:_,COUNT:h,COUNTA:h,COUNTBLANK:x[1],COUNTIF:x[2],COUNTIFS:d,COVAR:R,"COVARIANCE.P":R,"COVARIANCE.S":R,CRITBINOM:w["int-num-num"],CSC:_,CSCH:_,CUMIPMT:m[6],CUMPRINC:m[6],DATE:v[3],DATEDIF:[i.toInteger,i.toInteger,i.toString],DATEVALUE:x[1],DAY:v[1],DAYS:v[2],DAYS360:[i.toInteger,i.toInteger,i.parseBool],DB:[i.toNumber,i.toNumber,i.toNumber,i.toNumber,i.toInteger],DDB:m[5],DEC2BIN:S,DEC2HEX:S,DEC2OCT:S,DECIMAL:w["str-int"],DEGREES:m[1],DELTA:m[2],DEVSQ:c,DOLLAR:w["num-int"],DOLLARDE:w["num-int"],DOLLARFR:w["num-int"],EDATE:w["num-int"],EFFECT:w["num-int"],EOMONTH:w["num-int"],ERF:m[2],"ERF.PRECISE":m[1],ERFC:m[1],"ERFC.PRECISE":m[1],"ERROR.TYPE":x[1],EVEN:m[1],EXACT:y[2],EXP:m[1],"EXPON.DIST":T,EXPONDIST:T,FALSE:u,"F.DIST":w["num-int-int-bool"],"F.DIST.RT":w["num-int-int"],"F.INV":w["num-int-int"],"F.INV.RT":w["num-int-int"],"F.TEST":R,FACT:v[1],FACTDOUBLE:v[1],FDIST:w["num-int-int-bool"],FILTER:[null,null,null],FIND:w["str-str-int"],FINV:w["num-int-int"],FISHER:m[1],FISHERINV:m[1],FIXED:w["num-num-bool"],FLOOR:m[2],"FLOOR.MATH":m[3],"FLOOR.PRECISE":m[2],FORECAST:w["num-array-array"],FTEST:R,FV:m[5],FVSCHEDULE:[i.toNumber,null],GAMMA:m[1],"GAMMA.DIST":w["num-num-num-bool"],"GAMMA.INV":m[3],GAMMADIST:w["num-num-num-bool"],GAMMAINV:m[3],GAMMALN:m[1],"GAMMALN.PRECISE":m[1],GAUSS:m[1],GCD:c,GEOMEAN:c,GESTEP:m[2],HARMEAN:c,HEX2BIN:S,HEX2DEC:x[1],HEX2OCT:S,HLOOKUP:[null,null,i.toInteger,i.parseBool],HOUR:m[1],"HYPGEOM.DIST":[i.toInteger,i.toInteger,i.toInteger,i.toInteger,i.parseBool],HYPGEOMDIST:v[4],IF:[i.parseBool,null,null],IFERROR:x[2],IFNA:x[2],IFS:[i.parseBool,null,l(i.parseBool),l(null)],IMABS:C[1],IMAGINARY:C[1],IMARGUMENT:C[1],IMCONJUGATE:C[1],IMCOS:C[1],IMCOSH:C[1],IMCOT:C[1],IMCSC:C[1],IMCSCH:C[1],IMDIV:C[2],IMEXP:C[1],IMLN:C[1],IMLOG10:C[1],IMLOG2:C[1],IMPOWER:[i.toComplex,i.toNumber],IMPRODUCT:f,IMREAL:C[1],IMSEC:C[1],IMSECH:C[1],IMSIN:C[1],IMSINH:C[1],IMSQRT:C[1],IMSUB:C[2],IMSUM:f,IMTAN:C[1],INDEX:[null,i.toInteger,i.toInteger,i.toInteger],INDIRECT:[i.toString,i.parseBool],INT:m[1],INTERCEPT:R,IPMT:m[6],IRR:w["array-num"],ISBLANK:x[1],ISDATE:x[1],ISERR:x[1],ISERROR:x[1],ISEVEN:x[1],ISLOGICAL:x[1],ISNA:x[1],ISODD:x[1],ISNONTEXT:x[1],ISNUMBER:x[1],"ISO.CEILING":m[2],ISOWEEKNUM:v[1],ISPMT:m[4],ISTEXT:x[1],KURT:c,LARGE:w["array-int"],LCM:c,LEFT:w["str-int"],LEN:y[1],LN:m[1],LOG:m[2],LOG10:m[1],LOGINV:m[3],"LOGNORM.DIST":w["num-num-num-bool"],"LOGNORM.INV":m[3],LOGNORMDIST:m[3],LOWER:y[1],MATCH:[null,null,i.toNumber],MAX:c,MAXA:c,MAXIFS:[null,...d],MEDIAN:c,MID:[i.toString,i.toInteger,i.toInteger],MIN:c,MINA:c,MINIFS:[null,...d],MINUTE:m[1],MIRR:w["array-num-num"],MOD:m[2],MODE:c,"MODE.SNGL":c,MONTH:m[1],MROUND:m[2],MULTINOMIAL:h,N:x[1],NA:u,"NEGBINOM.DIST":[i.toInteger,i.toInteger,i.toNumber,i.parseBool],NEGBINOMDIST:w["int-int-num"],NETWORKDAYS:M,"NETWORKDAYS.INTL":k,NOMINAL:w["num-int"],"NORM.DIST":w["num-num-num-bool"],"NORM.INV":m[3],"NORM.S.DIST":[i.toNumber,i.parseBool],"NORM.S.INV":m[1],NORMDIST:w["num-num-num-bool"],NORMINV:m[3],NORMSDIST:m[1],NORMSINV:m[1],NOT:[i.parseBool],NOW:u,NPER:m[5],NPV:[i.toNumber,null,l(null)],OCT2BIN:S,OCT2DEC:x[1],OCT2HEX:S,ODD:m[1],OFFSET:[null,i.toInteger,i.toInteger,i.toInteger,i.toInteger],OR:g,PDURATION:m[3],PEARSON:R,PERCENTILE:w["array-num"],"PERCENTILE.EXC":w["array-num"],"PERCENTILE.INC":w["array-num"],PERCENTRANK:w["array-num-int"],"PERCENTRANK.EXC":w["array-num-int"],"PERCENTRANK.INC":w["array-num-int"],PERMUT:v[2],PERMUTATIONA:v[2],PHI:m[1],PI:u,PMT:m[5],POISSON:E,"POISSON.DIST":E,POWER:m[2],PPMT:m[5],PROB:[null,null,i.toNumber,i.toNumber],PRODUCT:h,PROPER:y[1],PV:m[5],QUARTILE:w["array-int"],"QUARTILE.EXC":w["array-int"],"QUARTILE.INC":w["array-int"],QUOTIENT:m[2],RADIANS:m[1],RAND:u,RANDARRAY:[i.toInteger,i.toInteger,i.toNumber,i.toNumber,i.parseBool],RANDBETWEEN:m[2],RANK:w["num-array-num"],"RANK.AVG":w["num-array-num"],"RANK.EQ":w["num-array-num"],RATE:[i.toInteger,i.toNumber,i.toNumber,i.toNumber,i.toNumber,i.toNumber],REPLACE:[i.toString,i.toInteger,i.toInteger,i.toString],REPT:w["str-int"],RIGHT:w["str-int"],ROMAN:[i.toNumber,null],ROUND:w["num-int"],ROUNDDOWN:w["num-int"],ROUNDUP:w["num-int"],ROW:x[1],ROWS:x[1],RRI:m[3],RSQ:R,SEARCH:w["str-str-int"],SEC:_,SECH:_,SECOND:m[1],SERIESSUM:[i.toNumber,i.toNumber,i.toNumber,s(i.toNumber)],SEQUENCE:[i.toInteger,i.toInteger,i.toNumber,i.toNumber],SIGN:m[1],SIN:_,SINH:_,SKEW:c,"SKEW.P":c,SLN:m[3],SLOPE:R,SMALL:w["array-int"],SORT:[null,i.toInteger,i.toInteger,i.parseBool],SORTBY:[null,null,i.toInteger,l(null),l(i.toInteger)],SQRT:m[1],SQRTPI:m[1],STANDARDIZE:m[3],STDEV:c,"STDEV.P":c,"STDEV.S":c,STDEVA:c,STDEVP:c,STDEVPA:c,STEYX:R,SUBSTITUTE:[i.toString,i.toString,i.toString,i.toInteger],SUBTOTAL:[null,null,l(null)],SUM:h,SUMIF:[null,i.toString,null],SUMIFS:[null,...d],SUMPRODUCT:h,SUMSQ:h,SUMX2MY2:R,SUMX2PY2:R,SUMXMY2:R,SYD:m[4],T:x[1],"T.DIST":[i.toNumber,i.toInteger,i.parseBool],"T.DIST.2T":w["num-int"],"T.DIST.RT":w["num-int"],"T.INV":w["num-int"],"T.INV.2T":w["num-int"],"T.TEST":w["array-array-int-int"],TAN:_,TANH:_,TBILLEQ:w["int-int-num"],TBILLPRICE:w["int-int-num"],TBILLYIELD:w["int-int-num"],TDIST:w["num-int-int"],TEXT:[null,i.toString],TIME:v[3],TIMEVALUE:x[1],TINV:w["num-int"],TODAY:u,TRANSPOSE:x[1],TRIM:y[1],TRIMMEAN:[s(a),i.toNumber],TRUE:u,TRUNC:w["num-int"],TTEST:w["array-array-int-int"],TYPE:x[1],UNICHAR:v[1],UNICODE:y[1],UNIQUE:[null,i.parseBool,i.parseBool],UPPER:y[1],VALUE:y[1],VAR:c,"VAR.P":c,"VAR.S":c,VARA:c,VARP:c,VARPA:c,VLOOKUP:[null,null,i.toInteger,i.parseBool],WEEKDAY:w["int-any"],WEEKNUM:w["int-any"],WEIBULL:w["num-num-num-bool"],"WEIBULL.DIST":w["num-num-num-bool"],WORKDAY:M,"WORKDAY.INTL":k,XIRR:[null,null,i.toNumber],XLOOKUP:[null,null,null,null,i.toInteger,i.toInteger],XNPV:w["num-array-array"],XOR:g,YEAR:m[1],YEARFRAC:v[3],"Z.TEST":w["array-num-num"],ZTEST:w["array-num-num"],HYPERLINK:y[2],IMPORTRANGE:y[2]};function O(e,t){const r=N[e];if(null==r)return t;const n=r.filter(o).map((e=>e.converter)),i=r.length-n.length;return t.forEach(((e,o)=>{let a=null;a=o>=i?n[(o-i)%n.length]:r[o],null!==a&&void 0!==t[o]&&(t[o]=a.call(this,t[o]))})),t}},48961:(e,t,r)=>{"use strict";r.d(t,{getArrayDimension:()=>s,getArrayHandler:()=>m,getDimensionValue:()=>w});var n=r(35821),i=r(82239),o=r(50039),a=r(51388);function s(e,t){return e instanceof i.RefExpr?e.resolveDimension(t):(e instanceof i.Expr&&(e=e.v),Array.isArray(e)?{height:e.length,width:Array.isArray(e[0])?e[0].length:1}:{height:0,width:0})}function l(e){return Array.isArray(e)?1+l(e[0]):0}function u(e){const t=l(e);let r=e,n=1,i=1;switch(t){case 0:r=[[e]];break;case 1:n=1,i=e.length,r=[e];break;case 2:n=e.length,i=e[0].length}return{value:r,dimension:t,height:n,width:i,isCell:1===n&&1===i,isRow:1===n&&i>1,isCol:n>1&&1===i,isRange:n>1&&i>1}}function c(e,t){const r=(0,a.makeSequence)(e);for(let n=e;ne.dimension>2)))return n.default.VALUE;if(r.every((e=>e.isCell)))return t(r.map((e=>e.value[0][0])));const i=r.reduce(((e,t)=>{let{height:r}=t;return Math.max(e,r)}),Number.NEGATIVE_INFINITY),o=r.reduce(((e,t)=>{let{width:r}=t;return Math.max(e,r)}),Number.NEGATIVE_INFINITY),s=r.map((e=>function(e,t,r){let{value:n,height:i,width:o,dimension:s,isRow:l,isCol:u,isCell:c}=e;if(!l&&!u&&!c)return n;l&&(r=o),u&&(t=i);const h=(0,a.make2dArray)(t,r);for(let e=0;eMath.min(e,t.length)),Number.POSITIVE_INFINITY),h=s.reduce(((e,t)=>Math.min(e,t[0].length)),Number.POSITIVE_INFINITY);for(let e=0;e=c||r>=h?n.default.NA:t(s.map((t=>t[e][r])));return l}function f(e,t,r){if(void 0===r&&(r=0),0===r)return t(e);const n=e.slice(0,r);return e=e.slice(r),d(n,(r=>t([...r,...e])))}function g(e,t,r){r=r.slice();const n=e.slice();for(;r.length>0&&r[r.length-1]>=e.length;)r.pop();for(const e of r)n[e]=[[0]];return d(n,(n=>{for(const t of r)n[t]=e[t];return t(n)}))}function p(e){return function(t,r){return g(t,r,e)}}function m(e){return h[e]||d}const v={};function y(e,t){let r=1,n=1;for(const i of e){const e=s(i,t);r=Math.max(r,e.height),n=Math.max(n,e.width)}return 1===r&&1===n?{height:0,width:0}:{height:r,width:n}}function C(e,t,r){return y(e.filter(((e,t)=>!r.includes(t))),t)}function x(e){return function(t,r){return C(t,r,e)}}function w(e,t,r){return(v[e]||y)(t,r)}[["IMPRODUCT","IMSUM","AND","OR","XOR","ROWS","COLUMNS","GCD","LCM","MULTINOMIAL","PRODUCT","SUM","SUMPRODUCT","SUMSQ","SUMX2MY2","SUMX2PY2","SUMXMY2","AVEDEV","AVERAGE","AVERAGEA","CHISQ.TEST","CHITEST","CONCAT","CORREL","COUNT","COUNTA","COUNTBLANK","COVAR","COVARIANCE.P","COVARIANCE.S","DEVSQ","F.TEST","FTEST","GEOMEAN","HARMEAN","INTERCEPT","KURT","MAX","MAXA","MEDIAN","MIN","MINA","MODE.SNGL","MODE","PEARSON","RSQ","SKEW.P","SKEW","SLOPE","STDEV.P","STDEV.S","STDEV","STDEVA","STDEVP","STDEVPA","STEYX","VAR.P","VAR.S","VAR","VARA","VARP","VARPA"],["NPV","SUBTOTAL","FORECAST"]].forEach(((e,t)=>{if(0===e.length)return;const r=(n=t,function(e,t){return f(e,t,n)});var n;const i=function(e){return function(t,r){return function(e,t,r){return y(e.slice(0,r),t)}(t,r,e)}}(t);for(const t of e)h[t]=r,v[t]=i})),["OFFSET","INDIRECT","INDEX","SEQUENCE","SORT","SORTBY","FILTER","RANDARRAY","TRANSPOSE","UNIQUE"].forEach((e=>{h[e]=f})),[["IRR","MIRR","TYPE","LARGE","PERCENTILE.EXC","PERCENTILE.INC","PERCENTILE","PERCENTRANK.EXC","PERCENTRANK.INC","PERCENTRANK","QUARTILE.EXC","QUARTILE.INC","QUARTILE","SMALL","TRIMMEAN"],["FVSCHEDULE","MATCH","RANK.AVG","RANK.EQ","RANK"],["NETWORKDAYS","WORKDAY"],["NETWORKDAYS.INTL","WORKDAY.INTL","SERIESSUM"]].forEach(((e,t)=>{if(0===e.length)return;const r=p([t]),n=x([t]);for(const t of e)h[t]=r,v[t]=n})),[[],["XIRR","PROB","T.TEST","TTEST","Z.TEST","ZTEST"]].forEach(((e,t)=>{if(0===e.length)return;const r=p((0,a.makeSequence)(t+1)),n=x((0,a.makeSequence)(t+1));for(const t of e)h[t]=r,v[t]=n})),[["SUMIF","AVERAGEIF","COUNTIF","COUNTIFS"],["SUMIFS","AVERAGEIFS","MAXIFS","MINIFS"]].forEach(((e,t)=>{if(0===e.length)return;const r=(n=t,function(e,t){return g(e,t,c(n,e))});var n;const i=function(e){return function(t,r){return C(t,r,c(e,t))}}(t);for(const t of e)h[t]=r,v[t]=i})),h.XNPV=p([1,2]),v.XNPV=x([1,2]),h.ROW=f,v.ROW=function(e,t){const r=e[0];if(!r||!r.isRef())return{height:0,width:0};const{height:n}=r.resolveDimension(t);return{height:n,width:1}},h.COLUMN=f,v.COLUMN=function(e,t){const r=e[0];if(!r||!r.isRef())return{height:0,width:0};const{width:n}=r.resolveDimension(t);return{height:1,width:n}},h.HLOOKUP=p([1,3]),v.HLOOKUP=x([1,3]),h.VLOOKUP=p([1,3]),v.VLOOKUP=x([1,3]),h.IF=function(e,t){const{height:r,width:n}=u(e[0]);return r>1||n>1?d(e,t):t(e)},v.IF=function(e,t){const r=e[0];if(!r)return{height:0,width:0};const{height:n,width:i}=s(r,t);return n>1||i>1?y(e,t):s(r.resolve(t,new o.ResolveOption)?e[1]:e[2],t)},h.XLOOKUP=p([1,2]),v.XLOOKUP=x([1,2]),h.IFS=function(e,t){for(let r=0;r1||i>1)return d(e,t)}return t(e)},v.IFS=function(e,t){for(let r=0;r1||i>1)return y(e,t)}for(let r=0;r{"use strict";r.r(t),r.d(t,{equal:()=>c,greaterThan:()=>u,greaterThanOrEqual:()=>d,lessThan:()=>l,lessThanOrEqual:()=>h,not:()=>f});var n=r(69705);function i(e){switch(typeof e){case"number":return n.ValueType.NUMBER;case"string":return n.ValueType.STRING;case"boolean":return n.ValueType.BOOLEAN;default:return n.ValueType.OTHER}}function o(e){for(;Array.isArray(e)&&e.length>0;)e=e[0];return e}function a(e,t){const r=function(e,t){if(null!==e||null===t)return o(e);switch(typeof t){case"string":return"";case"number":return 0;case"boolean":return!1;default:return o(e)}}(e,t);return{val:r,type:i(r)}}function s(e,t){e.type===n.ValueType.STRING&&t.type===n.ValueType.STRING&&(e.val=e.val.toLowerCase(),t.val=t.val.toLowerCase())}function l(e,t){const r=a(e,t),n=a(t,e);return r.type!==n.type?r.typen.type:(s(r,n),r.val>n.val)}function c(e,t){const r=a(e,t),n=a(t,e);return r.type===n.type&&(s(r,n),r.val===n.val)}function h(e,t){return c(e,t)||l(e,t)}function d(e,t){return c(e,t)||u(e,t)}function f(e,t){return!c(e,t)}},57768:(e,t,r)=>{"use strict";r.d(t,{default:()=>l});var n=r(35821),i=r(88895),o=r(46449),a=r(78288);class s{constructor(e,t){this.range=e,this.shName=e.shName,this.isImplicit=t}toRange(){return this.range}}const l=class{constructor(e){this.workbook=e,this.footprint=new o.default,this.instStack=[],this.dimHelpers=[]}preExec(e){const t=(e=e||{}).item;if(t&&!this.footprint.push(t))return this.footprint.markCircularReferences(t),!1;const r=this.workbook.getSheetById(e.sheetId);return!!r&&(this.instStack.push(r),this.dimHelpers.push(new a.default),!0)}postExec(e){let t=!0;const r=e.item;return r&&(this.footprint.pop(),r.circularRef&&(t=!1)),this.instStack.pop(),this.dimHelpers.pop(),t}get item(){return this.footprint.top()}cellValue(e,t){return this._getSourceData(e,(function(r,n){const i=e.v[0];return r.cellValue(i.row,i.col,n,t)}))}rangeValue(e,t){return this._getSourceData(e,(function(r,n){const o=(0,i.fromCellRefs)(e.v);return r.rangeValue(o.from,o.to,n,t)}))}rowRangeValue(e,t){return this._getSourceData(e,(function(r,n){let[i,o]=e.v;if(i>o){const e=i;i=o,o=e}return r.rangeValue({row:i,col:0},{row:o,col:Number.MAX_VALUE},n,t)}))}colRangeValue(e,t){return this._getSourceData(e,(function(r,n){let[i,o]=e.v;if(i>o){const e=i;i=o,o=e}return r.rangeValue({row:0,col:i},{row:Number.MAX_VALUE,col:o},n,t)}))}visibleCellValue(e,t){return this._getSourceData(e,(function(r,n){const i=e.v[0];return r.visibleCellValue(i.row,i.col,n,t)}))}visibleRangeValue(e,t){return this._getSourceData(e,(function(r,n){const o=(0,i.fromCellRefs)(e.v);return r.visibleRangeValue(o.from,o.to,n,t)}))}visibleRowRangeValue(e,t){return this._getSourceData(e,(function(r,n){let[i,o]=e.v;if(i>o){const e=i;i=o,o=e}return r.visibleRangeValue({row:i,col:0},{row:o,col:Number.MAX_VALUE},n,t)}))}visibleColRangeValue(e,t){return this._getSourceData(e,(function(r,n){let[i,o]=e.v;if(i>o){const e=i;i=o,o=e}return r.visibleRangeValue({row:0,col:i},{row:Number.MAX_VALUE,col:o},n,t)}))}createRowVector(e,t,r,n){return this._getSourceData(new s(e,r),(function(r,i){return n(r.createRowVector(e,i,t))}))}createColumnVector(e,t,r,n){return this._getSourceData(new s(e,r),(function(r,i){return n(r.createColumnVector(e,i,t))}))}createRangeVector(e,t,r,n){return this._getSourceData(new s(e,r),(function(r,i){return n(r.createRangeVector(e,i,t))}))}getExternalRange(e,t){return this.getCurrentInstance().formula.getExternalValue(e,t,this)}rangeDimension(e){return this._getRefDimension(e,(t=>{const r=(0,i.fromCellRefs)(e.v);return{height:r.to.row-r.from.row+1,width:r.to.col-r.from.col+1}}))}rowRangeDimension(e){return this._getRefDimension(e,(t=>{let[r,n]=e.v;if(r>n){const e=r;r=n,n=e}return{height:n-r+1,width:t.countCols()}}))}colRangeDimension(e){return this._getRefDimension(e,(t=>{let[r,n]=e.v;if(r>n){const e=r;r=n,n=e}return{height:t.countRows(),width:n-r+1}}))}_getRefDimension(e,t){const r=e.shName?this.workbook.getSheetByName(e.shName):this.getCurrentInstance();return r?t(r):{height:1,width:1}}addItemSelfImplicit(){this.item?.setSelfImplicit()}_getSourceData(e,t){const r=this.getCurrentInstance(),i=e.shName?this.workbook.getSheetByName(e.shName):r,o=!!e.isImplicit;if(!i)return o&&this.item&&this.item.setUnknownName(e.shName),n.default.REF;const a=i!==r;a&&this.instStack.push(i),o&&this.item&&i.formula.addImplicitDep(this.item,e.toRange());const s=t(i.formula,this);return a&&this.instStack.pop(),s}getCurrentInstance(){return this.instStack[this.instStack.length-1]}getVariable(e,t){let r=this.getCurrentInstance().sheetId;if(t&&("'"===t.charAt(0)&&(t=t.slice(1,-1).replace(/''/,"'")),r=this.workbook.getIdByName(t)),!r)return;const n=this.workbook.getNameManager();return n.get(e,r)||n.get(e)}getInstance(e){return e.shName?this.workbook.getSheetByName(e.shName):this.getCurrentInstance()}getLocale(){return this.workbook.getLocale()}getDimHelper(){return this.dimHelpers[this.dimHelpers.length-1]}}},78288:(e,t,r)=>{"use strict";r.d(t,{default:()=>o});const n=new Set(["OFFSET","CHOOSE","INDIRECT","INDEX","SEQUENCE","SORT","SORTBY","FILTER","RANDARRAY","TRANSPOSE","UNIQUE","XLOOKUP","IMPORTRANGE"]),i=new Set([...n,"IFS"]);class o{constructor(){this.funcState=[]}pushFuncName(e){this.funcState.push({name:e,argCount:0})}popFuncName(){this.funcState.pop()}pushArgs(e){0!==this.funcState.length&&(this.funcState[this.funcState.length-1].argCount+=e)}needRealValue(){for(const{name:e,argCount:t}of this.funcState)if(i.has(e)||"IF"===e&&0===t)return!0;return!1}isReturnRefFunction(e){return n.has(e)}}},35821:(e,t,r)=>{"use strict";r.d(t,{default:()=>s,getErrorFromText:()=>a});var n=r(99613);const i={NULL:n.nil,DIV0:n.div0,VALUE:n.value,REF:n.ref,NAME:n.name,NUM:n.num,NA:n.na,SPILL:n.spill,ERROR:n.error,CALC:n.calc,GETTING_DATA:n.data,LOADING:n.loading},o={};function a(e){return o[e]||n.error}Object.keys(i).forEach((e=>{const t=i[e];t.name=t.message,t.stack&&(t.stack=void 0),o[t.message]=t}));const s=i},82239:(e,t,r)=>{"use strict";r.d(t,{Expr:()=>c,LinkExpr:()=>f,RefExpr:()=>h});var n,i=r(72208),o=r(28488),a=r(35821),s=r(50039),l=r(44499),u=r(88895);!function(e){e[e.ERROR=0]="ERROR",e[e.VALUE=1]="VALUE",e[e.ARRAY=2]="ARRAY",e[e.CELL_REF=3]="CELL_REF",e[e.ROW_REF=4]="ROW_REF",e[e.COL_REF=5]="COL_REF"}(n||(n={}));class c{constructor(e,t){this.v=e,this.t=t}static fromValue(e){let t=n.VALUE;return Array.isArray(e)?t=n.ARRAY:(0,i.isError)(e)&&(t=n.ERROR),new c(e,t)}isError(){return this.t===n.ERROR}isValue(){return this.t===n.VALUE}isArray(){return this.t===n.ARRAY}isCellRef(){return this.t===n.CELL_REF}isRowRef(){return this.t===n.ROW_REF}isColRef(){return this.t===n.COL_REF}isRef(){return this.isCellRef()||this.isRowRef()||this.isColRef()}set(e,t){this.t=n[e],this.v=t}resolve(e,t){return this.isArray()?this.v.map((r=>r.map((r=>r instanceof c?r.resolve(e,t):r)))):this.v}finalize(e){return this._finalize(e)}_finalize(e,t){return this.resolve(e,t)}addCellRef(e){this.t=n.ERROR,this.v=a.default.ERROR}}class h extends c{constructor(e,t,r){super(e,t),this.shName=r,this.isImplicit=!1}resolve(e,t){switch(t=t||new s.ResolveOption,this.t){case n.CELL_REF:return this.v.length>1?e.rangeValue(this,t):e.cellValue(this,t);case n.ROW_REF:return e.rowRangeValue(this,t);case n.COL_REF:return e.colRangeValue(this,t);default:return this.v}}resolveDimension(e){switch(this.t){case n.CELL_REF:return this.v.length>1?e.rangeDimension(this):{height:0,width:0};case n.ROW_REF:return e.rowRangeDimension(this);case n.COL_REF:return e.colRangeDimension(this);default:return{height:0,width:0}}}finalize(e){const t=(new s.ResolveOption).assign({keepNfId:!0});return this.isCellRef()&&1===this.v.length&&(t.keepLink=!0),this._finalize(e,t)}setImplicit(){this.isImplicit=!0}addCellRef(e){n.CELL_REF===this.t&&this.v&&n.CELL_REF===e.t&&e.v?(this.v.push(e.v[0]),e.isImplicit&&this.setImplicit()):c.prototype.addCellRef.call(this,e)}static fromCell(e,t,r){const i=new h([e],n.CELL_REF,t);return r&&i.setImplicit(),i}static fromRange(e,t,r){const n=h.fromCell(e.from,t,r);return n.v.push(e.to),n}static createRangeRef(e,t){const r=e.split(":").map(o.labelToCoord);return new h(r,n.CELL_REF,t)}static createCellRef(e,t){return new h([(0,o.labelToCoord)(e)],n.CELL_REF,t)}static createRowRef(e,t){const[{row:r},{row:i}]=(0,o.rangeToCoords)(e);return new h([r,i],n.ROW_REF,t)}static createColRef(e,t){const[{col:r},{col:i}]=(0,o.rangeToCoords)(e);return new h([r,i],n.COL_REF,t)}toRange(){const e=this.v;switch(this.t){case n.CELL_REF:if(e.length>1){const{from:t,to:r}=(0,u.fromCellRefs)(e);return new l.CellRange(t,r,this.shName)}return new l.CellRange(e[0],{row:e[0].row,col:e[0].col},this.shName);case n.ROW_REF:return new l.RowRange(Math.min(e[0],e[1]),Math.max(e[0],e[1]),this.shName);case n.COL_REF:return new l.ColRange(Math.min(e[0],e[1]),Math.max(e[0],e[1]),this.shName);default:throw new Error("unexpected expr type")}}toCellRef(e){const t=e.getInstance(this);if(!t)return null;let r;switch(this.t){case n.CELL_REF:r=(0,u.fromCellRefs)(this.v),r=[r.from,r.to];break;case n.ROW_REF:r=[{row:Math.min(this.v[0],this.v[1]),col:0},{row:Math.max(this.v[0],this.v[1]),col:t.countCols()-1}];break;case n.COL_REF:r=[{row:0,col:Math.min(this.v[0],this.v[1])},{row:t.countRows()-1,col:Math.max(this.v[0],this.v[1])}]}if(!r)return null;const i=new h(r,n.CELL_REF,this.shName);return this.isImplicit&&i.setImplicit(),i}toVisibleRefExpr(){const e=new d(this.v,this.t,this.shName);return this.isImplicit&&e.setImplicit(),e}}class d extends h{resolve(e,t){switch(t=t||new s.ResolveOption,this.t){case n.CELL_REF:return this.v.length>1?e.visibleRangeValue(this,t):e.visibleCellValue(this,t);case n.ROW_REF:return e.visibleRowRangeValue(this,t);case n.COL_REF:return e.visibleColRangeValue(this,t);default:return this.v}}}class f extends c{constructor(e,t){super(e,n.VALUE),this.href=t}finalize(e){const t=e.item;return t&&(t.href=this.href),this._finalize(e)}}},46449:(e,t,r)=>{"use strict";r.d(t,{default:()=>n});const n=class{constructor(){this.visitedSet=new Set,this.stack=[]}push(e){return!this.visitedSet.has(e)&&(this.visitedSet.add(e),this.stack.push(e),!0)}pop(){if(0===this.stack.length)return;const e=this.stack.pop();return this.visitedSet.delete(e),e}top(){const e=this.stack.length;return e>0?this.stack[e-1]:null}markCircularReferences(e){const t=this.stack.indexOf(e);if(!(t<0))for(let e=t;e{"use strict";r.r(t),r.d(t,{AVERAGEIF:()=>f,AVERAGEIFS:()=>g,COUNTIF:()=>s,COUNTIFS:()=>l,MAXIFS:()=>m,MINIFS:()=>v,SUMIF:()=>d,SUMIFS:()=>h});var n=r(99613),i=r(37233),o=r(26258);const a=(new(r(50039).ResolveOption)).assign({keepNull:!0});function s(e,t){if(void 0===e||void 0===t)return n.na;const r=new i.Matcher(this,t);let o=0;function a(e,t,n){const i=n.getCellValue(e,t);r.test(i)&&o++}return x(this,e,(function(e){w(e,a)})),o}function l(){const e=(0,o.argsToArray)(arguments);if(e.length<2||e.length%2!=0)return n.na;const t=y(this,e);return t!==n.value?t.length:n.value}function u(e,t,r,i,o){return t.length<3||t.length%2==0?n.na:x(e,t[0],(function(a){const s=r?[a.getHeight(),a.getWidth()]:null,l=y(e,t.slice(1),s);if(l===n.value)return n.value;let u=i;const c=a.getRowOffset(),h=a.getColOffset();for(let e=0;e0?o/i:n.div0}function m(){const e=u(this,(0,o.argsToArray)(arguments),!0,Number.MIN_VALUE,Math.max);return e!==Number.MIN_VALUE?e:0}function v(){const e=u(this,(0,o.argsToArray)(arguments),!0,Number.MAX_VALUE,Math.min);return e!==Number.MAX_VALUE?e:0}function y(e,t,r){const o=t[0];let a,s=new i.Matcher(e,t[1]),l=0,u=0,c=[];if(a=x(e,o,(function(e){if(l=e.getHeight(),u=e.getWidth(),r&&(r[0]!==l||r[1]!==u))return n.value;w(e,(function(e,t,r){const n=r.getCellValue(e,t);s.test(n)&&c.push([e-r.getRowOffset(),t-r.getColOffset()])}))})),a===n.value)return a;function h(e){if(e.getHeight()!==l||e.getWidth()!==u)return n.value;const t=[],r=e.getRowOffset(),i=e.getColOffset();for(let n=0;n{"use strict";r.d(t,{Matcher:()=>R,createMatcherRegExp:()=>u,hasWildcard:()=>l});var n=r(26258),i=r(72208),o=r(49827);const a=/~[?*]|[-/\\^$*+?.()|[\]{}]/g;function s(e){switch(e){case"~?":case"~*":return"\\"+e.charAt(1);case"*":return"[\\s\\S]*";case"?":return".";default:return"\\"+e.charAt(0)}}function l(e){return e.indexOf("*")>-1||e.indexOf("?")>-1}function u(e){const t=e.replace(a,s);return new RegExp(["^",t,"$"].join(""),"i")}function c(e){return e!==this.cond}function h(e){return null!==e&&e>this.cond}function d(e){return null!==e&&e=this.cond}function g(e){return null!==e&&e<=this.cond}function p(e){return this.cond===e}function m(e){if((0,i.isString)(e)){const t=(0,n.parseNumber)(e);(0,n.isParsedError)(t)||(e=t)}return v.call(this,e)}function v(e){return!(0,i.isError)(e)&&this.cond===(0,n.toString)(e)}function y(e){return"string"==typeof e&&this.cond.test(e)}function C(e){return!y.call(this,e)}function x(e){return"string"==typeof e&&this.cond===e.toLowerCase()}function w(e){return!x.call(this,e)}function _(){return!1}function R(e,t){let r=t,a=v;if((0,i.isNumber)(t))a=m;else if(""===t);else if((0,i.isBoolean)(t)||(0,i.isError)(t))a=p;else if(null===t)a=_;else{r=t.toString();const s=function(e){switch(e[0]){case"<":return">"===e[1]||"="===e[1]?e.substr(0,2):e[0];case">":return"="===e[1]?e.substr(0,2):e[0];case"=":return e[0];default:return}}(r);s&&(r=r.substr(s.length),""===r&&(r=null));let v=!0;if(null!==r){let t=(0,n.parseNumber)(r);if((0,n.isParsedError)(t)){const n=e.getLocale().getDateParser().parse(r);n?t=(0,o.serialize)(n.v):v=!1}r=v?t:l(r)?u(r):r.toLowerCase()}a=v?function(e,t){switch(e){case"<>":return c;case">":return h;case"<":return d;case">=":return f;case"<=":return g;default:return null===t?p:m}}(s,r):function(e,t){const r=(0,i.isString)(t);return"<>"===e?r?w:C:r?x:y}(s,r)}a!==v&&a!==m||(r=(0,n.toString)(r)),this.cond=r,this.test=a}},41430:(e,t,r)=>{"use strict";r.r(t),r.d(t,{DATE:()=>c,DATEDIF:()=>H,DATEVALUE:()=>h,DAY:()=>d,DAYS:()=>f,DAYS360:()=>p,EDATE:()=>m,EOMONTH:()=>v,HOUR:()=>y,INTERVAL:()=>C,ISOWEEKNUM:()=>x,MINUTE:()=>w,MONTH:()=>_,NETWORKDAYS:()=>R,NOW:()=>S,SECOND:()=>b,TIME:()=>I,TIMEVALUE:()=>A,TODAY:()=>T,WEEKDAY:()=>E,WEEKNUM:()=>M,WORKDAY:()=>k,YEAR:()=>L,YEARFRAC:()=>B,_DAYS:()=>g,_YEARFRAC:()=>V});var n=r(99613),i=r(26258),o=r(72208),a=r(49827);const s=[void 0,0,1,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,1,2,3,4,5,6,0],l=[[],[1,2,3,4,5,6,7],[7,1,2,3,4,5,6],[6,0,1,2,3,4,5],[],[],[],[],[],[],[],[7,1,2,3,4,5,6],[6,7,1,2,3,4,5],[5,6,7,1,2,3,4],[4,5,6,7,1,2,3],[3,4,5,6,7,1,2],[2,3,4,5,6,7,1],[1,2,3,4,5,6,7]],u=[void 0,[1,0,0,0,0,0,1],[1,1,0,0,0,0,0],[0,1,1,0,0,0,0],[0,0,1,1,0,0,0],[0,0,0,1,1,0,0],[0,0,0,0,1,1,0],[0,0,0,0,0,1,1],void 0,void 0,void 0,[1,0,0,0,0,0,0],[0,1,0,0,0,0,0],[0,0,1,0,0,0,0],[0,0,0,1,0,0,0],[0,0,0,0,1,0,0],[0,0,0,0,0,1,0],[0,0,0,0,0,0,1]];function c(e,t,r){if(e=(0,i.parseNumber)(e),t=(0,i.parseNumber)(t),r=(0,i.parseNumber)(r),(0,i.anyIsParsedError)(e,t,r))return n.value;if(e<=1899&&(e+=1900),1900===e&&2===t&&29===r)return 60;const o=new Date(e,t-1,r),s=Math.floor((0,a.serialize)(o));return s<0||o.getFullYear()>=1e4?n.num:s}function h(e){if("string"!=typeof e)return n.value;const t=this.getLocale().getDateParser().parse(e);return null===t?n.value:Math.floor((0,a.serialize)(t.v))}function d(e){const t=(0,i.parseDate)(this,e);return(0,i.isParsedError)(t)?n.value:t.getDate()}function f(e,t){return 2!==arguments.length?n.na:(e=(0,i.parseDate)(this,e),t=(0,i.parseDate)(this,t),(0,i.isParsedError)(e)||(0,i.isParsedError)(t)?n.value:g(e,t))}function g(e,t){return Math.floor((0,a.serialize)(e))-Math.floor((0,a.serialize)(t))}function p(e,t,r){if(r=void 0!==r&&(0,i.parseBool)(r),e=(0,i.parseDate)(this,e),t=(0,i.parseDate)(this,t),(0,i.anyIsParsedError)(e,t,r))return n.value;const o=e.getMonth();let a,s,l=t.getMonth();if(r)a=31===e.getDate()?30:e.getDate(),s=31===t.getDate()?30:t.getDate();else{const r=e=>1===e,n=e=>e.getDate()===new Date(e.getFullYear(),e.getMonth()+1,0).getDate();a=n(e)?30:e.getDate(),s=r(o)&&n(e)&&r(l)&&n(t)?t.getDate():30===a&&31===t.getDate()?30:t.getDate()}return 360*(t.getFullYear()-e.getFullYear())+30*(l-o)+(s-a)}function m(e,t){return e=(0,i.parseDate)(this,e),(0,i.isParsedError)(e)||isNaN(t)?n.value:(t=parseInt(t,10),e.setMonth(e.getMonth()+t),(0,a.serialize)(e))}function v(e,t){return e=(0,i.parseDate)(this,e),(0,i.isParsedError)(e)||isNaN(t)?n.value:(t=parseInt(t,10),(0,a.serialize)(new Date(e.getFullYear(),e.getMonth()+t+1,0)))}function y(e){return e=(0,i.parseDate)(this,e),(0,i.isParsedError)(e)?n.value:e.getHours()}function C(e){if("number"!=typeof e&&"string"!=typeof e)return n.value;e=parseInt(e,10);let t=Math.floor(e/94608e4);e%=94608e4;let r=Math.floor(e/2592e3);e%=2592e3;let i=Math.floor(e/86400);e%=86400;let o=Math.floor(e/3600);e%=3600;let a=Math.floor(e/60),s=e%=60;return t=t>0?t+"Y":"",r=r>0?r+"M":"",i=i>0?i+"D":"",o=o>0?o+"H":"",a=a>0?a+"M":"",s=s>0?s+"S":"","P"+t+r+i+"T"+o+a+s}function x(e){if(e=(0,i.parseDate)(this,e),(0,i.isParsedError)(e))return n.value;e.setHours(0,0,0),e.setDate(e.getDate()+4-(e.getDay()||7));const t=new Date(e.getFullYear(),0,1);return Math.ceil(((0,a.serialize)(e)-(0,a.serialize)(t)+1)/7)}function w(e){return e=(0,i.parseDate)(this,e),(0,i.isParsedError)(e)?n.value:e.getMinutes()}function _(e){return e=(0,i.parseDate)(this,e),(0,i.isParsedError)(e)?n.value:e.getMonth()+1}function R(e,t,r){return R.INTL.call(this,e,t,1,r)}function S(){return(0,a.serialize)(new Date)}function b(e){return e=(0,i.parseDate)(this,e),(0,i.isParsedError)(e)?n.value:e.getSeconds()}function I(e,t,r){return e=(0,i.parseNumber)(e),t=(0,i.parseNumber)(t),r=(0,i.parseNumber)(r),(0,i.anyIsParsedError)(e,t,r)?n.value:e<0||t<0||r<0?n.num:(3600*e+60*t+r)/86400}function A(e){const t=(0,i.parseDate)(this,e);return(0,i.isParsedError)(t)?n.value:(3600*t.getHours()+60*t.getMinutes()+t.getSeconds())/86400}function T(){return Math.floor((0,a.serialize)(new Date))}function E(e,t){if(e=(0,i.parseDate)(this,e),(0,i.isParsedError)(e))return n.value;void 0===t&&(t=1);const r=e.getDay();return l[t][r]}function M(e,t){const r=(0,i.parseDate)(this,e);if((0,i.isParsedError)(r))return n.value;if(e=(0,a.serialize)(r),void 0===t&&(t=1),21===t)return x(e);const o=s[t],l=new Date(r.getFullYear(),0,1),u=l.getDay()""!==e)))}function D(e,t,r){if(1===t[e.getDay()])return!1;for(let t=0;t9999?n.num:t}function P(e){return 1===new Date(e,1,29).getMonth()}function F(e,t){return Math.ceil((0,a.serialize)(t)-(0,a.serialize)(e))}function B(e,t,r){return e=(0,i.parseDate)(this,e),t=(0,i.parseDate)(this,t),(0,i.isParsedError)(e)||(0,i.isParsedError)(t)?n.value:V(e,t,r)}function V(e,t,r){r=r||0;let n=e.getDate();const i=e.getMonth()+1,o=e.getFullYear();let a=t.getDate();const s=t.getMonth()+1,l=t.getFullYear();switch(r){case 0:return 31===n&&31===a?(n=30,a=30):31===n?n=30:30===n&&31===a&&(a=30),(a+30*s+360*l-(n+30*i+360*o))/360;case 1:var u=365;if(o===l||o+1===l&&(i>s||i===s&&n>=a))return(o===l&&P(o)||function(e,t){const r=e.getFullYear(),n=new Date(r,2,1);if(P(r)&&e=n)return!0;const i=t.getFullYear(),o=new Date(i,2,1);return P(i)&&t>=o&&et||!(0,o.isString)(r))return n.num;const s=864e5;switch(r.toUpperCase()){case"Y":{const r=t.getMonth()-e.getMonth();return t.getFullYear()-e.getFullYear()-(r<0||0===r&&t.getDate()=e.getDate()?t.getDate()-e.getDate():Math.floor(Math.abs(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())-Date.UTC(e.getFullYear(),e.getMonth()+1,t.getDate()))/s);case"YM":{const r=t.getMonth()-e.getMonth(),n=t.getDate()=e.getMonth()?0:1),t.getMonth(),t.getDate()))/s;default:return n.num}}R.INTL=function(e,t,r,o){let s=!0;if(e=(0,i.parseDate)(this,e),t=(0,i.parseDate)(this,t),(0,i.isParsedError)(e)||(0,i.isParsedError)(t))return n.value;if(r=N(r),!Array.isArray(r))return r;if(o=O(this,o),(0,i.isParsedError)(o))return n.value;e>t&&([e,t]=[t,e],s=!1);const l=Math.floor((0,a.serialize)(t))-Math.floor((0,a.serialize)(e))+1;let u=l;const c=e;for(let e=0;e0?1:-1)),D(s,r,o)&&e++;return Math.floor((0,a.serialize)(s))}},49827:(e,t,r)=>{"use strict";r.d(t,{deserialize:()=>o,serialize:()=>i});const n=Date.UTC(1900,0,0);function i(e){const t=(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())-n)/864e5;return t>=60?t+1:t}function o(e){const t=e>=61?e-1:e,r=Math.floor(t),n=t-r,i=new Date(Date.UTC(1900,0,r)+864e5*n);return new Date(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate(),i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds())}},85862:(e,t,r)=>{"use strict";r.r(t),r.d(t,{BESSELI:()=>d,BESSELJ:()=>f,BESSELK:()=>g,BESSELY:()=>p,BIN2DEC:()=>m,BIN2HEX:()=>v,BIN2OCT:()=>y,BITAND:()=>C,BITLSHIFT:()=>x,BITOR:()=>w,BITRSHIFT:()=>_,BITXOR:()=>R,COMPLEX:()=>S,CONVERT:()=>b,DEC2BIN:()=>I,DEC2HEX:()=>A,DEC2OCT:()=>T,DELTA:()=>E,ERF:()=>M,ERFC:()=>k,GESTEP:()=>N,HEX2BIN:()=>O,HEX2DEC:()=>D,HEX2OCT:()=>L,IMABS:()=>P,IMAGINARY:()=>F,IMARGUMENT:()=>B,IMCONJUGATE:()=>V,IMCOS:()=>H,IMCOSH:()=>U,IMCOT:()=>z,IMCSC:()=>re,IMCSCH:()=>ne,IMDIV:()=>W,IMEXP:()=>G,IMLN:()=>j,IMLOG10:()=>Y,IMLOG2:()=>X,IMPOWER:()=>$,IMPRODUCT:()=>q,IMREAL:()=>K,IMSEC:()=>J,IMSECH:()=>Z,IMSIN:()=>Q,IMSINH:()=>ee,IMSQRT:()=>te,IMSUB:()=>ie,IMSUM:()=>oe,IMTAN:()=>ae,OCT2BIN:()=>se,OCT2DEC:()=>le,OCT2HEX:()=>ue});var n=r(99613),i=r(73691),o=r(25412),a=r(26258),s=r(72208),l=r(15765),u=r.n(l),c=r(290);function h(e){return/^[01]{1,10}$/.test(e)}function d(e,t){return e=(0,a.parseNumber)(e),t=(0,a.parseNumber)(t),(0,c.default)(e)&&(0,c.default)(t)?0>t?n.num:(0,a.toEffective)(u().besseli(e,t)):n.value}function f(e,t){return e=(0,a.parseNumber)(e),t=(0,a.parseNumber)(t),(0,c.default)(e)&&(0,c.default)(t)?0>t?n.num:(0,a.toEffective)(u().besselj(e,t)):n.value}function g(e,t){return e=(0,a.parseNumber)(e),t=(0,a.parseNumber)(t),(0,c.default)(e)&&(0,c.default)(t)?0>t?n.num:(0,a.toEffective)(u().besselk(e,t)):n.value}function p(e,t){return e=(0,a.parseNumber)(e),t=(0,a.parseNumber)(t),(0,c.default)(e)&&(0,c.default)(t)?0>t?n.num:(0,a.toEffective)(u().bessely(e,t)):n.value}function m(e){if(!h(e))return n.num;const t=parseInt(e,2),r=e.toString();return 10===r.length&&"1"===r.substring(0,1)?parseInt(r.substring(1),2)-512:t}function v(e,t){if(!h(e))return n.num;(0,c.default)(e)&&(e=e.toString());const r=e.toString();if(10===r.length&&"1"===r.substring(0,1))return(0xfffffffe00+parseInt(r.substring(1),2)).toString(16).toUpperCase();const i=parseInt(e,2).toString(16).toUpperCase();return void 0===t?i:isNaN(t)?n.value:t<0?n.num:(t=Math.floor(t))>=i.length?(0,o.REPT)("0",t-i.length)+i:n.num}function y(e,t){if(!h(e))return n.num;(0,c.default)(e)&&(e=e.toString());const r=e.toString();if(10===r.length&&"1"===r.substring(0,1))return(1073741312+parseInt(r.substring(1),2)).toString(8);const i=parseInt(e,2).toString(8);return void 0===t?i:isNaN(t)?n.value:t<0?n.num:(t=Math.floor(t))>=i.length?(0,o.REPT)("0",t-i.length)+i:n.num}function C(e,t){return e=(0,a.parseNumber)(e),t=(0,a.parseNumber)(t),(0,a.anyIsParsedError)(e,t)?n.value:e<0||t<0||Math.floor(e)!==e||Math.floor(t)!==t||e>0xffffffffffff||t>0xffffffffffff?n.num:e&t}function x(e,t){return e=(0,a.parseNumber)(e),t=(0,a.parseNumber)(t),(0,a.anyIsParsedError)(e,t)?n.value:e<0||Math.floor(e)!==e||e>0xffffffffffff||Math.abs(t)>53?n.num:t>=0?e<>-t}function w(e,t){return e=(0,a.parseNumber)(e),t=(0,a.parseNumber)(t),(0,a.anyIsParsedError)(e,t)?n.value:e<0||t<0||Math.floor(e)!==e||Math.floor(t)!==t||e>0xffffffffffff||t>0xffffffffffff?n.num:e|t}function _(e,t){return e=(0,a.parseNumber)(e),t=(0,a.parseNumber)(t),(0,a.anyIsParsedError)(e,t)?n.value:e<0||Math.floor(e)!==e||e>0xffffffffffff||Math.abs(t)>53?n.num:t>=0?e>>t:e<<-t}function R(e,t){return e=(0,a.parseNumber)(e),t=(0,a.parseNumber)(t),(0,a.anyIsParsedError)(e,t)?n.value:e<0||t<0||Math.floor(e)!==e||Math.floor(t)!==t||e>0xffffffffffff||t>0xffffffffffff?n.num:e^t}function S(e,t,r){if(e=(0,a.parseNumber)(e),t=(0,a.parseNumber)(t),(0,a.anyIsParsedError)(e,t))return e;if("i"!==(r=void 0===r?"i":r)&&"j"!==r)return n.value;function i(e){return(0,a.toEffective)(e).toString()}if(0===e&&0===t)return 0;if(0===e)return 1===t?r:i(t)+r;if(0===t)return i(e);{const n=t>0?"+":"";return i(e)+n+(1===t?r:i(t)+r)}}function b(e,t,r){if((e=(0,a.parseNumber)(e))instanceof Error)return e;const i=[["a.u. of action","?",null,"action",!1,!1,105457168181818e-48],["a.u. of charge","e",null,"electric_charge",!1,!1,160217653141414e-33],["a.u. of energy","Eh",null,"energy",!1,!1,435974417757576e-32],["a.u. of length","a?",null,"length",!1,!1,529177210818182e-25],["a.u. of mass","m?",null,"mass",!1,!1,910938261616162e-45],["a.u. of time","?/Eh",null,"time",!1,!1,241888432650516e-31],["admiralty knot","admkn",null,"speed",!1,!0,.514773333],["ampere","A",null,"electric_current",!0,!1,1],["ampere per meter","A/m",null,"magnetic_field_intensity",!0,!1,1],["ångström","Å",["ang"],"length",!1,!0,1e-10],["are","ar",null,"area",!1,!0,100],["astronomical unit","ua",null,"length",!1,!1,149597870691667e-25],["bar","bar",null,"pressure",!1,!1,1e5],["barn","b",null,"area",!1,!1,1e-28],["becquerel","Bq",null,"radioactivity",!0,!1,1],["bit","bit",["b"],"information",!1,!0,1],["btu","BTU",["btu"],"energy",!1,!0,1055.05585262],["byte","byte",null,"information",!1,!0,8],["candela","cd",null,"luminous_intensity",!0,!1,1],["candela per square metre","cd/m?",null,"luminance",!0,!1,1],["coulomb","C",null,"electric_charge",!0,!1,1],["cubic ångström","ang3",["ang^3"],"volume",!1,!0,1e-30],["cubic foot","ft3",["ft^3"],"volume",!1,!0,.028316846592],["cubic inch","in3",["in^3"],"volume",!1,!0,16387064e-12],["cubic light-year","ly3",["ly^3"],"volume",!1,!0,846786664623715e-61],["cubic metre","m?",null,"volume",!0,!0,1],["cubic mile","mi3",["mi^3"],"volume",!1,!0,4168181825.44058],["cubic nautical mile","Nmi3",["Nmi^3"],"volume",!1,!0,6352182208],["cubic Pica","Pica3",["Picapt3","Pica^3","Picapt^3"],"volume",!1,!0,7.58660370370369e-8],["cubic yard","yd3",["yd^3"],"volume",!1,!0,.764554857984],["cup","cup",null,"volume",!1,!0,.0002365882365],["dalton","Da",["u"],"mass",!1,!1,166053886282828e-41],["day","d",["day"],"time",!1,!0,86400],["degree","°",null,"angle",!1,!1,.0174532925199433],["degrees Rankine","Rank",null,"temperature",!1,!0,.555555555555556],["dyne","dyn",["dy"],"force",!1,!0,1e-5],["electronvolt","eV",["ev"],"energy",!1,!0,1.60217656514141],["ell","ell",null,"length",!1,!0,1.143],["erg","erg",["e"],"energy",!1,!0,1e-7],["farad","F",null,"electric_capacitance",!0,!1,1],["fluid ounce","oz",null,"volume",!1,!0,295735295625e-16],["foot","ft",null,"length",!1,!0,.3048],["foot-pound","flb",null,"energy",!1,!0,1.3558179483314],["gal","Gal",null,"acceleration",!1,!1,.01],["gallon","gal",null,"volume",!1,!0,.003785411784],["gauss","G",["ga"],"magnetic_flux_density",!1,!0,1],["grain","grain",null,"mass",!1,!0,647989e-10],["gram","g",null,"mass",!1,!0,.001],["gray","Gy",null,"absorbed_dose",!0,!1,1],["gross registered ton","GRT",["regton"],"volume",!1,!0,2.8316846592],["hectare","ha",null,"area",!1,!0,1e4],["henry","H",null,"inductance",!0,!1,1],["hertz","Hz",null,"frequency",!0,!1,1],["horsepower","HP",["h"],"power",!1,!0,745.69987158227],["horsepower-hour","HPh",["hh","hph"],"energy",!1,!0,2684519.538],["hour","h",["hr"],"time",!1,!0,3600],["imperial gallon (U.K.)","uk_gal",null,"volume",!1,!0,.00454609],["imperial hundredweight","lcwt",["uk_cwt","hweight"],"mass",!1,!0,50.802345],["imperial quart (U.K)","uk_qt",null,"volume",!1,!0,.0011365225],["imperial ton","brton",["uk_ton","LTON"],"mass",!1,!0,1016.046909],["inch","in",null,"length",!1,!0,.0254],["international acre","uk_acre",null,"area",!1,!0,4046.8564224],["IT calorie","cal",null,"energy",!1,!0,4.1868],["joule","J",null,"energy",!0,!0,1],["katal","kat",null,"catalytic_activity",!0,!1,1],["kelvin","K",["kel"],"temperature",!0,!0,1],["kilogram","kg",null,"mass",!0,!0,1],["knot","kn",null,"speed",!1,!0,.514444444444444],["light-year","ly",null,"length",!1,!0,9460730472580800],["litre","L",["l","lt"],"volume",!1,!0,.001],["lumen","lm",null,"luminous_flux",!0,!1,1],["lux","lx",null,"illuminance",!0,!1,1],["maxwell","Mx",null,"magnetic_flux",!1,!1,1e-18],["measurement ton","MTON",null,"volume",!1,!0,1.13267386368],["meter per hour","m/h",["m/hr"],"speed",!1,!0,.00027777777777778],["meter per second","m/s",["m/sec"],"speed",!0,!0,1],["meter per second squared","m?s??",null,"acceleration",!0,!1,1],["parsec","pc",["parsec"],"length",!1,!0,0x6da012f958ee1c],["meter squared per second","m?/s",null,"kinematic_viscosity",!0,!1,1],["metre","m",null,"length",!0,!0,1],["miles per hour","mph",null,"speed",!1,!0,.44704],["millimetre of mercury","mmHg",null,"pressure",!1,!1,133.322],["minute","?",null,"angle",!1,!1,.000290888208665722],["minute","min",["mn"],"time",!1,!0,60],["modern teaspoon","tspm",null,"volume",!1,!0,5e-6],["mole","mol",null,"amount_of_substance",!0,!1,1],["morgen","Morgen",null,"area",!1,!0,2500],["n.u. of action","?",null,"action",!1,!1,105457168181818e-48],["n.u. of mass","m?",null,"mass",!1,!1,910938261616162e-45],["n.u. of speed","c?",null,"speed",!1,!1,299792458],["n.u. of time","?/(me?c??)",null,"time",!1,!1,128808866778687e-35],["nautical mile","M",["Nmi"],"length",!1,!0,1852],["newton","N",null,"force",!0,!0,1],["œrsted","Oe ",null,"magnetic_field_intensity",!1,!1,79.5774715459477],["ohm","Ω",null,"electric_resistance",!0,!1,1],["ounce mass","ozm",null,"mass",!1,!0,.028349523125],["pascal","Pa",null,"pressure",!0,!1,1],["pascal second","Pa?s",null,"dynamic_viscosity",!0,!1,1],["pferdestärke","PS",null,"power",!1,!0,735.49875],["phot","ph",null,"illuminance",!1,!1,1e-4],["pica (1/6 inch)","pica",null,"length",!1,!0,.00035277777777778],["pica (1/72 inch)","Pica",["Picapt"],"length",!1,!0,.00423333333333333],["poise","P",null,"dynamic_viscosity",!1,!1,.1],["pond","pond",null,"force",!1,!0,.00980665],["pound force","lbf",null,"force",!1,!0,4.4482216152605],["pound mass","lbm",null,"mass",!1,!0,.45359237],["quart","qt",null,"volume",!1,!0,.000946352946],["radian","rad",null,"angle",!0,!1,1],["second","?",null,"angle",!1,!1,484813681109536e-20],["second","s",["sec"],"time",!0,!0,1],["short hundredweight","cwt",["shweight"],"mass",!1,!0,45.359237],["siemens","S",null,"electrical_conductance",!0,!1,1],["sievert","Sv",null,"equivalent_dose",!0,!1,1],["slug","sg",null,"mass",!1,!0,14.59390294],["square ångström","ang2",["ang^2"],"area",!1,!0,1e-20],["square foot","ft2",["ft^2"],"area",!1,!0,.09290304],["square inch","in2",["in^2"],"area",!1,!0,64516e-8],["square light-year","ly2",["ly^2"],"area",!1,!0,895054210748189e17],["square meter","m?",null,"area",!0,!0,1],["square mile","mi2",["mi^2"],"area",!1,!0,2589988.110336],["square nautical mile","Nmi2",["Nmi^2"],"area",!1,!0,3429904],["square Pica","Pica2",["Picapt2","Pica^2","Picapt^2"],"area",!1,!0,1792111111111e-17],["square yard","yd2",["yd^2"],"area",!1,!0,.83612736],["statute mile","mi",null,"length",!1,!0,1609.344],["steradian","sr",null,"solid_angle",!0,!1,1],["stilb","sb",null,"luminance",!1,!1,1e-4],["stokes","St",null,"kinematic_viscosity",!1,!1,1e-4],["stone","stone",null,"mass",!1,!0,6.35029318],["tablespoon","tbs",null,"volume",!1,!0,147868e-10],["teaspoon","tsp",null,"volume",!1,!0,492892e-11],["tesla","T",null,"magnetic_flux_density",!0,!0,1],["thermodynamic calorie","c",null,"energy",!1,!0,4.184],["ton","ton",null,"mass",!1,!0,907.18474],["tonne","t",null,"mass",!1,!1,1e3],["U.K. pint","uk_pt",null,"volume",!1,!0,.00056826125],["U.S. bushel","bushel",null,"volume",!1,!0,.03523907],["U.S. oil barrel","barrel",null,"volume",!1,!0,.158987295],["U.S. pint","pt",["us_pt"],"volume",!1,!0,.000473176473],["U.S. survey mile","survey_mi",null,"length",!1,!0,1609.347219],["U.S. survey/statute acre","us_acre",null,"area",!1,!0,4046.87261],["volt","V",null,"voltage",!0,!1,1],["watt","W",null,"power",!0,!0,1],["watt-hour","Wh",["wh"],"energy",!1,!0,3600],["weber","Wb",null,"magnetic_flux",!0,!1,1],["yard","yd",null,"length",!1,!0,.9144],["year","yr",null,"time",!1,!0,31557600]],o={Yi:["yobi",80,12089258196146292e8,"Yi","yotta"],Zi:["zebi",70,11805916207174113e5,"Zi","zetta"],Ei:["exbi",60,0x1000000000000000,"Ei","exa"],Pi:["pebi",50,0x4000000000000,"Pi","peta"],Ti:["tebi",40,1099511627776,"Ti","tera"],Gi:["gibi",30,1073741824,"Gi","giga"],Mi:["mebi",20,1048576,"Mi","mega"],ki:["kibi",10,1024,"ki","kilo"]},s={Y:["yotta",1e24,"Y"],Z:["zetta",1e21,"Z"],E:["exa",1e18,"E"],P:["peta",1e15,"P"],T:["tera",1e12,"T"],G:["giga",1e9,"G"],M:["mega",1e6,"M"],k:["kilo",1e3,"k"],h:["hecto",100,"h"],e:["dekao",10,"e"],d:["deci",.1,"d"],c:["centi",.01,"c"],m:["milli",.001,"m"],u:["micro",1e-6,"u"],n:["nano",1e-9,"n"],p:["pico",1e-12,"p"],f:["femto",1e-15,"f"],a:["atto",1e-18,"a"],z:["zepto",1e-21,"z"],y:["yocto",1e-24,"y"]};let l,u=null,c=null,h=t,d=r,f=1,g=1;for(let e=0;e=0)&&(u=i[e]),(i[e][1]===d||l.indexOf(d)>=0)&&(c=i[e]);if(null===u){const e=o[t.substring(0,2)];let r=s[t.substring(0,1)];"da"===t.substring(0,2)&&(r=["dekao",10,"da"]),e?(f=e[2],h=t.substring(2)):r&&(f=r[1],h=t.substring(r[2].length));for(let e=0;e=0)&&(u=i[e])}if(null===c){const e=o[r.substring(0,2)];let t=s[r.substring(0,1)];"da"===r.substring(0,2)&&(t=["dekao",10,"da"]),e?(g=e[2],d=r.substring(2)):t&&(g=t[1],d=r.substring(t[2].length));for(let e=0;e=0)&&(c=i[e])}return null===u||null===c||u[3]!==c[3]?n.na:e*u[6]*f/(c[6]*g)}function I(e,t){if((e=(0,a.parseNumber)(e))instanceof Error)return e;if(!/^-?[0-9]{1,3}$/.test(e)||e<-512||e>511)return n.num;if(e<0)return"1"+(0,o.REPT)("0",9-(512+e).toString(2).length)+(512+e).toString(2);const r=parseInt(e,10).toString(2);return void 0===t?r:isNaN(t)?n.value:t<0?n.num:(t=Math.floor(t))>=r.length?(0,o.REPT)("0",t-r.length)+r:n.num}function A(e,t){if((e=(0,a.parseNumber)(e))instanceof Error)return e;if(!/^-?[0-9]{1,12}$/.test(e)||e<-549755813888||e>549755813887)return n.num;if(e<0)return(1099511627776+e).toString(16).toUpperCase();const r=parseInt(e,10).toString(16).toUpperCase();return void 0===t?r:isNaN(t)?n.value:t<0?n.num:(t=Math.floor(t))>=r.length?(0,o.REPT)("0",t-r.length)+r:n.num}function T(e,t){if((e=(0,a.parseNumber)(e))instanceof Error)return e;if(!/^-?[0-9]{1,9}$/.test(e)||e<-536870912||e>536870911)return n.num;if(e<0)return(1073741824+e).toString(8);const r=parseInt(e,10).toString(8);return void 0===t?r:isNaN(t)?n.value:t<0?n.num:(t=Math.floor(t))>=r.length?(0,o.REPT)("0",t-r.length)+r:n.num}function E(e,t){return e=(0,a.parseNumber)(e),t=void 0===t?0:(0,a.parseNumber)(t),(0,a.anyIsParsedError)(e,t)?n.value:e===t?1:0}function M(e,t){return e=(0,a.parseNumber)(e),t=void 0===t?0:(0,a.parseNumber)(t),(0,a.anyIsParsedError)(e,t)?n.value:(e=0===e?0:i.default.erf(e),0!==t?i.default.erf(t)-e:e)}function k(e){return isNaN(e)?n.value:0===e?1:i.default.erfc(e)}function N(e,t){return e=(0,a.parseNumber)(e),t=void 0===t?0:(0,a.parseNumber)(t),(0,a.anyIsParsedError)(t,e)?n.value:e>=t?1:0}function O(e,t){if(!/^[0-9A-Fa-f]{1,10}$/.test(e))return n.num;const r=10===e.length&&"f"===e.substring(0,1).toLowerCase(),i=r?parseInt(e,16)-1099511627776:parseInt(e,16);if(i<-512||i>511)return n.num;if(r)return"1"+(0,o.REPT)("0",9-(512+i).toString(2).length)+(512+i).toString(2);const a=i.toString(2);return void 0===t?a:isNaN(t)?n.value:t<0?n.num:(t=Math.floor(t))>=a.length?(0,o.REPT)("0",t-a.length)+a:n.num}function D(e){if(!/^[0-9A-Fa-f]{1,10}$/.test(e))return n.num;const t=parseInt(e,16);return t>=549755813888?t-1099511627776:t}function L(e,t){if(!/^[0-9A-Fa-f]{1,10}$/.test(e))return n.num;const r=parseInt(e,16);if(r>536870911&&r<0xffe0000000)return n.num;if(r>=0xffe0000000)return(r-0xffc0000000).toString(8);const i=r.toString(8);return void 0===t?i:isNaN(t)?n.value:t<0?n.num:(t=Math.floor(t))>=i.length?(0,o.REPT)("0",t-i.length)+i:n.num}function P(e){const t=K(e),r=F(e);return ce(t,r)?n.num:Math.sqrt(Math.pow(t,2)+Math.pow(r,2))}function F(e){if(void 0===e||!0===e||!1===e)return n.value;if((0,c.default)(e)&&(e=e.toString()),0===e||"0"===e)return 0;if(["i","j"].indexOf(e)>=0)return 1;let t=(e=e.replace("+i","+1i").replace("-i","-1i").replace("+j","+1j").replace("-j","-1j")).indexOf("+"),r=e.indexOf("-");0===t&&(t=e.indexOf("+",1)),0===r&&(r=e.indexOf("-",1));const i=e.substring(e.length-1,e.length),o="i"===i||"j"===i;return t>=0||r>=0?o?t>=0?isNaN(e.substring(0,t))||isNaN(e.substring(t+1,e.length-1))?n.num:Number(e.substring(t+1,e.length-1)):isNaN(e.substring(0,r))||isNaN(e.substring(r+1,e.length-1))?n.num:-Number(e.substring(r+1,e.length-1)):n.num:o?isNaN(e.substring(0,e.length-1))?n.num:e.substring(0,e.length-1):isNaN(e)?n.num:0}function B(e){const t=K(e),r=F(e);return ce(t,r)?n.num:0===t&&0===r?n.div0:0===t&&r>0?Math.PI/2:0===t&&r<0?-Math.PI/2:0===r&&t>0?0:0===r&&t<0?-Math.PI:t>0?Math.atan(r/t):t<0&&r>=0?Math.atan(r/t)+Math.PI:Math.atan(r/t)-Math.PI}function V(e){(0,c.default)(e)&&(e=e.toString());const t=K(e),r=F(e);if(ce(t,r))return n.num;let i=e.substring(e.length-1);return i="i"===i||"j"===i?i:"i",0!==r?S(t,-r,i):e}function H(e){(0,c.default)(e)&&(e=e.toString());const t=K(e),r=F(e);if(ce(t,r))return n.num;let i=e.substring(e.length-1);return i="i"===i||"j"===i?i:"i",S(Math.cos(t)*(Math.exp(r)+Math.exp(-r))/2,-Math.sin(t)*(Math.exp(r)-Math.exp(-r))/2,i)}function U(e){(0,c.default)(e)&&(e=e.toString());const t=K(e),r=F(e);if(ce(t,r))return n.num;let i=e.substring(e.length-1);return i="i"===i||"j"===i?i:"i",S(Math.cos(r)*(Math.exp(t)+Math.exp(-t))/2,Math.sin(r)*(Math.exp(t)-Math.exp(-t))/2,i)}function z(e){const t=K(e),r=F(e);if(ce(t,r))return n.num;let i="i";"j"===e.substring(e.length-1)&&(i="j");const o=Math.sin(t),a=(Math.exp(r)-Math.exp(-r))/2,s=Math.cos(t),l=(Math.exp(r)+Math.exp(-r))/2,u=l*l-s*s;return S(o*s/u,-a*l/u,i)}function W(e,t){(0,c.default)(e)&&(e=e.toString()),(0,c.default)(t)&&(t=t.toString());const r=K(e),i=F(e),o=K(t),a=F(t);if(ce(r,i,o,a))return n.num;const s=e.substring(e.length-1),l=t.substring(t.length-1);let u="i";if(("j"===s||"j"===l)&&(u="j"),0===o&&0===a)return n.num;const h=o*o+a*a;return S((r*o+i*a)/h,(i*o-r*a)/h,u)}function G(e){(0,c.default)(e)&&(e=e.toString());const t=K(e),r=F(e);if(ce(t,r))return n.num;let i=e.substring(e.length-1);i="i"===i||"j"===i?i:"i";const o=Math.exp(t);return S(o*Math.cos(r),o*Math.sin(r),i)}function j(e){(0,c.default)(e)&&(e=e.toString());const t=K(e),r=F(e);if(ce(t,r))return n.num;let i=e.substring(e.length-1);return i="i"===i||"j"===i?i:"i",S(Math.log(Math.sqrt(t*t+r*r)),Math.atan(r/t),i)}function Y(e){(0,c.default)(e)&&(e=e.toString());const t=K(e),r=F(e);if(ce(t,r))return n.num;let i=e.substring(e.length-1);return i="i"===i||"j"===i?i:"i",S(Math.log(Math.sqrt(t*t+r*r))/Math.log(10),Math.atan(r/t)/Math.log(10),i)}function X(e){(0,c.default)(e)&&(e=e.toString());const t=K(e),r=F(e);if(ce(t,r))return n.num;let i=e.substring(e.length-1);return i="i"===i||"j"===i?i:"i",S(Math.log(Math.sqrt(t*t+r*r))/Math.log(2),Math.atan(r/t)/Math.log(2),i)}function $(e,t){if((0,c.default)(e)&&(e=e.toString()),ce(t=(0,a.parseNumber)(t),K(e),F(e)))return n.num;let r=e.substring(e.length-1);r="i"===r||"j"===r?r:"i";const i=Math.pow(P(e),t),o=B(e);return S(i*Math.cos(t*o),i*Math.sin(t*o),r)}function q(){if(arguments.length<1)return n.na;const e=(0,a.flatten)(Array.from(arguments).filter((e=>null!=e))).map((e=>""===e?0:e));if(0===e.length)return n.na;let t=e[0];for(let r=1;r=0)return 0;let t=e.indexOf("+"),r=e.indexOf("-");0===t&&(t=e.indexOf("+",1)),0===r&&(r=e.indexOf("-",1));const i=e.substring(e.length-1,e.length),o="i"===i||"j"===i;return t>=0||r>=0?o?t>=0?isNaN(e.substring(0,t))||isNaN(e.substring(t+1,e.length-1))?n.num:Number(e.substring(0,t)):isNaN(e.substring(0,r))||isNaN(e.substring(r+1,e.length-1))?n.num:Number(e.substring(0,r)):n.num:o?isNaN(e.substring(0,e.length-1))?n.num:0:isNaN(e)?n.num:e}function J(e){return!0===e||!1===e?n.value:ce(K(e),F(e))?n.num:W("1",H(e))}function Z(e){const t=K(e),r=F(e);if(ce(t,r))return n.num;let i="i";"j"===e.substring(e.length-1)&&(i="j");const o=Math.sin(r),a=(Math.exp(t)-Math.exp(-t))/2,s=Math.cos(r),l=s*s+a*a;return S(s*((Math.exp(t)+Math.exp(-t))/2)/l,-o*a/l,i)}function Q(e){(0,c.default)(e)&&(e=e.toString());const t=K(e),r=F(e);if(ce(t,r))return n.num;let i=e.substring(e.length-1);return i="i"===i||"j"===i?i:"i",S(Math.sin(t)*(Math.exp(r)+Math.exp(-r))/2,Math.cos(t)*(Math.exp(r)-Math.exp(-r))/2,i)}function ee(e){(0,c.default)(e)&&(e=e.toString());const t=K(e),r=F(e);if(ce(t,r))return n.num;let i=e.substring(e.length-1);return i="i"===i||"j"===i?i:"i",S(Math.cos(r)*(Math.exp(t)-Math.exp(-t))/2,Math.sin(r)*(Math.exp(t)+Math.exp(-t))/2,i)}function te(e){if((0,c.default)(e)&&(e=e.toString()),ce(K(e),F(e)))return n.num;let t=e.substring(e.length-1);t="i"===t||"j"===t?t:"i";const r=Math.sqrt(P(e)),i=B(e);return S(r*Math.cos(i/2),r*Math.sin(i/2),t)}function re(e){return!0===e||!1===e?n.value:ce(K(e),F(e))?n.num:W("1",Q(e))}function ne(e){if(!0===e||!1===e)return n.value;const t=K(e),r=F(e);if(ce(t,r))return n.num;let i="i";"j"===e.substring(e.length-1)&&(i="j");const o=Math.sin(r),a=(Math.exp(t)-Math.exp(-t))/2,s=o*o+a*a;return S(Math.cos(r)*a/s,-o*((Math.exp(t)+Math.exp(-t))/2)/s,i)}function ie(e,t){(0,c.default)(e)&&(e=e.toString()),(0,c.default)(t)&&(t=t.toString());const r=K(e),i=F(e),o=K(t),a=F(t);if(ce(r,i,o,a))return n.num;const s=e.substring(e.length-1),l=t.substring(t.length-1);let u="i";return("j"===s||"j"===l)&&(u="j"),S(r-o,i-a,u)}function oe(){if(arguments.length<1)return n.na;const e=(0,a.flatten)(Array.from(arguments).filter((e=>null!=e))).map((e=>""===e?0:e));if(0===e.length)return n.na;let t=e[0];for(let r=1;r511)return n.num;if(r)return"1"+(0,o.REPT)("0",9-(512+i).toString(2).length)+(512+i).toString(2);const a=i.toString(2);return void 0===t?a:isNaN(t)?n.value:t<0?n.num:(t=Math.floor(t))>=a.length?(0,o.REPT)("0",t-a.length)+a:n.num}function le(e){if(!/^[0-7]{1,10}$/.test(e))return n.num;const t=parseInt(e,8);return t>=536870912?t-1073741824:t}function ue(e,t){if(!/^[0-7]{1,10}$/.test(e))return n.num;const r=parseInt(e,8);if(r>=536870912)return"FF"+(r+3221225472).toString(16).toUpperCase();const i=r.toString(16).toUpperCase();return void 0===t?i:isNaN(t)?n.value:t<0?n.num:(t=Math.floor(t))>=i.length?(0,o.REPT)("0",t-i.length)+i:n.num}function ce(){return Array.prototype.some.call(arguments,s.isError)}M.PRECISE=function(e,t){return M(e,t)},k.PRECISE=function(e){const t=M.PRECISE(e);return(0,s.isError)(t)?t:1-t}},99613:(e,t,r)=>{"use strict";r.d(t,{calc:()=>d,data:()=>f,div0:()=>i,error:()=>h,loading:()=>g,na:()=>u,name:()=>s,nil:()=>n,num:()=>l,ref:()=>a,spill:()=>c,value:()=>o});const n=new Error("#NULL!"),i=new Error("#DIV/0!"),o=new Error("#VALUE!"),a=new Error("#REF!"),s=new Error("#NAME?"),l=new Error("#NUM!"),u=new Error("#N/A"),c=new Error("#SPILL!"),h=new Error("#ERROR!"),d=new Error("#CALC!"),f=new Error("#GETTING_DATA"),g=new Error("#LOADING!")},36529:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ACCRINT:()=>s,CUMIPMT:()=>l,CUMPRINC:()=>u,DB:()=>c,DDB:()=>h,DOLLARDE:()=>d,DOLLARFR:()=>f,EFFECT:()=>g,FV:()=>p,FVSCHEDULE:()=>m,IPMT:()=>v,IRR:()=>y,ISPMT:()=>C,MIRR:()=>x,NOMINAL:()=>w,NPER:()=>_,NPV:()=>R,PDURATION:()=>S,PMT:()=>b,PPMT:()=>I,PV:()=>A,RATE:()=>T,RRI:()=>E,SLN:()=>M,SYD:()=>k,TBILLEQ:()=>N,TBILLPRICE:()=>O,TBILLYIELD:()=>D,XIRR:()=>L,XNPV:()=>P});var n=r(99613),i=r(41430),o=r(26258),a=r(27771);function s(e,t,r,a,s,l,u){return e=(0,o.parseDate)(this,e),t=(0,o.parseDate)(this,t),r=(0,o.parseDate)(this,r),void 0===u&&(u=0),(0,o.anyIsParsedError)(e,t,r)?n.value:a<=0||s<=0||-1===[1,2,4].indexOf(l)||-1===[0,1,2,3,4].indexOf(u)||r<=e?n.num:(u=u||0,(s=s||0)*a*(0,i._YEARFRAC)(e,r,u))}function l(e,t,r,i,a,s){if(e=(0,o.parseNumber)(e),t=(0,o.parseNumber)(t),r=(0,o.parseNumber)(r),(0,o.anyIsParsedError)(e,t,r))return n.value;if(e<=0||t<=0||r<=0)return n.num;if(i<1||a<1||i>a)return n.num;if(0!==s&&1!==s)return n.num;const l=b(e,t,r,0,s);let u=0;1===i&&(s<=0&&(u=-r),i++);for(let t=i;t<=a;t++)u+=s>0?p(e,t-2,l,r,1)-l:p(e,t-1,l,r,0);return u*=e,u}function u(e,t,r,i,a,s){if(e=(0,o.parseNumber)(e),t=(0,o.parseNumber)(t),r=(0,o.parseNumber)(r),(0,o.anyIsParsedError)(e,t,r))return n.value;if(e<=0||t<=0||r<=0)return n.num;if(i<1||a<1||i>a)return n.num;if(0!==s&&1!==s)return n.num;const l=b(e,t,r,0,s);let u=0;1===i&&(u=0===s?l+r*e:l,i++);for(let t=i;t<=a;t++)u+=s>0?l-(p(e,t-2,l,r,1)-l)*e:l-p(e,t-1,l,r,0)*e;return u}function c(e,t,r,i,a){if(e=(0,o.parseNumber)(e),t=(0,o.parseNumber)(t),r=(0,o.parseNumber)(r),i=(0,o.parseNumber)(i),a=void 0===a?12:(0,o.parseNumber)(a),(0,o.anyIsParsedError)(e,t,r,i,a))return n.value;if(e<0||t<0||r<0||i<0)return n.num;if(-1===[1,2,3,4,5,6,7,8,9,10,11,12].indexOf(a))return n.num;const s=12===a?0:1;if(i>r+s)return n.num;const l=(1-Math.pow(t/e,1/r)).toFixed(3),u=e*l*a/12;let c=u,h=0;const d=i===r+s?i-1:i;for(let t=2;t<=d;t++)h=(e-c)*l,c+=h;let f;return 1===i?f=u:i===r+s?(h=(e-c)*l,f=1===s?h*(12-a)/12:h):f=h,f}function h(e,t,r,i,a){if(e=(0,o.parseNumber)(e),t=(0,o.parseNumber)(t),r=(0,o.parseNumber)(r),i=(0,o.parseNumber)(i),a=void 0===a?2:(0,o.parseNumber)(a),(0,o.anyIsParsedError)(e,t,r,i,a))return n.value;if(e<0||t<0||r<0||i<0||a<=0)return n.num;if(i>r)return n.num;if(t>=e)return 0;let s=0,l=0;for(let n=1;n<=i;n++)l=Math.min(a/r*(e-s),e-t-s),s+=l;return l}function d(e,t){if(e=(0,o.parseNumber)(e),t=(0,o.parseNumber)(t),(0,o.anyIsParsedError)(e,t))return n.value;if(t<0)return n.num;if(t>=0&&t<1)return n.div0;t=parseInt(t,10);let r=parseInt(e,10);r+=e%1*Math.pow(10,Math.ceil(Math.log(t)/Math.LN10))/t;const i=Math.pow(10,Math.ceil(Math.log(t)/Math.LN2)+1);return r=Math.round(r*i)/i,r}function f(e,t){if(e=(0,o.parseNumber)(e),t=(0,o.parseNumber)(t),(0,o.anyIsParsedError)(e,t))return n.value;if(t<0)return n.num;if(t>=0&&t<1)return n.div0;t=parseInt(t,10);let r=parseInt(e,10);return r+=e%1*Math.pow(10,-Math.ceil(Math.log(t)/Math.LN10))*t,r}function g(e,t){return e=(0,o.parseNumber)(e),t=(0,o.parseNumber)(t),(0,o.anyIsParsedError)(e,t)?n.value:e<=0||t<1?n.num:(t=parseInt(t,10),Math.pow(1+e/t,t)-1)}function p(e,t,r,i,a){if(e=(0,o.parseNumber)(e),t=(0,o.parseNumber)(t),r=(0,o.parseNumber)(r),i=void 0===i?0:(0,o.parseNumber)(i),a=void 0===a?0:(0,o.parseNumber)(a),(0,o.anyIsParsedError)(e,t,r,i,a))return n.value;let s;if(0===e)s=i+r*t;else{const n=Math.pow(1+e,t);s=1===a?i*n+r*(1+e)*(n-1)/e:i*n+r*(n-1)/e}return-s}function m(e,t){if(e=(0,o.parseNumber)(e),(0,a.default)(t)||(t=[t]),t=(0,o.parseNumberArray)((0,o.flatten)(t)),(0,o.anyIsParsedError)(e,t))return n.value;const r=t.length;let i=e;for(let e=0;e0&&(s=!0),e[t]<0&&(l=!0);if(!s||!l)return n.num;let u,c,h,d=t=void 0===t?.1:t,f=!0;do{h=r(e,a,d),u=d-h/i(e,a,d),c=Math.abs(u-d),d=u,f=c>1e-10&&Math.abs(h)>1e-10}while(f);return d}function C(e,t,r,i){return e=(0,o.parseNumber)(e),t=(0,o.parseNumber)(t),r=(0,o.parseNumber)(r),i=(0,o.parseNumber)(i),(0,o.anyIsParsedError)(e,t,r,i)?n.value:i*e*(t/r-1)}function x(e,t,r){if(e=(0,o.parseNumberArray)((0,o.flatten)(e)),t=(0,o.parseNumber)(t),r=(0,o.parseNumber)(r),(0,o.anyIsParsedError)(e,t,r))return n.value;const i=e.length;t++,r++;let a=0,s=1,l=0,u=1,c=!1,h=!1;for(let n=0;n0?(h=!0,a+=e[n]*s):e[n]<0&&(c=!0,l+=e[n]*u),s/=r,u/=t;if(!c||!h)return n.div0;let d=-a/l;return d*=Math.pow(r,i-1),Math.pow(d,1/(i-1))-1}function w(e,t){return e=(0,o.parseNumber)(e),t=(0,o.parseNumber)(t),(0,o.anyIsParsedError)(e,t)?n.value:e<=0||t<1?n.num:(t=parseInt(t,10),(Math.pow(e+1,1/t)-1)*t)}function _(e,t,r,i,a){if(e=(0,o.parseNumber)(e),t=(0,o.parseNumber)(t),r=(0,o.parseNumber)(r),i=void 0===i?0:(0,o.parseNumber)(i),a=void 0===a?0:(0,o.parseNumber)(a),(0,o.anyIsParsedError)(e,t,r,i,a))return n.value;if(0===e)return-(r+i)/t;{const n=t*(1+e*a)-i*e,o=r*e+t*(1+e*a);return Math.log(n/o)/Math.log(1+e)}}function R(){if(arguments.length<2)return n.na;const e=(0,o.parseNumberArray)((0,o.flatten)(arguments).map((e=>""===e||null==e?0:e)));if(e instanceof Error)return e;const t=e[0];let r=0;for(let n=1;nr?n.num:(e-t)*(r-(i=parseInt(i,10))+1)*2/(r*(r+1))}function N(e,t,r){if(e=(0,o.parseDate)(this,e),t=(0,o.parseDate)(this,t),r=(0,o.parseNumber)(r),(0,o.anyIsParsedError)(e,t,r))return n.value;if(r<=0)return n.num;if(e>t)return n.num;if(t-e>31536e6)return n.num;const a=(0,i._DAYS)(t,e);if(t-e>157248e5){const e=(a/365-.5)/2,t=a/365,n=-r*a/(360-r*a);return(Math.sqrt(t*t-4*e*n)-t)/(2*e)}return 365*r/(360-r*a)}function O(e,t,r){if(e=(0,o.parseDate)(this,e),t=(0,o.parseDate)(this,t),r=(0,o.parseNumber)(r),(0,o.anyIsParsedError)(e,t,r))return n.value;if(r<=0)return n.num;if(e>t)return n.num;if(t-e>31536e6)return n.num;const a=100*(1-r*(0,i._DAYS)(t,e)/360);return a>=0?a:n.num}function D(e,t,r){return e=(0,o.parseDate)(this,e),t=(0,o.parseDate)(this,t),r=(0,o.parseNumber)(r),(0,o.anyIsParsedError)(e,t,r)?n.value:r<=0||e>t||t-e>31536e6?n.num:360*(100-r)/(r*(0,i._DAYS)(t,e))}function L(e,t,r){if(e=(0,o.parseNumberArray)((0,o.flatten)(e)),t=(0,o.parseDateArray)(this,(0,o.flatten)(t)),r=void 0===r?.1:(0,o.parseNumber)(r),(0,o.anyIsParsedError)(e,t,r))return n.value;const a=function(e,t,r){const n=r+1;let o=e[0];for(let r=1;r0&&(l=!0),e[t]<0&&(u=!0);if(!l||!u)return n.num;if(e.length!==t.length)return n.num;let c,h,d,f=r=r||.1,g=!0;do{d=a(e,t,f),c=f-d/s(e,t,f),h=Math.abs(c-f),f=c,g=h>1e-10&&Math.abs(d)>1e-10}while(g);return f}function P(e,t,r){if(e=(0,o.parseNumber)(e),t=(0,o.parseNumberArray)((0,o.flatten)(t)),r=(0,o.parseDateArray)(this,(0,o.flatten)(r)),(0,o.anyIsParsedError)(e,t,r))return n.value;let a=0;for(let n=0;n{"use strict";r.d(t,{default:()=>o});const n=[r(85862),r(30770),r(76076),r(25412),r(41430),r(36529),r(35455),r(68332),r(25845),r(43067),r(54423),r(56708)],i={};for(const e in n){const t=n[e];for(const e in t)i[e]=t[e]}const o=i},35455:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ERROR:()=>i,ISBINARY:()=>a,ISBLANK:()=>o,ISERR:()=>s,ISERROR:()=>l,ISEVEN:()=>u,ISLOGICAL:()=>c,ISNA:()=>h,ISNONTEXT:()=>d,ISNUMBER:()=>f,ISODD:()=>g,ISTEXT:()=>p,N:()=>m,NA:()=>v,TYPE:()=>y});var n=r(99613);const i={};function o(){return arguments.length<1?n.na:1===arguments.length&&null===arguments[0]}function a(e){return/^[01]{1,10}$/.test(e)}function s(e){return"[object Error]"===Object.prototype.toString.apply(e)&&(e=e.message),[n.value.message,n.ref.message,n.div0.message,n.num.message,n.name.message,n.nil.message].indexOf(e)>=0||"number"==typeof e&&(isNaN(e)||!isFinite(e))}function l(e){return"[object Error]"===Object.prototype.toString.apply(e)&&(e=e.message),s(e)||e===n.na.message}function u(e){return!(1&Math.floor(Math.abs(e)))}function c(e){return!0===e||!1===e}function h(e){return"[object Error]"===Object.prototype.toString.apply(e)&&(e=e.message),e===n.na.message}function d(e){return"string"!=typeof e}function f(e){return"number"==typeof e&&!isNaN(e)&&isFinite(e)}function g(e){return!!(1&Math.floor(Math.abs(e)))}function p(e){return"string"==typeof e}function m(e){return f(e)?e:!0===e?1:!1===e?0:l(e)?e:0}function v(){return n.na}function y(e){return null===e||f(e)?1:p(e)?2:c(e)?4:l(e)?16:Array.isArray(e)?64:void 0}i.TYPE=function(e){switch("[object Error]"===Object.prototype.toString.apply(e)&&(e=e.message),e){case n.nil.message:return 1;case n.div0.message:return 2;case n.value.message:return 3;case n.ref.message:return 4;case n.name.message:return 5;case n.num.message:return 6;case n.na.message:return 7;case n.data.message:return 8}return n.na}},30770:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AND:()=>a,CHOOSE:()=>s,FALSE:()=>l,IF:()=>u,IFERROR:()=>h,IFNA:()=>d,IFS:()=>c,NOT:()=>f,OR:()=>g,SWITCH:()=>v,TRUE:()=>p,XOR:()=>m});var n=r(99613),i=r(26258),o=r(35455);function a(){if(arguments.length<1)return n.na;const e=(0,i.flatten)(arguments);let t=!0;for(let r=0;r254||arguments.length3?n.na:(2===arguments.length&&(r=!1),e?t:r)}function c(){const e=arguments.length;if(e%2==1)return n.na;for(let t=0;t0){const t=arguments[0],r=arguments.length-1,n=Math.floor(r/2);let i=!1;const o=r%2==0?null:arguments[arguments.length-1];if(n)for(let r=0;r{"use strict";r.r(t),r.d(t,{FILTER:()=>L,HLOOKUP:()=>E,IMPORTRANGE:()=>V,MATCH:()=>A,SORT:()=>N,SORTBY:()=>O,TRANSPOSE:()=>F,UNIQUE:()=>B,VLOOKUP:()=>M,XLOOKUP:()=>k});var n=r(99613),i=r(26258),o=r(37233),a=r(44499),s=r(3288),l=r(82239),u=r(50039),c=r(2813),h=r(51388),d=r(81394),f=r(28488),g=r(48961),p=r(72208);const m={Exact:0,NextGreater:1,NextLittler:-1,Regex:2},v={Linear:1,ReversedLinear:-1,Binary:2,ReversedBinary:-2},y={number:1,string:2,boolean:3},C=new u.ResolveOption,x=(new u.ResolveOption).assign({keepNull:!0});function w(e,t){const r=y[typeof e],n=y[typeof t];return void 0===r||void 0===n?-1:r!==n?r0&&(-1===a||r(c,o)<0)&&(o=c,a=u)}return a}function I(e,t,r,n,i){void 0===n&&(n=!0),void 0===i&&(i=null);let a=w,s=!0;return i?s=i>0:(i=t===m.Exact?v.Linear:t===m.NextLittler?v.Binary:v.ReversedBinary,s=t!==m.NextLittler),i===v.Binary||i===v.ReversedBinary?(i===v.ReversedBinary&&(a=_),function(e,t,r,n,i,o){void 0===n&&(n=!0),void 0===i&&(i=!0),void 0===o&&(o=!0);let a=0,s=t.getLength()-1;for(;a<=s;){const n=Math.floor((a+s)/2),i=r(t.getValue(n),e);if(0===i){if(a===s)return n;o?s=n:a=n+1}else i>0?s=n-1:i<0&&(a=n+1)}return a=0&&0===r(t.getValue(s),e)?s:n?-1:i?s>=0?s:-1:a3||null===e)return n.na;const a={0:m.Exact,1:m.NextLittler,[-1]:m.NextGreater};if(o<3)r=m.NextLittler;else{if("number"!=typeof r)return n.value;if(!(r in a))return n.na;r=a[r]}let s=-1;if(t.isRef()){const n=this,[i,o,a]=H(t),[l,u,c]=U(t);o===a?s=n.createRowVector(i,x,t.isImplicit,I.bind(null,e,r)):u===c&&(s=n.createColumnVector(l,x,t.isImplicit,I.bind(null,e,r)))}else if(t.isArray()){const n=t.resolve();(1===n.length||n.every((e=>1===e.length)))&&(s=I(e,r,new G((0,i.flatten)(n))))}return s<0?n.na:s+1}function T(e,t,r,n,i){const o=I(e,t,r,n,i);return o<0?-1:o+r.getStartOffset()}function E(e,t,r,o){const a=arguments.length;if(a<3||a>4||null===e)return n.na;if("number"!=typeof r||null!=o&&"boolean"!=typeof o)return n.value;const s=a<4||o?m.NextLittler:m.Exact,u=this;let c=0,h=-1,d=n.na;if(t.isRef()){const[i,o,a]=H(t);if(c=o+r-1,c>a)return n.ref;h=u.createRowVector(i,x,t.isImplicit,T.bind(null,e,s)),d=h>-1?u.cellValue(l.RefExpr.fromCell({row:c,col:h},i.shName,t.isImplicit),x):n.na}else if(t.isArray()){const o=(0,i.convertInto2D)(t.resolve());if(c=r-1,c>=o.length)return n.ref;h=T(e,s,new G(o[0])),d=h>-1?o[c][h]:n.na}return d}function M(e,t,r,o){const a=arguments.length;if(a<3||a>4||null===e)return n.na;if("number"!=typeof r||null!=o&&"boolean"!=typeof o)return n.value;const s=a<4||o?m.NextLittler:m.Exact,u=this;let c=-1,h=0,d=n.na;if(t.isRef()){const[i,o,a]=U(t);if(h=o+r-1,h>a)return n.ref;c=u.createColumnVector(i,x,t.isImplicit,T.bind(null,e,s)),d=c>-1?u.cellValue(l.RefExpr.fromCell({row:c,col:h},i.shName,t.isImplicit),x):n.na}else if(t.isArray()){const o=(0,i.convertInto2D)(t.resolve());if(h=r-1,h>=o[0].length)return n.ref;c=T(e,s,new G(W(o))),d=c>-1?o[c][h]:n.na}return d}function k(e,t,r,o,a,s){const u=arguments.length;if(u<3||u>6)return n.na;if(e=e??"",a=(0,i.parseNumber)(a??0),s=(0,i.parseNumber)(s??1),(0,p.isError)(a)||(0,p.isError)(s))return n.value;if(a=Math.floor(a),s=Math.floor(s),!Object.values(m).includes(a)||!Object.values(v).includes(s))return n.value;if(a===m.Regex&&(s===v.Binary||s===v.ReversedBinary))return n.value;const c=a===m.Regex?m.Exact:a,h=a===m.Regex,d=this;let f=n.na;const y=e=>{let{height:t,width:r}=(0,g.getArrayDimension)(e,d);return{height:t||1,width:r||1}},x=y(t),w=y(r);if(x.width>1&&x.height>1)return n.value;const _=x.height>1;if(_?x.height!==w.height:x.width!==w.width)return n.value;let R;if(t.isRef()){const[e]=_?U(t):H(t);R=(_?d.createColumnVector.bind(d):d.createRowVector.bind(d))(e,C,t.isImplicit,(e=>e))}else if(t.isArray()){const e=(0,i.convertInto2D)(t.resolve());R=new G(_?W(e):e[0])}else{if(!t.isValue())return n.value;R=new G([t.v])}const S=T(e,c,R,h,s)-R.getStartOffset();if(S<0)f=o??n.na;else if(r.isRef()){let e,n,i=r.toCellRef(d).toRange(),o=!1;if(_){const t=i.from.row+S;e={row:t,col:i.from.col},n={row:t,col:i.to.col},o=w.width>1}else{const t=i.from.col+S;e={row:i.from.row,col:t},n={row:i.to.row,col:t},o=w.height>1}f=o?l.RefExpr.fromRange({from:e,to:n},i.shName,t.isImplicit):l.RefExpr.fromCell(e,i.shName,t.isImplicit)}else if(r.isArray()){const e=(0,i.convertInto2D)(r.resolve());f=_?w.width>1?[e[S]]:e[S][0]:w.height>1?z(e,S).map((e=>[e])):e[0][S]}else{if(!r.isValue())return n.value;f=r.v}return f}function N(e,t,r,o){if(e=(0,i.convertInto2D)(e),t=(0,i.parseNumber)(t??1),r=(0,i.parseNumber)(r??1),o=(0,i.parseBool)(o??!1),(0,i.anyIsParsedError)(t,r,o))return n.value;const a=o?e[0].length:e.length,s=o?e.length:e[0].length;if(t<1||t>s||1!==r&&-1!==r)return n.value;const l=(0,c.getSortOrder)((r=>o?e[t-1][r]:e[r][t-1]),a,1,this.getLocale().getCollator(),1===r);return D(e,o,l)}function O(e,t,r){if(arguments.length>3&&arguments.length%2!=1)return n.value;e=(0,i.convertInto2D)(e),t=(0,i.convertInto2D)(t),r=(0,i.parseNumber)(r??1);const o=t.length,a=t[0].length,s=o===e.length&&1===a,l=a===e[0].length&&1===o;if(!s&&!l||1!==r&&-1!==r)return n.value;const u=[1===r];for(let e=3;e{const r=arguments[2*t+1];return r?l?r[0][e]:r[e][0]:null}),l?a:o,u.length,this.getLocale().getCollator(),u);return D(e,l,h)}function D(e,t,r){const n=(0,h.make2dArray)(e.length,e[0].length);for(let i=0;i{let[t]=e;return(0,i.parseBool)(t)}));return(0,i.anyIsParsedError)(...s)?n.value:P(e,s,a,r)}function P(e,t,r,i){if(!t.some((e=>e)))return i??n.calc;const o=(e,r)=>t[r];return r?e.map((e=>e.filter(o))):e.filter(o)}function F(e){return void 0===e?n.na:(e=(0,i.convertInto2D)(e))[0].map(((t,r)=>e.map((e=>e[r]))))}function B(e,t,r){return e=(0,i.convertInto2D)(e),t=(0,i.parseBool)(t??!1),r=(0,i.parseBool)(r??!1),(0,i.anyIsParsedError)(t,r)?n.value:P(e,(0,d.findUnique)(e,t,r),t)}function V(e,t){if(!e||!t)return n.na;const r=(0,s.tokenize)(t);return 1===r.size()&&r.get(0).isRange()?this.getExternalRange(e,(0,f.deabsoluteToken)(r.get(0))):n.ref}function H(e){let t,r,n=e.toRange();return e.isCellRef()?(t=n.from.row,r=n.to.row,n.to.row=n.from.row):e.isRowRef()?(t=n.from,r=n.to,n.to=n.from):e.isColRef()&&(t=0,r=Number.MAX_VALUE,n=new a.CellRange({row:0,col:n.from},{row:0,col:n.to},n.shName)),[n,t,r]}function U(e){let t,r,n=e.toRange();return e.isCellRef()?(t=n.from.col,r=n.to.col,n.to.col=n.from.col):e.isRowRef()?(t=0,r=Number.MAX_VALUE,n=new a.CellRange({row:n.from,col:0},{row:n.to,col:0},n.shName)):e.isColRef()&&(t=n.from,r=n.to,n.to=n.from),[n,t,r]}function z(e,t){const r=[];for(let n=0;n{"use strict";r.r(t),r.d(t,{ABS:()=>d,ACOS:()=>f,ACOSH:()=>g,ACOT:()=>p,ACOTH:()=>m,ADD:()=>xe,AGGREGATE:()=>v,ARABIC:()=>y,ASIN:()=>C,ASINH:()=>x,ATAN:()=>w,ATAN2:()=>_,ATANH:()=>R,BASE:()=>S,CEILING:()=>b,COMBIN:()=>I,COMBINA:()=>A,COS:()=>T,COSH:()=>E,COT:()=>M,COTH:()=>k,CSC:()=>N,CSCH:()=>O,DECIMAL:()=>D,DEGREES:()=>L,DIVIDE:()=>_e,EQ:()=>Ae,EVEN:()=>P,EXP:()=>F,FACT:()=>V,FACTDOUBLE:()=>H,FLOOR:()=>U,GCD:()=>z,GTE:()=>Se,INT:()=>W,ISO:()=>G,LCM:()=>j,LN:()=>Y,LOG:()=>X,LOG10:()=>$,LT:()=>be,LTE:()=>Ie,MINUS:()=>we,MOD:()=>q,MROUND:()=>K,MULTINOMIAL:()=>J,MULTIPLY:()=>Re,NE:()=>Te,ODD:()=>Z,PI:()=>Q,POW:()=>Ee,POWER:()=>ee,PRODUCT:()=>te,QUOTIENT:()=>re,RADIANS:()=>ne,RAND:()=>ie,RANDARRAY:()=>oe,RANDBETWEEN:()=>ae,ROMAN:()=>se,ROUND:()=>le,ROUNDDOWN:()=>ue,ROUNDUP:()=>ce,SEC:()=>he,SECH:()=>de,SEQUENCE:()=>Ve,SERIESSUM:()=>fe,SIGN:()=>ge,SIN:()=>pe,SINH:()=>me,SQRT:()=>ve,SQRTPI:()=>ye,SUBTOTAL:()=>Ce,SUM:()=>Me,SUMPRODUCT:()=>ke,SUMSQ:()=>Ne,SUMX2MY2:()=>Oe,SUMX2PY2:()=>De,SUMXMY2:()=>Le,TAN:()=>Pe,TANH:()=>Fe,TRUNC:()=>Be});var n=r(26258),i=r(99613),o=r(43067),a=r(35455),s=r(27771),l=r(290),u=r(51181),c=r(59464),h=r(20956);function d(e){return e=(0,n.parseNumber)(e),(0,n.isParsedError)(e)?e:Math.abs((0,n.parseNumber)(e))}function f(e){return e=(0,n.parseNumber)(e),(0,n.isParsedError)(e)?e:e<-1||e>1?i.num:Math.acos(e)}function g(e){return e=(0,n.parseNumber)(e),(0,n.isParsedError)(e)?e:e<1?i.num:Math.log(e+Math.sqrt(e*e-1))}function p(e){return e=(0,n.parseNumber)(e),(0,n.isParsedError)(e)?e:Math.atan(1/e)}function m(e){return e=(0,n.parseNumber)(e),(0,n.isParsedError)(e)?e:e<-1||e>1?.5*Math.log((e+1)/(e-1)):i.num}function v(e,t,r,a){if(e=(0,n.parseNumber)(e),t=(0,n.parseNumber)(e),(0,n.anyIsParsedError)(e,t))return i.value;switch(e){case 1:return(0,o.AVERAGE)(r);case 2:return(0,o.COUNT)(r);case 3:return(0,o.COUNTA)(r);case 4:return(0,o.MAX)(r);case 5:return(0,o.MIN)(r);case 6:return te(r);case 7:return o.STDEV.S(r);case 8:return o.STDEV.P(r);case 9:return Me(r);case 10:return o.VAR.S(r);case 11:return o.VAR.P(r);case 12:return(0,o.MEDIAN)(r);case 13:return o.MODE.SNGL(r);case 14:return(0,o.LARGE)(r,a);case 15:return(0,o.SMALL)(r,a);case 16:return o.PERCENTILE.INC(r,a);case 17:return o.QUARTILE.INC(r,a);case 18:return o.PERCENTILE.EXC(r,a);case 19:return o.QUARTILE.EXC(r,a)}}function y(e){if(e=e.toUpperCase(),!/^M*(?:D?C{0,3}|C[MD])(?:L?X{0,3}|X[CL])(?:V?I{0,3}|I[XV])$/.test(e))return i.value;let t=0;return e.replace(/[MDLV]|C[MD]?|X[CL]?|I[XV]?/g,(function(e){t+={M:1e3,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1}[e]})),t}function C(e){return(e=(0,n.parseNumber)(e))instanceof Error?e:e>1||e<-1?i.num:Math.asin(e)}function x(e){return(e=(0,n.parseNumber)(e))instanceof Error?e:Math.log(e+Math.sqrt(e*e+1))}function w(e){return(e=(0,n.parseNumber)(e))instanceof Error?e:Math.atan(e)}function _(e,t){return e=(0,n.parseNumber)(e),t=(0,n.parseNumber)(t),(0,n.anyIsParsedError)(e,t)?i.value:0===e&&0===t?i.div0:Math.atan2(t,e)}function R(e){return(e=(0,n.parseNumber)(e))instanceof Error?e:e>=1||e<=-1?i.num:Math.log((1+e)/(1-e))/2}function S(e,t,r){if(r=r||0,e=(0,n.parseNumber)(e),t=(0,n.parseNumber)(t),r=(0,n.parseNumber)(r),(0,n.anyIsParsedError)(e,t,r))return i.value;if(r=void 0===r?0:r,e<0||t<2||t>36||r<0)return i.num;const o=e.toString(t);return new Array(Math.max(r+1-o.length,0)).join("0")+o}function b(e,t){return e=(0,n.parseNumber)(e),t=(0,n.parseNumber)(t),(0,n.anyIsParsedError)(e,t)?i.value:b.MATH(e,t,t<0?1:0)}function I(e,t){return e=(0,n.parseNumber)(e),t=(0,n.parseNumber)(t),(0,n.anyIsParsedError)(e,t)?i.value:e<0||t<0||t>e?i.num:V(e)/(V(t)*V(e-t))}function A(e,t){return e=(0,n.parseNumber)(e),t=(0,n.parseNumber)(t),(0,n.anyIsParsedError)(e,t)?i.value:0===e&&0===t?1:I(e+t-1,e-1)}function T(e){return(e=(0,n.parseNumber)(e))instanceof Error?e:Math.cos(e)}function E(e){return(e=(0,n.parseNumber)(e))instanceof Error?e:(Math.exp(e)+Math.exp(-e))/2}function M(e){return(e=(0,n.parseNumber)(e))instanceof Error?e:1/Math.tan(e)}function k(e){if((e=(0,n.parseNumber)(e))instanceof Error)return e;if(e>15)return 1;const t=Math.exp(2*e);return(t+1)/(t-1)}function N(e){return(e=(0,n.parseNumber)(e))instanceof Error?e:1/Math.sin(e)}function O(e){return(e=(0,n.parseNumber)(e))instanceof Error?e:2/(Math.exp(e)-Math.exp(-e))}function D(e,t){if(arguments.length<1)return i.value;void 0!==e&&""!==e||(e="0");const r=parseInt(e,t);return Number.isNaN(r)?i.num:r}function L(e){return(e=(0,n.parseNumber)(e))instanceof Error?e:180*e/Math.PI}function P(e){return(e=(0,n.parseNumber)(e))instanceof Error?e:b(e,-2)}b.MATH=function(e,t,r){if(e=(0,n.parseNumber)(e),r=void 0===r?0:(0,n.parseNumber)(r),t=void 0===t?1:(0,n.parseNumber)(Math.abs(t)),(0,n.anyIsParsedError)(e,r,t))return i.value;if(0===t||0===e)return 0;const o=-Math.floor(Math.log(t)/Math.log(10));return e>=0?(0,u.default)(Math.ceil(e/t)*t,o):0===r?-(0,u.default)(Math.floor(Math.abs(e)/t)*t,o):-(0,u.default)(Math.ceil(Math.abs(e)/t)*t,o)},b.PRECISE=function(e,t){return b.MATH(e,t,0)};const F=Math.exp,B=[1,1];function V(e){if((e=(0,n.parseNumber)(e))instanceof Error)return e;const t=Math.floor(e);if(t<0)return i.num;let r;for(let e=B.length;e<=t;e++){if(r=B[e-1]*e,!isFinite(r))return i.na;B[e]=r}return B[t]}function H(e){if((e=(0,n.parseNumber)(e))instanceof Error)return e;const t=Math.floor(e);return t<0?i.num:0===t||1===t?1:t*H(t-2)}function U(e,t){return e=(0,n.parseNumber)(e),t=(0,n.parseNumber)(t),(0,n.anyIsParsedError)(e,t)?i.value:0>t&&00===e)))return 0;const t=e.length,r=e[0];let o=r<0?-r:r;for(let r=1;rn?o%=n:n%=o;o+=n}return o}function W(e){return(e=(0,n.parseNumber)(e))instanceof Error?e:Math.floor(e)}U.MATH=function(e,t,r){if(e=(0,n.parseNumber)(e),t=void 0===t?1:(0,n.parseNumber)(Math.abs(t)),r=void 0===r?0:(0,n.parseNumber)(r),(0,n.anyIsParsedError)(e,t,r))return i.value;if(0===t||0===e)return 0;const o=-Math.floor(Math.log(t)/Math.log(10));return e>=0?(0,u.default)(Math.floor(e/t)*t,o):0===r?-(0,u.default)(Math.ceil(Math.abs(e)/t)*t,o):-(0,u.default)(Math.floor(Math.abs(e)/t)*t,o)},U.PRECISE=function(e,t){return U.MATH(e,t,0)};const G={CEILING:function(e,t){return b.MATH(e,t)}};function j(){if(arguments.length<1)return i.na;const e=(0,n.flattenNaturalIntegerArray)(arguments);if(e instanceof Error)return e;if(0===e.length||e.includes(0))return 0;for(var t,r,o,a,s=1;void 0!==(o=e.pop());)for(;o>1;){if(o%2){for(t=3,r=Math.floor(Math.sqrt(o));t<=r&&o%t;t+=2);a=t<=r?t:o}else a=2;for(o/=a,s*=a,t=e.length;t;e[--t]%a==0&&1==(e[t]/=a)&&e.splice(t,1));}return s}function Y(e){return(e=(0,n.parseNumber)(e))instanceof Error?e:e<=0?i.num:Math.log(e)}function X(e,t){return e=(0,n.parseNumber)(e),t=void 0===t?10:(0,n.parseNumber)(t),(0,n.anyIsParsedError)(e,t)?i.value:e<=0||t<=0?i.num:Math.log(e)/Math.log(t)}function $(e){return(e=(0,n.parseNumber)(e))instanceof Error?e:e<=0?i.num:Math.log(e)/Math.log(10)}function q(e,t){return e=(0,n.parseNumber)(e),t=(0,n.parseNumber)(t),(0,n.anyIsParsedError)(e,t)?i.value:0===t?i.div0:e-t*Math.floor(e/t)}function K(e,t){return e=(0,n.parseNumber)(e),t=(0,n.parseNumber)(t),(0,n.anyIsParsedError)(e,t)?i.value:e*t<0?i.num:Math.round(e/t)*t}function J(){if(arguments.length<1)return i.na;const e=(0,n.flattenNaturalIntegerArray)(arguments);if(e instanceof Error)return e;if(0===e.length||e.every((e=>0===e)))return 1;let t=0,r=1;for(let n=0;n=0?t:-t}function Q(){return 0!==arguments.length?i.na:Math.PI}function ee(e,t){if(2!==arguments.length)return i.na;if(e??(e=0),t??(t=0),"number"!=typeof e||"number"!=typeof t)return i.value;if(0===e&&0===t)return i.num;if(0===e&&t<0)return i.div0;const r=Math.pow(e,t);return isNaN(r)?i.num:r}function te(){let e=(0,n.flatten)(arguments),t=!1,r=1;for(let n=0;n0?i.na:Math.random()}function oe(e,t,r,o,a){if(e=(0,n.parseNumber)(e??1),t=(0,n.parseNumber)(t??1),r=(0,n.parseNumber)(r??0),o=(0,n.parseNumber)(o??1),a=(0,n.parseBool)(a??!1),(0,n.anyIsParsedError)(e,t,r,o,a)||r>o)return i.value;if(e<1||t<1||a&&(!Number.isInteger(r)||!Number.isInteger(o)))return i.value;const s=a?()=>Math.floor(Math.random()*(o-r+1)+r):()=>Math.random()*(o-r)+r;return Array.from({length:e},(()=>Array.from({length:t},s)))}function ae(e,t){return e=(0,n.parseNumber)(e),t=(0,n.parseNumber)(t),(0,n.anyIsParsedError)(e,t)?i.value:e+Math.ceil((t-e+1)*Math.random())-1}function se(e,t){if(e=(0,n.parseNumber)(e),t=void 0===t||!0===t?0:!1===t?4:(0,n.parseNumber)(t),(0,n.anyIsParsedError)(e,t)||t<0||t>4||0>e||39990&&(l=l.replace(/XLV/g,"VL"),l=l.replace(/XCV/g,"VC"),l=l.replace(/CDL/g,"LD"),l=l.replace(/CML/g,"LM"),l=l.replace(/CMVC/g,"LMVL")),1===t&&(l=l.replace(/CDXC/g,"LDXL"),l=l.replace(/CDVC/g,"LDVL"),l=l.replace(/CMXC/g,"LMXL"),l=l.replace(/XCIX/g,"VCIV"),l=l.replace(/XLIX/g,"VLIV")),t>1&&(l=l.replace(/XLIX/g,"IL"),l=l.replace(/XCIX/g,"IC"),l=l.replace(/CDXC/g,"XD"),l=l.replace(/CDVC/g,"XDV"),l=l.replace(/CDIC/g,"XDIX"),l=l.replace(/LMVL/g,"XMV"),l=l.replace(/CMIC/g,"XMIX"),l=l.replace(/CMXC/g,"XM")),t>2&&(l=l.replace(/XDV/g,"VD"),l=l.replace(/XDIX/g,"VDIV"),l=l.replace(/XMV/g,"VM"),l=l.replace(/XMIX/g,"VMIV")),4===t&&(l=l.replace(/VDIV/g,"ID"),l=l.replace(/VMIV/g,"IM")),l}function le(e,t){return e=(0,n.parseNumber)(e),t=(0,n.parseNumber)(t),(0,n.anyIsParsedError)(e,t)?i.value:(0,u.default)(e,t)}function ue(e,t){return e=(0,n.parseNumber)(e),t=(0,n.parseNumber)(t),(0,n.anyIsParsedError)(e,t)?i.value:(e>0?1:-1)*(0,c.default)(Math.abs(e),t)}function ce(e,t){return e=(0,n.parseNumber)(e),t=(0,n.parseNumber)(t),(0,n.anyIsParsedError)(e,t)?i.value:(e>0?1:-1)*(0,h.default)(Math.abs(e),t)}function he(e){return(e=(0,n.parseNumber)(e))instanceof Error?e:1/Math.cos(e)}function de(e){return(e=(0,n.parseNumber)(e))instanceof Error?e:2/(Math.exp(e)+Math.exp(-e))}function fe(e,t,r,i){if(e=(0,n.parseNumber)(e),t=(0,n.parseNumber)(t),r=(0,n.parseNumber)(r),i=(0,n.flatten)(i),!(0,s.default)(i))return i*Math.pow(e,t);let o=i[0]*Math.pow(e,t);for(let n=1;n=t)}function be(e,t){return 2!==arguments.length?i.na:(e=(0,n.parseNumber)(e),t=(0,n.parseNumber)(t),(0,n.anyIsParsedError)(e,t)?i.value:e0?1:-1)*Math.floor(Math.abs(e)*Math.pow(10,t))/Math.pow(10,t)}function Ve(e,t,r,o){return[e,t,r,o]=[e,t,r,o].map((e=>void 0===e?1:(0,n.parseNumber)(e))),(0,n.anyIsParsedError)(e,t,r,o)?i.value:e<1||t<1?i.num:Array.from({length:e},((e,n)=>Array.from({length:t},((e,i)=>(n*t+i)*o+r))))}},54423:(e,t,r)=>{"use strict";r.r(t),r.d(t,{JOIN:()=>o,NUMBERS:()=>a,REFERENCE:()=>i});var n=r(26258);function i(e,t){try{const r=t.split(".");let n=e;for(let e=0;e{"use strict";r.r(t),r.d(t,{ADDRESS:()=>p,HYPERLINK:()=>c,INDEX:()=>g,INDIRECT:()=>d,ISDATE:()=>f,OFFSET:()=>h});var n=r(99613),i=r(72208),o=r(28488),a=r(3288),s=r(82239),l=r(89373),u=r(7996);function c(e,t){return"HYPERLINK"!==e||t?(t||(t=e),0>e.indexOf("://")&&0!==e.indexOf("mailto:")&&0!==e.indexOf("#tid=")&&0!==e.indexOf("#dlink=")&&(e="http://"+e),{text:t,href:e}):n.name}function h(e,t,r,o,a){if(arguments.length<3||arguments.length>5)return n.na;if(Number.isNaN(t=(0,i.numberify)(t))||Number.isNaN(r=(0,i.numberify)(r)))return n.value;if(void 0!==o&&(Number.isNaN(o=(0,i.numberify)(o))||o<1))return n.value;if(void 0!==a&&(Number.isNaN(a=(0,i.numberify)(a))||a<1))return n.value;if(!e.isRef())return n.na;e=e.toCellRef(this);const s=this.getInstance(e),l=s.countRows(),u=s.countCols();return e.v[0].row+=t,e.v[0].col+=r,e.v[1].row=o?e.v[0].row+o-1:e.v[1].row+t,e.v[1].col=a?e.v[0].col+a-1:e.v[1].col+r,e.v[0].row<0||e.v[0].col<0||e.v[1].row>=l||e.v[1].col>=u?n.ref:m(e)}function d(e,t){let r=(0,a.tokenize)(e,t?void 0:"R1C1");if(1!==r.size())return n.ref;let i=r.get(0),l=i.getValue();if(i.isRange()){const e=this.item;l=t?l:(0,o.fromR1C1ToA1)(i.getValue(),e.row,e.col)}else{if(!i.isVariable())return n.ref;{const e=this.getVariable(i.getValue(),i.getSheetName());if(!e)return n.ref;if(r=(0,a.tokenize)(e),i=r.get(0),1!==r.size()||!i.isRange())return n.ref;l=i.getValue()}}return i.isRowRange()?s.RefExpr.createRowRef(l,i.getSheetName()):i.isColRange()?s.RefExpr.createColRef(l,i.getSheetName()):s.RefExpr.createRangeRef(l,i.getSheetName())}function f(e){if(1!==arguments.length)return n.na;if(e.isRowRef()||e.isColRef())return!1;const t=e.resolve(this);if((0,i.isError)(t))return t;if(Array.isArray(t))return!1;if("string"==typeof t)return null!==this.getLocale().getDateParser().parse(t);if("number"==typeof t){if(!e.isCellRef())return l.default.isDate(this.item.nfId);const{v:[{row:t,col:r}]}=e,n=this.getInstance(e),i=n.worksheet.getComputedCellStyle(t,r).getNumberFormat();if(i.isDate())return!0;if(i.isDefault())return l.default.isDate(n.formula.getNumberFormatHint(t,r))}return!1}function g(e,t,r){if(arguments.length>4||arguments.length<1||void 0===e)return n.na;if("number"!=typeof t||t<0)return n.value;if("number"!=typeof r||r<0)return n.value;if(e.isArray()){let i=e.resolve(this);if(i.length0?[i[t-1]]:i;const o=[];for(let e=0;e0?[i[e][r-1]]:i[e])}return o}if(e.isRef()){const i=e.toCellRef(this);return i.v[1].row-i.v[0].row+10&&(i.v[1].row=i.v[0].row+=t-1),r>0&&(i.v[1].col=i.v[0].col+=r-1),m(i))}return n.ref}function p(e,t,r,o,a){if(void 0===r&&(r=1),void 0===o&&(o=!0),arguments.length<2||arguments.length>5)return n.value;if(!(0,i.isNumber)(e)||e<1||!(0,i.isNumber)(t)||t<1)return n.value;const s={row:e-1,col:t-1,isRowAbs:3!==r&&4!==r,isColAbs:2!==r&&4!==r},l=o?(0,u.coordToLabel)(s):(0,u.coordToR1C1)(s);return a?`${(0,u.escapeSheetName)(a)}!${l}`:l}function m(e){if(e.v.length<2)return e;const[t,r]=e.v;return t.row===r.row&&t.col===r.col?s.RefExpr.fromCell(t,e.shName,e.isImplicit):e}},43067:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AVEDEV:()=>g,AVERAGE:()=>p,AVERAGEA:()=>m,BETA:()=>v,BETADIST:()=>y,BETAINV:()=>C,BINOM:()=>x,BINOMDIST:()=>w,CHIDIST:()=>S,CHIINV:()=>b,CHISQ:()=>R,CHITEST:()=>I,COLUMN:()=>A,COLUMNS:()=>T,CONFIDENCE:()=>E,CORREL:()=>M,COUNT:()=>k,COUNTA:()=>N,COUNTBLANK:()=>D,COUNTIN:()=>O,COUNTUNIQUE:()=>L,COVAR:()=>V,COVARIANCE:()=>B,CRITBINOM:()=>_,DEVSQ:()=>H,EXPON:()=>U,EXPONDIST:()=>z,F:()=>W,FDIST:()=>G,FINV:()=>j,FISHER:()=>X,FISHERINV:()=>$,FORECAST:()=>q,FREQUENCY:()=>K,FTEST:()=>Y,GAMMA:()=>J,GAMMADIST:()=>Z,GAMMAINV:()=>Q,GAMMALN:()=>ee,GAUSS:()=>te,GEOMEAN:()=>re,GROWTH:()=>ne,HARMEAN:()=>ie,HYPGEOM:()=>oe,HYPGEOMDIST:()=>ae,INTERCEPT:()=>se,KURT:()=>le,LARGE:()=>ue,LINEST:()=>ce,LOGEST:()=>he,LOGINV:()=>ge,LOGNORM:()=>de,LOGNORMDIST:()=>fe,MAX:()=>pe,MAXA:()=>me,MEDIAN:()=>ve,MIN:()=>ye,MINA:()=>Ce,MODE:()=>xe,NEGBINOM:()=>we,NEGBINOMDIST:()=>_e,NORM:()=>Te,NORMDIST:()=>Re,NORMINV:()=>Se,NORMSDIST:()=>Ie,NORMSINV:()=>Ae,PEARSON:()=>Ee,PERCENTILE:()=>ke,PERCENTRANK:()=>Oe,PERMUT:()=>De,PERMUTATIONA:()=>Le,PHI:()=>Pe,POISSON:()=>Fe,PROB:()=>Be,QUARTILE:()=>He,RANK:()=>Ue,ROW:()=>ze,ROWS:()=>We,RSQ:()=>Ge,SKEW:()=>je,SLOPE:()=>Ye,SMALL:()=>Xe,STANDARDIZE:()=>$e,STDEV:()=>Je,STDEVA:()=>Ze,STDEVP:()=>Ke,STDEVPA:()=>Qe,STDEVS:()=>qe,STEYX:()=>et,T:()=>tt,TDIST:()=>rt,TINV:()=>nt,TREND:()=>ot,TRIMMEAN:()=>at,TTEST:()=>it,VAR:()=>ct,VARA:()=>ut,VARP:()=>st,VARPA:()=>ht,VARS:()=>lt,WEIBULL:()=>dt,Z:()=>gt,ZTEST:()=>ft});var n=r(76076),i=r(73691),o=r(26258),a=r(72208),s=r(88895),l=r(99613),u=r(68332),c=r(290),h=r(90783),d=r(3729),f=r(25412);function g(){if(arguments.length<1)return l.na;const e=[],t=(0,o.flatten)(arguments),r=t.length;for(let n=0;n1||n===a?l.num:i.default.beta.inv(e,t,r)*(a-n)+n}v.DIST=function(e,t,r,n,a,s){return arguments.length<4?l.value:(e=(0,o.parseNumber)(e),t=(0,o.parseNumber)(t),r=(0,o.parseNumber)(r),a=void 0===a?0:(0,o.parseNumber)(a),s=void 0===s?1:(0,o.parseNumber)(s),(0,o.anyIsParsedError)(e,t,r,a,s)?l.value:t<=0||r<=0||es||a===s?l.num:(e=(e-a)/(s-a),n?i.default.beta.cdf(e,t,r):i.default.beta.pdf(e,t,r)/(s-a)))},v.INV=C;const x={};function w(e,t,r,n){return void 0===n?l.na:(e=(0,o.parseNumber)(e),t=(0,o.parseNumber)(t),r=(0,o.parseNumber)(r),n=!!n,(0,o.anyIsParsedError)(e,t,r)?l.value:(e=Math.floor(e),t=Math.floor(t),e<0||e>t||r<0||r>1?l.num:n?i.default.binomial.cdf(e,t,r):i.default.binomial.pdf(e,t,r)))}x.DIST=w,x.DIST.RANGE=function(e,t,r,i){if(i=void 0===i?r:i,e=(0,o.parseNumber)(e),t=(0,o.parseNumber)(t),r=(0,o.parseNumber)(r),i=(0,o.parseNumber)(i),(0,o.anyIsParsedError)(e,t,r,i))return l.value;let a=0;for(let o=r;o<=i;o++)a+=(0,n.COMBIN)(e,o)*Math.pow(t,o)*Math.pow(1-t,e-o);return a},x.INV=function(e,t,r){if(e=(0,o.parseNumber)(e),t=(0,o.parseNumber)(t),r=(0,o.parseNumber)(r),(0,o.anyIsParsedError)(e,t,r))return l.value;if(e<0||t<=0||t>=1||r<=0||r>=1)return l.num;let n=0;for(;n<=e;){if(i.default.binomial.cdf(n,e,t)>=r)return n;n++}};const _=x.INV,R={DIST:function(e,t,r){return e=(0,o.parseNumber)(e),t=(0,o.parseNumber)(t),(0,o.anyIsParsedError)(e,t)?l.value:e<0||t<1||t>Math.pow(10,10)?l.num:r?i.default.chisquare.cdf(e,t):i.default.chisquare.pdf(e,t)}};R.DIST.RT=function(e,t){return void 0===e||void 0===t?l.na:(e=(0,o.parseNumber)(e),t=(0,o.parseNumber)(t),(0,o.anyIsParsedError)(e,t)?l.value:(t=Math.floor(t),e<0||t<1||t>Math.pow(10,10)?l.num:1-i.default.chisquare.cdf(e,t)))},R.INV=function(e,t){return e=(0,o.parseNumber)(e),t=(0,o.parseNumber)(t),(0,o.anyIsParsedError)(e,t)?l.value:(t=Math.floor(t),e<0||e>1||t<1||t>Math.pow(10,10)?l.num:i.default.chisquare.inv(e,t))},R.INV.RT=function(e,t){return void 0===e||void 0===t?l.na:e<0||e>1||t<1||t>Math.pow(10,10)?l.num:"number"!=typeof e||"number"!=typeof t?l.value:(t=Math.floor(t),i.default.chisquare.inv(1-e,t))},R.TEST=function(e,t){if(2!==arguments.length)return l.na;if(!Array.isArray(e)||!Array.isArray(t))return l.value;if(e=(0,o.convertInto2D)(e),t=(0,o.convertInto2D)(t),e.length!==t.length)return l.na;const r=e.length,n=e[0].length;let i,a;if(1===r&&1===n)return l.na;for(i=0;i=2;)r=r*e/n,n-=2;let i=r,o=t;for(;i>1e-10*r;)o+=2,i=i*e/o,r+=i;return 1-r}return Math.round(1e9*d(u,s))/1e9};const S=R.DIST.RT,b=R.INV.RT,I=R.TEST;function A(e){let t=Number.MAX_VALUE;if(e){let t=0,r=this.getInstance(e).countCols()-1;if(e.isCellRef())e.v.forEach((function(e){r=Math.min(r,e.col),t=Math.max(t,e.col)}));else if(e.isRowRef())r=0,t=this.getInstance(e).countCols()-1;else{if(!e.isColRef())return e.isError()?e.v:l.num;r=Math.min(e.v[0],e.v[1]),t=Math.max(e.v[0],e.v[1])}return r===t?r+1:[new Array(t-r+1).fill(null).map(((e,t)=>t+r+1))]}return this.item&&(t=this.item.getPosition().col),t!==Number.MAX_VALUE?t+1:l.num}function T(e){if(!e)return l.num;const t=this.getInstance(e);if(e.isCellRef()){const t=(0,s.fromCellRefs)(e.v);return t.to.col-t.from.col+1}return e.isRowRef()?t.countCols():e.isColRef()?Math.min(Math.abs(e.v[1]-e.v[0])+1,t.countCols()):e.isArray()?Array.isArray(e.v[0])?e.v[0].length:e.v.length:e.isError()?e.v:1}function E(e,t,r){return e=(0,o.parseNumber)(e),t=(0,o.parseNumber)(t),r=(0,o.parseNumber)(r),(0,o.anyIsParsedError)(e,t,r)?l.value:(r=Math.floor(r),e<=0||e>=1||t<=0||r<1?l.num:i.default.normalci(1,e,t,r)[1]-1)}function M(e,t){return Ee(e,t)}function k(){let e=(0,o.flatten)(arguments),t=e.length,r=0;for(;t--;)"number"==typeof e[t]&&++r;return r}function N(){const e=(0,o.flatten)(arguments);let t=0;for(let r=0;r=1||t<=0||r<1?l.num:1===r?l.div0:i.default.tci(1,e,t,r)[1]-1)};const B={P:F,S:function(e,t){return P(e)!==P(t)?l.na:([e,t]=pt(e,t),e.length<=1||t.length<=1?l.div0:i.default.covariance(e,t))}},V=F;function H(){const e=mt(arguments),t=i.default.mean(e);let r=0;for(let n=0;n=a||r<1||r>=a?l.num:n?i.default.centralF.cdf(e,t,r):i.default.centralF.pdf(e,t,r)},W.DIST.RT=function(e,t,r){return"number"!=typeof e||"number"!=typeof t||"number"!=typeof r?l.value:(t=Math.floor(t),r=Math.floor(r),e<0||t<1||r<1?l.num:1-i.default.centralF.cdf(e,t,r))},W.INV=function(e,t,r){return e=(0,o.parseNumber)(e),t=(0,o.parseNumber)(t),r=(0,o.parseNumber)(r),(0,o.anyIsParsedError)(e,t,r)?l.value:(t=Math.floor(t),r=Math.floor(r),e<0||e>=1||t<1||r<1?l.num:i.default.centralF.inv(e,t,r))},W.INV.RT=function(e,t,r){if(3!==arguments.length)return l.na;const n=Math.pow(10,10);return e=(0,o.parseNumber)(e),t=(0,o.parseNumber)(t),r=(0,o.parseNumber)(r),(0,o.anyIsParsedError)(e,t,r)?l.value:(t=Math.floor(t),r=Math.floor(r),e<=0||e>1||t<1||t>=n||r<1||r>=n?l.num:i.default.centralF.inv(1-e,t,r))};const j=W.INV.RT;W.TEST=function(e,t){if(void 0===e||void 0===t)return l.na;if(e=mt(e),t=mt(t),!Array.isArray(e)||!Array.isArray(t))return l.na;if(e.length<2||t.length<2)return l.div0;const r=function(e){let t=0;for(let r=0;rs?(u=a/s,c=e.length-1,h=t.length-1):(u=s/a,c=t.length-1,h=e.length-1),2*W.DIST.RT(u,c,h)};const Y=W.TEST;function X(e){return e=(0,o.parseNumber)(e),(0,o.isParsedError)(e)?e:e<=-1||e>=1?l.num:Math.log((1+e)/(1-e))/2}function $(e){if(e=(0,o.parseNumber)(e),(0,o.isParsedError)(e))return e;const t=Math.exp(2*e);return(t-1)/(t+1)}function q(e,t,r){if(e=(0,o.parseNumber)(e),t=(0,o.parseNumberArray)((0,o.flatten)(t)),r=(0,o.parseNumberArray)((0,o.flatten)(r)),(0,o.anyIsParsedError)(e,t,r))return l.value;if(t.length!==r.length)return l.na;if(0===i.default.variance(r))return l.div0;const n=i.default.mean(r),a=i.default.mean(t),s=r.length;let u=0,c=0;for(let e=0;et[o-1]&&e[a]<=t[o]&&(i[o]+=1):o===n&&e[a]>t[n-1]&&(i[n]+=1)}return i}function J(e){return e=(0,o.parseNumber)(e),(0,o.isParsedError)(e)?e:0===e||parseInt(e,10)===e&&e<0?l.num:i.default.gammafn(e)}J.DIST=function(e,t,r,n){return 4!==arguments.length?l.na:e<0||t<=0||r<=0?l.num:"number"!=typeof e||"number"!=typeof t||"number"!=typeof r?l.value:n?i.default.gamma.cdf(e,t,r,!0):i.default.gamma.pdf(e,t,r,!1)},J.INV=function(e,t,r){return 3!==arguments.length?l.na:e<0||e>=1||t<=0||r<=0?l.num:"number"!=typeof e||"number"!=typeof t||"number"!=typeof r?l.value:i.default.gamma.inv(e,t,r)};const Z=J.DIST,Q=J.INV;function ee(e){return e=(0,o.parseNumber)(e),(0,o.isParsedError)(e)?e:e<=0?l.num:i.default.gammaln(e)}function te(e){return e=(0,o.parseNumber)(e),(0,o.isParsedError)(e)?e:i.default.normal.cdf(e,0,1)-.5}function re(){if(arguments.length<1)return l.na;const e=mt(arguments);for(let t=0;te.length?l.num:(0,o.anyIsParsedError)(e,t)?e:e.sort((function(e,t){return t-e}))[t-1]}function ce(e,t){let r;if(e=(0,o.parseNumberArray)((0,o.flatten)(e)),void 0===t)for(t=[],r=0;rMath.min(t,r)||ei||r<0||r>i||i<=0)return l.num;function s(e,t,r,i){return r=1||r<=0?l.num:i.default.lognormal.inv(e,t,r)};const ge=de.INV;function pe(){if(arguments.length<1)return l.na;const e=mt(arguments);return 0===e.length?0:(0,h.default)(e)}function me(){if(arguments.length<1)return l.na;const e=(0,o.arrayValuesToNumbers)((0,o.flatten)(arguments));return 0===e.length?0:(0,h.default)(e)}function ve(){if(arguments.length<1)return l.na;const e=(0,o.arrayValuesToNumbers)((0,o.flatten)(arguments));return i.default.median(e)}function ye(){if(arguments.length<1)return l.na;const e=mt(arguments);return 0===e.length?0:(0,d.default)(e)}function Ce(){if(arguments.length<1)return l.na;const e=(0,o.arrayValuesToNumbers)((0,o.flatten)(arguments));return 0===e.length?0:(0,d.default)(e)}function xe(){const e=(0,o.flatten)(arguments),t=xe.MULT(e);return t instanceof Error?t:t.sort((function(e,t){return e-t}))[0]}xe.MULT=function(){const e=mt(arguments);if(e instanceof Error)return e;const t=e.length,r={};let n,i=[],o=0;for(let a=0;ao&&(o=r[n],i=[]),r[n]===o&&(i[i.length]=n);return o<=1?l.na:i},xe.SNGL=xe;const we={};function _e(e,t,r){return we.DIST(e,t,r,!1)}function Re(e,t,r,n){return e=(0,o.parseNumber)(e),t=(0,o.parseNumber)(t),r=(0,o.parseNumber)(r),(0,o.anyIsParsedError)(e,t,r)?l.value:r<=0?l.num:n?i.default.normal.cdf(e,t,r):i.default.normal.pdf(e,t,r)}function Se(e,t,r){return e=(0,o.parseNumber)(e),t=(0,o.parseNumber)(t),r=(0,o.parseNumber)(r),(0,o.anyIsParsedError)(e,t,r)?l.value:e<=0||e>=1||r<=0?l.num:i.default.normal.inv(e,t,r)}we.DIST=function(e,t,r,n){return e=(0,o.parseNumber)(e),t=(0,o.parseNumber)(t),r=(0,o.parseNumber)(r),(0,o.anyIsParsedError)(e,t,r)?l.value:(e=Math.floor(e),t=Math.floor(t),r<0||r>1||e<0||t<1?l.num:n?i.default.negbin.cdf(e,t,r):i.default.negbin.pdf(e,t,r))};const be={};function Ie(e){return be.DIST(e,!0)}function Ae(e){return e=(0,o.parseNumber)(e),(0,o.isParsedError)(e)?l.value:e<=0||e>=1?l.num:i.default.normal.inv(e,0,1)}be.DIST=function(e,t){return e=(0,o.parseNumber)(e),(0,o.isParsedError)(e)?l.value:t?i.default.normal.cdf(e,0,1):i.default.normal.pdf(e,0,1)},be.INV=Ae;const Te={DIST:Re,INV:Se,S:be};function Ee(e,t){if(t=(0,o.flatten)(t),e=(0,o.flatten)(e),0===t.length||0===e.length||t.length!==e.length)return l.na;let r=0,n=0,i=0,a=0,s=0,u=0;for(let l=0;l1)return l.num;const r=(e=e.sort((function(e,t){return e-t}))).length;if(1===r)return e[0];const n=t*(r-1),i=Math.floor(n);return(0,o.toEffective)(n===i?e[n]:e[i]+(n-i)*(e[i+1]-e[i]))}const ke=Me;function Ne(e,t,r){if(r=void 0===r?3:r,e=(e=(0,o.flatten)(e||[])).filter((function(e){return!(0,o.anyIsParsedError)((0,o.parseNumber)(e))})),t=(0,o.parseNumber)(t),r=(0,o.parseNumber)(r),(0,o.anyIsParsedError)(e,t,r))return l.value;if((r=Math.floor(r))<1||0===e.length)return l.num;if(t<(e=e.sort((function(e,t){return e-t})))[0]||t>e[e.length-1])return l.na;const n=(0,u.UNIQUE)(e,!0)[0],i=e.length,a=n.length,s=Math.pow(10,r);let c=0,h=!1,d=0;if(1===i)return 1;for(;!h&&d=n[d]&&(t1-1/(r+1))return l.num;const n=t*(r+1)-1,i=Math.floor(n);return(0,o.toEffective)(n===i?e[n]:e[i]+(n-i)*(e[i+1]-e[i]))},ke.INC=Me;const Oe=Ne;function De(e,t){return e=(0,o.parseNumber)(e),t=(0,o.parseNumber)(t),(0,o.anyIsParsedError)(e,t)?l.value:(e=Math.floor(e),t=Math.floor(t),e<=0||t<0||e1)return l.num;i+=c,u<=n&&u>=r&&(a+=c)}}return 0===i?l.div0:Math.abs(i-1)>1e-15?l.num:a}function Ve(e,t){return e=mt(e),t=(0,o.parseNumber)(t),(0,o.anyIsParsedError)(e,t)?l.value:0===e.length||(t=Math.floor(t))<0||t>4?l.num:ke.INC(e,.25*t)}Oe.EXC=function(e,t,r){if(r=void 0===r?3:r,e=(e=(0,o.flatten)(e||[])).filter((function(e){return!(0,o.anyIsParsedError)((0,o.parseNumber)(e))})),t=(0,o.parseNumber)(t),r=(0,o.parseNumber)(r),(0,o.anyIsParsedError)(e,t,r))return l.value;if((r=Math.floor(r))<1||0===e.length)return l.num;if(t<(e=e.sort((function(e,t){return e-t})))[0]||t>e[e.length-1])return l.na;const n=(0,u.UNIQUE)(e,!0)[0],i=e.length,a=n.length,s=Math.pow(10,r);let c=0,h=!1,d=0;if(1===i)return 1;for(;!h&&d=n[d]&&(t[t+r+1]))}return this.item&&(t=this.item.getPosition().row),t!==Number.MAX_VALUE?t+1:l.num}function We(e){if(!e)return l.num;const t=this.getInstance(e);if(e.isCellRef()){const t=(0,s.fromCellRefs)(e.v);return t.to.row-t.from.row+1}return e.isRowRef()?Math.min(Math.abs(e.v[1]-e.v[0])+1,t.countRows()):e.isColRef()?t.countRows():e.isArray()?e.v.length:e.isError()?e.v:1}function Ge(e,t){const r=Ee(e,t);return(0,a.isError)(r)?r:r*r}function je(){const e=mt(arguments);if(e.length<3)return l.div0;const t=i.default.mean(e),r=e.length;let n=0;for(let i=0;ie.length?l.num:e.sort((function(e,t){return e-t}))[t-1]}function $e(e,t,r){return e=(0,o.parseNumber)(e),t=(0,o.parseNumber)(t),r=(0,o.parseNumber)(r),(0,o.anyIsParsedError)(e,t,r)?l.value:r<=1e-15?l.num:(e-t)/r}function qe(){if(arguments.length<1)return l.na;const e=lt.apply(this,arguments);return e instanceof Error?e:Math.sqrt(e)}function Ke(){if(arguments.length<1)return l.na;const e=st.apply(this,arguments);return e instanceof Error?e:Math.sqrt(e)}He.INC=Ve,He.EXC=function(e,t){return e=mt(e),t=(0,o.parseNumber)(t),(0,o.anyIsParsedError)(e,t)?l.value:0===e.length||(t=Math.floor(t))<=0||t>=4?l.num:ke.EXC(e,.25*t)},Ue.EQ=Ue,Ue.AVG=function(e,t,r){if(e=(0,o.parseNumber)(e),t=mt(t),(0,o.anyIsParsedError)(e,t))return l.value;const n=(r=r||!1)?function(e,t){return e-t}:function(e,t){return t-e},i=(t=(t=(0,o.flatten)(t)).sort(n)).length;let a=0;for(let r=0;r1?(2*t.indexOf(e)+a+1)/2:t.indexOf(e)+1},je.P=function(){const e=mt(arguments);if(e.length<3)return l.div0;const t=i.default.mean(e),r=e.length;let n=0,o=0;for(let i=0;i2||n<1||n>3)return l.num;if(1===n&&e.length!==t.length)return l.na;let i,a,s,u=0,c=0,h=0,d=0;if(2===n){for(i=0;i=1)return l.num;if(0===e.length)return l.div0;const r=(0,n.FLOOR)(e.length*t,2)/2,a=e.sort(((e,t)=>e-t));return i.default.mean(a.slice(r,a.length-r))}function st(){if(arguments.length<1)return l.na;const e=mt(arguments),t=e.length;if(t<=0)return l.div0;let r=0;const n=p(e);for(let i=0;i=1||t<1?l.num:i.default.studentt.inv(e,t))},tt.INV["2T"]=function(e,t){return e=(0,o.parseNumber)(e),t=(0,o.parseNumber)(t),(0,o.anyIsParsedError)(e,t)?l.value:(t=Math.floor(t),e<=0||e>=1||t<1?l.num:Math.abs(i.default.studentt.inv(e/2,t)))},tt.TEST=it;const ct=lt;function ht(){if(arguments.length<1)return l.na;const e=(0,o.flatten)(arguments),t=e.length;let r=0,n=0;const i=m(e);for(let o=0;o{"use strict";r.d(t,{default:()=>o});var n=r(2162),i=r.n(n);i().gammafn=function(e){const t=[-1.716185138865495,24.76565080557592,-379.80425647094563,629.3311553128184,866.9662027904133,-31451.272968848367,-36144.413418691176,66456.14382024054],r=[-30.8402300119739,315.35062697960416,-1015.1563674902192,-3107.771671572311,22538.11842098015,4755.846277527881,-134659.9598649693,-115132.2596755535];let n,i,o,a,s=!1,l=0,u=1,c=0,h=e;if(h<=0){if(a=h%1+36e-17,!a)return 1/0;s=(1&h?-1:1)*Math.PI/Math.sin(Math.PI*a),h=1-h}for(o=h,i=h<1?h++:(h-=l=(0|h)-1)-1,n=0;n<8;++n)c=(c+t[n])*i,u=u*i+r[n];if(a=c/u+1,oh)for(n=0;n=1?e:1/e)+.4*e+18);let f;if(t<0||e<=0)return NaN;if(t{"use strict";r.r(t),r.d(t,{CHAR:()=>a,CLEAN:()=>s,CODE:()=>l,CONCAT:()=>u,CONCATENATE:()=>c,DOLLAR:()=>h,EXACT:()=>d,FIND:()=>f,FIXED:()=>g,HTML2TEXT:()=>p,LEFT:()=>m,LEN:()=>v,LOWER:()=>y,MID:()=>C,PROPER:()=>x,REGEXEXTRACT:()=>w,REGEXMATCH:()=>_,REGEXREPLACE:()=>R,REPLACE:()=>S,REPT:()=>b,RIGHT:()=>I,SEARCH:()=>A,SPLIT:()=>T,SUBSTITUTE:()=>E,T:()=>M,TEXT:()=>k,TRIM:()=>N,UNICHAR:()=>O,UNICODE:()=>D,UPPER:()=>L,VALUE:()=>P});var n=r(26258),i=r(99613),o=r(49827);function a(e){return(e=(0,n.parseNumber)(e))instanceof Error?e:e<=0?i.value:String.fromCharCode(e)}function s(e){return(e=e||"").replace(/[\0-\x1F]/g,"")}function l(e){return(e=e||"").charCodeAt(0)}function u(){return c(...arguments)}function c(){const e=(0,n.flatten)(arguments);let t=0;for(;(t=e.indexOf(!0))>-1;)e[t]="TRUE";let r=0;for(;(r=e.indexOf(!1))>-1;)e[r]="FALSE";return e.join("")}function h(e,t){if(e=(0,n.parseNumber)(e),t=void 0===t?2:(0,n.parseNumber)(t),(0,n.anyIsParsedError)(e,t))return i.value;const r=this.getLocale(),o=e<0?-1:1;let a="[$"+(r.getData().CURRENCY_SYM||"$")+"]0";return t<=0?e=Math.round(e/o*Math.pow(10,t))/Math.pow(10,t):a=a+"."+new Array(t+1).join("0"),r.getSSF().render(a+";("+a+")",e)}function d(e,t){return(e=(0,n.toString)(e))===(0,n.toString)(t)}function f(e,t,r){if(arguments.length<2||arguments.length>3)return i.na;if(e=(0,n.toString)(e),t=(0,n.toString)(t),(r=void 0===r?0:r-1)<0||t.length/gm,"")})):t=e.replace(/<(?:.|\n)*?>/gm,"")),t}function m(e,t){return t=void 0===t?1:t,(t=(0,n.parseNumber)(t))instanceof Error?i.value:(e=(0,n.toString)(e),t<0?i.value:e?e.substring(0,t):null)}function v(e){return 0===arguments.length?i.na:(0,n.toString)(e).length}function y(e){return 1!==arguments.length?i.na:(0,n.toString)(e).toLowerCase()}function C(e,t,r){return t=(0,n.parseNumber)(t),r=(0,n.parseNumber)(r),(0,n.anyIsParsedError)(t,r)?i.num:t<1||r<0?i.value:(e=(0,n.toString)(e)).substr(t-1,r)}function x(e){return void 0===e||0===e.length?i.value:(!0===e&&(e="TRUE"),!1===e&&(e="FALSE"),isNaN(e)&&"number"==typeof e?i.value:("number"==typeof e&&(e=""+e),e.replace(/[a-zA-Z]\S*/g,(function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}))))}function w(e,t){const r=e.match(new RegExp(t));return r?r[r.length>1?r.length-1:0]:null}function _(e,t,r){const n=e.match(new RegExp(t));return r?n:!!n}function R(e,t,r){return e.replace(new RegExp(t),r)}function S(e,t,r,o){return t=(0,n.parseNumber)(t),r=(0,n.parseNumber)(r),e=(0,n.toString)(e),(0,n.anyIsParsedError)(t,r)||"string"!=typeof e||"string"!=typeof o?i.value:e.substr(0,t-1)+o+e.substr(t-1+r)}function b(e,t){return(t=(0,n.parseNumber)(t))instanceof Error?t:(t=Math.floor(t))<0?i.value:new Array(t+1).join(e)}function I(e,t){return t=void 0===t?1:t,(t=(0,n.parseNumber)(t))instanceof Error?t:(e=(0,n.toString)(e))?e.substring(e.length-t):null}function A(e,t,r){let o;return e=(0,n.toString)(e),r=void 0===r?0:r,o=(t=(0,n.toString)(t)).toLowerCase().indexOf(e.toLowerCase(),r-1)+1,0===o?i.value:o}function T(e,t){return e.split(t)}function E(e,t,r,o){if(arguments.length<3)return i.na;if(o<=0)return i.value;if(e=(0,n.toString)(e),t=(0,n.toString)(t),r=(0,n.toString)(r),!e||!t)return e;if(void 0===o){const n=t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&");return e.replace(new RegExp(n,"g"),r)}{0===o&&(o=1);let n=0,i=0;for(;(n=e.indexOf(t,n))>-1;){if(i++,i===o)return e.substring(0,n)+r+e.substring(n+t.length);n+=t.length}return e}}function M(e){return"string"==typeof e?e:""}function k(e,t){if("string"==typeof e){const t=(0,n.parseNumber)(e);if((0,n.isParsedError)(t)){const t=(0,n.parseDate)(this,e);(0,n.isParsedError)(t)||(e=(0,o.serialize)(t))}else e=t}return t=(0,n.toString)(t),this.getLocale().getSSF().format(t,e).v}function N(e){return(e=(0,n.toString)(e)).replace(/ +/g," ").trim()}const O=a,D=l;function L(e){return 1!==arguments.length?i.na:(0,n.toString)(e).toUpperCase()}function P(e){let t;const r=this.getLocale().getInputParser();try{t=r.parse(e)?.v??e}catch(e){t=i.value}return"number"!=typeof t?i.value:t}},26258:(e,t,r)=>{"use strict";r.d(t,{anyIsParsedError:()=>C,argsToArray:()=>l,arrayValuesToNumbers:()=>x,convertInto2D:()=>R,flatten:()=>s,flattenNaturalIntegerArray:()=>f,isParsedError:()=>y,parseBool:()=>c,parseDate:()=>m,parseDateArray:()=>v,parseNumber:()=>h,parseNumberArray:()=>d,toComplex:()=>_,toEffective:()=>u,toInteger:()=>p,toNumber:()=>g,toString:()=>w});var n=r(99613),i=r(99215),o=r(49827),a=r(72208);function s(){return(0,i.default)(l(arguments))}function l(e){let t;return null!=e&&(t=Array.prototype.slice.call(e,0)),void 0!==t&&0!==t.length||(t=[e]),t}function u(e){return+e.toPrecision(15)}function c(e){if(!0===(e=e??!1)||!1===e)return e;if(e instanceof Error)return e;if("number"==typeof e)return 0!==e;if("string"==typeof e){const t=e.toUpperCase();if("TRUE"===t)return!0;if("FALSE"===t)return!1}return n.value}function h(e){if("number"==typeof e)return e;if(void 0===e||""===e||isNaN(e))return n.value;const t=parseFloat(e,10);return Number.isNaN(t)?n.value:t}function d(e){let t;if(!e||0===(t=e.length))return n.value;for(let r=0;r"number"!=typeof e))?n.value:t.some((e=>e<0))?n.num:(t.forEach(((e,r)=>{t[r]=Math.floor(t[r])})),t)}function g(e){if(""===e||!1===e||null==e)return 0;if(!0===e)return 1;if("string"==typeof e){const t=m(this,e);if(!y(t))return(0,o.serialize)(t)}return h(e)}function p(e){const t=g.call(this,e);return y(t)?t:Math.floor(t)}function m(e,t){if("number"==typeof t)return(0,o.deserialize)(t);if("string"==typeof t){const r=e.getLocale().getDateParser().parse(t);return r?r.v:n.value}return n.value}function v(e,t){for(let r=0,n=t.length;r{"use strict";r.d(t,{ArrayDimHandler:()=>C,ParserHandler:()=>y,createGrammarParser:()=>v});var n=r(3288),i=r(7996),o=r(87851),a=r(37136),s=r(71566),l=r(48961),u=r(35821),c=r(82239),h=r(32379),d=r(72208),f=r(51388),g=r(47915),p=r(89463);const m=r(42067).default.reduce(((e,t)=>{let r=h.default;const n=t.split(".");for(let e=0;e{throw u.default.ERROR},t.yy={handler:e},t}class y{constructor(e){this.ctx=e}getErrorFromText(e){return(0,u.getErrorFromText)(e)}numberify(e){return d.numberify(e)}extractString(e){return(0,i.extractString)(e)}addCellRef(e,t){e.addCellRef(t)}enterFunction(e){}leaveFunction(e){}exec(e,t,r){const n=o.default.resolverTable[e]||o.default.defaultResolver,i=o.default.checkerTable[e]||o.default.defaultChecker,c=(0,l.getArrayHandler)(e)(n(r,this.ctx),(r=>{let n=i(r);return n||((0,a.checkArgumentCount)(e,r)?(s.argumentTypeConvert.call(this.ctx,e,r),n=i(r),n||t.apply(this.ctx,r)):u.default.NA)}));return(p.default.table[e]||p.default.defaultHandler)(c,this.ctx)}callFunction(e,t,r){e=e.toUpperCase(),t=t||[];const n=m[e];return n?this.exec(e,n,t):c.Expr.fromValue(u.default.NAME)}callOperator(e,t){const r=g.default[e];return this.exec(e,r,t)}createConstantArrayExpr(e){const t=e.length,r=e[0].length;if(1===t&&1===r)return this.createExpr(e[0][0]);for(let n=1;n0&&i>0?(0,f.make2dArray)(n,i):0;return this.createExpr(o)}callOperator(e,t){if(this.ctx.getDimHelper().needRealValue())return super.callOperator(e,t);const{height:r,width:n}=(0,l.getDimensionValue)(e,t,this.ctx),i=r>0&&n>0?(0,f.make2dArray)(r,n):0;return this.createExpr(i)}createArgs(){for(var e=arguments.length,t=new Array(e),r=0;r{"use strict";function n(e,t){return new Array(e).fill(null).map((e=>new Array(t)))}function i(e,t){return void 0===t&&(t=0),Array.from({length:e},((e,r)=>r+t))}r.d(t,{make2dArray:()=>n,makeSequence:()=>i})},28488:(e,t,r)=>{"use strict";r.r(t),r.d(t,{absoluteFormula:()=>I,changeFormula:()=>x,changeFormulaKeepSheet:()=>w,changeFormulaRange:()=>N,changeRefMode:()=>g,deabsoluteToken:()=>R,fromA1ToR1C1:()=>T,fromR1C1ToA1:()=>M,getFormulaBound:()=>O,isFormulaAbsolute:()=>A,labelToCoord:()=>c,moveFormula:()=>v,rangeToBound:()=>h,rangeToCoords:()=>d,transposeR1C1:()=>k});var n=r(7996),i=r(44499),o=r(3288),a=r(72208);const s={CELL:/^(\$?)([A-Z]+)(\$?)(\d+)$/i,COLRANGECELL:/^(\$?)([A-Z]+):(\$?)([A-Z]+)$/i,ROWRANGECELL:/^(\$?)(\d+):(\$?)(\d+)$/},l={CELL:/^(?:R\[(-?\d+)\]|R(\d*))(?:C\[(-?\d+)\]|C(\d*))/,COLRANGECELL:/^(?:C\[(-?\d+)\]|C(\d+)):(?:C\[(-?\d+)\]|C(\d+))/,ROWRANGECELL:/^(?:R\[(-?\d+)\]|R(\d+)):(?:R\[(-?\d+)\]|R(\d+))/},u=/^(?:(\$?)([A-Z]+))?(?:(\$?)(\d+))?$/i;function c(e){const t=u.exec(e);if(null===t)return{};const r=t[4]?{isRowAbs:!!t[3],row:(0,n.rowLabelToIndex)(t[4])}:null,i=t[2]?{isColAbs:!!t[1],col:(0,n.columnLabelToIndex)(t[2])}:null;return null===r||null===i?r||i||{}:Object.assign({},r,i)}function h(e){const t=e.split(":").map(c),r={},n={};for(let e=0;ei)&&(r.row=i,r.isRowAbs=a),(0===e||void 0===o||r.col>o)&&(r.col=o,r.isColAbs=s),(0===e||void 0===i||n.rowi)&&(t.row=i),(void 0===t.col||t.col>o)&&(t.col=o),(void 0===i||r.row=t.sec[0].start&&e<=t.sec[0].end?n?t.sec[0].start:e+t.sec[1].amount:e>=t.sec[1].start&&e<=t.sec[1].end?r?t.sec[1].end:e-t.sec[0].amount:e}function m(e,t,r,i,o){if(!t.isRange())return t.getText();if((t.getSheetName()||o)!==i)return t.getText();if(t.isRowRange()&&"row"!==e||t.isColRange()&&"col"!==e)return t.getText();const a=function(e,t,r){const i=t.split(":").map(c),[o,a]=f(i),s=o[e],l=a[e],u=r.isBackward&&s>=r.sec[0].start&&s<=r.sec[0].end,h=!r.isBackward&&l>=r.sec[1].start&&l<=r.sec[1].end;for(let t=0;t{const t=u.exec(e);return"$"+t[2]+"$"+t[4]})).join(":"):t.split(":").map((e=>(e.indexOf("$")<0?"$":"")+e)).join(":"),e.getFullSheetName()+t}function R(e){if(!e.isRange())return e.getText();let t=e.getValue();return t=e.isCellRange()?t.split(":").map((e=>{const t=u.exec(e);return`${t[2]}${t[4]}`})).join(":"):t.split(":").map((e=>e.replace("$",""))).join(":"),`${e.getFullSheetName()}${t}`}function S(e){const t=c(e);return(!Object.prototype.hasOwnProperty.call(t,"isRowAbs")||t.isRowAbs)&&(!Object.prototype.hasOwnProperty.call(t,"isColAbs")||t.isColAbs)}function b(e){return!e.isRange()||(e.isGroup()?e.getTokens().every(b):e.isRowRange()||e.isColRange()?e.getValue().split(":").every(S):S(e.getValue()))}function I(e){let t="";const r=(0,o.tokenize)(e);for(let e=0;e"R"));break;case o.SYMBOL.ROWRANGECELL:r+=o.lexer.yytext.replace(/R/g,(()=>"C"));break;default:r+=o.lexer.yytext}return o.lexer.popState(),r}function N(e,t,r,a,s){const l=r.from.row-t.from.row,u=r.from.col-t.from.col,d=e=>{if(!e.isCellRange())return e.getText();const o=e.getSheetName()||a,d=e.getValue(),g=d.split(":").map(c),p=h(d),m=t.includes(p.top,p.left),v=t.includes(p.bottom,p.right),y=t.includes(p.top,p.right),C=t.includes(p.bottom,p.left),x=r.includes(p.top,p.left),w=r.includes(p.bottom,p.right),_=r.includes(p.top,p.right),R=r.includes(p.bottom,p.left),S=0!==l&&0===u,b=0!==u&&0===l;if(t.shName===o&&g.every((e=>t.includes(e.row,e.col)))){const t=g.map((e=>(0,n.coordToLabel)({row:e.row+l,col:e.col+u,isRowAbs:e.isRowAbs,isColAbs:e.isColAbs}))).join(":"),i=r.shName;return(s||!e.getSheetName()&&i===a?"":`${(0,n.escapeSheetName)(i)}!`)+t}if(s&&!e.getSheetName())return`${(0,n.escapeSheetName)(t.shName)}!`+d;if(t.shName===o&&r.shName===o&&((m&&y||C&&v)&&S||(m&&C||y&&v)&&b)){const a=function(e,t,r,n,o){let a,s,l,u,c,h;void 0===o&&(o=-1),1===o?(a=e.from[n],s=e.to[n],l=t.from[n],u=t.to[n],c=r.from[n],h=r.to[n]):(a=-e.to[n],s=-e.from[n],l=-t.to[n],u=-t.from[n],c=-r.to[n],h=-r.from[n]),cs?a=u+1:l===a?(a=Math.min(c,u+1),s=Math.max(h,s)):(a=h>=s?u+1:a+c-l,s=Math.max(h,s));const d=new i.CellRange({row:e.from.row,col:e.from.col},{row:e.to.row,col:e.to.col},e.shName);return 1===o?(d.from[n]=a,d.to[n]=s):(d.to[n]=-a,d.from[n]=-s),d}(new i.CellRange({row:p.top,col:p.left},{row:p.bottom,col:p.right},o),t,r,S?"row":"col",m?1:-1),s=[(0,n.coordToLabel)({row:a.from.row,col:a.from.col,isRowAbs:p.isTopAbs,isColAbs:p.isLeftAbs}),(0,n.coordToLabel)({row:a.to.row,col:a.to.col,isRowAbs:p.isBottomAbs,isColAbs:p.isRightAbs})].join(":");return`${e.getFullSheetName()}${s}`}if(r.shName===(e.getSheetName()||a)){const[t,i]=f(g);if(!x&&!w)return e.getText();if(x&&w)return"#REF!";r.from.rowi.row&&R&&w&&(i.row=r.from.row-1),r.from.coli.col&&_&&w&&(i.col=r.from.col-1);const o=g.map((e=>(0,n.coordToLabel)({row:Math.min(Math.max(e.row,t.row),i.row),col:Math.min(Math.max(e.col,t.col),i.col),isRowAbs:e.isRowAbs,isColAbs:e.isColAbs}))).join(":");return`${e.getFullSheetName()}${o}`}return`${e.getFullSheetName()}${e.getValue()}`};let g="";const p=(0,o.tokenize)(e);for(let e=0,t=p.size();et)&&(a.row=t)}function h(e){const t=u(e,n.columnLabelToIndex);null!==t&&(!Object.prototype.hasOwnProperty.call(a,"col")||a.col>t)&&(a.col=t)}const d=o.SYMBOL,f=t?l:s;for(const n of e)if("string"==typeof n){for(o.lexer.setInput(n),t&&o.lexer.pushState("R1C1");!o.lexer.done;)switch(r=o.lexer.next(),i=o.lexer.yytext,r){case d.CELL:{const e=i.match(f.CELL);t?(c([e[1],e[2]]),h([e[3],e[4]])):(c([e[3],e[4]]),h([e[1],e[2]]));break}case d.COLRANGECELL:{const e=i.match(f.COLRANGECELL);h([e[1],e[2]]),h([e[3],e[4]]);break}case d.ROWRANGECELL:{const e=i.match(f.ROWRANGECELL);c([e[1],e[2]]),c([e[3],e[4]]);break}case d.error:a={}}t&&o.lexer.popState()}return a}},89373:(e,t,r)=>{"use strict";r.d(t,{default:()=>n});const n={DATETIME:-1,DATE:-2,TIME:-3,CURRENCY:-4,PERCENTAGE:-5,isDate:function(e){return e===this.DATE}}},88895:(e,t,r)=>{"use strict";function n(e){const t={row:0,col:0},r={row:Number.MAX_VALUE,col:Number.MAX_VALUE};for(let n=0,i=e.length;nt.row&&(t.row=i),o>t.col&&(t.col=o)}return{from:r,to:t}}r.d(t,{fromCellRefs:()=>n})},2813:(e,t,r)=>{"use strict";r.r(t),r.d(t,{getSortOrder:()=>l});var n,i=r(72208),o=r(69705),a=r(51388);function s(e,t,r,a,l,u,c){if(l>=a)return u>c?1:-1;const h=e(u,l),d=e(c,l),[f,g]=[h,d].map((e=>(0,i.isNumber)(e)?o.ValueType.NUMBER:(0,i.isString)(e)?o.ValueType.STRING:(0,i.isBoolean)(e)?o.ValueType.BOOLEAN:(0,i.isError)(e)?n.ERROR:o.ValueType.OTHER));if(h===d||f===o.ValueType.OTHER&&g===o.ValueType.OTHER)return s(e,t,r,a,l+1,u,c);if(f===o.ValueType.OTHER||g===o.ValueType.OTHER)return f===o.ValueType.OTHER?1:-1;const p=(Array.isArray(r)?r[l]:r)?1:-1;let m=1;return f!==g?m=f>g?1:-1:f===o.ValueType.BOOLEAN?m=h?1:-1:f===o.ValueType.NUMBER?m=h>d?1:-1:f===o.ValueType.STRING?m=t.compare(h,d):f===n.ERROR&&(m=0),p*m}function l(e,t,r,n,i){const o=(0,a.makeSequence)(t).sort(((t,o)=>s(e,n,i,r,0,t,o))),l=new Array(o.length);for(let e=0;e{"use strict";r.d(t,{isBoolean:()=>s,isError:()=>a,isNumber:()=>n.default,isString:()=>i.default,numberify:()=>o,toEffective:()=>l});var n=r(290),i=r(36378);function o(e){if(null==e)return 0;switch(typeof e){case"number":return e;case"string":return+e;case"boolean":return e?1:0}return NaN}function a(e){return"[object Error]"===Object.prototype.toString.call(e)}function s(e){return!0===e||!1===e}function l(e){return+e.toPrecision(15)}},81394:(e,t,r)=>{"use strict";function n(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!1);const n=new Map,i=t?e[0].map(((t,r)=>JSON.stringify(e.map((e=>e[r]))))):e.map((e=>JSON.stringify(e))),o=new Array(i.length).fill(!0);for(let e=0;en})},69705:(e,t,r)=>{"use strict";r.d(t,{ValueType:()=>a,deserializeFormulaValue:()=>l,serializeFormulaValue:()=>s,toFormulaString:()=>u});var n=r(77226),i=r(72208),o=r(35821);let a;function s(e){return Array.isArray(e)?e.map(s):(0,n.default)(e)?{error:e.message}:e}function l(e){return Array.isArray(e)?e.map(l):(0,n.default)(e)?(0,o.getErrorFromText)(e.error):e}function u(e){const t=e=>Array.isArray(e)?t(e[0]):(0,i.isError)(e)?e.message:"boolean"==typeof e?e?"True":"False":"number"==typeof e?`${e}`:`"${e??""}"`;return Array.isArray(e)?`{${e.map((e=>Array.isArray(e)?e.map(t).join(", "):t(e))).join("; ")}}`:t(e)}!function(e){e[e.OTHER=0]="OTHER",e[e.NUMBER=1]="NUMBER",e[e.STRING=2]="STRING",e[e.BOOLEAN=3]="BOOLEAN"}(a||(a={}))},47915:(e,t,r)=>{"use strict";r.d(t,{default:()=>s});var n=r(19303),i=r(72208),o=r(35821);function a(e){return function(t,r){return function(e,t,r){if(t=(0,i.numberify)(t),r=(0,i.numberify)(r),isNaN(t)||isNaN(r))return o.default.VALUE;const n=e(t,r);return isFinite(n)?(0,i.toEffective)(n):(0,i.isError)(n)?n:o.default.NUM}(e,t,r)}}const s={"&":function(e,t){return"number"==typeof e&&(e=(0,i.toEffective)(e)),"number"==typeof t&&(t=(0,i.toEffective)(t)),e+""+t},"=":n.equal,">":n.greaterThan,"<":n.lessThan,">=":n.greaterThanOrEqual,"<=":n.lessThanOrEqual,"<>":n.not,"%":function(e){return.01*(0,i.numberify)(e)},"+":a((function(e,t){return e+t})),"-":a((function(e,t){return e-t})),"*":a((function(e,t){return e*t})),"/":a((function(e,t){if(0===t)return o.default.DIV0;const r=e/t;return r===1/0?o.default.DIV0:isNaN(r)?o.default.VALUE:r})),"^":a((function(e,t){return Math.pow(e,t)})),invert:function(e){const t=-1*(0,i.numberify)(e);return isNaN(t)?o.default.VALUE:t},plus:function(e){return e}}},68305:(e,t,r)=>{"use strict";r.d(t,{default:()=>d});var n=r(28213),i=r(48961),o=r(35821),a=r(82239),s=r(72208),l=r(57768),u=r(39111);const c="Maximum call stack size exceeded"+((0,n.isSafari)()?".":""),h=(0,n.isFirefox)()?e=>e instanceof Error&&"too much recursion"===e.message:e=>e instanceof RangeError&&e.message===c,d=class{constructor(e){this.ctx=new l.default(e),this.parser=(0,u.createGrammarParser)(new u.ParserHandler(this.ctx)),this.dimParser=(0,u.createGrammarParser)(new u.ArrayDimHandler(this.ctx))}exec(e,t){if(!this.ctx.preExec(t))return{error:o.default.REF,result:null};const r=this._parse(e,t);return this.ctx.postExec(t)?r:{error:o.default.REF,result:null}}parseRange(e,t){if(!this.ctx.preExec(t))return null;let r;try{r=this.parser.parse(e)}catch(e){}return this.ctx.postExec(t)&&r&&r instanceof a.RefExpr?r.toRange():null}execArrayDimension(e,t){const r={height:0,width:0};if(!this.ctx.preExec(t))return r;let n=null;try{n=this.dimParser.parse(e)}catch{}const o=(0,i.getArrayDimension)(n,this.ctx);return this.ctx.postExec(t)?o:r}getRangeValues(e,t,r){if(!this.ctx.preExec(t))return o.default.REF;const n=this.ctx.visibleRangeValue(a.RefExpr.fromRange(e,void 0),r);return this.ctx.postExec(t)?n:o.default.REF}_parse(e,t){let r=null,n=null,i=!1;try{r=this.parser.parse(e).finalize(this.ctx),s.isError(r)&&(n=r,r=null)}catch(e){if(h(e)){if(n=o.default.CALC,i=!0,t.item)for(;this.ctx.item!==t.item;)this.ctx.postExec(t)}else n=o.default.ERROR;r=null}return{error:n,result:r,delayCalc:i}}}},50039:(e,t,r)=>{"use strict";r.d(t,{ResolveOption:()=>n,VisibleResolveOption:()=>i});class n{constructor(){this.keepNull=!1,this.keepNfId=!1,this.keepLink=!1}assign(e){return Object.assign(this,e),this}}class i extends n{constructor(){super(),this.skipHiddenRow=!1,this.skipHiddenCol=!1,this.skipFiltered=!1,this.skipSubtotal=!1}}},89463:(e,t,r)=>{"use strict";r.d(t,{default:()=>g});var n=r(82239),i=r(72208),o=r(89373);function a(e){return n.Expr.fromValue(e??null)}function s(e){return e instanceof n.Expr?((e.isCellRef()||e.isRowRef()||e.isColRef())&&e.setImplicit(),e.isValue()&&void 0===e.v&&(e.v=null),e):a(e)}function l(e,t,r){return t.item&&t.item.setNfIdHint(r,!0),a(e)}function u(e,t){return l(e,t,o.default.DATE)}function c(e,t){return l(e,t,o.default.CURRENCY)}function h(e,t){return l(e,t,o.default.PERCENTAGE)}function d(e,t){return t.item&&t.item.resetNfIdHint(),a(e)}const f={IF:s,CHOOSE:s,OFFSET:s,INDIRECT:s,INDEX:s,IFS:s,SUBTOTAL:function(e,t){return t.item&&t.item.markSubtotal(),a(e)},HYPERLINK:function(e,t,r){return(0,i.isError)(e)?a(e):new n.LinkExpr(e.text,e.href)},NOW:function(e,t){return l(e,t,o.default.DATETIME)},TIME:function(e,t){return l(e,t,o.default.TIME)},TODAY:u,WORKDAY:u,DATE:u,EDATE:u,EOMONTH:u,DB:c,DDB:c,FV:c,FVSCHEDULE:c,IPMT:c,IRR:h,MIRR:h,NPV:c,PMT:c,PPMT:c,PV:c,RATE:h,SLN:c,XLOOKUP:function(e,t){if(e instanceof n.Expr)return s(e);if(e instanceof Array)for(const r in e)for(const i in e[r]){let o=e[r][i];if(o instanceof n.Expr)(o.isCellRef()||o.isRowRef()||o.isColRef())&&(o.v=o.toCellRef(t)?.v.slice(0,1)??o.v);else for(;o instanceof Array;)o=o[0];e[r][i]=o}return a(e)}};["COUNT","COUNTA","COUNTBLANK","COUNTIF","COUNTIFS","DAY","DAYS","DATEDIF","MONTH","YEAR","WEEKDAY","HOUR","MINUTE","SECOND","WEEKNUM","YEARFRAC","ISOWEEKNUM","NETWORKDAYS.INTL","NETWORKDAYS","TIMEVALUE",">","<","=","<>",">=","<=","OR","AND","NOT","XOR"].forEach((function(e){f[e]=d}));const g={table:f,defaultHandler:a}},42067:(e,t,r)=>{"use strict";r.d(t,{default:()=>n});const n=["ABS","ADDRESS","ACCRINT","ACOS","ACOSH","ACOT","ACOTH","AND","ARABIC","ASIN","ASINH","ATAN","ATAN2","ATANH","AVEDEV","AVERAGE","AVERAGEA","AVERAGEIF","AVERAGEIFS","BASE","BESSELI","BESSELJ","BESSELK","BESSELY","BETA.DIST","BETA.INV","BETADIST","BETAINV","BIN2DEC","BIN2HEX","BIN2OCT","BINOM.DIST","BINOM.INV","BINOMDIST","BITAND","BITLSHIFT","BITOR","BITRSHIFT","BITXOR","CEILING","CEILING.MATH","CEILING.PRECISE","CHAR","CHIDIST","CHIINV","CHISQ.DIST","CHISQ.DIST.RT","CHISQ.INV","CHISQ.INV.RT","CHISQ.TEST","CHITEST","CHOOSE","CLEAN","CODE","COLUMN","COLUMNS","COMBIN","COMBINA","COMPLEX","CONCAT","CONCATENATE","CONFIDENCE","CONFIDENCE.NORM","CONFIDENCE.T","CORREL","COS","COSH","COT","COTH","COUNT","COUNTA","COUNTBLANK","COUNTIF","COUNTIFS","COVAR","COVARIANCE.P","COVARIANCE.S","CRITBINOM","CSC","CSCH","CUMIPMT","CUMPRINC","DATE","DATEDIF","DATEVALUE","DAY","DAYS","DAYS360","DB","DDB","DEC2BIN","DEC2HEX","DEC2OCT","DECIMAL","DEGREES","DELTA","DEVSQ","DOLLAR","DOLLARDE","DOLLARFR","EDATE","EFFECT","EOMONTH","ERF","ERF.PRECISE","ERFC","ERFC.PRECISE","ERROR.TYPE","EVEN","EXACT","EXP","EXPON.DIST","EXPONDIST","FALSE","F.DIST","F.DIST.RT","F.INV","F.INV.RT","F.TEST","FACT","FACTDOUBLE","FDIST","FIND","FINV","FISHER","FISHERINV","FIXED","FLOOR","FLOOR.MATH","FLOOR.PRECISE","FORECAST","FTEST","FV","FVSCHEDULE","GAMMA","GAMMA.DIST","GAMMA.INV","GAMMADIST","GAMMAINV","GAMMALN","GAMMALN.PRECISE","GAUSS","GCD","GEOMEAN","GESTEP","HARMEAN","HEX2BIN","HEX2DEC","HEX2OCT","HLOOKUP","HOUR","HYPGEOM.DIST","HYPGEOMDIST","IF","IFERROR","IFNA","IMABS","IMAGINARY","IMARGUMENT","IMCONJUGATE","IMCOS","IMCOSH","IMCOT","IMCSC","IMCSCH","IMDIV","IMEXP","IMLN","IMLOG10","IMLOG2","IMPOWER","IMPRODUCT","IMREAL","IMSEC","IMSECH","IMSIN","IMSINH","IMSQRT","IMSUB","IMSUM","IMTAN","INDIRECT","INT","INTERCEPT","IPMT","IRR","ISBLANK","ISERR","ISERROR","ISEVEN","ISLOGICAL","ISNA","ISODD","ISNONTEXT","ISNUMBER","ISO.CEILING","ISOWEEKNUM","ISPMT","ISTEXT","TEXT","KURT","LARGE","LCM","LEFT","LEN","LN","LOG","LOG10","LOGINV","LOGNORM.DIST","LOGNORM.INV","LOGNORMDIST","LOWER","MATCH","MAX","MAXA","MAXIFS","MEDIAN","MID","MIN","MINA","MINIFS","MINUTE","MIRR","MOD","MODE","MODE.SNGL","MONTH","MROUND","MULTINOMIAL","N","NA","NEGBINOM.DIST","NEGBINOMDIST","NETWORKDAYS","NETWORKDAYS.INTL","NOMINAL","NORM.DIST","NORM.INV","NORM.S.DIST","NORM.S.INV","NORMDIST","NORMINV","NORMSDIST","NORMSINV","NOT","NOW","NPER","NPV","OCT2BIN","OCT2DEC","OCT2HEX","ODD","OFFSET","OR","PDURATION","PEARSON","PERCENTILE","PERCENTILE.EXC","PERCENTILE.INC","PERCENTRANK","PERCENTRANK.EXC","PERCENTRANK.INC","PERMUT","PERMUTATIONA","PHI","PI","PMT","POISSON","POISSON.DIST","POWER","PPMT","PROB","PRODUCT","PROPER","PV","QUARTILE","QUARTILE.EXC","QUARTILE.INC","QUOTIENT","RADIANS","RAND","RANDBETWEEN","RANK","RANK.AVG","RANK.EQ","RATE","REPLACE","REPT","RIGHT","ROMAN","ROUND","ROUNDDOWN","ROUNDUP","ROW","ROWS","RRI","RSQ","SEARCH","SEC","SECH","SECOND","SERIESSUM","SIGN","SIN","SINH","SKEW","SKEW.P","SLN","SLOPE","SMALL","SQRT","SQRTPI","STANDARDIZE","STDEV","STDEV.P","STDEV.S","STDEVA","STDEVP","STDEVPA","STEYX","SUBSTITUTE","SUBTOTAL","SUM","SUMIF","SUMIFS","SUMPRODUCT","SUMSQ","SUMX2MY2","SUMX2PY2","SUMXMY2","SYD","T","T.DIST","T.DIST.2T","T.DIST.RT","T.INV","T.INV.2T","T.TEST","TAN","TANH","TBILLEQ","TBILLPRICE","TBILLYIELD","TDIST","TIME","TIMEVALUE","TINV","TODAY","TRIM","TRIMMEAN","TRUE","TRUNC","TTEST","TYPE","UNICHAR","UNICODE","UPPER","VALUE","VAR","VAR.P","VAR.S","VARA","VARP","VARPA","VLOOKUP","WEEKDAY","WEEKNUM","WEIBULL","WEIBULL.DIST","WORKDAY","WORKDAY.INTL","XIRR","XLOOKUP","XNPV","XOR","YEAR","YEARFRAC","Z.TEST","ZTEST","HYPERLINK","ISDATE","INDEX","IFS","SEQUENCE","SORT","SORTBY","FILTER","RANDARRAY","TRANSPOSE","UNIQUE","IMPORTRANGE"]},3288:(e,t,r)=>{"use strict";r.d(t,{GrammarParser:()=>i.default,SYMBOL:()=>i.SYMBOL,TokenList:()=>o.default,changeSheetName:()=>s.changeSheetName,lexer:()=>n.default,tokenize:()=>a.default});var n=r(27913),i=r(75005),o=r(5818),a=r(39852),s=r(31242)},10453:(e,t,r)=>{"use strict";r.d(t,{default:()=>u});var n=r(41042),i=r(25548),o=r.n(i),a=r(43990);const s=o().symbols_,l=new Map(Object.entries({...s,SPACE:!1,",":s.COMMA,";":s.SEMICOLON,NAME:s.VARIABLE,ROWRANGE:s.ROWRANGECELL,COLRANGE:s.COLRANGECELL}));class u{constructor(){this.setInput("")}parseError(){return this.yy.parser&&this.yy.parser.parseError(...arguments),this._handleParseError()}setInput(e,t){return this._index=0,this.tokens=[],this._initJisonState(e,t),this}lex(){let e=this.next();for(;!e;)e=this.next();return e}next(){if(0===this._index&&(this.tokens=this._initLexingTokens()),!this._validateInput())return this.setInput(this._input,this.yy).next();if(this.done)return this._translate("EOF");if(this._index>=this.tokens.length)return this.parseError(`Unrecognized text: ${this._input}`);const e=this.tokens[this._index++];this._updateJisonState(e);const t=this._getTokenLabel(e.tokenType);return this._translate(t)}pushState(e){this.conditionStack.push(e)}popState(){return this.conditionStack.length>1?this.conditionStack.pop():this.conditionStack[0]}_initLexingTokens(){const e=this.conditionStack[this.conditionStack.length-1],t=e===this.conditionStack[0]?void 0:e,{errors:r,tokens:i}=n.default.tokenize(this._input,t);if(0===r.length)return i;const o=Math.min.apply(null,r.map((e=>e.offset)));return i.filter((e=>e.startOffset{"use strict";r.d(t,{default:()=>u});var n=r(43990),i=r(9300);function o(e,t,r){e[e.indexOf(t)]=r}const a=[i.SPACE,i.FUNCTION,i.SHEETNAME,i.CELL_A1,i.COLRANGE_A1,i.ROWRANGE_A1,i.NUMBER,i.STRING,i.LOGIC,i.ERROR,i.NAME,i.COMMA,i.SEMICOLON,i.LPAREN,i.RPAREN,i.LCURLY,i.RCURLY,i.COLON,i.PERCENT,i.EXP,i.MUL,i.DIV,i.ADD,i.SUB,i.CONCAT,i.NE,i.LE,i.GE,i.EQ,i.LT,i.GT],s=a.slice();o(s,i.CELL_A1,i.CELL_R1C1),o(s,i.ROWRANGE_A1,i.ROWRANGE_R1C1),o(s,i.COLRANGE_A1,i.COLRANGE_R1C1);const l={A1:a,R1C1:s},u=new n.Lexer({modes:l,defaultMode:"A1"},{skipValidations:!0})},27913:(e,t,r)=>{"use strict";r.d(t,{default:()=>n});const n=new(r(10453).default)},75005:(e,t,r)=>{"use strict";r.d(t,{SYMBOL:()=>s,default:()=>a});var n=r(25548),i=r.n(n),o=r(10453);i().Parser.prototype.lexer=new o.default;const a=i().Parser,s=i().symbols_},9300:(e,t,r)=>{"use strict";r.d(t,{ADD:()=>v,CELL_A1:()=>B,CELL_R1C1:()=>W,COLON:()=>h,COLRANGE_A1:()=>H,COLRANGE_R1C1:()=>j,COMMA:()=>d,CONCAT:()=>C,DIV:()=>m,EQ:()=>x,ERROR:()=>M,EXP:()=>g,FUNCTION:()=>O,GE:()=>S,GT:()=>b,LCURLY:()=>a,LE:()=>_,LOGIC:()=>E,LPAREN:()=>l,LT:()=>R,MUL:()=>p,NAME:()=>A,NE:()=>w,NUMBER:()=>k,PERCENT:()=>f,RCURLY:()=>s,ROWRANGE_A1:()=>V,ROWRANGE_R1C1:()=>G,RPAREN:()=>u,SEMICOLON:()=>c,SHEETNAME:()=>L,SPACE:()=>T,STRING:()=>N,SUB:()=>y});var n=r(43990);const i={LCURLY:"{",RCURLY:"}",LPAREN:"(",RPAREN:")",SEMICOLON:";",COLON:":",COMMA:",",PERCENT:"%",EXP:"^",MUL:"*",DIV:"/",ADD:"+",SUB:"-",CONCAT:"&",EQ:"=",NE:"<>",LE:"<=",LT:"<",GE:">=",GT:">"};function o(e){const t=i[e];return(0,n.createToken)({name:e,label:t,pattern:t})}const a=o("LCURLY"),s=o("RCURLY"),l=o("LPAREN"),u=o("RPAREN"),c=o("SEMICOLON"),h=o("COLON"),d=o("COMMA"),f=o("PERCENT"),g=o("EXP"),p=o("MUL"),m=o("DIV"),v=o("ADD"),y=o("SUB"),C=o("CONCAT"),x=o("EQ"),w=o("NE"),_=o("LE"),R=o("LT"),S=o("GE"),b=o("GT"),I="[\\u00a1-\\ud7ff\\ue000-\\uffff]|[\\ud800-\\udbff][\\udc00-\\udfff]",A=(0,n.createToken)({name:"NAME",pattern:new RegExp(`([A-Z_]|${I})([A-Z0-9_.\\]|${I})*`,"i")}),T=(0,n.createToken)({name:"SPACE",pattern:/\s+/,line_breaks:!0}),E=(0,n.createToken)({name:"LOGIC",pattern:/TRUE|FALSE/i,longer_alt:A}),M=(0,n.createToken)({name:"ERROR",pattern:/#DIV\/0!|#N\/A|#NAME\?|#NULL!|#NUM!|#REF!|#VALUE!|#GETTING_DATA/i}),k=(0,n.createToken)({name:"NUMBER",pattern:/[0-9]*\.?[0-9]+([Ee][+-]?[0-9]+)?/}),N=(0,n.createToken)({name:"STRING",pattern:/"([^"]|"")*"/}),O=(0,n.createToken)({name:"FUNCTION",pattern:/[A-Z][A-Z0-9.]*(?=\()/i}),D=`([A-Z0-9_]|${I})([A-Z0-9_.]|${I})*`,L=(0,n.createToken)({name:"SHEETNAME",pattern:new RegExp(`${D}!|'([^']|'')+'!`,"i")}),P="\\$?[0-9]{1,7}",F="\\$?[A-Z]{1,3}",B=(0,n.createToken)({name:"CELL_A1",pattern:new RegExp(`${F}${P}`,"i"),longer_alt:A}),V=(0,n.createToken)({name:"ROWRANGE_A1",pattern:new RegExp(`${P}:${P}`,"i")}),H=(0,n.createToken)({name:"COLRANGE_A1",pattern:new RegExp(`${F}:${F}`,"i")}),U="(R\\[-?\\d+\\]|R\\d*)",z="(C\\[-?\\d+\\]|C\\d*)",W=(0,n.createToken)({name:"CELL_R1C1",pattern:new RegExp(`${U}${z}`,"i")}),G=(0,n.createToken)({name:"ROWRANGE_R1C1",pattern:new RegExp(`${U}:${U}`,"i")}),j=(0,n.createToken)({name:"COLRANGE_R1C1",pattern:new RegExp(`${z}:${z}`,"i")})},5818:(e,t,r)=>{"use strict";r.d(t,{default:()=>d});var n=r(75005),i=r(7996);class o{constructor(e,t){this.symbol=e,this.setValue(t)}setValue(e){this.value=e}getValue(){return this.value}getText(){return this.value}isGroup(){return!1}isValid(){return this.symbol!==n.SYMBOL.error}isCellRange(){return this.symbol===n.SYMBOL.CELL}isColRange(){return this.symbol===n.SYMBOL.COLRANGECELL}isRowRange(){return this.symbol===n.SYMBOL.ROWRANGECELL}isRange(){return this.symbol===n.SYMBOL.CELL||this.symbol===n.SYMBOL.COLRANGECELL||this.symbol===n.SYMBOL.ROWRANGECELL}isEqualSymbol(){return this.symbol===n.SYMBOL["="]}isFunction(){return this.symbol===n.SYMBOL.FUNCTION}isVariable(){return this.symbol===n.SYMBOL.VARIABLE}isLeftParenthesis(){return this.symbol===n.SYMBOL["("]}isRightParenthesis(){return this.symbol===n.SYMBOL[")"]}isParenthesis(){return this.isLeftParenthesis()||this.isRightParenthesis()}isLeftBrace(){return this.symbol===n.SYMBOL["{"]}isRightBrace(){return this.symbol===n.SYMBOL["}"]}isNumber(){return this.symbol===n.SYMBOL.NUMBER}isComma(){return this.symbol===n.SYMBOL.COMMA}isDelimiter(){return this.symbol===n.SYMBOL.COMMA||this.symbol===n.SYMBOL["+"]||this.symbol===n.SYMBOL["-"]||this.symbol===n.SYMBOL["*"]||this.symbol===n.SYMBOL["/"]||this.symbol===n.SYMBOL["%"]||this.symbol===n.SYMBOL["^"]||this.symbol===n.SYMBOL["&"]}isLeftDelimiter(){return this.isLeftParenthesis()||this.isEqualSymbol()||this.isDelimiter()}isRightDelimiter(){return this.isRightParenthesis()||this.symbol===n.SYMBOL.EOF||this.isDelimiter()}isString(){return this.symbol===n.SYMBOL.STRING}isWhitespace(){return!1===this.symbol}}class a extends o{constructor(e,t){super(e,t),this.pair=void 0}getPair(){return this.pair}bind(e){if(this.unbind(),void 0!==e)return e.pair=this,this.pair=e,e}unbind(){const e=this.pair;if(void 0!==e)return e.pair=void 0,this.pair=void 0,e}getMatchSymbol(){switch(this.symbol){case n.SYMBOL["("]:return n.SYMBOL[")"];case n.SYMBOL[")"]:return n.SYMBOL["("];case n.SYMBOL["{"]:return n.SYMBOL["}"];case n.SYMBOL["}"]:return n.SYMBOL["{"]}}isMatch(e){return void 0!==e&&e.symbol===this.getMatchSymbol()}}class s extends o{constructor(e,t,r){super(e,t),this.shName=r}getText(){const e=this.value||"";return void 0===this.shName?e:this.shName+e}getSheetName(){return void 0===this.shName?this.shName:(0,i.extractSheetName)(this.shName)}getFullSheetName(){return this.shName||""}setSheetName(e){this.shName=e}isValid(){return super.isValid()&&void 0!==this.value}}const l=e=>class extends e{constructor(){for(var e=arguments.length,t=new Array(e),r=0;r=0)return t+n}t+=this.tokens[r].getText().length}return-1}};class u extends(l(o)){constructor(e,t){super(t,e)}getValue(){let e="";const t=this.tokens;for(let r=0;rthis.tokens.length)return-1;let t,r=this.tokens.length,n=e.length-1;for(;n>=0;){if(--r<0)return-1;if(t=this.tokens[r],!1!==t.symbol&&t.symbol!==e[n--])return-1}return r}static createToken(e,t,r){switch(e){case n.SYMBOL["("]:case n.SYMBOL[")"]:case n.SYMBOL["{"]:case n.SYMBOL["}"]:return new a(e,t);case n.SYMBOL.SHEETNAME:return new s(e,void 0,t);case n.SYMBOL.CELL:case n.SYMBOL.ROWRANGECELL:case n.SYMBOL.COLRANGECELL:case n.SYMBOL.VARIABLE:return new s(e,t,r)}return new o(e,t)}static createGroup(e,t){return e===n.SYMBOL.CELL?new c(e,t):new u(e,t)}static createRangeToken(e,t,r){if(r&&(r=(0,i.escapeSheetName)(r)+"!"),"row"===t)return new s(n.SYMBOL.ROWRANGECELL,e,r);if("col"===t)return new s(n.SYMBOL.COLRANGECELL,e,r);{const t=e.split(":");if(1===t.length)return new s(n.SYMBOL.CELL,e,r);const i=[new s(n.SYMBOL.CELL,t[0],r)];for(let e=1;e=0){const o=h.createRangeToken(t,r,n);return this.tokens.splice(i,1,o),o.getText().length-e.getText().length}return 0}insertFormulaText(e,t){let r=0,i=e.length+1;for(let s=0;s{"use strict";r.d(t,{default:()=>o});var n=r(27913),i=r(5818);const o=function(e,t){n.default.setInput(e),n.default.pushState(t||"INITIAL");const r=new i.default;for(;!n.default.done;){const e=n.default.next();n.default.yytext&&r.append(e,n.default.yytext)}return r}},31242:(e,t,r)=>{"use strict";r.d(t,{changeSheetName:()=>o});var n=r(39852),i=r(7996);function o(e,t,r){return function(e,t,r){let o=!1;const a=(0,n.default)(e);for(let e=0,r=a.size();ee===t?r:void 0))}},7996:(e,t,r)=>{"use strict";function n(e){return e>=0?(e+1).toString():""}function i(e){let t="";for(;e>=0;)t=String.fromCharCode(e%26+65)+t,e=e=Math.floor(e/26-1);return t}function o(e){return function(e){return(e.isColAbs?"$":"")+i(e.col)}(e)+function(e){return(e.isRowAbs?"$":"")+n(e.row)}(e)}function a(e,t,r){return e+(r?t.toString():`[${t}]`)}function s(e){return a("R",e.row+1,e.isRowAbs)+a("C",e.col+1,e.isColAbs)}function l(e){return/^\w+$/.test(e)?e:`'${e.replace(/'/g,"''")}'`}function u(e){const t=parseInt(e,10);return isNaN(t)||t<1?-1:t-1}function c(e){let t=0;const r=(e||"").toUpperCase();for(let e=0;ei,columnLabelToIndex:()=>c,coordToLabel:()=>o,coordToR1C1:()=>s,escapeSheetName:()=>l,extractSheetName:()=>d,extractString:()=>h,rowIndexToLabel:()=>n,rowLabelToIndex:()=>u})},59182:(e,t,r)=>{"use strict";r.d(t,{default:()=>i});const n=r(43733).SS.MODEL.BaseAction,i=class extends n{fail(e){return super.fail(e).catch((e=>({sucess:!1,error:e})))}async done(e){return await super.done(e),{sucess:!0}}}},86743:(e,t,r)=>{"use strict";r.d(t,{default:()=>i});const n=new class{constructor(){this.map=new Map,this.id=-1}_waitFor(){const e=this.id++,t=new Promise((t=>{this.map.set(e,(function(){for(var e=arguments.length,r=new Array(e),n=0;ne(...t))),t}waitForWebAPICallback(){const[e,t]=this._waitFor();return[e,t.then((e=>{const[t,r]=e;return(t?Promise.resolve:Promise.reject)(r)}))]}},i=n},93387:(e,t,r)=>{"use strict";r.d(t,{default:()=>u});var n=r(70596),i=r.n(n),o=r(96803),a=r(86296),s=r(71800);let l=null;const u=class{constructor(){this._version=1,this._transformedDrawings={}}setVersion(e){this._version=e}getPartialCells(e,t,r,n,i){const o=e.getDataModel(),[a,s,l,u]=e.getRangeBound({row:t,col:r},{row:n,col:i}),c=Math.min(l,o.cellCollections.length-1),h={},d=e.renderCache;for(let e=a;e<=c;e++){const t=o.cellCollections[e];if(!t)continue;const r={},n=Math.min(u,t.cells.length-1);for(let i=s;i<=n;i++){const n=t.cells[i];if(!n)continue;const o=d.renderData(e,i,n),a=n.getProperties(),s=n.getValue(),l={v:s&&s.toJSON?this._version>1?s.toJSON():o.v:s,s:n.getXfId(),x:o.v,t:o.t};void 0!==o.c&&(l.c=o.c),o.isLink()&&(l.e=o.e),a.cfStyle&&(l.cf=[(f=a.cfStyle).bold?1:0,f.italic?1:0,f.strike?1:0,f.underline?1:0,f.bgColor||"",f.color||""]),a.validId&&(l.vi=a.validId,a.synoInvalid&&(l.iv=a.synoInvalid)),r[i]=l}h[e]=r}var f;return h}getAll(e){const t=e.getDataModel(),r=e.countRows(),n=e.countCols();let i,o;const a={};for(i=0;i0?{s:t.getGlobalXf()}:null,rowCount:r,colCount:n},this._getPluginInfo(e))}_getPluginInfo(e){const t={synoMergeCell:"mergeCells",synoFilter:"filter",synoDrawingController:"imageController",synoFreezeBar:"freezeBar"},r={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[t[n]]=e.getPlugin(n).getDataView());return this.transformDrawingPosition(e,r?.imageController?.images),this.transformDrawingPosition(e,r?.imageController?.charts),this._transformedDrawings[e.id]=r.imageController,Object.assign(r,r.freezeBar,r.imageController),r.freezeBar=void 0,r.imageController=void 0,r}getStyles(e){return e.getStyleManager().toJSON()}getRowOffset(e){const t=e.countRows();let r=0;const n=[r];for(let i=0;ie.id===t))?.position;if(!o)return;const{width:a,height:s}=o,u=function(){if(null===l){const e=document.createElement("div");e.style.position="absolute",e.style.top="-99999px",e.style.left="-99999px",document.body.appendChild(e),l=i().init(e)}return l}();return u.resize({width:a,height:s}),u.setOption(n.getEchartParameters(a,s),!0),u.getDataURL({pixelRatio:window.devicePixelRatio||2})}transformDrawingPosition(e,t){const r=this.getRowOffset(e),n=this.getColOffset(e),i=new s.RowColOffsetter(r,n),l=new a.default(i);for(const e of t){const t=l.toAbsolutePosition(e.position);t.top+=o.default.COL_HEADER_HEIGHT,t.left+=o.default.ROW_HEADER_WIDTH,e.position=t}}getAllAttachments(e){const t=[];return e.forAll((e=>{const r=e.sheet.getPlugin("synoDrawingController").images;for(let e=0;e{"use strict";r.d(t,{default:()=>o});var n=r(43733),i=r(96687);const o=class{constructor(e){this.nativeBridge=e}exec(e,t){t().then((e=>{this.nativeBridge.onEditDone(e)})).catch((e=>{console.error("uncaught error",e)}))}setValues(e,t,r){this.exec(e,(()=>n.SS.editor.getAction().setValues(t,r)),i.SourceType.Edit)}}},59070:(e,t,r)=>{"use strict";r.d(t,{default:()=>u});var n=r(43733),i=r(93387),o=r(13907),a=r(4788),s=r(86743),l=r(97692);const u=class{constructor(){this.dataView=new i.default,this.nativeBridge=new a.default,this.edit=new l.default(this.nativeBridge)}initEnv(e){return(0,o.initEnv)()}init(e,t){let{version:r=1}=void 0===t?{}:t;e&&e.content&&(e=e.content),(0,o.initEditor)(this.nativeBridge,e),r>1&&this.dataView.setVersion(r)}setActive(e){n.SS.editor.getDataBridge().setCurrent(e)}getAllData(){return this.dataView.getAll(n.SS.editor.getWorkbook().current)}getPartialCells(e,t,r,i){return this.dataView.getPartialCells(n.SS.editor.getWorkbook().current,e,t,r,i)}getAllStyles(){return this.dataView.getStyles(n.SS.editor.getWorkbook())}drawChart(e){return this.dataView.drawChart(n.SS.editor.getWorkbook().current,e)}getAllAttachments(){return this.dataView.getAllAttachments(n.SS.editor.getWorkbook())}responseCallback(e,t){s.default.trigger(e,t)}async processOfflineSteps(e){for(let t=0;t{"use strict";r.d(t,{initEditor:()=>a,initEnv:()=>s});var n=r(43733),i=r(93944),o=r(59182);async function a(e,t){const r=new i.default(e),a=new o.default,s=function(e){return e.index&&0!==e.index.order.length?e.index.schemaVersion{"use strict";r.d(t,{default:()=>a});var n=r(86743);function i(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n{const t=nativeBridge;t[e]&&t[e](...r)}),0)}function o(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n{const i=n.default.waitForCallback((e=>{t(e)}));this.postMessage("confirm",i,e)}))}setTitle(e){this.postMessage("setTitle",e)}setStar(e){this.postMessage("setStar",e)}}},93944:(e,t,r)=>{"use strict";r.d(t,{default:()=>i});const n=r(43733).SS.MODEL.BaseUIBridge,i=class extends n{constructor(e){super(),this.nativeBridge=e}onEditorRender(){this.nativeBridge.onRender()}onAlert(e){this.nativeBridge.onAlert(e)}onConfirm(e){return this.nativeBridge.onConfirm(e)}}},44499:(e,t,r)=>{"use strict";r.d(t,{CellRange:()=>n.CellRange,ColRange:()=>n.ColRange,NameRange:()=>n.NameRange,RowRange:()=>n.RowRange,isCellRange:()=>n.isCellRange,isColRange:()=>n.isColRange,isRowRange:()=>n.isRowRange,parseRefRange:()=>i.parseRefRange});var n=r(97140),i=r(99845)},99845:(e,t,r)=>{"use strict";r.d(t,{parseRefRange:()=>a});var n,i=r(7996),o=r(97140);function a(e){const t=e.split(":");if(t.length>2)return null;const r=l(t[0]);if(null===r)return null;let[i,a,s]=r,u=i,c=a,h=s;if(2===t.length){const e=l(t[1]);if(null===e)return null;if([u,c,h]=e,u!==i)return null}switch(a>c&&([a,c]=[c,a]),s>h&&([s,h]=[h,s]),i){case n.CELL:return new o.CellRange({row:a,col:s},{row:c,col:h});case n.COL:return new o.ColRange(s,h);case n.ROW:return new o.RowRange(a,c);default:return null}}!function(e){e[e.CELL=0]="CELL",e[e.ROW=1]="ROW",e[e.COL=2]="COL"}(n||(n={}));const s=/^\$?([A-Z]+)?\$?(\d+)?$/i;function l(e){const t=s.exec(e);if(!t)return null;const r=void 0!==t[1]?(0,i.columnLabelToIndex)(t[1]):-1,o=void 0!==t[2]?(0,i.rowLabelToIndex)(t[2]):-1;let a=n.CELL;return-1===o&&-1===r?null:(-1===o?a=n.COL:-1===r&&(a=n.ROW),[a,o,r])}},97140:(e,t,r)=>{"use strict";r.d(t,{CellRange:()=>o,ColRange:()=>s,NameRange:()=>l,RowRange:()=>a,isCellRange:()=>g,isColRange:()=>m,isRowRange:()=>p});var n=r(7996);class i{constructor(e,t,r){this.from=e,this.to=t,this.shName=r}equals(e){return this.from===e.from&&this.to===e.to}clone(){return new this.constructor(this.from,this.to,this.shName)}toLabel(){const e=this._toLabel();return this.shName?(0,n.escapeSheetName)(this.shName)+"!"+e:e}isNameRange(){return!1}}class o extends i{getContainer(e){return e.getContainer()}key(){return`${this.from.row},${this.from.col},${this.to.row},${this.to.col}`}clone(){return new this.constructor(u(this.from),u(this.to),this.shName)}equals(e){return this.from.row===e.from.row&&this.from.col===e.from.col&&this.to.row===e.to.row&&this.to.col===e.to.col}includes(e,t){return this.from.row<=e&&this.to.row>=e&&this.from.col<=t&&this.to.col>=t}isBetweenRow(e,t){return e<=this.to.row&&t>=this.from.row}isBetweenCol(e,t){return e<=this.to.col&&t>=this.from.col}isWithinRow(e,t){return e<=this.from.row&&t>=this.to.row}isWithinCol(e,t){return e<=this.from.col&&t>=this.to.col}isInsertionWithin(e,t){return!1}willBeExpanded(e,t){return c(this.from[e],this.to[e],t)}insert(e,t,r,n){const[i,a]=[u(this.from),u(this.to)],s=h(i[e],a[e],t,r,n);return[i[e],a[e]]=s,new o(i,a,this.shName)}remove(e,t,r){const[n,i]=[u(this.from),u(this.to)],a=d(n[e],i[e],t,r);return null===a?null:([n[e],i[e]]=a,new o(n,i,this.shName))}move(e,t){const[r,n]=[u(this.from),u(this.to)],i=f(r[e],n[e],t);return[r[e],n[e]]=i,new o(r,n,this.shName)}setName(e){this.shName=e}_toLabel(){let e=(0,n.coordToLabel)(this.from);return this.from.row===this.to.row&&this.from.col===this.to.col||(e+=":"+(0,n.coordToLabel)(this.to)),e}}class a extends i{getContainer(e){return e.getRowContainer()}key(){return`${this.from},${this.to}`}includes(e,t){return this.from<=e&&this.to>=e}isBetweenRow(e,t){return e<=this.to&&t>=this.from}isBetweenCol(e,t){return!0}isWithinRow(e,t){return e<=this.from&&t>=this.to}isWithinCol(e,t){return!0}isInsertionWithin(e,t){return"row"===e&&c(this.from,this.to,t)}willBeExpanded(e,t){return"col"===e||c(this.from,this.to,t)}insert(e,t,r,n){if("col"===e)return this.clone();const[i,o]=h(this.from,this.to,t,r,n);return new a(i,o,this.shName)}remove(e,t,r){if("col"===e)return this.clone();const n=d(this.from,this.to,t,r);return n?new a(n[0],n[1],this.shName):null}move(e,t){if("col"===e)return this.clone();const[r,n]=f(this.from,this.to,t);return new a(r,n,this.shName)}_toLabel(){return(0,n.rowIndexToLabel)(this.from)+":"+(0,n.rowIndexToLabel)(this.to)}}class s extends i{getContainer(e){return e.getColContainer()}key(){return`${this.from},${this.to}`}includes(e,t){return this.from<=t&&this.to>=t}isBetweenRow(e,t){return!0}isBetweenCol(e,t){return e<=this.to&&t>=this.from}isWithinRow(e,t){return!0}isWithinCol(e,t){return e<=this.from&&t>=this.to}isInsertionWithin(e,t){return"col"===e&&c(this.from,this.to,t)}willBeExpanded(e,t){return"row"===e||c(this.from,this.to,t)}insert(e,t,r,n){if("row"===e)return this.clone();const[i,o]=h(this.from,this.to,t,r,n);return new s(i,o,this.shName)}remove(e,t,r){if("row"===e)return this.clone();const n=d(this.from,this.to,t,r);return n?new s(n[0],n[1],this.shName):null}move(e,t){if("row"===e)return this.clone();const[r,n]=f(this.from,this.to,t);return new s(r,n,this.shName)}_toLabel(){return(0,n.columnIndexToLabel)(this.from)+":"+(0,n.columnIndexToLabel)(this.to)}}class l{constructor(e,t){this.name=e,this.shName=t}getContainer(e){return e.getNameContainer()}includes(e,t){return!1}isBetweenRow(e,t){return!1}isBetweenCol(e,t){return!1}isNameRange(){return!0}}function u(e){return{row:e.row,col:e.col}}function c(e,t,r){return t-e!=0&&e=r&&(e+=n,t+=n),[e,t]}function d(e,t,r,n){if(r+n-1=n.start&&e<=n.end?!o&&t>=i.start&&t<=i.end?e=n.start:e+=i.amount:e>=i.start&&e<=i.end&&(e-=n.amount),t>=n.start&&t<=n.end?t+=i.amount:t>=i.start&&t<=i.end&&(o&&e>=n.start&&e<=n.end?t=i.end:t-=n.amount),[e,t]}function g(e){return e.constructor===o}function p(e){return e.constructor===a}function m(e){return e.constructor===s}},50137:(e,t,r)=>{"use strict";r.d(t,{default:()=>c});var n=r(21558),i=r(63515),o=r(64269),a=r(48162);class s{constructor(){this._locale=new n.default}format(e,t){return u(e).render(t,this._locale)}render(e,t){try{return u(e).formatValue(t,this._locale)}catch(e){return t}}getLocaleData(){return this._locale}static isDate(e){try{return u(e).isDate()}catch(e){return!1}}static isTime(e){try{return u(e).isTime()}catch(e){return!1}}static isDateTime(e){try{return u(e).isDateTime()}catch(e){return!1}}static isDuration(e){try{return u(e).isDuration()}catch(e){return!1}}static getBuiltinFormat(e){return o.default[e]}}let l={};function u(e){return l[e]||(l[e]=new a.default(e)),l[e]}s.clearCache=function(){l={}},s.increaseDecimal=i.increaseDecimal,s.decreaseDecimal=i.decreaseDecimal;const c=s},78272:(e,t,r)=>{"use strict";r.d(t,{multiExp:()=>a,toFixed:()=>o,toFixedFormat:()=>s});var n=r(93302),i=r.n(n);function o(e){const t=e.toString();return-1{"use strict";r.d(t,{default:()=>n});const n={0:"General",1:"0",2:"0.00",3:"#,##0",4:"#,##0.00",9:"0%",10:"0.00%",11:"0.00E+00",12:"# ?/?",13:"# ??/??",14:"m/d/yy",15:"d-mmm-yy",16:"d-mmm",17:"mmm-yy",18:"h:mm AM/PM",19:"h:mm:ss AM/PM",20:"h:mm",21:"h:mm:ss",22:"m/d/yy h:mm",37:"#,##0 ;(#,##0)",38:"#,##0 ;[Red](#,##0)",39:"#,##0.00;(#,##0.00)",40:"#,##0.00;[Red](#,##0.00)",45:"mm:ss",46:"[h]:mm:ss",47:"mmss.0",48:"##0.0E+0",49:"@",56:'"上午/下午 "hh"時"mm"分"ss"秒 "',65535:"General"}},48162:(e,t,r)=>{"use strict";r.d(t,{default:()=>a});var n=r(96007);function i(e){this.sectionCount=0,this.posNumFmt=null,this.negNumFmt=null,this.zeroNumFmt=null,this.textFmt=null,this._parse(e)}const o=new n.default("General");i.prototype._parse=function(e){const t=function(e){const t=[];let r=!1;for(var n=0,i=0;n=e.length)throw new Error("Format |"+e+"| unterminated");break;case";":r||(t.push(e.slice(i,n)),i=n+1)}if(r)throw new Error("Format |"+e+"| unterminated");return t.push(e.slice(i)),t}(e).map((function(e){return new n.default(e)}));let r=t.length;if(r>4||0===r)throw new Error("Invalid number of section");let i=o;const a=t[r-1].containsAtSymbol();switch(r<4&&a&&(i=t[r-1],r--),r){case 1:this.posNumFmt=t[0],this.textFmt=i;break;case 2:this.posNumFmt=t[0],this.negNumFmt=t[1],this.textFmt=i;break;case 3:this.posNumFmt=t[0],this.negNumFmt=t[1],this.zeroNumFmt=t[2],this.textFmt=i;break;case 4:this.posNumFmt=t[0],this.negNumFmt=t[1],this.zeroNumFmt=t[2],this.textFmt=t[3];break;default:this.posNumFmt=o,this.textFmt=i,r=1}this.sectionCount=r},i.prototype.render=function(e,t){let r,n=!1;if("number"==typeof e){let t=!1;if(e<0){switch(this.sectionCount){case 1:break;case 2:t=!this.posNumFmt.hasCondition&&!this.negNumFmt.hasCondition;break;case 3:case 4:t=!this.negNumFmt.hasCondition}t?(r=this.negNumFmt,e=-e):n=!0}r=!1===t?this.getApplicableFmt(e):this.negNumFmt,n&&!r.isNumber()&&(n=!1)}else r=this.textFmt;return{v:!1===n?r.formatValue(e,t):"-"+r.formatValue(-e,t),d:r.isDate(),c:r.color}},i.prototype.formatValue=function(e,t){return this.render(e,t).v},i.prototype.isDateTime=function(){return this.posNumFmt.isDateTime()},i.prototype.isDate=function(){return this.posNumFmt.isDate()},i.prototype.isTime=function(){return this.posNumFmt.isTime()},i.prototype.isDuration=function(){return this.posNumFmt.isDuration()},i.prototype.getApplicableFmt=function(e){return 1===this.sectionCount?this.posNumFmt.isApplicable(e)?this.posNumFmt:o:2===this.sectionCount?!this.posNumFmt.hasCondition&&e>=0||this.posNumFmt.hasCondition&&this.posNumFmt.isApplicable(e)?this.posNumFmt:!this.negNumFmt.hasCondition||this.negNumFmt.hasCondition&&this.negNumFmt.isApplicable(e)?this.negNumFmt:o:!this.posNumFmt.hasCondition&&e>0||this.posNumFmt.hasCondition&&this.posNumFmt.isApplicable(e)?this.posNumFmt:!this.negNumFmt.hasCondition&&e<0||this.negNumFmt.hasCondition&&this.negNumFmt.isApplicable(e)?this.negNumFmt:this.zeroNumFmt};const a=i},34997:(e,t,r)=>{"use strict";function n(e){let t;switch(e.toLowerCase()){case"black":t="000";break;case"green":t="0f0";break;case"white":t="fff";break;case"blue":t="00f";break;case"magenta":t="f0f";break;case"yellow":t="ff0";break;case"cyan":t="0ff";break;case"red":t="f00"}return t}r.d(t,{parse_color:()=>n})},10654:(e,t,r)=>{"use strict";r.d(t,{parse_date_code:()=>o,write_date:()=>i});var n=r(44789);function i(e,t,r,i,o){let a,s=0,l=r.y;switch(e){case"b":l=r.y+543;case"y":t.length<=2?(a=l%100,s=2):(a=l%1e4,s=4);break;case"m":if(5===t.length)return o.MONTHS[r.m-1][0];if(3===t.length)return o.MONTHS[r.m-1][1];if(t.length>2)return o.MONTHS[r.m-1][2];a=r.m,s=t.length;break;case"d":if(3===t.length)return o.DAYS[r.q][0];if(t.length>3)return o.DAYS[r.q][1];a=r.d,s=t.length;break;case"h":if(1!==t.length&&2!==t.length)throw"bad hour format: "+t;a=1+(r.H+11)%12,s=t.length;break;case"H":if(1!==t.length&&2!==t.length)throw"bad hour format: "+t;a=r.H,s=t.length;break;case"M":if(1!==t.length&&2!==t.length)throw"bad minute format: "+t;a=r.M,s=t.length;break;case"s":if(0===r.u&&("s"===t||"ss"===t))return(0,n.pad0)(r.S,t.length);if(["s","ss",".0",".00",".000"].includes(t)){let e=0;e=i>=2?3===i?1e3:100:1===i?10:1;const o=Math.floor(e*(r.S+r.u));if("s"===t)return 0===o?"0":o/e+"";const a=(0,n.pad0)(o,2+i);return"ss"===t?a.substr(0,2):"."+a.substr(2,t.length-1)}throw"bad second format: "+t;case"Z":switch(t){case"[h]":case"[hh]":a=24*r.D+r.H;break;case"[m]":case"[mm]":a=60*(24*r.D+r.H)+r.M;break;case"[s]":case"[ss]":a=60*(60*(24*r.D+r.H)+r.M)+r.S;break;default:throw"bad abstime format: "+t}s=3===t.length?1:2;break;case"e":a=l,s=1}return s>0?(0,n.pad0)(a,s):""}function o(e,t,r,n){let i=e>=0&&e<=2958465,o=Math.floor(e),a=Math.floor(86400*(e-o)),s=86400*(e-o)-a,l=0,u=[];n.date1904&&(o+=1462);const c=Math.pow(10,t);s=Math.round(s*c)/c,s>=1&&(s-=1,a+=1,86400===a&&(a=0,o+=1));const h={v:e,D:o,T:a,u:s,y:0,m:0,d:0,H:0,M:0,S:0,q:0,valid:i};if(60===o)u=r?[1317,10,29]:[1900,2,29],l=3;else if(0===o)u=r?[1317,8,29]:[1900,1,0],l=6;else{const e=new Date(1900,0,1),t=o>60?o-2:o-1;e.setDate(e.getDate()+t),u=[e.getFullYear(),e.getMonth()+1,e.getDate()],l=e.getDay(),o<60&&(l=(l+6)%7),r&&(l=0)}return h.y=u[0],h.m=u[1],h.d=u[2],h.q=l,h.S=a%60,a=Math.floor(a/60),h.M=a%60,a=Math.floor(a/60),h.H=a,h}},52238:(e,t,r)=>{"use strict";r.d(t,{evalFmt:()=>f,tokenize:()=>d});var n=r(3883),i=r(78272),o=r(10654),a=r(34997),s=r(90139),l=r(11334);const u=/^[HhMmSs]+$/,c=/-[0-9a-f]{1,8}$/i,h=/^([<>=]=?|!=|<>)\s*(-?\d+(?:\.\d*)?)\s*$/;function d(e){let t,r,i,o,s=[],d="t",f="H",g=!1,p=!1,m=0,v="",y=0,C="";for(;m1?s.push({t:"s",v:C}):s.push({t:"t",v:C});break}case"0":case"#":for(C=v;"0#?.,E+-%".indexOf(v=e[++m])>-1||"\\"==v&&"-"==e[m+1]&&"0#".indexOf(e[m+2])>-1;)C+=v;s.push({t:"n",v:C,n:!0}),p=!0;break;case"?":for(C=v;e[++m]===v;)C+=v;s.push({t:v,v:C,n:!0}),d=v,p=!0;break;case"*":++m," *".includes(e[m])&&++m;break;case"(":case")":s.push({t:v,v}),++m;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(C=v;"0123456789".includes(e[++m]);)C+=e[m];s.push({t:"D",v:C});break;case" ":s.push({t:v,v}),++m;break;default:if(!1===",$-+/():!^&'~{}<>=€acfijklopqrtuvwxz".includes(v))throw new Error("unrecognized character "+v+" in "+e);s.push({t:"t",v}),++m}let x=null;if(g){let e,t=0;for(d="t",m=s.length-1;m>=0;--m)switch(s[m].t){case"h":case"H":s[m].t=f,d="h";break;case"s":e=s[m].v.match(/\.0+$/),e&&(t=Math.max(t,e[0].length-1));case"d":case"y":case"M":case"e":d=s[m].t;break;case"m":"s"===d&&(s[m].t="M")}x={ss0:t}}let w=l.default.TEXT;return g?w=l.default.DATETIME:p&&(w=l.default.NUMBER),{tokens:s,cond:r,color:t,type:w,dateInfo:x}}function f(e,t,r,a){let l=null,u=a?.ss0||0;if(e=e.map((e=>{let{t,v:r,n}=e;return{t,v:r,n}})),a&&(l=(0,o.parse_date_code)(t,u,!1,r),null===l))return(0,i.toFixed)(t);let c="";for(let a=0;a=12?1:0],e[a].t="T"):"A/P"===e[a].v&&(e[a].v=r.SHORT_AMPM[l.H>=12?1:0],e[a].t="T")}if(e=e.filter((e=>e)),c.length>0){const n=(0,s.write_num)("("===c?"(":"n",c,t);if(-1===n.indexOf("E")){let t=e.length;for(let r=0;r-1){t=r;break}let i=e.length;if(t===e.length){let t=n.length-1;for(let r=e.length-1;r>=0;--r)e[r].n&&(e[r].v=e[r].v.replace(/\\(?!\\)/g,""),t>=e[r].v.length-1?(t-=e[r].v.length,e[r].v=n.substr(t+1,e[r].v.length)):t<0?e[r].v="":(e[r].v=n.substr(0,t+1),t=-1),e[r].t="t",i=r);t>=0&&i=0;--r){if(!e[r].n)continue;e[r].v=e[r].v.replace(/\\(?!\\)/g,"");let a=e[r].v.indexOf(".")>-1&&r===t?e[r].v.indexOf(".")-1:e[r].v.length-1,s=e[r].v.substr(a+1);for(;a>=0;--a)o>=0&&("0"===e[r].v[a]||"#"===e[r].v[a])&&(s=n[o]+s,o--);e[r].v=s,e[r].t="t",i=r}o>=0&&i-1&&r===t?e[r].v.indexOf(".")+1:0,s=e[r].v.substr(0,a);for(;a{"use strict";r.d(t,{default:()=>s});var n=r(3883),i=r(52238),o=r(11334);function a(e){this.isDefault=(0,n.isgeneral)(e,0)&&7===e.length,this.cond=null,this.color=null,this.tokens=[],this.hasCondition=!1,this.type=o.default.TEXT,this.dateInfo=null,this.isDefault||this.init(e)}a.prototype.init=function(e){const t=(0,i.tokenize)(e);if(this.cond=t.cond||null,this.color=t.color||null,this.tokens=t.tokens,this.type=t.type,this.hasCondition=null!==this.cond,this.type===o.default.DATETIME){const e=this.dateInfo=t.dateInfo;e.isDate=!0,e.isTime=!0,e.isDuration=!1;for(let r=0;r":if(e>this.cond.v)return!0;break;case"<":if(e":if(e!==this.cond.v)return!0;break;case">=":if(e>=this.cond.v)return!0;break;case"<=":if(e<=this.cond.v)return!0}return!1},a.prototype.formatValue=function(e,t){if(this.isDefault)return(0,n.general_fmt)(e,t);switch(e){case!0:e="TRUE";break;case!1:e="FALSE";break;case"":case null:case void 0:return""}return(0,i.evalFmt)(this.tokens,e,t,this.dateInfo)},a.prototype.containsAtSymbol=function(){return!this.isDefault&&this.tokens.some((function(e){return"@"===e.t}))},a.prototype.isDate=function(){return this.dateInfo&&this.dateInfo.isDate},a.prototype.isTime=function(){return this.dateInfo&&this.dateInfo.isTime},a.prototype.isDuration=function(){return this.dateInfo&&this.dateInfo.isDuration},a.prototype.isNumber=function(){return this.type===o.default.NUMBER},a.prototype.isDateTime=function(){return this.type===o.default.DATETIME};const s=a},81308:(e,t,r)=>{"use strict";function n(e,t,r){const n=e<0?-1:1;let i=e*n,o=0,a=1,s=0,l=1,u=0,c=0,h=Math.floor(i);for(;ut&&(c=u,s=a),c>t&&(c=l,s=o),!r)return[0,n*s,c];if(0===c)throw"Unexpected state: "+s+" "+a+" "+o+" "+c+" "+u+" "+l;const d=Math.floor(n*s/c);return[d,n*s-d*c,c]}r.d(t,{frac:()=>n})},3883:(e,t,r)=>{"use strict";r.d(t,{general_fmt:()=>c,isgeneral:()=>h});var n=r(78272);const i=/\.(\d*[1-9])0+$/,o=/\.0*$/,a=/\.(\d*[1-9])0+/,s=/\.0*[Ee]/,l=/(E[+-])(\d)$/;function u(e,t){return e.indexOf(".")>-1?e.replace(o,"").replace(i,t.DEC+"$1"):e}function c(e,t){switch(typeof e){case"string":return e;case"boolean":return e?"TRUE":"FALSE";case"number":return(0|e)===e?function(e){return(0,n.toFixed)(e)}(e):function(e,t){let r,n=Math.floor(Math.log(Math.abs(e))*Math.LOG10E);return r=n>=-4&&n<=-1?e.toPrecision(10+n):Math.abs(n)<=9?function(e,t){const r=e<0?12:11;let n=u(e.toFixed(12),t);return n.length<=r?n:(n=e.toPrecision(10),n.length<=r?n:e.toExponential(5))}(e,t):10===n?e.toFixed(10).substr(0,12):function(e){let t=e.toFixed(11).replace(i,".$1");return t.length>(e<0?12:11)&&(t=e.toPrecision(6)),t}(e),u(function(e){for(let t=0;t!=e.length;++t)if("e"===e[t])return e.replace(a,".$1").replace(s,"E").replace("e","E").replace(l,"$10$2");return e}(r),t)}(e,t)}throw new Error("unsupported value in General format: "+e)}function h(e,t){return e.length>=7+t&&"General"===e.substr(t,7)}},21558:(e,t,r)=>{"use strict";r.d(t,{default:()=>n});class n{constructor(){this.DAYS=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],this.MONTHS=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]],this.DEC=".",this.GROUP=",",this.AMPM=["AM","PM"],this.SHORT_AMPM=["A","P"]}toLocaleNumber(e){let t=-1;return"."!==this.DEC&&(t=e.indexOf(".")),","!==this.GROUP&&(e=e.replace(/,/g,this.GROUP)),-1!==t&&(e=e.substr(0,t)+this.DEC+e.substr(t+1)),e}}},63515:(e,t,r)=>{"use strict";function n(e){let t=0;switch(e.charCodeAt(0)){case 34:return t=e.indexOf('"',1),t<0?e:e.slice(0,t+1);case 91:return t=e.indexOf("]",1),t<0?e:e.slice(0,t+1);case 95:case 42:case 92:return e.slice(0,2);case 48:case 35:case 63:return/[0#?.,%E+-/ ]+/.exec(e)[0];case 89:case 77:case 68:case 72:case 83:case 121:case 109:case 100:case 104:case 115:return/[YMDHS:/]+/i.exec(e)[0];case 65:return/AM\/PM|A\/P|A/.exec(e)[0];case 46:return/\.0*/.exec(e)[0];default:return e[0]}}function i(e){const t=[];let r,i=!1;for(;0!==e.length;t.push(r))switch(e=e.substr((r=n(e)).length),r.charCodeAt(0)){case 46:r=i?r:r.length>2?r.slice(0,-1):"";break;case 48:case 35:case 63:r=r.replace(/\.[0#?]+/,(e=>e.length>2?e.slice(0,-1):""));break;case 65:case 89:case 77:case 68:case 72:case 83:case 121:case 109:case 100:case 104:case 115:i=!0}return t.join("")}function o(e){return e.indexOf("/")>=0?e:e.indexOf(".")>=0?e.replace(/\.[0#?]+/,(e=>e+"0")):e.replace(/[0#?,]*[0#?]/,(e=>e+".0"))}function a(e){const t=[];let r,i=!1;for(;0!==e.length;t.push(r))switch(e=e.substr((r=n(e)).length),r.charCodeAt(0)){case 46:r=i||r.length<2?r:r+"0";break;case 48:case 35:case 63:r=o(r);break;case 65:case 89:case 77:case 68:case 72:case 83:case 121:case 109:case 100:case 104:case 115:i=!0}return t.join("")}r.d(t,{decreaseDecimal:()=>i,increaseDecimal:()=>a})},90139:(e,t,r)=>{"use strict";r.d(t,{write_num:()=>y});var n=r(90497),i=r(78272),o=r(44789),a=r(81308);const s=/%/g,l=/# (\?+)( ?)\/( ?)(\d+)/,u=/^#*0*\.(0+)/,c=/\).*[0#]/,h=/\(###\) ###\\?-####/;function d(e,t){let r="";if(e.match(/^#*0+.0+E[+-]0+$/)){let n=e.indexOf(".");n=n<0?e.indexOf("E"):n;let i=e.indexOf("E")-n-1;i=i<0?0:i;const o=Math.abs(t),a=Math.floor(Math.log(o)*Math.LOG10E),s=a%n<0?a%n+n:a%n;r=(o/Math.pow(10,a)).toPrecision(s+1+i),r.indexOf("e")<0?(r=r.split(".").join(""),r=r.substr(0,s+1)+"."+r.substr(s+1)):r=r.replace(/^([+-]?\d*\.?\d*)[eE]([+-]?\d+)$/,(function(e,t){return t.substr(0,s+1)+"."+t.substr(s+1)})),r+=(a-s<0?"E":"E+")+(a-s)}const n=e.match(/E\+(0+)$/);return n&&(r=r.replace(/\d+$/,(function(e){return(0,o.pad0)(+e,n[1].length)}))),e.match(/E-/)&&r.match(/[eE]\+/)&&(r=r.replace(/([eE])\+/,"$1")),t<0?"-"+r:r}function f(e){let t,r="";for(let n=0;n!=e.length;++n)switch(t=e.charCodeAt(n)){case 35:break;case 63:r+=" ";break;case 48:r+="0";break;default:r+=String.fromCharCode(t)}return r}function g(e,t){const r=e<0?-e:e,n=Math.pow(10,t),i=Math.round((r-Math.floor(r))*n);return i>=n?i-n:i}function p(e,t){const r=e<0?-e:e,n=(0,i.multiExp)(Math.round((0,i.multiExp)(r,t)),-t);return(0,i.toFixed)(e<0?-n:n)}function m(e,t,r){if(40===e.charCodeAt(0)&&!t.match(c))return"("+m("n",t.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,""),r)+")";if(44===t.charCodeAt(t.length-1))return function(e,t,r){let n=t.length-1;for(;44===t.charCodeAt(n-1);)--n;return y(e,t.substr(0,n),r/Math.pow(10,3*(t.length-n)))}(e,t,r);if(-1!==t.indexOf("%"))return function(e,t,r){const o=t.replace(s,""),a=t.length-o.length;return y(e,o,(0,i.multiExp)(r,2*a))+(0,n.fill)("%",a)}(e,t,r);if(-1!==t.indexOf("E"))return d(t,r);if(36===t.charCodeAt(0))return"$"+m(e,t.substr(" "==t[1]?2:1),r);let v,C,x,w,_=Math.abs(r),R=r<0?"-":"";if(t.match(/^00+$/))return R+(0,o.pad0r)(_,t.length);if(t.match(/^[#?]+$/))return v=(0,o.pad0r)(r,0),"0"===v&&(v=""),v.length>t.length?v:f(t.substr(0,t.length-v.length))+v;if(null!==(C=t.match(l)))return function(e,t,r){const i=parseInt(e[4],10),a=Math.round(t*i),s=Math.floor(a/i),l=a-s*i,u=i;return r+(0===s?"":""+s)+" "+(0===l?(0,n.fill)(" ",e[1].length+1+e[4].length):(0,o.pad_)(l,e[1].length)+e[2]+"/"+e[3]+(0,o.pad0)(u,e[4].length))}(C,_,R);if(null!==t.match(/^#+0+$/))return R+(0,o.pad0r)(_,t.length-t.indexOf("0"));if(null!==(C=t.match(u)))return v=p(r,C[1].length).replace(/^([^.]+)$/,"$1."+C[1]).replace(/\.$/,"."+C[1]).replace(/\.(\d*)$/,(function(e,t){return"."+t+(0,n.fill)("0",C[1].length-t.length)})),-1!==t.indexOf("0.")?v:v.replace(/^0\./,".");if(t=t.replace(/^#+([0.])/,"$1"),null!==(C=t.match(/^(0*)\.(#*)$/)))return R+p(_,C[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,C[1].length?"0.":".");if(null!==(C=t.match(/^#,##0(\.?)$/)))return R+(0,n.commaify)((0,o.pad0r)(_,0));if(null!==(C=t.match(/^#,##0\.([#0]*0)$/)))return R+function(e,t){const r=(0,i.toFixedFormat)(e,t).split(".");return r[0]=(0,n.commaify)(r[0]),r.join(".")}(_,C[1].length);if(null!==(C=t.match(/^#,##0\.([-]*-)$/)))return x=(0,o.pad0)(g(r,C[1].length),C[1].length),r<0?"-"+m(e,t,-r):(0,n.commaify)((0,i.toFixed)(Math.floor(r)))+"."+(0===parseInt(x,0)?(0,o.padc)("-",C[1].length,"-"):x);if(null!==(C=t.match(/^#,#*,#0/)))return m(e,t.replace(/^#,#*,/,""),r);if(null!==(C=t.match(/^([0#]+)(\\?-([0#]+))+$/)))return v=(0,n.reverse)(m(e,t.replace(/[\\-]/g,""),r)),x=0,(0,n.reverse)((0,n.reverse)(t.replace(/\\/g,"")).replace(/[0#]/g,(function(e){return x-2147483648?(0,i.toFixed)(e>=0?0|e:e-1|0):(0,i.toFixed)(Math.floor(e))}(r)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,(function(e){return"00,"+(e.length<3?(0,o.pad0)(0,3-e.length):"")+e}))+"."+(0,o.pad0)(x,C[1].length);if("#,###"===t){var b=(0,n.commaify)((0,o.pad0r)(_,0));return"0"!==b?R+b:""}throw new Error("unsupported format |"+t+"|")}function v(e,t,r){if(40===e.charCodeAt(0)&&!t.match(c))return"("+v("n",t.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,""),r)+")";if(44===t.charCodeAt(t.length-1))return function(e,t,r){let n=t.length-1;for(;44===t.charCodeAt(n-1);)--n;return y(e,t.substr(0,n),r/Math.pow(10,3*(t.length-n)))}(e,t,r);if(-1!==t.indexOf("%"))return function(e,t,r){const o=t.replace(s,""),a=t.length-o.length;return y(e,o,(0,i.multiExp)(r,2*a))+(0,n.fill)("%",a)}(e,t,r);if(-1!==t.indexOf("E"))return function(e,t){return d(e,t)}(t,r);if(36===t.charCodeAt(0))return"$"+v(e,t.substr(" "==t[1]?2:1),r);let g,p,m,C,x=Math.abs(r),w=r<0?"-":"";if(t.match(/^00+$/))return w+(0,o.pad0)(x,t.length);if(t.match(/^[#?]+$/))return g=""+r,0===r&&(g=""),g.length>t.length?g:f(t.substr(0,t.length-g.length))+g;if(null!==(p=t.match(l)))return function(e,t,r){return r+(0===t?"":(0,i.toFixed)(t))+(0,n.fill)(" ",e[1].length+2+e[4].length)}(p,x,w);if(null!==t.match(/^#+0+$/))return w+(0,o.pad0)(x,t.length-t.indexOf("0"));if(null!==(p=t.match(u)))return g=(0,i.toFixed)(r).replace(/^([^.]+)$/,"$1."+p[1]).replace(/\.$/,"."+p[1]).replace(/\.(\d*)$/,(function(e,t){return"."+t+(0,n.fill)("0",p[1].length-t.length)})),-1!==t.indexOf("0.")?g:g.replace(/^0\./,".");if(t=t.replace(/^#+([0.])/,"$1"),null!==(p=t.match(/^(0*)\.(#*)$/)))return w+(0,i.toFixed)(x).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,p[1].length?"0.":".");if(null!==(p=t.match(/^#,##0(\.?)$/)))return w+(0,n.commaify)((0,i.toFixed)(x));if(null!==(p=t.match(/^#,##0\.([#0]*0)$/)))return r<0?"-"+v(e,t,-r):(0,n.commaify)((0,i.toFixed)(r))+"."+(0,n.fill)("0",p[1].length);if(null!==(p=t.match(/^#,##0\.([-]*-)$/)))return g=(0,n.fill)("0",p[1].length),r<0?"-"+v(e,t,-r):(0,n.commaify)((0,i.toFixed)(r))+"."+(0===parseInt(g,10)?(0,n.fill)("-",p[1].length):g);if(null!==(p=t.match(/^#,#*,#0/)))return v(e,t.replace(/^#,#*,/,""),r);if(null!==(p=t.match(/^([0#]+)(\\?-([0#]+))+$/)))return g=(0,n.reverse)(v(e,t.replace(/[\\-]/g,""),r)),m=0,(0,n.reverse)((0,n.reverse)(t.replace(/\\/g,"")).replace(/[0#]/g,(function(e){return m{"use strict";r.d(t,{pad0:()=>a,pad0r:()=>l,pad_:()=>s,padc:()=>c,rpad_:()=>u});var n=r(78272),i=r(90497);const o=Math.pow(2,32);function a(e,t){const r=(0,n.toFixed)(e);return r.length>=t?r:(0,i.fill)("0",t-r.length)+r}function s(e,t){const r=(0,n.toFixed)(e);return r.length>=t?r:(0,i.fill)(" ",t-r.length)+r}function l(e,t){return e>o||e<-o?function(e,t){e=e<0?-Math.round(-e):Math.round(e);const r=(0,n.toFixed)(Math.round(e));return r.length>=t?r:(0,i.fill)("0",t-r.length)+r}(e,t):function(e,t){const r=(0,n.toFixed)(e);return r.length>=t?r:(0,i.fill)("0",t-r.length)+r}(e=e<0?-Math.round(-e):Math.round(e),t)}function u(e,t){const r=(0,n.toFixed)(e);return r.length>=t?r:r+(0,i.fill)(" ",t-r.length)}function c(e,t,r){const o=(0,n.toFixed)(e);return o.length>=t?o:(0,i.fill)(r,t-o.length)+o}},90497:(e,t,r)=>{"use strict";function n(e){let t="",r=e.length-1;for(;r>=0;)t+=e.charAt(r--);return t}function i(e,t){let r="";for(;r.length0?",":"")+e.substr(t,3);return r}r.d(t,{commaify:()=>o,fill:()=>i,reverse:()=>n})},11334:(e,t,r)=>{"use strict";r.d(t,{default:()=>n});const n={TEXT:0,NUMBER:1,DATETIME:2}},15765:(e,t)=>{var r;r=function(e){e.version="1.0.2";var t=Math;function r(e,t){for(var r=0,n=0;ri)o=n(r,i,l(r),f(r),-1);else{for(var a=!1,s=0,u=0,c=1,h=0,d=2/r,g=2*t.floor((i+t.floor(t.sqrt(40*i)))/2);g>0;g--)h=g*d*c-s,s=c,c=h,t.abs(c)>1e10&&(c*=1e-10,s*=1e-10,o*=1e-10,u*=1e-10),a&&(u+=c),a=!a,g==i&&(o=s);o/=u=2*u-c}return o}}(),C=(o=.636619772,a=[-2957821389,7062834065,-512359803.6,10879881.29,-86327.92757,228.4622733].reverse(),s=[40076544269,745249964.8,7189466.438,47447.2647,226.1030244,1].reverse(),l=[1,-.001098628627,2734510407e-14,-2073370639e-15,2.093887211e-7].reverse(),u=[-.01562499995,.0001430488765,-6911147651e-15,7.621095161e-7,-9.34945152e-8].reverse(),c=[-4900604943e3,127527439e4,-51534381390,734926455.1,-4237922.726,8511.937935].reverse(),h=[249958057e5,424441966400,3733650367,22459040.02,102042.605,354.9632885,1].reverse(),d=[1,.00183105,-3516396496e-14,2457520174e-15,-2.40337019e-7].reverse(),f=[.04687499995,-.0002002690873,8449199096e-15,-8.8228987e-7,1.05787412e-7].reverse(),i((function(e){var n=0,i=0,c=0,h=e*e,d=e-.785398164;return e<8?n=(i=r(a,h))/(c=r(s,h))+o*y(e,0)*t.log(e):(i=r(l,h=64/h),c=r(u,h),n=t.sqrt(o/e)*(t.sin(d)*i+t.cos(d)*c*8/e)),n}),(function(e){var n=0,i=0,a=0,s=e*e,l=e-2.356194491;return e<8?n=(i=e*r(c,s))/(a=r(h,s))+o*(y(e,1)*t.log(e)-1/e):(i=r(d,s=64/s),a=r(f,s),n=t.sqrt(o/e)*(t.sin(l)*i+t.cos(l)*a*8/e)),n}),0,1,-1)),x=(g=[1,3.5156229,3.0899424,1.2067492,.2659732,.0360768,.0045813].reverse(),p=[.39894228,.01328592,.00225319,-.00157565,.00916281,-.02057706,.02635537,-.01647633,.00392377].reverse(),m=[.5,.87890594,.51498869,.15084934,.02658733,.00301532,32411e-8].reverse(),v=[.39894228,-.03988024,-.00362018,.00163801,-.01031555,.02282967,-.02895312,.01787654,-.00420059].reverse(),function e(n,i){if(0===(i=Math.round(i)))return function(e){return e<=3.75?r(g,e*e/14.0625):t.exp(t.abs(e))/t.sqrt(t.abs(e))*r(p,3.75/t.abs(e))}(n);if(1===i)return function(e){return e<3.75?e*r(m,e*e/14.0625):(e<0?-1:1)*t.exp(t.abs(e))/t.sqrt(t.abs(e))*r(v,3.75/t.abs(e))}(n);if(i<0)return NaN;if(0===t.abs(n))return 0;if(n==1/0)return 1/0;var o,a=0,s=2/t.abs(n),l=0,u=1,c=0;for(o=2*t.round((i+t.round(t.sqrt(40*i)))/2);o>0;o--)c=o*s*u+l,l=u,u=c,t.abs(u)>1e10&&(u*=1e-10,l*=1e-10,a*=1e-10),o==i&&(a=l);return a*=e(n,0)/u,n<0&&i%2?-a:a}),w=function(){var e=[-.57721566,.4227842,.23069756,.0348859,.00262698,1075e-7,74e-7].reverse(),n=[1.25331414,-.07832358,.02189568,-.01062446,.00587872,-.0025154,53208e-8].reverse(),o=[1,.15443144,-.67278579,-.18156897,-.01919402,-.00110404,-4686e-8].reverse(),a=[1.25331414,.23498619,-.0365562,.01504268,-.00780353,.00325614,-68245e-8].reverse();return i((function(i){return i<=2?-t.log(i/2)*x(i,0)+r(e,i*i/4):t.exp(-i)/t.sqrt(i)*r(n,2/i)}),(function(e){return e<=2?t.log(e/2)*x(e,1)+1/e*r(o,e*e/4):t.exp(-e)/t.sqrt(e)*r(a,2/e)}),0,2,1)}();e.besselj=y,e.bessely=C,e.besseli=x,e.besselk=w},"undefined"==typeof DO_NOT_EXPORT_BESSEL?r(t):r({})},93302:function(e,t,r){var n;!function(i){"use strict";var o,a=1e6,s="[big.js] ",l=s+"Invalid ",u=l+"decimal places",c=l+"rounding mode",h=s+"Division by zero",d={},f=void 0,g=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function p(e,t,r,n){var i=e.c,o=e.e+t+1;if(o=5;else if(2===r)n=i[o]>5||5==i[o]&&(n||o<0||i[o+1]!==f||1&i[o-1]);else if(3===r)n=n||!!i[0];else if(n=!1,0!==r)throw Error(c);if(o<1)i.length=1,n?(e.e=-t,i[0]=1):i[0]=e.e=0;else{if(i.length=o--,n)for(;++i[o]>9;)i[o]=0,o--||(++e.e,i.unshift(1));for(o=i.length;!i[--o];)i.pop()}}else if(r<0||r>3||r!==~~r)throw Error(c);return e}function m(e,t,r,n){var i,o,s=e.constructor,c=!e.c[0];if(r!==f){if(r!==~~r||r<(3==t)||r>a)throw Error(3==t?l+"precision":u);for(r=n-(e=new s(e)).e,e.c.length>++n&&p(e,r,s.RM),2==t&&(n=e.e+r+1);e.c.length=s.PE))o=o.charAt(0)+(r>1?"."+o.slice(1):"")+(i<0?"e":"e+")+i;else if(i<0){for(;++i;)o="0"+o;o="0."+o}else if(i>0)if(++i>r)for(i-=r;i--;)o+="0";else i1&&(o=o.charAt(0)+"."+o.slice(1));return e.s<0&&(!c||4==t)?"-"+o:o}d.abs=function(){var e=new this.constructor(this);return e.s=1,e},d.cmp=function(e){var t,r=this,n=r.c,i=(e=new r.constructor(e)).c,o=r.s,a=e.s,s=r.e,l=e.e;if(!n[0]||!i[0])return n[0]?o:i[0]?-a:0;if(o!=a)return o;if(t=o<0,s!=l)return s>l^t?1:-1;for(a=(s=n.length)<(l=i.length)?s:l,o=-1;++oi[o]^t?1:-1;return s==l?0:s>l^t?1:-1},d.div=function(e){var t=this,r=t.constructor,n=t.c,i=(e=new r(e)).c,o=t.s==e.s?1:-1,s=r.DP;if(s!==~~s||s<0||s>a)throw Error(u);if(!i[0])throw Error(h);if(!n[0])return new r(0*o);var l,c,d,g,m,v=i.slice(),y=l=i.length,C=n.length,x=n.slice(0,l),w=x.length,_=e,R=_.c=[],S=0,b=s+(_.e=t.e-e.e)+1;for(_.s=o,o=b<0?0:b,v.unshift(0);w++w?1:-1;else for(m=-1,g=0;++mx[m]?1:-1;break}if(!(g<0))break;for(c=w==l?i:v;w;){if(x[--w]b&&p(_,s,r.RM,x[0]!==f),_},d.eq=function(e){return!this.cmp(e)},d.gt=function(e){return this.cmp(e)>0},d.gte=function(e){return this.cmp(e)>-1},d.lt=function(e){return this.cmp(e)<0},d.lte=function(e){return this.cmp(e)<1},d.minus=d.sub=function(e){var t,r,n,i,o=this,a=o.constructor,s=o.s,l=(e=new a(e)).s;if(s!=l)return e.s=-l,o.plus(e);var u=o.c.slice(),c=o.e,h=e.c,d=e.e;if(!u[0]||!h[0])return h[0]?(e.s=-l,e):new a(u[0]?o:0);if(s=c-d){for((i=s<0)?(s=-s,n=u):(d=c,n=h),n.reverse(),l=s;l--;)n.push(0);n.reverse()}else for(r=((i=u.length0)for(;l--;)u[t++]=0;for(l=t;r>s;){if(u[--r]0?(l=a,t=u):(i=-i,t=s),t.reverse();i--;)t.push(0);t.reverse()}for(s.length-u.length<0&&(t=u,u=s,s=t),i=u.length,o=0;i;s[i]%=10)o=(s[--i]=s[i]+u[i]+o)/10|0;for(o&&(s.unshift(o),++l),i=s.length;0===s[--i];)s.pop();return e.c=s,e.e=l,e},d.pow=function(e){var t=this,r=new t.constructor(1),n=r,i=e<0;if(e!==~~e||e<-1e6||e>1e6)throw Error(l+"exponent");for(i&&(e=-e);1&e&&(n=n.times(t)),e>>=1;)t=t.times(t);return i?r.div(n):n},d.round=function(e,t){var r=this.constructor;if(e===f)e=0;else if(e!==~~e||e<-a||e>a)throw Error(u);return p(new r(this),e,t===f?r.RM:t)},d.sqrt=function(){var e,t,r,n=this,i=n.constructor,o=n.s,a=n.e,l=new i(.5);if(!n.c[0])return new i(n);if(o<0)throw Error(s+"No square root");0===(o=Math.sqrt(n+""))||o===1/0?((t=n.c.join("")).length+a&1||(t+="0"),a=((a+1)/2|0)-(a<0||1&a),e=new i(((o=Math.sqrt(t))==1/0?"1e":(o=o.toExponential()).slice(0,o.indexOf("e")+1))+a)):e=new i(o),a=e.e+(i.DP+=4);do{r=e,e=l.times(r.plus(n.div(r)))}while(r.c.slice(0,a).join("")!==e.c.slice(0,a).join(""));return p(e,i.DP-=4,i.RM)},d.times=d.mul=function(e){var t,r=this,n=r.constructor,i=r.c,o=(e=new n(e)).c,a=i.length,s=o.length,l=r.e,u=e.e;if(e.s=r.s==e.s?1:-1,!i[0]||!o[0])return new n(0*e.s);for(e.e=l+u,al;)s=t[u]+o[l]*i[u-l-1]+s,t[u--]=s%10,s=s/10|0;t[u]=(t[u]+s)%10}for(s?++e.e:t.shift(),l=t.length;!t[--l];)t.pop();return e.c=t,e},d.toExponential=function(e){return m(this,1,e,e)},d.toFixed=function(e){return m(this,2,e,this.e+e)},d.toPrecision=function(e){return m(this,3,e,e-1)},d.toString=function(){return m(this)},d.valueOf=d.toJSON=function(){return m(this,4)},(o=function e(){function t(r){var n=this;if(!(n instanceof t))return r===f?e():new t(r);r instanceof t?(n.s=r.s,n.e=r.e,n.c=r.c.slice()):function(e,t){var r,n,i;if(0===t&&1/t<0)t="-0";else if(!g.test(t+=""))throw Error(l+"number");for(e.s="-"==t.charAt(0)?(t=t.slice(1),-1):1,(r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),i=t.length,n=0;n0&&"0"==t.charAt(--i););for(e.e=r-n-1,e.c=[],r=0;n<=i;)e.c[r++]=+t.charAt(n++)}}(n,r),n.constructor=t}return t.prototype=d,t.DP=20,t.RM=1,t.NE=-7,t.PE=21,t.version="5.2.2",t}()).default=o.Big=o,void 0===(n=function(){return o}.call(t,r,t,e))||(e.exports=n)}()},43990:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Alternation:()=>c.Alternation,CstParser:()=>i.CstParser,EMPTY_ALT:()=>i.EMPTY_ALT,EOF:()=>a.EOF,EarlyExitException:()=>l.EarlyExitException,EmbeddedActionsParser:()=>i.EmbeddedActionsParser,Flat:()=>c.Flat,GAstVisitor:()=>h.GAstVisitor,Lexer:()=>o.Lexer,LexerDefinitionErrorType:()=>o.LexerDefinitionErrorType,MismatchedTokenException:()=>l.MismatchedTokenException,NoViableAltException:()=>l.NoViableAltException,NonTerminal:()=>c.NonTerminal,NotAllInputParsedException:()=>l.NotAllInputParsedException,Option:()=>c.Option,Parser:()=>i.Parser,ParserDefinitionErrorType:()=>i.ParserDefinitionErrorType,Repetition:()=>c.Repetition,RepetitionMandatory:()=>c.RepetitionMandatory,RepetitionMandatoryWithSeparator:()=>c.RepetitionMandatoryWithSeparator,RepetitionWithSeparator:()=>c.RepetitionWithSeparator,Rule:()=>c.Rule,Terminal:()=>c.Terminal,VERSION:()=>n.VERSION,assignOccurrenceIndices:()=>d.assignOccurrenceIndices,clearCache:()=>p,createSyntaxDiagramsCode:()=>f.createSyntaxDiagramsCode,createToken:()=>a.createToken,createTokenInstance:()=>a.createTokenInstance,defaultGrammarResolverErrorProvider:()=>s.defaultGrammarResolverErrorProvider,defaultGrammarValidatorErrorProvider:()=>s.defaultGrammarValidatorErrorProvider,defaultLexerErrorProvider:()=>u.defaultLexerErrorProvider,defaultParserErrorProvider:()=>s.defaultParserErrorProvider,generateParserFactory:()=>g.generateParserFactory,generateParserModule:()=>g.generateParserModule,isRecognitionException:()=>l.isRecognitionException,resolveGrammar:()=>d.resolveGrammar,serializeGrammar:()=>c.serializeGrammar,serializeProduction:()=>c.serializeProduction,tokenLabel:()=>a.tokenLabel,tokenMatcher:()=>a.tokenMatcher,tokenName:()=>a.tokenName,validateGrammar:()=>d.validateGrammar});var n=r(72127),i=r(69326),o=r(70995),a=r(18056),s=r(76409),l=r(42169),u=r(42261),c=r(4002),h=r(52433),d=r(24479),f=r(67534),g=r(77482);function p(){console.warn("The clearCache function was 'soft' removed from the Chevrotain API.\n\t It performs no action other than printing this message.\n\t Please avoid using it as it will be completely removed in the future")}},67534:(e,t,r)=>{"use strict";r.d(t,{createSyntaxDiagramsCode:()=>i});var n=r(72127);function i(e,t){var r=void 0===t?{}:t,i=r.resourceBase,o=void 0===i?"https://unpkg.com/chevrotain@"+n.VERSION+"/diagrams/":i,a=r.css;return"\n\x3c!-- This is a generated file --\x3e\n\n\n\n\n\n\n\n