continue}n=e.charCodeAt(t++);if(a>191&&a<224){s=(a&31)<<6;s|=n&63;r+=String.fromCharCode(s);continue}i=e.charCodeAt(t++);if(a<240){r+=String.fromCharCode((a&15)<<12|(n&63)<<6|i&63);continue}s=e.charCodeAt(t++);f=((a&7)<<18|(n&63)<<12|(i&63)<<6|s&63)-65536;r+=String.fromCharCode(55296+(f>>>10&1023));r+=String.fromCharCode(56320+(f&1023))}returnr};varQe=function(e){varr=[],t=0,a=0,n=0;while(t<e.length){a=e.charCodeAt(t++);switch(true){casea<128:r.push(String.fromCharCode(a));break;casea<2048:r.push(String.fromCharCode(192+(a>>6)));r.push(String.fromCharCode(128+(a&63)));break;casea>=55296&&a<57344:a-=55296;n=e.charCodeAt(t++)-56320+(a<<10);r.push(String.fromCharCode(240+(n>>18&7)));r.push(String.fromCharCode(144+(n>>12&63)));r.push(String.fromCharCode(128+(n>>6&63)));r.push(String.fromCharCode(128+(n&63)));break;default:r.push(String.fromCharCode(224+(a>>12)));r.push(String.fromCharCode(128+(a>>6&63)));r.push(String.fromCharCode(128+(a&63)));}}returnr.join("")};if(E){varJe=functionHm(e){varr=Buffer.alloc(2*e.length),t,a,n=1,i=0,s=0,f;for(a=0;a<e.length;a+=n){n=1;if((f=e.charCodeAt(a))<128)t=f;elseif(f<224){t=(f&31)*64+(e.charCodeAt(a+1)&63);n=2}elseif(f<240){t=(f&15)*4096+(e.charCodeAt(a+1)&63)*64+(e.charCodeAt(a+2)&63);n=3}else{n=4;t=(f&7)*262144+(e.charCodeAt(a+1)&63)*4096+(e.charCodeAt(a+2)&63)*64+(e.charCodeAt(a+3)&63);t-=65536;s=55296+(t>>>10&1023);t=56320+(t&1023)}if(s!==0){r[i++]=s&255;r[i++]=s>>>8;s=0}r[i++]=t%256;r[i++]=t>>>8}returnr.slice(0,i).toString("ucs2")};varZe="foo bar bazâð£";if(Ye(Ze)==Je(Ze))Ye=Je;varqe=functionWm(e){returnw(e,"binary").toString("utf8")};if(Ye(Ze)==qe(Ze))Ye=qe;Qe=function(e){returnw(e,"utf8").toString("binary")}}varer=function(){vare={};returnfunctionr(t,a){varn=t+"|"+(a||"");if(e[n])returne[n];returne[n]=newRegExp("<(?:\\w+:)?"+t+'(?: xml:space="preserve")?(?:[^>]*)>([\\s\\S]*?)</(?:\\w+:)?'+t+">",a||"")}}();varrr=function(){vare=[["nbsp"," "],["middot","·"],["quot",'"'],["apos","'"],["gt",">"],["lt","<"],["amp","&"]].map(function(e){return[newRegExp("&"+e[0]+";","ig"),e[1]]});returnfunctionr(t){vara=t.replace(/^[\t\n\r ]+/,"").replace(/[\t\n\r ]+$/,"").replace(/>\s+/g,">").replace(/\s+</g,"<").replace(/[\t\n\r ]+/g," ").replace(/<\s*[bB][rR]\s*\/?>/g,"\n").replace(/<[^>]*>/g,"");for(varn=0;n<e.length;++n)a=a.replace(e[n][0],e[n][1]);returna}}();vartr=function(){vare={};returnfunctionr(t){if(e[t]!==undefined)returne[t];returne[t]=newRegExp("<(?:vt:)?"+t+">([\\s\\S]*?)</(?:vt:)?"+t+">","g")}}();varar=/<\/?(?:vt:)?variant>/g,nr=/<(?:vt:)([^>]*)>([\s\S]*)</;functionir(e,r){vart=Oe(e);vara=e.match(tr(t.baseType))||[];varn=[];if(a.length!=t.size){if(r.WTF)thrownewError("unexpected vector length "+a.length+" != "+t.size);returnn}a.forEach(function(e){varr=e.replace(ar,"").match(nr);if(r)n.push({v:Ye(r[2]),t:r[1]})});returnn}varsr=/(^\s|\s$|\n)/;functionfr(e,r){return"<"+e+(r.match(sr)?' xml:space="preserve"':"")+">"+r+"</"+e+">"}functionlr(e){returnK(e).map(function(r){return" "+r+'="'+e[r]+'"'}).join("")}functionor(e,r,t){return"<"+e+(t!=null?lr(t):"")+(r!=null?(r.match(sr)?' xml:space="preserve"':"")+">"+r+"</"+e:"/")+">"}functioncr(e,r){try{returne.toISOString().replace(/\.\d*/,"")}catch(t){if(r)throwt}return""}functionur(e,r){switch(typeofe){case"string":vart=or("vt:lpwstr",We(e));if(r)t=t.replace(/"/g,"_x0022_");returnt;case"number":returnor((e|0)==e?"vt:i4":"vt:r8",We(String(e)));case"boolean":returnor("vt:bool",e?"true":"false");}if(einstanceofDate)returnor("vt:filetime",cr(e));thrownewError("Unable to serialize "+e)}varhr={dc:"http://purl.org/dc/elements/1.1/",dcterms:"http://purl.org/dc/terms/",dcmitype:"http://purl.org/dc/dcmitype/",mx:"http://schemas.microsoft.com/office/mac/excel/2008/main",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",sjs:"http://schemas.openxmlformats.org/package/2006/sheetjs/core-properties",vt:"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes",xsi:"http://www.w3.org/2001/XMLSchema-instance",xsd:"http://www.w3.org/2001/XMLSche
r.calcchain=r.calcchains.length>0?r.calcchains[0]:"";r.sst=r.strs.length>0?r.strs[0]:"";r.style=r.styles.length>0?r.styles[0]:"";r.defaults=t;deleter.calcchains;returnr}varNa=or("Types",null,{xmlns:hr.CT,"xmlns:xsd":hr.xsd,"xmlns:xsi":hr.xsi});varMa=[["xml","application/xml"],["bin","application/vnd.ms-excel.sheet.binary.macroEnabled.main"],["vml","application/vnd.openxmlformats-officedocument.vmlDrawing"],["data","application/vnd.openxmlformats-officedocument.model+data"],["bmp","image/bmp"],["png","image/png"],["gif","image/gif"],["emf","image/x-emf"],["wmf","image/x-wmf"],["jpg","image/jpeg"],["jpeg","image/jpeg"],["tif","image/tiff"],["tiff","image/tiff"],["pdf","application/pdf"],["rels",Da.rels[0]]].map(function(e){returnor("Default",null,{Extension:e[0],ContentType:e[1]})});functionLa(e,r){vart=[],a;t[t.length]=ye;t[t.length]=Na;t=t.concat(Ma);varn=function(n){if(e[n]&&e[n].length>0){a=e[n][0];t[t.length]=or("Override",null,{PartName:(a[0]=="/"?"":"/")+a,ContentType:Fa[n][r.bookType||"xlsx"]})}};vari=function(a){(e[a]||[]).forEach(function(e){t[t.length]=or("Override",null,{PartName:(e[0]=="/"?"":"/")+e,ContentType:Fa[a][r.bookType||"xlsx"]})})};vars=function(r){(e[r]||[]).forEach(function(e){t[t.length]=or("Override",null,{PartName:(e[0]=="/"?"":"/")+e,ContentType:Da[r][0]})})};n("workbooks");i("sheets");i("charts");s("themes");["strs","styles"].forEach(n);["coreprops","extprops","custprops"].forEach(s);s("vba");s("comments");s("drawings");if(t.length>2){t[t.length]="</Types>";t[1]=t[1].replace("/>",">")}returnt.join("")}varUa={WB:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",SHEET:"http://sheetjs.openxmlformats.org/officeDocument/2006/relationships/officeDocument",HLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",VML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",XPATH:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath",XMISS:"http://schemas.microsoft.com/office/2006/relationships/xlExternalLinkPath/xlPathMissing",XLINK:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink",CXML:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml",CXMLP:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps",VBA:"http://schemas.microsoft.com/office/2006/relationships/vbaProject"};functionHa(e){varr=e.lastIndexOf("/");returne.slice(0,r+1)+"_rels/"+e.slice(r+1)+".rels"}functionWa(e,r){vart={"!id":{}};if(!e)returnt;if(r.charAt(0)!=="/"){r="/"+r}vara={};(e.match(Re)||[]).forEach(function(e){varn=Oe(e);if(n[0]==="<Relationship"){vari={};i.Type=n.Type;i.Target=n.Target;i.Id=n.Id;i.TargetMode=n.TargetMode;vars=n.TargetMode==="External"?n.Target:Ae(n.Target,r);t[s]=i;a[n.Id]=i}});t["!id"]=a;returnt}hr.RELS="http://schemas.openxmlformats.org/package/2006/relationships";varVa=or("Relationships",null,{xmlns:hr.RELS});functionXa(e){varr=[ye,Va];K(e["!id"]).forEach(function(t){r[r.length]=or("Relationship",null,e["!id"][t])});if(r.length>2){r[r.length]="</Relationships>";r[1]=r[1].replace("/>",">")}returnr.join("")}varGa=[Ua.HLINK,Ua.XPATH,Ua.XMISS];functionza(e,r,t,a,n,i){if(!n)n={};if(!e["!id"])e["!id"]={};if(r<0)for(r=1;e["!id"]["rId"+r];++r){}n.Id="rId"+r;n.Type=a;n.Target=t;if(i)n.TargetMode=i;elseif(Ga.indexOf(n.Type)>-1)n.TargetMode="External";if(e["!id"][n.Id])thrownewError("Cannot rewrite rId "+r);e["!id"][n.Id]=n;e[("/"+n.Target).replace("//","/")]=n;returnr}varja="application/vnd.oasis.opendocument.spreadsheet";function$a(e,r){vart=Tp(e);vara;varn;while(a=_p.exec(t))switch(a[3]){case"manifest":break;case"file-entry":n=Oe(a[0],false);if(n.path=="/"&&n.type!==ja)thrownewError("This OpenDocument is not a spreadsheet");break;case"encryption-data":;case"algorithm":;case"start-key-generation":;case"key-derivation":thrownewError("Unsupported ODS Encryption");default:if(r&&r.WTF)throwa;}}functionKa(e){varr=[ye];r.push('<manifest:manifestxmlns:manifest="urn:oasis:names:
if(!b||b.t=="z")continue;if(b.t=="n"){if((b.v|0)==b.v&&b.v>=-32768&&b.v<=32767)tb(a,13,v(c,d,b.v));elsetb(a,14,m(c,d,b.v))}else{varg=St(b);tb(a,15,h(c,d,g.slice(0,239)))}}}tb(a,1);returna.end()}functionn(e,r){vart=r||{};if(+t.codepage>=0)l(+t.codepage);if(t.type=="string")thrownewError("Cannot write WK3 to JS string");vara=qr();tb(a,0,s(e));for(varn=0,i=0;n<e.SheetNames.length;++n)if((e.Sheets[e.SheetNames[n]]||{})["!ref"])tb(a,27,L(e.SheetNames[n],i++));varf=0;for(n=0;n<e.SheetNames.length;++n){varo=e.Sheets[e.SheetNames[n]];if(!o||!o["!ref"])continue;varc=wt(o["!ref"]);varu=Array.isArray(o);varh=[];for(vard=c.s.r;d<=c.e.r;++d){varv=lt(d);for(varp=c.s.c;p<=c.e.c;++p){if(d===c.s.r)h[p]=ht(p);varb=h[p]+v;varm=u?(o[d]||[])[p]:o[b];if(!m||m.t=="z")continue;if(m.t=="n"){tb(a,23,R(d,p,f,m.v))}else{varg=St(m);tb(a,22,A(d,p,f,g.slice(0,239)))}}}++f}tb(a,1);returna.end()}functioni(e){varr=Jr(2);r._W(2,e);returnr}functions(e){varr=Jr(26);r._W(2,4096);r._W(2,4);r._W(4,0);vart=0,a=0,n=0;for(vari=0;i<e.SheetNames.length;++i){vars=e.SheetNames[i];varf=e.Sheets[s];if(!f||!f["!ref"])continue;++n;varl=gt(f["!ref"]);if(t<l.e.r)t=l.e.r;if(a<l.e.c)a=l.e.c}r._W(2,t);r._W(1,n);r._W(1,a);r._W(2,0);r._W(2,0);r._W(1,1);r._W(1,2);r._W(4,0);r._W(4,0);returnr}functionf(e){varr={s:{c:0,r:0},e:{c:0,r:0}};r.s.c=e._R(2);r.s.r=e._R(2);r.e.c=e._R(2);r.e.r=e._R(2);if(r.s.c==65535)r.s.c=r.e.c=r.s.r=r.e.r=0;returnr}functiono(e){varr=Jr(8);r._W(2,e.s.c);r._W(2,e.s.r);r._W(2,e.e.c);r._W(2,e.e.r);returnr}functionc(e,r,t){vara=[{c:0,r:0},{t:"n",v:0},0];if(t.qpro&&t.vers!=20768){a[0].c=e._R(1);e.l++;a[0].r=e._R(2);e.l+=2}else{a[2]=e._R(1);a[0].c=e._R(2);a[0].r=e._R(2)}returna}functionu(e,r,t){vara=e.l+r;varn=c(e,r,t);n[1].t="s";if(t.vers==20768){e.l++;vari=e._R(1);n[1].v=e._R(i,"utf8");returnn}if(t.qpro)e.l++;n[1].v=e._R(a-e.l,"cstr");returnn}functionh(e,r,t){vara=Jr(7+t.length);a._W(1,255);a._W(2,r);a._W(2,e);a._W(1,39);for(varn=0;n<a.length;++n){vari=t.charCodeAt(n);a._W(1,i>=128?95:i)}a._W(1,0);returna}functiond(e,r,t){vara=c(e,r,t);a[1].v=e._R(2,"i");returna}functionv(e,r,t){vara=Jr(7);a._W(1,255);a._W(2,r);a._W(2,e);a._W(2,t,"i");returna}functionp(e,r,t){vara=c(e,r,t);a[1].v=e._R(8,"f");returna}functionm(e,r,t){vara=Jr(13);a._W(1,255);a._W(2,r);a._W(2,e);a._W(8,t,"f");returna}functionE(e,r,t){vara=e.l+r;varn=c(e,r,t);n[1].v=e._R(8,"f");if(t.qpro)e.l=a;else{vari=e._R(2);C(e.slice(e.l,e.l+i),n);e.l+=i}returnn}functionw(e,r,t){vara=r&32768;r&=~32768;r=(a?e:0)+(r>=8192?r-16384:r);return(a?"":"$")+(t?ht(r):lt(r))}vark=[8,8,8,8,8,8,8,8,6,4,4,5,5,7,3,3,3,3,3,3,1,1,2,6,8,8,8,8,8,8,8,8];varS={51:["FALSE",0],52:["TRUE",0],70:["LEN",1],80:["SUM",69],81:["AVERAGEA",69],82:["COUNTA",69],83:["MINA",69],84:["MAXA",69],111:["T",1]};varB=["","","","","","","","","","+","-","*","/","^","=","<>","<=",">=","<",">","","","","","&","","","","","","",""];functionC(e,r){Yr(e,0);vart=[],a=0,n="",i="";while(e.l<e.length){vars=e[e.l++];switch(s){case0:t.push(e._R(8,"f"));break;case1:{i=w(r[0].c,e._R(2),true);n=w(r[0].r,e._R(2),false);t.push(i+n)}break;case2:{varf=w(r[0].c,e._R(2),true);varl=w(r[0].r,e._R(2),false);i=w(r[0].c,e._R(2),true);n=w(r[0].r,e._R(2),false);t.push(f+l+":"+i+n)}break;case3:if(e.l<e.length){console.error("WK1 premature formula end");return}break;case4:t.push("("+t.pop()+")");break;case5:t.push(e._R(2));break;case6:{varo="";while(s=e[e.l++])o+=String.fromCharCode(s);t.push('"'+o.replace(/"/g,'""')+'"');break}break;case8:t.push("-"+t.pop());break;case23:t.push("+"+t.pop());break;case22:t.push("NOT("+t.pop()+")");break;case20:;case21:{varc=t.pop(),u=t.pop();t.push(["AND","OR"][s-20]+"("+u+","+c+")")}break;default:if(s<32&&B[s]){c=t.pop();u=t.pop();t.push(u+B[s]+c)}elseif(S[s]){a=S[s][1];if(a==69)a=e[e.l++];if(a>t.length){console.error("WK1 bad formula parse 0x"+s.toString(16)+":|"+t.join("|")+"|");return}varh=t.slice(-a);t.length-=a;t.push(S[s][0]+"("+h.join(",")+")")}elseif(s<=7)returnconsole.error("WK1 invalid opcode "+s.toString(16));elseif(s<=24)returnconsole.er
switch(t.biff||2){case8:;case5:returnEb(e,r);case4:;case3:;case2:returnob(e,r);}thrownewError("invalid type "+t.bookType+" for BIFF")}varkb=function(){functione(e,r){vart=r||{};if(b!=null&&t.dense==null)t.dense=b;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;varl=pe(e.slice(s,f),/(:?<tr[^>]*>)/i,"<tr>");varo=-1,c=0,u=0,h=0;vard={s:{r:1e7,c:1e7},e:{r:0,c:0}};varv=[];for(s=0;s<l.length;++s){varp=l[s].trim();varm=p.slice(0,3).toLowerCase();if(m=="<tr"){++o;if(t.sheetRows&&t.sheetRows<=o){--o;break}c=0;continue}if(m!="<td"&&m!="<th")continue;varg=p.split(/<\/t[dh]>/i);for(f=0;f<g.length;++f){varE=g[f].trim();if(!E.match(/<t[dh]/i))continue;varw=E,k=0;while(w.charAt(0)=="<"&&(k=w.indexOf(">"))>-1)w=w.slice(k+1);for(varS=0;S<v.length;++S){varB=v[S];if(B.s.c==c&&B.s.r<o&&o<=B.e.r){c=B.e.c+1;S=-1}}varC=Oe(E.slice(0,E.indexOf(">")));h=C.colspan?+C.colspan:1;if((u=+C.rowspan)>1||h>1)v.push({s:{r:o,c:c},e:{r:o+(u||1)-1,c:c+h-1}});varT=C.t||C["data-t"]||"";if(!w.length){c+=h;continue}w=rr(w);if(d.s.r>o)d.s.r=o;if(d.e.r<o)d.e.r=o;if(d.s.c>c)d.s.c=c;if(d.e.c<c)d.e.c=c;if(!w.length)continue;var_={t:"s",v:w};if(t.raw||!w.trim().length||T=="s"){}elseif(w==="TRUE")_={t:"b",v:true};elseif(w==="FALSE")_={t:"b",v:false};elseif(!isNaN(he(w)))_={t:"n",v:he(w)};elseif(!isNaN(de(w).getDate())){_={t:"d",v:le(w)};if(!t.cellDates)_={t:"n",v:ee(_.v)};_.z=t.dateNF||D._table[14]}if(t.dense){if(!a[o])a[o]=[];a[o][c]=_}elsea[mt({r:o,c:c})]=_;c+=h}}a["!ref"]=Et(d);if(v.length)a["!merges"]=v;returna}functionr(r,t){vara=r.match(/<table.*?>[\s\S]*?<\/table>/gi);if(!a||a.length==0)thrownewError("Invalid HTML: could not find <table>");if(a.length==1)returnBt(e(a[0],t),t);varn=Im.book_new();a.forEach(function(r,a){Im.book_append_sheet(n,e(r,t),"Sheet"+(a+1))});returnn}functiont(e,r,t,a){varn=e["!merges"]||[];vari=[];for(vars=r.s.c;s<=r.e.c;++s){varf=0,l=0;for(varo=0;o<n.length;++o){if(n[o].s.r>t||n[o].s.c>s)continue;if(n[o].e.r<t||n[o].e.c<s)continue;if(n[o].s.r<t||n[o].s.c<s){f=-1;break}f=n[o].e.r-n[o].s.r+1;l=n[o].e.c-n[o].s.c+1;break}if(f<0)continue;varc=mt({r:t,c:s});varu=a.dense?(e[t]||[])[s]:e[c];varh=u&&u.v!=null&&(u.h||Ge(u.w||(St(u),u.w)||""))||"";vard={};if(f>1)d.rowspan=f;if(l>1)d.colspan=l;if(a.editable)h='<span contenteditable="true">'+h+"</span>";elseif(u){d["data-t"]=u&&u.t||"z";if(u.v!=null)d["data-v"]=u.v;if(u.z!=null)d["data-z"]=u.z;if(u.l&&(u.l.Target||"#").charAt(0)!="#")h='<a href="'+u.l.Target+'">'+h+"</a>"}d.id=(a.id||"sjs")+"-"+c;i.push(or("td",h,d))}varv="<tr>";returnv+i.join("")+"</tr>"}functiona(e,r,t){vara=[];returna.join("")+"<table"+(t&&t.id?' id="'+t.id+'"':"")+">"}varn='<html><head><meta charset="utf-8"/><title>SheetJS Table Export</title></head><body>';vari="</body></html>";functions(e,r){vars=r||{};varf=s.header!=null?s.header:n;varl=s.footer!=null?s.footer:i;varo=[f];varc=gt(e["!ref"]);s.dense=Array.isArray(e);o.push(a(e,c,s));for(varu=c.s.r;u<=c.e.r;++u)o.push(t(e,c,u,s));o.push("</table>"+l);returno.join("")}return{to_workbook:r,to_sheet:e,_row:t,BEGIN:n,END:i,_preamble:a,from_sheet:s}}();functionSb(e,r,t){vara=t||{};if(b!=null)a.dense=b;varn=0,i=0;if(a.origin!=null){if(typeofa.origin=="number")n=a.origin;else{vars=typeofa.origin=="string"?bt(a.origin):a.origin;n=s.r;i=s.c}}varf=r.getElementsByTagName("tr");varl=Math.min(a.sheetRows||1e7,f.length);varo={s:{r:0,c:0},e:{r:n,c:i}};if(e["!ref"]){varc=gt(e["!ref"]);o.s.r=Math.min(o.s.r,c.s.r);o.s.c=Math.min(o.s.c,c.s.c);o.e.r=Math.max(o.e.r,c.e.r);o.e.c=Math.max(o.e.c,c.e.c);if(n==-1)o.e.r=n=c.e.r+1}varu=[],h=0;vard=e["!rows"]||(e["!rows"]=[]);varv=0,p=0,m=0,g=0,E=0,w=0;if(!e["!cols"])e["!cols"]=[];for(;v<f.length&&p<l;++v){vark=f[v];if(Tb(k)){if(a.display)continue;d[p]={hidden:true}}varS=k.children;for(m=g=0;m<S.length;++m){varB=S[m];if(a.display&&Tb(B))continue;varC=B.hasAttribute("data-v")?B.getAttribute("data-v"):B.hasAttribute("v")?B.getAtt
n=V.find(e,a);if(!n||!n.content)thrownewError("ECMA-376 Encrypted file missing "+a);if(l[0]==4&&typeofdecrypt_agile!=="undefined")returndecrypt_agile(l[1],n.content,t.password||"",t);if(l[0]==2&&typeofdecrypt_std76!=="undefined")returndecrypt_std76(l[1],n.content,t.password||"",t);thrownewError("File is password-protected")}functionem(e,r){Ho=1024;if(r.bookType=="ods")returnFb(e,r);if(e&&!e.SSF){e.SSF=D.get_table()}if(e&&e.SSF){O(D);D.load_table(e.SSF);r.revssf=J(e.SSF);r.revssf[e.SSF[65535]]=0;r.ssf=e.SSF}r.rels={};r.wbrels={};r.Strings=[];r.Strings.Count=0;r.Strings.Unique=0;if(hh)r.revStrings=newMap;else{r.revStrings={};r.revStrings.foo=[];deleter.revStrings.foo}vart=r.bookType=="xlsb"?"bin":"xml";vara=rc.indexOf(r.bookType)>-1;varn=Oa();$b(r=r||{});vari=_e();vars="",f=0;r.cellXfs=[];bh(r.cellXfs,{},{revssf:{General:0}});if(!e.Props)e.Props={};s="docProps/core.xml";Ce(i,s,nn(e.Props,r));n.coreprops.push(s);za(r.rels,2,s,Ua.CORE_PROPS);s="docProps/app.xml";if(e.Props&&e.Props.SheetNames){}elseif(!e.Workbook||!e.Workbook.Sheets)e.Props.SheetNames=e.SheetNames;else{varl=[];for(varo=0;o<e.SheetNames.length;++o)if((e.Workbook.Sheets[o]||{}).Hidden!=2)l.push(e.SheetNames[o]);e.Props.SheetNames=l}e.Props.Worksheets=e.Props.SheetNames.length;Ce(i,s,un(e.Props,r));n.extprops.push(s);za(r.rels,3,s,Ua.EXT_PROPS);if(e.Custprops!==e.Props&&K(e.Custprops||{}).length>0){s="docProps/custom.xml";Ce(i,s,pn(e.Custprops,r));n.custprops.push(s);za(r.rels,4,s,Ua.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,cp(f-1,s,r,e,c));n.sheets.push(s);za(r.wbrels,-1,"worksheets/sheet"+f+"."+t,Ua.WS[0]);}if(u){vard=u["!comments"];varv=false;if(d&&d.length>0){varp="xl/comments"+f+"."+t;Ce(i,p,vp(d,p,r));n.comments.push(p);za(c,-1,"../comments"+f+"."+t,Ua.CMNT);v=true}if(u["!legacy"]){if(v)Ce(i,"xl/drawings/vmlDrawing"+f+".vml",Wo(f,u["!comments"]))}deleteu["!comments"];deleteu["!legacy"]}if(c["!id"].rId1)Ce(i,Ha(s),Xa(c))}if(r.Strings!=null&&r.Strings.length>0){s="xl/sharedStrings."+t;Ce(i,s,dp(r.Strings,s,r));n.strs.push(s);za(r.wbrels,-1,"sharedStrings."+t,Ua.SST)}s="xl/workbook."+t;Ce(i,s,op(e,s,r));n.workbooks.push(s);za(r.rels,1,s,Ua.WB);s="xl/theme/theme1.xml";Ce(i,s,To(e.Themes,r));n.themes.push(s);za(r.wbrels,-1,"theme/theme1.xml",Ua.THEME);s="xl/styles."+t;Ce(i,s,hp(e,s,r));n.styles.push(s);za(r.wbrels,-1,"styles."+t,Ua.STY);if(e.vbaraw&&a){s="xl/vbaProject.bin";Ce(i,s,e.vbaraw);n.vba.push(s);za(r.wbrels,-1,"vbaProject.bin",Ua.VBA)}Ce(i,"[Content_Types].xml",La(n,r));Ce(i,"_rels/.rels",Xa(r.rels));Ce(i,"xl/_rels/workbook."+t+".rels",Xa(r.wbrels));deleter.revssf;deleter.ssf;returni}functionrm(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)]}functiontm(e,r){if(V.find(e,"EncryptedPackage"))returnqb(e,r);returnQp(e,r)}functionam(e,r){vart,a=e;varn=r||{};if(!n.type)n.type=E&&Buffer.isBuffer(e)?"buffer":"base64";t=xe(a,n);returnZb(t,n)}functionnm(e,r){vart=0;e:while(t<e.length)switch(e.charCodeAt(t)){case10:;case13:;case32:++t;break;case60:returnAp(e.slice(t),r);default:breake;}returngf.to_workbook(e,r)}functionim(e,r){vart="",a=rm(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=oe(e);break;default:thrownewError("Unrecognized type "+r.type);}if(a[0]==239&&a[1]==187&&a[2]==191)t=Ye(t);returnnm(t,r)}functionsm(e,r){vart=e;if(r.type=="base64")t=g.decode(t);t=cptable.utils.decode(1200,t.slice(2),"str");r.type="binary";returnnm(t,r)}functionfm(e){return!e.match(/[^\x00-\x7F]/)?e:Q