}returnres};exports.findCompression=function(compressionMethod){for(varmethodincompressions){if(!compressions.hasOwnProperty(method)){continue}if(compressions[method].magic===compressionMethod){returncompressions[method]}}returnnull};exports.isRegExp=function(object){returnObject.prototype.toString.call(object)==="[object RegExp]"}},{"./compressions":3,"./nodeBuffer":11,"./support":17}],22:[function(_dereq_,module,exports){"use strict";varStringReader=_dereq_("./stringReader");varNodeBufferReader=_dereq_("./nodeBufferReader");varUint8ArrayReader=_dereq_("./uint8ArrayReader");varutils=_dereq_("./utils");varsig=_dereq_("./signature");varZipEntry=_dereq_("./zipEntry");varsupport=_dereq_("./support");varjszipProto=_dereq_("./object");functionZipEntries(data,loadOptions){this.files=[];this.loadOptions=loadOptions;if(data){this.load(data)}}ZipEntries.prototype={checkSignature:function(expectedSignature){varsignature=this.reader.readString(4);if(signature!==expectedSignature){thrownewError("Corrupted zip or bug : unexpected signature "+"("+utils.pretty(signature)+", expected "+utils.pretty(expectedSignature)+")")}},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2);this.diskWithCentralDirStart=this.reader.readInt(2);this.centralDirRecordsOnThisDisk=this.reader.readInt(2);this.centralDirRecords=this.reader.readInt(2);this.centralDirSize=this.reader.readInt(4);this.centralDirOffset=this.reader.readInt(4);this.zipCommentLength=this.reader.readInt(2);this.zipComment=this.reader.readString(this.zipCommentLength);this.zipComment=jszipProto.utf8decode(this.zipComment)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8);this.versionMadeBy=this.reader.readString(2);this.versionNeeded=this.reader.readInt(2);this.diskNumber=this.reader.readInt(4);this.diskWithCentralDirStart=this.reader.readInt(4);this.centralDirRecordsOnThisDisk=this.reader.readInt(8);this.centralDirRecords=this.reader.readInt(8);this.centralDirSize=this.reader.readInt(8);this.centralDirOffset=this.reader.readInt(8);this.zip64ExtensibleData={};varextraDataSize=this.zip64EndOfCentralSize-44,index=0,extraFieldId,extraFieldLength,extraFieldValue;while(index<extraDataSize){extraFieldId=this.reader.readInt(2);extraFieldLength=this.reader.readInt(4);extraFieldValue=this.reader.readString(extraFieldLength);this.zip64ExtensibleData[extraFieldId]={id:extraFieldId,length:extraFieldLength,value:extraFieldValue}}},readBlockZip64EndOfCentralLocator:function(){this.diskWithZip64CentralDirStart=this.reader.readInt(4);this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8);this.disksCount=this.reader.readInt(4);if(this.disksCount>1){thrownewError("Multi-volumes zip are not supported")}},readLocalFiles:function(){vari,file;for(i=0;i<this.files.length;i++){file=this.files[i];this.reader.setIndex(file.localHeaderOffset);this.checkSignature(sig.LOCAL_FILE_HEADER);file.readLocalPart(this.reader);file.handleUTF8()}},readCentralDir:function(){varfile;this.reader.setIndex(this.centralDirOffset);while(this.reader.readString(4)===sig.CENTRAL_FILE_HEADER){file=newZipEntry({zip64:this.zip64},this.loadOptions);file.readCentralPart(this.reader);this.files.push(file)}},readEndOfCentral:function(){varoffset=this.reader.lastIndexOfSignature(sig.CENTRAL_DIRECTORY_END);if(offset===-1){thrownewError("Corrupted zip : can't find end of central directory")}this.reader.setIndex(offset);this.checkSignature(sig.CENTRAL_DIRECTORY_END);this.readBlockEndOfCentral();if(this.diskNumber===utils.MAX_VALUE_16BITS||this.diskWithCentralDirStart===utils.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===utils.MAX_VALUE_16BITS||this.centralDirRecords===utils.MAX_VALUE_16BITS||this.centralDirSize===utils.MAX_VALUE_32BITS||this.centralDirOffset===utils.MAX_VALUE_32BITS){this.zip64=true;offset=this.reader.lastIndexOfSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR);if(offset===-1){thrownewError("Corrupted zip : can't find the ZIP64 end of central directory locator")}this.reader.setIndex(offset);this.checkSignature(sig.ZIP64_CENTRAL_D
returnx.v});varidx=0,len=0;for(vari=0;i!==v.length;i+=2){len=+v[i+1].v;switch(v[i].v){case"Worksheets":case"工作表":case"Листы":case"ワークシート":case"גליונות עבודה":case"Arbeitsblätter":case"Çalışma Sayfaları":case"Feuilles de calcul":case"Fogli di lavoro":case"Folhas de cálculo":case"Planilhas":case"Werkbladen":p.Worksheets=len;p.SheetNames=parts.slice(idx,idx+len);break;case"Named Ranges":case"Benannte Bereiche":p.NamedRanges=len;p.DefinedNames=parts.slice(idx,idx+len);break;case"Charts":case"Diagramme":p.Chartsheets=len;p.ChartNames=parts.slice(idx,idx+len);break}idx+=len}}returnp}varEXT_PROPS_XML_ROOT=writextag("Properties",null,{xmlns:XMLNS.EXT_PROPS,"xmlns:vt":XMLNS.vt});functionwrite_ext_props(cp,opts){varo=[],p={},W=writextag;if(!cp)cp={};cp.Application="SheetJS";o[o.length]=XML_HEADER;o[o.length]=EXT_PROPS_XML_ROOT;EXT_PROPS.forEach(function(f){if(cp[f[1]]===undefined)return;varv;switch(f[2]){case"string":v=cp[f[1]];break;case"bool":v=cp[f[1]]?"true":"false";break}if(v!==undefined)o[o.length]=W(f[0],v)});o[o.length]=W("HeadingPairs",W("vt:vector",W("vt:variant","<vt:lpstr>Worksheets</vt:lpstr>")+W("vt:variant",W("vt:i4",String(cp.Worksheets))),{size:2,baseType:"variant"}));o[o.length]=W("TitlesOfParts",W("vt:vector",cp.SheetNames.map(function(s){return"<vt:lpstr>"+escapexml(s)+"</vt:lpstr>"}).join(""),{size:cp.Worksheets,baseType:"lpstr"}));if(o.length>2){o[o.length]="</Properties>";o[1]=o[1].replace("/>",">")}returno.join("")}XMLNS.CUST_PROPS="http://schemas.openxmlformats.org/officeDocument/2006/custom-properties";RELS.CUST_PROPS="http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties";varcustregex=/<[^>]+>[^<]*/g;functionparse_cust_props(data,opts){varp={},name="";varm=data.match(custregex);if(m)for(vari=0;i!=m.length;++i){varx=m[i],y=parsexmltag(x);switch(y[0]){case"<?xml":break;case"<Properties":break;case"<property":name=y.name;break;case"</property>":name=null;break;default:if(x.indexOf("<vt:")===0){vartoks=x.split(">");vartype=toks[0].substring(4),text=toks[1];switch(type){case"lpstr":case"bstr":case"lpwstr":p[name]=unescapexml(text);break;case"bool":p[name]=parsexmlbool(text,"<vt:bool>");break;case"i1":case"i2":case"i4":case"i8":case"int":case"uint":p[name]=parseInt(text,10);break;case"r4":case"r8":case"decimal":p[name]=parseFloat(text);break;case"filetime":case"date":p[name]=parseDate(text);break;case"cy":case"error":p[name]=unescapexml(text);break;default:if(opts.WTF&&typeofconsole!=="undefined")console.warn("Unexpected",x,type,toks)}}elseif(x.substr(0,2)==="</"){}elseif(opts.WTF)thrownewError(x)}}returnp}varCUST_PROPS_XML_ROOT=writextag("Properties",null,{xmlns:XMLNS.CUST_PROPS,"xmlns:vt":XMLNS.vt});functionwrite_cust_props(cp,opts){varo=[XML_HEADER,CUST_PROPS_XML_ROOT];if(!cp)returno.join("");varpid=1;keys(cp).forEach(functioncustprop(k){++pid;o[o.length]=writextag("property",write_vt(cp[k]),{fmtid:"{D5CDD505-2E9C-101B-9397-08002B2CF9AE}",pid:pid,name:k})});if(o.length>2){o[o.length]="</Properties>";o[1]=o[1].replace("/>",">")}returno.join("")}functionxlml_set_prop(Props,tag,val){switch(tag){case"Description":tag="Comments";break;case"Created":tag="CreatedDate";break;case"LastSaved":tag="ModifiedDate";break}Props[tag]=val}varXLMLDocumentProperties=[["Title","Title"],["Subject","Subject"],["Author","Author"],["Keywords","Keywords"],["Comments","Description"],["LastAuthor","LastAuthor"],["CreatedDate","Created","date"],["ModifiedDate","LastSaved","date"],["Category","Category"],["Manager","Manager"],["Company","Company"],["AppVersion","Version"]];functionxlml_write_docprops(Props){varT="DocumentProperties";varo=[];XLMLDocumentProperties.forEach(function(p){if(!Props[p[0]])return;varm=Props[p[0]];switch(p[2]){case"date":m=newDate(m).toISOString();break}o.push(writetag(p[1],m))});return"<"+T+' xmlns="'+XLMLNS.o+'">'+o.join("")+"</"+T+">"}functionxlml_write_custprops(Props,Custprops){varT="CustomDocumentProperties";varo=[];if(Props)keys(Props).forEach(function(k){if(!Props.hasOwnProperty(k))return;fo
out.flags.Extend=out.grbit.fExtend;out.flags.Sub=out.sss&2;out.flags.Sup=out.sss&1;returnout}functionparse_BrtXF(data,length){varixfeParent=data.read_shift(2);varifmt=data.read_shift(2);parsenoop(data,length-4);return{ixfe:ixfeParent,ifmt:ifmt}}functionparse_sty_bin(data,themes,opts){varstyles={};styles.NumberFmt=[];for(varyinSSF._table)styles.NumberFmt[y]=SSF._table[y];styles.CellXf=[];varstate="";varpass=false;recordhopper(data,functionhopper_sty(val,R,RT){switch(R.n){case"BrtFmt":styles.NumberFmt[val[0]]=val[1];SSF.load(val[1],val[0]);break;case"BrtFont":break;case"BrtKnownFonts":break;case"BrtFill":break;case"BrtBorder":break;case"BrtXF":if(state==="CELLXFS"){styles.CellXf.push(val)}break;case"BrtStyle":break;case"BrtDXF":break;case"BrtMRUColor":break;case"BrtIndexedColor":break;case"BrtBeginStyleSheet":break;case"BrtEndStyleSheet":break;case"BrtBeginTableStyle":break;case"BrtTableStyleElement":break;case"BrtEndTableStyle":break;case"BrtBeginFmts":state="FMTS";break;case"BrtEndFmts":state="";break;case"BrtBeginFonts":state="FONTS";break;case"BrtEndFonts":state="";break;case"BrtACBegin":state="ACFONTS";break;case"BrtACEnd":state="";break;case"BrtBeginFills":state="FILLS";break;case"BrtEndFills":state="";break;case"BrtBeginBorders":state="BORDERS";break;case"BrtEndBorders":state="";break;case"BrtBeginCellStyleXFs":state="CELLSTYLEXFS";break;case"BrtEndCellStyleXFs":state="";break;case"BrtBeginCellXFs":state="CELLXFS";break;case"BrtEndCellXFs":state="";break;case"BrtBeginStyles":state="STYLES";break;case"BrtEndStyles":state="";break;case"BrtBeginDXFs":state="DXFS";break;case"BrtEndDXFs":state="";break;case"BrtBeginTableStyles":state="TABLESTYLES";break;case"BrtEndTableStyles":state="";break;case"BrtBeginColorPalette":state="COLORPALETTE";break;case"BrtEndColorPalette":state="";break;case"BrtBeginIndexedColors":state="INDEXEDCOLORS";break;case"BrtEndIndexedColors":state="";break;case"BrtBeginMRUColors":state="MRUCOLORS";break;case"BrtEndMRUColors":state="";break;case"BrtFRTBegin":pass=true;break;case"BrtFRTEnd":pass=false;break;case"BrtBeginStyleSheetExt14":break;case"BrtBeginSlicerStyles":break;case"BrtEndSlicerStyles":break;case"BrtBeginTimelineStylesheetExt15":break;case"BrtEndTimelineStylesheetExt15":break;case"BrtBeginTimelineStyles":break;case"BrtEndTimelineStyles":break;case"BrtEndStyleSheetExt14":break;default:if(!pass||opts.WTF)thrownewError("Unexpected record "+RT+" "+R.n)}});returnstyles}functionwrite_sty_bin(data,opts){varba=buf_array();write_record(ba,"BrtBeginStyleSheet");write_record(ba,"BrtEndStyleSheet");returnba.end()}RELS.THEME="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme";functionparse_clrScheme(t,themes,opts){themes.themeElements.clrScheme=[];varcolor={};(t[0].match(tagregex)||[]).forEach(function(x){vary=parsexmltag(x);switch(y[0]){case"<a:clrScheme":case"</a:clrScheme>":break;case"<a:srgbClr":color.rgb=y.val;break;case"<a:sysClr":color.rgb=y.lastClr;break;case"<a:dk1>":case"</a:dk1>":case"<a:dk2>":case"</a:dk2>":case"<a:lt1>":case"</a:lt1>":case"<a:lt2>":case"</a:lt2>":case"<a:accent1>":case"</a:accent1>":case"<a:accent2>":case"</a:accent2>":case"<a:accent3>":case"</a:accent3>":case"<a:accent4>":case"</a:accent4>":case"<a:accent5>":case"</a:accent5>":case"<a:accent6>":case"</a:accent6>":case"<a:hlink>":case"</a:hlink>":case"<a:folHlink>":case"</a:folHlink>":if(y[0][1]==="/"){themes.themeElements.clrScheme.push(color);color={}}else{color.name=y[0].substring(3,y[0].length-1)}break;default:if(opts&&opts.WTF)thrownewError("Unrecognized "+y[0]+" in clrScheme")}})}functionparse_fontScheme(t,themes,opts){}functionparse_fmtScheme(t,themes,opts){}varclrsregex=/<a:clrScheme([^>]*)>[^\u2603]*<\/a:clrScheme>/;varfntsregex=/<a:fontScheme([^>]*)>[^\u2603]*<\/a:fontScheme>/;varfmtsregex=/<a:fmtScheme([^>]*)>[^\u2603]*<\/a:fmtScheme>/;functionparse_themeElements(data,themes,opts){themes.themeElements={};vart;[["clrScheme",clrsregex,parse_clrScheme],["fontScheme",fntsregex,parse_fontScheme],["fmtScheme",fmtsregex,parse_fmtScheme]].forEach(function(m){if(!
z.name=parse_XLWideString(data);returnz}functionwrite_BrtBundleSh(data,o){if(!o)o=new_buf(127);o.write_shift(4,data.Hidden);o.write_shift(4,data.iTabID);write_RelID(data.strRelID,o);write_XLWideString(data.name.substr(0,31),o);returno.length>o.l?o.slice(0,o.l):o}functionparse_BrtWbProp(data,length){data.read_shift(4);vardwThemeVersion=data.read_shift(4);varstrName=length>8?parse_XLWideString(data):"";return[dwThemeVersion,strName]}functionwrite_BrtWbProp(data,o){if(!o)o=new_buf(68);o.write_shift(4,0);o.write_shift(4,0);write_XLSBCodeName("ThisWorkbook",o);returno.slice(0,o.l)}functionparse_BrtFRTArchID$(data,length){varo={};data.read_shift(4);o.ArchID=data.read_shift(4);data.l+=length-8;returno}functionparse_BrtName(data,length,opts){varend=data.l+length;varflags=data.read_shift(4);varchKey=data.read_shift(1);varitab=data.read_shift(4);varname=parse_XLNameWideString(data);varformula=parse_XLSBNameParsedFormula(data,0,opts);varcomment=parse_XLNullableWideString(data);data.l=end;return{Name:name,Ptg:formula,Comment:comment}}functionparse_wb_bin(data,opts){varwb={AppVersion:{},WBProps:{},WBView:[],Sheets:[],CalcPr:{},xmlns:""};varpass=false,z;if(!opts)opts={};opts.biff=12;varNames={},NameList=[];recordhopper(data,functionhopper_wb(val,R){switch(R.n){case"BrtBundleSh":wb.Sheets.push(val);break;case"BrtName":Names[val.Name]=val;NameList.push(val.Name);break;case"BrtBeginBook":break;case"BrtFileVersion":break;case"BrtWbProp14":case"BrtWbProp":break;case"BrtACBegin":break;case"BrtAbsPath15":break;case"BrtACEnd":break;case"BrtWbFactoid":break;case"BrtBookProtection":break;case"BrtBeginBookViews":break;case"BrtBookView":break;case"BrtEndBookViews":break;case"BrtBeginBundleShs":break;case"BrtEndBundleShs":break;case"BrtBeginFnGroup":break;case"BrtEndFnGroup":break;case"BrtBeginExternals":break;case"BrtSupSelf":break;case"BrtSupBookSrc":break;case"BrtExternSheet":break;case"BrtEndExternals":break;case"BrtCalcProp":break;case"BrtUserBookView":break;case"BrtBeginPivotCacheIDs":break;case"BrtBeginPivotCacheID":break;case"BrtEndPivotCacheID":break;case"BrtEndPivotCacheIDs":break;case"BrtWebOpt":break;case"BrtFileRecover":break;case"BrtFileSharing":break;case"BrtBeginSmartTagTypes":break;case"BrtSmartTagType":break;case"BrtEndSmartTagTypes":break;case"BrtFRTBegin":pass=true;break;case"BrtFRTArchID$":break;case"BrtWorkBookPr15":break;case"BrtFRTEnd":pass=false;break;case"BrtEndBook":break;default:if(!pass||opts.WTF)thrownewError("Unexpected record "+R.n)}},opts);parse_wb_defaults(wb);Names["!names"]=NameList;wb.Names=Names;returnwb}functionwrite_BUNDLESHS(ba,wb,opts){write_record(ba,"BrtBeginBundleShs");for(varidx=0;idx!=wb.SheetNames.length;++idx){varviz=wb.Workbook&&wb.Workbook.Sheets&&wb.Workbook.Sheets[idx]&&wb.Workbook.Sheets[idx].Hidden||0;vard={Hidden:viz,iTabID:idx+1,strRelID:"rId"+(idx+1),name:wb.SheetNames[idx]};write_record(ba,"BrtBundleSh",write_BrtBundleSh(d))}write_record(ba,"BrtEndBundleShs")}functionwrite_BrtFileVersion(data,o){if(!o)o=new_buf(127);for(vari=0;i!=4;++i)o.write_shift(4,0);write_XLWideString("SheetJS",o);write_XLWideString(XLSX.version,o);write_XLWideString(XLSX.version,o);write_XLWideString("7262",o);o.length=o.l;returno.length>o.l?o.slice(0,o.l):o}functionwrite_BrtBookView(idx,o){if(!o)o=new_buf(29);o.write_shift(-4,0);o.write_shift(-4,460);o.write_shift(4,28800);o.write_shift(4,17600);o.write_shift(4,500);o.write_shift(4,idx);o.write_shift(4,idx);varflags=120;o.write_shift(1,flags);returno.length>o.l?o.slice(0,o.l):o}functionwrite_BOOKVIEWS(ba,wb,opts){if(!wb.Workbook||!wb.Workbook.Sheets)return;varsheets=wb.Workbook.Sheets;vari=0,vistab=-1,hidden=-1;for(;i<sheets.length;++i){if(!sheets[i]||!sheets[i].Hidden&&vistab==-1)vistab=i;elseif(sheets[i].Hidden==1&&hidden==-1)hidden=i}if(hidden>vistab)return;write_record(ba,"BrtBeginBookViews");write_record(ba,"BrtBookView",write_BrtBookView(vistab));write_record(ba,"BrtEndBookViews")}functionwrite_BrtCalcProp(data,o){if(!o)o=new_buf(26);o.write_shift(4,0);o.write_shift(4,1);o.write_shift(4,0);write_Xnum(0,o);o.write_shif
if(array_formulae[afi][0].s.r!=cell.r)deleteline.f;if(line.f)line.f=""+stringify_formula(array_formulae[afi][1],range,cell,supbooks,opts);break}}if(options.sheetRows&&lastcell.r>=options.sheetRows)cell_valid=false;elseout[last_cell]=line};varopts={enc:false,sbcch:0,snames:[],sharedf:shared_formulae,arrayf:array_formulae,rrtabid:[],lastuser:"",biff:8,codepage:0,winlocked:0,cellStyles:!!options&&!!options.cellStyles,WTF:!!options&&!!options.wtf};if(options.password)opts.password=options.password;varmergecells=[];varobjects=[];varcolinfo=[],rowinfo=[];vardefwidth=0,defheight=0;varseencol=false;varsupbooks=[[]];varsbc=0,sbci=0,sbcli=0;supbooks.SheetNames=opts.snames;supbooks.sharedf=opts.sharedf;supbooks.arrayf=opts.arrayf;varlast_Rn="";varfile_depth=0;varBIFF2Fmt=0;opts.codepage=1200;set_cp(1200);while(blob.l<blob.length-1){vars=blob.l;varRecordType=blob.read_shift(2);if(RecordType===0&&last_Rn==="EOF")break;varlength=blob.l===blob.length?0:blob.read_shift(2),y;varR=XLSRecordEnum[RecordType];if(R&&R.f){if(options.bookSheets){if(last_Rn==="BoundSheet8"&&R.n!=="BoundSheet8")break}last_Rn=R.n;if(R.r===2||R.r==12){varrt=blob.read_shift(2);length-=2;if(!opts.enc&&rt!==RecordType)throw"rt mismatch";if(R.r==12){blob.l+=10;length-=10}}varval;if(R.n==="EOF")val=R.f(blob,length,opts);elseval=slurp(R,blob,length,opts);varRn=R.n;switch(Rn){case"Date1904":wb.opts.Date1904=val;break;case"WriteProtect":wb.opts.WriteProtect=true;break;case"FilePass":if(!opts.enc)blob.l=0;opts.enc=val;if(opts.WTF)console.error(val);if(!options.password)thrownewError("File is password-protected");if(val.Type!==0)thrownewError("Encryption scheme unsupported");if(!val.valid)thrownewError("Password is incorrect");break;case"WriteAccess":opts.lastuser=val;break;case"FileSharing":break;case"CodePage":if(val===21010)val=1200;elseif(val===32769)val=1252;opts.codepage=val;set_cp(val);break;case"RRTabId":opts.rrtabid=val;break;case"WinProtect":opts.winlocked=val;break;case"Template":break;case"RefreshAll":wb.opts.RefreshAll=val;break;case"BookBool":break;case"UsesELFs":break;case"MTRSettings":break;case"CalcCount":wb.opts.CalcCount=val;break;case"CalcDelta":wb.opts.CalcDelta=val;break;case"CalcIter":wb.opts.CalcIter=val;break;case"CalcMode":wb.opts.CalcMode=val;break;case"CalcPrecision":wb.opts.CalcPrecision=val;break;case"CalcSaveRecalc":wb.opts.CalcSaveRecalc=val;break;case"CalcRefMode":opts.CalcRefMode=val;break;case"Uncalced":break;case"ForceFullCalculation":wb.opts.FullCalc=val;break;case"WsBool":break;case"XF":XFs.push(val);break;case"ExtSST":break;case"BookExt":break;case"RichTextStream":break;case"BkHim":break;case"SupBook":supbooks[++sbc]=[val];sbci=0;break;case"ExternName":supbooks[sbc][++sbci]=val;break;case"Index":break;case"Lbl":supbooks[0][++sbcli]=val;break;case"ExternSheet":supbooks[sbc]=supbooks[sbc].concat(val);sbci+=val.length;break;case"Protect":out["!protect"]=val;break;case"Password":if(val!==0&&opts.WTF)console.error("Password verifier: "+val);break;case"Prot4Rev":case"Prot4RevPass":break;case"BoundSheet8":{Directory[val.pos]=val;opts.snames.push(val.name)}break;case"EOF":{if(--file_depth)break;if(range.e){if(range.e.r>0&&range.e.c>0){range.e.r--;range.e.c--;out["!ref"]=encode_range(range);range.e.r++;range.e.c++}if(mergecells.length>0)out["!merges"]=mergecells;if(objects.length>0)out["!objects"]=objects;if(colinfo.length>0)out["!cols"]=colinfo;if(rowinfo.length>0)out["!rows"]=rowinfo;Workbook.Sheets.push(wsprops)}if(cur_sheet==="")Preamble=out;elseSheets[cur_sheet]=out;out={}}break;case"BOF":{if(opts.biff!==8){}elseif(RecordType===9)opts.biff=2;elseif(RecordType===521)opts.biff=3;elseif(RecordType===1033)opts.biff=4;elseif(val.BIFFVer===1280)opts.biff=5;elseif(val.BIFFVer===1536)opts.biff=8;elseif(val.BIFFVer===2)opts.biff=2;elseif(val.BIFFVer===7)opts.biff=2;if(file_depth++)break;cell_valid=true;out={};if(opts.biff<5){if(cur_sheet==="")cur_sheet="Sheet1";range={s:{r:0,c:0},e:{r:0,c:0}};varfakebs8={pos:blob.l-length,name:cur_sheet};Directory[fakebs8.pos]=fakebs8;opts.snames.push(cur_sheet)}elsecur_sheet=(
r=safe_decode_range(sheet["!ref"]);r.s.r=range;break;default:r=range}if(header>0)offset=0;varrr=encode_row(r.s.r);varcols=newArray(r.e.c-r.s.c+1);varout=newArray(r.e.r-r.s.r-offset+1);varouti=0;for(C=r.s.c;C<=r.e.c;++C){cols[C]=encode_col(C);val=sheet[cols[C]+rr];switch(header){case1:hdr[C]=C;break;case2:hdr[C]=cols[C];break;case3:hdr[C]=o.header[C-r.s.c];break;default:if(val==null)continue;vv=v=format_cell(val,null,o);varcounter=0;for(varCC=0;CC<hdr.length;++CC)if(hdr[CC]==vv)vv=v+"_"+++counter;hdr[C]=vv}}for(R=r.s.r+offset;R<=r.e.r;++R){rr=encode_row(R);isempty=true;if(header===1)row=[];else{row={};if(Object.defineProperty)try{Object.defineProperty(row,"__rowNum__",{value:R,enumerable:false})}catch(e){row.__rowNum__=R}elserow.__rowNum__=R}for(C=r.s.c;C<=r.e.c;++C){val=sheet[cols[C]+rr];if(val===undefined||val.t===undefined){if(defval===undefined)continue;if(hdr[C]!=null){row[hdr[C]]=defval;isempty=false}continue}v=val.v;switch(val.t){case"z":if(v==null)break;continue;case"e":continue;case"s":case"d":case"b":case"n":break;default:thrownewError("unrecognized type "+val.t)}if(hdr[C]!=null){if(v==null){if(defval!==undefined)row[hdr[C]]=defval;elseif(raw&&v===null)row[hdr[C]]=null;elsecontinue}else{row[hdr[C]]=raw?v:format_cell(val,v,o)}isempty=false}}if(isempty===false||(header===1?o.blankrows!==false:!!o.blankrows))out[outi++]=row}out.length=outi;returnout}functionsheet_to_csv(sheet,opts){varout="",txt="",qreg=/"/g;varo=opts==null?{}:opts;if(sheet==null||sheet["!ref"]==null)return"";varr=safe_decode_range(sheet["!ref"]);varFS=o.FS!==undefined?o.FS:",",fs=FS.charCodeAt(0);varRS=o.RS!==undefined?o.RS:"\n",rs=RS.charCodeAt(0);varendregex=newRegExp((FS=="|"?"\\|":FS)+"+$");varrow="",rr="",cols=[];vari=0,cc=0,val;varR=0,C=0;for(C=r.s.c;C<=r.e.c;++C)cols[C]=encode_col(C);for(R=r.s.r;R<=r.e.r;++R){varisempty=true;row="";rr=encode_row(R);for(C=r.s.c;C<=r.e.c;++C){val=sheet[cols[C]+rr];if(val==null)txt="";elseif(val.v!=null){isempty=false;txt=""+format_cell(val,null,o);for(i=0,cc=0;i!==txt.length;++i)if((cc=txt.charCodeAt(i))===fs||cc===rs||cc===34){txt='"'+txt.replace(qreg,'""')+'"';break}}elseif(val.f!=null&&!val.F){isempty=false;txt="="+val.f;if(txt.indexOf(",")>=0)txt='"'+txt.replace(qreg,'""')+'"'}elsetxt="";row+=(C===r.s.c?"":FS)+txt}if(o.blankrows===false&&isempty)continue;if(o.strip)row=row.replace(endregex,"");out+=row+RS}returnout}varmake_csv=sheet_to_csv;functionsheet_to_formulae(sheet){vary="",x,val="";if(sheet==null||sheet["!ref"]==null)return[];varr=safe_decode_range(sheet["!ref"]),rr="",cols=[],C;varcmds=newArray((r.e.r-r.s.r+1)*(r.e.c-r.s.c+1));vari=0;for(C=r.s.c;C<=r.e.c;++C)cols[C]=encode_col(C);for(varR=r.s.r;R<=r.e.r;++R){rr=encode_row(R);for(C=r.s.c;C<=r.e.c;++C){y=cols[C]+rr;x=sheet[y];val="";if(x===undefined)continue;elseif(x.F!=null){y=x.F;if(!x.f)continue;val=x.f;if(y.indexOf(":")==-1)y=y+":"+y}if(x.f!=null)val=x.f;elseif(x.t=="z")continue;elseif(x.t=="n"&&x.v!=null)val=""+x.v;elseif(x.t=="b")val=x.v?"TRUE":"FALSE";elseif(x.w!==undefined)val="'"+x.w;elseif(x.v===undefined)continue;elseif(x.t=="s")val="'"+x.v;elseval=""+x.v;cmds[i++]=y+"="+val}}cmds.length=i;returncmds}varutils={encode_col:encode_col,encode_row:encode_row,encode_cell:encode_cell,encode_range:encode_range,decode_col:decode_col,decode_row:decode_row,split_cell:split_cell,decode_cell:decode_cell,decode_range:decode_range,format_cell:format_cell,get_formulae:sheet_to_formulae,make_csv:sheet_to_csv,make_json:sheet_to_json,make_formulae:sheet_to_formulae,aoa_to_sheet:aoa_to_sheet,table_to_sheet:parse_dom_table,table_to_book:table_to_book,sheet_to_csv:sheet_to_csv,sheet_to_json:sheet_to_json,sheet_to_formulae:sheet_to_formulae,sheet_to_row_object_array:sheet_to_json};XLSX.parse_xlscfb=parse_xlscfb;XLSX.parse_ods=parse_ods;XLSX.parse_fods=parse_fods;XLSX.write_ods=write_ods;XLSX.parse_zip=parse_zip;XLSX.read=readSync;XLSX.readFile=readFileSync;XLSX.readFileSync=readFileSync;XLSX.write=writeSync;XLSX.writeFile=writeFileSync;XLSX.writeFileSync=writeFileSync;XLSX.writeFileAsync=writeFileAsync;XLSX.u