if((n=e.charCodeAt(a)-64)<1||n>26)break;t=26*t+n}r.e.c=--t;for(t=0;a!=i;++a){if((n=e.charCodeAt(a)-48)<0||n>9)break;t=10*t+n}r.e.r=--t;returnr}functionEt(e,r){vart=e.t=="d"&&rinstanceofDate;if(e.z!=null)try{returne.w=D.format(e.z,t?ee(r):r)}catch(a){}try{returne.w=D.format((e.XF||{}).numFmtId||(t?14:0),t?ee(r):r)}catch(a){return""+r}}functionSt(e,r,t){if(e==null||e.t==null||e.t=="z")return"";if(e.w!==undefined)returne.w;if(e.t=="d"&&!e.z&&t&&t.dateNF)e.z=t.dateNF;if(r==undefined)returnEt(e,e.v);returnEt(e,r)}function_t(e,r){vart=r&&r.sheet?r.sheet:"Sheet1";vara={};a[t]=e;return{SheetNames:[t],Sheets:a}}functionCt(e,r,t){vara=t||{};varn=e?Array.isArray(e):a.dense;if(m!=null&&n==null)n=m;vari=e||(n?[]:{});vars=0,f=0;if(i&&a.origin!=null){if(typeofa.origin=="number")s=a.origin;else{varo=typeofa.origin=="string"?mt(a.origin):a.origin;s=o.r;f=o.c}if(!i["!ref"])i["!ref"]="A1:A1"}varl={s:{c:1e7,r:1e7},e:{c:0,r:0}};if(i["!ref"]){varc=kt(i["!ref"]);l.s.c=c.s.c;l.s.r=c.s.r;l.e.c=Math.max(l.e.c,c.e.c);l.e.r=Math.max(l.e.r,c.e.r);if(s==-1)l.e.r=s=c.e.r+1}for(varu=0;u!=r.length;++u){if(!r[u])continue;if(!Array.isArray(r[u]))thrownewError("aoa_to_sheet expects an array of arrays");for(varh=0;h!=r[u].length;++h){if(typeofr[u][h]==="undefined")continue;vard={v:r[u][h]};varv=s+u,p=f+h;if(l.s.r>v)l.s.r=v;if(l.s.c>p)l.s.c=p;if(l.e.r<v)l.e.r=v;if(l.e.c<p)l.e.c=p;if(r[u][h]&&typeofr[u][h]==="object"&&!Array.isArray(r[u][h])&&!(r[u][h]instanceofDate))d=r[u][h];else{if(Array.isArray(d.v)){d.f=r[u][h][1];d.v=d.v[0]}if(d.v===null){if(d.f)d.t="n";elseif(!a.sheetStubs)continue;elsed.t="z"}elseif(typeofd.v==="number")d.t="n";elseif(typeofd.v==="boolean")d.t="b";elseif(d.vinstanceofDate){d.z=a.dateNF||D._table[14];if(a.cellDates){d.t="d";d.w=D.format(d.z,ee(d.v))}else{d.t="n";d.v=ee(d.v);d.w=D.format(d.z,d.v)}}elsed.t="s"}if(n){if(!i[v])i[v]=[];if(i[v][p]&&i[v][p].z)d.z=i[v][p].z;i[v][p]=d}else{varb=bt({c:p,r:v});if(i[b]&&i[b].z)d.z=i[b].z;i[b]=d}}}if(l.s.c<1e7)i["!ref"]=wt(l);returni}functionBt(e,r){returnCt(null,e,r)}functionTt(e,r){if(!r)r=Jr(4);r._W(4,e);returnr}functionyt(e){varr=e._R(4);returnr===0?"":e._R(r,"dbcs")}functionxt(e,r){vart=false;if(r==null){t=true;r=Jr(4+2*e.length)}r._W(4,e.length);if(e.length>0)r._W(0,e,"dbcs");returnt?r.slice(0,r.l):r}functionAt(e){return{ich:e._R(2),ifnt:e._R(2)}}functionIt(e,r){if(!r)r=Jr(4);r._W(2,e.ich||0);r._W(2,e.ifnt||0);returnr}functionRt(e,r){vart=e.l;vara=e._R(1);varn=yt(e);vari=[];vars={t:n,h:n};if((a&1)!==0){varf=e._R(4);for(varo=0;o!=f;++o)i.push(At(e));s.r=i}elses.r=[{ich:0,ifnt:0}];e.l=t+r;returns}functionOt(e,r){vart=false;if(r==null){t=true;r=Jr(15+4*e.t.length)}r._W(1,0);xt(e.t,r);returnt?r.slice(0,r.l):r}varDt=Rt;functionFt(e,r){vart=false;if(r==null){t=true;r=Jr(23+4*e.t.length)}r._W(1,1);xt(e.t,r);r._W(4,1);It({ich:0,ifnt:0},r);returnt?r.slice(0,r.l):r}functionPt(e){varr=e._R(4);vart=e._R(2);t+=e._R(1)<<16;e.l++;return{c:r,iStyleRef:t}}functionNt(e,r){if(r==null)r=Jr(8);r._W(-4,e.c);r._W(3,e.iStyleRef||e.s);r._W(1,0);returnr}varLt=yt;varMt=xt;functionUt(e){varr=e._R(4);returnr===0||r===4294967295?"":e._R(r,"dbcs")}functionzt(e,r){vart=false;if(r==null){t=true;r=Jr(127)}r._W(4,e.length>0?e.length:4294967295);if(e.length>0)r._W(0,e,"dbcs");returnt?r.slice(0,r.l):r}varHt=yt;varWt=Ut;varVt=zt;functionXt(e){varr=e.slice(e.l,e.l+4);vart=r[0]&1,a=r[0]&2;e.l+=4;r[0]&=252;varn=a===0?Fr([0,0,0,0,r[0],r[1],r[2],r[3]],0):Hr(r,0)>>2;returnt?n/100:n}functionGt(e,r){if(r==null)r=Jr(4);vart=0,a=0,n=e*100;if(e==(e|0)&&e>=-(1<<29)&&e<1<<29){a=1}elseif(n==(n|0)&&n>=-(1<<29)&&n<1<<29){a=1;t=1}if(a)r._W(-4,((t?n:e)<<2)+(t+2));elsethrownewError("unsupported RkNumber "+e)}functionjt(e){varr={s:{},e:{}};r.s.r=e._R(4);r.e.r=e._R(4);r.s.c=e._R(4);r.e.c=e._R(4);returnr}functionKt(e,r){if(!r)r=Jr(16);r._W(4,e.s.r);r._W(4,e.e.r);r._W(4,e.s.c);r._W(4,e.e.c);returnr}var$t=jt;varYt=Kt;functionZt(e){returne._R(8,"f")}functionJt(e,r){return(r||Jr(8))._W(8,e,"f")}functionQt(e){varr={};vart=e._R(1);vara=t>>>1;
returne.replace(/\u0000/g,";")});varS=E[0],_;if(k.length>0)switch(S){case"ID":break;case"E":break;case"B":break;case"O":break;case"P":if(E[1].charAt(0)=="P")h.push(k.slice(3).replace(/;;/g,";"));break;case"C":varC=false,B=false;for(c=1;c<E.length;++c)switch(E[c].charAt(0)){case"X":f=parseInt(E[c].slice(1))-1;B=true;break;case"Y":s=parseInt(E[c].slice(1))-1;if(!B)f=0;for(w=u.length;w<=s;++w)u[w]=[];break;case"K":_=E[c].slice(1);if(_.charAt(0)==='"')_=_.slice(1,_.length-1);elseif(_==="TRUE")_=true;elseif(_==="FALSE")_=false;elseif(!isNaN(he(_))){_=he(_);if(d!==null&&D.is_date(d))_=ne(_)}elseif(!isNaN(de(_).getDate())){_=oe(_)}if(typeofcptable!=="undefined"&&typeof_=="string"&&(n||{}).type!="string"&&(n||{}).codepage)_=cptable.utils.decode(n.codepage,_);C=true;break;case"E":varT=nc(E[c].slice(1),{r:s,c:f});u[s][f]=[u[s][f],T];break;default:if(n&&n.WTF)thrownewError("SYLK bad record "+k);}if(C){u[s][f]=_;d=null}break;case"F":vary=0;for(c=1;c<E.length;++c)switch(E[c].charAt(0)){case"X":f=parseInt(E[c].slice(1))-1;++y;break;case"Y":s=parseInt(E[c].slice(1))-1;for(w=u.length;w<=s;++w)u[w]=[];break;case"M":g=parseInt(E[c].slice(1))/20;break;case"F":break;case"G":break;case"P":d=h[parseInt(E[c].slice(1))];break;case"S":break;case"D":break;case"N":break;case"W":b=E[c].slice(1).split(" ");for(w=parseInt(b[0],10);w<=parseInt(b[1],10);++w){g=parseInt(b[2],10);m[w-1]=g===0?{hidden:true}:{wch:g};So(m[w-1])}break;case"C":f=parseInt(E[c].slice(1))-1;if(!m[f])m[f]={};break;case"R":s=parseInt(E[c].slice(1))-1;if(!p[s])p[s]={};if(g>0){p[s].hpt=g;p[s].hpx=To(g)}elseif(g===0)p[s].hidden=true;break;default:if(n&&n.WTF)thrownewError("SYLK bad record "+k);}if(y<1)d=null;break;default:if(n&&n.WTF)thrownewError("SYLK bad record "+k);}}if(p.length>0)v["!rows"]=p;if(m.length>0)v["!cols"]=m;if(n&&n.sheetRows)u=u.slice(0,n.sheetRows);return[u,v]}functions(e,r){vart=n(e,r);vara=t[0],i=t[1];vars=Bt(a,r);K(i).forEach(function(e){s[e]=i[e]});returns}functionf(e,r){return_t(s(e,r),r)}functionl(e,r,t,a){varn="C;Y"+(t+1)+";X"+(a+1)+";K";switch(e.t){case"n":n+=e.v||0;if(e.f&&!e.F)n+=";E"+sc(e.f,{r:t,c:a});break;case"b":n+=e.v?"TRUE":"FALSE";break;case"e":n+=e.w||e.v;break;case"d":n+='"'+(e.w||e.v)+'"';break;case"s":n+='"'+e.v.replace(/"/g,"")+'"';break;}returnn}functionc(e,r){r.forEach(function(r,t){vara="F;W"+(t+1)+" "+(t+1)+" ";if(r.hidden)a+="0";else{if(typeofr.width=="number")r.wpx=bo(r.width);if(typeofr.wpx=="number")r.wch=go(r.wpx);if(typeofr.wch=="number")a+=Math.round(r.wch)}if(a.charAt(a.length-1)!=" ")e.push(a)})}functionu(e,r){r.forEach(function(r,t){vara="F;";if(r.hidden)a+="M0;";elseif(r.hpt)a+="M"+20*r.hpt+";";elseif(r.hpx)a+="M"+20*Bo(r.hpx)+";";if(a.length>2)e.push(a+"R"+(t+1))})}functionh(e,r){vart=["ID;PWXL;N;E"],a=[];varn=kt(e["!ref"]),i;vars=Array.isArray(e);varf="\r\n";t.push("P;PGeneral");t.push("F;P0;DG0G8;M255");if(e["!cols"])c(t,e["!cols"]);if(e["!rows"])u(t,e["!rows"]);t.push("B;Y"+(n.e.r-n.s.r+1)+";X"+(n.e.c-n.s.c+1)+";D"+[n.s.c,n.s.r,n.e.c,n.e.r].join(" "));for(varo=n.s.r;o<=n.e.r;++o){for(varh=n.s.c;h<=n.e.c;++h){vard=bt({r:o,c:h});i=s?(e[o]||[])[h]:e[d];if(!i||i.v==null&&(!i.f||i.F))continue;a.push(l(i,e,o,h,r))}}returnt.join(f)+f+a.join(f)+f+"E"+f}return{to_workbook:f,to_sheet:s,from_sheet:h}}();varvf=function(){functione(e,t){switch(t.type){case"base64":returnr(g.decode(e),t);case"binary":returnr(e,t);case"buffer":returnr(e.toString("binary"),t);case"array":returnr(le(e),t);}thrownewError("Unrecognized type "+t.type)}functionr(e,r){vart=e.split("\n"),a=-1,n=-1,i=0,s=[];for(;i!==t.length;++i){if(t[i].trim()==="BOT"){s[++a]=[];n=0;continue}if(a<0)continue;varf=t[i].trim().split(",");varo=f[0],l=f[1];++i;varc=t[i].trim();switch(+o){case-1:if(c==="BOT"){s[++a]=[];n=0;continue}elseif(c!=="EOD")thrownewError("Unrecognized DIF special command "+c);break;case0:if(c==="TRUE")s[a][n]=true;elseif(c==="FALSE")s[a][n]=false;elseif(!isNaN(he(l)))s[a][n]=he(l);elseif(!isNaN(de(l).getDate()))s[a][n]=oe(l);elses[a][n]=l;++n;break;case1:c=c.slice(1,c.length-1);s[a][n++]=c!==""?
break;case"<fgColor/>":;case"</fgColor>":break;case"<stop":;case"<stop/>":break;case"</stop>":break;case"<color":;case"<color/>":break;case"</color>":break;case"<extLst":;case"<extLst>":;case"</extLst>":break;case"<ext":i=true;break;case"</ext>":i=false;break;default:if(a&&a.WTF){if(!i)thrownewError("unrecognized "+t[0]+" in fills")};}})}functionIo(e,r,t,a){r.Fonts=[];varn={};vars=false;(e[0].match(Re)||[]).forEach(function(e){varf=Fe(e);switch(Pe(f[0])){case"<fonts":;case"<fonts>":;case"</fonts>":break;case"<font":;case"<font>":break;case"</font>":;case"<font/>":r.Fonts.push(n);n={};break;case"<name":if(f.val)n.name=Ye(f.val);break;case"<name/>":;case"</name>":break;case"<b":n.bold=f.val?$e(f.val):1;break;case"<b/>":n.bold=1;break;case"<i":n.italic=f.val?$e(f.val):1;break;case"<i/>":n.italic=1;break;case"<u":switch(f.val){case"none":n.underline=0;break;case"single":n.underline=1;break;case"double":n.underline=2;break;case"singleAccounting":n.underline=33;break;case"doubleAccounting":n.underline=34;break;}break;case"<u/>":n.underline=1;break;case"<strike":n.strike=f.val?$e(f.val):1;break;case"<strike/>":n.strike=1;break;case"<outline":n.outline=f.val?$e(f.val):1;break;case"<outline/>":n.outline=1;break;case"<shadow":n.shadow=f.val?$e(f.val):1;break;case"<shadow/>":n.shadow=1;break;case"<condense":n.condense=f.val?$e(f.val):1;break;case"<condense/>":n.condense=1;break;case"<extend":n.extend=f.val?$e(f.val):1;break;case"<extend/>":n.extend=1;break;case"<sz":if(f.val)n.sz=+f.val;break;case"<sz/>":;case"</sz>":break;case"<vertAlign":if(f.val)n.vertAlign=f.val;break;case"<vertAlign/>":;case"</vertAlign>":break;case"<family":if(f.val)n.family=parseInt(f.val,10);break;case"<family/>":;case"</family>":break;case"<scheme":if(f.val)n.scheme=f.val;break;case"<scheme/>":;case"</scheme>":break;case"<charset":if(f.val=="1")break;f.codepage=i[parseInt(f.val,10)];break;case"<color":if(!n.color)n.color={};if(f.auto)n.color.auto=$e(f.auto);if(f.rgb)n.color.rgb=f.rgb.slice(-6);elseif(f.indexed){n.color.index=parseInt(f.indexed,10);varo=ya[n.color.index];if(n.color.index==81)o=ya[1];if(!o)thrownewError(e);n.color.rgb=o[0].toString(16)+o[1].toString(16)+o[2].toString(16)}elseif(f.theme){n.color.theme=parseInt(f.theme,10);if(f.tint)n.color.tint=parseFloat(f.tint);if(f.theme&&t.themeElements&&t.themeElements.clrScheme){n.color.rgb=uo(t.themeElements.clrScheme[n.color.theme].rgb,n.color.tint||0)}}break;case"<color/>":;case"</color>":break;case"<AlternateContent":s=true;break;case"</AlternateContent>":s=false;break;case"<extLst":;case"<extLst>":;case"</extLst>":break;case"<ext":s=true;break;case"</ext>":s=false;break;default:if(a&&a.WTF){if(!s)thrownewError("unrecognized "+f[0]+" in fonts")};}})}functionRo(e,r,t){r.NumberFmt=[];vara=K(D._table);for(varn=0;n<a.length;++n)r.NumberFmt[a[n]]=D._table[a[n]];vari=e[0].match(Re);if(!i)return;for(n=0;n<i.length;++n){vars=Fe(i[n]);switch(Pe(s[0])){case"<numFmts":;case"</numFmts>":;case"<numFmts/>":;case"<numFmts>":break;case"<numFmt":{varf=Me(Ye(s.formatCode)),o=parseInt(s.numFmtId,10);r.NumberFmt[o]=f;if(o>0){if(o>392){for(o=392;o>60;--o)if(r.NumberFmt[o]==null)break;r.NumberFmt[o]=f}D.load(f,o)}}break;case"</numFmt>":break;default:if(t.WTF)thrownewError("unrecognized "+s[0]+" in numFmts");}}}functionOo(e){varr=["<numFmts>"];[[5,8],[23,26],[41,44],[50,392]].forEach(function(t){for(vara=t[0];a<=t[1];++a)if(e[a]!=null)r[r.length]=lr("numFmt",null,{numFmtId:a,formatCode:He(e[a])})});if(r.length===1)return"";r[r.length]="</numFmts>";r[0]=lr("numFmts",null,{count:r.length-2}).replace("/>",">");returnr.join("")}varDo=["numFmtId","fillId","fontId","borderId","xfId"];varFo=["applyAlignment","applyBorder","applyFill","applyFont","applyNumberFormat","applyProtection","pivotButton","quotePrefix"];functionPo(e,r,t){r.CellXf=[];vara;varn=false;(e[0].match(Re)||[]).forEach(function(e){vari=Fe(e),s=0;switch(Pe(i[0])){case"<cellXfs":;case"<cellXfs>":;case"<cellXfs/>":;case"</cellXfs>":break;case"<xf":;case"<xf/>":a=i;deletea[0];for(s=0;s<Do.length;++s)if(a[Do[s]])a[Do[s]]=parseInt(a[Do[
if(l&&s.Views)Lp(a,"Window2",Zi(s.Views[0]));if(l&&(i["!merges"]||[]).length)Lp(a,"MergeCells",Ps(i["!merges"]));if(l)Yp(a,i);Lp(a,"CodeName",ii(g,r));if(l)Kp(a,i);Lp(a,"EOF");returna.end()}functionQp(e,r,t){vara=qr();varn=(e||{}).Workbook||{};vari=n.Sheets||[];vars=n.WBProps||{};varf=t.biff==8,o=t.biff==5;Lp(a,2057,Di(e,5,t));if(t.bookType=="xla")Lp(a,"Addin");Lp(a,"InterfaceHdr",f?Yn(1200):null);Lp(a,"Mms",Xn(2));if(o)Lp(a,"ToolbarHdr");if(o)Lp(a,"ToolbarEnd");Lp(a,"InterfaceEnd");Lp(a,"WriteAccess",Ni("SheetJS",t));Lp(a,"CodePage",Yn(f?1200:1252));if(f)Lp(a,"DSF",Yn(0));if(f)Lp(a,"Excel9File");Lp(a,"RRTabId",Qs(e.SheetNames.length));if(f&&e.vbaraw)Lp(a,"ObProj");if(f&&e.vbaraw){varl=s.CodeName||"ThisWorkbook";Lp(a,"CodeName",ii(l,t))}Lp(a,"BuiltInFnGroupCount",Yn(17));Lp(a,"WinProtect",Kn(false));Lp(a,"Protect",Kn(false));Lp(a,"Password",Yn(0));if(f)Lp(a,"Prot4Rev",Kn(false));if(f)Lp(a,"Prot4RevPass",Yn(0));Lp(a,"Window1",$i(t));Lp(a,"Backup",Kn(false));Lp(a,"HideObj",Yn(0));Lp(a,"Date1904",Kn(hv(e)=="true"));Lp(a,"CalcPrecision",Kn(true));if(f)Lp(a,"RefreshAll",Kn(false));Lp(a,"BookBool",Yn(0));Gp(a,e,t);jp(a,e.SSF,t);$p(a,t);if(f)Lp(a,"UsesELFs",Kn(false));varc=a.end();varu=qr();if(f)Lp(u,"Country",Gs());if(f&&t.Strings)Mp(u,"SST",Hi(t.Strings,t));Lp(u,"EOF");varh=u.end();vard=qr();varv=0,p=0;for(p=0;p<e.SheetNames.length;++p)v+=(f?12:11)+(f?2:1)*e.SheetNames[p].length;varm=c.length+v+h.length;for(p=0;p<e.SheetNames.length;++p){varb=i[p]||{};Lp(d,"BoundSheet8",Ui({pos:m,hs:b.Hidden||0,dt:0,name:e.SheetNames[p]},t));m+=r[p].length}varg=d.end();if(v!=g.length)thrownewError("BS8 "+v+" != "+g.length);varw=[];if(c.length)w.push(c);if(g.length)w.push(g);if(h.length)w.push(h);returnmr([w])}functionqp(e,r){vart=r||{};vara=[];if(e&&!e.SSF){e.SSF=D.get_table()}if(e&&e.SSF){F(D);D.load_table(e.SSF);t.revssf=J(e.SSF);t.revssf[e.SSF[65535]]=0;t.ssf=e.SSF}t.Strings=[];t.Strings.Count=0;t.Strings.Unique=0;Tm(t);t.cellXfs=[];vh(t.cellXfs,{},{revssf:{General:0}});if(!e.Props)e.Props={};for(varn=0;n<e.SheetNames.length;++n)a[a.length]=Jp(n,t,e);a.unshift(Qp(e,a,t));returnmr([a])}functionem(e,r){vart=r||{};switch(t.biff||2){case8:;case5:returnqp(e,r);case4:;case3:;case2:returnXp(e,r);}thrownewError("invalid type "+t.bookType+" for BIFF")}varrm=function(){functione(e,r){vart=r||{};if(m!=null&&t.dense==null)t.dense=m;vara=t.dense?[]:{};e=e.replace(/<!--.*?-->/g,"");varn=e.match(/<table/i);if(!n)thrownewError("Invalid HTML: could not find <table>");vari=e.match(/<\/table/i);vars=n.index,f=i&&i.index||e.length;varo=pe(e.slice(s,f),/(:?<tr[^>]*>)/i,"<tr>");varl=-1,c=0,u=0,h=0;vard={s:{r:1e7,c:1e7},e:{r:0,c:0}};varv=[];for(s=0;s<o.length;++s){varp=o[s].trim();varb=p.slice(0,3).toLowerCase();if(b=="<tr"){++l;if(t.sheetRows&&t.sheetRows<=l){--l;break}c=0;continue}if(b!="<td"&&b!="<th")continue;varg=p.split(/<\/t[dh]>/i);for(f=0;f<g.length;++f){varw=g[f].trim();if(!w.match(/<t[dh]/i))continue;vark=w,E=0;while(k.charAt(0)=="<"&&(E=k.indexOf(">"))>-1)k=k.slice(E+1);for(varS=0;S<v.length;++S){var_=v[S];if(_.s.c==c&&_.s.r<l&&l<=_.e.r){c=_.e.c+1;S=-1}}varC=Fe(w.slice(0,w.indexOf(">")));h=C.colspan?+C.colspan:1;if((u=+C.rowspan)>1||h>1)v.push({s:{r:l,c:c},e:{r:l+(u||1)-1,c:c+h-1}});varB=C.t||"";if(!k.length){c+=h;continue}k=rr(k);if(d.s.r>l)d.s.r=l;if(d.e.r<l)d.e.r=l;if(d.s.c>c)d.s.c=c;if(d.e.c<c)d.e.c=c;if(!k.length)continue;varT={t:"s",v:k};if(t.raw||!k.trim().length||B=="s"){}elseif(k==="TRUE")T={t:"b",v:true};elseif(k==="FALSE")T={t:"b",v:false};elseif(!isNaN(he(k)))T={t:"n",v:he(k)};elseif(!isNaN(de(k).getDate())){T={t:"d",v:oe(k)};if(!t.cellDates)T={t:"n",v:ee(T.v)};T.z=t.dateNF||D._table[14]}if(t.dense){if(!a[l])a[l]=[];a[l][c]=T}elsea[bt({r:l,c:c})]=T;c+=h}}a["!ref"]=wt(d);if(v.length)a["!merges"]=v;returna}functionr(r,t){return_t(e(r,t),t)}functiont(e,r,t,a){varn=e["!merges"]||[];vari=[];for(vars=r.s.c;s<=r.e.c;++s){varf=0,o=0;for(varl=0;l<n.length;++l){if(n[l].s.r>t||n[l].s.c>s)continue;if(n[l].e.r<t||n[l].e.c<s)continue;if(n[l].s.r<t||n[l].s.c<s){f=-1;break}f=n[l].e
r.Strings.Unique=0;if(ch)r.revStrings=newMap;else{r.revStrings={};r.revStrings.foo=[];deleter.revStrings.foo}vart=r.bookType=="xlsb"?"bin":"xml";vara=ql.indexOf(r.bookType)>-1;varn=Da();Tm(r=r||{});vari=Te();vars="",f=0;r.cellXfs=[];vh(r.cellXfs,{},{revssf:{General:0}});if(!e.Props)e.Props={};s="docProps/core.xml";Ce(i,s,an(e.Props,r));n.coreprops.push(s);Xa(r.rels,2,s,Ma.CORE_PROPS);s="docProps/app.xml";if(e.Props&&e.Props.SheetNames){}elseif(!e.Workbook||!e.Workbook.Sheets)e.Props.SheetNames=e.SheetNames;else{varo=[];for(varl=0;l<e.SheetNames.length;++l)if((e.Workbook.Sheets[l]||{}).Hidden!=2)o.push(e.SheetNames[l]);e.Props.SheetNames=o}e.Props.Worksheets=e.Props.SheetNames.length;Ce(i,s,cn(e.Props,r));n.extprops.push(s);Xa(r.rels,3,s,Ma.EXT_PROPS);if(e.Custprops!==e.Props&&K(e.Custprops||{}).length>0){s="docProps/custom.xml";Ce(i,s,vn(e.Custprops,r));n.custprops.push(s);Xa(r.rels,4,s,Ma.CUST_PROPS)}for(f=1;f<=e.SheetNames.length;++f){varc={"!id":{}};varu=e.Sheets[e.SheetNames[f-1]];varh=(u||{})["!type"]||"sheet";switch(h){case"chart":;default:s="xl/worksheets/sheet"+f+"."+t;Ce(i,s,Gv(f-1,s,r,e,c));n.sheets.push(s);Xa(r.wbrels,-1,"worksheets/sheet"+f+"."+t,Ma.WS[0]);}if(u){vard=u["!comments"];varv=false;if(d&&d.length>0){varp="xl/comments"+f+"."+t;Ce(i,p,Yv(d,p,r));n.comments.push(p);Xa(c,-1,"../comments"+f+"."+t,Ma.CMNT);v=true}if(u["!legacy"]){if(v)Ce(i,"xl/drawings/vmlDrawing"+f+".vml",Ul(f,u["!comments"]))}deleteu["!comments"];deleteu["!legacy"]}if(c["!id"].rId1)Ce(i,Ua(s),Wa(c))}if(r.Strings!=null&&r.Strings.length>0){s="xl/sharedStrings."+t;Ce(i,s,$v(r.Strings,s,r));n.strs.push(s);Xa(r.wbrels,-1,"sharedStrings."+t,Ma.SST)}s="xl/workbook."+t;Ce(i,s,Xv(e,s,r));n.workbooks.push(s);Xa(r.rels,1,s,Ma.WB);s="xl/theme/theme1.xml";Ce(i,s,_l(e.Themes,r));n.themes.push(s);Xa(r.wbrels,-1,"theme/theme1.xml",Ma.THEME);s="xl/styles."+t;Ce(i,s,Kv(e,s,r));n.styles.push(s);Xa(r.wbrels,-1,"styles."+t,Ma.STY);if(e.vbaraw&&a){s="xl/vbaProject.bin";Ce(i,s,e.vbaraw);n.vba.push(s);Xa(r.wbrels,-1,"vbaProject.bin",Ma.VBA)}Ce(i,"[Content_Types].xml",La(n,r));Ce(i,"_rels/.rels",Wa(r.rels));Ce(i,"xl/_rels/workbook."+t+".rels",Wa(r.wbrels));deleter.revssf;deleter.ssf;returni}functionFm(e,r){vart="";switch((r||{}).type||"base64"){case"buffer":return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]];case"base64":t=g.decode(e.slice(0,12));break;case"binary":t=e;break;case"array":return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]];default:thrownewError("Unrecognized type "+(r&&r.type||"undefined"));}return[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3),t.charCodeAt(4),t.charCodeAt(5),t.charCodeAt(6),t.charCodeAt(7)]}functionPm(e,r){if(W.find(e,"EncryptedPackage"))returnOm(e,r);returnRp(e,r)}functionNm(e,r){vart,a=e;varn=r||{};if(!n.type)n.type=w&&Buffer.isBuffer(e)?"buffer":"base64";t=ye(a,n);returnRm(t,n)}functionLm(e,r){vart=0;e:while(t<e.length)switch(e.charCodeAt(t)){case10:;case13:;case32:++t;break;case60:returnlp(e.slice(t),r);default:breake;}returnmf.to_workbook(e,r)}functionMm(e,r){vart="",a=Fm(e,r);switch(r.type){case"base64":t=g.decode(e);break;case"binary":t=e;break;case"buffer":t=e.toString("binary");break;case"array":t=le(e);break;default:thrownewError("Unrecognized type "+r.type);}if(a[0]==239&&a[1]==187&&a[2]==191)t=Ye(t);returnLm(t,r)}functionUm(e,r){vart=e;if(r.type=="base64")t=g.decode(t);t=cptable.utils.decode(1200,t.slice(2),"str");r.type="binary";returnLm(t,r)}functionzm(e){return!e.match(/[^\x00-\x7F]/)?e:Ze(e)}functionHm(e,r,t,a){if(a){t.type="string";returnmf.to_workbook(e,t)}returnmf.to_workbook(r,t)}functionWm(e,r){l();if(typeofArrayBuffer!=="undefined"&&einstanceofArrayBuffer)returnWm(newUint8Array(e),r);vart=e,a=[0,0,0,0],n=false;vari=r||{};if(i.cellStyles){i.cellNF=true;i.sheetStubs=true}lh={};if(i.dateNF)lh.dateNF=i.dateNF;if(!i.type)i.type=w&&Buffer.isBuffer(e)?"buffer":"base64";if(i.type=="file"){i.type=w?"buffer":"binary";t=j(e)}if(i.type=="string"){n=true;i.type="binary";i.codepage=65001;t=zm(e)}if(i.type=="array"&&typeofUint8Array!=="undefined"&&