varr="",t=0,a=0,n=0,i=0,s=0,f=0;while(t<e.length){a=e.charCodeAt(t++);if(a<128){r+=String.fromCharCode(a);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};varJe=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){varqe=functionWm(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(Qe(Ze)==qe(Ze))Qe=qe;varer=functionVm(e){returnw(e,"binary").toString("utf8")};if(Qe(Ze)==er(Ze))Qe=er;Je=function(e){returnw(e,"utf8").toString("binary")}}varrr=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||"")}}();vartr=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}}();varar=function(){vare={};returnfunctionr(t){if(e[t]!==undefined)returne[t];returne[t]=newRegExp("<(?:vt:)?"+t+">([\\s\\S]*?)</(?:vt:)?"+t+">","g")}}();varnr=/<\/?(?:vt:)?variant>/g,ir=/<(?:vt:)([^>]*)>([\s\S]*)</;functionsr(e,r){vart=Pe(e);vara=e.match(ar(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(nr,"").match(ir);if(r)n.push({v:Qe(r[2]),t:r[1]})});returnn}varfr=/(^\s|\s$|\n)/;functionlr(e,r){return"<"+e+(r.match(fr)?' xml:space="preserve"':"")+">"+r+"</"+e+">"}functionor(e){returnK(e).map(function(r){return" "+r+'="'+e[r]+'"'}).join("")}functioncr(e,r,t){return"<"+e+(t!=null?or(t):"")+(r!=null?(r.match(fr)?' xml:space="preserve"':"")+">"+r+"</"+e:"/")+">"}functionur(e,r){try{returne.toISOString().replace(/\.\d*/,"")}catch(t){if(r)throwt}return""}functionhr(e,r){switch(typeofe){case"string":vart=cr("vt:lpwstr",Ve(e));if(r)t=t.replace(/"/g,"_x0022_");returnt;case"number":returncr((e|0)==e?"vt:i4":"vt:r8",Ve(String(e)));case"boolean":returncr("vt:bool",e?"true":"false");}if(einstanceofDate)returncr("vt:filetime",ur(e));thrownewError("Unable to serialize "+e)}vardr={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/officeDocume
break;}});if(r.xmlns!==dr.CT)thrownewError("Unknown Namespace: "+r.xmlns);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}varMa=cr("Types",null,{xmlns:dr.CT,"xmlns:xsd":dr.xsd,"xmlns:xsi":dr.xsi});varLa=[["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",Oa.rels[0]]].map(function(e){returncr("Default",null,{Extension:e[0],ContentType:e[1]})});functionUa(e,r){vart=[],a;t[t.length]=Ie;t[t.length]=Ma;t=t.concat(La);varn=function(n){if(e[n]&&e[n].length>0){a=e[n][0];t[t.length]=cr("Override",null,{PartName:(a[0]=="/"?"":"/")+a,ContentType:Da[n][r.bookType||"xlsx"]})}};vari=function(a){(e[a]||[]).forEach(function(e){t[t.length]=cr("Override",null,{PartName:(e[0]=="/"?"":"/")+e,ContentType:Da[a][r.bookType||"xlsx"]})})};vars=function(r){(e[r]||[]).forEach(function(e){t[t.length]=cr("Override",null,{PartName:(e[0]=="/"?"":"/")+e,ContentType:Oa[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("")}varHa={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"};functionWa(e){varr=e.lastIndexOf("/");returne.slice(0,r+1)+"_rels/"+e.slice(r+1)+".rels"}functionVa(e,r){vart={"!id":{}};if(!e)returnt;if(r.charAt(0)!=="/"){r="/"+r}vara={};(e.match(Fe)||[]).forEach(function(e){varn=Pe(e);if(n[0]==="<Relationship"){vari={};i.Type=n.Type;i.Target=n.Target;i.Id=n.Id;if(n.TargetMode)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}dr.RELS="http://schemas.openxmlformats.org/package/2006/relationships";varXa=cr("Relationships",null,{xmlns:dr.RELS});functionGa(e){varr=[Ie,Xa];K(e["!id"]).forEach(function(t){r[r.length]=cr("Relationship",null,e["!id"][t])});if(r.length>2){r[r.length]="</Relationships>";r[1]=r[1].replace("/>",">")}returnr.join("")}varza=[Ha.HLINK,Ha.XPATH,Ha.XMISS];functionja(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(za.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}var$a="application/vnd.oasis.opendocument.spreadsheet";functionKa(e,r){vart=_p(e);vara;varn;while(a=xp.exec(t))switch(a[3]){case"manifest":break;case"file-entry":n=Pe(a[0],false);if(n.path=="/"&&n.type!==$a)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)thr
if(l)ab(a,"ToolbarHdr");if(l)ab(a,"ToolbarEnd");ab(a,"InterfaceEnd");ab(a,"WriteAccess",Li("SheetJS",t));ab(a,"CodePage",Qn(f?1200:1252));if(f)ab(a,"DSF",Qn(0));if(f)ab(a,"Excel9File");ab(a,"RRTabId",rf(e.SheetNames.length));if(f&&e.vbaraw)ab(a,"ObProj");if(f&&e.vbaraw){varo=s.CodeName||"ThisWorkbook";ab(a,"CodeName",si(o,t))}ab(a,"BuiltInFnGroupCount",Qn(17));ab(a,"WinProtect",Kn(false));ab(a,"Protect",Kn(false));ab(a,"Password",Qn(0));if(f)ab(a,"Prot4Rev",Kn(false));if(f)ab(a,"Prot4RevPass",Qn(0));ab(a,"Window1",Qi(t));ab(a,"Backup",Kn(false));ab(a,"HideObj",Qn(0));ab(a,"Date1904",Kn(Fv(e)=="true"));ab(a,"CalcPrecision",Kn(true));if(f)ab(a,"RefreshAll",Kn(false));ab(a,"BookBool",Qn(0));ub(a,e,t);hb(a,e.SSF,t);vb(a,t);if(f)ab(a,"UsesELFs",Kn(false));varc=a.end();varu=et();if(f)ab(u,"Country",$s());if(f&&t.Strings)nb(u,"SST",Xi(t.Strings,t));ab(u,"EOF");varh=u.end();vard=et();varv=0,p=0;for(p=0;p<e.SheetNames.length;++p)v+=(f?12:11)+(f?2:1)*e.SheetNames[p].length;varb=c.length+v+h.length;for(p=0;p<e.SheetNames.length;++p){varm=i[p]||{};ab(d,"BoundSheet8",Wi({pos:b,hs:m.Hidden||0,dt:0,name:e.SheetNames[p]},t));b+=r[p].length}varg=d.end();if(v!=g.length)thrownewError("BS8 "+v+" != "+g.length);varE=[];if(c.length)E.push(c);if(g.length)E.push(g);if(h.length)E.push(h);returnmr([E])}functionwb(e,r){vart=r||{};vara=[];if(e&&!e.SSF){e.SSF=D.get_table()}if(e&&e.SSF){O(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;Mb(t);t.cellXfs=[];mh(t.cellXfs,{},{revssf:{General:0}});if(!e.Props)e.Props={};for(varn=0;n<e.SheetNames.length;++n)a[a.length]=gb(n,t,e);a.unshift(Eb(e,a,t));returnmr([a])}functionkb(e,r){for(vart=0;t<=e.SheetNames.length;++t){vara=e.Sheets[e.SheetNames[t]];if(!a||!a["!ref"])continue;varn=Et(a["!ref"]);if(n.e.c>255){if(typeofconsole!="undefined"&&console.error)console.error("Worksheet '"+e.SheetNames[t]+"' extends beyond column IV (255). Data may be lost.")}}vari=r||{};switch(i.biff||2){case8:;case5:returnwb(e,r);case4:;case3:;case2:returncb(e,r);}thrownewError("invalid type "+i.bookType+" for BIFF")}varSb=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=Pe(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=tr(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[gt({r:o,c:c})]=_;c+=h}}a["!ref"]=wt(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)returnCt(e(a[0],t),t);varn=Rm.book_new();a.forEach(function(r,a){Rm.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
;}returnv}functionk(e,r,t){vara=e[0];switch(a){case3:;case4:returnw(e,r,t,a);default:thrownewError("Unsupported pre-BNC version ".concat(a));}}varS=function(e){varr="";for(++e;e;e=Math.floor((e-1)/26))r=String.fromCharCode((e-1)%26+65)+r;returnr};varB=function(e){return"".concat(S(e.c)).concat(e.r+1)};varC=function(e){returnB(e.s)+":"+B(e.e)};varT=function(){return{Sheets:{},SheetNames:[]}};var_=function(e,r,t){if(!t)for(vara=1;a<9999;++a){if(e.SheetNames.indexOf(t="Sheet ".concat(a))==-1)break}elseif(e.SheetNames.indexOf(t)>-1)for(vara=1;a<9999;++a){if(e.SheetNames.indexOf("".concat(t,"_").concat(a))==-1){t="".concat(t,"_").concat(a);break}}e.SheetNames.push(t);e.Sheets[t]=r};functiony(e){varr=[];e.FileIndex.forEach(function(e){if(!e.name.match(/\.iwa$/))return;vart;try{t=m(e.content)}catch(a){returnconsole.log("?? "+e.content.length+" "+(a.message||a))}varn;try{n=E(t)}catch(a){returnconsole.log("## "+(a.message||a))}n.forEach(function(e){r[+e.id]=e.messages})});if(!r.length)thrownewError("File has no messages");vart;r.forEach(function(e){e.forEach(function(e){varr=v(e.meta[1][0].data)>>>0;if(r==1){if(!t)t=e;elsethrownewError("Document has multiple roots")}})});if(!t)thrownewError("Cannot find Document root");returnM(r,t)}varA=y;functionI(e){varr=p(e);returnd(r[1][0].data)}functionR(e,r){vart=p(r.data);vara=v(t[1][0].data);varn=t[3];vari=[];(n||[]).forEach(function(r){vart=p(r.data);varn=v(t[1][0].data)>>>0;switch(a){case1:i[n]=c(t[3][0].data);break;case8:{vars=e[I(t[9][0].data)][0];varf=p(s.data);varl=e[I(f[1][0].data)][0];varo=v(l.meta[1][0].data);if(o!=2001)thrownewError("2000 unexpected reference to ".concat(o));varu=p(l.data);i[n]=u[3].map(function(e){returnc(e.data)}).join("")}break;}});returni}functionF(e){varr=p(e);vart=v(r[1][0].data)>>>0;vara=r[3][0].data;varn=o(r[4][0].data);vari=[];for(vars=0;s<n.byteLength/2;++s){varf=n.getUint16(s*2,true);if(f>a.length)continue;i[s]=a.subarray(f,n.getUint16(s*2+2,true))}return{R:t,cells:i}}functionD(e,r){vart=p(r.data);vara=b(t[5],F);returna.reduce(function(e,r){if(!e[r.R])e[r.R]=[];r.cells.forEach(function(t,a){if(e[r.R][a])thrownewError("Duplicate cell r=".concat(r.R," c=").concat(a));e[r.R][a]=t});returne},[])}functionO(e,r,t){vara;varn=p(r.data);vari={s:{r:0,c:0},e:{r:0,c:0}};i.e.r=(v(n[6][0].data)>>>0)-1;if(i.e.r<0)thrownewError("Invalid row varint ".concat(n[6][0].data));i.e.c=(v(n[7][0].data)>>>0)-1;if(i.e.c<0)thrownewError("Invalid col varint ".concat(n[7][0].data));t["!ref"]=C(i);{vars=p(n[4][0].data);varf=R(e,e[I(s[4][0].data)][0]);varl=((a=s[17])==null?void0:a[0])?R(e,e[I(s[17][0].data)][0]):[];{varo=p(s[3][0].data);varc=[];o[1].forEach(function(r){vart=p(r.data);vara=e[I(t[2][0].data)][0];varn=v(a.meta[1][0].data);if(n!=6002)thrownewError("6001 unexpected reference to ".concat(n));c.push({id:v(t[1][0].data),ref:D(e,a)})});c.forEach(function(e){e.ref.forEach(function(e,r){e.forEach(function(e,a){varn=B({r:r,c:a});vari=k(e,f,l);if(i)t[n]=i})})})}}}functionP(e,r){vart=p(r.data);vara={"!ref":"A1"};varn=e[I(t[2][0].data)];vari=v(n[0].meta[1][0].data);if(i!=6001)thrownewError("6000 unexpected reference to ".concat(i));O(e,n[0],a);returna}functionN(e,r){vart;vara=p(r.data);varn={name:((t=a[1])==null?void0:t[0])?c(a[1][0].data):"",sheets:[]};vari=b(a[2],I);i.forEach(function(r){e[r].forEach(function(r){vart=v(r.meta[1][0].data);if(t==6e3)n.sheets.push(P(e,r))})});returnn}functionM(e,r){vart=T();vara=p(r.data);varn=b(a[1],I);n.forEach(function(r){e[r].forEach(function(r){vara=v(r.meta[1][0].data);if(a==2){varn=N(e,r);n.sheets.forEach(function(e){_(t,e,n.name)})}})});if(t.SheetNames.length==0)thrownewError("Empty NUMBERS file");returnt}returnf(l)}();functionPb(e){returnfunctionr(t){for(vara=0;a!=e.length;++a){varn=e[a];if(t[n[0]]===undefined)t[n[0]]=n[1];if(n[2]==="n")t[n[0]]=Number(t[n[0]])}}}varNb=function(e){Pb([["cellNF",false],["cellHTML",true],["cellFormula",true],["cellStyles",false],["cellText",true],["cellDates",false],["sheetStubs",false