{"version":3,"sources":["../node_modules/xlsx/xlsx.mjs"],"names":["$cptable","XLSX","current_codepage","current_ansi","VALID_ANSI","CS2CP","set_ansi","cp","indexOf","set_cp","reset_cp","char_codes","data","o","i","len","length","charCodeAt","utf16leread","String","fromCharCode","join","utf16beread","debom","c1","c2","slice","_getchar","x","_getansi","DENSE","Base64_map","Base64_encode","input","c3","e1","e2","e3","e4","isNaN","charAt","Base64_decode","replace","has_buf","Buffer","process","versions","node","Buffer_from","nbfs","from","e","buf","enc","bind","buf_utf16le","toString","new_raw_buf","alloc","Uint8Array","Array","new_unsafe_buf","allocUnsafe","s2a","s","split","map","a2s","isArray","c","ab2a","ArrayBuffer","Error","bconcat","bufs","concat","isBuffer","maxlen","set","apply","call","chr0","chr1","_strrev","pad0","v","d","t","fill","pad_","rpad_","p2_32","Math","pow","pad0r","round","pad0r1","pad0r2","SSF_isgeneral","days","months","table_fmt","SSF_default_map","SSF_default_str","SSF_frac","D","mixed","sgn","B","P_2","P_1","P","Q_2","Q_1","Q","A","floor","q","SSF_parse_date_code","opts","b2","date","toPrecision","m","n","Number","SSF_normalize_xl_unsafe","time","dow","dout","out","T","u","y","H","M","S","abs","date1904","Date","setDate","getDate","getFullYear","getMonth","getDay","SSF_fix_hijri","SSF_strip_decimal","SSF_general_num","isFinite","V","log","LOG10E","w","toFixed","toExponential","SSF_small_exp","substr","SSF_large_exp","SSF_normalize_exp","toUpperCase","SSF_general","SSF_format","datenum","SSF_write_date","type","fmt","val","ss0","ss","tt","outl","commaify","j","pct1","write_num_exp","idx","match","period","ee","fakee","$$","$1","$2","$3","frac1","dec1","closeparen","phone","hashq","str","cc","rnd","dd","dec","_frac","write_num_flt","ffmt","write_num","write_num_cm","sfmt","mul","write_num_pct","r","ri","ff","aval","sign","den","parseInt","rr","base","myn","myd","write_num_f1","carry","oa","min","max","lres","rres","flr","write_num_exp2","write_num_int","write_num_cm2","write_num_pct2","write_num_f2","lastIndexOf","SSF_abstime","fmt_is_date","cfregex2","chkcond","thresh","parseFloat","choose_fmt","f","in_str","SSF_split_fmt","l","lat","m1","m2","dateNF","table","flen","dt","lst","hr","toLowerCase","ssm","_dt","bt","jj","nstr","myv","ostr","vv","decpt","lasti","retval","eval_fmt","SSF_load","undefined","make_ssf","SSFImplicit","dateNFregex","bad_formats","SSF__load","_fs","CRC32","version","T0","Int32Array","signed_crc_table","TT","subarray","slice_by_16_tables","T1","T2","T3","T4","T5","T6","T7","T8","T9","Ta","Tb","Tc","Td","Te","Tf","bstr","seed","C","L","CFB","fs","exports","dirname","p","filename","write_dos_date","hms","getHours","getMinutes","getSeconds","write_shift","ymd","parse_extra_field","blob","prep_blob","flags","read_shift","sz","tgt","mtime","atime","ctime","mt","sz1","sz2","usz","csz","get_fs","parse","file","options","parse_zip","root","di","row","test","mboundary","boundary","FileIndex","FullPaths","init_cfb","start_di","fcnt","line","parse_mime","parse_mad","mver","nmfs","difat_sec_cnt","dir_start","minifat_start","difat_start","ssz","fat_addrs","mv","chk","HEADER_SIGNATURE","check_get_mver","header","shift","check_shifts","dir_cnt","sectors","nsectors","ceil","sectorify","sleuth_fat","sector_list","sl","chkd","buf_chain","modulus","k","seen","push","addr","__readInt32LE","nodes","__toBuffer","make_sector_list","name","ENDOFCHAIN","Paths","files","mini","minifat_store","pl","sector","namelen","__utf16le","color","R","clsid","state","start","size","ct","read_date","storage","get_sector_list","content","get_mfat_entry","read_directory","FI","FP","dad","build_full_paths","raw","entry","payload","MSSZ","new_buf","cnt","offset","__readUInt32LE","cfb","CLSID","nm","find","rebuild_cfb","seed_cfb","gc","_file","pop","now","fullPaths","Object","create","HEADER_CLSID","sort","Z","namecmp","elt","_write","_opts","fileType","fp","fi","ca","cstr","dispcnt","csl","qp","get_content_type","write_quoted_printable","write_base64_76","write_mad","cdirs","method","compression","start_cd","crcs","sz_cd","namebuf","outbuf","_deflateRawSync","write_zip","mini_size","fat_size","mfat_cnt","fat_base","fat_cnt","difat_cnt","HEADER_SIG","chainit","consts","DIFSECT","FATSECT","_nm","copy","_zlib","MAXREGSECT","FREESECT","HEADER_MINOR_VERSION","MAXREGSID","NOSTREAM","EntryTypes","deflateRawSync","_deflate","CLEN_ORDER","LEN_LN","DST_LN","bit_swap_8","use_typed_arrays","bitswap8","bit_swap_n","b","rev","read_bits_2","bl","h","read_bits_3","read_bits_5","read_bits_7","read_bits_n","write_bits_3","write_bits_1","write_bits_8","write_bits_16","realloc","a","zero_fill_array","build_tree","clens","cmap","MAX","ccode","bl_count","Uint16Array","ctree","cleni","fix_lmap","fix_dmap","dlens","_deflateRaw","DST_LN_RE","LEN_LN_RE","boff","write_stored","addrs","hash","mlen","len_eb","dst_eb","write_huff_fixed","off","dyn_lmap","dyn_dmap","dyn_cmap","dyn_len_1","dyn_len_2","dyn","_HLIT","_HDIST","_HCLEN","read_bits_4","next_code","hcodes","h1","h2","_inflate","woff","OL","max_len_1","max_len_2","bits","code","dst","inflate","warn_or_throw","wrn","msg","efsz","fcsz","EF","parse_local_file","meth","setMilliseconds","setFullYear","setMonth","setHours","setMinutes","setSeconds","parse_dos_date","_csz","_usz","ef","InflRaw","InflateRaw","_processChunk","_finishFlushFlag","bytesRead","_inflateRawSync","cfb_add","unsafe","ContentTypeMap","ctype","ext","text","encoded","si","end","tmp","fdata","fname","cte","trim","oi","parse_quoted_printable","fpath","utils","cfb_gc","path","UCFullPaths","UCPaths","UCPath","read","readFileSync","read_file","write","writeFileSync","writeFile","cfb_new","cfb_del","splice","cfb_mov","old_name","new_name","ReadShift","CheckField","use_zlib","zlib","_inflateRaw","keys","ks","o2","prototype","hasOwnProperty","evert","obj","K","dnthresh","UTC","dnthresh1","dnthresh2","res","getTime","numdate","setTime","parse_isodur","sec","pdre1","pdre2","pdre3","parseDate","cc2str","arr","debomit","utf8write","TextDecoder","decode","dup","JSON","stringify","fuzzynum","NaN","wt","FDRE1","FDRE2","FDISO","utc_append_works","valueOf","lower_months","fuzzydate","local_to_utc","lower","lnos","fuzzytime1","fuzzytime2","getYear","split_regex","safe_split_regex","re","def","utc_to_local","utc","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","local","getMilliseconds","remove_doctype","index","str_match_ng","ei","str_remove_ng","last","xml_boundary","str_match_xml","tag","sf","et","str_match_xml_ns","str_match_xml_ns_cache","RegExp","lastIndex","exec","str_match_xml_ns_g","str_remove_xml_ns_g","str_remove_xml_ns_cache","str_match_xml_ig","getdatastr","asNodeBuffer","asBinary","_data","getContent","getdatabin","safegetzipfile","zip","g","getzipfile","getzipdata","safe","getzipstr","getzipbin","zipentries","zip_add_file","widx","ridx","utf8decode","zip_read","resolve_path","result","target","step","XML_HEADER","attregexg","tagregex1","tagregex","nsregex","nsregex2","parsexmltag","skip_root","skip_LC","z","eq","quot","parsexmltagraw","strip_ns","encodings","rencoding","unescapexml","encregex","coderegex","raw_unescapexml","xlsx","decregex","htmlcharegex","escapehtml","xlml_fixstr","entregex","entrepl","parsexmlbool","value","utf8reada","orig","utf8readb","ww","utf8readc","utf8corpus","utf8read","htmldecode","entities","vtvregex","vtmregex","parseVector","matches","baseType","WTF","forEach","wtregex","wxt_helper","writextag","xlml_normalize","xlmlregex","XMLNS","XMLNS_main","___toBuffer","___utf16le","__readUInt16LE","___hexlify","__hexlify","___utf8","__readUInt8","__utf8","___lpstr","__lpstr","___cpstr","__cpstr","___lpwstr","__lpwstr","___lpp4","__lpp4","___8lpp4","__8lpp4","___double","Infinity","read_double_le","__double","is_buf","cpdoit","readUInt32LE","readDoubleLE","__readInt16LE","__readInt32BE","oI","oR","loc","oo","this","lens","__writeUInt16LE","WriteShift","cpp","encode","__writeUInt32LE","bs","av","LN2","write_double_le","__writeInt32LE","hexstr","fld","pos","parsenoop","recordhopper","cb","tmpbyte","cntbyte","RT","XLSBRecordEnum","buf_array","blksz","newblk","curbuf","endbuf","next","_bufs","end2","shift_cell_xls","cell","cRel","rRel","biff","shift_range_xls","range","encode_cell_xls","encode_cell","fix_row","encode_range_xls","encode_row","encode_col","decode_row","rowstr","decode_col","colstr","col","decode_cell","decode_range","encode_range","cs","ce","formula_quote_sheet_name","sname","safe_decode_range","safe_format_cell","XF","numFmtId","format_cell","BErr","sheet_to_workbook","sheet","sheets","SheetNames","Sheets","sheet_add_aoa","_ws","dense","ws","_R","_C","origin","_origin","_range","__R","data_R","__C","nullError","sheetStubs","cellDates","cell_ref","aoa_to_sheet","parse_XLWideString","cchCharacters","parse_StrRun","ich","ifnt","parse_RichStr","rgsStrRun","dwSizeStrRun","parse_BrtCommentText","parse_XLSBCell","iStyleRef","parse_XLSBShortCell","parse_XLSBCodeName","parse_XLNullableWideString","parse_XLNameWideString","parse_RelID","parse_RkNumber","fX100","fInt","RK","parse_RfX","parse_UncheckedRfX","parse_Xnum","parse_ClipboardFormatOrString","VT_STRING","VT_CUSTOM","DocSummaryPIDDSI","SummaryPIDSI","CountryEnum","XLSFillPattern","rgbify","XLSIcv","RBErr","XLSLblBuiltIn","ct2type","RELS","WB","SHEET","HLINK","VML","XPATH","XMISS","XLINK","CXML","CXMLP","CMNT","CORE_PROPS","EXT_PROPS","CUST_PROPS","SST","STY","THEME","CHART","CHARTEX","CS","WS","DS","MS","IMG","DRAW","XLMETA","TCMNT","PEOPLE","CONN","VBA","get_rels_path","parse_rels","currentFilePath","rels","rel","Type","Target","Id","TargetMode","canonictarget","parse_core_props","cur","load_props_pairs","HP","TOP","props","hp","parts","Worksheets","NamedRanges","DefinedNames","Chartsheets","ChartNames","custregex","evert_XLMLDPM","XLMLDocPropsMap","Title","Subject","Author","Keywords","Comments","LastAuthor","RevNumber","Application","LastPrinted","CreatedDate","ModifiedDate","Category","Manager","Company","AppVersion","ContentStatus","Identifier","Language","xlml_set_prop","Props","parse_FILETIME","dwLowDateTime","dwHighDateTime","toISOString","parse_VtStringBase","stringType","pad","parse_lpwstr","parse_lpstr","parse_VtString","parse_VtHeadingPair","headingString","parse_TypedPropertyValue","parse_dictionary","CodePage","dict","pid","parse_BLOB","bytes","ret","Size","parse_ClipboardData","parse_VtUnalignedString","cElements","parse_VtVecHeadingPairValue","parse_VtVecLpwstrValue","parse_VtVecUnalignedLpstrValue","parse_PropertySet","PIDSI","start_addr","NumProps","Dictionary","DictObj","PropID","Offset","PropH","fail","piddsi","oldpos","parsebool","parse_PropertySetStream","NumSets","FMTID0","FMTID1","Offset0","Offset1","SystemIdentifier","PSet1","PSet0","rval","FMTID","parsenoop2","parseuint16","parseuint16a","parslurp","parse_Bes","parse_ShortXLUnicodeString","cch","encoding","parse_XLUnicodeRichExtendedString","cbExtRst","fExtSt","fRichSt","width","cRun","parse_XLUnicodeStringNoCch","parse_XLUnicodeString","parse_XLUnicodeString2","parse_HyperlinkMoniker","extra","url","parse_URLMoniker","cAnti","preamble","ansiPath","parse_FileMoniker","parse_HyperlinkString","parse_LongRGBA","parse_LongRGB","parse_XLSCell","ixfe","parse_XTI","parse_RkRec","parse_Ref8U","rwFirst","rwLast","parse_RefU","parse_Ref","parse_FtCmo","ot","id","parse_FtSkip","FtTab","cf","fSharedNote","parse_BOF","BIFFVer","parse_DefaultRowHeight","miyRw","Unsynced","DyZero","ExAsc","ExDsc","parse_BIFF2Format","parse_Dimensions","parse_XLHeaderFooter","parse_ExternName","body","fBuiltIn","fWantAdvise","fWantPict","fOle","fOleLink","fIcon","sbcch","udfName","parse_AddinUdf","Name","parse_Lbl","chKey","cce","itab","npflen","rgce","rgcb","parse_Rgce","parse_RgbExtra","parse_NameParsedFormula","parse_ExternSheet","parse_BIFF5ExternSheet","parse_Array","ref","parse_ArrayParsedFormula","parse_BIFF5OT","cchName","parse_ColInfo","cellStyles","colFirst","colLast","coldx","level","parse_Blank","parse_Scl","parse_String","DBF_SUPPORTED_VERSIONS","DBF","dbf_codepage_map","dbf_reverse_map","dbf_to_sheet","ft","memo","vfp","l7","nrow","fpos","rlen","current_cp","codepage","fields","field","hend","hi","lo","sheetRows","dbf_to_aoa","wch","_RLEN","to_workbook","bookType","to_sheet","from_sheet","old_cp","ba","aoa","sheet_to_json","headers","cols","hcnt","coltypes","colwidths","coldecimals","guess","_guess","hf","_f","hb","rout","_n","_l","_s","SYLK","sylk_escapes","AA","BA","CA","DA","HA","JA","AE","BE","CE","HE","AI","BI","CI","HI","AO","BO","CO","DO","HO","AU","BU","CU","HU","Aa","Ba","Ca","Da","Ha","Ja","Ae","Be","Ce","He","Ai","Bi","Ci","Hi","Ao","Bo","Co","Do","Ho","Au","Bu","Cu","Hu","KC","Kc","DN","Dn","Hy","sylk_char_regex","sylk_char_fn","_","decode_sylk_char","newcc","sylk_to_aoa_str","records","rj","formats","next_cell_format","sht","rowinfo","colinfo","cw","Mval","wb","Workbook","WBProps","Names","rstr","record","d1904","nn","Sheet","Ref","rc_to_a1","C_seen_K","C_seen_X","C_seen_S","C_seen_E","formula","cell_t","cmnt","cellText","shrbase","shift_formula_str","F_seen","hidden","hpt","hpx","pt2px","process_col","write_ws_cell_sylk","F","a1_to_rc","write_ws_cmnt_sylk","aoasht","sylk_to_aoa","outwb","_formats","RS","ifmt","rec","wpx","width2px","px2char","rows","px2pt","write_ws_rows_sylk","DIF","dif_to_aoa_str","metadata","dif_to_sheet","dif_to_aoa","make_value","make_value_str","ETH","eth_to_sheet","eth_to_aoa","sep","meta","sheet_to_eth_data","coord","PRN","set_text_arr","guess_seps","guess_sep_weights","guess_sep","instr","dsv_to_sheet_str","FS","sepcc","startcc","_re","dateNF_regex","finish_cell","news","Y","datestr","timestr","dateNF_fix","cellNF","outer","prn_to_sheet_str","lines","prn_to_aoa_str","prn_to_sheet","firstbyte","WK_","lotushopper","Enum","WK1Enum","LOTUS_DATE_FMTS","lotus_to_workbook_buf","next_n","sidx","snames","realnames","sdata","refguess","lastcell","FMTS","QPWNFTable","book_append_sheet","CC","fmtidx","delta","newcell","parse_qpw_str","qpw_to_workbook_buf","vers","qpro","works","works2","tmpcell","WK3Enum","osheets","rnames","parse_cell","get_wk1_fmt","write_LABEL","write_INTEGER","write_NUMBER","wk1_parse_rc","FuncTab","BinOpTab","parse_cell_3","write_LABEL_16","wsidx","parse_NUMBER_17","v1","v2","write_NUMBER_17","log2","parse_NUMBER_27","parse_SHEETNAMECS","write_XFORMAT_SHEETNAME","argc","argL","argR","args","wk1_fmla_to_csf","sheet_to_wk1","write_biff_rec","write_BOF_WK1","write_RANGE","max_R","dc","book_to_wk3","wscnt","write_BOF_WK3","parse_rs","parse_r","rpr","font","pass","shadow","outline","strike","uval","rgb","family","valign","parse_rpr","rregex","rend","rs","filter","rs_to_html","nlregex","r_to_html","terms","intro","outro","style","align","parse_rpr2","sitregex","sirregex","parse_si","html","cellHTML","sstr1","sstr2","_JS2ANSI","parse_CRYPTOVersion","Major","Minor","parse_DataSpaceMapEntry","comps","parse_Primary","hdr","U","W","parse_TransformInfoHeader","ename","cmode","parse_EncryptionHeader","Flags","AlgID","valid","AlgIDHash","KeySize","ProviderType","CSPName","parse_EncryptionVerifier","Salt","Verifier","VerifierHash","parse_EncInfoStd","parse_EncInfoExt","parse_EncInfoAgl","KeyData","xml","encryptedHmacKey","encryptedHmacValue","encs","uri","crypto_CreatePasswordVerifier_Method1","Password","PasswordArray","PasswordDecoded","crypto_CreateXorArray_Method1","PadArray","InitialCode","XorMatrix","XorRor","byte1","byte2","Byte","password","Temp","PasswordLastChar","PadIndex","XorKey","CurrentElement","Char","CreateXorKey_Method1","Index","ObfuscationArray","crypto_MakeXorDecryptor","XorArrayIndex","XorArray","Data","O","Value","crypto_DecryptData_Method1","parse_FilePassHeader","Info","EncryptionVersionInfo","EncryptedVerifier","EncryptedVerifierHash","parse_RC4Header","EncryptionHeader","EncryptionVerifier","parse_RC4CryptoHeader","rtf_to_sheet_str","rowtf","rtfre","last_index","rtf_to_workbook","rtf_to_sheet","rgb2Hex","rgb_tint","hex","tint","hsl","G","H6","L2","rgb2HSL","hex2RGB","X","h6","hsl2RGB","MDW","px","char2width","chr","cycle_width","collw","find_mdw_colw","_MDW","coll","customWidth","pt","XLMLPatternTypeMap","cellXF_uint","cellXF_bool","parse_sty_xml","themes","styles","NumberFmt","formatCode","parse_numFmts","Fonts","bold","italic","underline","condense","extend","vertAlign","scheme","auto","indexed","icv","theme","themeElements","clrScheme","parse_fonts","Fills","patternType","bgColor","fgColor","parse_fills","Borders","border","diagonalUp","diagonalDown","parse_borders","xf","CellXf","alignment","vertical","horizontal","textRotation","indent","wrapText","parse_cellXfs","parse_BrtFill","parse_BrtBorder","XLSXThemeClrScheme","parse_themeElements","lastClr","parse_clrScheme","parse_theme_xml","write_theme","Themes","themeXLSX","parse_FullColorExt","xclrType","nTintShade","xclrValue","parse_IcvXF","parse_ColorTheme","parse_ExtProp","extType","parse_XFExtGradient","sheet_insert_comments","comments","threaded","people","comment","author","parse_BrtCommentAuthor","rcregex","rcbase","rcfunc","fstr","crefregex","$0","$4","$5","shift_formula_xlsx","_xlfn","parseread1","parse_ColRelU","parse_RgceArea","parse_RgceArea_BIFF2","parse_RgceLoc","parse_RgceLoc_BIFF2","parse_RgceElfLoc","fQuoted","parse_PtgAttrBaxcel","bitSemi","parse_PtgAttrSpaceType","parse_SerAr","parse_PtgExtraMem","count","parse_PtgExtraArray","parse_PtgElfLoc","parse_PtgElfNoop","parse_PtgElfLel","PtgListRT","PtgTypes","iftab","FtabArgc","Ftab","cparams","tab","parsetab","Cetab","nameindex","rl","parse_RgceLocRel_BIFF2","cl","parse_RgceLocRel","area","parse_RgceAreaRel","ixti","parse_PtgNameX_BIFF5","PtgDupes","Ptg18","coltype","rt","Ptg19","bitIf","bitGoto","ptgs","stringify_array","PtgBinOp","PtgAdd","PtgConcat","PtgDiv","PtgEq","PtgGe","PtgGt","PtgLe","PtgLt","PtgMul","PtgNe","PtgPower","PtgSub","make_3d_range","get_ixti_raw","supbooks","XTI","SID","get_ixti","ixtiraw","stringify_formula","stack","nameidx","last_sp","sp","fflen","func","lbl","names","xlfn","externbook","bookidx","ixtidata","lp","rp","sharedf","parsedf","fnd","arrayf","_left","parse_SharedParsedFormula","parse_Formula","parse_FormulaValue","cbf","parse_XLSCellParsedFormula","shared","parse_XLSBParsedFormula","parse_XLSBArrayParsedFormula","parse_XLSBCellParsedFormula","parse_XLSBNameParsedFormula","parse_XLSBSharedParsedFormula","ods_to_csf_formula","ods_to_csf_3D","strs","_ssfopts","default_margins","margins","mode","defs","left","right","top","bottom","footer","safe_format","fmtid","fillid","raw_rgb","mergecregex","hlinkregex","dimregex","colregex","afregex","marginregex","sheetprregex","parse_ws_xml","data1","data2","mtch","sheetPr","parse_ws_xml_sheetpr","parse_ws_xml_sheetpr2","nodim","parse_ws_xml_dim","svs","Views","sviewregex","zoomScale","zoom","rightToLeft","RTL","parse_ws_xml_sheetviews","columns","seencol","coli","colm","colM","outlineLevel","parse_ws_xml_cols","parse_ws_xml_data","afilter","parse_ws_xml_autofilter","merges","_merge","hlink","location","Rel","tooltip","Tooltip","rng","parse_ws_xml_hlinks","margin","parse_ws_xml_margins","tmpref","codeName","CodeName","cellregex","rowregex","refregex","sstr","ftag","cells","cref","tagr","tagc","do_format","rowobj","rowrite","marr","marrlen","xlen","rstarti","outa","ht","rslice","cellFormula","___f","_tag","fillId","cm","xlmeta","Cell","_r","parse_BrtWsDim","parse_BrtShortReal","parse_BrtMergeCell","BrtMarginKeys","parse_chart","csheet","nc","cache","num","nf","parse_Cache","WBPropsDef","WBViewDef","SheetDef","CalcPrDef","push_defaults_array","defaults","push_defaults","parse_wb_defaults","CalcPr","WBView","badchars","check_ws_name","wbnsregex","parse_BrtFRTArchID$","ArchID","parse_wb","xmlns","Ptg","parse_wb_bin","dname","dnstart","Hidden","Comment","localSheetId","parse_wb_xml","parse_ws","ai","af","vm","RR","aii","_d","relId","rfx","above","parse_ws_bin","parse_cs","parse_cs_bin","parse_cs_xml","parse_sty","parse_sty_bin","parse_sst","Count","Unique","parse_sst_bin","sst","uniqueCount","parse_sst_xml","parse_cmnt","authors","iauthor","parse_comments_bin","commentList","authtag","cmnttag","authorId","guid","textMatch","parse_comments_xml","parse_cc","parse_cc_bin","parse_cc_xml","parse_xlink","parse_xlink_bin","parse_xlmeta","Types","metatype","parse_xlmeta_bin","lastmeta","offsets","parse_xlmeta_xml","XLMLFormatMap","attregexg2","attregex2","xlml_parsexmltag","words","xlml_parsexmltagobj","xlml_set_custprop","Custprops","key","oval","safe_format_xlml","format","xlml_format","process_style_xlml","stag","Interior","I","Pattern","ID","parse_xlml_data","csty","sid","StyleID","interiors","ssid","Parent","Formula","ArrayRange","xlml_clean_comment","parse_xlml_xml","Rn","opening","ishtml","_o","html_to_sheet","book_new","html_to_workbook","sheetnames","cursheet","sheetname","dtag","didx","fidx","pidx","cstys","wsprops","raw_Rn3","HRef","HRefScreenTip","MergeAcross","MergeDown","cma","cmd","AutoFitHeight","Height","Format","ssfidx","Width","_col","Span","_NamedRange","_DefinedName","RefersTo","AutoFilter","Range","parse_fods","Margin","pagemargins","Top","Left","Right","Bottom","bookSheets","bookProps","SSF","parse_xlml","fix_read_opts","parse_compobj","AnsiUserType","AnsiClipboardFormat","parse_ClipboardFormatOrAnsiString","Reserved1","UnicodeClipboardFormat","parse_ClipboardFormatOrUnicodeString","Reserved2","CONTINUE_RT","slurp","RecordType","insitu","nextrt","XLSRecordEnum","ll","safe_format_xf","make_cell","parse_workbook","rngC","rngR","temp_val","country","Directory","last_formula","cur_sheet","Preamble","last_cell","XFs","palette","biff4w","get_rgb","addcell","file_depth","xfd","icvFore","icvBack","process_cell_style","afi","rrtabid","lastuser","winlocked","wtf","objects","last_lbl","last_RT","BIFF2Fmt","BIFF2FmtTable","FilterDatabases","seen_codepage","Date1904","WriteProtect","cpval","CalcRefMode","FullCalc","fDialog","fBelow","fRight","ExternCount","tmpri","biffguess","fakebs8","hs","rknum","rkrec","_fr","_fc","_fe","_arraystart","isst","_j","_ixfe","b4idx","b2idx","cmo","lastobj","TxO","ImData","noteobj","xfe","Strings","Encryption","Metadata","Country","PSCLSID","parse_xlscfb","CompObj","WorkbookP","bookVBA","vbaraw","newcfb","newpath","make_vba_xls","DSI","DocSummary","SI","Summary","HeadingPairs","TitlesOfParts","parse_xls_props","bookFiles","grbit","fBold","fItalic","fUnderline","fStrikeout","fOutline","fShadow","fCondense","fExtend","parse_FontFlags","bCharSet","charset","xColorType","nTS","bR","bG","bB","parse_BrtColor","ixfeParent","defaultThemeVersion","strName","autoCompressPictures","backupFile","checkCompatibility","filterPrivacy","hidePivotFieldList","promptedSolutions","publishItems","refreshAllConnections","saveExternalLinkValues","showBorderUnselectedTables","showInkAnnotation","showObjects","showPivotChartFilter","updateLinks","iTabID","strRelID","fAlwaysCalc","display","idObj","parse_NoteSh","verificationBytes","verifier","parse_XORObfuscation","dyHeight","fl","Pos","Dim","CurTab","FirstTab","Selected","TabRatio","UserName","fts","parse_BIFF5Obj","parse_FtArray","ccv","rw","rkrecs","lastcol","ixfes","fStyle","alc","fWrap","alcV","fJustLast","trot","cIndent","fShrinkToFit","iReadOrder","fAtrNum","fAtrFnt","fAtrAlc","fAtrBdr","fAtrPat","fAtrProt","dgLeft","dgRight","dgTop","dgBottom","icvLeft","icvRight","grbitDiag","icvTop","icvBottom","icvDiag","dgDiag","fsxButton","parse_CellStyleXF","cmcs","ucnt","extsst","dsst","ctab","virtPath","rgst","texts","accel","parse_ControlInfo","cchText","sVer","displayName","targetFrameName","moniker","oleMoniker","fileTime","Loc","parse_Hyperlink","xnum","cUse","wzTooltip","cxfs","crc","cexts","cchComment","themeXML","parse_frtHeader","bestart","env","lcb","mtch2","hd","midx","colspan","rowspan","_t","make_html_row","editable","HTML_BEGIN","HTML_END","make_html_preamble","sheet_to_html","sheet_add_dom","tagName","or_R","or_C","is_dom_element_hidden","elts","hasAttribute","getAttribute","innerHTML","Aelts","getElementsByTagName","Aelti","parse_dom_table","element","get_computed_style","ownerDocument","defaultView","getComputedStyle","get_get_computed_style_function","getPropertyValue","parse_text_p","fixed","parse_ods_styles","_nfm","number_format_map","NFtag","NF","tNF","etpos","tidx","parse_content_xml","nfidx","sheetag","rowtag","ctag","ctag2","textp","textpidx","oldtextp","oldtextpidx","textR","oldtextR","row_ol","mrange","mR","mC","rowpeat","colpeat","atag","_Ref","creator","creatoridx","isstub","intable","rptR","rpt","annotag","xlmlidx","styletag","nrange","ptp","href","parse_ods","FEtag","parse_manifest","Styles","u8_to_dataview","array","DataView","buffer","byteOffset","byteLength","u8str","u8","u8concat","u8a","popcnt","parse_varint49","ptr","varint","varint_to_i32","i32","parse_shallow","mappa","parse_iwa_file","_a","messages","mi","merge","parse_snappy_chunk","chunks","clen","u8i","decompress_iwa_file","numbers_format_cell","ofmt","nfmt","_b","_c","ver","dur","dstyle","dmin","dmax","autodur","dstr","zstr","parse_new_storage","lut","dv","getUint32","doff","zidx","d128","ieee","exp","mantissa","readDecimal128LE","getFloat64","rts","rsst","cmntidx","iwa","replies","reply","iwa_to_s5s_comment","parse_cell_storage","parse_old_storage","parse_TSP_Reference","parse_TST_TableDataList","pb","entries","le","rtp","rtpref","mtype","tswpsa","richtext","sfields","smartfields","_a2","_b2","attr","parse_TSD_CommentStorageArchive","parse_TST_Tile","_e","_g","_h","_i","_k","_m","used_storage_u8","used_storage","wide_offsets","used_storage_offsets","getUint16","parse_TST_TileRowInfo","nrows","reduce","acc","csp","asp","pi","parse_TST_TableInfoArchive","tableref","dws","store","fmla","ferr","tile","kv","tl","ref2","mtype2","_tile","merge_owner","formula_store","_c2","_d2","_e2","formula_pair","AST_node_array","AST_node0","AST_colon_tract","colrange","rowrange","parse_TST_TableModelArchive","parse_TN_DocumentArchive","root2","parse_TN_SheetArchive","parse_numbers_iwa","indices","packets","packet","docroot","iwam","fix_opts_func","parse_sheet_legacy_drawing","draw","cidx","aidx","ObjectType","ws_get_cell_stub","parse_vml","safe_parse_sheet","relsPath","sheetRels","stype","dfile","drelsp","parse_drawing","chartp","crelsp","parse_ds","tcomments","personId","parse_tcmnt_xml","strip_front_slash","_zip","index_zip","Bun","readSync","binname","dir","workbooks","charts","dialogs","macros","threadedcomments","links","coreprops","extprops","custprops","calcchains","vba","drawings","TODO","ctext","Extension","ContentType","PartName","calcchain","parse_ct","xlsb","link","propdata","parse_ext_props","toks","parse_cust_props","deps","bookDeps","wbsheets","wbext","wbrelsi","wbrelsfile","wbrels","displayname","parse_people_xml","safe_parse_wbrels","nmode","wsloop","snjseen","snj","Deps","bin","parse_xlsxcfb","parse_DataSpaceVersionInfo","dsm","parse_DataSpaceMap","seds","parse_DataSpaceDefinition","einfo","parse_EncryptionInfo","decrypt_agile","decrypt_std76","read_plaintext","main","read_utf16","utf16lereadu","read_prn","Int8Array","Deno","$","File","Folder","infile","open","close","message","read_binary","bstrify","ab","vu","foo","read_cfb","OLD_WTF","read_wb_ID","read_zip","read_plaintext_raw","make_json_row","defval","isempty","defineProperty","enumerable","__rowNum__","rawNumbers","outi","counter","header_cnt","skipHidden","blankrows","qreg","make_csv_row","txt","datarow","forceQuotes","strip","sheet_to_csv","sheet_to_txt","sheet_add_json","js","skipHeader","ROW","JS","RC","wsname","roll","cell_set_hyperlink","split_cell","sheet_new","json_to_sheet","table_to_sheet","table_to_book","sheet_to_formulae","cmds","values","sheet_to_row_object_array","sheet_get_cell","book_set_sheet_visibility","sh","vis","wb_sheet_idx","cell_set_number_format","cell_set_internal_link","cell_add_comment","sheet_set_array_formula","dynamic","rngstr","wsr","SHEET_VISIBLE","SHEET_HIDDEN","SHEET_VERY_HIDDEN"],"mappings":";qHAAA,sEAIA,IAKIA,EALAC,EAAO,CACXA,QAAe,UACXC,EAAmB,KAAMC,EAAe,KAKxCC,EAAa,CAAE,IAAK,IAAK,IAAK,IAAK,IAAK,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAE9FC,EAAS,CACZ,EAAM,KACN,EAAK,MACL,EAAK,MACL,GAAK,IACL,IAAO,IACP,IAAO,IACP,IAAM,KACN,IAAO,IACP,IAAO,IACP,IAAM,KACN,IAAM,KACN,IAAM,KACN,IAAM,KACN,IAAM,KACN,IAAM,KACN,IAAM,KACN,IAAO,IACP,IAAM,KACN,IAAM,KACN,GAAM,MAGHC,EAAW,SAASC,IAA+C,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ACR,GAAQ,KACR,GAAQ,KACR,GAAQ,KACR,GAAQ,KACR,GAAQ,KACR,GAAQ,KACR,GAAQ,KACR,GAAQ,KACR,GAAQ,KACR,GAAQ,KACR,GAAQ,KACR,GAAQ,KACR,GAAQ,KACR,GAAQ,KACR,GAAQ,KACR,GAAQ,KACR,GAAQ,KACR,GAAQ,KACR,GAAQ,KACR,IAAQ,KACR,IAAQ,KACR,IAAQ,KACR,IAAQ,KACR,IAAQ,KACR,IAAQ,KACR,IAAQ,KACR,IAAQ,KACR,IAAQ,KACR,IAAQ,KACR,IAAQ,KACR,IAAQ,KACR,IAAQ,KACR,IAAQ,KACR,IAAQ,KACR,IAAQ,KACR,IAAQ,KACR,IAAQ,KACR,IAAQ,KACR,MAAQ,MAILC,GAAiB,CACpB,KACA,QACA,aACA,WACA,YACA,iBACA,eACA,WACA,SACA,WACA,cACA,kBACA,gBACA,YACA,UACA,YACA,eACA,UACA,YAGD,SAASC,GAAOxR,GAA6D,OAAOA,EAAItjB,KAAI,SAAStC,GAAK,MAAO,CAAEA,GAAG,GAAI,IAAKA,GAAG,EAAG,IAAM,IAAFA,EAAQ,GAAI,CAIrJ,IA4FIq3B,GAAsBpR,GA5FEmR,GAAO,CAElC,EACA,SACA,SACA,MACA,IACA,SACA,SACA,MAGA,EACA,SACA,SACA,MACA,IACA,SACA,SACA,MAEA,QACA,MACA,IACA,QACA,QACA,MACA,SACA,QACA,SACA,SACA,SACA,SACA,QACA,SACA,MACA,SAEA,IACA,SACA,SACA,MACA,QACA,QACA,MACA,IACA,MACA,SACA,SACA,SACA,SACA,SACA,SACA,SAEA,QACA,QACA,SACA,SACA,SACA,SACA,QACA,QACA,MACA,QACA,MACA,QACA,SACA,SACA,QACA,QAGA,EACA,SACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,KAKGrD,GAAO,CACV,EAAM,SACN,EAAM,UACN,GAAM,UACN,GAAM,QACN,GAAM,SACN,G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,gBACL,IAAK,gBACL,IAAK,gBACL,IAAK,eACL,IAAK,SACL,IAAK,cACL,IAAK,gBACL,IAAK,QACL,IAAK,QACL,IAAK,QACL,IAAK,QACL,IAAK,UACL,IAAK,UACL,IAAK,QACL,IAAK,MACL,IAAK,cACL,IAAK,iBACL,IAAK,UACL,IAAK,aACL,IAAK,eACL,IAAK,eACL,IAAK,aACL,IAAK,cACL,IAAK,cACL,IAAK,kBACL,IAAK,YACL,IAAK,iBACL,IAAK,cACL,IAAK,eACL,IAAK,eACL,IAAK,YACL,IAAK,QACL,IAAK,YACL,IAAK,UACL,IAAK,gBACL,IAAK,UACL,IAAK,aACL,IAAK,aACL,IAAK,gBACL,IAAK,YACL,IAAK,aACL,IAAK,UACL,IAAK,OACL,IAAK,cACL,IAAK,UACL,IAAK,YACL,IAAK,iBACL,IAAK,cACL,IAAK,oBACL,IAAK,gBACL,IAAK,eACL,IAAK,iBACL,IAAK,kBACL,IAAK,cACL,IAAK,qBACL,IAAK,SACL,IAAK,cACL,IAAK,WACL,IAAK,WACL,IAAK,eACL,IAAK,eACL,IAAK,iBACL,IAAK,eACL,IAAK,kBACL,IAAK,qBACL,IAAK,aACL,IAAK,YACL,IAAK,YACL,IAAK,gBACL,IAAK,cACL,IAAK,eACL,IAAK,kBACL,IAAK,oBACL,IAAK,kBACL,IAAK,iBACL,IAAK,UACL,IAAK,YACL,IAAK,YACL,IAAK,aACL,IAAK,cACL,IAAK,UACL,IAAK,SACL,IAAK,cACL,IAAK,UACL,IAAK,oBACL,IAAK,kBACL,IAAK,QACL,IAAK,aACL,IAAK,YACL,IAAK,cACL,IAAK,mBACL,IAAK,oBACL,IAAK,cACL,IAAK,cACL,IAAK,mBACL,IAAK,eACL,IAAK,aACL,IAAK,eACL,IAAK,gBACL,IAAK,aACL,IAAK,cACL,IAAK,cACL,IAAK,iBACL,IAAK,YACL,IAAK,cACL,IAAK,eACL,IAAK,aACL,IAAK,aACL,IAAK,gBACL,IAAK,eACL,IAAK,kBACL,IAAK,gBACL,IAAK,qBACL,IAAK,WACL,IAAK,OACL,IAAK,gBACL,IAAK,kBACL,IAAK,aACL,IAAK,aACL,IAAK,eACL,IAAK,iBACL,IAAK,cACL,IAAK,iBACL,IAAK,qBACL,IAAK,YACL,IAAK,oBACL,IAAK,WACL,IAAK,cACL,IAAK,iBACL,IAAK,WACL,IAAK,eACL,IAAK,gBACL,IAAK,gBACL,IAAK,mBACL,IAAK,iBACL,IAAK,eACL,IAAK,cACL,IAAK,YACL,IAAK,kBACL,IAAK,oBACL,IAAK,iBACL,IAAK,YACL,IAAK,aACL,IAAK,oBACL,IAAK,aACL,IAAK,eACL,IAAK,iBACL,IAAK,kBACL,IAAK,eACL,IAAK,gBACL,IAAK,gBACL,IAAK,qBACL,IAAK,mBACL,IAAK,qBACL,IAAK,yBACL,IAAK,cACL,IAAK,aACL,IAAK,mBACL,IAAK,sBACL,IAAK,eACL,IAAK,eACL,IAAK,gBACL,IAAK,cACL,IAAK,kBACL,IAAK,cACL,IAAK,gBACL,IAAK,kBACL,IAAK,2BACL,IAAK,eACL,IAAK,iBACL,IAAK,aACL,IAAK,iBACL,IAAK,YACL,IAAK,mBACL,IAAK,cACL,IAAK,wBACL,IAAK,kBACL,IAAK,qBACL,IAAK,kBACL,IAAK,kBACL,IAAK,kBACL,IAAK,qBACL,IAAK,aACL,IAAK,iBACL,IAAK,eACL,IAAK,mBACL,IAAK,aACL,IAAK,eACL,IAAK,kBACL,IAAK,gBACL,IAAK,gBACL,IAAK,kBACL,IAAK,kBACL,IAAK,gBACL,IAAK,iBACL,IAAK,uBACL,IAAK,0BACL,IAAK,iBACL,IAAK,eACL,IAAK,YACL,IAAK,cACL,IAAK,aACL,IAAK,iBACL,IAAK,kBACL,IAAK,kBACL,IAAK,gBACL,IAAK,kBACL,IAAK,gBACL,IAAK,gBACL,IAAK,qBACL,IAAK,cACL,IAAK,mBACL,IAAK,uBACL,IAAK,mBACL,IAAK,kBACL,IAAK,mBACL,IAAK,cACL,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ACL,IAAK,UACL,IAAK,IACL,IAAK,IACL,IAAK,QACL,IAAK,SACL,IAAK,QACL,IAAK,UACL,IAAK,QACL,IAAK,WACL,IAAK,SACL,IAAK,OACL,IAAK,YACL,IAAK,YACL,IAAK,MACL,IAAK,MACL,IAAK,MACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,WACL,IAAK,WACL,IAAK,OACL,IAAK,UACL,IAAK,WACL,IAAK,cACL,IAAK,iBACL,IAAK,gBACL,IAAK,iBACL,IAAK,WACL,IAAK,cACL,IAAK,iBACL,IAAK,iBACL,IAAK,aACL,IAAK,QACL,IAAK,UACL,IAAK,WACL,IAAK,QACL,IAAK,QACL,IAAK,OACL,IAAK,OACL,IAAK,SACL,IAAK,aACL,IAAK,MACL,IAAK,QACL,IAAK,QACL,IAAK,OACL,IAAK,WACL,IAAK,UACL,IAAK,OACL,IAAK,UACL,IAAK,YACL,IAAK,UACL,IAAK,OACL,IAAK,UACL,IAAK,UACL,IAAK,OACL,IAAK,WACL,IAAK,gBACL,IAAK,aACL,IAAK,eACL,IAAK,WACL,IAAK,YACL,IAAK,WACL,IAAK,OACL,IAAK,SACL,IAAK,OACL,IAAK,UACL,IAAK,QACL,IAAK,QACL,IAAK,YACL,IAAK,UACL,IAAK,aACL,IAAK,aACL,IAAK,WACL,IAAK,QACL,IAAK,UACL,IAAK,WACL,IAAK,QACL,IAAK,SACL,IAAK,OACL,IAAK,OACL,IAAK,UACL,IAAK,YACL,IAAK,MACL,IAAK,OACL,IAAK,OACL,IAAK,UACL,IAAK,UACL,IAAK,QACL,IAAK,MACL,IAAK,OACL,IAAK,UACL,IAAK,SACL,IAAK,WACL,IAAK,SACL,IAAK,aACL,IAAK,OACL,IAAK,OACL,IAAK,OACL,IAAK,QACL,IAAK,QACL,IAAK,QACL,IAAK,OACL,IAAK,gBACL,IAAK,WACL,IAAK,aACL,IAAK,cACL,IAAK,gBACL,IAAK,kBACL,IAAK,gBACL,IAAK,WACL,IAAK,OACL,IAAK,QACL,IAAK,aACL,IAAK,KACL,IAAK,QACL,IAAK,SACL,IAAK,YACL,IAAK,cACL,IAAK,iBACL,IAAK,OACL,IAAK,gBACL,IAAK,WACL,IAAK,cACL,IAAK,WACL,IAAK,iBACL,IAAK,aACL,IAAK,YACL,IAAK,eACL,IAAK,eACL,IAAK,cACL,IAAK,aACL,IAAK,cACL,IAAK,eACL,IAAK,SACL,IAAK,WACL,IAAK,UACL,IAAK,UACL,IAAK,YACL,IAAK,UACL,IAAK,SACL,IAAK,SACL,IAAK,aACL,IAAK,YACL,IAAK,OACL,IAAK,YACL,IAAK,QACL,IAAK,OACL,IAAK,SACL,IAAK,YACL,IAAK,QACL,IAAK,YACL,IAAK,WACL,IAAK,UACL,IAAK,cACL,IAAK,cACL,IAAK,SACL,IAAK,eACL,IAAK,WACL,IAAK,YACL,IAAK,UACL,IAAK,WACL,IAAK,cACL,IAAK,MACL,IAAK,SACL,IAAK,UACL,IAAK,QACL,IAAK,UACL,IAAK,UACL,IAAK,WACL,IAAK,WACL,IAAK,UACL,IAAK,SACL,IAAK,QACL,IAAK,WACL,IAAK,QACL,IAAK,YACL,IAAK,UACL,IAAK,MACL,IAAK,QACL,IAAK,QACL,IAAK,QACL,IAAK,OACL,IAAK,QACL,IAAK,UACL,IAAK,UACL,IAAK,QACL,IAAK,OACL,IAAK,OACL,IAAK,QACL,IAAK,QACL,IAAK,QACL,IAAK,WACL,IAAK,aACL,IAAK,cACL,IAAK,OACL,IAAK,WACL,IAAK,OACL,IAAK,gBACL,IAAK,YACL,IAAK,cACL,IAAK,QACL,IAAK,iBACL,IAAK,kBACL,IAAK,kBACL,IAAK,iBACL,IAAK,UACL,IAAK,UACL,IAAK,WACL,IAAK,QACL,IAAK,UACL,IAAK,aACL,IAAK,eACL,IAAK,oBACL,IAAK,QACL,IAAK,UACL,IAAK,aACL,IAAK,eACL,IAAK,QACL,IAAK,cACL,IAAK,cACL,IAAK,WACL,IAAK,eACL,IAAK,YACL,IAAK,WACL,IAAK,WACL,IAAK,OACL,IAAK,OACL,IAAK,UACL,IAAK,QACL,IAAK,SACL,IAAK,OACL,IAAK,WACL,IAAK,gBACL,IAAK,YACL,IAAK,kBACL,IAAK,eACL,IAAK,gBACL,IAAK,mBACL,IAAK,cACL,IAAK,gBACL,IAAK,cACL,IAAK,WACL,IAAK,MACL,IAAK,YACL,IAAK,aACL,IAAK,qBACL,IAAK,mBACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,QACL,IAAK,QACL,IAAK,UACL,IAAK,QACL,IAAK,SACL,IAAK,OACL,IAAK,SACL,IAAK,UACL,IAAK,QACL,IAAK,QACL,IAAK,QACL,IAAK,aACL,IAAK,cACL,IAAK,YACL,IAAK,SACL,IAAK,UACL,IAAK,QACL,IAAK,YACL,IAAK,YACL,IAAK,aACL,IAAK,SACL,IAAK,WACL,IAAK,QACL,IAAK,SACL,IAAK,SACL,IAAK,QACL,IAAK,SACL,IAAK,MACL,IAAK,OACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,OACL,IAAK,OACL,IAAK,WACL,IAAK,WACL,IAAK,UACL,IAAK,WACL,IAAK,OACL,IAAK,YACL,IAAK,YACL,IAAK,UACL,IAAK,aACL,IAAK,aACL,IAAK,QACL,IAAK,QACL,IAAK,WACL,IAAK,WACL,IAAK,UACL,IAAK,SACL,IAAK,WACL,IAAK,UACL,IAAK,QACL,IAAK,UACL,IAAK,WACL,IAAK,YACL,IAAK,WACL,IAAK,aACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,WACL,IAAK,YACL,IAAK,YACL,IAAK,YACL,IAAK,YACL,IAAK,YACL,IAAK,cACL,IAAK,UACL,IAAK,YACL,IAAK,WACL,IAAK,UACL,IAAK,UACL,IAAK,UACL,IAAK,WACL,IAAK,UACL,IAAK,cACL,I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AAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL,IAAK,EACL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,OALGsoD,EAAI16E,EAAE0I,EAAI2hD,EAAIrqD,EAAE0I,IAAGgyE,EAAI16E,EAAE0I,EAAI2hD,EAAIrqD,EAAE0I,GACnCgyE,EAAI16E,EAAEK,EAAIgqD,EAAIrqD,EAAEK,IAAGq6E,EAAI16E,EAAEK,EAAIgqD,EAAIrqD,EAAEK,GACnCq6E,EAAIv7E,EAAEuJ,EAAI2hD,EAAIlrD,EAAEuJ,IAAGgyE,EAAIv7E,EAAEuJ,EAAI2hD,EAAIlrD,EAAEuJ,GACnCgyE,EAAIv7E,EAAEkB,EAAIgqD,EAAIlrD,EAAEkB,IAAGq6E,EAAIv7E,EAAEkB,EAAIgqD,EAAIlrD,EAAEkB,GACtC+xB,EAAG,QAAUnB,GAAaypD,GACnBtoD,CACR,EAoCCvZ,OAAQ,CACP8hE,cAAe,EACfC,aAAc,EACdC,kBAAmB,IA2RE5+E,EAAK4Q,O","file":"static/js/main~9a78d50b.d915612a.chunk.js","sourcesContent":["/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */\n/* vim: set ts=2: */\n/*exported XLSX */\n/*global process:false, Buffer:false, ArrayBuffer:false, DataView:false, Deno:false */\nvar XLSX = {};\nXLSX.version = '0.20.3';\nvar current_codepage = 1200, current_ansi = 1252;\n/*:: declare var cptable:any; */\n/*global cptable:true, window */\nvar $cptable;\n\nvar VALID_ANSI = [ 874, 932, 936, 949, 950, 1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1258, 10000 ];\n/* ECMA-376 Part I 18.4.1 charset to codepage mapping */\nvar CS2CP = ({\n\t0: 1252, /* ANSI */\n\t1: 65001, /* DEFAULT */\n\t2: 65001, /* SYMBOL */\n\t77: 10000, /* MAC */\n\t128: 932, /* SHIFTJIS */\n\t129: 949, /* HANGUL */\n\t130: 1361, /* JOHAB */\n\t134: 936, /* GB2312 */\n\t136: 950, /* CHINESEBIG5 */\n\t161: 1253, /* GREEK */\n\t162: 1254, /* TURKISH */\n\t163: 1258, /* VIETNAMESE */\n\t177: 1255, /* HEBREW */\n\t178: 1256, /* ARABIC */\n\t186: 1257, /* BALTIC */\n\t204: 1251, /* RUSSIAN */\n\t222: 874, /* THAI */\n\t238: 1250, /* EASTEUROPE */\n\t255: 1252, /* OEM */\n\t69: 6969 /* MISC */\n}/*:any*/);\n\nvar set_ansi = function(cp/*:number*/) { if(VALID_ANSI.indexOf(cp) == -1) return; current_ansi = CS2CP[0] = cp; };\nfunction reset_ansi() { set_ansi(1252); }\n\nvar set_cp = function(cp/*:number*/) { current_codepage = cp; set_ansi(cp); };\nfunction reset_cp() { set_cp(1200); reset_ansi(); }\n\nfunction char_codes(data/*:string*/)/*:Array*/ { var o/*:Array*/ = []; for(var i = 0, len = data.length; i < len; ++i) o[i] = data.charCodeAt(i); return o; }\n\nfunction utf16leread(data/*:string*/)/*:string*/ {\n\tvar o/*:Array*/ = [];\n\tfor(var i = 0; i < (data.length>>1); ++i) o[i] = String.fromCharCode(data.charCodeAt(2*i) + (data.charCodeAt(2*i+1)<<8));\n\treturn o.join(\"\");\n}\nfunction utf16lereadu(data/*:Uint8Array*/)/*:string*/ {\n\tvar o/*:Array*/ = [];\n\tfor(var i = 0; i < (data.length>>1); ++i) o[i] = String.fromCharCode(data[2*i] + (data[2*i+1]<<8));\n\treturn o.join(\"\");\n}\nfunction utf16beread(data/*:string*/)/*:string*/ {\n\tvar o/*:Array*/ = [];\n\tfor(var i = 0; i < (data.length>>1); ++i) o[i] = String.fromCharCode(data.charCodeAt(2*i+1) + (data.charCodeAt(2*i)<<8));\n\treturn o.join(\"\");\n}\n\nvar debom = function(data/*:string*/)/*:string*/ {\n\tvar c1 = data.charCodeAt(0), c2 = data.charCodeAt(1);\n\tif(c1 == 0xFF && c2 == 0xFE) return utf16leread(data.slice(2));\n\tif(c1 == 0xFE && c2 == 0xFF) return utf16beread(data.slice(2));\n\tif(c1 == 0xFEFF) return data.slice(1);\n\treturn data;\n};\n\nvar _getchar = function _gc1(x/*:number*/)/*:string*/ { return String.fromCharCode(x); };\nvar _getansi = function _ga1(x/*:number*/)/*:string*/ { return String.fromCharCode(x); };\n\nfunction set_cptable(cptable) {\n\t$cptable = cptable;\n\tset_cp = function(cp/*:number*/) { current_codepage = cp; set_ansi(cp); };\n\tdebom = function(data/*:string*/) {\n\t\tif(data.charCodeAt(0) === 0xFF && data.charCodeAt(1) === 0xFE) { return $cptable.utils.decode(1200, char_codes(data.slice(2))); }\n\t\treturn data;\n\t};\n\t_getchar = function _gc2(x/*:number*/)/*:string*/ {\n\t\tif(current_codepage === 1200) return String.fromCharCode(x);\n\t\treturn $cptable.utils.decode(current_codepage, [x&255,x>>8])[0];\n\t};\n\t_getansi = function _ga2(x/*:number*/)/*:string*/ {\n\t\treturn $cptable.utils.decode(current_ansi, [x])[0];\n\t};\n\tcpdoit();\n}\nvar DENSE = null;\nvar DIF_XL = true;\nvar Base64_map = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\nfunction Base64_encode(input) {\n var o = \"\";\n var c1 = 0, c2 = 0, c3 = 0, e1 = 0, e2 = 0, e3 = 0, e4 = 0;\n for (var i = 0; i < input.length; ) {\n c1 = input.charCodeAt(i++);\n e1 = c1 >> 2;\n c2 = input.charCodeAt(i++);\n e2 = (c1 & 3) << 4 | c2 >> 4;\n c3 = input.charCodeAt(i++);\n e3 = (c2 & 15) << 2 | c3 >> 6;\n e4 = c3 & 63;\n if (isNaN(c2)) {\n e3 = e4 = 64;\n } else if (isNaN(c3)) {\n e4 = 64;\n }\n o += Base64_map.charAt(e1) + Base64_map.charAt(e2) + Base64_map.charAt(e3) + Base64_map.charAt(e4);\n }\n return o;\n}\nfunction Base64_encode_pass(input) {\n var o = \"\";\n var c1 = 0, c2 = 0, c3 = 0, e1 = 0, e2 = 0, e3 = 0, e4 = 0;\n for (var i = 0; i < input.length; ) {\n c1 = input.charCodeAt(i++);\n if (c1 > 255)\n c1 = 95;\n e1 = c1 >> 2;\n c2 = input.charCodeAt(i++);\n if (c2 > 255)\n c2 = 95;\n e2 = (c1 & 3) << 4 | c2 >> 4;\n c3 = input.charCodeAt(i++);\n if (c3 > 255)\n c3 = 95;\n e3 = (c2 & 15) << 2 | c3 >> 6;\n e4 = c3 & 63;\n if (isNaN(c2)) {\n e3 = e4 = 64;\n } else if (isNaN(c3)) {\n e4 = 64;\n }\n o += Base64_map.charAt(e1) + Base64_map.charAt(e2) + Base64_map.charAt(e3) + Base64_map.charAt(e4);\n }\n return o;\n}\nfunction Base64_encode_arr(input) {\n var o = \"\";\n var c1 = 0, c2 = 0, c3 = 0, e1 = 0, e2 = 0, e3 = 0, e4 = 0;\n for (var i = 0; i < input.length; ) {\n c1 = input[i++];\n e1 = c1 >> 2;\n c2 = input[i++];\n e2 = (c1 & 3) << 4 | c2 >> 4;\n c3 = input[i++];\n e3 = (c2 & 15) << 2 | c3 >> 6;\n e4 = c3 & 63;\n if (isNaN(c2)) {\n e3 = e4 = 64;\n } else if (isNaN(c3)) {\n e4 = 64;\n }\n o += Base64_map.charAt(e1) + Base64_map.charAt(e2) + Base64_map.charAt(e3) + Base64_map.charAt(e4);\n }\n return o;\n}\nfunction Base64_decode(input) {\n var o = \"\";\n var c1 = 0, c2 = 0, c3 = 0, e1 = 0, e2 = 0, e3 = 0, e4 = 0;\n if (input.slice(0, 5) == \"data:\") {\n var i = input.slice(0, 1024).indexOf(\";base64,\");\n if (i > -1)\n input = input.slice(i + 8);\n }\n input = input.replace(/[^\\w\\+\\/\\=]/g, \"\");\n for (var i = 0; i < input.length; ) {\n e1 = Base64_map.indexOf(input.charAt(i++));\n e2 = Base64_map.indexOf(input.charAt(i++));\n c1 = e1 << 2 | e2 >> 4;\n o += String.fromCharCode(c1);\n e3 = Base64_map.indexOf(input.charAt(i++));\n c2 = (e2 & 15) << 4 | e3 >> 2;\n if (e3 !== 64) {\n o += String.fromCharCode(c2);\n }\n e4 = Base64_map.indexOf(input.charAt(i++));\n c3 = (e3 & 3) << 6 | e4;\n if (e4 !== 64) {\n o += String.fromCharCode(c3);\n }\n }\n return o;\n}\nvar has_buf = /*#__PURE__*/(function() { return typeof Buffer !== 'undefined' && typeof process !== 'undefined' && typeof process.versions !== 'undefined' && !!process.versions.node; })();\n\nvar Buffer_from = /*#__PURE__*/(function() {\n\tif(typeof Buffer !== 'undefined') {\n\t\tvar nbfs = !Buffer.from;\n\t\tif(!nbfs) try { Buffer.from(\"foo\", \"utf8\"); } catch(e) { nbfs = true; }\n\t\treturn nbfs ? function(buf, enc) { return (enc) ? new Buffer(buf, enc) : new Buffer(buf); } : Buffer.from.bind(Buffer);\n\t}\n\treturn function() {};\n})();\nvar buf_utf16le = /*#__PURE__*/(function() {\n\tif(typeof Buffer === 'undefined') return false;\n\tvar x = Buffer_from([65,0]);\n\tif(!x) return false;\n\tvar o = x.toString(\"utf16le\");\n\treturn o.length == 1;\n})();\n\n\nfunction new_raw_buf(len/*:number*/) {\n\t/* jshint -W056 */\n\tif(has_buf) return Buffer.alloc ? Buffer.alloc(len) : new Buffer(len);\n\treturn typeof Uint8Array != \"undefined\" ? new Uint8Array(len) : new Array(len);\n\t/* jshint +W056 */\n}\n\nfunction new_unsafe_buf(len/*:number*/) {\n\t/* jshint -W056 */\n\tif(has_buf) return Buffer.allocUnsafe ? Buffer.allocUnsafe(len) : new Buffer(len);\n\treturn typeof Uint8Array != \"undefined\" ? new Uint8Array(len) : new Array(len);\n\t/* jshint +W056 */\n}\n\nvar s2a = function s2a(s/*:string*/)/*:any*/ {\n\tif(has_buf) return Buffer_from(s, \"binary\");\n\treturn s.split(\"\").map(function(x/*:string*/)/*:number*/{ return x.charCodeAt(0) & 0xff; });\n};\n\nfunction s2ab(s/*:string*/)/*:any*/ {\n\tif(typeof ArrayBuffer === 'undefined') return s2a(s);\n\tvar buf = new ArrayBuffer(s.length), view = new Uint8Array(buf);\n\tfor (var i=0; i!=s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;\n\treturn buf;\n}\n\nfunction a2s(data/*:any*/)/*:string*/ {\n\tif(Array.isArray(data)) return data.map(function(c) { return String.fromCharCode(c); }).join(\"\");\n\tvar o/*:Array*/ = []; for(var i = 0; i < data.length; ++i) o[i] = String.fromCharCode(data[i]); return o.join(\"\");\n}\n\nfunction a2u(data/*:Array*/)/*:Uint8Array*/ {\n\tif(typeof Uint8Array === 'undefined') throw new Error(\"Unsupported\");\n\treturn new Uint8Array(data);\n}\n\nfunction ab2a(data/*:ArrayBuffer|Uint8Array*/)/*:Array*/ {\n\tif(typeof ArrayBuffer == 'undefined') throw new Error(\"Unsupported\");\n\tif(data instanceof ArrayBuffer) return ab2a(new Uint8Array(data));\n\t/*:: if(data instanceof ArrayBuffer) throw new Error(\"unreachable\"); */\n\tvar o = new Array(data.length);\n\tfor(var i = 0; i < data.length; ++i) o[i] = data[i];\n\treturn o;\n}\n\nvar bconcat = has_buf ? function(bufs) { return Buffer.concat(bufs.map(function(buf) { return Buffer.isBuffer(buf) ? buf : Buffer_from(buf); })); } : function(bufs) {\n\tif(typeof Uint8Array !== \"undefined\") {\n\t\tvar i = 0, maxlen = 0;\n\t\tfor(i = 0; i < bufs.length; ++i) maxlen += bufs[i].length;\n\t\tvar o = new Uint8Array(maxlen);\n\t\tvar len = 0;\n\t\tfor(i = 0, maxlen = 0; i < bufs.length; maxlen += len, ++i) {\n\t\t\tlen = bufs[i].length;\n\t\t\tif(bufs[i] instanceof Uint8Array) o.set(bufs[i], maxlen);\n\t\t\telse if(typeof bufs[i] == \"string\") o.set(new Uint8Array(s2a(bufs[i])), maxlen);\n\t\t\telse o.set(new Uint8Array(bufs[i]), maxlen);\n\t\t}\n\t\treturn o;\n\t}\n\treturn [].concat.apply([], bufs.map(function(buf) { return Array.isArray(buf) ? buf : [].slice.call(buf); }));\n};\n\nfunction utf8decode(content/*:string*/) {\n\tvar out = [], widx = 0, L = content.length + 250;\n\tvar o = new_raw_buf(content.length + 255);\n\tfor(var ridx = 0; ridx < content.length; ++ridx) {\n\t\tvar c = content.charCodeAt(ridx);\n\t\tif(c < 0x80) o[widx++] = c;\n\t\telse if(c < 0x800) {\n\t\t\to[widx++] = (192|((c>>6)&31));\n\t\t\to[widx++] = (128|(c&63));\n\t\t} else if(c >= 0xD800 && c < 0xE000) {\n\t\t\tc = (c&1023)+64;\n\t\t\tvar d = content.charCodeAt(++ridx)&1023;\n\t\t\to[widx++] = (240|((c>>8)&7));\n\t\t\to[widx++] = (128|((c>>2)&63));\n\t\t\to[widx++] = (128|((d>>6)&15)|((c&3)<<4));\n\t\t\to[widx++] = (128|(d&63));\n\t\t} else {\n\t\t\to[widx++] = (224|((c>>12)&15));\n\t\t\to[widx++] = (128|((c>>6)&63));\n\t\t\to[widx++] = (128|(c&63));\n\t\t}\n\t\tif(widx > L) {\n\t\t\tout.push(o.slice(0, widx));\n\t\t\twidx = 0;\n\t\t\to = new_raw_buf(65535);\n\t\t\tL = 65530;\n\t\t}\n\t}\n\tout.push(o.slice(0, widx));\n\treturn bconcat(out);\n}\n\nvar chr0 = /\\u0000/g, chr1 = /[\\u0001-\\u0006]/g;\n/*::\ndeclare type Block = any;\ndeclare type BufArray = {\n\tnewblk(sz:number):Block;\n\tnext(sz:number):Block;\n\tend():any;\n\tpush(buf:Block):void;\n};\n\ntype RecordHopperCB = {(d:any, Rn:string, RT:number):?boolean;};\n\ntype EvertType = {[string]:string};\ntype EvertNumType = {[string]:number};\ntype EvertArrType = {[string]:Array};\n\ntype StringConv = {(string):string};\n\n*/\n/* ssf.js (C) 2013-present SheetJS -- http://sheetjs.com */\n/*jshint -W041 */\nfunction _strrev(x/*:string*/)/*:string*/ { var o = \"\", i = x.length-1; while(i>=0) o += x.charAt(i--); return o; }\nfunction pad0(v/*:any*/,d/*:number*/)/*:string*/{var t=\"\"+v; return t.length>=d?t:fill('0',d-t.length)+t;}\nfunction pad_(v/*:any*/,d/*:number*/)/*:string*/{var t=\"\"+v;return t.length>=d?t:fill(' ',d-t.length)+t;}\nfunction rpad_(v/*:any*/,d/*:number*/)/*:string*/{var t=\"\"+v; return t.length>=d?t:t+fill(' ',d-t.length);}\nfunction pad0r1(v/*:any*/,d/*:number*/)/*:string*/{var t=\"\"+Math.round(v); return t.length>=d?t:fill('0',d-t.length)+t;}\nfunction pad0r2(v/*:any*/,d/*:number*/)/*:string*/{var t=\"\"+v; return t.length>=d?t:fill('0',d-t.length)+t;}\nvar p2_32 = /*#__PURE__*/Math.pow(2,32);\nfunction pad0r(v/*:any*/,d/*:number*/)/*:string*/{if(v>p2_32||v<-p2_32) return pad0r1(v,d); var i = Math.round(v); return pad0r2(i,d); }\n/* yes, in 2022 this is still faster than string compare */\nfunction SSF_isgeneral(s/*:string*/, i/*:?number*/)/*:boolean*/ { i = i || 0; return s.length >= 7 + i && (s.charCodeAt(i)|32) === 103 && (s.charCodeAt(i+1)|32) === 101 && (s.charCodeAt(i+2)|32) === 110 && (s.charCodeAt(i+3)|32) === 101 && (s.charCodeAt(i+4)|32) === 114 && (s.charCodeAt(i+5)|32) === 97 && (s.charCodeAt(i+6)|32) === 108; }\nvar days/*:Array >*/ = [\n\t['Sun', 'Sunday'],\n\t['Mon', 'Monday'],\n\t['Tue', 'Tuesday'],\n\t['Wed', 'Wednesday'],\n\t['Thu', 'Thursday'],\n\t['Fri', 'Friday'],\n\t['Sat', 'Saturday']\n];\nvar months/*:Array >*/ = [\n\t['J', 'Jan', 'January'],\n\t['F', 'Feb', 'February'],\n\t['M', 'Mar', 'March'],\n\t['A', 'Apr', 'April'],\n\t['M', 'May', 'May'],\n\t['J', 'Jun', 'June'],\n\t['J', 'Jul', 'July'],\n\t['A', 'Aug', 'August'],\n\t['S', 'Sep', 'September'],\n\t['O', 'Oct', 'October'],\n\t['N', 'Nov', 'November'],\n\t['D', 'Dec', 'December']\n];\nfunction SSF_init_table(t/*:any*/) {\n\tif(!t) t = {};\n\tt[0]= 'General';\n\tt[1]= '0';\n\tt[2]= '0.00';\n\tt[3]= '#,##0';\n\tt[4]= '#,##0.00';\n\tt[9]= '0%';\n\tt[10]= '0.00%';\n\tt[11]= '0.00E+00';\n\tt[12]= '# ?/?';\n\tt[13]= '# ??/??';\n\tt[14]= 'm/d/yy';\n\tt[15]= 'd-mmm-yy';\n\tt[16]= 'd-mmm';\n\tt[17]= 'mmm-yy';\n\tt[18]= 'h:mm AM/PM';\n\tt[19]= 'h:mm:ss AM/PM';\n\tt[20]= 'h:mm';\n\tt[21]= 'h:mm:ss';\n\tt[22]= 'm/d/yy h:mm';\n\tt[37]= '#,##0 ;(#,##0)';\n\tt[38]= '#,##0 ;[Red](#,##0)';\n\tt[39]= '#,##0.00;(#,##0.00)';\n\tt[40]= '#,##0.00;[Red](#,##0.00)';\n\tt[45]= 'mm:ss';\n\tt[46]= '[h]:mm:ss';\n\tt[47]= 'mmss.0';\n\tt[48]= '##0.0E+0';\n\tt[49]= '@';\n\tt[56]= '\"上午/下午 \"hh\"時\"mm\"分\"ss\"秒 \"';\n\treturn t;\n}\n/* repeated to satiate webpack */\nvar table_fmt = {\n\t0: 'General',\n\t1: '0',\n\t2: '0.00',\n\t3: '#,##0',\n\t4: '#,##0.00',\n\t9: '0%',\n\t10: '0.00%',\n\t11: '0.00E+00',\n\t12: '# ?/?',\n\t13: '# ??/??',\n\t14: 'm/d/yy',\n\t15: 'd-mmm-yy',\n\t16: 'd-mmm',\n\t17: 'mmm-yy',\n\t18: 'h:mm AM/PM',\n\t19: 'h:mm:ss AM/PM',\n\t20: 'h:mm',\n\t21: 'h:mm:ss',\n\t22: 'm/d/yy h:mm',\n\t37: '#,##0 ;(#,##0)',\n\t38: '#,##0 ;[Red](#,##0)',\n\t39: '#,##0.00;(#,##0.00)',\n\t40: '#,##0.00;[Red](#,##0.00)',\n\t45: 'mm:ss',\n\t46: '[h]:mm:ss',\n\t47: 'mmss.0',\n\t48: '##0.0E+0',\n\t49: '@',\n\t56: '\"上午/下午 \"hh\"時\"mm\"分\"ss\"秒 \"'\n};\n\n/* Defaults determined by systematically testing in Excel 2019 */\n\n/* These formats appear to default to other formats in the table */\nvar SSF_default_map = {\n\t5: 37, 6: 38, 7: 39, 8: 40, // 5 -> 37 ... 8 -> 40\n\n\t23: 0, 24: 0, 25: 0, 26: 0, // 23 -> 0 ... 26 -> 0\n\n\t27: 14, 28: 14, 29: 14, 30: 14, 31: 14, // 27 -> 14 ... 31 -> 14\n\n\t50: 14, 51: 14, 52: 14, 53: 14, 54: 14, // 50 -> 14 ... 58 -> 14\n\t55: 14, 56: 14, 57: 14, 58: 14,\n\t59: 1, 60: 2, 61: 3, 62: 4, // 59 -> 1 ... 62 -> 4\n\n\t67: 9, 68: 10, // 67 -> 9 ... 68 -> 10\n\t69: 12, 70: 13, 71: 14, // 69 -> 12 ... 71 -> 14\n\t72: 14, 73: 15, 74: 16, 75: 17, // 72 -> 14 ... 75 -> 17\n\t76: 20, 77: 21, 78: 22, // 76 -> 20 ... 78 -> 22\n\t79: 45, 80: 46, 81: 47, // 79 -> 45 ... 81 -> 47\n\t82: 0 // 82 -> 0 ... 65536 -> 0 (omitted)\n};\n\n\n/* These formats technically refer to Accounting formats with no equivalent */\nvar SSF_default_str = {\n\t// 5 -- Currency, 0 decimal, black negative\n\t5: '\"$\"#,##0_);\\\\(\"$\"#,##0\\\\)',\n\t63: '\"$\"#,##0_);\\\\(\"$\"#,##0\\\\)',\n\n\t// 6 -- Currency, 0 decimal, red negative\n\t6: '\"$\"#,##0_);[Red]\\\\(\"$\"#,##0\\\\)',\n\t64: '\"$\"#,##0_);[Red]\\\\(\"$\"#,##0\\\\)',\n\n\t// 7 -- Currency, 2 decimal, black negative\n\t7: '\"$\"#,##0.00_);\\\\(\"$\"#,##0.00\\\\)',\n\t65: '\"$\"#,##0.00_);\\\\(\"$\"#,##0.00\\\\)',\n\n\t// 8 -- Currency, 2 decimal, red negative\n\t8: '\"$\"#,##0.00_);[Red]\\\\(\"$\"#,##0.00\\\\)',\n\t66: '\"$\"#,##0.00_);[Red]\\\\(\"$\"#,##0.00\\\\)',\n\n\t// 41 -- Accounting, 0 decimal, No Symbol\n\t41: '_(* #,##0_);_(* \\\\(#,##0\\\\);_(* \"-\"_);_(@_)',\n\n\t// 42 -- Accounting, 0 decimal, $ Symbol\n\t42: '_(\"$\"* #,##0_);_(\"$\"* \\\\(#,##0\\\\);_(\"$\"* \"-\"_);_(@_)',\n\n\t// 43 -- Accounting, 2 decimal, No Symbol\n\t43: '_(* #,##0.00_);_(* \\\\(#,##0.00\\\\);_(* \"-\"??_);_(@_)',\n\n\t// 44 -- Accounting, 2 decimal, $ Symbol\n\t44: '_(\"$\"* #,##0.00_);_(\"$\"* \\\\(#,##0.00\\\\);_(\"$\"* \"-\"??_);_(@_)'\n};\n\nfunction SSF_frac(x/*:number*/, D/*:number*/, mixed/*:?boolean*/)/*:Array*/ {\n\tvar sgn = x < 0 ? -1 : 1;\n\tvar B = x * sgn;\n\tvar P_2 = 0, P_1 = 1, P = 0;\n\tvar Q_2 = 1, Q_1 = 0, Q = 0;\n\tvar A = Math.floor(B);\n\twhile(Q_1 < D) {\n\t\tA = Math.floor(B);\n\t\tP = A * P_1 + P_2;\n\t\tQ = A * Q_1 + Q_2;\n\t\tif((B - A) < 0.00000005) break;\n\t\tB = 1 / (B - A);\n\t\tP_2 = P_1; P_1 = P;\n\t\tQ_2 = Q_1; Q_1 = Q;\n\t}\n\tif(Q > D) { if(Q_1 > D) { Q = Q_2; P = P_2; } else { Q = Q_1; P = P_1; } }\n\tif(!mixed) return [0, sgn * P, Q];\n\tvar q = Math.floor(sgn * P/Q);\n\treturn [q, sgn*P - q*Q, Q];\n}\nfunction SSF_normalize_xl_unsafe(v/*:number*/)/*:number*/ {\n\tvar s = v.toPrecision(16);\n\tif(s.indexOf(\"e\") > -1) {\n\t\tvar m = s.slice(0, s.indexOf(\"e\"));\n\t\tm = m.indexOf(\".\") > -1 ? m.slice(0, (m.slice(0,2) == \"0.\" ? 17 : 16)) : (m.slice(0,15) + fill(\"0\", m.length - 15));\n\t\treturn m + s.slice(s.indexOf(\"e\"));\n\t}\n\tvar n = s.indexOf(\".\") > -1 ? s.slice(0, (s.slice(0,2) == \"0.\" ? 17 : 16)) : (s.slice(0,15) + fill(\"0\", s.length - 15));\n\treturn Number(n);\n}\n\nfunction SSF_parse_date_code(v/*:number*/,opts/*:?any*/,b2/*:?boolean*/) {\n\tif(v > 2958465 || v < 0) return null;\n\tv = SSF_normalize_xl_unsafe(v);\n\tvar date = (v|0), time = Math.floor(86400 * (v - date)), dow=0;\n\tvar dout=[];\n\tvar out={D:date, T:time, u:86400*(v-date)-time,y:0,m:0,d:0,H:0,M:0,S:0,q:0};\n\tif(Math.abs(out.u) < 1e-6) out.u = 0;\n\tif(opts && opts.date1904) date += 1462;\n\tif(out.u > 0.9999) {\n\t\tout.u = 0;\n\t\tif(++time == 86400) { out.T = time = 0; ++date; ++out.D; }\n\t}\n\tif(date === 60) {dout = b2 ? [1317,10,29] : [1900,2,29]; dow=3;}\n\telse if(date === 0) {dout = b2 ? [1317,8,29] : [1900,1,0]; dow=6;}\n\telse {\n\t\tif(date > 60) --date;\n\t\t/* 1 = Jan 1 1900 in Gregorian */\n\t\tvar d = new Date(1900, 0, 1);\n\t\td.setDate(d.getDate() + date - 1);\n\t\tdout = [d.getFullYear(), d.getMonth()+1,d.getDate()];\n\t\tdow = d.getDay();\n\t\tif(date < 60) dow = (dow + 6) % 7;\n\t\tif(b2) dow = SSF_fix_hijri(d, dout);\n\t}\n\tout.y = dout[0]; out.m = dout[1]; out.d = dout[2];\n\tout.S = time % 60; time = Math.floor(time / 60);\n\tout.M = time % 60; time = Math.floor(time / 60);\n\tout.H = time;\n\tout.q = dow;\n\treturn out;\n}\n/* ECMA-376 18.8.30 numFmt*/\n/* Note: `toPrecision` uses standard form when prec > E and E >= -6 */\n/* exponent >= -9 and <= 9 */\nfunction SSF_strip_decimal(o/*:string*/)/*:string*/ {\n\treturn (o.indexOf(\".\") == -1) ? o : o.replace(/(?:\\.0*|(\\.\\d*[1-9])0+)$/, \"$1\");\n}\n\n/* General Exponential always shows 2 digits exp and trims the mantissa */\nfunction SSF_normalize_exp(o/*:string*/)/*:string*/ {\n\tif(o.indexOf(\"E\") == -1) return o;\n\treturn o.replace(/(?:\\.0*|(\\.\\d*[1-9])0+)[Ee]/,\"$1E\").replace(/(E[+-])(\\d)$/,\"$10$2\");\n}\n\n/* exponent >= -9 and <= 9 */\nfunction SSF_small_exp(v/*:number*/)/*:string*/ {\n\tvar w = (v<0?12:11);\n\tvar o = SSF_strip_decimal(v.toFixed(12)); if(o.length <= w) return o;\n\to = v.toPrecision(10); if(o.length <= w) return o;\n\treturn v.toExponential(5);\n}\n\n/* exponent >= 11 or <= -10 likely exponential */\nfunction SSF_large_exp(v/*:number*/)/*:string*/ {\n\tvar o = SSF_strip_decimal(v.toFixed(11));\n\treturn (o.length > (v<0?12:11) || o === \"0\" || o === \"-0\") ? v.toPrecision(6) : o;\n}\n\nfunction SSF_general_num(v/*:number*/)/*:string*/ {\n\tif(!isFinite(v)) return isNaN(v) ? \"#NUM!\" : \"#DIV/0!\";\n\tvar V = Math.floor(Math.log(Math.abs(v))*Math.LOG10E), o;\n\n\tif(V >= -4 && V <= -1) o = v.toPrecision(10+V);\n\telse if(Math.abs(V) <= 9) o = SSF_small_exp(v);\n\telse if(V === 10) o = v.toFixed(10).substr(0,12);\n\telse o = SSF_large_exp(v);\n\n\treturn SSF_strip_decimal(SSF_normalize_exp(o.toUpperCase()));\n}\n\n\n/*\n\t\"General\" rules:\n\t- text is passed through (\"@\")\n\t- booleans are rendered as TRUE/FALSE\n\t- \"up to 11 characters\" displayed for numbers\n\t- Default date format (code 14) used for Dates\n\n\tThe longest 32-bit integer text is \"-2147483648\", exactly 11 chars\n\tTODO: technically the display depends on the width of the cell\n*/\nfunction SSF_general(v/*:any*/, opts/*:any*/) {\n\tswitch(typeof v) {\n\t\tcase 'string': return v;\n\t\tcase 'boolean': return v ? \"TRUE\" : \"FALSE\";\n\t\tcase 'number': return (v|0) === v ? v.toString(10) : SSF_general_num(v);\n\t\tcase 'undefined': return \"\";\n\t\tcase 'object':\n\t\t\tif(v == null) return \"\";\n\t\t\tif(v instanceof Date) return SSF_format(14, datenum(v, opts && opts.date1904), opts);\n\t}\n\tthrow new Error(\"unsupported value in General format: \" + v);\n}\n\nfunction SSF_fix_hijri(date/*:Date*/, o/*:[number, number, number]*/) {\n /* TODO: properly adjust y/m/d and */\n o[0] -= 581;\n var dow = date.getDay();\n if(date < 60) dow = (dow + 6) % 7;\n return dow;\n}\n//var THAI_DIGITS = \"\\u0E50\\u0E51\\u0E52\\u0E53\\u0E54\\u0E55\\u0E56\\u0E57\\u0E58\\u0E59\".split(\"\");\nfunction SSF_write_date(type/*:number*/, fmt/*:string*/, val, ss0/*:?number*/)/*:string*/ {\n\tvar o=\"\", ss=0, tt=0, y = val.y, out, outl = 0;\n\tswitch(type) {\n\t\tcase 98: /* 'b' buddhist year */\n\t\t\ty = val.y + 543;\n\t\t\t/* falls through */\n\t\tcase 121: /* 'y' year */\n\t\tswitch(fmt.length) {\n\t\t\tcase 1: case 2: out = y % 100; outl = 2; break;\n\t\t\tdefault: out = y % 10000; outl = 4; break;\n\t\t} break;\n\t\tcase 109: /* 'm' month */\n\t\tswitch(fmt.length) {\n\t\t\tcase 1: case 2: out = val.m; outl = fmt.length; break;\n\t\t\tcase 3: return months[val.m-1][1];\n\t\t\tcase 5: return months[val.m-1][0];\n\t\t\tdefault: return months[val.m-1][2];\n\t\t} break;\n\t\tcase 100: /* 'd' day */\n\t\tswitch(fmt.length) {\n\t\t\tcase 1: case 2: out = val.d; outl = fmt.length; break;\n\t\t\tcase 3: return days[val.q][0];\n\t\t\tdefault: return days[val.q][1];\n\t\t} break;\n\t\tcase 104: /* 'h' 12-hour */\n\t\tswitch(fmt.length) {\n\t\t\tcase 1: case 2: out = 1+(val.H+11)%12; outl = fmt.length; break;\n\t\t\tdefault: throw 'bad hour format: ' + fmt;\n\t\t} break;\n\t\tcase 72: /* 'H' 24-hour */\n\t\tswitch(fmt.length) {\n\t\t\tcase 1: case 2: out = val.H; outl = fmt.length; break;\n\t\t\tdefault: throw 'bad hour format: ' + fmt;\n\t\t} break;\n\t\tcase 77: /* 'M' minutes */\n\t\tswitch(fmt.length) {\n\t\t\tcase 1: case 2: out = val.M; outl = fmt.length; break;\n\t\t\tdefault: throw 'bad minute format: ' + fmt;\n\t\t} break;\n\t\tcase 115: /* 's' seconds */\n\t\t\tif(fmt != 's' && fmt != 'ss' && fmt != '.0' && fmt != '.00' && fmt != '.000') throw 'bad second format: ' + fmt;\n\t\t\tif(val.u === 0 && (fmt == \"s\" || fmt == \"ss\")) return pad0(val.S, fmt.length);\n\t\t\t/*::if(!ss0) ss0 = 0; */\n\t\t\tif(ss0 >= 2) tt = ss0 === 3 ? 1000 : 100;\n\t\t\telse tt = ss0 === 1 ? 10 : 1;\n\t\t\tss = Math.round((tt)*(val.S + val.u));\n\t\t\tif(ss >= 60*tt) ss = 0;\n\t\t\tif(fmt === 's') return ss === 0 ? \"0\" : \"\"+ss/tt;\n\t\t\to = pad0(ss,2 + ss0);\n\t\t\tif(fmt === 'ss') return o.substr(0,2);\n\t\t\treturn \".\" + o.substr(2,fmt.length-1);\n\t\tcase 90: /* 'Z' absolute time */\n\t\tswitch(fmt) {\n\t\t\tcase '[h]': case '[hh]': out = val.D*24+val.H; break;\n\t\t\tcase '[m]': case '[mm]': out = (val.D*24+val.H)*60+val.M; break;\n\t\t\tcase '[s]': case '[ss]': out = ((val.D*24+val.H)*60+val.M)*60+(ss0 == 0 ? Math.round(val.S+val.u) : val.S); break;\n\t\t\tdefault: throw 'bad abstime format: ' + fmt;\n\t\t} outl = fmt.length === 3 ? 1 : 2; break;\n\t\tcase 101: /* 'e' era */\n\t\t\tout = y; outl = 1; break;\n\t}\n\tvar outstr = outl > 0 ? pad0(out, outl) : \"\";\n\treturn outstr;\n}\n\n\n/*jshint -W086 */\n/*jshint +W086 */\nfunction commaify(s/*:string*/)/*:string*/ {\n\tvar w = 3;\n\tif(s.length <= w) return s;\n\tvar j = (s.length % w), o = s.substr(0,j);\n\tfor(; j!=s.length; j+=w) o+=(o.length > 0 ? \",\" : \"\") + s.substr(j,w);\n\treturn o;\n}\nvar pct1 = /%/g;\nfunction write_num_pct(type/*:string*/, fmt/*:string*/, val/*:number*/)/*:string*/{\n\tvar sfmt = fmt.replace(pct1,\"\"), mul = fmt.length - sfmt.length;\n\treturn write_num(type, sfmt, val * Math.pow(10,2*mul)) + fill(\"%\",mul);\n}\n\nfunction write_num_cm(type/*:string*/, fmt/*:string*/, val/*:number*/)/*:string*/{\n\tvar idx = fmt.length - 1;\n\twhile(fmt.charCodeAt(idx-1) === 44) --idx;\n\treturn write_num(type, fmt.substr(0,idx), val / Math.pow(10,3*(fmt.length-idx)));\n}\n\nfunction write_num_exp(fmt/*:string*/, val/*:number*/)/*:string*/{\n\tvar o/*:string*/;\n\tvar idx = fmt.indexOf(\"E\") - fmt.indexOf(\".\") - 1;\n\tif(fmt.match(/^#+0.0E\\+0$/)) {\n\t\tif(val == 0) return \"0.0E+0\";\n\t\telse if(val < 0) return \"-\" + write_num_exp(fmt, -val);\n\t\tvar period = fmt.indexOf(\".\"); if(period === -1) period=fmt.indexOf('E');\n\t\tvar ee = Math.floor(Math.log(val)*Math.LOG10E)%period;\n\t\tif(ee < 0) ee += period;\n\t\to = (val/Math.pow(10,ee)).toPrecision(idx+1+(period+ee)%period);\n\t\tif(o.indexOf(\"e\") === -1) {\n\t\t\tvar fakee = Math.floor(Math.log(val)*Math.LOG10E);\n\t\t\tif(o.indexOf(\".\") === -1) o = o.charAt(0) + \".\" + o.substr(1) + \"E+\" + (fakee - o.length+ee);\n\t\t\telse o += \"E+\" + (fakee - ee);\n\t\t\twhile(o.substr(0,2) === \"0.\") {\n\t\t\t\to = o.charAt(0) + o.substr(2,period) + \".\" + o.substr(2+period);\n\t\t\t\to = o.replace(/^0+([1-9])/,\"$1\").replace(/^0+\\./,\"0.\");\n\t\t\t}\n\t\t\to = o.replace(/\\+-/,\"-\");\n\t\t}\n\t\to = o.replace(/^([+-]?)(\\d*)\\.(\\d*)[Ee]/,function($$,$1,$2,$3) { return $1 + $2 + $3.substr(0,(period+ee)%period) + \".\" + $3.substr(ee) + \"E\"; });\n\t} else o = val.toExponential(idx);\n\tif(fmt.match(/E\\+00$/) && o.match(/e[+-]\\d$/)) o = o.substr(0,o.length-1) + \"0\" + o.charAt(o.length-1);\n\tif(fmt.match(/E\\-/) && o.match(/e\\+/)) o = o.replace(/e\\+/,\"e\");\n\treturn o.replace(\"e\",\"E\");\n}\nvar frac1 = /# (\\?+)( ?)\\/( ?)(\\d+)/;\nfunction write_num_f1(r/*:Array*/, aval/*:number*/, sign/*:string*/)/*:string*/ {\n\tvar den = parseInt(r[4],10), rr = Math.round(aval * den), base = Math.floor(rr/den);\n\tvar myn = (rr - base*den), myd = den;\n\treturn sign + (base === 0 ? \"\" : \"\"+base) + \" \" + (myn === 0 ? fill(\" \", r[1].length + 1 + r[4].length) : pad_(myn,r[1].length) + r[2] + \"/\" + r[3] + pad0(myd,r[4].length));\n}\nfunction write_num_f2(r/*:Array*/, aval/*:number*/, sign/*:string*/)/*:string*/ {\n\treturn sign + (aval === 0 ? \"\" : \"\"+aval) + fill(\" \", r[1].length + 2 + r[4].length);\n}\nvar dec1 = /^#*0*\\.([0#]+)/;\nvar closeparen = /\\)[^)]*[0#]/;\nvar phone = /\\(###\\) ###\\\\?-####/;\nfunction hashq(str/*:string*/)/*:string*/ {\n\tvar o = \"\", cc;\n\tfor(var i = 0; i != str.length; ++i) switch((cc=str.charCodeAt(i))) {\n\t\tcase 35: break;\n\t\tcase 63: o+= \" \"; break;\n\t\tcase 48: o+= \"0\"; break;\n\t\tdefault: o+= String.fromCharCode(cc);\n\t}\n\treturn o;\n}\nfunction rnd(val/*:number*/, d/*:number*/)/*:string*/ { var dd = Math.pow(10,d); return \"\"+(Math.round(val * dd)/dd); }\nfunction dec(val/*:number*/, d/*:number*/)/*:number*/ {\n\tvar _frac = val - Math.floor(val), dd = Math.pow(10,d);\n\tif (d < ('' + Math.round(_frac * dd)).length) return 0;\n\treturn Math.round(_frac * dd);\n}\nfunction carry(val/*:number*/, d/*:number*/)/*:number*/ {\n\tif (d < ('' + Math.round((val-Math.floor(val))*Math.pow(10,d))).length) {\n\t\treturn 1;\n\t}\n\treturn 0;\n}\nfunction flr(val/*:number*/)/*:string*/ {\n\tif(val < 2147483647 && val > -2147483648) return \"\"+(val >= 0 ? (val|0) : (val-1|0));\n\treturn \"\"+Math.floor(val);\n}\nfunction write_num_flt(type/*:string*/, fmt/*:string*/, val/*:number*/)/*:string*/ {\n\tif(type.charCodeAt(0) === 40 && !fmt.match(closeparen)) {\n\t\tvar ffmt = fmt.replace(/\\( */,\"\").replace(/ \\)/,\"\").replace(/\\)/,\"\");\n\t\tif(val >= 0) return write_num_flt('n', ffmt, val);\n\t\treturn '(' + write_num_flt('n', ffmt, -val) + ')';\n\t}\n\tif(fmt.charCodeAt(fmt.length - 1) === 44) return write_num_cm(type, fmt, val);\n\tif(fmt.indexOf('%') !== -1) return write_num_pct(type, fmt, val);\n\tif(fmt.indexOf('E') !== -1) return write_num_exp(fmt, val);\n\tif(fmt.charCodeAt(0) === 36) return \"$\"+write_num_flt(type,fmt.substr(fmt.charAt(1)==' '?2:1),val);\n\tvar o;\n\tvar r/*:?Array*/, ri, ff, aval = Math.abs(val), sign = val < 0 ? \"-\" : \"\";\n\tif(fmt.match(/^00+$/)) return sign + pad0r(aval,fmt.length);\n\tif(fmt.match(/^[#?]+$/)) {\n\t\to = pad0r(val,0); if(o === \"0\") o = \"\";\n\t\treturn o.length > fmt.length ? o : hashq(fmt.substr(0,fmt.length-o.length)) + o;\n\t}\n\tif((r = fmt.match(frac1))) return write_num_f1(r, aval, sign);\n\tif(fmt.match(/^#+0+$/)) return sign + pad0r(aval,fmt.length - fmt.indexOf(\"0\"));\n\tif((r = fmt.match(dec1))) {\n\t\to = rnd(val, r[1].length).replace(/^([^\\.]+)$/,\"$1.\"+hashq(r[1])).replace(/\\.$/,\".\"+hashq(r[1])).replace(/\\.(\\d*)$/,function($$, $1) { return \".\" + $1 + fill(\"0\", hashq(/*::(*/r/*::||[\"\"])*/[1]).length-$1.length); });\n\t\treturn fmt.indexOf(\"0.\") !== -1 ? o : o.replace(/^0\\./,\".\");\n\t}\n\tfmt = fmt.replace(/^#+([0.])/, \"$1\");\n\tif((r = fmt.match(/^(0*)\\.(#*)$/))) {\n\t\treturn sign + rnd(aval, r[2].length).replace(/\\.(\\d*[1-9])0*$/,\".$1\").replace(/^(-?\\d*)$/,\"$1.\").replace(/^0\\./,r[1].length?\"0.\":\".\");\n\t}\n\tif((r = fmt.match(/^#{1,3},##0(\\.?)$/))) return sign + commaify(pad0r(aval,0));\n\tif((r = fmt.match(/^#,##0\\.([#0]*0)$/))) {\n\t\treturn val < 0 ? \"-\" + write_num_flt(type, fmt, -val) : commaify(\"\"+(Math.floor(val) + carry(val, r[1].length))) + \".\" + pad0(dec(val, r[1].length),r[1].length);\n\t}\n\tif((r = fmt.match(/^#,#*,#0/))) return write_num_flt(type,fmt.replace(/^#,#*,/,\"\"),val);\n\tif((r = fmt.match(/^([0#]+)(\\\\?-([0#]+))+$/))) {\n\t\to = _strrev(write_num_flt(type, fmt.replace(/[\\\\-]/g,\"\"), val));\n\t\tri = 0;\n\t\treturn _strrev(_strrev(fmt.replace(/\\\\/g,\"\")).replace(/[0#]/g,function(x){return ri= 0) return write_num_int('n', ffmt, val);\n\t\treturn '(' + write_num_int('n', ffmt, -val) + ')';\n\t}\n\tif(fmt.charCodeAt(fmt.length - 1) === 44) return write_num_cm2(type, fmt, val);\n\tif(fmt.indexOf('%') !== -1) return write_num_pct2(type, fmt, val);\n\tif(fmt.indexOf('E') !== -1) return write_num_exp2(fmt, val);\n\tif(fmt.charCodeAt(0) === 36) return \"$\"+write_num_int(type,fmt.substr(fmt.charAt(1)==' '?2:1),val);\n\tvar o;\n\tvar r/*:?Array*/, ri, ff, aval = Math.abs(val), sign = val < 0 ? \"-\" : \"\";\n\tif(fmt.match(/^00+$/)) return sign + pad0(aval,fmt.length);\n\tif(fmt.match(/^[#?]+$/)) {\n\t\to = (\"\"+val); if(val === 0) o = \"\";\n\t\treturn o.length > fmt.length ? o : hashq(fmt.substr(0,fmt.length-o.length)) + o;\n\t}\n\tif((r = fmt.match(frac1))) return write_num_f2(r, aval, sign);\n\tif(fmt.match(/^#+0+$/)) return sign + pad0(aval,fmt.length - fmt.indexOf(\"0\"));\n\tif((r = fmt.match(dec1))) {\n\t\t/*:: if(!Array.isArray(r)) throw new Error(\"unreachable\"); */\n\t\to = (\"\"+val).replace(/^([^\\.]+)$/,\"$1.\"+hashq(r[1])).replace(/\\.$/,\".\"+hashq(r[1]));\n\t\to = o.replace(/\\.(\\d*)$/,function($$, $1) {\n\t\t/*:: if(!Array.isArray(r)) throw new Error(\"unreachable\"); */\n\t\t\treturn \".\" + $1 + fill(\"0\", hashq(r[1]).length-$1.length); });\n\t\treturn fmt.indexOf(\"0.\") !== -1 ? o : o.replace(/^0\\./,\".\");\n\t}\n\tfmt = fmt.replace(/^#+([0.])/, \"$1\");\n\tif((r = fmt.match(/^(0*)\\.(#*)$/))) {\n\t\treturn sign + (\"\"+aval).replace(/\\.(\\d*[1-9])0*$/,\".$1\").replace(/^(-?\\d*)$/,\"$1.\").replace(/^0\\./,r[1].length?\"0.\":\".\");\n\t}\n\tif((r = fmt.match(/^#{1,3},##0(\\.?)$/))) return sign + commaify((\"\"+aval));\n\tif((r = fmt.match(/^#,##0\\.([#0]*0)$/))) {\n\t\treturn val < 0 ? \"-\" + write_num_int(type, fmt, -val) : commaify((\"\"+val)) + \".\" + fill('0',r[1].length);\n\t}\n\tif((r = fmt.match(/^#,#*,#0/))) return write_num_int(type,fmt.replace(/^#,#*,/,\"\"),val);\n\tif((r = fmt.match(/^([0#]+)(\\\\?-([0#]+))+$/))) {\n\t\to = _strrev(write_num_int(type, fmt.replace(/[\\\\-]/g,\"\"), val));\n\t\tri = 0;\n\t\treturn _strrev(_strrev(fmt.replace(/\\\\/g,\"\")).replace(/[0#]/g,function(x){return ri*/ {\n\tvar out/*:Array*/ = [];\n\tvar in_str = false/*, cc*/;\n\tfor(var i = 0, j = 0; i < fmt.length; ++i) switch((/*cc=*/fmt.charCodeAt(i))) {\n\t\tcase 34: /* '\"' */\n\t\t\tin_str = !in_str; break;\n\t\tcase 95: case 42: case 92: /* '_' '*' '\\\\' */\n\t\t\t++i; break;\n\t\tcase 59: /* ';' */\n\t\t\tout[out.length] = fmt.substr(j,i-j);\n\t\t\tj = i+1;\n\t}\n\tout[out.length] = fmt.substr(j);\n\tif(in_str === true) throw new Error(\"Format |\" + fmt + \"| unterminated string \");\n\treturn out;\n}\n\nvar SSF_abstime = /\\[[HhMmSs\\u0E0A\\u0E19\\u0E17]*\\]/;\nfunction fmt_is_date(fmt/*:string*/)/*:boolean*/ {\n\tvar i = 0, /*cc = 0,*/ c = \"\", o = \"\";\n\twhile(i < fmt.length) {\n\t\tswitch((c = fmt.charAt(i))) {\n\t\t\tcase 'G': if(SSF_isgeneral(fmt, i)) i+= 6; i++; break;\n\t\t\tcase '\"': for(;(/*cc=*/fmt.charCodeAt(++i)) !== 34 && i < fmt.length;){/*empty*/} ++i; break;\n\t\t\tcase '\\\\': i+=2; break;\n\t\t\tcase '_': i+=2; break;\n\t\t\tcase '@': ++i; break;\n\t\t\tcase 'B': case 'b':\n\t\t\t\tif(fmt.charAt(i+1) === \"1\" || fmt.charAt(i+1) === \"2\") return true;\n\t\t\t\t/* falls through */\n\t\t\tcase 'M': case 'D': case 'Y': case 'H': case 'S': case 'E':\n\t\t\t\t/* falls through */\n\t\t\tcase 'm': case 'd': case 'y': case 'h': case 's': case 'e': case 'g': return true;\n\t\t\tcase 'A': case 'a': case '上':\n\t\t\t\tif(fmt.substr(i, 3).toUpperCase() === \"A/P\") return true;\n\t\t\t\tif(fmt.substr(i, 5).toUpperCase() === \"AM/PM\") return true;\n\t\t\t\tif(fmt.substr(i, 5).toUpperCase() === \"上午/下午\") return true;\n\t\t\t\t++i; break;\n\t\t\tcase '[':\n\t\t\t\to = c;\n\t\t\t\twhile(fmt.charAt(i++) !== ']' && i < fmt.length) o += fmt.charAt(i);\n\t\t\t\tif(o.match(SSF_abstime)) return true;\n\t\t\t\tbreak;\n\t\t\tcase '.':\n\t\t\t\t/* falls through */\n\t\t\tcase '0': case '#':\n\t\t\t\twhile(i < fmt.length && (\"0#?.,E+-%\".indexOf(c=fmt.charAt(++i)) > -1 || (c=='\\\\' && fmt.charAt(i+1) == \"-\" && \"0#\".indexOf(fmt.charAt(i+2))>-1))){/* empty */}\n\t\t\t\tbreak;\n\t\t\tcase '?': while(fmt.charAt(++i) === c){/* empty */} break;\n\t\t\tcase '*': ++i; if(fmt.charAt(i) == ' ' || fmt.charAt(i) == '*') ++i; break;\n\t\t\tcase '(': case ')': ++i; break;\n\t\t\tcase '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':\n\t\t\t\twhile(i < fmt.length && \"0123456789\".indexOf(fmt.charAt(++i)) > -1){/* empty */} break;\n\t\t\tcase ' ': ++i; break;\n\t\t\tdefault: ++i; break;\n\t\t}\n\t}\n\treturn false;\n}\n\nfunction eval_fmt(fmt/*:string*/, v/*:any*/, opts/*:any*/, flen/*:number*/) {\n\tvar out = [], o = \"\", i = 0, c = \"\", lst='t', dt, j, cc;\n\tvar hr='H';\n\t/* Tokenize */\n\twhile(i < fmt.length) {\n\t\tswitch((c = fmt.charAt(i))) {\n\t\t\tcase 'G': /* General */\n\t\t\t\tif(!SSF_isgeneral(fmt, i)) throw new Error('unrecognized character ' + c + ' in ' +fmt);\n\t\t\t\tout[out.length] = {t:'G', v:'General'}; i+=7; break;\n\t\t\tcase '\"': /* Literal text */\n\t\t\t\tfor(o=\"\";(cc=fmt.charCodeAt(++i)) !== 34 && i < fmt.length;) o += String.fromCharCode(cc);\n\t\t\t\tout[out.length] = {t:'t', v:o}; ++i; break;\n\t\t\tcase '\\\\': var w = fmt.charAt(++i), t = (w === \"(\" || w === \")\") ? w : 't';\n\t\t\t\tout[out.length] = {t:t, v:w}; ++i; break;\n\t\t\tcase '_': out[out.length] = {t:'t', v:\" \"}; i+=2; break;\n\t\t\tcase '@': /* Text Placeholder */\n\t\t\t\tout[out.length] = {t:'T', v:v}; ++i; break;\n\t\t\tcase 'B': case 'b':\n\t\t\t\tif(fmt.charAt(i+1) === \"1\" || fmt.charAt(i+1) === \"2\") {\n\t\t\t\t\tif(dt==null) { dt=SSF_parse_date_code(v, opts, fmt.charAt(i+1) === \"2\"); if(dt==null) return \"\"; }\n\t\t\t\t\tout[out.length] = {t:'X', v:fmt.substr(i,2)}; lst = c; i+=2; break;\n\t\t\t\t}\n\t\t\t\t/* falls through */\n\t\t\tcase 'M': case 'D': case 'Y': case 'H': case 'S': case 'E':\n\t\t\t\tc = c.toLowerCase();\n\t\t\t\t/* falls through */\n\t\t\tcase 'm': case 'd': case 'y': case 'h': case 's': case 'e': case 'g':\n\t\t\t\tif(v < 0) return \"\";\n\t\t\t\tif(dt==null) { dt=SSF_parse_date_code(v, opts); if(dt==null) return \"\"; }\n\t\t\t\to = c; while(++i < fmt.length && fmt.charAt(i).toLowerCase() === c) o+=c;\n\t\t\t\tif(c === 'm' && lst.toLowerCase() === 'h') c = 'M';\n\t\t\t\tif(c === 'h') c = hr;\n\t\t\t\tout[out.length] = {t:c, v:o}; lst = c; break;\n\t\t\tcase 'A': case 'a': case '上':\n\t\t\t\tvar q={t:c, v:c};\n\t\t\t\tif(dt==null) dt=SSF_parse_date_code(v, opts);\n\t\t\t\tif(fmt.substr(i, 3).toUpperCase() === \"A/P\") { if(dt!=null) q.v = dt.H >= 12 ? fmt.charAt(i+2) : c; q.t = 'T'; hr='h';i+=3;}\n\t\t\t\telse if(fmt.substr(i,5).toUpperCase() === \"AM/PM\") { if(dt!=null) q.v = dt.H >= 12 ? \"PM\" : \"AM\"; q.t = 'T'; i+=5; hr='h'; }\n\t\t\t\telse if(fmt.substr(i,5).toUpperCase() === \"上午/下午\") { if(dt!=null) q.v = dt.H >= 12 ? \"下午\" : \"上午\"; q.t = 'T'; i+=5; hr='h'; }\n\t\t\t\telse { q.t = \"t\"; ++i; }\n\t\t\t\tif(dt==null && q.t === 'T') return \"\";\n\t\t\t\tout[out.length] = q; lst = c; break;\n\t\t\tcase '[':\n\t\t\t\to = c;\n\t\t\t\twhile(fmt.charAt(i++) !== ']' && i < fmt.length) o += fmt.charAt(i);\n\t\t\t\tif(o.slice(-1) !== ']') throw 'unterminated \"[\" block: |' + o + '|';\n\t\t\t\tif(o.match(SSF_abstime)) {\n\t\t\t\t\tif(dt==null) { dt=SSF_parse_date_code(v, opts); if(dt==null) return \"\"; }\n\t\t\t\t\tout[out.length] = {t:'Z', v:o.toLowerCase()};\n\t\t\t\t\tlst = o.charAt(1);\n\t\t\t\t} else if(o.indexOf(\"$\") > -1) {\n\t\t\t\t\to = (o.match(/\\$([^-\\[\\]]*)/)||[])[1]||\"$\";\n\t\t\t\t\tif(!fmt_is_date(fmt)) out[out.length] = {t:'t',v:o};\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t/* Numbers */\n\t\t\tcase '.':\n\t\t\t\tif(dt != null) {\n\t\t\t\t\to = c; while(++i < fmt.length && (c=fmt.charAt(i)) === \"0\") o += c;\n\t\t\t\t\tout[out.length] = {t:'s', v:o}; break;\n\t\t\t\t}\n\t\t\t\t/* falls through */\n\t\t\tcase '0': case '#':\n\t\t\t\to = c; while(++i < fmt.length && \"0#?.,E+-%\".indexOf(c=fmt.charAt(i)) > -1) o += c;\n\t\t\t\tout[out.length] = {t:'n', v:o}; break;\n\t\t\tcase '?':\n\t\t\t\to = c; while(fmt.charAt(++i) === c) o+=c;\n\t\t\t\tout[out.length] = {t:c, v:o}; lst = c; break;\n\t\t\tcase '*': ++i; if(fmt.charAt(i) == ' ' || fmt.charAt(i) == '*') ++i; break; // **\n\t\t\tcase '(': case ')': out[out.length] = {t:(flen===1?'t':c), v:c}; ++i; break;\n\t\t\tcase '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':\n\t\t\t\to = c; while(i < fmt.length && \"0123456789\".indexOf(fmt.charAt(++i)) > -1) o+=fmt.charAt(i);\n\t\t\t\tout[out.length] = {t:'D', v:o}; break;\n\t\t\tcase ' ': out[out.length] = {t:c, v:c}; ++i; break;\n\t\t\tcase '$': out[out.length] = {t:'t', v:'$'}; ++i; break;\n\t\t\tdefault:\n\t\t\t\tif(\",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP\".indexOf(c) === -1) throw new Error('unrecognized character ' + c + ' in ' + fmt);\n\t\t\t\tout[out.length] = {t:'t', v:c}; ++i; break;\n\t\t}\n\t}\n\n\t/* Scan for date/time parts */\n\tvar bt = 0, ss0 = 0, ssm;\n\tfor(i=out.length-1, lst='t'; i >= 0; --i) {\n\t\tswitch(out[i].t) {\n\t\t\tcase 'h': case 'H': out[i].t = hr; lst='h'; if(bt < 1) bt = 1; break;\n\t\t\tcase 's':\n\t\t\t\tif((ssm=out[i].v.match(/\\.0+$/))) { ss0=Math.max(ss0,ssm[0].length-1); bt = 4;}\n\t\t\t\tif(bt < 3) bt = 3;\n\t\t\t/* falls through */\n\t\t\tcase 'd': case 'y': case 'e': lst=out[i].t; break;\n\t\t\tcase 'M': lst=out[i].t; if(bt < 2) bt = 2; break;\n\t\t\tcase 'm': if(lst === 's') { out[i].t = 'M'; if(bt < 2) bt = 2; } break;\n\t\t\tcase 'X': /*if(out[i].v === \"B2\");*/\n\t\t\t\tbreak;\n\t\t\tcase 'Z':\n\t\t\t\tif(bt < 1 && out[i].v.match(/[Hh]/)) bt = 1;\n\t\t\t\tif(bt < 2 && out[i].v.match(/[Mm]/)) bt = 2;\n\t\t\t\tif(bt < 3 && out[i].v.match(/[Ss]/)) bt = 3;\n\t\t}\n\t}\n\n\t/* time rounding depends on presence of minute / second / usec fields */\n\tvar _dt;\n\tswitch(bt) {\n\t\tcase 0: break;\n\t\tcase 1:\n\t\tcase 2:\n\t\tcase 3:\n\t\t\tif(dt.u >= 0.5) { dt.u = 0; ++dt.S; }\n\t\t\tif(dt.S >= 60) { dt.S = 0; ++dt.M; }\n\t\t\tif(dt.M >= 60) { dt.M = 0; ++dt.H; }\n\t\t\tif(dt.H >= 24) { dt.H = 0; ++dt.D; _dt = SSF_parse_date_code(dt.D); _dt.u = dt.u; _dt.S = dt.S; _dt.M = dt.M; _dt.H = dt.H; dt = _dt; }\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tswitch(ss0) {\n\t\t\t\tcase 1: dt.u = Math.round(dt.u * 10)/10; break;\n\t\t\t\tcase 2: dt.u = Math.round(dt.u * 100)/100; break;\n\t\t\t\tcase 3: dt.u = Math.round(dt.u * 1000)/1000; break;\n\t\t\t}\n\t\t\tif(dt.u >= 1) { dt.u = 0; ++dt.S; }\n\t\t\tif(dt.S >= 60) { dt.S = 0; ++dt.M; }\n\t\t\tif(dt.M >= 60) { dt.M = 0; ++dt.H; }\n\t\t\tif(dt.H >= 24) { dt.H = 0; ++dt.D; _dt = SSF_parse_date_code(dt.D); _dt.u = dt.u; _dt.S = dt.S; _dt.M = dt.M; _dt.H = dt.H; dt = _dt; }\n\t\t\tbreak;\n\t}\n\n\t/* replace fields */\n\tvar nstr = \"\", jj;\n\tfor(i=0; i < out.length; ++i) {\n\t\tswitch(out[i].t) {\n\t\t\tcase 't': case 'T': case ' ': case 'D': break;\n\t\t\tcase 'X': out[i].v = \"\"; out[i].t = \";\"; break;\n\t\t\tcase 'd': case 'm': case 'y': case 'h': case 'H': case 'M': case 's': case 'e': case 'b': case 'Z':\n\t\t\t\t/*::if(!dt) throw \"unreachable\"; */\n\t\t\t\tout[i].v = SSF_write_date(out[i].t.charCodeAt(0), out[i].v, dt, ss0);\n\t\t\t\tout[i].t = 't'; break;\n\t\t\tcase 'n': case '?':\n\t\t\t\tjj = i+1;\n\t\t\t\twhile(out[jj] != null && (\n\t\t\t\t\t(c=out[jj].t) === \"?\" || c === \"D\" ||\n\t\t\t\t\t((c === \" \" || c === \"t\") && out[jj+1] != null && (out[jj+1].t === '?' || out[jj+1].t === \"t\" && out[jj+1].v === '/')) ||\n\t\t\t\t\t(out[i].t === '(' && (c === ' ' || c === 'n' || c === ')')) ||\n\t\t\t\t\t(c === 't' && (out[jj].v === '/' || out[jj].v === ' ' && out[jj+1] != null && out[jj+1].t == '?'))\n\t\t\t\t)) {\n\t\t\t\t\tout[i].v += out[jj].v;\n\t\t\t\t\tout[jj] = {v:\"\", t:\";\"}; ++jj;\n\t\t\t\t}\n\t\t\t\tnstr += out[i].v;\n\t\t\t\ti = jj-1; break;\n\t\t\tcase 'G': out[i].t = 't'; out[i].v = SSF_general(v,opts); break;\n\t\t}\n\t}\n\tvar vv = \"\", myv, ostr;\n\tif(nstr.length > 0) {\n\t\tif(nstr.charCodeAt(0) == 40) /* '(' */ {\n\t\t\tmyv = (v<0&&nstr.charCodeAt(0) === 45 ? -v : v);\n\t\t\tostr = write_num('n', nstr, myv);\n\t\t} else {\n\t\t\tmyv = (v<0 && flen > 1 ? -v : v);\n\t\t\tostr = write_num('n', nstr, myv);\n\t\t\tif(myv < 0 && out[0] && out[0].t == 't') {\n\t\t\t\tostr = ostr.substr(1);\n\t\t\t\tout[0].v = \"-\" + out[0].v;\n\t\t\t}\n\t\t}\n\t\tjj=ostr.length-1;\n\t\tvar decpt = out.length;\n\t\tfor(i=0; i < out.length; ++i) if(out[i] != null && out[i].t != 't' && out[i].v.indexOf(\".\") > -1) { decpt = i; break; }\n\t\tvar lasti=out.length;\n\t\tif(decpt === out.length && ostr.indexOf(\"E\") === -1) {\n\t\t\tfor(i=out.length-1; i>= 0;--i) {\n\t\t\t\tif(out[i] == null || 'n?'.indexOf(out[i].t) === -1) continue;\n\t\t\t\tif(jj>=out[i].v.length-1) { jj -= out[i].v.length; out[i].v = ostr.substr(jj+1, out[i].v.length); }\n\t\t\t\telse if(jj < 0) out[i].v = \"\";\n\t\t\t\telse { out[i].v = ostr.substr(0, jj+1); jj = -1; }\n\t\t\t\tout[i].t = 't';\n\t\t\t\tlasti = i;\n\t\t\t}\n\t\t\tif(jj>=0 && lasti= 0; --i) {\n\t\t\t\tif(out[i] == null || 'n?'.indexOf(out[i].t) === -1) continue;\n\t\t\t\tj=out[i].v.indexOf(\".\")>-1&&i===decpt?out[i].v.indexOf(\".\")-1:out[i].v.length-1;\n\t\t\t\tvv = out[i].v.substr(j+1);\n\t\t\t\tfor(; j>=0; --j) {\n\t\t\t\t\tif(jj>=0 && (out[i].v.charAt(j) === \"0\" || out[i].v.charAt(j) === \"#\")) vv = ostr.charAt(jj--) + vv;\n\t\t\t\t}\n\t\t\t\tout[i].v = vv;\n\t\t\t\tout[i].t = 't';\n\t\t\t\tlasti = i;\n\t\t\t}\n\t\t\tif(jj>=0 && lasti-1&&i===decpt?out[i].v.indexOf(\".\")+1:0;\n\t\t\t\tvv = out[i].v.substr(0,j);\n\t\t\t\tfor(; j-1) {\n\t\tmyv = (flen >1 && v < 0 && i>0 && out[i-1].v === \"-\" ? -v:v);\n\t\tout[i].v = write_num(out[i].t, out[i].v, myv);\n\t\tout[i].t = 't';\n\t}\n\tvar retval = \"\";\n\tfor(i=0; i !== out.length; ++i) if(out[i] != null) retval += out[i].v;\n\treturn retval;\n}\n\nvar cfregex2 = /\\[(=|>[=]?|<[>=]?)(-?\\d+(?:\\.\\d*)?)\\]/;\nfunction chkcond(v, rr) {\n\tif(rr == null) return false;\n\tvar thresh = parseFloat(rr[2]);\n\tswitch(rr[1]) {\n\t\tcase \"=\": if(v == thresh) return true; break;\n\t\tcase \">\": if(v > thresh) return true; break;\n\t\tcase \"<\": if(v < thresh) return true; break;\n\t\tcase \"<>\": if(v != thresh) return true; break;\n\t\tcase \">=\": if(v >= thresh) return true; break;\n\t\tcase \"<=\": if(v <= thresh) return true; break;\n\t}\n\treturn false;\n}\nfunction choose_fmt(f/*:string*/, v/*:any*/) {\n\tvar fmt = SSF_split_fmt(f);\n\tvar l = fmt.length, lat = fmt[l-1].indexOf(\"@\");\n\tif(l<4 && lat>-1) --l;\n\tif(fmt.length > 4) throw new Error(\"cannot find right format for |\" + fmt.join(\"|\") + \"|\");\n\tif(typeof v !== \"number\") return [4, fmt.length === 4 || lat>-1?fmt[fmt.length-1]:\"@\"];\n\t/* NOTE: most spreadsheet software do not support NaN or infinities */\n\tif(typeof v === \"number\" && !isFinite(v)) v = 0;\n\tswitch(fmt.length) {\n\t\tcase 1: fmt = lat>-1 ? [\"General\", \"General\", \"General\", fmt[0]] : [fmt[0], fmt[0], fmt[0], \"@\"]; break;\n\t\tcase 2: fmt = lat>-1 ? [fmt[0], fmt[0], fmt[0], fmt[1]] : [fmt[0], fmt[1], fmt[0], \"@\"]; break;\n\t\tcase 3: fmt = lat>-1 ? [fmt[0], fmt[1], fmt[0], fmt[2]] : [fmt[0], fmt[1], fmt[2], \"@\"]; break;\n\t\tcase 4: break;\n\t}\n\tvar ff = v > 0 ? fmt[0] : v < 0 ? fmt[1] : fmt[2];\n\tif(fmt[0].indexOf(\"[\") === -1 && fmt[1].indexOf(\"[\") === -1) return [l, ff];\n\tif(fmt[0].match(/\\[[=<>]/) != null || fmt[1].match(/\\[[=<>]/) != null) {\n\t\tvar m1 = fmt[0].match(cfregex2);\n\t\tvar m2 = fmt[1].match(cfregex2);\n\t\treturn chkcond(v, m1) ? [l, fmt[0]] : chkcond(v, m2) ? [l, fmt[1]] : [l, fmt[m1 != null && m2 != null ? 2 : 1]];\n\t}\n\treturn [l, ff];\n}\nfunction SSF_format(fmt/*:string|number*/,v/*:any*/,o/*:?any*/) {\n\tif(o == null) o = {};\n\tvar sfmt = \"\";\n\tswitch(typeof fmt) {\n\t\tcase \"string\":\n\t\t\tif(fmt == \"m/d/yy\" && o.dateNF) sfmt = o.dateNF;\n\t\t\telse sfmt = fmt;\n\t\t\tbreak;\n\t\tcase \"number\":\n\t\t\tif(fmt == 14 && o.dateNF) sfmt = o.dateNF;\n\t\t\telse sfmt = (o.table != null ? (o.table/*:any*/) : table_fmt)[fmt];\n\t\t\tif(sfmt == null) sfmt = (o.table && o.table[SSF_default_map[fmt]]) || table_fmt[SSF_default_map[fmt]];\n\t\t\tif(sfmt == null) sfmt = SSF_default_str[fmt] || \"General\";\n\t\t\tbreak;\n\t}\n\tif(SSF_isgeneral(sfmt,0)) return SSF_general(v, o);\n\tif(v instanceof Date) v = datenum(v, o.date1904);\n\tvar f = choose_fmt(sfmt, v);\n\tif(SSF_isgeneral(f[1])) return SSF_general(v, o);\n\tif(v === true) v = \"TRUE\"; else if(v === false) v = \"FALSE\";\n\telse if(v === \"\" || v == null) return \"\";\n\telse if(isNaN(v) && f[1].indexOf(\"0\") > -1) return \"#NUM!\";\n\telse if(!isFinite(v) && f[1].indexOf(\"0\") > -1) return \"#DIV/0!\";\n\treturn eval_fmt(f[1], v, o, f[0]);\n}\nfunction SSF_load(fmt/*:string*/, idx/*:?number*/)/*:number*/ {\n\tif(typeof idx != 'number') {\n\t\tidx = +idx || -1;\n/*::if(typeof idx != 'number') return 0x188; */\n\t\tfor(var i = 0; i < 0x0188; ++i) {\n/*::if(typeof idx != 'number') return 0x188; */\n\t\t\tif(table_fmt[i] == undefined) { if(idx < 0) idx = i; continue; }\n\t\t\tif(table_fmt[i] == fmt) { idx = i; break; }\n\t\t}\n/*::if(typeof idx != 'number') return 0x188; */\n\t\tif(idx < 0) idx = 0x187;\n\t}\n/*::if(typeof idx != 'number') return 0x188; */\n\ttable_fmt[idx] = fmt;\n\treturn idx;\n}\nfunction SSF_load_table(tbl/*:SSFTable*/)/*:void*/ {\n\tfor(var i=0; i!=0x0188; ++i)\n\t\tif(tbl[i] !== undefined) SSF_load(tbl[i], i);\n}\n\nfunction make_ssf() {\n\ttable_fmt = SSF_init_table();\n}\n\nvar SSF = {\n\tformat: SSF_format,\n\tload: SSF_load,\n\t_table: table_fmt,\n\tload_table: SSF_load_table,\n\tparse_date_code: SSF_parse_date_code,\n\tis_date: fmt_is_date,\n\tget_table: function get_table() { return SSF._table = table_fmt; }\n};\n\nvar SSFImplicit/*{[number]:string}*/ = ({\n\t\"5\": '\"$\"#,##0_);\\\\(\"$\"#,##0\\\\)',\n\t\"6\": '\"$\"#,##0_);[Red]\\\\(\"$\"#,##0\\\\)',\n\t\"7\": '\"$\"#,##0.00_);\\\\(\"$\"#,##0.00\\\\)',\n\t\"8\": '\"$\"#,##0.00_);[Red]\\\\(\"$\"#,##0.00\\\\)',\n\t\"23\": 'General', \"24\": 'General', \"25\": 'General', \"26\": 'General',\n\t\"27\": 'm/d/yy', \"28\": 'm/d/yy', \"29\": 'm/d/yy', \"30\": 'm/d/yy', \"31\": 'm/d/yy',\n\t\"32\": 'h:mm:ss', \"33\": 'h:mm:ss', \"34\": 'h:mm:ss', \"35\": 'h:mm:ss',\n\t\"36\": 'm/d/yy',\n\t\"41\": '_(* #,##0_);_(* \\(#,##0\\);_(* \"-\"_);_(@_)',\n\t\"42\": '_(\"$\"* #,##0_);_(\"$\"* \\(#,##0\\);_(\"$\"* \"-\"_);_(@_)',\n\t\"43\": '_(* #,##0.00_);_(* \\(#,##0.00\\);_(* \"-\"??_);_(@_)',\n\t\"44\": '_(\"$\"* #,##0.00_);_(\"$\"* \\(#,##0.00\\);_(\"$\"* \"-\"??_);_(@_)',\n\t\"50\": 'm/d/yy', \"51\": 'm/d/yy', \"52\": 'm/d/yy', \"53\": 'm/d/yy', \"54\": 'm/d/yy',\n\t\"55\": 'm/d/yy', \"56\": 'm/d/yy', \"57\": 'm/d/yy', \"58\": 'm/d/yy',\n\t\"59\": '0',\n\t\"60\": '0.00',\n\t\"61\": '#,##0',\n\t\"62\": '#,##0.00',\n\t\"63\": '\"$\"#,##0_);\\\\(\"$\"#,##0\\\\)',\n\t\"64\": '\"$\"#,##0_);[Red]\\\\(\"$\"#,##0\\\\)',\n\t\"65\": '\"$\"#,##0.00_);\\\\(\"$\"#,##0.00\\\\)',\n\t\"66\": '\"$\"#,##0.00_);[Red]\\\\(\"$\"#,##0.00\\\\)',\n\t\"67\": '0%',\n\t\"68\": '0.00%',\n\t\"69\": '# ?/?',\n\t\"70\": '# ??/??',\n\t\"71\": 'm/d/yy',\n\t\"72\": 'm/d/yy',\n\t\"73\": 'd-mmm-yy',\n\t\"74\": 'd-mmm',\n\t\"75\": 'mmm-yy',\n\t\"76\": 'h:mm',\n\t\"77\": 'h:mm:ss',\n\t\"78\": 'm/d/yy h:mm',\n\t\"79\": 'mm:ss',\n\t\"80\": '[h]:mm:ss',\n\t\"81\": 'mmss.0'\n}/*:any*/);\n\n/* dateNF parse TODO: move to SSF */\nvar dateNFregex = /[dD]+|[mM]+|[yYeE]+|[Hh]+|[Ss]+/g;\nfunction dateNF_regex(dateNF/*:string|number*/)/*:RegExp*/ {\n\tvar fmt = typeof dateNF == \"number\" ? table_fmt[dateNF] : dateNF;\n\tfmt = fmt.replace(dateNFregex, \"(\\\\d+)\");\n\tdateNFregex.lastIndex = 0;\n\treturn new RegExp(\"^\" + fmt + \"$\");\n}\nfunction dateNF_fix(str/*:string*/, dateNF/*:string*/, match/*:Array*/)/*:string*/ {\n\tvar Y = -1, m = -1, d = -1, H = -1, M = -1, S = -1;\n\t(dateNF.match(dateNFregex)||[]).forEach(function(n, i) {\n\t\tvar v = parseInt(match[i+1], 10);\n\t\tswitch(n.toLowerCase().charAt(0)) {\n\t\t\tcase 'y': Y = v; break; case 'd': d = v; break;\n\t\t\tcase 'h': H = v; break; case 's': S = v; break;\n\t\t\tcase 'm': if(H >= 0) M = v; else m = v; break;\n\t\t}\n\t});\n\tdateNFregex.lastIndex = 0;\n\tif(S >= 0 && M == -1 && m >= 0) { M = m; m = -1; }\n\tvar datestr = ((\"\" + (Y>=0?Y: new Date().getFullYear())).slice(-4) + \"-\" + (\"00\" + (m>=1?m:1)).slice(-2) + \"-\" + (\"00\" + (d>=1?d:1)).slice(-2));\n\tif(datestr.length == 7) datestr = \"0\" + datestr;\n\tif(datestr.length == 8) datestr = \"20\" + datestr;\n\tvar timestr = ((\"00\" + (H>=0?H:0)).slice(-2) + \":\" + (\"00\" + (M>=0?M:0)).slice(-2) + \":\" + (\"00\" + (S>=0?S:0)).slice(-2));\n\tif(H == -1 && M == -1 && S == -1) return datestr;\n\tif(Y == -1 && m == -1 && d == -1) return timestr;\n\treturn datestr + \"T\" + timestr;\n}\n\n/* table of bad formats written by third-party tools */\nvar bad_formats = {\n\t\"d.m\": \"d\\\\.m\" // Issue #2571 Google Sheets writes invalid format 'd.m', correct format is 'd\".\"m' or 'd\\\\.m'\n};\n\nfunction SSF__load(fmt, idx) {\n\treturn SSF_load(bad_formats[fmt] || fmt, idx);\n}\n\n/*::\ndeclare var ReadShift:any;\ndeclare var CheckField:any;\ndeclare var prep_blob:any;\ndeclare var __readUInt32LE:any;\ndeclare var __readInt32LE:any;\ndeclare var __toBuffer:any;\ndeclare var __utf16le:any;\ndeclare var bconcat:any;\ndeclare var s2a:any;\ndeclare var chr0:any;\ndeclare var chr1:any;\ndeclare var has_buf:boolean;\ndeclare var new_buf:any;\ndeclare var new_raw_buf:any;\ndeclare var new_unsafe_buf:any;\ndeclare var Buffer_from:any;\n*/\n/* cfb.js (C) 2013-present SheetJS -- http://sheetjs.com */\n/* vim: set ts=2: */\n/*jshint eqnull:true */\n/*exported CFB */\n/*global Uint8Array:false, Uint16Array:false */\n\n/*::\ntype SectorEntry = {\n\tname?:string;\n\tnodes?:Array;\n\tdata:RawBytes;\n};\ntype SectorList = {\n\t[k:string|number]:SectorEntry;\n\tname:?string;\n\tfat_addrs:Array;\n\tssz:number;\n}\ntype CFBFiles = {[n:string]:CFBEntry};\n*/\n/* crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */\n/* vim: set ts=2: */\n/*exported CRC32 */\nvar CRC32 = /*#__PURE__*/(function() {\nvar CRC32 = {};\nCRC32.version = '1.2.0';\n/*::\ntype CRC32TableType = Array | Int32Array;\n*/\n/*global Int32Array */\nfunction signed_crc_table()/*:any*/ {\n\tvar c = 0, table/*:Array*/ = new Array(256);\n\n\tfor(var n =0; n != 256; ++n){\n\t\tc = n;\n\t\tc = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));\n\t\tc = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));\n\t\tc = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));\n\t\tc = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));\n\t\tc = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));\n\t\tc = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));\n\t\tc = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));\n\t\tc = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));\n\t\ttable[n] = c;\n\t}\n\n\treturn typeof Int32Array !== 'undefined' ? new Int32Array(table) : table;\n}\n\nvar T0 = signed_crc_table();\nfunction slice_by_16_tables(T) {\n\tvar c = 0, v = 0, n = 0, table/*:Array*/ = typeof Int32Array !== 'undefined' ? new Int32Array(4096) : new Array(4096) ;\n\n\tfor(n = 0; n != 256; ++n) table[n] = T[n];\n\tfor(n = 0; n != 256; ++n) {\n\t\tv = T[n];\n\t\tfor(c = 256 + n; c < 4096; c += 256) v = table[c] = (v >>> 8) ^ T[v & 0xFF];\n\t}\n\tvar out = [];\n\tfor(n = 1; n != 16; ++n) out[n - 1] = typeof Int32Array !== 'undefined' && typeof table.subarray == \"function\" ? table.subarray(n * 256, n * 256 + 256) : table.slice(n * 256, n * 256 + 256);\n\treturn out;\n}\nvar TT = slice_by_16_tables(T0);\nvar T1 = TT[0], T2 = TT[1], T3 = TT[2], T4 = TT[3], T5 = TT[4];\nvar T6 = TT[5], T7 = TT[6], T8 = TT[7], T9 = TT[8], Ta = TT[9];\nvar Tb = TT[10], Tc = TT[11], Td = TT[12], Te = TT[13], Tf = TT[14];\nfunction crc32_bstr(bstr/*:string*/, seed/*:?number*/)/*:number*/ {\n\tvar C = seed/*:: ? 0 : 0 */ ^ -1;\n\tfor(var i = 0, L = bstr.length; i < L;) C = (C>>>8) ^ T0[(C^bstr.charCodeAt(i++))&0xFF];\n\treturn ~C;\n}\n\nfunction crc32_buf(B/*:Uint8Array|Array*/, seed/*:number*/)/*:number*/ {\n\tvar C = seed/*:: ? 0 : 0 */ ^ -1, L = B.length - 15, i = 0;\n\tfor(; i < L;) C =\n\t\tTf[B[i++] ^ (C & 255)] ^\n\t\tTe[B[i++] ^ ((C >> 8) & 255)] ^\n\t\tTd[B[i++] ^ ((C >> 16) & 255)] ^\n\t\tTc[B[i++] ^ (C >>> 24)] ^\n\t\tTb[B[i++]] ^ Ta[B[i++]] ^ T9[B[i++]] ^ T8[B[i++]] ^\n\t\tT7[B[i++]] ^ T6[B[i++]] ^ T5[B[i++]] ^ T4[B[i++]] ^\n\t\tT3[B[i++]] ^ T2[B[i++]] ^ T1[B[i++]] ^ T0[B[i++]];\n\tL += 15;\n\twhile(i < L) C = (C>>>8) ^ T0[(C^B[i++])&0xFF];\n\treturn ~C;\n}\n\nfunction crc32_str(str/*:string*/, seed/*:number*/)/*:number*/ {\n\tvar C = seed ^ -1;\n\tfor(var i = 0, L = str.length, c = 0, d = 0; i < L;) {\n\t\tc = str.charCodeAt(i++);\n\t\tif(c < 0x80) {\n\t\t\tC = (C>>>8) ^ T0[(C^c)&0xFF];\n\t\t} else if(c < 0x800) {\n\t\t\tC = (C>>>8) ^ T0[(C ^ (192|((c>>6)&31)))&0xFF];\n\t\t\tC = (C>>>8) ^ T0[(C ^ (128|(c&63)))&0xFF];\n\t\t} else if(c >= 0xD800 && c < 0xE000) {\n\t\t\tc = (c&1023)+64; d = str.charCodeAt(i++)&1023;\n\t\t\tC = (C>>>8) ^ T0[(C ^ (240|((c>>8)&7)))&0xFF];\n\t\t\tC = (C>>>8) ^ T0[(C ^ (128|((c>>2)&63)))&0xFF];\n\t\t\tC = (C>>>8) ^ T0[(C ^ (128|((d>>6)&15)|((c&3)<<4)))&0xFF];\n\t\t\tC = (C>>>8) ^ T0[(C ^ (128|(d&63)))&0xFF];\n\t\t} else {\n\t\t\tC = (C>>>8) ^ T0[(C ^ (224|((c>>12)&15)))&0xFF];\n\t\t\tC = (C>>>8) ^ T0[(C ^ (128|((c>>6)&63)))&0xFF];\n\t\t\tC = (C>>>8) ^ T0[(C ^ (128|(c&63)))&0xFF];\n\t\t}\n\t}\n\treturn ~C;\n}\nCRC32.table = T0;\nCRC32.bstr = crc32_bstr;\nCRC32.buf = crc32_buf;\nCRC32.str = crc32_str;\nreturn CRC32;\n})();\n/* [MS-CFB] v20171201 */\nvar CFB = /*#__PURE__*/(function _CFB(){\nvar exports/*:CFBModule*/ = /*::(*/{}/*:: :any)*/;\nexports.version = '1.2.2';\n/* [MS-CFB] 2.6.4 */\nfunction namecmp(l/*:string*/, r/*:string*/)/*:number*/ {\n\tvar L = l.split(\"/\"), R = r.split(\"/\");\n\tfor(var i = 0, c = 0, Z = Math.min(L.length, R.length); i < Z; ++i) {\n\t\tif((c = L[i].length - R[i].length)) return c;\n\t\tif(L[i] != R[i]) return L[i] < R[i] ? -1 : 1;\n\t}\n\treturn L.length - R.length;\n}\nfunction dirname(p/*:string*/)/*:string*/ {\n\tif(p.charAt(p.length - 1) == \"/\") return (p.slice(0,-1).indexOf(\"/\") === -1) ? p : dirname(p.slice(0, -1));\n\tvar c = p.lastIndexOf(\"/\");\n\treturn (c === -1) ? p : p.slice(0, c+1);\n}\n\nfunction filename(p/*:string*/)/*:string*/ {\n\tif(p.charAt(p.length - 1) == \"/\") return filename(p.slice(0, -1));\n\tvar c = p.lastIndexOf(\"/\");\n\treturn (c === -1) ? p : p.slice(c+1);\n}\n/* -------------------------------------------------------------------------- */\n/* DOS Date format:\n high|YYYYYYYm.mmmddddd.HHHHHMMM.MMMSSSSS|low\n add 1980 to stored year\n stored second should be doubled\n*/\n\n/* write JS date to buf as a DOS date */\nfunction write_dos_date(buf/*:CFBlob*/, date/*:Date|string*/) {\n\tif(typeof date === \"string\") date = new Date(date);\n\tvar hms/*:number*/ = date.getHours();\n\thms = hms << 6 | date.getMinutes();\n\thms = hms << 5 | (date.getSeconds()>>>1);\n\tbuf.write_shift(2, hms);\n\tvar ymd/*:number*/ = (date.getFullYear() - 1980);\n\tymd = ymd << 4 | (date.getMonth()+1);\n\tymd = ymd << 5 | date.getDate();\n\tbuf.write_shift(2, ymd);\n}\n\n/* read four bytes from buf and interpret as a DOS date */\nfunction parse_dos_date(buf/*:CFBlob*/)/*:Date*/ {\n\tvar hms = buf.read_shift(2) & 0xFFFF;\n\tvar ymd = buf.read_shift(2) & 0xFFFF;\n\tvar val = new Date();\n\tvar d = ymd & 0x1F; ymd >>>= 5;\n\tvar m = ymd & 0x0F; ymd >>>= 4;\n\tval.setMilliseconds(0);\n\tval.setFullYear(ymd + 1980);\n\tval.setMonth(m-1);\n\tval.setDate(d);\n\tvar S = hms & 0x1F; hms >>>= 5;\n\tvar M = hms & 0x3F; hms >>>= 6;\n\tval.setHours(hms);\n\tval.setMinutes(M);\n\tval.setSeconds(S<<1);\n\treturn val;\n}\nfunction parse_extra_field(blob/*:CFBlob*/)/*:any*/ {\n\tprep_blob(blob, 0);\n\tvar o = /*::(*/{}/*:: :any)*/;\n\tvar flags = 0;\n\twhile(blob.l <= blob.length - 4) {\n\t\tvar type = blob.read_shift(2);\n\t\tvar sz = blob.read_shift(2), tgt = blob.l + sz;\n\t\tvar p = {};\n\t\tswitch(type) {\n\t\t\t/* UNIX-style Timestamps */\n\t\t\tcase 0x5455: {\n\t\t\t\tflags = blob.read_shift(1);\n\t\t\t\tif(flags & 1) p.mtime = blob.read_shift(4);\n\t\t\t\t/* for some reason, CD flag corresponds to LFH */\n\t\t\t\tif(sz > 5) {\n\t\t\t\t\tif(flags & 2) p.atime = blob.read_shift(4);\n\t\t\t\t\tif(flags & 4) p.ctime = blob.read_shift(4);\n\t\t\t\t}\n\t\t\t\tif(p.mtime) p.mt = new Date(p.mtime*1000);\n\t\t\t} break;\n\t\t\t/* ZIP64 Extended Information Field */\n\t\t\tcase 0x0001: {\n\t\t\t\tvar sz1 = blob.read_shift(4), sz2 = blob.read_shift(4);\n\t\t\t\tp.usz = (sz2 * Math.pow(2,32) + sz1);\n\t\t\t\tsz1 = blob.read_shift(4); sz2 = blob.read_shift(4);\n\t\t\t\tp.csz = (sz2 * Math.pow(2,32) + sz1);\n\t\t\t\t// NOTE: volume fields are skipped\n\t\t\t} break;\n\t\t}\n\t\tblob.l = tgt;\n\t\to[type] = p;\n\t}\n\treturn o;\n}\nvar fs/*:: = require('fs'); */;\nfunction get_fs() { return fs || (fs = _fs); }\nfunction parse(file/*:RawBytes*/, options/*:CFBReadOpts*/)/*:CFBContainer*/ {\nif(file[0] == 0x50 && file[1] == 0x4b) return parse_zip(file, options);\nif((file[0] | 0x20) == 0x6d && (file[1]|0x20) == 0x69) return parse_mad(file, options);\nif(file.length < 512) throw new Error(\"CFB file size \" + file.length + \" < 512\");\nvar mver = 3;\nvar ssz = 512;\nvar nmfs = 0; // number of mini FAT sectors\nvar difat_sec_cnt = 0;\nvar dir_start = 0;\nvar minifat_start = 0;\nvar difat_start = 0;\n\nvar fat_addrs/*:Array*/ = []; // locations of FAT sectors\n\n/* [MS-CFB] 2.2 Compound File Header */\nvar blob/*:CFBlob*/ = /*::(*/file.slice(0,512)/*:: :any)*/;\nprep_blob(blob, 0);\n\n/* major version */\nvar mv = check_get_mver(blob);\nmver = mv[0];\nswitch(mver) {\n\tcase 3: ssz = 512; break; case 4: ssz = 4096; break;\n\tcase 0: if(mv[1] == 0) return parse_zip(file, options);\n\t/* falls through */\n\tdefault: throw new Error(\"Major Version: Expected 3 or 4 saw \" + mver);\n}\n\n/* reprocess header */\nif(ssz !== 512) { blob = /*::(*/file.slice(0,ssz)/*:: :any)*/; prep_blob(blob, 28 /* blob.l */); }\n/* Save header for final object */\nvar header/*:RawBytes*/ = file.slice(0,ssz);\n\ncheck_shifts(blob, mver);\n\n// Number of Directory Sectors\nvar dir_cnt/*:number*/ = blob.read_shift(4, 'i');\nif(mver === 3 && dir_cnt !== 0) throw new Error('# Directory Sectors: Expected 0 saw ' + dir_cnt);\n\n// Number of FAT Sectors\nblob.l += 4;\n\n// First Directory Sector Location\ndir_start = blob.read_shift(4, 'i');\n\n// Transaction Signature\nblob.l += 4;\n\n// Mini Stream Cutoff Size\nblob.chk('00100000', 'Mini Stream Cutoff Size: ');\n\n// First Mini FAT Sector Location\nminifat_start = blob.read_shift(4, 'i');\n\n// Number of Mini FAT Sectors\nnmfs = blob.read_shift(4, 'i');\n\n// First DIFAT sector location\ndifat_start = blob.read_shift(4, 'i');\n\n// Number of DIFAT Sectors\ndifat_sec_cnt = blob.read_shift(4, 'i');\n\n// Grab FAT Sector Locations\nfor(var q = -1, j = 0; j < 109; ++j) { /* 109 = (512 - blob.l)>>>2; */\n\tq = blob.read_shift(4, 'i');\n\tif(q<0) break;\n\tfat_addrs[j] = q;\n}\n\n/** Break the file up into sectors */\nvar sectors/*:Array*/ = sectorify(file, ssz);\n\nsleuth_fat(difat_start, difat_sec_cnt, sectors, ssz, fat_addrs);\n\n/** Chains */\nvar sector_list/*:SectorList*/ = make_sector_list(sectors, dir_start, fat_addrs, ssz);\n\nif(dir_start < sector_list.length) sector_list[dir_start].name = \"!Directory\";\nif(nmfs > 0 && minifat_start !== ENDOFCHAIN) sector_list[minifat_start].name = \"!MiniFAT\";\nsector_list[fat_addrs[0]].name = \"!FAT\";\nsector_list.fat_addrs = fat_addrs;\nsector_list.ssz = ssz;\n\n/* [MS-CFB] 2.6.1 Compound File Directory Entry */\nvar files/*:CFBFiles*/ = {}, Paths/*:Array*/ = [], FileIndex/*:CFBFileIndex*/ = [], FullPaths/*:Array*/ = [];\nread_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex, minifat_start);\n\nbuild_full_paths(FileIndex, FullPaths, Paths);\nPaths.shift();\n\nvar o = {\n\tFileIndex: FileIndex,\n\tFullPaths: FullPaths\n};\n\n// $FlowIgnore\nif(options && options.raw) o.raw = {header: header, sectors: sectors};\nreturn o;\n} // parse\n\n/* [MS-CFB] 2.2 Compound File Header -- read up to major version */\nfunction check_get_mver(blob/*:CFBlob*/)/*:[number, number]*/ {\n\tif(blob[blob.l] == 0x50 && blob[blob.l + 1] == 0x4b) return [0, 0];\n\t// header signature 8\n\tblob.chk(HEADER_SIGNATURE, 'Header Signature: ');\n\n\t// clsid 16\n\t//blob.chk(HEADER_CLSID, 'CLSID: ');\n\tblob.l += 16;\n\n\t// minor version 2\n\tvar mver/*:number*/ = blob.read_shift(2, 'u');\n\n\treturn [blob.read_shift(2,'u'), mver];\n}\nfunction check_shifts(blob/*:CFBlob*/, mver/*:number*/)/*:void*/ {\n\tvar shift = 0x09;\n\n\t// Byte Order\n\t//blob.chk('feff', 'Byte Order: '); // note: some writers put 0xffff\n\tblob.l += 2;\n\n\t// Sector Shift\n\tswitch((shift = blob.read_shift(2))) {\n\t\tcase 0x09: if(mver != 3) throw new Error('Sector Shift: Expected 9 saw ' + shift); break;\n\t\tcase 0x0c: if(mver != 4) throw new Error('Sector Shift: Expected 12 saw ' + shift); break;\n\t\tdefault: throw new Error('Sector Shift: Expected 9 or 12 saw ' + shift);\n\t}\n\n\t// Mini Sector Shift\n\tblob.chk('0600', 'Mini Sector Shift: ');\n\n\t// Reserved\n\tblob.chk('000000000000', 'Reserved: ');\n}\n\n/** Break the file up into sectors */\nfunction sectorify(file/*:RawBytes*/, ssz/*:number*/)/*:Array*/ {\n\tvar nsectors = Math.ceil(file.length/ssz)-1;\n\tvar sectors/*:Array*/ = [];\n\tfor(var i=1; i < nsectors; ++i) sectors[i-1] = file.slice(i*ssz,(i+1)*ssz);\n\tsectors[nsectors-1] = file.slice(nsectors*ssz);\n\treturn sectors;\n}\n\n/* [MS-CFB] 2.6.4 Red-Black Tree */\nfunction build_full_paths(FI/*:CFBFileIndex*/, FP/*:Array*/, Paths/*:Array*/)/*:void*/ {\n\tvar i = 0, L = 0, R = 0, C = 0, j = 0, pl = Paths.length;\n\tvar dad/*:Array*/ = [], q/*:Array*/ = [];\n\n\tfor(; i < pl; ++i) { dad[i]=q[i]=i; FP[i]=Paths[i]; }\n\n\tfor(; j < q.length; ++j) {\n\t\ti = q[j];\n\t\tL = FI[i].L; R = FI[i].R; C = FI[i].C;\n\t\tif(dad[i] === i) {\n\t\t\tif(L !== -1 /*NOSTREAM*/ && dad[L] !== L) dad[i] = dad[L];\n\t\t\tif(R !== -1 && dad[R] !== R) dad[i] = dad[R];\n\t\t}\n\t\tif(C !== -1 /*NOSTREAM*/) dad[C] = i;\n\t\tif(L !== -1 && i != dad[i]) { dad[L] = dad[i]; if(q.lastIndexOf(L) < j) q.push(L); }\n\t\tif(R !== -1 && i != dad[i]) { dad[R] = dad[i]; if(q.lastIndexOf(R) < j) q.push(R); }\n\t}\n\tfor(i=1; i < pl; ++i) if(dad[i] === i) {\n\t\tif(R !== -1 /*NOSTREAM*/ && dad[R] !== R) dad[i] = dad[R];\n\t\telse if(L !== -1 && dad[L] !== L) dad[i] = dad[L];\n\t}\n\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type === 0 /* unknown */) continue;\n\t\tj = i;\n\t\tif(j != dad[j]) do {\n\t\t\tj = dad[j];\n\t\t\tFP[i] = FP[j] + \"/\" + FP[i];\n\t\t} while (j !== 0 && -1 !== dad[j] && j != dad[j]);\n\t\tdad[i] = -1;\n\t}\n\n\tFP[0] += \"/\";\n\tfor(i=1; i < pl; ++i) {\n\t\tif(FI[i].type !== 2 /* stream */) FP[i] += \"/\";\n\t}\n}\n\nfunction get_mfat_entry(entry/*:CFBEntry*/, payload/*:RawBytes*/, mini/*:?RawBytes*/)/*:CFBlob*/ {\n\tvar start = entry.start, size = entry.size;\n\t//return (payload.slice(start*MSSZ, start*MSSZ + size)/*:any*/);\n\tvar o = [];\n\tvar idx = start;\n\twhile(mini && size > 0 && idx >= 0) {\n\t\to.push(payload.slice(idx * MSSZ, idx * MSSZ + MSSZ));\n\t\tsize -= MSSZ;\n\t\tidx = __readInt32LE(mini, idx * 4);\n\t}\n\tif(o.length === 0) return (new_buf(0)/*:any*/);\n\treturn (bconcat(o).slice(0, entry.size)/*:any*/);\n}\n\n/** Chase down the rest of the DIFAT chain to build a comprehensive list\n DIFAT chains by storing the next sector number as the last 32 bits */\nfunction sleuth_fat(idx/*:number*/, cnt/*:number*/, sectors/*:Array*/, ssz/*:number*/, fat_addrs)/*:void*/ {\n\tvar q/*:number*/ = ENDOFCHAIN;\n\tif(idx === ENDOFCHAIN) {\n\t\tif(cnt !== 0) throw new Error(\"DIFAT chain shorter than expected\");\n\t} else if(idx !== -1 /*FREESECT*/) {\n\t\tvar sector = sectors[idx], m = (ssz>>>2)-1;\n\t\tif(!sector) return;\n\t\tfor(var i = 0; i < m; ++i) {\n\t\t\tif((q = __readInt32LE(sector,i*4)) === ENDOFCHAIN) break;\n\t\t\tfat_addrs.push(q);\n\t\t}\n\t\tif(cnt >= 1) sleuth_fat(__readInt32LE(sector,ssz-4),cnt - 1, sectors, ssz, fat_addrs);\n\t}\n}\n\n/** Follow the linked list of sectors for a given starting point */\nfunction get_sector_list(sectors/*:Array*/, start/*:number*/, fat_addrs/*:Array*/, ssz/*:number*/, chkd/*:?Array*/)/*:SectorEntry*/ {\n\tvar buf/*:Array*/ = [], buf_chain/*:Array*/ = [];\n\tif(!chkd) chkd = [];\n\tvar modulus = ssz - 1, j = 0, jj = 0;\n\tfor(j=start; j>=0;) {\n\t\tchkd[j] = true;\n\t\tbuf[buf.length] = j;\n\t\tbuf_chain.push(sectors[j]);\n\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\tjj = ((j*4) & modulus);\n\t\tif(ssz < 4 + jj) throw new Error(\"FAT boundary crossed: \" + j + \" 4 \"+ssz);\n\t\tif(!sectors[addr]) break;\n\t\tj = __readInt32LE(sectors[addr], jj);\n\t}\n\treturn {nodes: buf, data:__toBuffer([buf_chain])};\n}\n\n/** Chase down the sector linked lists */\nfunction make_sector_list(sectors/*:Array*/, dir_start/*:number*/, fat_addrs/*:Array*/, ssz/*:number*/)/*:SectorList*/ {\n\tvar sl = sectors.length, sector_list/*:SectorList*/ = ([]/*:any*/);\n\tvar chkd/*:Array*/ = [], buf/*:Array*/ = [], buf_chain/*:Array*/ = [];\n\tvar modulus = ssz - 1, i=0, j=0, k=0, jj=0;\n\tfor(i=0; i < sl; ++i) {\n\t\tbuf = ([]/*:Array*/);\n\t\tk = (i + dir_start); if(k >= sl) k-=sl;\n\t\tif(chkd[k]) continue;\n\t\tbuf_chain = [];\n\t\tvar seen = [];\n\t\tfor(j=k; j>=0;) {\n\t\t\tseen[j] = true;\n\t\t\tchkd[j] = true;\n\t\t\tbuf[buf.length] = j;\n\t\t\tbuf_chain.push(sectors[j]);\n\t\t\tvar addr/*:number*/ = fat_addrs[Math.floor(j*4/ssz)];\n\t\t\tjj = ((j*4) & modulus);\n\t\t\tif(ssz < 4 + jj) throw new Error(\"FAT boundary crossed: \" + j + \" 4 \"+ssz);\n\t\t\tif(!sectors[addr]) break;\n\t\t\tj = __readInt32LE(sectors[addr], jj);\n\t\t\tif(seen[j]) break;\n\t\t}\n\t\tsector_list[k] = ({nodes: buf, data:__toBuffer([buf_chain])}/*:SectorEntry*/);\n\t}\n\treturn sector_list;\n}\n\n/* [MS-CFB] 2.6.1 Compound File Directory Entry */\nfunction read_directory(dir_start/*:number*/, sector_list/*:SectorList*/, sectors/*:Array*/, Paths/*:Array*/, nmfs, files, FileIndex, mini) {\n\tvar minifat_store = 0, pl = (Paths.length?2:0);\n\tvar sector = sector_list[dir_start].data;\n\tvar i = 0, namelen = 0, name;\n\tfor(; i < sector.length; i+= 128) {\n\t\tvar blob/*:CFBlob*/ = /*::(*/sector.slice(i, i+128)/*:: :any)*/;\n\t\tprep_blob(blob, 64);\n\t\tnamelen = blob.read_shift(2);\n\t\tname = __utf16le(blob,0,namelen-pl);\n\t\tPaths.push(name);\n\t\tvar o/*:CFBEntry*/ = ({\n\t\t\tname: name,\n\t\t\ttype: blob.read_shift(1),\n\t\t\tcolor: blob.read_shift(1),\n\t\t\tL: blob.read_shift(4, 'i'),\n\t\t\tR: blob.read_shift(4, 'i'),\n\t\t\tC: blob.read_shift(4, 'i'),\n\t\t\tclsid: blob.read_shift(16),\n\t\t\tstate: blob.read_shift(4, 'i'),\n\t\t\tstart: 0,\n\t\t\tsize: 0\n\t\t});\n\t\tvar ctime/*:number*/ = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(ctime !== 0) o.ct = read_date(blob, blob.l-8);\n\t\tvar mtime/*:number*/ = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(mtime !== 0) o.mt = read_date(blob, blob.l-8);\n\t\to.start = blob.read_shift(4, 'i');\n\t\to.size = blob.read_shift(4, 'i');\n\t\tif(o.size < 0 && o.start < 0) { o.size = o.type = 0; o.start = ENDOFCHAIN; o.name = \"\"; }\n\t\tif(o.type === 5) { /* root */\n\t\t\tminifat_store = o.start;\n\t\t\tif(nmfs > 0 && minifat_store !== ENDOFCHAIN) sector_list[minifat_store].name = \"!StreamData\";\n\t\t\t/*minifat_size = o.size;*/\n\t\t} else if(o.size >= 4096 /* MSCSZ */) {\n\t\t\to.storage = 'fat';\n\t\t\tif(sector_list[o.start] === undefined) sector_list[o.start] = get_sector_list(sectors, o.start, sector_list.fat_addrs, sector_list.ssz);\n\t\t\tsector_list[o.start].name = o.name;\n\t\t\to.content = (sector_list[o.start].data.slice(0,o.size)/*:any*/);\n\t\t} else {\n\t\t\to.storage = 'minifat';\n\t\t\tif(o.size < 0) o.size = 0;\n\t\t\telse if(minifat_store !== ENDOFCHAIN && o.start !== ENDOFCHAIN && sector_list[minifat_store]) {\n\t\t\t\to.content = get_mfat_entry(o, sector_list[minifat_store].data, (sector_list[mini]||{}).data);\n\t\t\t}\n\t\t}\n\t\tif(o.content) prep_blob(o.content, 0);\n\t\tfiles[name] = o;\n\t\tFileIndex.push(o);\n\t}\n}\n\nfunction read_date(blob/*:RawBytes|CFBlob*/, offset/*:number*/)/*:Date*/ {\n\treturn new Date(( ( (__readUInt32LE(blob,offset+4)/1e7)*Math.pow(2,32)+__readUInt32LE(blob,offset)/1e7 ) - 11644473600)*1000);\n}\n\nfunction read_file(filename/*:string*/, options/*:CFBReadOpts*/) {\n\tget_fs();\n\treturn parse(fs.readFileSync(filename), options);\n}\n\nfunction read(blob/*:RawBytes|string*/, options/*:CFBReadOpts*/) {\n\tvar type = options && options.type;\n\tif(!type) {\n\t\tif(has_buf && Buffer.isBuffer(blob)) type = \"buffer\";\n\t}\n\tswitch(type || \"base64\") {\n\t\tcase \"file\": /*:: if(typeof blob !== 'string') throw \"Must pass a filename when type='file'\"; */return read_file(blob, options);\n\t\tcase \"base64\": /*:: if(typeof blob !== 'string') throw \"Must pass a base64-encoded binary string when type='file'\"; */return parse(s2a(Base64_decode(blob)), options);\n\t\tcase \"binary\": /*:: if(typeof blob !== 'string') throw \"Must pass a binary string when type='file'\"; */return parse(s2a(blob), options);\n\t}\n\treturn parse(/*::typeof blob == 'string' ? new Buffer(blob, 'utf-8') : */blob, options);\n}\n\nfunction init_cfb(cfb/*:CFBContainer*/, opts/*:?any*/)/*:void*/ {\n\tvar o = opts || {}, root = o.root || \"Root Entry\";\n\tif(!cfb.FullPaths) cfb.FullPaths = [];\n\tif(!cfb.FileIndex) cfb.FileIndex = [];\n\tif(cfb.FullPaths.length !== cfb.FileIndex.length) throw new Error(\"inconsistent CFB structure\");\n\tif(cfb.FullPaths.length === 0) {\n\t\tcfb.FullPaths[0] = root + \"/\";\n\t\tcfb.FileIndex[0] = ({ name: root, type: 5 }/*:any*/);\n\t}\n\tif(o.CLSID) cfb.FileIndex[0].clsid = o.CLSID;\n\tseed_cfb(cfb);\n}\nfunction seed_cfb(cfb/*:CFBContainer*/)/*:void*/ {\n\tvar nm = \"\\u0001Sh33tJ5\";\n\tif(CFB.find(cfb, \"/\" + nm)) return;\n\tvar p = new_buf(4); p[0] = 55; p[1] = p[3] = 50; p[2] = 54;\n\tcfb.FileIndex.push(({ name: nm, type: 2, content:p, size:4, L:69, R:69, C:69 }/*:any*/));\n\tcfb.FullPaths.push(cfb.FullPaths[0] + nm);\n\trebuild_cfb(cfb);\n}\nfunction rebuild_cfb(cfb/*:CFBContainer*/, f/*:?boolean*/)/*:void*/ {\n\tinit_cfb(cfb);\n\tvar gc = false, s = false;\n\tfor(var i = cfb.FullPaths.length - 1; i >= 0; --i) {\n\t\tvar _file = cfb.FileIndex[i];\n\t\tswitch(_file.type) {\n\t\t\tcase 0:\n\t\t\t\tif(s) gc = true;\n\t\t\t\telse { cfb.FileIndex.pop(); cfb.FullPaths.pop(); }\n\t\t\t\tbreak;\n\t\t\tcase 1: case 2: case 5:\n\t\t\t\ts = true;\n\t\t\t\tif(isNaN(_file.R * _file.L * _file.C)) gc = true;\n\t\t\t\tif(_file.R > -1 && _file.L > -1 && _file.R == _file.L) gc = true;\n\t\t\t\tbreak;\n\t\t\tdefault: gc = true; break;\n\t\t}\n\t}\n\tif(!gc && !f) return;\n\n\tvar now = new Date(1987, 1, 19), j = 0;\n\t// Track which names exist\n\tvar fullPaths = Object.create ? Object.create(null) : {};\n\tvar data/*:Array<[string, CFBEntry]>*/ = [];\n\tfor(i = 0; i < cfb.FullPaths.length; ++i) {\n\t\tfullPaths[cfb.FullPaths[i]] = true;\n\t\tif(cfb.FileIndex[i].type === 0) continue;\n\t\tdata.push([cfb.FullPaths[i], cfb.FileIndex[i]]);\n\t}\n\tfor(i = 0; i < data.length; ++i) {\n\t\tvar dad = dirname(data[i][0]);\n\t\ts = fullPaths[dad];\n\t\twhile(!s) {\n\t\t\twhile(dirname(dad) && !fullPaths[dirname(dad)]) dad = dirname(dad);\n\n\t\t\tdata.push([dad, ({\n\t\t\t\tname: filename(dad).replace(\"/\",\"\"),\n\t\t\t\ttype: 1,\n\t\t\t\tclsid: HEADER_CLSID,\n\t\t\t\tct: now, mt: now,\n\t\t\t\tcontent: null\n\t\t\t}/*:any*/)]);\n\n\t\t\t// Add name to set\n\t\t\tfullPaths[dad] = true;\n\n\t\t\tdad = dirname(data[i][0]);\n\t\t\ts = fullPaths[dad];\n\t\t}\n\t}\n\n\tdata.sort(function(x,y) { return namecmp(x[0], y[0]); });\n\tcfb.FullPaths = []; cfb.FileIndex = [];\n\tfor(i = 0; i < data.length; ++i) { cfb.FullPaths[i] = data[i][0]; cfb.FileIndex[i] = data[i][1]; }\n\tfor(i = 0; i < data.length; ++i) {\n\t\tvar elt = cfb.FileIndex[i];\n\t\tvar nm = cfb.FullPaths[i];\n\n\t\telt.name = filename(nm).replace(\"/\",\"\");\n\t\telt.L = elt.R = elt.C = -(elt.color = 1);\n\t\telt.size = elt.content ? elt.content.length : 0;\n\t\telt.start = 0;\n\t\telt.clsid = (elt.clsid || HEADER_CLSID);\n\t\tif(i === 0) {\n\t\t\telt.C = data.length > 1 ? 1 : -1;\n\t\t\telt.size = 0;\n\t\t\telt.type = 5;\n\t\t} else if(nm.slice(-1) == \"/\") {\n\t\t\tfor(j=i+1;j < data.length; ++j) if(dirname(cfb.FullPaths[j])==nm) break;\n\t\t\telt.C = j >= data.length ? -1 : j;\n\t\t\tfor(j=i+1;j < data.length; ++j) if(dirname(cfb.FullPaths[j])==dirname(nm)) break;\n\t\t\telt.R = j >= data.length ? -1 : j;\n\t\t\telt.type = 1;\n\t\t} else {\n\t\t\tif(dirname(cfb.FullPaths[i+1]||\"\") == dirname(nm)) elt.R = i + 1;\n\t\t\telt.type = 2;\n\t\t}\n\t}\n\n}\n\nfunction _write(cfb/*:CFBContainer*/, options/*:CFBWriteOpts*/)/*:RawBytes|string*/ {\n\tvar _opts = options || {};\n\t/* MAD is order-sensitive, skip rebuild and sort */\n\tif(_opts.fileType == 'mad') return write_mad(cfb, _opts);\n\trebuild_cfb(cfb);\n\tswitch(_opts.fileType) {\n\t\tcase 'zip': return write_zip(cfb, _opts);\n\t\t//case 'mad': return write_mad(cfb, _opts);\n\t}\n\tvar L = (function(cfb/*:CFBContainer*/)/*:Array*/{\n\t\tvar mini_size = 0, fat_size = 0;\n\t\tfor(var i = 0; i < cfb.FileIndex.length; ++i) {\n\t\t\tvar file = cfb.FileIndex[i];\n\t\t\tif(!file.content) continue;\n\t\t\tvar flen = file.content.length;\n\t\t\tif(flen > 0){\n\t\t\t\tif(flen < 0x1000) mini_size += (flen + 0x3F) >> 6;\n\t\t\t\telse fat_size += (flen + 0x01FF) >> 9;\n\t\t\t}\n\t\t}\n\t\tvar dir_cnt = (cfb.FullPaths.length +3) >> 2;\n\t\tvar mini_cnt = (mini_size + 7) >> 3;\n\t\tvar mfat_cnt = (mini_size + 0x7F) >> 7;\n\t\tvar fat_base = mini_cnt + fat_size + dir_cnt + mfat_cnt;\n\t\tvar fat_cnt = (fat_base + 0x7F) >> 7;\n\t\tvar difat_cnt = fat_cnt <= 109 ? 0 : Math.ceil((fat_cnt-109)/0x7F);\n\t\twhile(((fat_base + fat_cnt + difat_cnt + 0x7F) >> 7) > fat_cnt) difat_cnt = ++fat_cnt <= 109 ? 0 : Math.ceil((fat_cnt-109)/0x7F);\n\t\tvar L = [1, difat_cnt, fat_cnt, mfat_cnt, dir_cnt, fat_size, mini_size, 0];\n\t\tcfb.FileIndex[0].size = mini_size << 6;\n\t\tL[7] = (cfb.FileIndex[0].start=L[0]+L[1]+L[2]+L[3]+L[4]+L[5])+((L[6]+7) >> 3);\n\t\treturn L;\n\t})(cfb);\n\tvar o = new_buf(L[7] << 9);\n\tvar i = 0, T = 0;\n\t{\n\t\tfor(i = 0; i < 8; ++i) o.write_shift(1, HEADER_SIG[i]);\n\t\tfor(i = 0; i < 8; ++i) o.write_shift(2, 0);\n\t\to.write_shift(2, 0x003E);\n\t\to.write_shift(2, 0x0003);\n\t\to.write_shift(2, 0xFFFE);\n\t\to.write_shift(2, 0x0009);\n\t\to.write_shift(2, 0x0006);\n\t\tfor(i = 0; i < 3; ++i) o.write_shift(2, 0);\n\t\to.write_shift(4, 0);\n\t\to.write_shift(4, L[2]);\n\t\to.write_shift(4, L[0] + L[1] + L[2] + L[3] - 1);\n\t\to.write_shift(4, 0);\n\t\to.write_shift(4, 1<<12);\n\t\to.write_shift(4, L[3] ? L[0] + L[1] + L[2] - 1: ENDOFCHAIN);\n\t\to.write_shift(4, L[3]);\n\t\to.write_shift(-4, L[1] ? L[0] - 1: ENDOFCHAIN);\n\t\to.write_shift(4, L[1]);\n\t\tfor(i = 0; i < 109; ++i) o.write_shift(-4, i < L[2] ? L[1] + i : -1);\n\t}\n\tif(L[1]) {\n\t\tfor(T = 0; T < L[1]; ++T) {\n\t\t\tfor(; i < 236 + T * 127; ++i) o.write_shift(-4, i < L[2] ? L[1] + i : -1);\n\t\t\to.write_shift(-4, T === L[1] - 1 ? ENDOFCHAIN : T + 1);\n\t\t}\n\t}\n\tvar chainit = function(w/*:number*/)/*:void*/ {\n\t\tfor(T += w; i> 9);\n\t}\n\tchainit((L[6] + 7) >> 3);\n\twhile(o.l & 0x1FF) o.write_shift(-4, consts.ENDOFCHAIN);\n\tT = i = 0;\n\tfor(j = 0; j < cfb.FileIndex.length; ++j) {\n\t\tfile = cfb.FileIndex[j];\n\t\tif(!file.content) continue;\n\t\t/*:: if(file.content == null) throw new Error(\"unreachable\"); */\n\t\tflen = file.content.length;\n\t\tif(!flen || flen >= 0x1000) continue;\n\t\tfile.start = T;\n\t\tchainit((flen + 0x3F) >> 6);\n\t}\n\twhile(o.l & 0x1FF) o.write_shift(-4, consts.ENDOFCHAIN);\n\tfor(i = 0; i < L[4]<<2; ++i) {\n\t\tvar nm = cfb.FullPaths[i];\n\t\tif(!nm || nm.length === 0) {\n\t\t\tfor(j = 0; j < 17; ++j) o.write_shift(4, 0);\n\t\t\tfor(j = 0; j < 3; ++j) o.write_shift(4, -1);\n\t\t\tfor(j = 0; j < 12; ++j) o.write_shift(4, 0);\n\t\t\tcontinue;\n\t\t}\n\t\tfile = cfb.FileIndex[i];\n\t\tif(i === 0) file.start = file.size ? file.start - 1 : ENDOFCHAIN;\n\t\tvar _nm/*:string*/ = (i === 0 && _opts.root) || file.name;\n\t\tif(_nm.length > 31) {\n\t\t\tconsole.error(\"Name \" + _nm + \" will be truncated to \" + _nm.slice(0,31));\n\t\t\t_nm = _nm.slice(0, 31);\n\t\t}\n\t\tflen = 2*(_nm.length+1);\n\t\to.write_shift(64, _nm, \"utf16le\");\n\t\to.write_shift(2, flen);\n\t\to.write_shift(1, file.type);\n\t\to.write_shift(1, file.color);\n\t\to.write_shift(-4, file.L);\n\t\to.write_shift(-4, file.R);\n\t\to.write_shift(-4, file.C);\n\t\tif(!file.clsid) for(j = 0; j < 4; ++j) o.write_shift(4, 0);\n\t\telse o.write_shift(16, file.clsid, \"hex\");\n\t\to.write_shift(4, file.state || 0);\n\t\to.write_shift(4, 0); o.write_shift(4, 0);\n\t\to.write_shift(4, 0); o.write_shift(4, 0);\n\t\to.write_shift(4, file.start);\n\t\to.write_shift(4, file.size); o.write_shift(4, 0);\n\t}\n\tfor(i = 1; i < cfb.FileIndex.length; ++i) {\n\t\tfile = cfb.FileIndex[i];\n\t\t/*:: if(!file.content) throw new Error(\"unreachable\"); */\n\t\tif(file.size >= 0x1000) {\n\t\t\to.l = (file.start+1) << 9;\n\t\t\tif (has_buf && Buffer.isBuffer(file.content)) {\n\t\t\t\tfile.content.copy(o, o.l, 0, file.size);\n\t\t\t\t// o is a 0-filled Buffer so just set next offset\n\t\t\t\to.l += (file.size + 511) & -512;\n\t\t\t} else {\n\t\t\t\tfor(j = 0; j < file.size; ++j) o.write_shift(1, file.content[j]);\n\t\t\t\tfor(; j & 0x1FF; ++j) o.write_shift(1, 0);\n\t\t\t}\n\t\t}\n\t}\n\tfor(i = 1; i < cfb.FileIndex.length; ++i) {\n\t\tfile = cfb.FileIndex[i];\n\t\t/*:: if(!file.content) throw new Error(\"unreachable\"); */\n\t\tif(file.size > 0 && file.size < 0x1000) {\n\t\t\tif (has_buf && Buffer.isBuffer(file.content)) {\n\t\t\t\tfile.content.copy(o, o.l, 0, file.size);\n\t\t\t\t// o is a 0-filled Buffer so just set next offset\n\t\t\t\to.l += (file.size + 63) & -64;\n\t\t\t} else {\n\t\t\t\tfor(j = 0; j < file.size; ++j) o.write_shift(1, file.content[j]);\n\t\t\t\tfor(; j & 0x3F; ++j) o.write_shift(1, 0);\n\t\t\t}\n\t\t}\n\t}\n\tif (has_buf) {\n\t\to.l = o.length;\n\t} else {\n\t\t// When using Buffer, already 0-filled\n\t\twhile(o.l < o.length) o.write_shift(1, 0);\n\t}\n\treturn o;\n}\n/* [MS-CFB] 2.6.4 (Unicode 3.0.1 case conversion) */\nfunction find(cfb/*:CFBContainer*/, path/*:string*/)/*:?CFBEntry*/ {\n\tvar UCFullPaths/*:Array*/ = cfb.FullPaths.map(function(x) { return x.toUpperCase(); });\n\tvar UCPaths/*:Array*/ = UCFullPaths.map(function(x) { var y = x.split(\"/\"); return y[y.length - (x.slice(-1) == \"/\" ? 2 : 1)]; });\n\tvar k/*:boolean*/ = false;\n\tif(path.charCodeAt(0) === 47 /* \"/\" */) { k = true; path = UCFullPaths[0].slice(0, -1) + path; }\n\telse k = path.indexOf(\"/\") !== -1;\n\tvar UCPath/*:string*/ = path.toUpperCase();\n\tvar w/*:number*/ = k === true ? UCFullPaths.indexOf(UCPath) : UCPaths.indexOf(UCPath);\n\tif(w !== -1) return cfb.FileIndex[w];\n\n\tvar m = !UCPath.match(chr1);\n\tUCPath = UCPath.replace(chr0,'');\n\tif(m) UCPath = UCPath.replace(chr1,'!');\n\tfor(w = 0; w < UCFullPaths.length; ++w) {\n\t\tif((m ? UCFullPaths[w].replace(chr1,'!') : UCFullPaths[w]).replace(chr0,'') == UCPath) return cfb.FileIndex[w];\n\t\tif((m ? UCPaths[w].replace(chr1,'!') : UCPaths[w]).replace(chr0,'') == UCPath) return cfb.FileIndex[w];\n\t}\n\treturn null;\n}\n/** CFB Constants */\nvar MSSZ = 64; /* Mini Sector Size = 1<<6 */\n//var MSCSZ = 4096; /* Mini Stream Cutoff Size */\n/* 2.1 Compound File Sector Numbers and Types */\nvar ENDOFCHAIN = -2;\n/* 2.2 Compound File Header */\nvar HEADER_SIGNATURE = 'd0cf11e0a1b11ae1';\nvar HEADER_SIG = [0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1];\nvar HEADER_CLSID = '00000000000000000000000000000000';\nvar consts = {\n\t/* 2.1 Compund File Sector Numbers and Types */\n\tMAXREGSECT: -6,\n\tDIFSECT: -4,\n\tFATSECT: -3,\n\tENDOFCHAIN: ENDOFCHAIN,\n\tFREESECT: -1,\n\t/* 2.2 Compound File Header */\n\tHEADER_SIGNATURE: HEADER_SIGNATURE,\n\tHEADER_MINOR_VERSION: '3e00',\n\tMAXREGSID: -6,\n\tNOSTREAM: -1,\n\tHEADER_CLSID: HEADER_CLSID,\n\t/* 2.6.1 Compound File Directory Entry */\n\tEntryTypes: ['unknown','storage','stream','lockbytes','property','root']\n};\n\nfunction write_file(cfb/*:CFBContainer*/, filename/*:string*/, options/*:CFBWriteOpts*/)/*:void*/ {\n\tget_fs();\n\tvar o = _write(cfb, options);\n\t/*:: if(typeof Buffer == 'undefined' || !Buffer.isBuffer(o) || !(o instanceof Buffer)) throw new Error(\"unreachable\"); */\n\tfs.writeFileSync(filename, o);\n}\n\nfunction a2s(o/*:RawBytes*/)/*:string*/ {\n\tvar out = new Array(o.length);\n\tfor(var i = 0; i < o.length; ++i) out[i] = String.fromCharCode(o[i]);\n\treturn out.join(\"\");\n}\n\nfunction write(cfb/*:CFBContainer*/, options/*:CFBWriteOpts*/)/*:RawBytes|string*/ {\n\tvar o = _write(cfb, options);\n\tswitch(options && options.type || \"buffer\") {\n\t\tcase \"file\": get_fs(); fs.writeFileSync(options.filename, (o/*:any*/)); return o;\n\t\tcase \"binary\": return typeof o == \"string\" ? o : a2s(o);\n\t\tcase \"base64\": return Base64_encode(typeof o == \"string\" ? o : a2s(o));\n\t\tcase \"buffer\": if(has_buf) return Buffer.isBuffer(o) ? o : Buffer_from(o);\n\t\t\t/* falls through */\n\t\tcase \"array\": return typeof o == \"string\" ? s2a(o) : o;\n\t}\n\treturn o;\n}\n/* node < 8.1 zlib does not expose bytesRead, so default to pure JS */\nvar _zlib;\nfunction use_zlib(zlib) { try {\n\tvar InflateRaw = zlib.InflateRaw;\n\tvar InflRaw = new InflateRaw();\n\tInflRaw._processChunk(new Uint8Array([3, 0]), InflRaw._finishFlushFlag);\n\tif(InflRaw.bytesRead) _zlib = zlib;\n\telse throw new Error(\"zlib does not expose bytesRead\");\n} catch(e) {console.error(\"cannot use native zlib: \" + (e.message || e)); } }\n\nfunction _inflateRawSync(payload, usz) {\n\tif(!_zlib) return _inflate(payload, usz);\n\tvar InflateRaw = _zlib.InflateRaw;\n\tvar InflRaw = new InflateRaw();\n\tvar out = InflRaw._processChunk(payload.slice(payload.l), InflRaw._finishFlushFlag);\n\tpayload.l += InflRaw.bytesRead;\n\treturn out;\n}\n\nfunction _deflateRawSync(payload) {\n\treturn _zlib ? _zlib.deflateRawSync(payload) : _deflate(payload);\n}\nvar CLEN_ORDER = [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ];\n\n/* LEN_ID = [ 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285 ]; */\nvar LEN_LN = [ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13 , 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258 ];\n\n/* DST_ID = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 ]; */\nvar DST_LN = [ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577 ];\n\nfunction bit_swap_8(n) { var t = (((((n<<1)|(n<<11)) & 0x22110) | (((n<<5)|(n<<15)) & 0x88440))); return ((t>>16) | (t>>8) |t)&0xFF; }\n\nvar use_typed_arrays = typeof Uint8Array !== 'undefined';\n\nvar bitswap8 = use_typed_arrays ? new Uint8Array(1<<8) : [];\nfor(var q = 0; q < (1<<8); ++q) bitswap8[q] = bit_swap_8(q);\n\nfunction bit_swap_n(n, b) {\n\tvar rev = bitswap8[n & 0xFF];\n\tif(b <= 8) return rev >>> (8-b);\n\trev = (rev << 8) | bitswap8[(n>>8)&0xFF];\n\tif(b <= 16) return rev >>> (16-b);\n\trev = (rev << 8) | bitswap8[(n>>16)&0xFF];\n\treturn rev >>> (24-b);\n}\n\n/* helpers for unaligned bit reads */\nfunction read_bits_2(buf, bl) { var w = (bl&7), h = (bl>>>3); return ((buf[h]|(w <= 6 ? 0 : buf[h+1]<<8))>>>w)& 0x03; }\nfunction read_bits_3(buf, bl) { var w = (bl&7), h = (bl>>>3); return ((buf[h]|(w <= 5 ? 0 : buf[h+1]<<8))>>>w)& 0x07; }\nfunction read_bits_4(buf, bl) { var w = (bl&7), h = (bl>>>3); return ((buf[h]|(w <= 4 ? 0 : buf[h+1]<<8))>>>w)& 0x0F; }\nfunction read_bits_5(buf, bl) { var w = (bl&7), h = (bl>>>3); return ((buf[h]|(w <= 3 ? 0 : buf[h+1]<<8))>>>w)& 0x1F; }\nfunction read_bits_7(buf, bl) { var w = (bl&7), h = (bl>>>3); return ((buf[h]|(w <= 1 ? 0 : buf[h+1]<<8))>>>w)& 0x7F; }\n\n/* works up to n = 3 * 8 + 1 = 25 */\nfunction read_bits_n(buf, bl, n) {\n\tvar w = (bl&7), h = (bl>>>3), f = ((1<>> w;\n\tif(n < 8 - w) return v & f;\n\tv |= buf[h+1]<<(8-w);\n\tif(n < 16 - w) return v & f;\n\tv |= buf[h+2]<<(16-w);\n\tif(n < 24 - w) return v & f;\n\tv |= buf[h+3]<<(24-w);\n\treturn v & f;\n}\n\n/* helpers for unaligned bit writes */\nfunction write_bits_3(buf, bl, v) { var w = bl & 7, h = bl >>> 3;\n\tif(w <= 5) buf[h] |= (v & 7) << w;\n\telse {\n\t\tbuf[h] |= (v << w) & 0xFF;\n\t\tbuf[h+1] = (v&7) >> (8-w);\n\t}\n\treturn bl + 3;\n}\n\nfunction write_bits_1(buf, bl, v) {\n\tvar w = bl & 7, h = bl >>> 3;\n\tv = (v&1) << w;\n\tbuf[h] |= v;\n\treturn bl + 1;\n}\nfunction write_bits_8(buf, bl, v) {\n\tvar w = bl & 7, h = bl >>> 3;\n\tv <<= w;\n\tbuf[h] |= v & 0xFF; v >>>= 8;\n\tbuf[h+1] = v;\n\treturn bl + 8;\n}\nfunction write_bits_16(buf, bl, v) {\n\tvar w = bl & 7, h = bl >>> 3;\n\tv <<= w;\n\tbuf[h] |= v & 0xFF; v >>>= 8;\n\tbuf[h+1] = v & 0xFF;\n\tbuf[h+2] = v >>> 8;\n\treturn bl + 16;\n}\n\n/* until ArrayBuffer#realloc is a thing, fake a realloc */\nfunction realloc(b, sz/*:number*/) {\n\tvar L = b.length, M = 2*L > sz ? 2*L : sz + 5, i = 0;\n\tif(L >= sz) return b;\n\tif(has_buf) {\n\t\tvar o = new_unsafe_buf(M);\n\t\t// $FlowIgnore\n\t\tif(b.copy) b.copy(o);\n\t\telse for(; i < b.length; ++i) o[i] = b[i];\n\t\treturn o;\n\t} else if(use_typed_arrays) {\n\t\tvar a = new Uint8Array(M);\n\t\tif(a.set) a.set(b);\n\t\telse for(; i < L; ++i) a[i] = b[i];\n\t\treturn a;\n\t}\n\tb.length = M;\n\treturn b;\n}\n\n/* zero-filled arrays for older browsers */\nfunction zero_fill_array(n) {\n\tvar o = new Array(n);\n\tfor(var i = 0; i < n; ++i) o[i] = 0;\n\treturn o;\n}\n\n/* build tree (used for literals and lengths) */\nfunction build_tree(clens, cmap, MAX/*:number*/)/*:number*/ {\n\tvar maxlen = 1, w = 0, i = 0, j = 0, ccode = 0, L = clens.length;\n\n\tvar bl_count = use_typed_arrays ? new Uint16Array(32) : zero_fill_array(32);\n\tfor(i = 0; i < 32; ++i) bl_count[i] = 0;\n\n\tfor(i = L; i < MAX; ++i) clens[i] = 0;\n\tL = clens.length;\n\n\tvar ctree = use_typed_arrays ? new Uint16Array(L) : zero_fill_array(L); // []\n\n\t/* build code tree */\n\tfor(i = 0; i < L; ++i) {\n\t\tbl_count[(w = clens[i])]++;\n\t\tif(maxlen < w) maxlen = w;\n\t\tctree[i] = 0;\n\t}\n\tbl_count[0] = 0;\n\tfor(i = 1; i <= maxlen; ++i) bl_count[i+16] = (ccode = (ccode + bl_count[i-1])<<1);\n\tfor(i = 0; i < L; ++i) {\n\t\tccode = clens[i];\n\t\tif(ccode != 0) ctree[i] = bl_count[ccode+16]++;\n\t}\n\n\t/* cmap[maxlen + 4 bits] = (off&15) + (lit<<4) reverse mapping */\n\tvar cleni = 0;\n\tfor(i = 0; i < L; ++i) {\n\t\tcleni = clens[i];\n\t\tif(cleni != 0) {\n\t\t\tccode = bit_swap_n(ctree[i], maxlen)>>(maxlen-cleni);\n\t\t\tfor(j = (1<<(maxlen + 4 - cleni)) - 1; j>=0; --j)\n\t\t\t\tcmap[ccode|(j<*/ = [];\n\tvar i = 0;\n\tfor(;i<32; i++) dlens.push(5);\n\tbuild_tree(dlens, fix_dmap, 32);\n\n\tvar clens/*:Array*/ = [];\n\ti = 0;\n\tfor(; i<=143; i++) clens.push(8);\n\tfor(; i<=255; i++) clens.push(9);\n\tfor(; i<=279; i++) clens.push(7);\n\tfor(; i<=287; i++) clens.push(8);\n\tbuild_tree(clens, fix_lmap, 288);\n})();var _deflateRaw = /*#__PURE__*/(function _deflateRawIIFE() {\n\tvar DST_LN_RE = use_typed_arrays ? new Uint8Array(0x8000) : [];\n\tvar j = 0, k = 0;\n\tfor(; j < DST_LN.length - 1; ++j) {\n\t\tfor(; k < DST_LN[j+1]; ++k) DST_LN_RE[k] = j;\n\t}\n\tfor(;k < 32768; ++k) DST_LN_RE[k] = 29;\n\n\tvar LEN_LN_RE = use_typed_arrays ? new Uint8Array(0x103) : [];\n\tfor(j = 0, k = 0; j < LEN_LN.length - 1; ++j) {\n\t\tfor(; k < LEN_LN[j+1]; ++k) LEN_LN_RE[k] = j;\n\t}\n\n\tfunction write_stored(data, out) {\n\t\tvar boff = 0;\n\t\twhile(boff < data.length) {\n\t\t\tvar L = Math.min(0xFFFF, data.length - boff);\n\t\t\tvar h = boff + L == data.length;\n\t\t\tout.write_shift(1, +h);\n\t\t\tout.write_shift(2, L);\n\t\t\tout.write_shift(2, (~L) & 0xFFFF);\n\t\t\twhile(L-- > 0) out[out.l++] = data[boff++];\n\t\t}\n\t\treturn out.l;\n\t}\n\n\t/* Fixed Huffman */\n\tfunction write_huff_fixed(data, out) {\n\t\tvar bl = 0;\n\t\tvar boff = 0;\n\t\tvar addrs = use_typed_arrays ? new Uint16Array(0x8000) : [];\n\t\twhile(boff < data.length) {\n\t\t\tvar L = /* data.length - boff; */ Math.min(0xFFFF, data.length - boff);\n\n\t\t\t/* write a stored block for short data */\n\t\t\tif(L < 10) {\n\t\t\t\tbl = write_bits_3(out, bl, +!!(boff + L == data.length)); // jshint ignore:line\n\t\t\t\tif(bl & 7) bl += 8 - (bl & 7);\n\t\t\t\tout.l = (bl / 8) | 0;\n\t\t\t\tout.write_shift(2, L);\n\t\t\t\tout.write_shift(2, (~L) & 0xFFFF);\n\t\t\t\twhile(L-- > 0) out[out.l++] = data[boff++];\n\t\t\t\tbl = out.l * 8;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tbl = write_bits_3(out, bl, +!!(boff + L == data.length) + 2); // jshint ignore:line\n\t\t\tvar hash = 0;\n\t\t\twhile(L-- > 0) {\n\t\t\t\tvar d = data[boff];\n\t\t\t\thash = ((hash << 5) ^ d) & 0x7FFF;\n\n\t\t\t\tvar match = -1, mlen = 0;\n\n\t\t\t\tif((match = addrs[hash])) {\n\t\t\t\t\tmatch |= boff & ~0x7FFF;\n\t\t\t\t\tif(match > boff) match -= 0x8000;\n\t\t\t\t\tif(match < boff) while(data[match + mlen] == data[boff + mlen] && mlen < 250) ++mlen;\n\t\t\t\t}\n\n\t\t\t\tif(mlen > 2) {\n\t\t\t\t\t/* Copy Token */\n\t\t\t\t\td = LEN_LN_RE[mlen];\n\t\t\t\t\tif(d <= 22) bl = write_bits_8(out, bl, bitswap8[d+1]>>1) - 1;\n\t\t\t\t\telse {\n\t\t\t\t\t\twrite_bits_8(out, bl, 3);\n\t\t\t\t\t\tbl += 5;\n\t\t\t\t\t\twrite_bits_8(out, bl, bitswap8[d-23]>>5);\n\t\t\t\t\t\tbl += 3;\n\t\t\t\t\t}\n\t\t\t\t\tvar len_eb = (d < 8) ? 0 : ((d - 4)>>2);\n\t\t\t\t\tif(len_eb > 0) {\n\t\t\t\t\t\twrite_bits_16(out, bl, mlen - LEN_LN[d]);\n\t\t\t\t\t\tbl += len_eb;\n\t\t\t\t\t}\n\n\t\t\t\t\td = DST_LN_RE[boff - match];\n\t\t\t\t\tbl = write_bits_8(out, bl, bitswap8[d]>>3);\n\t\t\t\t\tbl -= 3;\n\n\t\t\t\t\tvar dst_eb = d < 4 ? 0 : (d-2)>>1;\n\t\t\t\t\tif(dst_eb > 0) {\n\t\t\t\t\t\twrite_bits_16(out, bl, boff - match - DST_LN[d]);\n\t\t\t\t\t\tbl += dst_eb;\n\t\t\t\t\t}\n\t\t\t\t\tfor(var q = 0; q < mlen; ++q) {\n\t\t\t\t\t\taddrs[hash] = boff & 0x7FFF;\n\t\t\t\t\t\thash = ((hash << 5) ^ data[boff]) & 0x7FFF;\n\t\t\t\t\t\t++boff;\n\t\t\t\t\t}\n\t\t\t\t\tL-= mlen - 1;\n\t\t\t\t} else {\n\t\t\t\t\t/* Literal Token */\n\t\t\t\t\tif(d <= 143) d = d + 48;\n\t\t\t\t\telse bl = write_bits_1(out, bl, 1);\n\t\t\t\t\tbl = write_bits_8(out, bl, bitswap8[d]);\n\t\t\t\t\taddrs[hash] = boff & 0x7FFF;\n\t\t\t\t\t++boff;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbl = write_bits_8(out, bl, 0) - 1;\n\t\t}\n\t\tout.l = ((bl + 7)/8)|0;\n\t\treturn out.l;\n\t}\n\treturn function _deflateRaw(data, out) {\n\t\tif(data.length < 8) return write_stored(data, out);\n\t\treturn write_huff_fixed(data, out);\n\t};\n})();\n\nfunction _deflate(data) {\n\tvar buf = new_buf(50+Math.floor(data.length*1.1));\n\tvar off = _deflateRaw(data, buf);\n\treturn buf.slice(0, off);\n}\n/* modified inflate function also moves original read head */\n\nvar dyn_lmap = use_typed_arrays ? new Uint16Array(32768) : zero_fill_array(32768);\nvar dyn_dmap = use_typed_arrays ? new Uint16Array(32768) : zero_fill_array(32768);\nvar dyn_cmap = use_typed_arrays ? new Uint16Array(128) : zero_fill_array(128);\nvar dyn_len_1 = 1, dyn_len_2 = 1;\n\n/* 5.5.3 Expanding Huffman Codes */\nfunction dyn(data, boff/*:number*/) {\n\t/* nomenclature from RFC1951 refers to bit values; these are offset by the implicit constant */\n\tvar _HLIT = read_bits_5(data, boff) + 257; boff += 5;\n\tvar _HDIST = read_bits_5(data, boff) + 1; boff += 5;\n\tvar _HCLEN = read_bits_4(data, boff) + 4; boff += 4;\n\tvar w = 0;\n\n\t/* grab and store code lengths */\n\tvar clens = use_typed_arrays ? new Uint8Array(19) : zero_fill_array(19);\n\tvar ctree = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ];\n\tvar maxlen = 1;\n\tvar bl_count = use_typed_arrays ? new Uint8Array(8) : zero_fill_array(8);\n\tvar next_code = use_typed_arrays ? new Uint8Array(8) : zero_fill_array(8);\n\tvar L = clens.length; /* 19 */\n\tfor(var i = 0; i < _HCLEN; ++i) {\n\t\tclens[CLEN_ORDER[i]] = w = read_bits_3(data, boff);\n\t\tif(maxlen < w) maxlen = w;\n\t\tbl_count[w]++;\n\t\tboff += 3;\n\t}\n\n\t/* build code tree */\n\tvar ccode = 0;\n\tbl_count[0] = 0;\n\tfor(i = 1; i <= maxlen; ++i) next_code[i] = ccode = (ccode + bl_count[i-1])<<1;\n\tfor(i = 0; i < L; ++i) if((ccode = clens[i]) != 0) ctree[i] = next_code[ccode]++;\n\t/* cmap[7 bits from stream] = (off&7) + (lit<<3) */\n\tvar cleni = 0;\n\tfor(i = 0; i < L; ++i) {\n\t\tcleni = clens[i];\n\t\tif(cleni != 0) {\n\t\t\tccode = bitswap8[ctree[i]]>>(8-cleni);\n\t\t\tfor(var j = (1<<(7-cleni))-1; j>=0; --j) dyn_cmap[ccode|(j<*/ = [];\n\tmaxlen = 1;\n\tfor(; hcodes.length < _HLIT + _HDIST;) {\n\t\tccode = dyn_cmap[read_bits_7(data, boff)];\n\t\tboff += ccode & 7;\n\t\tswitch((ccode >>>= 3)) {\n\t\t\tcase 16:\n\t\t\t\tw = 3 + read_bits_2(data, boff); boff += 2;\n\t\t\t\tccode = hcodes[hcodes.length - 1];\n\t\t\t\twhile(w-- > 0) hcodes.push(ccode);\n\t\t\t\tbreak;\n\t\t\tcase 17:\n\t\t\t\tw = 3 + read_bits_3(data, boff); boff += 3;\n\t\t\t\twhile(w-- > 0) hcodes.push(0);\n\t\t\t\tbreak;\n\t\t\tcase 18:\n\t\t\t\tw = 11 + read_bits_7(data, boff); boff += 7;\n\t\t\t\twhile(w -- > 0) hcodes.push(0);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\thcodes.push(ccode);\n\t\t\t\tif(maxlen < ccode) maxlen = ccode;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/* build literal / length trees */\n\tvar h1 = hcodes.slice(0, _HLIT), h2 = hcodes.slice(_HLIT);\n\tfor(i = _HLIT; i < 286; ++i) h1[i] = 0;\n\tfor(i = _HDIST; i < 30; ++i) h2[i] = 0;\n\tdyn_len_1 = build_tree(h1, dyn_lmap, 286);\n\tdyn_len_2 = build_tree(h2, dyn_dmap, 30);\n\treturn boff;\n}\n\n/* return [ data, bytesRead ] */\nfunction inflate(data, usz/*:number*/) {\n\t/* shortcircuit for empty buffer [0x03, 0x00] */\n\tif(data[0] == 3 && !(data[1] & 0x3)) { return [new_raw_buf(usz), 2]; }\n\n\t/* bit offset */\n\tvar boff = 0;\n\n\t/* header includes final bit and type bits */\n\tvar header = 0;\n\n\tvar outbuf = new_unsafe_buf(usz ? usz : (1<<18));\n\tvar woff = 0;\n\tvar OL = outbuf.length>>>0;\n\tvar max_len_1 = 0, max_len_2 = 0;\n\n\twhile((header&1) == 0) {\n\t\theader = read_bits_3(data, boff); boff += 3;\n\t\tif((header >>> 1) == 0) {\n\t\t\t/* Stored block */\n\t\t\tif(boff & 7) boff += 8 - (boff&7);\n\t\t\t/* 2 bytes sz, 2 bytes bit inverse */\n\t\t\tvar sz = data[boff>>>3] | data[(boff>>>3)+1]<<8;\n\t\t\tboff += 32;\n\t\t\t/* push sz bytes */\n\t\t\tif(sz > 0) {\n\t\t\t\tif(!usz && OL < woff + sz) { outbuf = realloc(outbuf, woff + sz); OL = outbuf.length; }\n\t\t\t\twhile(sz-- > 0) { outbuf[woff++] = data[boff>>>3]; boff += 8; }\n\t\t\t}\n\t\t\tcontinue;\n\t\t} else if((header >> 1) == 1) {\n\t\t\t/* Fixed Huffman */\n\t\t\tmax_len_1 = 9; max_len_2 = 5;\n\t\t} else {\n\t\t\t/* Dynamic Huffman */\n\t\t\tboff = dyn(data, boff);\n\t\t\tmax_len_1 = dyn_len_1; max_len_2 = dyn_len_2;\n\t\t}\n\t\tfor(;;) { // while(true) is apparently out of vogue in modern JS circles\n\t\t\tif(!usz && (OL < woff + 32767)) { outbuf = realloc(outbuf, woff + 32767); OL = outbuf.length; }\n\t\t\t/* ingest code and move read head */\n\t\t\tvar bits = read_bits_n(data, boff, max_len_1);\n\t\t\tvar code = (header>>>1) == 1 ? fix_lmap[bits] : dyn_lmap[bits];\n\t\t\tboff += code & 15; code >>>= 4;\n\t\t\t/* 0-255 are literals, 256 is end of block token, 257+ are copy tokens */\n\t\t\tif(((code>>>8)&0xFF) === 0) outbuf[woff++] = code;\n\t\t\telse if(code == 256) break;\n\t\t\telse {\n\t\t\t\tcode -= 257;\n\t\t\t\tvar len_eb = (code < 8) ? 0 : ((code-4)>>2); if(len_eb > 5) len_eb = 0;\n\t\t\t\tvar tgt = woff + LEN_LN[code];\n\t\t\t\t/* length extra bits */\n\t\t\t\tif(len_eb > 0) {\n\t\t\t\t\ttgt += read_bits_n(data, boff, len_eb);\n\t\t\t\t\tboff += len_eb;\n\t\t\t\t}\n\n\t\t\t\t/* dist code */\n\t\t\t\tbits = read_bits_n(data, boff, max_len_2);\n\t\t\t\tcode = (header>>>1) == 1 ? fix_dmap[bits] : dyn_dmap[bits];\n\t\t\t\tboff += code & 15; code >>>= 4;\n\t\t\t\tvar dst_eb = (code < 4 ? 0 : (code-2)>>1);\n\t\t\t\tvar dst = DST_LN[code];\n\t\t\t\t/* dist extra bits */\n\t\t\t\tif(dst_eb > 0) {\n\t\t\t\t\tdst += read_bits_n(data, boff, dst_eb);\n\t\t\t\t\tboff += dst_eb;\n\t\t\t\t}\n\n\t\t\t\t/* in the common case, manual byte copy is faster than TA set / Buffer copy */\n\t\t\t\tif(!usz && OL < tgt) { outbuf = realloc(outbuf, tgt + 100); OL = outbuf.length; }\n\t\t\t\twhile(woff < tgt) { outbuf[woff] = outbuf[woff - dst]; ++woff; }\n\t\t\t}\n\t\t}\n\t}\n\tif(usz) return [outbuf, (boff+7)>>>3];\n\treturn [outbuf.slice(0, woff), (boff+7)>>>3];\n}\n\nfunction _inflate(payload, usz) {\n\tvar data = payload.slice(payload.l||0);\n\tvar out = inflate(data, usz);\n\tpayload.l += out[1];\n\treturn out[0];\n}\n\nfunction warn_or_throw(wrn, msg) {\n\tif(wrn) { if(typeof console !== 'undefined') console.error(msg); }\n\telse throw new Error(msg);\n}\n\nfunction parse_zip(file/*:RawBytes*/, options/*:CFBReadOpts*/)/*:CFBContainer*/ {\n\tvar blob/*:CFBlob*/ = /*::(*/file/*:: :any)*/;\n\tprep_blob(blob, 0);\n\n\tvar FileIndex/*:CFBFileIndex*/ = [], FullPaths/*:Array*/ = [];\n\tvar o = {\n\t\tFileIndex: FileIndex,\n\t\tFullPaths: FullPaths\n\t};\n\tinit_cfb(o, { root: options.root });\n\n\t/* find end of central directory, start just after signature */\n\tvar i = blob.length - 4;\n\twhile((blob[i] != 0x50 || blob[i+1] != 0x4b || blob[i+2] != 0x05 || blob[i+3] != 0x06) && i >= 0) --i;\n\tblob.l = i + 4;\n\n\t/* parse end of central directory */\n\tblob.l += 4;\n\tvar fcnt = blob.read_shift(2);\n\tblob.l += 6;\n\tvar start_cd = blob.read_shift(4);\n\n\t/* parse central directory */\n\tblob.l = start_cd;\n\n\tfor(i = 0; i < fcnt; ++i) {\n\t\t/* trust local file header instead of CD entry */\n\t\tblob.l += 20;\n\t\tvar csz = blob.read_shift(4);\n\t\tvar usz = blob.read_shift(4);\n\t\tvar namelen = blob.read_shift(2);\n\t\tvar efsz = blob.read_shift(2);\n\t\tvar fcsz = blob.read_shift(2);\n\t\tblob.l += 8;\n\t\tvar offset = blob.read_shift(4);\n\t\tvar EF = parse_extra_field(/*::(*/blob.slice(blob.l+namelen, blob.l+namelen+efsz)/*:: :any)*/);\n\t\tblob.l += namelen + efsz + fcsz;\n\n\t\tvar L = blob.l;\n\t\tblob.l = offset + 4;\n\t\t/* ZIP64 lengths */\n\t\tif(EF && EF[0x0001]) {\n\t\t\tif((EF[0x0001]||{}).usz) usz = EF[0x0001].usz;\n\t\t\tif((EF[0x0001]||{}).csz) csz = EF[0x0001].csz;\n\t\t}\n\t\tparse_local_file(blob, csz, usz, o, EF);\n\t\tblob.l = L;\n\t}\n\n\treturn o;\n}\n\n\n/* head starts just after local file header signature */\nfunction parse_local_file(blob/*:CFBlob*/, csz/*:number*/, usz/*:number*/, o/*:CFBContainer*/, EF) {\n\t/* [local file header] */\n\tblob.l += 2;\n\tvar flags = blob.read_shift(2);\n\tvar meth = blob.read_shift(2);\n\tvar date = parse_dos_date(blob);\n\n\tif(flags & 0x2041) throw new Error(\"Unsupported ZIP encryption\");\n\tvar crc32 = blob.read_shift(4);\n\tvar _csz = blob.read_shift(4);\n\tvar _usz = blob.read_shift(4);\n\n\tvar namelen = blob.read_shift(2);\n\tvar efsz = blob.read_shift(2);\n\n\t// TODO: flags & (1<<11) // UTF8\n\tvar name = \"\"; for(var i = 0; i < namelen; ++i) name += String.fromCharCode(blob[blob.l++]);\n\tif(efsz) {\n\t\tvar ef = parse_extra_field(/*::(*/blob.slice(blob.l, blob.l + efsz)/*:: :any)*/);\n\t\tif((ef[0x5455]||{}).mt) date = ef[0x5455].mt;\n\t\tif((ef[0x0001]||{}).usz) _usz = ef[0x0001].usz;\n\t\tif((ef[0x0001]||{}).csz) _csz = ef[0x0001].csz;\n\t\tif(EF) {\n\t\t\tif((EF[0x5455]||{}).mt) date = EF[0x5455].mt;\n\t\t\tif((EF[0x0001]||{}).usz) _usz = EF[0x0001].usz;\n\t\t\tif((EF[0x0001]||{}).csz) _csz = EF[0x0001].csz;\n\t\t}\n\t}\n\tblob.l += efsz;\n\n\t/* [encryption header] */\n\n\t/* [file data] */\n\tvar data = blob.slice(blob.l, blob.l + _csz);\n\tswitch(meth) {\n\t\tcase 8: data = _inflateRawSync(blob, _usz); break;\n\t\tcase 0: blob.l += _csz; break; // TODO: scan for magic number\n\t\tdefault: throw new Error(\"Unsupported ZIP Compression method \" + meth);\n\t}\n\n\t/* [data descriptor] */\n\tvar wrn = false;\n\tif(flags & 8) {\n\t\tcrc32 = blob.read_shift(4);\n\t\tif(crc32 == 0x08074b50) { crc32 = blob.read_shift(4); wrn = true; }\n\t\t_csz = blob.read_shift(4);\n\t\t_usz = blob.read_shift(4);\n\t}\n\n\tif(_csz != csz) warn_or_throw(wrn, \"Bad compressed size: \" + csz + \" != \" + _csz);\n\tif(_usz != usz) warn_or_throw(wrn, \"Bad uncompressed size: \" + usz + \" != \" + _usz);\n\t//var _crc32 = CRC32.buf(data, 0);\n\t//if((crc32>>0) != (_crc32>>0)) warn_or_throw(wrn, \"Bad CRC32 checksum: \" + crc32 + \" != \" + _crc32);\n\tcfb_add(o, name, data, {unsafe: true, mt: date});\n}\nfunction write_zip(cfb/*:CFBContainer*/, options/*:CFBWriteOpts*/)/*:RawBytes*/ {\n\tvar _opts = options || {};\n\tvar out = [], cdirs = [];\n\tvar o/*:CFBlob*/ = new_buf(1);\n\tvar method = (_opts.compression ? 8 : 0), flags = 0;\n\tvar desc = false;\n\tif(desc) flags |= 8;\n\tvar i = 0, j = 0;\n\n\tvar start_cd = 0, fcnt = 0;\n\tvar root = cfb.FullPaths[0], fp = root, fi = cfb.FileIndex[0];\n\tvar crcs = [];\n\tvar sz_cd = 0;\n\n\tfor(i = 1; i < cfb.FullPaths.length; ++i) {\n\t\tfp = cfb.FullPaths[i].slice(root.length); fi = cfb.FileIndex[i];\n\t\tif(!fi.size || !fi.content || (Array.isArray(fi.content) && fi.content.length == 0) || fp == \"\\u0001Sh33tJ5\") continue;\n\t\tvar start = start_cd;\n\n\n\t\t/* TODO: CP437 filename */\n\t\tvar namebuf = new_buf(fp.length);\n\t\tfor(j = 0; j < fp.length; ++j) namebuf.write_shift(1, fp.charCodeAt(j) & 0x7F);\n\t\tnamebuf = namebuf.slice(0, namebuf.l);\n\t\tcrcs[fcnt] = typeof fi.content == \"string\" ? CRC32.bstr(fi.content, 0) : CRC32.buf(/*::((*/fi.content/*::||[]):any)*/, 0);\n\n\t\tvar outbuf = typeof fi.content == \"string\" ? s2a(fi.content) : fi.content/*::||[]*/;\n\t\tif(method == 8) outbuf = _deflateRawSync(outbuf);\n\n\t\t/* local file header */\n\t\to = new_buf(30);\n\t\to.write_shift(4, 0x04034b50);\n\t\to.write_shift(2, 20);\n\t\to.write_shift(2, flags);\n\t\to.write_shift(2, method);\n\t\t/* TODO: last mod file time/date */\n\t\tif(fi.mt) write_dos_date(o, fi.mt);\n\t\telse o.write_shift(4, 0);\n\t\to.write_shift(-4, (flags & 8) ? 0 : crcs[fcnt]);\n\t\to.write_shift(4, (flags & 8) ? 0 : outbuf.length);\n\t\to.write_shift(4, (flags & 8) ? 0 : /*::(*/fi.content/*::||[])*/.length);\n\t\to.write_shift(2, namebuf.length);\n\t\to.write_shift(2, 0);\n\n\t\tstart_cd += o.length;\n\t\tout.push(o);\n\t\tstart_cd += namebuf.length;\n\t\tout.push(namebuf);\n\n\t\t/* TODO: extra fields? */\n\n\t\t/* TODO: encryption header ? */\n\n\t\tstart_cd += outbuf.length;\n\t\tout.push(outbuf);\n\n\t\t/* data descriptor */\n\t\tif(flags & 8) {\n\t\t\to = new_buf(12);\n\t\t\to.write_shift(-4, crcs[fcnt]);\n\t\t\to.write_shift(4, outbuf.length);\n\t\t\to.write_shift(4, /*::(*/fi.content/*::||[])*/.length);\n\t\t\tstart_cd += o.l;\n\t\t\tout.push(o);\n\t\t}\n\n\t\t/* central directory */\n\t\to = new_buf(46);\n\t\to.write_shift(4, 0x02014b50);\n\t\to.write_shift(2, 0);\n\t\to.write_shift(2, 20);\n\t\to.write_shift(2, flags);\n\t\to.write_shift(2, method);\n\t\to.write_shift(4, 0); /* TODO: last mod file time/date */\n\t\to.write_shift(-4, crcs[fcnt]);\n\n\t\to.write_shift(4, outbuf.length);\n\t\to.write_shift(4, /*::(*/fi.content/*::||[])*/.length);\n\t\to.write_shift(2, namebuf.length);\n\t\to.write_shift(2, 0);\n\t\to.write_shift(2, 0);\n\t\to.write_shift(2, 0);\n\t\to.write_shift(2, 0);\n\t\to.write_shift(4, 0);\n\t\to.write_shift(4, start);\n\n\t\tsz_cd += o.l;\n\t\tcdirs.push(o);\n\t\tsz_cd += namebuf.length;\n\t\tcdirs.push(namebuf);\n\t\t++fcnt;\n\t}\n\n\t/* end of central directory */\n\to = new_buf(22);\n\to.write_shift(4, 0x06054b50);\n\to.write_shift(2, 0);\n\to.write_shift(2, 0);\n\to.write_shift(2, fcnt);\n\to.write_shift(2, fcnt);\n\to.write_shift(4, sz_cd);\n\to.write_shift(4, start_cd);\n\to.write_shift(2, 0);\n\n\treturn bconcat(([bconcat((out/*:any*/)), bconcat(cdirs), o]/*:any*/));\n}\nvar ContentTypeMap = ({\n\t\"htm\": \"text/html\",\n\t\"xml\": \"text/xml\",\n\n\t\"gif\": \"image/gif\",\n\t\"jpg\": \"image/jpeg\",\n\t\"png\": \"image/png\",\n\n\t\"mso\": \"application/x-mso\",\n\t\"thmx\": \"application/vnd.ms-officetheme\",\n\t\"sh33tj5\": \"application/octet-stream\"\n}/*:any*/);\n\nfunction get_content_type(fi/*:CFBEntry*/, fp/*:string*/)/*:string*/ {\n\tif(fi.ctype) return fi.ctype;\n\n\tvar ext = fi.name || \"\", m = ext.match(/\\.([^\\.]+)$/);\n\tif(m && ContentTypeMap[m[1]]) return ContentTypeMap[m[1]];\n\n\tif(fp) {\n\t\tm = (ext = fp).match(/[\\.\\\\]([^\\.\\\\])+$/);\n\t\tif(m && ContentTypeMap[m[1]]) return ContentTypeMap[m[1]];\n\t}\n\n\treturn \"application/octet-stream\";\n}\n\n/* 76 character chunks TODO: intertwine encoding */\nfunction write_base64_76(bstr/*:string*/)/*:string*/ {\n\tvar data = Base64_encode(bstr);\n\tvar o = [];\n\tfor(var i = 0; i < data.length; i+= 76) o.push(data.slice(i, i+76));\n\treturn o.join(\"\\r\\n\") + \"\\r\\n\";\n}\n\n/*\nRules for QP:\n\t- escape =## applies for all non-display characters and literal \"=\"\n\t- space or tab at end of line must be encoded\n\t- \\r\\n newlines can be preserved, but bare \\r and \\n must be escaped\n\t- lines must not exceed 76 characters, use soft breaks =\\r\\n\n\nTODO: Some files from word appear to write line extensions with bare equals:\n\n```\n*/ = [], split = encoded.split(\"\\r\\n\");\n\tfor(var si = 0; si < split.length; ++si) {\n\t\tvar str = split[si];\n\t\tif(str.length == 0) { o.push(\"\"); continue; }\n\t\tfor(var i = 0; i < str.length;) {\n\t\t\tvar end = 76;\n\t\t\tvar tmp = str.slice(i, i + end);\n\t\t\tif(tmp.charAt(end - 1) == \"=\") end --;\n\t\t\telse if(tmp.charAt(end - 2) == \"=\") end -= 2;\n\t\t\telse if(tmp.charAt(end - 3) == \"=\") end -= 3;\n\t\t\ttmp = str.slice(i, i + end);\n\t\t\ti += end;\n\t\t\tif(i < str.length) tmp += \"=\";\n\t\t\to.push(tmp);\n\t\t}\n\t}\n\n\treturn o.join(\"\\r\\n\");\n}\nfunction parse_quoted_printable(data/*:Array*/)/*:RawBytes*/ {\n\tvar o = [];\n\n\t/* unify long lines */\n\tfor(var di = 0; di < data.length; ++di) {\n\t\tvar line = data[di];\n\t\twhile(di <= data.length && line.charAt(line.length - 1) == \"=\") line = line.slice(0, line.length - 1) + data[++di];\n\t\to.push(line);\n\t}\n\n\t/* decode */\n\tfor(var oi = 0; oi < o.length; ++oi) o[oi] = o[oi].replace(/[=][0-9A-Fa-f]{2}/g, function($$) { return String.fromCharCode(parseInt($$.slice(1), 16)); });\n\treturn s2a(o.join(\"\\r\\n\"));\n}\n\n\nfunction parse_mime(cfb/*:CFBContainer*/, data/*:Array*/, root/*:string*/)/*:void*/ {\n\tvar fname = \"\", cte = \"\", ctype = \"\", fdata;\n\tvar di = 0;\n\tfor(;di < 10; ++di) {\n\t\tvar line = data[di];\n\t\tif(!line || line.match(/^\\s*$/)) break;\n\t\tvar m = line.match(/^([^:]*?):\\s*([^\\s].*)$/);\n\t\tif(m) switch(m[1].toLowerCase()) {\n\t\t\tcase \"content-location\": fname = m[2].trim(); break;\n\t\t\tcase \"content-type\": ctype = m[2].trim(); break;\n\t\t\tcase \"content-transfer-encoding\": cte = m[2].trim(); break;\n\t\t}\n\t}\n\t++di;\n\tswitch(cte.toLowerCase()) {\n\t\tcase 'base64': fdata = s2a(Base64_decode(data.slice(di).join(\"\"))); break;\n\t\tcase 'quoted-printable': fdata = parse_quoted_printable(data.slice(di)); break;\n\t\tdefault: throw new Error(\"Unsupported Content-Transfer-Encoding \" + cte);\n\t}\n\tvar file = cfb_add(cfb, fname.slice(root.length), fdata, {unsafe: true});\n\tif(ctype) file.ctype = ctype;\n}\n\nfunction parse_mad(file/*:RawBytes*/, options/*:CFBReadOpts*/)/*:CFBContainer*/ {\n\tif(a2s(file.slice(0,13)).toLowerCase() != \"mime-version:\") throw new Error(\"Unsupported MAD header\");\n\tvar root = (options && options.root || \"\");\n\t// $FlowIgnore\n\tvar data = (has_buf && Buffer.isBuffer(file) ? file.toString(\"binary\") : a2s(file)).split(\"\\r\\n\");\n\tvar di = 0, row = \"\";\n\n\t/* if root is not specified, scan for the common prefix */\n\tfor(di = 0; di < data.length; ++di) {\n\t\trow = data[di];\n\t\tif(!/^Content-Location:/i.test(row)) continue;\n\t\trow = row.slice(row.indexOf(\"file\"));\n\t\tif(!root) root = row.slice(0, row.lastIndexOf(\"/\") + 1);\n\t\tif(row.slice(0, root.length) == root) continue;\n\t\twhile(root.length > 0) {\n\t\t\troot = root.slice(0, root.length - 1);\n\t\t\troot = root.slice(0, root.lastIndexOf(\"/\") + 1);\n\t\t\tif(row.slice(0,root.length) == root) break;\n\t\t}\n\t}\n\n\tvar mboundary = (data[1] || \"\").match(/boundary=\"(.*?)\"/);\n\tif(!mboundary) throw new Error(\"MAD cannot find boundary\");\n\tvar boundary = \"--\" + (mboundary[1] || \"\");\n\n\tvar FileIndex/*:CFBFileIndex*/ = [], FullPaths/*:Array*/ = [];\n\tvar o = {\n\t\tFileIndex: FileIndex,\n\t\tFullPaths: FullPaths\n\t};\n\tinit_cfb(o);\n\tvar start_di, fcnt = 0;\n\tfor(di = 0; di < data.length; ++di) {\n\t\tvar line = data[di];\n\t\tif(line !== boundary && line !== boundary + \"--\") continue;\n\t\tif(fcnt++) parse_mime(o, data.slice(start_di, di), root);\n\t\tstart_di = di;\n\t}\n\treturn o;\n}\n\nfunction write_mad(cfb/*:CFBContainer*/, options/*:CFBWriteOpts*/)/*:string*/ {\n\tvar opts = options || {};\n\tvar boundary = opts.boundary || \"SheetJS\";\n\tboundary = '------=' + boundary;\n\n\tvar out = [\n\t\t'MIME-Version: 1.0',\n\t\t'Content-Type: multipart/related; boundary=\"' + boundary.slice(2) + '\"',\n\t\t'',\n\t\t'',\n\t\t''\n\t];\n\n\tvar root = cfb.FullPaths[0], fp = root, fi = cfb.FileIndex[0];\n\tfor(var i = 1; i < cfb.FullPaths.length; ++i) {\n\t\tfp = cfb.FullPaths[i].slice(root.length);\n\t\tfi = cfb.FileIndex[i];\n\t\tif(!fi.size || !fi.content || fp == \"\\u0001Sh33tJ5\") continue;\n\n\t\t/* Normalize filename */\n\t\tfp = fp.replace(/[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7E-\\xFF]/g, function(c) {\n\t\t\treturn \"_x\" + c.charCodeAt(0).toString(16) + \"_\";\n\t\t}).replace(/[\\u0080-\\uFFFF]/g, function(u) {\n\t\t\treturn \"_u\" + u.charCodeAt(0).toString(16) + \"_\";\n\t\t});\n\n\t\t/* Extract content as binary string */\n\t\tvar ca = fi.content;\n\t\t// $FlowIgnore\n\t\tvar cstr = has_buf && Buffer.isBuffer(ca) ? ca.toString(\"binary\") : a2s(ca);\n\n\t\t/* 4/5 of first 1024 chars ascii -> quoted printable, else base64 */\n\t\tvar dispcnt = 0, L = Math.min(1024, cstr.length), cc = 0;\n\t\tfor(var csl = 0; csl <= L; ++csl) if((cc=cstr.charCodeAt(csl)) >= 0x20 && cc < 0x80) ++dispcnt;\n\t\tvar qp = dispcnt >= L * 4 / 5;\n\n\t\tout.push(boundary);\n\t\tout.push('Content-Location: ' + (opts.root || 'file:///C:/SheetJS/') + fp);\n\t\tout.push('Content-Transfer-Encoding: ' + (qp ? 'quoted-printable' : 'base64'));\n\t\tout.push('Content-Type: ' + get_content_type(fi, fp));\n\t\tout.push('');\n\n\t\tout.push(qp ? write_quoted_printable(cstr) : write_base64_76(cstr));\n\t}\n\tout.push(boundary + '--\\r\\n');\n\treturn out.join(\"\\r\\n\");\n}\nfunction cfb_new(opts/*:?any*/)/*:CFBContainer*/ {\n\tvar o/*:CFBContainer*/ = ({}/*:any*/);\n\tinit_cfb(o, opts);\n\treturn o;\n}\n\nfunction cfb_add(cfb/*:CFBContainer*/, name/*:string*/, content/*:?RawBytes*/, opts/*:?any*/)/*:CFBEntry*/ {\n\tvar unsafe = opts && opts.unsafe;\n\tif(!unsafe) init_cfb(cfb);\n\tvar file = !unsafe && CFB.find(cfb, name);\n\tif(!file) {\n\t\tvar fpath/*:string*/ = cfb.FullPaths[0];\n\t\tif(name.slice(0, fpath.length) == fpath) fpath = name;\n\t\telse {\n\t\t\tif(fpath.slice(-1) != \"/\") fpath += \"/\";\n\t\t\tfpath = (fpath + name).replace(\"//\",\"/\");\n\t\t}\n\t\tfile = ({name: filename(name), type: 2}/*:any*/);\n\t\tcfb.FileIndex.push(file);\n\t\tcfb.FullPaths.push(fpath);\n\t\tif(!unsafe) CFB.utils.cfb_gc(cfb);\n\t}\n\t/*:: if(!file) throw new Error(\"unreachable\"); */\n\tfile.content = (content/*:any*/);\n\tfile.size = content ? content.length : 0;\n\tif(opts) {\n\t\tif(opts.CLSID) file.clsid = opts.CLSID;\n\t\tif(opts.mt) file.mt = opts.mt;\n\t\tif(opts.ct) file.ct = opts.ct;\n\t}\n\treturn file;\n}\n\nfunction cfb_del(cfb/*:CFBContainer*/, name/*:string*/)/*:boolean*/ {\n\tinit_cfb(cfb);\n\tvar file = CFB.find(cfb, name);\n\tif(file) for(var j = 0; j < cfb.FileIndex.length; ++j) if(cfb.FileIndex[j] == file) {\n\t\tcfb.FileIndex.splice(j, 1);\n\t\tcfb.FullPaths.splice(j, 1);\n\t\treturn true;\n\t}\n\treturn false;\n}\n\nfunction cfb_mov(cfb/*:CFBContainer*/, old_name/*:string*/, new_name/*:string*/)/*:boolean*/ {\n\tinit_cfb(cfb);\n\tvar file = CFB.find(cfb, old_name);\n\tif(file) for(var j = 0; j < cfb.FileIndex.length; ++j) if(cfb.FileIndex[j] == file) {\n\t\tcfb.FileIndex[j].name = filename(new_name);\n\t\tcfb.FullPaths[j] = new_name;\n\t\treturn true;\n\t}\n\treturn false;\n}\n\nfunction cfb_gc(cfb/*:CFBContainer*/)/*:void*/ { rebuild_cfb(cfb, true); }\n\nexports.find = find;\nexports.read = read;\nexports.parse = parse;\nexports.write = write;\nexports.writeFile = write_file;\nexports.utils = {\n\tcfb_new: cfb_new,\n\tcfb_add: cfb_add,\n\tcfb_del: cfb_del,\n\tcfb_mov: cfb_mov,\n\tcfb_gc: cfb_gc,\n\tReadShift: ReadShift,\n\tCheckField: CheckField,\n\tprep_blob: prep_blob,\n\tbconcat: bconcat,\n\tuse_zlib: use_zlib,\n\t_deflateRaw: _deflate,\n\t_inflateRaw: _inflate,\n\tconsts: consts\n};\n\nreturn exports;\n})();\n\nvar _fs;\nfunction set_fs(fs) { _fs = fs; }\n\n/* normalize data for blob ctor */\nfunction blobify(data) {\n\tif(typeof data === \"string\") return s2ab(data);\n\tif(Array.isArray(data)) return a2u(data);\n\treturn data;\n}\n/* write or download file */\nfunction write_dl(fname/*:string*/, payload/*:any*/, enc/*:?string*/) {\n\t/*global IE_SaveFile, Blob, navigator, saveAs, document, File, chrome */\n\tif(typeof _fs !== 'undefined' && _fs.writeFileSync) return enc ? _fs.writeFileSync(fname, payload, enc) : _fs.writeFileSync(fname, payload);\n\tif(typeof Deno !== 'undefined') {\n\t\t/* in this spot, it's safe to assume typed arrays and TextEncoder/TextDecoder exist */\n\t\tif(enc && typeof payload == \"string\") switch(enc) {\n\t\t\tcase \"utf8\": payload = new TextEncoder(enc).encode(payload); break;\n\t\t\tcase \"binary\": payload = s2ab(payload); break;\n\t\t\t/* TODO: binary equivalent */\n\t\t\tdefault: throw new Error(\"Unsupported encoding \" + enc);\n\t\t}\n\t\treturn Deno.writeFileSync(fname, payload);\n\t}\n\tvar data = (enc == \"utf8\") ? utf8write(payload) : payload;\n\t/*:: declare var IE_SaveFile: any; */\n\tif(typeof IE_SaveFile !== 'undefined') return IE_SaveFile(data, fname);\n\tif(typeof Blob !== 'undefined') {\n\t\tvar blob = new Blob([blobify(data)], {type:\"application/octet-stream\"});\n\t\t/*:: declare var navigator: any; */\n\t\tif(typeof navigator !== 'undefined' && navigator.msSaveBlob) return navigator.msSaveBlob(blob, fname);\n\t\t/*:: declare var saveAs: any; */\n\t\tif(typeof saveAs !== 'undefined') return saveAs(blob, fname);\n\t\tif(typeof URL !== 'undefined' && typeof document !== 'undefined' && document.createElement && URL.createObjectURL) {\n\t\t\tvar url = URL.createObjectURL(blob);\n\t\t\t/*:: declare var chrome: any; */\n\t\t\tif(typeof chrome === 'object' && typeof (chrome.downloads||{}).download == \"function\") {\n\t\t\t\tif(URL.revokeObjectURL && typeof setTimeout !== 'undefined') setTimeout(function() { URL.revokeObjectURL(url); }, 60000);\n\t\t\t\treturn chrome.downloads.download({ url: url, filename: fname, saveAs: true });\n\t\t\t}\n\t\t\tvar a = document.createElement(\"a\");\n\t\t\tif(a.download != null) {\n\t\t\t\t/*:: if(document.body == null) throw new Error(\"unreachable\"); */\n\t\t\t\ta.download = fname; a.href = url; document.body.appendChild(a); a.click();\n\t\t\t\t/*:: if(document.body == null) throw new Error(\"unreachable\"); */ document.body.removeChild(a);\n\t\t\t\tif(URL.revokeObjectURL && typeof setTimeout !== 'undefined') setTimeout(function() { URL.revokeObjectURL(url); }, 60000);\n\t\t\t\treturn url;\n\t\t\t}\n\t\t} else if(typeof URL !== 'undefined' && !URL.createObjectURL && typeof chrome === 'object') {\n\t\t\t/* manifest v3 extensions -- no URL.createObjectURL */\n\t\t\tvar b64 = \"data:application/octet-stream;base64,\" + Base64_encode_arr(new Uint8Array(blobify(data)));\n\t\t\treturn chrome.downloads.download({ url: b64, filename: fname, saveAs: true });\n\t\t}\n\t}\n\t// $FlowIgnore\n\tif(typeof $ !== 'undefined' && typeof File !== 'undefined' && typeof Folder !== 'undefined') try { // extendscript\n\t\t// $FlowIgnore\n\t\tvar out = File(fname); out.open(\"w\"); out.encoding = \"binary\";\n\t\tif(Array.isArray(payload)) payload = a2s(payload);\n\t\tout.write(payload); out.close(); return payload;\n\t} catch(e) { if(!e.message || e.message.indexOf(\"onstruct\") == -1) throw e; }\n\tthrow new Error(\"cannot save file \" + fname);\n}\n\n/* read binary data from file */\nfunction read_binary(path/*:string*/) {\n\tif(typeof _fs !== 'undefined') return _fs.readFileSync(path);\n\tif(typeof Deno !== 'undefined') return Deno.readFileSync(path);\n\t// $FlowIgnore\n\tif(typeof $ !== 'undefined' && typeof File !== 'undefined' && typeof Folder !== 'undefined') try { // extendscript\n\t\t// $FlowIgnore\n\t\tvar infile = File(path); infile.open(\"r\"); infile.encoding = \"binary\";\n\t\tvar data = infile.read(); infile.close();\n\t\treturn data;\n\t} catch(e) { if(!e.message || e.message.indexOf(\"onstruct\") == -1) throw e; }\n\tthrow new Error(\"Cannot access file \" + path);\n}\nfunction keys(o/*:any*/)/*:Array*/ {\n\tvar ks = Object.keys(o), o2 = [];\n\tfor(var i = 0; i < ks.length; ++i) if(Object.prototype.hasOwnProperty.call(o, ks[i])) o2.push(ks[i]);\n\treturn o2;\n}\n\nfunction evert_key(obj/*:any*/, key/*:string*/)/*:EvertType*/ {\n\tvar o = ([]/*:any*/), K = keys(obj);\n\tfor(var i = 0; i !== K.length; ++i) if(o[obj[K[i]][key]] == null) o[obj[K[i]][key]] = K[i];\n\treturn o;\n}\n\nfunction evert(obj/*:any*/)/*:EvertType*/ {\n\tvar o = ([]/*:any*/), K = keys(obj);\n\tfor(var i = 0; i !== K.length; ++i) o[obj[K[i]]] = K[i];\n\treturn o;\n}\n\nfunction evert_num(obj/*:any*/)/*:EvertNumType*/ {\n\tvar o = ([]/*:any*/), K = keys(obj);\n\tfor(var i = 0; i !== K.length; ++i) o[obj[K[i]]] = parseInt(K[i],10);\n\treturn o;\n}\n\nfunction evert_arr(obj/*:any*/)/*:EvertArrType*/ {\n\tvar o/*:EvertArrType*/ = ([]/*:any*/), K = keys(obj);\n\tfor(var i = 0; i !== K.length; ++i) {\n\t\tif(o[obj[K[i]]] == null) o[obj[K[i]]] = [];\n\t\to[obj[K[i]]].push(K[i]);\n\t}\n\treturn o;\n}\n\nvar dnthresh = /*#__PURE__*/Date.UTC(1899, 11, 30, 0, 0, 0); // -2209161600000\nvar dnthresh1 = /*#__PURE__*/Date.UTC(1899, 11, 31, 0, 0, 0); // -2209075200000\nvar dnthresh2 = /*#__PURE__*/Date.UTC(1904, 0, 1, 0, 0, 0); // -2209075200000\nfunction datenum(v/*:Date*/, date1904/*:?boolean*/)/*:number*/ {\n\tvar epoch = /*#__PURE__*/v.getTime();\n\tvar res = (epoch - dnthresh) / (24 * 60 * 60 * 1000);\n\tif(date1904) { res -= 1462; return res < -1402 ? res - 1 : res; }\n\treturn res < 60 ? res - 1 : res;\n}\nfunction numdate(v/*:number*/)/*:Date|number*/ {\n\tif(v >= 60 && v < 61) return v;\n\tvar out = new Date();\n\tout.setTime((v>60 ? v : (v+1)) * 24 * 60 * 60 * 1000 + dnthresh);\n\treturn out;\n}\n\n/* ISO 8601 Duration */\nfunction parse_isodur(s) {\n\tvar sec = 0, mt = 0, time = false;\n\tvar m = s.match(/P([0-9\\.]+Y)?([0-9\\.]+M)?([0-9\\.]+D)?T([0-9\\.]+H)?([0-9\\.]+M)?([0-9\\.]+S)?/);\n\tif(!m) throw new Error(\"|\" + s + \"| is not an ISO8601 Duration\");\n\tfor(var i = 1; i != m.length; ++i) {\n\t\tif(!m[i]) continue;\n\t\tmt = 1;\n\t\tif(i > 3) time = true;\n\t\tswitch(m[i].slice(m[i].length-1)) {\n\t\t\tcase 'Y':\n\t\t\t\tthrow new Error(\"Unsupported ISO Duration Field: \" + m[i].slice(m[i].length-1));\n\t\t\tcase 'D': mt *= 24;\n\t\t\t\t/* falls through */\n\t\t\tcase 'H': mt *= 60;\n\t\t\t\t/* falls through */\n\t\t\tcase 'M':\n\t\t\t\tif(!time) throw new Error(\"Unsupported ISO Duration Field: M\");\n\t\t\t\telse mt *= 60;\n\t\t\t\t/* falls through */\n\t\t\tcase 'S': break;\n\t\t}\n\t\tsec += mt * parseInt(m[i], 10);\n\t}\n\treturn sec;\n}\n\n/* Blame https://bugs.chromium.org/p/v8/issues/detail?id=7863 for the regexide */\nvar pdre1 = /^(\\d+):(\\d+)(:\\d+)?(\\.\\d+)?$/; // HH:MM[:SS[.UUU]]\nvar pdre2 = /^(\\d+)-(\\d+)-(\\d+)$/; // YYYY-mm-dd\nvar pdre3 = /^(\\d+)-(\\d+)-(\\d+)[T ](\\d+):(\\d+)(:\\d+)?(\\.\\d+)?$/; // YYYY-mm-dd(T or space)HH:MM[:SS[.UUU]], sans \"Z\"\n/* parses a date string as a UTC date */\nfunction parseDate(str/*:string*/, date1904/*:boolean*/)/*:Date*/ {\n\tif(str instanceof Date) return str;\n\tvar m = str.match(pdre1);\n\tif(m) return new Date((date1904 ? dnthresh2 : dnthresh1) + ((parseInt(m[1], 10)*60 + parseInt(m[2], 10))*60 + (m[3] ? parseInt(m[3].slice(1), 10) : 0))*1000 + (m[4] ? parseInt((m[4]+\"000\").slice(1,4), 10) : 0));\n\tm = str.match(pdre2);\n\tif(m) return new Date(Date.UTC(+m[1], +m[2]-1, +m[3], 0, 0, 0, 0));\n\t/* TODO: 1900-02-29T00:00:00.000 should return a flag to treat as a date code (affects xlml) */\n\tm = str.match(pdre3);\n\tif(m) return new Date(Date.UTC(+m[1], +m[2]-1, +m[3], +m[4], +m[5], ((m[6] && parseInt(m[6].slice(1), 10))|| 0), ((m[7] && parseInt((m[7] + \"0000\").slice(1,4), 10))||0)));\n\tvar d = new Date(str);\n\treturn d;\n}\n\nfunction cc2str(arr/*:Array*/, debomit)/*:string*/ {\n\tif(has_buf && Buffer.isBuffer(arr)) {\n\t\tif(debomit && buf_utf16le) {\n\t\t\t// TODO: temporary patch\n\t\t\tif(arr[0] == 0xFF && arr[1] == 0xFE) return utf8write(arr.slice(2).toString(\"utf16le\"));\n\t\t\tif(arr[1] == 0xFE && arr[2] == 0xFF) return utf8write(utf16beread(arr.slice(2).toString(\"binary\")));\n\t\t}\n\t\treturn arr.toString(\"binary\");\n\t}\n\n\tif(typeof TextDecoder !== \"undefined\") try {\n\t\tif(debomit) {\n\t\t\tif(arr[0] == 0xFF && arr[1] == 0xFE) return utf8write(new TextDecoder(\"utf-16le\").decode(arr.slice(2)));\n\t\t\tif(arr[0] == 0xFE && arr[1] == 0xFF) return utf8write(new TextDecoder(\"utf-16be\").decode(arr.slice(2)));\n\t\t}\n\t\tvar rev = {\n\t\t\t\"\\u20ac\": \"\\x80\", \"\\u201a\": \"\\x82\", \"\\u0192\": \"\\x83\", \"\\u201e\": \"\\x84\",\n\t\t\t\"\\u2026\": \"\\x85\", \"\\u2020\": \"\\x86\", \"\\u2021\": \"\\x87\", \"\\u02c6\": \"\\x88\",\n\t\t\t\"\\u2030\": \"\\x89\", \"\\u0160\": \"\\x8a\", \"\\u2039\": \"\\x8b\", \"\\u0152\": \"\\x8c\",\n\t\t\t\"\\u017d\": \"\\x8e\", \"\\u2018\": \"\\x91\", \"\\u2019\": \"\\x92\", \"\\u201c\": \"\\x93\",\n\t\t\t\"\\u201d\": \"\\x94\", \"\\u2022\": \"\\x95\", \"\\u2013\": \"\\x96\", \"\\u2014\": \"\\x97\",\n\t\t\t\"\\u02dc\": \"\\x98\", \"\\u2122\": \"\\x99\", \"\\u0161\": \"\\x9a\", \"\\u203a\": \"\\x9b\",\n\t\t\t\"\\u0153\": \"\\x9c\", \"\\u017e\": \"\\x9e\", \"\\u0178\": \"\\x9f\"\n\t\t};\n\t\tif(Array.isArray(arr)) arr = new Uint8Array(arr);\n\t\treturn new TextDecoder(\"latin1\").decode(arr).replace(/[€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ]/g, function(c) { return rev[c] || c; });\n\t} catch(e) {}\n\n\tvar o = [], i = 0;\n\t// this cascade is for the browsers and runtimes of antiquity (and for modern runtimes that lack TextEncoder)\n\ttry {\n\t\tfor(i = 0; i < arr.length - 65536; i+=65536) o.push(String.fromCharCode.apply(0, arr.slice(i, i + 65536)));\n\t\to.push(String.fromCharCode.apply(0, arr.slice(i)));\n\t} catch(e) { try {\n\t\t\tfor(; i < arr.length - 16384; i+=16384) o.push(String.fromCharCode.apply(0, arr.slice(i, i + 16384)));\n\t\t\to.push(String.fromCharCode.apply(0, arr.slice(i)));\n\t\t} catch(e) {\n\t\t\tfor(; i != arr.length; ++i) o.push(String.fromCharCode(arr[i]));\n\t\t}\n\t}\n\treturn o.join(\"\");\n}\n\nfunction dup(o/*:any*/)/*:any*/ {\n\tif(typeof JSON != 'undefined' && !Array.isArray(o)) return JSON.parse(JSON.stringify(o));\n\tif(typeof o != 'object' || o == null) return o;\n\tif(o instanceof Date) return new Date(o.getTime());\n\tvar out = {};\n\tfor(var k in o) if(Object.prototype.hasOwnProperty.call(o, k)) out[k] = dup(o[k]);\n\treturn out;\n}\n\nfunction fill(c/*:string*/,l/*:number*/)/*:string*/ { var o = \"\"; while(o.length < l) o+=c; return o; }\n\n/* TODO: stress test */\nfunction fuzzynum(s/*:string*/)/*:number*/ {\n\tvar v/*:number*/ = Number(s);\n\tif(!isNaN(v)) return isFinite(v) ? v : NaN;\n\tif(!/\\d/.test(s)) return v;\n\tvar wt = 1;\n\tvar ss = s.replace(/([\\d]),([\\d])/g,\"$1$2\").replace(/[$]/g,\"\").replace(/[%]/g, function() { wt *= 100; return \"\";});\n\tif(!isNaN(v = Number(ss))) return v / wt;\n\tss = ss.replace(/[(]([^()]*)[)]/,function($$, $1) { wt = -wt; return $1;});\n\tif(!isNaN(v = Number(ss))) return v / wt;\n\treturn v;\n}\n\n/* NOTE: Chrome rejects bare times like 1:23 PM */\nvar FDRE1 = /^(0?\\d|1[0-2])(?:|:([0-5]?\\d)(?:|(\\.\\d+)(?:|:([0-5]?\\d))|:([0-5]?\\d)(|\\.\\d+)))\\s+([ap])m?$/;\nvar FDRE2 = /^([01]?\\d|2[0-3])(?:|:([0-5]?\\d)(?:|(\\.\\d+)(?:|:([0-5]?\\d))|:([0-5]?\\d)(|\\.\\d+)))$/;\nvar FDISO = /^(\\d+)-(\\d+)-(\\d+)[T ](\\d+):(\\d+)(:\\d+)(\\.\\d+)?[Z]?$/; // YYYY-mm-dd(T or space)HH:MM:SS[.UUU][Z]\n\n/* TODO: 1904 adjustment */\nvar utc_append_works = new Date(\"6/9/69 00:00 UTC\").valueOf() == -17798400000;\nfunction fuzzytime1(M) /*:Date*/ {\n\tif(!M[2]) return new Date(Date.UTC(1899,11,31,(+M[1]%12) + (M[7] == \"p\" ? 12 : 0), 0, 0, 0));\n\tif(M[3]) {\n\t\t\tif(M[4]) return new Date(Date.UTC(1899,11,31,(+M[1]%12) + (M[7] == \"p\" ? 12 : 0), +M[2], +M[4], parseFloat(M[3])*1000));\n\t\t\telse return new Date(Date.UTC(1899,11,31,(M[7] == \"p\" ? 12 : 0), +M[1], +M[2], parseFloat(M[3])*1000));\n\t}\n\telse if(M[5]) return new Date(Date.UTC(1899,11,31, (+M[1]%12) + (M[7] == \"p\" ? 12 : 0), +M[2], +M[5], M[6] ? parseFloat(M[6]) * 1000 : 0));\n\telse return new Date(Date.UTC(1899,11,31,(+M[1]%12) + (M[7] == \"p\" ? 12 : 0), +M[2], 0, 0));\n}\nfunction fuzzytime2(M) /*:Date*/ {\n\tif(!M[2]) return new Date(Date.UTC(1899,11,31,+M[1], 0, 0, 0));\n\tif(M[3]) {\n\t\t\tif(M[4]) return new Date(Date.UTC(1899,11,31,+M[1], +M[2], +M[4], parseFloat(M[3])*1000));\n\t\t\telse return new Date(Date.UTC(1899,11,31,0, +M[1], +M[2], parseFloat(M[3])*1000));\n\t}\n\telse if(M[5]) return new Date(Date.UTC(1899,11,31, +M[1], +M[2], +M[5], M[6] ? parseFloat(M[6]) * 1000 : 0));\n\telse return new Date(Date.UTC(1899,11,31,+M[1], +M[2], 0, 0));\n}\nvar lower_months = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december'];\nfunction fuzzydate(s/*:string*/)/*:Date*/ {\n\t// See issue 2863 -- this is technically not supported in Excel but is otherwise useful\n\tif(FDISO.test(s)) return s.indexOf(\"Z\") == -1 ? local_to_utc(new Date(s)) : new Date(s);\n\tvar lower = s.toLowerCase();\n\tvar lnos = lower.replace(/\\s+/g, \" \").trim();\n\tvar M = lnos.match(FDRE1);\n\tif(M) return fuzzytime1(M);\n\tM = lnos.match(FDRE2);\n\tif(M) return fuzzytime2(M);\n\tM = lnos.match(pdre3);\n\tif(M) return new Date(Date.UTC(+M[1], +M[2]-1, +M[3], +M[4], +M[5], ((M[6] && parseInt(M[6].slice(1), 10))|| 0), ((M[7] && parseInt((M[7] + \"0000\").slice(1,4), 10))||0)));\n\tvar o = new Date(utc_append_works && s.indexOf(\"UTC\") == -1 ? s + \" UTC\": s), n = new Date(NaN);\n\tvar y = o.getYear(), m = o.getMonth(), d = o.getDate();\n\tif(isNaN(d)) return n;\n\tif(lower.match(/jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec/)) {\n\t\tlower = lower.replace(/[^a-z]/g,\"\").replace(/([^a-z]|^)[ap]m?([^a-z]|$)/,\"\");\n\t\tif(lower.length > 3 && lower_months.indexOf(lower) == -1) return n;\n\t} else if(lower.replace(/[ap]m?/, \"\").match(/[a-z]/)) return n;\n\tif(y < 0 || y > 8099 || s.match(/[^-0-9:,\\/\\\\\\ ]/)) return n;\n\treturn o;\n}\n\nvar split_regex = /*#__PURE__*/(function() {\n\tvar safe_split_regex = \"abacaba\".split(/(:?b)/i).length == 5;\n\treturn function split_regex(str/*:string*/, re, def/*:string*/)/*:Array*/ {\n\t\tif(safe_split_regex || typeof re == \"string\") return str.split(re);\n\t\tvar p = str.split(re), o = [p[0]];\n\t\tfor(var i = 1; i < p.length; ++i) { o.push(def); o.push(p[i]); }\n\t\treturn o;\n\t};\n})();\n\nfunction utc_to_local(utc) {\n\treturn new Date(utc.getUTCFullYear(), utc.getUTCMonth(), utc.getUTCDate(), utc.getUTCHours(), utc.getUTCMinutes(), utc.getUTCSeconds(), utc.getUTCMilliseconds());\n}\nfunction local_to_utc(local) {\n\treturn new Date(Date.UTC(local.getFullYear(), local.getMonth(), local.getDate(), local.getHours(), local.getMinutes(), local.getSeconds(), local.getMilliseconds()));\n}\n\nfunction remove_doctype(str) {\n\tvar preamble = str.slice(0, 1024);\n\tvar si = preamble.indexOf(\"/g) --> str_match_ng(str, \"\") */\nfunction str_match_ng(str, s, e) {\n var out = [];\n\n var si = str.indexOf(s);\n while(si > -1) {\n var ei = str.indexOf(e, si + s.length);\n\t\tif(ei == -1) break;\n\n\t\tout.push(str.slice(si, ei + e.length));\n\t\tsi = str.indexOf(s, ei + e.length);\n\t}\n\n return out.length > 0 ? out : null;\n}\n\n/* str.replace(//g, \"\") --> str_remove_ng(str, \"\") */\nfunction str_remove_ng(str, s, e) {\n var out = [], last = 0;\n\n var si = str.indexOf(s);\n\tif(si == -1) return str;\n while(si > -1) {\n\t\tout.push(str.slice(last, si));\n var ei = str.indexOf(e, si + s.length);\n\t\tif(ei == -1) break;\n\n\t\tif((si = str.indexOf(s, (last = ei + e.length))) == -1) out.push(str.slice(last));\n\t}\n\n return out.join(\"\");\n}\n\n/* str.match(/]*?>([\\s\\S]*?)/) --> str_match_xml(str, \"tag\") */\nvar xml_boundary = { \" \": 1, \"\\t\": 1, \"\\r\": 1, \"\\n\": 1, \">\": 1 };\nfunction str_match_xml(str, tag) {\n\tvar si = str.indexOf('<' + tag), w = tag.length + 1, L = str.length;\n\twhile(si >= 0 && si <= L - w && !xml_boundary[str.charAt(si + w)]) si = str.indexOf('<' + tag, si+1);\n\tif(si === -1) return null;\n\tvar sf = str.indexOf(\">\", si + tag.length);\n\tif(sf === -1) return null;\n\tvar et = \"\";\n\tvar ei = str.indexOf(et, sf);\n\tif(ei == -1) return null;\n\treturn [str.slice(si, ei + et.length), str.slice(sf + 1, ei)];\n}\n\n/* str.match(/<(?:\\w+:)?tag\\b[^<>]*?>([\\s\\S]*?)<\\/(?:\\w+:)?tag>/) --> str_match_xml(str, \"tag\") */\nvar str_match_xml_ns = /*#__PURE__*/(function() {\n\tvar str_match_xml_ns_cache = {};\n\treturn function str_match_xml_ns(str, tag) {\n\t\tvar res = str_match_xml_ns_cache[tag];\n\t\tif(!res) str_match_xml_ns_cache[tag] = res = [\n\t\t\tnew RegExp('<(?:\\\\w+:)?'+tag+'\\\\b[^<>]*>', \"g\"),\n\t\t\tnew RegExp('', \"g\")\n\t\t];\n\t\tres[0].lastIndex = res[1].lastIndex = 0;\n\t\tvar m = res[0].exec(str);\n\t\tif(!m) return null;\n\t\tvar si = m.index;\n\t\tvar sf = res[0].lastIndex;\n\t\tres[1].lastIndex = res[0].lastIndex;\n\t\tm = res[1].exec(str);\n\t\tif(!m) return null;\n\t\tvar ei = m.index;\n\t\tvar ef = res[1].lastIndex;\n\t\treturn [str.slice(si, ef), str.slice(sf, ei)];\n\t};\n})();\n\n/* str.match(/<(?:\\w+:)?tag\\b[^<>]*?>([\\s\\S]*?)<\\/(?:\\w+:)?tag>/g) --> str_match_xml_ns_g(str, \"tag\") */\nvar str_match_xml_ns_g = /*#__PURE__*/(function() {\n\tvar str_match_xml_ns_cache = {};\n\treturn function str_match_xml_ns(str, tag) {\n\t\tvar out = [];\n\t\tvar res = str_match_xml_ns_cache[tag];\n\t\tif(!res) str_match_xml_ns_cache[tag] = res = [\n\t\t\tnew RegExp('<(?:\\\\w+:)?'+tag+'\\\\b[^<>]*>', \"g\"),\n\t\t\tnew RegExp('', \"g\")\n\t\t];\n\t\tres[0].lastIndex = res[1].lastIndex = 0;\n\t\tvar m;\n\t\twhile((m = res[0].exec(str))) {\n\t\t\tvar si = m.index;\n\t\t\tres[1].lastIndex = res[0].lastIndex;\n\t\t\tm = res[1].exec(str);\n\t\t\tif(!m) return null;\n\t\t\tvar ef = res[1].lastIndex;\n\t\t\tout.push(str.slice(si, ef));\n\t\t\tres[0].lastIndex = res[1].lastIndex;\n\t\t}\n\t\treturn out.length == 0 ? null : out;\n\t};\n})();\nvar str_remove_xml_ns_g = /*#__PURE__*/(function() {\n\tvar str_remove_xml_ns_cache = {};\n\treturn function str_remove_xml_ns_g(str, tag) {\n\t\tvar out = [];\n\t\tvar res = str_remove_xml_ns_cache[tag];\n\t\tif(!res) str_remove_xml_ns_cache[tag] = res = [\n\t\t\tnew RegExp('<(?:\\\\w+:)?'+tag+'\\\\b[^<>]*>', \"g\"),\n\t\t\tnew RegExp('', \"g\")\n\t\t];\n\t\tres[0].lastIndex = res[1].lastIndex = 0;\n\t\tvar m;\n\t\tvar si = 0, ef = 0;\n\t\twhile((m = res[0].exec(str))) {\n\t\t\tsi = m.index;\n\t\t\tout.push(str.slice(ef, si));\n\t\t\tef = si;\n\t\t\tres[1].lastIndex = res[0].lastIndex;\n\t\t\tm = res[1].exec(str);\n\t\t\tif(!m) return null;\n\t\t\tef = res[1].lastIndex;\n\t\t\tres[0].lastIndex = res[1].lastIndex;\n\t\t}\n\t\tout.push(str.slice(ef));\n\t\treturn out.length == 0 ? \"\" : out.join(\"\");\n\t};\n})();\n\n/* str.match(/<(?:\\w+:)?tag\\b[^>]*?>([\\s\\S]*?)<\\/(?:\\w+:)?tag>/gi) --> str_match_xml_ns_ig(str, \"tag\") */\nvar str_match_xml_ig = /*#__PURE__*/(function() {\n\tvar str_match_xml_ns_cache = {};\n\treturn function str_match_xml_ns(str, tag) {\n\t\tvar out = [];\n\t\tvar res = str_match_xml_ns_cache[tag];\n\t\tif(!res) str_match_xml_ns_cache[tag] = res = [\n\t\t\tnew RegExp('<'+tag+'\\\\b[^<>]*>', \"ig\"),\n\t\t\tnew RegExp('', \"ig\")\n\t\t];\n\t\tres[0].lastIndex = res[1].lastIndex = 0;\n\t\tvar m;\n\t\twhile((m = res[0].exec(str))) {\n\t\t\tvar si = m.index;\n\t\t\tres[1].lastIndex = res[0].lastIndex;\n\t\t\tm = res[1].exec(str);\n\t\t\tif(!m) return null;\n\t\t\tvar ef = res[1].lastIndex;\n\t\t\tout.push(str.slice(si, ef));\n\t\t\tres[0].lastIndex = res[1].lastIndex;\n\t\t}\n\t\treturn out.length == 0 ? null : out;\n\t};\n})();\nfunction getdatastr(data)/*:?string*/ {\n\tif(!data) return null;\n\tif(data.content && data.type) return cc2str(data.content, true);\n\tif(data.data) return debom(data.data);\n\tif(data.asNodeBuffer && has_buf) return debom(data.asNodeBuffer().toString('binary'));\n\tif(data.asBinary) return debom(data.asBinary());\n\tif(data._data && data._data.getContent) return debom(cc2str(Array.prototype.slice.call(data._data.getContent(),0)));\n\treturn null;\n}\n\nfunction getdatabin(data) {\n\tif(!data) return null;\n\tif(data.data) return char_codes(data.data);\n\tif(data.asNodeBuffer && has_buf) return data.asNodeBuffer();\n\tif(data._data && data._data.getContent) {\n\t\tvar o = data._data.getContent();\n\t\tif(typeof o == \"string\") return char_codes(o);\n\t\treturn Array.prototype.slice.call(o);\n\t}\n\tif(data.content && data.type) return data.content;\n\treturn null;\n}\n\nfunction getdata(data) { return (data && data.name.slice(-4) === \".bin\") ? getdatabin(data) : getdatastr(data); }\n\n/* Part 2 Section 10.1.2 \"Mapping Content Types\" Names are case-insensitive */\n/* OASIS does not comment on filename case sensitivity */\nfunction safegetzipfile(zip, file/*:string*/) {\n\tvar k = zip.FullPaths || keys(zip.files);\n\tvar f = file.toLowerCase().replace(/[\\/]/g, '\\\\'), g = f.replace(/\\\\/g,'\\/');\n\tfor(var i=0; i\\/]+)\\s*=\\s*((?:\")([^\"]*)(?:\")|(?:')([^']*)(?:')|([^'\">\\s]+))/g;\nvar tagregex1=/<[\\/\\?]?[a-zA-Z0-9:_-]+(?:\\s+[^\"\\s?<>\\/]+\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^'\"<>\\s=]+))*\\s*[\\/\\?]?>/mg, tagregex2 = /<[^<>]*>/g;\nvar tagregex = /*#__PURE__*/XML_HEADER.match(tagregex1) ? tagregex1 : tagregex2;\nvar nsregex=/<\\w*:/, nsregex2 = /<(\\/?)\\w+:/;\nfunction parsexmltag(tag/*:string*/, skip_root/*:?boolean*/, skip_LC/*:?boolean*/)/*:any*/ {\n\tvar z = ({}/*:any*/);\n\tvar eq = 0, c = 0;\n\tfor(; eq !== tag.length; ++eq) if((c = tag.charCodeAt(eq)) === 32 || c === 10 || c === 13) break;\n\tif(!skip_root) z[0] = tag.slice(0, eq);\n\tif(eq === tag.length) return z;\n\tvar m = tag.match(attregexg), j=0, v=\"\", i=0, q=\"\", cc=\"\", quot = 1;\n\tif(m) for(i = 0; i != m.length; ++i) {\n\t\tcc = m[i].slice(1);\n\t\tfor(c=0; c != cc.length; ++c) if(cc.charCodeAt(c) === 61) break;\n\t\tq = cc.slice(0,c).trim();\n\t\twhile(cc.charCodeAt(c+1) == 32) ++c;\n\t\tquot = ((eq=cc.charCodeAt(c+1)) == 34 || eq == 39) ? 1 : 0;\n\t\tv = cc.slice(c+1+quot, cc.length-quot);\n\t\tfor(j=0;j!=q.length;++j) if(q.charCodeAt(j) === 58) break;\n\t\tif(j===q.length) {\n\t\t\tif(q.indexOf(\"_\") > 0) q = q.slice(0, q.indexOf(\"_\")); // from ods\n\t\t\tz[q] = v;\n\t\t\tif(!skip_LC) z[q.toLowerCase()] = v;\n\t\t}\n\t\telse {\n\t\t\tvar k = (j===5 && q.slice(0,5)===\"xmlns\"?\"xmlns\":\"\")+q.slice(j+1);\n\t\t\tif(z[k] && q.slice(j-3,j) == \"ext\") continue; // from ods\n\t\t\tz[k] = v;\n\t\t\tif(!skip_LC) z[k.toLowerCase()] = v;\n\t\t}\n\t}\n\treturn z;\n}\nfunction parsexmltagraw(tag/*:string*/, skip_root/*:?boolean*/, skip_LC/*:?boolean*/)/*:any*/ {\n\tvar z = ({}/*:any*/);\n\tvar eq = 0, c = 0;\n\tfor(; eq !== tag.length; ++eq) if((c = tag.charCodeAt(eq)) === 32 || c === 10 || c === 13) break;\n\tif(!skip_root) z[0] = tag.slice(0, eq);\n\tif(eq === tag.length) return z;\n\tvar m = tag.match(attregexg), j=0, v=\"\", i=0, q=\"\", cc=\"\", quot = 1;\n\tif(m) for(i = 0; i != m.length; ++i) {\n\t\tcc = m[i].slice(1);\n\t\tfor(c=0; c != cc.length; ++c) if(cc.charCodeAt(c) === 61) break;\n\t\tq = cc.slice(0,c).trim();\n\t\twhile(cc.charCodeAt(c+1) == 32) ++c;\n\t\tquot = ((eq=cc.charCodeAt(c+1)) == 34 || eq == 39) ? 1 : 0;\n\t\tv = cc.slice(c+1+quot, cc.length-quot);\n\t\tif(q.indexOf(\"_\") > 0) q = q.slice(0, q.indexOf(\"_\")); // from ods\n\t\tz[q] = v;\n\t\tif(!skip_LC) z[q.toLowerCase()] = v;\n\t}\n\treturn z;\n}\nfunction strip_ns(x/*:string*/)/*:string*/ { return x.replace(nsregex2, \"<$1\"); }\n\nvar encodings = {\n\t'"': '\"',\n\t''': \"'\",\n\t'>': '>',\n\t'<': '<',\n\t'&': '&'\n};\nvar rencoding = /*#__PURE__*/evert(encodings);\n//var rencstr = \"&<>'\\\"\".split(\"\");\n\n// TODO: CP remap (need to read file version to determine OS)\nvar unescapexml/*:StringConv*/ = /*#__PURE__*/(function() {\n\t/* 22.4.2.4 bstr (Basic String) */\n\tvar encregex = /&(?:quot|apos|gt|lt|amp|#x?([\\da-fA-F]+));/ig, coderegex = /_x([\\da-fA-F]{4})_/ig;\n\tfunction raw_unescapexml(text/*:string*/)/*:string*/ {\n\t\tvar s = text + '', i = s.indexOf(\"-1?16:10))||$$; }).replace(coderegex,function(m,c) {return String.fromCharCode(parseInt(c,16));});\n\t\tvar j = s.indexOf(\"]]>\");\n\t\treturn raw_unescapexml(s.slice(0, i)) + s.slice(i+9,j) + raw_unescapexml(s.slice(j+3));\n\t}\n\treturn function unescapexml(text/*:string*/, xlsx/*:boolean*/) {\n\t\tvar out = raw_unescapexml(text);\n\t\treturn xlsx ? out.replace(/\\r\\n/g, \"\\n\") : out;\n\t};\n})();\n\nvar decregex=/[&<>'\"]/g, charegex = /[\\u0000-\\u0008\\u000b-\\u001f\\uFFFE-\\uFFFF]/g;\nfunction escapexml(text/*:string*/)/*:string*/{\n\tvar s = text + '';\n\treturn s.replace(decregex, function(y) { return rencoding[y]; }).replace(charegex,function(s) { return \"_x\" + (\"000\"+s.charCodeAt(0).toString(16)).slice(-4) + \"_\";});\n}\nfunction escapexmltag(text/*:string*/)/*:string*/{ return escapexml(text).replace(/ /g,\"_x0020_\"); }\n\nvar htmlcharegex = /[\\u0000-\\u001f]/g;\nfunction escapehtml(text/*:string*/)/*:string*/{\n\tvar s = text + '';\n\treturn s.replace(decregex, function(y) { return rencoding[y]; }).replace(/\\n/g, \"
\").replace(htmlcharegex,function(s) { return \"&#x\" + (\"000\"+s.charCodeAt(0).toString(16)).slice(-4) + \";\"; });\n}\n\nfunction escapexlml(text/*:string*/)/*:string*/{\n\tvar s = text + '';\n\treturn s.replace(decregex, function(y) { return rencoding[y]; }).replace(htmlcharegex,function(s) { return \"&#x\" + (s.charCodeAt(0).toString(16)).toUpperCase() + \";\"; });\n}\n\n/* TODO: handle codepages */\nvar xlml_fixstr/*:StringConv*/ = /*#__PURE__*/(function() {\n\tvar entregex = /&#(\\d+);/g;\n\tfunction entrepl($$/*:string*/,$1/*:string*/)/*:string*/ { return String.fromCharCode(parseInt($1,10)); }\n\treturn function xlml_fixstr(str/*:string*/)/*:string*/ { return str.replace(entregex,entrepl); };\n})();\nfunction xlml_unfixstr(str/*:string*/)/*:string*/ { return str.replace(/(\\r\\n|[\\r\\n])/g,\"\\ \"); }\n\n/* note: xsd:boolean valid values: true / 1 / false / 0 */\nfunction parsexmlbool(value/*:any*/)/*:boolean*/ {\n\tswitch(value) {\n\t\tcase 1: case true: case '1': case 'true': return true;\n\t\tcase 0: case false: case '0': case 'false': return false;\n\t\t//default: throw new Error(\"Invalid xsd:boolean \" + value);\n\t}\n\treturn false;\n}\n\nfunction utf8reada(orig/*:string*/)/*:string*/ {\n\tvar out = \"\", i = 0, c = 0, d = 0, e = 0, f = 0, w = 0;\n\twhile (i < orig.length) {\n\t\tc = orig.charCodeAt(i++);\n\t\tif (c < 128) { out += String.fromCharCode(c); continue; }\n\t\td = orig.charCodeAt(i++);\n\t\tif (c>191 && c<224) { f = ((c & 31) << 6); f |= (d & 63); out += String.fromCharCode(f); continue; }\n\t\te = orig.charCodeAt(i++);\n\t\tif (c < 240) { out += String.fromCharCode(((c & 15) << 12) | ((d & 63) << 6) | (e & 63)); continue; }\n\t\tf = orig.charCodeAt(i++);\n\t\tw = (((c & 7) << 18) | ((d & 63) << 12) | ((e & 63) << 6) | (f & 63))-65536;\n\t\tout += String.fromCharCode(0xD800 + ((w>>>10)&1023));\n\t\tout += String.fromCharCode(0xDC00 + (w&1023));\n\t}\n\treturn out;\n}\n\nfunction utf8readb(data) {\n\tvar out = new_raw_buf(2*data.length), w, i, j = 1, k = 0, ww=0, c;\n\tfor(i = 0; i < data.length; i+=j) {\n\t\tj = 1;\n\t\tif((c=data.charCodeAt(i)) < 128) w = c;\n\t\telse if(c < 224) { w = (c&31)*64+(data.charCodeAt(i+1)&63); j=2; }\n\t\telse if(c < 240) { w=(c&15)*4096+(data.charCodeAt(i+1)&63)*64+(data.charCodeAt(i+2)&63); j=3; }\n\t\telse { j = 4;\n\t\t\tw = (c & 7)*262144+(data.charCodeAt(i+1)&63)*4096+(data.charCodeAt(i+2)&63)*64+(data.charCodeAt(i+3)&63);\n\t\t\tw -= 65536; ww = 0xD800 + ((w>>>10)&1023); w = 0xDC00 + (w&1023);\n\t\t}\n\t\tif(ww !== 0) { out[k++] = ww&255; out[k++] = ww>>>8; ww = 0; }\n\t\tout[k++] = w%256; out[k++] = w>>>8;\n\t}\n\treturn out.slice(0,k).toString('ucs2');\n}\n\nfunction utf8readc(data) { return Buffer_from(data, 'binary').toString('utf8'); }\n\nvar utf8corpus = \"foo bar baz\\u00e2\\u0098\\u0083\\u00f0\\u009f\\u008d\\u00a3\";\nvar utf8read = has_buf && (/*#__PURE__*/utf8readc(utf8corpus) == /*#__PURE__*/utf8reada(utf8corpus) && utf8readc || /*#__PURE__*/utf8readb(utf8corpus) == /*#__PURE__*/utf8reada(utf8corpus) && utf8readb) || utf8reada;\n\nvar utf8write/*:StringConv*/ = has_buf ? function(data) { return Buffer_from(data, 'utf8').toString(\"binary\"); } : function(orig/*:string*/)/*:string*/ {\n\tvar out/*:Array*/ = [], i = 0, c = 0, d = 0;\n\twhile(i < orig.length) {\n\t\tc = orig.charCodeAt(i++);\n\t\tswitch(true) {\n\t\t\tcase c < 128: out.push(String.fromCharCode(c)); break;\n\t\t\tcase c < 2048:\n\t\t\t\tout.push(String.fromCharCode(192 + (c >> 6)));\n\t\t\t\tout.push(String.fromCharCode(128 + (c & 63)));\n\t\t\t\tbreak;\n\t\t\tcase c >= 55296 && c < 57344:\n\t\t\t\tc -= 55296; d = orig.charCodeAt(i++) - 56320 + (c<<10);\n\t\t\t\tout.push(String.fromCharCode(240 + ((d >>18) & 7)));\n\t\t\t\tout.push(String.fromCharCode(144 + ((d >>12) & 63)));\n\t\t\t\tout.push(String.fromCharCode(128 + ((d >> 6) & 63)));\n\t\t\t\tout.push(String.fromCharCode(128 + (d & 63)));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tout.push(String.fromCharCode(224 + (c >> 12)));\n\t\t\t\tout.push(String.fromCharCode(128 + ((c >> 6) & 63)));\n\t\t\t\tout.push(String.fromCharCode(128 + (c & 63)));\n\t\t}\n\t}\n\treturn out.join(\"\");\n};\n\nvar htmldecode/*:{(s:string):string}*/ = /*#__PURE__*/(function() {\n\tvar entities/*:Array<[RegExp, string]>*/ = [\n\t\t['nbsp', ' '], ['middot', '·'],\n\t\t['quot', '\"'], ['apos', \"'\"], ['gt', '>'], ['lt', '<'], ['amp', '&']\n\t].map(function(x/*:[string, string]*/) { return [new RegExp('&' + x[0] + ';', \"ig\"), x[1]]; });\n\treturn function htmldecode(str/*:string*/)/*:string*/ {\n\t\tvar o = str\n\t\t\t\t// Remove new lines and spaces from start of content\n\t\t\t\t.replace(/^[\\t\\n\\r ]+/, \"\")\n\t\t\t\t// Remove new lines and spaces from end of content\n\t\t\t\t.replace(/(^|[^\\t\\n\\r ])[\\t\\n\\r ]+$/,\"$1\")\n\t\t\t\t// Added line which removes any white space characters after and before html tags\n\t\t\t\t.replace(/>\\s+/g,\">\").replace(/\\b\\s+ tags with new lines\n\t\t\t\t.replace(/<\\s*[bB][rR]\\s*\\/?>/g,\"\\n\")\n\t\t\t\t// Strip HTML elements\n\t\t\t\t.replace(/<[^<>]*>/g,\"\");\n\t\tfor(var i = 0; i < entities.length; ++i) o = o.replace(entities[i][0], entities[i][1]);\n\t\treturn o;\n\t};\n})();\n\nvar vtvregex = /<\\/?(?:vt:)?variant>/g, vtmregex = /<(?:vt:)([^<\"'>]*)>([\\s\\S]*)*/ {\n\tvar h = parsexmltag(data);\n\n\tvar matches/*:Array*/ = str_match_xml_ns_g(data, h.baseType)||[];\n\tvar res/*:Array*/ = [];\n\tif(matches.length != h.size) {\n\t\tif(opts.WTF) throw new Error(\"unexpected vector length \" + matches.length + \" != \" + h.size);\n\t\treturn res;\n\t}\n\tmatches.forEach(function(x/*:string*/) {\n\t\tvar v = x.replace(vtvregex,\"\").match(vtmregex);\n\t\tif(v) res.push({v:utf8read(v[2]), t:v[1]});\n\t});\n\treturn res;\n}\n\nvar wtregex = /(^\\s|\\s$|\\n)/;\nfunction writetag(f/*:string*/,g/*:string*/)/*:string*/ { return '<' + f + (g.match(wtregex)?' xml:space=\"preserve\"' : \"\") + '>' + g + ''; }\n\nfunction wxt_helper(h)/*:string*/ { return keys(h).map(function(k) { return \" \" + k + '=\"' + h[k] + '\"';}).join(\"\"); }\nfunction writextag(f/*:string*/,g/*:?string*/,h) { return '<' + f + ((h != null) ? wxt_helper(h) : \"\") + ((g != null) ? (g.match(wtregex)?' xml:space=\"preserve\"' : \"\") + '>' + g + '';}\n\nfunction write_w3cdtf(d/*:Date*/, t/*:?boolean*/)/*:string*/ { try { return d.toISOString().replace(/\\.\\d*/,\"\"); } catch(e) { if(t) throw e; } return \"\"; }\n\nfunction write_vt(s, xlsx/*:?boolean*/)/*:string*/ {\n\tswitch(typeof s) {\n\t\tcase 'string':\n\t\t\tvar o = writextag('vt:lpwstr', escapexml(s));\n\t\t\tif(xlsx) o = o.replace(/"/g, \"_x0022_\");\n\t\t\treturn o;\n\t\tcase 'number': return writextag((s|0)==s?'vt:i4':'vt:r8', escapexml(String(s)));\n\t\tcase 'boolean': return writextag('vt:bool',s?'true':'false');\n\t}\n\tif(s instanceof Date) return writextag('vt:filetime', write_w3cdtf(s));\n\tthrow new Error(\"Unable to serialize \" + s);\n}\n\nfunction xlml_normalize(d)/*:string*/ {\n\tif(has_buf &&/*::typeof Buffer !== \"undefined\" && d != null && d instanceof Buffer &&*/ Buffer.isBuffer(d)) return d.toString('utf8');\n\tif(typeof d === 'string') return d;\n\t/* duktape */\n\tif(typeof Uint8Array !== 'undefined' && d instanceof Uint8Array) return utf8read(a2s(ab2a(d)));\n\tthrow new Error(\"Bad input format: expected Buffer or string\");\n}\n/* UOS uses CJK in tags, ODS uses invalid XML */\nvar xlmlregex = /<([\\/]?)([^\\s?>:\\/\"]+)(?:\\s+[^<>=?\"'\\s]+=\"[^\"]*?\")*\\s*[\\/]?>/mg;\n\nvar XMLNS = ({\n\tCORE_PROPS: 'http://schemas.openxmlformats.org/package/2006/metadata/core-properties',\n\tCUST_PROPS: \"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties\",\n\tEXT_PROPS: \"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties\",\n\tCT: 'http://schemas.openxmlformats.org/package/2006/content-types',\n\tRELS: 'http://schemas.openxmlformats.org/package/2006/relationships',\n\tTCMNT: 'http://schemas.microsoft.com/office/spreadsheetml/2018/threadedcomments',\n\t'dc': 'http://purl.org/dc/elements/1.1/',\n\t'dcterms': 'http://purl.org/dc/terms/',\n\t'dcmitype': 'http://purl.org/dc/dcmitype/',\n\t'mx': 'http://schemas.microsoft.com/office/mac/excel/2008/main',\n\t'r': 'http://schemas.openxmlformats.org/officeDocument/2006/relationships',\n\t'sjs': 'http://schemas.openxmlformats.org/package/2006/sheetjs/core-properties',\n\t'vt': 'http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes',\n\t'xsi': 'http://www.w3.org/2001/XMLSchema-instance',\n\t'xsd': 'http://www.w3.org/2001/XMLSchema'\n}/*:any*/);\n\nvar XMLNS_main = [\n\t'http://schemas.openxmlformats.org/spreadsheetml/2006/main',\n\t'http://purl.oclc.org/ooxml/spreadsheetml/main',\n\t'http://schemas.microsoft.com/office/excel/2006/main',\n\t'http://schemas.microsoft.com/office/excel/2006/2'\n];\n\nvar XLMLNS = ({\n\t'o': 'urn:schemas-microsoft-com:office:office',\n\t'x': 'urn:schemas-microsoft-com:office:excel',\n\t'ss': 'urn:schemas-microsoft-com:office:spreadsheet',\n\t'dt': 'uuid:C2F41010-65B3-11d1-A29F-00AA00C14882',\n\t'mv': 'http://macVmlSchemaUri',\n\t'v': 'urn:schemas-microsoft-com:vml',\n\t'html': 'http://www.w3.org/TR/REC-html40'\n}/*:any*/);\nfunction read_double_le(b/*:RawBytes|CFBlob*/, idx/*:number*/)/*:number*/ {\n\tvar s = 1 - 2 * (b[idx + 7] >>> 7);\n\tvar e = ((b[idx + 7] & 0x7f) << 4) + ((b[idx + 6] >>> 4) & 0x0f);\n\tvar m = (b[idx+6]&0x0f);\n\tfor(var i = 5; i >= 0; --i) m = m * 256 + b[idx + i];\n\tif(e == 0x7ff) return m == 0 ? (s * Infinity) : NaN;\n\tif(e == 0) e = -1022;\n\telse { e -= 1023; m += Math.pow(2,52); }\n\treturn s * Math.pow(2, e - 52) * m;\n}\n\nfunction write_double_le(b/*:RawBytes|CFBlob*/, v/*:number*/, idx/*:number*/) {\n\tvar bs = ((((v < 0) || (1/v == -Infinity)) ? 1 : 0) << 7), e = 0, m = 0;\n\tvar av = bs ? (-v) : v;\n\tif(!isFinite(av)) { e = 0x7ff; m = isNaN(v) ? 0x6969 : 0; }\n\telse if(av == 0) e = m = 0;\n\telse {\n\t\te = Math.floor(Math.log(av) / Math.LN2);\n\t\tm = av * Math.pow(2, 52 - e);\n\t\tif((e <= -1023) && (!isFinite(m) || (m < Math.pow(2,52)))) { e = -1022; }\n\t\telse { m -= Math.pow(2,52); e+=1023; }\n\t}\n\tfor(var i = 0; i <= 5; ++i, m/=256) b[idx + i] = m & 0xff;\n\tb[idx + 6] = ((e & 0x0f) << 4) | (m & 0xf);\n\tb[idx + 7] = (e >> 4) | bs;\n}\n\nvar ___toBuffer = function(bufs/*:Array >*/)/*:RawBytes*/ { var x=[],w=10240; for(var i=0;i 0 && Buffer.isBuffer(bufs[0][0])) ? Buffer.concat(bufs[0].map(function(x) { return Buffer.isBuffer(x) ? x : Buffer_from(x); })) : ___toBuffer(bufs);} : ___toBuffer;\n\nvar ___utf16le = function(b/*:RawBytes|CFBlob*/,s/*:number*/,e/*:number*/)/*:string*/ { var ss/*:Array*/=[]; for(var i=s; i*/=[]; for(var i=s; i 0 ? __utf8(b, i+4,i+4+len-1) : \"\";};\nvar __lpstr = ___lpstr;\n\nvar ___cpstr = function(b/*:RawBytes|CFBlob*/,i/*:number*/) { var len = __readUInt32LE(b,i); return len > 0 ? __utf8(b, i+4,i+4+len-1) : \"\";};\nvar __cpstr = ___cpstr;\n\nvar ___lpwstr = function(b/*:RawBytes|CFBlob*/,i/*:number*/) { var len = 2*__readUInt32LE(b,i); return len > 0 ? __utf8(b, i+4,i+4+len-1) : \"\";};\nvar __lpwstr = ___lpwstr;\n\nvar ___lpp4 = function lpp4_(b/*:RawBytes|CFBlob*/,i/*:number*/) { var len = __readUInt32LE(b,i); return len > 0 ? __utf16le(b, i+4,i+4+len) : \"\";};\nvar __lpp4 = ___lpp4;\n\nvar ___8lpp4 = function(b/*:RawBytes|CFBlob*/,i/*:number*/) { var len = __readUInt32LE(b,i); return len > 0 ? __utf8(b, i+4,i+4+len) : \"\";};\nvar __8lpp4 = ___8lpp4;\n\nvar ___double = function(b/*:RawBytes|CFBlob*/, idx/*:number*/) { return read_double_le(b, idx);};\nvar __double = ___double;\n\nvar is_buf = function is_buf_a(a) { return Array.isArray(a) || (typeof Uint8Array !== \"undefined\" && a instanceof Uint8Array); };\n\nif(has_buf/*:: && typeof Buffer !== 'undefined'*/) {\n\t__lpstr = function lpstr_b(b/*:RawBytes|CFBlob*/, i/*:number*/) { if(!Buffer.isBuffer(b)/*:: || !(b instanceof Buffer)*/) return ___lpstr(b, i); var len = b.readUInt32LE(i); return len > 0 ? b.toString('utf8',i+4,i+4+len-1) : \"\";};\n\t__cpstr = function cpstr_b(b/*:RawBytes|CFBlob*/, i/*:number*/) { if(!Buffer.isBuffer(b)/*:: || !(b instanceof Buffer)*/) return ___cpstr(b, i); var len = b.readUInt32LE(i); return len > 0 ? b.toString('utf8',i+4,i+4+len-1) : \"\";};\n\t__lpwstr = function lpwstr_b(b/*:RawBytes|CFBlob*/, i/*:number*/) { if(!Buffer.isBuffer(b)/*:: || !(b instanceof Buffer)*/ || !buf_utf16le) return ___lpwstr(b, i); var len = 2*b.readUInt32LE(i); return b.toString('utf16le',i+4,i+4+len-1);};\n\t__lpp4 = function lpp4_b(b/*:RawBytes|CFBlob*/, i/*:number*/) { if(!Buffer.isBuffer(b)/*:: || !(b instanceof Buffer)*/ || !buf_utf16le) return ___lpp4(b, i); var len = b.readUInt32LE(i); return b.toString('utf16le',i+4,i+4+len);};\n\t__8lpp4 = function lpp4_8b(b/*:RawBytes|CFBlob*/, i/*:number*/) { if(!Buffer.isBuffer(b)/*:: || !(b instanceof Buffer)*/) return ___8lpp4(b, i); var len = b.readUInt32LE(i); return b.toString('utf8',i+4,i+4+len);};\n\t__double = function double_(b/*:RawBytes|CFBlob*/, i/*:number*/) { if(Buffer.isBuffer(b)/*::&& b instanceof Buffer*/) return b.readDoubleLE(i); return ___double(b,i); };\n\tis_buf = function is_buf_b(a) { return Buffer.isBuffer(a) || Array.isArray(a) || (typeof Uint8Array !== \"undefined\" && a instanceof Uint8Array); };\n}\n\n/* from js-xls */\nfunction cpdoit() {\n\t__utf16le = function(b/*:RawBytes|CFBlob*/,s/*:number*/,e/*:number*/) { return $cptable.utils.decode(1200, b.slice(s,e)).replace(chr0, ''); };\n\t__utf8 = function(b/*:RawBytes|CFBlob*/,s/*:number*/,e/*:number*/) { return $cptable.utils.decode(65001, b.slice(s,e)); };\n\t__lpstr = function(b/*:RawBytes|CFBlob*/,i/*:number*/) { var len = __readUInt32LE(b,i); return len > 0 ? $cptable.utils.decode(current_ansi, b.slice(i+4, i+4+len-1)) : \"\";};\n\t__cpstr = function(b/*:RawBytes|CFBlob*/,i/*:number*/) { var len = __readUInt32LE(b,i); return len > 0 ? $cptable.utils.decode(current_codepage, b.slice(i+4, i+4+len-1)) : \"\";};\n\t__lpwstr = function(b/*:RawBytes|CFBlob*/,i/*:number*/) { var len = 2*__readUInt32LE(b,i); return len > 0 ? $cptable.utils.decode(1200, b.slice(i+4,i+4+len-1)) : \"\";};\n\t__lpp4 = function(b/*:RawBytes|CFBlob*/,i/*:number*/) { var len = __readUInt32LE(b,i); return len > 0 ? $cptable.utils.decode(1200, b.slice(i+4,i+4+len)) : \"\";};\n\t__8lpp4 = function(b/*:RawBytes|CFBlob*/,i/*:number*/) { var len = __readUInt32LE(b,i); return len > 0 ? $cptable.utils.decode(65001, b.slice(i+4,i+4+len)) : \"\";};\n}\nif(typeof $cptable !== 'undefined') cpdoit();\n\nvar __readUInt8 = function(b/*:RawBytes|CFBlob*/, idx/*:number*/)/*:number*/ { return b[idx]; };\nvar __readUInt16LE = function(b/*:RawBytes|CFBlob*/, idx/*:number*/)/*:number*/ { return (b[idx+1]*(1<<8))+b[idx]; };\nvar __readInt16LE = function(b/*:RawBytes|CFBlob*/, idx/*:number*/)/*:number*/ { var u = (b[idx+1]*(1<<8))+b[idx]; return (u < 0x8000) ? u : ((0xffff - u + 1) * -1); };\nvar __readUInt32LE = function(b/*:RawBytes|CFBlob*/, idx/*:number*/)/*:number*/ { return b[idx+3]*(1<<24)+(b[idx+2]<<16)+(b[idx+1]<<8)+b[idx]; };\nvar __readInt32LE = function(b/*:RawBytes|CFBlob*/, idx/*:number*/)/*:number*/ { return (b[idx+3]<<24)|(b[idx+2]<<16)|(b[idx+1]<<8)|b[idx]; };\nvar __readInt32BE = function(b/*:RawBytes|CFBlob*/, idx/*:number*/)/*:number*/ { return (b[idx]<<24)|(b[idx+1]<<16)|(b[idx+2]<<8)|b[idx+3]; };\n\nfunction ReadShift(size/*:number*/, t/*:?string*/)/*:number|string*/ {\n\tvar o=\"\", oI/*:: :number = 0*/, oR, oo=[], w, vv, i, loc;\n\tswitch(t) {\n\t\tcase 'dbcs':\n\t\t\tloc = this.l;\n\t\t\tif(has_buf && Buffer.isBuffer(this) && buf_utf16le) o = this.slice(this.l, this.l+2*size).toString(\"utf16le\");\n\t\t\telse for(i = 0; i < size; ++i) { o+=String.fromCharCode(__readUInt16LE(this, loc)); loc+=2; }\n\t\t\tsize *= 2;\n\t\t\tbreak;\n\n\t\tcase 'utf8': o = __utf8(this, this.l, this.l + size); break;\n\t\tcase 'utf16le': size *= 2; o = __utf16le(this, this.l, this.l + size); break;\n\n\t\tcase 'wstr':\n\t\t\tif(typeof $cptable !== 'undefined') o = $cptable.utils.decode(current_codepage, this.slice(this.l, this.l+2*size));\n\t\t\telse return ReadShift.call(this, size, 'dbcs');\n\t\t\tsize = 2 * size; break;\n\n\t\t/* [MS-OLEDS] 2.1.4 LengthPrefixedAnsiString */\n\t\tcase 'lpstr-ansi': o = __lpstr(this, this.l); size = 4 + __readUInt32LE(this, this.l); break;\n\t\tcase 'lpstr-cp': o = __cpstr(this, this.l); size = 4 + __readUInt32LE(this, this.l); break;\n\t\t/* [MS-OLEDS] 2.1.5 LengthPrefixedUnicodeString */\n\t\tcase 'lpwstr': o = __lpwstr(this, this.l); size = 4 + 2 * __readUInt32LE(this, this.l); break;\n\t\t/* [MS-OFFCRYPTO] 2.1.2 Length-Prefixed Padded Unicode String (UNICODE-LP-P4) */\n\t\tcase 'lpp4': size = 4 + __readUInt32LE(this, this.l); o = __lpp4(this, this.l); if(size & 0x02) size += 2; break;\n\t\t/* [MS-OFFCRYPTO] 2.1.3 Length-Prefixed UTF-8 String (UTF-8-LP-P4) */\n\t\tcase '8lpp4': size = 4 + __readUInt32LE(this, this.l); o = __8lpp4(this, this.l); if(size & 0x03) size += 4 - (size & 0x03); break;\n\n\t\tcase 'cstr': size = 0; o = \"\";\n\t\t\twhile((w=__readUInt8(this, this.l + size++))!==0) oo.push(_getchar(w));\n\t\t\to = oo.join(\"\"); break;\n\t\tcase '_wstr': size = 0; o = \"\";\n\t\t\twhile((w=__readUInt16LE(this,this.l +size))!==0){oo.push(_getchar(w));size+=2;}\n\t\t\tsize+=2; o = oo.join(\"\"); break;\n\n\t\t/* sbcs and dbcs support continue records in the SST way TODO codepages */\n\t\tcase 'dbcs-cont': o = \"\"; loc = this.l;\n\t\t\tfor(i = 0; i < size; ++i) {\n\t\t\t\tif(this.lens && this.lens.indexOf(loc) !== -1) {\n\t\t\t\t\tw = __readUInt8(this, loc);\n\t\t\t\t\tthis.l = loc + 1;\n\t\t\t\t\tvv = ReadShift.call(this, size-i, w ? 'dbcs-cont' : 'sbcs-cont');\n\t\t\t\t\treturn oo.join(\"\") + vv;\n\t\t\t\t}\n\t\t\t\too.push(_getchar(__readUInt16LE(this, loc)));\n\t\t\t\tloc+=2;\n\t\t\t} o = oo.join(\"\"); size *= 2; break;\n\n\t\tcase 'cpstr':\n\t\t\tif(typeof $cptable !== 'undefined') {\n\t\t\t\to = $cptable.utils.decode(current_codepage, this.slice(this.l, this.l + size));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t/* falls through */\n\t\tcase 'sbcs-cont': o = \"\"; loc = this.l;\n\t\t\tfor(i = 0; i != size; ++i) {\n\t\t\t\tif(this.lens && this.lens.indexOf(loc) !== -1) {\n\t\t\t\t\tw = __readUInt8(this, loc);\n\t\t\t\t\tthis.l = loc + 1;\n\t\t\t\t\tvv = ReadShift.call(this, size-i, w ? 'dbcs-cont' : 'sbcs-cont');\n\t\t\t\t\treturn oo.join(\"\") + vv;\n\t\t\t\t}\n\t\t\t\too.push(_getchar(__readUInt8(this, loc)));\n\t\t\t\tloc+=1;\n\t\t\t} o = oo.join(\"\"); break;\n\n\t\tdefault:\n\tswitch(size) {\n\t\tcase 1: oI = __readUInt8(this, this.l); this.l++; return oI;\n\t\tcase 2: oI = (t === 'i' ? __readInt16LE : __readUInt16LE)(this, this.l); this.l += 2; return oI;\n\t\tcase 4: case -4:\n\t\t\tif(t === 'i' || ((this[this.l+3] & 0x80)===0)) { oI = ((size > 0) ? __readInt32LE : __readInt32BE)(this, this.l); this.l += 4; return oI; }\n\t\t\telse { oR = __readUInt32LE(this, this.l); this.l += 4; } return oR;\n\t\tcase 8: case -8:\n\t\t\tif(t === 'f') {\n\t\t\t\tif(size == 8) oR = __double(this, this.l);\n\t\t\t\telse oR = __double([this[this.l+7],this[this.l+6],this[this.l+5],this[this.l+4],this[this.l+3],this[this.l+2],this[this.l+1],this[this.l+0]], 0);\n\t\t\t\tthis.l += 8; return oR;\n\t\t\t} else size = 8;\n\t\t/* falls through */\n\t\tcase 16: o = __hexlify(this, this.l, size); break;\n\t}}\n\tthis.l+=size; return o;\n}\n\nvar __writeUInt32LE = function(b/*:RawBytes|CFBlob*/, val/*:number*/, idx/*:number*/)/*:void*/ { b[idx] = (val & 0xFF); b[idx+1] = ((val >>> 8) & 0xFF); b[idx+2] = ((val >>> 16) & 0xFF); b[idx+3] = ((val >>> 24) & 0xFF); };\nvar __writeInt32LE = function(b/*:RawBytes|CFBlob*/, val/*:number*/, idx/*:number*/)/*:void*/ { b[idx] = (val & 0xFF); b[idx+1] = ((val >> 8) & 0xFF); b[idx+2] = ((val >> 16) & 0xFF); b[idx+3] = ((val >> 24) & 0xFF); };\nvar __writeUInt16LE = function(b/*:RawBytes|CFBlob*/, val/*:number*/, idx/*:number*/)/*:void*/ { b[idx] = (val & 0xFF); b[idx+1] = ((val >>> 8) & 0xFF); };\n\nfunction WriteShift(t/*:number*/, val/*:string|number*/, f/*:?string*/)/*:any*/ {\n\tvar size = 0, i = 0;\n\tif(f === 'dbcs') {\n\t\t/*:: if(typeof val !== 'string') throw new Error(\"unreachable\"); */\n\t\tfor(i = 0; i != val.length; ++i) __writeUInt16LE(this, val.charCodeAt(i), this.l + 2 * i);\n\t\tsize = 2 * val.length;\n\t} else if(f === 'sbcs' || f == 'cpstr') {\n\t\tif(typeof $cptable !== 'undefined' && current_ansi == 874) {\n\t\t\t/* TODO: use tables directly, don't encode */\n\t\t\t/*:: if(typeof val !== \"string\") throw new Error(\"unreachable\"); */\n\t\t\tfor(i = 0; i != val.length; ++i) {\n\t\t\t\tvar cpp = $cptable.utils.encode(current_ansi, val.charAt(i));\n\t\t\t\tthis[this.l + i] = cpp[0];\n\t\t\t}\n\t\t\tsize = val.length;\n\t\t} else if(typeof $cptable !== 'undefined' && f == 'cpstr') {\n\t\t\tcpp = $cptable.utils.encode(current_codepage, val);\n\t\t\t/* replace null bytes with _ when relevant */\n if(cpp.length == val.length) for(i = 0; i < val.length; ++i) if(cpp[i] == 0 && val.charCodeAt(i) != 0) cpp[i] = 0x5F;\n if(cpp.length == 2 * val.length) for(i = 0; i < val.length; ++i) if(cpp[2*i] == 0 && cpp[2*i+1] == 0 && val.charCodeAt(i) != 0) cpp[2*i] = 0x5F;\n\t\t\tfor(i = 0; i < cpp.length; ++i) this[this.l + i] = cpp[i];\n\t\t\tsize = cpp.length;\n\t\t} else {\n\t\t\t/*:: if(typeof val !== 'string') throw new Error(\"unreachable\"); */\n\t\t\tval = val.replace(/[^\\x00-\\x7F]/g, \"_\");\n\t\t\t/*:: if(typeof val !== 'string') throw new Error(\"unreachable\"); */\n\t\t\tfor(i = 0; i != val.length; ++i) this[this.l + i] = (val.charCodeAt(i) & 0xFF);\n\t\t\tsize = val.length;\n\t\t}\n\t} else if(f === 'hex') {\n\t\tfor(; i < t; ++i) {\n\t\t\t/*:: if(typeof val !== \"string\") throw new Error(\"unreachable\"); */\n\t\t\tthis[this.l++] = (parseInt(val.slice(2*i, 2*i+2), 16)||0);\n\t\t} return this;\n\t} else if(f === 'utf16le') {\n\t\t\t/*:: if(typeof val !== \"string\") throw new Error(\"unreachable\"); */\n\t\t\tvar end/*:number*/ = Math.min(this.l + t, this.length);\n\t\t\tfor(i = 0; i < Math.min(val.length, t); ++i) {\n\t\t\t\tvar cc = val.charCodeAt(i);\n\t\t\t\tthis[this.l++] = (cc & 0xff);\n\t\t\t\tthis[this.l++] = (cc >> 8);\n\t\t\t}\n\t\t\twhile(this.l < end) this[this.l++] = 0;\n\t\t\treturn this;\n\t} else /*:: if(typeof val === 'number') */ switch(t) {\n\t\tcase 1: size = 1; this[this.l] = val&0xFF; break;\n\t\tcase 2: size = 2; this[this.l] = val&0xFF; val >>>= 8; this[this.l+1] = val&0xFF; break;\n\t\tcase 3: size = 3; this[this.l] = val&0xFF; val >>>= 8; this[this.l+1] = val&0xFF; val >>>= 8; this[this.l+2] = val&0xFF; break;\n\t\tcase 4: size = 4; __writeUInt32LE(this, val, this.l); break;\n\t\tcase 8: size = 8; if(f === 'f') { write_double_le(this, val, this.l); break; }\n\t\t/* falls through */\n\t\tcase 16: break;\n\t\tcase -4: size = 4; __writeInt32LE(this, val, this.l); break;\n\t}\n\tthis.l += size; return this;\n}\n\nfunction CheckField(hexstr/*:string*/, fld/*:string*/)/*:void*/ {\n\tvar m = __hexlify(this,this.l,hexstr.length>>1);\n\tif(m !== hexstr) throw new Error(fld + 'Expected ' + hexstr + ' saw ' + m);\n\tthis.l += hexstr.length>>1;\n}\n\nfunction prep_blob(blob, pos/*:number*/)/*:void*/ {\n\tblob.l = pos;\n\tblob.read_shift = /*::(*/ReadShift/*:: :any)*/;\n\tblob.chk = CheckField;\n\tblob.write_shift = WriteShift;\n}\n\nfunction parsenoop(blob, length/*:: :number, opts?:any */) { blob.l += length; }\n\nfunction new_buf(sz/*:number*/)/*:Block*/ {\n\tvar o = new_raw_buf(sz);\n\tprep_blob(o, 0);\n\treturn o;\n}\n\n/* [MS-XLSB] 2.1.4 Record */\nfunction recordhopper(data, cb/*:RecordHopperCB*/, opts/*:?any*/) {\n\tif(!data) return;\n\tvar tmpbyte, cntbyte, length;\n\tprep_blob(data, data.l || 0);\n\tvar L = data.length, RT = 0, tgt = 0;\n\twhile(data.l < L) {\n\t\tRT = data.read_shift(1);\n\t\tif(RT & 0x80) RT = (RT & 0x7F) + ((data.read_shift(1) & 0x7F)<<7);\n\t\tvar R = XLSBRecordEnum[RT] || XLSBRecordEnum[0xFFFF];\n\t\ttmpbyte = data.read_shift(1);\n\t\tlength = tmpbyte & 0x7F;\n\t\tfor(cntbyte = 1; cntbyte <4 && (tmpbyte & 0x80); ++cntbyte) length += ((tmpbyte = data.read_shift(1)) & 0x7F)<<(7*cntbyte);\n\t\ttgt = data.l + length;\n\t\tvar d = R.f && R.f(data, length, opts);\n\t\tdata.l = tgt;\n\t\tif(cb(d, R, RT)) return;\n\t}\n}\n\n/* control buffer usage for fixed-length buffers */\nfunction buf_array()/*:BufArray*/ {\n\tvar bufs/*:Array*/ = [], blksz = has_buf ? 16384 : 2048;\n\tvar has_buf_copy = has_buf && (typeof new_buf(blksz).copy == \"function\");\n\tvar newblk = function ba_newblk(sz/*:number*/)/*:Block*/ {\n\t\tvar o/*:Block*/ = (new_buf(sz)/*:any*/);\n\t\tprep_blob(o, 0);\n\t\treturn o;\n\t};\n\n\tvar curbuf/*:Block*/ = newblk(blksz);\n\n\tvar endbuf = function ba_endbuf() {\n\t\tif(!curbuf) return;\n\t\t// workaround for new Buffer(3).slice(0,0) bug in bun 0.1.3\n\t\tif(curbuf.l) {\n\t\t\tif(curbuf.length > curbuf.l) { curbuf = curbuf.slice(0, curbuf.l); curbuf.l = curbuf.length; }\n\t\t\tif(curbuf.length > 0) bufs.push(curbuf);\n\t\t}\n\t\tcurbuf = null;\n\t};\n\n\tvar next = function ba_next(sz/*:number*/)/*:Block*/ {\n\t\tif(curbuf && (sz < (curbuf.length - curbuf.l))) return curbuf;\n\t\tendbuf();\n\t\treturn (curbuf = newblk(Math.max(sz+1, blksz)));\n\t};\n\n\tvar end = function ba_end() {\n\t\tendbuf();\n\t\treturn bconcat(bufs);\n\t};\n\tvar end2 = function() {\n\t\tendbuf(); return bufs;\n\t};\n\n\tvar push = function ba_push(buf) {\n\t\tendbuf(); curbuf = buf; if(curbuf.l == null) curbuf.l = curbuf.length; next(blksz);\n\t};\n\n\treturn ({ next:next, push:push, end:end, _bufs:bufs, end2:end2 }/*:any*/);\n}\n\nfunction write_record(ba/*:BufArray*/, type/*:number*/, payload, length/*:?number*/) {\n\tvar t/*:number*/ = +type, l;\n\tif(isNaN(t)) return; // TODO: throw something here?\n\tif(!length) length = XLSBRecordEnum[t].p || (payload||[]).length || 0;\n\tl = 1 + (t >= 0x80 ? 1 : 0) + 1/* + length*/;\n\tif(length >= 0x80) ++l; if(length >= 0x4000) ++l; if(length >= 0x200000) ++l;\n\tvar o = ba.next(l);\n\tif(t <= 0x7F) o.write_shift(1, t);\n\telse {\n\t\to.write_shift(1, (t & 0x7F) + 0x80);\n\t\to.write_shift(1, (t >> 7));\n\t}\n\tfor(var i = 0; i != 4; ++i) {\n\t\tif(length >= 0x80) { o.write_shift(1, (length & 0x7F)+0x80); length >>= 7; }\n\t\telse { o.write_shift(1, length); break; }\n\t}\n\tif(/*:: length != null &&*/length > 0 && is_buf(payload)) ba.push(payload);\n}\n/* XLS ranges enforced */\nfunction shift_cell_xls(cell/*:CellAddress*/, tgt/*:any*/, opts/*:?any*/)/*:CellAddress*/ {\n\tvar out = dup(cell);\n\tif(tgt.s) {\n\t\tif(out.cRel) out.c += tgt.s.c;\n\t\tif(out.rRel) out.r += tgt.s.r;\n\t} else {\n\t\tif(out.cRel) out.c += tgt.c;\n\t\tif(out.rRel) out.r += tgt.r;\n\t}\n\tif(!opts || opts.biff < 12) {\n\t\twhile(out.c >= 0x100) out.c -= 0x100;\n\t\twhile(out.r >= 0x10000) out.r -= 0x10000;\n\t}\n\treturn out;\n}\n\nfunction shift_range_xls(cell, range, opts) {\n\tvar out = dup(cell);\n\tout.s = shift_cell_xls(out.s, range.s, opts);\n\tout.e = shift_cell_xls(out.e, range.s, opts);\n\treturn out;\n}\n\nfunction encode_cell_xls(c/*:CellAddress*/, biff/*:number*/)/*:string*/ {\n\tif(c.cRel && c.c < 0) { c = dup(c); while(c.c < 0) c.c += (biff > 8) ? 0x4000 : 0x100; }\n\tif(c.rRel && c.r < 0) { c = dup(c); while(c.r < 0) c.r += (biff > 8) ? 0x100000 : ((biff > 5) ? 0x10000 : 0x4000); }\n\tvar s = encode_cell(c);\n\tif(!c.cRel && c.cRel != null) s = fix_col(s);\n\tif(!c.rRel && c.rRel != null) s = fix_row(s);\n\treturn s;\n}\n\nfunction encode_range_xls(r, opts)/*:string*/ {\n\tif(r.s.r == 0 && !r.s.rRel) {\n\t\tif(r.e.r == (opts.biff >= 12 ? 0xFFFFF : (opts.biff >= 8 ? 0x10000 : 0x4000)) && !r.e.rRel) {\n\t\t\treturn (r.s.cRel ? \"\" : \"$\") + encode_col(r.s.c) + \":\" + (r.e.cRel ? \"\" : \"$\") + encode_col(r.e.c);\n\t\t}\n\t}\n\tif(r.s.c == 0 && !r.s.cRel) {\n\t\tif(r.e.c == (opts.biff >= 12 ? 0x3FFF : 0xFF) && !r.e.cRel) {\n\t\t\treturn (r.s.rRel ? \"\" : \"$\") + encode_row(r.s.r) + \":\" + (r.e.rRel ? \"\" : \"$\") + encode_row(r.e.r);\n\t\t}\n\t}\n\treturn encode_cell_xls(r.s, opts.biff) + \":\" + encode_cell_xls(r.e, opts.biff);\n}\nfunction decode_row(rowstr/*:string*/)/*:number*/ { return parseInt(unfix_row(rowstr),10) - 1; }\nfunction encode_row(row/*:number*/)/*:string*/ { return \"\" + (row + 1); }\nfunction fix_row(cstr/*:string*/)/*:string*/ { return cstr.replace(/([A-Z]|^)(\\d+)$/,\"$1$$$2\"); }\nfunction unfix_row(cstr/*:string*/)/*:string*/ { return cstr.replace(/\\$(\\d+)$/,\"$1\"); }\n\nfunction decode_col(colstr/*:string*/)/*:number*/ { var c = unfix_col(colstr), d = 0, i = 0; for(; i !== c.length; ++i) d = 26*d + c.charCodeAt(i) - 64; return d - 1; }\nfunction encode_col(col/*:number*/)/*:string*/ { if(col < 0) throw new Error(\"invalid column \" + col); var s=\"\"; for(++col; col; col=Math.floor((col-1)/26)) s = String.fromCharCode(((col-1)%26) + 65) + s; return s; }\nfunction fix_col(cstr/*:string*/)/*:string*/ { return cstr.replace(/^([A-Z])/,\"$$$1\"); }\nfunction unfix_col(cstr/*:string*/)/*:string*/ { return cstr.replace(/^\\$([A-Z])/,\"$1\"); }\n\nfunction split_cell(cstr/*:string*/)/*:Array*/ { return cstr.replace(/(\\$?[A-Z]*)(\\$?\\d*)/,\"$1,$2\").split(\",\"); }\nfunction decode_cell(cstr/*:string*/)/*:CellAddress*/ {\n\tvar R = 0, C = 0;\n\tfor(var i = 0; i < cstr.length; ++i) {\n\t\tvar cc = cstr.charCodeAt(i);\n\t\tif(cc >= 48 && cc <= 57) R = 10 * R + (cc - 48);\n\t\telse if(cc >= 65 && cc <= 90) C = 26 * C + (cc - 64);\n\t}\n\treturn { c: C - 1, r:R - 1 };\n}\nfunction encode_cell(cell/*:CellAddress*/)/*:string*/ {\n\tvar col = cell.c + 1;\n\tvar s=\"\";\n\tfor(; col; col=((col-1)/26)|0) s = String.fromCharCode(((col-1)%26) + 65) + s;\n\treturn s + (cell.r + 1);\n}\nfunction decode_range(range/*:string*/)/*:Range*/ {\n\tvar idx = range.indexOf(\":\");\n\tif(idx == -1) return { s: decode_cell(range), e: decode_cell(range) };\n\treturn { s: decode_cell(range.slice(0, idx)), e: decode_cell(range.slice(idx + 1)) };\n}\n/*# if only one arg, it is assumed to be a Range. If 2 args, both are cell addresses */\nfunction encode_range(cs/*:CellAddrSpec|Range*/,ce/*:?CellAddrSpec*/)/*:string*/ {\n\tif(typeof ce === 'undefined' || typeof ce === 'number') {\n/*:: if(!(cs instanceof Range)) throw \"unreachable\"; */\n\t\treturn encode_range(cs.s, cs.e);\n\t}\n/*:: if((cs instanceof Range)) throw \"unreachable\"; */\n\tif(typeof cs !== 'string') cs = encode_cell((cs/*:any*/));\n\tif(typeof ce !== 'string') ce = encode_cell((ce/*:any*/));\n/*:: if(typeof cs !== 'string') throw \"unreachable\"; */\n/*:: if(typeof ce !== 'string') throw \"unreachable\"; */\n\treturn cs == ce ? cs : cs + \":\" + ce;\n}\nfunction fix_range(a1/*:string*/)/*:string*/ {\n\tvar s = decode_range(a1);\n\treturn \"$\" + encode_col(s.s.c) + \"$\" + encode_row(s.s.r) + \":$\" + encode_col(s.e.c) + \"$\" + encode_row(s.e.r);\n}\n\n// List of invalid characters needs to be tested further\nfunction formula_quote_sheet_name(sname/*:string*/, opts)/*:string*/ {\n\tif(!sname && !(opts && opts.biff <= 5 && opts.biff >= 2)) throw new Error(\"empty sheet name\");\n\tif (/[^\\w\\u4E00-\\u9FFF\\u3040-\\u30FF]/.test(sname)) return \"'\" + sname.replace(/'/g, \"''\") + \"'\";\n\treturn sname;\n}\n\nfunction safe_decode_range(range/*:string*/)/*:Range*/ {\n\tvar o = {s:{c:0,r:0},e:{c:0,r:0}};\n\tvar idx = 0, i = 0, cc = 0;\n\tvar len = range.length;\n\tfor(idx = 0; i < len; ++i) {\n\t\tif((cc=range.charCodeAt(i)-64) < 1 || cc > 26) break;\n\t\tidx = 26*idx + cc;\n\t}\n\to.s.c = --idx;\n\n\tfor(idx = 0; i < len; ++i) {\n\t\tif((cc=range.charCodeAt(i)-48) < 0 || cc > 9) break;\n\t\tidx = 10*idx + cc;\n\t}\n\to.s.r = --idx;\n\n\tif(i === len || cc != 10) { o.e.c=o.s.c; o.e.r=o.s.r; return o; }\n\t++i;\n\n\tfor(idx = 0; i != len; ++i) {\n\t\tif((cc=range.charCodeAt(i)-64) < 1 || cc > 26) break;\n\t\tidx = 26*idx + cc;\n\t}\n\to.e.c = --idx;\n\n\tfor(idx = 0; i != len; ++i) {\n\t\tif((cc=range.charCodeAt(i)-48) < 0 || cc > 9) break;\n\t\tidx = 10*idx + cc;\n\t}\n\to.e.r = --idx;\n\treturn o;\n}\n\nfunction safe_format_cell(cell/*:Cell*/, v/*:any*/) {\n\tvar q = (cell.t == 'd' && v instanceof Date);\n\tif(cell.z != null) try { return (cell.w = SSF_format(cell.z, q ? datenum(v) : v)); } catch(e) { }\n\ttry { return (cell.w = SSF_format((cell.XF||{}).numFmtId||(q ? 14 : 0), q ? datenum(v) : v)); } catch(e) { return ''+v; }\n}\n\nfunction format_cell(cell/*:Cell*/, v/*:any*/, o/*:any*/) {\n\tif(cell == null || cell.t == null || cell.t == 'z') return \"\";\n\tif(cell.w !== undefined) return cell.w;\n\tif(cell.t == 'd' && !cell.z && o && o.dateNF) cell.z = o.dateNF;\n\tif(cell.t == \"e\") return BErr[cell.v] || cell.v;\n\tif(v == undefined) return safe_format_cell(cell, cell.v);\n\treturn safe_format_cell(cell, v);\n}\n\nfunction sheet_to_workbook(sheet/*:Worksheet*/, opts)/*:Workbook*/ {\n\tvar n = opts && opts.sheet ? opts.sheet : \"Sheet1\";\n\tvar sheets = {}; sheets[n] = sheet;\n\treturn { SheetNames: [n], Sheets: sheets };\n}\n\nfunction sheet_new(opts) {\n\tvar out = {};\n\tvar o = opts || {};\n\tif(o.dense) out[\"!data\"] = [];\n\treturn out;\n}\n\nfunction sheet_add_aoa(_ws/*:?Worksheet*/, data/*:AOA*/, opts/*:?any*/)/*:Worksheet*/ {\n\tvar o = opts || {};\n\tvar dense = _ws ? (_ws[\"!data\"] != null) : o.dense;\n\tif(DENSE != null && dense == null) dense = DENSE;\n\tvar ws/*:Worksheet*/ = _ws || (dense ? ({\"!data\": []}) : ({}/*:any*/));\n\tif(dense && !ws[\"!data\"]) ws[\"!data\"] = [];\n\tvar _R = 0, _C = 0;\n\tif(ws && o.origin != null) {\n\t\tif(typeof o.origin == 'number') _R = o.origin;\n\t\telse {\n\t\t\tvar _origin/*:CellAddress*/ = typeof o.origin == \"string\" ? decode_cell(o.origin) : o.origin;\n\t\t\t_R = _origin.r; _C = _origin.c;\n\t\t}\n\t}\n\tvar range/*:Range*/ = ({s: {c:10000000, r:10000000}, e: {c:0, r:0}}/*:any*/);\n\tif(ws[\"!ref\"]){\n\t\tvar _range = safe_decode_range(ws['!ref']);\n\t\trange.s.c = _range.s.c;\n\t\trange.s.r = _range.s.r;\n\t\trange.e.c = Math.max(range.e.c, _range.e.c);\n\t\trange.e.r = Math.max(range.e.r, _range.e.r);\n\t\tif(_R == -1) range.e.r = _R = (ws[\"!ref\"] ? _range.e.r + 1 : 0);\n\t} else {\n\t\trange.s.c = range.e.c = range.s.r = range.e.r = 0;\n\t}\n\tvar row = [], seen = false;\n\tfor(var R = 0; R != data.length; ++R) {\n\t\tif(!data[R]) continue;\n\t\tif(!Array.isArray(data[R])) throw new Error(\"aoa_to_sheet expects an array of arrays\");\n\t\tvar __R = _R + R;\n\t\tif(dense) {\n\t\t\tif(!ws[\"!data\"][__R]) ws[\"!data\"][__R] = [];\n\t\t\trow = ws[\"!data\"][__R];\n\t\t}\n\t\tvar data_R = data[R];\n\t\tfor(var C = 0; C != data_R.length; ++C) {\n\t\t\tif(typeof data_R[C] === 'undefined') continue;\n\t\t\tvar cell/*:Cell*/ = ({v: data_R[C], t:\"\" }/*:any*/);\n\t\t\tvar __C = _C + C;\n\t\t\tif(range.s.r > __R) range.s.r = __R;\n\t\t\tif(range.s.c > __C) range.s.c = __C;\n\t\t\tif(range.e.r < __R) range.e.r = __R;\n\t\t\tif(range.e.c < __C) range.e.c = __C;\n\t\t\tseen = true;\n\t\t\tif(data_R[C] && typeof data_R[C] === 'object' && !Array.isArray(data_R[C]) && !(data_R[C] instanceof Date)) cell = data_R[C];\n\t\t\telse {\n\t\t\t\tif(Array.isArray(cell.v)) { cell.f = data_R[C][1]; cell.v = cell.v[0]; }\n\t\t\t\tif(cell.v === null) {\n\t\t\t\t\tif(cell.f) cell.t = 'n';\n\t\t\t\t\telse if(o.nullError) { cell.t = 'e'; cell.v = 0; }\n\t\t\t\t\telse if(!o.sheetStubs) continue;\n\t\t\t\t\telse cell.t = 'z';\n\t\t\t\t}\n\t\t\t\telse if(typeof cell.v === 'number') {\n\t\t\t\t\tif(isFinite(cell.v)) cell.t = 'n';\n\t\t\t\t\telse if(isNaN(cell.v)) { cell.t = 'e'; cell.v = 0x0F; /* #VALUE! */ }\n\t\t\t\t\telse { cell.t = 'e'; cell.v = 0x07; /*# DIV/0 */ }\n\t\t\t\t}\n\t\t\t\telse if(typeof cell.v === 'boolean') cell.t = 'b';\n\t\t\t\telse if(cell.v instanceof Date) {\n\t\t\t\t\tcell.z = o.dateNF || table_fmt[14];\n\t\t\t\t\tif(!o.UTC) cell.v = local_to_utc(cell.v);\n\t\t\t\t\tif(o.cellDates) { cell.t = 'd'; cell.w = SSF_format(cell.z, datenum(cell.v, o.date1904)); }\n\t\t\t\t\telse { cell.t = 'n'; cell.v = datenum(cell.v, o.date1904); cell.w = SSF_format(cell.z, cell.v); }\n\t\t\t\t}\n\t\t\t\telse cell.t = 's';\n\t\t\t}\n\t\t\tif(dense) {\n\t\t\t\tif(row[__C] && row[__C].z) cell.z = row[__C].z;\n\t\t\t\trow[__C] = cell;\n\t\t\t} else {\n\t\t\t\tvar cell_ref = encode_col(__C) + (__R + 1)/*:any*/;\n\t\t\t\tif(ws[cell_ref] && ws[cell_ref].z) cell.z = ws[cell_ref].z;\n\t\t\t\tws[cell_ref] = cell;\n\t\t\t}\n\t\t}\n\t}\n\tif(seen && range.s.c < 10400000) ws['!ref'] = encode_range(range);\n\treturn ws;\n}\nfunction aoa_to_sheet(data/*:AOA*/, opts/*:?any*/)/*:Worksheet*/ { return sheet_add_aoa(null, data, opts); }\nfunction parse_Int32LE(data) {\n\treturn data.read_shift(4, 'i');\n}\nfunction write_UInt32LE(x/*:number*/, o) {\n\tif (!o) o = new_buf(4);\n\to.write_shift(4, x);\n\treturn o;\n}\n\n/* [MS-XLSB] 2.5.168 */\nfunction parse_XLWideString(data/*::, length*/)/*:string*/ {\n\tvar cchCharacters = data.read_shift(4);\n\treturn cchCharacters === 0 ? \"\" : data.read_shift(cchCharacters, 'dbcs');\n}\nfunction write_XLWideString(data/*:string*/, o) {\n\tvar _null = false; if (o == null) { _null = true; o = new_buf(4 + 2 * data.length); }\n\to.write_shift(4, data.length);\n\tif (data.length > 0) o.write_shift(0, data, 'dbcs');\n\treturn _null ? o.slice(0, o.l) : o;\n}\n\n/* [MS-XLSB] 2.5.91 */\n//function parse_LPWideString(data/*::, length*/)/*:string*/ {\n//\tvar cchCharacters = data.read_shift(2);\n//\treturn cchCharacters === 0 ? \"\" : data.read_shift(cchCharacters, \"utf16le\");\n//}\n\n/* [MS-XLSB] 2.5.143 */\nfunction parse_StrRun(data) {\n\treturn { ich: data.read_shift(2), ifnt: data.read_shift(2) };\n}\nfunction write_StrRun(run, o) {\n\tif (!o) o = new_buf(4);\n\to.write_shift(2, run.ich || 0);\n\to.write_shift(2, run.ifnt || 0);\n\treturn o;\n}\n\n/* [MS-XLSB] 2.5.121 */\nfunction parse_RichStr(data, length/*:number*/)/*:XLString*/ {\n\tvar start = data.l;\n\tvar flags = data.read_shift(1);\n\tvar str = parse_XLWideString(data);\n\tvar rgsStrRun = [];\n\tvar z = ({ t: str, h: str }/*:any*/);\n\tif ((flags & 1) !== 0) { /* fRichStr */\n\t\t/* TODO: formatted string */\n\t\tvar dwSizeStrRun = data.read_shift(4);\n\t\tfor (var i = 0; i != dwSizeStrRun; ++i) rgsStrRun.push(parse_StrRun(data));\n\t\tz.r = rgsStrRun;\n\t}\n\telse z.r = [{ ich: 0, ifnt: 0 }];\n\t//if((flags & 2) !== 0) { /* fExtStr */\n\t//\t/* TODO: phonetic string */\n\t//}\n\tdata.l = start + length;\n\treturn z;\n}\nfunction write_RichStr(str/*:XLString*/, o/*:?Block*/)/*:Block*/ {\n\t/* TODO: formatted string */\n\tvar _null = false; if (o == null) { _null = true; o = new_buf(15 + 4 * str.t.length); }\n\to.write_shift(1, 0);\n\twrite_XLWideString(str.t, o);\n\treturn _null ? o.slice(0, o.l) : o;\n}\n/* [MS-XLSB] 2.4.328 BrtCommentText (RichStr w/1 run) */\nvar parse_BrtCommentText = parse_RichStr;\nfunction write_BrtCommentText(str/*:XLString*/, o/*:?Block*/)/*:Block*/ {\n\t/* TODO: formatted string */\n\tvar _null = false; if (o == null) { _null = true; o = new_buf(23 + 4 * str.t.length); }\n\to.write_shift(1, 1);\n\twrite_XLWideString(str.t, o);\n\to.write_shift(4, 1);\n\twrite_StrRun({ ich: 0, ifnt: 0 }, o);\n\treturn _null ? o.slice(0, o.l) : o;\n}\n\n/* [MS-XLSB] 2.5.9 */\nfunction parse_XLSBCell(data)/*:any*/ {\n\tvar col = data.read_shift(4);\n\tvar iStyleRef = data.read_shift(2);\n\tiStyleRef += data.read_shift(1) << 16;\n\tdata.l++; //var fPhShow = data.read_shift(1);\n\treturn { c: col, iStyleRef: iStyleRef };\n}\nfunction write_XLSBCell(cell/*:any*/, o/*:?Block*/) {\n\tif (o == null) o = new_buf(8);\n\to.write_shift(-4, cell.c);\n\to.write_shift(3, cell.iStyleRef || cell.s);\n\to.write_shift(1, 0); /* fPhShow */\n\treturn o;\n}\n\n/* Short XLSB Cell does not include column */\nfunction parse_XLSBShortCell(data)/*:any*/ {\n\tvar iStyleRef = data.read_shift(2);\n\tiStyleRef += data.read_shift(1) <<16;\n\tdata.l++; //var fPhShow = data.read_shift(1);\n\treturn { c:-1, iStyleRef: iStyleRef };\n}\nfunction write_XLSBShortCell(cell/*:any*/, o/*:?Block*/) {\n\tif(o == null) o = new_buf(4);\n\to.write_shift(3, cell.iStyleRef || cell.s);\n\to.write_shift(1, 0); /* fPhShow */\n\treturn o;\n}\n\n/* [MS-XLSB] 2.5.21 */\nvar parse_XLSBCodeName = parse_XLWideString;\nvar write_XLSBCodeName = write_XLWideString;\n\n/* [MS-XLSB] 2.5.166 */\nfunction parse_XLNullableWideString(data/*::, length*/)/*:string*/ {\n\tvar cchCharacters = data.read_shift(4);\n\treturn cchCharacters === 0 || cchCharacters === 0xFFFFFFFF ? \"\" : data.read_shift(cchCharacters, 'dbcs');\n}\nfunction write_XLNullableWideString(data/*:string*/, o) {\n\tvar _null = false; if (o == null) { _null = true; o = new_buf(127); }\n\to.write_shift(4, data.length > 0 ? data.length : 0xFFFFFFFF);\n\tif (data.length > 0) o.write_shift(0, data, 'dbcs');\n\treturn _null ? o.slice(0, o.l) : o;\n}\n\n/* [MS-XLSB] 2.5.165 */\nvar parse_XLNameWideString = parse_XLWideString;\n//var write_XLNameWideString = write_XLWideString;\n\n/* [MS-XLSB] 2.5.114 */\nvar parse_RelID = parse_XLNullableWideString;\nvar write_RelID = write_XLNullableWideString;\n\n\n/* [MS-XLS] 2.5.217 ; [MS-XLSB] 2.5.122 */\nfunction parse_RkNumber(data)/*:number*/ {\n\tvar b = data.slice(data.l, data.l + 4);\n\tvar fX100 = (b[0] & 1), fInt = (b[0] & 2);\n\tdata.l += 4;\n\tvar RK = fInt === 0 ? __double([0, 0, 0, 0, (b[0] & 0xFC), b[1], b[2], b[3]], 0) : __readInt32LE(b, 0) >> 2;\n\treturn fX100 ? (RK / 100) : RK;\n}\nfunction write_RkNumber(data/*:number*/, o) {\n\tif (o == null) o = new_buf(4);\n\tvar fX100 = 0, fInt = 0, d100 = data * 100;\n\tif ((data == (data | 0)) && (data >= -(1 << 29)) && (data < (1 << 29))) { fInt = 1; }\n\telse if ((d100 == (d100 | 0)) && (d100 >= -(1 << 29)) && (d100 < (1 << 29))) { fInt = 1; fX100 = 1; }\n\tif (fInt) o.write_shift(-4, ((fX100 ? d100 : data) << 2) + (fX100 + 2));\n\telse throw new Error(\"unsupported RkNumber \" + data); // TODO\n}\n\n\n/* [MS-XLSB] 2.5.117 RfX */\nfunction parse_RfX(data /*::, length*/)/*:Range*/ {\n\tvar cell/*:Range*/ = ({ s: {}, e: {} }/*:any*/);\n\tcell.s.r = data.read_shift(4);\n\tcell.e.r = data.read_shift(4);\n\tcell.s.c = data.read_shift(4);\n\tcell.e.c = data.read_shift(4);\n\treturn cell;\n}\nfunction write_RfX(r/*:Range*/, o) {\n\tif (!o) o = new_buf(16);\n\to.write_shift(4, r.s.r);\n\to.write_shift(4, r.e.r);\n\to.write_shift(4, r.s.c);\n\to.write_shift(4, r.e.c);\n\treturn o;\n}\n\n/* [MS-XLSB] 2.5.153 UncheckedRfX */\nvar parse_UncheckedRfX = parse_RfX;\nvar write_UncheckedRfX = write_RfX;\n\n/* [MS-XLSB] 2.5.155 UncheckedSqRfX */\n//function parse_UncheckedSqRfX(data) {\n//\tvar cnt = data.read_shift(4);\n//\tvar out = [];\n//\tfor(var i = 0; i < cnt; ++i) {\n//\t\tvar rng = parse_UncheckedRfX(data);\n//\t\tout.push(encode_range(rng));\n//\t}\n//\treturn out.join(\",\");\n//}\n//function write_UncheckedSqRfX(sqrfx/*:string*/) {\n//\tvar parts = sqrfx.split(/\\s*,\\s*/);\n//\tvar o = new_buf(4); o.write_shift(4, parts.length);\n//\tvar out = [o];\n//\tparts.forEach(function(rng) {\n//\t\tout.push(write_UncheckedRfX(safe_decode_range(rng)));\n//\t});\n//\treturn bconcat(out);\n//}\n\n/* [MS-XLS] 2.5.342 ; [MS-XLSB] 2.5.171 */\n/* TODO: error checking, NaN and Infinity values are not valid Xnum */\nfunction parse_Xnum(data/*::, length*/) {\n\tif(data.length - data.l < 8) throw \"XLS Xnum Buffer underflow\";\n\treturn data.read_shift(8, 'f');\n}\nfunction write_Xnum(data, o) { return (o || new_buf(8)).write_shift(8, data, 'f'); }\n\n/* [MS-XLSB] 2.4.324 BrtColor */\nfunction parse_BrtColor(data/*::, length*/) {\n\tvar out = {};\n\tvar d = data.read_shift(1);\n\n\t//var fValidRGB = d & 1;\n\tvar xColorType = d >>> 1;\n\n\tvar index = data.read_shift(1);\n\tvar nTS = data.read_shift(2, 'i');\n\tvar bR = data.read_shift(1);\n\tvar bG = data.read_shift(1);\n\tvar bB = data.read_shift(1);\n\tdata.l++; //var bAlpha = data.read_shift(1);\n\n\tswitch (xColorType) {\n\t\tcase 0: out.auto = 1; break;\n\t\tcase 1:\n\t\t\tout.index = index;\n\t\t\tvar icv = XLSIcv[index];\n\t\t\t/* automatic pseudo index 81 */\n\t\t\tif (icv) out.rgb = rgb2Hex(icv);\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\t/* if(!fValidRGB) throw new Error(\"invalid\"); */\n\t\t\tout.rgb = rgb2Hex([bR, bG, bB]);\n\t\t\tbreak;\n\t\tcase 3: out.theme = index; break;\n\t}\n\tif (nTS != 0) out.tint = nTS > 0 ? nTS / 32767 : nTS / 32768;\n\n\treturn out;\n}\nfunction write_BrtColor(color, o) {\n\tif (!o) o = new_buf(8);\n\tif (!color || color.auto) { o.write_shift(4, 0); o.write_shift(4, 0); return o; }\n\tif (color.index != null) {\n\t\to.write_shift(1, 0x02);\n\t\to.write_shift(1, color.index);\n\t} else if (color.theme != null) {\n\t\to.write_shift(1, 0x06);\n\t\to.write_shift(1, color.theme);\n\t} else {\n\t\to.write_shift(1, 0x05);\n\t\to.write_shift(1, 0);\n\t}\n\tvar nTS = color.tint || 0;\n\tif (nTS > 0) nTS *= 32767;\n\telse if (nTS < 0) nTS *= 32768;\n\to.write_shift(2, nTS);\n\tif (!color.rgb || color.theme != null) {\n\t\to.write_shift(2, 0);\n\t\to.write_shift(1, 0);\n\t\to.write_shift(1, 0);\n\t} else {\n\t\tvar rgb = (color.rgb || 'FFFFFF');\n\t\tif (typeof rgb == 'number') rgb = (\"000000\" + rgb.toString(16)).slice(-6);\n\t\to.write_shift(1, parseInt(rgb.slice(0, 2), 16));\n\t\to.write_shift(1, parseInt(rgb.slice(2, 4), 16));\n\t\to.write_shift(1, parseInt(rgb.slice(4, 6), 16));\n\t\to.write_shift(1, 0xFF);\n\t}\n\treturn o;\n}\n\n/* [MS-XLSB] 2.5.52 */\nfunction parse_FontFlags(data/*::, length, opts*/) {\n\tvar d = data.read_shift(1);\n\tdata.l++;\n\tvar out = {\n\t\tfBold: d & 0x01,\n\t\tfItalic: d & 0x02,\n\t\tfUnderline: d & 0x04,\n\t\tfStrikeout: d & 0x08,\n\t\tfOutline: d & 0x10,\n\t\tfShadow: d & 0x20,\n\t\tfCondense: d & 0x40,\n\t\tfExtend: d & 0x80\n\t};\n\treturn out;\n}\nfunction write_FontFlags(font, o) {\n\tif (!o) o = new_buf(2);\n\tvar grbit =\n\t\t(font.italic ? 0x02 : 0) |\n\t\t(font.strike ? 0x08 : 0) |\n\t\t(font.outline ? 0x10 : 0) |\n\t\t(font.shadow ? 0x20 : 0) |\n\t\t(font.condense ? 0x40 : 0) |\n\t\t(font.extend ? 0x80 : 0);\n\to.write_shift(1, grbit);\n\to.write_shift(1, 0);\n\treturn o;\n}\n\n/* [MS-OLEDS] 2.3.1 and 2.3.2 */\nfunction parse_ClipboardFormatOrString(o, w/*:number*/)/*:string*/ {\n\t// $FlowIgnore\n\tvar ClipFmt = { 2: \"BITMAP\", 3: \"METAFILEPICT\", 8: \"DIB\", 14: \"ENHMETAFILE\" };\n\tvar m/*:number*/ = o.read_shift(4);\n\tswitch (m) {\n\t\tcase 0x00000000: return \"\";\n\t\tcase 0xffffffff: case 0xfffffffe: return ClipFmt[o.read_shift(4)] || \"\";\n\t}\n\tif (m > 0x190) throw new Error(\"Unsupported Clipboard: \" + m.toString(16));\n\to.l -= 4;\n\treturn o.read_shift(0, w == 1 ? \"lpstr\" : \"lpwstr\");\n}\nfunction parse_ClipboardFormatOrAnsiString(o) { return parse_ClipboardFormatOrString(o, 1); }\nfunction parse_ClipboardFormatOrUnicodeString(o) { return parse_ClipboardFormatOrString(o, 2); }\n\n/* [MS-OLEPS] 2.2 PropertyType */\n// Note: some tree shakers cannot handle VT_VECTOR | $CONST, hence extra vars\n//var VT_EMPTY = 0x0000;\n//var VT_NULL = 0x0001;\nvar VT_I2 = 0x0002;\nvar VT_I4 = 0x0003;\n//var VT_R4 = 0x0004;\n//var VT_R8 = 0x0005;\n//var VT_CY = 0x0006;\n//var VT_DATE = 0x0007;\n//var VT_BSTR = 0x0008;\n//var VT_ERROR = 0x000A;\nvar VT_BOOL = 0x000B;\nvar VT_VARIANT = 0x000C;\n//var VT_DECIMAL = 0x000E;\n//var VT_I1 = 0x0010;\n//var VT_UI1 = 0x0011;\n//var VT_UI2 = 0x0012;\nvar VT_UI4 = 0x0013;\n//var VT_I8 = 0x0014;\n//var VT_UI8 = 0x0015;\n//var VT_INT = 0x0016;\n//var VT_UINT = 0x0017;\n//var VT_LPSTR = 0x001E;\n//var VT_LPWSTR = 0x001F;\nvar VT_FILETIME = 0x0040;\nvar VT_BLOB = 0x0041;\n//var VT_STREAM = 0x0042;\n//var VT_STORAGE = 0x0043;\n//var VT_STREAMED_Object = 0x0044;\n//var VT_STORED_Object = 0x0045;\n//var VT_BLOB_Object = 0x0046;\nvar VT_CF = 0x0047;\n//var VT_CLSID = 0x0048;\n//var VT_VERSIONED_STREAM = 0x0049;\n//var VT_VECTOR = 0x1000;\nvar VT_VECTOR_VARIANT = 0x100C;\nvar VT_VECTOR_LPSTR = 0x101E;\n//var VT_ARRAY = 0x2000;\n\nvar VT_STRING = 0x0050; // 2.3.3.1.11 VtString\nvar VT_USTR = 0x0051; // 2.3.3.1.12 VtUnalignedString\nvar VT_CUSTOM = [VT_STRING, VT_USTR];\n\n/* [MS-OSHARED] 2.3.3.2.2.1 Document Summary Information PIDDSI */\nvar DocSummaryPIDDSI = {\n\t0x01: { n: 'CodePage', t: VT_I2 },\n\t0x02: { n: 'Category', t: VT_STRING },\n\t0x03: { n: 'PresentationFormat', t: VT_STRING },\n\t0x04: { n: 'ByteCount', t: VT_I4 },\n\t0x05: { n: 'LineCount', t: VT_I4 },\n\t0x06: { n: 'ParagraphCount', t: VT_I4 },\n\t0x07: { n: 'SlideCount', t: VT_I4 },\n\t0x08: { n: 'NoteCount', t: VT_I4 },\n\t0x09: { n: 'HiddenCount', t: VT_I4 },\n\t0x0a: { n: 'MultimediaClipCount', t: VT_I4 },\n\t0x0b: { n: 'ScaleCrop', t: VT_BOOL },\n\t0x0c: { n: 'HeadingPairs', t: VT_VECTOR_VARIANT /* VT_VECTOR | VT_VARIANT */ },\n\t0x0d: { n: 'TitlesOfParts', t: VT_VECTOR_LPSTR /* VT_VECTOR | VT_LPSTR */ },\n\t0x0e: { n: 'Manager', t: VT_STRING },\n\t0x0f: { n: 'Company', t: VT_STRING },\n\t0x10: { n: 'LinksUpToDate', t: VT_BOOL },\n\t0x11: { n: 'CharacterCount', t: VT_I4 },\n\t0x13: { n: 'SharedDoc', t: VT_BOOL },\n\t0x16: { n: 'HyperlinksChanged', t: VT_BOOL },\n\t0x17: { n: 'AppVersion', t: VT_I4, p: 'version' },\n\t0x18: { n: 'DigSig', t: VT_BLOB },\n\t0x1A: { n: 'ContentType', t: VT_STRING },\n\t0x1B: { n: 'ContentStatus', t: VT_STRING },\n\t0x1C: { n: 'Language', t: VT_STRING },\n\t0x1D: { n: 'Version', t: VT_STRING },\n\t0xFF: {},\n\t/* [MS-OLEPS] 2.18 */\n\t0x80000000: { n: 'Locale', t: VT_UI4 },\n\t0x80000003: { n: 'Behavior', t: VT_UI4 },\n\t0x72627262: {}\n};\n\n/* [MS-OSHARED] 2.3.3.2.1.1 Summary Information Property Set PIDSI */\nvar SummaryPIDSI = {\n\t0x01: { n: 'CodePage', t: VT_I2 },\n\t0x02: { n: 'Title', t: VT_STRING },\n\t0x03: { n: 'Subject', t: VT_STRING },\n\t0x04: { n: 'Author', t: VT_STRING },\n\t0x05: { n: 'Keywords', t: VT_STRING },\n\t0x06: { n: 'Comments', t: VT_STRING },\n\t0x07: { n: 'Template', t: VT_STRING },\n\t0x08: { n: 'LastAuthor', t: VT_STRING },\n\t0x09: { n: 'RevNumber', t: VT_STRING },\n\t0x0A: { n: 'EditTime', t: VT_FILETIME },\n\t0x0B: { n: 'LastPrinted', t: VT_FILETIME },\n\t0x0C: { n: 'CreatedDate', t: VT_FILETIME },\n\t0x0D: { n: 'ModifiedDate', t: VT_FILETIME },\n\t0x0E: { n: 'PageCount', t: VT_I4 },\n\t0x0F: { n: 'WordCount', t: VT_I4 },\n\t0x10: { n: 'CharCount', t: VT_I4 },\n\t0x11: { n: 'Thumbnail', t: VT_CF },\n\t0x12: { n: 'Application', t: VT_STRING },\n\t0x13: { n: 'DocSecurity', t: VT_I4 },\n\t0xFF: {},\n\t/* [MS-OLEPS] 2.18 */\n\t0x80000000: { n: 'Locale', t: VT_UI4 },\n\t0x80000003: { n: 'Behavior', t: VT_UI4 },\n\t0x72627262: {}\n};\n\n/* [MS-XLS] 2.4.63 Country/Region codes */\nvar CountryEnum = {\n\t0x0001: \"US\", // United States\n\t0x0002: \"CA\", // Canada\n\t0x0003: \"\", // Latin America (except Brazil)\n\t0x0007: \"RU\", // Russia\n\t0x0014: \"EG\", // Egypt\n\t0x001E: \"GR\", // Greece\n\t0x001F: \"NL\", // Netherlands\n\t0x0020: \"BE\", // Belgium\n\t0x0021: \"FR\", // France\n\t0x0022: \"ES\", // Spain\n\t0x0024: \"HU\", // Hungary\n\t0x0027: \"IT\", // Italy\n\t0x0029: \"CH\", // Switzerland\n\t0x002B: \"AT\", // Austria\n\t0x002C: \"GB\", // United Kingdom\n\t0x002D: \"DK\", // Denmark\n\t0x002E: \"SE\", // Sweden\n\t0x002F: \"NO\", // Norway\n\t0x0030: \"PL\", // Poland\n\t0x0031: \"DE\", // Germany\n\t0x0034: \"MX\", // Mexico\n\t0x0037: \"BR\", // Brazil\n\t0x003d: \"AU\", // Australia\n\t0x0040: \"NZ\", // New Zealand\n\t0x0042: \"TH\", // Thailand\n\t0x0051: \"JP\", // Japan\n\t0x0052: \"KR\", // Korea\n\t0x0054: \"VN\", // Viet Nam\n\t0x0056: \"CN\", // China\n\t0x005A: \"TR\", // Turkey\n\t0x0069: \"JS\", // Ramastan\n\t0x00D5: \"DZ\", // Algeria\n\t0x00D8: \"MA\", // Morocco\n\t0x00DA: \"LY\", // Libya\n\t0x015F: \"PT\", // Portugal\n\t0x0162: \"IS\", // Iceland\n\t0x0166: \"FI\", // Finland\n\t0x01A4: \"CZ\", // Czech Republic\n\t0x0376: \"TW\", // Taiwan\n\t0x03C1: \"LB\", // Lebanon\n\t0x03C2: \"JO\", // Jordan\n\t0x03C3: \"SY\", // Syria\n\t0x03C4: \"IQ\", // Iraq\n\t0x03C5: \"KW\", // Kuwait\n\t0x03C6: \"SA\", // Saudi Arabia\n\t0x03CB: \"AE\", // United Arab Emirates\n\t0x03CC: \"IL\", // Israel\n\t0x03CE: \"QA\", // Qatar\n\t0x03D5: \"IR\", // Iran\n\t0xFFFF: \"US\" // United States\n};\n\n/* [MS-XLS] 2.5.127 */\nvar XLSFillPattern = [\n\tnull,\n\t'solid',\n\t'mediumGray',\n\t'darkGray',\n\t'lightGray',\n\t'darkHorizontal',\n\t'darkVertical',\n\t'darkDown',\n\t'darkUp',\n\t'darkGrid',\n\t'darkTrellis',\n\t'lightHorizontal',\n\t'lightVertical',\n\t'lightDown',\n\t'lightUp',\n\t'lightGrid',\n\t'lightTrellis',\n\t'gray125',\n\t'gray0625'\n];\n\nfunction rgbify(arr/*:Array*/)/*:Array<[number, number, number]>*/ { return arr.map(function(x) { return [(x>>16)&255,(x>>8)&255,x&255]; }); }\n\n/* [MS-XLS] 2.5.161 */\n/* [MS-XLSB] 2.5.75 Icv */\nvar _XLSIcv = /*#__PURE__*/ rgbify([\n\t/* Color Constants */\n\t0x000000,\n\t0xFFFFFF,\n\t0xFF0000,\n\t0x00FF00,\n\t0x0000FF,\n\t0xFFFF00,\n\t0xFF00FF,\n\t0x00FFFF,\n\n\t/* Overridable Defaults */\n\t0x000000,\n\t0xFFFFFF,\n\t0xFF0000,\n\t0x00FF00,\n\t0x0000FF,\n\t0xFFFF00,\n\t0xFF00FF,\n\t0x00FFFF,\n\n\t0x800000,\n\t0x008000,\n\t0x000080,\n\t0x808000,\n\t0x800080,\n\t0x008080,\n\t0xC0C0C0,\n\t0x808080,\n\t0x9999FF,\n\t0x993366,\n\t0xFFFFCC,\n\t0xCCFFFF,\n\t0x660066,\n\t0xFF8080,\n\t0x0066CC,\n\t0xCCCCFF,\n\n\t0x000080,\n\t0xFF00FF,\n\t0xFFFF00,\n\t0x00FFFF,\n\t0x800080,\n\t0x800000,\n\t0x008080,\n\t0x0000FF,\n\t0x00CCFF,\n\t0xCCFFFF,\n\t0xCCFFCC,\n\t0xFFFF99,\n\t0x99CCFF,\n\t0xFF99CC,\n\t0xCC99FF,\n\t0xFFCC99,\n\n\t0x3366FF,\n\t0x33CCCC,\n\t0x99CC00,\n\t0xFFCC00,\n\t0xFF9900,\n\t0xFF6600,\n\t0x666699,\n\t0x969696,\n\t0x003366,\n\t0x339966,\n\t0x003300,\n\t0x333300,\n\t0x993300,\n\t0x993366,\n\t0x333399,\n\t0x333333,\n\n\t/* Other entries to appease BIFF8/12 */\n\t0x000000, /* 0x40 icvForeground ?? */\n\t0xFFFFFF, /* 0x41 icvBackground ?? */\n\t0x000000, /* 0x42 icvFrame ?? */\n\t0x000000, /* 0x43 icv3D ?? */\n\t0x000000, /* 0x44 icv3DText ?? */\n\t0x000000, /* 0x45 icv3DHilite ?? */\n\t0x000000, /* 0x46 icv3DShadow ?? */\n\t0x000000, /* 0x47 icvHilite ?? */\n\t0x000000, /* 0x48 icvCtlText ?? */\n\t0x000000, /* 0x49 icvCtlScrl ?? */\n\t0x000000, /* 0x4A icvCtlInv ?? */\n\t0x000000, /* 0x4B icvCtlBody ?? */\n\t0x000000, /* 0x4C icvCtlFrame ?? */\n\t0x000000, /* 0x4D icvCtlFore ?? */\n\t0x000000, /* 0x4E icvCtlBack ?? */\n\t0x000000, /* 0x4F icvCtlNeutral */\n\t0x000000, /* 0x50 icvInfoBk ?? */\n\t0x000000 /* 0x51 icvInfoText ?? */\n]);\nvar XLSIcv = /*#__PURE__*/dup(_XLSIcv);\n\n/* [MS-XLSB] 2.5.97.2 */\nvar BErr = {\n\t0x00: \"#NULL!\",\n\t0x07: \"#DIV/0!\",\n\t0x0F: \"#VALUE!\",\n\t0x17: \"#REF!\",\n\t0x1D: \"#NAME?\",\n\t0x24: \"#NUM!\",\n\t0x2A: \"#N/A\",\n\t0x2B: \"#GETTING_DATA\",\n\t0xFF: \"#WTF?\"\n};\n//var RBErr = evert_num(BErr);\nvar RBErr = {\n\t\"#NULL!\": 0x00,\n\t\"#DIV/0!\": 0x07,\n\t\"#VALUE!\": 0x0F,\n\t\"#REF!\": 0x17,\n\t\"#NAME?\": 0x1D,\n\t\"#NUM!\": 0x24,\n\t\"#N/A\": 0x2A,\n\t\"#GETTING_DATA\": 0x2B,\n\t\"#WTF?\": 0xFF\n};\n\nvar XLSLblBuiltIn = [\n\t\"_xlnm.Consolidate_Area\",\n\t\"_xlnm.Auto_Open\",\n\t\"_xlnm.Auto_Close\",\n\t\"_xlnm.Extract\",\n\t\"_xlnm.Database\",\n\t\"_xlnm.Criteria\",\n\t\"_xlnm.Print_Area\",\n\t\"_xlnm.Print_Titles\",\n\t\"_xlnm.Recorder\",\n\t\"_xlnm.Data_Form\",\n\t\"_xlnm.Auto_Activate\",\n\t\"_xlnm.Auto_Deactivate\",\n\t\"_xlnm.Sheet_Title\",\n\t\"_xlnm._FilterDatabase\"\n];\n\n/* Parts enumerated in OPC spec, MS-XLSB and MS-XLSX */\n/* 12.3 Part Summary */\n/* 14.2 Part Summary */\n/* [MS-XLSX] 2.1 Part Enumerations ; [MS-XLSB] 2.1.7 Part Enumeration */\nvar ct2type/*{[string]:string}*/ = ({\n\t/* Workbook */\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml\": \"workbooks\",\n\t\"application/vnd.ms-excel.sheet.macroEnabled.main+xml\": \"workbooks\",\n\t\"application/vnd.ms-excel.sheet.binary.macroEnabled.main\": \"workbooks\",\n\t\"application/vnd.ms-excel.addin.macroEnabled.main+xml\": \"workbooks\",\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml\": \"workbooks\",\n\n\t/* Worksheet */\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml\": \"sheets\",\n\t\"application/vnd.ms-excel.worksheet\": \"sheets\",\n\t\"application/vnd.ms-excel.binIndexWs\": \"TODO\", /* Binary Index */\n\n\t/* Chartsheet */\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml\": \"charts\",\n\t\"application/vnd.ms-excel.chartsheet\": \"charts\",\n\n\t/* Macrosheet */\n\t\"application/vnd.ms-excel.macrosheet+xml\": \"macros\",\n\t\"application/vnd.ms-excel.macrosheet\": \"macros\",\n\t\"application/vnd.ms-excel.intlmacrosheet\": \"TODO\",\n\t\"application/vnd.ms-excel.binIndexMs\": \"TODO\", /* Binary Index */\n\n\t/* Dialogsheet */\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml\": \"dialogs\",\n\t\"application/vnd.ms-excel.dialogsheet\": \"dialogs\",\n\n\t/* Shared Strings */\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml\": \"strs\",\n\t\"application/vnd.ms-excel.sharedStrings\": \"strs\",\n\n\t/* Styles */\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml\": \"styles\",\n\t\"application/vnd.ms-excel.styles\": \"styles\",\n\n\t/* File Properties */\n\t\"application/vnd.openxmlformats-package.core-properties+xml\": \"coreprops\",\n\t\"application/vnd.openxmlformats-officedocument.custom-properties+xml\": \"custprops\",\n\t\"application/vnd.openxmlformats-officedocument.extended-properties+xml\": \"extprops\",\n\n\t/* Custom Data Properties */\n\t\"application/vnd.openxmlformats-officedocument.customXmlProperties+xml\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty\": \"TODO\",\n\n\t/* Comments */\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml\": \"comments\",\n\t\"application/vnd.ms-excel.comments\": \"comments\",\n\t\"application/vnd.ms-excel.threadedcomments+xml\": \"threadedcomments\",\n\t\"application/vnd.ms-excel.person+xml\": \"people\",\n\n\t/* Metadata (Stock/Geography and Dynamic Array) */\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml\": \"metadata\",\n\t\"application/vnd.ms-excel.sheetMetadata\": \"metadata\",\n\n\t/* PivotTable */\n\t\"application/vnd.ms-excel.pivotTable\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml\": \"TODO\",\n\n\t/* Chart Objects */\n\t\"application/vnd.openxmlformats-officedocument.drawingml.chart+xml\": \"TODO\",\n\n\t/* Chart Colors */\n\t\"application/vnd.ms-office.chartcolorstyle+xml\": \"TODO\",\n\n\t/* Chart Style */\n\t\"application/vnd.ms-office.chartstyle+xml\": \"TODO\",\n\n\t/* Chart Advanced */\n\t\"application/vnd.ms-office.chartex+xml\": \"TODO\",\n\n\t/* Calculation Chain */\n\t\"application/vnd.ms-excel.calcChain\": \"calcchains\",\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml\": \"calcchains\",\n\n\t/* Printer Settings */\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings\": \"TODO\",\n\n\t/* ActiveX */\n\t\"application/vnd.ms-office.activeX\": \"TODO\",\n\t\"application/vnd.ms-office.activeX+xml\": \"TODO\",\n\n\t/* Custom Toolbars */\n\t\"application/vnd.ms-excel.attachedToolbars\": \"TODO\",\n\n\t/* External Data Connections */\n\t\"application/vnd.ms-excel.connections\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml\": \"TODO\",\n\n\t/* External Links */\n\t\"application/vnd.ms-excel.externalLink\": \"links\",\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml\": \"links\",\n\n\t/* PivotCache */\n\t\"application/vnd.ms-excel.pivotCacheDefinition\": \"TODO\",\n\t\"application/vnd.ms-excel.pivotCacheRecords\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml\": \"TODO\",\n\n\t/* Query Table */\n\t\"application/vnd.ms-excel.queryTable\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml\": \"TODO\",\n\n\t/* Shared Workbook */\n\t\"application/vnd.ms-excel.userNames\": \"TODO\",\n\t\"application/vnd.ms-excel.revisionHeaders\": \"TODO\",\n\t\"application/vnd.ms-excel.revisionLog\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionHeaders+xml\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionLog+xml\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.userNames+xml\": \"TODO\",\n\n\t/* Single Cell Table */\n\t\"application/vnd.ms-excel.tableSingleCells\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.tableSingleCells+xml\": \"TODO\",\n\n\t/* Slicer */\n\t\"application/vnd.ms-excel.slicer\": \"TODO\",\n\t\"application/vnd.ms-excel.slicerCache\": \"TODO\",\n\t\"application/vnd.ms-excel.slicer+xml\": \"TODO\",\n\t\"application/vnd.ms-excel.slicerCache+xml\": \"TODO\",\n\n\t/* Sort Map */\n\t\"application/vnd.ms-excel.wsSortMap\": \"TODO\",\n\n\t/* Table */\n\t\"application/vnd.ms-excel.table\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml\": \"TODO\",\n\n\t/* Themes */\n\t\"application/vnd.openxmlformats-officedocument.theme+xml\": \"themes\",\n\n\t/* Theme Override */\n\t\"application/vnd.openxmlformats-officedocument.themeOverride+xml\": \"TODO\",\n\n\t/* Timeline */\n\t\"application/vnd.ms-excel.Timeline+xml\": \"TODO\", /* verify */\n\t\"application/vnd.ms-excel.TimelineCache+xml\": \"TODO\", /* verify */\n\n\t/* VBA */\n\t\"application/vnd.ms-office.vbaProject\": \"vba\",\n\t\"application/vnd.ms-office.vbaProjectSignature\": \"TODO\",\n\n\t/* Volatile Dependencies */\n\t\"application/vnd.ms-office.volatileDependencies\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.spreadsheetml.volatileDependencies+xml\": \"TODO\",\n\n\t/* Control Properties */\n\t\"application/vnd.ms-excel.controlproperties+xml\": \"TODO\",\n\n\t/* Data Model */\n\t\"application/vnd.openxmlformats-officedocument.model+data\": \"TODO\",\n\n\t/* Survey */\n\t\"application/vnd.ms-excel.Survey+xml\": \"TODO\",\n\n\t/* Drawing */\n\t\"application/vnd.openxmlformats-officedocument.drawing+xml\": \"drawings\",\n\t\"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.drawingml.diagramColors+xml\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.drawingml.diagramLayout+xml\": \"TODO\",\n\t\"application/vnd.openxmlformats-officedocument.drawingml.diagramStyle+xml\": \"TODO\",\n\n\t/* VML */\n\t\"application/vnd.openxmlformats-officedocument.vmlDrawing\": \"TODO\",\n\n\t\"application/vnd.openxmlformats-package.relationships+xml\": \"rels\",\n\t\"application/vnd.openxmlformats-officedocument.oleObject\": \"TODO\",\n\n\t/* Image */\n\t\"image/png\": \"TODO\",\n\n\t\"sheet\": \"js\"\n}/*:any*/);\n\nvar CT_LIST = {\n\tworkbooks: {\n\t\txlsx: \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml\",\n\t\txlsm: \"application/vnd.ms-excel.sheet.macroEnabled.main+xml\",\n\t\txlsb: \"application/vnd.ms-excel.sheet.binary.macroEnabled.main\",\n\t\txlam: \"application/vnd.ms-excel.addin.macroEnabled.main+xml\",\n\t\txltx: \"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml\"\n\t},\n\tstrs: { /* Shared Strings */\n\t\txlsx: \"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml\",\n\t\txlsb: \"application/vnd.ms-excel.sharedStrings\"\n\t},\n\tcomments: { /* Comments */\n\t\txlsx: \"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml\",\n\t\txlsb: \"application/vnd.ms-excel.comments\"\n\t},\n\tsheets: { /* Worksheet */\n\t\txlsx: \"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml\",\n\t\txlsb: \"application/vnd.ms-excel.worksheet\"\n\t},\n\tcharts: { /* Chartsheet */\n\t\txlsx: \"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml\",\n\t\txlsb: \"application/vnd.ms-excel.chartsheet\"\n\t},\n\tdialogs: { /* Dialogsheet */\n\t\txlsx: \"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml\",\n\t\txlsb: \"application/vnd.ms-excel.dialogsheet\"\n\t},\n\tmacros: { /* Macrosheet (Excel 4.0 Macros) */\n\t\txlsx: \"application/vnd.ms-excel.macrosheet+xml\",\n\t\txlsb: \"application/vnd.ms-excel.macrosheet\"\n\t},\n\tmetadata: { /* Metadata (Stock/Geography and Dynamic Array) */\n\t\txlsx: \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml\",\n\t\txlsb: \"application/vnd.ms-excel.sheetMetadata\"\n\t},\n\tstyles: { /* Styles */\n\t\txlsx: \"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml\",\n\t\txlsb: \"application/vnd.ms-excel.styles\"\n\t}\n};\n\nfunction new_ct()/*:any*/ {\n\treturn ({\n\t\tworkbooks:[], sheets:[], charts:[], dialogs:[], macros:[],\n\t\trels:[], strs:[], comments:[], threadedcomments:[], links:[],\n\t\tcoreprops:[], extprops:[], custprops:[], themes:[], styles:[],\n\t\tcalcchains:[], vba: [], drawings: [], metadata: [], people:[],\n\t\tTODO:[], xmlns: \"\" }/*:any*/);\n}\n\nfunction parse_ct(data/*:?string*/) {\n\tvar ct = new_ct();\n\tif(!data || !data.match) return ct;\n\tvar ctext = {};\n\t(data.match(tagregex)||[]).forEach(function(x) {\n\t\tvar y = parsexmltag(x);\n\t\tswitch(y[0].replace(nsregex,\"<\")) {\n\t\t\tcase ' 0 ? ct.calcchains[0] : \"\";\n\tct.sst = ct.strs.length > 0 ? ct.strs[0] : \"\";\n\tct.style = ct.styles.length > 0 ? ct.styles[0] : \"\";\n\tct.defaults = ctext;\n\tdelete ct.calcchains;\n\treturn ct;\n}\n\nfunction write_ct(ct, opts, raw)/*:string*/ {\n\tvar type2ct/*{[string]:Array}*/ = evert_arr(ct2type);\n\n\tvar o/*:Array*/ = [], v;\n\n\tif(!raw) {\n\t\to[o.length] = (XML_HEADER);\n\t\to[o.length] = writextag('Types', null, {\n\t\t\t'xmlns': XMLNS.CT,\n\t\t\t'xmlns:xsd': XMLNS.xsd,\n\t\t\t'xmlns:xsi': XMLNS.xsi\n\t\t});\n\t\to = o.concat([\n\t\t\t['xml', 'application/xml'],\n\t\t\t['bin', 'application/vnd.ms-excel.sheet.binary.macroEnabled.main'],\n\t\t\t['vml', 'application/vnd.openxmlformats-officedocument.vmlDrawing'],\n\t\t\t['data', 'application/vnd.openxmlformats-officedocument.model+data'],\n\t\t\t/* from test files */\n\t\t\t['bmp', 'image/bmp'],\n\t\t\t['png', 'image/png'],\n\t\t\t['gif', 'image/gif'],\n\t\t\t['emf', 'image/x-emf'],\n\t\t\t['wmf', 'image/x-wmf'],\n\t\t\t['jpg', 'image/jpeg'], ['jpeg', 'image/jpeg'],\n\t\t\t['tif', 'image/tiff'], ['tiff', 'image/tiff'],\n\t\t\t['pdf', 'application/pdf'],\n\t\t\t['rels', 'application/vnd.openxmlformats-package.relationships+xml']\n\t\t].map(function(x) {\n\t\t\treturn writextag('Default', null, {'Extension':x[0], 'ContentType': x[1]});\n\t\t}));\n\t}\n\n\t/* only write first instance */\n\tvar f1 = function(w) {\n\t\tif(ct[w] && ct[w].length > 0) {\n\t\t\tv = ct[w][0];\n\t\t\to[o.length] = (writextag('Override', null, {\n\t\t\t\t'PartName': (v[0] == '/' ? \"\":\"/\") + v,\n\t\t\t\t'ContentType': CT_LIST[w][opts.bookType] || CT_LIST[w]['xlsx']\n\t\t\t}));\n\t\t}\n\t};\n\n\t/* book type-specific */\n\tvar f2 = function(w) {\n\t\t(ct[w]||[]).forEach(function(v) {\n\t\t\to[o.length] = (writextag('Override', null, {\n\t\t\t\t'PartName': (v[0] == '/' ? \"\":\"/\") + v,\n\t\t\t\t'ContentType': CT_LIST[w][opts.bookType] || CT_LIST[w]['xlsx']\n\t\t\t}));\n\t\t});\n\t};\n\n\t/* standard type */\n\tvar f3 = function(t) {\n\t\t(ct[t]||[]).forEach(function(v) {\n\t\t\to[o.length] = (writextag('Override', null, {\n\t\t\t\t'PartName': (v[0] == '/' ? \"\":\"/\") + v,\n\t\t\t\t'ContentType': type2ct[t][0]\n\t\t\t}));\n\t\t});\n\t};\n\n\tf1('workbooks');\n\tf2('sheets');\n\tf2('charts');\n\tf3('themes');\n\t['strs', 'styles'].forEach(f1);\n\t['coreprops', 'extprops', 'custprops'].forEach(f3);\n\tf3('vba');\n\tf3('comments');\n\tf3('threadedcomments');\n\tf3('drawings');\n\tf2('metadata');\n\tf3('people');\n\tif(!raw && o.length>2){ o[o.length] = (''); o[1]=o[1].replace(\"/>\",\">\"); }\n\treturn o.join(\"\");\n}\n/* 9.3 Relationships */\nvar RELS = ({\n\tWB: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n\tSHEET: \"http://sheetjs.openxmlformats.org/officeDocument/2006/relationships/officeDocument\",\n\tHLINK: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink\",\n\tVML: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing\",\n\tXPATH: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath\",\n\tXMISS: \"http://schemas.microsoft.com/office/2006/relationships/xlExternalLinkPath/xlPathMissing\",\n\tXLINK: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink\",\n\tCXML: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml\",\n\tCXMLP: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps\",\n\tCMNT: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments\",\n\tCORE_PROPS: \"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\",\n\tEXT_PROPS: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties',\n\tCUST_PROPS: 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties',\n\tSST: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings\",\n\tSTY: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles\",\n\tTHEME: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\",\n\tCHART: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart\",\n\tCHARTEX: \"http://schemas.microsoft.com/office/2014/relationships/chartEx\",\n\tCS: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartsheet\",\n\tWS: [\n\t\t\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet\",\n\t\t\"http://purl.oclc.org/ooxml/officeDocument/relationships/worksheet\"\n\t],\n\tDS: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/dialogsheet\",\n\tMS: \"http://schemas.microsoft.com/office/2006/relationships/xlMacrosheet\",\n\tIMG: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image\",\n\tDRAW: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing\",\n\tXLMETA: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata\",\n\tTCMNT: \"http://schemas.microsoft.com/office/2017/10/relationships/threadedComment\",\n\tPEOPLE: \"http://schemas.microsoft.com/office/2017/10/relationships/person\",\n\tCONN: \"http://schemas.openxmlformats.org/officeDocument/2006/relationships/connections\",\n\tVBA: \"http://schemas.microsoft.com/office/2006/relationships/vbaProject\"\n}/*:any*/);\n\n/* 9.3.3 Representing Relationships */\nfunction get_rels_path(file/*:string*/)/*:string*/ {\n\tvar n = file.lastIndexOf(\"/\");\n\treturn file.slice(0,n+1) + '_rels/' + file.slice(n+1) + \".rels\";\n}\n\nfunction parse_rels(data/*:?string*/, currentFilePath/*:string*/) {\n\tvar rels = {\"!id\":{}};\n\tif (!data) return rels;\n\tif (currentFilePath.charAt(0) !== '/') {\n\t\tcurrentFilePath = '/'+currentFilePath;\n\t}\n\tvar hash = {};\n\n\t(data.match(tagregex)||[]).forEach(function(x) {\n\t\tvar y = parsexmltag(x);\n\t\t/* 9.3.2.2 OPC_Relationships */\n\t\tif (y[0] === '2){ o[o.length] = (''); o[1]=o[1].replace(\"/>\",\">\"); }\n\treturn o.join(\"\");\n}\n\nfunction add_rels(rels, rId/*:number*/, f, type, relobj, targetmode/*:?string*/)/*:number*/ {\n\tif(!relobj) relobj = {};\n\tif(!rels['!id']) rels['!id'] = {};\n\tif(!rels['!idx']) rels['!idx'] = 1;\n\tif(rId < 0) for(rId = rels['!idx']; rels['!id']['rId' + rId]; ++rId){/* empty */}\n\trels['!idx'] = rId + 1;\n\trelobj.Id = 'rId' + rId;\n\trelobj.Type = type;\n\trelobj.Target = f;\n\tif(targetmode) relobj.TargetMode = targetmode;\n\telse if([RELS.HLINK, RELS.XPATH, RELS.XMISS].indexOf(relobj.Type) > -1) relobj.TargetMode = \"External\";\n\tif(rels['!id'][relobj.Id]) throw new Error(\"Cannot rewrite rId \" + rId);\n\trels['!id'][relobj.Id] = relobj;\n\trels[('/' + relobj.Target).replace(\"//\",\"/\")] = relobj;\n\treturn rId;\n}\nvar CT_ODS = \"application/vnd.oasis.opendocument.spreadsheet\";\nfunction parse_manifest(d, opts) {\n var str = xlml_normalize(d);\n var Rn;\n var FEtag;\n while (Rn = xlmlregex.exec(str))\n switch (Rn[3]) {\n case \"manifest\":\n break;\n case \"file-entry\":\n FEtag = parsexmltag(Rn[0], false);\n if (FEtag.path == \"/\" && FEtag.type !== CT_ODS)\n throw new Error(\"This OpenDocument is not a spreadsheet\");\n break;\n case \"encryption-data\":\n case \"algorithm\":\n case \"start-key-generation\":\n case \"key-derivation\":\n throw new Error(\"Unsupported ODS Encryption\");\n default:\n if (opts && opts.WTF)\n throw Rn;\n }\n}\nfunction write_manifest(manifest) {\n var o = [XML_HEADER];\n o.push('\\n');\n o.push(' \\n');\n for (var i = 0; i < manifest.length; ++i)\n o.push(' \\n');\n o.push(\"\");\n return o.join(\"\");\n}\nfunction write_rdf_type(file, res, tag) {\n return [\n ' \\n',\n ' \\n',\n \" \\n\"\n ].join(\"\");\n}\nfunction write_rdf_has(base, file) {\n return [\n ' \\n',\n ' \\n',\n \" \\n\"\n ].join(\"\");\n}\nfunction write_rdf(rdf) {\n var o = [XML_HEADER];\n o.push('\\n');\n for (var i = 0; i != rdf.length; ++i) {\n o.push(write_rdf_type(rdf[i][0], rdf[i][1]));\n o.push(write_rdf_has(\"\", rdf[i][0]));\n }\n o.push(write_rdf_type(\"\", \"Document\", \"pkg\"));\n o.push(\"\");\n return o.join(\"\");\n}\nfunction write_meta_ods(wb, opts) {\n return 'SheetJS ' + XLSX.version + \"\";\n}\n/* ECMA-376 Part II 11.1 Core Properties Part */\n/* [MS-OSHARED] 2.3.3.2.[1-2].1 (PIDSI/PIDDSI) */\nvar CORE_PROPS/*:Array >*/ = [\n\t[\"cp:category\", \"Category\"],\n\t[\"cp:contentStatus\", \"ContentStatus\"],\n\t[\"cp:keywords\", \"Keywords\"],\n\t[\"cp:lastModifiedBy\", \"LastAuthor\"],\n\t[\"cp:lastPrinted\", \"LastPrinted\"],\n\t[\"cp:revision\", \"RevNumber\"],\n\t[\"cp:version\", \"Version\"],\n\t[\"dc:creator\", \"Author\"],\n\t[\"dc:description\", \"Comments\"],\n\t[\"dc:identifier\", \"Identifier\"],\n\t[\"dc:language\", \"Language\"],\n\t[\"dc:subject\", \"Subject\"],\n\t[\"dc:title\", \"Title\"],\n\t[\"dcterms:created\", \"CreatedDate\", 'date'],\n\t[\"dcterms:modified\", \"ModifiedDate\", 'date']\n];\n\nfunction parse_core_props(data) {\n\tvar p = {};\n\tdata = utf8read(data);\n\n\tfor(var i = 0; i < CORE_PROPS.length; ++i) {\n\t\tvar f = CORE_PROPS[i], cur = str_match_xml(data, f[0]);\n\t\tif(cur != null && cur.length > 0) p[f[1]] = unescapexml(cur[1]);\n\t\tif(f[2] === 'date' && p[f[1]]) p[f[1]] = parseDate(p[f[1]]);\n\t}\n\n\treturn p;\n}\n\nfunction cp_doit(f, g, h, o, p) {\n\tif(p[f] != null || g == null || g === \"\") return;\n\tp[f] = g;\n\tg = escapexml(g);\n\to[o.length] = (h ? writextag(f,g,h) : writetag(f,g));\n}\n\nfunction write_core_props(cp, _opts) {\n\tvar opts = _opts || {};\n\tvar o = [XML_HEADER, writextag('cp:coreProperties', null, {\n\t\t//'xmlns': XMLNS.CORE_PROPS,\n\t\t'xmlns:cp': XMLNS.CORE_PROPS,\n\t\t'xmlns:dc': XMLNS.dc,\n\t\t'xmlns:dcterms': XMLNS.dcterms,\n\t\t'xmlns:dcmitype': XMLNS.dcmitype,\n\t\t'xmlns:xsi': XMLNS.xsi\n\t})], p = {};\n\tif(!cp && !opts.Props) return o.join(\"\");\n\n\tif(cp) {\n\t\tif(cp.CreatedDate != null) cp_doit(\"dcterms:created\", typeof cp.CreatedDate === \"string\" ? cp.CreatedDate : write_w3cdtf(cp.CreatedDate, opts.WTF), {\"xsi:type\":\"dcterms:W3CDTF\"}, o, p);\n\t\tif(cp.ModifiedDate != null) cp_doit(\"dcterms:modified\", typeof cp.ModifiedDate === \"string\" ? cp.ModifiedDate : write_w3cdtf(cp.ModifiedDate, opts.WTF), {\"xsi:type\":\"dcterms:W3CDTF\"}, o, p);\n\t}\n\n\tfor(var i = 0; i != CORE_PROPS.length; ++i) {\n\t\tvar f = CORE_PROPS[i];\n\t\tvar v = opts.Props && opts.Props[f[1]] != null ? opts.Props[f[1]] : cp ? cp[f[1]] : null;\n\t\tif(v === true) v = \"1\";\n\t\telse if(v === false) v = \"0\";\n\t\telse if(typeof v == \"number\") v = String(v);\n\t\tif(v != null) cp_doit(f[0], v, null, o, p);\n\t}\n\tif(o.length>2){ o[o.length] = (''); o[1]=o[1].replace(\"/>\",\">\"); }\n\treturn o.join(\"\");\n}\n/* 15.2.12.3 Extended File Properties Part */\n/* [MS-OSHARED] 2.3.3.2.[1-2].1 (PIDSI/PIDDSI) */\nvar EXT_PROPS/*:Array >*/ = [\n\t[\"Application\", \"Application\", \"string\"],\n\t[\"AppVersion\", \"AppVersion\", \"string\"],\n\t[\"Company\", \"Company\", \"string\"],\n\t[\"DocSecurity\", \"DocSecurity\", \"string\"],\n\t[\"Manager\", \"Manager\", \"string\"],\n\t[\"HyperlinksChanged\", \"HyperlinksChanged\", \"bool\"],\n\t[\"SharedDoc\", \"SharedDoc\", \"bool\"],\n\t[\"LinksUpToDate\", \"LinksUpToDate\", \"bool\"],\n\t[\"ScaleCrop\", \"ScaleCrop\", \"bool\"],\n\t[\"HeadingPairs\", \"HeadingPairs\", \"raw\"],\n\t[\"TitlesOfParts\", \"TitlesOfParts\", \"raw\"]\n];\n\nvar PseudoPropsPairs = [\n\t\"Worksheets\", \"SheetNames\",\n\t\"NamedRanges\", \"DefinedNames\",\n\t\"Chartsheets\", \"ChartNames\"\n];\nfunction load_props_pairs(HP/*:string|Array>*/, TOP, props, opts) {\n\tvar v = [];\n\tif(typeof HP == \"string\") v = parseVector(HP, opts);\n\telse for(var j = 0; j < HP.length; ++j) v = v.concat(HP[j].map(function(hp) { return {v:hp}; }));\n\tvar parts = (typeof TOP == \"string\") ? parseVector(TOP, opts).map(function (x) { return x.v; }) : TOP;\n\tvar idx = 0, len = 0;\n\tif(parts.length > 0) for(var i = 0; i !== v.length; i += 2) {\n\t\tlen = +(v[i+1].v);\n\t\tswitch(v[i].v) {\n\t\t\tcase \"Worksheets\":\n\t\t\tcase \"工作表\":\n\t\t\tcase \"Листы\":\n\t\t\tcase \"أوراق العمل\":\n\t\t\tcase \"ワークシート\":\n\t\t\tcase \"גליונות עבודה\":\n\t\t\tcase \"Arbeitsblätter\":\n\t\t\tcase \"Çalışma Sayfaları\":\n\t\t\tcase \"Feuilles de calcul\":\n\t\t\tcase \"Fogli di lavoro\":\n\t\t\tcase \"Folhas de cálculo\":\n\t\t\tcase \"Planilhas\":\n\t\t\tcase \"Regneark\":\n\t\t\tcase \"Hojas de cálculo\":\n\t\t\tcase \"Werkbladen\":\n\t\t\t\tprops.Worksheets = len;\n\t\t\t\tprops.SheetNames = parts.slice(idx, idx + len);\n\t\t\t\tbreak;\n\n\t\t\tcase \"Named Ranges\":\n\t\t\tcase \"Rangos con nombre\":\n\t\t\tcase \"名前付き一覧\":\n\t\t\tcase \"Benannte Bereiche\":\n\t\t\tcase \"Navngivne områder\":\n\t\t\t\tprops.NamedRanges = len;\n\t\t\t\tprops.DefinedNames = parts.slice(idx, idx + len);\n\t\t\t\tbreak;\n\n\t\t\tcase \"Charts\":\n\t\t\tcase \"Diagramme\":\n\t\t\t\tprops.Chartsheets = len;\n\t\t\t\tprops.ChartNames = parts.slice(idx, idx + len);\n\t\t\t\tbreak;\n\t\t}\n\t\tidx += len;\n\t}\n}\n\nfunction parse_ext_props(data, p, opts) {\n\tvar q = {}; if(!p) p = {};\n\tdata = utf8read(data);\n\n\tEXT_PROPS.forEach(function(f) {\n\t\tvar xml = (str_match_xml_ns(data, f[0])||[])[1];\n\t\tswitch(f[2]) {\n\t\t\tcase \"string\": if(xml) p[f[1]] = unescapexml(xml); break;\n\t\t\tcase \"bool\": p[f[1]] = xml === \"true\"; break;\n\t\t\tcase \"raw\":\n\t\t\t\tvar cur = str_match_xml(data, f[0]);\n\t\t\t\tif(cur && cur.length > 0) q[f[1]] = cur[1];\n\t\t\t\tbreak;\n\t\t}\n\t});\n\n\tif(q.HeadingPairs && q.TitlesOfParts) load_props_pairs(q.HeadingPairs, q.TitlesOfParts, p, opts);\n\n\treturn p;\n}\n\nfunction write_ext_props(cp/*::, opts*/)/*:string*/ {\n\tvar o/*:Array*/ = [], W = writextag;\n\tif(!cp) cp = {};\n\tcp.Application = \"SheetJS\";\n\to[o.length] = (XML_HEADER);\n\to[o.length] = (writextag('Properties', null, {\n\t\t'xmlns': XMLNS.EXT_PROPS,\n\t\t'xmlns:vt': XMLNS.vt\n\t}));\n\n\tEXT_PROPS.forEach(function(f) {\n\t\tif(cp[f[1]] === undefined) return;\n\t\tvar v;\n\t\tswitch(f[2]) {\n\t\t\tcase 'string': v = escapexml(String(cp[f[1]])); break;\n\t\t\tcase 'bool': v = cp[f[1]] ? 'true' : 'false'; break;\n\t\t}\n\t\tif(v !== undefined) o[o.length] = (W(f[0], v));\n\t});\n\n\t/* TODO: HeadingPairs, TitlesOfParts */\n\to[o.length] = (W('HeadingPairs', W('vt:vector', W('vt:variant', 'Worksheets')+W('vt:variant', W('vt:i4', String(cp.Worksheets))), {size:2, baseType:\"variant\"})));\n\to[o.length] = (W('TitlesOfParts', W('vt:vector', cp.SheetNames.map(function(s) { return \"\" + escapexml(s) + \"\"; }).join(\"\"), {size: cp.Worksheets, baseType:\"lpstr\"})));\n\tif(o.length>2){ o[o.length] = (''); o[1]=o[1].replace(\"/>\",\">\"); }\n\treturn o.join(\"\");\n}\n/* 15.2.12.2 Custom File Properties Part */\nvar custregex = /<[^<>]+>[^<]*/g;\nfunction parse_cust_props(data/*:string*/, opts) {\n\tvar p = {}, name = \"\";\n\tvar m = data.match(custregex);\n\tif(m) for(var i = 0; i != m.length; ++i) {\n\t\tvar x = m[i], y = parsexmltag(x);\n\t\tswitch(strip_ns(y[0])) {\n\t\t\tcase '': name = null; break;\n\t\t\tdefault: if (x.indexOf('');\n\t\t\t\tvar type = toks[0].slice(4), text = toks[1];\n\t\t\t\t/* 22.4.2.32 (CT_Variant). Omit the binary types from 22.4 (Variant Types) */\n\t\t\t\tswitch(type) {\n\t\t\t\t\tcase 'lpstr': case 'bstr': case 'lpwstr':\n\t\t\t\t\t\tp[name] = unescapexml(text);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'bool':\n\t\t\t\t\t\tp[name] = parsexmlbool(text);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'i1': case 'i2': case 'i4': case 'i8': case 'int': case 'uint':\n\t\t\t\t\t\tp[name] = parseInt(text, 10);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'r4': case 'r8': case 'decimal':\n\t\t\t\t\t\tp[name] = parseFloat(text);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'filetime': case 'date':\n\t\t\t\t\t\tp[name] = parseDate(text);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'cy': case 'error':\n\t\t\t\t\t\tp[name] = unescapexml(text);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif(type.slice(-1) == '/') break;\n\t\t\t\t\t\tif(opts.WTF && typeof console !== 'undefined') console.warn('Unexpected', x, type, toks);\n\t\t\t\t}\n\t\t\t} else if(x.slice(0,2) === \"2){ o[o.length] = ''; o[1]=o[1].replace(\"/>\",\">\"); }\n\treturn o.join(\"\");\n}\n/* Common Name -> XLML Name */\nvar XLMLDocPropsMap = {\n\tTitle: 'Title',\n\tSubject: 'Subject',\n\tAuthor: 'Author',\n\tKeywords: 'Keywords',\n\tComments: 'Description',\n\tLastAuthor: 'LastAuthor',\n\tRevNumber: 'Revision',\n\tApplication: 'AppName',\n\t/* TotalTime: 'TotalTime', */\n\tLastPrinted: 'LastPrinted',\n\tCreatedDate: 'Created',\n\tModifiedDate: 'LastSaved',\n\t/* Pages */\n\t/* Words */\n\t/* Characters */\n\tCategory: 'Category',\n\t/* PresentationFormat */\n\tManager: 'Manager',\n\tCompany: 'Company',\n\t/* Guid */\n\t/* HyperlinkBase */\n\t/* Bytes */\n\t/* Lines */\n\t/* Paragraphs */\n\t/* CharactersWithSpaces */\n\tAppVersion: 'Version',\n\n\tContentStatus: 'ContentStatus', /* NOTE: missing from schema */\n\tIdentifier: 'Identifier', /* NOTE: missing from schema */\n\tLanguage: 'Language' /* NOTE: missing from schema */\n};\nvar evert_XLMLDPM;\n\nfunction xlml_set_prop(Props, tag/*:string*/, val) {\n\tif(!evert_XLMLDPM) evert_XLMLDPM = evert(XLMLDocPropsMap);\n\ttag = evert_XLMLDPM[tag] || tag;\n\tProps[tag] = val;\n}\n\nfunction xlml_write_docprops(Props, opts) {\n\tvar o/*:Array*/ = [];\n\tkeys(XLMLDocPropsMap).map(function(m) {\n\t\tfor(var i = 0; i < CORE_PROPS.length; ++i) if(CORE_PROPS[i][1] == m) return CORE_PROPS[i];\n\t\tfor(i = 0; i < EXT_PROPS.length; ++i) if(EXT_PROPS[i][1] == m) return EXT_PROPS[i];\n\t\tthrow m;\n\t}).forEach(function(p) {\n\t\tif(Props[p[1]] == null) return;\n\t\tvar m = opts && opts.Props && opts.Props[p[1]] != null ? opts.Props[p[1]] : Props[p[1]];\n\t\tswitch(p[2]) {\n\t\t\tcase 'date': m = new Date(m).toISOString().replace(/\\.\\d*Z/,\"Z\"); break;\n\t\t}\n\t\tif(typeof m == 'number') m = String(m);\n\t\telse if(m === true || m === false) { m = m ? \"1\" : \"0\"; }\n\t\telse if(m instanceof Date) m = new Date(m).toISOString().replace(/\\.\\d*Z/,\"\");\n\t\to.push(writetag(XLMLDocPropsMap[p[1]] || p[1], m));\n\t});\n\treturn writextag('DocumentProperties', o.join(\"\"), {xmlns:XLMLNS.o });\n}\nfunction xlml_write_custprops(Props, Custprops/*::, opts*/) {\n\tvar BLACKLIST = [\"Worksheets\",\"SheetNames\"];\n\tvar T = 'CustomDocumentProperties';\n\tvar o/*:Array*/ = [];\n\tif(Props) keys(Props).forEach(function(k) {\n\t\t/*:: if(!Props) return; */\n\t\tif(!Object.prototype.hasOwnProperty.call(Props, k)) return;\n\t\tfor(var i = 0; i < CORE_PROPS.length; ++i) if(k == CORE_PROPS[i][1]) return;\n\t\tfor(i = 0; i < EXT_PROPS.length; ++i) if(k == EXT_PROPS[i][1]) return;\n\t\tfor(i = 0; i < BLACKLIST.length; ++i) if(k == BLACKLIST[i]) return;\n\n\t\tvar m = Props[k];\n\t\tvar t = \"string\";\n\t\tif(typeof m == 'number') { t = \"float\"; m = String(m); }\n\t\telse if(m === true || m === false) { t = \"boolean\"; m = m ? \"1\" : \"0\"; }\n\t\telse m = String(m);\n\t\to.push(writextag(escapexmltag(k), m, {\"dt:dt\":t}));\n\t});\n\tif(Custprops) keys(Custprops).forEach(function(k) {\n\t\t/*:: if(!Custprops) return; */\n\t\tif(!Object.prototype.hasOwnProperty.call(Custprops, k)) return;\n\t\tif(Props && Object.prototype.hasOwnProperty.call(Props, k)) return;\n\t\tvar m = Custprops[k];\n\t\tvar t = \"string\";\n\t\tif(typeof m == 'number') { t = \"float\"; m = String(m); }\n\t\telse if(m === true || m === false) { t = \"boolean\"; m = m ? \"1\" : \"0\"; }\n\t\telse if(m instanceof Date) { t = \"dateTime.tz\"; m = m.toISOString(); }\n\t\telse m = String(m);\n\t\to.push(writextag(escapexmltag(k), m, {\"dt:dt\":t}));\n\t});\n\treturn '<' + T + ' xmlns=\"' + XLMLNS.o + '\">' + o.join(\"\") + '';\n}\n/* [MS-DTYP] 2.3.3 FILETIME */\n/* [MS-OLEDS] 2.1.3 FILETIME (Packet Version) */\n/* [MS-OLEPS] 2.8 FILETIME (Packet Version) */\nfunction parse_FILETIME(blob) {\n\tvar dwLowDateTime = blob.read_shift(4), dwHighDateTime = blob.read_shift(4);\n\treturn new Date(((dwHighDateTime/1e7*Math.pow(2,32) + dwLowDateTime/1e7) - 11644473600)*1000).toISOString().replace(/\\.000/,\"\");\n}\nfunction write_FILETIME(time/*:string|Date*/) {\n\tvar date = (typeof time == \"string\") ? new Date(Date.parse(time)) : time;\n\tvar t = date.getTime() / 1000 + 11644473600;\n\tvar l = t % Math.pow(2,32), h = (t - l) / Math.pow(2,32);\n\tl *= 1e7; h *= 1e7;\n\tvar w = (l / Math.pow(2,32)) | 0;\n\tif(w > 0) { l = l % Math.pow(2,32); h += w; }\n\tvar o = new_buf(8); o.write_shift(4, l); o.write_shift(4, h); return o;\n}\n\n/* [MS-OSHARED] 2.3.3.1.4 Lpstr */\nfunction parse_lpstr(blob, type, pad/*:?number*/) {\n\tvar start = blob.l;\n\tvar str = blob.read_shift(0, 'lpstr-cp');\n\tif(pad) while((blob.l - start) & 3) ++blob.l;\n\treturn str;\n}\n\n/* [MS-OSHARED] 2.3.3.1.6 Lpwstr */\nfunction parse_lpwstr(blob, type, pad) {\n\tvar str = blob.read_shift(0, 'lpwstr');\n\tif(pad) blob.l += (4 - ((str.length+1) & 3)) & 3;\n\treturn str;\n}\n\n\n/* [MS-OSHARED] 2.3.3.1.11 VtString */\n/* [MS-OSHARED] 2.3.3.1.12 VtUnalignedString */\nfunction parse_VtStringBase(blob, stringType, pad) {\n\tif(stringType === 0x1F /*VT_LPWSTR*/) return parse_lpwstr(blob);\n\treturn parse_lpstr(blob, stringType, pad);\n}\n\nfunction parse_VtString(blob, t/*:number*/, pad/*:?boolean*/) { return parse_VtStringBase(blob, t, pad === false ? 0: 4); }\nfunction parse_VtUnalignedString(blob, t/*:number*/) { if(!t) throw new Error(\"VtUnalignedString must have positive length\"); return parse_VtStringBase(blob, t, 0); }\n\n/* [MS-OSHARED] 2.3.3.1.7 VtVecLpwstrValue */\nfunction parse_VtVecLpwstrValue(blob)/*:Array*/ {\n\tvar length = blob.read_shift(4);\n\tvar ret/*:Array*/ = [];\n\tfor(var i = 0; i != length; ++i) {\n\t\tvar start = blob.l;\n\t\tret[i] = blob.read_shift(0, 'lpwstr').replace(chr0,'');\n\t\tif((blob.l - start) & 0x02) blob.l += 2;\n\t}\n\treturn ret;\n}\n\n/* [MS-OSHARED] 2.3.3.1.9 VtVecUnalignedLpstrValue */\nfunction parse_VtVecUnalignedLpstrValue(blob)/*:Array*/ {\n\tvar length = blob.read_shift(4);\n\tvar ret/*:Array*/ = [];\n\tfor(var i = 0; i != length; ++i) ret[i] = blob.read_shift(0, 'lpstr-cp').replace(chr0,'');\n\treturn ret;\n}\n\n\n/* [MS-OSHARED] 2.3.3.1.13 VtHeadingPair */\nfunction parse_VtHeadingPair(blob) {\n\tvar start = blob.l;\n\tvar headingString = parse_TypedPropertyValue(blob, VT_USTR);\n\tif(blob[blob.l] == 0x00 && blob[blob.l+1] == 0x00 && ((blob.l - start) & 0x02)) blob.l += 2;\n\tvar headerParts = parse_TypedPropertyValue(blob, VT_I4);\n\treturn [headingString, headerParts];\n}\n\n/* [MS-OSHARED] 2.3.3.1.14 VtVecHeadingPairValue */\nfunction parse_VtVecHeadingPairValue(blob) {\n\tvar cElements = blob.read_shift(4);\n\tvar out = [];\n\tfor(var i = 0; i < cElements / 2; ++i) out.push(parse_VtHeadingPair(blob));\n\treturn out;\n}\n\n/* [MS-OLEPS] 2.18.1 Dictionary (uses 2.17, 2.16) */\nfunction parse_dictionary(blob,CodePage) {\n\tvar cnt = blob.read_shift(4);\n\tvar dict/*:{[number]:string}*/ = ({}/*:any*/);\n\tfor(var j = 0; j != cnt; ++j) {\n\t\tvar pid = blob.read_shift(4);\n\t\tvar len = blob.read_shift(4);\n\t\tdict[pid] = blob.read_shift(len, (CodePage === 0x4B0 ?'utf16le':'utf8')).replace(chr0,'').replace(chr1,'!');\n\t\tif(CodePage === 0x4B0 && (len % 2)) blob.l += 2;\n\t}\n\tif(blob.l & 3) blob.l = (blob.l>>2+1)<<2;\n\treturn dict;\n}\n\n/* [MS-OLEPS] 2.9 BLOB */\nfunction parse_BLOB(blob) {\n\tvar size = blob.read_shift(4);\n\tvar bytes = blob.slice(blob.l,blob.l+size);\n\tblob.l += size;\n\tif((size & 3) > 0) blob.l += (4 - (size & 3)) & 3;\n\treturn bytes;\n}\n\n/* [MS-OLEPS] 2.11 ClipboardData */\nfunction parse_ClipboardData(blob) {\n\t// TODO\n\tvar o = {};\n\to.Size = blob.read_shift(4);\n\t//o.Format = blob.read_shift(4);\n\tblob.l += o.Size + 3 - (o.Size - 1) % 4;\n\treturn o;\n}\n\n/* [MS-OLEPS] 2.15 TypedPropertyValue */\nfunction parse_TypedPropertyValue(blob, type/*:number*/, _opts)/*:any*/ {\n\tvar t = blob.read_shift(2), ret, opts = _opts||{};\n\tblob.l += 2;\n\tif(type !== VT_VARIANT)\n\tif(t !== type && VT_CUSTOM.indexOf(type)===-1 && !((type & 0xFFFE) == 0x101E && (t & 0xFFFE) == 0x101E)) throw new Error('Expected type ' + type + ' saw ' + t);\n\tswitch(type === VT_VARIANT ? t : type) {\n\t\tcase 0x02 /*VT_I2*/: ret = blob.read_shift(2, 'i'); if(!opts.raw) blob.l += 2; return ret;\n\t\tcase 0x03 /*VT_I4*/: ret = blob.read_shift(4, 'i'); return ret;\n\t\tcase 0x0B /*VT_BOOL*/: return blob.read_shift(4) !== 0x0;\n\t\tcase 0x13 /*VT_UI4*/: ret = blob.read_shift(4); return ret;\n\t\tcase 0x1E /*VT_LPSTR*/: blob.l += 4; val = parse_VtString(blob, blob[blob.l-4]).replace(/(^|[^\\u0000])\\u0000+$/,\"$1\"); break;\n\t\tcase 0x1F /*VT_LPWSTR*/: blob.l += 4; val = parse_VtString(blob, blob[blob.l-4]).replace(/(^|[^\\u0000])\\u0000+$/,\"$1\"); break;\n\t\tcase 0x40 /*VT_FILETIME*/: return parse_FILETIME(blob);\n\t\tcase 0x41 /*VT_BLOB*/: return parse_BLOB(blob);\n\t\tcase 0x47 /*VT_CF*/: return parse_ClipboardData(blob);\n\t\tcase 0x50 /*VT_STRING*/: return parse_VtString(blob, t, !opts.raw).replace(chr0,'');\n\t\tcase 0x51 /*VT_USTR*/: return parse_VtUnalignedString(blob, t/*, 4*/).replace(chr0,'');\n\t\tcase 0x100C /*VT_VECTOR|VT_VARIANT*/: return parse_VtVecHeadingPairValue(blob);\n\t\tcase 0x101E /*VT_VECTOR|VT_LPSTR*/:\n\t\tcase 0x101F /*VT_VECTOR|VT_LPWSTR*/:\n\t\t\treturn t == 0x101F ? parse_VtVecLpwstrValue(blob) : parse_VtVecUnalignedLpstrValue(blob);\n\t\tdefault: throw new Error(\"TypedPropertyValue unrecognized type \" + type + \" \" + t);\n\t}\n}\nfunction write_TypedPropertyValue(type/*:number*/, value) {\n\tvar o = new_buf(4), p = new_buf(4);\n\to.write_shift(4, type == 0x50 ? 0x1F : type);\n\tswitch(type) {\n\t\tcase 0x03 /*VT_I4*/: p.write_shift(-4, value); break;\n\t\tcase 0x05 /*VT_I4*/: p = new_buf(8); p.write_shift(8, value, 'f'); break;\n\t\tcase 0x0B /*VT_BOOL*/: p.write_shift(4, value ? 0x01 : 0x00); break;\n\t\tcase 0x40 /*VT_FILETIME*/: /*:: if(typeof value !== \"string\" && !(value instanceof Date)) throw \"unreachable\"; */ p = write_FILETIME(value); break;\n\t\tcase 0x1F /*VT_LPWSTR*/:\n\t\tcase 0x50 /*VT_STRING*/:\n\t\t\t/*:: if(typeof value !== \"string\") throw \"unreachable\"; */\n\t\t\tp = new_buf(4 + 2 * (value.length + 1) + (value.length % 2 ? 0 : 2));\n\t\t\tp.write_shift(4, value.length + 1);\n\t\t\tp.write_shift(0, value, \"dbcs\");\n\t\t\twhile(p.l != p.length) p.write_shift(1, 0);\n\t\t\tbreak;\n\t\tdefault: throw new Error(\"TypedPropertyValue unrecognized type \" + type + \" \" + value);\n\t}\n\treturn bconcat([o, p]);\n}\n\n/* [MS-OLEPS] 2.20 PropertySet */\nfunction parse_PropertySet(blob, PIDSI) {\n\tvar start_addr = blob.l;\n\tvar size = blob.read_shift(4);\n\tvar NumProps = blob.read_shift(4);\n\tvar Props = [], i = 0;\n\tvar CodePage = 0;\n\tvar Dictionary = -1, DictObj/*:{[number]:string}*/ = ({}/*:any*/);\n\tfor(i = 0; i != NumProps; ++i) {\n\t\tvar PropID = blob.read_shift(4);\n\t\tvar Offset = blob.read_shift(4);\n\t\tProps[i] = [PropID, Offset + start_addr];\n\t}\n\tProps.sort(function(x,y) { return x[1] - y[1]; });\n\tvar PropH = {};\n\tfor(i = 0; i != NumProps; ++i) {\n\t\tif(blob.l !== Props[i][1]) {\n\t\t\tvar fail = true;\n\t\t\tif(i>0 && PIDSI) switch(PIDSI[Props[i-1][0]].t) {\n\t\t\t\tcase 0x02 /*VT_I2*/: if(blob.l+2 === Props[i][1]) { blob.l+=2; fail = false; } break;\n\t\t\t\tcase 0x50 /*VT_STRING*/: if(blob.l <= Props[i][1]) { blob.l=Props[i][1]; fail = false; } break;\n\t\t\t\tcase 0x100C /*VT_VECTOR|VT_VARIANT*/: if(blob.l <= Props[i][1]) { blob.l=Props[i][1]; fail = false; } break;\n\t\t\t}\n\t\t\tif((!PIDSI||i==0) && blob.l <= Props[i][1]) { fail=false; blob.l = Props[i][1]; }\n\t\t\tif(fail) throw new Error(\"Read Error: Expected address \" + Props[i][1] + ' at ' + blob.l + ' :' + i);\n\t\t}\n\t\tif(PIDSI) {\n\t\t\tif(Props[i][0] == 0 && Props.length > i+1 && Props[i][1] == Props[i+1][1]) continue; // R9\n\t\t\tvar piddsi = PIDSI[Props[i][0]];\n\t\t\tPropH[piddsi.n] = parse_TypedPropertyValue(blob, piddsi.t, {raw:true});\n\t\t\tif(piddsi.p === 'version') PropH[piddsi.n] = String(PropH[piddsi.n] >> 16) + \".\" + (\"0000\" + String(PropH[piddsi.n] & 0xFFFF)).slice(-4);\n\t\t\tif(piddsi.n == \"CodePage\") switch(PropH[piddsi.n]) {\n\t\t\t\tcase 0: PropH[piddsi.n] = 1252;\n\t\t\t\t\t/* falls through */\n\t\t\t\tcase 874:\n\t\t\t\tcase 932:\n\t\t\t\tcase 936:\n\t\t\t\tcase 949:\n\t\t\t\tcase 950:\n\t\t\t\tcase 1250:\n\t\t\t\tcase 1251:\n\t\t\t\tcase 1253:\n\t\t\t\tcase 1254:\n\t\t\t\tcase 1255:\n\t\t\t\tcase 1256:\n\t\t\t\tcase 1257:\n\t\t\t\tcase 1258:\n\t\t\t\tcase 10000:\n\t\t\t\tcase 1200:\n\t\t\t\tcase 1201:\n\t\t\t\tcase 1252:\n\t\t\t\tcase 65000: case -536:\n\t\t\t\tcase 65001: case -535:\n\t\t\t\t\tset_cp(CodePage = (PropH[piddsi.n]>>>0) & 0xFFFF); break;\n\t\t\t\tdefault: throw new Error(\"Unsupported CodePage: \" + PropH[piddsi.n]);\n\t\t\t}\n\t\t} else {\n\t\t\tif(Props[i][0] === 0x1) {\n\t\t\t\tCodePage = PropH.CodePage = (parse_TypedPropertyValue(blob, VT_I2)/*:number*/);\n\t\t\t\tset_cp(CodePage);\n\t\t\t\tif(Dictionary !== -1) {\n\t\t\t\t\tvar oldpos = blob.l;\n\t\t\t\t\tblob.l = Props[Dictionary][1];\n\t\t\t\t\tDictObj = parse_dictionary(blob,CodePage);\n\t\t\t\t\tblob.l = oldpos;\n\t\t\t\t}\n\t\t\t} else if(Props[i][0] === 0) {\n\t\t\t\tif(CodePage === 0) { Dictionary = i; blob.l = Props[i+1][1]; continue; }\n\t\t\t\tDictObj = parse_dictionary(blob,CodePage);\n\t\t\t} else {\n\t\t\t\tvar name = DictObj[Props[i][0]];\n\t\t\t\tvar val;\n\t\t\t\t/* [MS-OSHARED] 2.3.3.2.3.1.2 + PROPVARIANT */\n\t\t\t\tswitch(blob[blob.l]) {\n\t\t\t\t\tcase 0x41 /*VT_BLOB*/: blob.l += 4; val = parse_BLOB(blob); break;\n\t\t\t\t\tcase 0x1E /*VT_LPSTR*/: blob.l += 4; val = parse_VtString(blob, blob[blob.l-4]).replace(/(^|[^\\u0000])\\u0000+$/,\"$1\"); break;\n\t\t\t\t\tcase 0x1F /*VT_LPWSTR*/: blob.l += 4; val = parse_VtString(blob, blob[blob.l-4]).replace(/(^|[^\\u0000])\\u0000+$/,\"$1\"); break;\n\t\t\t\t\tcase 0x03 /*VT_I4*/: blob.l += 4; val = blob.read_shift(4, 'i'); break;\n\t\t\t\t\tcase 0x13 /*VT_UI4*/: blob.l += 4; val = blob.read_shift(4); break;\n\t\t\t\t\tcase 0x05 /*VT_R8*/: blob.l += 4; val = blob.read_shift(8, 'f'); break;\n\t\t\t\t\tcase 0x0B /*VT_BOOL*/: blob.l += 4; val = parsebool(blob, 4); break;\n\t\t\t\t\tcase 0x40 /*VT_FILETIME*/: blob.l += 4; val = parseDate(parse_FILETIME(blob)); break;\n\t\t\t\t\tdefault: throw new Error(\"unparsed value: \" + blob[blob.l]);\n\t\t\t\t}\n\t\t\t\tPropH[name] = val;\n\t\t\t}\n\t\t}\n\t}\n\tblob.l = start_addr + size; /* step ahead to skip padding */\n\treturn PropH;\n}\nvar XLSPSSkip = [ \"CodePage\", \"Thumbnail\", \"_PID_LINKBASE\", \"_PID_HLINKS\", \"SystemIdentifier\", \"FMTID\" ];\nfunction guess_property_type(val/*:any*/)/*:number*/ {\n\tswitch(typeof val) {\n\t\tcase \"boolean\": return 0x0B;\n\t\tcase \"number\": return ((val|0)==val) ? 0x03 : 0x05;\n\t\tcase \"string\": return 0x1F;\n\t\tcase \"object\": if(val instanceof Date) return 0x40; break;\n\t}\n\treturn -1;\n}\nfunction write_PropertySet(entries, RE, PIDSI) {\n\tvar hdr = new_buf(8), piao = [], prop = [];\n\tvar sz = 8, i = 0;\n\n\tvar pr = new_buf(8), pio = new_buf(8);\n\tpr.write_shift(4, 0x0002);\n\tpr.write_shift(4, 0x04B0);\n\tpio.write_shift(4, 0x0001);\n\tprop.push(pr); piao.push(pio);\n\tsz += 8 + pr.length;\n\n\tif(!RE) {\n\t\tpio = new_buf(8);\n\t\tpio.write_shift(4, 0);\n\t\tpiao.unshift(pio);\n\n\t\tvar bufs = [new_buf(4)];\n\t\tbufs[0].write_shift(4, entries.length);\n\t\tfor(i = 0; i < entries.length; ++i) {\n\t\t\tvar value = entries[i][0];\n\t\t\tpr = new_buf(4 + 4 + 2 * (value.length + 1) + (value.length % 2 ? 0 : 2));\n\t\t\tpr.write_shift(4, i+2);\n\t\t\tpr.write_shift(4, value.length + 1);\n\t\t\tpr.write_shift(0, value, \"dbcs\");\n\t\t\twhile(pr.l != pr.length) pr.write_shift(1, 0);\n\t\t\tbufs.push(pr);\n\t\t}\n\t\tpr = bconcat(bufs);\n\t\tprop.unshift(pr);\n\t\tsz += 8 + pr.length;\n\t}\n\n\tfor(i = 0; i < entries.length; ++i) {\n\t\tif(RE && !RE[entries[i][0]]) continue;\n\t\tif(XLSPSSkip.indexOf(entries[i][0]) > -1 || PseudoPropsPairs.indexOf(entries[i][0]) > -1) continue;\n\t\tif(entries[i][1] == null) continue;\n\n\t\tvar val = entries[i][1], idx = 0;\n\t\tif(RE) {\n\t\t\tidx = +RE[entries[i][0]];\n\t\t\tvar pinfo = (PIDSI/*:: || {}*/)[idx]/*:: || {} */;\n\t\t\tif(pinfo.p == \"version\" && typeof val == \"string\") {\n\t\t\t\t/*:: if(typeof val !== \"string\") throw \"unreachable\"; */\n\t\t\t\tvar arr = val.split(\".\");\n\t\t\t\tval = ((+arr[0])<<16) + ((+arr[1])||0);\n\t\t\t}\n\t\t\tpr = write_TypedPropertyValue(pinfo.t, val);\n\t\t} else {\n\t\t\tvar T = guess_property_type(val);\n\t\t\tif(T == -1) { T = 0x1F; val = String(val); }\n\t\t\tpr = write_TypedPropertyValue(T, val);\n\t\t}\n\t\tprop.push(pr);\n\n\t\tpio = new_buf(8);\n\t\tpio.write_shift(4, !RE ? 2+i : idx);\n\t\tpiao.push(pio);\n\n\t\tsz += 8 + pr.length;\n\t}\n\n\tvar w = 8 * (prop.length + 1);\n\tfor(i = 0; i < prop.length; ++i) { piao[i].write_shift(4, w); w += prop[i].length; }\n\thdr.write_shift(4, sz);\n\thdr.write_shift(4, prop.length);\n\treturn bconcat([hdr].concat(piao).concat(prop));\n}\n\n/* [MS-OLEPS] 2.21 PropertySetStream */\nfunction parse_PropertySetStream(file, PIDSI, clsid) {\n\tvar blob = file.content;\n\tif(!blob) return ({}/*:any*/);\n\tprep_blob(blob, 0);\n\n\tvar NumSets, FMTID0, FMTID1, Offset0, Offset1 = 0;\n\tblob.chk('feff', 'Byte Order: ');\n\n\t/*var vers = */blob.read_shift(2); // TODO: check version\n\tvar SystemIdentifier = blob.read_shift(4);\n\tvar CLSID = blob.read_shift(16);\n\tif(CLSID !== CFB.utils.consts.HEADER_CLSID && CLSID !== clsid) throw new Error(\"Bad PropertySet CLSID \" + CLSID);\n\tNumSets = blob.read_shift(4);\n\tif(NumSets !== 1 && NumSets !== 2) throw new Error(\"Unrecognized #Sets: \" + NumSets);\n\tFMTID0 = blob.read_shift(16); Offset0 = blob.read_shift(4);\n\n\tif(NumSets === 1 && Offset0 !== blob.l) throw new Error(\"Length mismatch: \" + Offset0 + \" !== \" + blob.l);\n\telse if(NumSets === 2) { FMTID1 = blob.read_shift(16); Offset1 = blob.read_shift(4); }\n\tvar PSet0 = parse_PropertySet(blob, PIDSI);\n\n\tvar rval = ({ SystemIdentifier: SystemIdentifier }/*:any*/);\n\tfor(var y in PSet0) rval[y] = PSet0[y];\n\t//rval.blob = blob;\n\trval.FMTID = FMTID0;\n\t//rval.PSet0 = PSet0;\n\tif(NumSets === 1) return rval;\n\tif(Offset1 - blob.l == 2) blob.l += 2;\n\tif(blob.l !== Offset1) throw new Error(\"Length mismatch 2: \" + blob.l + \" !== \" + Offset1);\n\tvar PSet1;\n\ttry { PSet1 = parse_PropertySet(blob, null); } catch(e) {/* empty */}\n\tfor(y in PSet1) rval[y] = PSet1[y];\n\trval.FMTID = [FMTID0, FMTID1]; // TODO: verify FMTID0/1\n\treturn rval;\n}\nfunction write_PropertySetStream(entries, clsid, RE, PIDSI/*:{[key:string|number]:any}*/, entries2/*:?any*/, clsid2/*:?any*/) {\n\tvar hdr = new_buf(entries2 ? 68 : 48);\n\tvar bufs = [hdr];\n\thdr.write_shift(2, 0xFFFE);\n\thdr.write_shift(2, 0x0000); /* TODO: type 1 props */\n\thdr.write_shift(4, 0x32363237);\n\thdr.write_shift(16, CFB.utils.consts.HEADER_CLSID, \"hex\");\n\thdr.write_shift(4, (entries2 ? 2 : 1));\n\thdr.write_shift(16, clsid, \"hex\");\n\thdr.write_shift(4, (entries2 ? 68 : 48));\n\tvar ps0 = write_PropertySet(entries, RE, PIDSI);\n\tbufs.push(ps0);\n\n\tif(entries2) {\n\t\tvar ps1 = write_PropertySet(entries2, null, null);\n\t\thdr.write_shift(16, clsid2, \"hex\");\n\t\thdr.write_shift(4, 68 + ps0.length);\n\t\tbufs.push(ps1);\n\t}\n\treturn bconcat(bufs);\n}\n\nfunction parsenoop2(blob, length) { blob.read_shift(length); return null; }\nfunction writezeroes(n, o) { if(!o) o=new_buf(n); for(var j=0; j= 12 ? 2 : 1);\n\tvar encoding = 'sbcs-cont';\n\tvar cp = current_codepage;\n\tif(opts && opts.biff >= 8) current_codepage = 1200;\n\tif(!opts || opts.biff == 8 ) {\n\t\tvar fHighByte = blob.read_shift(1);\n\t\tif(fHighByte) { encoding = 'dbcs-cont'; }\n\t} else if(opts.biff == 12) {\n\t\tencoding = 'wstr';\n\t}\n\tif(opts.biff >= 2 && opts.biff <= 5) encoding = 'cpstr';\n\tvar o = cch ? blob.read_shift(cch, encoding) : \"\";\n\tcurrent_codepage = cp;\n\treturn o;\n}\n\n/* 2.5.293 XLUnicodeRichExtendedString */\nfunction parse_XLUnicodeRichExtendedString(blob) {\n\tvar cp = current_codepage;\n\tcurrent_codepage = 1200;\n\tvar cch = blob.read_shift(2), flags = blob.read_shift(1);\n\tvar /*fHighByte = flags & 0x1,*/ fExtSt = flags & 0x4, fRichSt = flags & 0x8;\n\tvar width = 1 + (flags & 0x1); // 0x0 -> utf8, 0x1 -> dbcs\n\tvar cRun = 0, cbExtRst;\n\tvar z = {};\n\tif(fRichSt) cRun = blob.read_shift(2);\n\tif(fExtSt) cbExtRst = blob.read_shift(4);\n\tvar encoding = width == 2 ? 'dbcs-cont' : 'sbcs-cont';\n\tvar msg = cch === 0 ? \"\" : blob.read_shift(cch, encoding);\n\tif(fRichSt) blob.l += 4 * cRun; //TODO: parse this\n\tif(fExtSt) blob.l += cbExtRst; //TODO: parse this\n\tz.t = msg;\n\tif(!fRichSt) { z.raw = \"\" + z.t + \"\"; z.r = z.t; }\n\tcurrent_codepage = cp;\n\treturn z;\n}\nfunction write_XLUnicodeRichExtendedString(xlstr/*:: :XLString, opts*/) {\n\tvar str = (xlstr.t||\"\"), nfmts = 1;\n\n\tvar hdr = new_buf(3 + (nfmts > 1 ? 2 : 0));\n\thdr.write_shift(2, str.length);\n\thdr.write_shift(1, (nfmts > 1 ? 0x08 : 0x00) | 0x01);\n\tif(nfmts > 1) hdr.write_shift(2, nfmts);\n\n\tvar otext = new_buf(2 * str.length);\n\totext.write_shift(2 * str.length, str, 'utf16le');\n\n\tvar out = [hdr, otext];\n\n\treturn bconcat(out);\n}\n\n/* 2.5.296 XLUnicodeStringNoCch */\nfunction parse_XLUnicodeStringNoCch(blob, cch, opts) {\n\tvar retval;\n\tif(opts) {\n\t\tif(opts.biff >= 2 && opts.biff <= 5) return blob.read_shift(cch, 'cpstr');\n\t\tif(opts.biff >= 12) return blob.read_shift(cch, 'dbcs-cont');\n\t}\n\tvar fHighByte = blob.read_shift(1);\n\tif(fHighByte===0) { retval = blob.read_shift(cch, 'sbcs-cont'); }\n\telse { retval = blob.read_shift(cch, 'dbcs-cont'); }\n\treturn retval;\n}\n\n/* 2.5.294 XLUnicodeString */\nfunction parse_XLUnicodeString(blob, length, opts) {\n\tvar cch = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);\n\tif(cch === 0) { blob.l++; return \"\"; }\n\treturn parse_XLUnicodeStringNoCch(blob, cch, opts);\n}\n/* BIFF5 override */\nfunction parse_XLUnicodeString2(blob, length, opts) {\n\tif(opts.biff > 5) return parse_XLUnicodeString(blob, length, opts);\n\tvar cch = blob.read_shift(1);\n\tif(cch === 0) { blob.l++; return \"\"; }\n\treturn blob.read_shift(cch, (opts.biff <= 4 || !blob.lens ) ? 'cpstr' : 'sbcs-cont');\n}\n/* TODO: BIFF5 and lower, codepage awareness */\nfunction write_XLUnicodeString(str, opts, o) {\n\tif(!o) o = new_buf(3 + 2 * str.length);\n\to.write_shift(2, str.length);\n\to.write_shift(1, 1);\n\to.write_shift(31, str, 'utf16le');\n\treturn o;\n}\n\n/* [MS-XLS] 2.5.61 ControlInfo */\nfunction parse_ControlInfo(blob/*::, length, opts*/) {\n\tvar flags = blob.read_shift(1);\n\tblob.l++;\n\tvar accel = blob.read_shift(2);\n\tblob.l += 2;\n\treturn [flags, accel];\n}\n\n/* [MS-OSHARED] 2.3.7.6 URLMoniker TODO: flags */\nfunction parse_URLMoniker(blob/*::, length, opts*/) {\n\tvar len = blob.read_shift(4), start = blob.l;\n\tvar extra = false;\n\tif(len > 24) {\n\t\t/* look ahead */\n\t\tblob.l += len - 24;\n\t\tif(blob.read_shift(16) === \"795881f43b1d7f48af2c825dc4852763\") extra = true;\n\t\tblob.l = start;\n\t}\n\tvar url = blob.read_shift((extra?len-24:len)>>1, 'utf16le').replace(chr0,\"\");\n\tif(extra) blob.l += 24;\n\treturn url;\n}\n\n/* [MS-OSHARED] 2.3.7.8 FileMoniker TODO: all fields */\nfunction parse_FileMoniker(blob/*::, length*/) {\n\tvar cAnti = blob.read_shift(2);\n\tvar preamble = \"\"; while(cAnti-- > 0) preamble += \"../\";\n\tvar ansiPath = blob.read_shift(0, 'lpstr-ansi');\n\tblob.l += 2; //var endServer = blob.read_shift(2);\n\tif(blob.read_shift(2) != 0xDEAD) throw new Error(\"Bad FileMoniker\");\n\tvar sz = blob.read_shift(4);\n\tif(sz === 0) return preamble + ansiPath.replace(/\\\\/g,\"/\");\n\tvar bytes = blob.read_shift(4);\n\tif(blob.read_shift(2) != 3) throw new Error(\"Bad FileMoniker\");\n\tvar unicodePath = blob.read_shift(bytes>>1, 'utf16le').replace(chr0,\"\");\n\treturn preamble + unicodePath;\n}\n\n/* [MS-OSHARED] 2.3.7.2 HyperlinkMoniker TODO: all the monikers */\nfunction parse_HyperlinkMoniker(blob, length) {\n\tvar clsid = blob.read_shift(16); length -= 16;\n\tswitch(clsid) {\n\t\tcase \"e0c9ea79f9bace118c8200aa004ba90b\": return parse_URLMoniker(blob, length);\n\t\tcase \"0303000000000000c000000000000046\": return parse_FileMoniker(blob, length);\n\t\tdefault: throw new Error(\"Unsupported Moniker \" + clsid);\n\t}\n}\n\n/* [MS-OSHARED] 2.3.7.9 HyperlinkString */\nfunction parse_HyperlinkString(blob/*::, length*/) {\n\tvar len = blob.read_shift(4);\n\tvar o = len > 0 ? blob.read_shift(len, 'utf16le').replace(chr0, \"\") : \"\";\n\treturn o;\n}\nfunction write_HyperlinkString(str/*:string*/, o) {\n\tif(!o) o = new_buf(6 + str.length * 2);\n\to.write_shift(4, 1 + str.length);\n\tfor(var i = 0; i < str.length; ++i) o.write_shift(2, str.charCodeAt(i));\n\to.write_shift(2, 0);\n\treturn o;\n}\n\n/* [MS-OSHARED] 2.3.7.1 Hyperlink Object */\nfunction parse_Hyperlink(blob, length)/*:Hyperlink*/ {\n\tvar end = blob.l + length;\n\tvar sVer = blob.read_shift(4);\n\tif(sVer !== 2) throw new Error(\"Unrecognized streamVersion: \" + sVer);\n\tvar flags = blob.read_shift(2);\n\tblob.l += 2;\n\tvar displayName, targetFrameName, moniker, oleMoniker, Loc=\"\", guid, fileTime;\n\tif(flags & 0x0010) displayName = parse_HyperlinkString(blob, end - blob.l);\n\tif(flags & 0x0080) targetFrameName = parse_HyperlinkString(blob, end - blob.l);\n\tif((flags & 0x0101) === 0x0101) moniker = parse_HyperlinkString(blob, end - blob.l);\n\tif((flags & 0x0101) === 0x0001) oleMoniker = parse_HyperlinkMoniker(blob, end - blob.l);\n\tif(flags & 0x0008) Loc = parse_HyperlinkString(blob, end - blob.l);\n\tif(flags & 0x0020) guid = blob.read_shift(16);\n\tif(flags & 0x0040) fileTime = parse_FILETIME(blob/*, 8*/);\n\tblob.l = end;\n\tvar target = targetFrameName||moniker||oleMoniker||\"\";\n\tif(target && Loc) target+=\"#\"+Loc;\n\tif(!target) target = \"#\" + Loc;\n\tif((flags & 0x0002) && target.charAt(0) == \"/\" && target.charAt(1) != \"/\") target = \"file://\" + target;\n\tvar out = ({Target:target}/*:any*/);\n\tif(guid) out.guid = guid;\n\tif(fileTime) out.time = fileTime;\n\tif(displayName) out.Tooltip = displayName;\n\treturn out;\n}\nfunction write_Hyperlink(hl) {\n\tvar out = new_buf(512), i = 0;\n\tvar Target = hl.Target;\n\tif(Target.slice(0,7) == \"file://\") Target = Target.slice(7);\n\tvar hashidx = Target.indexOf(\"#\");\n\tvar F = hashidx > -1 ? 0x1f : 0x17;\n\tswitch(Target.charAt(0)) { case \"#\": F=0x1c; break; case \".\": F&=~2; break; }\n\tout.write_shift(4,2); out.write_shift(4, F);\n\tvar data = [8,6815827,6619237,4849780,83]; for(i = 0; i < data.length; ++i) out.write_shift(4, data[i]);\n\tif(F == 0x1C) {\n\t\tTarget = Target.slice(1);\n\t\twrite_HyperlinkString(Target, out);\n\t} else if(F & 0x02) {\n\t\tdata = \"e0 c9 ea 79 f9 ba ce 11 8c 82 00 aa 00 4b a9 0b\".split(\" \");\n\t\tfor(i = 0; i < data.length; ++i) out.write_shift(1, parseInt(data[i], 16));\n\t\tvar Pretarget = hashidx > -1 ? Target.slice(0, hashidx) : Target;\n\t\tout.write_shift(4, 2*(Pretarget.length + 1));\n\t\tfor(i = 0; i < Pretarget.length; ++i) out.write_shift(2, Pretarget.charCodeAt(i));\n\t\tout.write_shift(2, 0);\n\t\tif(F & 0x08) write_HyperlinkString(hashidx > -1 ? Target.slice(hashidx+1): \"\", out);\n\t} else {\n\t\tdata = \"03 03 00 00 00 00 00 00 c0 00 00 00 00 00 00 46\".split(\" \");\n\t\tfor(i = 0; i < data.length; ++i) out.write_shift(1, parseInt(data[i], 16));\n\t\tvar P = 0;\n\t\twhile(Target.slice(P*3,P*3+3)==\"../\"||Target.slice(P*3,P*3+3)==\"..\\\\\") ++P;\n\t\tout.write_shift(2, P);\n\t\tout.write_shift(4, Target.length - 3 * P + 1);\n\t\tfor(i = 0; i < Target.length - 3 * P; ++i) out.write_shift(1, Target.charCodeAt(i + 3 * P) & 0xFF);\n\t\tout.write_shift(1, 0);\n\t\tout.write_shift(2, 0xFFFF);\n\t\tout.write_shift(2, 0xDEAD);\n\t\tfor(i = 0; i < 6; ++i) out.write_shift(4, 0);\n\t}\n\treturn out.slice(0, out.l);\n}\n\n/* 2.5.178 LongRGBA */\nfunction parse_LongRGBA(blob/*::, length*/) { var r = blob.read_shift(1), g = blob.read_shift(1), b = blob.read_shift(1), a = blob.read_shift(1); return [r,g,b,a]; }\n\n/* 2.5.177 LongRGB */\nfunction parse_LongRGB(blob, length) { var x = parse_LongRGBA(blob, length); x[3] = 0; return x; }\n\n\n/* [MS-XLS] 2.5.19 */\nfunction parse_XLSCell(blob, length, opts)/*:Cell*/ {\n\tvar rw = blob.read_shift(2); // 0-indexed\n\tvar col = blob.read_shift(2);\n\tvar ret = ({r:rw, c:col, ixfe:0}/*:any*/);\n\tif(opts && opts.biff == 2 || length == 7) {\n\t\t/* TODO: pass back flags */\n\t\tvar flags = blob.read_shift(1);\n\t\tret.ixfe = flags & 0x3F;\n\t\tblob.l += 2;\n\t\t/*\n\t\tvar ifntifmt = blob.read_shift(1);\n\t\tvar ifmt = ifntifmt & 0x3f, ifnt = ifntifmt >> 6;\n\t\tvar flags3 = blob.read_shift(1);\n\t\t*/\n\t} else ret.ixfe = blob.read_shift(2);\n\treturn ret;\n}\nfunction write_XLSCell(R/*:number*/, C/*:number*/, ixfe/*:?number*/, o) {\n\tif(!o) o = new_buf(6);\n\to.write_shift(2, R);\n\to.write_shift(2, C);\n\to.write_shift(2, ixfe||0);\n\treturn o;\n}\n\n/* [MS-XLS] 2.5.134 */\nfunction parse_frtHeader(blob) {\n\tvar rt = blob.read_shift(2);\n\tvar flags = blob.read_shift(2); // TODO: parse these flags\n\tblob.l += 8;\n\treturn {type: rt, flags: flags};\n}\n\n\n\nfunction parse_OptXLUnicodeString(blob, length, opts) { return length === 0 ? \"\" : parse_XLUnicodeString2(blob, length, opts); }\n\n/* [MS-XLS] 2.5.344 */\nfunction parse_XTI(blob, length, opts) {\n\tvar w = opts.biff > 8 ? 4 : 2;\n\tvar iSupBook = blob.read_shift(w), itabFirst = blob.read_shift(w,'i'), itabLast = blob.read_shift(w,'i');\n\treturn [iSupBook, itabFirst, itabLast];\n}\n\n/* [MS-XLS] 2.5.218 */\nfunction parse_RkRec(blob) {\n\tvar ixfe = blob.read_shift(2);\n\tvar RK = parse_RkNumber(blob);\n\treturn [ixfe, RK];\n}\n\n/* [MS-XLS] 2.5.1 */\nfunction parse_AddinUdf(blob, length, opts) {\n\tblob.l += 4; length -= 4;\n\tvar l = blob.l + length;\n\tvar udfName = parse_ShortXLUnicodeString(blob, length, opts);\n\tvar cb = blob.read_shift(2);\n\tl -= blob.l;\n\tif(cb !== l) throw new Error(\"Malformed AddinUdf: padding = \" + l + \" != \" + cb);\n\tblob.l += cb;\n\treturn udfName;\n}\n\n/* [MS-XLS] 2.5.209 TODO: Check sizes */\nfunction parse_Ref8U(blob/*::, length*/) {\n\tvar rwFirst = blob.read_shift(2);\n\tvar rwLast = blob.read_shift(2);\n\tvar colFirst = blob.read_shift(2);\n\tvar colLast = blob.read_shift(2);\n\treturn {s:{c:colFirst, r:rwFirst}, e:{c:colLast,r:rwLast}};\n}\nfunction write_Ref8U(r/*:Range*/, o) {\n\tif(!o) o = new_buf(8);\n\to.write_shift(2, r.s.r);\n\to.write_shift(2, r.e.r);\n\to.write_shift(2, r.s.c);\n\to.write_shift(2, r.e.c);\n\treturn o;\n}\n\n/* [MS-XLS] 2.5.211 */\nfunction parse_RefU(blob/*::, length*/) {\n\tvar rwFirst = blob.read_shift(2);\n\tvar rwLast = blob.read_shift(2);\n\tvar colFirst = blob.read_shift(1);\n\tvar colLast = blob.read_shift(1);\n\treturn {s:{c:colFirst, r:rwFirst}, e:{c:colLast,r:rwLast}};\n}\n\n/* [MS-XLS] 2.5.207 */\nvar parse_Ref = parse_RefU;\n\n/* [MS-XLS] 2.5.143 */\nfunction parse_FtCmo(blob/*::, length*/) {\n\tblob.l += 4;\n\tvar ot = blob.read_shift(2);\n\tvar id = blob.read_shift(2);\n\tvar flags = blob.read_shift(2);\n\tblob.l+=12;\n\treturn [id, ot, flags];\n}\n\n/* [MS-XLS] 2.5.149 */\nfunction parse_FtNts(blob) {\n\tvar out = {};\n\tblob.l += 4;\n\tblob.l += 16; // GUID TODO\n\tout.fSharedNote = blob.read_shift(2);\n\tblob.l += 4;\n\treturn out;\n}\n\n/* [MS-XLS] 2.5.142 */\nfunction parse_FtCf(blob) {\n\tvar out = {};\n\tblob.l += 4;\n\tblob.cf = blob.read_shift(2);\n\treturn out;\n}\n\n/* [MS-XLS] 2.5.140 - 2.5.154 and friends */\nfunction parse_FtSkip(blob) { blob.l += 2; blob.l += blob.read_shift(2); }\nvar FtTab = {\n\t0x00: parse_FtSkip, /* FtEnd */\n\t0x04: parse_FtSkip, /* FtMacro */\n\t0x05: parse_FtSkip, /* FtButton */\n\t0x06: parse_FtSkip, /* FtGmo */\n\t0x07: parse_FtCf, /* FtCf */\n\t0x08: parse_FtSkip, /* FtPioGrbit */\n\t0x09: parse_FtSkip, /* FtPictFmla */\n\t0x0A: parse_FtSkip, /* FtCbls */\n\t0x0B: parse_FtSkip, /* FtRbo */\n\t0x0C: parse_FtSkip, /* FtSbs */\n\t0x0D: parse_FtNts, /* FtNts */\n\t0x0E: parse_FtSkip, /* FtSbsFmla */\n\t0x0F: parse_FtSkip, /* FtGboData */\n\t0x10: parse_FtSkip, /* FtEdoData */\n\t0x11: parse_FtSkip, /* FtRboData */\n\t0x12: parse_FtSkip, /* FtCblsData */\n\t0x13: parse_FtSkip, /* FtLbsData */\n\t0x14: parse_FtSkip, /* FtCblsFmla */\n\t0x15: parse_FtCmo\n};\nfunction parse_FtArray(blob, length/*::, ot*/) {\n\tvar tgt = blob.l + length;\n\tvar fts = [];\n\twhile(blob.l < tgt) {\n\t\tvar ft = blob.read_shift(2);\n\t\tblob.l-=2;\n\t\ttry {\n\t\t\tfts[ft] = FtTab[ft](blob, tgt - blob.l);\n\t\t} catch(e) { blob.l = tgt; return fts; }\n\t}\n\tif(blob.l != tgt) blob.l = tgt; //throw new Error(\"bad Object Ft-sequence\");\n\treturn fts;\n}\n\n/* --- 2.4 Records --- */\n\n/* [MS-XLS] 2.4.21 */\nfunction parse_BOF(blob, length) {\n\tvar o = {BIFFVer:0, dt:0};\n\to.BIFFVer = blob.read_shift(2); length -= 2;\n\tif(length >= 2) { o.dt = blob.read_shift(2); blob.l -= 2; }\n\tswitch(o.BIFFVer) {\n\t\tcase 0x0600: /* BIFF8 */\n\t\tcase 0x0500: /* BIFF5 */\n\t\tcase 0x0400: /* BIFF4 */\n\t\tcase 0x0300: /* BIFF3 */\n\t\tcase 0x0200: /* BIFF2 */\n\t\tcase 0x0002: case 0x0007: /* BIFF2 */\n\t\t\tbreak;\n\t\tdefault: if(length > 6) throw new Error(\"Unexpected BIFF Ver \" + o.BIFFVer);\n\t}\n\n\tblob.read_shift(length);\n\treturn o;\n}\nfunction write_BOF(wb/*:Workbook*/, t/*:number*/, o) {\n\tvar h = 0x0600, w = 16;\n\tswitch(o.bookType) {\n\t\tcase 'biff8': break;\n\t\tcase 'biff5': h = 0x0500; w = 8; break;\n\t\tcase 'biff4': h = 0x0004; w = 6; break;\n\t\tcase 'biff3': h = 0x0003; w = 6; break;\n\t\tcase 'biff2': h = 0x0002; w = 4; break;\n\t\tcase 'xla': break;\n\t\tdefault: throw new Error(\"unsupported BIFF version\");\n\t}\n\tvar out = new_buf(w);\n\tout.write_shift(2, h);\n\tout.write_shift(2, t);\n\tif(w > 4) out.write_shift(2, 0x7262);\n\tif(w > 6) out.write_shift(2, 0x07CD);\n\tif(w > 8) {\n\t\tout.write_shift(2, 0xC009);\n\t\tout.write_shift(2, 0x0001);\n\t\tout.write_shift(2, 0x0706);\n\t\tout.write_shift(2, 0x0000);\n\t}\n\treturn out;\n}\n\n\n/* [MS-XLS] 2.4.146 */\nfunction parse_InterfaceHdr(blob, length) {\n\tif(length === 0) return 0x04b0;\n\tif((blob.read_shift(2))!==0x04b0){/* empty */}\n\treturn 0x04b0;\n}\n\n\n/* [MS-XLS] 2.4.349 */\nfunction parse_WriteAccess(blob, length, opts) {\n\tif(opts.enc) { blob.l += length; return \"\"; }\n\tvar l = blob.l;\n\t// TODO: make sure XLUnicodeString doesnt overrun\n\tvar UserName = parse_XLUnicodeString2(blob, 0, opts);\n\tblob.read_shift(length + l - blob.l);\n\treturn UserName;\n}\nfunction write_WriteAccess(s/*:string*/, opts) {\n\tvar b8 = !opts || opts.biff == 8;\n\tvar o = new_buf(b8 ? 112 : 54);\n\to.write_shift(opts.biff == 8 ? 2 : 1, 7);\n\tif(b8) o.write_shift(1, 0);\n\to.write_shift(4, 0x33336853);\n\to.write_shift(4, (0x00534A74 | (b8 ? 0 : 0x20000000)));\n\twhile(o.l < o.length) o.write_shift(1, (b8 ? 0 : 32));\n\treturn o;\n}\n\n/* [MS-XLS] 2.4.351 */\nfunction parse_WsBool(blob, length, opts) {\n\tvar flags = opts && opts.biff == 8 || length == 2 ? blob.read_shift(2) : (blob.l += length, 0);\n\treturn { fDialog: flags & 0x10, fBelow: flags & 0x40, fRight: flags & 0x80 };\n}\n\n/* [MS-XLS] 2.4.28 */\nfunction parse_BoundSheet8(blob, length, opts) {\n\tvar name = \"\";\n\tif(opts.biff == 4) {\n\t\tname = parse_ShortXLUnicodeString(blob, 0, opts);\n\t\tif(name.length === 0) name = \"Sheet1\";\n\t\treturn { name:name };\n\t}\n\tvar pos = blob.read_shift(4);\n\tvar hidden = blob.read_shift(1) & 0x03;\n\tvar dt = blob.read_shift(1);\n\tswitch(dt) {\n\t\tcase 0: dt = 'Worksheet'; break;\n\t\tcase 1: dt = 'Macrosheet'; break;\n\t\tcase 2: dt = 'Chartsheet'; break;\n\t\tcase 6: dt = 'VBAModule'; break;\n\t}\n\tname = parse_ShortXLUnicodeString(blob, 0, opts);\n\tif(name.length === 0) name = \"Sheet1\";\n\treturn { pos:pos, hs:hidden, dt:dt, name:name };\n}\nfunction write_BoundSheet8(data, opts) {\n\tvar w = (!opts || opts.biff >= 8 ? 2 : 1);\n\tvar o = new_buf(8 + w * data.name.length);\n\to.write_shift(4, data.pos);\n\to.write_shift(1, data.hs || 0);\n\to.write_shift(1, data.dt);\n\to.write_shift(1, data.name.length);\n\tif(opts.biff >= 8) o.write_shift(1, 1);\n\to.write_shift(w * data.name.length, data.name, opts.biff < 8 ? 'sbcs' : 'utf16le');\n\tvar out = o.slice(0, o.l);\n\tout.l = o.l; return out;\n}\n\n/* [MS-XLS] 2.4.265 TODO */\nfunction parse_SST(blob, length)/*:SST*/ {\n\tvar end = blob.l + length;\n\tvar cnt = blob.read_shift(4);\n\tvar ucnt = blob.read_shift(4);\n\tvar strs/*:SST*/ = ([]/*:any*/);\n\tfor(var i = 0; i != ucnt && blob.l < end; ++i) {\n\t\tstrs.push(parse_XLUnicodeRichExtendedString(blob));\n\t}\n\tstrs.Count = cnt; strs.Unique = ucnt;\n\treturn strs;\n}\nfunction write_SST(sst, opts) {\n\tvar header = new_buf(8);\n\theader.write_shift(4, sst.Count);\n\theader.write_shift(4, sst.Unique);\n\tvar strs = [];\n\tfor(var j = 0; j < sst.length; ++j) strs[j] = write_XLUnicodeRichExtendedString(sst[j], opts);\n\tvar o = bconcat([header].concat(strs));\n\t/*::(*/o/*:: :any)*/.parts = [header.length].concat(strs.map(function(str) { return str.length; }));\n\treturn o;\n}\n\n/* [MS-XLS] 2.4.107 */\nfunction parse_ExtSST(blob, length) {\n\tvar extsst = {};\n\textsst.dsst = blob.read_shift(2);\n\tblob.l += length-2;\n\treturn extsst;\n}\n\n\n/* [MS-XLS] 2.4.221 TODO: check BIFF2-4 */\nfunction parse_Row(blob) {\n\tvar z = ({}/*:any*/);\n\tz.r = blob.read_shift(2);\n\tz.c = blob.read_shift(2);\n\tz.cnt = blob.read_shift(2) - z.c;\n\tvar miyRw = blob.read_shift(2);\n\tblob.l += 4; // reserved(2), unused(2)\n\tvar flags = blob.read_shift(1); // various flags\n\tblob.l += 3; // reserved(8), ixfe(12), flags(4)\n\tif(flags & 0x07) z.level = flags & 0x07;\n\t// collapsed: flags & 0x10\n\tif(flags & 0x20) z.hidden = true;\n\tif(flags & 0x40) z.hpt = miyRw / 20;\n\treturn z;\n}\n\n\n/* [MS-XLS] 2.4.125 */\nfunction parse_ForceFullCalculation(blob) {\n\tvar header = parse_frtHeader(blob);\n\tif(header.type != 0x08A3) throw new Error(\"Invalid Future Record \" + header.type);\n\tvar fullcalc = blob.read_shift(4);\n\treturn fullcalc !== 0x0;\n}\n\n\n\n\n\n/* [MS-XLS] 2.4.215 rt */\nfunction parse_RecalcId(blob) {\n\tblob.read_shift(2);\n\treturn blob.read_shift(4);\n}\n\n/* [MS-XLS] 2.4.87 */\nfunction parse_DefaultRowHeight(blob, length, opts) {\n\tvar f = 0;\n\tif(!(opts && opts.biff == 2)) {\n\t\tf = blob.read_shift(2);\n\t}\n\tvar miyRw = blob.read_shift(2);\n\tif((opts && opts.biff == 2)) {\n\t\tf = 1 - (miyRw >> 15); miyRw &= 0x7fff;\n\t}\n\tvar fl = {Unsynced:f&1,DyZero:(f&2)>>1,ExAsc:(f&4)>>2,ExDsc:(f&8)>>3};\n\treturn [fl, miyRw];\n}\n\n/* [MS-XLS] 2.4.345 TODO */\nfunction parse_Window1(blob) {\n\tvar xWn = blob.read_shift(2), yWn = blob.read_shift(2), dxWn = blob.read_shift(2), dyWn = blob.read_shift(2);\n\tvar flags = blob.read_shift(2), iTabCur = blob.read_shift(2), iTabFirst = blob.read_shift(2);\n\tvar ctabSel = blob.read_shift(2), wTabRatio = blob.read_shift(2);\n\treturn { Pos: [xWn, yWn], Dim: [dxWn, dyWn], Flags: flags, CurTab: iTabCur,\n\t\tFirstTab: iTabFirst, Selected: ctabSel, TabRatio: wTabRatio };\n}\nfunction write_Window1(/*::opts*/) {\n\tvar o = new_buf(18);\n\to.write_shift(2, 0);\n\to.write_shift(2, 0);\n\to.write_shift(2, 0x7260);\n\to.write_shift(2, 0x44c0);\n\to.write_shift(2, 0x38);\n\to.write_shift(2, 0);\n\to.write_shift(2, 0);\n\to.write_shift(2, 1);\n\to.write_shift(2, 0x01f4);\n\treturn o;\n}\n/* [MS-XLS] 2.4.346 TODO */\nfunction parse_Window2(blob, length, opts) {\n\tif(opts && opts.biff >= 2 && opts.biff < 5) return {};\n\tvar f = blob.read_shift(2);\n\treturn { RTL: f & 0x40 };\n}\nfunction write_Window2(view) {\n\tvar o = new_buf(18), f = 0x6b6;\n\tif(view && view.RTL) f |= 0x40;\n\to.write_shift(2, f);\n\to.write_shift(4, 0);\n\to.write_shift(4, 64);\n\to.write_shift(4, 0);\n\to.write_shift(4, 0);\n\treturn o;\n}\n\n/* [MS-XLS] 2.4.189 TODO */\nfunction parse_Pane(/*blob, length, opts*/) {\n}\n\n/* [MS-XLS] 2.4.122 TODO */\nfunction parse_Font(blob, length, opts) {\n\tvar o/*:any*/ = {\n\t\tdyHeight: blob.read_shift(2),\n\t\tfl: blob.read_shift(2)\n\t};\n\tswitch((opts && opts.biff) || 8) {\n\t\tcase 2: break;\n\t\tcase 3: case 4: blob.l += 2; break;\n\t\tdefault: blob.l += 10; break;\n\t}\n\to.name = parse_ShortXLUnicodeString(blob, 0, opts);\n\treturn o;\n}\nfunction write_Font(data, opts) {\n\tvar name = data.name || \"Arial\";\n\tvar b5 = (opts && (opts.biff == 5)), w = (b5 ? (15 + name.length) : (16 + 2 * name.length));\n\tvar o = new_buf(w);\n\to.write_shift(2, (data.sz || 12) * 20);\n\to.write_shift(4, 0);\n\to.write_shift(2, 400);\n\to.write_shift(4, 0);\n\to.write_shift(2, 0);\n\to.write_shift(1, name.length);\n\tif(!b5) o.write_shift(1, 1);\n\to.write_shift((b5 ? 1 : 2) * name.length, name, (b5 ? \"sbcs\" : \"utf16le\"));\n\treturn o;\n}\n\n/* [MS-XLS] 2.4.149 */\nfunction parse_LabelSst(blob, length, opts) {\n\tvar cell = parse_XLSCell(blob, length, opts);\n\tcell.isst = blob.read_shift(4);\n\treturn cell;\n}\nfunction write_LabelSst(R/*:number*/, C/*:number*/, v/*:number*/, os/*:number*/ /*::, opts*/) {\n\tvar o = new_buf(10);\n\twrite_XLSCell(R, C, os, o);\n\to.write_shift(4, v);\n\treturn o;\n}\n\n/* [MS-XLS] 2.4.148 */\nfunction parse_Label(blob, length, opts) {\n\tif(opts.biffguess && opts.biff == 2) opts.biff = 5;\n\tvar target = blob.l + length;\n\tvar cell = parse_XLSCell(blob, length, opts);\n\tvar str = parse_XLUnicodeString(blob, target - blob.l, opts);\n\tcell.val = str;\n\treturn cell;\n}\nfunction write_Label(R/*:number*/, C/*:number*/, v/*:string*/, os/*:number*/, opts) {\n\tvar b8 = !opts || opts.biff == 8;\n\tvar o = new_buf(6 + 2 + (+b8) + (1 + b8) * v.length);\n\twrite_XLSCell(R, C, os, o);\n\to.write_shift(2, v.length);\n\tif(b8) o.write_shift(1, 1);\n\to.write_shift((1 + b8) * v.length, v, b8 ? 'utf16le' : 'sbcs');\n\treturn o;\n}\n\n\n/* [MS-XLS] 2.4.126 Number Formats */\nfunction parse_Format(blob, length, opts) {\n\tvar numFmtId = blob.read_shift(2);\n\tvar fmtstr = parse_XLUnicodeString2(blob, 0, opts);\n\treturn [numFmtId, fmtstr];\n}\nfunction write_Format(i/*:number*/, f/*:string*/, opts, o) {\n\tvar b5 = (opts && (opts.biff == 5));\n\tif(!o) o = new_buf(b5 ? (3 + f.length) : (5 + 2 * f.length));\n\to.write_shift(2, i);\n\to.write_shift((b5 ? 1 : 2), f.length);\n\tif(!b5) o.write_shift(1, 1);\n\to.write_shift((b5 ? 1 : 2) * f.length, f, (b5 ? 'sbcs' : 'utf16le'));\n\tvar out = (o.length > o.l) ? o.slice(0, o.l) : o;\n\tif(out.l == null) out.l = out.length;\n\treturn out;\n}\nvar parse_BIFF2Format = parse_XLUnicodeString2;\nfunction write_BIFF2Format(f/*:string*/) {\n\tvar o = new_buf(1 + f.length);\n\to.write_shift(1, f.length);\n\to.write_shift(f.length, f, \"sbcs\");\n\treturn o;\n}\nfunction write_BIFF4Format(f/*:string*/) {\n\tvar o = new_buf(3 + f.length);\n\to.l += 2;\n\to.write_shift(1, f.length);\n\to.write_shift(f.length, f, \"sbcs\");\n\treturn o;\n}\n\n/* [MS-XLS] 2.4.90 */\nfunction parse_Dimensions(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar w = opts.biff == 8 || !opts.biff ? 4 : 2;\n\tvar r = blob.read_shift(w), R = blob.read_shift(w);\n\tvar c = blob.read_shift(2), C = blob.read_shift(2);\n\tblob.l = end;\n\treturn {s: {r:r, c:c}, e: {r:R, c:C}};\n}\nfunction write_Dimensions(range, opts) {\n\tvar w = opts.biff == 8 || !opts.biff ? 4 : 2;\n\tvar o = new_buf(2*w + 6);\n\to.write_shift(w, range.s.r);\n\to.write_shift(w, range.e.r + 1);\n\to.write_shift(2, range.s.c);\n\to.write_shift(2, range.e.c + 1);\n\to.write_shift(2, 0);\n\treturn o;\n}\n\n/* [MS-XLS] 2.4.220 */\nfunction parse_RK(blob) {\n\tvar rw = blob.read_shift(2), col = blob.read_shift(2);\n\tvar rkrec = parse_RkRec(blob);\n\treturn {r:rw, c:col, ixfe:rkrec[0], rknum:rkrec[1]};\n}\n\n/* [MS-XLS] 2.4.175 */\nfunction parse_MulRk(blob, length) {\n\tvar target = blob.l + length - 2;\n\tvar rw = blob.read_shift(2), col = blob.read_shift(2);\n\tvar rkrecs = [];\n\twhile(blob.l < target) rkrecs.push(parse_RkRec(blob));\n\tif(blob.l !== target) throw new Error(\"MulRK read error\");\n\tvar lastcol = blob.read_shift(2);\n\tif(rkrecs.length != lastcol - col + 1) throw new Error(\"MulRK length mismatch\");\n\treturn {r:rw, c:col, C:lastcol, rkrec:rkrecs};\n}\n/* [MS-XLS] 2.4.174 */\nfunction parse_MulBlank(blob, length) {\n\tvar target = blob.l + length - 2;\n\tvar rw = blob.read_shift(2), col = blob.read_shift(2);\n\tvar ixfes = [];\n\twhile(blob.l < target) ixfes.push(blob.read_shift(2));\n\tif(blob.l !== target) throw new Error(\"MulBlank read error\");\n\tvar lastcol = blob.read_shift(2);\n\tif(ixfes.length != lastcol - col + 1) throw new Error(\"MulBlank length mismatch\");\n\treturn {r:rw, c:col, C:lastcol, ixfe:ixfes};\n}\n\n/* [MS-XLS] 2.5.20 2.5.249 TODO: interpret values here */\nfunction parse_CellStyleXF(blob, length, style, opts) {\n\tvar o = {};\n\tvar a = blob.read_shift(4), b = blob.read_shift(4);\n\tvar c = blob.read_shift(4), d = blob.read_shift(2);\n\to.patternType = XLSFillPattern[c >> 26];\n\n\tif(!opts.cellStyles) return o;\n\to.alc = a & 0x07;\n\to.fWrap = (a >> 3) & 0x01;\n\to.alcV = (a >> 4) & 0x07;\n\to.fJustLast = (a >> 7) & 0x01;\n\to.trot = (a >> 8) & 0xFF;\n\to.cIndent = (a >> 16) & 0x0F;\n\to.fShrinkToFit = (a >> 20) & 0x01;\n\to.iReadOrder = (a >> 22) & 0x02;\n\to.fAtrNum = (a >> 26) & 0x01;\n\to.fAtrFnt = (a >> 27) & 0x01;\n\to.fAtrAlc = (a >> 28) & 0x01;\n\to.fAtrBdr = (a >> 29) & 0x01;\n\to.fAtrPat = (a >> 30) & 0x01;\n\to.fAtrProt = (a >> 31) & 0x01;\n\n\to.dgLeft = b & 0x0F;\n\to.dgRight = (b >> 4) & 0x0F;\n\to.dgTop = (b >> 8) & 0x0F;\n\to.dgBottom = (b >> 12) & 0x0F;\n\to.icvLeft = (b >> 16) & 0x7F;\n\to.icvRight = (b >> 23) & 0x7F;\n\to.grbitDiag = (b >> 30) & 0x03;\n\n\to.icvTop = c & 0x7F;\n\to.icvBottom = (c >> 7) & 0x7F;\n\to.icvDiag = (c >> 14) & 0x7F;\n\to.dgDiag = (c >> 21) & 0x0F;\n\n\to.icvFore = d & 0x7F;\n\to.icvBack = (d >> 7) & 0x7F;\n\to.fsxButton = (d >> 14) & 0x01;\n\treturn o;\n}\n//function parse_CellXF(blob, length, opts) {return parse_CellStyleXF(blob,length,0, opts);}\n//function parse_StyleXF(blob, length, opts) {return parse_CellStyleXF(blob,length,1, opts);}\n\n/* [MS-XLS] 2.4.353 TODO: actually do this right */\nfunction parse_XF(blob, length, opts) {\n\tvar o = {};\n\to.ifnt = blob.read_shift(2); o.numFmtId = blob.read_shift(2); o.flags = blob.read_shift(2);\n\to.fStyle = (o.flags >> 2) & 0x01;\n\tlength -= 6;\n\to.data = parse_CellStyleXF(blob, length, o.fStyle, opts);\n\treturn o;\n}\nfunction write_XF(data, ixfeP, opts, o) {\n\tvar b5 = (opts && (opts.biff == 5));\n\tif(!o) o = new_buf(b5 ? 16 : 20);\n\to.write_shift(2, 0);\n\tif(data.style) {\n\t\to.write_shift(2, (data.numFmtId||0));\n\t\to.write_shift(2, 0xFFF4);\n\t} else {\n\t\to.write_shift(2, (data.numFmtId||0));\n\t\to.write_shift(2, (ixfeP<<4));\n\t}\n\tvar f = 0;\n\tif(data.numFmtId > 0 && b5) f |= 0x0400;\n\to.write_shift(4, f);\n\to.write_shift(4, 0);\n\tif(!b5) o.write_shift(4, 0);\n\to.write_shift(2, 0);\n\treturn o;\n}\nfunction parse_BIFF2XF(blob/*::, length, opts*/) {\n\tvar o = {};\n\to.ifnt = blob.read_shift(1); blob.l++; o.flags = blob.read_shift(1);\n\to.numFmtId = o.flags & 0x3F; o.flags>>=6;\n\to.fStyle = 0;\n\to.data = {}; // TODO\n\treturn o;\n}\nfunction write_BIFF2XF(xf) {\n\tvar o = new_buf(4);\n\to.l+=2;\n\to.write_shift(1, xf.numFmtId);\n\to.l++;\n\treturn o;\n}\nfunction write_BIFF3XF(xf) {\n\tvar o = new_buf(12);\n\to.l++;\n\to.write_shift(1, xf.numFmtId);\n\to.l += 10;\n\treturn o;\n}\n/* TODO: check other fields */\nvar write_BIFF4XF = write_BIFF3XF;\nfunction parse_BIFF3XF(blob/*::, length, opts*/) {\n\tvar o = {};\n\to.ifnt = blob.read_shift(1); o.numFmtId = blob.read_shift(1); o.flags = blob.read_shift(2);\n\to.fStyle = (o.flags >> 2) & 0x01;\n\to.data = {}; // TODO\n\treturn o;\n}\nfunction parse_BIFF4XF(blob/*::, length, opts*/) {\n\tvar o = {};\n\to.ifnt = blob.read_shift(1); o.numFmtId = blob.read_shift(1); o.flags = blob.read_shift(2);\n\to.fStyle = (o.flags >> 2) & 0x01;\n\to.data = {}; // TODO\n\treturn o;\n}\n\n/* [MS-XLS] 2.4.134 */\nfunction parse_Guts(blob) {\n\tblob.l += 4;\n\tvar out = [blob.read_shift(2), blob.read_shift(2)];\n\tif(out[0] !== 0) out[0]--;\n\tif(out[1] !== 0) out[1]--;\n\tif(out[0] > 7 || out[1] > 7) throw new Error(\"Bad Gutters: \" + out.join(\"|\"));\n\treturn out;\n}\nfunction write_Guts(guts/*:Array*/) {\n\tvar o = new_buf(8);\n\to.write_shift(4, 0);\n\to.write_shift(2, guts[0] ? guts[0] + 1 : 0);\n\to.write_shift(2, guts[1] ? guts[1] + 1 : 0);\n\treturn o;\n}\n\n/* [MS-XLS] 2.4.24 */\nfunction parse_BoolErr(blob, length, opts) {\n\tvar cell = parse_XLSCell(blob, 6, opts);\n\tvar val = parse_Bes(blob, 2);\n\tcell.val = val;\n\tcell.t = (val === true || val === false) ? 'b' : 'e';\n\treturn cell;\n}\nfunction write_BoolErr(R/*:number*/, C/*:number*/, v, os/*:number*/, opts, t/*:string*/) {\n\tvar o = new_buf(8);\n\twrite_XLSCell(R, C, os, o);\n\twrite_Bes(v, t, o);\n\treturn o;\n}\n\n/* [MS-XLS] 2.4.180 Number */\nfunction parse_Number(blob, length, opts) {\n\tif(opts.biffguess && opts.biff == 2) opts.biff = 5;\n\tvar cell = parse_XLSCell(blob, 6, opts);\n\tvar xnum = parse_Xnum(blob, 8);\n\tcell.val = xnum;\n\treturn cell;\n}\nfunction write_Number(R/*:number*/, C/*:number*/, v, os/*:: :number, opts*/) {\n\tvar o = new_buf(14);\n\twrite_XLSCell(R, C, os, o);\n\twrite_Xnum(v, o);\n\treturn o;\n}\n\nvar parse_XLHeaderFooter = parse_OptXLUnicodeString; // TODO: parse 2.4.136\n\n/* [MS-XLS] 2.4.271 */\nfunction parse_SupBook(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar ctab = blob.read_shift(2);\n\tvar cch = blob.read_shift(2);\n\topts.sbcch = cch;\n\tif(cch == 0x0401 || cch == 0x3A01) return [cch, ctab];\n\tif(cch < 0x01 || cch >0xff) throw new Error(\"Unexpected SupBook type: \"+cch);\n\tvar virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\t/* TODO: 2.5.277 Virtual Path */\n\tvar rgst = [];\n\twhile(end > blob.l) rgst.push(parse_XLUnicodeString(blob));\n\treturn [cch, ctab, virtPath, rgst];\n}\n\n/* [MS-XLS] 2.4.105 TODO */\nfunction parse_ExternName(blob, length, opts) {\n\tvar flags = blob.read_shift(2);\n\tvar body;\n\tvar o = ({\n\t\tfBuiltIn: flags & 0x01,\n\t\tfWantAdvise: (flags >>> 1) & 0x01,\n\t\tfWantPict: (flags >>> 2) & 0x01,\n\t\tfOle: (flags >>> 3) & 0x01,\n\t\tfOleLink: (flags >>> 4) & 0x01,\n\t\tcf: (flags >>> 5) & 0x3FF,\n\t\tfIcon: flags >>> 15 & 0x01\n\t}/*:any*/);\n\tif(opts.sbcch === 0x3A01) body = parse_AddinUdf(blob, length-2, opts);\n\t//else throw new Error(\"unsupported SupBook cch: \" + opts.sbcch);\n\to.body = body || blob.read_shift(length-2);\n\tif(typeof body === \"string\") o.Name = body;\n\treturn o;\n}\n\n/* [MS-XLS] 2.4.150 TODO */\nfunction parse_Lbl(blob, length, opts) {\n\tvar target = blob.l + length;\n\tvar flags = blob.read_shift(2);\n\tvar chKey = blob.read_shift(1);\n\tvar cch = blob.read_shift(1);\n\tvar cce = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);\n\tvar itab = 0;\n\tif(!opts || opts.biff >= 5) {\n\t\tif(opts.biff != 5) blob.l += 2;\n\t\titab = blob.read_shift(2);\n\t\tif(opts.biff == 5) blob.l += 2;\n\t\tblob.l += 4;\n\t}\n\tvar name = parse_XLUnicodeStringNoCch(blob, cch, opts);\n\tif(flags & 0x20) name = XLSLblBuiltIn[name.charCodeAt(0)];\n\tvar npflen = target - blob.l; if(opts && opts.biff == 2) --npflen;\n\t/*jshint -W018 */\n\tvar rgce = (target == blob.l || cce === 0 || !(npflen > 0)) ? [] : parse_NameParsedFormula(blob, npflen, opts, cce);\n\t/*jshint +W018 */\n\treturn {\n\t\tchKey: chKey,\n\t\tName: name,\n\t\titab: itab,\n\t\trgce: rgce\n\t};\n}\n\n/* [MS-XLS] 2.4.106 TODO: legacy record filename encoding */\nfunction parse_ExternSheet(blob, length, opts) {\n\tif(opts.biff < 8) return parse_BIFF5ExternSheet(blob, length, opts);\n\t/* see issue 2907 */\n\tif(!(opts.biff > 8) && (length == blob[blob.l] + (blob[blob.l+1] == 0x03 ? 1 : 0) + 1)) return parse_BIFF5ExternSheet(blob, length, opts);\n\tvar o = [], target = blob.l + length, len = blob.read_shift(opts.biff > 8 ? 4 : 2);\n\twhile(len-- !== 0) o.push(parse_XTI(blob, opts.biff > 8 ? 12 : 6, opts));\n\t\t// [iSupBook, itabFirst, itabLast];\n\tif(blob.l != target) throw new Error(\"Bad ExternSheet: \" + blob.l + \" != \" + target);\n\treturn o;\n}\nfunction parse_BIFF5ExternSheet(blob, length, opts) {\n\tif(blob[blob.l + 1] == 0x03) blob[blob.l]++;\n\tvar o = parse_ShortXLUnicodeString(blob, length, opts);\n\treturn o.charCodeAt(0) == 0x03 ? o.slice(1) : o;\n}\n\n/* [MS-XLS] 2.4.176 TODO: check older biff */\nfunction parse_NameCmt(blob, length, opts) {\n\tif(opts.biff < 8) { blob.l += length; return; }\n\tvar cchName = blob.read_shift(2);\n\tvar cchComment = blob.read_shift(2);\n\tvar name = parse_XLUnicodeStringNoCch(blob, cchName, opts);\n\tvar comment = parse_XLUnicodeStringNoCch(blob, cchComment, opts);\n\treturn [name, comment];\n}\n\n/* [MS-XLS] 2.4.260 */\nfunction parse_ShrFmla(blob, length, opts) {\n\tvar ref = parse_RefU(blob, 6);\n\tblob.l++;\n\tvar cUse = blob.read_shift(1);\n\tlength -= 8;\n\treturn [parse_SharedParsedFormula(blob, length, opts), cUse, ref];\n}\n\n/* [MS-XLS] 2.4.4 TODO */\nfunction parse_Array(blob, length, opts) {\n\tvar ref = parse_Ref(blob, 6);\n\t/* TODO: fAlwaysCalc */\n\tswitch(opts.biff) {\n\t\tcase 2: blob.l ++; length -= 7; break;\n\t\tcase 3: case 4: blob.l += 2; length -= 8; break;\n\t\tdefault: blob.l += 6; length -= 12;\n\t}\n\treturn [ref, parse_ArrayParsedFormula(blob, length, opts, ref)];\n}\n\n/* [MS-XLS] 2.4.173 */\nfunction parse_MTRSettings(blob) {\n\tvar fMTREnabled = blob.read_shift(4) !== 0x00;\n\tvar fUserSetThreadCount = blob.read_shift(4) !== 0x00;\n\tvar cUserThreadCount = blob.read_shift(4);\n\treturn [fMTREnabled, fUserSetThreadCount, cUserThreadCount];\n}\n\n/* [MS-XLS] 2.5.186 */\nfunction parse_NoteSh(blob, length, opts) {\n\tvar row = blob.read_shift(2), col = blob.read_shift(2);\n\tvar flags = blob.read_shift(2), idObj = blob.read_shift(2);\n\tvar stAuthor = parse_XLUnicodeString2(blob, 0, opts);\n\treturn [{r:row,c:col}, stAuthor, idObj, flags];\n}\n\n/* [MS-XLS] 2.4.179 */\nfunction parse_Note(blob, length, opts) {\n\tif(opts && (opts.biff < 8)) {\n\t\tvar row = blob.read_shift(2), col = blob.read_shift(2);\n\t\tif(row == 0xFFFF || row == -1) return; // TODO: test continuation\n\t\tvar cch = blob.read_shift(2);\n\t\tvar cmnt = blob.read_shift(Math.min(cch,2048), 'cpstr');\n\t\treturn [{r:row, c:col}, cmnt];\n\t}\n\t/* TODO: Support revisions */\n\treturn parse_NoteSh(blob, length, opts);\n}\nfunction write_NOTE_BIFF2(text/*:string*/, R/*:number*/, C/*:number*/, len/*?:number*/) {\n\tvar o = new_buf(6 + (len || text.length));\n\to.write_shift(2, R);\n\to.write_shift(2, C);\n\to.write_shift(2, len || text.length);\n\to.write_shift(text.length, text, \"sbcs\");\n\treturn o;\n}\n\n/* [MS-XLS] 2.4.168 */\nfunction parse_MergeCells(blob, length)/*:Array*/ {\n\tvar merges/*:Array*/ = [];\n\tvar cmcs = blob.read_shift(2);\n\twhile (cmcs--) merges.push(parse_Ref8U(blob,length));\n\treturn merges;\n}\nfunction write_MergeCells(merges/*:Array*/) {\n\tvar o = new_buf(2 + merges.length * 8);\n\to.write_shift(2, merges.length);\n\tfor(var i = 0; i < merges.length; ++i) write_Ref8U(merges[i], o);\n\treturn o;\n}\n\n/* [MS-XLS] 2.4.181 TODO: parse all the things! */\nfunction parse_Obj(blob, length, opts) {\n\tif(opts && opts.biff < 8) return parse_BIFF5Obj(blob, length, opts);\n\tvar cmo = parse_FtCmo(blob, 22); // id, ot, flags\n\tvar fts = parse_FtArray(blob, length-22, cmo[1]);\n\treturn { cmo: cmo, ft:fts };\n}\n/* from older spec */\nvar parse_BIFF5OT = {\n0x08: function(blob, length) {\n\tvar tgt = blob.l + length;\n\tblob.l += 10; // todo\n\tvar cf = blob.read_shift(2);\n\tblob.l += 4;\n\tblob.l += 2; //var cbPictFmla = blob.read_shift(2);\n\tblob.l += 2;\n\tblob.l += 2; //var grbit = blob.read_shift(2);\n\tblob.l += 4;\n\tvar cchName = blob.read_shift(1);\n\tblob.l += cchName; // TODO: stName\n\tblob.l = tgt; // TODO: fmla\n\treturn { fmt:cf };\n}\n};\n\nfunction parse_BIFF5Obj(blob, length, opts) {\n\tblob.l += 4; //var cnt = blob.read_shift(4);\n\tvar ot = blob.read_shift(2);\n\tvar id = blob.read_shift(2);\n\tvar grbit = blob.read_shift(2);\n\tblob.l += 2; //var colL = blob.read_shift(2);\n\tblob.l += 2; //var dxL = blob.read_shift(2);\n\tblob.l += 2; //var rwT = blob.read_shift(2);\n\tblob.l += 2; //var dyT = blob.read_shift(2);\n\tblob.l += 2; //var colR = blob.read_shift(2);\n\tblob.l += 2; //var dxR = blob.read_shift(2);\n\tblob.l += 2; //var rwB = blob.read_shift(2);\n\tblob.l += 2; //var dyB = blob.read_shift(2);\n\tblob.l += 2; //var cbMacro = blob.read_shift(2);\n\tblob.l += 6;\n\tlength -= 36;\n\tvar fts = [];\n\tfts.push((parse_BIFF5OT[ot]||parsenoop)(blob, length, opts));\n\treturn { cmo: [id, ot, grbit], ft:fts };\n}\n\n/* [MS-XLS] 2.4.329 TODO: parse properly */\nfunction parse_TxO(blob, length, opts) {\n\tvar s = blob.l;\n\tvar texts = \"\";\ntry {\n\tblob.l += 4;\n\tvar ot = (opts.lastobj||{cmo:[0,0]}).cmo[1];\n\tvar controlInfo; // eslint-disable-line no-unused-vars\n\tif([0,5,7,11,12,14].indexOf(ot) == -1) blob.l += 6;\n\telse controlInfo = parse_ControlInfo(blob, 6, opts); // eslint-disable-line no-unused-vars\n\tvar cchText = blob.read_shift(2);\n\t/*var cbRuns = */blob.read_shift(2);\n\t/*var ifntEmpty = */parseuint16(blob, 2);\n\tvar len = blob.read_shift(2);\n\tblob.l += len;\n\t//var fmla = parse_ObjFmla(blob, s + length - blob.l);\n\n\tfor(var i = 1; i < blob.lens.length-1; ++i) {\n\t\tif(blob.l-s != blob.lens[i]) throw new Error(\"TxO: bad continue record\");\n\t\tvar hdr = blob[blob.l];\n\t\tvar t = parse_XLUnicodeStringNoCch(blob, blob.lens[i+1]-blob.lens[i]-1);\n\t\ttexts += t;\n\t\tif(texts.length >= (hdr ? cchText : 2*cchText)) break;\n\t}\n\tif(texts.length !== cchText && texts.length !== cchText*2) {\n\t\tthrow new Error(\"cchText: \" + cchText + \" != \" + texts.length);\n\t}\n\n\tblob.l = s + length;\n\t/* [MS-XLS] 2.5.272 TxORuns */\n//\tvar rgTxoRuns = [];\n//\tfor(var j = 0; j != cbRuns/8-1; ++j) blob.l += 8;\n//\tvar cchText2 = blob.read_shift(2);\n//\tif(cchText2 !== cchText) throw new Error(\"TxOLastRun mismatch: \" + cchText2 + \" \" + cchText);\n//\tblob.l += 6;\n//\tif(s + length != blob.l) throw new Error(\"TxO \" + (s + length) + \", at \" + blob.l);\n\treturn { t: texts };\n} catch(e) { blob.l = s + length; return { t: texts }; }\n}\n\n/* [MS-XLS] 2.4.140 */\nfunction parse_HLink(blob, length) {\n\tvar ref = parse_Ref8U(blob, 8);\n\tblob.l += 16; /* CLSID */\n\tvar hlink = parse_Hyperlink(blob, length-24);\n\treturn [ref, hlink];\n}\nfunction write_HLink(hl) {\n\tvar O = new_buf(24);\n\tvar ref = decode_cell(hl[0]);\n\tO.write_shift(2, ref.r); O.write_shift(2, ref.r);\n\tO.write_shift(2, ref.c); O.write_shift(2, ref.c);\n\tvar clsid = \"d0 c9 ea 79 f9 ba ce 11 8c 82 00 aa 00 4b a9 0b\".split(\" \");\n\tfor(var i = 0; i < 16; ++i) O.write_shift(1, parseInt(clsid[i], 16));\n\treturn bconcat([O, write_Hyperlink(hl[1])]);\n}\n\n\n/* [MS-XLS] 2.4.141 */\nfunction parse_HLinkTooltip(blob, length) {\n\tblob.read_shift(2);\n\tvar ref = parse_Ref8U(blob, 8);\n\tvar wzTooltip = blob.read_shift((length-10)/2, 'dbcs-cont');\n\twzTooltip = wzTooltip.replace(chr0,\"\");\n\treturn [ref, wzTooltip];\n}\nfunction write_HLinkTooltip(hl) {\n\tvar TT = hl[1].Tooltip;\n\tvar O = new_buf(10 + 2 * (TT.length + 1));\n\tO.write_shift(2, 0x0800);\n\tvar ref = decode_cell(hl[0]);\n\tO.write_shift(2, ref.r); O.write_shift(2, ref.r);\n\tO.write_shift(2, ref.c); O.write_shift(2, ref.c);\n\tfor(var i = 0; i < TT.length; ++i) O.write_shift(2, TT.charCodeAt(i));\n\tO.write_shift(2, 0);\n\treturn O;\n}\n\n/* [MS-XLS] 2.4.63 */\nfunction parse_Country(blob)/*:[string|number, string|number]*/ {\n\tvar o = [0,0], d;\n\td = blob.read_shift(2); o[0] = CountryEnum[d] || d;\n\td = blob.read_shift(2); o[1] = CountryEnum[d] || d;\n\treturn o;\n}\nfunction write_Country(o) {\n\tif(!o) o = new_buf(4);\n\to.write_shift(2, 0x01);\n\to.write_shift(2, 0x01);\n\treturn o;\n}\n\n/* [MS-XLS] 2.4.50 ClrtClient */\nfunction parse_ClrtClient(blob) {\n\tvar ccv = blob.read_shift(2);\n\tvar o = [];\n\twhile(ccv-->0) o.push(parse_LongRGB(blob, 8));\n\treturn o;\n}\n\n/* [MS-XLS] 2.4.188 */\nfunction parse_Palette(blob) {\n\tvar ccv = blob.read_shift(2);\n\tvar o = [];\n\twhile(ccv-->0) o.push(parse_LongRGB(blob, 8));\n\treturn o;\n}\n\n/* [MS-XLS] 2.4.354 */\nfunction parse_XFCRC(blob) {\n\tblob.l += 2;\n\tvar o = {cxfs:0, crc:0};\n\to.cxfs = blob.read_shift(2);\n\to.crc = blob.read_shift(4);\n\treturn o;\n}\n\n/* [MS-XLS] 2.4.53 TODO: parse flags */\n/* [MS-XLSB] 2.4.323 TODO: parse flags */\nfunction parse_ColInfo(blob, length, opts) {\n\tif(!opts.cellStyles) return parsenoop(blob, length);\n\tvar w = opts && opts.biff >= 12 ? 4 : 2;\n\tvar colFirst = blob.read_shift(w);\n\tvar colLast = blob.read_shift(w);\n\tvar coldx = blob.read_shift(w);\n\tvar ixfe = blob.read_shift(w);\n\tvar flags = blob.read_shift(2);\n\tif(w == 2) blob.l += 2;\n\tvar o = ({s:colFirst, e:colLast, w:coldx, ixfe:ixfe, flags:flags}/*:any*/);\n\tif(opts.biff >= 5 || !opts.biff) o.level = (flags >> 8) & 0x7;\n\treturn o;\n}\nfunction write_ColInfo(col, idx) {\n\tvar o = new_buf(12);\n\to.write_shift(2, idx);\n\to.write_shift(2, idx);\n\to.write_shift(2, col.width * 256);\n\to.write_shift(2, 0);\n\tvar f = 0;\n\tif(col.hidden) f |= 1;\n\to.write_shift(1, f);\n\tf = col.level || 0;\n\to.write_shift(1, f);\n\to.write_shift(2, 0);\n\treturn o;\n}\n\n/* [MS-XLS] 2.4.257 */\nfunction parse_Setup(blob, length) {\n\tvar o = {};\n\tif(length < 32) return o;\n\tblob.l += 16;\n\to.header = parse_Xnum(blob, 8);\n\to.footer = parse_Xnum(blob, 8);\n\tblob.l += 2;\n\treturn o;\n}\n\n/* [MS-XLS] 2.4.261 */\nfunction parse_ShtProps(blob, length, opts) {\n\tvar def = {area:false};\n\tif(opts.biff != 5) { blob.l += length; return def; }\n\tvar d = blob.read_shift(1); blob.l += 3;\n\tif((d & 0x10)) def.area = true;\n\treturn def;\n}\n\n/* [MS-XLS] 2.4.241 */\nfunction write_RRTabId(n/*:number*/) {\n\tvar out = new_buf(2 * n);\n\tfor(var i = 0; i < n; ++i) out.write_shift(2, i+1);\n\treturn out;\n}\n\nvar parse_Blank = parse_XLSCell; /* [MS-XLS] 2.4.20 Just the cell */\nvar parse_Scl = parseuint16a; /* [MS-XLS] 2.4.247 num, den */\nvar parse_String = parse_XLUnicodeString; /* [MS-XLS] 2.4.268 */\n\n/* --- Specific to versions before BIFF8 --- */\nfunction parse_ImData(blob) {\n\tvar cf = blob.read_shift(2);\n\tvar env = blob.read_shift(2);\n\tvar lcb = blob.read_shift(4);\n\tvar o = {fmt:cf, env:env, len:lcb, data:blob.slice(blob.l,blob.l+lcb)};\n\tblob.l += lcb;\n\treturn o;\n}\n\nfunction write_BIFF2Cell(out, r/*:number*/, c/*:number*/, ixfe/*:number*/, ifmt/*:number*/) {\n\tif(!out) out = new_buf(7);\n\tout.write_shift(2, r);\n\tout.write_shift(2, c);\n\tout.write_shift(1, ixfe||0/* & 0x3F */);\n\tout.write_shift(1, ifmt||0/* & 0x3F */);\n\tout.write_shift(1, 0);\n\treturn out;\n}\n\n/* BIFF2_??? where ??? is the name from [XLS] */\nfunction parse_BIFF2STR(blob, length, opts) {\n\tif(opts.biffguess && opts.biff == 5) opts.biff = 2;\n\tvar cell = parse_XLSCell(blob, 7, opts);\n\tvar str = parse_XLUnicodeString2(blob, length-7, opts);\n\tcell.t = 'str';\n\tcell.val = str;\n\treturn cell;\n}\n\nfunction parse_BIFF2NUM(blob, length, opts) {\n\tvar cell = parse_XLSCell(blob, 7, opts);\n\tvar num = parse_Xnum(blob, 8);\n\tcell.t = 'n';\n\tcell.val = num;\n\treturn cell;\n}\nfunction write_BIFF2NUM(r/*:number*/, c/*:number*/, val/*:number*/, ixfe, ifmt) {\n\tvar out = new_buf(15);\n\twrite_BIFF2Cell(out, r, c, ixfe||0, ifmt||0);\n\tout.write_shift(8, val, 'f');\n\treturn out;\n}\n\nfunction parse_BIFF2INT(blob, length, opts) {\n\tvar cell = parse_XLSCell(blob, 7, opts);\n\tvar num = blob.read_shift(2);\n\tcell.t = 'n';\n\tcell.val = num;\n\treturn cell;\n}\nfunction write_BIFF2INT(r/*:number*/, c/*:number*/, val/*:number*/, ixfe/*:number*/, ifmt/*:number*/) {\n\tvar out = new_buf(9);\n\twrite_BIFF2Cell(out, r, c, ixfe||0, ifmt||0);\n\tout.write_shift(2, val);\n\treturn out;\n}\n\nfunction parse_BIFF2STRING(blob) {\n\tvar cch = blob.read_shift(1);\n\tif(cch === 0) { blob.l++; return \"\"; }\n\treturn blob.read_shift(cch, 'sbcs-cont');\n}\n\nfunction parse_BIFF2BOOLERR(blob, length, opts) {\n\tvar bestart = blob.l + 7;\n\tvar cell = parse_XLSCell(blob, 6, opts);\n\tblob.l = bestart;\n\tvar val = parse_Bes(blob, 2);\n\tcell.val = val;\n\tcell.t = (val === true || val === false) ? 'b' : 'e';\n\treturn cell;\n}\n\n/* TODO: convert to BIFF8 font struct */\nfunction parse_BIFF2FONTXTRA(blob, length) {\n\tblob.l += 6; // unknown\n\tblob.l += 2; // font weight \"bls\"\n\tblob.l += 1; // charset\n\tblob.l += 3; // unknown\n\tblob.l += 1; // font family\n\tblob.l += length - 13;\n}\n\n/* TODO: parse rich text runs */\nfunction parse_RString(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar cell = parse_XLSCell(blob, 6, opts);\n\tvar cch = blob.read_shift(2);\n\tvar str = parse_XLUnicodeStringNoCch(blob, cch, opts);\n\tblob.l = end;\n\tcell.t = 'str';\n\tcell.val = str;\n\treturn cell;\n}\n\nfunction parse_BIFF4SheetInfo(blob/*::, length, opts*/) {\n\tvar flags = blob.read_shift(4);\n\tvar cch = blob.read_shift(1), name = blob.read_shift(cch, \"sbcs\");\n\tif(name.length === 0) name = \"Sheet1\";\n\treturn { flags: flags, name:name };\n}var DBF_SUPPORTED_VERSIONS = [0x02, 0x03, 0x30, 0x31, 0x83, 0x8B, 0x8C, 0xF5];\nvar DBF = /*#__PURE__*/(function() {\nvar dbf_codepage_map = {\n\t/* Code Pages Supported by Visual FoxPro */\n\t0x01: 437, 0x02: 850,\n\t0x03: 1252, 0x04: 10000,\n\t0x64: 852, 0x65: 866,\n\t0x66: 865, 0x67: 861,\n\t0x68: 895, 0x69: 620,\n\t0x6A: 737, 0x6B: 857,\n\t0x78: 950, 0x79: 949,\n\t0x7A: 936, 0x7B: 932,\n\t0x7C: 874, 0x7D: 1255,\n\t0x7E: 1256, 0x96: 10007,\n\t0x97: 10029, 0x98: 10006,\n\t0xC8: 1250, 0xC9: 1251,\n\t0xCA: 1254, 0xCB: 1253,\n\n\t/* shapefile DBF extension */\n\t0x00: 20127, 0x08: 865,\n\t0x09: 437, 0x0A: 850,\n\t0x0B: 437, 0x0D: 437,\n\t0x0E: 850, 0x0F: 437,\n\t0x10: 850, 0x11: 437,\n\t0x12: 850, 0x13: 932,\n\t0x14: 850, 0x15: 437,\n\t0x16: 850, 0x17: 865,\n\t0x18: 437, 0x19: 437,\n\t0x1A: 850, 0x1B: 437,\n\t0x1C: 863, 0x1D: 850,\n\t0x1F: 852, 0x22: 852,\n\t0x23: 852, 0x24: 860,\n\t0x25: 850, 0x26: 866,\n\t0x37: 850, 0x40: 852,\n\t0x4D: 936, 0x4E: 949,\n\t0x4F: 950, 0x50: 874,\n\t0x57: 1252, 0x58: 1252,\n\t0x59: 1252, 0x6C: 863,\n\t0x86: 737, 0x87: 852,\n\t0x88: 857, 0xCC: 1257,\n\n\t0xFF: 16969\n};\nvar dbf_reverse_map = evert({\n\t0x01: 437, 0x02: 850,\n\t0x03: 1252, 0x04: 10000,\n\t0x64: 852, 0x65: 866,\n\t0x66: 865, 0x67: 861,\n\t0x68: 895, 0x69: 620,\n\t0x6A: 737, 0x6B: 857,\n\t0x78: 950, 0x79: 949,\n\t0x7A: 936, 0x7B: 932,\n\t0x7C: 874, 0x7D: 1255,\n\t0x7E: 1256, 0x96: 10007,\n\t0x97: 10029, 0x98: 10006,\n\t0xC8: 1250, 0xC9: 1251,\n\t0xCA: 1254, 0xCB: 1253,\n\t0x00: 20127\n});\n/* TODO: find an actual specification */\nfunction dbf_to_aoa(buf, opts)/*:AOA*/ {\n\tvar out/*:AOA*/ = [];\n\tvar d/*:Block*/ = (new_raw_buf(1)/*:any*/);\n\tswitch(opts.type) {\n\t\tcase 'base64': d = s2a(Base64_decode(buf)); break;\n\t\tcase 'binary': d = s2a(buf); break;\n\t\tcase 'buffer':\n\t\tcase 'array': d = buf; break;\n\t}\n\tprep_blob(d, 0);\n\n\t/* header */\n\tvar ft = d.read_shift(1);\n\tvar memo = !!(ft & 0x88);\n\tvar vfp = false, l7 = false;\n\tswitch(ft) {\n\t\tcase 0x02: break; // dBASE II\n\t\tcase 0x03: break; // dBASE III\n\t\tcase 0x30: vfp = true; memo = true; break; // VFP\n\t\tcase 0x31: vfp = true; memo = true; break; // VFP with autoincrement\n\t\t// 0x43 dBASE IV SQL table files\n\t\t// 0x63 dBASE IV SQL system files\n\t\tcase 0x83: break; // dBASE III with memo\n\t\tcase 0x8B: break; // dBASE IV with memo\n\t\tcase 0x8C: l7 = true; break; // dBASE Level 7 with memo\n\t\t// case 0xCB dBASE IV SQL table files with memo\n\t\tcase 0xF5: break; // FoxPro 2.x with memo\n\t\t// case 0xFB FoxBASE\n\t\tdefault: throw new Error(\"DBF Unsupported Version: \" + ft.toString(16));\n\t}\n\n\tvar nrow = 0, fpos = 0x0209;\n\tif(ft == 0x02) nrow = d.read_shift(2);\n\td.l += 3; // dBASE II stores DDMMYY date, others use YYMMDD\n\tif(ft != 0x02) nrow = d.read_shift(4);\n\tif(nrow > 1048576) nrow = 1e6;\n\n\tif(ft != 0x02) fpos = d.read_shift(2); // header length\n\tvar rlen = d.read_shift(2); // record length\n\n\tvar /*flags = 0,*/ current_cp = opts.codepage || 1252;\n\tif(ft != 0x02) { // 20 reserved bytes\n\t\td.l+=16;\n\t\t/*flags = */d.read_shift(1);\n\t\t//if(memo && ((flags & 0x02) === 0)) throw new Error(\"DBF Flags \" + flags.toString(16) + \" ft \" + ft.toString(16));\n\n\t\t/* codepage present in FoxPro and dBASE Level 7 */\n\t\tif(d[d.l] !== 0) current_cp = dbf_codepage_map[d[d.l]];\n\t\td.l+=1;\n\n\t\td.l+=2;\n\t}\n\tif(l7) d.l += 36; // Level 7: 32 byte \"Language driver name\", 4 byte reserved\n\n/*:: type DBFField = { name:string; len:number; type:string; } */\n\tvar fields/*:Array*/ = [], field/*:DBFField*/ = ({}/*:any*/);\n\tvar hend = Math.min(d.length, (ft == 0x02 ? 0x209 : (fpos - 10 - (vfp ? 264 : 0))));\n\tvar ww = l7 ? 32 : 11;\n\twhile(d.l < hend && d[d.l] != 0x0d) {\n\t\tfield = ({}/*:any*/);\n\t\tfield.name = (typeof $cptable !== \"undefined\" ? $cptable.utils.decode(current_cp, d.slice(d.l, d.l+ww)) : a2s(d.slice(d.l, d.l + ww))).replace(/[\\u0000\\r\\n][\\S\\s]*$/g,\"\");\n\t\td.l += ww;\n\t\tfield.type = String.fromCharCode(d.read_shift(1));\n\t\tif(ft != 0x02 && !l7) field.offset = d.read_shift(4);\n\t\tfield.len = d.read_shift(1);\n\t\tif(ft == 0x02) field.offset = d.read_shift(2);\n\t\tfield.dec = d.read_shift(1);\n\t\tif(field.name.length) fields.push(field);\n\t\tif(ft != 0x02) d.l += l7 ? 13 : 14;\n\t\tswitch(field.type) {\n\t\t\tcase 'B': // Double (VFP) / Binary (dBASE L7)\n\t\t\t\tif((!vfp || field.len != 8) && opts.WTF) console.log('Skipping ' + field.name + ':' + field.type);\n\t\t\t\tbreak;\n\t\t\tcase 'G': // General (FoxPro and dBASE L7)\n\t\t\tcase 'P': // Picture (FoxPro and dBASE L7)\n\t\t\t\tif(opts.WTF) console.log('Skipping ' + field.name + ':' + field.type);\n\t\t\t\tbreak;\n\t\t\tcase '+': // Autoincrement (dBASE L7 only)\n\t\t\tcase '0': // _NullFlags (VFP only)\n\t\t\tcase '@': // Timestamp (dBASE L7 only)\n\t\t\tcase 'C': // Character (dBASE II)\n\t\t\tcase 'D': // Date (dBASE III)\n\t\t\tcase 'F': // Float (dBASE IV)\n\t\t\tcase 'I': // Long (VFP and dBASE L7)\n\t\t\tcase 'L': // Logical (dBASE II)\n\t\t\tcase 'M': // Memo (dBASE III)\n\t\t\tcase 'N': // Number (dBASE II)\n\t\t\tcase 'O': // Double (dBASE L7 only)\n\t\t\tcase 'T': // Datetime (VFP only)\n\t\t\tcase 'Y': // Currency (VFP only)\n\t\t\t\tbreak;\n\t\t\tdefault: throw new Error('Unknown Field Type: ' + field.type);\n\t\t}\n\t}\n\n\tif(d[d.l] !== 0x0D) d.l = fpos-1;\n\tif(d.read_shift(1) !== 0x0D) throw new Error(\"DBF Terminator not found \" + d.l + \" \" + d[d.l]);\n\td.l = fpos;\n\n\t/* data */\n\tvar R = 0, C = 0;\n\tout[0] = [];\n\tfor(C = 0; C != fields.length; ++C) out[0][C] = fields[C].name;\n\twhile(nrow-- > 0) {\n\t\tif(d[d.l] === 0x2A) {\n\t\t\t// TODO: record marked as deleted -- create a hidden row?\n\t\t\td.l+=rlen;\n\t\t\tcontinue;\n\t\t}\n\t\t++d.l;\n\t\tout[++R] = []; C = 0;\n\t\tfor(C = 0; C != fields.length; ++C) {\n\t\t\tvar dd = d.slice(d.l, d.l+fields[C].len); d.l+=fields[C].len;\n\t\t\tprep_blob(dd, 0);\n\t\t\tvar s = typeof $cptable !== \"undefined\" ? $cptable.utils.decode(current_cp, dd) : a2s(dd);\n\t\t\tswitch(fields[C].type) {\n\t\t\t\tcase 'C':\n\t\t\t\t\t// NOTE: it is conventional to write ' / / ' for empty dates\n\t\t\t\t\tif(s.trim().length) out[R][C] = s.replace(/([^\\s])\\s+$/,\"$1\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'D':\n\t\t\t\t\tif(s.length === 8) {\n\t\t\t\t\t\tout[R][C] = new Date(Date.UTC(+s.slice(0,4), +s.slice(4,6)-1, +s.slice(6,8), 0, 0, 0, 0));\n\t\t\t\t\t\tif(!(opts && opts.UTC)) { out[R][C] = utc_to_local(out[R][C]); }\n\t\t\t\t\t}\n\t\t\t\t\telse out[R][C] = s;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'F': out[R][C] = parseFloat(s.trim()); break;\n\t\t\t\tcase '+': case 'I': out[R][C] = l7 ? dd.read_shift(-4, 'i') ^ 0x80000000 : dd.read_shift(4, 'i'); break;\n\t\t\t\tcase 'L': switch(s.trim().toUpperCase()) {\n\t\t\t\t\tcase 'Y': case 'T': out[R][C] = true; break;\n\t\t\t\t\tcase 'N': case 'F': out[R][C] = false; break;\n\t\t\t\t\tcase '': case '\\x00': case '?': break;\n\t\t\t\t\tdefault: throw new Error(\"DBF Unrecognized L:|\" + s + \"|\");\n\t\t\t\t\t} break;\n\t\t\t\tcase 'M': /* TODO: handle memo files */\n\t\t\t\t\tif(!memo) throw new Error(\"DBF Unexpected MEMO for type \" + ft.toString(16));\n\t\t\t\t\tout[R][C] = \"##MEMO##\" + (l7 ? parseInt(s.trim(), 10): dd.read_shift(4));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'N':\n\t\t\t\t\ts = s.replace(/\\u0000/g,\"\").trim();\n\t\t\t\t\t// NOTE: dBASE II interprets \" . \" as 0\n\t\t\t\t\tif(s && s != \".\") out[R][C] = +s || 0; break;\n\t\t\t\tcase '@':\n\t\t\t\t\t// NOTE: dBASE specs appear to be incorrect\n\t\t\t\t\tout[R][C] = new Date(dd.read_shift(-8, 'f') - 0x388317533400);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'T': {\n\t\t\t\t\tvar hi = dd.read_shift(4), lo = dd.read_shift(4);\n\t\t\t\t\tif(hi == 0 && lo == 0) break;\n\t\t\t\t\tout[R][C] = new Date((hi - 0x253D8C) * 0x5265C00 + lo);\n\t\t\t\t\tif(!(opts && opts.UTC)) out[R][C] = utc_to_local(out[R][C]);\n\t\t\t\t} break;\n\t\t\t\tcase 'Y': out[R][C] = dd.read_shift(4,'i')/1e4 + (dd.read_shift(4, 'i')/1e4)*Math.pow(2,32); break;\n\t\t\t\tcase 'O': out[R][C] = -dd.read_shift(-8, 'f'); break;\n\t\t\t\tcase 'B': if(vfp && fields[C].len == 8) { out[R][C] = dd.read_shift(8,'f'); break; }\n\t\t\t\t\t/* falls through */\n\t\t\t\tcase 'G': case 'P': dd.l += fields[C].len; break;\n\t\t\t\tcase '0':\n\t\t\t\t\tif(fields[C].name === '_NullFlags') break;\n\t\t\t\t\t/* falls through */\n\t\t\t\tdefault: throw new Error(\"DBF Unsupported data type \" + fields[C].type);\n\t\t\t}\n\t\t}\n\t}\n\tif(ft != 0x02) if(d.l < d.length && d[d.l++] != 0x1A) throw new Error(\"DBF EOF Marker missing \" + (d.l-1) + \" of \" + d.length + \" \" + d[d.l-1].toString(16));\n\tif(opts && opts.sheetRows) out = out.slice(0, opts.sheetRows);\n\topts.DBF = fields;\n\treturn out;\n}\n\nfunction dbf_to_sheet(buf, opts)/*:Worksheet*/ {\n\tvar o = opts || {};\n\tif(!o.dateNF) o.dateNF = \"yyyymmdd\";\n\tvar ws = aoa_to_sheet(dbf_to_aoa(buf, o), o);\n\tws[\"!cols\"] = o.DBF.map(function(field) { return {\n\t\twch: field.len,\n\t\tDBF: field\n\t};});\n\tdelete o.DBF;\n\treturn ws;\n}\n\nfunction dbf_to_workbook(buf, opts)/*:Workbook*/ {\n\ttry {\n\t\tvar o = sheet_to_workbook(dbf_to_sheet(buf, opts), opts);\n\t\to.bookType = \"dbf\";\n\t\treturn o;\n\t} catch(e) { if(opts && opts.WTF) throw e; }\n\treturn ({SheetNames:[],Sheets:{}});\n}\n\nvar _RLEN = { 'B': 8, 'C': 250, 'L': 1, 'D': 8, '?': 0, '': 0 };\nfunction sheet_to_dbf(ws/*:Worksheet*/, opts/*:WriteOpts*/) {\n\tif(!ws[\"!ref\"]) throw new Error(\"Cannot export empty sheet to DBF\");\n\tvar o = opts || {};\n\tvar old_cp = current_codepage;\n\tif(+o.codepage >= 0) set_cp(+o.codepage);\n\tif(o.type == \"string\") throw new Error(\"Cannot write DBF to JS string\");\n\tvar ba = buf_array();\n\tvar aoa/*:AOA*/ = sheet_to_json(ws, {header:1, raw:true, cellDates:true});\n\tvar headers = aoa[0], data = aoa.slice(1), cols = ws[\"!cols\"] || [];\n\tvar i = 0, j = 0, hcnt = 0, rlen = 1;\n\tfor(i = 0; i < headers.length; ++i) {\n\t\tif(((cols[i]||{}).DBF||{}).name) { headers[i] = cols[i].DBF.name; ++hcnt; continue; }\n\t\tif(headers[i] == null) continue;\n\t\t++hcnt;\n\t\tif(typeof headers[i] === 'number') headers[i] = headers[i].toString(10);\n\t\tif(typeof headers[i] !== 'string') throw new Error(\"DBF Invalid column name \" + headers[i] + \" |\" + (typeof headers[i]) + \"|\");\n\t\tif(headers.indexOf(headers[i]) !== i) for(j=0; j<1024;++j)\n\t\t\tif(headers.indexOf(headers[i] + \"_\" + j) == -1) { headers[i] += \"_\" + j; break; }\n\t}\n\tvar range = safe_decode_range(ws['!ref']);\n\tvar coltypes/*:Array*/ = [];\n\tvar colwidths/*:Array*/ = [];\n\tvar coldecimals/*:Array*/ = [];\n\tfor(i = 0; i <= range.e.c - range.s.c; ++i) {\n\t\tvar guess = '', _guess = '', maxlen = 0;\n\t\tvar col/*:Array*/ = [];\n\t\tfor(j=0; j < data.length; ++j) {\n\t\t\tif(data[j][i] != null) col.push(data[j][i]);\n\t\t}\n\t\tif(col.length == 0 || headers[i] == null) { coltypes[i] = '?'; continue; }\n\t\tfor(j = 0; j < col.length; ++j) {\n\t\t\tswitch(typeof col[j]) {\n\t\t\t\t/* TODO: check if L2 compat is desired */\n\t\t\t\tcase 'number': _guess = 'B'; break;\n\t\t\t\tcase 'string': _guess = 'C'; break;\n\t\t\t\tcase 'boolean': _guess = 'L'; break;\n\t\t\t\tcase 'object': _guess = col[j] instanceof Date ? 'D' : 'C'; break;\n\t\t\t\tdefault: _guess = 'C';\n\t\t\t}\n\t\t\t/* TODO: cache the values instead of encoding twice */\n\t\t\tmaxlen = Math.max(maxlen, (typeof $cptable !== \"undefined\" && typeof col[j] == \"string\" ? $cptable.utils.encode(current_ansi, col[j]): String(col[j])).length);\n\t\t\tguess = guess && guess != _guess ? 'C' : _guess;\n\t\t\t//if(guess == 'C') break;\n\t\t}\n\t\tif(maxlen > 250) maxlen = 250;\n\t\t_guess = ((cols[i]||{}).DBF||{}).type;\n\t\t/* TODO: more fine grained control over DBF type resolution */\n\t\tif(_guess == 'C') {\n\t\t\tif(cols[i].DBF.len > maxlen) maxlen = cols[i].DBF.len;\n\t\t}\n\t\tif(guess == 'B' && _guess == 'N') {\n\t\t\tguess = 'N';\n\t\t\tcoldecimals[i] = cols[i].DBF.dec;\n\t\t\tmaxlen = cols[i].DBF.len;\n\t\t}\n\t\tcolwidths[i] = guess == 'C' || _guess == 'N' ? maxlen : (_RLEN[guess] || 0);\n\t\trlen += colwidths[i];\n\t\tcoltypes[i] = guess;\n\t}\n\n\tvar h = ba.next(32);\n\th.write_shift(4, 0x13021130);\n\th.write_shift(4, data.length);\n\th.write_shift(2, 296 + 32 * hcnt);\n\th.write_shift(2, rlen);\n\tfor(i=0; i < 4; ++i) h.write_shift(4, 0);\n\tvar cp = +dbf_reverse_map[/*::String(*/current_codepage/*::)*/] || 0x03;\n\th.write_shift(4, 0x00000000 | (cp<<8));\n\tif(dbf_codepage_map[cp] != +o.codepage) {\n\t\tif(o.codepage) console.error(\"DBF Unsupported codepage \" + current_codepage + \", using 1252\");\n\t\tcurrent_codepage = 1252;\n\t}\n\n\tfor(i = 0, j = 0; i < headers.length; ++i) {\n\t\tif(headers[i] == null) continue;\n\t\tvar hf = ba.next(32);\n\t\t/* TODO: test how applications handle non-ASCII field names */\n\t\tvar _f = (headers[i].slice(-10) + \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\").slice(0, 11);\n\t\thf.write_shift(1, _f, \"sbcs\");\n\t\thf.write_shift(1, coltypes[i] == '?' ? 'C' : coltypes[i], \"sbcs\");\n\t\thf.write_shift(4, j);\n\t\thf.write_shift(1, colwidths[i] || _RLEN[coltypes[i]] || 0);\n\t\thf.write_shift(1, coldecimals[i] || 0);\n\t\thf.write_shift(1, 0x02);\n\t\thf.write_shift(4, 0);\n\t\thf.write_shift(1, 0);\n\t\thf.write_shift(4, 0);\n\t\thf.write_shift(4, 0);\n\t\tj += (colwidths[i] || _RLEN[coltypes[i]] || 0);\n\t}\n\n\tvar hb = ba.next(264);\n\thb.write_shift(4, 0x0000000D);\n\tfor(i=0; i < 65;++i) hb.write_shift(4, 0x00000000);\n\tfor(i=0; i < data.length; ++i) {\n\t\tvar rout = ba.next(rlen);\n\t\trout.write_shift(1, 0);\n\t\tfor(j=0; j colwidths[j]) _n = _n.slice(0, colwidths[j]); // addresses decimal > width\n\t\t\t\t\tfor(hcnt=0; hcnt < colwidths[j]-_n.length; ++hcnt) rout.write_shift(1, 0x20);\n\t\t\t\t\trout.write_shift(1, _n, \"sbcs\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'D':\n\t\t\t\t\tif(!data[i][j]) rout.write_shift(8, \"00000000\", \"sbcs\");\n\t\t\t\t\telse {\n\t\t\t\t\t\trout.write_shift(4, (\"0000\"+data[i][j].getFullYear()).slice(-4), \"sbcs\");\n\t\t\t\t\t\trout.write_shift(2, (\"00\"+(data[i][j].getMonth()+1)).slice(-2), \"sbcs\");\n\t\t\t\t\t\trout.write_shift(2, (\"00\"+data[i][j].getDate()).slice(-2), \"sbcs\");\n\t\t\t\t\t} break;\n\t\t\t\tcase 'C':\n\t\t\t\t\tvar _l = rout.l;\n\t\t\t\t\tvar _s = String(data[i][j] != null ? data[i][j] : \"\").slice(0, colwidths[j]);\n\t\t\t\t\trout.write_shift(1, _s, \"cpstr\");\n\t\t\t\t\t_l += colwidths[j] - rout.l;\n\t\t\t\t\tfor(hcnt=0; hcnt < _l; ++hcnt) rout.write_shift(1, 0x20); break;\n\t\t\t}\n\t\t}\n\t\t// data\n\t}\n\tcurrent_codepage = old_cp;\n\tba.next(1).write_shift(1, 0x1A);\n\treturn ba.end();\n}\n\treturn {\n\t\tto_workbook: dbf_to_workbook,\n\t\tto_sheet: dbf_to_sheet,\n\t\tfrom_sheet: sheet_to_dbf\n\t};\n})();\n\nvar SYLK = /*#__PURE__*/(function() {\n\t/* TODO: stress test sequences */\n\tvar sylk_escapes = ({\n\t\tAA:'À', BA:'Á', CA:'Â', DA:195, HA:'Ä', JA:197,\n\t\tAE:'È', BE:'É', CE:'Ê', HE:'Ë',\n\t\tAI:'Ì', BI:'Í', CI:'Î', HI:'Ï',\n\t\tAO:'Ò', BO:'Ó', CO:'Ô', DO:213, HO:'Ö',\n\t\tAU:'Ù', BU:'Ú', CU:'Û', HU:'Ü',\n\t\tAa:'à', Ba:'á', Ca:'â', Da:227, Ha:'ä', Ja:229,\n\t\tAe:'è', Be:'é', Ce:'ê', He:'ë',\n\t\tAi:'ì', Bi:'í', Ci:'î', Hi:'ï',\n\t\tAo:'ò', Bo:'ó', Co:'ô', Do:245, Ho:'ö',\n\t\tAu:'ù', Bu:'ú', Cu:'û', Hu:'ü',\n\t\tKC:'Ç', Kc:'ç', q:'æ', z:'œ', a:'Æ', j:'Œ',\n\t\tDN:209, Dn:241, Hy:255,\n\t\tS:169, c:170, R:174, \"B \":180,\n\t\t0:176, 1:177, 2:178,\n\t\t3:179, 5:181, 6:182,\n\t\t7:183, Q:185, k:186, b:208, i:216, l:222, s:240, y:248,\n\t\t\"!\":161, '\"':162, \"#\":163, \"(\":164, \"%\":165, \"'\":167, \"H \":168,\n\t\t\"+\":171, \";\":187, \"<\":188, \"=\":189, \">\":190, \"?\":191, \"{\":223\n\t}/*:any*/);\n\tvar sylk_char_regex = new RegExp(\"\\u001BN(\" + keys(sylk_escapes).join(\"|\").replace(/\\|\\|\\|/, \"|\\\\||\").replace(/([?()+])/g,\"\\\\$1\").replace(\"{\", \"\\\\{\") + \"|\\\\|)\", \"gm\");\n\ttry {\n\t\tsylk_char_regex = new RegExp(\"\\u001BN(\" + keys(sylk_escapes).join(\"|\").replace(/\\|\\|\\|/, \"|\\\\||\").replace(/([?()+])/g,\"\\\\$1\") + \"|\\\\|)\", \"gm\");\n\t} catch(e) {}\n\tvar sylk_char_fn = function(_, $1){ var o = sylk_escapes[$1]; return typeof o == \"number\" ? _getansi(o) : o; };\n\tvar decode_sylk_char = function($$, $1, $2) { var newcc = (($1.charCodeAt(0) - 0x20)<<4) | ($2.charCodeAt(0) - 0x30); return newcc == 59 ? $$ : _getansi(newcc); };\n\tsylk_escapes[\"|\"] = 254;\n\t/* TODO: evert the escape map */\n\tvar encode_sylk_str = function($$) { return $$.replace(/\\n/g, \"\\x1b :\").replace(/\\r/g, \"\\x1b =\"); };\n\t/* https://oss.sheetjs.com/notes/sylk/ for more details */\n\tfunction sylk_to_aoa(d/*:RawData*/, opts)/*:[AOA, Worksheet]*/ {\n\t\tswitch(opts.type) {\n\t\t\tcase 'base64': return sylk_to_aoa_str(Base64_decode(d), opts);\n\t\t\tcase 'binary': return sylk_to_aoa_str(d, opts);\n\t\t\tcase 'buffer': return sylk_to_aoa_str(has_buf && Buffer.isBuffer(d) ? d.toString('binary') : a2s(d), opts);\n\t\t\tcase 'array': return sylk_to_aoa_str(cc2str(d), opts);\n\t\t}\n\t\tthrow new Error(\"Unrecognized type \" + opts.type);\n\t}\n\tfunction sylk_to_aoa_str(str/*:string*/, opts)/*:[AOA, Worksheet]*/ {\n\t\tvar records = str.split(/[\\n\\r]+/), R = -1, C = -1, ri = 0, rj = 0, arr/*:AOA*/ = [];\n\t\tvar formats/*:Array*/ = [];\n\t\tvar next_cell_format/*:string|null*/ = null;\n\t\tvar sht = {}, rowinfo/*:Array*/ = [], colinfo/*:Array*/ = [], cw/*:Array*/ = [];\n\t\tvar Mval = 0, j;\n\t\tvar wb = { Workbook: { WBProps: {}, Names: [] } };\n\t\tif(+opts.codepage >= 0) set_cp(+opts.codepage);\n\t\tfor (; ri !== records.length; ++ri) {\n\t\t\tMval = 0;\n\t\t\tvar rstr=records[ri].trim().replace(/\\x1B([\\x20-\\x2F])([\\x30-\\x3F])/g, decode_sylk_char).replace(sylk_char_regex, sylk_char_fn);\n\t\t\tvar record=rstr.replace(/;;/g, \"\\u0000\").split(\";\").map(function(x) { return x.replace(/\\u0000/g, \";\"); });\n\t\t\tvar RT=record[0], val;\n\t\t\tif(rstr.length > 0) switch(RT) {\n\t\t\tcase 'ID': break; /* header */\n\t\t\tcase 'E': break; /* EOF */\n\t\t\tcase 'B': break; /* dimensions */\n\t\t\tcase 'O': /* workbook options */\n\t\t\tfor(rj=1; rj= 5 or < 0\n\t\t\t\t\tif(d1904 >= 1 && d1904 <= 4) wb.Workbook.WBProps.date1904 = true;\n\t\t\t\t} break;\n\t\t\t} break;\n\t\t\tcase 'W': break; /* window */\n\t\t\tcase 'P':\n\t\t\t\tswitch(record[1].charAt(0)){\n\t\t\t\t\tcase 'P': formats.push(rstr.slice(3).replace(/;;/g, \";\")); break;\n\t\t\t\t} break;\n\t\t\tcase 'NN': { /* defined name */\n\t\t\t\tvar nn = {Sheet: 0};\n\t\t\t\tfor(rj=1; rj -1 && arr[_R][_C];\n\t\t\t\tif(!shrbase || !shrbase[1]) throw new Error(\"SYLK shared formula cannot find base\");\n\t\t\t\tformula = shift_formula_str(shrbase[1], {r: R - _R, c: C - _C});\n\t\t\t}\n\t\t\tif(formula) {\n\t\t\t\tif(!arr[R][C]) arr[R][C] = { t: 'n', f: formula };\n\t\t\t\telse arr[R][C].f = formula;\n\t\t\t}\n\t\t\tif(cmnt) {\n\t\t\t\tif(!arr[R][C]) arr[R][C] = { t: 'z' };\n\t\t\t\tarr[R][C].c = [{a:\"SheetJSYLK\", t: cmnt}];\n\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 'F': /* Format */\n\t\t\tvar F_seen = 0;\n\t\t\tfor(rj=1; rj 0) { rowinfo[R].hpt = Mval; rowinfo[R].hpx = pt2px(Mval); }\n\t\t\t\t\telse if(Mval === 0) rowinfo[R].hidden = true;\n\t\t\t\t\tbreak;\n\t\t\t\t// case 'K': // ??\n\t\t\t\t// case 'E': // ??\n\t\t\t\tdefault: if(opts && opts.WTF) throw new Error(\"SYLK bad record \" + rstr);\n\t\t\t}\n\t\t\tif(F_seen < 1) next_cell_format = null; break;\n\t\t\tdefault: if(opts && opts.WTF) throw new Error(\"SYLK bad record \" + rstr);\n\t\t\t}\n\t\t}\n\t\tif(rowinfo.length > 0) sht['!rows'] = rowinfo;\n\t\tif(colinfo.length > 0) sht['!cols'] = colinfo;\n\t\tcolinfo.forEach(function(col) { process_col(col); });\n\t\tif(opts && opts.sheetRows) arr = arr.slice(0, opts.sheetRows);\n\t\treturn [arr, sht, wb];\n\t}\n\n\tfunction sylk_to_workbook(d/*:RawData*/, opts)/*:Workbook*/ {\n\t\tvar aoasht = sylk_to_aoa(d, opts);\n\t\tvar aoa = aoasht[0], ws = aoasht[1], wb = aoasht[2];\n\t\tvar _opts = dup(opts); _opts.date1904 = (((wb||{}).Workbook || {}).WBProps || {}).date1904;\n\t\tvar o = aoa_to_sheet(aoa, _opts);\n\t\tkeys(ws).forEach(function(k) { o[k] = ws[k]; });\n\t\tvar outwb = sheet_to_workbook(o, opts);\n\t\tkeys(wb).forEach(function(k) { outwb[k] = wb[k]; });\n\t\toutwb.bookType = \"sylk\";\n\t\treturn outwb;\n\t}\n\n\tfunction write_ws_cell_sylk(cell/*:Cell*/, ws/*:Worksheet*/, R/*:number*/, C/*:number*/, opts, date1904/*:boolean*/)/*:string*/ {\n\t\tvar o = \"C;Y\" + (R+1) + \";X\" + (C+1) + \";K\";\n\t\tswitch(cell.t) {\n\t\t\tcase 'n':\n\t\t\t\to += isFinite(cell.v) ? (cell.v||0) : BErr[isNaN(cell.v) ? 0x24 : 0x07];\n\t\t\t\tif(cell.f && !cell.F) o += \";E\" + a1_to_rc(cell.f, {r:R, c:C}); break;\n\t\t\tcase 'b': o += cell.v ? \"TRUE\" : \"FALSE\"; break;\n\t\t\tcase 'e': o += cell.w || BErr[cell.v] || cell.v; break;\n\t\t\tcase 'd': o += datenum(parseDate(cell.v, date1904), date1904); break;\n\t\t\tcase 's': o += '\"' + (cell.v == null ? \"\" : String(cell.v)).replace(/\"/g,\"\").replace(/;/g, \";;\") + '\"'; break;\n\t\t}\n\t\treturn o;\n\t}\n\n\tfunction write_ws_cmnt_sylk(cmnt/*:Comment*/, R/*:number*/, C/*:number*/)/*:string*/ {\n\t\tvar o = \"C;Y\" + (R+1) + \";X\" + (C+1) + \";A\";\n\t\t/* TODO: max length? */\n\t\to += encode_sylk_str(cmnt.map(function(c) { return c.t; }).join(\"\"));\n\t\treturn o;\n\t}\n\n\tfunction write_ws_cols_sylk(out, cols) {\n\t\tcols.forEach(function(col, i) {\n\t\t\tvar rec = \"F;W\" + (i+1) + \" \" + (i+1) + \" \";\n\t\t\tif(col.hidden) rec += \"0\";\n\t\t\telse {\n\t\t\t\tif(typeof col.width == 'number' && !col.wpx) col.wpx = width2px(col.width);\n\t\t\t\tif(typeof col.wpx == 'number' && !col.wch) col.wch = px2char(col.wpx);\n\t\t\t\tif(typeof col.wch == 'number') rec += Math.round(col.wch);\n\t\t\t}\n\t\t\tif(rec.charAt(rec.length - 1) != \" \") out.push(rec);\n\t\t});\n\t}\n\n\tfunction write_ws_rows_sylk(out/*:Array*/, rows/*:Array*/) {\n\t\trows.forEach(function(row, i) {\n\t\t\tvar rec = \"F;\";\n\t\t\tif(row.hidden) rec += \"M0;\";\n\t\t\telse if(row.hpt) rec += \"M\" + 20 * row.hpt + \";\";\n\t\t\telse if(row.hpx) rec += \"M\" + 20 * px2pt(row.hpx) + \";\";\n\t\t\tif(rec.length > 2) out.push(rec + \"R\" + (i+1));\n\t\t});\n\t}\n\n\tfunction sheet_to_sylk(ws/*:Worksheet*/, opts/*:?any*/, wb/*:?WorkBook*/)/*:string*/ {\n\t\tif(!opts) opts = {}; opts._formats = [\"General\"];\n\t\t/* TODO: codepage */\n\t\tvar preamble/*:Array*/ = [\"ID;PSheetJS;N;E\"], o/*:Array*/ = [];\n\t\tvar r = safe_decode_range(ws['!ref']||\"A1\"), cell/*:Cell*/;\n\t\tvar dense = ws[\"!data\"] != null;\n\t\tvar RS = \"\\r\\n\";\n\t\tvar d1904 = (((wb||{}).Workbook||{}).WBProps||{}).date1904;\n\n\t\tvar _lastfmt = \"General\";\n\t\tpreamble.push(\"P;PGeneral\");\n\t\t/* Excel has been inconsistent in comment placement */\n\t\tvar R = r.s.r, C = r.s.c, p = [];\n\t\tif(ws[\"!ref\"]) for(R = r.s.r; R <= r.e.r; ++R) {\n\t\t\tif(dense && !ws[\"!data\"][R]) continue;\n\t\t\tp = [];\n\t\t\tfor(C = r.s.c; C <= r.e.c; ++C) {\n\t\t\t\tcell = dense ? ws[\"!data\"][R][C] : ws[encode_col(C) + encode_row(R)];\n\t\t\t\tif(!cell || !cell.c) continue;\n\t\t\t\tp.push(write_ws_cmnt_sylk(cell.c, R, C));\n\t\t\t}\n\t\t\tif(p.length) o.push(p.join(RS));\n\t\t}\n\t\tif(ws[\"!ref\"]) for(R = r.s.r; R <= r.e.r; ++R) {\n\t\t\tif(dense && !ws[\"!data\"][R]) continue;\n\t\t\tp = [];\n\t\t\tfor(C = r.s.c; C <= r.e.c; ++C) {\n\t\t\t\tcell = dense ? ws[\"!data\"][R][C] : ws[encode_col(C) + encode_row(R)];\n\t\t\t\tif(!cell || (cell.v == null && (!cell.f || cell.F))) continue;\n\t\t\t\tif((cell.z||(cell.t == \"d\" ? table_fmt[14] : \"General\")) != _lastfmt) {\n\t\t\t\t\tvar ifmt = opts._formats.indexOf(cell.z);\n\t\t\t\t\tif(ifmt == -1) { opts._formats.push(cell.z); ifmt = opts._formats.length - 1; preamble.push(\"P;P\" + cell.z.replace(/;/g, \";;\")); }\n\t\t\t\t\tp.push(\"F;P\" + ifmt + \";Y\" + (R+1) + \";X\" + (C+1));\n\t\t\t\t}\n\t\t\t\tp.push(write_ws_cell_sylk(cell, ws, R, C, opts, d1904));\n\t\t\t}\n\t\t\to.push(p.join(RS));\n\t\t}\n\n\t\tpreamble.push(\"F;P0;DG0G8;M255\");\n\t\tif(ws['!cols']) write_ws_cols_sylk(preamble, ws['!cols']);\n\t\tif(ws['!rows']) write_ws_rows_sylk(preamble, ws['!rows']);\n\n\t\tif(ws[\"!ref\"]) preamble.push(\"B;Y\" + (r.e.r - r.s.r + 1) + \";X\" + (r.e.c - r.s.c + 1) + \";D\" + [r.s.c,r.s.r,r.e.c,r.e.r].join(\" \"));\n\t\tpreamble.push(\"O;L;D;B\" + (d1904 ? \";V4\" : \"\") + \";K47;G100 0.001\");\n\n\t\tdelete opts._formats;\n\t\treturn preamble.join(RS) + RS + o.join(RS) + RS + \"E\" + RS;\n\t}\n\n\treturn {\n\t\tto_workbook: sylk_to_workbook,\n\t\tfrom_sheet: sheet_to_sylk\n\t};\n})();\n\nvar DIF = /*#__PURE__*/(function() {\n\tfunction dif_to_aoa(d/*:RawData*/, opts)/*:AOA*/ {\n\t\tswitch(opts.type) {\n\t\t\tcase 'base64': return dif_to_aoa_str(Base64_decode(d), opts);\n\t\t\tcase 'binary': return dif_to_aoa_str(d, opts);\n\t\t\tcase 'buffer': return dif_to_aoa_str(has_buf && Buffer.isBuffer(d) ? d.toString('binary') : a2s(d), opts);\n\t\t\tcase 'array': return dif_to_aoa_str(cc2str(d), opts);\n\t\t}\n\t\tthrow new Error(\"Unrecognized type \" + opts.type);\n\t}\n\tfunction dif_to_aoa_str(str/*:string*/, opts)/*:AOA*/ {\n\t\tvar records = str.split('\\n'), R = -1, C = -1, ri = 0, arr/*:AOA*/ = [];\n\t\tfor (; ri !== records.length; ++ri) {\n\t\t\tif (records[ri].trim() === 'BOT') { arr[++R] = []; C = 0; continue; }\n\t\t\tif (R < 0) continue;\n\t\t\tvar metadata = records[ri].trim().split(\",\");\n\t\t\tvar type = metadata[0], value = metadata[1];\n\t\t\t++ri;\n\t\t\tvar data = records[ri] || \"\";\n\t\t\twhile(((data.match(/[\"]/g)||[]).length & 1) && ri < records.length - 1) data += \"\\n\" + records[++ri];\n\t\t\tdata = data.trim();\n\t\t\tswitch (+type) {\n\t\t\t\tcase -1:\n\t\t\t\t\tif (data === 'BOT') { arr[++R] = []; C = 0; continue; }\n\t\t\t\t\telse if (data !== 'EOD') throw new Error(\"Unrecognized DIF special command \" + data);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0:\n\t\t\t\t\tif(data === 'TRUE') arr[R][C] = true;\n\t\t\t\t\telse if(data === 'FALSE') arr[R][C] = false;\n\t\t\t\t\telse if(!isNaN(fuzzynum(value))) arr[R][C] = fuzzynum(value);\n\t\t\t\t\telse if(!isNaN(fuzzydate(value).getDate())) {\n\t\t\t\t\t\tarr[R][C] = parseDate(value);\n\t\t\t\t\t\tif(!(opts && opts.UTC)) { arr[R][C] = utc_to_local(arr[R][C]); }\n\t\t\t\t\t}\n\t\t\t\t\telse arr[R][C] = value;\n\t\t\t\t\t++C; break;\n\t\t\t\tcase 1:\n\t\t\t\t\tdata = data.slice(1,data.length-1);\n\t\t\t\t\tdata = data.replace(/\"\"/g, '\"');\n\t\t\t\t\tif(DIF_XL && data && data.match(/^=\".*\"$/)) data = data.slice(2, -1);\n\t\t\t\t\tarr[R][C++] = data !== '' ? data : null;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (data === 'EOD') break;\n\t\t}\n\t\tif(opts && opts.sheetRows) arr = arr.slice(0, opts.sheetRows);\n\t\treturn arr;\n\t}\n\n\tfunction dif_to_sheet(str/*:string*/, opts)/*:Worksheet*/ { return aoa_to_sheet(dif_to_aoa(str, opts), opts); }\n\tfunction dif_to_workbook(str/*:string*/, opts)/*:Workbook*/ {\n\t\tvar o = sheet_to_workbook(dif_to_sheet(str, opts), opts);\n\t\to.bookType = \"dif\";\n\t\treturn o;\n\t}\n\n\tfunction make_value(v/*:number*/, s/*:string*/)/*:string*/ { return \"0,\" + String(v) + \"\\r\\n\" + s; }\n\tfunction make_value_str(s/*:string*/)/*:string*/ { return \"1,0\\r\\n\\\"\" + s.replace(/\"/g,'\"\"') + '\"'; }\n\tfunction sheet_to_dif(ws/*:Worksheet*//*::, opts:?any*/)/*:string*/ {\n\t\tvar _DIF_XL = DIF_XL;\n\t\tif(!ws[\"!ref\"]) throw new Error(\"Cannot export empty sheet to DIF\");\n\t\tvar r = safe_decode_range(ws['!ref']);\n\t\tvar dense = ws[\"!data\"] != null;\n\t\tvar o/*:Array*/ = [\n\t\t\t\"TABLE\\r\\n0,1\\r\\n\\\"sheetjs\\\"\\r\\n\",\n\t\t\t\"VECTORS\\r\\n0,\" + (r.e.r - r.s.r + 1) + \"\\r\\n\\\"\\\"\\r\\n\",\n\t\t\t\"TUPLES\\r\\n0,\" + (r.e.c - r.s.c + 1) + \"\\r\\n\\\"\\\"\\r\\n\",\n\t\t\t\"DATA\\r\\n0,0\\r\\n\\\"\\\"\\r\\n\"\n\t\t];\n\t\tfor(var R = r.s.r; R <= r.e.r; ++R) {\n\t\t\tvar row = dense ? ws[\"!data\"][R] : [];\n\t\t\tvar p = \"-1,0\\r\\nBOT\\r\\n\";\n\t\t\tfor(var C = r.s.c; C <= r.e.c; ++C) {\n\t\t\t\tvar cell/*:Cell*/ = dense ? (row && row[C]) : ws[encode_cell({r:R,c:C})];\n\t\t\t\tif(cell == null) { p +=(\"1,0\\r\\n\\\"\\\"\\r\\n\"); continue;}\n\t\t\t\tswitch(cell.t) {\n\t\t\t\t\tcase 'n':\n\t\t\t\t\t\tif(_DIF_XL) {\n\t\t\t\t\t\t\tif(cell.w != null) p +=(\"0,\" + cell.w + \"\\r\\nV\");\n\t\t\t\t\t\t\telse if(cell.v != null) p +=(make_value(cell.v, \"V\")); // TODO: should this call SSF_format?\n\t\t\t\t\t\t\telse if(cell.f != null && !cell.F) p +=(make_value_str(\"=\" + cell.f));\n\t\t\t\t\t\t\telse p +=(\"1,0\\r\\n\\\"\\\"\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif(cell.v == null) p +=(\"1,0\\r\\n\\\"\\\"\");\n\t\t\t\t\t\t\telse p +=(make_value(cell.v, \"V\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'b':\n\t\t\t\t\t\tp +=(cell.v ? make_value(1, \"TRUE\") : make_value(0, \"FALSE\"));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 's':\n\t\t\t\t\t\tp +=(make_value_str((!_DIF_XL || isNaN(+cell.v)) ? cell.v : '=\"' + cell.v + '\"'));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'd':\n\t\t\t\t\t\tif(!cell.w) cell.w = SSF_format(cell.z || table_fmt[14], datenum(parseDate(cell.v)));\n\t\t\t\t\t\tif(_DIF_XL) p +=(make_value(cell.w, \"V\"));\n\t\t\t\t\t\telse p +=(make_value_str(cell.w));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault: p +=(\"1,0\\r\\n\\\"\\\"\");\n\t\t\t\t}\n\t\t\t\tp += \"\\r\\n\";\n\t\t\t}\n\t\t\to.push(p);\n\t\t}\n\t\treturn o.join(\"\") + \"-1,0\\r\\nEOD\";\n\t}\n\treturn {\n\t\tto_workbook: dif_to_workbook,\n\t\tto_sheet: dif_to_sheet,\n\t\tfrom_sheet: sheet_to_dif\n\t};\n})();\n\nvar ETH = /*#__PURE__*/(function() {\n\tfunction decode(s/*:string*/)/*:string*/ { return s.replace(/\\\\b/g,\"\\\\\").replace(/\\\\c/g,\":\").replace(/\\\\n/g,\"\\n\"); }\n\tfunction encode(s/*:string*/)/*:string*/ { return s.replace(/\\\\/g, \"\\\\b\").replace(/:/g, \"\\\\c\").replace(/\\n/g,\"\\\\n\"); }\n\n\tfunction eth_to_aoa(str/*:string*/, opts)/*:AOA*/ {\n\t\tvar records = str.split('\\n'), R = -1, C = -1, ri = 0, arr/*:AOA*/ = [];\n\t\tfor (; ri !== records.length; ++ri) {\n\t\t\tvar record = records[ri].trim().split(\":\");\n\t\t\tif(record[0] !== 'cell') continue;\n\t\t\tvar addr = decode_cell(record[1]);\n\t\t\tif(arr.length <= addr.r) for(R = arr.length; R <= addr.r; ++R) if(!arr[R]) arr[R] = [];\n\t\t\tR = addr.r; C = addr.c;\n\t\t\tswitch(record[2]) {\n\t\t\t\tcase 't': arr[R][C] = decode(record[3]); break;\n\t\t\t\tcase 'v': arr[R][C] = +record[3]; break;\n\t\t\t\tcase 'vtf': var _f = record[record.length - 1];\n\t\t\t\t\t/* falls through */\n\t\t\t\tcase 'vtc':\n\t\t\t\t\tswitch(record[3]) {\n\t\t\t\t\t\tcase 'nl': arr[R][C] = +record[4] ? true : false; break;\n\t\t\t\t\t\tdefault: arr[R][C] = record[record.length-1].charAt(0) == \"#\" ? ({t: \"e\", v: RBErr[record[record.length-1]] }) : +record[4]; break;\n\t\t\t\t\t}\n\t\t\t\t\tif(record[2] == 'vtf') arr[R][C] = [arr[R][C], _f];\n\t\t\t}\n\t\t}\n\t\tif(opts && opts.sheetRows) arr = arr.slice(0, opts.sheetRows);\n\t\treturn arr;\n\t}\n\n\tfunction eth_to_sheet(d/*:string*/, opts)/*:Worksheet*/ { return aoa_to_sheet(eth_to_aoa(d, opts), opts); }\n\tfunction eth_to_workbook(d/*:string*/, opts)/*:Workbook*/ { return sheet_to_workbook(eth_to_sheet(d, opts), opts); }\n\n\tvar header = [\n\t\t\"socialcalc:version:1.5\",\n\t\t\"MIME-Version: 1.0\",\n\t\t\"Content-Type: multipart/mixed; boundary=SocialCalcSpreadsheetControlSave\"\n\t].join(\"\\n\");\n\n\tvar sep = [\n\t\t\"--SocialCalcSpreadsheetControlSave\",\n\t\t\"Content-type: text/plain; charset=UTF-8\"\n\t].join(\"\\n\") + \"\\n\";\n\n\t/* TODO: the other parts */\n\tvar meta = [\n\t\t\"# SocialCalc Spreadsheet Control Save\",\n\t\t\"part:sheet\"\n\t].join(\"\\n\");\n\n\tvar end = \"--SocialCalcSpreadsheetControlSave--\";\n\n\tfunction sheet_to_eth_data(ws/*:Worksheet*/)/*:string*/ {\n\t\tif(!ws || !ws['!ref']) return \"\";\n\t\tvar o/*:Array*/ = [], oo/*:Array*/ = [], cell, coord = \"\";\n\t\tvar r = decode_range(ws['!ref']);\n\t\tvar dense = ws[\"!data\"] != null;\n\t\tfor(var R = r.s.r; R <= r.e.r; ++R) {\n\t\t\tfor(var C = r.s.c; C <= r.e.c; ++C) {\n\t\t\t\tcoord = encode_cell({r:R,c:C});\n\t\t\t\tcell = dense ? (ws[\"!data\"][R]||[])[C] : ws[coord];\n\t\t\t\tif(!cell || cell.v == null || cell.t === 'z') continue;\n\t\t\t\too = [\"cell\", coord, 't'];\n\t\t\t\tswitch(cell.t) {\n\t\t\t\t\tcase 's': oo.push(encode(cell.v)); break;\n\t\t\t\t\tcase 'b':\n\t\t\t\t\t\too[2] = 'vt'+(cell.f?'f':'c'); oo[3]='nl'; oo[4]=cell.v?\"1\":\"0\";\n\t\t\t\t\t\too[5] = encode(cell.f||(cell.v?'TRUE':'FALSE'));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'd':\n\t\t\t\t\t\tvar t = datenum(parseDate(cell.v));\n\t\t\t\t\t\too[2] = 'vtc'; oo[3] = 'nd'; oo[4] = \"\"+t;\n\t\t\t\t\t\too[5] = cell.w || SSF_format(cell.z || table_fmt[14], t);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'n':\n\t\t\t\t\t\tif(isFinite(cell.v)) {\n\t\t\t\t\t\t\tif(!cell.f) { oo[2]='v'; oo[3]=cell.v; }\n\t\t\t\t\t\t\telse { oo[2]='vtf'; oo[3]='n'; oo[4]=cell.v; oo[5]=encode(cell.f); }\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\too[2] = 'vt' + (cell.f ? 'f' : 'c');\n\t\t\t\t\t\t\too[3] = \"e\" + BErr[isNaN(cell.v) ? 0x24 : 0x07];\n\t\t\t\t\t\t\too[4] = \"0\";\n\t\t\t\t\t\t\too[5] = cell.f || oo[3].slice(1);\n\t\t\t\t\t\t\too[6] = \"e\";\n\t\t\t\t\t\t\too[7] = oo[3].slice(1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'e': continue;\n\t\t\t\t}\n\t\t\t\to.push(oo.join(\":\"));\n\t\t\t}\n\t\t}\n\t\to.push(\"sheet:c:\" + (r.e.c-r.s.c+1) + \":r:\" + (r.e.r-r.s.r+1) + \":tvf:1\");\n\t\to.push(\"valueformat:1:text-wiki\");\n\t\t//o.push(\"copiedfrom:\" + ws['!ref']); // clipboard only\n\t\treturn o.join(\"\\n\");\n\t}\n\n\tfunction sheet_to_eth(ws/*:Worksheet*//*::, opts:?any*/)/*:string*/ {\n\t\treturn [header, sep, meta, sep, sheet_to_eth_data(ws), end].join(\"\\n\");\n\t\t// return [\"version:1.5\", sheet_to_eth_data(ws)].join(\"\\n\"); // clipboard form\n\t}\n\n\treturn {\n\t\tto_workbook: eth_to_workbook,\n\t\tto_sheet: eth_to_sheet,\n\t\tfrom_sheet: sheet_to_eth\n\t};\n})();\n\nvar PRN = /*#__PURE__*/(function() {\n\tfunction set_text_arr(data/*:string*/, arr/*:AOA*/, R/*:number*/, C/*:number*/, o/*:any*/) {\n\t\tif(o.raw) arr[R][C] = data;\n\t\telse if(data === \"\"){/* empty */}\n\t\telse if(data === 'TRUE') arr[R][C] = true;\n\t\telse if(data === 'FALSE') arr[R][C] = false;\n\t\telse if(!isNaN(fuzzynum(data))) arr[R][C] = fuzzynum(data);\n\t\telse if(!isNaN(fuzzydate(data).getDate())) arr[R][C] = parseDate(data);\n\t\telse if(data.charCodeAt(0) == 35 /* # */ && RBErr[data] != null) arr[R][C] = ({ t: 'e', v: RBErr[data], w: data });\n\t\telse arr[R][C] = data;\n\t}\n\n\tfunction prn_to_aoa_str(f/*:string*/, opts)/*:AOA*/ {\n\t\tvar o = opts || {};\n\t\tvar arr/*:AOA*/ = ([]/*:any*/);\n\t\tif(!f || f.length === 0) return arr;\n\t\tvar lines = f.split(/[\\r\\n]/);\n\t\tvar L = lines.length - 1;\n\t\twhile(L >= 0 && lines[L].length === 0) --L;\n\t\tvar start = 10, idx = 0;\n\t\tvar R = 0;\n\t\tfor(; R <= L; ++R) {\n\t\t\tidx = lines[R].indexOf(\" \");\n\t\t\tif(idx == -1) idx = lines[R].length; else idx++;\n\t\t\tstart = Math.max(start, idx);\n\t\t}\n\t\tfor(R = 0; R <= L; ++R) {\n\t\t\tarr[R] = [];\n\t\t\t/* TODO: confirm that widths are always 10 */\n\t\t\tvar C = 0;\n\t\t\tset_text_arr(lines[R].slice(0, start).trim(), arr, R, C, o);\n\t\t\tfor(C = 1; C <= (lines[R].length - start)/10 + 1; ++C)\n\t\t\t\tset_text_arr(lines[R].slice(start+(C-1)*10,start+C*10).trim(),arr,R,C,o);\n\t\t}\n\t\tif(o.sheetRows) arr = arr.slice(0, o.sheetRows);\n\t\treturn arr;\n\t}\n\n\t// List of accepted CSV separators\n\tvar guess_seps = {\n\t\t0x2C: ',',\n\t\t0x09: \"\\t\",\n\t\t0x3B: ';',\n\t\t0x7C: '|'\n\t};\n\n\t// CSV separator weights to be used in case of equal numbers\n\tvar guess_sep_weights = {\n\t\t0x2C: 3,\n\t\t0x09: 2,\n\t\t0x3B: 1,\n\t\t0x7C: 0\n\t};\n\n\tfunction guess_sep(str) {\n\t\tvar cnt = {}, instr = false, end = 0, cc = 0;\n\t\tfor(;end < str.length;++end) {\n\t\t\tif((cc=str.charCodeAt(end)) == 0x22) instr = !instr;\n\t\t\telse if(!instr && cc in guess_seps) cnt[cc] = (cnt[cc]||0)+1;\n\t\t}\n\n\t\tcc = [];\n\t\tfor(end in cnt) if ( Object.prototype.hasOwnProperty.call(cnt, end) ) {\n\t\t\tcc.push([ cnt[end], end ]);\n\t\t}\n\n\t\tif ( !cc.length ) {\n\t\t\tcnt = guess_sep_weights;\n\t\t\tfor(end in cnt) if ( Object.prototype.hasOwnProperty.call(cnt, end) ) {\n\t\t\t\tcc.push([ cnt[end], end ]);\n\t\t\t}\n\t\t}\n\n\t\tcc.sort(function(a, b) { return a[0] - b[0] || guess_sep_weights[a[1]] - guess_sep_weights[b[1]]; });\n\n\t\treturn guess_seps[cc.pop()[1]] || 0x2C;\n\t}\n\n\tfunction dsv_to_sheet_str(str/*:string*/, opts)/*:Worksheet*/ {\n\t\tvar o = opts || {};\n\t\tvar sep = \"\";\n\t\tif(DENSE != null && o.dense == null) o.dense = DENSE;\n\t\tvar ws/*:Worksheet*/ = ({}/*:any*/);\n\t\tif(o.dense) ws[\"!data\"] = [];\n\t\tvar range/*:Range*/ = ({s: {c:0, r:0}, e: {c:0, r:0}}/*:any*/);\n\n\t\tif(str.slice(0,4) == \"sep=\") {\n\t\t\t// If the line ends in \\r\\n\n\t\t\tif(str.charCodeAt(5) == 13 && str.charCodeAt(6) == 10 ) {\n\t\t\t\tsep = str.charAt(4); str = str.slice(7);\n\t\t\t}\n\t\t\t// If line ends in \\r OR \\n\n\t\t\telse if(str.charCodeAt(5) == 13 || str.charCodeAt(5) == 10 ) {\n\t\t\t\tsep = str.charAt(4); str = str.slice(6);\n\t\t\t}\n\t\t\telse sep = guess_sep(str.slice(0,1024));\n\t\t}\n\t\telse if(o && o.FS) sep = o.FS;\n\t\telse sep = guess_sep(str.slice(0,1024));\n\t\tvar R = 0, C = 0, v = 0;\n\t\tvar start = 0, end = 0, sepcc = sep.charCodeAt(0), instr = false, cc=0, startcc=str.charCodeAt(0);\n\t\tvar _re/*:?RegExp*/ = o.dateNF != null ? dateNF_regex(o.dateNF) : null;\n\t\tfunction finish_cell() {\n\t\t\t/* TODO: fuzzy parsers should pass back assumed number format */\n\t\t\tvar s = str.slice(start, end); if(s.slice(-1) == \"\\r\") s = s.slice(0, -1);\n\t\t\tvar cell = ({}/*:any*/);\n\t\t\tif(s.charAt(0) == '\"' && s.charAt(s.length - 1) == '\"') s = s.slice(1,-1).replace(/\"\"/g,'\"');\n\t\t\tif(o.cellText !== false) cell.w = s;\n\t\t\tif(s.length === 0) cell.t = 'z';\n\t\t\telse if(o.raw) { cell.t = 's'; cell.v = s; }\n\t\t\telse if(s.trim().length === 0) { cell.t = 's'; cell.v = s; }\n\t\t\telse if(s.charCodeAt(0) == 0x3D) {\n\t\t\t\tif(s.charCodeAt(1) == 0x22 && s.charCodeAt(s.length - 1) == 0x22) { cell.t = 's'; cell.v = s.slice(2,-1).replace(/\"\"/g,'\"'); }\n\t\t\t\telse if(fuzzyfmla(s)) { cell.t = 's'; cell.f = s.slice(1); cell.v = s; }\n\t\t\t\telse { cell.t = 's'; cell.v = s; } }\n\t\t\telse if(s == \"TRUE\") { cell.t = 'b'; cell.v = true; }\n\t\t\telse if(s == \"FALSE\") { cell.t = 'b'; cell.v = false; }\n\t\t\telse if(!isNaN(v = fuzzynum(s))) { cell.t = 'n'; cell.v = v; }\n\t\t\telse if(!isNaN((v = fuzzydate(s)).getDate()) || _re && s.match(_re)) {\n\t\t\t\tcell.z = o.dateNF || table_fmt[14];\n\t\t\t\tif(_re && s.match(_re)){ var news=dateNF_fix(s, o.dateNF, (s.match(_re)||[])); v = parseDate(news); if(o && o.UTC === false) v = utc_to_local(v); }\n\t\t\t\telse if(o && o.UTC === false) v = utc_to_local(v);\n\t\t\t\telse if(o.cellText !== false && o.dateNF) cell.w = SSF_format(cell.z, v);\n\t\t\t\tif(o.cellDates) { cell.t = 'd'; cell.v = v; }\n\t\t\t\telse { cell.t = 'n'; cell.v = datenum(v); }\n\t\t\t\tif(!o.cellNF) delete cell.z;\n\t\t\t} else if(s.charCodeAt(0) == 35 /* # */ && RBErr[s] != null) {\n\t\t\t\tcell.t = 'e'; cell.w = s; cell.v = RBErr[s];\n\t\t\t} else {\n\t\t\t\tcell.t = 's';\n\t\t\t\tcell.v = s;\n\t\t\t}\n\t\t\tif(cell.t == 'z'){}\n\t\t\telse if(o.dense) { if(!ws[\"!data\"][R]) ws[\"!data\"][R] = []; ws[\"!data\"][R][C] = cell; }\n\t\t\telse ws[encode_cell({c:C,r:R})] = cell;\n\t\t\tstart = end+1; startcc = str.charCodeAt(start);\n\t\t\tif(range.e.c < C) range.e.c = C;\n\t\t\tif(range.e.r < R) range.e.r = R;\n\t\t\tif(cc == sepcc) ++C; else { C = 0; ++R; if(o.sheetRows && o.sheetRows <= R) return true; }\n\t\t}\n\t\touter: for(;end < str.length;++end) switch((cc=str.charCodeAt(end))) {\n\t\t\tcase 0x22: if(startcc === 0x22) instr = !instr; break;\n\t\t\tcase 0x0d:\n\t\t\t\tif(instr) break;\n\t\t\t\tif(str.charCodeAt(end+1) == 0x0a) ++end;\n\t\t\t\t/* falls through */\n\t\t\tcase sepcc: case 0x0a: if(!instr && finish_cell()) break outer; break;\n\t\t\tdefault: break;\n\t\t}\n\t\tif(end - start > 0) finish_cell();\n\n\t\tws['!ref'] = encode_range(range);\n\t\treturn ws;\n\t}\n\n\tfunction prn_to_sheet_str(str/*:string*/, opts)/*:Worksheet*/ {\n\t\tif(!(opts && opts.PRN)) return dsv_to_sheet_str(str, opts);\n\t\tif(opts.FS) return dsv_to_sheet_str(str, opts);\n\t\tif(str.slice(0,4) == \"sep=\") return dsv_to_sheet_str(str, opts);\n\t\tif(str.indexOf(\"\\t\") >= 0 || str.indexOf(\",\") >= 0 || str.indexOf(\";\") >= 0) return dsv_to_sheet_str(str, opts);\n\t\treturn aoa_to_sheet(prn_to_aoa_str(str, opts), opts);\n\t}\n\n\tfunction prn_to_sheet(d/*:RawData*/, opts)/*:Worksheet*/ {\n\t\tvar str = \"\", bytes = opts.type == 'string' ? [0,0,0,0] : firstbyte(d, opts);\n\t\tswitch(opts.type) {\n\t\t\tcase 'base64': str = Base64_decode(d); break;\n\t\t\tcase 'binary': str = d; break;\n\t\t\tcase 'buffer':\n\t\t\t\tif(opts.codepage == 65001) str = d.toString('utf8'); // TODO: test if buf\n\t\t\t\telse if(opts.codepage && typeof $cptable !== 'undefined') str = $cptable.utils.decode(opts.codepage, d);\n\t\t\t\telse str = has_buf && Buffer.isBuffer(d) ? d.toString('binary') : a2s(d);\n\t\t\t\tbreak;\n\t\t\tcase 'array': str = cc2str(d); break;\n\t\t\tcase 'string': str = d; break;\n\t\t\tdefault: throw new Error(\"Unrecognized type \" + opts.type);\n\t\t}\n\t\tif(bytes[0] == 0xEF && bytes[1] == 0xBB && bytes[2] == 0xBF) str = utf8read(str.slice(3));\n\t\telse if(opts.type != 'string' && opts.type != 'buffer' && opts.codepage == 65001) str = utf8read(str);\n\t\telse if((opts.type == 'binary') && typeof $cptable !== 'undefined' && opts.codepage) str = $cptable.utils.decode(opts.codepage, $cptable.utils.encode(28591,str));\n\t\tif(str.slice(0,19) == \"socialcalc:version:\") return ETH.to_sheet(opts.type == 'string' ? str : utf8read(str), opts);\n\t\treturn prn_to_sheet_str(str, opts);\n\t}\n\n\tfunction prn_to_workbook(d/*:RawData*/, opts)/*:Workbook*/ { return sheet_to_workbook(prn_to_sheet(d, opts), opts); }\n\n\tfunction sheet_to_prn(ws/*:Worksheet*//*::, opts:?any*/)/*:string*/ {\n\t\tvar o/*:Array*/ = [];\n\t\tif(!ws[\"!ref\"]) return \"\";\n\t\tvar r = safe_decode_range(ws['!ref']), cell/*:Cell*/;\n\t\tvar dense = ws[\"!data\"] != null;\n\t\tfor(var R = r.s.r; R <= r.e.r; ++R) {\n\t\t\tvar oo/*:Array*/ = [];\n\t\t\tfor(var C = r.s.c; C <= r.e.c; ++C) {\n\t\t\t\tvar coord = encode_cell({r:R,c:C});\n\t\t\t\tcell = dense ? (ws[\"!data\"][R]||[])[C] : ws[coord];\n\t\t\t\tif(!cell || cell.v == null) { oo.push(\" \"); continue; }\n\t\t\t\tvar w = (cell.w || (format_cell(cell), cell.w) || \"\").slice(0,10);\n\t\t\t\twhile(w.length < 10) w += \" \";\n\t\t\t\too.push(w + (C === 0 ? \" \" : \"\"));\n\t\t\t}\n\t\t\to.push(oo.join(\"\"));\n\t\t}\n\t\treturn o.join(\"\\n\");\n\t}\n\n\treturn {\n\t\tto_workbook: prn_to_workbook,\n\t\tto_sheet: prn_to_sheet,\n\t\tfrom_sheet: sheet_to_prn\n\t};\n})();\n\n/* Excel defaults to SYLK but warns if data is not valid */\nfunction read_wb_ID(d, opts) {\n\tvar o = opts || {}, OLD_WTF = !!o.WTF; o.WTF = true;\n\ttry {\n\t\tvar out = SYLK.to_workbook(d, o);\n\t\to.WTF = OLD_WTF;\n\t\treturn out;\n\t} catch(e) {\n\t\to.WTF = OLD_WTF;\n\t\tif((e.message.indexOf(\"SYLK bad record ID\") == -1) && OLD_WTF) throw e;\n\t\treturn PRN.to_workbook(d, opts);\n\t}\n}\n\nvar WK_ = /*#__PURE__*/(function() {\n\tfunction lotushopper(data, cb/*:RecordHopperCB*/, opts/*:any*/) {\n\t\tif(!data) return;\n\t\tprep_blob(data, data.l || 0);\n\t\tvar Enum = opts.Enum || WK1Enum;\n\t\twhile(data.l < data.length) {\n\t\t\tvar RT = data.read_shift(2);\n\t\t\tvar R = Enum[RT] || Enum[0xFFFF];\n\t\t\tvar length = data.read_shift(2);\n\t\t\tvar tgt = data.l + length;\n\t\t\tvar d = R.f && R.f(data, length, opts);\n\t\t\tdata.l = tgt;\n\t\t\tif(cb(d, R, RT)) return;\n\t\t}\n\t}\n\n\tfunction lotus_to_workbook(d/*:RawData*/, opts) {\n\t\tswitch(opts.type) {\n\t\t\tcase 'base64': return lotus_to_workbook_buf(s2a(Base64_decode(d)), opts);\n\t\t\tcase 'binary': return lotus_to_workbook_buf(s2a(d), opts);\n\t\t\tcase 'buffer':\n\t\t\tcase 'array': return lotus_to_workbook_buf(d, opts);\n\t\t}\n\t\tthrow \"Unsupported type \" + opts.type;\n\t}\n\n\t/* NOTE: this list intentionally starts at 1 */\n\tvar LOTUS_DATE_FMTS = [\n\t\t\"mmmm\",\n\t\t\"dd-mmm-yyyy\",\n\t\t\"dd-mmm\",\n\t\t\"mmm-yyyy\",\n\t\t\"@\", // \"text\"?\n\t\t\"mm/dd\",\n\t\t\"hh:mm:ss AM/PM\", // 7\n\t\t\"hh:mm AM/PM\",\n\t\t\"mm/dd/yyyy\",\n\t\t\"mm/dd\",\n\t\t\"hh:mm:ss\",\n\t\t\"hh:mm\" // 12\n\t];\n\n\tfunction lotus_to_workbook_buf(d, opts)/*:Workbook*/ {\n\t\tif(!d) return d;\n\t\tvar o = opts || {};\n\t\tif(DENSE != null && o.dense == null) o.dense = DENSE;\n\t\tvar s/*:Worksheet*/ = ({}/*:any*/), n = \"Sheet1\", next_n = \"\", sidx = 0;\n\t\tvar sheets = {}, snames = [], realnames = [], sdata = [];\n\t\tif(o.dense) sdata = s[\"!data\"] = [];\n\n\t\tvar refguess = {s: {r:0, c:0}, e: {r:0, c:0} };\n\t\tvar sheetRows = o.sheetRows || 0;\n\t\tvar lastcell = {};\n\n\t\tif(d[4] == 0x51 && d[5] == 0x50 && d[6] == 0x57) return qpw_to_workbook_buf(d, opts);\n\t\tif(d[2] == 0x00) {\n\t\t\tif(d[3] == 0x08 || d[3] == 0x09) {\n\t\t\t\tif(d.length >= 16 && d[14] == 0x05 && d[15] === 0x6c) throw new Error(\"Unsupported Works 3 for Mac file\");\n\t\t\t}\n\t\t}\n\n\t\tif(d[2] == 0x02) {\n\t\t\to.Enum = WK1Enum;\n\t\t\tlotushopper(d, function(val, R, RT) { switch(RT) {\n\t\t\t\tcase 0x00: /* BOF */\n\t\t\t\t\to.vers = val;\n\t\t\t\t\tif(val >= 0x1000) o.qpro = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0xFF: /* BOF (works 3+) */\n\t\t\t\t\to.vers = val;\n\t\t\t\t\to.works = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0x06: refguess = val; break; /* RANGE */\n\t\t\t\tcase 0xCC: if(val) next_n = val; break; /* SHEETNAMECS */\n\t\t\t\tcase 0xDE: next_n = val; break; /* SHEETNAMELP */\n\t\t\t\tcase 0x0F: /* LABEL */\n\t\t\t\tcase 0x33: /* STRING */\n\t\t\t\t\tif((!o.qpro && !o.works || RT == 0x33) && val[1].v.charCodeAt(0) < 0x30) val[1].v = val[1].v.slice(1);\n\t\t\t\t\tif(o.works || o.works2) val[1].v = val[1].v.replace(/\\r\\n/g, \"\\n\");\n\t\t\t\t\t/* falls through */\n\t\t\t\tcase 0x0D: /* INTEGER */\n\t\t\t\tcase 0x0E: /* NUMBER */\n\t\t\t\tcase 0x10: /* FORMULA */\n\t\t\t\t\t/* TODO: actual translation of the format code */\n\t\t\t\t\tif((val[2] & 0x70) == 0x70 && (val[2] & 0x0F) > 1 && (val[2] & 0x0F) < 15) {\n\t\t\t\t\t\tval[1].z = o.dateNF || LOTUS_DATE_FMTS[(val[2] & 0x0F)-1] || table_fmt[14];\n\t\t\t\t\t\tif(o.cellDates) { val[1].v = numdate(val[1].v); val[1].t = typeof val[1].v == \"number\" ? 'n' : 'd'; }\n\t\t\t\t\t}\n\n\t\t\t\t\tif(o.qpro) {\n\t\t\t\t\t\tif(val[3] > sidx) {\n\t\t\t\t\t\t\ts[\"!ref\"] = encode_range(refguess);\n\t\t\t\t\t\t\tsheets[n] = s;\n\t\t\t\t\t\t\tsnames.push(n);\n\t\t\t\t\t\t\ts = ({}/*:any*/); if(o.dense) sdata = s[\"!data\"] = [];\n\t\t\t\t\t\t\trefguess = {s: {r:0, c:0}, e: {r:0, c:0} };\n\t\t\t\t\t\t\tsidx = val[3]; n = next_n || \"Sheet\" + (sidx + 1); next_n = \"\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tvar tmpcell = o.dense ? (sdata[val[0].r]||[])[val[0].c] : s[encode_cell(val[0])];\n\t\t\t\t\tif(tmpcell) {\n\t\t\t\t\t\ttmpcell.t = val[1].t; tmpcell.v = val[1].v;\n\t\t\t\t\t\tif(val[1].z != null) tmpcell.z = val[1].z;\n\t\t\t\t\t\tif(val[1].f != null) tmpcell.f = val[1].f;\n\t\t\t\t\t\tlastcell = tmpcell;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif(o.dense) {\n\t\t\t\t\t\tif(!sdata[val[0].r]) sdata[val[0].r] = [];\n\t\t\t\t\t\tsdata[val[0].r][val[0].c] = val[1];\n\t\t\t\t\t} else s[encode_cell(val[0])] = val[1];\n\t\t\t\t\tlastcell = val[1];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0x5405: o.works2 = true; break;\n\t\t\t\tcase 0x5402: {\n\t\t\t\t\t/* TODO: enumerate all extended number formats */\n\t\t\t\t\tif(val == 0x14a1) {\n\t\t\t\t\t\tlastcell.z = \"hh:mm:ss\";\n\t\t\t\t\t\tif(o.cellDates && lastcell.t == \"n\") {\n\t\t\t\t\t\t\tlastcell.v = numdate(lastcell.v); lastcell.t = typeof lastcell.v == \"number\" ? 'n' : 'd';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} break;\n\t\t\t}}, o);\n\t\t} else if(d[2] == 0x1A || d[2] == 0x0E) {\n\t\t\to.Enum = WK3Enum;\n\t\t\tif(d[2] == 0x0E) { o.qpro = true; d.l = 0; }\n\t\t\tlotushopper(d, function(val, R, RT) { switch(RT) {\n\t\t\t\tcase 0xCC: n = val; break; /* SHEETNAMECS */\n\t\t\t\tcase 0x16: /* LABEL16 */\n\t\t\t\t\tif(val[1].v.charCodeAt(0) < 0x30) val[1].v = val[1].v.slice(1);\n\t\t\t\t\t// TODO: R9 appears to encode control codes this way -- verify against other versions\n\t\t\t\t\tval[1].v = val[1].v.replace(/\\x0F./g, function($$) { return String.fromCharCode($$.charCodeAt(1) - 0x20); }).replace(/\\r\\n/g, \"\\n\");\n\t\t\t\t\t/* falls through */\n\t\t\t\tcase 0x17: /* NUMBER17 */\n\t\t\t\tcase 0x18: /* NUMBER18 */\n\t\t\t\tcase 0x19: /* FORMULA19 */\n\t\t\t\tcase 0x25: /* NUMBER25 */\n\t\t\t\tcase 0x27: /* NUMBER27 */\n\t\t\t\tcase 0x28: /* FORMULA28 */\n\t\t\t\t\tif(val[3] > sidx) {\n\t\t\t\t\t\ts[\"!ref\"] = encode_range(refguess);\n\t\t\t\t\t\tsheets[n] = s;\n\t\t\t\t\t\tsnames.push(n);\n\t\t\t\t\t\ts = ({}/*:any*/); if(o.dense) sdata = s[\"!data\"] = [];\n\t\t\t\t\t\trefguess = {s: {r:0, c:0}, e: {r:0, c:0} };\n\t\t\t\t\t\tsidx = val[3]; n = \"Sheet\" + (sidx + 1);\n\t\t\t\t\t}\n\t\t\t\t\tif(sheetRows > 0 && val[0].r >= sheetRows) break;\n\t\t\t\t\tif(o.dense) {\n\t\t\t\t\t\tif(!sdata[val[0].r]) sdata[val[0].r] = [];\n\t\t\t\t\t\tsdata[val[0].r][val[0].c] = val[1];\n\t\t\t\t\t} else s[encode_cell(val[0])] = val[1];\n\t\t\t\t\tif(refguess.e.c < val[0].c) refguess.e.c = val[0].c;\n\t\t\t\t\tif(refguess.e.r < val[0].r) refguess.e.r = val[0].r;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0x1B: /* XFORMAT */\n\t\t\t\t\tif(val[0x36b0]) realnames[val[0x36b0][0]] = val[0x36b0][1];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0x0601: /* SHEETINFOQP */\n\t\t\t\t\trealnames[val[0]] = val[1]; if(val[0] == sidx) n = val[1]; break;\n\t\t\t\tdefault: break;\n\t\t\t}}, o);\n\t\t} else throw new Error(\"Unrecognized LOTUS BOF \" + d[2]);\n\t\ts[\"!ref\"] = encode_range(refguess);\n\t\tsheets[next_n || n] = s;\n\t\tsnames.push(next_n || n);\n\t\tif(!realnames.length) return { SheetNames: snames, Sheets: sheets };\n\t\tvar osheets = {}, rnames = [];\n\t\t/* TODO: verify no collisions */\n\t\tfor(var i = 0; i < realnames.length; ++i) if(sheets[snames[i]]) {\n\t\t\trnames.push(realnames[i] || snames[i]);\n\t\t\tosheets[realnames[i]] = sheets[realnames[i]] || sheets[snames[i]];\n\t\t} else {\n\t\t\trnames.push(realnames[i]);\n\t\t\tosheets[realnames[i]] = ({ \"!ref\": \"A1\" });\n\t\t}\n\t\treturn { SheetNames: rnames, Sheets: osheets };\n\t}\n\n\tfunction sheet_to_wk1(ws/*:Worksheet*/, opts/*:WriteOpts*/) {\n\t\tvar o = opts || {};\n\t\tif(+o.codepage >= 0) set_cp(+o.codepage);\n\t\tif(o.type == \"string\") throw new Error(\"Cannot write WK1 to JS string\");\n\t\tvar ba = buf_array();\n\t\tif(!ws[\"!ref\"]) throw new Error(\"Cannot export empty sheet to WK1\");\n\t\tvar range = safe_decode_range(ws[\"!ref\"]);\n\t\tvar dense = ws[\"!data\"] != null;\n\t\tvar cols = [];\n\n\t\twrite_biff_rec(ba, 0x00, write_BOF_WK1(0x0406));\n\t\twrite_biff_rec(ba, 0x06, write_RANGE(range));\n\t\tvar max_R = Math.min(range.e.r, 8191);\n\t\tfor(var C = range.s.c; C <= range.e.c; ++C) cols[C] = encode_col(C);\n\t\tfor(var R = range.s.r; R <= max_R; ++R) {\n\t\t\tvar rr = encode_row(R);\n\t\t\tfor(C = range.s.c; C <= range.e.c; ++C) {\n\t\t\t\tvar cell = dense ? (ws[\"!data\"][R]||[])[C] : ws[cols[C] + rr];\n\t\t\t\tif(!cell || cell.t == \"z\") continue;\n\t\t\t\t/* TODO: formula records */\n\t\t\t\tswitch(cell.t) {\n\t\t\t\tcase \"n\":\n\t\t\t\t\tif((cell.v|0)==cell.v && cell.v >= -32768 && cell.v <= 32767) write_biff_rec(ba, 0x0d, write_INTEGER(R, C, cell));\n\t\t\t\t\telse write_biff_rec(ba, 0x0e, write_NUMBER(R, C, cell));\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"d\":\n\t\t\t\t\tvar dc = datenum(cell.v);\n\t\t\t\t\tif((dc|0)==dc && dc >= -32768 && dc <= 32767) write_biff_rec(ba, 0x0d, write_INTEGER(R, C, {t:\"n\", v:dc, z:cell.z || table_fmt[14]}));\n\t\t\t\t\telse write_biff_rec(ba, 0x0e, write_NUMBER(R, C, {t:\"n\", v:dc, z:cell.z || table_fmt[14]}));\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tvar str = format_cell(cell);\n\t\t\t\t\twrite_biff_rec(ba, 0x0F, write_LABEL(R, C, str.slice(0, 239)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\twrite_biff_rec(ba, 0x01);\n\t\treturn ba.end();\n\t}\n\n\tfunction book_to_wk3(wb/*:Workbook*/, opts/*:WriteOpts*/) {\n\t\tvar o = opts || {};\n\t\tif(+o.codepage >= 0) set_cp(+o.codepage);\n\t\tif(o.type == \"string\") throw new Error(\"Cannot write WK3 to JS string\");\n\t\tvar ba = buf_array();\n\n\t\twrite_biff_rec(ba, 0x00, write_BOF_WK3(wb));\n\n\t\tfor(var i = 0, cnt = 0; i < wb.SheetNames.length; ++i) if((wb.Sheets[wb.SheetNames[i]] || {})[\"!ref\"]) write_biff_rec(ba, 0x1b, write_XFORMAT_SHEETNAME(wb.SheetNames[i], cnt++));\n\n\t\tvar wsidx = 0;\n\t\tfor(i = 0; i < wb.SheetNames.length; ++i) {\n\t\t\tvar ws = wb.Sheets[wb.SheetNames[i]];\n\t\t\tif(!ws || !ws[\"!ref\"]) continue;\n\t\t\tvar range = safe_decode_range(ws[\"!ref\"]);\n\t\t\tvar dense = ws[\"!data\"] != null;\n\t\t\tvar cols = [];\n\t\t\tvar max_R = Math.min(range.e.r, 8191);\n\t\t\tfor(var R = range.s.r; R <= max_R; ++R) {\n\t\t\t\tvar rr = encode_row(R);\n\t\t\t\tfor(var C = range.s.c; C <= range.e.c; ++C) {\n\t\t\t\t\tif(R === range.s.r) cols[C] = encode_col(C);\n\t\t\t\t\tvar ref = cols[C] + rr;\n\t\t\t\t\tvar cell = dense ? (ws[\"!data\"][R]||[])[C] : ws[ref];\n\t\t\t\t\tif(!cell || cell.t == \"z\") continue;\n\t\t\t\t\t/* TODO: FORMULA19 NUMBER18 records */\n\t\t\t\t\tif(cell.t == \"n\") {\n\t\t\t\t\t\twrite_biff_rec(ba, 0x17, write_NUMBER_17(R, C, wsidx, cell.v));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar str = format_cell(cell);\n\t\t\t\t\t\t/* TODO: max len? */\n\t\t\t\t\t\twrite_biff_rec(ba, 0x16, write_LABEL_16(R, C, wsidx, str.slice(0, 239)));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t++wsidx;\n\t\t}\n\n\t\twrite_biff_rec(ba, 0x01);\n\t\treturn ba.end();\n\t}\n\n\n\tfunction write_BOF_WK1(v/*:number*/) {\n\t\tvar out = new_buf(2);\n\t\tout.write_shift(2, v);\n\t\treturn out;\n\t}\n\n\tfunction write_BOF_WK3(wb/*:Workbook*/) {\n\t\tvar out = new_buf(26);\n\t\tout.write_shift(2, 0x1000);\n\t\tout.write_shift(2, 0x0004);\n\t\tout.write_shift(4, 0x0000);\n\t\tvar rows = 0, cols = 0, wscnt = 0;\n\t\tfor(var i = 0; i < wb.SheetNames.length; ++i) {\n\t\t\tvar name = wb.SheetNames[i];\n\t\t\tvar ws = wb.Sheets[name];\n\t\t\tif(!ws || !ws[\"!ref\"]) continue;\n\t\t\t++wscnt;\n\t\t\tvar range = decode_range(ws[\"!ref\"]);\n\t\t\tif(rows < range.e.r) rows = range.e.r;\n\t\t\tif(cols < range.e.c) cols = range.e.c;\n\t\t}\n\t\tif(rows > 8191) rows = 8191;\n\t\tout.write_shift(2, rows);\n\t\tout.write_shift(1, wscnt);\n\t\tout.write_shift(1, cols);\n\t\tout.write_shift(2, 0x00);\n\t\tout.write_shift(2, 0x00);\n\t\tout.write_shift(1, 0x01);\n\t\tout.write_shift(1, 0x02);\n\t\tout.write_shift(4, 0);\n\t\tout.write_shift(4, 0);\n\t\treturn out;\n\t}\n\n\tfunction parse_RANGE(blob, length, opts) {\n\t\tvar o = {s:{c:0,r:0},e:{c:0,r:0}};\n\t\tif(length == 8 && opts.qpro) {\n\t\t\to.s.c = blob.read_shift(1);\n\t\t\tblob.l++;\n\t\t\to.s.r = blob.read_shift(2);\n\t\t\to.e.c = blob.read_shift(1);\n\t\t\tblob.l++;\n\t\t\to.e.r = blob.read_shift(2);\n\t\t\treturn o;\n\t\t}\n\t\to.s.c = blob.read_shift(2);\n\t\to.s.r = blob.read_shift(2);\n\t\tif(length == 12 && opts.qpro) blob.l += 2;\n\t\to.e.c = blob.read_shift(2);\n\t\to.e.r = blob.read_shift(2);\n\t\tif(length == 12 && opts.qpro) blob.l += 2;\n\t\tif(o.s.c == 0xFFFF) o.s.c = o.e.c = o.s.r = o.e.r = 0;\n\t\treturn o;\n\t}\n\tfunction write_RANGE(range) {\n\t\tvar out = new_buf(8);\n\t\tout.write_shift(2, range.s.c);\n\t\tout.write_shift(2, range.s.r);\n\t\tout.write_shift(2, range.e.c);\n\t\tout.write_shift(2, range.e.r);\n\t\treturn out;\n\t}\n\n\tfunction parse_cell(blob, length, opts) {\n\t\tvar o = [{c:0,r:0}, {t:'n',v:0}, 0, 0];\n\t\tif(opts.qpro && opts.vers != 0x5120) {\n\t\t\to[0].c = blob.read_shift(1);\n\t\t\to[3] = blob.read_shift(1);\n\t\t\to[0].r = blob.read_shift(2);\n\t\t\tblob.l+=2;\n\t\t} else if(opts.works) { // TODO: verify with more complex works3-4 examples\n\t\t\to[0].c = blob.read_shift(2); o[0].r = blob.read_shift(2);\n\t\t\to[2] = blob.read_shift(2);\n\t\t} else {\n\t\t\to[2] = blob.read_shift(1);\n\t\t\to[0].c = blob.read_shift(2); o[0].r = blob.read_shift(2);\n\t\t}\n\t\treturn o;\n\t}\n\n\tfunction get_wk1_fmt(cell)/*:number*/ {\n\t\t/* TODO: some fuzzy matching on the number format */\n\t\tif(cell.z && fmt_is_date(cell.z)) {\n\t\t\treturn 0xf0 | (LOTUS_DATE_FMTS.indexOf(cell.z) + 1 || 2);\n\t\t}\n\t\treturn 0xFF;\n\t}\n\tfunction parse_LABEL(blob, length, opts) {\n\t\tvar tgt = blob.l + length;\n\t\tvar o = parse_cell(blob, length, opts);\n\t\to[1].t = 's';\n\t\tif((opts.vers & 0xFFFE) == 0x5120) { // WQ1 / WQ2\n\t\t\tblob.l++;\n\t\t\tvar len = blob.read_shift(1);\n\t\t\to[1].v = blob.read_shift(len, 'utf8');\n\t\t\treturn o;\n\t\t}\n\t\tif(opts.qpro) blob.l++;\n\t\to[1].v = blob.read_shift(tgt - blob.l, 'cstr');\n\t\treturn o;\n\t}\n\tfunction write_LABEL(R, C, s) {\n\t\t/* TODO: encoding */\n\t\tvar o = new_buf(7 + s.length);\n\t\to.write_shift(1, 0xFF);\n\t\to.write_shift(2, C);\n\t\to.write_shift(2, R);\n\t\to.write_shift(1, 0x27); // ??\n\t\tfor(var i = 0; i < o.length; ++i) {\n\t\t\tvar cc = s.charCodeAt(i);\n\t\t\to.write_shift(1, cc >= 0x80 ? 0x5F : cc);\n\t\t}\n\t\to.write_shift(1, 0);\n\t\treturn o;\n\t}\n\tfunction parse_STRING(blob, length, opts) {\n\t\tvar tgt = blob.l + length;\n\t\tvar o = parse_cell(blob, length, opts);\n\t\to[1].t = 's';\n\t\tif(opts.vers == 0x5120) {\n\t\t\tvar len = blob.read_shift(1);\n\t\t\to[1].v = blob.read_shift(len, 'utf8');\n\t\t\treturn o;\n\t\t}\n\t\to[1].v = blob.read_shift(tgt - blob.l, 'cstr');\n\t\treturn o;\n\t}\n\n\tfunction parse_INTEGER(blob, length, opts) {\n\t\tvar o = parse_cell(blob, length, opts);\n\t\to[1].v = blob.read_shift(2, 'i');\n\t\treturn o;\n\t}\n\tfunction write_INTEGER(R, C, cell) {\n\t\tvar o = new_buf(7);\n\t\to.write_shift(1, get_wk1_fmt(cell));\n\t\to.write_shift(2, C);\n\t\to.write_shift(2, R);\n\t\to.write_shift(2, cell.v, 'i');\n\t\treturn o;\n\t}\n\n\tfunction parse_NUMBER(blob, length, opts) {\n\t\tvar o = parse_cell(blob, length, opts);\n\t\to[1].v = blob.read_shift(8, 'f');\n\t\treturn o;\n\t}\n\tfunction write_NUMBER(R, C, cell) {\n\t\tvar o = new_buf(13);\n\t\to.write_shift(1, get_wk1_fmt(cell));\n\t\to.write_shift(2, C);\n\t\to.write_shift(2, R);\n\t\to.write_shift(8, cell.v, 'f');\n\t\treturn o;\n\t}\n\n\tfunction parse_FORMULA(blob, length, opts) {\n\t\tvar tgt = blob.l + length;\n\t\tvar o = parse_cell(blob, length, opts);\n\t\t/* TODO: formula */\n\t\to[1].v = blob.read_shift(8, 'f');\n\t\tif(opts.qpro) blob.l = tgt;\n\t\telse {\n\t\t\tvar flen = blob.read_shift(2);\n\t\t\twk1_fmla_to_csf(blob.slice(blob.l, blob.l + flen), o);\n\t\t\tblob.l += flen;\n\t\t}\n\t\treturn o;\n\t}\n\n\tfunction wk1_parse_rc(B, V, col) {\n\t\tvar rel = V & 0x8000;\n\t\tV &= ~0x8000;\n\t\tV = (rel ? B : 0) + ((V >= 0x2000) ? V - 0x4000 : V);\n\t\treturn (rel ? \"\" : \"$\") + (col ? encode_col(V) : encode_row(V));\n\t}\n\t/* var oprec = [\n\t\t8, 8, 8, 8, 8, 8, 8, 8, 6, 4, 4, 5, 5, 7, 3, 3,\n\t\t3, 3, 3, 3, 1, 1, 2, 6, 8, 8, 8, 8, 8, 8, 8, 8\n\t]; */\n\t/* TODO: flesh out */\n\tvar FuncTab = {\n\t\t0x1F: [\"NA\", 0],\n\t\t// 0x20: [\"ERR\", 0],\n\t\t0x21: [\"ABS\", 1],\n\t\t0x22: [\"TRUNC\", 1],\n\t\t0x23: [\"SQRT\", 1],\n\t\t0x24: [\"LOG\", 1],\n\t\t0x25: [\"LN\", 1],\n\t\t0x26: [\"PI\", 0],\n\t\t0x27: [\"SIN\", 1],\n\t\t0x28: [\"COS\", 1],\n\t\t0x29: [\"TAN\", 1],\n\t\t0x2A: [\"ATAN2\", 2],\n\t\t0x2B: [\"ATAN\", 1],\n\t\t0x2C: [\"ASIN\", 1],\n\t\t0x2D: [\"ACOS\", 1],\n\t\t0x2E: [\"EXP\", 1],\n\t\t0x2F: [\"MOD\", 2],\n\t\t// 0x30\n\t\t0x31: [\"ISNA\", 1],\n\t\t0x32: [\"ISERR\", 1],\n\t\t0x33: [\"FALSE\", 0],\n\t\t0x34: [\"TRUE\", 0],\n\t\t0x35: [\"RAND\", 0],\n\t\t0x36: [\"DATE\", 3],\n\t\t// 0x37 NOW\n\t\t// 0x38 PMT\n\t\t// 0x39 PV\n\t\t// 0x3A FV\n\t\t// 0x3B IF\n\t\t// 0x3C DAY\n\t\t// 0x3D MONTH\n\t\t// 0x3E YEAR\n\t\t0x3F: [\"ROUND\", 2],\n\t\t0x40: [\"TIME\", 3],\n\t\t// 0x41 HOUR\n\t\t// 0x42 MINUTE\n\t\t// 0x43 SECOND\n\t\t0x44: [\"ISNUMBER\", 1],\n\t\t0x45: [\"ISTEXT\", 1],\n\t\t0x46: [\"LEN\", 1],\n\t\t0x47: [\"VALUE\", 1],\n\t\t// 0x48: [\"FIXED\", ?? 1],\n\t\t0x49: [\"MID\", 3],\n\t\t0x4A: [\"CHAR\", 1],\n\t\t// 0x4B\n\t\t// 0x4C FIND\n\t\t// 0x4D DATEVALUE\n\t\t// 0x4E TIMEVALUE\n\t\t// 0x4F CELL\n\t\t0x50: [\"SUM\", 69],\n\t\t0x51: [\"AVERAGEA\", 69],\n\t\t0x52: [\"COUNTA\", 69],\n\t\t0x53: [\"MINA\", 69],\n\t\t0x54: [\"MAXA\", 69],\n\t\t// 0x55 VLOOKUP\n\t\t// 0x56 NPV\n\t\t// 0x57 VAR\n\t\t// 0x58 STD\n\t\t// 0x59 IRR\n\t\t// 0x5A HLOOKUP\n\t\t// 0x5B DSUM\n\t\t// 0x5C DAVERAGE\n\t\t// 0x5D DCOUNTA\n\t\t// 0x5E DMIN\n\t\t// 0x5F DMAX\n\t\t// 0x60 DVARP\n\t\t// 0x61 DSTDEVP\n\t\t// 0x62 INDEX\n\t\t// 0x63 COLS\n\t\t// 0x64 ROWS\n\t\t// 0x65 REPEAT\n\t\t0x66: [\"UPPER\", 1],\n\t\t0x67: [\"LOWER\", 1],\n\t\t// 0x68 LEFT\n\t\t// 0x69 RIGHT\n\t\t// 0x6A REPLACE\n\t\t0x6B: [\"PROPER\", 1],\n\t\t// 0x6C CELL\n\t\t0x6D: [\"TRIM\", 1],\n\t\t// 0x6E CLEAN\n\t\t0x6F: [\"T\", 1]\n\t\t// 0x70 V\n\t};\n\tvar BinOpTab = [\n\t\t \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", // eslint-disable-line no-mixed-spaces-and-tabs\n\t\t \"\", \"+\", \"-\", \"*\", \"/\", \"^\", \"=\", \"<>\", // eslint-disable-line no-mixed-spaces-and-tabs\n\t\t\"<=\", \">=\", \"<\", \">\", \"\", \"\", \"\", \"\", // eslint-disable-line no-mixed-spaces-and-tabs\n\t\t \"&\", \"\", \"\", \"\", \"\", \"\", \"\", \"\" // eslint-disable-line no-mixed-spaces-and-tabs\n\t];\n\n\tfunction wk1_fmla_to_csf(blob, o) {\n\t\tprep_blob(blob, 0);\n\t\tvar out = [], argc = 0, R = \"\", C = \"\", argL = \"\", argR = \"\";\n\t\twhile(blob.l < blob.length) {\n\t\t\tvar cc = blob[blob.l++];\n\t\t\tswitch(cc) {\n\t\t\t\tcase 0x00: out.push(blob.read_shift(8, 'f')); break;\n\t\t\t\tcase 0x01: {\n\t\t\t\t\tC = wk1_parse_rc(o[0].c, blob.read_shift(2), true);\n\t\t\t\t\tR = wk1_parse_rc(o[0].r, blob.read_shift(2), false);\n\t\t\t\t\tout.push(C + R);\n\t\t\t\t} break;\n\t\t\t\tcase 0x02: {\n\t\t\t\t\tvar c = wk1_parse_rc(o[0].c, blob.read_shift(2), true);\n\t\t\t\t\tvar r = wk1_parse_rc(o[0].r, blob.read_shift(2), false);\n\t\t\t\t\tC = wk1_parse_rc(o[0].c, blob.read_shift(2), true);\n\t\t\t\t\tR = wk1_parse_rc(o[0].r, blob.read_shift(2), false);\n\t\t\t\t\tout.push(c + r + \":\" + C + R);\n\t\t\t\t} break;\n\t\t\t\tcase 0x03:\n\t\t\t\t\tif(blob.l < blob.length) { console.error(\"WK1 premature formula end\"); return; }\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0x04: out.push(\"(\" + out.pop() + \")\"); break;\n\t\t\t\tcase 0x05: out.push(blob.read_shift(2)); break;\n\t\t\t\tcase 0x06: {\n\t\t\t\t\t/* TODO: text encoding */\n\t\t\t\t\tvar Z = \"\"; while((cc = blob[blob.l++])) Z += String.fromCharCode(cc);\n\t\t\t\t\tout.push('\"' + Z.replace(/\"/g, '\"\"') + '\"');\n\t\t\t\t} break;\n\n\t\t\t\tcase 0x08: out.push(\"-\" + out.pop()); break;\n\t\t\t\tcase 0x17: out.push(\"+\" + out.pop()); break;\n\t\t\t\tcase 0x16: out.push(\"NOT(\" + out.pop() + \")\"); break;\n\n\t\t\t\tcase 0x14: case 0x15: {\n\t\t\t\t\targR = out.pop(); argL = out.pop();\n\t\t\t\t\tout.push([\"AND\", \"OR\"][cc - 0x14] + \"(\" + argL + \",\" + argR + \")\");\n\t\t\t\t} break;\n\n\t\t\t\tdefault:\n\t\t\t\t\tif(cc < 0x20 && BinOpTab[cc]) {\n\t\t\t\t\t\targR = out.pop(); argL = out.pop();\n\t\t\t\t\t\tout.push(argL + BinOpTab[cc] + argR);\n\t\t\t\t\t} else if(FuncTab[cc]) {\n\t\t\t\t\t\targc = FuncTab[cc][1];\n\t\t\t\t\t\tif(argc == 69) argc = blob[blob.l++];\n\t\t\t\t\t\tif(argc > out.length) { console.error(\"WK1 bad formula parse 0x\" + cc.toString(16) + \":|\" + out.join(\"|\") + \"|\"); return; }\n\t\t\t\t\t\tvar args = out.slice(-argc);\n\t\t\t\t\t\tout.length -= argc;\n\t\t\t\t\t\tout.push(FuncTab[cc][0] + \"(\" + args.join(\",\") + \")\");\n\t\t\t\t\t}\n\t\t\t\t\telse if(cc <= 0x07) return console.error(\"WK1 invalid opcode \" + cc.toString(16));\n\t\t\t\t\telse if(cc <= 0x18) return console.error(\"WK1 unsupported op \" + cc.toString(16));\n\t\t\t\t\telse if(cc <= 0x1E) return console.error(\"WK1 invalid opcode \" + cc.toString(16));\n\t\t\t\t\telse if(cc <= 0x73) return console.error(\"WK1 unsupported function opcode \" + cc.toString(16));\n\t\t\t\t\t// possible future functions ??\n\t\t\t\t\telse return console.error(\"WK1 unrecognized opcode \" + cc.toString(16));\n\t\t\t}\n\t\t}\n\t\tif(out.length == 1) o[1].f = \"\" + out[0];\n\t\telse console.error(\"WK1 bad formula parse |\" + out.join(\"|\") + \"|\");\n\t}\n\n\tfunction parse_cell_3(blob/*::, length*/) {\n\t\tvar o = [{c:0,r:0}, {t:'n',v:0}, 0];\n\t\to[0].r = blob.read_shift(2); o[3] = blob[blob.l++]; o[0].c = blob[blob.l++];\n\t\treturn o;\n\t}\n\n\tfunction parse_LABEL_16(blob, length) {\n\t\tvar o = parse_cell_3(blob, length);\n\t\to[1].t = 's';\n\t\to[1].v = blob.read_shift(length - 4, 'cstr');\n\t\treturn o;\n\t}\n\tfunction write_LABEL_16(R, C, wsidx, s) {\n\t\t/* TODO: encoding */\n\t\tvar o = new_buf(6 + s.length);\n\t\to.write_shift(2, R);\n\t\to.write_shift(1, wsidx);\n\t\to.write_shift(1, C);\n\t\to.write_shift(1, 0x27);\n\t\tfor(var i = 0; i < s.length; ++i) {\n\t\t\tvar cc = s.charCodeAt(i);\n\t\t\to.write_shift(1, cc >= 0x80 ? 0x5F : cc);\n\t\t}\n\t\to.write_shift(1, 0);\n\t\treturn o;\n\t}\n\n\tfunction parse_NUMBER_18(blob, length) {\n\t\tvar o = parse_cell_3(blob, length);\n\t\to[1].v = blob.read_shift(2);\n\t\tvar v = o[1].v >> 1;\n\t\tif(o[1].v & 0x1) {\n\t\t\tswitch(v & 0x07) {\n\t\t\t\tcase 0: v = (v >> 3) * 5000; break;\n\t\t\t\tcase 1: v = (v >> 3) * 500; break;\n\t\t\t\tcase 2: v = (v >> 3) / 20; break;\n\t\t\t\tcase 3: v = (v >> 3) / 200; break;\n\t\t\t\tcase 4: v = (v >> 3) / 2000; break;\n\t\t\t\tcase 5: v = (v >> 3) / 20000; break;\n\t\t\t\tcase 6: v = (v >> 3) / 16; break;\n\t\t\t\tcase 7: v = (v >> 3) / 64; break;\n\t\t\t}\n\t\t}\n\t\to[1].v = v;\n\t\treturn o;\n\t}\n\n\tfunction parse_NUMBER_17(blob, length) {\n\t\tvar o = parse_cell_3(blob, length);\n\t\tvar v1 = blob.read_shift(4);\n\t\tvar v2 = blob.read_shift(4);\n\t\tvar e = blob.read_shift(2);\n\t\tif(e == 0xFFFF) {\n\t\t\tif(v1 === 0 && v2 === 0xC0000000) { o[1].t = \"e\"; o[1].v = 0x0F; } // ERR -> #VALUE!\n\t\t\telse if(v1 === 0 && v2 === 0xD0000000) { o[1].t = \"e\"; o[1].v = 0x2A; } // NA -> #N/A\n\t\t\telse o[1].v = 0;\n\t\t\treturn o;\n\t\t}\n\t\tvar s = e & 0x8000; e = (e&0x7FFF) - 16446;\n\t\to[1].v = (1 - s*2) * (v2 * Math.pow(2, e+32) + v1 * Math.pow(2, e));\n\t\treturn o;\n\t}\n\tfunction write_NUMBER_17(R, C, wsidx, v) {\n\t\tvar o = new_buf(14);\n\t\to.write_shift(2, R);\n\t\to.write_shift(1, wsidx);\n\t\to.write_shift(1, C);\n\t\tif(v == 0) {\n\t\t\to.write_shift(4, 0);\n\t\t\to.write_shift(4, 0);\n\t\t\to.write_shift(2, 0xFFFF);\n\t\t\treturn o;\n\t\t}\n\t\tvar s = 0, e = 0, v1 = 0, v2 = 0;\n\t\tif(v < 0) { s = 1; v = -v; }\n\t\te = Math.log2(v) | 0;\n\t\tv /= Math.pow(2, e-31);\n\t\tv2 = (v)>>>0;\n\t\tif((v2&0x80000000) == 0) { v/=2; ++e; v2 = v >>> 0; }\n\t\tv -= v2;\n\t\tv2 |= 0x80000000;\n\t\tv2 >>>= 0;\n\t\tv *= Math.pow(2, 32);\n\t\tv1 = v>>>0;\n\t\to.write_shift(4, v1);\n\t\to.write_shift(4, v2);\n\t\te += 0x3FFF + (s ? 0x8000 : 0);\n\t\to.write_shift(2, e);\n\t\treturn o;\n\t}\n\n\tfunction parse_FORMULA_19(blob, length) {\n\t\tvar o = parse_NUMBER_17(blob, 14);\n\t\tblob.l += length - 14; /* TODO: WK3 formula */\n\t\treturn o;\n\t}\n\n\tfunction parse_NUMBER_25(blob, length) {\n\t\tvar o = parse_cell_3(blob, length);\n\t\tvar v1 = blob.read_shift(4);\n\t\to[1].v = v1 >> 6;\n\t\treturn o;\n\t}\n\n\tfunction parse_NUMBER_27(blob, length) {\n\t\tvar o = parse_cell_3(blob, length);\n\t\tvar v1 = blob.read_shift(8,'f');\n\t\to[1].v = v1;\n\t\treturn o;\n\t}\n\n\tfunction parse_FORMULA_28(blob, length) {\n\t\tvar o = parse_NUMBER_27(blob, 12);\n\t\tblob.l += length - 12; /* TODO: formula */\n\t\treturn o;\n\t}\n\n\tfunction parse_SHEETNAMECS(blob, length) {\n\t\treturn blob[blob.l + length - 1] == 0 ? blob.read_shift(length, 'cstr') : \"\";\n\t}\n\n\tfunction parse_SHEETNAMELP(blob, length) {\n\t\tvar len = blob[blob.l++];\n\t\tif(len > length - 1) len = length - 1;\n\t\tvar o = \"\"; while(o.length < len) o += String.fromCharCode(blob[blob.l++]);\n\t\treturn o;\n\t}\n\n\tfunction parse_SHEETINFOQP(blob, length, opts) {\n\t\tif(!opts.qpro || length < 21) return;\n\t\tvar id = blob.read_shift(1);\n\t\tblob.l += 17;\n\t\tblob.l += 1; //var len = blob.read_shift(1);\n\t\tblob.l += 2;\n\t\tvar nm = blob.read_shift(length - 21, 'cstr');\n\t\treturn [id, nm];\n\t}\n\n\tfunction parse_XFORMAT(blob, length) {\n\t\tvar o = {}, tgt = blob.l + length;\n\t\twhile(blob.l < tgt) {\n\t\t\tvar dt = blob.read_shift(2);\n\t\t\tif(dt == 0x36b0) {\n\t\t\t\to[dt] = [0, \"\"];\n\t\t\t\to[dt][0] = blob.read_shift(2);\n\t\t\t\twhile(blob[blob.l]) { o[dt][1] += String.fromCharCode(blob[blob.l]); blob.l++; } blob.l++;\n\t\t\t}\n\t\t\t// TODO: 0x3a99 ??\n\t\t}\n\t\treturn o;\n\t}\n\tfunction write_XFORMAT_SHEETNAME(name, wsidx) {\n\t\tvar out = new_buf(5 + name.length);\n\t\tout.write_shift(2, 0x36b0);\n\t\tout.write_shift(2, wsidx);\n\t\tfor(var i = 0; i < name.length; ++i) {\n\t\t\tvar cc = name.charCodeAt(i);\n\t\t\tout[out.l++] = cc > 0x7F ? 0x5F : cc;\n\t\t}\n\t\tout[out.l++] = 0;\n\t\treturn out;\n\t}\n\n\tvar WK1Enum = {\n\t\t0x0000: { n:\"BOF\", f:parseuint16 },\n\t\t0x0001: { n:\"EOF\" },\n\t\t0x0002: { n:\"CALCMODE\" },\n\t\t0x0003: { n:\"CALCORDER\" },\n\t\t0x0004: { n:\"SPLIT\" },\n\t\t0x0005: { n:\"SYNC\" },\n\t\t0x0006: { n:\"RANGE\", f:parse_RANGE },\n\t\t0x0007: { n:\"WINDOW1\" },\n\t\t0x0008: { n:\"COLW1\" },\n\t\t0x0009: { n:\"WINTWO\" },\n\t\t0x000A: { n:\"COLW2\" },\n\t\t0x000B: { n:\"NAME\" },\n\t\t0x000C: { n:\"BLANK\" },\n\t\t0x000D: { n:\"INTEGER\", f:parse_INTEGER },\n\t\t0x000E: { n:\"NUMBER\", f:parse_NUMBER },\n\t\t0x000F: { n:\"LABEL\", f:parse_LABEL },\n\t\t0x0010: { n:\"FORMULA\", f:parse_FORMULA },\n\t\t0x0018: { n:\"TABLE\" },\n\t\t0x0019: { n:\"ORANGE\" },\n\t\t0x001A: { n:\"PRANGE\" },\n\t\t0x001B: { n:\"SRANGE\" },\n\t\t0x001C: { n:\"FRANGE\" },\n\t\t0x001D: { n:\"KRANGE1\" },\n\t\t0x0020: { n:\"HRANGE\" },\n\t\t0x0023: { n:\"KRANGE2\" },\n\t\t0x0024: { n:\"PROTEC\" },\n\t\t0x0025: { n:\"FOOTER\" },\n\t\t0x0026: { n:\"HEADER\" },\n\t\t0x0027: { n:\"SETUP\" },\n\t\t0x0028: { n:\"MARGINS\" },\n\t\t0x0029: { n:\"LABELFMT\" },\n\t\t0x002A: { n:\"TITLES\" },\n\t\t0x002B: { n:\"SHEETJS\" },\n\t\t0x002D: { n:\"GRAPH\" },\n\t\t0x002E: { n:\"NGRAPH\" },\n\t\t0x002F: { n:\"CALCCOUNT\" },\n\t\t0x0030: { n:\"UNFORMATTED\" },\n\t\t0x0031: { n:\"CURSORW12\" },\n\t\t0x0032: { n:\"WINDOW\" },\n\t\t0x0033: { n:\"STRING\", f:parse_STRING },\n\t\t0x0037: { n:\"PASSWORD\" },\n\t\t0x0038: { n:\"LOCKED\" },\n\t\t0x003C: { n:\"QUERY\" },\n\t\t0x003D: { n:\"QUERYNAME\" },\n\t\t0x003E: { n:\"PRINT\" },\n\t\t0x003F: { n:\"PRINTNAME\" },\n\t\t0x0040: { n:\"GRAPH2\" },\n\t\t0x0041: { n:\"GRAPHNAME\" },\n\t\t0x0042: { n:\"ZOOM\" },\n\t\t0x0043: { n:\"SYMSPLIT\" },\n\t\t0x0044: { n:\"NSROWS\" },\n\t\t0x0045: { n:\"NSCOLS\" },\n\t\t0x0046: { n:\"RULER\" },\n\t\t0x0047: { n:\"NNAME\" },\n\t\t0x0048: { n:\"ACOMM\" },\n\t\t0x0049: { n:\"AMACRO\" },\n\t\t0x004A: { n:\"PARSE\" },\n\t\t// 0x0064\n\t\t0x0066: { n:\"PRANGES??\" },\n\t\t0x0067: { n:\"RRANGES??\" },\n\t\t0x0068: { n:\"FNAME??\" },\n\t\t0x0069: { n:\"MRANGES??\" },\n\t\t// 0x0096\n\t\t// 0x0099\n\t\t// 0x009A\n\t\t// 0x009B\n\t\t// 0x009C\n\t\t// 0x00C0\n\t\t// 0x00C7\n\t\t// 0x00C9\n\t\t0x00CC: { n:\"SHEETNAMECS\", f:parse_SHEETNAMECS },\n\t\t// 0x00CD\n\t\t0x00DE: { n:\"SHEETNAMELP\", f:parse_SHEETNAMELP },\n\t\t0x00FF: { n:\"BOF\", f:parseuint16 },\n\t\t0x5402: { n:\"WKSNF\", f:parseuint16 },\n\t\t0xFFFF: { n:\"\" }\n\t};\n\n\tvar WK3Enum = {\n\t\t0x0000: { n:\"BOF\" },\n\t\t0x0001: { n:\"EOF\" },\n\t\t0x0002: { n:\"PASSWORD\" },\n\t\t0x0003: { n:\"CALCSET\" },\n\t\t0x0004: { n:\"WINDOWSET\" },\n\t\t0x0005: { n:\"SHEETCELLPTR\" },\n\t\t0x0006: { n:\"SHEETLAYOUT\" },\n\t\t0x0007: { n:\"COLUMNWIDTH\" },\n\t\t0x0008: { n:\"HIDDENCOLUMN\" },\n\t\t0x0009: { n:\"USERRANGE\" },\n\t\t0x000A: { n:\"SYSTEMRANGE\" },\n\t\t0x000B: { n:\"ZEROFORCE\" },\n\t\t0x000C: { n:\"SORTKEYDIR\" },\n\t\t0x000D: { n:\"FILESEAL\" },\n\t\t0x000E: { n:\"DATAFILLNUMS\" },\n\t\t0x000F: { n:\"PRINTMAIN\" },\n\t\t0x0010: { n:\"PRINTSTRING\" },\n\t\t0x0011: { n:\"GRAPHMAIN\" },\n\t\t0x0012: { n:\"GRAPHSTRING\" },\n\t\t0x0013: { n:\"??\" },\n\t\t0x0014: { n:\"ERRCELL\" },\n\t\t0x0015: { n:\"NACELL\" },\n\t\t0x0016: { n:\"LABEL16\", f:parse_LABEL_16},\n\t\t0x0017: { n:\"NUMBER17\", f:parse_NUMBER_17 },\n\t\t0x0018: { n:\"NUMBER18\", f:parse_NUMBER_18 },\n\t\t0x0019: { n:\"FORMULA19\", f:parse_FORMULA_19},\n\t\t0x001A: { n:\"FORMULA1A\" },\n\t\t0x001B: { n:\"XFORMAT\", f:parse_XFORMAT },\n\t\t0x001C: { n:\"DTLABELMISC\" },\n\t\t0x001D: { n:\"DTLABELCELL\" },\n\t\t0x001E: { n:\"GRAPHWINDOW\" },\n\t\t0x001F: { n:\"CPA\" },\n\t\t0x0020: { n:\"LPLAUTO\" },\n\t\t0x0021: { n:\"QUERY\" },\n\t\t0x0022: { n:\"HIDDENSHEET\" },\n\t\t0x0023: { n:\"??\" },\n\t\t0x0025: { n:\"NUMBER25\", f:parse_NUMBER_25 },\n\t\t0x0026: { n:\"??\" },\n\t\t0x0027: { n:\"NUMBER27\", f:parse_NUMBER_27 },\n\t\t0x0028: { n:\"FORMULA28\", f:parse_FORMULA_28 },\n\t\t0x008E: { n:\"??\" },\n\t\t0x0093: { n:\"??\" },\n\t\t0x0096: { n:\"??\" },\n\t\t0x0097: { n:\"??\" },\n\t\t0x0098: { n:\"??\" },\n\t\t0x0099: { n:\"??\" },\n\t\t0x009A: { n:\"??\" },\n\t\t0x009B: { n:\"??\" },\n\t\t0x009C: { n:\"??\" },\n\t\t0x00A3: { n:\"??\" },\n\t\t0x00AE: { n:\"??\" },\n\t\t0x00AF: { n:\"??\" },\n\t\t0x00B0: { n:\"??\" },\n\t\t0x00B1: { n:\"??\" },\n\t\t0x00B8: { n:\"??\" },\n\t\t0x00B9: { n:\"??\" },\n\t\t0x00BA: { n:\"??\" },\n\t\t0x00BB: { n:\"??\" },\n\t\t0x00BC: { n:\"??\" },\n\t\t0x00C3: { n:\"??\" },\n\t\t0x00C9: { n:\"??\" },\n\t\t0x00CC: { n:\"SHEETNAMECS\", f:parse_SHEETNAMECS },\n\t\t0x00CD: { n:\"??\" },\n\t\t0x00CE: { n:\"??\" },\n\t\t0x00CF: { n:\"??\" },\n\t\t0x00D0: { n:\"??\" },\n\t\t0x0100: { n:\"??\" },\n\t\t0x0103: { n:\"??\" },\n\t\t0x0104: { n:\"??\" },\n\t\t0x0105: { n:\"??\" },\n\t\t0x0106: { n:\"??\" },\n\t\t0x0107: { n:\"??\" },\n\t\t0x0109: { n:\"??\" },\n\t\t0x010A: { n:\"??\" },\n\t\t0x010B: { n:\"??\" },\n\t\t0x010C: { n:\"??\" },\n\t\t0x010E: { n:\"??\" },\n\t\t0x010F: { n:\"??\" },\n\t\t0x0180: { n:\"??\" },\n\t\t0x0185: { n:\"??\" },\n\t\t0x0186: { n:\"??\" },\n\t\t0x0189: { n:\"??\" },\n\t\t0x018C: { n:\"??\" },\n\t\t0x0200: { n:\"??\" },\n\t\t0x0202: { n:\"??\" },\n\t\t0x0201: { n:\"??\" },\n\t\t0x0204: { n:\"??\" },\n\t\t0x0205: { n:\"??\" },\n\t\t0x0280: { n:\"??\" },\n\t\t0x0281: { n:\"??\" },\n\t\t0x0282: { n:\"??\" },\n\t\t0x0283: { n:\"??\" },\n\t\t0x0284: { n:\"??\" },\n\t\t0x0285: { n:\"??\" },\n\t\t0x0286: { n:\"??\" },\n\t\t0x0287: { n:\"??\" },\n\t\t0x0288: { n:\"??\" },\n\t\t0x0292: { n:\"??\" },\n\t\t0x0293: { n:\"??\" },\n\t\t0x0294: { n:\"??\" },\n\t\t0x0295: { n:\"??\" },\n\t\t0x0296: { n:\"??\" },\n\t\t0x0299: { n:\"??\" },\n\t\t0x029A: { n:\"??\" },\n\t\t0x0300: { n:\"??\" },\n\t\t0x0304: { n:\"??\" },\n\t\t0x0601: { n:\"SHEETINFOQP\", f:parse_SHEETINFOQP },\n\t\t0x0640: { n:\"??\" },\n\t\t0x0642: { n:\"??\" },\n\t\t0x0701: { n:\"??\" },\n\t\t0x0702: { n:\"??\" },\n\t\t0x0703: { n:\"??\" },\n\t\t0x0704: { n:\"??\" },\n\t\t0x0780: { n:\"??\" },\n\t\t0x0800: { n:\"??\" },\n\t\t0x0801: { n:\"??\" },\n\t\t0x0804: { n:\"??\" },\n\t\t0x0A80: { n:\"??\" },\n\t\t0x2AF6: { n:\"??\" },\n\t\t0x3231: { n:\"??\" },\n\t\t0x6E49: { n:\"??\" },\n\t\t0x6F44: { n:\"??\" },\n\t\t0xFFFF: { n:\"\" }\n\t};\n\n\t/* TODO: fill out and verify this table across QP versions */\n\tvar QPWNFTable = {\n\t\t0x05: \"dd-mmm-yy\",\n\t\t0x06: \"dd-mmm\",\n\t\t0x07: \"mmm-yy\",\n\t\t0x08: \"mm/dd/yy\", // Long Date Intl\n\t\t0x0A: \"hh:mm:ss AM/PM\",\n\t\t0x0B: \"hh:mm AM/PM\",\n\t\t0x0E: \"dd-mmm-yyyy\",\n\t\t0x0F: \"mmm-yyyy\",\n\n\t\t/* It is suspected that the the low nybble specifies decimal places */\n\t\t0x0022: \"0.00\",\n\t\t0x0032: \"0.00;[Red]0.00\",\n\t\t0x0042: \"0.00;\\(0.00\\)\",\n\t\t0x0052: \"0.00;[Red]\\(0.00\\)\",\n\t\t0x00A2: '\"$\"#,##0.00;\\\\(\"$\"#,##0.00\\\\)',\n\t\t0x0120: '0%',\n\t\t0x0130: '0E+00',\n\t\t0x0140: '# ?/?'\n\t};\n\n\tfunction parse_qpw_str(p) {\n\t\tvar cch = p.read_shift(2);\n\t\tvar flags = p.read_shift(1);\n\t\t/* TODO: find examples with nonzero flags */\n\t\tif(flags != 0) throw \"unsupported QPW string type \" + flags.toString(16);\n\t\treturn p.read_shift(cch, \"sbcs-cont\");\n\t}\n\n\t/* QPW uses a different set of record types */\n\tfunction qpw_to_workbook_buf(d, opts)/*:Workbook*/ {\n\t\tprep_blob(d, 0);\n\t\tvar o = opts || {};\n\t\tif(DENSE != null && o.dense == null) o.dense = DENSE;\n\t\tvar s/*:Worksheet*/ = ({}/*:any*/); if(o.dense) s[\"!data\"] = [];\n\t\tvar SST = [], sname = \"\", formulae = [];\n\t\tvar range = {s:{r:-1,c:-1}, e:{r:-1,c:-1}};\n\t\tvar cnt = 0, type = 0, C = 0, R = 0;\n\t\tvar wb = { SheetNames: [], Sheets: {} };\n\t\tvar FMTS = [];\n\t\touter: while(d.l < d.length) {\n\t\t\tvar RT = d.read_shift(2), length = d.read_shift(2);\n\t\t\tvar p = d.slice(d.l, d.l + length);\n\t\t\tprep_blob(p, 0);\n\t\t\tswitch(RT) {\n\t\t\t\tcase 0x01: /* BOF */\n\t\t\t\t\tif(p.read_shift(4) != 0x39575051) throw \"Bad QPW9 BOF!\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0x02: /* EOF */ break outer;\n\n\t\t\t\tcase 0x08: /* NF */ break; // TODO: this is tied to custom number formats\n\n\t\t\t\tcase 0x0A: /* FORMATS */ {\n\t\t\t\t\tvar fcnt = p.read_shift(4);\n\t\t\t\t\tvar step = ((p.length - p.l)/ fcnt)|0;\n\t\t\t\t\tfor(var ifmt = 0; ifmt < fcnt; ++ifmt) {\n\t\t\t\t\t\tvar end = p.l + step;\n\t\t\t\t\t\tvar fmt = {};\n\t\t\t\t\t\tp.l += 2;\n\t\t\t\t\t\tfmt.numFmtId = p.read_shift(2);\n\t\t\t\t\t\tif(QPWNFTable[fmt.numFmtId]) fmt.z = QPWNFTable[fmt.numFmtId];\n\t\t\t\t\t\tp.l = end;\n\t\t\t\t\t\tFMTS.push(fmt);\n\t\t\t\t\t}\n\t\t\t\t} break;\n\n\t\t\t\t/* TODO: The behavior here should be consistent with Numbers: QP Notebook ~ .TN.SheetArchive, QP Sheet ~ .TST.TableModelArchive */\n\t\t\t\tcase 0x0401: /* BON */ break;\n\t\t\t\tcase 0x0402: /* EON */ /* TODO: backfill missing sheets based on BON cnt */ break;\n\n\t\t\t\tcase 0x0407: { /* SST */\n\t\t\t\t\tp.l += 12;\n\t\t\t\t\twhile(p.l < p.length) {\n\t\t\t\t\t\tcnt = p.read_shift(2);\n\t\t\t\t\t\ttype = p.read_shift(1);\n\t\t\t\t\t\tSST.push(p.read_shift(cnt, 'cstr'));\n\t\t\t\t\t}\n\t\t\t\t} break;\n\t\t\t\tcase 0x0408: { /* FORMULAE */\n\t\t\t\t\t//p.l += 12;\n\t\t\t\t\t//while(p.l < p.length) {\n\t\t\t\t\t//\tcnt = p.read_shift(2);\n\t\t\t\t\t//\tformulae.push(p.slice(p.l, p.l + cnt + 1)); p.l += cnt + 1;\n\t\t\t\t\t//}\n\t\t\t\t} break;\n\n\t\t\t\tcase 0x0601: { /* BOS */\n\t\t\t\t\tvar sidx = p.read_shift(2);\n\t\t\t\t\ts = ({}/*:any*/); if(o.dense) s[\"!data\"] = [];\n\t\t\t\t\trange.s.c = p.read_shift(2);\n\t\t\t\t\trange.e.c = p.read_shift(2);\n\t\t\t\t\trange.s.r = p.read_shift(4);\n\t\t\t\t\trange.e.r = p.read_shift(4);\n\t\t\t\t\tp.l += 4;\n\t\t\t\t\tif(p.l + 2 < p.length) {\n\t\t\t\t\t\tcnt = p.read_shift(2);\n\t\t\t\t\t\ttype = p.read_shift(1);\n\t\t\t\t\t\tsname = cnt == 0 ? \"\" : p.read_shift(cnt, 'cstr');\n\t\t\t\t\t}\n\t\t\t\t\tif(!sname) sname = encode_col(sidx);\n\t\t\t\t\t/* TODO: backfill empty sheets */\n\t\t\t\t} break;\n\t\t\t\tcase 0x0602: { /* EOS */\n\t\t\t\t\t/* NOTE: QP valid range A1:IV1000000 */\n\t\t\t\t\tif(range.s.c > 0xFF || range.s.r > 999999) break;\n\t\t\t\t\tif(range.e.c < range.s.c) range.e.c = range.s.c;\n\t\t\t\t\tif(range.e.r < range.s.r) range.e.r = range.s.r;\n\t\t\t\t\ts[\"!ref\"] = encode_range(range);\n\t\t\t\t\tbook_append_sheet(wb, s, sname); // TODO: a barrel roll\n\t\t\t\t} break;\n\n\t\t\t\tcase 0x0A01: { /* COL (like XLS Row, modulo the layout transposition) */\n\t\t\t\t\tC = p.read_shift(2);\n\t\t\t\t\tif(range.e.c < C) range.e.c = C;\n\t\t\t\t\tif(range.s.c > C) range.s.c = C;\n\t\t\t\t\tR = p.read_shift(4);\n\t\t\t\t\tif(range.s.r > R) range.s.r = R;\n\t\t\t\t\tR = p.read_shift(4);\n\t\t\t\t\tif(range.e.r < R) range.e.r = R;\n\t\t\t\t} break;\n\n\t\t\t\tcase 0x0C01: { /* MulCells (like XLS MulRK, but takes advantage of common column data patterns) */\n\t\t\t\t\tR = p.read_shift(4), cnt = p.read_shift(4);\n\t\t\t\t\tif(range.s.r > R) range.s.r = R;\n\t\t\t\t\tif(range.e.r < R + cnt - 1) range.e.r = R + cnt - 1;\n\t\t\t\t\tvar CC = encode_col(C);\n\t\t\t\t\twhile(p.l < p.length) {\n\t\t\t\t\t\tvar cell = { t: \"z\" };\n\t\t\t\t\t\tvar flags = p.read_shift(1), fmtidx = -1;\n\t\t\t\t\t\tif(flags & 0x80) fmtidx = p.read_shift(2);\n\t\t\t\t\t\tvar mul = (flags & 0x40) ? p.read_shift(2) - 1: 0;\n\t\t\t\t\t\tswitch(flags & 0x1F) {\n\t\t\t\t\t\t\tcase 0: break;\n\t\t\t\t\t\t\tcase 1: break;\n\t\t\t\t\t\t\tcase 2: cell = { t: \"n\", v: p.read_shift(2) }; break;\n\t\t\t\t\t\t\tcase 3: cell = { t: \"n\", v: p.read_shift(2, 'i') }; break;\n\t\t\t\t\t\t\tcase 4: cell = { t: \"n\", v: parse_RkNumber(p) }; break;\n\t\t\t\t\t\t\tcase 5: cell = { t: \"n\", v: p.read_shift(8, 'f') }; break;\n\t\t\t\t\t\t\tcase 7: cell = { t: \"s\", v: SST[type = p.read_shift(4) - 1] }; break;\n\t\t\t\t\t\t\tcase 8:\n\t\t\t\t\t\t\t\tcell = { t: \"n\", v: p.read_shift(8, 'f') };\n\t\t\t\t\t\t\t\tp.l += 2; /* cell.f = formulae[p.read_shift(4)]; */ p.l += 4;\n\t\t\t\t\t\t\t\tif(isNaN(cell.v)) cell = { t: \"e\", v: 0x0F }; // #VALUE!\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault: throw \"Unrecognized QPW cell type \" + (flags & 0x1F);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(fmtidx != -1 && (FMTS[fmtidx - 1]||{}).z) cell.z = FMTS[fmtidx-1].z;\n\t\t\t\t\t\tvar delta = 0;\n\t\t\t\t\t\tif(flags & 0x20) switch(flags & 0x1F) {\n\t\t\t\t\t\t\tcase 2: delta = p.read_shift(2); break;\n\t\t\t\t\t\t\tcase 3: delta = p.read_shift(2, 'i'); break;\n\t\t\t\t\t\t\tcase 7: delta = p.read_shift(2); break;\n\t\t\t\t\t\t\tdefault: throw \"Unsupported delta for QPW cell type \" + (flags & 0x1F);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!(!o.sheetStubs && cell.t == \"z\")) {\n\t\t\t\t\t\t\tvar newcell = dup(cell);\n\t\t\t\t\t\t\tif(cell.t == \"n\" && cell.z && fmt_is_date(cell.z) && o.cellDates) {\n\t\t\t\t\t\t\t\tnewcell.v = numdate(cell.v); newcell.t = typeof newcell.v == \"number\" ? 'n' : 'd';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(s[\"!data\"] != null) {\n\t\t\t\t\t\t\t\tif(!s[\"!data\"][R]) s[\"!data\"][R] = [];\n\t\t\t\t\t\t\t\ts[\"!data\"][R][C] = newcell;\n\t\t\t\t\t\t\t} else s[CC + encode_row(R)] = newcell;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t++R; --cnt;\n\t\t\t\t\t\twhile(mul-- > 0 && cnt >= 0) {\n\t\t\t\t\t\t\tif(flags & 0x20) switch(flags & 0x1F) {\n\t\t\t\t\t\t\t\tcase 2: cell = { t: \"n\", v: (cell.v + delta) & 0xFFFF }; break;\n\t\t\t\t\t\t\t\tcase 3: cell = { t: \"n\", v: (cell.v + delta) & 0xFFFF }; if(cell.v > 0x7FFF) cell.v -= 0x10000; break;\n\t\t\t\t\t\t\t\tcase 7: cell = { t: \"s\", v: SST[type = (type + delta) >>> 0] }; break;\n\t\t\t\t\t\t\t\tdefault: throw \"Cannot apply delta for QPW cell type \" + (flags & 0x1F);\n\t\t\t\t\t\t\t} else switch(flags & 0x1F) {\n\t\t\t\t\t\t\t\tcase 1: cell = { t: \"z\" }; break;\n\t\t\t\t\t\t\t\tcase 2: cell = { t: \"n\", v: p.read_shift(2) }; break;\n\t\t\t\t\t\t\t\tcase 7: cell = { t: \"s\", v: SST[type = p.read_shift(4) - 1] }; break;\n\t\t\t\t\t\t\t\tdefault: throw \"Cannot apply repeat for QPW cell type \" + (flags & 0x1F);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(fmtidx != -1);\n\t\t\t\t\t\t\tif(!(!o.sheetStubs && cell.t == \"z\")) {\n\t\t\t\t\t\t\t\tif(s[\"!data\"] != null) {\n\t\t\t\t\t\t\t\t\tif(!s[\"!data\"][R]) s[\"!data\"][R] = [];\n\t\t\t\t\t\t\t\t\ts[\"!data\"][R][C] = cell;\n\t\t\t\t\t\t\t\t} else s[CC + encode_row(R)] = cell;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t++R; --cnt;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} break;\n\n\t\t\t\tcase 0x0C02: { /* String (result of string formula expression) */\n\t\t\t\t\tC = p.read_shift(2);\n\t\t\t\t\tR = p.read_shift(4);\n\t\t\t\t\tvar str = parse_qpw_str(p);\n\t\t\t\t\t/* TODO: QP10 record has an additional unknown character after the string */\n\t\t\t\t\tif(s[\"!data\"] != null) {\n\t\t\t\t\t\tif(!s[\"!data\"][R]) s[\"!data\"][R] = [];\n\t\t\t\t\t\ts[\"!data\"][R][C] = { t:\"s\", v:str };\n\t\t\t\t\t} else s[encode_col(C) + encode_row(R)] = { t:\"s\", v:str };\n\t\t\t\t} break;\n\n\t\t\t\tdefault: break;\n\t\t\t}\n\t\t\td.l += length;\n\t\t}\n\t\treturn wb;\n\t}\n\n\treturn {\n\t\tsheet_to_wk1: sheet_to_wk1,\n\t\tbook_to_wk3: book_to_wk3,\n\t\tto_workbook: lotus_to_workbook\n\t};\n})();\n/* 18.4.7 rPr CT_RPrElt */\nfunction parse_rpr(rpr) {\n\tvar font = {}, m = rpr.match(tagregex), i = 0;\n\tvar pass = false;\n\tif(m) for(;i!=m.length; ++i) {\n\t\tvar y = parsexmltag(m[i]);\n\t\tswitch(y[0].replace(/<\\w*:/g,\"<\")) {\n\t\t\t/* 18.8.12 condense CT_BooleanProperty */\n\t\t\t/* ** not required . */\n\t\t\tcase '':\n\t\t\tcase '': font.shadow = 1; break;\n\t\t\tcase '': break;\n\n\t\t\t/* 18.4.1 charset CT_IntProperty TODO */\n\t\t\tcase '':\n\t\t\tcase '': font.outline = 1; break;\n\t\t\tcase '': break;\n\n\t\t\t/* 18.4.5 rFont CT_FontName */\n\t\t\tcase '':\n\t\t\tcase '': font.strike = 1; break;\n\t\t\tcase '': break;\n\n\t\t\t/* 18.4.13 u CT_UnderlineProperty */\n\t\t\tcase '':\n\t\t\tcase '': font.u = 1; break;\n\t\t\tcase '': break;\n\n\t\t\t/* 18.8.2 b */\n\t\t\tcase '':\n\t\t\tcase '': font.b = 1; break;\n\t\t\tcase '': break;\n\n\t\t\t/* 18.8.26 i */\n\t\t\tcase '':\n\t\t\tcase '': font.i = 1; break;\n\t\t\tcase '': break;\n\n\t\t\t/* 18.3.1.15 color CT_Color TODO: tint, theme, auto, indexed */\n\t\t\tcase '': case '': case '': break;\n\n\t\t\t/* 18.8.18 family ST_FontFamily */\n\t\t\tcase '': case '': case '': break;\n\n\t\t\t/* 18.4.14 vertAlign CT_VerticalAlignFontProperty TODO */\n\t\t\tcase '': case '': case '': break;\n\n\t\t\t/* 18.8.35 scheme CT_FontScheme TODO */\n\t\t\tcase '': case '': case '': break;\n\n\t\t\t/* 18.2.10 extLst CT_ExtensionList ? */\n\t\t\tcase '': case '': break;\n\t\t\tcase '': pass = false; break;\n\t\t\tdefault:\n\t\t\t\tif(y[0].charCodeAt(1) !== 47 && !pass) throw new Error('Unrecognized rich format ' + y[0]);\n\t\t}\n\t}\n\treturn font;\n}\n\nvar parse_rs = /*#__PURE__*/(function() {\n\t/* 18.4.4 r CT_RElt */\n\tfunction parse_r(r) {\n\t\t/* 18.4.12 t ST_Xstring */\n\t\tvar t = str_match_xml_ns(r, \"t\")/*, cp = 65001*/;\n\t\tif(!t) return {t:\"s\", v:\"\"};\n\n\t\tvar o/*:Cell*/ = ({t:'s', v:unescapexml(t[1])}/*:any*/);\n\t\tvar rpr = str_match_xml_ns(r, \"rPr\");\n\t\tif(rpr) o.s = parse_rpr(rpr[1]);\n\t\treturn o;\n\t}\n\tvar rregex = /<(?:\\w+:)?r>/g, rend = /<\\/(?:\\w+:)?r>/;\n\treturn function parse_rs(rs) {\n\t\treturn rs.replace(rregex,\"\").split(rend).map(parse_r).filter(function(r) { return r.v; });\n\t};\n})();\n\n\n/* Parse a list of tags */\nvar rs_to_html = /*#__PURE__*/(function parse_rs_factory() {\n\tvar nlregex = /(\\r\\n|\\n)/g;\n\tfunction parse_rpr2(font, intro, outro) {\n\t\tvar style/*:Array*/ = [];\n\n\t\tif(font.u) style.push(\"text-decoration: underline;\");\n\t\tif(font.uval) style.push(\"text-underline-style:\" + font.uval + \";\");\n\t\tif(font.sz) style.push(\"font-size:\" + font.sz + \"pt;\");\n\t\tif(font.outline) style.push(\"text-effect: outline;\");\n\t\tif(font.shadow) style.push(\"text-shadow: auto;\");\n\t\tintro.push('');\n\n\t\tif(font.b) { intro.push(\"\"); outro.push(\"\"); }\n\t\tif(font.i) { intro.push(\"\"); outro.push(\"\"); }\n\t\tif(font.strike) { intro.push(\"\"); outro.push(\"\"); }\n\n\t\tvar align = font.valign || \"\";\n\t\tif(align == \"superscript\" || align == \"super\") align = \"sup\";\n\t\telse if(align == \"subscript\") align = \"sub\";\n\t\tif(align != \"\") { intro.push(\"<\" + align + \">\"); outro.push(\"\"); }\n\n\t\toutro.push(\"\");\n\t\treturn font;\n\t}\n\n\t/* 18.4.4 r CT_RElt */\n\tfunction r_to_html(r) {\n\t\tvar terms/*:[Array, string, Array]*/ = [[],r.v,[]];\n\t\tif(!r.v) return \"\";\n\n\t\tif(r.s) parse_rpr2(r.s, terms[0], terms[2]);\n\n\t\treturn terms[0].join(\"\") + terms[1].replace(nlregex,'
') + terms[2].join(\"\");\n\t}\n\n\treturn function parse_rs(rs) {\n\t\treturn rs.map(r_to_html).join(\"\");\n\t};\n})();\n\n/* 18.4.8 si CT_Rst */\nvar sitregex = /<(?:\\w+:)?t\\b[^<>]*>([^<]*)<\\/(?:\\w+:)?t>/g, sirregex = /<(?:\\w+:)?r\\b[^<>]*>/;\nfunction parse_si(x, opts) {\n\tvar html = opts ? opts.cellHTML : true;\n\tvar z = {};\n\tif(!x) return { t: \"\" };\n\t//var y;\n\t/* 18.4.12 t ST_Xstring (Plaintext String) */\n\t// TODO: is whitespace actually valid here?\n\tif(x.match(/^\\s*<(?:\\w+:)?t[^>]*>/)) {\n\t\tz.t = unescapexml(utf8read(x.slice(x.indexOf(\">\")+1).split(/<\\/(?:\\w+:)?t>/)[0]||\"\"), true);\n\t\tz.r = utf8read(x);\n\t\tif(html) z.h = escapehtml(z.t);\n\t}\n\t/* 18.4.4 r CT_RElt (Rich Text Run) */\n\telse if((/*y = */x.match(sirregex))) {\n\t\tz.r = utf8read(x);\n\t\tz.t = unescapexml(utf8read((str_remove_xml_ns_g(x, \"rPh\").match(sitregex)||[]).join(\"\").replace(tagregex,\"\")), true);\n\t\tif(html) z.h = rs_to_html(parse_rs(z.r));\n\t}\n\t/* 18.4.3 phoneticPr CT_PhoneticPr (TODO: needed for Asian support) */\n\t/* 18.4.6 rPh CT_PhoneticRun (TODO: needed for Asian support) */\n\treturn z;\n}\n\n/* 18.4 Shared String Table */\nvar sstr1 = /<(?:\\w+:)?(?:si|sstItem)>/g;\nvar sstr2 = /<\\/(?:\\w+:)?(?:si|sstItem)>/;\nfunction parse_sst_xml(data/*:string*/, opts)/*:SST*/ {\n\tvar s/*:SST*/ = ([]/*:any*/), ss = \"\";\n\tif(!data) return s;\n\t/* 18.4.9 sst CT_Sst */\n\tvar sst = str_match_xml_ns(data, \"sst\");\n\tif(sst) {\n\t\tss = sst[1].replace(sstr1,\"\").split(sstr2);\n\t\tfor(var i = 0; i != ss.length; ++i) {\n\t\t\tvar o = parse_si(ss[i].trim(), opts);\n\t\t\tif(o != null) s[s.length] = o;\n\t\t}\n\t\tsst = parsexmltag(sst[0].slice(0, sst[0].indexOf(\">\"))); s.Count = sst.count; s.Unique = sst.uniqueCount;\n\t}\n\treturn s;\n}\n\nvar straywsregex = /^\\s|\\s$|[\\t\\n\\r]/;\nfunction write_sst_xml(sst/*:SST*/, opts)/*:string*/ {\n\tif(!opts.bookSST) return \"\";\n\tvar o = [XML_HEADER];\n\to[o.length] = (writextag('sst', null, {\n\t\txmlns: XMLNS_main[0],\n\t\tcount: sst.Count,\n\t\tuniqueCount: sst.Unique\n\t}));\n\tfor(var i = 0; i != sst.length; ++i) { if(sst[i] == null) continue;\n\t\tvar s/*:XLString*/ = sst[i];\n\t\tvar sitag = \"\";\n\t\tif(s.r) sitag += s.r;\n\t\telse {\n\t\t\tsitag += \"\" + escapexml(s.t) + \"\";\n\t\t}\n\t\tsitag += \"\";\n\t\to[o.length] = (sitag);\n\t}\n\tif(o.length>2){ o[o.length] = (''); o[1]=o[1].replace(\"/>\",\">\"); }\n\treturn o.join(\"\");\n}\n/* [MS-XLSB] 2.4.221 BrtBeginSst */\nfunction parse_BrtBeginSst(data) {\n\treturn [data.read_shift(4), data.read_shift(4)];\n}\n\n/* [MS-XLSB] 2.1.7.45 Shared Strings */\nfunction parse_sst_bin(data, opts)/*:SST*/ {\n\tvar s/*:SST*/ = ([]/*:any*/);\n\tvar pass = false;\n\trecordhopper(data, function hopper_sst(val, R, RT) {\n\t\tswitch(RT) {\n\t\t\tcase 0x009F: /* BrtBeginSst */\n\t\t\t\ts.Count = val[0]; s.Unique = val[1]; break;\n\t\t\tcase 0x0013: /* BrtSSTItem */\n\t\t\t\ts.push(val); break;\n\t\t\tcase 0x00A0: /* BrtEndSst */\n\t\t\t\treturn true;\n\n\t\t\tcase 0x0023: /* BrtFRTBegin */\n\t\t\t\tpass = true; break;\n\t\t\tcase 0x0024: /* BrtFRTEnd */\n\t\t\t\tpass = false; break;\n\n\t\t\tdefault:\n\t\t\t\tif(R.T){}\n\t\t\t\tif(!pass || opts.WTF) throw new Error(\"Unexpected record 0x\" + RT.toString(16));\n\t\t}\n\t});\n\treturn s;\n}\n\nfunction write_BrtBeginSst(sst, o) {\n\tif(!o) o = new_buf(8);\n\to.write_shift(4, sst.Count);\n\to.write_shift(4, sst.Unique);\n\treturn o;\n}\n\nvar write_BrtSSTItem = write_RichStr;\n\nfunction write_sst_bin(sst/*::, opts*/) {\n\tvar ba = buf_array();\n\twrite_record(ba, 0x009F /* BrtBeginSst */, write_BrtBeginSst(sst));\n\tfor(var i = 0; i < sst.length; ++i) write_record(ba, 0x0013 /* BrtSSTItem */, write_BrtSSTItem(sst[i]));\n\t/* FRTSST */\n\twrite_record(ba, 0x00A0 /* BrtEndSst */);\n\treturn ba.end();\n}\nfunction _JS2ANSI(str/*:string*/)/*:Array*/ {\n\tif(typeof $cptable !== 'undefined') return $cptable.utils.encode(current_ansi, str);\n\tvar o/*:Array*/ = [], oo = str.split(\"\");\n\tfor(var i = 0; i < oo.length; ++i) o[i] = oo[i].charCodeAt(0);\n\treturn o;\n}\n\n/* [MS-OFFCRYPTO] 2.1.4 Version */\nfunction parse_CRYPTOVersion(blob, length/*:?number*/) {\n\tvar o/*:any*/ = {};\n\to.Major = blob.read_shift(2);\n\to.Minor = blob.read_shift(2);\n\t/*:: if(length == null) return o; */\n\tif(length >= 4) blob.l += length - 4;\n\treturn o;\n}\n\n/* [MS-OFFCRYPTO] 2.1.5 DataSpaceVersionInfo */\nfunction parse_DataSpaceVersionInfo(blob) {\n\tvar o = {};\n\to.id = blob.read_shift(0, 'lpp4');\n\to.R = parse_CRYPTOVersion(blob, 4);\n\to.U = parse_CRYPTOVersion(blob, 4);\n\to.W = parse_CRYPTOVersion(blob, 4);\n\treturn o;\n}\n\n/* [MS-OFFCRYPTO] 2.1.6.1 DataSpaceMapEntry Structure */\nfunction parse_DataSpaceMapEntry(blob) {\n\tvar len = blob.read_shift(4);\n\tvar end = blob.l + len - 4;\n\tvar o = {};\n\tvar cnt = blob.read_shift(4);\n\tvar comps/*:Array<{t:number, v:string}>*/ = [];\n\t/* [MS-OFFCRYPTO] 2.1.6.2 DataSpaceReferenceComponent Structure */\n\twhile(cnt-- > 0) comps.push({ t: blob.read_shift(4), v: blob.read_shift(0, 'lpp4') });\n\to.name = blob.read_shift(0, 'lpp4');\n\to.comps = comps;\n\tif(blob.l != end) throw new Error(\"Bad DataSpaceMapEntry: \" + blob.l + \" != \" + end);\n\treturn o;\n}\n\n/* [MS-OFFCRYPTO] 2.1.6 DataSpaceMap */\nfunction parse_DataSpaceMap(blob) {\n\tvar o = [];\n\tblob.l += 4; // must be 0x8\n\tvar cnt = blob.read_shift(4);\n\twhile(cnt-- > 0) o.push(parse_DataSpaceMapEntry(blob));\n\treturn o;\n}\n\n/* [MS-OFFCRYPTO] 2.1.7 DataSpaceDefinition */\nfunction parse_DataSpaceDefinition(blob)/*:Array*/ {\n\tvar o/*:Array*/ = [];\n\tblob.l += 4; // must be 0x8\n\tvar cnt = blob.read_shift(4);\n\twhile(cnt-- > 0) o.push(blob.read_shift(0, 'lpp4'));\n\treturn o;\n}\n\n/* [MS-OFFCRYPTO] 2.1.8 DataSpaceDefinition */\nfunction parse_TransformInfoHeader(blob) {\n\tvar o = {};\n\t/*var len = */blob.read_shift(4);\n\tblob.l += 4; // must be 0x1\n\to.id = blob.read_shift(0, 'lpp4');\n\to.name = blob.read_shift(0, 'lpp4');\n\to.R = parse_CRYPTOVersion(blob, 4);\n\to.U = parse_CRYPTOVersion(blob, 4);\n\to.W = parse_CRYPTOVersion(blob, 4);\n\treturn o;\n}\n\nfunction parse_Primary(blob) {\n\t/* [MS-OFFCRYPTO] 2.2.6 IRMDSTransformInfo */\n\tvar hdr = parse_TransformInfoHeader(blob);\n\t/* [MS-OFFCRYPTO] 2.1.9 EncryptionTransformInfo */\n\thdr.ename = blob.read_shift(0, '8lpp4');\n\thdr.blksz = blob.read_shift(4);\n\thdr.cmode = blob.read_shift(4);\n\tif(blob.read_shift(4) != 0x04) throw new Error(\"Bad !Primary record\");\n\treturn hdr;\n}\n\n/* [MS-OFFCRYPTO] 2.3.2 Encryption Header */\nfunction parse_EncryptionHeader(blob, length/*:number*/) {\n\tvar tgt = blob.l + length;\n\tvar o = {};\n\to.Flags = (blob.read_shift(4) & 0x3F);\n\tblob.l += 4;\n\to.AlgID = blob.read_shift(4);\n\tvar valid = false;\n\tswitch(o.AlgID) {\n\t\tcase 0x660E: case 0x660F: case 0x6610: valid = (o.Flags == 0x24); break;\n\t\tcase 0x6801: valid = (o.Flags == 0x04); break;\n\t\tcase 0: valid = (o.Flags == 0x10 || o.Flags == 0x04 || o.Flags == 0x24); break;\n\t\tdefault: throw 'Unrecognized encryption algorithm: ' + o.AlgID;\n\t}\n\tif(!valid) throw new Error(\"Encryption Flags/AlgID mismatch\");\n\to.AlgIDHash = blob.read_shift(4);\n\to.KeySize = blob.read_shift(4);\n\to.ProviderType = blob.read_shift(4);\n\tblob.l += 8;\n\to.CSPName = blob.read_shift((tgt-blob.l)>>1, 'utf16le');\n\tblob.l = tgt;\n\treturn o;\n}\n\n/* [MS-OFFCRYPTO] 2.3.3 Encryption Verifier */\nfunction parse_EncryptionVerifier(blob, length/*:number*/) {\n\tvar o = {}, tgt = blob.l + length;\n\tblob.l += 4; // SaltSize must be 0x10\n\to.Salt = blob.slice(blob.l, blob.l+16); blob.l += 16;\n\to.Verifier = blob.slice(blob.l, blob.l+16); blob.l += 16;\n\t/*var sz = */blob.read_shift(4);\n\to.VerifierHash = blob.slice(blob.l, tgt); blob.l = tgt;\n\treturn o;\n}\n\n/* [MS-OFFCRYPTO] 2.3.4.* EncryptionInfo Stream */\nfunction parse_EncryptionInfo(blob) {\n\tvar vers = parse_CRYPTOVersion(blob);\n\tswitch(vers.Minor) {\n\t\tcase 0x02: return [vers.Minor, parse_EncInfoStd(blob, vers)];\n\t\tcase 0x03: return [vers.Minor, parse_EncInfoExt(blob, vers)];\n\t\tcase 0x04: return [vers.Minor, parse_EncInfoAgl(blob, vers)];\n\t}\n\tthrow new Error(\"ECMA-376 Encrypted file unrecognized Version: \" + vers.Minor);\n}\n\n/* [MS-OFFCRYPTO] 2.3.4.5 EncryptionInfo Stream (Standard Encryption) */\nfunction parse_EncInfoStd(blob/*::, vers*/) {\n\tvar flags = blob.read_shift(4);\n\tif((flags & 0x3F) != 0x24) throw new Error(\"EncryptionInfo mismatch\");\n\tvar sz = blob.read_shift(4);\n\t//var tgt = blob.l + sz;\n\tvar hdr = parse_EncryptionHeader(blob, sz);\n\tvar verifier = parse_EncryptionVerifier(blob, blob.length - blob.l);\n\treturn { t:\"Std\", h:hdr, v:verifier };\n}\n/* [MS-OFFCRYPTO] 2.3.4.6 EncryptionInfo Stream (Extensible Encryption) */\nfunction parse_EncInfoExt(/*::blob, vers*/) { throw new Error(\"File is password-protected: ECMA-376 Extensible\"); }\n/* [MS-OFFCRYPTO] 2.3.4.10 EncryptionInfo Stream (Agile Encryption) */\nfunction parse_EncInfoAgl(blob/*::, vers*/) {\n\tvar KeyData = [\"saltSize\",\"blockSize\",\"keyBits\",\"hashSize\",\"cipherAlgorithm\",\"cipherChaining\",\"hashAlgorithm\",\"saltValue\"];\n\tblob.l+=4;\n\tvar xml = blob.read_shift(blob.length - blob.l, 'utf8');\n\tvar o = {};\n\txml.replace(tagregex, function xml_agile(x) {\n\t\tvar y/*:any*/ = parsexmltag(x);\n\t\tswitch(strip_ns(y[0])) {\n\t\t\tcase '': break;\n\t\t\tcase '': case '': break;\n\n\t\t\tcase '': break;\n\t\t\tcase ' 4 || vers.Major < 2) throw new Error('unrecognized major version code: ' + vers.Major);\n\to.Flags = blob.read_shift(4); length -= 4;\n\tvar sz = blob.read_shift(4); length -= 4;\n\to.EncryptionHeader = parse_EncryptionHeader(blob, sz); length -= sz;\n\to.EncryptionVerifier = parse_EncryptionVerifier(blob, length);\n\treturn o;\n}\n/* [MS-OFFCRYPTO] 2.3.6.1 RC4 Encryption Header */\nfunction parse_RC4Header(blob/*::, length*/) {\n\tvar o = {};\n\tvar vers = o.EncryptionVersionInfo = parse_CRYPTOVersion(blob, 4);\n\tif(vers.Major != 1 || vers.Minor != 1) throw 'unrecognized version code ' + vers.Major + ' : ' + vers.Minor;\n\to.Salt = blob.read_shift(16);\n\to.EncryptedVerifier = blob.read_shift(16);\n\to.EncryptedVerifierHash = blob.read_shift(16);\n\treturn o;\n}\n\n/* [MS-OFFCRYPTO] 2.3.7.1 Binary Document Password Verifier Derivation */\nfunction crypto_CreatePasswordVerifier_Method1(Password/*:string*/) {\n\tvar Verifier = 0x0000, PasswordArray;\n\tvar PasswordDecoded = _JS2ANSI(Password);\n\tvar len = PasswordDecoded.length + 1, i, PasswordByte;\n\tvar Intermediate1, Intermediate2, Intermediate3;\n\tPasswordArray = new_raw_buf(len);\n\tPasswordArray[0] = PasswordDecoded.length;\n\tfor(i = 1; i != len; ++i) PasswordArray[i] = PasswordDecoded[i-1];\n\tfor(i = len-1; i >= 0; --i) {\n\t\tPasswordByte = PasswordArray[i];\n\t\tIntermediate1 = ((Verifier & 0x4000) === 0x0000) ? 0 : 1;\n\t\tIntermediate2 = (Verifier << 1) & 0x7FFF;\n\t\tIntermediate3 = Intermediate1 | Intermediate2;\n\t\tVerifier = Intermediate3 ^ PasswordByte;\n\t}\n\treturn Verifier ^ 0xCE4B;\n}\n\n/* [MS-OFFCRYPTO] 2.3.7.2 Binary Document XOR Array Initialization */\nvar crypto_CreateXorArray_Method1 = /*#__PURE__*/(function() {\n\tvar PadArray = [0xBB, 0xFF, 0xFF, 0xBA, 0xFF, 0xFF, 0xB9, 0x80, 0x00, 0xBE, 0x0F, 0x00, 0xBF, 0x0F, 0x00];\n\tvar InitialCode = [0xE1F0, 0x1D0F, 0xCC9C, 0x84C0, 0x110C, 0x0E10, 0xF1CE, 0x313E, 0x1872, 0xE139, 0xD40F, 0x84F9, 0x280C, 0xA96A, 0x4EC3];\n\tvar XorMatrix = [0xAEFC, 0x4DD9, 0x9BB2, 0x2745, 0x4E8A, 0x9D14, 0x2A09, 0x7B61, 0xF6C2, 0xFDA5, 0xEB6B, 0xC6F7, 0x9DCF, 0x2BBF, 0x4563, 0x8AC6, 0x05AD, 0x0B5A, 0x16B4, 0x2D68, 0x5AD0, 0x0375, 0x06EA, 0x0DD4, 0x1BA8, 0x3750, 0x6EA0, 0xDD40, 0xD849, 0xA0B3, 0x5147, 0xA28E, 0x553D, 0xAA7A, 0x44D5, 0x6F45, 0xDE8A, 0xAD35, 0x4A4B, 0x9496, 0x390D, 0x721A, 0xEB23, 0xC667, 0x9CEF, 0x29FF, 0x53FE, 0xA7FC, 0x5FD9, 0x47D3, 0x8FA6, 0x0F6D, 0x1EDA, 0x3DB4, 0x7B68, 0xF6D0, 0xB861, 0x60E3, 0xC1C6, 0x93AD, 0x377B, 0x6EF6, 0xDDEC, 0x45A0, 0x8B40, 0x06A1, 0x0D42, 0x1A84, 0x3508, 0x6A10, 0xAA51, 0x4483, 0x8906, 0x022D, 0x045A, 0x08B4, 0x1168, 0x76B4, 0xED68, 0xCAF1, 0x85C3, 0x1BA7, 0x374E, 0x6E9C, 0x3730, 0x6E60, 0xDCC0, 0xA9A1, 0x4363, 0x86C6, 0x1DAD, 0x3331, 0x6662, 0xCCC4, 0x89A9, 0x0373, 0x06E6, 0x0DCC, 0x1021, 0x2042, 0x4084, 0x8108, 0x1231, 0x2462, 0x48C4];\n\tvar Ror = function(Byte) { return ((Byte/2) | (Byte*128)) & 0xFF; };\n\tvar XorRor = function(byte1, byte2) { return Ror(byte1 ^ byte2); };\n\tvar CreateXorKey_Method1 = function(Password) {\n\t\tvar XorKey = InitialCode[Password.length - 1];\n\t\tvar CurrentElement = 0x68;\n\t\tfor(var i = Password.length-1; i >= 0; --i) {\n\t\t\tvar Char = Password[i];\n\t\t\tfor(var j = 0; j != 7; ++j) {\n\t\t\t\tif(Char & 0x40) XorKey ^= XorMatrix[CurrentElement];\n\t\t\t\tChar *= 2; --CurrentElement;\n\t\t\t}\n\t\t}\n\t\treturn XorKey;\n\t};\n\treturn function(password/*:string*/) {\n\t\tvar Password = _JS2ANSI(password);\n\t\tvar XorKey = CreateXorKey_Method1(Password);\n\t\tvar Index = Password.length;\n\t\tvar ObfuscationArray = new_raw_buf(16);\n\t\tfor(var i = 0; i != 16; ++i) ObfuscationArray[i] = 0x00;\n\t\tvar Temp, PasswordLastChar, PadIndex;\n\t\tif((Index & 1) === 1) {\n\t\t\tTemp = XorKey >> 8;\n\t\t\tObfuscationArray[Index] = XorRor(PadArray[0], Temp);\n\t\t\t--Index;\n\t\t\tTemp = XorKey & 0xFF;\n\t\t\tPasswordLastChar = Password[Password.length - 1];\n\t\t\tObfuscationArray[Index] = XorRor(PasswordLastChar, Temp);\n\t\t}\n\t\twhile(Index > 0) {\n\t\t\t--Index;\n\t\t\tTemp = XorKey >> 8;\n\t\t\tObfuscationArray[Index] = XorRor(Password[Index], Temp);\n\t\t\t--Index;\n\t\t\tTemp = XorKey & 0xFF;\n\t\t\tObfuscationArray[Index] = XorRor(Password[Index], Temp);\n\t\t}\n\t\tIndex = 15;\n\t\tPadIndex = 15 - Password.length;\n\t\twhile(PadIndex > 0) {\n\t\t\tTemp = XorKey >> 8;\n\t\t\tObfuscationArray[Index] = XorRor(PadArray[PadIndex], Temp);\n\t\t\t--Index;\n\t\t\t--PadIndex;\n\t\t\tTemp = XorKey & 0xFF;\n\t\t\tObfuscationArray[Index] = XorRor(Password[Index], Temp);\n\t\t\t--Index;\n\t\t\t--PadIndex;\n\t\t}\n\t\treturn ObfuscationArray;\n\t};\n})();\n\n/* [MS-OFFCRYPTO] 2.3.7.3 Binary Document XOR Data Transformation Method 1 */\nvar crypto_DecryptData_Method1 = function(password/*:string*/, Data, XorArrayIndex, XorArray, O) {\n\t/* If XorArray is set, use it; if O is not set, make changes in-place */\n\tif(!O) O = Data;\n\tif(!XorArray) XorArray = crypto_CreateXorArray_Method1(password);\n\tvar Index, Value;\n\tfor(Index = 0; Index != Data.length; ++Index) {\n\t\tValue = Data[Index];\n\t\tValue ^= XorArray[XorArrayIndex];\n\t\tValue = ((Value>>5) | (Value<<3)) & 0xFF;\n\t\tO[Index] = Value;\n\t\t++XorArrayIndex;\n\t}\n\treturn [O, XorArrayIndex, XorArray];\n};\n\nvar crypto_MakeXorDecryptor = function(password/*:string*/) {\n\tvar XorArrayIndex = 0, XorArray = crypto_CreateXorArray_Method1(password);\n\treturn function(Data) {\n\t\tvar O = crypto_DecryptData_Method1(\"\", Data, XorArrayIndex, XorArray);\n\t\tXorArrayIndex = O[1];\n\t\treturn O[0];\n\t};\n};\n\n/* 2.5.343 */\nfunction parse_XORObfuscation(blob, length, opts, out) {\n\tvar o = ({ key: parseuint16(blob), verificationBytes: parseuint16(blob) }/*:any*/);\n\tif(opts.password) o.verifier = crypto_CreatePasswordVerifier_Method1(opts.password);\n\tout.valid = o.verificationBytes === o.verifier;\n\tif(out.valid) out.insitu = crypto_MakeXorDecryptor(opts.password);\n\treturn o;\n}\n\n/* 2.4.117 */\nfunction parse_FilePassHeader(blob, length/*:number*/, oo) {\n\tvar o = oo || {}; o.Info = blob.read_shift(2); blob.l -= 2;\n\tif(o.Info === 1) o.Data = parse_RC4Header(blob, length);\n\telse o.Data = parse_RC4CryptoHeader(blob, length);\n\treturn o;\n}\nfunction parse_FilePass(blob, length/*:number*/, opts) {\n\tvar o = ({ Type: opts.biff >= 8 ? blob.read_shift(2) : 0 }/*:any*/); /* wEncryptionType */\n\tif(o.Type) parse_FilePassHeader(blob, length-2, o);\n\telse parse_XORObfuscation(blob, opts.biff >= 8 ? length : length - 2, opts, o);\n\treturn o;\n}\n\n\nfunction rtf_to_sheet(d, opts) {\n switch (opts.type) {\n case \"base64\":\n return rtf_to_sheet_str(Base64_decode(d), opts);\n case \"binary\":\n return rtf_to_sheet_str(d, opts);\n case \"buffer\":\n return rtf_to_sheet_str(has_buf && Buffer.isBuffer(d) ? d.toString(\"binary\") : a2s(d), opts);\n case \"array\":\n return rtf_to_sheet_str(cc2str(d), opts);\n }\n throw new Error(\"Unrecognized type \" + opts.type);\n}\nfunction rtf_to_sheet_str(str, opts) {\n var o = opts || {};\n var ws = {};\n var dense = o.dense;\n if (dense)\n ws[\"!data\"] = [];\n var rows = str_match_ng(str, \"\\\\trowd\", \"\\\\row\");\n if (!rows)\n throw new Error(\"RTF missing table\");\n var range = { s: { c: 0, r: 0 }, e: { c: 0, r: rows.length - 1 } };\n var row = [];\n rows.forEach(function(rowtf, R) {\n if (dense)\n row = ws[\"!data\"][R] = [];\n var rtfre = /\\\\[\\w\\-]+\\b/g;\n var last_index = 0;\n var res;\n var C = -1;\n var payload = [];\n while ((res = rtfre.exec(rowtf)) != null) {\n var data = rowtf.slice(last_index, rtfre.lastIndex - res[0].length);\n if (data.charCodeAt(0) == 32)\n data = data.slice(1);\n if (data.length)\n payload.push(data);\n switch (res[0]) {\n case \"\\\\cell\":\n ++C;\n if (payload.length) {\n var cell = { v: payload.join(\"\"), t: \"s\" };\n if (cell.v == \"TRUE\" || cell.v == \"FALSE\") {\n cell.v = cell.v == \"TRUE\";\n cell.t = \"b\";\n } else if (!isNaN(fuzzynum(cell.v))) {\n cell.t = \"n\";\n if (o.cellText !== false)\n cell.w = cell.v;\n cell.v = fuzzynum(cell.v);\n } else if (RBErr[cell.v] != null) {\n cell.t = \"e\";\n cell.w = cell.v;\n cell.v = RBErr[cell.v];\n }\n if (dense)\n row[C] = cell;\n else\n ws[encode_cell({ r: R, c: C })] = cell;\n }\n payload = [];\n break;\n case \"\\\\par\":\n payload.push(\"\\n\");\n break;\n }\n last_index = rtfre.lastIndex;\n }\n if (C > range.e.c)\n range.e.c = C;\n });\n ws[\"!ref\"] = encode_range(range);\n return ws;\n}\nfunction rtf_to_workbook(d, opts) {\n var wb = sheet_to_workbook(rtf_to_sheet(d, opts), opts);\n wb.bookType = \"rtf\";\n return wb;\n}\nfunction sheet_to_rtf(ws, opts) {\n var o = [\"{\\\\rtf1\\\\ansi\"];\n if (!ws[\"!ref\"])\n return o[0] + \"}\";\n var r = safe_decode_range(ws[\"!ref\"]), cell;\n var dense = ws[\"!data\"] != null, row = [];\n for (var R = r.s.r; R <= r.e.r; ++R) {\n o.push(\"\\\\trowd\\\\trautofit1\");\n for (var C = r.s.c; C <= r.e.c; ++C)\n o.push(\"\\\\cellx\" + (C + 1));\n o.push(\"\\\\pard\\\\intbl\");\n if (dense)\n row = ws[\"!data\"][R] || [];\n for (C = r.s.c; C <= r.e.c; ++C) {\n var coord = encode_cell({ r: R, c: C });\n cell = dense ? row[C] : ws[coord];\n if (!cell || cell.v == null && (!cell.f || cell.F)) {\n o.push(\" \\\\cell\");\n continue;\n }\n o.push(\" \" + (cell.w || (format_cell(cell), cell.w) || \"\").replace(/[\\r\\n]/g, \"\\\\par \"));\n o.push(\"\\\\cell\");\n }\n o.push(\"\\\\pard\\\\intbl\\\\row\");\n }\n return o.join(\"\") + \"}\";\n}\nfunction hex2RGB(h) {\n\tvar o = h.slice(h[0]===\"#\"?1:0).slice(0,6);\n\treturn [parseInt(o.slice(0,2),16),parseInt(o.slice(2,4),16),parseInt(o.slice(4,6),16)];\n}\nfunction rgb2Hex(rgb) {\n\tfor(var i=0,o=1; i!=3; ++i) o = o*256 + (rgb[i]>255?255:rgb[i]<0?0:rgb[i]);\n\treturn o.toString(16).toUpperCase().slice(1);\n}\n\nfunction rgb2HSL(rgb) {\n\tvar R = rgb[0]/255, G = rgb[1]/255, B=rgb[2]/255;\n\tvar M = Math.max(R, G, B), m = Math.min(R, G, B), C = M - m;\n\tif(C === 0) return [0, 0, R];\n\n\tvar H6 = 0, S = 0, L2 = (M + m);\n\tS = C / (L2 > 1 ? 2 - L2 : L2);\n\tswitch(M){\n\t\tcase R: H6 = ((G - B) / C + 6)%6; break;\n\t\tcase G: H6 = ((B - R) / C + 2); break;\n\t\tcase B: H6 = ((R - G) / C + 4); break;\n\t}\n\treturn [H6 / 6, S, L2 / 2];\n}\n\nfunction hsl2RGB(hsl){\n\tvar H = hsl[0], S = hsl[1], L = hsl[2];\n\tvar C = S * 2 * (L < 0.5 ? L : 1 - L), m = L - C/2;\n\tvar rgb = [m,m,m], h6 = 6*H;\n\n\tvar X;\n\tif(S !== 0) switch(h6|0) {\n\t\tcase 0: case 6: X = C * h6; rgb[0] += C; rgb[1] += X; break;\n\t\tcase 1: X = C * (2 - h6); rgb[0] += X; rgb[1] += C; break;\n\t\tcase 2: X = C * (h6 - 2); rgb[1] += C; rgb[2] += X; break;\n\t\tcase 3: X = C * (4 - h6); rgb[1] += X; rgb[2] += C; break;\n\t\tcase 4: X = C * (h6 - 4); rgb[2] += C; rgb[0] += X; break;\n\t\tcase 5: X = C * (6 - h6); rgb[2] += X; rgb[0] += C; break;\n\t}\n\tfor(var i = 0; i != 3; ++i) rgb[i] = Math.round(rgb[i]*255);\n\treturn rgb;\n}\n\n/* 18.8.3 bgColor tint algorithm */\nfunction rgb_tint(hex, tint) {\n\tif(tint === 0) return hex;\n\tvar hsl = rgb2HSL(hex2RGB(hex));\n\tif (tint < 0) hsl[2] = hsl[2] * (1 + tint);\n\telse hsl[2] = 1 - (1 - hsl[2]) * (1 - tint);\n\treturn rgb2Hex(hsl2RGB(hsl));\n}\n\n/* 18.3.1.13 width calculations */\n/* [MS-OI29500] 2.1.595 Column Width & Formatting */\nvar DEF_MDW = 6, MAX_MDW = 15, MIN_MDW = 1, MDW = DEF_MDW;\nfunction width2px(width) { return Math.floor(( width + (Math.round(128/MDW))/256 )* MDW ); }\nfunction px2char(px) { return (Math.floor((px - 5)/MDW * 100 + 0.5))/100; }\nfunction char2width(chr) { return (Math.round((chr * MDW + 5)/MDW*256))/256; }\n//function px2char_(px) { return (((px - 5)/MDW * 100 + 0.5))/100; }\n//function char2width_(chr) { return (((chr * MDW + 5)/MDW*256))/256; }\nfunction cycle_width(collw) { return char2width(px2char(width2px(collw))); }\n/* XLSX/XLSB/XLS specify width in units of MDW */\nfunction find_mdw_colw(collw) {\n\tvar delta = Math.abs(collw - cycle_width(collw)), _MDW = MDW;\n\tif(delta > 0.005) for(MDW=MIN_MDW; MDW 0.5) guess--;\n\t\tif(Math.abs(guess) < delta) { delta = Math.abs(guess); _MDW = MDW; }\n\t}\n\tMDW = _MDW;\n}*/\n\nfunction process_col(coll/*:ColInfo*/) {\n\tif(coll.width) {\n\t\tcoll.wpx = width2px(coll.width);\n\t\tcoll.wch = px2char(coll.wpx);\n\t\tcoll.MDW = MDW;\n\t} else if(coll.wpx) {\n\t\tcoll.wch = px2char(coll.wpx);\n\t\tcoll.width = char2width(coll.wch);\n\t\tcoll.MDW = MDW;\n\t} else if(typeof coll.wch == 'number') {\n\t\tcoll.width = char2width(coll.wch);\n\t\tcoll.wpx = width2px(coll.width);\n\t\tcoll.MDW = MDW;\n\t}\n\tif(coll.customWidth) delete coll.customWidth;\n}\n\nvar DEF_PPI = 96, PPI = DEF_PPI;\nfunction px2pt(px) { return px * 96 / PPI; }\nfunction pt2px(pt) { return pt * PPI / 96; }\n\n/* [MS-EXSPXML3] 2.4.54 ST_enmPattern */\nvar XLMLPatternTypeMap = {\n\t\"None\": \"none\",\n\t\"Solid\": \"solid\",\n\t\"Gray50\": \"mediumGray\",\n\t\"Gray75\": \"darkGray\",\n\t\"Gray25\": \"lightGray\",\n\t\"HorzStripe\": \"darkHorizontal\",\n\t\"VertStripe\": \"darkVertical\",\n\t\"ReverseDiagStripe\": \"darkDown\",\n\t\"DiagStripe\": \"darkUp\",\n\t\"DiagCross\": \"darkGrid\",\n\t\"ThickDiagCross\": \"darkTrellis\",\n\t\"ThinHorzStripe\": \"lightHorizontal\",\n\t\"ThinVertStripe\": \"lightVertical\",\n\t\"ThinReverseDiagStripe\": \"lightDown\",\n\t\"ThinHorzCross\": \"lightGrid\"\n};\n\n/* 18.8.5 borders CT_Borders */\nfunction parse_borders(t, styles, themes, opts) {\n\tstyles.Borders = [];\n\tvar border = {};\n\tvar pass = false;\n\t(t.match(tagregex)||[]).forEach(function(x) {\n\t\tvar y = parsexmltag(x);\n\t\tswitch(strip_ns(y[0])) {\n\t\t\tcase '': case '': break;\n\n\t\t\t/* 18.8.4 border CT_Border */\n\t\t\tcase '': case '':\n\t\t\t\tborder = /*::(*/{}/*:: :any)*/;\n\t\t\t\tif(y.diagonalUp) border.diagonalUp = parsexmlbool(y.diagonalUp);\n\t\t\t\tif(y.diagonalDown) border.diagonalDown = parsexmlbool(y.diagonalDown);\n\t\t\t\tstyles.Borders.push(border);\n\t\t\t\tbreak;\n\t\t\tcase '': break;\n\n\t\t\t/* note: not in spec, appears to be CT_BorderPr */\n\t\t\tcase '': break;\n\t\t\tcase '': break;\n\t\t\tcase '': break;\n\n\t\t\t/* note: not in spec, appears to be CT_BorderPr */\n\t\t\tcase '': break;\n\t\t\tcase '': break;\n\t\t\tcase '': break;\n\n\t\t\t/* 18.8.43 top CT_BorderPr */\n\t\t\tcase '': break;\n\t\t\tcase '': break;\n\t\t\tcase '': break;\n\n\t\t\t/* 18.8.6 bottom CT_BorderPr */\n\t\t\tcase '': break;\n\t\t\tcase '': break;\n\t\t\tcase '': break;\n\n\t\t\t/* 18.8.13 diagonal CT_BorderPr */\n\t\t\tcase '': case '': break;\n\t\t\tcase '': break;\n\n\t\t\t/* 18.8.25 horizontal CT_BorderPr */\n\t\t\tcase '': case '': break;\n\t\t\tcase '': break;\n\n\t\t\t/* 18.8.44 vertical CT_BorderPr */\n\t\t\tcase '': case '': break;\n\t\t\tcase '': break;\n\n\t\t\t/* 18.8.37 start CT_BorderPr */\n\t\t\tcase '': case '': break;\n\t\t\tcase '': break;\n\n\t\t\t/* 18.8.16 end CT_BorderPr */\n\t\t\tcase '': case '': break;\n\t\t\tcase '': break;\n\n\t\t\t/* 18.8.? color CT_Color */\n\t\t\tcase '':\n\t\t\t\tbreak;\n\t\t\tcase '': case '': break;\n\n\t\t\t/* 18.2.10 extLst CT_ExtensionList ? */\n\t\t\tcase '': case '': break;\n\t\t\tcase '': pass = false; break;\n\t\t\tdefault: if(opts && opts.WTF) {\n\t\t\t\tif(!pass) throw new Error('unrecognized ' + y[0] + ' in borders');\n\t\t\t}\n\t\t}\n\t});\n}\n\n/* 18.8.21 fills CT_Fills */\nfunction parse_fills(t, styles, themes, opts) {\n\tstyles.Fills = [];\n\tvar fill = {};\n\tvar pass = false;\n\t(t.match(tagregex)||[]).forEach(function(x) {\n\t\tvar y = parsexmltag(x);\n\t\tswitch(strip_ns(y[0])) {\n\t\t\tcase '': case '': break;\n\n\t\t\t/* 18.8.20 fill CT_Fill */\n\t\t\tcase '': case '':\n\t\t\t\tfill = {}; styles.Fills.push(fill); break;\n\t\t\tcase '': break;\n\n\t\t\t/* 18.8.24 gradientFill CT_GradientFill */\n\t\t\tcase '': break;\n\t\t\tcase '': styles.Fills.push(fill); fill = {}; break;\n\n\t\t\t/* 18.8.32 patternFill CT_PatternFill */\n\t\t\tcase '':\n\t\t\t\tif(y.patternType) fill.patternType = y.patternType;\n\t\t\t\tbreak;\n\t\t\tcase '': case '': break;\n\n\t\t\t/* 18.8.3 bgColor CT_Color */\n\t\t\tcase '': case '': break;\n\n\t\t\t/* 18.8.19 fgColor CT_Color */\n\t\t\tcase '': case '': break;\n\n\t\t\t/* 18.8.38 stop CT_GradientStop */\n\t\t\tcase '': break;\n\t\t\tcase '': break;\n\n\t\t\t/* 18.8.? color CT_Color */\n\t\t\tcase '': break;\n\t\t\tcase '': break;\n\n\t\t\t/* 18.2.10 extLst CT_ExtensionList ? */\n\t\t\tcase '': case '': break;\n\t\t\tcase '': pass = false; break;\n\t\t\tdefault: if(opts && opts.WTF) {\n\t\t\t\tif(!pass) throw new Error('unrecognized ' + y[0] + ' in fills');\n\t\t\t}\n\t\t}\n\t});\n}\n\n/* 18.8.23 fonts CT_Fonts */\nfunction parse_fonts(t, styles, themes, opts) {\n\tstyles.Fonts = [];\n\tvar font = {};\n\tvar pass = false;\n\t(t.match(tagregex)||[]).forEach(function(x) {\n\t\tvar y = parsexmltag(x);\n\t\tswitch(strip_ns(y[0])) {\n\t\t\tcase '': case '': break;\n\n\t\t\t/* 18.8.22 font CT_Font */\n\t\t\tcase '': break;\n\t\t\tcase '': case '':\n\t\t\t\tstyles.Fonts.push(font);\n\t\t\t\tfont = {};\n\t\t\t\tbreak;\n\n\t\t\t/* 18.8.29 name CT_FontName */\n\t\t\tcase '': case '': break;\n\n\t\t\t/* 18.8.2 b CT_BooleanProperty */\n\t\t\tcase '': font.bold = 1; break;\n\t\t\tcase '': case '': font.italic = 1; break;\n\t\t\tcase '': case '': font.underline = 1; break;\n\t\t\tcase '': case '': font.strike = 1; break;\n\t\t\tcase '': case '': font.outline = 1; break;\n\t\t\tcase '': case '': font.shadow = 1; break;\n\t\t\tcase '': case '': font.condense = 1; break;\n\t\t\tcase '': case '
': font.extend = 1; break;\n\t\t\tcase '': case '': case '': case '': case '': case '': case '': case '': case '': case '': case '': case '': case '': case '': case '': case '': break;\n\t\t\tcase '': pass = false; break;\n\t\t\tdefault: if(opts && opts.WTF) {\n\t\t\t\tif(!pass) throw new Error('unrecognized ' + y[0] + ' in fonts');\n\t\t\t}\n\t\t}\n\t});\n}\n\n/* 18.8.31 numFmts CT_NumFmts */\nfunction parse_numFmts(t, styles, opts) {\n\tstyles.NumberFmt = [];\n\tvar k/*Array*/ = (keys(table_fmt)/*:any*/);\n\tfor(var i=0; i < k.length; ++i) styles.NumberFmt[k[i]] = table_fmt[k[i]];\n\tvar m = t.match(tagregex);\n\tif(!m) return;\n\tfor(i=0; i < m.length; ++i) {\n\t\tvar y = parsexmltag(m[i]);\n\t\tswitch(strip_ns(y[0])) {\n\t\t\tcase '': case '': case '': break;\n\t\t\tcase '0) {\n\t\t\t\t\tif(j > 0x188) {\n\t\t\t\t\t\tfor(j = 0x188; j > 0x3c; --j) if(styles.NumberFmt[j] == null) break;\n\t\t\t\t\t\tstyles.NumberFmt[j] = f;\n\t\t\t\t\t}\n\t\t\t\t\tSSF__load(f,j);\n\t\t\t\t}\n\t\t\t} break;\n\t\t\tcase '': break;\n\t\t\tdefault: if(opts.WTF) throw new Error('unrecognized ' + y[0] + ' in numFmts');\n\t\t}\n\t}\n}\n\nfunction write_numFmts(NF/*:{[n:number|string]:string}*//*::, opts*/) {\n\tvar o = [\"\"];\n\t[[5,8],[23,26],[41,44],[/*63*/50,/*66],[164,*/392]].forEach(function(r) {\n\t\tfor(var i = r[0]; i <= r[1]; ++i) if(NF[i] != null) o[o.length] = (writextag('numFmt',null,{numFmtId:i,formatCode:escapexml(NF[i])}));\n\t});\n\tif(o.length === 1) return \"\";\n\to[o.length] = (\"\");\n\to[0] = writextag('numFmts', null, { count:o.length-2 }).replace(\"/>\", \">\");\n\treturn o.join(\"\");\n}\n\n/* 18.8.10 cellXfs CT_CellXfs */\nvar cellXF_uint = [ \"numFmtId\", \"fillId\", \"fontId\", \"borderId\", \"xfId\" ];\nvar cellXF_bool = [ \"applyAlignment\", \"applyBorder\", \"applyFill\", \"applyFont\", \"applyNumberFormat\", \"applyProtection\", \"pivotButton\", \"quotePrefix\" ];\nfunction parse_cellXfs(t, styles, opts) {\n\tstyles.CellXf = [];\n\tvar xf;\n\tvar pass = false;\n\t(t.match(tagregex)||[]).forEach(function(x) {\n\t\tvar y = parsexmltag(x), i = 0;\n\t\tswitch(strip_ns(y[0])) {\n\t\t\tcase '': case '': case '': break;\n\n\t\t\t/* 18.8.45 xf CT_Xf */\n\t\t\tcase '': case '':\n\t\t\t\txf = y;\n\t\t\t\tdelete xf[0];\n\t\t\t\tfor(i = 0; i < cellXF_uint.length; ++i) if(xf[cellXF_uint[i]])\n\t\t\t\t\txf[cellXF_uint[i]] = parseInt(xf[cellXF_uint[i]], 10);\n\t\t\t\tfor(i = 0; i < cellXF_bool.length; ++i) if(xf[cellXF_bool[i]])\n\t\t\t\t\txf[cellXF_bool[i]] = parsexmlbool(xf[cellXF_bool[i]]);\n\t\t\t\tif(styles.NumberFmt && xf.numFmtId > 0x188) {\n\t\t\t\t\tfor(i = 0x188; i > 0x3c; --i) if(styles.NumberFmt[xf.numFmtId] == styles.NumberFmt[i]) { xf.numFmtId = i; break; }\n\t\t\t\t}\n\t\t\t\tstyles.CellXf.push(xf); break;\n\t\t\tcase '': break;\n\n\t\t\t/* 18.8.1 alignment CT_CellAlignment */\n\t\t\tcase '': case '':\n\t\t\t\tvar alignment = {};\n\t\t\t\tif(y.vertical) alignment.vertical = y.vertical;\n\t\t\t\tif(y.horizontal) alignment.horizontal = y.horizontal;\n\t\t\t\tif(y.textRotation != null) alignment.textRotation = y.textRotation;\n\t\t\t\tif(y.indent) alignment.indent = y.indent;\n\t\t\t\tif(y.wrapText) alignment.wrapText = parsexmlbool(y.wrapText);\n\t\t\t\txf.alignment = alignment;\n\t\t\t\tbreak;\n\t\t\tcase '': break;\n\n\t\t\t/* 18.8.33 protection CT_CellProtection */\n\t\t\tcase '':\n\t\t\t\tbreak;\n\t\t\tcase '': case '': break;\n\n\t\t\t/* note: sometimes mc:AlternateContent appears bare */\n\t\t\tcase '': pass = true; break;\n\t\t\tcase '': pass = false; break;\n\n\t\t\t/* 18.2.10 extLst CT_ExtensionList ? */\n\t\t\tcase '': case '': break;\n\t\t\tcase '': pass = false; break;\n\t\t\tdefault: if(opts && opts.WTF) {\n\t\t\t\tif(!pass) throw new Error('unrecognized ' + y[0] + ' in cellXfs');\n\t\t\t}\n\t\t}\n\t});\n}\n\nfunction write_cellXfs(cellXfs)/*:string*/ {\n\tvar o/*:Array*/ = [];\n\to[o.length] = (writextag('cellXfs',null));\n\tcellXfs.forEach(function(c) {\n\t\to[o.length] = (writextag('xf', null, c));\n\t});\n\to[o.length] = (\"\");\n\tif(o.length === 2) return \"\";\n\to[0] = writextag('cellXfs',null, {count:o.length-2}).replace(\"/>\",\">\");\n\treturn o.join(\"\");\n}\n\n/* 18.8 Styles CT_Stylesheet*/\nvar parse_sty_xml= /*#__PURE__*/(function make_pstyx() {\n\nreturn function parse_sty_xml(data, themes, opts) {\n\tvar styles = {};\n\tif(!data) return styles;\n\tdata = remove_doctype(str_remove_ng(data, \"\"));\n\t/* 18.8.39 styleSheet CT_Stylesheet */\n\tvar t;\n\n\t/* 18.8.31 numFmts CT_NumFmts ? */\n\tif((t=str_match_xml_ns(data, \"numFmts\"))) parse_numFmts(t[0], styles, opts);\n\n\t/* 18.8.23 fonts CT_Fonts ? */\n\tif((t=str_match_xml_ns(data, \"fonts\"))) parse_fonts(t[0], styles, themes, opts);\n\n\t/* 18.8.21 fills CT_Fills ? */\n\tif((t=str_match_xml_ns(data, \"fills\"))) parse_fills(t[0], styles, themes, opts);\n\n\t/* 18.8.5 borders CT_Borders ? */\n\tif((t=str_match_xml_ns(data, \"borders\"))) parse_borders(t[0], styles, themes, opts);\n\n\t/* 18.8.9 cellStyleXfs CT_CellStyleXfs ? */\n\t/* 18.8.8 cellStyles CT_CellStyles ? */\n\n\t/* 18.8.10 cellXfs CT_CellXfs ? */\n\tif((t=str_match_xml_ns(data, \"cellXfs\"))) parse_cellXfs(t[0], styles, opts);\n\n\t/* 18.8.15 dxfs CT_Dxfs ? */\n\t/* 18.8.42 tableStyles CT_TableStyles ? */\n\t/* 18.8.11 colors CT_Colors ? */\n\t/* 18.2.10 extLst CT_ExtensionList ? */\n\n\treturn styles;\n};\n})();\n\nfunction write_sty_xml(wb/*:Workbook*/, opts)/*:string*/ {\n\tvar o = [XML_HEADER, writextag('styleSheet', null, {\n\t\t'xmlns': XMLNS_main[0],\n\t\t'xmlns:vt': XMLNS.vt\n\t})], w;\n\tif(wb.SSF && (w = write_numFmts(wb.SSF)) != null) o[o.length] = w;\n\to[o.length] = ('');\n\to[o.length] = ('');\n\to[o.length] = ('');\n\to[o.length] = ('');\n\tif((w = write_cellXfs(opts.cellXfs))) o[o.length] = (w);\n\to[o.length] = ('');\n\to[o.length] = ('');\n\to[o.length] = ('');\n\n\tif(o.length>2){ o[o.length] = (''); o[1]=o[1].replace(\"/>\",\">\"); }\n\treturn o.join(\"\");\n}\n/* [MS-XLSB] 2.4.657 BrtFmt */\nfunction parse_BrtFmt(data, length/*:number*/) {\n\tvar numFmtId = data.read_shift(2);\n\tvar stFmtCode = parse_XLWideString(data,length-2);\n\treturn [numFmtId, stFmtCode];\n}\nfunction write_BrtFmt(i/*:number*/, f/*:string*/, o) {\n\tif(!o) o = new_buf(6 + 4 * f.length);\n\to.write_shift(2, i);\n\twrite_XLWideString(f, o);\n\tvar out = (o.length > o.l) ? o.slice(0, o.l) : o;\n\tif(o.l == null) o.l = o.length;\n\treturn out;\n}\n\n/* [MS-XLSB] 2.4.659 BrtFont TODO */\nfunction parse_BrtFont(data, length/*:number*/, opts) {\n\tvar out = ({}/*:any*/);\n\n\tout.sz = data.read_shift(2) / 20;\n\n\tvar grbit = parse_FontFlags(data, 2, opts);\n\tif(grbit.fItalic) out.italic = 1;\n\tif(grbit.fCondense) out.condense = 1;\n\tif(grbit.fExtend) out.extend = 1;\n\tif(grbit.fShadow) out.shadow = 1;\n\tif(grbit.fOutline) out.outline = 1;\n\tif(grbit.fStrikeout) out.strike = 1;\n\n\tvar bls = data.read_shift(2);\n\tif(bls === 0x02BC) out.bold = 1;\n\n\tswitch(data.read_shift(2)) {\n\t\t/* case 0: out.vertAlign = \"baseline\"; break; */\n\t\tcase 1: out.vertAlign = \"superscript\"; break;\n\t\tcase 2: out.vertAlign = \"subscript\"; break;\n\t}\n\n\tvar underline = data.read_shift(1);\n\tif(underline != 0) out.underline = underline;\n\n\tvar family = data.read_shift(1);\n\tif(family > 0) out.family = family;\n\n\tvar bCharSet = data.read_shift(1);\n\tif(bCharSet > 0) out.charset = bCharSet;\n\n\tdata.l++;\n\tout.color = parse_BrtColor(data, 8);\n\n\tswitch(data.read_shift(1)) {\n\t\t/* case 0: out.scheme = \"none\": break; */\n\t\tcase 1: out.scheme = \"major\"; break;\n\t\tcase 2: out.scheme = \"minor\"; break;\n\t}\n\n\tout.name = parse_XLWideString(data, length - 21);\n\n\treturn out;\n}\nfunction write_BrtFont(font/*:any*/, o) {\n\tif(!o) o = new_buf(25+4*32);\n\to.write_shift(2, font.sz * 20);\n\twrite_FontFlags(font, o);\n\to.write_shift(2, font.bold ? 0x02BC : 0x0190);\n\tvar sss = 0;\n\tif(font.vertAlign == \"superscript\") sss = 1;\n\telse if(font.vertAlign == \"subscript\") sss = 2;\n\to.write_shift(2, sss);\n\to.write_shift(1, font.underline || 0);\n\to.write_shift(1, font.family || 0);\n\to.write_shift(1, font.charset || 0);\n\to.write_shift(1, 0);\n\twrite_BrtColor(font.color, o);\n\tvar scheme = 0;\n\tif(font.scheme == \"major\") scheme = 1;\n\tif(font.scheme == \"minor\") scheme = 2;\n\to.write_shift(1, scheme);\n\twrite_XLWideString(font.name, o);\n\treturn o.length > o.l ? o.slice(0, o.l) : o;\n}\n\n/* [MS-XLSB] 2.4.650 BrtFill */\nvar XLSBFillPTNames = [\n\t\"none\",\n\t\"solid\",\n\t\"mediumGray\",\n\t\"darkGray\",\n\t\"lightGray\",\n\t\"darkHorizontal\",\n\t\"darkVertical\",\n\t\"darkDown\",\n\t\"darkUp\",\n\t\"darkGrid\",\n\t\"darkTrellis\",\n\t\"lightHorizontal\",\n\t\"lightVertical\",\n\t\"lightDown\",\n\t\"lightUp\",\n\t\"lightGrid\",\n\t\"lightTrellis\",\n\t\"gray125\",\n\t\"gray0625\"\n];\nvar rev_XLSBFillPTNames/*:EvertNumType*/;\n/* TODO: gradient fill representation */\nvar parse_BrtFill = parsenoop;\nfunction write_BrtFill(fill, o) {\n\tif(!o) o = new_buf(4*3 + 8*7 + 16*1);\n\tif(!rev_XLSBFillPTNames) rev_XLSBFillPTNames = (evert(XLSBFillPTNames)/*:any*/);\n\tvar fls/*:number*/ = rev_XLSBFillPTNames[fill.patternType];\n\tif(fls == null) fls = 0x28;\n\to.write_shift(4, fls);\n\tvar j = 0;\n\tif(fls != 0x28) {\n\t\t/* TODO: custom FG Color */\n\t\twrite_BrtColor({auto:1}, o);\n\t\t/* TODO: custom BG Color */\n\t\twrite_BrtColor({auto:1}, o);\n\n\t\tfor(; j < 12; ++j) o.write_shift(4, 0);\n\t} else {\n\t\tfor(; j < 4; ++j) o.write_shift(4, 0);\n\n\t\tfor(; j < 12; ++j) o.write_shift(4, 0); /* TODO */\n\t\t/* iGradientType */\n\t\t/* xnumDegree */\n\t\t/* xnumFillToLeft */\n\t\t/* xnumFillToRight */\n\t\t/* xnumFillToTop */\n\t\t/* xnumFillToBottom */\n\t\t/* cNumStop */\n\t\t/* xfillGradientStop */\n\t}\n\treturn o.length > o.l ? o.slice(0, o.l) : o;\n}\n\n/* [MS-XLSB] 2.4.824 BrtXF */\nfunction parse_BrtXF(data, length/*:number*/) {\n\tvar tgt = data.l + length;\n\tvar ixfeParent = data.read_shift(2);\n\tvar ifmt = data.read_shift(2);\n\tdata.l = tgt;\n\treturn {ixfe:ixfeParent, numFmtId:ifmt };\n}\nfunction write_BrtXF(data, ixfeP, o) {\n\tif(!o) o = new_buf(16);\n\to.write_shift(2, ixfeP||0);\n\to.write_shift(2, data.numFmtId||0);\n\to.write_shift(2, 0); /* iFont */\n\to.write_shift(2, 0); /* iFill */\n\to.write_shift(2, 0); /* ixBorder */\n\to.write_shift(1, 0); /* trot */\n\to.write_shift(1, 0); /* indent */\n\tvar flow = 0;\n\to.write_shift(1, flow); /* flags */\n\to.write_shift(1, 0); /* flags */\n\to.write_shift(1, 0); /* xfGrbitAtr */\n\to.write_shift(1, 0);\n\treturn o;\n}\n\n/* [MS-XLSB] 2.5.4 Blxf TODO */\nfunction write_Blxf(data, o) {\n\tif(!o) o = new_buf(10);\n\to.write_shift(1, 0); /* dg */\n\to.write_shift(1, 0);\n\to.write_shift(4, 0); /* color */\n\to.write_shift(4, 0); /* color */\n\treturn o;\n}\n/* [MS-XLSB] 2.4.302 BrtBorder TODO */\nvar parse_BrtBorder = parsenoop;\nfunction write_BrtBorder(border, o) {\n\tif(!o) o = new_buf(51);\n\to.write_shift(1, 0); /* diagonal */\n\twrite_Blxf(null, o); /* top */\n\twrite_Blxf(null, o); /* bottom */\n\twrite_Blxf(null, o); /* left */\n\twrite_Blxf(null, o); /* right */\n\twrite_Blxf(null, o); /* diag */\n\treturn o.length > o.l ? o.slice(0, o.l) : o;\n}\n\n/* [MS-XLSB] 2.4.763 BrtStyle TODO */\nfunction write_BrtStyle(style, o) {\n\tif(!o) o = new_buf(12+4*10);\n\to.write_shift(4, style.xfId);\n\to.write_shift(2, 1);\n\to.write_shift(1, +style.builtinId);\n\to.write_shift(1, 0); /* iLevel */\n\twrite_XLNullableWideString(style.name || \"\", o);\n\treturn o.length > o.l ? o.slice(0, o.l) : o;\n}\n\n/* [MS-XLSB] 2.4.272 BrtBeginTableStyles */\nfunction write_BrtBeginTableStyles(cnt, defTableStyle, defPivotStyle) {\n\tvar o = new_buf(4+256*2*4);\n\to.write_shift(4, cnt);\n\twrite_XLNullableWideString(defTableStyle, o);\n\twrite_XLNullableWideString(defPivotStyle, o);\n\treturn o.length > o.l ? o.slice(0, o.l) : o;\n}\n\n/* [MS-XLSB] 2.1.7.50 Styles */\nfunction parse_sty_bin(data, themes, opts) {\n\tvar styles = {};\n\tstyles.NumberFmt = ([]/*:any*/);\n\tfor(var y in table_fmt) styles.NumberFmt[y] = table_fmt[y];\n\n\tstyles.CellXf = [];\n\tstyles.Fonts = [];\n\tvar state/*:Array*/ = [];\n\tvar pass = false;\n\trecordhopper(data, function hopper_sty(val, R, RT) {\n\t\tswitch(RT) {\n\t\t\tcase 0x002C: /* BrtFmt */\n\t\t\t\tstyles.NumberFmt[val[0]] = val[1]; SSF__load(val[1], val[0]);\n\t\t\t\tbreak;\n\t\t\tcase 0x002B: /* BrtFont */\n\t\t\t\tstyles.Fonts.push(val);\n\t\t\t\tif(val.color.theme != null && themes && themes.themeElements && themes.themeElements.clrScheme) {\n\t\t\t\t\tval.color.rgb = rgb_tint(themes.themeElements.clrScheme[val.color.theme].rgb, val.color.tint || 0);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 0x0401: /* BrtKnownFonts */ break;\n\t\t\tcase 0x002D: /* BrtFill */\n\t\t\t\tbreak;\n\t\t\tcase 0x002E: /* BrtBorder */\n\t\t\t\tbreak;\n\t\t\tcase 0x002F: /* BrtXF */\n\t\t\t\tif(state[state.length - 1] == 0x0269 /* BrtBeginCellXFs */) {\n\t\t\t\t\tstyles.CellXf.push(val);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 0x0030: /* BrtStyle */\n\t\t\tcase 0x01FB: /* BrtDXF */\n\t\t\tcase 0x023C: /* BrtMRUColor */\n\t\t\tcase 0x01DB: /* BrtIndexedColor */\n\t\t\t\tbreak;\n\n\t\t\tcase 0x0493: /* BrtDXF14 */\n\t\t\tcase 0x0836: /* BrtDXF15 */\n\t\t\tcase 0x046A: /* BrtSlicerStyleElement */\n\t\t\tcase 0x0200: /* BrtTableStyleElement */\n\t\t\tcase 0x082F: /* BrtTimelineStyleElement */\n\t\t\tcase 0x0C00: /* BrtUid */\n\t\t\t\tbreak;\n\n\t\t\tcase 0x0023: /* BrtFRTBegin */\n\t\t\t\tpass = true; break;\n\t\t\tcase 0x0024: /* BrtFRTEnd */\n\t\t\t\tpass = false; break;\n\t\t\tcase 0x0025: /* BrtACBegin */\n\t\t\t\tstate.push(RT); pass = true; break;\n\t\t\tcase 0x0026: /* BrtACEnd */\n\t\t\t\tstate.pop(); pass = false; break;\n\n\t\t\tdefault:\n\t\t\t\tif(R.T > 0) state.push(RT);\n\t\t\t\telse if(R.T < 0) state.pop();\n\t\t\t\telse if(!pass || (opts.WTF && state[state.length-1] != 0x0025 /* BrtACBegin */)) throw new Error(\"Unexpected record 0x\" + RT.toString(16));\n\t\t}\n\t});\n\treturn styles;\n}\n\nfunction write_FMTS_bin(ba, NF/*:?SSFTable*/) {\n\tif(!NF) return;\n\tvar cnt = 0;\n\t[[5,8],[23,26],[41,44],[/*63*/50,/*66],[164,*/392]].forEach(function(r) {\n\t\t/*:: if(!NF) return; */\n\t\tfor(var i = r[0]; i <= r[1]; ++i) if(NF[i] != null) ++cnt;\n\t});\n\n\tif(cnt == 0) return;\n\twrite_record(ba, 0x0267 /* BrtBeginFmts */, write_UInt32LE(cnt));\n\t[[5,8],[23,26],[41,44],[/*63*/50,/*66],[164,*/392]].forEach(function(r) {\n\t\t/*:: if(!NF) return; */\n\t\tfor(var i = r[0]; i <= r[1]; ++i) if(NF[i] != null) write_record(ba, 0x002C /* BrtFmt */, write_BrtFmt(i, NF[i]));\n\t});\n\twrite_record(ba, 0x0268 /* BrtEndFmts */);\n}\n\nfunction write_FONTS_bin(ba/*::, data*/) {\n\tvar cnt = 1;\n\n\tif(cnt == 0) return;\n\twrite_record(ba, 0x0263 /* BrtBeginFonts */, write_UInt32LE(cnt));\n\twrite_record(ba, 0x002B /* BrtFont */, write_BrtFont({\n\t\tsz:12,\n\t\tcolor: {theme:1},\n\t\tname: \"Calibri\",\n\t\tfamily: 2,\n\t\tscheme: \"minor\"\n\t}));\n\t/* 1*65491BrtFont [ACFONTS] */\n\twrite_record(ba, 0x0264 /* BrtEndFonts */);\n}\n\nfunction write_FILLS_bin(ba/*::, data*/) {\n\tvar cnt = 2;\n\n\tif(cnt == 0) return;\n\twrite_record(ba, 0x025B /* BrtBeginFills */, write_UInt32LE(cnt));\n\twrite_record(ba, 0x002D /* BrtFill */, write_BrtFill({patternType:\"none\"}));\n\twrite_record(ba, 0x002D /* BrtFill */, write_BrtFill({patternType:\"gray125\"}));\n\t/* 1*65431BrtFill */\n\twrite_record(ba, 0x025C /* BrtEndFills */);\n}\n\nfunction write_BORDERS_bin(ba/*::, data*/) {\n\tvar cnt = 1;\n\n\tif(cnt == 0) return;\n\twrite_record(ba, 0x0265 /* BrtBeginBorders */, write_UInt32LE(cnt));\n\twrite_record(ba, 0x002E /* BrtBorder */, write_BrtBorder({}));\n\t/* 1*65430BrtBorder */\n\twrite_record(ba, 0x0266 /* BrtEndBorders */);\n}\n\nfunction write_CELLSTYLEXFS_bin(ba/*::, data*/) {\n\tvar cnt = 1;\n\twrite_record(ba, 0x0272 /* BrtBeginCellStyleXFs */, write_UInt32LE(cnt));\n\twrite_record(ba, 0x002F /* BrtXF */, write_BrtXF({\n\t\tnumFmtId: 0,\n\t\tfontId: 0,\n\t\tfillId: 0,\n\t\tborderId: 0\n\t}, 0xFFFF));\n\t/* 1*65430(BrtXF *FRT) */\n\twrite_record(ba, 0x0273 /* BrtEndCellStyleXFs */);\n}\n\nfunction write_CELLXFS_bin(ba, data) {\n\twrite_record(ba, 0x0269 /* BrtBeginCellXFs */, write_UInt32LE(data.length));\n\tdata.forEach(function(c) { write_record(ba, 0x002F /* BrtXF */, write_BrtXF(c,0)); });\n\t/* 1*65430(BrtXF *FRT) */\n\twrite_record(ba, 0x026A /* BrtEndCellXFs */);\n}\n\nfunction write_STYLES_bin(ba/*::, data*/) {\n\tvar cnt = 1;\n\n\twrite_record(ba, 0x026B /* BrtBeginStyles */, write_UInt32LE(cnt));\n\twrite_record(ba, 0x0030 /* BrtStyle */, write_BrtStyle({\n\t\txfId:0,\n\t\tbuiltinId:0,\n\t\tname:\"Normal\"\n\t}));\n\t/* 1*65430(BrtStyle *FRT) */\n\twrite_record(ba, 0x026C /* BrtEndStyles */);\n}\n\nfunction write_DXFS_bin(ba/*::, data*/) {\n\tvar cnt = 0;\n\n\twrite_record(ba, 0x01F9 /* BrtBeginDXFs */, write_UInt32LE(cnt));\n\t/* *2147483647(BrtDXF *FRT) */\n\twrite_record(ba, 0x01FA /* BrtEndDXFs */);\n}\n\nfunction write_TABLESTYLES_bin(ba/*::, data*/) {\n\tvar cnt = 0;\n\n\twrite_record(ba, 0x01FC /* BrtBeginTableStyles */, write_BrtBeginTableStyles(cnt, \"TableStyleMedium9\", \"PivotStyleMedium4\"));\n\t/* *TABLESTYLE */\n\twrite_record(ba, 0x01FD /* BrtEndTableStyles */);\n}\n\nfunction write_COLORPALETTE_bin(/*::ba, data*/) {\n\treturn;\n\t/* BrtBeginColorPalette [INDEXEDCOLORS] [MRUCOLORS] BrtEndColorPalette */\n}\n\n/* [MS-XLSB] 2.1.7.50 Styles */\nfunction write_sty_bin(wb, opts) {\n\tvar ba = buf_array();\n\twrite_record(ba, 0x0116 /* BrtBeginStyleSheet */);\n\twrite_FMTS_bin(ba, wb.SSF);\n\twrite_FONTS_bin(ba, wb);\n\twrite_FILLS_bin(ba, wb);\n\twrite_BORDERS_bin(ba, wb);\n\twrite_CELLSTYLEXFS_bin(ba, wb);\n\twrite_CELLXFS_bin(ba, opts.cellXfs);\n\twrite_STYLES_bin(ba, wb);\n\twrite_DXFS_bin(ba, wb);\n\twrite_TABLESTYLES_bin(ba, wb);\n\twrite_COLORPALETTE_bin(ba, wb);\n\t/* FRTSTYLESHEET*/\n\twrite_record(ba, 0x0117 /* BrtEndStyleSheet */);\n\treturn ba.end();\n}\n/* Even though theme layout is dk1 lt1 dk2 lt2, true order is lt1 dk1 lt2 dk2 */\nvar XLSXThemeClrScheme = [\n\t'', '', '', '',\n\t'', '', '',\n\t'', '', '',\n\t'', ''\n];\n/* 20.1.6.2 clrScheme CT_ColorScheme */\nfunction parse_clrScheme(t, themes, opts) {\n\tthemes.themeElements.clrScheme = [];\n\tvar color = {};\n\t(t[0].match(tagregex)||[]).forEach(function(x) {\n\t\tvar y = parsexmltag(x);\n\t\tswitch(y[0]) {\n\t\t\t/* 20.1.6.2 clrScheme (Color Scheme) CT_ColorScheme */\n\t\t\tcase '': break;\n\n\t\t\t/* 20.1.2.3.32 srgbClr CT_SRgbColor */\n\t\t\tcase '': break;\n\n\t\t\t/* 20.1.2.3.33 sysClr CT_SystemColor */\n\t\t\tcase '': break;\n\n\t\t\t/* 20.1.4.1.1 accent1 (Accent 1) */\n\t\t\t/* 20.1.4.1.2 accent2 (Accent 2) */\n\t\t\t/* 20.1.4.1.3 accent3 (Accent 3) */\n\t\t\t/* 20.1.4.1.4 accent4 (Accent 4) */\n\t\t\t/* 20.1.4.1.5 accent5 (Accent 5) */\n\t\t\t/* 20.1.4.1.6 accent6 (Accent 6) */\n\t\t\t/* 20.1.4.1.9 dk1 (Dark 1) */\n\t\t\t/* 20.1.4.1.10 dk2 (Dark 2) */\n\t\t\t/* 20.1.4.1.15 folHlink (Followed Hyperlink) */\n\t\t\t/* 20.1.4.1.19 hlink (Hyperlink) */\n\t\t\t/* 20.1.4.1.22 lt1 (Light 1) */\n\t\t\t/* 20.1.4.1.23 lt2 (Light 2) */\n\t\t\tcase '':\n\t\t\tcase '':\n\t\t\tcase '':\n\t\t\tcase '':\n\t\t\tcase '': case '':\n\t\t\tcase '': case '':\n\t\t\tcase '': case '':\n\t\t\tcase '': case '':\n\t\t\tcase '': case '':\n\t\t\tcase '': case '':\n\t\t\tcase '': case '':\n\t\t\tcase '': case '':\n\t\t\tcase '': case '':\n\t\t\tcase '': case '':\n\t\t\t\tif (y[0].charAt(1) === '/') {\n\t\t\t\t\tthemes.themeElements.clrScheme[XLSXThemeClrScheme.indexOf(y[0])] = color;\n\t\t\t\t\tcolor = {};\n\t\t\t\t} else {\n\t\t\t\t\tcolor.name = y[0].slice(3, y[0].length - 1);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tdefault: if(opts && opts.WTF) throw new Error('Unrecognized ' + y[0] + ' in clrScheme');\n\t\t}\n\t});\n}\n\n/* 20.1.4.1.18 fontScheme CT_FontScheme */\nfunction parse_fontScheme(/*::t, themes, opts*/) { }\n\n/* 20.1.4.1.15 fmtScheme CT_StyleMatrix */\nfunction parse_fmtScheme(/*::t, themes, opts*/) { }\n\n/* 20.1.6.10 themeElements CT_BaseStyles */\nfunction parse_themeElements(data, themes, opts) {\n\tthemes.themeElements = {};\n\n\tvar t;\n\n\t/* clrScheme CT_ColorScheme */\n\tif(!(t=str_match_xml(data, \"a:clrScheme\"))) throw new Error('clrScheme not found in themeElements');\n\tparse_clrScheme(t, themes, opts);\n\n\t/* fontScheme CT_FontScheme */\n\tif(!(t=str_match_xml(data, \"a:fontScheme\"))) throw new Error('fontScheme not found in themeElements');\n\tparse_fontScheme(t, themes, opts);\n\n\t/* fmtScheme CT_StyleMatrix */\n\tif(!(t=str_match_xml(data, \"a:fmtScheme\"))) throw new Error('fmtScheme not found in themeElements');\n\tparse_fmtScheme(t, themes, opts);\n}\n\n/* 14.2.7 Theme Part */\nfunction parse_theme_xml(data/*:string*/, opts) {\n\t/* 20.1.6.9 theme CT_OfficeStyleSheet */\n\tif(!data || data.length === 0) data = write_theme();\n\n\tvar t;\n\tvar themes = {};\n\n\t/* themeElements CT_BaseStyles */\n\tif(!(t=str_match_xml(data, \"a:themeElements\"))) throw new Error('themeElements not found in theme');\n\tparse_themeElements(t[0], themes, opts);\n\tthemes.raw = data;\n\treturn themes;\n}\n\nfunction write_theme(Themes, opts)/*:string*/ {\n\tif(opts && opts.themeXLSX) return opts.themeXLSX;\n\tif(Themes && typeof Themes.raw == \"string\") return Themes.raw;\n\tvar o = [XML_HEADER];\n\to[o.length] = '';\n\to[o.length] = '';\n\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\to[o.length] = '';\n\treturn o.join(\"\");\n}\n/* [MS-XLS] 2.4.326 TODO: payload is a zip file */\nfunction parse_Theme(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar dwThemeVersion = blob.read_shift(4);\n\tif(dwThemeVersion === 124226) return;\n\tif(!opts.cellStyles) { blob.l = end; return; }\n\tvar data = blob.slice(blob.l);\n\tblob.l = end;\n\tvar zip; try { zip = zip_read(data, {type: \"array\"}); } catch(e) { return; }\n\tvar themeXML = getzipstr(zip, \"theme/theme/theme1.xml\", true);\n\tif(!themeXML) return;\n\treturn parse_theme_xml(themeXML, opts);\n}\n\n/* 2.5.49 */\nfunction parse_ColorTheme(blob/*::, length*/) { return blob.read_shift(4); }\n\n/* 2.5.155 */\nfunction parse_FullColorExt(blob/*::, length*/) {\n\tvar o = {};\n\to.xclrType = blob.read_shift(2);\n\to.nTintShade = blob.read_shift(2);\n\tswitch(o.xclrType) {\n\t\tcase 0: blob.l += 4; break;\n\t\tcase 1: o.xclrValue = parse_IcvXF(blob, 4); break;\n\t\tcase 2: o.xclrValue = parse_LongRGBA(blob, 4); break;\n\t\tcase 3: o.xclrValue = parse_ColorTheme(blob, 4); break;\n\t\tcase 4: blob.l += 4; break;\n\t}\n\tblob.l += 8;\n\treturn o;\n}\n\n/* 2.5.164 TODO: read 7 bits*/\nfunction parse_IcvXF(blob, length) {\n\treturn parsenoop(blob, length);\n}\n\n/* 2.5.280 */\nfunction parse_XFExtGradient(blob, length) {\n\treturn parsenoop(blob, length);\n}\n\n/* [MS-XLS] 2.5.108 */\nfunction parse_ExtProp(blob/*::, length*/)/*:Array*/ {\n\tvar extType = blob.read_shift(2);\n\tvar cb = blob.read_shift(2) - 4;\n\tvar o = [extType];\n\tswitch(extType) {\n\t\tcase 0x04: case 0x05: case 0x07: case 0x08:\n\t\tcase 0x09: case 0x0A: case 0x0B: case 0x0D:\n\t\t\to[1] = parse_FullColorExt(blob, cb); break;\n\t\tcase 0x06: o[1] = parse_XFExtGradient(blob, cb); break;\n\t\tcase 0x0E: case 0x0F: o[1] = blob.read_shift(cb === 1 ? 1 : 2); break;\n\t\tdefault: throw new Error(\"Unrecognized ExtProp type: \" + extType + \" \" + cb);\n\t}\n\treturn o;\n}\n\n/* 2.4.355 */\nfunction parse_XFExt(blob, length) {\n\tvar end = blob.l + length;\n\tblob.l += 2;\n\tvar ixfe = blob.read_shift(2);\n\tblob.l += 2;\n\tvar cexts = blob.read_shift(2);\n\tvar ext/*:AOA*/ = [];\n\twhile(cexts-- > 0) ext.push(parse_ExtProp(blob, end-blob.l));\n\treturn {ixfe:ixfe, ext:ext};\n}\n\n/* xf is an XF, see parse_XFExt for xfext */\nfunction update_xfext(xf, xfext) {\n\txfext.forEach(function(xfe) {\n\t\tswitch(xfe[0]) { /* 2.5.108 extPropData */\n\t\t\tcase 0x04: break; /* foreground color */\n\t\t\tcase 0x05: break; /* background color */\n\t\t\tcase 0x06: break; /* gradient fill */\n\t\t\tcase 0x07: break; /* top cell border color */\n\t\t\tcase 0x08: break; /* bottom cell border color */\n\t\t\tcase 0x09: break; /* left cell border color */\n\t\t\tcase 0x0a: break; /* right cell border color */\n\t\t\tcase 0x0b: break; /* diagonal cell border color */\n\t\t\tcase 0x0d: /* text color */\n\t\t\t\tbreak;\n\t\t\tcase 0x0e: break; /* font scheme */\n\t\t\tcase 0x0f: break; /* indentation level */\n\t\t}\n\t});\n}\n\nfunction parse_BrtMdtinfo(data, length) {\n return {\n flags: data.read_shift(4),\n version: data.read_shift(4),\n name: parse_XLWideString(data, length - 8)\n };\n}\nfunction write_BrtMdtinfo(data) {\n var o = new_buf(12 + 2 * data.name.length);\n o.write_shift(4, data.flags);\n o.write_shift(4, data.version);\n write_XLWideString(data.name, o);\n return o.slice(0, o.l);\n}\nfunction parse_BrtMdb(data) {\n var out = [];\n var cnt = data.read_shift(4);\n while (cnt-- > 0)\n out.push([data.read_shift(4), data.read_shift(4)]);\n return out;\n}\nfunction write_BrtMdb(mdb) {\n var o = new_buf(4 + 8 * mdb.length);\n o.write_shift(4, mdb.length);\n for (var i = 0; i < mdb.length; ++i) {\n o.write_shift(4, mdb[i][0]);\n o.write_shift(4, mdb[i][1]);\n }\n return o;\n}\nfunction write_BrtBeginEsfmd(cnt, name) {\n var o = new_buf(8 + 2 * name.length);\n o.write_shift(4, cnt);\n write_XLWideString(name, o);\n return o.slice(0, o.l);\n}\nfunction parse_BrtBeginEsmdb(data) {\n data.l += 4;\n return data.read_shift(4) != 0;\n}\nfunction write_BrtBeginEsmdb(cnt, cm) {\n var o = new_buf(8);\n o.write_shift(4, cnt);\n o.write_shift(4, cm ? 1 : 0);\n return o;\n}\nfunction parse_xlmeta_bin(data, name, _opts) {\n var out = { Types: [], Cell: [], Value: [] };\n var opts = _opts || {};\n var state = [];\n var pass = false;\n var metatype = 2;\n recordhopper(data, function(val, R, RT) {\n switch (RT) {\n case 335:\n out.Types.push({ name: val.name });\n break;\n case 51:\n val.forEach(function(r) {\n if (metatype == 1)\n out.Cell.push({ type: out.Types[r[0] - 1].name, index: r[1] });\n else if (metatype == 0)\n out.Value.push({ type: out.Types[r[0] - 1].name, index: r[1] });\n });\n break;\n case 337:\n metatype = val ? 1 : 0;\n break;\n case 338:\n metatype = 2;\n break;\n case 35:\n state.push(RT);\n pass = true;\n break;\n case 36:\n state.pop();\n pass = false;\n break;\n default:\n if (R.T) {\n } else if (!pass || opts.WTF && state[state.length - 1] != 35)\n throw new Error(\"Unexpected record 0x\" + RT.toString(16));\n }\n });\n return out;\n}\nfunction write_xlmeta_bin() {\n var ba = buf_array();\n write_record(ba, 332);\n write_record(ba, 334, write_UInt32LE(1));\n write_record(ba, 335, write_BrtMdtinfo({\n name: \"XLDAPR\",\n version: 12e4,\n flags: 3496657072\n }));\n write_record(ba, 336);\n write_record(ba, 339, write_BrtBeginEsfmd(1, \"XLDAPR\"));\n write_record(ba, 52);\n write_record(ba, 35, write_UInt32LE(514));\n write_record(ba, 4096, write_UInt32LE(0));\n write_record(ba, 4097, writeuint16(1));\n write_record(ba, 36);\n write_record(ba, 53);\n write_record(ba, 340);\n write_record(ba, 337, write_BrtBeginEsmdb(1, true));\n write_record(ba, 51, write_BrtMdb([[1, 0]]));\n write_record(ba, 338);\n write_record(ba, 333);\n return ba.end();\n}\nfunction parse_xlmeta_xml(data, name, opts) {\n var out = { Types: [], Cell: [], Value: [] };\n if (!data)\n return out;\n var pass = false;\n var metatype = 2;\n var lastmeta;\n data.replace(tagregex, function(x) {\n var y = parsexmltag(x);\n switch (strip_ns(y[0])) {\n case \"\":\n break;\n case \"\":\n break;\n case \"\":\n break;\n case \"\":\n break;\n case \"\":\n break;\n case \"\":\n break;\n case \"\":\n break;\n case \"\":\n metatype = 2;\n break;\n case \"\":\n metatype = 2;\n break;\n case \"\":\n case \"\":\n case \"\":\n break;\n case \"\":\n pass = false;\n break;\n case \"\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n');\n return o.join(\"\");\n}\n/* 18.6 Calculation Chain */\nfunction parse_cc_xml(data/*::, name, opts*/)/*:Array*/ {\n\tvar d = [];\n\tif(!data) return d;\n\tvar i = 1;\n\t(data.match(tagregex)||[]).forEach(function(x) {\n\t\tvar y = parsexmltag(x);\n\t\tswitch(y[0]) {\n\t\t\tcase '': case '': break;\n\t\t\t/* 18.6.1 c CT_CalcCell 1 */\n\t\t\tcase ']*r:id=\"([^<>\"]*)\"/)||[\"\",\"\"])[1];\n\n\treturn rels['!id'][id].Target;\n}\n\n/* L.5.5.2 SpreadsheetML Comments + VML Schema */\nfunction parse_vml(data/*:string*/, sheet, comments) {\n\tvar cidx = 0;\n\t(str_match_xml_ns_g(data, \"shape\")||[]).forEach(function(m) {\n\t\tvar type = \"\";\n\t\tvar hidden = true;\n\t\tvar aidx = -1;\n\t\tvar R = -1, C = -1;\n\t\tm.replace(tagregex, function(x/*:string*/, idx/*:number*/) {\n\t\t\tvar y = parsexmltag(x);\n\t\t\tswitch(strip_ns(y[0])) {\n\t\t\t\tcase '': hidden = false; break;\n\n\t\t\t\tcase '': aidx = idx + x.length; break;\n\t\t\t\tcase '': R = +m.slice(aidx, idx).trim(); break;\n\n\t\t\t\tcase '': aidx = idx + x.length; break;\n\t\t\t\tcase '': C = +m.slice(aidx, idx).trim(); break;\n\t\t\t}\n\t\t\treturn \"\";\n\t\t});\n\t\tswitch(type) {\n\t\tcase 'Note':\n\t\t\tvar cell = ws_get_cell_stub(sheet, ((R>=0 && C>=0) ? encode_cell({r:R,c:C}) : comments[cidx].ref));\n\t\t\tif(cell.c) {\n\t\t\t\tcell.c.hidden = hidden;\n\t\t\t}\n\t\t\t++cidx;\n\t\t\tbreak;\n\t\t}\n\n\t});\n}\n\n\n/* comment boxes */\nfunction write_vml(rId/*:number*/, comments, ws) {\n\tvar csize = [21600, 21600];\n\t/* L.5.2.1.2 Path Attribute */\n\tvar bbox = [\"m0,0l0\",csize[1],csize[0],csize[1],csize[0],\"0xe\"].join(\",\");\n\tvar o = [\n\t\twritextag(\"xml\", null, { 'xmlns:v': XLMLNS.v, 'xmlns:o': XLMLNS.o, 'xmlns:x': XLMLNS.x, 'xmlns:mv': XLMLNS.mv }).replace(/\\/>/,\">\"),\n\t\twritextag(\"o:shapelayout\", writextag(\"o:idmap\", null, {'v:ext':\"edit\", 'data':rId}), {'v:ext':\"edit\"})\n\t];\n\n\tvar _shapeid = 65536 * rId;\n\n\tvar _comments = comments || [];\n\tif(_comments.length > 0) o.push(writextag(\"v:shapetype\", [\n\t\twritextag(\"v:stroke\", null, {joinstyle:\"miter\"}),\n\t\twritextag(\"v:path\", null, {gradientshapeok:\"t\", 'o:connecttype':\"rect\"})\n\t].join(\"\"), {id:\"_x0000_t202\", coordsize:csize.join(\",\"), 'o:spt':202, path:bbox}));\n\n\t_comments.forEach(function(x) { ++_shapeid; o.push(write_vml_comment(x, _shapeid)); });\n\to.push('');\n\treturn o.join(\"\");\n}\n\nfunction write_vml_comment(x, _shapeid, ws)/*:string*/ {\n\tvar c = decode_cell(x[0]);\n\tvar fillopts = /*::(*/{'color2':\"#BEFF82\", 'type':\"gradient\"}/*:: :any)*/;\n\tif(fillopts.type == \"gradient\") fillopts.angle = \"-180\";\n\tvar fillparm = fillopts.type == \"gradient\" ? writextag(\"o:fill\", null, {type:\"gradientUnscaled\", 'v:ext':\"view\"}) : null;\n\tvar fillxml = writextag('v:fill', fillparm, fillopts);\n\n\tvar shadata = ({on:\"t\", 'obscured':\"t\"}/*:any*/);\n\n\treturn [\n\t'',\n\t\tfillxml,\n\t\twritextag(\"v:shadow\", null, shadata),\n\t\twritextag(\"v:path\", null, {'o:connecttype':\"none\"}),\n\t\t'
',\n\t\t'',\n\t\t\t'',\n\t\t\t'',\n\t\t\t/* Part 4 19.4.2.3 Anchor (Anchor) */\n\t\t\twritetag('x:Anchor', [c.c+1, 0, c.r+1, 0, c.c+3, 20, c.r+5, 20].join(\",\")),\n\t\t\twritetag('x:AutoFill', \"False\"),\n\t\t\twritetag('x:Row', String(c.r)),\n\t\t\twritetag('x:Column', String(c.c)),\n\t\t\tx[1].hidden ? '' : '',\n\t\t'',\n\t''\n\t].join(\"\");\n}\nfunction sheet_insert_comments(sheet/*:WorkSheet*/, comments/*:Array*/, threaded/*:boolean*/, people/*:?Array*/) {\n\tvar dense = sheet[\"!data\"] != null;\n\tvar cell/*:Cell*/;\n\tcomments.forEach(function(comment) {\n\t\tvar r = decode_cell(comment.ref);\n\t\tif(r.r < 0 || r.c < 0) return;\n\t\tif(dense) {\n\t\t\tif(!sheet[\"!data\"][r.r]) sheet[\"!data\"][r.r] = [];\n\t\t\tcell = sheet[\"!data\"][r.r][r.c];\n\t\t} else cell = sheet[comment.ref];\n\t\tif (!cell) {\n\t\t\tcell = ({t:\"z\"}/*:any*/);\n\t\t\tif(dense) sheet[\"!data\"][r.r][r.c] = cell;\n\t\t\telse sheet[comment.ref] = cell;\n\t\t\tvar range = safe_decode_range(sheet[\"!ref\"]||\"BDWGO1000001:A1\");\n\t\t\tif(range.s.r > r.r) range.s.r = r.r;\n\t\t\tif(range.e.r < r.r) range.e.r = r.r;\n\t\t\tif(range.s.c > r.c) range.s.c = r.c;\n\t\t\tif(range.e.c < r.c) range.e.c = r.c;\n\t\t\tvar encoded = encode_range(range);\n\t\t\tsheet[\"!ref\"] = encoded;\n\t\t}\n\n\t\tif (!cell.c) cell.c = [];\n\t\tvar o/*:Comment*/ = ({a: comment.author, t: comment.t, r: comment.r, T: threaded});\n\t\tif(comment.h) o.h = comment.h;\n\n\t\t/* threaded comments always override */\n\t\tfor(var i = cell.c.length - 1; i >= 0; --i) {\n\t\t\tif(!threaded && cell.c[i].T) return;\n\t\t\tif(threaded && !cell.c[i].T) cell.c.splice(i, 1);\n\t\t}\n\t\tif(threaded && people) for(i = 0; i < people.length; ++i) {\n\t\t\tif(o.a == people[i].id) { o.a = people[i].name || o.a; break; }\n\t\t}\n\t\tcell.c.push(o);\n\t});\n}\n/* 18.7 Comments */\nfunction parse_comments_xml(data/*:string*/, opts)/*:Array*/ {\n\t/* 18.7.6 CT_Comments */\n\tif(data.match(/<(?:\\w+:)?comments *\\/>/)) return [];\n\tvar authors/*:Array*/ = [];\n\tvar commentList/*:Array*/ = [];\n\tvar authtag = str_match_xml_ns(data, \"authors\");\n\tif(authtag && authtag[1]) authtag[1].split(/<\\/\\w*:?author>/).forEach(function(x) {\n\t\tif(x === \"\" || x.trim() === \"\") return;\n\t\tvar a = x.match(/<(?:\\w+:)?author[^<>]*>(.*)/);\n\t\tif(a) authors.push(a[1]);\n\t});\n\tvar cmnttag = str_match_xml_ns(data, \"commentList\");\n\tif(cmnttag && cmnttag[1]) cmnttag[1].split(/<\\/\\w*:?comment>/).forEach(function(x) {\n\t\tif(x === \"\" || x.trim() === \"\") return;\n\t\tvar cm = x.match(/<(?:\\w+:)?comment[^<>]*>/);\n\t\tif(!cm) return;\n\t\tvar y = parsexmltag(cm[0]);\n\t\tvar comment/*:RawComment*/ = ({ author: y.authorId && authors[y.authorId] || \"sheetjsghost\", ref: y.ref, guid: y.guid }/*:any*/);\n\t\tvar cell = decode_cell(y.ref);\n\t\tif(opts.sheetRows && opts.sheetRows <= cell.r) return;\n\t\tvar textMatch = str_match_xml_ns(x, \"text\");\n\t\tvar rt = !!textMatch && !!textMatch[1] && parse_si(textMatch[1]) || {r:\"\",t:\"\",h:\"\"};\n\t\tcomment.r = rt.r;\n\t\tif(rt.r == \"\") rt.t = rt.h = \"\";\n\t\tcomment.t = (rt.t||\"\").replace(/\\r\\n/g,\"\\n\").replace(/\\r/g,\"\\n\");\n\t\tif(opts.cellHTML) comment.h = rt.h;\n\t\tcommentList.push(comment);\n\t});\n\treturn commentList;\n}\n\nfunction write_comments_xml(data/*::, opts*/) {\n\tvar o = [XML_HEADER, writextag('comments', null, { 'xmlns': XMLNS_main[0] })];\n\n\tvar iauthor/*:Array*/ = [];\n\to.push(\"\");\n\tdata.forEach(function(x) { x[1].forEach(function(w) { var a = escapexml(w.a);\n\t\tif(iauthor.indexOf(a) == -1) {\n\t\t\tiauthor.push(a);\n\t\t\to.push(\"\" + a + \"\");\n\t\t}\n\t\tif(w.T && w.ID && iauthor.indexOf(\"tc=\" + w.ID) == -1) {\n\t\t\tiauthor.push(\"tc=\" + w.ID);\n\t\t\to.push(\"\" + \"tc=\" + w.ID + \"\");\n\t\t}\n\t}); });\n\tif(iauthor.length == 0) { iauthor.push(\"SheetJ5\"); o.push(\"SheetJ5\"); }\n\to.push(\"\");\n\to.push(\"\");\n\tdata.forEach(function(d) {\n\t\t/* 18.7.3 CT_Comment */\n\t\tvar lastauthor = 0, ts = [], tcnt = 0;\n\t\tif(d[1][0] && d[1][0].T && d[1][0].ID) lastauthor = iauthor.indexOf(\"tc=\" + d[1][0].ID);\n\t\td[1].forEach(function(c) {\n\t\t\tif(c.a) lastauthor = iauthor.indexOf(escapexml(c.a));\n\t\t\tif(c.T) ++tcnt;\n\t\t\tts.push(c.t == null ? \"\" : escapexml(c.t));\n\t\t});\n\t\tif(tcnt === 0) {\n\t\t\td[1].forEach(function(c) {\n\t\t\t\to.push('');\n\t\t\t\to.push(writetag(\"t\", c.t == null ? \"\" : escapexml(c.t)));\n\t\t\t\to.push('');\n\t\t\t});\n\t\t} else {\n\t\t\tif(d[1][0] && d[1][0].T && d[1][0].ID) lastauthor = iauthor.indexOf(\"tc=\" + d[1][0].ID);\n\t\t\t/* based on Threaded Comments -> Comments projection */\n\t\t\to.push('');\n\t\t\tvar t = \"Comment:\\n \" + (ts[0]) + \"\\n\";\n\t\t\tfor(var i = 1; i < ts.length; ++i) t += \"Reply:\\n \" + ts[i] + \"\\n\";\n\t\t\to.push(writetag(\"t\", escapexml(t)));\n\t\t\to.push('');\n\t\t}\n\t});\n\to.push(\"\");\n\tif(o.length>2) { o[o.length] = (''); o[1]=o[1].replace(\"/>\",\">\"); }\n\treturn o.join(\"\");\n}\n\n/* [MS-XLSX] 2.1.17 */\nfunction parse_tcmnt_xml(data/*:string*/, opts)/*:Array*/ {\n\tvar out = [];\n\tvar pass = false, comment = {}, tidx = 0;\n\tdata.replace(tagregex, function xml_tcmnt(x, idx) {\n\t\tvar y/*:any*/ = parsexmltag(x);\n\t\tswitch(strip_ns(y[0])) {\n\t\t\tcase '': break;\n\n\t\t\t/* 2.6.205 threadedComment CT_ThreadedComment */\n\t\t\tcase '': if(comment.t != null) out.push(comment); break;\n\n\t\t\tcase '': case '': comment.t = data.slice(tidx, idx).replace(/\\r\\n/g, \"\\n\").replace(/\\r/g, \"\\n\"); break;\n\n\t\t\t/* 2.6.206 mentions CT_ThreadedCommentMentions TODO */\n\t\t\tcase '': pass = true; break;\n\t\t\tcase '': pass = false; break;\n\n\t\t\t/* 2.6.202 mention CT_Mention TODO */\n\n\t\t\t/* 18.2.10 extLst CT_ExtensionList ? */\n\t\t\tcase '': case '
': case '': break;\n\t\t\t/* 18.2.7 ext CT_Extension + */\n\t\t\tcase '': pass=false; break;\n\n\t\t\tdefault: if(!pass && opts.WTF) throw new Error('unrecognized ' + y[0] + ' in threaded comments');\n\t\t}\n\t\treturn x;\n\t});\n\treturn out;\n}\n\nfunction write_tcmnt_xml(comments, people, opts) {\n\tvar o = [XML_HEADER, writextag('ThreadedComments', null, { 'xmlns': XMLNS.TCMNT }).replace(/[\\/]>/, \">\")];\n\tcomments.forEach(function(carr) {\n\t\tvar rootid = \"\";\n\t\t(carr[1] || []).forEach(function(c, idx) {\n\t\t\tif(!c.T) { delete c.ID; return; }\n\t\t\tif(c.a && people.indexOf(c.a) == -1) people.push(c.a);\n\t\t\tvar tcopts = {\n\t\t\t\tref: carr[0],\n\t\t\t\tid: \"{54EE7951-7262-4200-6969-\" + (\"000000000000\" + opts.tcid++).slice(-12) + \"}\"\n\t\t\t};\n\t\t\tif(idx == 0) rootid = tcopts.id;\n\t\t\telse tcopts.parentId = rootid;\n\t\t\tc.ID = tcopts.id;\n\t\t\tif(c.a) tcopts.personId = \"{54EE7950-7262-4200-6969-\" + (\"000000000000\" + people.indexOf(c.a)).slice(-12) + \"}\";\n\t\t\to.push(writextag('threadedComment', writetag('text', c.t||\"\"), tcopts));\n\t\t});\n\t});\n\to.push('');\n\treturn o.join(\"\");\n}\n\n/* [MS-XLSX] 2.1.18 */\nfunction parse_people_xml(data/*:string*/, opts) {\n\tvar out = [];\n\tvar pass = false;\n\tdata.replace(tagregex, function xml_tcmnt(x) {\n\t\tvar y/*:any*/ = parsexmltag(x);\n\t\tswitch(strip_ns(y[0])) {\n\t\t\tcase '': break;\n\n\t\t\t/* 2.6.203 person CT_Person TODO: providers */\n\t\t\tcase '': break;\n\n\t\t\t/* 18.2.10 extLst CT_ExtensionList ? */\n\t\t\tcase '': case '': case '': break;\n\t\t\t/* 18.2.7 ext CT_Extension + */\n\t\t\tcase '': pass=false; break;\n\n\t\t\tdefault: if(!pass && opts.WTF) throw new Error('unrecognized ' + y[0] + ' in threaded comments');\n\t\t}\n\t\treturn x;\n\t});\n\treturn out;\n}\nfunction write_people_xml(people/*, opts*/) {\n\tvar o = [XML_HEADER, writextag('personList', null, {\n\t\t'xmlns': XMLNS.TCMNT,\n\t\t'xmlns:x': XMLNS_main[0]\n\t}).replace(/[\\/]>/, \">\")];\n\tpeople.forEach(function(person, idx) {\n\t\to.push(writextag('person', null, {\n\t\t\tdisplayName: person,\n\t\t\tid: \"{54EE7950-7262-4200-6969-\" + (\"000000000000\" + idx).slice(-12) + \"}\",\n\t\t\tuserId: person,\n\t\t\tproviderId: \"None\"\n\t\t}));\n\t});\n\to.push(\"\");\n\treturn o.join(\"\");\n}\n/* [MS-XLSB] 2.4.28 BrtBeginComment */\nfunction parse_BrtBeginComment(data) {\n\tvar out = {};\n\tout.iauthor = data.read_shift(4);\n\tvar rfx = parse_UncheckedRfX(data, 16);\n\tout.rfx = rfx.s;\n\tout.ref = encode_cell(rfx.s);\n\tdata.l += 16; /*var guid = parse_GUID(data); */\n\treturn out;\n}\nfunction write_BrtBeginComment(data, o) {\n\tif(o == null) o = new_buf(36);\n\to.write_shift(4, data[1].iauthor);\n\twrite_UncheckedRfX((data[0]/*:any*/), o);\n\to.write_shift(4, 0);\n\to.write_shift(4, 0);\n\to.write_shift(4, 0);\n\to.write_shift(4, 0);\n\treturn o;\n}\n\n/* [MS-XLSB] 2.4.327 BrtCommentAuthor */\nvar parse_BrtCommentAuthor = parse_XLWideString;\nfunction write_BrtCommentAuthor(data) { return write_XLWideString(data.slice(0, 54)); }\n\n/* [MS-XLSB] 2.1.7.8 Comments */\nfunction parse_comments_bin(data, opts)/*:Array*/ {\n\tvar out/*:Array*/ = [];\n\tvar authors/*:Array*/ = [];\n\tvar c = {};\n\tvar pass = false;\n\trecordhopper(data, function hopper_cmnt(val, R, RT) {\n\t\tswitch(RT) {\n\t\t\tcase 0x0278: /* 'BrtCommentAuthor' */\n\t\t\t\tauthors.push(val); break;\n\t\t\tcase 0x027B: /* 'BrtBeginComment' */\n\t\t\t\tc = val; break;\n\t\t\tcase 0x027D: /* 'BrtCommentText' */\n\t\t\t\tc.t = val.t; c.h = val.h; c.r = val.r; break;\n\t\t\tcase 0x027C: /* 'BrtEndComment' */\n\t\t\t\tc.author = authors[c.iauthor];\n\t\t\t\tdelete (c/*:any*/).iauthor;\n\t\t\t\tif(opts.sheetRows && c.rfx && opts.sheetRows <= c.rfx.r) break;\n\t\t\t\tif(!c.t) c.t = \"\";\n\t\t\t\tdelete c.rfx; out.push(c); break;\n\n\t\t\tcase 0x0C00: /* 'BrtUid' */\n\t\t\t\tbreak;\n\n\t\t\tcase 0x0023: /* 'BrtFRTBegin' */\n\t\t\t\tpass = true; break;\n\t\t\tcase 0x0024: /* 'BrtFRTEnd' */\n\t\t\t\tpass = false; break;\n\t\t\tcase 0x0025: /* 'BrtACBegin' */ break;\n\t\t\tcase 0x0026: /* 'BrtACEnd' */ break;\n\n\n\t\t\tdefault:\n\t\t\t\tif(R.T){/* empty */}\n\t\t\t\telse if(!pass || opts.WTF) throw new Error(\"Unexpected record 0x\" + RT.toString(16));\n\t\t}\n\t});\n\treturn out;\n}\n\nfunction write_comments_bin(data/*::, opts*/) {\n\tvar ba = buf_array();\n\tvar iauthor/*:Array*/ = [];\n\twrite_record(ba, 0x0274 /* BrtBeginComments */);\n\n\twrite_record(ba, 0x0276 /* BrtBeginCommentAuthors */);\n\tdata.forEach(function(comment) {\n\t\tcomment[1].forEach(function(c) {\n\t\t\tif(iauthor.indexOf(c.a) > -1) return;\n\t\t\tiauthor.push(c.a.slice(0,54));\n\t\t\twrite_record(ba, 0x0278 /* BrtCommentAuthor */, write_BrtCommentAuthor(c.a));\n\t\t\tif(c.T && c.ID && iauthor.indexOf(\"tc=\" + c.ID) == -1) {\n\t\t\t\tiauthor.push(\"tc=\" + c.ID);\n\t\t\t\twrite_record(ba, 0x0278 /* BrtCommentAuthor */, write_BrtCommentAuthor(\"tc=\" + c.ID));\n\t\t\t}\n\t\t});\n\t});\n\twrite_record(ba, 0x0277 /* BrtEndCommentAuthors */);\n\n\twrite_record(ba, 0x0279 /* BrtBeginCommentList */);\n\tdata.forEach(function(comment) {\n\t\tcomment[1].forEach(function(c) {\n\t\t\tvar _ia = -1;\n\t\t\tif(c.ID) _ia = iauthor.indexOf(\"tc=\" + c.ID);\n\t\t\tif(_ia == -1 && comment[1][0].T && comment[1][0].ID) _ia = iauthor.indexOf(\"tc=\" + comment[1][0].ID);\n\t\t\tif(_ia == -1) _ia = iauthor.indexOf(c.a);\n\t\t\tc.iauthor = _ia;\n\t\t\tvar range = {s:decode_cell(comment[0]),e:decode_cell(comment[0])};\n\t\t\twrite_record(ba, 0x027B /* BrtBeginComment */, write_BrtBeginComment([range, c]));\n\t\t\tif(c.t && c.t.length > 0) write_record(ba, 0x027D /* BrtCommentText */, write_BrtCommentText(c));\n\t\t\twrite_record(ba, 0x027C /* BrtEndComment */);\n\t\t\tdelete c.iauthor;\n\t\t});\n\t});\n\twrite_record(ba, 0x027A /* BrtEndCommentList */);\n\n\twrite_record(ba, 0x0275 /* BrtEndComments */);\n\treturn ba.end();\n}\nvar CT_VBA = \"application/vnd.ms-office.vbaProject\";\nfunction make_vba_xls(cfb) {\n var newcfb = CFB.utils.cfb_new({ root: \"R\" });\n cfb.FullPaths.forEach(function(p, i) {\n if (p.slice(-1) === \"/\" || !p.match(/_VBA_PROJECT_CUR/))\n return;\n var newpath = p.replace(/^[^\\/]*/, \"R\").replace(/\\/_VBA_PROJECT_CUR\\u0000*/, \"\");\n CFB.utils.cfb_add(newcfb, newpath, cfb.FileIndex[i].content);\n });\n return CFB.write(newcfb);\n}\nfunction fill_vba_xls(cfb, vba) {\n vba.FullPaths.forEach(function(p, i) {\n if (i == 0)\n return;\n var newpath = p.replace(/^[\\/]*[^\\/]*[\\/]/, \"/_VBA_PROJECT_CUR/\");\n if (newpath.slice(-1) !== \"/\")\n CFB.utils.cfb_add(cfb, newpath, vba.FileIndex[i].content);\n });\n}\nvar VBAFMTS = [\"xlsb\", \"xlsm\", \"xlam\", \"biff8\", \"xla\"];\n/* macro and dialog sheet stubs */\nfunction parse_ds_bin(/*::data:any, opts, idx:number, rels, wb, themes, styles*/)/*:Worksheet*/ { return {'!type':'dialog'}; }\nfunction parse_ds_xml(/*::data:any, opts, idx:number, rels, wb, themes, styles*/)/*:Worksheet*/ { return {'!type':'dialog'}; }\nfunction parse_ms_bin(/*::data:any, opts, idx:number, rels, wb, themes, styles*/)/*:Worksheet*/ { return {'!type':'macro'}; }\nfunction parse_ms_xml(/*::data:any, opts, idx:number, rels, wb, themes, styles*/)/*:Worksheet*/ { return {'!type':'macro'}; }\n/* TODO: it will be useful to parse the function str */\nvar rc_to_a1 = /*#__PURE__*/(function(){\n\tvar rcregex = /(^|[^A-Za-z_])R(\\[?-?\\d+\\]|[1-9]\\d*|)C(\\[?-?\\d+\\]|[1-9]\\d*|)(?![A-Za-z0-9_])/g;\n\tvar rcbase/*:Cell*/ = ({r:0,c:0}/*:any*/);\n\tfunction rcfunc($$,$1,$2,$3) {\n\t\tvar cRel = false, rRel = false;\n\n\t\tif($2.length == 0) rRel = true;\n\t\telse if($2.charAt(0) == \"[\") { rRel = true; $2 = $2.slice(1, -1); }\n\n\t\tif($3.length == 0) cRel = true;\n\t\telse if($3.charAt(0) == \"[\") { cRel = true; $3 = $3.slice(1, -1); }\n\n\t\tvar R = $2.length>0?parseInt($2,10)|0:0, C = $3.length>0?parseInt($3,10)|0:0;\n\n\t\tif(cRel) C += rcbase.c; else --C;\n\t\tif(rRel) R += rcbase.r; else --R;\n\t\treturn $1 + (cRel ? \"\" : \"$\") + encode_col(C) + (rRel ? \"\" : \"$\") + encode_row(R);\n\t}\n\treturn function rc_to_a1(fstr/*:string*/, base/*:Cell*/)/*:string*/ {\n\t\trcbase = base;\n\t\treturn fstr.replace(rcregex, rcfunc);\n\t};\n})();\n\nvar crefregex = /(^|[^._A-Z0-9])(\\$?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])(\\$?)(\\d{1,7})(?![_.\\(A-Za-z0-9])/g;\ntry {\n\tcrefregex = /(^|[^._A-Z0-9])([$]?)([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])([$]?)(10[0-3]\\d{4}|104[0-7]\\d{3}|1048[0-4]\\d{2}|10485[0-6]\\d|104857[0-6]|[1-9]\\d{0,5})(?![_.\\(A-Za-z0-9])/g;\n}catch(e){}\nvar a1_to_rc = /*#__PURE__*/(function(){\n\treturn function a1_to_rc(fstr/*:string*/, base/*:CellAddress*/) {\n\t\treturn fstr.replace(crefregex, function($0, $1, $2, $3, $4, $5) {\n\t\t\tvar c = decode_col($3) - ($2 ? 0 : base.c);\n\t\t\tvar r = decode_row($5) - ($4 ? 0 : base.r);\n\t\t\tvar R = $4 == \"$\" ? (r+1) : (r == 0 ? \"\" : \"[\" + r + \"]\");\n\t\t\tvar C = $2 == \"$\" ? (c+1) : (c == 0 ? \"\" : \"[\" + c + \"]\");\n\t\t\treturn $1 + \"R\" + R + \"C\" + C;\n\t\t});\n\t};\n})();\n\n/* no defined name can collide with a valid cell address A1:XFD1048576 ... except LOG10! */\nfunction shift_formula_str(f/*:string*/, delta/*:Cell*/)/*:string*/ {\n\treturn f.replace(crefregex, function($0, $1, $2, $3, $4, $5) {\n\t\treturn $1+($2==\"$\" ? $2+$3 : encode_col(decode_col($3)+delta.c))+($4==\"$\" ? $4+$5 : encode_row(decode_row($5) + delta.r));\n\t});\n}\n\nfunction shift_formula_xlsx(f/*:string*/, range/*:string*/, cell/*:string*/)/*:string*/ {\n\tvar r = decode_range(range), s = r.s, c = decode_cell(cell);\n\tvar delta = {r:c.r - s.r, c:c.c - s.c};\n\treturn shift_formula_str(f, delta);\n}\n\n/* TODO: parse formula */\nfunction fuzzyfmla(f/*:string*/)/*:boolean*/ {\n\tif(f.length == 1) return false;\n\treturn true;\n}\n\nfunction _xlfn(f/*:string*/)/*:string*/ {\n\treturn f.replace(/_xlfn\\./g,\"\");\n}\nfunction parseread1(blob) { blob.l+=1; return; }\n\n/* [MS-XLS] 2.5.51 */\nfunction parse_ColRelU(blob, length) {\n\tvar c = blob.read_shift(length == 1 ? 1 : 2);\n\treturn [c & 0x3FFF, (c >> 14) & 1, (c >> 15) & 1];\n}\n\n/* [MS-XLS] 2.5.198.105 ; [MS-XLSB] 2.5.97.89 */\nfunction parse_RgceArea(blob, length, opts) {\n\tvar w = 2;\n\tif(opts) {\n\t\tif(opts.biff >= 2 && opts.biff <= 5) return parse_RgceArea_BIFF2(blob, length, opts);\n\t\telse if(opts.biff == 12) w = 4;\n\t}\n\tvar r=blob.read_shift(w), R=blob.read_shift(w);\n\tvar c=parse_ColRelU(blob, 2);\n\tvar C=parse_ColRelU(blob, 2);\n\treturn { s:{r:r, c:c[0], cRel:c[1], rRel:c[2]}, e:{r:R, c:C[0], cRel:C[1], rRel:C[2]} };\n}\n/* BIFF 2-5 encodes flags in the row field */\nfunction parse_RgceArea_BIFF2(blob/*::, length, opts*/) {\n\tvar r=parse_ColRelU(blob, 2), R=parse_ColRelU(blob, 2);\n\tvar c=blob.read_shift(1);\n\tvar C=blob.read_shift(1);\n\treturn { s:{r:r[0], c:c, cRel:r[1], rRel:r[2]}, e:{r:R[0], c:C, cRel:R[1], rRel:R[2]} };\n}\n\n/* [MS-XLS] 2.5.198.105 ; [MS-XLSB] 2.5.97.90 */\nfunction parse_RgceAreaRel(blob, length, opts) {\n\tif(opts.biff < 8) return parse_RgceArea_BIFF2(blob, length, opts);\n\tvar r=blob.read_shift(opts.biff == 12 ? 4 : 2), R=blob.read_shift(opts.biff == 12 ? 4 : 2);\n\tvar c=parse_ColRelU(blob, 2);\n\tvar C=parse_ColRelU(blob, 2);\n\treturn { s:{r:r, c:c[0], cRel:c[1], rRel:c[2]}, e:{r:R, c:C[0], cRel:C[1], rRel:C[2]} };\n}\n\n/* [MS-XLS] 2.5.198.109 ; [MS-XLSB] 2.5.97.91 */\nfunction parse_RgceLoc(blob, length, opts) {\n\tif(opts && opts.biff >= 2 && opts.biff <= 5) return parse_RgceLoc_BIFF2(blob, length, opts);\n\tvar r = blob.read_shift(opts && opts.biff == 12 ? 4 : 2);\n\tvar c = parse_ColRelU(blob, 2);\n\treturn {r:r, c:c[0], cRel:c[1], rRel:c[2]};\n}\nfunction parse_RgceLoc_BIFF2(blob/*::, length, opts*/) {\n\tvar r = parse_ColRelU(blob, 2);\n\tvar c = blob.read_shift(1);\n\treturn {r:r[0], c:c, cRel:r[1], rRel:r[2]};\n}\n\n/* [MS-XLS] 2.5.198.107, 2.5.47 */\nfunction parse_RgceElfLoc(blob/*::, length, opts*/) {\n\tvar r = blob.read_shift(2);\n\tvar c = blob.read_shift(2);\n\treturn {r:r, c:c & 0xFF, fQuoted:!!(c & 0x4000), cRel:c>>15, rRel:c>>15 };\n}\n\n/* [MS-XLS] 2.5.198.111 ; [MS-XLSB] 2.5.97.92 TODO */\nfunction parse_RgceLocRel(blob, length, opts) {\n\tvar biff = opts && opts.biff ? opts.biff : 8;\n\tif(biff >= 2 && biff <= 5) return parse_RgceLocRel_BIFF2(blob, length, opts);\n\tvar r = blob.read_shift(biff >= 12 ? 4 : 2);\n\tvar cl = blob.read_shift(2);\n\tvar cRel = (cl & 0x4000) >> 14, rRel = (cl & 0x8000) >> 15;\n\tcl &= 0x3FFF;\n\tif(rRel == 1) while(r > 0x7FFFF) r -= 0x100000;\n\tif(cRel == 1) while(cl > 0x1FFF) cl = cl - 0x4000;\n\treturn {r:r,c:cl,cRel:cRel,rRel:rRel};\n}\nfunction parse_RgceLocRel_BIFF2(blob/*::, length:number, opts*/) {\n\tvar rl = blob.read_shift(2);\n\tvar c = blob.read_shift(1);\n\tvar rRel = (rl & 0x8000) >> 15, cRel = (rl & 0x4000) >> 14;\n\trl &= 0x3FFF;\n\tif(rRel == 1 && rl >= 0x2000) rl = rl - 0x4000;\n\tif(cRel == 1 && c >= 0x80) c = c - 0x100;\n\treturn {r:rl,c:c,cRel:cRel,rRel:rRel};\n}\n\n/* [MS-XLS] 2.5.198.27 ; [MS-XLSB] 2.5.97.18 */\nfunction parse_PtgArea(blob, length, opts) {\n\tvar type = (blob[blob.l++] & 0x60) >> 5;\n\tvar area = parse_RgceArea(blob, opts.biff >= 2 && opts.biff <= 5 ? 6 : 8, opts);\n\treturn [type, area];\n}\n\n/* [MS-XLS] 2.5.198.28 ; [MS-XLSB] 2.5.97.19 */\nfunction parse_PtgArea3d(blob, length, opts) {\n\tvar type = (blob[blob.l++] & 0x60) >> 5;\n\tvar ixti = blob.read_shift(2, 'i');\n\tvar w = 8;\n\tif(opts) switch(opts.biff) {\n\t\tcase 5: blob.l += 12; w = 6; break;\n\t\tcase 12: w = 12; break;\n\t}\n\tvar area = parse_RgceArea(blob, w, opts);\n\treturn [type, ixti, area];\n}\n\n/* [MS-XLS] 2.5.198.29 ; [MS-XLSB] 2.5.97.20 */\nfunction parse_PtgAreaErr(blob, length, opts) {\n\tvar type = (blob[blob.l++] & 0x60) >> 5;\n\tblob.l += opts && (opts.biff > 8) ? 12 : (opts.biff < 8 ? 6 : 8);\n\treturn [type];\n}\n/* [MS-XLS] 2.5.198.30 ; [MS-XLSB] 2.5.97.21 */\nfunction parse_PtgAreaErr3d(blob, length, opts) {\n\tvar type = (blob[blob.l++] & 0x60) >> 5;\n\tvar ixti = blob.read_shift(2);\n\tvar w = 8;\n\tif(opts) switch(opts.biff) {\n\t\tcase 5: blob.l += 12; w = 6; break;\n\t\tcase 12: w = 12; break;\n\t}\n\tblob.l += w;\n\treturn [type, ixti];\n}\n\n/* [MS-XLS] 2.5.198.31 ; [MS-XLSB] 2.5.97.22 */\nfunction parse_PtgAreaN(blob, length, opts) {\n\tvar type = (blob[blob.l++] & 0x60) >> 5;\n\tvar area = parse_RgceAreaRel(blob, length - 1, opts);\n\treturn [type, area];\n}\n\n/* [MS-XLS] 2.5.198.32 ; [MS-XLSB] 2.5.97.23 */\nfunction parse_PtgArray(blob, length, opts) {\n\tvar type = (blob[blob.l++] & 0x60) >> 5;\n\tblob.l += opts.biff == 2 ? 6 : opts.biff == 12 ? 14 : 7;\n\treturn [type];\n}\n\n/* [MS-XLS] 2.5.198.33 ; [MS-XLSB] 2.5.97.24 */\nfunction parse_PtgAttrBaxcel(blob) {\n\tvar bitSemi = blob[blob.l+1] & 0x01; /* 1 = volatile */\n\tvar bitBaxcel = 1;\n\tblob.l += 4;\n\treturn [bitSemi, bitBaxcel];\n}\n\n/* [MS-XLS] 2.5.198.34 ; [MS-XLSB] 2.5.97.25 */\nfunction parse_PtgAttrChoose(blob, length, opts)/*:Array*/ {\n\tblob.l +=2;\n\tvar offset = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);\n\tvar o/*:Array*/ = [];\n\t/* offset is 1 less than the number of elements */\n\tfor(var i = 0; i <= offset; ++i) o.push(blob.read_shift(opts && opts.biff == 2 ? 1 : 2));\n\treturn o;\n}\n\n/* [MS-XLS] 2.5.198.35 ; [MS-XLSB] 2.5.97.26 */\nfunction parse_PtgAttrGoto(blob, length, opts) {\n\tvar bitGoto = (blob[blob.l+1] & 0xFF) ? 1 : 0;\n\tblob.l += 2;\n\treturn [bitGoto, blob.read_shift(opts && opts.biff == 2 ? 1 : 2)];\n}\n\n/* [MS-XLS] 2.5.198.36 ; [MS-XLSB] 2.5.97.27 */\nfunction parse_PtgAttrIf(blob, length, opts) {\n\tvar bitIf = (blob[blob.l+1] & 0xFF) ? 1 : 0;\n\tblob.l += 2;\n\treturn [bitIf, blob.read_shift(opts && opts.biff == 2 ? 1 : 2)];\n}\n\n/* [MS-XLSB] 2.5.97.28 */\nfunction parse_PtgAttrIfError(blob) {\n\tvar bitIf = (blob[blob.l+1] & 0xFF) ? 1 : 0;\n\tblob.l += 2;\n\treturn [bitIf, blob.read_shift(2)];\n}\n\n/* [MS-XLS] 2.5.198.37 ; [MS-XLSB] 2.5.97.29 */\nfunction parse_PtgAttrSemi(blob, length, opts) {\n\tvar bitSemi = (blob[blob.l+1] & 0xFF) ? 1 : 0;\n\tblob.l += opts && opts.biff == 2 ? 3 : 4;\n\treturn [bitSemi];\n}\n\n/* [MS-XLS] 2.5.198.40 ; [MS-XLSB] 2.5.97.32 */\nfunction parse_PtgAttrSpaceType(blob/*::, length*/) {\n\tvar type = blob.read_shift(1), cch = blob.read_shift(1);\n\treturn [type, cch];\n}\n\n/* [MS-XLS] 2.5.198.38 ; [MS-XLSB] 2.5.97.30 */\nfunction parse_PtgAttrSpace(blob) {\n\tblob.read_shift(2);\n\treturn parse_PtgAttrSpaceType(blob, 2);\n}\n\n/* [MS-XLS] 2.5.198.39 ; [MS-XLSB] 2.5.97.31 */\nfunction parse_PtgAttrSpaceSemi(blob) {\n\tblob.read_shift(2);\n\treturn parse_PtgAttrSpaceType(blob, 2);\n}\n\n/* [MS-XLS] 2.5.198.84 ; [MS-XLSB] 2.5.97.68 TODO */\nfunction parse_PtgRef(blob, length, opts) {\n\t//var ptg = blob[blob.l] & 0x1F;\n\tvar type = (blob[blob.l] & 0x60)>>5;\n\tblob.l += 1;\n\tvar loc = parse_RgceLoc(blob, 0, opts);\n\treturn [type, loc];\n}\n\n/* [MS-XLS] 2.5.198.88 ; [MS-XLSB] 2.5.97.72 TODO */\nfunction parse_PtgRefN(blob, length, opts) {\n\tvar type = (blob[blob.l] & 0x60)>>5;\n\tblob.l += 1;\n\tvar loc = parse_RgceLocRel(blob, 0, opts);\n\treturn [type, loc];\n}\n\n/* [MS-XLS] 2.5.198.85 ; [MS-XLSB] 2.5.97.69 TODO */\nfunction parse_PtgRef3d(blob, length, opts) {\n\tvar type = (blob[blob.l] & 0x60)>>5;\n\tblob.l += 1;\n\tvar ixti = blob.read_shift(2); // XtiIndex\n\tif(opts && opts.biff == 5) blob.l += 12;\n\tvar loc = parse_RgceLoc(blob, 0, opts); // TODO: or RgceLocRel\n\treturn [type, ixti, loc];\n}\n\n\n/* [MS-XLS] 2.5.198.62 ; [MS-XLSB] 2.5.97.45 TODO */\nfunction parse_PtgFunc(blob, length, opts) {\n\t//var ptg = blob[blob.l] & 0x1F;\n\tvar type = (blob[blob.l] & 0x60)>>5;\n\tblob.l += 1;\n\tvar iftab = blob.read_shift(opts && opts.biff <= 3 ? 1 : 2);\n\treturn [FtabArgc[iftab], Ftab[iftab], type];\n}\n/* [MS-XLS] 2.5.198.63 ; [MS-XLSB] 2.5.97.46 TODO */\nfunction parse_PtgFuncVar(blob, length, opts) {\n\tvar type = blob[blob.l++];\n\tvar cparams = blob.read_shift(1), tab = opts && opts.biff <= 3 ? [(type == 0x58 ? -1 : 0), blob.read_shift(1)]: parsetab(blob);\n\treturn [cparams, (tab[0] === 0 ? Ftab : Cetab)[tab[1]]];\n}\n\nfunction parsetab(blob) {\n\treturn [blob[blob.l+1]>>7, blob.read_shift(2) & 0x7FFF];\n}\n\n/* [MS-XLS] 2.5.198.41 ; [MS-XLSB] 2.5.97.33 */\nfunction parse_PtgAttrSum(blob, length, opts) {\n\tblob.l += opts && opts.biff == 2 ? 3 : 4; return;\n}\n\n/* [MS-XLS] 2.5.198.58 ; [MS-XLSB] 2.5.97.40 */\nfunction parse_PtgExp(blob, length, opts) {\n\tblob.l++;\n\tif(opts && opts.biff == 12) return [blob.read_shift(4, 'i'), 0];\n\tvar row = blob.read_shift(2);\n\tvar col = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);\n\treturn [row, col];\n}\n\n/* [MS-XLS] 2.5.198.57 ; [MS-XLSB] 2.5.97.39 */\nfunction parse_PtgErr(blob) { blob.l++; return BErr[blob.read_shift(1)]; }\n\n/* [MS-XLS] 2.5.198.66 ; [MS-XLSB] 2.5.97.49 */\nfunction parse_PtgInt(blob) { blob.l++; return blob.read_shift(2); }\n\n/* [MS-XLS] 2.5.198.42 ; [MS-XLSB] 2.5.97.34 */\nfunction parse_PtgBool(blob) { blob.l++; return blob.read_shift(1)!==0;}\n\n/* [MS-XLS] 2.5.198.79 ; [MS-XLSB] 2.5.97.63 */\nfunction parse_PtgNum(blob) { blob.l++; return parse_Xnum(blob, 8); }\n\n/* [MS-XLS] 2.5.198.89 ; [MS-XLSB] 2.5.97.74 */\nfunction parse_PtgStr(blob, length, opts) { blob.l++; return parse_ShortXLUnicodeString(blob, length-1, opts); }\n\n/* [MS-XLS] 2.5.192.112 + 2.5.192.11{3,4,5,6,7} */\n/* [MS-XLSB] 2.5.97.93 + 2.5.97.9{4,5,6,7} */\nfunction parse_SerAr(blob, biff/*:number*/) {\n\tvar val = [blob.read_shift(1)];\n\tif(biff == 12) switch(val[0]) {\n\t\tcase 0x02: val[0] = 0x04; break; /* SerBool */\n\t\tcase 0x04: val[0] = 0x10; break; /* SerErr */\n\t\tcase 0x00: val[0] = 0x01; break; /* SerNum */\n\t\tcase 0x01: val[0] = 0x02; break; /* SerStr */\n\t}\n\tswitch(val[0]) {\n\t\tcase 0x04: /* SerBool -- boolean */\n\t\t\tval[1] = parsebool(blob, 1) ? 'TRUE' : 'FALSE';\n\t\t\tif(biff != 12) blob.l += 7; break;\n\t\tcase 0x25: /* appears to be an alias */\n\t\tcase 0x10: /* SerErr -- error */\n\t\t\tval[1] = BErr[blob[blob.l]];\n\t\t\tblob.l += ((biff == 12) ? 4 : 8); break;\n\t\tcase 0x00: /* SerNil -- honestly, I'm not sure how to reproduce this */\n\t\t\tblob.l += 8; break;\n\t\tcase 0x01: /* SerNum -- Xnum */\n\t\t\tval[1] = parse_Xnum(blob, 8); break;\n\t\tcase 0x02: /* SerStr -- XLUnicodeString (<256 chars) */\n\t\t\tval[1] = parse_XLUnicodeString2(blob, 0, {biff:biff > 0 && biff < 8 ? 2 : biff}); break;\n\t\tdefault: throw new Error(\"Bad SerAr: \" + val[0]); /* Unreachable */\n\t}\n\treturn val;\n}\n\n/* [MS-XLS] 2.5.198.61 ; [MS-XLSB] 2.5.97.44 */\nfunction parse_PtgExtraMem(blob, cce, opts) {\n\tvar count = blob.read_shift((opts.biff == 12) ? 4 : 2);\n\tvar out/*:Array*/ = [];\n\tfor(var i = 0; i != count; ++i) out.push(((opts.biff == 12) ? parse_UncheckedRfX : parse_Ref8U)(blob, 8));\n\treturn out;\n}\n\n/* [MS-XLS] 2.5.198.59 ; [MS-XLSB] 2.5.97.41 */\nfunction parse_PtgExtraArray(blob, length, opts) {\n\tvar rows = 0, cols = 0;\n\tif(opts.biff == 12) {\n\t\trows = blob.read_shift(4); // DRw\n\t\tcols = blob.read_shift(4); // DCol\n\t} else {\n\t\tcols = 1 + blob.read_shift(1); //DColByteU\n\t\trows = 1 + blob.read_shift(2); //DRw\n\t}\n\tif(opts.biff >= 2 && opts.biff < 8) { --rows; if(--cols == 0) cols = 0x100; }\n\t// $FlowIgnore\n\tfor(var i = 0, o/*:Array>*/ = []; i != rows && (o[i] = []); ++i)\n\t\tfor(var j = 0; j != cols; ++j) o[i][j] = parse_SerAr(blob, opts.biff);\n\treturn o;\n}\n\n/* [MS-XLS] 2.5.198.76 ; [MS-XLSB] 2.5.97.60 */\nfunction parse_PtgName(blob, length, opts) {\n\tvar type = (blob.read_shift(1) >>> 5) & 0x03;\n\tvar w = (!opts || (opts.biff >= 8)) ? 4 : 2;\n\tvar nameindex = blob.read_shift(w);\n\tswitch(opts.biff) {\n\t\tcase 2: blob.l += 5; break;\n\t\tcase 3: case 4: blob.l += 8; break;\n\t\tcase 5: blob.l += 12; break;\n\t}\n\treturn [type, 0, nameindex];\n}\n\n/* [MS-XLS] 2.5.198.77 ; [MS-XLSB] 2.5.97.61 */\nfunction parse_PtgNameX(blob, length, opts) {\n\tif(opts.biff == 5) return parse_PtgNameX_BIFF5(blob, length, opts);\n\tvar type = (blob.read_shift(1) >>> 5) & 0x03;\n\tvar ixti = blob.read_shift(2); // XtiIndex\n\tvar nameindex = blob.read_shift(4);\n\treturn [type, ixti, nameindex];\n}\nfunction parse_PtgNameX_BIFF5(blob/*::, length, opts*/) {\n\tvar type = (blob.read_shift(1) >>> 5) & 0x03;\n\tvar ixti = blob.read_shift(2, 'i'); // XtiIndex\n\tblob.l += 8;\n\tvar nameindex = blob.read_shift(2);\n\tblob.l += 12;\n\treturn [type, ixti, nameindex];\n}\n\n/* [MS-XLS] 2.5.198.70 ; [MS-XLSB] 2.5.97.54 */\nfunction parse_PtgMemArea(blob, length, opts) {\n\tvar type = (blob.read_shift(1) >>> 5) & 0x03;\n\tblob.l += (opts && opts.biff == 2 ? 3 : 4);\n\tvar cce = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);\n\treturn [type, cce];\n}\n\n/* [MS-XLS] 2.5.198.72 ; [MS-XLSB] 2.5.97.56 */\nfunction parse_PtgMemFunc(blob, length, opts) {\n\tvar type = (blob.read_shift(1) >>> 5) & 0x03;\n\tvar cce = blob.read_shift(opts && opts.biff == 2 ? 1 : 2);\n\treturn [type, cce];\n}\n\n\n/* [MS-XLS] 2.5.198.86 ; [MS-XLSB] 2.5.97.69 */\nfunction parse_PtgRefErr(blob, length, opts) {\n\tvar type = (blob.read_shift(1) >>> 5) & 0x03;\n\tblob.l += 4;\n\tif(opts.biff < 8) blob.l--;\n\tif(opts.biff == 12) blob.l += 2;\n\treturn [type];\n}\n\n/* [MS-XLS] 2.5.198.87 ; [MS-XLSB] 2.5.97.71 */\nfunction parse_PtgRefErr3d(blob, length, opts) {\n\tvar type = (blob[blob.l++] & 0x60) >> 5;\n\tvar ixti = blob.read_shift(2);\n\tvar w = 4;\n\tif(opts) switch(opts.biff) {\n\t\tcase 5: w = 15; break;\n\t\tcase 12: w = 6; break;\n\t}\n\tblob.l += w;\n\treturn [type, ixti];\n}\n\n/* [MS-XLS] 2.5.198.71 ; [MS-XLSB] 2.5.97.55 */\nvar parse_PtgMemErr = parsenoop;\n/* [MS-XLS] 2.5.198.73 ; [MS-XLSB] 2.5.97.57 */\nvar parse_PtgMemNoMem = parsenoop;\n/* [MS-XLS] 2.5.198.92 */\nvar parse_PtgTbl = parsenoop;\n\nfunction parse_PtgElfLoc(blob, length, opts) {\n\tblob.l += 2;\n\treturn [parse_RgceElfLoc(blob, 4, opts)];\n}\nfunction parse_PtgElfNoop(blob/*::, length, opts*/) {\n\tblob.l += 6;\n\treturn [];\n}\n/* [MS-XLS] 2.5.198.46 */\nvar parse_PtgElfCol = parse_PtgElfLoc;\n/* [MS-XLS] 2.5.198.47 */\nvar parse_PtgElfColS = parse_PtgElfNoop;\n/* [MS-XLS] 2.5.198.48 */\nvar parse_PtgElfColSV = parse_PtgElfNoop;\n/* [MS-XLS] 2.5.198.49 */\nvar parse_PtgElfColV = parse_PtgElfLoc;\n/* [MS-XLS] 2.5.198.50 */\nfunction parse_PtgElfLel(blob/*::, length, opts*/) {\n\tblob.l += 2;\n\treturn [parseuint16(blob), blob.read_shift(2) & 0x01];\n}\n/* [MS-XLS] 2.5.198.51 */\nvar parse_PtgElfRadical = parse_PtgElfLoc;\n/* [MS-XLS] 2.5.198.52 */\nvar parse_PtgElfRadicalLel = parse_PtgElfLel;\n/* [MS-XLS] 2.5.198.53 */\nvar parse_PtgElfRadicalS = parse_PtgElfNoop;\n/* [MS-XLS] 2.5.198.54 */\nvar parse_PtgElfRw = parse_PtgElfLoc;\n/* [MS-XLS] 2.5.198.55 */\nvar parse_PtgElfRwV = parse_PtgElfLoc;\n\n/* [MS-XLSB] 2.5.97.52 TODO */\nvar PtgListRT = [\n\t\"Data\",\n\t\"All\",\n\t\"Headers\",\n\t\"??\",\n\t\"?Data2\",\n\t\"??\",\n\t\"?DataHeaders\",\n\t\"??\",\n\t\"Totals\",\n\t\"??\",\n\t\"??\",\n\t\"??\",\n\t\"?DataTotals\",\n\t\"??\",\n\t\"??\",\n\t\"??\",\n\t\"?Current\"\n];\nfunction parse_PtgList(blob/*::, length, opts*/) {\n\tblob.l += 2;\n\tvar ixti = blob.read_shift(2);\n\tvar flags = blob.read_shift(2);\n\tvar idx = blob.read_shift(4);\n\tvar c = blob.read_shift(2);\n\tvar C = blob.read_shift(2);\n\tvar rt = PtgListRT[(flags >> 2) & 0x1F];\n\treturn {ixti: ixti, coltype:(flags&0x3), rt:rt, idx:idx, c:c, C:C};\n}\n/* [MS-XLS] 2.5.198.91 ; [MS-XLSB] 2.5.97.76 */\nfunction parse_PtgSxName(blob/*::, length, opts*/) {\n\tblob.l += 2;\n\treturn [blob.read_shift(4)];\n}\n\n/* [XLS] old spec */\nfunction parse_PtgSheet(blob, length, opts) {\n\tblob.l += 5;\n\tblob.l += 2;\n\tblob.l += (opts.biff == 2 ? 1 : 4);\n\treturn [\"PTGSHEET\"];\n}\nfunction parse_PtgEndSheet(blob, length, opts) {\n\tblob.l += (opts.biff == 2 ? 4 : 5);\n\treturn [\"PTGENDSHEET\"];\n}\nfunction parse_PtgMemAreaN(blob/*::, length, opts*/) {\n\tvar type = (blob.read_shift(1) >>> 5) & 0x03;\n\tvar cce = blob.read_shift(2);\n\treturn [type, cce];\n}\nfunction parse_PtgMemNoMemN(blob/*::, length, opts*/) {\n\tvar type = (blob.read_shift(1) >>> 5) & 0x03;\n\tvar cce = blob.read_shift(2);\n\treturn [type, cce];\n}\nfunction parse_PtgAttrNoop(blob/*::, length, opts*/) {\n\tblob.l += 4;\n\treturn [0, 0];\n}\n\n/* [MS-XLS] 2.5.198.25 ; [MS-XLSB] 2.5.97.16 */\nvar PtgTypes = {\n\t0x01: { n:'PtgExp', f:parse_PtgExp },\n\t0x02: { n:'PtgTbl', f:parse_PtgTbl },\n\t0x03: { n:'PtgAdd', f:parseread1 },\n\t0x04: { n:'PtgSub', f:parseread1 },\n\t0x05: { n:'PtgMul', f:parseread1 },\n\t0x06: { n:'PtgDiv', f:parseread1 },\n\t0x07: { n:'PtgPower', f:parseread1 },\n\t0x08: { n:'PtgConcat', f:parseread1 },\n\t0x09: { n:'PtgLt', f:parseread1 },\n\t0x0A: { n:'PtgLe', f:parseread1 },\n\t0x0B: { n:'PtgEq', f:parseread1 },\n\t0x0C: { n:'PtgGe', f:parseread1 },\n\t0x0D: { n:'PtgGt', f:parseread1 },\n\t0x0E: { n:'PtgNe', f:parseread1 },\n\t0x0F: { n:'PtgIsect', f:parseread1 },\n\t0x10: { n:'PtgUnion', f:parseread1 },\n\t0x11: { n:'PtgRange', f:parseread1 },\n\t0x12: { n:'PtgUplus', f:parseread1 },\n\t0x13: { n:'PtgUminus', f:parseread1 },\n\t0x14: { n:'PtgPercent', f:parseread1 },\n\t0x15: { n:'PtgParen', f:parseread1 },\n\t0x16: { n:'PtgMissArg', f:parseread1 },\n\t0x17: { n:'PtgStr', f:parse_PtgStr },\n\t0x1A: { n:'PtgSheet', f:parse_PtgSheet },\n\t0x1B: { n:'PtgEndSheet', f:parse_PtgEndSheet },\n\t0x1C: { n:'PtgErr', f:parse_PtgErr },\n\t0x1D: { n:'PtgBool', f:parse_PtgBool },\n\t0x1E: { n:'PtgInt', f:parse_PtgInt },\n\t0x1F: { n:'PtgNum', f:parse_PtgNum },\n\t0x20: { n:'PtgArray', f:parse_PtgArray },\n\t0x21: { n:'PtgFunc', f:parse_PtgFunc },\n\t0x22: { n:'PtgFuncVar', f:parse_PtgFuncVar },\n\t0x23: { n:'PtgName', f:parse_PtgName },\n\t0x24: { n:'PtgRef', f:parse_PtgRef },\n\t0x25: { n:'PtgArea', f:parse_PtgArea },\n\t0x26: { n:'PtgMemArea', f:parse_PtgMemArea },\n\t0x27: { n:'PtgMemErr', f:parse_PtgMemErr },\n\t0x28: { n:'PtgMemNoMem', f:parse_PtgMemNoMem },\n\t0x29: { n:'PtgMemFunc', f:parse_PtgMemFunc },\n\t0x2A: { n:'PtgRefErr', f:parse_PtgRefErr },\n\t0x2B: { n:'PtgAreaErr', f:parse_PtgAreaErr },\n\t0x2C: { n:'PtgRefN', f:parse_PtgRefN },\n\t0x2D: { n:'PtgAreaN', f:parse_PtgAreaN },\n\t0x2E: { n:'PtgMemAreaN', f:parse_PtgMemAreaN },\n\t0x2F: { n:'PtgMemNoMemN', f:parse_PtgMemNoMemN },\n\t0x39: { n:'PtgNameX', f:parse_PtgNameX },\n\t0x3A: { n:'PtgRef3d', f:parse_PtgRef3d },\n\t0x3B: { n:'PtgArea3d', f:parse_PtgArea3d },\n\t0x3C: { n:'PtgRefErr3d', f:parse_PtgRefErr3d },\n\t0x3D: { n:'PtgAreaErr3d', f:parse_PtgAreaErr3d },\n\t0xFF: {}\n};\n/* These are duplicated in the PtgTypes table */\nvar PtgDupes = {\n\t0x40: 0x20, 0x60: 0x20,\n\t0x41: 0x21, 0x61: 0x21,\n\t0x42: 0x22, 0x62: 0x22,\n\t0x43: 0x23, 0x63: 0x23,\n\t0x44: 0x24, 0x64: 0x24,\n\t0x45: 0x25, 0x65: 0x25,\n\t0x46: 0x26, 0x66: 0x26,\n\t0x47: 0x27, 0x67: 0x27,\n\t0x48: 0x28, 0x68: 0x28,\n\t0x49: 0x29, 0x69: 0x29,\n\t0x4A: 0x2A, 0x6A: 0x2A,\n\t0x4B: 0x2B, 0x6B: 0x2B,\n\t0x4C: 0x2C, 0x6C: 0x2C,\n\t0x4D: 0x2D, 0x6D: 0x2D,\n\t0x4E: 0x2E, 0x6E: 0x2E,\n\t0x4F: 0x2F, 0x6F: 0x2F,\n\t0x58: 0x22, 0x78: 0x22,\n\t0x59: 0x39, 0x79: 0x39,\n\t0x5A: 0x3A, 0x7A: 0x3A,\n\t0x5B: 0x3B, 0x7B: 0x3B,\n\t0x5C: 0x3C, 0x7C: 0x3C,\n\t0x5D: 0x3D, 0x7D: 0x3D\n};\n\nvar Ptg18 = {\n\t0x01: { n:'PtgElfLel', f:parse_PtgElfLel },\n\t0x02: { n:'PtgElfRw', f:parse_PtgElfRw },\n\t0x03: { n:'PtgElfCol', f:parse_PtgElfCol },\n\t0x06: { n:'PtgElfRwV', f:parse_PtgElfRwV },\n\t0x07: { n:'PtgElfColV', f:parse_PtgElfColV },\n\t0x0A: { n:'PtgElfRadical', f:parse_PtgElfRadical },\n\t0x0B: { n:'PtgElfRadicalS', f:parse_PtgElfRadicalS },\n\t0x0D: { n:'PtgElfColS', f:parse_PtgElfColS },\n\t0x0F: { n:'PtgElfColSV', f:parse_PtgElfColSV },\n\t0x10: { n:'PtgElfRadicalLel', f:parse_PtgElfRadicalLel },\n\t0x19: { n:'PtgList', f:parse_PtgList },\n\t0x1D: { n:'PtgSxName', f:parse_PtgSxName },\n\t0xFF: {}\n};\nvar Ptg19 = {\n\t0x00: { n:'PtgAttrNoop', f:parse_PtgAttrNoop },\n\t0x01: { n:'PtgAttrSemi', f:parse_PtgAttrSemi },\n\t0x02: { n:'PtgAttrIf', f:parse_PtgAttrIf },\n\t0x04: { n:'PtgAttrChoose', f:parse_PtgAttrChoose },\n\t0x08: { n:'PtgAttrGoto', f:parse_PtgAttrGoto },\n\t0x10: { n:'PtgAttrSum', f:parse_PtgAttrSum },\n\t0x20: { n:'PtgAttrBaxcel', f:parse_PtgAttrBaxcel },\n\t0x21: { n:'PtgAttrBaxcel', f:parse_PtgAttrBaxcel },\n\t0x40: { n:'PtgAttrSpace', f:parse_PtgAttrSpace },\n\t0x41: { n:'PtgAttrSpaceSemi', f:parse_PtgAttrSpaceSemi },\n\t0x80: { n:'PtgAttrIfError', f:parse_PtgAttrIfError },\n\t0xFF: {}\n};\n\n/* [MS-XLS] 2.5.198.103 ; [MS-XLSB] 2.5.97.87 */\nfunction parse_RgbExtra(blob, length, rgce, opts) {\n\tif(opts.biff < 8) return parsenoop(blob, length);\n\tvar target = blob.l + length;\n\tvar o = [];\n\tfor(var i = 0; i !== rgce.length; ++i) {\n\t\tswitch(rgce[i][0]) {\n\t\t\tcase 'PtgArray': /* PtgArray -> PtgExtraArray */\n\t\t\t\trgce[i][1] = parse_PtgExtraArray(blob, 0, opts);\n\t\t\t\to.push(rgce[i][1]);\n\t\t\t\tbreak;\n\t\t\tcase 'PtgMemArea': /* PtgMemArea -> PtgExtraMem */\n\t\t\t\trgce[i][2] = parse_PtgExtraMem(blob, rgce[i][1], opts);\n\t\t\t\to.push(rgce[i][2]);\n\t\t\t\tbreak;\n\t\t\tcase 'PtgExp': /* PtgExp -> PtgExtraCol */\n\t\t\t\tif(opts && opts.biff == 12) {\n\t\t\t\t\trgce[i][1][1] = blob.read_shift(4);\n\t\t\t\t\to.push(rgce[i][1]);\n\t\t\t\t} break;\n\t\t\tcase 'PtgList': /* TODO: PtgList -> PtgExtraList */\n\t\t\tcase 'PtgElfRadicalS': /* TODO: PtgElfRadicalS -> PtgExtraElf */\n\t\t\tcase 'PtgElfColS': /* TODO: PtgElfColS -> PtgExtraElf */\n\t\t\tcase 'PtgElfColSV': /* TODO: PtgElfColSV -> PtgExtraElf */\n\t\t\t\tthrow \"Unsupported \" + rgce[i][0];\n\t\t\tdefault: break;\n\t\t}\n\t}\n\tlength = target - blob.l;\n\t/* note: this is technically an error but Excel disregards */\n\t//if(target !== blob.l && blob.l !== target - length) throw new Error(target + \" != \" + blob.l);\n\tif(length !== 0) o.push(parsenoop(blob, length));\n\treturn o;\n}\n\n/* [MS-XLS] 2.5.198.104 ; [MS-XLSB] 2.5.97.88 */\nfunction parse_Rgce(blob, length, opts) {\n\tvar target = blob.l + length;\n\tvar R, id, ptgs = [];\n\twhile(target != blob.l) {\n\t\tlength = target - blob.l;\n\t\tid = blob[blob.l];\n\t\tR = PtgTypes[id] || PtgTypes[PtgDupes[id]];\n\t\tif(id === 0x18 || id === 0x19) R = (id === 0x18 ? Ptg18 : Ptg19)[blob[blob.l + 1]];\n\t\tif(!R || !R.f) { /*ptgs.push*/(parsenoop(blob, length)); }\n\t\telse { ptgs.push([R.n, R.f(blob, length, opts)]); }\n\t}\n\treturn ptgs;\n}\n\nfunction stringify_array(f/*:Array>*/)/*:string*/ {\n\tvar o/*:Array*/ = [];\n\tfor(var i = 0; i < f.length; ++i) {\n\t\tvar x = f[i], r/*:Array*/ = [];\n\t\tfor(var j = 0; j < x.length; ++j) {\n\t\t\tvar y = x[j];\n\t\t\tif(y) switch(y[0]) {\n\t\t\t\t// TODO: handle embedded quotes\n\t\t\t\tcase 0x02:\n\t\t\t\t\t/*:: if(typeof y[1] != 'string') throw \"unreachable\"; */\n\t\t\t\t\tr.push('\"' + y[1].replace(/\"/g,'\"\"') + '\"'); break;\n\t\t\t\tdefault: r.push(y[1]);\n\t\t\t} else r.push(\"\");\n\t\t}\n\t\to.push(r.join(\",\"));\n\t}\n\treturn o.join(\";\");\n}\n\n/* [MS-XLS] 2.2.2 ; [MS-XLSB] 2.2.2 TODO */\nvar PtgBinOp = {\n\tPtgAdd: \"+\",\n\tPtgConcat: \"&\",\n\tPtgDiv: \"/\",\n\tPtgEq: \"=\",\n\tPtgGe: \">=\",\n\tPtgGt: \">\",\n\tPtgLe: \"<=\",\n\tPtgLt: \"<\",\n\tPtgMul: \"*\",\n\tPtgNe: \"<>\",\n\tPtgPower: \"^\",\n\tPtgSub: \"-\"\n};\n\n// TODO: explore space\nfunction make_3d_range(start, end) {\n\tvar s = start.lastIndexOf(\"!\"), e = end.lastIndexOf(\"!\");\n\tif(s == -1 && e == -1) return start + \":\" + end;\n\tif(s > 0 && e > 0 && start.slice(0, s).toLowerCase() == end.slice(0, e).toLowerCase()) return start + \":\" + end.slice(e+1);\n\tconsole.error(\"Cannot hydrate range\", start, end);\n\treturn start + \":\" + end;\n}\n\nfunction get_ixti_raw(supbooks, ixti/*:number*/, opts)/*:string*/ {\n\tif(!supbooks) return \"SH33TJSERR0\";\n\tif(opts.biff > 8 && (!supbooks.XTI || !supbooks.XTI[ixti])) return supbooks.SheetNames[ixti];\n\tif(!supbooks.XTI) return \"SH33TJSERR6\";\n\tvar XTI = supbooks.XTI[ixti];\n\tif(opts.biff < 8) {\n\t\tif(ixti > 10000) ixti-= 65536;\n\t\tif(ixti < 0) ixti = -ixti;\n\t\treturn ixti == 0 ? \"\" : supbooks.XTI[ixti - 1];\n\t}\n\tif(!XTI) return \"SH33TJSERR1\";\n\tvar o = \"\";\n\tif(opts.biff > 8) switch(supbooks[XTI[0]][0]) {\n\t\tcase 0x0165: /* 'BrtSupSelf' */\n\t\t\to = XTI[1] == -1 ? \"#REF\" : supbooks.SheetNames[XTI[1]];\n\t\t\treturn XTI[1] == XTI[2] ? o : o + \":\" + supbooks.SheetNames[XTI[2]];\n\t\tcase 0x0166: /* 'BrtSupSame' */\n\t\t\tif(opts.SID != null) return supbooks.SheetNames[opts.SID];\n\t\t\treturn \"SH33TJSSAME\" + supbooks[XTI[0]][0];\n\t\tcase 0x0163: /* 'BrtSupBookSrc' */\n\t\t\t/* falls through */\n\t\tdefault: return \"SH33TJSSRC\" + supbooks[XTI[0]][0];\n\t}\n\tswitch(supbooks[XTI[0]][0][0]) {\n\t\tcase 0x0401:\n\t\t\to = XTI[1] == -1 ? \"#REF\" : (supbooks.SheetNames[XTI[1]] || \"SH33TJSERR3\");\n\t\t\treturn XTI[1] == XTI[2] ? o : o + \":\" + supbooks.SheetNames[XTI[2]];\n\t\tcase 0x3A01: return supbooks[XTI[0]].slice(1).map(function(name) { return name.Name; }).join(\";;\"); //return \"SH33TJSERR8\";\n\t\tdefault:\n\t\t\tif(!supbooks[XTI[0]][0][3]) return \"SH33TJSERR2\";\n\t\t\to = XTI[1] == -1 ? \"#REF\" : (supbooks[XTI[0]][0][3][XTI[1]] || \"SH33TJSERR4\");\n\t\t\treturn XTI[1] == XTI[2] ? o : o + \":\" + supbooks[XTI[0]][0][3][XTI[2]];\n\t}\n}\nfunction get_ixti(supbooks, ixti/*:number*/, opts)/*:string*/ {\n\tvar ixtiraw = get_ixti_raw(supbooks, ixti, opts);\n\treturn ixtiraw == \"#REF\" ? ixtiraw : formula_quote_sheet_name(ixtiraw, opts);\n}\nfunction stringify_formula(formula/*Array*/, range, cell/*:any*/, supbooks, opts)/*:string*/ {\n\tvar biff = (opts && opts.biff) || 8;\n\tvar _range = /*range != null ? range :*/ {s:{c:0, r:0},e:{c:0, r:0}};\n\tvar stack/*:Array*/ = [], e1, e2, /*::type,*/ c/*:CellAddress*/, ixti=0, nameidx=0, r, sname=\"\";\n\tif(!formula[0] || !formula[0][0]) return \"\";\n\tvar last_sp = -1, sp = \"\";\n\tfor(var ff = 0, fflen = formula[0].length; ff < fflen; ++ff) {\n\t\tvar f = formula[0][ff];\n\t\tswitch(f[0]) {\n\t\t\tcase 'PtgUminus': /* [MS-XLS] 2.5.198.93 */\n\t\t\t\tstack.push(\"-\" + stack.pop()); break;\n\t\t\tcase 'PtgUplus': /* [MS-XLS] 2.5.198.95 */\n\t\t\t\tstack.push(\"+\" + stack.pop()); break;\n\t\t\tcase 'PtgPercent': /* [MS-XLS] 2.5.198.81 */\n\t\t\t\tstack.push(stack.pop() + \"%\"); break;\n\n\t\t\tcase 'PtgAdd': /* [MS-XLS] 2.5.198.26 */\n\t\t\tcase 'PtgConcat': /* [MS-XLS] 2.5.198.43 */\n\t\t\tcase 'PtgDiv': /* [MS-XLS] 2.5.198.45 */\n\t\t\tcase 'PtgEq': /* [MS-XLS] 2.5.198.56 */\n\t\t\tcase 'PtgGe': /* [MS-XLS] 2.5.198.64 */\n\t\t\tcase 'PtgGt': /* [MS-XLS] 2.5.198.65 */\n\t\t\tcase 'PtgLe': /* [MS-XLS] 2.5.198.68 */\n\t\t\tcase 'PtgLt': /* [MS-XLS] 2.5.198.69 */\n\t\t\tcase 'PtgMul': /* [MS-XLS] 2.5.198.75 */\n\t\t\tcase 'PtgNe': /* [MS-XLS] 2.5.198.78 */\n\t\t\tcase 'PtgPower': /* [MS-XLS] 2.5.198.82 */\n\t\t\tcase 'PtgSub': /* [MS-XLS] 2.5.198.90 */\n\t\t\t\te1 = stack.pop(); e2 = stack.pop();\n\t\t\t\tif(last_sp >= 0) {\n\t\t\t\t\tswitch(formula[0][last_sp][1][0]) {\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\t// $FlowIgnore\n\t\t\t\t\t\t\tsp = fill(\" \", formula[0][last_sp][1][1]); break;\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t// $FlowIgnore\n\t\t\t\t\t\t\tsp = fill(\"\\r\", formula[0][last_sp][1][1]); break;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tsp = \"\";\n\t\t\t\t\t\t\t// $FlowIgnore\n\t\t\t\t\t\t\tif(opts.WTF) throw new Error(\"Unexpected PtgAttrSpaceType \" + formula[0][last_sp][1][0]);\n\t\t\t\t\t}\n\t\t\t\t\te2 = e2 + sp;\n\t\t\t\t\tlast_sp = -1;\n\t\t\t\t}\n\t\t\t\tstack.push(e2+PtgBinOp[f[0]]+e1);\n\t\t\t\tbreak;\n\n\t\t\tcase 'PtgIsect': /* [MS-XLS] 2.5.198.67 */\n\t\t\t\te1 = stack.pop(); e2 = stack.pop();\n\t\t\t\tstack.push(e2+\" \"+e1);\n\t\t\t\tbreak;\n\t\t\tcase 'PtgUnion': /* [MS-XLS] 2.5.198.94 */\n\t\t\t\te1 = stack.pop(); e2 = stack.pop();\n\t\t\t\tstack.push(e2+\",\"+e1);\n\t\t\t\tbreak;\n\t\t\tcase 'PtgRange': /* [MS-XLS] 2.5.198.83 */\n\t\t\t\te1 = stack.pop(); e2 = stack.pop();\n\t\t\t\tstack.push(make_3d_range(e2,e1));\n\t\t\t\tbreak;\n\n\t\t\tcase 'PtgAttrChoose': /* [MS-XLS] 2.5.198.34 */\n\t\t\t\tbreak;\n\t\t\tcase 'PtgAttrGoto': /* [MS-XLS] 2.5.198.35 */\n\t\t\t\tbreak;\n\t\t\tcase 'PtgAttrIf': /* [MS-XLS] 2.5.198.36 */\n\t\t\t\tbreak;\n\t\t\tcase 'PtgAttrIfError': /* [MS-XLSB] 2.5.97.28 */\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'PtgRef': /* [MS-XLS] 2.5.198.84 */\n\t\t\t\t/*::type = f[1][0]; */c = shift_cell_xls((f[1][1]/*:any*/), _range, opts);\n\t\t\t\tstack.push(encode_cell_xls(c, biff));\n\t\t\t\tbreak;\n\t\t\tcase 'PtgRefN': /* [MS-XLS] 2.5.198.88 */\n\t\t\t\t/*::type = f[1][0]; */c = cell ? shift_cell_xls((f[1][1]/*:any*/), cell, opts) : (f[1][1]/*:any*/);\n\t\t\t\tstack.push(encode_cell_xls(c, biff));\n\t\t\t\tbreak;\n\t\t\tcase 'PtgRef3d': /* [MS-XLS] 2.5.198.85 */\n\t\t\t\t/*::type = f[1][0]; */ixti = /*::Number(*/f[1][1]/*::)*/; c = shift_cell_xls((f[1][2]/*:any*/), _range, opts);\n\t\t\t\tsname = get_ixti(supbooks, ixti, opts);\n\t\t\t\tvar w = sname; /* IE9 fails on defined names */ // eslint-disable-line no-unused-vars\n\t\t\t\tstack.push(sname + \"!\" + encode_cell_xls(c, biff));\n\t\t\t\tbreak;\n\n\t\t\tcase 'PtgFunc': /* [MS-XLS] 2.5.198.62 */\n\t\t\tcase 'PtgFuncVar': /* [MS-XLS] 2.5.198.63 */\n\t\t\t\t/* f[1] = [argc, func, type] */\n\t\t\t\tvar argc/*:number*/ = (f[1][0]/*:any*/), func/*:string*/ = (f[1][1]/*:any*/);\n\t\t\t\tif(!argc) argc = 0;\n\t\t\t\targc &= 0x7F;\n\t\t\t\tvar args = argc == 0 ? [] : stack.slice(-argc);\n\t\t\t\tstack.length -= argc;\n\t\t\t\tif(func === 'User') func = args.shift();\n\t\t\t\tstack.push(func + \"(\" + args.join(\",\") + \")\");\n\t\t\t\tbreak;\n\n\t\t\tcase 'PtgBool': /* [MS-XLS] 2.5.198.42 */\n\t\t\t\tstack.push(f[1] ? \"TRUE\" : \"FALSE\"); break;\n\t\t\tcase 'PtgInt': /* [MS-XLS] 2.5.198.66 */\n\t\t\t\tstack.push(/*::String(*/f[1]/*::)*/); break;\n\t\t\tcase 'PtgNum': /* [MS-XLS] 2.5.198.79 TODO: precision? */\n\t\t\t\tstack.push(String(f[1])); break;\n\t\t\tcase 'PtgStr': /* [MS-XLS] 2.5.198.89 */\n\t\t\t\t// $FlowIgnore\n\t\t\t\tstack.push('\"' + f[1].replace(/\"/g, '\"\"') + '\"'); break;\n\t\t\tcase 'PtgErr': /* [MS-XLS] 2.5.198.57 */\n\t\t\t\tstack.push(/*::String(*/f[1]/*::)*/); break;\n\t\t\tcase 'PtgAreaN': /* [MS-XLS] 2.5.198.31 TODO */\n\t\t\t\t/*::type = f[1][0]; */r = shift_range_xls(f[1][1], cell ? {s:cell} : _range, opts);\n\t\t\t\tstack.push(encode_range_xls((r/*:any*/), opts));\n\t\t\t\tbreak;\n\t\t\tcase 'PtgArea': /* [MS-XLS] 2.5.198.27 TODO: fixed points */\n\t\t\t\t/*::type = f[1][0]; */r = shift_range_xls(f[1][1], _range, opts);\n\t\t\t\tstack.push(encode_range_xls((r/*:any*/), opts));\n\t\t\t\tbreak;\n\t\t\tcase 'PtgArea3d': /* [MS-XLS] 2.5.198.28 TODO */\n\t\t\t\t/*::type = f[1][0]; */ixti = /*::Number(*/f[1][1]/*::)*/; r = f[1][2];\n\t\t\t\tsname = get_ixti(supbooks, ixti, opts);\n\t\t\t\tstack.push(sname + \"!\" + encode_range_xls((r/*:any*/), opts));\n\t\t\t\tbreak;\n\t\t\tcase 'PtgAttrSum': /* [MS-XLS] 2.5.198.41 */\n\t\t\t\tstack.push(\"SUM(\" + stack.pop() + \")\");\n\t\t\t\tbreak;\n\n\t\t\tcase 'PtgAttrBaxcel': /* [MS-XLS] 2.5.198.33 */\n\t\t\tcase 'PtgAttrSemi': /* [MS-XLS] 2.5.198.37 */\n\t\t\t\tbreak;\n\n\t\t\tcase 'PtgName': /* [MS-XLS] 2.5.198.76 ; [MS-XLSB] 2.5.97.60 TODO: revisions */\n\t\t\t\t/* f[1] = type, 0, nameindex */\n\t\t\t\tnameidx = (f[1][2]/*:any*/);\n\t\t\t\tvar lbl = (supbooks.names||[])[nameidx-1] || (supbooks[0]||[])[nameidx];\n\t\t\t\tvar name = lbl ? lbl.Name : \"SH33TJSNAME\" + String(nameidx);\n\t\t\t\t/* [MS-XLSB] 2.5.97.10 Ftab -- last verified 20220204 */\n\t\t\t\tif(name && name.slice(0,6) == \"_xlfn.\" && !opts.xlfn) name = name.slice(6);\n\t\t\t\tstack.push(name);\n\t\t\t\tbreak;\n\n\t\t\tcase 'PtgNameX': /* [MS-XLS] 2.5.198.77 ; [MS-XLSB] 2.5.97.61 TODO: revisions */\n\t\t\t\t/* f[1] = type, ixti, nameindex */\n\t\t\t\tvar bookidx/*:number*/ = (f[1][1]/*:any*/); nameidx = (f[1][2]/*:any*/); var externbook;\n\t\t\t\t/* TODO: Properly handle missing values -- this should be using get_ixti_raw primarily */\n\t\t\t\tif(opts.biff <= 5) {\n\t\t\t\t\tif(bookidx < 0) bookidx = -bookidx;\n\t\t\t\t\tif(supbooks[bookidx]) externbook = supbooks[bookidx][nameidx];\n\t\t\t\t} else {\n\t\t\t\t\tvar o = \"\";\n\t\t\t\t\tif(((supbooks[bookidx]||[])[0]||[])[0] == 0x3A01){/* empty */}\n\t\t\t\t\telse if(((supbooks[bookidx]||[])[0]||[])[0] == 0x0401){\n\t\t\t\t\t\tif(supbooks[bookidx][nameidx] && supbooks[bookidx][nameidx].itab > 0) {\n\t\t\t\t\t\t\to = supbooks.SheetNames[supbooks[bookidx][nameidx].itab-1] + \"!\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse o = supbooks.SheetNames[nameidx-1]+ \"!\";\n\t\t\t\t\tif(supbooks[bookidx] && supbooks[bookidx][nameidx]) o += supbooks[bookidx][nameidx].Name;\n\t\t\t\t\telse if(supbooks[0] && supbooks[0][nameidx]) o += supbooks[0][nameidx].Name;\n\t\t\t\t\telse {\n\t\t\t\t\t\tvar ixtidata = (get_ixti_raw(supbooks, bookidx, opts)||\"\").split(\";;\");\n\t\t\t\t\t\tif(ixtidata[nameidx - 1]) o = ixtidata[nameidx - 1]; // TODO: confirm this is correct\n\t\t\t\t\t\telse o += \"SH33TJSERRX\";\n\t\t\t\t\t}\n\t\t\t\t\tstack.push(o);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif(!externbook) externbook = {Name: \"SH33TJSERRY\"};\n\t\t\t\tstack.push(externbook.Name);\n\t\t\t\tbreak;\n\n\t\t\tcase 'PtgParen': /* [MS-XLS] 2.5.198.80 */\n\t\t\t\tvar lp = '(', rp = ')';\n\t\t\t\tif(last_sp >= 0) {\n\t\t\t\t\tsp = \"\";\n\t\t\t\t\tswitch(formula[0][last_sp][1][0]) {\n\t\t\t\t\t\t// $FlowIgnore\n\t\t\t\t\t\tcase 2: lp = fill(\" \", formula[0][last_sp][1][1]) + lp; break;\n\t\t\t\t\t\t// $FlowIgnore\n\t\t\t\t\t\tcase 3: lp = fill(\"\\r\", formula[0][last_sp][1][1]) + lp; break;\n\t\t\t\t\t\t// $FlowIgnore\n\t\t\t\t\t\tcase 4: rp = fill(\" \", formula[0][last_sp][1][1]) + rp; break;\n\t\t\t\t\t\t// $FlowIgnore\n\t\t\t\t\t\tcase 5: rp = fill(\"\\r\", formula[0][last_sp][1][1]) + rp; break;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t// $FlowIgnore\n\t\t\t\t\t\t\tif(opts.WTF) throw new Error(\"Unexpected PtgAttrSpaceType \" + formula[0][last_sp][1][0]);\n\t\t\t\t\t}\n\t\t\t\t\tlast_sp = -1;\n\t\t\t\t}\n\t\t\t\tstack.push(lp + stack.pop() + rp); break;\n\n\t\t\tcase 'PtgRefErr': /* [MS-XLS] 2.5.198.86 */\n\t\t\t\tstack.push('#REF!'); break;\n\n\t\t\tcase 'PtgRefErr3d': /* [MS-XLS] 2.5.198.87 */\n\t\t\t\tstack.push('#REF!'); break;\n\n\t\t\tcase 'PtgExp': /* [MS-XLS] 2.5.198.58 TODO */\n\t\t\t\tc = {c:(f[1][1]/*:any*/),r:(f[1][0]/*:any*/)};\n\t\t\t\tvar q = ({c: cell.c, r:cell.r}/*:any*/);\n\t\t\t\tif(supbooks.sharedf[encode_cell(c)]) {\n\t\t\t\t\tvar parsedf = (supbooks.sharedf[encode_cell(c)]);\n\t\t\t\t\tstack.push(stringify_formula(parsedf, _range, q, supbooks, opts));\n\t\t\t\t} else {\n\t\t\t\t\tvar fnd = false;\n\t\t\t\t\tfor(e1=0;e1!=supbooks.arrayf.length; ++e1) {\n\t\t\t\t\t\t/* TODO: should be something like range_has */\n\t\t\t\t\t\te2 = supbooks.arrayf[e1];\n\t\t\t\t\t\tif(c.c < e2[0].s.c || c.c > e2[0].e.c) continue;\n\t\t\t\t\t\tif(c.r < e2[0].s.r || c.r > e2[0].e.r) continue;\n\t\t\t\t\t\tstack.push(stringify_formula(e2[1], _range, q, supbooks, opts));\n\t\t\t\t\t\tfnd = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif(!fnd) stack.push(/*::String(*/f[1]/*::)*/);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'PtgArray': /* [MS-XLS] 2.5.198.32 TODO */\n\t\t\t\tstack.push(\"{\" + stringify_array(/*::(*/f[1]/*:: :any)*/) + \"}\");\n\t\t\t\tbreak;\n\n\t\t\tcase 'PtgMemArea': /* [MS-XLS] 2.5.198.70 TODO: confirm this is a non-display */\n\t\t\t\t//stack.push(\"(\" + f[2].map(encode_range).join(\",\") + \")\");\n\t\t\t\tbreak;\n\n\t\t\tcase 'PtgAttrSpace': /* [MS-XLS] 2.5.198.38 */\n\t\t\tcase 'PtgAttrSpaceSemi': /* [MS-XLS] 2.5.198.39 */\n\t\t\t\tlast_sp = ff;\n\t\t\t\tbreak;\n\n\t\t\tcase 'PtgTbl': /* [MS-XLS] 2.5.198.92 TODO */\n\t\t\t\tbreak;\n\n\t\t\tcase 'PtgMemErr': /* [MS-XLS] 2.5.198.71 */\n\t\t\t\tbreak;\n\n\t\t\tcase 'PtgMissArg': /* [MS-XLS] 2.5.198.74 */\n\t\t\t\tstack.push(\"\");\n\t\t\t\tbreak;\n\n\t\t\tcase 'PtgAreaErr': /* [MS-XLS] 2.5.198.29 */\n\t\t\t\tstack.push(\"#REF!\"); break;\n\n\t\t\tcase 'PtgAreaErr3d': /* [MS-XLS] 2.5.198.30 */\n\t\t\t\tstack.push(\"#REF!\"); break;\n\n\t\t\tcase 'PtgList': /* [MS-XLSB] 2.5.97.52 */\n\t\t\t\t// $FlowIgnore\n\t\t\t\tstack.push(\"Table\" + f[1].idx + \"[#\" + f[1].rt + \"]\");\n\t\t\t\tbreak;\n\n\t\t\tcase 'PtgMemAreaN':\n\t\t\tcase 'PtgMemNoMemN':\n\t\t\tcase 'PtgAttrNoop':\n\t\t\tcase 'PtgSheet':\n\t\t\tcase 'PtgEndSheet':\n\t\t\t\tbreak;\n\n\t\t\tcase 'PtgMemFunc': /* [MS-XLS] 2.5.198.72 TODO */\n\t\t\t\tbreak;\n\t\t\tcase 'PtgMemNoMem': /* [MS-XLS] 2.5.198.73 TODO */\n\t\t\t\tbreak;\n\n\t\t\tcase 'PtgElfCol': /* [MS-XLS] 2.5.198.46 */\n\t\t\tcase 'PtgElfColS': /* [MS-XLS] 2.5.198.47 */\n\t\t\tcase 'PtgElfColSV': /* [MS-XLS] 2.5.198.48 */\n\t\t\tcase 'PtgElfColV': /* [MS-XLS] 2.5.198.49 */\n\t\t\tcase 'PtgElfLel': /* [MS-XLS] 2.5.198.50 */\n\t\t\tcase 'PtgElfRadical': /* [MS-XLS] 2.5.198.51 */\n\t\t\tcase 'PtgElfRadicalLel': /* [MS-XLS] 2.5.198.52 */\n\t\t\tcase 'PtgElfRadicalS': /* [MS-XLS] 2.5.198.53 */\n\t\t\tcase 'PtgElfRw': /* [MS-XLS] 2.5.198.54 */\n\t\t\tcase 'PtgElfRwV': /* [MS-XLS] 2.5.198.55 */\n\t\t\t\tthrow new Error(\"Unsupported ELFs\");\n\n\t\t\tcase 'PtgSxName': /* [MS-XLS] 2.5.198.91 TODO -- find a test case */\n\t\t\t\tthrow new Error('Unrecognized Formula Token: ' + String(f));\n\t\t\tdefault: throw new Error('Unrecognized Formula Token: ' + String(f));\n\t\t}\n\t\tvar PtgNonDisp = ['PtgAttrSpace', 'PtgAttrSpaceSemi', 'PtgAttrGoto'];\n\t\tif(opts.biff != 3) if(last_sp >= 0 && PtgNonDisp.indexOf(formula[0][ff][0]) == -1) {\n\t\t\tf = formula[0][last_sp];\n\t\t\tvar _left = true;\n\t\t\tswitch(f[1][0]) {\n\t\t\t\t/* note: some bad XLSB files omit the PtgParen */\n\t\t\t\tcase 4: _left = false;\n\t\t\t\t/* falls through */\n\t\t\t\tcase 0:\n\t\t\t\t\t// $FlowIgnore\n\t\t\t\t\tsp = fill(\" \", f[1][1]); break;\n\t\t\t\tcase 5: _left = false;\n\t\t\t\t/* falls through */\n\t\t\t\tcase 1:\n\t\t\t\t\t// $FlowIgnore\n\t\t\t\t\tsp = fill(\"\\r\", f[1][1]); break;\n\t\t\t\tdefault:\n\t\t\t\t\tsp = \"\";\n\t\t\t\t\t// $FlowIgnore\n\t\t\t\t\tif(opts.WTF) throw new Error(\"Unexpected PtgAttrSpaceType \" + f[1][0]);\n\t\t\t}\n\t\t\tstack.push((_left ? sp : \"\") + stack.pop() + (_left ? \"\" : sp));\n\t\t\tlast_sp = -1;\n\t\t}\n\t}\n\tif(stack.length > 1 && opts.WTF) throw new Error(\"bad formula stack\");\n\tif(stack[0] == \"TRUE\") return true; if(stack[0] == \"FALSE\") return false;\n\treturn stack[0];\n}\n\n/* [MS-XLS] 2.5.198.1 TODO */\nfunction parse_ArrayParsedFormula(blob, length, opts/*::, ref*/) {\n\tvar target = blob.l + length, len = opts.biff == 2 ? 1 : 2;\n\tvar rgcb, cce = blob.read_shift(len); // length of rgce\n\tif(cce == 0xFFFF) return [[],parsenoop(blob, length-2)];\n\tvar rgce = parse_Rgce(blob, cce, opts);\n\tif(length !== cce + len) rgcb = parse_RgbExtra(blob, length - cce - len, rgce, opts);\n\tblob.l = target;\n\treturn [rgce, rgcb];\n}\n\n/* [MS-XLS] 2.5.198.3 TODO */\nfunction parse_XLSCellParsedFormula(blob, length, opts) {\n\tvar target = blob.l + length, len = opts.biff == 2 ? 1 : 2;\n\tvar rgcb, cce = blob.read_shift(len); // length of rgce\n\tif(cce == 0xFFFF) return [[],parsenoop(blob, length-2)];\n\tvar rgce = parse_Rgce(blob, cce, opts);\n\tif(length !== cce + len) rgcb = parse_RgbExtra(blob, length - cce - len, rgce, opts);\n\tblob.l = target;\n\treturn [rgce, rgcb];\n}\n\n/* [MS-XLS] 2.5.198.21 */\nfunction parse_NameParsedFormula(blob, length, opts, cce) {\n\tvar target = blob.l + length;\n\tvar rgce = parse_Rgce(blob, cce, opts);\n\tvar rgcb;\n\tif(target !== blob.l) rgcb = parse_RgbExtra(blob, target - blob.l, rgce, opts);\n\treturn [rgce, rgcb];\n}\n\n/* [MS-XLS] 2.5.198.118 TODO */\nfunction parse_SharedParsedFormula(blob, length, opts) {\n\tvar target = blob.l + length;\n\tvar rgcb, cce = blob.read_shift(2); // length of rgce\n\tvar rgce = parse_Rgce(blob, cce, opts);\n\tif(cce == 0xFFFF) return [[],parsenoop(blob, length-2)];\n\tif(length !== cce + 2) rgcb = parse_RgbExtra(blob, target - cce - 2, rgce, opts);\n\treturn [rgce, rgcb];\n}\n\n/* [MS-XLS] 2.5.133 TODO: how to emit empty strings? */\nfunction parse_FormulaValue(blob/*::, length*/) {\n\tvar b;\n\tif(__readUInt16LE(blob,blob.l + 6) !== 0xFFFF) return [parse_Xnum(blob),'n'];\n\tswitch(blob[blob.l]) {\n\t\tcase 0x00: blob.l += 8; return [\"String\", 's'];\n\t\tcase 0x01: b = blob[blob.l+2] === 0x1; blob.l += 8; return [b,'b'];\n\t\tcase 0x02: b = blob[blob.l+2]; blob.l += 8; return [b,'e'];\n\t\tcase 0x03: blob.l += 8; return [\"\",'s'];\n\t}\n\treturn [];\n}\nfunction write_FormulaValue(value) {\n\tif(value == null) {\n\t\t// Blank String Value\n\t\tvar o = new_buf(8);\n\t\to.write_shift(1, 0x03);\n\t\to.write_shift(1, 0);\n\t\to.write_shift(2, 0);\n\t\to.write_shift(2, 0);\n\t\to.write_shift(2, 0xFFFF);\n\t\treturn o;\n\t} else if(typeof value == \"number\") return write_Xnum(value);\n\treturn write_Xnum(0);\n}\n\n/* [MS-XLS] 2.4.127 TODO */\nfunction parse_Formula(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar cell = parse_XLSCell(blob, 6, opts);\n\tvar val = parse_FormulaValue(blob,8);\n\tvar flags = blob.read_shift(1);\n\tif(opts.biff != 2) {\n\t\tblob.read_shift(1);\n\t\tif(opts.biff >= 5) {\n\t\t\t/*var chn = */blob.read_shift(4);\n\t\t}\n\t}\n\tvar cbf = parse_XLSCellParsedFormula(blob, end - blob.l, opts);\n\treturn {cell:cell, val:val[0], formula:cbf, shared: (flags >> 3) & 1, tt:val[1]};\n}\nfunction write_Formula(cell/*:Cell*/, R/*:number*/, C/*:number*/, opts, os/*:number*/) {\n\t// Cell\n\tvar o1 = write_XLSCell(R, C, os);\n\n\t// FormulaValue\n\tvar o2 = write_FormulaValue(cell.v);\n\n\t// flags + cache\n\tvar o3 = new_buf(6);\n\tvar flags = 0x01 | 0x20;\n\to3.write_shift(2, flags);\n\to3.write_shift(4, 0);\n\n\t// CellParsedFormula\n\tvar bf = new_buf(cell.bf.length);\n\tfor(var i = 0; i < cell.bf.length; ++i) bf[i] = cell.bf[i];\n\n\tvar out = bconcat([o1, o2, o3, bf]);\n\treturn out;\n}\n\n\n/* XLSB Parsed Formula records have the same shape */\nfunction parse_XLSBParsedFormula(data, length, opts) {\n\tvar cce = data.read_shift(4);\n\tvar rgce = parse_Rgce(data, cce, opts);\n\tvar cb = data.read_shift(4);\n\tvar rgcb = cb > 0 ? parse_RgbExtra(data, cb, rgce, opts) : null;\n\treturn [rgce, rgcb];\n}\n\n/* [MS-XLSB] 2.5.97.1 ArrayParsedFormula */\nvar parse_XLSBArrayParsedFormula = parse_XLSBParsedFormula;\n/* [MS-XLSB] 2.5.97.4 CellParsedFormula */\nvar parse_XLSBCellParsedFormula = parse_XLSBParsedFormula;\n/* [MS-XLSB] 2.5.97.8 DVParsedFormula */\n//var parse_XLSBDVParsedFormula = parse_XLSBParsedFormula;\n/* [MS-XLSB] 2.5.97.9 FRTParsedFormula */\n//var parse_XLSBFRTParsedFormula = parse_XLSBParsedFormula2;\n/* [MS-XLSB] 2.5.97.12 NameParsedFormula */\nvar parse_XLSBNameParsedFormula = parse_XLSBParsedFormula;\n/* [MS-XLSB] 2.5.97.98 SharedParsedFormula */\nvar parse_XLSBSharedParsedFormula = parse_XLSBParsedFormula;\n\n/* Writes a PtgNum or PtgInt */\nfunction write_XLSBFormulaNum(val/*:number*/) {\n\tif((val | 0) == val && val < Math.pow(2,16) && val >= 0) {\n\t\tvar oint = new_buf(11);\n\t\toint.write_shift(4, 3);\n\t\toint.write_shift(1, 0x1e);\n\t\toint.write_shift(2, val);\n\t\toint.write_shift(4, 0);\n\t\treturn oint;\n\t}\n\n\tvar num = new_buf(17);\n\tnum.write_shift(4, 11);\n\tnum.write_shift(1, 0x1f);\n\tnum.write_shift(8, val);\n\tnum.write_shift(4, 0);\n\treturn num;\n}\n/* Writes a PtgErr */\nfunction write_XLSBFormulaErr(val/*:number*/) {\n\tvar oint = new_buf(10);\n\toint.write_shift(4, 2);\n\toint.write_shift(1, 0x1C);\n\toint.write_shift(1, val);\n\toint.write_shift(4, 0);\n\treturn oint;\n}\n/* Writes a PtgBool */\nfunction write_XLSBFormulaBool(val/*:boolean*/) {\n\tvar oint = new_buf(10);\n\toint.write_shift(4, 2);\n\toint.write_shift(1, 0x1D);\n\toint.write_shift(1, val?1:0);\n\toint.write_shift(4, 0);\n\treturn oint;\n}\n\n/* Writes a PtgStr */\nfunction write_XLSBFormulaStr(val/*:string*/) {\n\tvar preamble = new_buf(7);\n\tpreamble.write_shift(4, 3 + 2 * val.length);\n\tpreamble.write_shift(1, 0x17);\n\tpreamble.write_shift(2, val.length);\n\n\tvar body = new_buf(2 * val.length);\n\tbody.write_shift(2 * val.length, val, \"utf16le\");\n\n\tvar postamble = new_buf(4);\n\tpostamble.write_shift(4, 0);\n\n\treturn bconcat([preamble, body, postamble]);\n}\n\n/* Writes a PtgRef */\nfunction write_XLSBFormulaRef(str) {\n\tvar cell = decode_cell(str);\n\tvar out = new_buf(15);\n\tout.write_shift(4, 7);\n\tout.write_shift(1, 0x04 | ((1)<<5));\n\tout.write_shift(4, cell.r);\n\tout.write_shift(2, cell.c | ((str.charAt(0) == \"$\" ? 0 : 1)<<14) | ((str.match(/\\$\\d/) ? 0 : 1)<<15)); // <== ColRelShort\n\tout.write_shift(4, 0);\n\n\treturn out;\n}\n\n/* Writes a PtgRef3d */\nfunction write_XLSBFormulaRef3D(str, wb) {\n\tvar lastbang = str.lastIndexOf(\"!\");\n\tvar sname = str.slice(0, lastbang);\n\tstr = str.slice(lastbang+1);\n\tvar cell = decode_cell(str);\n\tif(sname.charAt(0) == \"'\") sname = sname.slice(1, -1).replace(/''/g, \"'\");\n\n\tvar out = new_buf(17);\n\tout.write_shift(4, 9);\n\tout.write_shift(1, 0x1A | ((1)<<5));\n\tout.write_shift(2, 2 + wb.SheetNames.map(function(n) { return n.toLowerCase(); }).indexOf(sname.toLowerCase()));\n\tout.write_shift(4, cell.r);\n\tout.write_shift(2, cell.c | ((str.charAt(0) == \"$\" ? 0 : 1)<<14) | ((str.match(/\\$\\d/) ? 0 : 1)<<15)); // <== ColRelShort\n\tout.write_shift(4, 0);\n\n\treturn out;\n}\n\n/* Writes a PtgRefErr3d */\nfunction write_XLSBFormulaRefErr3D(str, wb) {\n\tvar lastbang = str.lastIndexOf(\"!\");\n\tvar sname = str.slice(0, lastbang);\n\tstr = str.slice(lastbang+1);\n\tif(sname.charAt(0) == \"'\") sname = sname.slice(1, -1).replace(/''/g, \"'\");\n\n\tvar out = new_buf(17);\n\tout.write_shift(4, 9);\n\tout.write_shift(1, 0x1C | ((1)<<5));\n\tout.write_shift(2, 2 + wb.SheetNames.map(function(n) { return n.toLowerCase(); }).indexOf(sname.toLowerCase()));\n\tout.write_shift(4, 0);\n\tout.write_shift(2, 0); // <== ColRelShort\n\tout.write_shift(4, 0);\n\n\treturn out;\n}\n\n/* Writes a single sheet range [PtgRef PtgRef PtgRange] */\nfunction write_XLSBFormulaRange(_str) {\n\tvar parts = _str.split(\":\"), str = parts[0];\n\n\tvar out = new_buf(23);\n\tout.write_shift(4, 15);\n\n\t/* start cell */\n\tstr = parts[0]; var cell = decode_cell(str);\n\tout.write_shift(1, 0x04 | ((1)<<5));\n\tout.write_shift(4, cell.r);\n\tout.write_shift(2, cell.c | ((str.charAt(0) == \"$\" ? 0 : 1)<<14) | ((str.match(/\\$\\d/) ? 0 : 1)<<15)); // <== ColRelShort\n\tout.write_shift(4, 0);\n\n\t/* end cell */\n\tstr = parts[1]; cell = decode_cell(str);\n\tout.write_shift(1, 0x04 | ((1)<<5));\n\tout.write_shift(4, cell.r);\n\tout.write_shift(2, cell.c | ((str.charAt(0) == \"$\" ? 0 : 1)<<14) | ((str.match(/\\$\\d/) ? 0 : 1)<<15)); // <== ColRelShort\n\tout.write_shift(4, 0);\n\n\t/* PtgRange */\n\tout.write_shift(1, 0x11);\n\n\tout.write_shift(4, 0);\n\n\treturn out;\n}\n\n/* Writes a range with explicit sheet name [PtgRef3D PtgRef3D PtgRange] */\nfunction write_XLSBFormulaRangeWS(_str, wb) {\n\tvar lastbang = _str.lastIndexOf(\"!\");\n\tvar sname = _str.slice(0, lastbang);\n\t_str = _str.slice(lastbang+1);\n\tif(sname.charAt(0) == \"'\") sname = sname.slice(1, -1).replace(/''/g, \"'\");\n\tvar parts = _str.split(\":\");\n\n\tvar out = new_buf(27);\n\tout.write_shift(4, 19);\n\n\t/* start cell */\n\tvar str = parts[0], cell = decode_cell(str);\n\tout.write_shift(1, 0x1A | ((1)<<5));\n\tout.write_shift(2, 2 + wb.SheetNames.map(function(n) { return n.toLowerCase(); }).indexOf(sname.toLowerCase()));\n\tout.write_shift(4, cell.r);\n\tout.write_shift(2, cell.c | ((str.charAt(0) == \"$\" ? 0 : 1)<<14) | ((str.match(/\\$\\d/) ? 0 : 1)<<15)); // <== ColRelShort\n\n\t/* end cell */\n\tstr = parts[1]; cell = decode_cell(str);\n\tout.write_shift(1, 0x1A | ((1)<<5));\n\tout.write_shift(2, 2 + wb.SheetNames.map(function(n) { return n.toLowerCase(); }).indexOf(sname.toLowerCase()));\n\tout.write_shift(4, cell.r);\n\tout.write_shift(2, cell.c | ((str.charAt(0) == \"$\" ? 0 : 1)<<14) | ((str.match(/\\$\\d/) ? 0 : 1)<<15)); // <== ColRelShort\n\n\t/* PtgRange */\n\tout.write_shift(1, 0x11);\n\n\tout.write_shift(4, 0);\n\n\treturn out;\n}\n\n/* Writes a range with explicit sheet name [PtgArea3d] */\nfunction write_XLSBFormulaArea3D(_str, wb) {\n\tvar lastbang = _str.lastIndexOf(\"!\");\n\tvar sname = _str.slice(0, lastbang);\n\t_str = _str.slice(lastbang+1);\n\tif(sname.charAt(0) == \"'\") sname = sname.slice(1, -1).replace(/''/g, \"'\");\n\tvar range = decode_range(_str);\n\n\tvar out = new_buf(23);\n\tout.write_shift(4, 15);\n\n\tout.write_shift(1, 0x1B | ((1)<<5));\n\tout.write_shift(2, 2 + wb.SheetNames.map(function(n) { return n.toLowerCase(); }).indexOf(sname.toLowerCase()));\n\tout.write_shift(4, range.s.r);\n\tout.write_shift(4, range.e.r);\n\tout.write_shift(2, range.s.c);\n\tout.write_shift(2, range.e.c);\n\n\tout.write_shift(4, 0);\n\n\treturn out;\n}\n\n\n/* General Formula */\nfunction write_XLSBFormula(val/*:string|number*/, wb) {\n\tif(typeof val == \"number\") return write_XLSBFormulaNum(val);\n\tif(typeof val == \"boolean\") return write_XLSBFormulaBool(val);\n\tif(/^#(DIV\\/0!|GETTING_DATA|N\\/A|NAME\\?|NULL!|NUM!|REF!|VALUE!)$/.test(val)) return write_XLSBFormulaErr(+RBErr[val]);\n\tif(val.match(/^\\$?(?:[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D]|[A-Z]{1,2})\\$?(?:10[0-3]\\d{4}|104[0-7]\\d{3}|1048[0-4]\\d{2}|10485[0-6]\\d|104857[0-6]|[1-9]\\d{0,5})$/)) return write_XLSBFormulaRef(val);\n\tif(val.match(/^\\$?(?:[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D]|[A-Z]{1,2})\\$?(?:10[0-3]\\d{4}|104[0-7]\\d{3}|1048[0-4]\\d{2}|10485[0-6]\\d|104857[0-6]|[1-9]\\d{0,5}):\\$?(?:[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D]|[A-Z]{1,2})\\$?(?:10[0-3]\\d{4}|104[0-7]\\d{3}|1048[0-4]\\d{2}|10485[0-6]\\d|104857[0-6]|[1-9]\\d{0,5})$/)) return write_XLSBFormulaRange(val);\n\tif(val.match(/^#REF!\\$?(?:[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D]|[A-Z]{1,2})\\$?(?:10[0-3]\\d{4}|104[0-7]\\d{3}|1048[0-4]\\d{2}|10485[0-6]\\d|104857[0-6]|[1-9]\\d{0,5}):\\$?(?:[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D]|[A-Z]{1,2})\\$?(?:10[0-3]\\d{4}|104[0-7]\\d{3}|1048[0-4]\\d{2}|10485[0-6]\\d|104857[0-6]|[1-9]\\d{0,5})$/)) return write_XLSBFormulaArea3D(val, wb);\n\tif(val.match(/^(?:'[^\\\\\\/?*\\[\\]:]*'|[^'][^\\\\\\/?*\\[\\]:'`~!@#$%^()\\-=+{}|;,<.>]*)!\\$?(?:[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D]|[A-Z]{1,2})\\$?(?:10[0-3]\\d{4}|104[0-7]\\d{3}|1048[0-4]\\d{2}|10485[0-6]\\d|104857[0-6]|[1-9]\\d{0,5})$/)) return write_XLSBFormulaRef3D(val, wb);\n\tif(val.match(/^(?:'[^\\\\\\/?*\\[\\]:]*'|[^'][^\\\\\\/?*\\[\\]:'`~!@#$%^()\\-=+{}|;,<.>]*)!\\$?(?:[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D]|[A-Z]{1,2})\\$?(?:10[0-3]\\d{4}|104[0-7]\\d{3}|1048[0-4]\\d{2}|10485[0-6]\\d|104857[0-6]|[1-9]\\d{0,5}):\\$?(?:[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D]|[A-Z]{1,2})\\$?(?:10[0-3]\\d{4}|104[0-7]\\d{3}|1048[0-4]\\d{2}|10485[0-6]\\d|104857[0-6]|[1-9]\\d{0,5})$/)) return write_XLSBFormulaRangeWS(val, wb);\n\tif(/^(?:'[^\\\\\\/?*\\[\\]:]*'|[^'][^\\\\\\/?*\\[\\]:'`~!@#$%^()\\-=+{}|;,<.>]*)!#REF!$/.test(val)) return write_XLSBFormulaRefErr3D(val, wb);\n\tif(/^\".*\"$/.test(val)) return write_XLSBFormulaStr(val);\n\tif(/^[+-]\\d+$/.test(val)) return write_XLSBFormulaNum(parseInt(val, 10));\n\tthrow \"Formula |\" + val + \"| not supported for XLSB\";\n}\nvar write_XLSBNameParsedFormula = write_XLSBFormula;\nvar Cetab = {\n 0: \"BEEP\",\n 1: \"OPEN\",\n 2: \"OPEN.LINKS\",\n 3: \"CLOSE.ALL\",\n 4: \"SAVE\",\n 5: \"SAVE.AS\",\n 6: \"FILE.DELETE\",\n 7: \"PAGE.SETUP\",\n 8: \"PRINT\",\n 9: \"PRINTER.SETUP\",\n 10: \"QUIT\",\n 11: \"NEW.WINDOW\",\n 12: \"ARRANGE.ALL\",\n 13: \"WINDOW.SIZE\",\n 14: \"WINDOW.MOVE\",\n 15: \"FULL\",\n 16: \"CLOSE\",\n 17: \"RUN\",\n 22: \"SET.PRINT.AREA\",\n 23: \"SET.PRINT.TITLES\",\n 24: \"SET.PAGE.BREAK\",\n 25: \"REMOVE.PAGE.BREAK\",\n 26: \"FONT\",\n 27: \"DISPLAY\",\n 28: \"PROTECT.DOCUMENT\",\n 29: \"PRECISION\",\n 30: \"A1.R1C1\",\n 31: \"CALCULATE.NOW\",\n 32: \"CALCULATION\",\n 34: \"DATA.FIND\",\n 35: \"EXTRACT\",\n 36: \"DATA.DELETE\",\n 37: \"SET.DATABASE\",\n 38: \"SET.CRITERIA\",\n 39: \"SORT\",\n 40: \"DATA.SERIES\",\n 41: \"TABLE\",\n 42: \"FORMAT.NUMBER\",\n 43: \"ALIGNMENT\",\n 44: \"STYLE\",\n 45: \"BORDER\",\n 46: \"CELL.PROTECTION\",\n 47: \"COLUMN.WIDTH\",\n 48: \"UNDO\",\n 49: \"CUT\",\n 50: \"COPY\",\n 51: \"PASTE\",\n 52: \"CLEAR\",\n 53: \"PASTE.SPECIAL\",\n 54: \"EDIT.DELETE\",\n 55: \"INSERT\",\n 56: \"FILL.RIGHT\",\n 57: \"FILL.DOWN\",\n 61: \"DEFINE.NAME\",\n 62: \"CREATE.NAMES\",\n 63: \"FORMULA.GOTO\",\n 64: \"FORMULA.FIND\",\n 65: \"SELECT.LAST.CELL\",\n 66: \"SHOW.ACTIVE.CELL\",\n 67: \"GALLERY.AREA\",\n 68: \"GALLERY.BAR\",\n 69: \"GALLERY.COLUMN\",\n 70: \"GALLERY.LINE\",\n 71: \"GALLERY.PIE\",\n 72: \"GALLERY.SCATTER\",\n 73: \"COMBINATION\",\n 74: \"PREFERRED\",\n 75: \"ADD.OVERLAY\",\n 76: \"GRIDLINES\",\n 77: \"SET.PREFERRED\",\n 78: \"AXES\",\n 79: \"LEGEND\",\n 80: \"ATTACH.TEXT\",\n 81: \"ADD.ARROW\",\n 82: \"SELECT.CHART\",\n 83: \"SELECT.PLOT.AREA\",\n 84: \"PATTERNS\",\n 85: \"MAIN.CHART\",\n 86: \"OVERLAY\",\n 87: \"SCALE\",\n 88: \"FORMAT.LEGEND\",\n 89: \"FORMAT.TEXT\",\n 90: \"EDIT.REPEAT\",\n 91: \"PARSE\",\n 92: \"JUSTIFY\",\n 93: \"HIDE\",\n 94: \"UNHIDE\",\n 95: \"WORKSPACE\",\n 96: \"FORMULA\",\n 97: \"FORMULA.FILL\",\n 98: \"FORMULA.ARRAY\",\n 99: \"DATA.FIND.NEXT\",\n 100: \"DATA.FIND.PREV\",\n 101: \"FORMULA.FIND.NEXT\",\n 102: \"FORMULA.FIND.PREV\",\n 103: \"ACTIVATE\",\n 104: \"ACTIVATE.NEXT\",\n 105: \"ACTIVATE.PREV\",\n 106: \"UNLOCKED.NEXT\",\n 107: \"UNLOCKED.PREV\",\n 108: \"COPY.PICTURE\",\n 109: \"SELECT\",\n 110: \"DELETE.NAME\",\n 111: \"DELETE.FORMAT\",\n 112: \"VLINE\",\n 113: \"HLINE\",\n 114: \"VPAGE\",\n 115: \"HPAGE\",\n 116: \"VSCROLL\",\n 117: \"HSCROLL\",\n 118: \"ALERT\",\n 119: \"NEW\",\n 120: \"CANCEL.COPY\",\n 121: \"SHOW.CLIPBOARD\",\n 122: \"MESSAGE\",\n 124: \"PASTE.LINK\",\n 125: \"APP.ACTIVATE\",\n 126: \"DELETE.ARROW\",\n 127: \"ROW.HEIGHT\",\n 128: \"FORMAT.MOVE\",\n 129: \"FORMAT.SIZE\",\n 130: \"FORMULA.REPLACE\",\n 131: \"SEND.KEYS\",\n 132: \"SELECT.SPECIAL\",\n 133: \"APPLY.NAMES\",\n 134: \"REPLACE.FONT\",\n 135: \"FREEZE.PANES\",\n 136: \"SHOW.INFO\",\n 137: \"SPLIT\",\n 138: \"ON.WINDOW\",\n 139: \"ON.DATA\",\n 140: \"DISABLE.INPUT\",\n 142: \"OUTLINE\",\n 143: \"LIST.NAMES\",\n 144: \"FILE.CLOSE\",\n 145: \"SAVE.WORKBOOK\",\n 146: \"DATA.FORM\",\n 147: \"COPY.CHART\",\n 148: \"ON.TIME\",\n 149: \"WAIT\",\n 150: \"FORMAT.FONT\",\n 151: \"FILL.UP\",\n 152: \"FILL.LEFT\",\n 153: \"DELETE.OVERLAY\",\n 155: \"SHORT.MENUS\",\n 159: \"SET.UPDATE.STATUS\",\n 161: \"COLOR.PALETTE\",\n 162: \"DELETE.STYLE\",\n 163: \"WINDOW.RESTORE\",\n 164: \"WINDOW.MAXIMIZE\",\n 166: \"CHANGE.LINK\",\n 167: \"CALCULATE.DOCUMENT\",\n 168: \"ON.KEY\",\n 169: \"APP.RESTORE\",\n 170: \"APP.MOVE\",\n 171: \"APP.SIZE\",\n 172: \"APP.MINIMIZE\",\n 173: \"APP.MAXIMIZE\",\n 174: \"BRING.TO.FRONT\",\n 175: \"SEND.TO.BACK\",\n 185: \"MAIN.CHART.TYPE\",\n 186: \"OVERLAY.CHART.TYPE\",\n 187: \"SELECT.END\",\n 188: \"OPEN.MAIL\",\n 189: \"SEND.MAIL\",\n 190: \"STANDARD.FONT\",\n 191: \"CONSOLIDATE\",\n 192: \"SORT.SPECIAL\",\n 193: \"GALLERY.3D.AREA\",\n 194: \"GALLERY.3D.COLUMN\",\n 195: \"GALLERY.3D.LINE\",\n 196: \"GALLERY.3D.PIE\",\n 197: \"VIEW.3D\",\n 198: \"GOAL.SEEK\",\n 199: \"WORKGROUP\",\n 200: \"FILL.GROUP\",\n 201: \"UPDATE.LINK\",\n 202: \"PROMOTE\",\n 203: \"DEMOTE\",\n 204: \"SHOW.DETAIL\",\n 206: \"UNGROUP\",\n 207: \"OBJECT.PROPERTIES\",\n 208: \"SAVE.NEW.OBJECT\",\n 209: \"SHARE\",\n 210: \"SHARE.NAME\",\n 211: \"DUPLICATE\",\n 212: \"APPLY.STYLE\",\n 213: \"ASSIGN.TO.OBJECT\",\n 214: \"OBJECT.PROTECTION\",\n 215: \"HIDE.OBJECT\",\n 216: \"SET.EXTRACT\",\n 217: \"CREATE.PUBLISHER\",\n 218: \"SUBSCRIBE.TO\",\n 219: \"ATTRIBUTES\",\n 220: \"SHOW.TOOLBAR\",\n 222: \"PRINT.PREVIEW\",\n 223: \"EDIT.COLOR\",\n 224: \"SHOW.LEVELS\",\n 225: \"FORMAT.MAIN\",\n 226: \"FORMAT.OVERLAY\",\n 227: \"ON.RECALC\",\n 228: \"EDIT.SERIES\",\n 229: \"DEFINE.STYLE\",\n 240: \"LINE.PRINT\",\n 243: \"ENTER.DATA\",\n 249: \"GALLERY.RADAR\",\n 250: \"MERGE.STYLES\",\n 251: \"EDITION.OPTIONS\",\n 252: \"PASTE.PICTURE\",\n 253: \"PASTE.PICTURE.LINK\",\n 254: \"SPELLING\",\n 256: \"ZOOM\",\n 259: \"INSERT.OBJECT\",\n 260: \"WINDOW.MINIMIZE\",\n 265: \"SOUND.NOTE\",\n 266: \"SOUND.PLAY\",\n 267: \"FORMAT.SHAPE\",\n 268: \"EXTEND.POLYGON\",\n 269: \"FORMAT.AUTO\",\n 272: \"GALLERY.3D.BAR\",\n 273: \"GALLERY.3D.SURFACE\",\n 274: \"FILL.AUTO\",\n 276: \"CUSTOMIZE.TOOLBAR\",\n 277: \"ADD.TOOL\",\n 278: \"EDIT.OBJECT\",\n 279: \"ON.DOUBLECLICK\",\n 280: \"ON.ENTRY\",\n 281: \"WORKBOOK.ADD\",\n 282: \"WORKBOOK.MOVE\",\n 283: \"WORKBOOK.COPY\",\n 284: \"WORKBOOK.OPTIONS\",\n 285: \"SAVE.WORKSPACE\",\n 288: \"CHART.WIZARD\",\n 289: \"DELETE.TOOL\",\n 290: \"MOVE.TOOL\",\n 291: \"WORKBOOK.SELECT\",\n 292: \"WORKBOOK.ACTIVATE\",\n 293: \"ASSIGN.TO.TOOL\",\n 295: \"COPY.TOOL\",\n 296: \"RESET.TOOL\",\n 297: \"CONSTRAIN.NUMERIC\",\n 298: \"PASTE.TOOL\",\n 302: \"WORKBOOK.NEW\",\n 305: \"SCENARIO.CELLS\",\n 306: \"SCENARIO.DELETE\",\n 307: \"SCENARIO.ADD\",\n 308: \"SCENARIO.EDIT\",\n 309: \"SCENARIO.SHOW\",\n 310: \"SCENARIO.SHOW.NEXT\",\n 311: \"SCENARIO.SUMMARY\",\n 312: \"PIVOT.TABLE.WIZARD\",\n 313: \"PIVOT.FIELD.PROPERTIES\",\n 314: \"PIVOT.FIELD\",\n 315: \"PIVOT.ITEM\",\n 316: \"PIVOT.ADD.FIELDS\",\n 318: \"OPTIONS.CALCULATION\",\n 319: \"OPTIONS.EDIT\",\n 320: \"OPTIONS.VIEW\",\n 321: \"ADDIN.MANAGER\",\n 322: \"MENU.EDITOR\",\n 323: \"ATTACH.TOOLBARS\",\n 324: \"VBAActivate\",\n 325: \"OPTIONS.CHART\",\n 328: \"VBA.INSERT.FILE\",\n 330: \"VBA.PROCEDURE.DEFINITION\",\n 336: \"ROUTING.SLIP\",\n 338: \"ROUTE.DOCUMENT\",\n 339: \"MAIL.LOGON\",\n 342: \"INSERT.PICTURE\",\n 343: \"EDIT.TOOL\",\n 344: \"GALLERY.DOUGHNUT\",\n 350: \"CHART.TREND\",\n 352: \"PIVOT.ITEM.PROPERTIES\",\n 354: \"WORKBOOK.INSERT\",\n 355: \"OPTIONS.TRANSITION\",\n 356: \"OPTIONS.GENERAL\",\n 370: \"FILTER.ADVANCED\",\n 373: \"MAIL.ADD.MAILER\",\n 374: \"MAIL.DELETE.MAILER\",\n 375: \"MAIL.REPLY\",\n 376: \"MAIL.REPLY.ALL\",\n 377: \"MAIL.FORWARD\",\n 378: \"MAIL.NEXT.LETTER\",\n 379: \"DATA.LABEL\",\n 380: \"INSERT.TITLE\",\n 381: \"FONT.PROPERTIES\",\n 382: \"MACRO.OPTIONS\",\n 383: \"WORKBOOK.HIDE\",\n 384: \"WORKBOOK.UNHIDE\",\n 385: \"WORKBOOK.DELETE\",\n 386: \"WORKBOOK.NAME\",\n 388: \"GALLERY.CUSTOM\",\n 390: \"ADD.CHART.AUTOFORMAT\",\n 391: \"DELETE.CHART.AUTOFORMAT\",\n 392: \"CHART.ADD.DATA\",\n 393: \"AUTO.OUTLINE\",\n 394: \"TAB.ORDER\",\n 395: \"SHOW.DIALOG\",\n 396: \"SELECT.ALL\",\n 397: \"UNGROUP.SHEETS\",\n 398: \"SUBTOTAL.CREATE\",\n 399: \"SUBTOTAL.REMOVE\",\n 400: \"RENAME.OBJECT\",\n 412: \"WORKBOOK.SCROLL\",\n 413: \"WORKBOOK.NEXT\",\n 414: \"WORKBOOK.PREV\",\n 415: \"WORKBOOK.TAB.SPLIT\",\n 416: \"FULL.SCREEN\",\n 417: \"WORKBOOK.PROTECT\",\n 420: \"SCROLLBAR.PROPERTIES\",\n 421: \"PIVOT.SHOW.PAGES\",\n 422: \"TEXT.TO.COLUMNS\",\n 423: \"FORMAT.CHARTTYPE\",\n 424: \"LINK.FORMAT\",\n 425: \"TRACER.DISPLAY\",\n 430: \"TRACER.NAVIGATE\",\n 431: \"TRACER.CLEAR\",\n 432: \"TRACER.ERROR\",\n 433: \"PIVOT.FIELD.GROUP\",\n 434: \"PIVOT.FIELD.UNGROUP\",\n 435: \"CHECKBOX.PROPERTIES\",\n 436: \"LABEL.PROPERTIES\",\n 437: \"LISTBOX.PROPERTIES\",\n 438: \"EDITBOX.PROPERTIES\",\n 439: \"PIVOT.REFRESH\",\n 440: \"LINK.COMBO\",\n 441: \"OPEN.TEXT\",\n 442: \"HIDE.DIALOG\",\n 443: \"SET.DIALOG.FOCUS\",\n 444: \"ENABLE.OBJECT\",\n 445: \"PUSHBUTTON.PROPERTIES\",\n 446: \"SET.DIALOG.DEFAULT\",\n 447: \"FILTER\",\n 448: \"FILTER.SHOW.ALL\",\n 449: \"CLEAR.OUTLINE\",\n 450: \"FUNCTION.WIZARD\",\n 451: \"ADD.LIST.ITEM\",\n 452: \"SET.LIST.ITEM\",\n 453: \"REMOVE.LIST.ITEM\",\n 454: \"SELECT.LIST.ITEM\",\n 455: \"SET.CONTROL.VALUE\",\n 456: \"SAVE.COPY.AS\",\n 458: \"OPTIONS.LISTS.ADD\",\n 459: \"OPTIONS.LISTS.DELETE\",\n 460: \"SERIES.AXES\",\n 461: \"SERIES.X\",\n 462: \"SERIES.Y\",\n 463: \"ERRORBAR.X\",\n 464: \"ERRORBAR.Y\",\n 465: \"FORMAT.CHART\",\n 466: \"SERIES.ORDER\",\n 467: \"MAIL.LOGOFF\",\n 468: \"CLEAR.ROUTING.SLIP\",\n 469: \"APP.ACTIVATE.MICROSOFT\",\n 470: \"MAIL.EDIT.MAILER\",\n 471: \"ON.SHEET\",\n 472: \"STANDARD.WIDTH\",\n 473: \"SCENARIO.MERGE\",\n 474: \"SUMMARY.INFO\",\n 475: \"FIND.FILE\",\n 476: \"ACTIVE.CELL.FONT\",\n 477: \"ENABLE.TIPWIZARD\",\n 478: \"VBA.MAKE.ADDIN\",\n 480: \"INSERTDATATABLE\",\n 481: \"WORKGROUP.OPTIONS\",\n 482: \"MAIL.SEND.MAILER\",\n 485: \"AUTOCORRECT\",\n 489: \"POST.DOCUMENT\",\n 491: \"PICKLIST\",\n 493: \"VIEW.SHOW\",\n 494: \"VIEW.DEFINE\",\n 495: \"VIEW.DELETE\",\n 509: \"SHEET.BACKGROUND\",\n 510: \"INSERT.MAP.OBJECT\",\n 511: \"OPTIONS.MENONO\",\n 517: \"MSOCHECKS\",\n 518: \"NORMAL\",\n 519: \"LAYOUT\",\n 520: \"RM.PRINT.AREA\",\n 521: \"CLEAR.PRINT.AREA\",\n 522: \"ADD.PRINT.AREA\",\n 523: \"MOVE.BRK\",\n 545: \"HIDECURR.NOTE\",\n 546: \"HIDEALL.NOTES\",\n 547: \"DELETE.NOTE\",\n 548: \"TRAVERSE.NOTES\",\n 549: \"ACTIVATE.NOTES\",\n 620: \"PROTECT.REVISIONS\",\n 621: \"UNPROTECT.REVISIONS\",\n 647: \"OPTIONS.ME\",\n 653: \"WEB.PUBLISH\",\n 667: \"NEWWEBQUERY\",\n 673: \"PIVOT.TABLE.CHART\",\n 753: \"OPTIONS.SAVE\",\n 755: \"OPTIONS.SPELL\",\n 808: \"HIDEALL.INKANNOTS\"\n};\nvar Ftab = {\n 0: \"COUNT\",\n 1: \"IF\",\n 2: \"ISNA\",\n 3: \"ISERROR\",\n 4: \"SUM\",\n 5: \"AVERAGE\",\n 6: \"MIN\",\n 7: \"MAX\",\n 8: \"ROW\",\n 9: \"COLUMN\",\n 10: \"NA\",\n 11: \"NPV\",\n 12: \"STDEV\",\n 13: \"DOLLAR\",\n 14: \"FIXED\",\n 15: \"SIN\",\n 16: \"COS\",\n 17: \"TAN\",\n 18: \"ATAN\",\n 19: \"PI\",\n 20: \"SQRT\",\n 21: \"EXP\",\n 22: \"LN\",\n 23: \"LOG10\",\n 24: \"ABS\",\n 25: \"INT\",\n 26: \"SIGN\",\n 27: \"ROUND\",\n 28: \"LOOKUP\",\n 29: \"INDEX\",\n 30: \"REPT\",\n 31: \"MID\",\n 32: \"LEN\",\n 33: \"VALUE\",\n 34: \"TRUE\",\n 35: \"FALSE\",\n 36: \"AND\",\n 37: \"OR\",\n 38: \"NOT\",\n 39: \"MOD\",\n 40: \"DCOUNT\",\n 41: \"DSUM\",\n 42: \"DAVERAGE\",\n 43: \"DMIN\",\n 44: \"DMAX\",\n 45: \"DSTDEV\",\n 46: \"VAR\",\n 47: \"DVAR\",\n 48: \"TEXT\",\n 49: \"LINEST\",\n 50: \"TREND\",\n 51: \"LOGEST\",\n 52: \"GROWTH\",\n 53: \"GOTO\",\n 54: \"HALT\",\n 55: \"RETURN\",\n 56: \"PV\",\n 57: \"FV\",\n 58: \"NPER\",\n 59: \"PMT\",\n 60: \"RATE\",\n 61: \"MIRR\",\n 62: \"IRR\",\n 63: \"RAND\",\n 64: \"MATCH\",\n 65: \"DATE\",\n 66: \"TIME\",\n 67: \"DAY\",\n 68: \"MONTH\",\n 69: \"YEAR\",\n 70: \"WEEKDAY\",\n 71: \"HOUR\",\n 72: \"MINUTE\",\n 73: \"SECOND\",\n 74: \"NOW\",\n 75: \"AREAS\",\n 76: \"ROWS\",\n 77: \"COLUMNS\",\n 78: \"OFFSET\",\n 79: \"ABSREF\",\n 80: \"RELREF\",\n 81: \"ARGUMENT\",\n 82: \"SEARCH\",\n 83: \"TRANSPOSE\",\n 84: \"ERROR\",\n 85: \"STEP\",\n 86: \"TYPE\",\n 87: \"ECHO\",\n 88: \"SET.NAME\",\n 89: \"CALLER\",\n 90: \"DEREF\",\n 91: \"WINDOWS\",\n 92: \"SERIES\",\n 93: \"DOCUMENTS\",\n 94: \"ACTIVE.CELL\",\n 95: \"SELECTION\",\n 96: \"RESULT\",\n 97: \"ATAN2\",\n 98: \"ASIN\",\n 99: \"ACOS\",\n 100: \"CHOOSE\",\n 101: \"HLOOKUP\",\n 102: \"VLOOKUP\",\n 103: \"LINKS\",\n 104: \"INPUT\",\n 105: \"ISREF\",\n 106: \"GET.FORMULA\",\n 107: \"GET.NAME\",\n 108: \"SET.VALUE\",\n 109: \"LOG\",\n 110: \"EXEC\",\n 111: \"CHAR\",\n 112: \"LOWER\",\n 113: \"UPPER\",\n 114: \"PROPER\",\n 115: \"LEFT\",\n 116: \"RIGHT\",\n 117: \"EXACT\",\n 118: \"TRIM\",\n 119: \"REPLACE\",\n 120: \"SUBSTITUTE\",\n 121: \"CODE\",\n 122: \"NAMES\",\n 123: \"DIRECTORY\",\n 124: \"FIND\",\n 125: \"CELL\",\n 126: \"ISERR\",\n 127: \"ISTEXT\",\n 128: \"ISNUMBER\",\n 129: \"ISBLANK\",\n 130: \"T\",\n 131: \"N\",\n 132: \"FOPEN\",\n 133: \"FCLOSE\",\n 134: \"FSIZE\",\n 135: \"FREADLN\",\n 136: \"FREAD\",\n 137: \"FWRITELN\",\n 138: \"FWRITE\",\n 139: \"FPOS\",\n 140: \"DATEVALUE\",\n 141: \"TIMEVALUE\",\n 142: \"SLN\",\n 143: \"SYD\",\n 144: \"DDB\",\n 145: \"GET.DEF\",\n 146: \"REFTEXT\",\n 147: \"TEXTREF\",\n 148: \"INDIRECT\",\n 149: \"REGISTER\",\n 150: \"CALL\",\n 151: \"ADD.BAR\",\n 152: \"ADD.MENU\",\n 153: \"ADD.COMMAND\",\n 154: \"ENABLE.COMMAND\",\n 155: \"CHECK.COMMAND\",\n 156: \"RENAME.COMMAND\",\n 157: \"SHOW.BAR\",\n 158: \"DELETE.MENU\",\n 159: \"DELETE.COMMAND\",\n 160: \"GET.CHART.ITEM\",\n 161: \"DIALOG.BOX\",\n 162: \"CLEAN\",\n 163: \"MDETERM\",\n 164: \"MINVERSE\",\n 165: \"MMULT\",\n 166: \"FILES\",\n 167: \"IPMT\",\n 168: \"PPMT\",\n 169: \"COUNTA\",\n 170: \"CANCEL.KEY\",\n 171: \"FOR\",\n 172: \"WHILE\",\n 173: \"BREAK\",\n 174: \"NEXT\",\n 175: \"INITIATE\",\n 176: \"REQUEST\",\n 177: \"POKE\",\n 178: \"EXECUTE\",\n 179: \"TERMINATE\",\n 180: \"RESTART\",\n 181: \"HELP\",\n 182: \"GET.BAR\",\n 183: \"PRODUCT\",\n 184: \"FACT\",\n 185: \"GET.CELL\",\n 186: \"GET.WORKSPACE\",\n 187: \"GET.WINDOW\",\n 188: \"GET.DOCUMENT\",\n 189: \"DPRODUCT\",\n 190: \"ISNONTEXT\",\n 191: \"GET.NOTE\",\n 192: \"NOTE\",\n 193: \"STDEVP\",\n 194: \"VARP\",\n 195: \"DSTDEVP\",\n 196: \"DVARP\",\n 197: \"TRUNC\",\n 198: \"ISLOGICAL\",\n 199: \"DCOUNTA\",\n 200: \"DELETE.BAR\",\n 201: \"UNREGISTER\",\n 204: \"USDOLLAR\",\n 205: \"FINDB\",\n 206: \"SEARCHB\",\n 207: \"REPLACEB\",\n 208: \"LEFTB\",\n 209: \"RIGHTB\",\n 210: \"MIDB\",\n 211: \"LENB\",\n 212: \"ROUNDUP\",\n 213: \"ROUNDDOWN\",\n 214: \"ASC\",\n 215: \"DBCS\",\n 216: \"RANK\",\n 219: \"ADDRESS\",\n 220: \"DAYS360\",\n 221: \"TODAY\",\n 222: \"VDB\",\n 223: \"ELSE\",\n 224: \"ELSE.IF\",\n 225: \"END.IF\",\n 226: \"FOR.CELL\",\n 227: \"MEDIAN\",\n 228: \"SUMPRODUCT\",\n 229: \"SINH\",\n 230: \"COSH\",\n 231: \"TANH\",\n 232: \"ASINH\",\n 233: \"ACOSH\",\n 234: \"ATANH\",\n 235: \"DGET\",\n 236: \"CREATE.OBJECT\",\n 237: \"VOLATILE\",\n 238: \"LAST.ERROR\",\n 239: \"CUSTOM.UNDO\",\n 240: \"CUSTOM.REPEAT\",\n 241: \"FORMULA.CONVERT\",\n 242: \"GET.LINK.INFO\",\n 243: \"TEXT.BOX\",\n 244: \"INFO\",\n 245: \"GROUP\",\n 246: \"GET.OBJECT\",\n 247: \"DB\",\n 248: \"PAUSE\",\n 251: \"RESUME\",\n 252: \"FREQUENCY\",\n 253: \"ADD.TOOLBAR\",\n 254: \"DELETE.TOOLBAR\",\n 255: \"User\",\n 256: \"RESET.TOOLBAR\",\n 257: \"EVALUATE\",\n 258: \"GET.TOOLBAR\",\n 259: \"GET.TOOL\",\n 260: \"SPELLING.CHECK\",\n 261: \"ERROR.TYPE\",\n 262: \"APP.TITLE\",\n 263: \"WINDOW.TITLE\",\n 264: \"SAVE.TOOLBAR\",\n 265: \"ENABLE.TOOL\",\n 266: \"PRESS.TOOL\",\n 267: \"REGISTER.ID\",\n 268: \"GET.WORKBOOK\",\n 269: \"AVEDEV\",\n 270: \"BETADIST\",\n 271: \"GAMMALN\",\n 272: \"BETAINV\",\n 273: \"BINOMDIST\",\n 274: \"CHIDIST\",\n 275: \"CHIINV\",\n 276: \"COMBIN\",\n 277: \"CONFIDENCE\",\n 278: \"CRITBINOM\",\n 279: \"EVEN\",\n 280: \"EXPONDIST\",\n 281: \"FDIST\",\n 282: \"FINV\",\n 283: \"FISHER\",\n 284: \"FISHERINV\",\n 285: \"FLOOR\",\n 286: \"GAMMADIST\",\n 287: \"GAMMAINV\",\n 288: \"CEILING\",\n 289: \"HYPGEOMDIST\",\n 290: \"LOGNORMDIST\",\n 291: \"LOGINV\",\n 292: \"NEGBINOMDIST\",\n 293: \"NORMDIST\",\n 294: \"NORMSDIST\",\n 295: \"NORMINV\",\n 296: \"NORMSINV\",\n 297: \"STANDARDIZE\",\n 298: \"ODD\",\n 299: \"PERMUT\",\n 300: \"POISSON\",\n 301: \"TDIST\",\n 302: \"WEIBULL\",\n 303: \"SUMXMY2\",\n 304: \"SUMX2MY2\",\n 305: \"SUMX2PY2\",\n 306: \"CHITEST\",\n 307: \"CORREL\",\n 308: \"COVAR\",\n 309: \"FORECAST\",\n 310: \"FTEST\",\n 311: \"INTERCEPT\",\n 312: \"PEARSON\",\n 313: \"RSQ\",\n 314: \"STEYX\",\n 315: \"SLOPE\",\n 316: \"TTEST\",\n 317: \"PROB\",\n 318: \"DEVSQ\",\n 319: \"GEOMEAN\",\n 320: \"HARMEAN\",\n 321: \"SUMSQ\",\n 322: \"KURT\",\n 323: \"SKEW\",\n 324: \"ZTEST\",\n 325: \"LARGE\",\n 326: \"SMALL\",\n 327: \"QUARTILE\",\n 328: \"PERCENTILE\",\n 329: \"PERCENTRANK\",\n 330: \"MODE\",\n 331: \"TRIMMEAN\",\n 332: \"TINV\",\n 334: \"MOVIE.COMMAND\",\n 335: \"GET.MOVIE\",\n 336: \"CONCATENATE\",\n 337: \"POWER\",\n 338: \"PIVOT.ADD.DATA\",\n 339: \"GET.PIVOT.TABLE\",\n 340: \"GET.PIVOT.FIELD\",\n 341: \"GET.PIVOT.ITEM\",\n 342: \"RADIANS\",\n 343: \"DEGREES\",\n 344: \"SUBTOTAL\",\n 345: \"SUMIF\",\n 346: \"COUNTIF\",\n 347: \"COUNTBLANK\",\n 348: \"SCENARIO.GET\",\n 349: \"OPTIONS.LISTS.GET\",\n 350: \"ISPMT\",\n 351: \"DATEDIF\",\n 352: \"DATESTRING\",\n 353: \"NUMBERSTRING\",\n 354: \"ROMAN\",\n 355: \"OPEN.DIALOG\",\n 356: \"SAVE.DIALOG\",\n 357: \"VIEW.GET\",\n 358: \"GETPIVOTDATA\",\n 359: \"HYPERLINK\",\n 360: \"PHONETIC\",\n 361: \"AVERAGEA\",\n 362: \"MAXA\",\n 363: \"MINA\",\n 364: \"STDEVPA\",\n 365: \"VARPA\",\n 366: \"STDEVA\",\n 367: \"VARA\",\n 368: \"BAHTTEXT\",\n 369: \"THAIDAYOFWEEK\",\n 370: \"THAIDIGIT\",\n 371: \"THAIMONTHOFYEAR\",\n 372: \"THAINUMSOUND\",\n 373: \"THAINUMSTRING\",\n 374: \"THAISTRINGLENGTH\",\n 375: \"ISTHAIDIGIT\",\n 376: \"ROUNDBAHTDOWN\",\n 377: \"ROUNDBAHTUP\",\n 378: \"THAIYEAR\",\n 379: \"RTD\",\n 380: \"CUBEVALUE\",\n 381: \"CUBEMEMBER\",\n 382: \"CUBEMEMBERPROPERTY\",\n 383: \"CUBERANKEDMEMBER\",\n 384: \"HEX2BIN\",\n 385: \"HEX2DEC\",\n 386: \"HEX2OCT\",\n 387: \"DEC2BIN\",\n 388: \"DEC2HEX\",\n 389: \"DEC2OCT\",\n 390: \"OCT2BIN\",\n 391: \"OCT2HEX\",\n 392: \"OCT2DEC\",\n 393: \"BIN2DEC\",\n 394: \"BIN2OCT\",\n 395: \"BIN2HEX\",\n 396: \"IMSUB\",\n 397: \"IMDIV\",\n 398: \"IMPOWER\",\n 399: \"IMABS\",\n 400: \"IMSQRT\",\n 401: \"IMLN\",\n 402: \"IMLOG2\",\n 403: \"IMLOG10\",\n 404: \"IMSIN\",\n 405: \"IMCOS\",\n 406: \"IMEXP\",\n 407: \"IMARGUMENT\",\n 408: \"IMCONJUGATE\",\n 409: \"IMAGINARY\",\n 410: \"IMREAL\",\n 411: \"COMPLEX\",\n 412: \"IMSUM\",\n 413: \"IMPRODUCT\",\n 414: \"SERIESSUM\",\n 415: \"FACTDOUBLE\",\n 416: \"SQRTPI\",\n 417: \"QUOTIENT\",\n 418: \"DELTA\",\n 419: \"GESTEP\",\n 420: \"ISEVEN\",\n 421: \"ISODD\",\n 422: \"MROUND\",\n 423: \"ERF\",\n 424: \"ERFC\",\n 425: \"BESSELJ\",\n 426: \"BESSELK\",\n 427: \"BESSELY\",\n 428: \"BESSELI\",\n 429: \"XIRR\",\n 430: \"XNPV\",\n 431: \"PRICEMAT\",\n 432: \"YIELDMAT\",\n 433: \"INTRATE\",\n 434: \"RECEIVED\",\n 435: \"DISC\",\n 436: \"PRICEDISC\",\n 437: \"YIELDDISC\",\n 438: \"TBILLEQ\",\n 439: \"TBILLPRICE\",\n 440: \"TBILLYIELD\",\n 441: \"PRICE\",\n 442: \"YIELD\",\n 443: \"DOLLARDE\",\n 444: \"DOLLARFR\",\n 445: \"NOMINAL\",\n 446: \"EFFECT\",\n 447: \"CUMPRINC\",\n 448: \"CUMIPMT\",\n 449: \"EDATE\",\n 450: \"EOMONTH\",\n 451: \"YEARFRAC\",\n 452: \"COUPDAYBS\",\n 453: \"COUPDAYS\",\n 454: \"COUPDAYSNC\",\n 455: \"COUPNCD\",\n 456: \"COUPNUM\",\n 457: \"COUPPCD\",\n 458: \"DURATION\",\n 459: \"MDURATION\",\n 460: \"ODDLPRICE\",\n 461: \"ODDLYIELD\",\n 462: \"ODDFPRICE\",\n 463: \"ODDFYIELD\",\n 464: \"RANDBETWEEN\",\n 465: \"WEEKNUM\",\n 466: \"AMORDEGRC\",\n 467: \"AMORLINC\",\n 468: \"CONVERT\",\n 724: \"SHEETJS\",\n 469: \"ACCRINT\",\n 470: \"ACCRINTM\",\n 471: \"WORKDAY\",\n 472: \"NETWORKDAYS\",\n 473: \"GCD\",\n 474: \"MULTINOMIAL\",\n 475: \"LCM\",\n 476: \"FVSCHEDULE\",\n 477: \"CUBEKPIMEMBER\",\n 478: \"CUBESET\",\n 479: \"CUBESETCOUNT\",\n 480: \"IFERROR\",\n 481: \"COUNTIFS\",\n 482: \"SUMIFS\",\n 483: \"AVERAGEIF\",\n 484: \"AVERAGEIFS\"\n};\nvar FtabArgc = {\n 2: 1,\n 3: 1,\n 10: 0,\n 15: 1,\n 16: 1,\n 17: 1,\n 18: 1,\n 19: 0,\n 20: 1,\n 21: 1,\n 22: 1,\n 23: 1,\n 24: 1,\n 25: 1,\n 26: 1,\n 27: 2,\n 30: 2,\n 31: 3,\n 32: 1,\n 33: 1,\n 34: 0,\n 35: 0,\n 38: 1,\n 39: 2,\n 40: 3,\n 41: 3,\n 42: 3,\n 43: 3,\n 44: 3,\n 45: 3,\n 47: 3,\n 48: 2,\n 53: 1,\n 61: 3,\n 63: 0,\n 65: 3,\n 66: 3,\n 67: 1,\n 68: 1,\n 69: 1,\n 70: 1,\n 71: 1,\n 72: 1,\n 73: 1,\n 74: 0,\n 75: 1,\n 76: 1,\n 77: 1,\n 79: 2,\n 80: 2,\n 83: 1,\n 85: 0,\n 86: 1,\n 89: 0,\n 90: 1,\n 94: 0,\n 95: 0,\n 97: 2,\n 98: 1,\n 99: 1,\n 101: 3,\n 102: 3,\n 105: 1,\n 106: 1,\n 108: 2,\n 111: 1,\n 112: 1,\n 113: 1,\n 114: 1,\n 117: 2,\n 118: 1,\n 119: 4,\n 121: 1,\n 126: 1,\n 127: 1,\n 128: 1,\n 129: 1,\n 130: 1,\n 131: 1,\n 133: 1,\n 134: 1,\n 135: 1,\n 136: 2,\n 137: 2,\n 138: 2,\n 140: 1,\n 141: 1,\n 142: 3,\n 143: 4,\n 144: 4,\n 161: 1,\n 162: 1,\n 163: 1,\n 164: 1,\n 165: 2,\n 172: 1,\n 175: 2,\n 176: 2,\n 177: 3,\n 178: 2,\n 179: 1,\n 184: 1,\n 186: 1,\n 189: 3,\n 190: 1,\n 195: 3,\n 196: 3,\n 197: 1,\n 198: 1,\n 199: 3,\n 201: 1,\n 207: 4,\n 210: 3,\n 211: 1,\n 212: 2,\n 213: 2,\n 214: 1,\n 215: 1,\n 225: 0,\n 229: 1,\n 230: 1,\n 231: 1,\n 232: 1,\n 233: 1,\n 234: 1,\n 235: 3,\n 244: 1,\n 247: 4,\n 252: 2,\n 257: 1,\n 261: 1,\n 271: 1,\n 273: 4,\n 274: 2,\n 275: 2,\n 276: 2,\n 277: 3,\n 278: 3,\n 279: 1,\n 280: 3,\n 281: 3,\n 282: 3,\n 283: 1,\n 284: 1,\n 285: 2,\n 286: 4,\n 287: 3,\n 288: 2,\n 289: 4,\n 290: 3,\n 291: 3,\n 292: 3,\n 293: 4,\n 294: 1,\n 295: 3,\n 296: 1,\n 297: 3,\n 298: 1,\n 299: 2,\n 300: 3,\n 301: 3,\n 302: 4,\n 303: 2,\n 304: 2,\n 305: 2,\n 306: 2,\n 307: 2,\n 308: 2,\n 309: 3,\n 310: 2,\n 311: 2,\n 312: 2,\n 313: 2,\n 314: 2,\n 315: 2,\n 316: 4,\n 325: 2,\n 326: 2,\n 327: 2,\n 328: 2,\n 331: 2,\n 332: 2,\n 337: 2,\n 342: 1,\n 343: 1,\n 346: 2,\n 347: 1,\n 350: 4,\n 351: 3,\n 352: 1,\n 353: 2,\n 360: 1,\n 368: 1,\n 369: 1,\n 370: 1,\n 371: 1,\n 372: 1,\n 373: 1,\n 374: 1,\n 375: 1,\n 376: 1,\n 377: 1,\n 378: 1,\n 382: 3,\n 385: 1,\n 392: 1,\n 393: 1,\n 396: 2,\n 397: 2,\n 398: 2,\n 399: 1,\n 400: 1,\n 401: 1,\n 402: 1,\n 403: 1,\n 404: 1,\n 405: 1,\n 406: 1,\n 407: 1,\n 408: 1,\n 409: 1,\n 410: 1,\n 414: 4,\n 415: 1,\n 416: 1,\n 417: 2,\n 420: 1,\n 421: 1,\n 422: 2,\n 424: 1,\n 425: 2,\n 426: 2,\n 427: 2,\n 428: 2,\n 430: 3,\n 438: 3,\n 439: 3,\n 440: 3,\n 443: 2,\n 444: 2,\n 445: 2,\n 446: 2,\n 447: 6,\n 448: 6,\n 449: 2,\n 450: 2,\n 464: 2,\n 468: 3,\n 476: 2,\n 479: 1,\n 480: 2,\n 65535: 0\n};\n/* Part 3 TODO: actually parse formulae */\nfunction ods_to_csf_formula(f/*:string*/)/*:string*/ {\n\tif(f.slice(0,3) == \"of:\") f = f.slice(3);\n\t/* 5.2 Basic Expressions */\n\tif(f.charCodeAt(0) == 61) {\n\t\tf = f.slice(1);\n\t\tif(f.charCodeAt(0) == 61) f = f.slice(1);\n\t}\n\tf = f.replace(/COM\\.MICROSOFT\\./g, \"\");\n\t/* Part 3 Section 5.8 References */\n\tf = f.replace(/\\[((?:\\.[A-Z]+[0-9]+)(?::\\.[A-Z]+[0-9]+)?)\\]/g, function($$, $1) { return $1.replace(/\\./g,\"\"); });\n\tf = f.replace(/\\$'([^']|'')+'/g, function($$) { return $$.slice(1); });\n\tf = f.replace(/\\$([^\\]\\. #$]+)/g, function($$, $1) { return ($1).match(/^([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])?(10[0-3]\\d{4}|104[0-7]\\d{3}|1048[0-4]\\d{2}|10485[0-6]\\d|104857[0-6]|[1-9]\\d{0,5})?$/) ? $$ : $1; });\n\t/* TODO: something other than this */\n\tf = f.replace(/\\[.(#[A-Z]*[?!])\\]/g, \"$1\");\n\treturn f.replace(/[;~]/g,\",\").replace(/\\|/g,\";\");\n}\n\nfunction csf_to_ods_formula(f/*:string*/)/*:string*/ {\n\tvar o = \"of:=\" + f.replace(crefregex, \"$1[.$2$3$4$5]\").replace(/\\]:\\[/g,\":\");\n\t/* TODO: something other than this */\n\treturn o.replace(/;/g, \"|\").replace(/,/g,\";\");\n}\n\nfunction ods_to_csf_3D(r/*:string*/)/*:[string, string]*/ {\n\tr = r.replace(/\\$'([^']|'')+'/g, function($$) { return $$.slice(1); });\n\tr = r.replace(/\\$([^\\]\\. #$]+)/g, function($$, $1) { return ($1).match(/^([A-Z]{1,2}|[A-W][A-Z]{2}|X[A-E][A-Z]|XF[A-D])?(10[0-3]\\d{4}|104[0-7]\\d{3}|1048[0-4]\\d{2}|10485[0-6]\\d|104857[0-6]|[1-9]\\d{0,5})?$/) ? $$ : $1; });\n\tvar a = r.split(\":\");\n\tvar s = a[0].split(\".\")[0];\n\treturn [s, a[0].split(\".\")[1] + (a.length > 1 ? (\":\" + (a[1].split(\".\")[1] || a[1].split(\".\")[0])) : \"\")];\n}\n\nfunction csf_to_ods_3D(r/*:string*/)/*:string*/ {\n\treturn r.replace(/!/,\".\").replace(/:/, \":.\");\n}\n\nvar strs = {}; // shared strings\nvar _ssfopts = {}; // spreadsheet formatting options\n\n\n/*global Map */\nvar browser_has_Map = typeof Map !== 'undefined';\n\nfunction get_sst_id(sst/*:SST*/, str/*:string*/, rev)/*:number*/ {\n\tvar i = 0, len = sst.length;\n\tif(rev) {\n\t\tif(browser_has_Map ? rev.has(str) : Object.prototype.hasOwnProperty.call(rev, str)) {\n\t\t\tvar revarr = browser_has_Map ? rev.get(str) : rev[str];\n\t\t\tfor(; i < revarr.length; ++i) {\n\t\t\t\tif(sst[revarr[i]].t === str) { sst.Count ++; return revarr[i]; }\n\t\t\t}\n\t\t}\n\t} else for(; i < len; ++i) {\n\t\tif(sst[i].t === str) { sst.Count ++; return i; }\n\t}\n\tsst[len] = ({t:str}/*:any*/); sst.Count ++; sst.Unique ++;\n\tif(rev) {\n\t\tif(browser_has_Map) {\n\t\t\tif(!rev.has(str)) rev.set(str, []);\n\t\t\trev.get(str).push(len);\n\t\t} else {\n\t\t\tif(!Object.prototype.hasOwnProperty.call(rev, str)) rev[str] = [];\n\t\t\trev[str].push(len);\n\t\t}\n\t}\n\treturn len;\n}\n\nfunction col_obj_w(C/*:number*/, col) {\n\tvar p = ({min:C+1,max:C+1}/*:any*/);\n\t/* wch (chars), wpx (pixels) */\n\tvar wch = -1;\n\tif(col.MDW) MDW = col.MDW;\n\tif(col.width != null) p.customWidth = 1;\n\telse if(col.wpx != null) wch = px2char(col.wpx);\n\telse if(col.wch != null) wch = col.wch;\n\tif(wch > -1) { p.width = char2width(wch); p.customWidth = 1; }\n\telse if(col.width != null) p.width = col.width;\n\tif(col.hidden) p.hidden = true;\n\tif(col.level != null) { p.outlineLevel = p.level = col.level; }\n\treturn p;\n}\n\nfunction default_margins(margins/*:Margins*/, mode/*:?string*/) {\n\tif(!margins) return;\n\tvar defs = [0.7, 0.7, 0.75, 0.75, 0.3, 0.3];\n\tif(mode == 'xlml') defs = [1, 1, 1, 1, 0.5, 0.5];\n\tif(margins.left == null) margins.left = defs[0];\n\tif(margins.right == null) margins.right = defs[1];\n\tif(margins.top == null) margins.top = defs[2];\n\tif(margins.bottom == null) margins.bottom = defs[3];\n\tif(margins.header == null) margins.header = defs[4];\n\tif(margins.footer == null) margins.footer = defs[5];\n}\n\nfunction get_cell_style(styles/*:Array*/, cell/*:Cell*/, opts) {\n\tvar z = opts.revssf[cell.z != null ? cell.z : \"General\"];\n\tvar i = 0x3c, len = styles.length;\n\tif(z == null && opts.ssf) {\n\t\tfor(; i < 0x188; ++i) if(opts.ssf[i] == null) {\n\t\t\tSSF__load(cell.z, i);\n\t\t\t// $FlowIgnore\n\t\t\topts.ssf[i] = cell.z;\n\t\t\topts.revssf[cell.z] = z = i;\n\t\t\tbreak;\n\t\t}\n\t}\n\tfor(i = 0; i != len; ++i) if(styles[i].numFmtId === z) return i;\n\tstyles[len] = {\n\t\tnumFmtId:z,\n\t\tfontId:0,\n\t\tfillId:0,\n\t\tborderId:0,\n\t\txfId:0,\n\t\tapplyNumberFormat:1\n\t};\n\treturn len;\n}\n\nfunction safe_format(p/*:Cell*/, fmtid/*:number*/, fillid/*:?number*/, opts, themes, styles, date1904) {\n\ttry {\n\t\tif(opts.cellNF) p.z = table_fmt[fmtid];\n\t} catch(e) { if(opts.WTF) throw e; }\n\tif(p.t === 'z' && !opts.cellStyles) return;\n\tif(p.t === 'd' && typeof p.v === 'string') p.v = parseDate(p.v);\n\tif((!opts || opts.cellText !== false) && p.t !== 'z') try {\n\t\tif(table_fmt[fmtid] == null) SSF__load(SSFImplicit[fmtid] || \"General\", fmtid);\n\t\tif(p.t === 'e') p.w = p.w || BErr[p.v];\n\t\telse if(fmtid === 0) {\n\t\t\tif(p.t === 'n') {\n\t\t\t\tif((p.v|0) === p.v) p.w = p.v.toString(10);\n\t\t\t\telse p.w = SSF_general_num(p.v);\n\t\t\t}\n\t\t\telse if(p.t === 'd') {\n\t\t\t\tvar dd = datenum(p.v, !!date1904);\n\t\t\t\tif((dd|0) === dd) p.w = dd.toString(10);\n\t\t\t\telse p.w = SSF_general_num(dd);\n\t\t\t}\n\t\t\telse if(p.v === undefined) return \"\";\n\t\t\telse p.w = SSF_general(p.v,_ssfopts);\n\t\t}\n\t\telse if(p.t === 'd') p.w = SSF_format(fmtid,datenum(p.v, !!date1904),_ssfopts);\n\t\telse p.w = SSF_format(fmtid,p.v,_ssfopts);\n\t} catch(e) { if(opts.WTF) throw e; }\n\tif(!opts.cellStyles) return;\n\tif(fillid != null) try {\n\t\tp.s = styles.Fills[fillid];\n\t\tif (p.s.fgColor && p.s.fgColor.theme && !p.s.fgColor.rgb) {\n\t\t\tp.s.fgColor.rgb = rgb_tint(themes.themeElements.clrScheme[p.s.fgColor.theme].rgb, p.s.fgColor.tint || 0);\n\t\t\tif(opts.WTF) p.s.fgColor.raw_rgb = themes.themeElements.clrScheme[p.s.fgColor.theme].rgb;\n\t\t}\n\t\tif (p.s.bgColor && p.s.bgColor.theme) {\n\t\t\tp.s.bgColor.rgb = rgb_tint(themes.themeElements.clrScheme[p.s.bgColor.theme].rgb, p.s.bgColor.tint || 0);\n\t\t\tif(opts.WTF) p.s.bgColor.raw_rgb = themes.themeElements.clrScheme[p.s.bgColor.theme].rgb;\n\t\t}\n\t} catch(e) { if(opts.WTF && styles.Fills) throw e; }\n}\n\nfunction check_ws(ws/*:Worksheet*/, sname/*:string*/, i/*:number*/) {\n\tif(ws && ws['!ref']) {\n\t\tvar range = safe_decode_range(ws['!ref']);\n\t\tif(range.e.c < range.s.c || range.e.r < range.s.r) throw new Error(\"Bad range (\" + i + \"): \" + ws['!ref']);\n\t}\n}\nfunction parse_ws_xml_dim(ws/*:Worksheet*/, s/*:string*/) {\n\tvar d = safe_decode_range(s);\n\tif(d.s.r<=d.e.r && d.s.c<=d.e.c && d.s.r>=0 && d.s.c>=0) ws[\"!ref\"] = encode_range(d);\n}\nvar mergecregex = /<(?:\\w+:)?mergeCell ref=[\"'][A-Z0-9:]+['\"]\\s*[\\/]?>/g;\nvar hlinkregex = /<(?:\\w+:)?hyperlink [^<>]*>/mg;\nvar dimregex = /\"(\\w*:\\w*)\"/;\nvar colregex = /<(?:\\w+:)?col\\b[^<>]*[\\/]?>/g;\nvar afregex = /<(?:\\w+:)?autoFilter[^>]*/g;\nvar marginregex= /<(?:\\w+:)?pageMargins[^<>]*\\/>/g;\nvar sheetprregex = /<(?:\\w+:)?sheetPr\\b[^<>]*?\\/>/;\n\n/* 18.3 Worksheets */\nfunction parse_ws_xml(data/*:?string*/, opts, idx/*:number*/, rels, wb/*:WBWBProps*/, themes, styles)/*:Worksheet*/ {\n\tif(!data) return data;\n\tif(!rels) rels = {'!id':{}};\n\tif(DENSE != null && opts.dense == null) opts.dense = DENSE;\n\n\t/* 18.3.1.99 worksheet CT_Worksheet */\n\tvar s = ({}/*:any*/); if(opts.dense) s[\"!data\"] = [];\n\tvar refguess/*:Range*/ = ({s: {r:2000000, c:2000000}, e: {r:0, c:0} }/*:any*/);\n\n\tvar data1 = \"\", data2 = \"\";\n\tvar mtch/*:?any*/ = str_match_xml_ns(data, \"sheetData\");\n\tif(mtch) {\n\t\tdata1 = data.slice(0, mtch.index);\n\t\tdata2 = data.slice(mtch.index + mtch[0].length);\n\t} else data1 = data2 = data;\n\n\t/* 18.3.1.82 sheetPr CT_SheetPr */\n\tvar sheetPr = data1.match(sheetprregex);\n\tif(sheetPr) parse_ws_xml_sheetpr(sheetPr[0], s, wb, idx);\n\telse if((sheetPr = str_match_xml_ns(data1, \"sheetPr\"))) parse_ws_xml_sheetpr2(sheetPr[0], sheetPr[1]||\"\", s, wb, idx, styles, themes);\n\n\t/* 18.3.1.35 dimension CT_SheetDimension */\n\tvar ridx = (data1.match(/<(?:\\w*:)?dimension/)||{index:-1}).index;\n\tif(ridx > 0) {\n\t\tvar ref = data1.slice(ridx,ridx+50).match(dimregex);\n\t\tif(ref && !(opts && opts.nodim)) parse_ws_xml_dim(s, ref[1]);\n\t}\n\n\t/* 18.3.1.88 sheetViews CT_SheetViews */\n\tvar svs = str_match_xml_ns(data1, \"sheetViews\");\n\tif(svs && svs[1]) parse_ws_xml_sheetviews(svs[1], wb);\n\n\t/* 18.3.1.17 cols CT_Cols */\n\tvar columns/*:Array*/ = [];\n\tif(opts.cellStyles) {\n\t\t/* 18.3.1.13 col CT_Col */\n\t\tvar cols = data1.match(colregex);\n\t\tif(cols) parse_ws_xml_cols(columns, cols);\n\t}\n\n\t/* 18.3.1.80 sheetData CT_SheetData ? */\n\tif(mtch) parse_ws_xml_data(mtch[1], s, opts, refguess, themes, styles, wb);\n\n\t/* 18.3.1.2 autoFilter CT_AutoFilter */\n\tvar afilter = data2.match(afregex);\n\tif(afilter) s['!autofilter'] = parse_ws_xml_autofilter(afilter[0]);\n\n\t/* 18.3.1.55 mergeCells CT_MergeCells */\n\tvar merges/*:Array*/ = [];\n\tvar _merge = data2.match(mergecregex);\n\tif(_merge) for(ridx = 0; ridx != _merge.length; ++ridx)\n\t\tmerges[ridx] = safe_decode_range(_merge[ridx].slice(_merge[ridx].indexOf(\"=\")+2));\n\n\t/* 18.3.1.48 hyperlinks CT_Hyperlinks */\n\tvar hlink = data2.match(hlinkregex);\n\tif(hlink) parse_ws_xml_hlinks(s, hlink, rels);\n\n\t/* 18.3.1.62 pageMargins CT_PageMargins */\n\tvar margins = data2.match(marginregex);\n\tif(margins) s['!margins'] = parse_ws_xml_margins(parsexmltag(margins[0]));\n\n\t/* legacyDrawing */\n\tvar m;\n\tif((m = data2.match(/legacyDrawing r:id=\"(.*?)\"/))) s['!legrel'] = m[1];\n\n\tif(opts && opts.nodim) refguess.s.c = refguess.s.r = 0;\n\tif(!s[\"!ref\"] && refguess.e.c >= refguess.s.c && refguess.e.r >= refguess.s.r) s[\"!ref\"] = encode_range(refguess);\n\tif(opts.sheetRows > 0 && s[\"!ref\"]) {\n\t\tvar tmpref = safe_decode_range(s[\"!ref\"]);\n\t\tif(opts.sheetRows <= +tmpref.e.r) {\n\t\t\ttmpref.e.r = opts.sheetRows - 1;\n\t\t\tif(tmpref.e.r > refguess.e.r) tmpref.e.r = refguess.e.r;\n\t\t\tif(tmpref.e.r < tmpref.s.r) tmpref.s.r = tmpref.e.r;\n\t\t\tif(tmpref.e.c > refguess.e.c) tmpref.e.c = refguess.e.c;\n\t\t\tif(tmpref.e.c < tmpref.s.c) tmpref.s.c = tmpref.e.c;\n\t\t\ts[\"!fullref\"] = s[\"!ref\"];\n\t\t\ts[\"!ref\"] = encode_range(tmpref);\n\t\t}\n\t}\n\tif(columns.length > 0) s[\"!cols\"] = columns;\n\tif(merges.length > 0) s[\"!merges\"] = merges;\n\tif(rels['!id'][s['!legrel']]) s['!legdrawel'] = rels['!id'][s['!legrel']];\n\treturn s;\n}\n\nfunction write_ws_xml_merges(merges/*:Array*/)/*:string*/ {\n\tif(merges.length === 0) return \"\";\n\tvar o = '';\n\tfor(var i = 0; i != merges.length; ++i) o += '';\n\treturn o + '';\n}\n\n/* 18.3.1.82-3 sheetPr CT_ChartsheetPr / CT_SheetPr */\nfunction parse_ws_xml_sheetpr(sheetPr/*:string*/, s, wb/*:WBWBProps*/, idx/*:number*/) {\n\tvar data = parsexmltag(sheetPr);\n\tif(!wb.Sheets[idx]) wb.Sheets[idx] = {};\n\tif(data.codeName) wb.Sheets[idx].CodeName = unescapexml(utf8read(data.codeName));\n}\nfunction parse_ws_xml_sheetpr2(sheetPr/*:string*/, body/*:string*/, s, wb/*:WBWBProps*/, idx/*:number*/) {\n\tparse_ws_xml_sheetpr(sheetPr.slice(0, sheetPr.indexOf(\">\")), s, wb, idx);\n}\nfunction write_ws_xml_sheetpr(ws, wb, idx, opts, o) {\n\tvar needed = false;\n\tvar props = {}, payload = null;\n\tif(opts.bookType !== 'xlsx' && wb.vbaraw) {\n\t\tvar cname = wb.SheetNames[idx];\n\t\ttry { if(wb.Workbook) cname = wb.Workbook.Sheets[idx].CodeName || cname; } catch(e) {}\n\t\tneeded = true;\n\t\tprops.codeName = utf8write(escapexml(cname));\n\t}\n\n\tif(ws && ws[\"!outline\"]) {\n\t\tvar outlineprops = {summaryBelow:1, summaryRight:1};\n\t\tif(ws[\"!outline\"].above) outlineprops.summaryBelow = 0;\n\t\tif(ws[\"!outline\"].left) outlineprops.summaryRight = 0;\n\t\tpayload = (payload||\"\") + writextag('outlinePr', null, outlineprops);\n\t}\n\n\tif(!needed && !payload) return;\n\to[o.length] = (writextag('sheetPr', payload, props));\n}\n\n/* 18.3.1.85 sheetProtection CT_SheetProtection */\nvar sheetprot_deffalse = [\"objects\", \"scenarios\", \"selectLockedCells\", \"selectUnlockedCells\"];\nvar sheetprot_deftrue = [\n\t\"formatColumns\", \"formatRows\", \"formatCells\",\n\t\"insertColumns\", \"insertRows\", \"insertHyperlinks\",\n\t\"deleteColumns\", \"deleteRows\",\n\t\"sort\", \"autoFilter\", \"pivotTables\"\n];\nfunction write_ws_xml_protection(sp)/*:string*/ {\n\t// algorithmName, hashValue, saltValue, spinCount\n\tvar o = ({sheet:1}/*:any*/);\n\tsheetprot_deffalse.forEach(function(n) { if(sp[n] != null && sp[n]) o[n] = \"1\"; });\n\tsheetprot_deftrue.forEach(function(n) { if(sp[n] != null && !sp[n]) o[n] = \"0\"; });\n\t/* TODO: algorithm */\n\tif(sp.password) o.password = crypto_CreatePasswordVerifier_Method1(sp.password).toString(16).toUpperCase();\n\treturn writextag('sheetProtection', null, o);\n}\n\nfunction parse_ws_xml_hlinks(s, data/*:Array*/, rels) {\n\tvar dense = s[\"!data\"] != null;\n\tfor(var i = 0; i != data.length; ++i) {\n\t\tvar val = parsexmltag(utf8read(data[i]), true);\n\t\tif(!val.ref) return;\n\t\tvar rel = ((rels || {})['!id']||[])[val.id];\n\t\tif(rel) {\n\t\t\tval.Target = rel.Target;\n\t\t\tif(val.location) val.Target += \"#\"+unescapexml(val.location);\n\t\t} else {\n\t\t\tval.Target = \"#\" + unescapexml(val.location);\n\t\t\trel = {Target: val.Target, TargetMode: 'Internal'};\n\t\t}\n\t\tval.Rel = rel;\n\t\tif(val.tooltip) { val.Tooltip = val.tooltip; delete val.tooltip; }\n\t\tvar rng = safe_decode_range(val.ref);\n\t\tfor(var R=rng.s.r;R<=rng.e.r;++R) for(var C=rng.s.c;C<=rng.e.c;++C) {\n\t\t\tvar addr = encode_col(C) + encode_row(R);\n\t\t\tif(dense) {\n\t\t\t\tif(!s[\"!data\"][R]) s[\"!data\"][R] = [];\n\t\t\t\tif(!s[\"!data\"][R][C]) s[\"!data\"][R][C] = {t:\"z\",v:undefined};\n\t\t\t\ts[\"!data\"][R][C].l = val;\n\t\t\t} else {\n\t\t\t\tif(!s[addr]) s[addr] = {t:\"z\",v:undefined};\n\t\t\t\ts[addr].l = val;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction parse_ws_xml_margins(margin) {\n\tvar o = {};\n\t[\"left\", \"right\", \"top\", \"bottom\", \"header\", \"footer\"].forEach(function(k) {\n\t\tif(margin[k]) o[k] = parseFloat(margin[k]);\n\t});\n\treturn o;\n}\nfunction write_ws_xml_margins(margin)/*:string*/ {\n\tdefault_margins(margin);\n\treturn writextag('pageMargins', null, margin);\n}\n\nfunction parse_ws_xml_cols(columns, cols) {\n\tvar seencol = false;\n\tfor(var coli = 0; coli != cols.length; ++coli) {\n\t\tvar coll = parsexmltag(cols[coli], true);\n\t\tif(coll.hidden) coll.hidden = parsexmlbool(coll.hidden);\n\t\tvar colm=parseInt(coll.min, 10)-1, colM=parseInt(coll.max,10)-1;\n\t\tif(coll.outlineLevel) coll.level = (+coll.outlineLevel || 0);\n\t\tdelete coll.min; delete coll.max; coll.width = +coll.width;\n\t\tif(!seencol && coll.width) { seencol = true; find_mdw_colw(coll.width); }\n\t\tprocess_col(coll);\n\t\twhile(colm <= colM) columns[colm++] = dup(coll);\n\t}\n}\nfunction write_ws_xml_cols(ws, cols)/*:string*/ {\n\tvar o = [\"\"], col;\n\tfor(var i = 0; i != cols.length; ++i) {\n\t\tif(!(col = cols[i])) continue;\n\t\to[o.length] = (writextag('col', null, col_obj_w(i, col)));\n\t}\n\to[o.length] = \"\";\n\treturn o.join(\"\");\n}\n\nfunction parse_ws_xml_autofilter(data/*:string*/) {\n\tvar o = { ref: (data.match(/ref=\"([^\"]*)\"/)||[])[1]};\n\treturn o;\n}\nfunction write_ws_xml_autofilter(data, ws, wb, idx)/*:string*/ {\n\tvar ref = typeof data.ref == \"string\" ? data.ref : encode_range(data.ref);\n\tif(!wb.Workbook) wb.Workbook = ({Sheets:[]}/*:any*/);\n\tif(!wb.Workbook.Names) wb.Workbook.Names = [];\n\tvar names/*: Array */ = wb.Workbook.Names;\n\tvar range = decode_range(ref);\n\tif(range.s.r == range.e.r) { range.e.r = decode_range(ws[\"!ref\"]).e.r; ref = encode_range(range); }\n\tfor(var i = 0; i < names.length; ++i) {\n\t\tvar name = names[i];\n\t\tif(name.Name != '_xlnm._FilterDatabase') continue;\n\t\tif(name.Sheet != idx) continue;\n\t\tname.Ref = formula_quote_sheet_name(wb.SheetNames[idx]) + \"!\" + fix_range(ref); break;\n\t}\n\tif(i == names.length) names.push({ Name: '_xlnm._FilterDatabase', Sheet: idx, Ref: \"'\" + wb.SheetNames[idx] + \"'!\" + ref });\n\treturn writextag(\"autoFilter\", null, {ref:ref});\n}\n\n/* 18.3.1.88 sheetViews CT_SheetViews */\n/* 18.3.1.87 sheetView CT_SheetView */\nvar sviewregex = /<(?:\\w:)?sheetView(?:[^<>a-z][^<>]*)?\\/?>/g;\nfunction parse_ws_xml_sheetviews(data, wb/*:WBWBProps*/) {\n\tif(!wb.Views) wb.Views = [{}];\n\t(data.match(sviewregex)||[]).forEach(function(r/*:string*/, i/*:number*/) {\n\t\tvar tag = parsexmltag(r);\n\t\t// $FlowIgnore\n\t\tif(!wb.Views[i]) wb.Views[i] = {};\n\t\t// $FlowIgnore\n\t\tif(+tag.zoomScale) wb.Views[i].zoom = +tag.zoomScale;\n\t\t// $FlowIgnore\n\t\tif(tag.rightToLeft && parsexmlbool(tag.rightToLeft)) wb.Views[i].RTL = true;\n\t});\n}\nfunction write_ws_xml_sheetviews(ws, opts, idx, wb)/*:string*/ {\n\tvar sview = ({workbookViewId:\"0\"}/*:any*/);\n\t// $FlowIgnore\n\tif((((wb||{}).Workbook||{}).Views||[])[0]) sview.rightToLeft = wb.Workbook.Views[0].RTL ? \"1\" : \"0\";\n\treturn writextag(\"sheetViews\", writextag(\"sheetView\", null, sview), {});\n}\n\nfunction write_ws_xml_cell(cell/*:Cell*/, ref, ws, opts, idx, wb, date1904)/*:string*/ {\n\tif(cell.c) ws['!comments'].push([ref, cell.c]);\n\tif((cell.v === undefined || cell.t === \"z\" && !(opts||{}).sheetStubs) && typeof cell.f !== \"string\" && typeof cell.z == \"undefined\") return \"\";\n\tvar vv = \"\";\n\tvar oldt = cell.t, oldv = cell.v;\n\tif(cell.t !== \"z\") switch(cell.t) {\n\t\tcase 'b': vv = cell.v ? \"1\" : \"0\"; break;\n\t\tcase 'n':\n\t\t\tif(isNaN(cell.v)) { cell.t = \"e\"; vv = BErr[cell.v = 0x24]; } // #NUM!\n\t\t\telse if(!isFinite(cell.v)) { cell.t = \"e\"; vv = BErr[cell.v = 0x07]; } // #DIV/0!\n\t\t\telse vv = ''+cell.v; break;\n\t\tcase 'e': vv = BErr[cell.v]; break;\n\t\tcase 'd':\n\t\t\tif(opts && opts.cellDates) {\n\t\t\t\tvar _vv = parseDate(cell.v, date1904);\n\t\t\t\tvv = _vv.toISOString();\n\t\t\t\tif(_vv.getUTCFullYear() < 1900) vv = vv.slice(vv.indexOf(\"T\") + 1).replace(\"Z\",\"\");\n\t\t\t} else {\n\t\t\t\tcell = dup(cell);\n\t\t\t\tcell.t = 'n';\n\t\t\t\tvv = ''+(cell.v = datenum(parseDate(cell.v, date1904), date1904));\n\t\t\t}\n\t\t\tif(typeof cell.z === 'undefined') cell.z = table_fmt[14];\n\t\t\tbreak;\n\t\tdefault: vv = cell.v; break;\n\t}\n\tvar v = (cell.t == \"z\" || cell.v == null)? \"\" : writetag('v', escapexml(vv)), o = ({r:ref}/*:any*/);\n\t/* TODO: cell style */\n\tvar os = get_cell_style(opts.cellXfs, cell, opts);\n\tif(os !== 0) o.s = os;\n\tswitch(cell.t) {\n\t\tcase 'n': break;\n\t\tcase 'd': o.t = \"d\"; break;\n\t\tcase 'b': o.t = \"b\"; break;\n\t\tcase 'e': o.t = \"e\"; break;\n\t\tcase 'z': break;\n\t\tdefault: if(cell.v == null) { delete cell.t; break; }\n\t\t\tif(cell.v.length > 32767) throw new Error(\"Text length must not exceed 32767 characters\");\n\t\t\tif(opts && opts.bookSST) {\n\t\t\t\tv = writetag('v', ''+get_sst_id(opts.Strings, cell.v, opts.revStrings));\n\t\t\t\to.t = \"s\"; break;\n\t\t\t}\n\t\t\telse o.t = \"str\"; break;\n\t}\n\tif(cell.t != oldt) { cell.t = oldt; cell.v = oldv; }\n\tif(typeof cell.f == \"string\" && cell.f) {\n\t\tvar ff = cell.F && cell.F.slice(0, ref.length) == ref ? {t:\"array\", ref:cell.F} : null;\n\t\tv = writextag('f', escapexml(cell.f), ff) + (cell.v != null ? v : \"\");\n\t}\n\tif(cell.l) {\n\t\tcell.l.display = escapexml(vv);\n\t\tws['!links'].push([ref, cell.l]);\n\t}\n\tif(cell.D) o.cm = 1;\n\treturn writextag('c', v, o);\n}\n\nvar parse_ws_xml_data = /*#__PURE__*/(function() {\n\tvar cellregex = /<(?:\\w+:)?c[ \\/>]/, rowregex = /<\\/(?:\\w+:)?row>/;\n\tvar rregex = /r=[\"']([^\"']*)[\"']/;\n\tvar refregex = /ref=[\"']([^\"']*)[\"']/;\n\nreturn function parse_ws_xml_data(sdata/*:string*/, s, opts, guess/*:Range*/, themes, styles, wb) {\n\tvar ri = 0, x = \"\", cells/*:Array*/ = [], cref/*:?Array*/ = [], idx=0, i=0, cc=0, d=\"\", p/*:any*/;\n\tvar tag, tagr = 0, tagc = 0;\n\tvar sstr, ftag;\n\tvar fmtid = 0, fillid = 0;\n\tvar do_format = Array.isArray(styles.CellXf), cf;\n\tvar arrayf/*:Array<[Range, string]>*/ = [];\n\tvar sharedf = [];\n\tvar dense = s[\"!data\"] != null;\n\tvar rows/*:Array*/ = [], rowobj = {}, rowrite = false;\n\tvar sheetStubs = !!opts.sheetStubs;\n\tvar date1904 = !!((wb||{}).WBProps||{}).date1904;\n\tfor(var marr = sdata.split(rowregex), mt = 0, marrlen = marr.length; mt != marrlen; ++mt) {\n\t\tx = marr[mt].trim();\n\t\tvar xlen = x.length;\n\t\tif(xlen === 0) continue;\n\n\t\t/* 18.3.1.73 row CT_Row */\n\t\tvar rstarti = 0;\n\t\touta: for(ri = 0; ri < xlen; ++ri) switch(/*x.charCodeAt(ri)*/x[ri]) {\n\t\t\tcase \">\" /*62*/:\n\t\t\t\tif(/*x.charCodeAt(ri-1) != 47*/x[ri-1] != \"/\") { ++ri; break outa; }\n\t\t\t\tif(opts && opts.cellStyles) {\n\t\t\t\t\t// TODO: avoid duplication\n\t\t\t\t\ttag = parsexmltag(x.slice(rstarti,ri), true);\n\t\t\t\t\ttagr = tag.r != null ? parseInt(tag.r, 10) : tagr+1; tagc = -1;\n\t\t\t\t\tif(opts.sheetRows && opts.sheetRows < tagr) continue;\n\t\t\t\t\trowobj = {}; rowrite = false;\n\t\t\t\t\tif(tag.ht) { rowrite = true; rowobj.hpt = parseFloat(tag.ht); rowobj.hpx = pt2px(rowobj.hpt); }\n\t\t\t\t\tif(tag.hidden && parsexmlbool(tag.hidden)) { rowrite = true; rowobj.hidden = true; }\n\t\t\t\t\tif(tag.outlineLevel != null) { rowrite = true; rowobj.level = +tag.outlineLevel; }\n\t\t\t\t\tif(rowrite) rows[tagr-1] = rowobj;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"<\" /*60*/: rstarti = ri; break;\n\t\t}\n\t\tif(rstarti >= ri) break;\n\t\ttag = parsexmltag(x.slice(rstarti,ri), true);\n\t\ttagr = tag.r != null ? parseInt(tag.r, 10) : tagr+1; tagc = -1;\n\t\tif(opts.sheetRows && opts.sheetRows < tagr) continue;\n\t\tif(!opts.nodim) {\n\t\t\tif(guess.s.r > tagr - 1) guess.s.r = tagr - 1;\n\t\t\tif(guess.e.r < tagr - 1) guess.e.r = tagr - 1;\n\t\t}\n\n\t\tif(opts && opts.cellStyles) {\n\t\t\trowobj = {}; rowrite = false;\n\t\t\tif(tag.ht) { rowrite = true; rowobj.hpt = parseFloat(tag.ht); rowobj.hpx = pt2px(rowobj.hpt); }\n\t\t\tif(tag.hidden && parsexmlbool(tag.hidden)) { rowrite = true; rowobj.hidden = true; }\n\t\t\tif(tag.outlineLevel != null) { rowrite = true; rowobj.level = +tag.outlineLevel; }\n\t\t\tif(rowrite) rows[tagr-1] = rowobj;\n\t\t}\n\n\t\t/* 18.3.1.4 c CT_Cell */\n\t\tcells = x.slice(ri).split(cellregex);\n\t\tfor(var rslice = 0; rslice != cells.length; ++rslice) if(cells[rslice].trim().charAt(0) != \"<\") break;\n\t\tcells = cells.slice(rslice);\n\t\tfor(ri = 0; ri != cells.length; ++ri) {\n\t\t\tx = cells[ri].trim();\n\t\t\tif(x.length === 0) continue;\n\t\t\tcref = x.match(rregex); idx = ri; i=0; cc=0;\n\t\t\tx = \"\":\"\") + x;\n\t\t\tif(cref != null && cref.length === 2) {\n\t\t\t\tidx = 0; d=cref[1];\n\t\t\t\tfor(i=0; i != d.length; ++i) {\n\t\t\t\t\tif((cc=d.charCodeAt(i)-64) < 1 || cc > 26) break;\n\t\t\t\t\tidx = 26*idx + cc;\n\t\t\t\t}\n\t\t\t\t--idx;\n\t\t\t\ttagc = idx;\n\t\t\t} else ++tagc;\n\t\t\tfor(i = 0; i != x.length; ++i) if(x.charCodeAt(i) === 62) break; ++i;\n\t\t\ttag = parsexmltag(x.slice(0,i), true);\n\t\t\tif(!tag.r) tag.r = encode_cell({r:tagr-1, c:tagc});\n\t\t\td = x.slice(i);\n\t\t\tp = ({t:\"\"}/*:any*/);\n\n\t\t\tif((cref=str_match_xml_ns(d, \"v\"))!= null && /*::cref != null && */cref[1] !== '') p.v=unescapexml(cref[1]);\n\t\t\tif(opts.cellFormula) {\n\t\t\t\tif((cref=str_match_xml_ns(d, \"f\"))!= null /*:: && cref != null*/) {\n\t\t\t\t\tif(cref[1] == \"\") {\n\t\t\t\t\t\tif(/*::cref != null && cref[0] != null && */cref[0].indexOf('t=\"shared\"') > -1) {\n\t\t\t\t\t\t\t// TODO: parse formula\n\t\t\t\t\t\t\tftag = parsexmltag(cref[0]);\n\t\t\t\t\t\t\tif(sharedf[ftag.si]) p.f = shift_formula_xlsx(sharedf[ftag.si][1], sharedf[ftag.si][2]/*[0].ref*/, tag.r);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t/* TODO: match against XLSXFutureFunctions */\n\t\t\t\t\t\tp.f=unescapexml(utf8read(cref[1]), true);\n\t\t\t\t\t\tif(!opts.xlfn) p.f = _xlfn(p.f);\n\t\t\t\t\t\tif(/*::cref != null && cref[0] != null && */cref[0].indexOf('t=\"array\"') > -1) {\n\t\t\t\t\t\t\tp.F = (d.match(refregex)||[])[1];\n\t\t\t\t\t\t\tif(p.F.indexOf(\":\") > -1) arrayf.push([safe_decode_range(p.F), p.F]);\n\t\t\t\t\t\t} else if(/*::cref != null && cref[0] != null && */cref[0].indexOf('t=\"shared\"') > -1) {\n\t\t\t\t\t\t\t// TODO: parse formula\n\t\t\t\t\t\t\tftag = parsexmltag(cref[0]);\n\t\t\t\t\t\t\tvar ___f = unescapexml(utf8read(cref[1]));\n\t\t\t\t\t\t\tif(!opts.xlfn) ___f = _xlfn(___f);\n\t\t\t\t\t\t\tsharedf[parseInt(ftag.si, 10)] = [ftag, ___f, tag.r];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if((cref=d.match(/]*\\/>/))) {\n\t\t\t\t\tftag = parsexmltag(cref[0]);\n\t\t\t\t\tif(sharedf[ftag.si]) p.f = shift_formula_xlsx(sharedf[ftag.si][1], sharedf[ftag.si][2]/*[0].ref*/, tag.r);\n\t\t\t\t}\n\t\t\t\t/* TODO: factor out contains logic */\n\t\t\t\tvar _tag = decode_cell(tag.r);\n\t\t\t\tfor(i = 0; i < arrayf.length; ++i)\n\t\t\t\t\tif(_tag.r >= arrayf[i][0].s.r && _tag.r <= arrayf[i][0].e.r)\n\t\t\t\t\t\tif(_tag.c >= arrayf[i][0].s.c && _tag.c <= arrayf[i][0].e.c)\n\t\t\t\t\t\t\tp.F = arrayf[i][1];\n\t\t\t}\n\n\t\t\tif(tag.t == null && p.v === undefined) {\n\t\t\t\tif(p.f || p.F) {\n\t\t\t\t\tp.v = 0; p.t = \"n\";\n\t\t\t\t} else if(!sheetStubs) continue;\n\t\t\t\telse p.t = \"z\";\n\t\t\t}\n\t\t\telse p.t = tag.t || \"n\";\n\t\t\tif(guess.s.c > tagc) guess.s.c = tagc;\n\t\t\tif(guess.e.c < tagc) guess.e.c = tagc;\n\t\t\t/* 18.18.11 t ST_CellType */\n\t\t\tswitch(p.t) {\n\t\t\t\tcase 'n':\n\t\t\t\t\tif(p.v == \"\" || p.v == null) {\n\t\t\t\t\t\tif(!sheetStubs) continue;\n\t\t\t\t\t\tp.t = 'z';\n\t\t\t\t\t} else p.v = parseFloat(p.v);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 's':\n\t\t\t\t\tif(typeof p.v == 'undefined') {\n\t\t\t\t\t\tif(!sheetStubs) continue;\n\t\t\t\t\t\tp.t = 'z';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsstr = strs[parseInt(p.v, 10)];\n\t\t\t\t\t\tp.v = sstr.t;\n\t\t\t\t\t\tp.r = sstr.r;\n\t\t\t\t\t\tif(opts.cellHTML) p.h = sstr.h;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'str':\n\t\t\t\t\tp.t = \"s\";\n\t\t\t\t\tp.v = (p.v!=null) ? unescapexml(utf8read(p.v), true) : '';\n\t\t\t\t\tif(opts.cellHTML) p.h = escapehtml(p.v);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'inlineStr':\n\t\t\t\t\tcref = str_match_xml_ns(d, \"is\");\n\t\t\t\t\tp.t = 's';\n\t\t\t\t\tif(cref != null && (sstr = parse_si(cref[1]))) {\n\t\t\t\t\t\tp.v = sstr.t;\n\t\t\t\t\t\tif(opts.cellHTML) p.h = sstr.h;\n\t\t\t\t\t} else p.v = \"\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'b': p.v = parsexmlbool(p.v); break;\n\t\t\t\tcase 'd':\n\t\t\t\t\tif(opts.cellDates) p.v = parseDate(p.v, date1904);\n\t\t\t\t\telse { p.v = datenum(parseDate(p.v, date1904), date1904); p.t = 'n'; }\n\t\t\t\t\tbreak;\n\t\t\t\t/* error string in .w, number in .v */\n\t\t\t\tcase 'e':\n\t\t\t\t\tif(!opts || opts.cellText !== false) p.w = p.v;\n\t\t\t\t\tp.v = RBErr[p.v]; break;\n\t\t\t}\n\t\t\t/* formatting */\n\t\t\tfmtid = fillid = 0;\n\t\t\tcf = null;\n\t\t\tif(do_format && tag.s !== undefined) {\n\t\t\t\tcf = styles.CellXf[tag.s];\n\t\t\t\tif(cf != null) {\n\t\t\t\t\tif(cf.numFmtId != null) fmtid = cf.numFmtId;\n\t\t\t\t\tif(opts.cellStyles) {\n\t\t\t\t\t\tif(cf.fillId != null) fillid = cf.fillId;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tsafe_format(p, fmtid, fillid, opts, themes, styles, date1904);\n\t\t\tif(opts.cellDates && do_format && p.t == 'n' && fmt_is_date(table_fmt[fmtid])) { p.v = numdate(p.v + (date1904 ? 1462 : 0)); p.t = typeof p.v == \"number\" ? 'n' : 'd'; }\n\t\t\tif(tag.cm && opts.xlmeta) {\n\t\t\t\tvar cm = (opts.xlmeta.Cell||[])[+tag.cm-1];\n\t\t\t\tif(cm && cm.type == 'XLDAPR') p.D = true;\n\t\t\t}\n\t\t\tvar _r;\n\t\t\tif(opts.nodim) {\n\t\t\t\t_r = decode_cell(tag.r);\n\t\t\t\tif(guess.s.r > _r.r) guess.s.r = _r.r;\n\t\t\t\tif(guess.e.r < _r.r) guess.e.r = _r.r;\n\t\t\t}\n\t\t\tif(dense) {\n\t\t\t\t_r = decode_cell(tag.r);\n\t\t\t\tif(!s[\"!data\"][_r.r]) s[\"!data\"][_r.r] = [];\n\t\t\t\ts[\"!data\"][_r.r][_r.c] = p;\n\t\t\t} else s[tag.r] = p;\n\t\t}\n\t}\n\tif(rows.length > 0) s['!rows'] = rows;\n}; })();\n\nfunction write_ws_xml_data(ws/*:Worksheet*/, opts, idx/*:number*/, wb/*:Workbook*//*::, rels*/)/*:string*/ {\n\tvar o/*:Array*/ = [], r/*:Array*/ = [], range = safe_decode_range(ws['!ref']), cell=\"\", ref, rr = \"\", cols/*:Array*/ = [], R=0, C=0, rows = ws['!rows'];\n\tvar dense = ws[\"!data\"] != null, data = dense ? ws[\"!data\"] : [];\n\tvar params = ({r:rr}/*:any*/), row/*:RowInfo*/, height = -1;\n\tvar date1904 = (((wb||{}).Workbook||{}).WBProps||{}).date1904;\n\tfor(C = range.s.c; C <= range.e.c; ++C) cols[C] = encode_col(C);\n\tfor(R = range.s.r; R <= range.e.r; ++R) {\n\t\tr = [];\n\t\trr = encode_row(R);\n\t\tvar data_R = dense ? data[R] : [];\n\t\tfor(C = range.s.c; C <= range.e.c; ++C) {\n\t\t\tref = cols[C] + rr;\n\t\t\tvar _cell = dense ? data_R[C] : ws[ref];\n\t\t\tif(_cell === undefined) continue;\n\t\t\tif((cell = write_ws_xml_cell(_cell, ref, ws, opts, idx, wb, date1904)) != null) r.push(cell);\n\t\t}\n\t\tif(r.length > 0 || (rows && rows[R])) {\n\t\t\tparams = ({r:rr}/*:any*/);\n\t\t\tif(rows && rows[R]) {\n\t\t\t\trow = rows[R];\n\t\t\t\tif(row.hidden) params.hidden = 1;\n\t\t\t\theight = -1;\n\t\t\t\tif(row.hpx) height = px2pt(row.hpx);\n\t\t\t\telse if(row.hpt) height = row.hpt;\n\t\t\t\tif(height > -1) { params.ht = height; params.customHeight = 1; }\n\t\t\t\tif(row.level) { params.outlineLevel = row.level; }\n\t\t\t}\n\t\t\to[o.length] = (writextag('row', r.join(\"\"), params));\n\t\t}\n\t}\n\tif(rows) for(; R < rows.length; ++R) {\n\t\tif(rows && rows[R]) {\n\t\t\tparams = ({r:R+1}/*:any*/);\n\t\t\trow = rows[R];\n\t\t\tif(row.hidden) params.hidden = 1;\n\t\t\theight = -1;\n\t\t\tif (row.hpx) height = px2pt(row.hpx);\n\t\t\telse if (row.hpt) height = row.hpt;\n\t\t\tif (height > -1) { params.ht = height; params.customHeight = 1; }\n\t\t\tif (row.level) { params.outlineLevel = row.level; }\n\t\t\to[o.length] = (writextag('row', \"\", params));\n\t\t}\n\t}\n\treturn o.join(\"\");\n}\n\nfunction write_ws_xml(idx/*:number*/, opts, wb/*:Workbook*/, rels)/*:string*/ {\n\tvar o = [XML_HEADER, writextag('worksheet', null, {\n\t\t'xmlns': XMLNS_main[0],\n\t\t'xmlns:r': XMLNS.r\n\t})];\n\tvar s = wb.SheetNames[idx], sidx = 0, rdata = \"\";\n\tvar ws = wb.Sheets[s];\n\tif(ws == null) ws = {};\n\tvar ref = ws['!ref'] || 'A1';\n\tvar range = safe_decode_range(ref);\n\tif(range.e.c > 0x3FFF || range.e.r > 0xFFFFF) {\n\t\tif(opts.WTF) throw new Error(\"Range \" + ref + \" exceeds format limit A1:XFD1048576\");\n\t\trange.e.c = Math.min(range.e.c, 0x3FFF);\n\t\trange.e.r = Math.min(range.e.c, 0xFFFFF);\n\t\tref = encode_range(range);\n\t}\n\tif(!rels) rels = {};\n\tws['!comments'] = [];\n\tvar _drawing = [];\n\n\twrite_ws_xml_sheetpr(ws, wb, idx, opts, o);\n\n\to[o.length] = (writextag('dimension', null, {'ref': ref}));\n\n\to[o.length] = write_ws_xml_sheetviews(ws, opts, idx, wb);\n\n\t/* TODO: store in WB, process styles */\n\tif(opts.sheetFormat) o[o.length] = (writextag('sheetFormatPr', null, {\n\t\tdefaultRowHeight:opts.sheetFormat.defaultRowHeight||'16',\n\t\tbaseColWidth:opts.sheetFormat.baseColWidth||'10',\n\t\toutlineLevelRow:opts.sheetFormat.outlineLevelRow||'7'\n\t}));\n\n\tif(ws['!cols'] != null && ws['!cols'].length > 0) o[o.length] = (write_ws_xml_cols(ws, ws['!cols']));\n\n\to[sidx = o.length] = '';\n\tws['!links'] = [];\n\tif(ws['!ref'] != null) {\n\t\trdata = write_ws_xml_data(ws, opts, idx, wb, rels);\n\t\tif(rdata.length > 0) o[o.length] = (rdata);\n\t}\n\tif(o.length>sidx+1) { o[o.length] = (''); o[sidx]=o[sidx].replace(\"/>\",\">\"); }\n\n\t/* sheetCalcPr */\n\n\tif(ws['!protect']) o[o.length] = write_ws_xml_protection(ws['!protect']);\n\n\t/* protectedRanges */\n\t/* scenarios */\n\n\tif(ws['!autofilter'] != null) o[o.length] = write_ws_xml_autofilter(ws['!autofilter'], ws, wb, idx);\n\n\t/* sortState */\n\t/* dataConsolidate */\n\t/* customSheetViews */\n\n\tif(ws['!merges'] != null && ws['!merges'].length > 0) o[o.length] = (write_ws_xml_merges(ws['!merges']));\n\n\t/* phoneticPr */\n\t/* conditionalFormatting */\n\t/* dataValidations */\n\n\tvar relc = -1, rel, rId = -1;\n\tif(/*::(*/ws['!links']/*::||[])*/.length > 0) {\n\t\to[o.length] = \"\";\n\t\t/*::(*/ws['!links']/*::||[])*/.forEach(function(l) {\n\t\t\tif(!l[1].Target) return;\n\t\t\trel = ({\"ref\":l[0]}/*:any*/);\n\t\t\tif(l[1].Target.charAt(0) != \"#\") {\n\t\t\t\trId = add_rels(rels, -1, escapexml(l[1].Target).replace(/#[\\s\\S]*$/, \"\"), RELS.HLINK);\n\t\t\t\trel[\"r:id\"] = \"rId\"+rId;\n\t\t\t}\n\t\t\tif((relc = l[1].Target.indexOf(\"#\")) > -1) rel.location = escapexml(l[1].Target.slice(relc+1));\n\t\t\tif(l[1].Tooltip) rel.tooltip = escapexml(l[1].Tooltip);\n\t\t\trel.display = l[1].display;\n\t\t\to[o.length] = writextag(\"hyperlink\",null,rel);\n\t\t});\n\t\to[o.length] = \"\";\n\t}\n\tdelete ws['!links'];\n\n\t/* printOptions */\n\n\tif(ws['!margins'] != null) o[o.length] = write_ws_xml_margins(ws['!margins']);\n\n\t/* pageSetup */\n\t/* headerFooter */\n\t/* rowBreaks */\n\t/* colBreaks */\n\t/* customProperties */\n\t/* cellWatches */\n\n\tif(!opts || opts.ignoreEC || (opts.ignoreEC == (void 0))) o[o.length] = writetag(\"ignoredErrors\", writextag(\"ignoredError\", null, {numberStoredAsText:1, sqref:ref}));\n\n\t/* smartTags */\n\n\tif(_drawing.length > 0) {\n\t\trId = add_rels(rels, -1, \"../drawings/drawing\" + (idx+1) + \".xml\", RELS.DRAW);\n\t\to[o.length] = writextag(\"drawing\", null, {\"r:id\":\"rId\" + rId});\n\t\tws['!drawing'] = _drawing;\n\t}\n\n\tif(ws['!comments'].length > 0) {\n\t\trId = add_rels(rels, -1, \"../drawings/vmlDrawing\" + (idx+1) + \".vml\", RELS.VML);\n\t\to[o.length] = writextag(\"legacyDrawing\", null, {\"r:id\":\"rId\" + rId});\n\t\tws['!legacy'] = rId;\n\t}\n\n\t/* legacyDrawingHF */\n\t/* picture */\n\t/* oleObjects */\n\t/* controls */\n\t/* webPublishItems */\n\t/* tableParts */\n\t/* extLst */\n\n\tif(o.length>1) { o[o.length] = (''); o[1]=o[1].replace(\"/>\",\">\"); }\n\treturn o.join(\"\");\n}\n\n/* [MS-XLSB] 2.4.726 BrtRowHdr */\nfunction parse_BrtRowHdr(data, length) {\n\tvar z = ({}/*:any*/);\n\tvar tgt = data.l + length;\n\tz.r = data.read_shift(4);\n\tdata.l += 4; // TODO: ixfe\n\tvar miyRw = data.read_shift(2);\n\tdata.l += 1; // TODO: top/bot padding\n\tvar flags = data.read_shift(1);\n\tdata.l = tgt;\n\tif(flags & 0x07) z.level = flags & 0x07;\n\tif(flags & 0x10) z.hidden = true;\n\tif(flags & 0x20) z.hpt = miyRw / 20;\n\treturn z;\n}\nfunction write_BrtRowHdr(R/*:number*/, range, ws) {\n\tvar o = new_buf(17+8*16);\n\tvar row = (ws['!rows']||[])[R]||{};\n\to.write_shift(4, R);\n\n\to.write_shift(4, 0); /* TODO: ixfe */\n\n\tvar miyRw = 0x0140;\n\tif(row.hpx) miyRw = px2pt(row.hpx) * 20;\n\telse if(row.hpt) miyRw = row.hpt * 20;\n\to.write_shift(2, miyRw);\n\n\to.write_shift(1, 0); /* top/bot padding */\n\n\tvar flags = 0x0;\n\tif(row.level) flags |= row.level;\n\tif(row.hidden) flags |= 0x10;\n\tif(row.hpx || row.hpt) flags |= 0x20;\n\to.write_shift(1, flags);\n\n\to.write_shift(1, 0); /* phonetic guide */\n\n\t/* [MS-XLSB] 2.5.8 BrtColSpan explains the mechanism */\n\tvar ncolspan = 0, lcs = o.l;\n\to.l += 4;\n\n\tvar caddr = {r:R, c:0};\n\tvar dense = ws[\"!data\"] != null;\n\tfor(var i = 0; i < 16; ++i) {\n\t\tif((range.s.c > ((i+1) << 10)) || (range.e.c < (i << 10))) continue;\n\t\tvar first = -1, last = -1;\n\t\tfor(var j = (i<<10); j < ((i+1)<<10); ++j) {\n\t\t\tcaddr.c = j;\n\t\t\tvar cell = dense ? (ws[\"!data\"][caddr.r]||[])[caddr.c] : ws[encode_cell(caddr)];\n\t\t\tif(cell) { if(first < 0) first = j; last = j; }\n\t\t}\n\t\tif(first < 0) continue;\n\t\t++ncolspan;\n\t\to.write_shift(4, first);\n\t\to.write_shift(4, last);\n\t}\n\n\tvar l = o.l;\n\to.l = lcs;\n\to.write_shift(4, ncolspan);\n\to.l = l;\n\n\treturn o.length > o.l ? o.slice(0, o.l) : o;\n}\nfunction write_row_header(ba, ws, range, R) {\n\tvar o = write_BrtRowHdr(R, range, ws);\n\tif((o.length > 17) || (ws['!rows']||[])[R]) write_record(ba, 0x0000 /* BrtRowHdr */, o);\n}\n\n/* [MS-XLSB] 2.4.820 BrtWsDim */\nvar parse_BrtWsDim = parse_UncheckedRfX;\nvar write_BrtWsDim = write_UncheckedRfX;\n\n/* [MS-XLSB] 2.4.821 BrtWsFmtInfo */\nfunction parse_BrtWsFmtInfo(/*::data, length*/) {\n}\n//function write_BrtWsFmtInfo(ws, o) { }\n\n/* [MS-XLSB] 2.4.823 BrtWsProp */\nfunction parse_BrtWsProp(data, length) {\n\tvar z = {};\n\tvar f = data[data.l]; ++data.l;\n\tz.above = !(f & 0x40);\n\tz.left = !(f & 0x80);\n\t/* TODO: pull flags */\n\tdata.l += 18;\n\tz.name = parse_XLSBCodeName(data, length - 19);\n\treturn z;\n}\nfunction write_BrtWsProp(str, outl, o) {\n\tif(o == null) o = new_buf(84+4*str.length);\n\tvar f = 0xC0;\n\tif(outl) {\n\t\tif(outl.above) f &= ~0x40;\n\t\tif(outl.left) f &= ~0x80;\n\t}\n\to.write_shift(1, f);\n\tfor(var i = 1; i < 3; ++i) o.write_shift(1,0);\n\twrite_BrtColor({auto:1}, o);\n\to.write_shift(-4,-1);\n\to.write_shift(-4,-1);\n\twrite_XLSBCodeName(str, o);\n\treturn o.slice(0, o.l);\n}\n\n/* [MS-XLSB] 2.4.306 BrtCellBlank */\nfunction parse_BrtCellBlank(data) {\n\tvar cell = parse_XLSBCell(data);\n\treturn [cell];\n}\nfunction write_BrtCellBlank(cell, ncell, o) {\n\tif(o == null) o = new_buf(8);\n\treturn write_XLSBCell(ncell, o);\n}\nfunction parse_BrtShortBlank(data) {\n\tvar cell = parse_XLSBShortCell(data);\n\treturn [cell];\n}\nfunction write_BrtShortBlank(cell, ncell, o) {\n\tif(o == null) o = new_buf(4);\n\treturn write_XLSBShortCell(ncell, o);\n}\n\n/* [MS-XLSB] 2.4.307 BrtCellBool */\nfunction parse_BrtCellBool(data) {\n\tvar cell = parse_XLSBCell(data);\n\tvar fBool = data.read_shift(1);\n\treturn [cell, fBool, 'b'];\n}\nfunction write_BrtCellBool(cell, ncell, o) {\n\tif(o == null) o = new_buf(9);\n\twrite_XLSBCell(ncell, o);\n\to.write_shift(1, cell.v ? 1 : 0);\n\treturn o;\n}\nfunction parse_BrtShortBool(data) {\n\tvar cell = parse_XLSBShortCell(data);\n\tvar fBool = data.read_shift(1);\n\treturn [cell, fBool, 'b'];\n}\nfunction write_BrtShortBool(cell, ncell, o) {\n\tif(o == null) o = new_buf(5);\n\twrite_XLSBShortCell(ncell, o);\n\to.write_shift(1, cell.v ? 1 : 0);\n\treturn o;\n}\n\n/* [MS-XLSB] 2.4.308 BrtCellError */\nfunction parse_BrtCellError(data) {\n\tvar cell = parse_XLSBCell(data);\n\tvar bError = data.read_shift(1);\n\treturn [cell, bError, 'e'];\n}\nfunction write_BrtCellError(cell, ncell, o) {\n\tif(o == null) o = new_buf(9);\n\twrite_XLSBCell(ncell, o);\n\to.write_shift(1, cell.v);\n\treturn o;\n}\nfunction parse_BrtShortError(data) {\n\tvar cell = parse_XLSBShortCell(data);\n\tvar bError = data.read_shift(1);\n\treturn [cell, bError, 'e'];\n}\nfunction write_BrtShortError(cell, ncell, o) {\n\tif(o == null) o = new_buf(8);\n\twrite_XLSBShortCell(ncell, o);\n\to.write_shift(1, cell.v);\n\to.write_shift(2, 0);\n\to.write_shift(1, 0);\n\treturn o;\n}\n\n\n/* [MS-XLSB] 2.4.311 BrtCellIsst */\nfunction parse_BrtCellIsst(data) {\n\tvar cell = parse_XLSBCell(data);\n\tvar isst = data.read_shift(4);\n\treturn [cell, isst, 's'];\n}\nfunction write_BrtCellIsst(cell, ncell, o) {\n\tif(o == null) o = new_buf(12);\n\twrite_XLSBCell(ncell, o);\n\to.write_shift(4, ncell.v);\n\treturn o;\n}\nfunction parse_BrtShortIsst(data) {\n\tvar cell = parse_XLSBShortCell(data);\n\tvar isst = data.read_shift(4);\n\treturn [cell, isst, 's'];\n}\nfunction write_BrtShortIsst(cell, ncell, o) {\n\tif(o == null) o = new_buf(8);\n\twrite_XLSBShortCell(ncell, o);\n\to.write_shift(4, ncell.v);\n\treturn o;\n}\n\n/* [MS-XLSB] 2.4.313 BrtCellReal */\nfunction parse_BrtCellReal(data) {\n\tvar cell = parse_XLSBCell(data);\n\tvar value = parse_Xnum(data);\n\treturn [cell, value, 'n'];\n}\nfunction write_BrtCellReal(cell, ncell, o) {\n\tif(o == null) o = new_buf(16);\n\twrite_XLSBCell(ncell, o);\n\twrite_Xnum(cell.v, o);\n\treturn o;\n}\nfunction parse_BrtShortReal(data) {\n\tvar cell = parse_XLSBShortCell(data);\n\tvar value = parse_Xnum(data);\n\treturn [cell, value, 'n'];\n}\nfunction write_BrtShortReal(cell, ncell, o) {\n\tif(o == null) o = new_buf(12);\n\twrite_XLSBShortCell(ncell, o);\n\twrite_Xnum(cell.v, o);\n\treturn o;\n}\n\n/* [MS-XLSB] 2.4.314 BrtCellRk */\nfunction parse_BrtCellRk(data) {\n\tvar cell = parse_XLSBCell(data);\n\tvar value = parse_RkNumber(data);\n\treturn [cell, value, 'n'];\n}\nfunction write_BrtCellRk(cell, ncell, o) {\n\tif(o == null) o = new_buf(12);\n\twrite_XLSBCell(ncell, o);\n\twrite_RkNumber(cell.v, o);\n\treturn o;\n}\nfunction parse_BrtShortRk(data) {\n\tvar cell = parse_XLSBShortCell(data);\n\tvar value = parse_RkNumber(data);\n\treturn [cell, value, 'n'];\n}\nfunction write_BrtShortRk(cell, ncell, o) {\n\tif(o == null) o = new_buf(8);\n\twrite_XLSBShortCell(ncell, o);\n\twrite_RkNumber(cell.v, o);\n\treturn o;\n}\n\n/* [MS-XLSB] 2.4.323 BrtCellRString */\nfunction parse_BrtCellRString(data) {\n\tvar cell = parse_XLSBCell(data);\n\tvar value = parse_RichStr(data);\n\treturn [cell, value, 'is'];\n}\n\n/* [MS-XLSB] 2.4.317 BrtCellSt */\nfunction parse_BrtCellSt(data) {\n\tvar cell = parse_XLSBCell(data);\n\tvar value = parse_XLWideString(data);\n\treturn [cell, value, 'str'];\n}\nfunction write_BrtCellSt(cell, ncell, o) {\n\tvar data = cell.v == null ? \"\" : String(cell.v);\n\tif(o == null) o = new_buf(12 + 4 * cell.v.length);\n\twrite_XLSBCell(ncell, o);\n\twrite_XLWideString(data, o);\n\treturn o.length > o.l ? o.slice(0, o.l) : o;\n}\nfunction parse_BrtShortSt(data) {\n\tvar cell = parse_XLSBShortCell(data);\n\tvar value = parse_XLWideString(data);\n\treturn [cell, value, 'str'];\n}\nfunction write_BrtShortSt(cell, ncell, o) {\n\tvar data = cell.v == null ? \"\" : String(cell.v);\n\tif(o == null) o = new_buf(8 + 4 * data.length);\n\twrite_XLSBShortCell(ncell, o);\n\twrite_XLWideString(data, o);\n\treturn o.length > o.l ? o.slice(0, o.l) : o;\n}\n\n/* [MS-XLSB] 2.4.653 BrtFmlaBool */\nfunction parse_BrtFmlaBool(data, length, opts) {\n\tvar end = data.l + length;\n\tvar cell = parse_XLSBCell(data);\n\tcell.r = opts['!row'];\n\tvar value = data.read_shift(1);\n\tvar o = [cell, value, 'b'];\n\tif(opts.cellFormula) {\n\t\tdata.l += 2;\n\t\tvar formula = parse_XLSBCellParsedFormula(data, end - data.l, opts);\n\t\to[3] = stringify_formula(formula, null/*range*/, cell, opts.supbooks, opts);/* TODO */\n\t}\n\telse data.l = end;\n\treturn o;\n}\n\n/* [MS-XLSB] 2.4.654 BrtFmlaError */\nfunction parse_BrtFmlaError(data, length, opts) {\n\tvar end = data.l + length;\n\tvar cell = parse_XLSBCell(data);\n\tcell.r = opts['!row'];\n\tvar value = data.read_shift(1);\n\tvar o = [cell, value, 'e'];\n\tif(opts.cellFormula) {\n\t\tdata.l += 2;\n\t\tvar formula = parse_XLSBCellParsedFormula(data, end - data.l, opts);\n\t\to[3] = stringify_formula(formula, null/*range*/, cell, opts.supbooks, opts);/* TODO */\n\t}\n\telse data.l = end;\n\treturn o;\n}\n\n/* [MS-XLSB] 2.4.655 BrtFmlaNum */\nfunction parse_BrtFmlaNum(data, length, opts) {\n\tvar end = data.l + length;\n\tvar cell = parse_XLSBCell(data);\n\tcell.r = opts['!row'];\n\tvar value = parse_Xnum(data);\n\tvar o = [cell, value, 'n'];\n\tif(opts.cellFormula) {\n\t\tdata.l += 2;\n\t\tvar formula = parse_XLSBCellParsedFormula(data, end - data.l, opts);\n\t\to[3] = stringify_formula(formula, null/*range*/, cell, opts.supbooks, opts);/* TODO */\n\t}\n\telse data.l = end;\n\treturn o;\n}\n\n/* [MS-XLSB] 2.4.656 BrtFmlaString */\nfunction parse_BrtFmlaString(data, length, opts) {\n\tvar end = data.l + length;\n\tvar cell = parse_XLSBCell(data);\n\tcell.r = opts['!row'];\n\tvar value = parse_XLWideString(data);\n\tvar o = [cell, value, 'str'];\n\tif(opts.cellFormula) {\n\t\tdata.l += 2;\n\t\tvar formula = parse_XLSBCellParsedFormula(data, end - data.l, opts);\n\t\to[3] = stringify_formula(formula, null/*range*/, cell, opts.supbooks, opts);/* TODO */\n\t}\n\telse data.l = end;\n\treturn o;\n}\n\n/* [MS-XLSB] 2.4.682 BrtMergeCell */\nvar parse_BrtMergeCell = parse_UncheckedRfX;\nvar write_BrtMergeCell = write_UncheckedRfX;\n/* [MS-XLSB] 2.4.107 BrtBeginMergeCells */\nfunction write_BrtBeginMergeCells(cnt, o) {\n\tif(o == null) o = new_buf(4);\n\to.write_shift(4, cnt);\n\treturn o;\n}\n\n/* [MS-XLSB] 2.4.662 BrtHLink */\nfunction parse_BrtHLink(data, length/*::, opts*/) {\n\tvar end = data.l + length;\n\tvar rfx = parse_UncheckedRfX(data, 16);\n\tvar relId = parse_XLNullableWideString(data);\n\tvar loc = parse_XLWideString(data);\n\tvar tooltip = parse_XLWideString(data);\n\tvar display = parse_XLWideString(data);\n\tdata.l = end;\n\tvar o = ({rfx:rfx, relId:relId, loc:loc, display:display}/*:any*/);\n\tif(tooltip) o.Tooltip = tooltip;\n\treturn o;\n}\nfunction write_BrtHLink(l, rId) {\n\tvar o = new_buf(50+4*(l[1].Target.length + (l[1].Tooltip || \"\").length));\n\twrite_UncheckedRfX({s:decode_cell(l[0]), e:decode_cell(l[0])}, o);\n\twrite_RelID(\"rId\" + rId, o);\n\tvar locidx = l[1].Target.indexOf(\"#\");\n\tvar loc = locidx == -1 ? \"\" : l[1].Target.slice(locidx+1);\n\twrite_XLWideString(loc || \"\", o);\n\twrite_XLWideString(l[1].Tooltip || \"\", o);\n\twrite_XLWideString(\"\", o);\n\treturn o.slice(0, o.l);\n}\n\n/* [MS-XLSB] 2.4.692 BrtPane */\nfunction parse_BrtPane(/*data, length, opts*/) {\n}\n\n/* [MS-XLSB] 2.4.6 BrtArrFmla */\nfunction parse_BrtArrFmla(data, length, opts) {\n\tvar end = data.l + length;\n\tvar rfx = parse_RfX(data, 16);\n\tvar fAlwaysCalc = data.read_shift(1);\n\tvar o = [rfx]; o[2] = fAlwaysCalc;\n\tif(opts.cellFormula) {\n\t\tvar formula = parse_XLSBArrayParsedFormula(data, end - data.l, opts);\n\t\to[1] = formula;\n\t} else data.l = end;\n\treturn o;\n}\n\n/* [MS-XLSB] 2.4.750 BrtShrFmla */\nfunction parse_BrtShrFmla(data, length, opts) {\n\tvar end = data.l + length;\n\tvar rfx = parse_UncheckedRfX(data, 16);\n\tvar o = [rfx];\n\tif(opts.cellFormula) {\n\t\tvar formula = parse_XLSBSharedParsedFormula(data, end - data.l, opts);\n\t\to[1] = formula;\n\t\tdata.l = end;\n\t} else data.l = end;\n\treturn o;\n}\n\n/* [MS-XLSB] 2.4.323 BrtColInfo */\n/* TODO: once XLS ColInfo is set, combine the functions */\nfunction write_BrtColInfo(C/*:number*/, col, o) {\n\tif(o == null) o = new_buf(18);\n\tvar p = col_obj_w(C, col);\n\to.write_shift(-4, C);\n\to.write_shift(-4, C);\n\to.write_shift(4, (p.width || 10) * 256);\n\to.write_shift(4, 0/*ixfe*/); // style\n\tvar flags = 0;\n\tif(col.hidden) flags |= 0x01;\n\tif(typeof p.width == 'number') flags |= 0x02;\n\tif(col.level) flags |= (col.level << 8);\n\to.write_shift(2, flags); // bit flag\n\treturn o;\n}\n\n/* [MS-XLSB] 2.4.678 BrtMargins */\nvar BrtMarginKeys = [\"left\",\"right\",\"top\",\"bottom\",\"header\",\"footer\"];\nfunction parse_BrtMargins(data/*::, length, opts*/)/*:Margins*/ {\n\tvar margins = ({}/*:any*/);\n\tBrtMarginKeys.forEach(function(k) { margins[k] = parse_Xnum(data, 8); });\n\treturn margins;\n}\nfunction write_BrtMargins(margins/*:Margins*/, o) {\n\tif(o == null) o = new_buf(6*8);\n\tdefault_margins(margins);\n\tBrtMarginKeys.forEach(function(k) { write_Xnum((margins/*:any*/)[k], o); });\n\treturn o;\n}\n\n/* [MS-XLSB] 2.4.299 BrtBeginWsView */\nfunction parse_BrtBeginWsView(data/*::, length, opts*/) {\n\tvar f = data.read_shift(2);\n\tdata.l += 28;\n\treturn { RTL: f & 0x20 };\n}\nfunction write_BrtBeginWsView(ws, Workbook, o) {\n\tif(o == null) o = new_buf(30);\n\tvar f = 0x39c;\n\tif((((Workbook||{}).Views||[])[0]||{}).RTL) f |= 0x20;\n\to.write_shift(2, f); // bit flag\n\to.write_shift(4, 0);\n\to.write_shift(4, 0); // view first row\n\to.write_shift(4, 0); // view first col\n\to.write_shift(1, 0); // gridline color ICV\n\to.write_shift(1, 0);\n\to.write_shift(2, 0);\n\to.write_shift(2, 100); // zoom scale\n\to.write_shift(2, 0);\n\to.write_shift(2, 0);\n\to.write_shift(2, 0);\n\to.write_shift(4, 0); // workbook view id\n\treturn o;\n}\n\n/* [MS-XLSB] 2.4.309 BrtCellIgnoreEC */\nfunction write_BrtCellIgnoreEC(ref) {\n\tvar o = new_buf(24);\n\to.write_shift(4, 4);\n\to.write_shift(4, 1);\n\twrite_UncheckedRfX(ref, o);\n\treturn o;\n}\n\n/* [MS-XLSB] 2.4.748 BrtSheetProtection */\nfunction write_BrtSheetProtection(sp, o) {\n\tif(o == null) o = new_buf(16*4+2);\n\to.write_shift(2, sp.password ? crypto_CreatePasswordVerifier_Method1(sp.password) : 0);\n\to.write_shift(4, 1); // this record should not be written if no protection\n\t[\n\t\t[\"objects\", false], // fObjects\n\t\t[\"scenarios\", false], // fScenarios\n\t\t[\"formatCells\", true], // fFormatCells\n\t\t[\"formatColumns\", true], // fFormatColumns\n\t\t[\"formatRows\", true], // fFormatRows\n\t\t[\"insertColumns\", true], // fInsertColumns\n\t\t[\"insertRows\", true], // fInsertRows\n\t\t[\"insertHyperlinks\", true], // fInsertHyperlinks\n\t\t[\"deleteColumns\", true], // fDeleteColumns\n\t\t[\"deleteRows\", true], // fDeleteRows\n\t\t[\"selectLockedCells\", false], // fSelLockedCells\n\t\t[\"sort\", true], // fSort\n\t\t[\"autoFilter\", true], // fAutoFilter\n\t\t[\"pivotTables\", true], // fPivotTables\n\t\t[\"selectUnlockedCells\", false] // fSelUnlockedCells\n\t].forEach(function(n) {\n\t\t/*:: if(o == null) throw \"unreachable\"; */\n\t\tif(n[1]) o.write_shift(4, sp[n[0]] != null && !sp[n[0]] ? 1 : 0);\n\t\telse o.write_shift(4, sp[n[0]] != null && sp[n[0]] ? 0 : 1);\n\t});\n\treturn o;\n}\n\nfunction parse_BrtDVal(/*data, length, opts*/) {\n}\nfunction parse_BrtDVal14(/*data, length, opts*/) {\n}\n/* [MS-XLSB] 2.1.7.61 Worksheet */\nfunction parse_ws_bin(data, _opts, idx, rels, wb/*:WBWBProps*/, themes, styles)/*:Worksheet*/ {\n\tif(!data) return data;\n\tvar opts = _opts || {};\n\tif(!rels) rels = {'!id':{}};\n\tif(DENSE != null && opts.dense == null) opts.dense = DENSE;\n\tvar s/*:Worksheet*/ = ({}); if(opts.dense) s[\"!data\"] = [];\n\n\tvar ref;\n\tvar refguess = {s: {r:2000000, c:2000000}, e: {r:0, c:0} };\n\n\tvar state/*:Array*/ = [];\n\tvar pass = false, end = false;\n\tvar row, p, cf, R, C, addr, sstr, rr, cell/*:Cell*/;\n\tvar merges/*:Array*/ = [];\n\topts.biff = 12;\n\topts['!row'] = 0;\n\n\tvar ai = 0, af = false;\n\n\tvar arrayf/*:Array<[Range, string]>*/ = [];\n\tvar sharedf = {};\n\tvar supbooks = opts.supbooks || /*::(*/wb/*:: :any)*/.supbooks || ([[]]/*:any*/);\n\tsupbooks.sharedf = sharedf;\n\tsupbooks.arrayf = arrayf;\n\tsupbooks.SheetNames = wb.SheetNames || wb.Sheets.map(function(x) { return x.name; });\n\tif(!opts.supbooks) {\n\t\topts.supbooks = supbooks;\n\t\tif(wb.Names) for(var i = 0; i < wb.Names.length; ++i) supbooks[0][i+1] = wb.Names[i];\n\t}\n\n\tvar colinfo/*:Array*/ = [], rowinfo/*:Array*/ = [];\n\tvar seencol = false;\n\n\tXLSBRecordEnum[0x0010] = { n:\"BrtShortReal\", f:parse_BrtShortReal };\n\n\tvar cm, vm;\n\tvar date1904 = 1462 * +!!((wb||{}).WBProps||{}).date1904;\n\n\trecordhopper(data, function ws_parse(val, RR, RT) {\n\t\tif(end) return;\n\t\tswitch(RT) {\n\t\t\tcase 0x0094: /* 'BrtWsDim' */\n\t\t\t\tref = val; break;\n\t\t\tcase 0x0000: /* 'BrtRowHdr' */\n\t\t\t\trow = val;\n\t\t\t\tif(opts.sheetRows && opts.sheetRows <= row.r) end=true;\n\t\t\t\trr = encode_row(R = row.r);\n\t\t\t\topts['!row'] = row.r;\n\t\t\t\tif(val.hidden || val.hpt || val.level != null) {\n\t\t\t\t\tif(val.hpt) val.hpx = pt2px(val.hpt);\n\t\t\t\t\trowinfo[val.r] = val;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 0x0002: /* 'BrtCellRk' */\n\t\t\tcase 0x0003: /* 'BrtCellError' */\n\t\t\tcase 0x0004: /* 'BrtCellBool' */\n\t\t\tcase 0x0005: /* 'BrtCellReal' */\n\t\t\tcase 0x0006: /* 'BrtCellSt' */\n\t\t\tcase 0x0007: /* 'BrtCellIsst' */\n\t\t\tcase 0x0008: /* 'BrtFmlaString' */\n\t\t\tcase 0x0009: /* 'BrtFmlaNum' */\n\t\t\tcase 0x000A: /* 'BrtFmlaBool' */\n\t\t\tcase 0x000B: /* 'BrtFmlaError' */\n\t\t\tcase 0x000D: /* 'BrtShortRk' */\n\t\t\tcase 0x000E: /* 'BrtShortError' */\n\t\t\tcase 0x000F: /* 'BrtShortBool' */\n\t\t\tcase 0x0010: /* 'BrtShortReal' */\n\t\t\tcase 0x0011: /* 'BrtShortSt' */\n\t\t\tcase 0x0012: /* 'BrtShortIsst' */\n\t\t\tcase 0x003E: /* 'BrtCellRString' */\n\t\t\t\tp = ({t:val[2]}/*:any*/);\n\t\t\t\tswitch(val[2]) {\n\t\t\t\t\tcase 'n': p.v = val[1]; break;\n\t\t\t\t\tcase 's': sstr = strs[val[1]]; p.v = sstr.t; p.r = sstr.r; break;\n\t\t\t\t\tcase 'b': p.v = val[1] ? true : false; break;\n\t\t\t\t\tcase 'e': p.v = val[1]; if(opts.cellText !== false) p.w = BErr[p.v]; break;\n\t\t\t\t\tcase 'str': p.t = 's'; p.v = val[1]; break;\n\t\t\t\t\tcase 'is': p.t = 's'; p.v = val[1].t; break;\n\t\t\t\t}\n\t\t\t\tif((cf = styles.CellXf[val[0].iStyleRef])) safe_format(p,cf.numFmtId,null,opts, themes, styles, date1904>0);\n\t\t\t\tC = val[0].c == -1 ? C + 1 : val[0].c;\n\t\t\t\tif(opts.dense) { if(!s[\"!data\"][R]) s[\"!data\"][R] = []; s[\"!data\"][R][C] = p; }\n\t\t\t\telse s[encode_col(C) + rr] = p;\n\t\t\t\tif(opts.cellFormula) {\n\t\t\t\t\taf = false;\n\t\t\t\t\tfor(ai = 0; ai < arrayf.length; ++ai) {\n\t\t\t\t\t\tvar aii = arrayf[ai];\n\t\t\t\t\t\tif(row.r >= aii[0].s.r && row.r <= aii[0].e.r)\n\t\t\t\t\t\t\tif(C >= aii[0].s.c && C <= aii[0].e.c) {\n\t\t\t\t\t\t\t\tp.F = encode_range(aii[0]); af = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(!af && val.length > 3) p.f = val[3];\n\t\t\t\t}\n\n\t\t\t\tif(refguess.s.r > row.r) refguess.s.r = row.r;\n\t\t\t\tif(refguess.s.c > C) refguess.s.c = C;\n\t\t\t\tif(refguess.e.r < row.r) refguess.e.r = row.r;\n\t\t\t\tif(refguess.e.c < C) refguess.e.c = C;\n\t\t\t\tif(opts.cellDates && cf && p.t == 'n' && fmt_is_date(table_fmt[cf.numFmtId])) {\n\t\t\t\t\tvar _d = SSF_parse_date_code(p.v + date1904); if(_d) { p.t = 'd'; p.v = new Date(Date.UTC(_d.y, _d.m-1,_d.d,_d.H,_d.M,_d.S,_d.u)); }\n\t\t\t\t}\n\t\t\t\tif(cm) {\n\t\t\t\t\tif(cm.type == 'XLDAPR') p.D = true;\n\t\t\t\t\tcm = void 0;\n\t\t\t\t}\n\t\t\t\tif(vm) vm = void 0;\n\t\t\t\tbreak;\n\n\t\t\tcase 0x0001: /* 'BrtCellBlank' */\n\t\t\tcase 0x000C: /* 'BrtShortBlank' */\n\t\t\t\tif(!opts.sheetStubs || pass) break;\n\t\t\t\tp = ({t:'z',v:void 0}/*:any*/);\n\t\t\t\tC = val[0].c == -1 ? C + 1 : val[0].c;\n\t\t\t\tif(opts.dense) { if(!s[\"!data\"][R]) s[\"!data\"][R] = []; s[\"!data\"][R][C] = p; }\n\t\t\t\telse s[encode_col(C) + rr] = p;\n\t\t\t\tif(refguess.s.r > row.r) refguess.s.r = row.r;\n\t\t\t\tif(refguess.s.c > C) refguess.s.c = C;\n\t\t\t\tif(refguess.e.r < row.r) refguess.e.r = row.r;\n\t\t\t\tif(refguess.e.c < C) refguess.e.c = C;\n\t\t\t\tif(cm) {\n\t\t\t\t\tif(cm.type == 'XLDAPR') p.D = true;\n\t\t\t\t\tcm = void 0;\n\t\t\t\t}\n\t\t\t\tif(vm) vm = void 0;\n\t\t\t\tbreak;\n\n\t\t\tcase 0x00B0: /* 'BrtMergeCell' */\n\t\t\t\tmerges.push(val); break;\n\n\t\t\tcase 0x0031: { /* 'BrtCellMeta' */\n\t\t\t\tcm = ((opts.xlmeta||{}).Cell||[])[val-1];\n\t\t\t} break;\n\n\t\t\tcase 0x01EE: /* 'BrtHLink' */\n\t\t\t\tvar rel = rels['!id'][val.relId];\n\t\t\t\tif(rel) {\n\t\t\t\t\tval.Target = rel.Target;\n\t\t\t\t\tif(val.loc) val.Target += \"#\"+val.loc;\n\t\t\t\t\tval.Rel = rel;\n\t\t\t\t} else if(val.relId == '') {\n\t\t\t\t\tval.Target = \"#\" + val.loc;\n\t\t\t\t}\n\t\t\t\tfor(R=val.rfx.s.r;R<=val.rfx.e.r;++R) for(C=val.rfx.s.c;C<=val.rfx.e.c;++C) {\n\t\t\t\t\tif(opts.dense) {\n\t\t\t\t\t\tif(!s[\"!data\"][R]) s[\"!data\"][R] = [];\n\t\t\t\t\t\tif(!s[\"!data\"][R][C]) s[\"!data\"][R][C] = {t:'z',v:undefined};\n\t\t\t\t\t\ts[\"!data\"][R][C].l = val;\n\t\t\t\t\t} else {\n\t\t\t\t\t\taddr = encode_col(C) + encode_row(R);\n\t\t\t\t\t\tif(!s[addr]) s[addr] = {t:'z',v:undefined};\n\t\t\t\t\t\ts[addr].l = val;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 0x01AA: /* 'BrtArrFmla' */\n\t\t\t\tif(!opts.cellFormula) break;\n\t\t\t\tarrayf.push(val);\n\t\t\t\tcell = ((opts.dense ? s[\"!data\"][R][C] : s[encode_col(C) + rr])/*:any*/);\n\t\t\t\tcell.f = stringify_formula(val[1], refguess, {r:row.r, c:C}, supbooks, opts);\n\t\t\t\tcell.F = encode_range(val[0]);\n\t\t\t\tbreak;\n\t\t\tcase 0x01AB: /* 'BrtShrFmla' */\n\t\t\t\tif(!opts.cellFormula) break;\n\t\t\t\tsharedf[encode_cell(val[0].s)] = val[1];\n\t\t\t\tcell = (opts.dense ? s[\"!data\"][R][C] : s[encode_col(C) + rr]);\n\t\t\t\tcell.f = stringify_formula(val[1], refguess, {r:row.r, c:C}, supbooks, opts);\n\t\t\t\tbreak;\n\n\t\t\t/* identical to 'ColInfo' in XLS */\n\t\t\tcase 0x003C: /* 'BrtColInfo' */\n\t\t\t\tif(!opts.cellStyles) break;\n\t\t\t\twhile(val.e >= val.s) {\n\t\t\t\t\tcolinfo[val.e--] = { width: val.w/256, hidden: !!(val.flags & 0x01), level: val.level };\n\t\t\t\t\tif(!seencol) { seencol = true; find_mdw_colw(val.w/256); }\n\t\t\t\t\tprocess_col(colinfo[val.e+1]);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 0x0227: /* 'BrtLegacyDrawing' */\n\t\t\t\tif(val) s[\"!legrel\"] = val;\n\t\t\t\tbreak;\n\n\t\t\tcase 0x00A1: /* 'BrtBeginAFilter' */\n\t\t\t\ts['!autofilter'] = { ref:encode_range(val) };\n\t\t\t\tbreak;\n\n\t\t\tcase 0x01DC: /* 'BrtMargins' */\n\t\t\t\ts['!margins'] = val;\n\t\t\t\tbreak;\n\n\t\t\tcase 0x0093: /* 'BrtWsProp' */\n\t\t\t\tif(!wb.Sheets[idx]) wb.Sheets[idx] = {};\n\t\t\t\tif(val.name) wb.Sheets[idx].CodeName = val.name;\n\t\t\t\tif(val.above || val.left) s['!outline'] = { above: val.above, left: val.left };\n\t\t\t\tbreak;\n\n\t\t\tcase 0x0089: /* 'BrtBeginWsView' */\n\t\t\t\tif(!wb.Views) wb.Views = [{}];\n\t\t\t\tif(!wb.Views[0]) wb.Views[0] = {};\n\t\t\t\tif(val.RTL) wb.Views[0].RTL = true;\n\t\t\t\tbreak;\n\n\t\t\tcase 0x01E5: /* 'BrtWsFmtInfo' */\n\t\t\t\tbreak;\n\n\t\t\tcase 0x0040: /* 'BrtDVal' */\n\t\t\tcase 0x041D: /* 'BrtDVal14' */\n\t\t\t\tbreak;\n\n\t\t\tcase 0x0097: /* 'BrtPane' */\n\t\t\t\tbreak;\n\t\t\tcase 0x0098: /* 'BrtSel' */\n\t\t\tcase 0x00AF: /* 'BrtAFilterDateGroupItem' */\n\t\t\tcase 0x0284: /* 'BrtActiveX' */\n\t\t\tcase 0x0271: /* 'BrtBigName' */\n\t\t\tcase 0x0232: /* 'BrtBkHim' */\n\t\t\tcase 0x018C: /* 'BrtBrk' */\n\t\t\tcase 0x0458: /* 'BrtCFIcon' */\n\t\t\tcase 0x047A: /* 'BrtCFRuleExt' */\n\t\t\tcase 0x01D7: /* 'BrtCFVO' */\n\t\t\tcase 0x041A: /* 'BrtCFVO14' */\n\t\t\tcase 0x0289: /* 'BrtCellIgnoreEC' */\n\t\t\tcase 0x0451: /* 'BrtCellIgnoreEC14' */\n\t\t\tcase 0x024D: /* 'BrtCellSmartTagProperty' */\n\t\t\tcase 0x025F: /* 'BrtCellWatch' */\n\t\t\tcase 0x0234: /* 'BrtColor' */\n\t\t\tcase 0x041F: /* 'BrtColor14' */\n\t\t\tcase 0x00A8: /* 'BrtColorFilter' */\n\t\t\tcase 0x00AE: /* 'BrtCustomFilter' */\n\t\t\tcase 0x049C: /* 'BrtCustomFilter14' */\n\t\t\tcase 0x01F3: /* 'BrtDRef' */\n\t\t\tcase 0x01FB: /* 'BrtDXF' */\n\t\t\tcase 0x0226: /* 'BrtDrawing' */\n\t\t\tcase 0x00AB: /* 'BrtDynamicFilter' */\n\t\t\tcase 0x00A7: /* 'BrtFilter' */\n\t\t\tcase 0x0499: /* 'BrtFilter14' */\n\t\t\tcase 0x00A9: /* 'BrtIconFilter' */\n\t\t\tcase 0x049D: /* 'BrtIconFilter14' */\n\t\t\tcase 0x0228: /* 'BrtLegacyDrawingHF' */\n\t\t\tcase 0x0295: /* 'BrtListPart' */\n\t\t\tcase 0x027F: /* 'BrtOleObject' */\n\t\t\tcase 0x01DE: /* 'BrtPageSetup' */\n\t\t\tcase 0x0219: /* 'BrtPhoneticInfo' */\n\t\t\tcase 0x01DD: /* 'BrtPrintOptions' */\n\t\t\tcase 0x0218: /* 'BrtRangeProtection' */\n\t\t\tcase 0x044F: /* 'BrtRangeProtection14' */\n\t\t\tcase 0x02A8: /* 'BrtRangeProtectionIso' */\n\t\t\tcase 0x0450: /* 'BrtRangeProtectionIso14' */\n\t\t\tcase 0x0400: /* 'BrtRwDescent' */\n\t\t\tcase 0x0297: /* 'BrtSheetCalcProp' */\n\t\t\tcase 0x0217: /* 'BrtSheetProtection' */\n\t\t\tcase 0x02A6: /* 'BrtSheetProtectionIso' */\n\t\t\tcase 0x01F8: /* 'BrtSlc' */\n\t\t\tcase 0x0413: /* 'BrtSparkline' */\n\t\t\tcase 0x01AC: /* 'BrtTable' */\n\t\t\tcase 0x00AA: /* 'BrtTop10Filter' */\n\t\t\tcase 0x0C00: /* 'BrtUid' */\n\t\t\tcase 0x0032: /* 'BrtValueMeta' */\n\t\t\tcase 0x0816: /* 'BrtWebExtension' */\n\t\t\tcase 0x0415: /* 'BrtWsFmtInfoEx14' */\n\t\t\t\tbreak;\n\n\t\t\tcase 0x0023: /* 'BrtFRTBegin' */\n\t\t\t\tpass = true; break;\n\t\t\tcase 0x0024: /* 'BrtFRTEnd' */\n\t\t\t\tpass = false; break;\n\t\t\tcase 0x0025: /* 'BrtACBegin' */\n\t\t\t\tstate.push(RT); pass = true; break;\n\t\t\tcase 0x0026: /* 'BrtACEnd' */\n\t\t\t\tstate.pop(); pass = false; break;\n\n\t\t\tdefault:\n\t\t\t\tif(RR.T){/* empty */}\n\t\t\t\telse if(!pass || opts.WTF) throw new Error(\"Unexpected record 0x\" + RT.toString(16));\n\t\t}\n\t}, opts);\n\n\tdelete opts.supbooks;\n\tdelete opts['!row'];\n\n\tif(!s[\"!ref\"] && (refguess.s.r < 2000000 || ref && (ref.e.r > 0 || ref.e.c > 0 || ref.s.r > 0 || ref.s.c > 0))) s[\"!ref\"] = encode_range(ref || refguess);\n\tif(opts.sheetRows && s[\"!ref\"]) {\n\t\tvar tmpref = safe_decode_range(s[\"!ref\"]);\n\t\tif(opts.sheetRows <= +tmpref.e.r) {\n\t\t\ttmpref.e.r = opts.sheetRows - 1;\n\t\t\tif(tmpref.e.r > refguess.e.r) tmpref.e.r = refguess.e.r;\n\t\t\tif(tmpref.e.r < tmpref.s.r) tmpref.s.r = tmpref.e.r;\n\t\t\tif(tmpref.e.c > refguess.e.c) tmpref.e.c = refguess.e.c;\n\t\t\tif(tmpref.e.c < tmpref.s.c) tmpref.s.c = tmpref.e.c;\n\t\t\ts[\"!fullref\"] = s[\"!ref\"];\n\t\t\ts[\"!ref\"] = encode_range(tmpref);\n\t\t}\n\t}\n\tif(merges.length > 0) s[\"!merges\"] = merges;\n\tif(colinfo.length > 0) s[\"!cols\"] = colinfo;\n\tif(rowinfo.length > 0) s[\"!rows\"] = rowinfo;\n\tif(rels['!id'][s['!legrel']]) s['!legdrawel'] = rels['!id'][s['!legrel']];\n\treturn s;\n}\n\n/* TODO: something useful -- this is a stub */\nfunction write_ws_bin_cell(ba/*:BufArray*/, cell/*:Cell*/, R/*:number*/, C/*:number*/, opts, ws/*:Worksheet*/, last_seen/*:boolean*/, date1904/*:boolean*/)/*:boolean*/ {\n\tvar o/*:any*/ = ({r:R, c:C}/*:any*/);\n\tif(cell.c) ws['!comments'].push([encode_cell(o), cell.c]);\n\tif(cell.v === undefined) return false;\n\tvar vv = \"\";\n\tswitch(cell.t) {\n\t\tcase 'b': vv = cell.v ? \"1\" : \"0\"; break;\n\t\tcase 'd': // no BrtCellDate :(\n\t\t\tcell = dup(cell);\n\t\t\tcell.z = cell.z || table_fmt[14];\n\t\t\tcell.v = datenum(parseDate(cell.v, date1904), date1904); cell.t = 'n';\n\t\t\tbreak;\n\t\t/* falls through */\n\t\tcase 'n': case 'e': vv = ''+cell.v; break;\n\t\tdefault: vv = cell.v; break;\n\t}\n\t/* TODO: cell style */\n\to.s = get_cell_style(opts.cellXfs, cell, opts);\n\tif(cell.l) ws['!links'].push([encode_cell(o), cell.l]);\n\tswitch(cell.t) {\n\t\tcase 's': case 'str':\n\t\t\tif(opts.bookSST) {\n\t\t\t\tvv = get_sst_id(opts.Strings, (cell.v == null ? \"\" : String(cell.v)/*:any*/), opts.revStrings);\n\t\t\t\to.t = \"s\"; o.v = vv;\n\t\t\t\tif(last_seen) write_record(ba, 0x0012 /* BrtShortIsst */, write_BrtShortIsst(cell, o));\n\t\t\t\telse write_record(ba, 0x0007 /* BrtCellIsst */, write_BrtCellIsst(cell, o));\n\t\t\t} else {\n\t\t\t\to.t = \"str\";\n\t\t\t\tif(last_seen) write_record(ba, 0x0011 /* BrtShortSt */, write_BrtShortSt(cell, o));\n\t\t\t\telse write_record(ba, 0x0006 /* BrtCellSt */, write_BrtCellSt(cell, o));\n\t\t\t}\n\t\t\treturn true;\n\t\tcase 'n':\n\t\t\t/* TODO: determine threshold for Real vs RK */\n\t\t\tif(cell.v == (cell.v | 0) && cell.v > -1000 && cell.v < 1000) {\n\t\t\t\tif(last_seen) write_record(ba, 0x000D /* BrtShortRk */, write_BrtShortRk(cell, o));\n\t\t\t\telse write_record(ba, 0x0002 /* BrtCellRk */, write_BrtCellRk(cell, o));\n\t\t\t} else if(!isFinite(cell.v)) {\n\t\t\t\to.t = \"e\";\n\t\t\t\tif(isNaN(cell.v)) {\n\t\t\t\t\tif(last_seen) write_record(ba, 0x000E /* BrtShortError */, write_BrtShortError({t:\"e\", v: 0x24}, o)); // #NUM!\n\t\t\t\t\telse write_record(ba, 0x0003 /* BrtCellError */, write_BrtCellError({t:\"e\", v: 0x24}, o)); // #NUM!\n\t\t\t\t} else {\n\t\t\t\t\tif(last_seen) write_record(ba, 0x000E /* BrtShortError */, write_BrtShortError({t:\"e\", v: 0x07}, o)); // #DIV/0!\n\t\t\t\t\telse write_record(ba, 0x0003 /* BrtCellError */, write_BrtCellError({t:\"e\", v: 0x07}, o)); // #DIV/0!\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif(last_seen) write_record(ba, 0x0010 /* BrtShortReal */, write_BrtShortReal(cell, o));\n\t\t\t\telse write_record(ba, 0x0005 /* BrtCellReal */, write_BrtCellReal(cell, o));\n\t\t\t} return true;\n\t\tcase 'b':\n\t\t\to.t = \"b\";\n\t\t\tif(last_seen) write_record(ba, 0x000F /* BrtShortBool */, write_BrtShortBool(cell, o));\n\t\t\telse write_record(ba, 0x0004 /* BrtCellBool */, write_BrtCellBool(cell, o));\n\t\t\treturn true;\n\t\tcase 'e':\n\t\t\to.t = \"e\";\n\t\t\tif(last_seen) write_record(ba, 0x000E /* BrtShortError */, write_BrtShortError(cell, o));\n\t\t\telse write_record(ba, 0x0003 /* BrtCellError */, write_BrtCellError(cell, o));\n\t\t\treturn true;\n\t}\n\tif(last_seen) write_record(ba, 0x000C /* BrtShortBlank */, write_BrtShortBlank(cell, o));\n\telse write_record(ba, 0x0001 /* BrtCellBlank */, write_BrtCellBlank(cell, o));\n\treturn true;\n}\n\nfunction write_CELLTABLE(ba, ws/*:Worksheet*/, idx/*:number*/, opts, wb/*:Workbook*/) {\n\tvar range = safe_decode_range(ws['!ref'] || \"A1\"), rr = \"\", cols/*:Array*/ = [];\n\tvar date1904 = (((wb||{}).Workbook||{}).WBProps||{}).date1904;\n\twrite_record(ba, 0x0091 /* BrtBeginSheetData */);\n\tvar dense = ws[\"!data\"] != null, row = dense ? ws[\"!data\"][range.s.r] : [];\n\tvar cap = range.e.r;\n\tif(ws['!rows']) cap = Math.max(range.e.r, ws['!rows'].length - 1);\n\tfor(var R = range.s.r; R <= cap; ++R) {\n\t\trr = encode_row(R);\n\t\tif(dense) row = ws[\"!data\"][R];\n\t\t/* [ACCELLTABLE] */\n\t\t/* BrtRowHdr */\n\t\twrite_row_header(ba, ws, range, R);\n\t\tif(dense && !row) continue;\n\t\tvar last_seen = false;\n\t\tif(R <= range.e.r) for(var C = range.s.c; C <= range.e.c; ++C) {\n\t\t\t/* *16384CELL */\n\t\t\tif(R === range.s.r) cols[C] = encode_col(C);\n\t\t\tvar cell = dense ? row[C] : ws[cols[C] + rr];\n\t\t\tif(!cell) { last_seen = false; continue; }\n\t\t\t/* write cell */\n\t\t\tlast_seen = write_ws_bin_cell(ba, cell, R, C, opts, ws, last_seen, date1904);\n\t\t}\n\t}\n\twrite_record(ba, 0x0092 /* BrtEndSheetData */);\n}\n\nfunction write_MERGECELLS(ba, ws/*:Worksheet*/) {\n\tif(!ws || !ws['!merges']) return;\n\twrite_record(ba, 0x00B1 /* BrtBeginMergeCells */, write_BrtBeginMergeCells(ws['!merges'].length));\n\tws['!merges'].forEach(function(m) { write_record(ba, 0x00B0 /* BrtMergeCell */, write_BrtMergeCell(m)); });\n\twrite_record(ba, 0x00B2 /* BrtEndMergeCells */);\n}\n\nfunction write_COLINFOS(ba, ws/*:Worksheet*//*::, idx:number, opts, wb:Workbook*/) {\n\tif(!ws || !ws['!cols']) return;\n\twrite_record(ba, 0x0186 /* BrtBeginColInfos */);\n\tws['!cols'].forEach(function(m, i) { if(m) write_record(ba, 0x003C /* 'BrtColInfo' */, write_BrtColInfo(i, m)); });\n\twrite_record(ba, 0x0187 /* BrtEndColInfos */);\n}\n\nfunction write_IGNOREECS(ba, ws/*:Worksheet*/) {\n\tif(!ws || !ws['!ref']) return;\n\twrite_record(ba, 0x0288 /* BrtBeginCellIgnoreECs */);\n\twrite_record(ba, 0x0289 /* BrtCellIgnoreEC */, write_BrtCellIgnoreEC(safe_decode_range(ws['!ref'])));\n\twrite_record(ba, 0x028A /* BrtEndCellIgnoreECs */);\n}\n\nfunction write_HLINKS(ba, ws/*:Worksheet*/, rels) {\n\t/* *BrtHLink */\n\tws['!links'].forEach(function(l) {\n\t\tif(!l[1].Target) return;\n\t\tvar rId = add_rels(rels, -1, l[1].Target.replace(/#[\\s\\S]*$/, \"\"), RELS.HLINK);\n\t\twrite_record(ba, 0x01EE /* BrtHLink */, write_BrtHLink(l, rId));\n\t});\n\tdelete ws['!links'];\n}\nfunction write_LEGACYDRAWING(ba, ws/*:Worksheet*/, idx/*:number*/, rels) {\n\t/* [BrtLegacyDrawing] */\n\tif(ws['!comments'].length > 0) {\n\t\tvar rId = add_rels(rels, -1, \"../drawings/vmlDrawing\" + (idx+1) + \".vml\", RELS.VML);\n\t\twrite_record(ba, 0x0227 /* BrtLegacyDrawing */, write_RelID(\"rId\" + rId));\n\t\tws['!legacy'] = rId;\n\t}\n}\n\nfunction write_AUTOFILTER(ba, ws, wb, idx) {\n\tif(!ws['!autofilter']) return;\n\tvar data = ws['!autofilter'];\n\tvar ref = typeof data.ref === \"string\" ? data.ref : encode_range(data.ref);\n\n\t/* Update FilterDatabase defined name for the worksheet */\n\tif(!wb.Workbook) wb.Workbook = ({Sheets:[]}/*:any*/);\n\tif(!wb.Workbook.Names) wb.Workbook.Names = [];\n\tvar names/*: Array */ = wb.Workbook.Names;\n\tvar range = decode_range(ref);\n\tif(range.s.r == range.e.r) { range.e.r = decode_range(ws[\"!ref\"]).e.r; ref = encode_range(range); }\n\tfor(var i = 0; i < names.length; ++i) {\n\t\tvar name = names[i];\n\t\tif(name.Name != '_xlnm._FilterDatabase') continue;\n\t\tif(name.Sheet != idx) continue;\n\t\tname.Ref = formula_quote_sheet_name(wb.SheetNames[idx]) + \"!\" + fix_range(ref); break;\n\t}\n\tif(i == names.length) names.push({ Name: '_xlnm._FilterDatabase', Sheet: idx, Ref: formula_quote_sheet_name(wb.SheetNames[idx]) + \"!\" + fix_range(ref) });\n\n\twrite_record(ba, 0x00A1 /* BrtBeginAFilter */, write_UncheckedRfX(safe_decode_range(ref)));\n\t/* *FILTERCOLUMN */\n\t/* [SORTSTATE] */\n\t/* BrtEndAFilter */\n\twrite_record(ba, 0x00A2 /* BrtEndAFilter */);\n}\n\nfunction write_WSVIEWS2(ba, ws, Workbook) {\n\twrite_record(ba, 0x0085 /* BrtBeginWsViews */);\n\t{ /* 1*WSVIEW2 */\n\t\t/* [ACUID] */\n\t\twrite_record(ba, 0x0089 /* BrtBeginWsView */, write_BrtBeginWsView(ws, Workbook));\n\t\t/* [BrtPane] */\n\t\t/* *4BrtSel */\n\t\t/* *4SXSELECT */\n\t\t/* *FRT */\n\t\twrite_record(ba, 0x008A /* BrtEndWsView */);\n\t}\n\t/* *FRT */\n\twrite_record(ba, 0x0086 /* BrtEndWsViews */);\n}\n\nfunction write_WSFMTINFO(/*::ba, ws*/) {\n\t/* [ACWSFMTINFO] */\n\t// write_record(ba, 0x01E5 /* BrtWsFmtInfo */, write_BrtWsFmtInfo(ws));\n}\n\nfunction write_SHEETPROTECT(ba, ws) {\n\tif(!ws['!protect']) return;\n\t/* [BrtSheetProtectionIso] */\n\twrite_record(ba, 0x0217 /* BrtSheetProtection */, write_BrtSheetProtection(ws['!protect']));\n}\n\nfunction write_ws_bin(idx/*:number*/, opts, wb/*:Workbook*/, rels) {\n\tvar ba = buf_array();\n\tvar s = wb.SheetNames[idx], ws = wb.Sheets[s] || {};\n\tvar c/*:string*/ = s; try { if(wb && wb.Workbook) c = wb.Workbook.Sheets[idx].CodeName || c; } catch(e) {}\n\tvar r = safe_decode_range(ws['!ref'] || \"A1\");\n\tif(r.e.c > 0x3FFF || r.e.r > 0xFFFFF) {\n\t\tif(opts.WTF) throw new Error(\"Range \" + (ws['!ref'] || \"A1\") + \" exceeds format limit A1:XFD1048576\");\n\t\tr.e.c = Math.min(r.e.c, 0x3FFF);\n\t\tr.e.r = Math.min(r.e.c, 0xFFFFF);\n\t}\n\tws['!links'] = [];\n\t/* passed back to write_zip and removed there */\n\tws['!comments'] = [];\n\twrite_record(ba, 0x0081 /* BrtBeginSheet */);\n\tif(wb.vbaraw || ws['!outline']) write_record(ba, 0x0093 /* BrtWsProp */, write_BrtWsProp(c, ws['!outline']));\n\twrite_record(ba, 0x0094 /* BrtWsDim */, write_BrtWsDim(r));\n\twrite_WSVIEWS2(ba, ws, wb.Workbook);\n\twrite_WSFMTINFO(ba, ws);\n\twrite_COLINFOS(ba, ws, idx, opts, wb);\n\twrite_CELLTABLE(ba, ws, idx, opts, wb);\n\t/* [BrtSheetCalcProp] */\n\twrite_SHEETPROTECT(ba, ws);\n\t/* *([BrtRangeProtectionIso] BrtRangeProtection) */\n\t/* [SCENMAN] */\n\twrite_AUTOFILTER(ba, ws, wb, idx);\n\t/* [SORTSTATE] */\n\t/* [DCON] */\n\t/* [USERSHVIEWS] */\n\twrite_MERGECELLS(ba, ws);\n\t/* [BrtPhoneticInfo] */\n\t/* *CONDITIONALFORMATTING */\n\t/* [DVALS] */\n\twrite_HLINKS(ba, ws, rels);\n\t/* [BrtPrintOptions] */\n\tif(ws['!margins']) write_record(ba, 0x01DC /* BrtMargins */, write_BrtMargins(ws['!margins']));\n\t/* [BrtPageSetup] */\n\t/* [HEADERFOOTER] */\n\t/* [RWBRK] */\n\t/* [COLBRK] */\n\t/* *BrtBigName */\n\t/* [CELLWATCHES] */\n\tif(!opts || opts.ignoreEC || (opts.ignoreEC == (void 0))) write_IGNOREECS(ba, ws);\n\t/* [SMARTTAGS] */\n\t/* [BrtDrawing] */\n\twrite_LEGACYDRAWING(ba, ws, idx, rels);\n\t/* [BrtLegacyDrawingHF] */\n\t/* [BrtBkHim] */\n\t/* [OLEOBJECTS] */\n\t/* [ACTIVEXCONTROLS] */\n\t/* [WEBPUBITEMS] */\n\t/* [LISTPARTS] */\n\t/* FRTWORKSHEET */\n\twrite_record(ba, 0x0082 /* BrtEndSheet */);\n\treturn ba.end();\n}\nfunction parse_Cache(data/*:string*/)/*:[Array, string, ?string]*/ {\n\tvar col/*:Array*/ = [];\n\tvar num = data.match(/^/);\n\tvar f;\n\n\t/* 21.2.2.150 pt CT_NumVal */\n\t(data.match(/\\/]*>([^<])<\\/c:v><\\/c:pt>/mg)||[]).forEach(function(pt) {\n\t\tvar q = pt.match(/\\/]*>([^<]*)<\\/c:v><\\/c:pt>/);\n\t\tif(!q) return;\n\t\tcol[+q[1]] = num ? +q[2] : q[2];\n\t});\n\n\t/* 21.2.2.71 formatCode CT_Xstring */\n\tvar nf = unescapexml((str_match_xml(data, \"c:formatCode\") || [\"\",\"General\"])[1]);\n\n\t(str_match_ng(data, \"\", \"\")||[]).forEach(function(F) { f = F.replace(/<[^<>]*>/g,\"\"); });\n\n\treturn [col, nf, f];\n}\n\n/* 21.2 DrawingML - Charts */\nfunction parse_chart(data/*:?string*/, name/*:string*/, opts, rels, wb, csheet) {\n\tvar cs/*:Worksheet*/ = ((csheet || {\"!type\":\"chart\"})/*:any*/);\n\tif(!data) return csheet;\n\t/* 21.2.2.27 chart CT_Chart */\n\n\tvar C = 0, R = 0, col = \"A\";\n\tvar refguess = {s: {r:2000000, c:2000000}, e: {r:0, c:0} };\n\n\t/* 21.2.2.120 numCache CT_NumData */\n\t(str_match_ng(data, \"\", \"\")||[]).forEach(function(nc) {\n\t\tvar cache = parse_Cache(nc);\n\t\trefguess.s.r = refguess.s.c = 0;\n\t\trefguess.e.c = C;\n\t\tcol = encode_col(C);\n\t\tcache[0].forEach(function(n,i) {\n\t\t\tif(cs[\"!data\"]) {\n\t\t\t\tif(!cs[\"!data\"][i]) cs[\"!data\"][i] = [];\n\t\t\t\tcs[\"!data\"][i][C] = {t:'n', v:n, z:cache[1] };\n\t\t\t} else cs[col + encode_row(i)] = {t:'n', v:n, z:cache[1] };\n\t\t\tR = i;\n\t\t});\n\t\tif(refguess.e.r < R) refguess.e.r = R;\n\t\t++C;\n\t});\n\tif(C > 0) cs[\"!ref\"] = encode_range(refguess);\n\treturn cs;\n}\n/* 18.3 Worksheets also covers Chartsheets */\nfunction parse_cs_xml(data/*:?string*/, opts, idx/*:number*/, rels, wb/*::, themes, styles*/)/*:Worksheet*/ {\n\tif(!data) return data;\n\t/* 18.3.1.12 chartsheet CT_ChartSheet */\n\tif(!rels) rels = {'!id':{}};\n\tvar s = ({'!type':\"chart\", '!drawel':null, '!rel':\"\"}/*:any*/);\n\tvar m;\n\n\t/* 18.3.1.83 sheetPr CT_ChartsheetPr */\n\tvar sheetPr = data.match(sheetprregex);\n\tif(sheetPr) parse_ws_xml_sheetpr(sheetPr[0], s, wb, idx);\n\n\t/* 18.3.1.36 drawing CT_Drawing */\n\tif((m = data.match(/drawing r:id=\"(.*?)\"/))) s['!rel'] = m[1];\n\n\tif(rels['!id'][s['!rel']]) s['!drawel'] = rels['!id'][s['!rel']];\n\treturn s;\n}\n//function write_cs_xml(idx/*:number*/, opts, wb/*:Workbook*/, rels)/*:string*/ {\n//\tvar o = [XML_HEADER, writextag('chartsheet', null, {\n//\t\t'xmlns': XMLNS_main[0],\n//\t\t'xmlns:r': XMLNS.r\n//\t})];\n//\to[o.length] = writextag(\"drawing\", null, {\"r:id\": \"rId1\"});\n//\tadd_rels(rels, -1, \"../drawings/drawing\" + (idx+1) + \".xml\", RELS.DRAW);\n//\tif(o.length>2) { o[o.length] = (''); o[1]=o[1].replace(\"/>\",\">\"); }\n//\treturn o.join(\"\");\n//}\n\n/* [MS-XLSB] 2.4.331 BrtCsProp */\nfunction parse_BrtCsProp(data, length/*:number*/) {\n\tdata.l += 10;\n\tvar name = parse_XLWideString(data, length - 10);\n\treturn { name: name };\n}\n\n/* [MS-XLSB] 2.1.7.7 Chart Sheet */\nfunction parse_cs_bin(data, opts, idx/*:number*/, rels, wb/*::, themes, styles*/)/*:Worksheet*/ {\n\tif(!data) return data;\n\tif(!rels) rels = {'!id':{}};\n\tvar s = {'!type':\"chart\", '!drawel':null, '!rel':\"\"};\n\tvar state/*:Array*/ = [];\n\tvar pass = false;\n\trecordhopper(data, function cs_parse(val, R, RT) {\n\t\tswitch(RT) {\n\n\t\t\tcase 0x0226: /* 'BrtDrawing' */\n\t\t\t\ts['!rel'] = val; break;\n\n\t\t\tcase 0x028B: /* 'BrtCsProp' */\n\t\t\t\tif(!wb.Sheets[idx]) wb.Sheets[idx] = {};\n\t\t\t\tif(val.name) wb.Sheets[idx].CodeName = val.name;\n\t\t\t\tbreak;\n\n\t\t\tcase 0x0232: /* 'BrtBkHim' */\n\t\t\tcase 0x028C: /* 'BrtCsPageSetup' */\n\t\t\tcase 0x029D: /* 'BrtCsProtection' */\n\t\t\tcase 0x02A7: /* 'BrtCsProtectionIso' */\n\t\t\tcase 0x0227: /* 'BrtLegacyDrawing' */\n\t\t\tcase 0x0228: /* 'BrtLegacyDrawingHF' */\n\t\t\tcase 0x01DC: /* 'BrtMargins' */\n\t\t\tcase 0x0C00: /* 'BrtUid' */\n\t\t\t\tbreak;\n\n\t\t\tcase 0x0023: /* 'BrtFRTBegin' */\n\t\t\t\tpass = true; break;\n\t\t\tcase 0x0024: /* 'BrtFRTEnd' */\n\t\t\t\tpass = false; break;\n\t\t\tcase 0x0025: /* 'BrtACBegin' */\n\t\t\t\tstate.push(RT); break;\n\t\t\tcase 0x0026: /* 'BrtACEnd' */\n\t\t\t\tstate.pop(); break;\n\n\t\t\tdefault:\n\t\t\t\tif(R.T > 0) state.push(RT);\n\t\t\t\telse if(R.T < 0) state.pop();\n\t\t\t\telse if(!pass || opts.WTF) throw new Error(\"Unexpected record 0x\" + RT.toString(16));\n\t\t}\n\t}, opts);\n\n\tif(rels['!id'][s['!rel']]) s['!drawel'] = rels['!id'][s['!rel']];\n\treturn s;\n}\n//function write_cs_bin(/*::idx:number, opts, wb:Workbook, rels*/) {\n//\tvar ba = buf_array();\n//\twrite_record(ba, 0x0081 /* BrtBeginSheet */);\n//\t/* [BrtCsProp] */\n//\t/* CSVIEWS */\n//\t/* [[BrtCsProtectionIso] BrtCsProtection] */\n//\t/* [USERCSVIEWS] */\n//\t/* [BrtMargins] */\n//\t/* [BrtCsPageSetup] */\n//\t/* [HEADERFOOTER] */\n//\t/* BrtDrawing */\n//\t/* [BrtLegacyDrawing] */\n//\t/* [BrtLegacyDrawingHF] */\n//\t/* [BrtBkHim] */\n//\t/* [WEBPUBITEMS] */\n//\t/* FRTCHARTSHEET */\n//\twrite_record(ba, 0x0082 /* BrtEndSheet */);\n//\treturn ba.end();\n//}\n/* 18.2.28 (CT_WorkbookProtection) Defaults */\nvar WBPropsDef = [\n\t['allowRefreshQuery', false, \"bool\"],\n\t['autoCompressPictures', true, \"bool\"],\n\t['backupFile', false, \"bool\"],\n\t['checkCompatibility', false, \"bool\"],\n\t['CodeName', ''],\n\t['date1904', false, \"bool\"],\n\t['defaultThemeVersion', 0, \"int\"],\n\t['filterPrivacy', false, \"bool\"],\n\t['hidePivotFieldList', false, \"bool\"],\n\t['promptedSolutions', false, \"bool\"],\n\t['publishItems', false, \"bool\"],\n\t['refreshAllConnections', false, \"bool\"],\n\t['saveExternalLinkValues', true, \"bool\"],\n\t['showBorderUnselectedTables', true, \"bool\"],\n\t['showInkAnnotation', true, \"bool\"],\n\t['showObjects', 'all'],\n\t['showPivotChartFilter', false, \"bool\"],\n\t['updateLinks', 'userSet']\n];\n\n/* 18.2.30 (CT_BookView) Defaults */\nvar WBViewDef = [\n\t['activeTab', 0, \"int\"],\n\t['autoFilterDateGrouping', true, \"bool\"],\n\t['firstSheet', 0, \"int\"],\n\t['minimized', false, \"bool\"],\n\t['showHorizontalScroll', true, \"bool\"],\n\t['showSheetTabs', true, \"bool\"],\n\t['showVerticalScroll', true, \"bool\"],\n\t['tabRatio', 600, \"int\"],\n\t['visibility', 'visible']\n\t//window{Height,Width}, {x,y}Window\n];\n\n/* 18.2.19 (CT_Sheet) Defaults */\nvar SheetDef = [\n\t//['state', 'visible']\n];\n\n/* 18.2.2 (CT_CalcPr) Defaults */\nvar CalcPrDef = [\n\t['calcCompleted', 'true'],\n\t['calcMode', 'auto'],\n\t['calcOnSave', 'true'],\n\t['concurrentCalc', 'true'],\n\t['fullCalcOnLoad', 'false'],\n\t['fullPrecision', 'true'],\n\t['iterate', 'false'],\n\t['iterateCount', '100'],\n\t['iterateDelta', '0.001'],\n\t['refMode', 'A1']\n];\n\n/* 18.2.3 (CT_CustomWorkbookView) Defaults */\n/*var CustomWBViewDef = [\n\t['autoUpdate', 'false'],\n\t['changesSavedWin', 'false'],\n\t['includeHiddenRowCol', 'true'],\n\t['includePrintSettings', 'true'],\n\t['maximized', 'false'],\n\t['minimized', 'false'],\n\t['onlySync', 'false'],\n\t['personalView', 'false'],\n\t['showComments', 'commIndicator'],\n\t['showFormulaBar', 'true'],\n\t['showHorizontalScroll', 'true'],\n\t['showObjects', 'all'],\n\t['showSheetTabs', 'true'],\n\t['showStatusbar', 'true'],\n\t['showVerticalScroll', 'true'],\n\t['tabRatio', '600'],\n\t['xWindow', '0'],\n\t['yWindow', '0']\n];*/\n\nfunction push_defaults_array(target, defaults) {\n\tfor(var j = 0; j != target.length; ++j) { var w = target[j];\n\t\tfor(var i=0; i != defaults.length; ++i) { var z = defaults[i];\n\t\t\tif(w[z[0]] == null) w[z[0]] = z[1];\n\t\t\telse switch(z[2]) {\n\t\t\tcase \"bool\": if(typeof w[z[0]] == \"string\") w[z[0]] = parsexmlbool(w[z[0]]); break;\n\t\t\tcase \"int\": if(typeof w[z[0]] == \"string\") w[z[0]] = parseInt(w[z[0]], 10); break;\n\t\t\t}\n\t\t}\n\t}\n}\nfunction push_defaults(target, defaults) {\n\tfor(var i = 0; i != defaults.length; ++i) { var z = defaults[i];\n\t\tif(target[z[0]] == null) target[z[0]] = z[1];\n\t\telse switch(z[2]) {\n\t\t\tcase \"bool\": if(typeof target[z[0]] == \"string\") target[z[0]] = parsexmlbool(target[z[0]]); break;\n\t\t\tcase \"int\": if(typeof target[z[0]] == \"string\") target[z[0]] = parseInt(target[z[0]], 10); break;\n\t\t}\n\t}\n}\n\nfunction parse_wb_defaults(wb) {\n\tpush_defaults(wb.WBProps, WBPropsDef);\n\tpush_defaults(wb.CalcPr, CalcPrDef);\n\n\tpush_defaults_array(wb.WBView, WBViewDef);\n\tpush_defaults_array(wb.Sheets, SheetDef);\n\n\t_ssfopts.date1904 = parsexmlbool(wb.WBProps.date1904);\n}\n\nfunction safe1904(wb/*:Workbook*/)/*:string*/ {\n\t/* TODO: store date1904 somewhere else */\n\tif(!wb.Workbook) return \"false\";\n\tif(!wb.Workbook.WBProps) return \"false\";\n\treturn parsexmlbool(wb.Workbook.WBProps.date1904) ? \"true\" : \"false\";\n}\n\nvar badchars = /*#__PURE__*/\":][*?\\/\\\\\".split(\"\");\nfunction check_ws_name(n/*:string*/, safe/*:?boolean*/)/*:boolean*/ {\n\ttry {\n\t\tif(n == \"\") throw new Error(\"Sheet name cannot be blank\");\n\t\tif(n.length > 31) throw new Error(\"Sheet name cannot exceed 31 chars\");\n\t\tif(n.charCodeAt(0) == 0x27 || n.charCodeAt(n.length - 1) == 0x27) throw new Error(\"Sheet name cannot start or end with apostrophe (')\");\n\t\tif(n.toLowerCase() == \"history\") throw new Error(\"Sheet name cannot be 'History'\");\n\t\tbadchars.forEach(function(c) {\n\t\t\tif(n.indexOf(c) == -1) return;\n\t\t\tthrow new Error(\"Sheet name cannot contain : \\\\ / ? * [ ]\");\n\t\t});\n\t} catch(e) { if(safe) return false; throw e; }\n\treturn true;\n}\nfunction check_wb_names(N, S, codes) {\n\tN.forEach(function(n,i) {\n\t\tcheck_ws_name(n);\n\t\tfor(var j = 0; j < i; ++j) if(n == N[j]) throw new Error(\"Duplicate Sheet Name: \" + n);\n\t\tif(codes) {\n\t\t\tvar cn = (S && S[i] && S[i].CodeName) || n;\n\t\t\tif(cn.charCodeAt(0) == 95 && cn.length > 22) throw new Error(\"Bad Code Name: Worksheet\" + cn);\n\t\t}\n\t});\n}\nfunction check_wb(wb) {\n\tif(!wb || !wb.SheetNames || !wb.Sheets) throw new Error(\"Invalid Workbook\");\n\tif(!wb.SheetNames.length) throw new Error(\"Workbook is empty\");\n\tvar Sheets = (wb.Workbook && wb.Workbook.Sheets) || [];\n\tcheck_wb_names(wb.SheetNames, Sheets, !!wb.vbaraw);\n\tfor(var i = 0; i < wb.SheetNames.length; ++i) check_ws(wb.Sheets[wb.SheetNames[i]], wb.SheetNames[i], i);\n\twb.SheetNames.forEach(function(n, i) {\n\t\tvar ws = wb.Sheets[n];\n\t\tif(!ws || !ws[\"!autofilter\"]) return;\n\t\tvar DN;\n\t\tif(!wb.Workbook) wb.Workbook = {};\n\t\tif(!wb.Workbook.Names) wb.Workbook.Names = [];\n\t\twb.Workbook.Names.forEach(function(dn) { if(dn.Name == \"_xlnm._FilterDatabase\" && dn.Sheet == i) DN = dn; });\n\t\tvar nn = formula_quote_sheet_name(n) + \"!\" + fix_range(ws[\"!autofilter\"].ref);\n\t\tif(DN) DN.Ref = nn;\n\t\telse wb.Workbook.Names.push({Name: \"_xlnm._FilterDatabase\", Sheet: i, Ref: nn});\n\t});\n\t/* TODO: validate workbook */\n}\n/* 18.2 Workbook */\nvar wbnsregex = /<\\w+:workbook/;\nfunction parse_wb_xml(data, opts)/*:WorkbookFile*/ {\n\tif(!data) throw new Error(\"Could not find file\");\n\tvar wb = /*::(*/{ AppVersion:{}, WBProps:{}, WBView:[], Sheets:[], CalcPr:{}, Names:[], xmlns: \"\" }/*::)*/;\n\tvar pass = false, xmlns = \"xmlns\";\n\tvar dname = {}, dnstart = 0;\n\tdata.replace(tagregex, function xml_wb(x, idx) {\n\t\tvar y/*:any*/ = parsexmltag(x);\n\t\tswitch(strip_ns(y[0])) {\n\t\t\tcase '': break;\n\n\t\t\t/* 18.2.13 fileVersion CT_FileVersion ? */\n\t\t\tcase '': case '': break;\n\n\t\t\t/* 18.2.12 fileSharing CT_FileSharing ? */\n\t\t\tcase '': break;\n\n\t\t\t/* 18.2.28 workbookPr CT_WorkbookPr ? */\n\t\t\tcase '':\n\t\t\t\tWBPropsDef.forEach(function(w) {\n\t\t\t\t\tif(y[w[0]] == null) return;\n\t\t\t\t\tswitch(w[2]) {\n\t\t\t\t\t\tcase \"bool\": wb.WBProps[w[0]] = parsexmlbool(y[w[0]]); break;\n\t\t\t\t\t\tcase \"int\": wb.WBProps[w[0]] = parseInt(y[w[0]], 10); break;\n\t\t\t\t\t\tdefault: wb.WBProps[w[0]] = y[w[0]];\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tif(y.codeName) wb.WBProps.CodeName = utf8read(y.codeName);\n\t\t\t\tbreak;\n\t\t\tcase '': break;\n\n\t\t\t/* 18.2.29 workbookProtection CT_WorkbookProtection ? */\n\t\t\tcase '': break;\n\n\t\t\t/* 18.2.1 bookViews CT_BookViews ? */\n\t\t\tcase '': case '': break;\n\t\t\t/* 18.2.30 workbookView CT_BookView + */\n\t\t\tcase '': delete y[0]; wb.WBView.push(y); break;\n\t\t\tcase '': break;\n\n\t\t\t/* 18.2.20 sheets CT_Sheets 1 */\n\t\t\tcase '': case '': break; // aggregate sheet\n\t\t\t/* 18.2.19 sheet CT_Sheet + */\n\t\t\tcase '': break;\n\n\t\t\t/* 18.2.15 functionGroups CT_FunctionGroups ? */\n\t\t\tcase '': break;\n\t\t\t/* 18.2.14 functionGroup CT_FunctionGroup + */\n\t\t\tcase '': case '': break;\n\t\t\t/* 18.2.8 externalReference CT_ExternalReference + */\n\t\t\tcase '': break;\n\t\t\tcase '': case '': pass=false; break;\n\t\t\t/* 18.2.5 definedName CT_DefinedName + */\n\t\t\tcase '': {\n\t\t\t\tdname.Ref = unescapexml(utf8read(data.slice(dnstart, idx)));\n\t\t\t\twb.Names.push(dname);\n\t\t\t} break;\n\t\t\tcase '': break;\n\n\t\t\t/* 18.2.2 calcPr CT_CalcPr ? */\n\t\t\tcase '': delete y[0]; wb.CalcPr = y; break;\n\t\t\tcase '': break;\n\n\t\t\t/* 18.2.16 oleSize CT_OleSize ? (ref required) */\n\t\t\tcase '': case '': case '': break;\n\n\t\t\t/* 18.2.18 pivotCaches CT_PivotCaches ? */\n\t\t\tcase '': case '': case '': break;\n\n\t\t\t/* 18.2.23 smartTagTypes CT_SmartTagTypes ? */\n\t\t\tcase '': case '': break;\n\t\t\t/* 18.2.22 smartTagType CT_SmartTagType ? */\n\t\t\tcase '': break;\n\n\t\t\t/* 18.2.11 fileRecoveryPr CT_FileRecoveryPr ? */\n\t\t\tcase '': break;\n\n\t\t\t/* 18.2.26 webPublishObjects CT_WebPublishObjects ? */\n\t\t\tcase '': case '': break;\n\t\t\t/* 18.2.25 webPublishObject CT_WebPublishObject ? */\n\t\t\tcase '': case '': case '': break;\n\t\t\t/* 18.2.7 ext CT_Extension + */\n\t\t\tcase '': pass=false; break;\n\n\t\t\t/* Others */\n\t\t\tcase '': pass=true; break;\n\t\t\tcase '': pass=false; break;\n\n\t\t\t/* TODO */\n\t\t\tcase ' 0);\n\n\t/* fileVersion */\n\t/* fileSharing */\n\n\tvar workbookPr/*:any*/ = ({codeName:\"ThisWorkbook\"}/*:any*/);\n\tif(wb.Workbook && wb.Workbook.WBProps) {\n\t\tWBPropsDef.forEach(function(x) {\n\t\t\t/*:: if(!wb.Workbook || !wb.Workbook.WBProps) throw \"unreachable\"; */\n\t\t\tif((wb.Workbook.WBProps[x[0]]/*:any*/) == null) return;\n\t\t\tif((wb.Workbook.WBProps[x[0]]/*:any*/) == x[1]) return;\n\t\t\tworkbookPr[x[0]] = (wb.Workbook.WBProps[x[0]]/*:any*/);\n\t\t});\n\t\t/*:: if(!wb.Workbook || !wb.Workbook.WBProps) throw \"unreachable\"; */\n\t\tif(wb.Workbook.WBProps.CodeName) { workbookPr.codeName = wb.Workbook.WBProps.CodeName; delete workbookPr.CodeName; }\n\t}\n\to[o.length] = (writextag('workbookPr', null, workbookPr));\n\n\t/* workbookProtection */\n\n\tvar sheets = wb.Workbook && wb.Workbook.Sheets || [];\n\tvar i = 0;\n\n\t/* bookViews only written if first worksheet is hidden */\n\tif(sheets && sheets[0] && !!sheets[0].Hidden) {\n\t\to[o.length] = \"\";\n\t\tfor(i = 0; i != wb.SheetNames.length; ++i) {\n\t\t\tif(!sheets[i]) break;\n\t\t\tif(!sheets[i].Hidden) break;\n\t\t}\n\t\tif(i == wb.SheetNames.length) i = 0;\n\t\to[o.length] = '';\n\t\to[o.length] = \"\";\n\t}\n\n\to[o.length] = \"\";\n\tfor(i = 0; i != wb.SheetNames.length; ++i) {\n\t\tvar sht = ({name:escapexml(wb.SheetNames[i].slice(0,31))}/*:any*/);\n\t\tsht.sheetId = \"\"+(i+1);\n\t\tsht[\"r:id\"] = \"rId\"+(i+1);\n\t\tif(sheets[i]) switch(sheets[i].Hidden) {\n\t\t\tcase 1: sht.state = \"hidden\"; break;\n\t\t\tcase 2: sht.state = \"veryHidden\"; break;\n\t\t}\n\t\to[o.length] = (writextag('sheet',null,sht));\n\t}\n\to[o.length] = \"\";\n\n\t/* functionGroups */\n\t/* externalReferences */\n\n\tif(write_names) {\n\t\to[o.length] = \"\";\n\t\tif(wb.Workbook && wb.Workbook.Names) wb.Workbook.Names.forEach(function(n) {\n\t\t\tvar d/*:any*/ = {name:n.Name};\n\t\t\tif(n.Comment) d.comment = n.Comment;\n\t\t\tif(n.Sheet != null) d.localSheetId = \"\"+n.Sheet;\n\t\t\tif(n.Hidden) d.hidden = \"1\";\n\t\t\tif(!n.Ref) return;\n\t\t\to[o.length] = writextag('definedName', escapexml(n.Ref), d);\n\t\t});\n\t\to[o.length] = \"\";\n\t}\n\n\t/* calcPr */\n\t/* oleSize */\n\t/* customWorkbookViews */\n\t/* pivotCaches */\n\t/* smartTagPr */\n\t/* smartTagTypes */\n\t/* webPublishing */\n\t/* fileRecoveryPr */\n\t/* webPublishObjects */\n\t/* extLst */\n\n\tif(o.length>2){ o[o.length] = ''; o[1]=o[1].replace(\"/>\",\">\"); }\n\treturn o.join(\"\");\n}\n/* [MS-XLSB] 2.4.304 BrtBundleSh */\nfunction parse_BrtBundleSh(data, length/*:number*/) {\n\tvar z = {};\n\tz.Hidden = data.read_shift(4); //hsState ST_SheetState\n\tz.iTabID = data.read_shift(4);\n\tz.strRelID = parse_RelID(data,length-8);\n\tz.name = parse_XLWideString(data);\n\treturn z;\n}\nfunction write_BrtBundleSh(data, o) {\n\tif(!o) o = new_buf(127);\n\to.write_shift(4, data.Hidden);\n\to.write_shift(4, data.iTabID);\n\twrite_RelID(data.strRelID, o);\n\twrite_XLWideString(data.name.slice(0,31), o);\n\treturn o.length > o.l ? o.slice(0, o.l) : o;\n}\n\n/* [MS-XLSB] 2.4.815 BrtWbProp */\nfunction parse_BrtWbProp(data, length)/*:WBProps*/ {\n\tvar o/*:WBProps*/ = ({}/*:any*/);\n\tvar flags = data.read_shift(4);\n\to.defaultThemeVersion = data.read_shift(4);\n\tvar strName = (length > 8) ? parse_XLWideString(data) : \"\";\n\tif(strName.length > 0) o.CodeName = strName;\n\to.autoCompressPictures = !!(flags & 0x10000);\n\to.backupFile = !!(flags & 0x40);\n\to.checkCompatibility = !!(flags & 0x1000);\n\to.date1904 = !!(flags & 0x01);\n\to.filterPrivacy = !!(flags & 0x08);\n\to.hidePivotFieldList = !!(flags & 0x400);\n\to.promptedSolutions = !!(flags & 0x10);\n\to.publishItems = !!(flags & 0x800);\n\to.refreshAllConnections = !!(flags & 0x40000);\n\to.saveExternalLinkValues = !!(flags & 0x80);\n\to.showBorderUnselectedTables = !!(flags & 0x04);\n\to.showInkAnnotation = !!(flags & 0x20);\n\to.showObjects = [\"all\", \"placeholders\", \"none\"][(flags >> 13) & 0x03];\n\to.showPivotChartFilter = !!(flags & 0x8000);\n\to.updateLinks = [\"userSet\", \"never\", \"always\"][(flags >> 8) & 0x03];\n\treturn o;\n}\nfunction write_BrtWbProp(data/*:?WBProps*/, o) {\n\tif(!o) o = new_buf(72);\n\tvar flags = 0;\n\tif(data) {\n\t\t/* TODO: mirror parse_BrtWbProp fields */\n\t\tif(data.date1904) flags |= 0x01;\n\t\tif(data.filterPrivacy) flags |= 0x08;\n\t}\n\to.write_shift(4, flags);\n\to.write_shift(4, 0);\n\twrite_XLSBCodeName(data && data.CodeName || \"ThisWorkbook\", o);\n\treturn o.slice(0, o.l);\n}\n\nfunction parse_BrtFRTArchID$(data, length) {\n\tvar o = {};\n\tdata.read_shift(4);\n\to.ArchID = data.read_shift(4);\n\tdata.l += length - 8;\n\treturn o;\n}\n\n/* [MS-XLSB] 2.4.687 BrtName */\nfunction parse_BrtName(data, length, opts) {\n\tvar end = data.l + length;\n\tvar flags = data.read_shift(4);\n\tdata.l += 1; //var chKey = data.read_shift(1);\n\tvar itab = data.read_shift(4);\n\tvar name = parse_XLNameWideString(data);\n\tvar formula;\n\tvar comment = \"\";\n\ttry {\n\t\tformula = parse_XLSBNameParsedFormula(data, 0, opts);\n\t\ttry {\n\t\t\tcomment = parse_XLNullableWideString(data);\n\t\t} catch(e){}\n\t} catch(e) { console.error(\"Could not parse defined name \" + name); }\n\tif(flags & 0x20) name = \"_xlnm.\" + name;\n\t//if(0 /* fProc */) {\n\t\t// unusedstring1: XLNullableWideString\n\t\t// description: XLNullableWideString\n\t\t// helpTopic: XLNullableWideString\n\t\t// unusedstring2: XLNullableWideString\n\t//}\n\tdata.l = end;\n\tvar out = ({Name:name, Ptg:formula, Flags: flags}/*:any*/);\n\tif(itab < 0xFFFFFFF) out.Sheet = itab;\n\tif(comment) out.Comment = comment;\n\treturn out;\n}\nfunction write_BrtName(name, wb) {\n\tvar o = new_buf(9);\n\tvar flags = 0;\n\tvar dname = name.Name;\n\tif(XLSLblBuiltIn.indexOf(dname) > -1) { flags |= 0x20; dname = dname.slice(6); }\n\to.write_shift(4, flags); // flags\n\to.write_shift(1, 0); // chKey\n\to.write_shift(4, name.Sheet == null ? 0xFFFFFFFF : name.Sheet);\n\n\tvar arr = [\n\t\to,\n\t\twrite_XLWideString(dname),\n\t\twrite_XLSBNameParsedFormula(name.Ref, wb)\n\t];\n\tif(name.Comment) arr.push(write_XLNullableWideString(name.Comment));\n\telse {\n\t\tvar x = new_buf(4);\n\t\tx.write_shift(4, 0xFFFFFFFF);\n\t\tarr.push(x);\n\t}\n\n\t// if macro (flags & 0x0F):\n\t// write_shift(4, 0xFFFFFFFF);\n\t// write_XLNullableWideString(description)\n\t// write_XLNullableWideString(helpTopic)\n\t// write_shift(4, 0xFFFFFFFF);\n\n\treturn bconcat(arr);\n}\n\n/* [MS-XLSB] 2.1.7.61 Workbook */\nfunction parse_wb_bin(data, opts)/*:WorkbookFile*/ {\n\tvar wb = { AppVersion:{}, WBProps:{}, WBView:[], Sheets:[], CalcPr:{}, xmlns: \"\" };\n\tvar state/*:Array*/ = [];\n\tvar pass = false;\n\n\tif(!opts) opts = {};\n\topts.biff = 12;\n\n\tvar Names = [];\n\tvar supbooks = ([[]]/*:any*/);\n\tsupbooks.SheetNames = [];\n\tsupbooks.XTI = [];\n\n\tXLSBRecordEnum[0x0010] = { n:\"BrtFRTArchID$\", f:parse_BrtFRTArchID$ };\n\n\trecordhopper(data, function hopper_wb(val, R, RT) {\n\t\tswitch(RT) {\n\t\t\tcase 0x009C: /* 'BrtBundleSh' */\n\t\t\t\tsupbooks.SheetNames.push(val.name);\n\t\t\t\twb.Sheets.push(val); break;\n\n\t\t\tcase 0x0099: /* 'BrtWbProp' */\n\t\t\t\twb.WBProps = val; break;\n\n\t\t\tcase 0x0027: /* 'BrtName' */\n\t\t\t\tif(val.Sheet != null) opts.SID = val.Sheet;\n\t\t\t\tval.Ref = val.Ptg ? stringify_formula(val.Ptg, null, null, supbooks, opts) : \"#REF!\";\n\t\t\t\tdelete opts.SID;\n\t\t\t\tdelete val.Ptg;\n\t\t\t\tNames.push(val);\n\t\t\t\tbreak;\n\t\t\tcase 0x040C: /* 'BrtNameExt' */ break;\n\n\t\t\tcase 0x0165: /* 'BrtSupSelf' */\n\t\t\tcase 0x0166: /* 'BrtSupSame' */\n\t\t\tcase 0x0163: /* 'BrtSupBookSrc' */\n\t\t\tcase 0x029B: /* 'BrtSupAddin' */\n\t\t\t\tif(!supbooks[0].length) supbooks[0] = [RT, val];\n\t\t\t\telse supbooks.push([RT, val]);\n\t\t\t\tsupbooks[supbooks.length - 1].XTI = [];\n\t\t\t\tbreak;\n\t\t\tcase 0x016A: /* 'BrtExternSheet' */\n\t\t\t\tif(supbooks.length === 0) { supbooks[0] = []; supbooks[0].XTI = []; }\n\t\t\t\tsupbooks[supbooks.length - 1].XTI = supbooks[supbooks.length - 1].XTI.concat(val);\n\t\t\t\tsupbooks.XTI = supbooks.XTI.concat(val);\n\t\t\t\tbreak;\n\t\t\tcase 0x0169: /* 'BrtPlaceholderName' */\n\t\t\t\tbreak;\n\n\t\t\tcase 0x0817: /* 'BrtAbsPath15' */\n\t\t\tcase 0x009E: /* 'BrtBookView' */\n\t\t\tcase 0x008F: /* 'BrtBeginBundleShs' */\n\t\t\tcase 0x0298: /* 'BrtBeginFnGroup' */\n\t\t\tcase 0x0161: /* 'BrtBeginExternals' */\n\t\t\t\tbreak;\n\n\t\t\t/* case 'BrtModelTimeGroupingCalcCol' */\n\t\t\tcase 0x0C00: /* 'BrtUid' */\n\t\t\tcase 0x0C01: /* 'BrtRevisionPtr' */\n\t\t\tcase 0x0216: /* 'BrtBookProtection' */\n\t\t\tcase 0x02A5: /* 'BrtBookProtectionIso' */\n\t\t\tcase 0x009D: /* 'BrtCalcProp' */\n\t\t\tcase 0x0262: /* 'BrtCrashRecErr' */\n\t\t\tcase 0x0802: /* 'BrtDecoupledPivotCacheID' */\n\t\t\tcase 0x009B: /* 'BrtFileRecover' */\n\t\t\tcase 0x0224: /* 'BrtFileSharing' */\n\t\t\tcase 0x02A4: /* 'BrtFileSharingIso' */\n\t\t\tcase 0x0080: /* 'BrtFileVersion' */\n\t\t\tcase 0x0299: /* 'BrtFnGroup' */\n\t\t\tcase 0x0850: /* 'BrtModelRelationship' */\n\t\t\tcase 0x084D: /* 'BrtModelTable' */\n\t\t\tcase 0x0225: /* 'BrtOleSize' */\n\t\t\tcase 0x0805: /* 'BrtPivotTableRef' */\n\t\t\tcase 0x0254: /* 'BrtSmartTagType' */\n\t\t\tcase 0x081C: /* 'BrtTableSlicerCacheID' */\n\t\t\tcase 0x081B: /* 'BrtTableSlicerCacheIDs' */\n\t\t\tcase 0x0822: /* 'BrtTimelineCachePivotCacheID' */\n\t\t\tcase 0x018D: /* 'BrtUserBookView' */\n\t\t\tcase 0x009A: /* 'BrtWbFactoid' */\n\t\t\tcase 0x045D: /* 'BrtWbProp14' */\n\t\t\tcase 0x0229: /* 'BrtWebOpt' */\n\t\t\tcase 0x082B: /* 'BrtWorkBookPr15' */\n\t\t\t\tbreak;\n\n\t\t\tcase 0x0023: /* 'BrtFRTBegin' */\n\t\t\t\tstate.push(RT); pass = true; break;\n\t\t\tcase 0x0024: /* 'BrtFRTEnd' */\n\t\t\t\tstate.pop(); pass = false; break;\n\t\t\tcase 0x0025: /* 'BrtACBegin' */\n\t\t\t\tstate.push(RT); pass = true; break;\n\t\t\tcase 0x0026: /* 'BrtACEnd' */\n\t\t\t\tstate.pop(); pass = false; break;\n\n\t\t\tcase 0x0010: /* 'BrtFRTArchID$' */ break;\n\n\t\t\tdefault:\n\t\t\t\tif(R.T){/* empty */}\n\t\t\t\telse if(!pass || (opts.WTF && state[state.length-1] != 0x0025 /* BrtACBegin */ && state[state.length-1] != 0x0023 /* BrtFRTBegin */)) throw new Error(\"Unexpected record 0x\" + RT.toString(16));\n\t\t}\n\t}, opts);\n\n\tparse_wb_defaults(wb);\n\n\t// $FlowIgnore\n\twb.Names = Names;\n\n\t(wb/*:any*/).supbooks = supbooks;\n\treturn wb;\n}\n\nfunction write_BUNDLESHS(ba, wb/*::, opts*/) {\n\twrite_record(ba, 0x008F /* BrtBeginBundleShs */);\n\tfor(var idx = 0; idx != wb.SheetNames.length; ++idx) {\n\t\tvar viz = wb.Workbook && wb.Workbook.Sheets && wb.Workbook.Sheets[idx] && wb.Workbook.Sheets[idx].Hidden || 0;\n\t\tvar d = { Hidden: viz, iTabID: idx+1, strRelID: 'rId' + (idx+1), name: wb.SheetNames[idx] };\n\t\twrite_record(ba, 0x009C /* BrtBundleSh */, write_BrtBundleSh(d));\n\t}\n\twrite_record(ba, 0x0090 /* BrtEndBundleShs */);\n}\n\n/* [MS-XLSB] 2.4.649 BrtFileVersion */\nfunction write_BrtFileVersion(data, o) {\n\tif(!o) o = new_buf(127);\n\tfor(var i = 0; i != 4; ++i) o.write_shift(4, 0);\n\twrite_XLWideString(\"SheetJS\", o);\n\twrite_XLWideString(XLSX.version, o);\n\twrite_XLWideString(XLSX.version, o);\n\twrite_XLWideString(\"7262\", o);\n\treturn o.length > o.l ? o.slice(0, o.l) : o;\n}\n\n/* [MS-XLSB] 2.4.301 BrtBookView */\nfunction write_BrtBookView(idx, o) {\n\tif(!o) o = new_buf(29);\n\to.write_shift(-4, 0);\n\to.write_shift(-4, 460);\n\to.write_shift(4, 28800);\n\to.write_shift(4, 17600);\n\to.write_shift(4, 500);\n\to.write_shift(4, idx);\n\to.write_shift(4, idx);\n\tvar flags = 0x78;\n\to.write_shift(1, flags);\n\treturn o.length > o.l ? o.slice(0, o.l) : o;\n}\n\nfunction write_BOOKVIEWS(ba, wb/*::, opts*/) {\n\t/* required if hidden tab appears before visible tab */\n\tif(!wb.Workbook || !wb.Workbook.Sheets) return;\n\tvar sheets = wb.Workbook.Sheets;\n\tvar i = 0, vistab = -1, hidden = -1;\n\tfor(; i < sheets.length; ++i) {\n\t\tif(!sheets[i] || !sheets[i].Hidden && vistab == -1) vistab = i;\n\t\telse if(sheets[i].Hidden == 1 && hidden == -1) hidden = i;\n\t}\n\tif(hidden > vistab) return;\n\twrite_record(ba, 0x0087 /* BrtBeginBookViews */);\n\twrite_record(ba, 0x009E /* BrtBookView */, write_BrtBookView(vistab));\n\t/* 1*(BrtBookView *FRT) */\n\twrite_record(ba, 0x0088 /* BrtEndBookViews */);\n}\n\nfunction write_BRTNAMES(ba, wb) {\n\tif(!wb.Workbook || !wb.Workbook.Names) return;\n\twb.Workbook.Names.forEach(function(name) { try {\n\t\tif(name.Flags & 0x0e) return; // TODO: macro name write\n\t\twrite_record(ba, 0x0027 /* BrtName */, write_BrtName(name, wb));\n\t} catch(e) {\n\t\tconsole.error(\"Could not serialize defined name \" + JSON.stringify(name));\n\t} });\n}\n\nfunction write_SELF_EXTERNS_xlsb(wb) {\n\tvar L = wb.SheetNames.length;\n\tvar o = new_buf(12 * L + 28);\n\to.write_shift(4, L + 2);\n\to.write_shift(4, 0); o.write_shift(4, -2); o.write_shift(4, -2); // workbook-level reference\n\to.write_shift(4, 0); o.write_shift(4, -1); o.write_shift(4, -1); // #REF!...\n\tfor(var i = 0; i < L; ++i) {\n\t\to.write_shift(4, 0); o.write_shift(4, i); o.write_shift(4, i);\n\t}\n\treturn o;\n}\nfunction write_EXTERNALS_xlsb(ba, wb) {\n\twrite_record(ba, 0x0161 /* BrtBeginExternals */);\n\twrite_record(ba, 0x0165 /* BrtSupSelf */);\n\twrite_record(ba, 0x016A /* BrtExternSheet */, write_SELF_EXTERNS_xlsb(wb, 0));\n\twrite_record(ba, 0x0162 /* BrtEndExternals */);\n}\n\n/* [MS-XLSB] 2.4.305 BrtCalcProp */\n/*function write_BrtCalcProp(data, o) {\n\tif(!o) o = new_buf(26);\n\to.write_shift(4,0); // force recalc\n\to.write_shift(4,1);\n\to.write_shift(4,0);\n\twrite_Xnum(0, o);\n\to.write_shift(-4, 1023);\n\to.write_shift(1, 0x33);\n\to.write_shift(1, 0x00);\n\treturn o;\n}*/\n\n/* [MS-XLSB] 2.4.646 BrtFileRecover */\n/*function write_BrtFileRecover(data, o) {\n\tif(!o) o = new_buf(1);\n\to.write_shift(1,0);\n\treturn o;\n}*/\n\n/* [MS-XLSB] 2.1.7.61 Workbook */\nfunction write_wb_bin(wb, opts) {\n\tvar ba = buf_array();\n\twrite_record(ba, 0x0083 /* BrtBeginBook */);\n\twrite_record(ba, 0x0080 /* BrtFileVersion */, write_BrtFileVersion());\n\t/* [[BrtFileSharingIso] BrtFileSharing] */\n\twrite_record(ba, 0x0099 /* BrtWbProp */, write_BrtWbProp(wb.Workbook && wb.Workbook.WBProps || null));\n\t/* [ACABSPATH] */\n\t/* [[BrtBookProtectionIso] BrtBookProtection] */\n\twrite_BOOKVIEWS(ba, wb, opts);\n\twrite_BUNDLESHS(ba, wb, opts);\n\t/* [FNGROUP] */\n\twrite_EXTERNALS_xlsb(ba, wb);\n\tif((wb.Workbook||{}).Names) write_BRTNAMES(ba, wb);\n\t/* write_record(ba, 0x009D BrtCalcProp, write_BrtCalcProp()); */\n\t/* [BrtOleSize] */\n\t/* *(BrtUserBookView *FRT) */\n\t/* [PIVOTCACHEIDS] */\n\t/* [BrtWbFactoid] */\n\t/* [SMARTTAGTYPES] */\n\t/* [BrtWebOpt] */\n\t/* write_record(ba, 0x009B BrtFileRecover, write_BrtFileRecover()); */\n\t/* [WEBPUBITEMS] */\n\t/* [CRERRS] */\n\t/* FRTWORKBOOK */\n\twrite_record(ba, 0x0084 /* BrtEndBook */);\n\n\treturn ba.end();\n}\nfunction parse_wb(data, name/*:string*/, opts)/*:WorkbookFile*/ {\n\tif(name.slice(-4)===\".bin\") return parse_wb_bin((data/*:any*/), opts);\n\treturn parse_wb_xml((data/*:any*/), opts);\n}\n\nfunction parse_ws(data, name/*:string*/, idx/*:number*/, opts, rels, wb, themes, styles)/*:Worksheet*/ {\n\tif(name.slice(-4)===\".bin\") return parse_ws_bin((data/*:any*/), opts, idx, rels, wb, themes, styles);\n\treturn parse_ws_xml((data/*:any*/), opts, idx, rels, wb, themes, styles);\n}\n\nfunction parse_cs(data, name/*:string*/, idx/*:number*/, opts, rels, wb, themes, styles)/*:Worksheet*/ {\n\tif(name.slice(-4)===\".bin\") return parse_cs_bin((data/*:any*/), opts, idx, rels, wb, themes, styles);\n\treturn parse_cs_xml((data/*:any*/), opts, idx, rels, wb, themes, styles);\n}\n\nfunction parse_ms(data, name/*:string*/, idx/*:number*/, opts, rels, wb, themes, styles)/*:Worksheet*/ {\n\tif(name.slice(-4)===\".bin\") return parse_ms_bin((data/*:any*/), opts, idx, rels, wb, themes, styles);\n\treturn parse_ms_xml((data/*:any*/), opts, idx, rels, wb, themes, styles);\n}\n\nfunction parse_ds(data, name/*:string*/, idx/*:number*/, opts, rels, wb, themes, styles)/*:Worksheet*/ {\n\tif(name.slice(-4)===\".bin\") return parse_ds_bin((data/*:any*/), opts, idx, rels, wb, themes, styles);\n\treturn parse_ds_xml((data/*:any*/), opts, idx, rels, wb, themes, styles);\n}\n\nfunction parse_sty(data, name/*:string*/, themes, opts) {\n\tif(name.slice(-4)===\".bin\") return parse_sty_bin((data/*:any*/), themes, opts);\n\treturn parse_sty_xml((data/*:any*/), themes, opts);\n}\n\nfunction parse_sst(data, name/*:string*/, opts)/*:SST*/ {\n\tif(name.slice(-4)===\".bin\") return parse_sst_bin((data/*:any*/), opts);\n\treturn parse_sst_xml((data/*:any*/), opts);\n}\n\nfunction parse_cmnt(data, name/*:string*/, opts)/*:Array*/ {\n\tif(name.slice(-4)===\".bin\") return parse_comments_bin((data/*:any*/), opts);\n\treturn parse_comments_xml((data/*:any*/), opts);\n}\n\nfunction parse_cc(data, name/*:string*/, opts) {\n\tif(name.slice(-4)===\".bin\") return parse_cc_bin((data/*:any*/), name, opts);\n\treturn parse_cc_xml((data/*:any*/), name, opts);\n}\n\nfunction parse_xlink(data, rel, name/*:string*/, opts) {\n\tif(name.slice(-4)===\".bin\") return parse_xlink_bin((data/*:any*/), rel, name, opts);\n\treturn parse_xlink_xml((data/*:any*/), rel, name, opts);\n}\n\nfunction parse_xlmeta(data, name/*:string*/, opts) {\n\tif(name.slice(-4)===\".bin\") return parse_xlmeta_bin((data/*:any*/), name, opts);\n\treturn parse_xlmeta_xml((data/*:any*/), name, opts);\n}\nvar attregexg2=/\\b((?:\\w+:)?[\\w]+)=((?:\")([^\"]*)(?:\")|(?:')([^']*)(?:'))/g;\nvar attregex2=/\\b((?:\\w+:)?[\\w]+)=((?:\")(?:[^\"]*)(?:\")|(?:')(?:[^']*)(?:'))/;\nfunction xlml_parsexmltag(tag/*:string*/, skip_root/*:?boolean*/) {\n\tvar words = tag.split(/\\s+/);\n\tvar z/*:any*/ = ([]/*:any*/); if(!skip_root) z[0] = words[0];\n\tif(words.length === 1) return z;\n\tvar m = tag.match(attregexg2), y, j, w, i;\n\tif(m) for(i = 0; i != m.length; ++i) {\n\t\ty = m[i].match(attregex2);\n/*:: if(!y || !y[2]) continue; */\n\t\tif((j=y[1].indexOf(\":\")) === -1) z[y[1]] = y[2].slice(1,y[2].length-1);\n\t\telse {\n\t\t\tif(y[1].slice(0,6) === \"xmlns:\") w = \"xmlns\"+y[1].slice(6);\n\t\t\telse w = y[1].slice(j+1);\n\t\t\tz[w] = y[2].slice(1,y[2].length-1);\n\t\t}\n\t}\n\treturn z;\n}\nfunction xlml_parsexmltagobj(tag/*:string*/) {\n\tvar words = tag.split(/\\s+/);\n\tvar z = {};\n\tif(words.length === 1) return z;\n\tvar m = tag.match(attregexg2), y, j, w, i;\n\tif(m) for(i = 0; i != m.length; ++i) {\n\t\ty = m[i].match(attregex2);\n/*:: if(!y || !y[2]) continue; */\n\t\tif((j=y[1].indexOf(\":\")) === -1) z[y[1]] = y[2].slice(1,y[2].length-1);\n\t\telse {\n\t\t\tif(y[1].slice(0,6) === \"xmlns:\") w = \"xmlns\"+y[1].slice(6);\n\t\t\telse w = y[1].slice(j+1);\n\t\t\tz[w] = y[2].slice(1,y[2].length-1);\n\t\t}\n\t}\n\treturn z;\n}\n\n// ----\n\n/* map from xlml named formats to SSF TODO: localize */\nvar XLMLFormatMap/*: {[string]:string}*/;\n\nfunction xlml_format(format, value, date1904)/*:string*/ {\n\tvar fmt = XLMLFormatMap[format] || unescapexml(format);\n\tif(fmt === \"General\") return SSF_general(value);\n\treturn SSF_format(fmt, value, {date1904: !!date1904});\n}\n\nfunction xlml_set_custprop(Custprops, key, cp, val/*:string*/) {\n\tvar oval/*:any*/ = val;\n\tswitch((cp[0].match(/dt:dt=\"([\\w.]+)\"/)||[\"\",\"\"])[1]) {\n\t\tcase \"boolean\": oval = parsexmlbool(val); break;\n\t\tcase \"i2\": case \"int\": oval = parseInt(val, 10); break;\n\t\tcase \"r4\": case \"float\": oval = parseFloat(val); break;\n\t\tcase \"date\": case \"dateTime.tz\": oval = parseDate(val); break;\n\t\tcase \"i8\": case \"string\": case \"fixed\": case \"uuid\": case \"bin.base64\": break;\n\t\tdefault: throw new Error(\"bad custprop:\" + cp[0]);\n\t}\n\tCustprops[unescapexml(key)] = oval;\n}\n\nfunction safe_format_xlml(cell/*:Cell*/, nf, o, date1904) {\n\tif(cell.t === 'z') return;\n\tif(!o || o.cellText !== false) try {\n\t\tif(cell.t === 'e') { cell.w = cell.w || BErr[cell.v]; }\n\t\telse if(nf === \"General\") {\n\t\t\tif(cell.t === 'n') {\n\t\t\t\tif((cell.v|0) === cell.v) cell.w = cell.v.toString(10);\n\t\t\t\telse cell.w = SSF_general_num(cell.v);\n\t\t\t}\n\t\t\telse cell.w = SSF_general(cell.v);\n\t\t}\n\t\telse cell.w = xlml_format(nf||\"General\", cell.v, date1904);\n\t} catch(e) { if(o.WTF) throw e; }\n\ttry {\n\t\tvar z = XLMLFormatMap[nf]||nf||\"General\";\n\t\tif(o.cellNF) cell.z = z;\n\t\tif(o.cellDates && cell.t == 'n' && fmt_is_date(z)) {\n\t\t\tvar _d = SSF_parse_date_code(cell.v + (date1904 ? 1462 : 0)); if(_d) { cell.t = 'd'; cell.v = new Date(Date.UTC(_d.y, _d.m-1,_d.d,_d.H,_d.M,_d.S,_d.u)); }\n\t\t}\n\t} catch(e) { if(o.WTF) throw e; }\n}\n\nfunction process_style_xlml(styles, stag, opts) {\n\tif(opts.cellStyles) {\n\t\tif(stag.Interior) {\n\t\t\tvar I = stag.Interior;\n\t\t\tif(I.Pattern) I.patternType = XLMLPatternTypeMap[I.Pattern] || I.Pattern;\n\t\t}\n\t}\n\tstyles[stag.ID] = stag;\n}\n\n/* TODO: there must exist some form of OSP-blessed spec */\nfunction parse_xlml_data(xml, ss, data, cell/*:any*/, base, styles, csty, row, arrayf, o, date1904) {\n\tvar nf = \"General\", sid = cell.StyleID, S = {}; o = o || {};\n\tvar interiors = [];\n\tvar i = 0;\n\tif(sid === undefined && row) sid = row.StyleID;\n\tif(sid === undefined && csty) sid = csty.StyleID;\n\twhile(styles[sid] !== undefined) {\n\t\tvar ssid = styles[sid];\n\t\tif(ssid.nf) nf = ssid.nf;\n\t\tif(ssid.Interior) interiors.push(ssid.Interior);\n\t\tif(!ssid.Parent) break;\n\t\tsid = ssid.Parent;\n\t}\n\tswitch(data.Type) {\n\t\tcase 'Boolean':\n\t\t\tcell.t = 'b';\n\t\t\tcell.v = parsexmlbool(xml);\n\t\t\tbreak;\n\t\tcase 'String':\n\t\t\tcell.t = 's'; cell.r = xlml_fixstr(unescapexml(xml));\n\t\t\tcell.v = (xml.indexOf(\"<\") > -1 ? unescapexml(ss||xml).replace(/<[^<>]*>/g, \"\") : cell.r); // todo: BR etc\n\t\t\tbreak;\n\t\tcase 'DateTime':\n\t\t\tif(xml.slice(-1) != \"Z\") xml += \"Z\";\n\t\t\tcell.v = datenum(parseDate(xml, date1904), date1904);\n\t\t\tif(cell.v !== cell.v) cell.v = unescapexml(xml);\n\t\t\tif(!nf || nf == \"General\") nf = \"yyyy-mm-dd\";\n\t\t\t/* falls through */\n\t\tcase 'Number':\n\t\t\tif(cell.v === undefined) cell.v=+xml;\n\t\t\tif(!cell.t) cell.t = 'n';\n\t\t\tbreak;\n\t\tcase 'Error': cell.t = 'e'; cell.v = RBErr[xml]; if(o.cellText !== false) cell.w = xml; break;\n\t\tdefault:\n\t\t\tif(xml == \"\" && ss == \"\") { cell.t = 'z'; }\n\t\t\telse { cell.t = 's'; cell.v = xlml_fixstr(ss||xml); }\n\t\t\tbreak;\n\t}\n\tsafe_format_xlml(cell, nf, o, date1904);\n\tif(o.cellFormula !== false) {\n\t\tif(cell.Formula) {\n\t\t\tvar fstr = unescapexml(cell.Formula);\n\t\t\t/* strictly speaking, the leading = is required but some writers omit */\n\t\t\tif(fstr.charCodeAt(0) == 61 /* = */) fstr = fstr.slice(1);\n\t\t\tcell.f = rc_to_a1(fstr, base);\n\t\t\tdelete cell.Formula;\n\t\t\tif(cell.ArrayRange == \"RC\") cell.F = rc_to_a1(\"RC:RC\", base);\n\t\t\telse if(cell.ArrayRange) {\n\t\t\t\tcell.F = rc_to_a1(cell.ArrayRange, base);\n\t\t\t\tarrayf.push([safe_decode_range(cell.F), cell.F]);\n\t\t\t}\n\t\t} else {\n\t\t\tfor(i = 0; i < arrayf.length; ++i)\n\t\t\t\tif(base.r >= arrayf[i][0].s.r && base.r <= arrayf[i][0].e.r)\n\t\t\t\t\tif(base.c >= arrayf[i][0].s.c && base.c <= arrayf[i][0].e.c)\n\t\t\t\t\t\tcell.F = arrayf[i][1];\n\t\t}\n\t}\n\tif(o.cellStyles) {\n\t\tinteriors.forEach(function(x) {\n\t\t\tif(!S.patternType && x.patternType) S.patternType = x.patternType;\n\t\t});\n\t\tcell.s = S;\n\t}\n\tif(cell.StyleID !== undefined) cell.ixfe = cell.StyleID;\n}\n\nfunction xlml_prefix_dname(dname) {\n\treturn XLSLblBuiltIn.indexOf(\"_xlnm.\" + dname) > -1 ? \"_xlnm.\" + dname : dname;\n}\n\nfunction xlml_clean_comment(comment/*:any*/) {\n\tcomment.t = comment.v || \"\";\n\tcomment.t = comment.t.replace(/\\r\\n/g,\"\\n\").replace(/\\r/g,\"\\n\");\n\tcomment.v = comment.w = comment.ixfe = undefined;\n}\n\n/* TODO: Everything */\nfunction parse_xlml_xml(d, _opts)/*:Workbook*/ {\n\tvar opts = _opts || {};\n\tmake_ssf();\n\tvar str = debom(xlml_normalize(d));\n\tif(opts.type == 'binary' || opts.type == 'array' || opts.type == 'base64') {\n\t\tif(typeof $cptable !== 'undefined') str = $cptable.utils.decode(65001, char_codes(str));\n\t\telse str = utf8read(str);\n\t}\n\tvar opening = str.slice(0, 1024).toLowerCase(), ishtml = false;\n\topening = opening.replace(/\".*?\"/g, \"\");\n\tif((opening.indexOf(\">\") & 1023) > Math.min((opening.indexOf(\",\") & 1023), (opening.indexOf(\";\")&1023))) { var _o = dup(opts); _o.type = \"string\"; return PRN.to_workbook(str, _o); }\n\tif(opening.indexOf(\"= 0) ishtml = true; });\n\tif(ishtml) return html_to_workbook(str, opts);\n\n\tXLMLFormatMap = ({\n\t\t\"General Number\": \"General\",\n\t\t\"General Date\": table_fmt[22],\n\t\t\"Long Date\": \"dddd, mmmm dd, yyyy\",\n\t\t\"Medium Date\": table_fmt[15],\n\t\t\"Short Date\": table_fmt[14],\n\t\t\"Long Time\": table_fmt[19],\n\t\t\"Medium Time\": table_fmt[18],\n\t\t\"Short Time\": table_fmt[20],\n\t\t\"Currency\": '\"$\"#,##0.00_);[Red]\\\\(\"$\"#,##0.00\\\\)',\n\t\t\"Fixed\": table_fmt[2],\n\t\t\"Standard\": table_fmt[4],\n\t\t\"Percent\": table_fmt[10],\n\t\t\"Scientific\": table_fmt[11],\n\t\t\"Yes/No\": '\"Yes\";\"Yes\";\"No\";@',\n\t\t\"True/False\": '\"True\";\"True\";\"False\";@',\n\t\t\"On/Off\": '\"Yes\";\"Yes\";\"No\";@'\n\t}/*:any*/);\n\n\n\tvar Rn;\n\tvar state = [], tmp;\n\tif(DENSE != null && opts.dense == null) opts.dense = DENSE;\n\tvar sheets = {}, sheetnames/*:Array*/ = [], cursheet/*:Worksheet*/ = ({}), sheetname = \"\"; if(opts.dense) cursheet[\"!data\"] = [];\n\tvar cell = ({}/*:any*/), row = {};// eslint-disable-line no-unused-vars\n\tvar dtag = xlml_parsexmltag(''), didx = 0;\n\tvar c = 0, r = 0;\n\tvar refguess/*:Range*/ = {s: {r:2000000, c:2000000}, e: {r:0, c:0} };\n\tvar styles = {}, stag = {};\n\tvar ss = \"\", fidx = 0;\n\tvar merges/*:Array*/ = [];\n\tvar Props = {}, Custprops = {}, pidx = 0, cp = [];\n\tvar comments/*:Array*/ = [], comment/*:Comment*/ = ({}/*:any*/);\n\tvar cstys = [], csty, seencol = false;\n\tvar arrayf/*:Array<[Range, string]>*/ = [];\n\tvar rowinfo/*:Array*/ = [], rowobj = {}, cc = 0, rr = 0;\n\tvar Workbook/*:WBWBProps*/ = ({ Sheets:[], WBProps:{date1904:false} }/*:any*/), wsprops = {};\n\txlmlregex.lastIndex = 0;\n\tstr = str_remove_ng(str, \"\");\n\tvar raw_Rn3 = \"\";\n\twhile((Rn = xlmlregex.exec(str))) switch((Rn[3] = (raw_Rn3 = Rn[3]).toLowerCase())) {\n\t\tcase 'data' /*case 'Data'*/:\n\t\t\tif(raw_Rn3 == \"data\") {\n\t\t\t\tif(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw new Error(\"Bad state: \"+tmp.join(\"|\"));}\n\t\t\t\telse if(Rn[0].charAt(Rn[0].length-2) !== '/') state.push([Rn[3], true]);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(state[state.length-1][1]) break;\n\t\t\tif(Rn[1]==='/') parse_xlml_data(str.slice(didx, Rn.index), ss, dtag, state[state.length-1][0]==/*\"Comment\"*/\"comment\"?comment:cell, {c:c,r:r}, styles, cstys[c], row, arrayf, opts, Workbook.WBProps.date1904);\n\t\t\telse { ss = \"\"; dtag = xlml_parsexmltag(Rn[0]); didx = Rn.index + Rn[0].length; }\n\t\t\tbreak;\n\t\tcase 'cell' /*case 'Cell'*/:\n\t\t\tif(Rn[1]==='/'){\n\t\t\t\tif(comments.length > 0) cell.c = comments;\n\t\t\t\tif((!opts.sheetRows || opts.sheetRows > r) && cell.v !== void 0) {\n\t\t\t\t\tif(opts.dense) {\n\t\t\t\t\t\tif(!cursheet[\"!data\"][r]) cursheet[\"!data\"][r] = [];\n\t\t\t\t\t\tcursheet[\"!data\"][r][c] = cell;\n\t\t\t\t\t} else cursheet[encode_col(c) + encode_row(r)] = cell;\n\t\t\t\t}\n\t\t\t\tif(cell.HRef) {\n\t\t\t\t\tcell.l = ({Target:unescapexml(cell.HRef)}/*:any*/);\n\t\t\t\t\tif(cell.HRefScreenTip) cell.l.Tooltip = cell.HRefScreenTip;\n\t\t\t\t\tdelete cell.HRef; delete cell.HRefScreenTip;\n\t\t\t\t}\n\t\t\t\tif(cell.MergeAcross || cell.MergeDown) {\n\t\t\t\t\tcc = c + (parseInt(cell.MergeAcross,10)|0);\n\t\t\t\t\trr = r + (parseInt(cell.MergeDown,10)|0);\n\t\t\t\t\tif(cc > c || rr > r) merges.push({s:{c:c,r:r},e:{c:cc,r:rr}});\n\t\t\t\t}\n\t\t\t\tif(!opts.sheetStubs) { if(cell.MergeAcross) c = cc + 1; else ++c; }\n\t\t\t\telse if(cell.MergeAcross || cell.MergeDown) {\n\t\t\t\t\t/*:: if(!cc) cc = 0; if(!rr) rr = 0; */\n\t\t\t\t\tfor(var cma = c; cma <= cc; ++cma) {\n\t\t\t\t\t\tfor(var cmd = r; cmd <= rr; ++cmd) {\n\t\t\t\t\t\t\tif(cma > c || cmd > r) {\n\t\t\t\t\t\t\t\tif(opts.dense) {\n\t\t\t\t\t\t\t\t\tif(!cursheet[\"!data\"][cmd]) cursheet[\"!data\"][cmd] = [];\n\t\t\t\t\t\t\t\t\tcursheet[\"!data\"][cmd][cma] = {t:'z'};\n\t\t\t\t\t\t\t\t} else cursheet[encode_col(cma) + encode_row(cmd)] = {t:'z'};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tc = cc + 1;\n\t\t\t\t}\n\t\t\t\telse ++c;\n\t\t\t} else {\n\t\t\t\tcell = xlml_parsexmltagobj(Rn[0]);\n\t\t\t\tif(cell.Index) c = +cell.Index - 1;\n\t\t\t\tif(c < refguess.s.c) refguess.s.c = c;\n\t\t\t\tif(c > refguess.e.c) refguess.e.c = c;\n\t\t\t\tif(Rn[0].slice(-2) === \"/>\") ++c;\n\t\t\t\tcomments = [];\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'row' /*case 'Row'*/:\n\t\t\tif(Rn[1]==='/' || Rn[0].slice(-2) === \"/>\") {\n\t\t\t\tif(r < refguess.s.r) refguess.s.r = r;\n\t\t\t\tif(r > refguess.e.r) refguess.e.r = r;\n\t\t\t\tif(Rn[0].slice(-2) === \"/>\") {\n\t\t\t\t\trow = xlml_parsexmltag(Rn[0]);\n\t\t\t\t\tif(row.Index) r = +row.Index - 1;\n\t\t\t\t}\n\t\t\t\tc = 0; ++r;\n\t\t\t} else {\n\t\t\t\trow = xlml_parsexmltag(Rn[0]);\n\t\t\t\tif(row.Index) r = +row.Index - 1;\n\t\t\t\trowobj = {};\n\t\t\t\tif(row.AutoFitHeight == \"0\" || row.Height) {\n\t\t\t\t\trowobj.hpx = parseInt(row.Height, 10); rowobj.hpt = px2pt(rowobj.hpx);\n\t\t\t\t\trowinfo[r] = rowobj;\n\t\t\t\t}\n\t\t\t\tif(row.Hidden == \"1\") { rowobj.hidden = true; rowinfo[r] = rowobj; }\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'worksheet' /*case 'Worksheet'*/: /* TODO: read range from FullRows/FullColumns */\n\t\t\tif(Rn[1]==='/'){\n\t\t\t\tif((tmp=state.pop())[0]!==Rn[3]) throw new Error(\"Bad state: \"+tmp.join(\"|\"));\n\t\t\t\tsheetnames.push(sheetname);\n\t\t\t\tif(refguess.s.r <= refguess.e.r && refguess.s.c <= refguess.e.c) {\n\t\t\t\t\tcursheet[\"!ref\"] = encode_range(refguess);\n\t\t\t\t\tif(opts.sheetRows && opts.sheetRows <= refguess.e.r) {\n\t\t\t\t\t\tcursheet[\"!fullref\"] = cursheet[\"!ref\"];\n\t\t\t\t\t\trefguess.e.r = opts.sheetRows - 1;\n\t\t\t\t\t\tcursheet[\"!ref\"] = encode_range(refguess);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(merges.length) cursheet[\"!merges\"] = merges;\n\t\t\t\tif(cstys.length > 0) cursheet[\"!cols\"] = cstys;\n\t\t\t\tif(rowinfo.length > 0) cursheet[\"!rows\"] = rowinfo;\n\t\t\t\tsheets[sheetname] = cursheet;\n\t\t\t} else {\n\t\t\t\trefguess = {s: {r:2000000, c:2000000}, e: {r:0, c:0} };\n\t\t\t\tr = c = 0;\n\t\t\t\tstate.push([Rn[3], false]);\n\t\t\t\ttmp = xlml_parsexmltag(Rn[0]);\n\t\t\t\tsheetname = unescapexml(tmp.Name);\n\t\t\t\tcursheet = ({}); if(opts.dense) cursheet[\"!data\"] = [];\n\t\t\t\tmerges = [];\n\t\t\t\tarrayf = [];\n\t\t\t\trowinfo = [];\n\t\t\t\twsprops = {name:sheetname, Hidden:0};\n\t\t\t\tWorkbook.Sheets.push(wsprops);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'table' /*case 'Table'*/:\n\t\t\tif(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw new Error(\"Bad state: \"+tmp.join(\"|\"));}\n\t\t\telse if(Rn[0].slice(-2) == \"/>\") break;\n\t\t\telse {\n\t\t\t\tstate.push([Rn[3], false]);\n\t\t\t\tcstys = []; seencol = false;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'style' /*case 'Style'*/:\n\t\t\tif(Rn[1]==='/') process_style_xlml(styles, stag, opts);\n\t\t\telse stag = xlml_parsexmltag(Rn[0]);\n\t\t\tbreak;\n\n\t\tcase 'numberformat' /*case 'NumberFormat'*/:\n\t\t\tstag.nf = unescapexml(xlml_parsexmltag(Rn[0]).Format || \"General\");\n\t\t\tif(XLMLFormatMap[stag.nf]) stag.nf = XLMLFormatMap[stag.nf];\n\t\t\tfor(var ssfidx = 0; ssfidx != 0x188; ++ssfidx) if(table_fmt[ssfidx] == stag.nf) break;\n\t\t\tif(ssfidx == 0x188) for(ssfidx = 0x39; ssfidx != 0x188; ++ssfidx) if(table_fmt[ssfidx] == null) { SSF__load(stag.nf, ssfidx); break; }\n\t\t\tbreak;\n\n\t\tcase 'column' /*case 'Column'*/:\n\t\t\tif(state[state.length-1][0] !== /*'Table'*/'table') break;\n\t\t\tif(Rn[1]==='/') break;\n\t\t\tcsty = xlml_parsexmltag(Rn[0]);\n\t\t\tif(csty.Hidden) { csty.hidden = true; delete csty.Hidden; }\n\t\t\tif(csty.Width) csty.wpx = parseInt(csty.Width, 10);\n\t\t\tif(!seencol && csty.wpx > 10) {\n\t\t\t\tseencol = true; MDW = DEF_MDW; //find_mdw_wpx(csty.wpx);\n\t\t\t\tfor(var _col = 0; _col < cstys.length; ++_col) if(cstys[_col]) process_col(cstys[_col]);\n\t\t\t}\n\t\t\tif(seencol) process_col(csty);\n\t\t\tcstys[(csty.Index-1||cstys.length)] = csty;\n\t\t\tfor(var i = 0; i < +csty.Span; ++i) cstys[cstys.length] = dup(csty);\n\t\t\tbreak;\n\n\t\tcase 'namedrange' /*case 'NamedRange'*/:\n\t\t\tif(Rn[1]==='/') break;\n\t\t\tif(!Workbook.Names) Workbook.Names = [];\n\t\t\tvar _NamedRange = parsexmltag(Rn[0]);\n\t\t\tvar _DefinedName/*:DefinedName*/ = ({\n\t\t\t\tName: xlml_prefix_dname(_NamedRange.Name),\n\t\t\t\tRef: rc_to_a1(_NamedRange.RefersTo.slice(1), {r:0, c:0})\n\t\t\t}/*:any*/);\n\t\t\tif(Workbook.Sheets.length>0) _DefinedName.Sheet=Workbook.Sheets.length-1;\n\t\t\t/*:: if(Workbook.Names) */Workbook.Names.push(_DefinedName);\n\t\t\tbreak;\n\n\t\tcase 'namedcell' /*case 'NamedCell'*/: break;\n\t\tcase 'b' /*case 'B'*/: break;\n\t\tcase 'i' /*case 'I'*/: break;\n\t\tcase 'u' /*case 'U'*/: break;\n\t\tcase 's' /*case 'S'*/: break;\n\t\tcase 'em' /*case 'EM'*/: break;\n\t\tcase 'h2' /*case 'H2'*/: break;\n\t\tcase 'h3' /*case 'H3'*/: break;\n\t\tcase 'sub' /*case 'Sub'*/: break;\n\t\tcase 'sup' /*case 'Sup'*/: break;\n\t\tcase 'span' /*case 'Span'*/: break;\n\t\tcase 'alignment' /*case 'Alignment'*/:\n\t\t\tbreak;\n\t\tcase 'borders' /*case 'Borders'*/: break;\n\t\tcase 'border' /*case 'Border'*/: break;\n\t\tcase 'font' /*case 'Font'*/:\n\t\t\tif(Rn[0].slice(-2) === \"/>\") break;\n\t\t\telse if(Rn[1]===\"/\") ss += str.slice(fidx, Rn.index);\n\t\t\telse fidx = Rn.index + Rn[0].length;\n\t\t\tbreak;\n\t\tcase 'interior' /*case 'Interior'*/:\n\t\t\tif(!opts.cellStyles) break;\n\t\t\tstag.Interior = xlml_parsexmltag(Rn[0]);\n\t\t\tbreak;\n\t\tcase 'protection' /*case 'Protection'*/: break;\n\n\t\tcase 'author' /*case 'Author'*/:\n\t\tcase 'title' /*case 'Title'*/:\n\t\tcase 'description' /*case 'Description'*/:\n\t\tcase 'created' /*case 'Created'*/:\n\t\tcase 'keywords' /*case 'Keywords'*/:\n\t\tcase 'subject' /*case 'Subject'*/:\n\t\tcase 'category' /*case 'Category'*/:\n\t\tcase 'company' /*case 'Company'*/:\n\t\tcase 'lastauthor' /*case 'LastAuthor'*/:\n\t\tcase 'lastsaved' /*case 'LastSaved'*/:\n\t\tcase 'lastprinted' /*case 'LastPrinted'*/:\n\t\tcase 'version' /*case 'Version'*/:\n\t\tcase 'revision' /*case 'Revision'*/:\n\t\tcase 'totaltime' /*case 'TotalTime'*/:\n\t\tcase 'hyperlinkbase' /*case 'HyperlinkBase'*/:\n\t\tcase 'manager' /*case 'Manager'*/:\n\t\tcase 'contentstatus' /*case 'ContentStatus'*/:\n\t\tcase 'identifier' /*case 'Identifier'*/:\n\t\tcase 'language' /*case 'Language'*/:\n\t\tcase 'appname' /*case 'AppName'*/:\n\t\t\tif(Rn[0].slice(-2) === \"/>\") break;\n\t\t\telse if(Rn[1]===\"/\") xlml_set_prop(Props, raw_Rn3, str.slice(pidx, Rn.index));\n\t\t\telse pidx = Rn.index + Rn[0].length;\n\t\t\tbreak;\n\t\tcase 'paragraphs' /*case 'Paragraphs'*/: break;\n\n\t\tcase 'styles' /*case 'Styles'*/:\n\t\tcase 'workbook' /*case 'Workbook'*/:\n\t\t\tif(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw new Error(\"Bad state: \"+tmp.join(\"|\"));}\n\t\t\telse state.push([Rn[3], false]);\n\t\t\tbreak;\n\n\t\tcase 'comment' /*case 'Comment'*/:\n\t\t\tif(Rn[1]==='/'){\n\t\t\t\tif((tmp=state.pop())[0]!==Rn[3]) throw new Error(\"Bad state: \"+tmp.join(\"|\"));\n\t\t\t\txlml_clean_comment(comment);\n\t\t\t\tcomments.push(comment);\n\t\t\t} else {\n\t\t\t\tstate.push([Rn[3], false]);\n\t\t\t\ttmp = xlml_parsexmltag(Rn[0]);\n\t\t\t\tif(!parsexmlbool(tmp[\"ShowAlways\"]||\"0\")) comments.hidden = true;\n\t\t\t\tcomment = ({a:tmp.Author}/*:any*/);\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'autofilter' /*case 'AutoFilter'*/:\n\t\t\tif(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw new Error(\"Bad state: \"+tmp.join(\"|\"));}\n\t\t\telse if(Rn[0].charAt(Rn[0].length-2) !== '/') {\n\t\t\t\tvar AutoFilter = xlml_parsexmltag(Rn[0]);\n\t\t\t\tcursheet['!autofilter'] = { ref:rc_to_a1(AutoFilter.Range).replace(/\\$/g,\"\") };\n\t\t\t\tstate.push([Rn[3], true]);\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'name' /*case 'Name'*/: break;\n\n\t\tcase 'datavalidation' /*case 'DataValidation'*/:\n\t\t\tif(Rn[1]==='/'){\n\t\t\t\tif((tmp=state.pop())[0]!==Rn[3]) throw new Error(\"Bad state: \"+tmp.join(\"|\"));\n\t\t\t} else {\n\t\t\t\tif(Rn[0].charAt(Rn[0].length-2) !== '/') state.push([Rn[3], true]);\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'pixelsperinch' /*case 'PixelsPerInch'*/:\n\t\t\tbreak;\n\t\tcase 'componentoptions' /*case 'ComponentOptions'*/:\n\t\tcase 'documentproperties' /*case 'DocumentProperties'*/:\n\t\tcase 'customdocumentproperties' /*case 'CustomDocumentProperties'*/:\n\t\tcase 'officedocumentsettings' /*case 'OfficeDocumentSettings'*/:\n\t\tcase 'pivottable' /*case 'PivotTable'*/:\n\t\tcase 'pivotcache' /*case 'PivotCache'*/:\n\t\tcase 'names' /*case 'Names'*/:\n\t\tcase 'mapinfo' /*case 'MapInfo'*/:\n\t\tcase 'pagebreaks' /*case 'PageBreaks'*/:\n\t\tcase 'querytable' /*case 'QueryTable'*/:\n\t\tcase 'sorting' /*case 'Sorting'*/:\n\t\tcase 'schema' /*case 'Schema'*/: //case 'data' /*case 'data'*/:\n\t\tcase 'conditionalformatting' /*case 'ConditionalFormatting'*/:\n\t\tcase 'smarttagtype' /*case 'SmartTagType'*/:\n\t\tcase 'smarttags' /*case 'SmartTags'*/:\n\t\tcase 'excelworkbook' /*case 'ExcelWorkbook'*/:\n\t\tcase 'workbookoptions' /*case 'WorkbookOptions'*/:\n\t\tcase 'worksheetoptions' /*case 'WorksheetOptions'*/:\n\t\t\tif(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw new Error(\"Bad state: \"+tmp.join(\"|\"));}\n\t\t\telse if(Rn[0].charAt(Rn[0].length-2) !== '/') state.push([Rn[3], true]);\n\t\t\tbreak;\n\n\t\tcase 'null' /*case 'Null'*/: break;\n\n\t\tdefault:\n\t\t\t/* FODS file root is */\n\t\t\tif(state.length == 0 && Rn[3] == \"document\") return parse_fods(str, opts);\n\t\t\t/* UOS file root is */\n\t\t\tif(state.length == 0 && Rn[3] == \"uof\"/*\"UOF\"*/) return parse_fods(str, opts);\n\n\t\t\tvar seen = true;\n\t\t\tswitch(state[state.length-1][0]) {\n\t\t\t\t/* OfficeDocumentSettings */\n\t\t\t\tcase 'officedocumentsettings' /*case 'OfficeDocumentSettings'*/: switch(Rn[3]) {\n\t\t\t\t\tcase 'allowpng' /*case 'AllowPNG'*/: break;\n\t\t\t\t\tcase 'removepersonalinformation' /*case 'RemovePersonalInformation'*/: break;\n\t\t\t\t\tcase 'downloadcomponents' /*case 'DownloadComponents'*/: break;\n\t\t\t\t\tcase 'locationofcomponents' /*case 'LocationOfComponents'*/: break;\n\t\t\t\t\tcase 'colors' /*case 'Colors'*/: break;\n\t\t\t\t\tcase 'color' /*case 'Color'*/: break;\n\t\t\t\t\tcase 'index' /*case 'Index'*/: break;\n\t\t\t\t\tcase 'rgb' /*case 'RGB'*/: break;\n\t\t\t\t\tcase 'targetscreensize' /*case 'TargetScreenSize'*/: break;\n\t\t\t\t\tcase 'readonlyrecommended' /*case 'ReadOnlyRecommended'*/: break;\n\t\t\t\t\tdefault: seen = false;\n\t\t\t\t} break;\n\n\t\t\t\t/* ComponentOptions */\n\t\t\t\tcase 'componentoptions' /*case 'ComponentOptions'*/: switch(Rn[3]) {\n\t\t\t\t\tcase 'toolbar' /*case 'Toolbar'*/: break;\n\t\t\t\t\tcase 'hideofficelogo' /*case 'HideOfficeLogo'*/: break;\n\t\t\t\t\tcase 'spreadsheetautofit' /*case 'SpreadsheetAutoFit'*/: break;\n\t\t\t\t\tcase 'label' /*case 'Label'*/: break;\n\t\t\t\t\tcase 'caption' /*case 'Caption'*/: break;\n\t\t\t\t\tcase 'maxheight' /*case 'MaxHeight'*/: break;\n\t\t\t\t\tcase 'maxwidth' /*case 'MaxWidth'*/: break;\n\t\t\t\t\tcase 'nextsheetnumber' /*case 'NextSheetNumber'*/: break;\n\t\t\t\t\tdefault: seen = false;\n\t\t\t\t} break;\n\n\t\t\t\t/* ExcelWorkbook */\n\t\t\t\tcase 'excelworkbook' /*case 'ExcelWorkbook'*/: switch(Rn[3]) {\n\t\t\t\t\tcase 'date1904' /*case 'Date1904'*/:\n\t\t\t\t\t\t/*:: if(!Workbook.WBProps) Workbook.WBProps = {}; */\n\t\t\t\t\t\tWorkbook.WBProps.date1904 = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'hidehorizontalscrollbar' /*case 'HideHorizontalScrollBar'*/: break;\n\t\t\t\t\tcase 'hideverticalscrollbar' /*case 'HideVerticalScrollBar'*/: break;\n\t\t\t\t\tcase 'hideworkbooktabs' /*case 'HideWorkbookTabs'*/: break;\n\t\t\t\t\tcase 'windowheight' /*case 'WindowHeight'*/: break;\n\t\t\t\t\tcase 'windowwidth' /*case 'WindowWidth'*/: break;\n\t\t\t\t\tcase 'windowtopx' /*case 'WindowTopX'*/: break;\n\t\t\t\t\tcase 'windowtopy' /*case 'WindowTopY'*/: break;\n\t\t\t\t\tcase 'tabratio' /*case 'TabRatio'*/: break;\n\t\t\t\t\tcase 'protectstructure' /*case 'ProtectStructure'*/: break;\n\t\t\t\t\tcase 'protectwindow' /*case 'ProtectWindow'*/: break;\n\t\t\t\t\tcase 'protectwindows' /*case 'ProtectWindows'*/: break;\n\t\t\t\t\tcase 'activesheet' /*case 'ActiveSheet'*/: break;\n\t\t\t\t\tcase 'displayinknotes' /*case 'DisplayInkNotes'*/: break;\n\t\t\t\t\tcase 'firstvisiblesheet' /*case 'FirstVisibleSheet'*/: break;\n\t\t\t\t\tcase 'supbook' /*case 'SupBook'*/: break;\n\t\t\t\t\tcase 'sheetname' /*case 'SheetName'*/: break;\n\t\t\t\t\tcase 'sheetindex' /*case 'SheetIndex'*/: break;\n\t\t\t\t\tcase 'sheetindexfirst' /*case 'SheetIndexFirst'*/: break;\n\t\t\t\t\tcase 'sheetindexlast' /*case 'SheetIndexLast'*/: break;\n\t\t\t\t\tcase 'dll' /*case 'Dll'*/: break;\n\t\t\t\t\tcase 'acceptlabelsinformulas' /*case 'AcceptLabelsInFormulas'*/: break;\n\t\t\t\t\tcase 'donotsavelinkvalues' /*case 'DoNotSaveLinkValues'*/: break;\n\t\t\t\t\tcase 'iteration' /*case 'Iteration'*/: break;\n\t\t\t\t\tcase 'maxiterations' /*case 'MaxIterations'*/: break;\n\t\t\t\t\tcase 'maxchange' /*case 'MaxChange'*/: break;\n\t\t\t\t\tcase 'path' /*case 'Path'*/: break;\n\t\t\t\t\tcase 'xct' /*case 'Xct'*/: break;\n\t\t\t\t\tcase 'count' /*case 'Count'*/: break;\n\t\t\t\t\tcase 'selectedsheets' /*case 'SelectedSheets'*/: break;\n\t\t\t\t\tcase 'calculation' /*case 'Calculation'*/: break;\n\t\t\t\t\tcase 'uncalced' /*case 'Uncalced'*/: break;\n\t\t\t\t\tcase 'startupprompt' /*case 'StartupPrompt'*/: break;\n\t\t\t\t\tcase 'crn' /*case 'Crn'*/: break;\n\t\t\t\t\tcase 'externname' /*case 'ExternName'*/: break;\n\t\t\t\t\tcase 'formula' /*case 'Formula'*/: break;\n\t\t\t\t\tcase 'colfirst' /*case 'ColFirst'*/: break;\n\t\t\t\t\tcase 'collast' /*case 'ColLast'*/: break;\n\t\t\t\t\tcase 'wantadvise' /*case 'WantAdvise'*/: break;\n\t\t\t\t\tcase 'boolean' /*case 'Boolean'*/: break;\n\t\t\t\t\tcase 'error' /*case 'Error'*/: break;\n\t\t\t\t\tcase 'text' /*case 'Text'*/: break;\n\t\t\t\t\tcase 'ole' /*case 'OLE'*/: break;\n\t\t\t\t\tcase 'noautorecover' /*case 'NoAutoRecover'*/: break;\n\t\t\t\t\tcase 'publishobjects' /*case 'PublishObjects'*/: break;\n\t\t\t\t\tcase 'donotcalculatebeforesave' /*case 'DoNotCalculateBeforeSave'*/: break;\n\t\t\t\t\tcase 'number' /*case 'Number'*/: break;\n\t\t\t\t\tcase 'refmoder1c1' /*case 'RefModeR1C1'*/: break;\n\t\t\t\t\tcase 'embedsavesmarttags' /*case 'EmbedSaveSmartTags'*/: break;\n\t\t\t\t\tdefault: seen = false;\n\t\t\t\t} break;\n\n\t\t\t\t/* WorkbookOptions */\n\t\t\t\tcase 'workbookoptions' /*case 'WorkbookOptions'*/: switch(Rn[3]) {\n\t\t\t\t\tcase 'owcversion' /*case 'OWCVersion'*/: break;\n\t\t\t\t\tcase 'height' /*case 'Height'*/: break;\n\t\t\t\t\tcase 'width' /*case 'Width'*/: break;\n\t\t\t\t\tdefault: seen = false;\n\t\t\t\t} break;\n\n\t\t\t\t/* WorksheetOptions */\n\t\t\t\tcase 'worksheetoptions' /*case 'WorksheetOptions'*/: switch(Rn[3]) {\n\t\t\t\t\tcase 'visible' /*case 'Visible'*/:\n\t\t\t\t\t\tif(Rn[0].slice(-2) === \"/>\"){/* empty */}\n\t\t\t\t\t\telse if(Rn[1]===\"/\") switch(str.slice(pidx, Rn.index)) {\n\t\t\t\t\t\t\tcase \"SheetHidden\": wsprops.Hidden = 1; break;\n\t\t\t\t\t\t\tcase \"SheetVeryHidden\": wsprops.Hidden = 2; break;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse pidx = Rn.index + Rn[0].length;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'header' /*case 'Header'*/:\n\t\t\t\t\t\tif(!cursheet['!margins']) default_margins(cursheet['!margins']={}, 'xlml');\n\t\t\t\t\t\tif(!isNaN(+parsexmltag(Rn[0]).Margin)) cursheet['!margins'].header = +parsexmltag(Rn[0]).Margin;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'footer' /*case 'Footer'*/:\n\t\t\t\t\t\tif(!cursheet['!margins']) default_margins(cursheet['!margins']={}, 'xlml');\n\t\t\t\t\t\tif(!isNaN(+parsexmltag(Rn[0]).Margin)) cursheet['!margins'].footer = +parsexmltag(Rn[0]).Margin;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'pagemargins' /*case 'PageMargins'*/:\n\t\t\t\t\t\tvar pagemargins = parsexmltag(Rn[0]);\n\t\t\t\t\t\tif(!cursheet['!margins']) default_margins(cursheet['!margins']={},'xlml');\n\t\t\t\t\t\tif(!isNaN(+pagemargins.Top)) cursheet['!margins'].top = +pagemargins.Top;\n\t\t\t\t\t\tif(!isNaN(+pagemargins.Left)) cursheet['!margins'].left = +pagemargins.Left;\n\t\t\t\t\t\tif(!isNaN(+pagemargins.Right)) cursheet['!margins'].right = +pagemargins.Right;\n\t\t\t\t\t\tif(!isNaN(+pagemargins.Bottom)) cursheet['!margins'].bottom = +pagemargins.Bottom;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'displayrighttoleft' /*case 'DisplayRightToLeft'*/:\n\t\t\t\t\t\tif(!Workbook.Views) Workbook.Views = [];\n\t\t\t\t\t\tif(!Workbook.Views[0]) Workbook.Views[0] = {};\n\t\t\t\t\t\tWorkbook.Views[0].RTL = true;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'freezepanes' /*case 'FreezePanes'*/: break;\n\t\t\t\t\tcase 'frozennosplit' /*case 'FrozenNoSplit'*/: break;\n\n\t\t\t\t\tcase 'splithorizontal' /*case 'SplitHorizontal'*/:\n\t\t\t\t\tcase 'splitvertical' /*case 'SplitVertical'*/:\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'donotdisplaygridlines' /*case 'DoNotDisplayGridlines'*/:\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'activerow' /*case 'ActiveRow'*/: break;\n\t\t\t\t\tcase 'activecol' /*case 'ActiveCol'*/: break;\n\t\t\t\t\tcase 'toprowbottompane' /*case 'TopRowBottomPane'*/: break;\n\t\t\t\t\tcase 'leftcolumnrightpane' /*case 'LeftColumnRightPane'*/: break;\n\n\t\t\t\t\tcase 'unsynced' /*case 'Unsynced'*/: break;\n\t\t\t\t\tcase 'print' /*case 'Print'*/: break;\n\t\t\t\t\tcase 'printerrors' /*case 'PrintErrors'*/: break;\n\t\t\t\t\tcase 'panes' /*case 'Panes'*/: break;\n\t\t\t\t\tcase 'scale' /*case 'Scale'*/: break;\n\t\t\t\t\tcase 'pane' /*case 'Pane'*/: break;\n\t\t\t\t\tcase 'number' /*case 'Number'*/: break;\n\t\t\t\t\tcase 'layout' /*case 'Layout'*/: break;\n\t\t\t\t\tcase 'pagesetup' /*case 'PageSetup'*/: break;\n\t\t\t\t\tcase 'selected' /*case 'Selected'*/: break;\n\t\t\t\t\tcase 'protectobjects' /*case 'ProtectObjects'*/: break;\n\t\t\t\t\tcase 'enableselection' /*case 'EnableSelection'*/: break;\n\t\t\t\t\tcase 'protectscenarios' /*case 'ProtectScenarios'*/: break;\n\t\t\t\t\tcase 'validprinterinfo' /*case 'ValidPrinterInfo'*/: break;\n\t\t\t\t\tcase 'horizontalresolution' /*case 'HorizontalResolution'*/: break;\n\t\t\t\t\tcase 'verticalresolution' /*case 'VerticalResolution'*/: break;\n\t\t\t\t\tcase 'numberofcopies' /*case 'NumberofCopies'*/: break;\n\t\t\t\t\tcase 'activepane' /*case 'ActivePane'*/: break;\n\t\t\t\t\tcase 'toprowvisible' /*case 'TopRowVisible'*/: break;\n\t\t\t\t\tcase 'leftcolumnvisible' /*case 'LeftColumnVisible'*/: break;\n\t\t\t\t\tcase 'fittopage' /*case 'FitToPage'*/: break;\n\t\t\t\t\tcase 'rangeselection' /*case 'RangeSelection'*/: break;\n\t\t\t\t\tcase 'papersizeindex' /*case 'PaperSizeIndex'*/: break;\n\t\t\t\t\tcase 'pagelayoutzoom' /*case 'PageLayoutZoom'*/: break;\n\t\t\t\t\tcase 'pagebreakzoom' /*case 'PageBreakZoom'*/: break;\n\t\t\t\t\tcase 'filteron' /*case 'FilterOn'*/: break;\n\t\t\t\t\tcase 'fitwidth' /*case 'FitWidth'*/: break;\n\t\t\t\t\tcase 'fitheight' /*case 'FitHeight'*/: break;\n\t\t\t\t\tcase 'commentslayout' /*case 'CommentsLayout'*/: break;\n\t\t\t\t\tcase 'zoom' /*case 'Zoom'*/: break;\n\t\t\t\t\tcase 'lefttoright' /*case 'LeftToRight'*/: break;\n\t\t\t\t\tcase 'gridlines' /*case 'Gridlines'*/: break;\n\t\t\t\t\tcase 'allowsort' /*case 'AllowSort'*/: break;\n\t\t\t\t\tcase 'allowfilter' /*case 'AllowFilter'*/: break;\n\t\t\t\t\tcase 'allowinsertrows' /*case 'AllowInsertRows'*/: break;\n\t\t\t\t\tcase 'allowdeleterows' /*case 'AllowDeleteRows'*/: break;\n\t\t\t\t\tcase 'allowinsertcols' /*case 'AllowInsertCols'*/: break;\n\t\t\t\t\tcase 'allowdeletecols' /*case 'AllowDeleteCols'*/: break;\n\t\t\t\t\tcase 'allowinserthyperlinks' /*case 'AllowInsertHyperlinks'*/: break;\n\t\t\t\t\tcase 'allowformatcells' /*case 'AllowFormatCells'*/: break;\n\t\t\t\t\tcase 'allowsizecols' /*case 'AllowSizeCols'*/: break;\n\t\t\t\t\tcase 'allowsizerows' /*case 'AllowSizeRows'*/: break;\n\t\t\t\t\tcase 'nosummaryrowsbelowdetail' /*case 'NoSummaryRowsBelowDetail'*/:\n\t\t\t\t\t\tif(!cursheet[\"!outline\"]) cursheet[\"!outline\"] = {};\n\t\t\t\t\t\tcursheet[\"!outline\"].above = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'tabcolorindex' /*case 'TabColorIndex'*/: break;\n\t\t\t\t\tcase 'donotdisplayheadings' /*case 'DoNotDisplayHeadings'*/: break;\n\t\t\t\t\tcase 'showpagelayoutzoom' /*case 'ShowPageLayoutZoom'*/: break;\n\t\t\t\t\tcase 'nosummarycolumnsrightdetail' /*case 'NoSummaryColumnsRightDetail'*/:\n\t\t\t\t\t\tif(!cursheet[\"!outline\"]) cursheet[\"!outline\"] = {};\n\t\t\t\t\t\tcursheet[\"!outline\"].left = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'blackandwhite' /*case 'BlackAndWhite'*/: break;\n\t\t\t\t\tcase 'donotdisplayzeros' /*case 'DoNotDisplayZeros'*/: break;\n\t\t\t\t\tcase 'displaypagebreak' /*case 'DisplayPageBreak'*/: break;\n\t\t\t\t\tcase 'rowcolheadings' /*case 'RowColHeadings'*/: break;\n\t\t\t\t\tcase 'donotdisplayoutline' /*case 'DoNotDisplayOutline'*/: break;\n\t\t\t\t\tcase 'noorientation' /*case 'NoOrientation'*/: break;\n\t\t\t\t\tcase 'allowusepivottables' /*case 'AllowUsePivotTables'*/: break;\n\t\t\t\t\tcase 'zeroheight' /*case 'ZeroHeight'*/: break;\n\t\t\t\t\tcase 'viewablerange' /*case 'ViewableRange'*/: break;\n\t\t\t\t\tcase 'selection' /*case 'Selection'*/: break;\n\t\t\t\t\tcase 'protectcontents' /*case 'ProtectContents'*/: break;\n\t\t\t\t\tdefault: seen = false;\n\t\t\t\t} break;\n\n\t\t\t\t/* PivotTable */\n\t\t\t\tcase 'pivottable' /*case 'PivotTable'*/: case 'pivotcache' /*case 'PivotCache'*/: switch(Rn[3]) {\n\t\t\t\t\tcase 'immediateitemsondrop' /*case 'ImmediateItemsOnDrop'*/: break;\n\t\t\t\t\tcase 'showpagemultipleitemlabel' /*case 'ShowPageMultipleItemLabel'*/: break;\n\t\t\t\t\tcase 'compactrowindent' /*case 'CompactRowIndent'*/: break;\n\t\t\t\t\tcase 'location' /*case 'Location'*/: break;\n\t\t\t\t\tcase 'pivotfield' /*case 'PivotField'*/: break;\n\t\t\t\t\tcase 'orientation' /*case 'Orientation'*/: break;\n\t\t\t\t\tcase 'layoutform' /*case 'LayoutForm'*/: break;\n\t\t\t\t\tcase 'layoutsubtotallocation' /*case 'LayoutSubtotalLocation'*/: break;\n\t\t\t\t\tcase 'layoutcompactrow' /*case 'LayoutCompactRow'*/: break;\n\t\t\t\t\tcase 'position' /*case 'Position'*/: break;\n\t\t\t\t\tcase 'pivotitem' /*case 'PivotItem'*/: break;\n\t\t\t\t\tcase 'datatype' /*case 'DataType'*/: break;\n\t\t\t\t\tcase 'datafield' /*case 'DataField'*/: break;\n\t\t\t\t\tcase 'sourcename' /*case 'SourceName'*/: break;\n\t\t\t\t\tcase 'parentfield' /*case 'ParentField'*/: break;\n\t\t\t\t\tcase 'ptlineitems' /*case 'PTLineItems'*/: break;\n\t\t\t\t\tcase 'ptlineitem' /*case 'PTLineItem'*/: break;\n\t\t\t\t\tcase 'countofsameitems' /*case 'CountOfSameItems'*/: break;\n\t\t\t\t\tcase 'item' /*case 'Item'*/: break;\n\t\t\t\t\tcase 'itemtype' /*case 'ItemType'*/: break;\n\t\t\t\t\tcase 'ptsource' /*case 'PTSource'*/: break;\n\t\t\t\t\tcase 'cacheindex' /*case 'CacheIndex'*/: break;\n\t\t\t\t\tcase 'consolidationreference' /*case 'ConsolidationReference'*/: break;\n\t\t\t\t\tcase 'filename' /*case 'FileName'*/: break;\n\t\t\t\t\tcase 'reference' /*case 'Reference'*/: break;\n\t\t\t\t\tcase 'nocolumngrand' /*case 'NoColumnGrand'*/: break;\n\t\t\t\t\tcase 'norowgrand' /*case 'NoRowGrand'*/: break;\n\t\t\t\t\tcase 'blanklineafteritems' /*case 'BlankLineAfterItems'*/: break;\n\t\t\t\t\tcase 'hidden' /*case 'Hidden'*/: break;\n\t\t\t\t\tcase 'subtotal' /*case 'Subtotal'*/: break;\n\t\t\t\t\tcase 'basefield' /*case 'BaseField'*/: break;\n\t\t\t\t\tcase 'mapchilditems' /*case 'MapChildItems'*/: break;\n\t\t\t\t\tcase 'function' /*case 'Function'*/: break;\n\t\t\t\t\tcase 'refreshonfileopen' /*case 'RefreshOnFileOpen'*/: break;\n\t\t\t\t\tcase 'printsettitles' /*case 'PrintSetTitles'*/: break;\n\t\t\t\t\tcase 'mergelabels' /*case 'MergeLabels'*/: break;\n\t\t\t\t\tcase 'defaultversion' /*case 'DefaultVersion'*/: break;\n\t\t\t\t\tcase 'refreshname' /*case 'RefreshName'*/: break;\n\t\t\t\t\tcase 'refreshdate' /*case 'RefreshDate'*/: break;\n\t\t\t\t\tcase 'refreshdatecopy' /*case 'RefreshDateCopy'*/: break;\n\t\t\t\t\tcase 'versionlastrefresh' /*case 'VersionLastRefresh'*/: break;\n\t\t\t\t\tcase 'versionlastupdate' /*case 'VersionLastUpdate'*/: break;\n\t\t\t\t\tcase 'versionupdateablemin' /*case 'VersionUpdateableMin'*/: break;\n\t\t\t\t\tcase 'versionrefreshablemin' /*case 'VersionRefreshableMin'*/: break;\n\t\t\t\t\tcase 'calculation' /*case 'Calculation'*/: break;\n\t\t\t\t\tdefault: seen = false;\n\t\t\t\t} break;\n\n\t\t\t\t/* PageBreaks */\n\t\t\t\tcase 'pagebreaks' /*case 'PageBreaks'*/: switch(Rn[3]) {\n\t\t\t\t\tcase 'colbreaks' /*case 'ColBreaks'*/: break;\n\t\t\t\t\tcase 'colbreak' /*case 'ColBreak'*/: break;\n\t\t\t\t\tcase 'rowbreaks' /*case 'RowBreaks'*/: break;\n\t\t\t\t\tcase 'rowbreak' /*case 'RowBreak'*/: break;\n\t\t\t\t\tcase 'colstart' /*case 'ColStart'*/: break;\n\t\t\t\t\tcase 'colend' /*case 'ColEnd'*/: break;\n\t\t\t\t\tcase 'rowend' /*case 'RowEnd'*/: break;\n\t\t\t\t\tdefault: seen = false;\n\t\t\t\t} break;\n\n\t\t\t\t/* AutoFilter */\n\t\t\t\tcase 'autofilter' /*case 'AutoFilter'*/: switch(Rn[3]) {\n\t\t\t\t\tcase 'autofiltercolumn' /*case 'AutoFilterColumn'*/: break;\n\t\t\t\t\tcase 'autofiltercondition' /*case 'AutoFilterCondition'*/: break;\n\t\t\t\t\tcase 'autofilterand' /*case 'AutoFilterAnd'*/: break;\n\t\t\t\t\tcase 'autofilteror' /*case 'AutoFilterOr'*/: break;\n\t\t\t\t\tdefault: seen = false;\n\t\t\t\t} break;\n\n\t\t\t\t/* QueryTable */\n\t\t\t\tcase 'querytable' /*case 'QueryTable'*/: switch(Rn[3]) {\n\t\t\t\t\tcase 'id' /*case 'Id'*/: break;\n\t\t\t\t\tcase 'autoformatfont' /*case 'AutoFormatFont'*/: break;\n\t\t\t\t\tcase 'autoformatpattern' /*case 'AutoFormatPattern'*/: break;\n\t\t\t\t\tcase 'querysource' /*case 'QuerySource'*/: break;\n\t\t\t\t\tcase 'querytype' /*case 'QueryType'*/: break;\n\t\t\t\t\tcase 'enableredirections' /*case 'EnableRedirections'*/: break;\n\t\t\t\t\tcase 'refreshedinxl9' /*case 'RefreshedInXl9'*/: break;\n\t\t\t\t\tcase 'urlstring' /*case 'URLString'*/: break;\n\t\t\t\t\tcase 'htmltables' /*case 'HTMLTables'*/: break;\n\t\t\t\t\tcase 'connection' /*case 'Connection'*/: break;\n\t\t\t\t\tcase 'commandtext' /*case 'CommandText'*/: break;\n\t\t\t\t\tcase 'refreshinfo' /*case 'RefreshInfo'*/: break;\n\t\t\t\t\tcase 'notitles' /*case 'NoTitles'*/: break;\n\t\t\t\t\tcase 'nextid' /*case 'NextId'*/: break;\n\t\t\t\t\tcase 'columninfo' /*case 'ColumnInfo'*/: break;\n\t\t\t\t\tcase 'overwritecells' /*case 'OverwriteCells'*/: break;\n\t\t\t\t\tcase 'donotpromptforfile' /*case 'DoNotPromptForFile'*/: break;\n\t\t\t\t\tcase 'textwizardsettings' /*case 'TextWizardSettings'*/: break;\n\t\t\t\t\tcase 'source' /*case 'Source'*/: break;\n\t\t\t\t\tcase 'number' /*case 'Number'*/: break;\n\t\t\t\t\tcase 'decimal' /*case 'Decimal'*/: break;\n\t\t\t\t\tcase 'thousandseparator' /*case 'ThousandSeparator'*/: break;\n\t\t\t\t\tcase 'trailingminusnumbers' /*case 'TrailingMinusNumbers'*/: break;\n\t\t\t\t\tcase 'formatsettings' /*case 'FormatSettings'*/: break;\n\t\t\t\t\tcase 'fieldtype' /*case 'FieldType'*/: break;\n\t\t\t\t\tcase 'delimiters' /*case 'Delimiters'*/: break;\n\t\t\t\t\tcase 'tab' /*case 'Tab'*/: break;\n\t\t\t\t\tcase 'comma' /*case 'Comma'*/: break;\n\t\t\t\t\tcase 'autoformatname' /*case 'AutoFormatName'*/: break;\n\t\t\t\t\tcase 'versionlastedit' /*case 'VersionLastEdit'*/: break;\n\t\t\t\t\tcase 'versionlastrefresh' /*case 'VersionLastRefresh'*/: break;\n\t\t\t\t\tdefault: seen = false;\n\t\t\t\t} break;\n\n\t\t\t\tcase 'datavalidation' /*case 'DataValidation'*/:\n\t\t\t\tswitch(Rn[3]) {\n\t\t\t\t\tcase 'range' /*case 'Range'*/: break;\n\n\t\t\t\t\tcase 'type' /*case 'Type'*/: break;\n\t\t\t\t\tcase 'min' /*case 'Min'*/: break;\n\t\t\t\t\tcase 'max' /*case 'Max'*/: break;\n\t\t\t\t\tcase 'sort' /*case 'Sort'*/: break;\n\t\t\t\t\tcase 'descending' /*case 'Descending'*/: break;\n\t\t\t\t\tcase 'order' /*case 'Order'*/: break;\n\t\t\t\t\tcase 'casesensitive' /*case 'CaseSensitive'*/: break;\n\t\t\t\t\tcase 'value' /*case 'Value'*/: break;\n\t\t\t\t\tcase 'errorstyle' /*case 'ErrorStyle'*/: break;\n\t\t\t\t\tcase 'errormessage' /*case 'ErrorMessage'*/: break;\n\t\t\t\t\tcase 'errortitle' /*case 'ErrorTitle'*/: break;\n\t\t\t\t\tcase 'inputmessage' /*case 'InputMessage'*/: break;\n\t\t\t\t\tcase 'inputtitle' /*case 'InputTitle'*/: break;\n\t\t\t\t\tcase 'combohide' /*case 'ComboHide'*/: break;\n\t\t\t\t\tcase 'inputhide' /*case 'InputHide'*/: break;\n\t\t\t\t\tcase 'condition' /*case 'Condition'*/: break;\n\t\t\t\t\tcase 'qualifier' /*case 'Qualifier'*/: break;\n\t\t\t\t\tcase 'useblank' /*case 'UseBlank'*/: break;\n\t\t\t\t\tcase 'value1' /*case 'Value1'*/: break;\n\t\t\t\t\tcase 'value2' /*case 'Value2'*/: break;\n\t\t\t\t\tcase 'format' /*case 'Format'*/: break;\n\n\t\t\t\t\tcase 'cellrangelist' /*case 'CellRangeList'*/: break;\n\t\t\t\t\tdefault: seen = false;\n\t\t\t\t} break;\n\n\t\t\t\tcase 'sorting' /*case 'Sorting'*/:\n\t\t\t\tcase 'conditionalformatting' /*case 'ConditionalFormatting'*/:\n\t\t\t\tswitch(Rn[3]) {\n\t\t\t\t\tcase 'range' /*case 'Range'*/: break;\n\t\t\t\t\tcase 'type' /*case 'Type'*/: break;\n\t\t\t\t\tcase 'min' /*case 'Min'*/: break;\n\t\t\t\t\tcase 'max' /*case 'Max'*/: break;\n\t\t\t\t\tcase 'sort' /*case 'Sort'*/: break;\n\t\t\t\t\tcase 'descending' /*case 'Descending'*/: break;\n\t\t\t\t\tcase 'order' /*case 'Order'*/: break;\n\t\t\t\t\tcase 'casesensitive' /*case 'CaseSensitive'*/: break;\n\t\t\t\t\tcase 'value' /*case 'Value'*/: break;\n\t\t\t\t\tcase 'errorstyle' /*case 'ErrorStyle'*/: break;\n\t\t\t\t\tcase 'errormessage' /*case 'ErrorMessage'*/: break;\n\t\t\t\t\tcase 'errortitle' /*case 'ErrorTitle'*/: break;\n\t\t\t\t\tcase 'cellrangelist' /*case 'CellRangeList'*/: break;\n\t\t\t\t\tcase 'inputmessage' /*case 'InputMessage'*/: break;\n\t\t\t\t\tcase 'inputtitle' /*case 'InputTitle'*/: break;\n\t\t\t\t\tcase 'combohide' /*case 'ComboHide'*/: break;\n\t\t\t\t\tcase 'inputhide' /*case 'InputHide'*/: break;\n\t\t\t\t\tcase 'condition' /*case 'Condition'*/: break;\n\t\t\t\t\tcase 'qualifier' /*case 'Qualifier'*/: break;\n\t\t\t\t\tcase 'useblank' /*case 'UseBlank'*/: break;\n\t\t\t\t\tcase 'value1' /*case 'Value1'*/: break;\n\t\t\t\t\tcase 'value2' /*case 'Value2'*/: break;\n\t\t\t\t\tcase 'format' /*case 'Format'*/: break;\n\t\t\t\t\tdefault: seen = false;\n\t\t\t\t} break;\n\n\t\t\t\t/* MapInfo (schema) */\n\t\t\t\tcase 'mapinfo' /*case 'MapInfo'*/: case 'schema' /*case 'Schema'*/: case 'data' /*case 'data'*/: switch(Rn[3]) {\n\t\t\t\t\tcase 'map' /*case 'Map'*/: break;\n\t\t\t\t\tcase 'entry' /*case 'Entry'*/: break;\n\t\t\t\t\tcase 'range' /*case 'Range'*/: break;\n\t\t\t\t\tcase 'xpath' /*case 'XPath'*/: break;\n\t\t\t\t\tcase 'field' /*case 'Field'*/: break;\n\t\t\t\t\tcase 'xsdtype' /*case 'XSDType'*/: break;\n\t\t\t\t\tcase 'filteron' /*case 'FilterOn'*/: break;\n\t\t\t\t\tcase 'aggregate' /*case 'Aggregate'*/: break;\n\t\t\t\t\tcase 'elementtype' /*case 'ElementType'*/: break;\n\t\t\t\t\tcase 'attributetype' /*case 'AttributeType'*/: break;\n\t\t\t\t/* These are from xsd (XML Schema Definition) */\n\t\t\t\t\tcase 'schema' /*case 'schema'*/:\n\t\t\t\t\tcase 'element' /*case 'element'*/:\n\t\t\t\t\tcase 'complextype' /*case 'complexType'*/:\n\t\t\t\t\tcase 'datatype' /*case 'datatype'*/:\n\t\t\t\t\tcase 'all' /*case 'all'*/:\n\t\t\t\t\tcase 'attribute' /*case 'attribute'*/:\n\t\t\t\t\tcase 'extends' /*case 'extends'*/: break;\n\n\t\t\t\t\tcase 'row' /*case 'row'*/: break;\n\t\t\t\t\tdefault: seen = false;\n\t\t\t\t} break;\n\n\t\t\t\t/* SmartTags (can be anything) */\n\t\t\t\tcase 'smarttags' /*case 'SmartTags'*/: break;\n\n\t\t\t\tdefault: seen = false; break;\n\t\t\t}\n\t\t\tif(seen) break;\n\t\t\t/* CustomDocumentProperties */\n\t\t\tif(Rn[3].match(/!\\[CDATA/)) break;\n\t\t\tif(!state[state.length-1][1]) throw 'Unrecognized tag: ' + Rn[3] + \"|\" + state.join(\"|\");\n\t\t\tif(state[state.length-1][0]===/*'CustomDocumentProperties'*/'customdocumentproperties') {\n\t\t\t\tif(Rn[0].slice(-2) === \"/>\") break;\n\t\t\t\telse if(Rn[1]===\"/\") xlml_set_custprop(Custprops, raw_Rn3, cp, str.slice(pidx, Rn.index));\n\t\t\t\telse { cp = Rn; pidx = Rn.index + Rn[0].length; }\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(opts.WTF) throw 'Unrecognized tag: ' + Rn[3] + \"|\" + state.join(\"|\");\n\t}\n\tvar out = ({}/*:any*/);\n\tif(!opts.bookSheets && !opts.bookProps) out.Sheets = sheets;\n\tout.SheetNames = sheetnames;\n\tout.Workbook = Workbook;\n\tout.SSF = dup(table_fmt);\n\tout.Props = Props;\n\tout.Custprops = Custprops;\n\tout.bookType = \"xlml\";\n\treturn out;\n}\n\nfunction parse_xlml(data/*:RawBytes|string*/, opts)/*:Workbook*/ {\n\tfix_read_opts(opts=opts||{});\n\tswitch(opts.type||\"base64\") {\n\t\tcase \"base64\": return parse_xlml_xml(Base64_decode(data), opts);\n\t\tcase \"binary\": case \"buffer\": case \"file\": return parse_xlml_xml(data, opts);\n\t\tcase \"array\": return parse_xlml_xml(a2s(data), opts);\n\t}\n\t/*:: throw new Error(\"unsupported type \" + opts.type); */\n}\n\n/* TODO */\nfunction write_props_xlml(wb/*:Workbook*/, opts)/*:string*/ {\n\tvar o/*:Array*/ = [];\n\t/* DocumentProperties */\n\tif(wb.Props) o.push(xlml_write_docprops(wb.Props, opts));\n\t/* CustomDocumentProperties */\n\tif(wb.Custprops) o.push(xlml_write_custprops(wb.Props, wb.Custprops, opts));\n\treturn o.join(\"\");\n}\n/* TODO */\nfunction write_wb_xlml(wb/*::, opts*/)/*:string*/ {\n\t/* OfficeDocumentSettings */\n\t/* ExcelWorkbook */\n\tif((((wb||{}).Workbook||{}).WBProps||{}).date1904) return '';\n\treturn \"\";\n}\n/* TODO */\nfunction write_sty_xlml(wb, opts)/*:string*/ {\n\t/* Styles */\n\tvar styles/*:Array*/ = [''];\n\topts.cellXfs.forEach(function(xf, id) {\n\t\tvar payload/*:Array*/ = [];\n\t\tpayload.push(writextag('NumberFormat', null, {\"ss:Format\": escapexml(table_fmt[xf.numFmtId])}));\n\n\t\tvar o = /*::(*/{\"ss:ID\": \"s\" + (21+id)}/*:: :any)*/;\n\t\tstyles.push(writextag('Style', payload.join(\"\"), o));\n\t});\n\treturn writextag(\"Styles\", styles.join(\"\"));\n}\nfunction write_name_xlml(n) { return writextag(\"NamedRange\", null, {\"ss:Name\": n.Name.slice(0,6) == \"_xlnm.\" ? n.Name.slice(6) : n.Name, \"ss:RefersTo\":\"=\" + a1_to_rc(n.Ref, {r:0,c:0})}); }\nfunction write_names_xlml(wb/*::, opts*/)/*:string*/ {\n\tif(!((wb||{}).Workbook||{}).Names) return \"\";\n\t/*:: if(!wb || !wb.Workbook || !wb.Workbook.Names) throw new Error(\"unreachable\"); */\n\tvar names/*:Array*/ = wb.Workbook.Names;\n\tvar out/*:Array*/ = [];\n\tfor(var i = 0; i < names.length; ++i) {\n\t\tvar n = names[i];\n\t\tif(n.Sheet != null) continue;\n\t\tif(n.Name.match(/^_xlfn\\./)) continue;\n\t\tout.push(write_name_xlml(n));\n\t}\n\treturn writextag(\"Names\", out.join(\"\"));\n}\nfunction write_ws_xlml_names(ws/*:Worksheet*/, opts, idx/*:number*/, wb/*:Workbook*/)/*:string*/ {\n\tif(!ws) return \"\";\n\tif(!((wb||{}).Workbook||{}).Names) return \"\";\n\t/*:: if(!wb || !wb.Workbook || !wb.Workbook.Names) throw new Error(\"unreachable\"); */\n\tvar names/*:Array*/ = wb.Workbook.Names;\n\tvar out/*:Array*/ = [];\n\tfor(var i = 0; i < names.length; ++i) {\n\t\tvar n = names[i];\n\t\tif(n.Sheet != idx) continue;\n\t\t/*switch(n.Name) {\n\t\t\tcase \"_\": continue;\n\t\t}*/\n\t\tif(n.Name.match(/^_xlfn\\./)) continue;\n\t\tout.push(write_name_xlml(n));\n\t}\n\treturn out.join(\"\");\n}\n/* WorksheetOptions */\nfunction write_ws_xlml_wsopts(ws/*:Worksheet*/, opts, idx/*:number*/, wb/*:Workbook*/)/*:string*/ {\n\tif(!ws) return \"\";\n\tvar o/*:Array*/ = [];\n\t/* NOTE: spec technically allows any order, but stick with implied order */\n\n\t/* FitToPage */\n\t/* DoNotDisplayColHeaders */\n\t/* DoNotDisplayRowHeaders */\n\t/* ViewableRange */\n\t/* Selection */\n\t/* GridlineColor */\n\t/* Name */\n\t/* ExcelWorksheetType */\n\t/* IntlMacro */\n\t/* Unsynced */\n\t/* Selected */\n\t/* CodeName */\n\n\tif(ws['!margins']) {\n\t\to.push(\"\");\n\t\tif(ws['!margins'].header) o.push(writextag(\"Header\", null, {'x:Margin':ws['!margins'].header}));\n\t\tif(ws['!margins'].footer) o.push(writextag(\"Footer\", null, {'x:Margin':ws['!margins'].footer}));\n\t\to.push(writextag(\"PageMargins\", null, {\n\t\t\t'x:Bottom': ws['!margins'].bottom || \"0.75\",\n\t\t\t'x:Left': ws['!margins'].left || \"0.7\",\n\t\t\t'x:Right': ws['!margins'].right || \"0.7\",\n\t\t\t'x:Top': ws['!margins'].top || \"0.75\"\n\t\t}));\n\t\to.push(\"\");\n\t}\n\n\t/* PageSetup */\n\t/* DisplayPageBreak */\n\t/* TransitionExpressionEvaluation */\n\t/* TransitionFormulaEntry */\n\t/* Print */\n\t/* Zoom */\n\t/* PageLayoutZoom */\n\t/* PageBreakZoom */\n\t/* ShowPageBreakZoom */\n\t/* DefaultRowHeight */\n\t/* DefaultColumnWidth */\n\t/* StandardWidth */\n\n\tif(wb && wb.Workbook && wb.Workbook.Sheets && wb.Workbook.Sheets[idx]) {\n\t\t/* Visible */\n\t\tif(wb.Workbook.Sheets[idx].Hidden) o.push(writextag(\"Visible\", (wb.Workbook.Sheets[idx].Hidden == 1 ? \"SheetHidden\" : \"SheetVeryHidden\"), {}));\n\t\telse {\n\t\t\t/* Selected */\n\t\t\tfor(var i = 0; i < idx; ++i) if(wb.Workbook.Sheets[i] && !wb.Workbook.Sheets[i].Hidden) break;\n\t\t\tif(i == idx) o.push(\"\");\n\t\t}\n\t}\n\n\t/* LeftColumnVisible */\n\n\tif(((((wb||{}).Workbook||{}).Views||[])[0]||{}).RTL) o.push(\"\");\n\n\t/* GridlineColorIndex */\n\t/* DisplayFormulas */\n\t/* DoNotDisplayGridlines */\n\t/* DoNotDisplayHeadings */\n\t/* DoNotDisplayOutline */\n\t/* ApplyAutomaticOutlineStyles */\n\t/* NoSummaryRowsBelowDetail */\n\t/* NoSummaryColumnsRightDetail */\n\t/* DoNotDisplayZeros */\n\t/* ActiveRow */\n\t/* ActiveColumn */\n\t/* FilterOn */\n\t/* RangeSelection */\n\t/* TopRowVisible */\n\t/* TopRowBottomPane */\n\t/* LeftColumnRightPane */\n\t/* ActivePane */\n\t/* SplitHorizontal */\n\t/* SplitVertical */\n\t/* FreezePanes */\n\t/* FrozenNoSplit */\n\t/* TabColorIndex */\n\t/* Panes */\n\n\t/* NOTE: Password not supported in XLML Format */\n\tif(ws['!protect']) {\n\t\to.push(writetag(\"ProtectContents\", \"True\"));\n\t\tif(ws['!protect'].objects) o.push(writetag(\"ProtectObjects\", \"True\"));\n\t\tif(ws['!protect'].scenarios) o.push(writetag(\"ProtectScenarios\", \"True\"));\n\t\tif(ws['!protect'].selectLockedCells != null && !ws['!protect'].selectLockedCells) o.push(writetag(\"EnableSelection\", \"NoSelection\"));\n\t\telse if(ws['!protect'].selectUnlockedCells != null && !ws['!protect'].selectUnlockedCells) o.push(writetag(\"EnableSelection\", \"UnlockedCells\"));\n\t[\n\t\t[ \"formatCells\", \"AllowFormatCells\" ],\n\t\t[ \"formatColumns\", \"AllowSizeCols\" ],\n\t\t[ \"formatRows\", \"AllowSizeRows\" ],\n\t\t[ \"insertColumns\", \"AllowInsertCols\" ],\n\t\t[ \"insertRows\", \"AllowInsertRows\" ],\n\t\t[ \"insertHyperlinks\", \"AllowInsertHyperlinks\" ],\n\t\t[ \"deleteColumns\", \"AllowDeleteCols\" ],\n\t\t[ \"deleteRows\", \"AllowDeleteRows\" ],\n\t\t[ \"sort\", \"AllowSort\" ],\n\t\t[ \"autoFilter\", \"AllowFilter\" ],\n\t\t[ \"pivotTables\", \"AllowUsePivotTables\" ]\n\t].forEach(function(x) { if(ws['!protect'][x[0]]) o.push(\"<\"+x[1]+\"/>\"); });\n\t}\n\n\tif(o.length == 0) return \"\";\n\treturn writextag(\"WorksheetOptions\", o.join(\"\"), {xmlns:XLMLNS.x});\n}\nfunction write_ws_xlml_comment(comments/*:Array*/)/*:string*/ {\n\t/* TODO: test multiple comments */\n\treturn comments.map(function(c) {\n\t\t// TODO: formatted text\n\t\tvar t = xlml_unfixstr(c.t||\"\");\n\t\tvar d =writextag(\"ss:Data\", t, {\"xmlns\":\"http://www.w3.org/TR/REC-html40\"});\n\t\tvar p = {};\n\t\tif(c.a) p[\"ss:Author\"] = c.a;\n\t\tif(!comments.hidden) p[\"ss:ShowAlways\"] = \"1\";\n\t\treturn writextag(\"Comment\", d, p);\n\t}).join(\"\");\n}\nfunction write_ws_xlml_cell(cell, ref/*:string*/, ws, opts, idx/*:number*/, wb, addr)/*:string*/{\n\tif(!cell || (cell.v == undefined && cell.f == undefined)) return \"\";\n\n\tvar attr = {};\n\tif(cell.f) attr[\"ss:Formula\"] = \"=\" + escapexml(a1_to_rc(cell.f, addr));\n\tif(cell.F && cell.F.slice(0, ref.length) == ref) {\n\t\tvar end = decode_cell(cell.F.slice(ref.length + 1));\n\t\tattr[\"ss:ArrayRange\"] = \"RC:R\" + (end.r == addr.r ? \"\" : \"[\" + (end.r - addr.r) + \"]\") + \"C\" + (end.c == addr.c ? \"\" : \"[\" + (end.c - addr.c) + \"]\");\n\t}\n\n\tif(cell.l && cell.l.Target) {\n\t\tattr[\"ss:HRef\"] = escapexml(cell.l.Target);\n\t\tif(cell.l.Tooltip) attr[\"x:HRefScreenTip\"] = escapexml(cell.l.Tooltip);\n\t}\n\n\tif(ws['!merges']) {\n\t\tvar marr = ws['!merges'];\n\t\tfor(var mi = 0; mi != marr.length; ++mi) {\n\t\t\tif(marr[mi].s.c != addr.c || marr[mi].s.r != addr.r) continue;\n\t\t\tif(marr[mi].e.c > marr[mi].s.c) attr['ss:MergeAcross'] = marr[mi].e.c - marr[mi].s.c;\n\t\t\tif(marr[mi].e.r > marr[mi].s.r) attr['ss:MergeDown'] = marr[mi].e.r - marr[mi].s.r;\n\t\t}\n\t}\n\n\tvar t = \"\", p = \"\";\n\tswitch(cell.t) {\n\t\tcase 'z': if(!opts.sheetStubs) return \"\"; break;\n\t\tcase 'n': {\n\t\t\tif(!isFinite(cell.v)) {\n\t\t\t\tt = 'Error'; p = BErr[isNaN(cell.v) ? 0x24 : 0x07];\n\t\t\t} else {\n\t\t\t\tt = 'Number'; p = String(cell.v);\n\t\t\t}\n\t\t} break;\n\t\tcase 'b': t = 'Boolean'; p = (cell.v ? \"1\" : \"0\"); break;\n\t\tcase 'e': t = 'Error'; p = BErr[cell.v]; break;\n\t\tcase 'd': t = 'DateTime'; p = new Date(cell.v).toISOString(); if(cell.z == null) cell.z = cell.z || table_fmt[14]; break;\n\t\tcase 's': t = 'String'; p = escapexlml(cell.v||\"\"); break;\n\t}\n\t/* TODO: cell style */\n\tvar os = get_cell_style(opts.cellXfs, cell, opts);\n\tattr[\"ss:StyleID\"] = \"s\" + (21+os);\n\tattr[\"ss:Index\"] = addr.c + 1;\n\tvar _v = (cell.v != null ? p : \"\");\n\tvar m = cell.t == 'z' ? \"\" : ('' + _v + '');\n\n\tif((cell.c||[]).length > 0) m += write_ws_xlml_comment(cell.c);\n\n\treturn writextag(\"Cell\", m, attr);\n}\nfunction write_ws_xlml_row(R/*:number*/, row)/*:string*/ {\n\tvar o = '';\n}\n/* TODO */\nfunction write_ws_xlml_table(ws/*:Worksheet*/, opts, idx/*:number*/, wb/*:Workbook*/)/*:string*/ {\n\tif(!ws['!ref']) return \"\";\n\tvar range/*:Range*/ = safe_decode_range(ws['!ref']);\n\tvar marr/*:Array*/ = ws['!merges'] || [], mi = 0;\n\tvar o/*:Array*/ = [];\n\tif(ws['!cols']) ws['!cols'].forEach(function(n, i) {\n\t\tprocess_col(n);\n\t\tvar w = !!n.width;\n\t\tvar p = col_obj_w(i, n);\n\t\tvar k/*:any*/ = {\"ss:Index\":i+1};\n\t\tif(w) k['ss:Width'] = width2px(p.width);\n\t\tif(n.hidden) k['ss:Hidden']=\"1\";\n\t\to.push(writextag(\"Column\",null,k));\n\t});\n\tvar dense = ws[\"!data\"] != null;\n\tvar addr = {r:0,c:0};\n\tfor(var R = range.s.r; R <= range.e.r; ++R) {\n\t\tvar row = [write_ws_xlml_row(R, (ws['!rows']||[])[R])];\n\t\taddr.r = R;\n\t\tfor(var C = range.s.c; C <= range.e.c; ++C) {\n\t\t\taddr.c = C;\n\t\t\tvar skip = false;\n\t\t\tfor(mi = 0; mi != marr.length; ++mi) {\n\t\t\t\tif(marr[mi].s.c > C) continue;\n\t\t\t\tif(marr[mi].s.r > R) continue;\n\t\t\t\tif(marr[mi].e.c < C) continue;\n\t\t\t\tif(marr[mi].e.r < R) continue;\n\t\t\t\tif(marr[mi].s.c != C || marr[mi].s.r != R) skip = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(skip) continue;\n\t\t\tvar ref = encode_col(C) + encode_row(R), cell = dense ? (ws[\"!data\"][R]||[])[C] : ws[ref];\n\t\t\trow.push(write_ws_xlml_cell(cell, ref, ws, opts, idx, wb, addr));\n\t\t}\n\t\trow.push(\"\");\n\t\tif(row.length > 2) o.push(row.join(\"\"));\n\t}\n\treturn o.join(\"\");\n}\nfunction write_ws_xlml(idx/*:number*/, opts, wb/*:Workbook*/)/*:string*/ {\n\tvar o/*:Array*/ = [];\n\tvar s = wb.SheetNames[idx];\n\tvar ws = wb.Sheets[s];\n\n\tvar t/*:string*/ = ws ? write_ws_xlml_names(ws, opts, idx, wb) : \"\";\n\tif(t.length > 0) o.push(\"\" + t + \"\");\n\n\t/* Table */\n\tt = ws ? write_ws_xlml_table(ws, opts, idx, wb) : \"\";\n\tif(t.length > 0) o.push(\"
\" + t + \"
\");\n\n\t/* WorksheetOptions */\n\to.push(write_ws_xlml_wsopts(ws, opts, idx, wb));\n\n\tif(ws && ws[\"!autofilter\"]) o.push('');\n\n\treturn o.join(\"\");\n}\nfunction write_xlml(wb, opts)/*:string*/ {\n\tif(!opts) opts = {};\n\tif(!wb.SSF) wb.SSF = dup(table_fmt);\n\tif(wb.SSF) {\n\t\tmake_ssf(); SSF_load_table(wb.SSF);\n\t\t// $FlowIgnore\n\t\topts.revssf = evert_num(wb.SSF); opts.revssf[wb.SSF[65535]] = 0;\n\t\topts.ssf = wb.SSF;\n\t\topts.cellXfs = [];\n\t\tget_cell_style(opts.cellXfs, {}, {revssf:{\"General\":0}});\n\t}\n\tvar d/*:Array*/ = [];\n\td.push(write_props_xlml(wb, opts));\n\td.push(write_wb_xlml(wb, opts));\n\td.push(\"\");\n\td.push(write_names_xlml(wb, opts));\n\tfor(var i = 0; i < wb.SheetNames.length; ++i)\n\t\td.push(writextag(\"Worksheet\", write_ws_xlml(i, opts, wb), {\"ss:Name\":escapexml(wb.SheetNames[i])}));\n\td[2] = write_sty_xlml(wb, opts);\n\treturn XML_HEADER + writextag(\"Workbook\", d.join(\"\"), {\n\t\t'xmlns': XLMLNS.ss,\n\t\t'xmlns:o': XLMLNS.o,\n\t\t'xmlns:x': XLMLNS.x,\n\t\t'xmlns:ss': XLMLNS.ss,\n\t\t'xmlns:dt': XLMLNS.dt,\n\t\t'xmlns:html': XLMLNS.html\n\t});\n}\n/* [MS-OLEDS] 2.3.8 CompObjStream */\nfunction parse_compobj(obj/*:CFBEntry*/) {\n\tvar v = {};\n\tvar o = obj.content;\n\t/*:: if(o == null) return; */\n\n\t/* [MS-OLEDS] 2.3.7 CompObjHeader -- All fields MUST be ignored */\n\to.l = 28;\n\n\tv.AnsiUserType = o.read_shift(0, \"lpstr-ansi\");\n\tv.AnsiClipboardFormat = parse_ClipboardFormatOrAnsiString(o);\n\n\tif(o.length - o.l <= 4) return v;\n\n\tvar m/*:number*/ = o.read_shift(4);\n\tif(m == 0 || m > 40) return v;\n\to.l-=4; v.Reserved1 = o.read_shift(0, \"lpstr-ansi\");\n\n\tif(o.length - o.l <= 4) return v;\n\tm = o.read_shift(4);\n\tif(m !== 0x71b239f4) return v;\n\tv.UnicodeClipboardFormat = parse_ClipboardFormatOrUnicodeString(o);\n\n\tm = o.read_shift(4);\n\tif(m == 0 || m > 40) return v;\n\to.l-=4; v.Reserved2 = o.read_shift(0, \"lpwstr\");\n}\n\n/*\n\tContinue logic for:\n\t- 2.4.58 Continue 0x003c\n\t- 2.4.59 ContinueBigName 0x043c\n\t- 2.4.60 ContinueFrt 0x0812\n\t- 2.4.61 ContinueFrt11 0x0875\n\t- 2.4.62 ContinueFrt12 0x087f\n*/\nvar CONTINUE_RT = [ 0x003c, 0x043c, 0x0812, 0x0875, 0x087f ];\nfunction slurp(RecordType, R, blob, length/*:number*/, opts)/*:any*/ {\n\tvar l = length;\n\tvar bufs = [];\n\tvar d = blob.slice(blob.l,blob.l+l);\n\tif(opts && opts.enc && opts.enc.insitu && d.length > 0) switch(RecordType) {\n\tcase 0x0009: case 0x0209: case 0x0409: case 0x0809/* BOF */: case 0x002F /* FilePass */: case 0x0195 /* FileLock */: case 0x00E1 /* InterfaceHdr */: case 0x0196 /* RRDInfo */: case 0x0138 /* RRDHead */: case 0x0194 /* UsrExcl */: case 0x000a /* EOF */:\n\t\tbreak;\n\tcase 0x0085 /* BoundSheet8 */:\n\t\tbreak;\n\tdefault:\n\t\topts.enc.insitu(d);\n\t}\n\tbufs.push(d);\n\tblob.l += l;\n\tvar nextrt = __readUInt16LE(blob,blob.l), next = XLSRecordEnum[nextrt];\n\tvar start = 0;\n\twhile(next != null && CONTINUE_RT.indexOf(nextrt) > -1) {\n\t\tl = __readUInt16LE(blob,blob.l+2);\n\t\tstart = blob.l + 4;\n\t\tif(nextrt == 0x0812 /* ContinueFrt */) start += 4;\n\t\telse if(nextrt == 0x0875 || nextrt == 0x087f) {\n\t\t\tstart += 12;\n\t\t}\n\t\td = blob.slice(start,blob.l+4+l);\n\t\tbufs.push(d);\n\t\tblob.l += 4+l;\n\t\tnext = (XLSRecordEnum[nextrt = __readUInt16LE(blob, blob.l)]);\n\t}\n\tvar b = (bconcat(bufs)/*:any*/);\n\tprep_blob(b, 0);\n\tvar ll = 0; b.lens = [];\n\tfor(var j = 0; j < bufs.length; ++j) { b.lens.push(ll); ll += bufs[j].length; }\n\tif(b.length < length) throw \"XLS Record 0x\" + RecordType.toString(16) + \" Truncated: \" + b.length + \" < \" + length;\n\treturn R.f(b, b.length, opts);\n}\n\nfunction safe_format_xf(p/*:any*/, opts/*:ParseOpts*/, date1904/*:?boolean*/) {\n\tif(p.t === 'z') return;\n\tif(!p.XF) return;\n\tvar fmtid = 0;\n\ttry {\n\t\tfmtid = p.z || p.XF.numFmtId || 0;\n\t\tif(opts.cellNF && p.z == null) p.z = table_fmt[fmtid];\n\t} catch(e) { if(opts.WTF) throw e; }\n\tif(!opts || opts.cellText !== false) try {\n\t\tif(p.t === 'e') { p.w = p.w || BErr[p.v]; }\n\t\telse if(fmtid === 0 || fmtid == \"General\") {\n\t\t\tif(p.t === 'n') {\n\t\t\t\tif((p.v|0) === p.v) p.w = p.v.toString(10);\n\t\t\t\telse p.w = SSF_general_num(p.v);\n\t\t\t}\n\t\t\telse p.w = SSF_general(p.v);\n\t\t}\n\t\telse p.w = SSF_format(fmtid,p.v, {date1904:!!date1904, dateNF: opts && opts.dateNF});\n\t} catch(e) { if(opts.WTF) throw e; }\n\tif(opts.cellDates && fmtid && p.t == 'n' && fmt_is_date(table_fmt[fmtid] || String(fmtid))) {\n\t\tvar _d = SSF_parse_date_code(p.v + (date1904 ? 1462 : 0)); if(_d) { p.t = 'd'; p.v = new Date(Date.UTC(_d.y, _d.m-1,_d.d,_d.H,_d.M,_d.S,_d.u)); }\n\t}\n}\n\nfunction make_cell(val, ixfe, t)/*:Cell*/ {\n\treturn ({v:val, ixfe:ixfe, t:t}/*:any*/);\n}\n\n// 2.3.2\nfunction parse_workbook(blob, options/*:ParseOpts*/)/*:Workbook*/ {\n\tvar wb = ({opts:{}}/*:any*/);\n\tvar Sheets = {};\n\tif(DENSE != null && options.dense == null) options.dense = DENSE;\n\tvar out/*:Worksheet*/ = ({}/*:any*/); if(options.dense) out[\"!data\"] = [];\n\tvar Directory = {};\n\tvar range/*:Range*/ = ({}/*:any*/);\n\tvar last_formula = null;\n\tvar sst/*:SST*/ = ([]/*:any*/);\n\tvar cur_sheet = \"\";\n\tvar Preamble = {};\n\tvar lastcell, last_cell = \"\", cc/*:Cell*/, cmnt, rngC, rngR;\n\tvar sharedf = {};\n\tvar arrayf/*:Array<[Range, string]>*/ = [];\n\tvar temp_val/*:Cell*/;\n\tvar country;\n\tvar XFs = []; /* XF records */\n\tvar palette/*:Array<[number, number, number]>*/ = [];\n\tvar Workbook/*:WBWBProps*/ = ({ Sheets:[], WBProps:{date1904:false}, Views:[{}] }/*:any*/), wsprops = {};\n\tvar biff4w = false;\n\tvar get_rgb = function getrgb(icv/*:number*/)/*:[number, number, number]*/ {\n\t\tif(icv < 8) return XLSIcv[icv];\n\t\tif(icv < 64) return palette[icv-8] || XLSIcv[icv];\n\t\treturn XLSIcv[icv];\n\t};\n\tvar process_cell_style = function pcs(line/*:any*/, options) {\n\t\tvar xfd = line.XF.data;\n\t\tif(!xfd || !xfd.patternType || !options || !options.cellStyles) return;\n\t\tline.s = ({}/*:any*/);\n\t\tline.s.patternType = xfd.patternType;\n\t\tvar t;\n\t\tif((t = rgb2Hex(get_rgb(xfd.icvFore)))) { line.s.fgColor = {rgb:t}; }\n\t\tif((t = rgb2Hex(get_rgb(xfd.icvBack)))) { line.s.bgColor = {rgb:t}; }\n\t};\n\tvar addcell = function addcell(cell/*:any*/, line/*:any*/, options/*:any*/) {\n\t\tif(!biff4w && file_depth > 1) return;\n\t\tif(options.sheetRows && cell.r >= options.sheetRows) return;\n\t\tif(options.cellStyles && line.XF && line.XF.data) process_cell_style(line, options);\n\t\tdelete line.ixfe; delete line.XF;\n\t\tlastcell = cell;\n\t\tlast_cell = encode_cell(cell);\n\t\tif(!range || !range.s || !range.e) range = {s:{r:0,c:0},e:{r:0,c:0}};\n\t\tif(cell.r < range.s.r) range.s.r = cell.r;\n\t\tif(cell.c < range.s.c) range.s.c = cell.c;\n\t\tif(cell.r + 1 > range.e.r) range.e.r = cell.r + 1;\n\t\tif(cell.c + 1 > range.e.c) range.e.c = cell.c + 1;\n\t\tif(options.cellFormula && line.f) {\n\t\t\tfor(var afi = 0; afi < arrayf.length; ++afi) {\n\t\t\t\tif(arrayf[afi][0].s.c > cell.c || arrayf[afi][0].s.r > cell.r) continue;\n\t\t\t\tif(arrayf[afi][0].e.c < cell.c || arrayf[afi][0].e.r < cell.r) continue;\n\t\t\t\tline.F = encode_range(arrayf[afi][0]);\n\t\t\t\tif(arrayf[afi][0].s.c != cell.c || arrayf[afi][0].s.r != cell.r) delete line.f;\n\t\t\t\tif(line.f) line.f = \"\" + stringify_formula(arrayf[afi][1], range, cell, supbooks, opts);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t{\n\t\t\tif(options.dense) {\n\t\t\t\tif(!out[\"!data\"][cell.r]) out[\"!data\"][cell.r] = [];\n\t\t\t\tout[\"!data\"][cell.r][cell.c] = line;\n\t\t\t} else out[last_cell] = line;\n\t\t}\n\t};\n\tvar opts = ({\n\t\tenc: false, // encrypted\n\t\tsbcch: 0, // cch in the preceding SupBook\n\t\tsnames: [], // sheetnames\n\t\tsharedf: sharedf, // shared formulae by address\n\t\tarrayf: arrayf, // array formulae array\n\t\trrtabid: [], // RRTabId\n\t\tlastuser: \"\", // Last User from WriteAccess\n\t\tbiff: 8, // BIFF version\n\t\tcodepage: 0, // CP from CodePage record\n\t\twinlocked: 0, // fLockWn from WinProtect\n\t\tcellStyles: !!options && !!options.cellStyles,\n\t\tWTF: !!options && !!options.wtf\n\t}/*:any*/);\n\tif(options.password) opts.password = options.password;\n\tvar themes;\n\tvar merges/*:Array*/ = [];\n\tvar objects = [];\n\tvar colinfo/*:Array*/ = [], rowinfo/*:Array*/ = [];\n\tvar seencol = false;\n\tvar supbooks = ([]/*:any*/); // 1-indexed, will hold extern names\n\tsupbooks.SheetNames = opts.snames;\n\tsupbooks.sharedf = opts.sharedf;\n\tsupbooks.arrayf = opts.arrayf;\n\tsupbooks.names = [];\n\tsupbooks.XTI = [];\n\tvar last_RT = 0;\n\tvar file_depth = 0; /* TODO: make a real stack */\n\tvar BIFF2Fmt = 0, BIFF2FmtTable/*:Array*/ = [];\n\tvar FilterDatabases = []; /* TODO: sort out supbooks and process elsewhere */\n\tvar last_lbl/*:?DefinedName*/;\n\n\t/* explicit override for some broken writers */\n\topts.codepage = 1200;\n\tset_cp(1200);\n\tvar seen_codepage = false;\n\twhile(blob.l < blob.length - 1) {\n\t\tvar s = blob.l;\n\t\tvar RecordType = blob.read_shift(2);\n\t\tif(RecordType === 0 && last_RT === 0x000a /* EOF */) break;\n\t\tvar length = (blob.l === blob.length ? 0 : blob.read_shift(2));\n\t\tvar R = XLSRecordEnum[RecordType];\n\t\tif(file_depth == 0 && [0x0009, 0x0209, 0x0409, 0x0809].indexOf(RecordType) == -1 /* BOF */) break;\n\t\t//console.log(RecordType.toString(16), RecordType, R, blob.l, length, blob.length);\n\t\t//if(!R) console.log(blob.slice(blob.l, blob.l + length));\n\t\tif(R && R.f) {\n\t\t\tif(options.bookSheets) {\n\t\t\t\tif(last_RT === 0x0085 /* BoundSheet8 */ && RecordType !== 0x0085 /* R.n !== 'BoundSheet8' */) break;\n\t\t\t}\n\t\t\tlast_RT = RecordType;\n\t\t\tif(R.r === 2 || R.r == 12) {\n\t\t\t\tvar rt = blob.read_shift(2); length -= 2;\n\t\t\t\tif(!opts.enc && rt !== RecordType && (((rt&0xFF)<<8)|(rt>>8)) !== RecordType) throw new Error(\"rt mismatch: \" + rt + \"!=\" + RecordType);\n\t\t\t\tif(R.r == 12){\n\t\t\t\t\tblob.l += 10; length -= 10;\n\t\t\t\t} // skip FRT\n\t\t\t}\n\t\t\t//console.error(R,blob.l,length,blob.length);\n\t\t\tvar val/*:any*/ = ({}/*:any*/);\n\t\t\tif(RecordType === 0x000a /* EOF */) val = /*::(*/R.f(blob, length, opts)/*:: :any)*/;\n\t\t\telse val = /*::(*/slurp(RecordType, R, blob, length, opts)/*:: :any)*/;\n\t\t\t/*:: val = (val:any); */\n\t\t\tif(file_depth == 0 && [0x0009, 0x0209, 0x0409, 0x0809].indexOf(last_RT) === -1 /* BOF */) continue;\n\t\t\tswitch(RecordType) {\n\t\t\t\tcase 0x0022 /* Date1904 */:\n\t\t\t\t\t/*:: if(!Workbook.WBProps) Workbook.WBProps = {}; */\n\t\t\t\t\twb.opts.Date1904 = Workbook.WBProps.date1904 = val; break;\n\t\t\t\tcase 0x0086 /* WriteProtect */: wb.opts.WriteProtect = true; break;\n\t\t\t\tcase 0x002f /* FilePass */:\n\t\t\t\t\tif(!opts.enc) blob.l = 0;\n\t\t\t\t\topts.enc = val;\n\t\t\t\t\tif(!options.password) throw new Error(\"File is password-protected\");\n\t\t\t\t\tif(val.valid == null) throw new Error(\"Encryption scheme unsupported\");\n\t\t\t\t\tif(!val.valid) throw new Error(\"Password is incorrect\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0x005c /* WriteAccess */: opts.lastuser = val; break;\n\t\t\t\tcase 0x0042 /* CodePage */:\n\t\t\t\t\tvar cpval = Number(val);\n\t\t\t\t\t/* overrides based on test cases */\n\t\t\t\t\tswitch(cpval) {\n\t\t\t\t\t\tcase 0x5212: cpval = 1200; break;\n\t\t\t\t\t\tcase 0x8000: cpval = 10000; break;\n\t\t\t\t\t\tcase 0x8001: cpval = 1252; break;\n\t\t\t\t\t}\n\t\t\t\t\tset_cp(opts.codepage = cpval);\n\t\t\t\t\tseen_codepage = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0x013d /* RRTabId */: opts.rrtabid = val; break;\n\t\t\t\tcase 0x0019 /* WinProtect */: opts.winlocked = val; break;\n\t\t\t\tcase 0x01b7 /* RefreshAll */: wb.opts[\"RefreshAll\"] = val; break;\n\t\t\t\tcase 0x000c /* CalcCount */: wb.opts[\"CalcCount\"] = val; break;\n\t\t\t\tcase 0x0010 /* CalcDelta */: wb.opts[\"CalcDelta\"] = val; break;\n\t\t\t\tcase 0x0011 /* CalcIter */: wb.opts[\"CalcIter\"] = val; break;\n\t\t\t\tcase 0x000d /* CalcMode */: wb.opts[\"CalcMode\"] = val; break;\n\t\t\t\tcase 0x000e /* CalcPrecision */: wb.opts[\"CalcPrecision\"] = val; break;\n\t\t\t\tcase 0x005f /* CalcSaveRecalc */: wb.opts[\"CalcSaveRecalc\"] = val; break;\n\t\t\t\tcase 0x000f /* CalcRefMode */: opts.CalcRefMode = val; break; // TODO: implement R1C1\n\t\t\t\tcase 0x08a3 /* ForceFullCalculation */: wb.opts.FullCalc = val; break;\n\t\t\t\tcase 0x0081 /* WsBool */:\n\t\t\t\t\tif(val.fDialog) out[\"!type\"] = \"dialog\";\n\t\t\t\t\tif(!val.fBelow) (out[\"!outline\"] || (out[\"!outline\"] = {})).above = true;\n\t\t\t\t\tif(!val.fRight) (out[\"!outline\"] || (out[\"!outline\"] = {})).left = true;\n\t\t\t\t\tbreak; // TODO\n\t\t\t\tcase 0x0043: /* BIFF2XF */ case 0x0243: /* BIFF3XF */ case 0x0443: /* BIFF4XF */\n\t\t\t\tcase 0x00e0 /* XF */:\n\t\t\t\t\tXFs.push(val); break;\n\t\t\t\tcase 0x01ae /* SupBook */:\n\t\t\t\t\tsupbooks.push([val]);\n\t\t\t\t\tsupbooks[supbooks.length-1].XTI = [];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0x0023: case 0x0223 /* ExternName */:\n\t\t\t\t\tsupbooks[supbooks.length-1].push(val);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0x0018: case 0x0218 /* Lbl */:\n\t\t\t\t\tlast_lbl = ({\n\t\t\t\t\t\tName: val.Name,\n\t\t\t\t\t\tRef: stringify_formula(val.rgce,range,null,supbooks,opts)\n\t\t\t\t\t}/*:DefinedName*/);\n\t\t\t\t\tif(val.itab > 0) last_lbl.Sheet = val.itab - 1;\n\t\t\t\t\tsupbooks.names.push(last_lbl);\n\t\t\t\t\tif(!supbooks[0]) { supbooks[0] = []; supbooks[0].XTI = []; }\n\t\t\t\t\tsupbooks[supbooks.length-1].push(val);\n\t\t\t\t\tif(val.Name == \"_xlnm._FilterDatabase\" && val.itab > 0)\n\t\t\t\t\t\tif(val.rgce && val.rgce[0] && val.rgce[0][0] && val.rgce[0][0][0] == 'PtgArea3d')\n\t\t\t\t\t\t\tFilterDatabases[val.itab - 1] = { ref: encode_range(val.rgce[0][0][1][2]) };\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0x0016 /* ExternCount */: opts.ExternCount = val; break;\n\t\t\t\tcase 0x0017 /* ExternSheet */:\n\t\t\t\t\tif(supbooks.length == 0) { supbooks[0] = []; supbooks[0].XTI = []; }\n\t\t\t\t\tsupbooks[supbooks.length - 1].XTI = supbooks[supbooks.length - 1].XTI.concat(val); supbooks.XTI = supbooks.XTI.concat(val); break;\n\t\t\t\tcase 0x0894 /* NameCmt */:\n\t\t\t\t\t/* TODO: search for correct name */\n\t\t\t\t\tif(opts.biff < 8) break;\n\t\t\t\t\tif(last_lbl != null) last_lbl.Comment = val[1];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0x0012 /* Protect */: out[\"!protect\"] = val; break; /* for sheet or book */\n\t\t\t\tcase 0x0013 /* Password */: if(val !== 0 && opts.WTF) console.error(\"Password verifier: \" + val); break;\n\t\t\t\tcase 0x0085 /* BoundSheet8 */: {\n\t\t\t\t\tDirectory[opts.biff == 4 ? opts.snames.length : val.pos] = val;\n\t\t\t\t\topts.snames.push(val.name);\n\t\t\t\t} break;\n\t\t\t\tcase 0x000a /* EOF */: {\n\t\t\t\t\tif(--file_depth ? !biff4w : biff4w) break;\n\t\t\t\t\tif(range.e) {\n\t\t\t\t\t\tif(range.e.r > 0 && range.e.c > 0) {\n\t\t\t\t\t\t\trange.e.r--; range.e.c--;\n\t\t\t\t\t\t\tout[\"!ref\"] = encode_range(range);\n\t\t\t\t\t\t\tif(options.sheetRows && options.sheetRows <= range.e.r) {\n\t\t\t\t\t\t\t\tvar tmpri = range.e.r;\n\t\t\t\t\t\t\t\trange.e.r = options.sheetRows - 1;\n\t\t\t\t\t\t\t\tout[\"!fullref\"] = out[\"!ref\"];\n\t\t\t\t\t\t\t\tout[\"!ref\"] = encode_range(range);\n\t\t\t\t\t\t\t\trange.e.r = tmpri;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\trange.e.r++; range.e.c++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(merges.length > 0) out[\"!merges\"] = merges;\n\t\t\t\t\t\tif(objects.length > 0) out[\"!objects\"] = objects;\n\t\t\t\t\t\tif(colinfo.length > 0) out[\"!cols\"] = colinfo;\n\t\t\t\t\t\tif(rowinfo.length > 0) out[\"!rows\"] = rowinfo;\n\t\t\t\t\t\tWorkbook.Sheets.push(wsprops);\n\t\t\t\t\t}\n\t\t\t\t\tif(cur_sheet === \"\") Preamble = out; else Sheets[cur_sheet] = out;\n\t\t\t\t\tout = ({}/*:any*/); if(options.dense) out[\"!data\"] = [];\n\t\t\t\t} break;\n\t\t\t\tcase 0x0009: case 0x0209: case 0x0409: case 0x0809 /* BOF */: {\n\t\t\t\t\tif(opts.biff === 8) opts.biff = {\n\t\t\t\t\t\t0x0009: 2,\n\t\t\t\t\t\t0x0209: 3,\n\t\t\t\t\t\t0x0409: 4\n\t\t\t\t\t}[RecordType] || {\n\t\t\t\t\t\t0x0200: 2,\n\t\t\t\t\t\t0x0300: 3,\n\t\t\t\t\t\t0x0400: 4,\n\t\t\t\t\t\t0x0500: 5,\n\t\t\t\t\t\t0x0600: 8,\n\t\t\t\t\t\t0x0002: 2,\n\t\t\t\t\t\t0x0007: 2\n\t\t\t\t\t}[val.BIFFVer] || 8;\n\t\t\t\t\topts.biffguess = val.BIFFVer == 0;\n\t\t\t\t\tif(val.BIFFVer == 0 && val.dt == 0x1000) { opts.biff = 5; seen_codepage = true; set_cp(opts.codepage = 28591); }\n\t\t\t\t\tif(opts.biff == 4 && val.dt & 0x100) biff4w = true;\n\t\t\t\t\tif(opts.biff == 8 && val.BIFFVer == 0 && val.dt == 16) opts.biff = 2;\n\t\t\t\t\tif(file_depth++ && !biff4w) break;\n\t\t\t\t\tout = ({}/*:any*/); if(options.dense) out[\"!data\"] = [];\n\n\t\t\t\t\tif(opts.biff < 8 && !seen_codepage) { seen_codepage = true; set_cp(opts.codepage = options.codepage || 1252); }\n\t\t\t\t\tif(opts.biff == 4 && biff4w) {\n\t\t\t\t\t\tcur_sheet = (Directory[opts.snames.indexOf(cur_sheet)+1] || {name:\"\"}).name;\n\t\t\t\t\t} else if(opts.biff < 5 || val.BIFFVer == 0 && val.dt == 0x1000) {\n\t\t\t\t\t\tif(cur_sheet === \"\") cur_sheet = \"Sheet1\";\n\t\t\t\t\t\trange = {s:{r:0,c:0},e:{r:0,c:0}};\n\t\t\t\t\t\t/* fake BoundSheet8 */\n\t\t\t\t\t\tvar fakebs8 = {pos: blob.l - length, name:cur_sheet};\n\t\t\t\t\t\tDirectory[fakebs8.pos] = fakebs8;\n\t\t\t\t\t\topts.snames.push(cur_sheet);\n\t\t\t\t\t}\n\t\t\t\t\telse cur_sheet = (Directory[s] || {name:\"\"}).name;\n\t\t\t\t\tif(val.dt == 0x20) out[\"!type\"] = \"chart\";\n\t\t\t\t\tif(val.dt == 0x40) out[\"!type\"] = \"macro\";\n\t\t\t\t\tmerges = [];\n\t\t\t\t\tobjects = [];\n\t\t\t\t\topts.arrayf = arrayf = [];\n\t\t\t\t\tcolinfo = []; rowinfo = [];\n\t\t\t\t\tseencol = false;\n\t\t\t\t\twsprops = {Hidden:(Directory[s]||{hs:0}).hs, name:cur_sheet };\n\t\t\t\t} break;\n\t\t\t\tcase 0x0203 /* Number */: case 0x0003 /* BIFF2NUM */: case 0x0002 /* BIFF2INT */: {\n\t\t\t\t\tif(out[\"!type\"] == \"chart\") if(options.dense ? (out[\"!data\"][val.r]||[])[val.c]: out[encode_col(val.c) + encode_row(val.r)]) ++val.c;\n\t\t\t\t\ttemp_val = ({ixfe: val.ixfe, XF: XFs[val.ixfe]||{}, v:val.val, t:'n'}/*:any*/);\n\t\t\t\t\tif(BIFF2Fmt > 0) temp_val.z = (temp_val.XF && temp_val.XF.numFmtId) && BIFF2FmtTable[temp_val.XF.numFmtId] || BIFF2FmtTable[(temp_val.ixfe>>8) & 0x3F];\n\t\t\t\t\tsafe_format_xf(temp_val, options, wb.opts.Date1904);\n\t\t\t\t\taddcell({c:val.c, r:val.r}, temp_val, options);\n\t\t\t\t} break;\n\t\t\t\tcase 0x0005: case 0x0205 /* BoolErr */: {\n\t\t\t\t\ttemp_val = ({ixfe: val.ixfe, XF: XFs[val.ixfe], v:val.val, t:val.t}/*:any*/);\n\t\t\t\t\tif(BIFF2Fmt > 0) temp_val.z = (temp_val.XF && temp_val.XF.numFmtId) && BIFF2FmtTable[temp_val.XF.numFmtId] || BIFF2FmtTable[(temp_val.ixfe>>8) & 0x3F];\n\t\t\t\t\tsafe_format_xf(temp_val, options, wb.opts.Date1904);\n\t\t\t\t\taddcell({c:val.c, r:val.r}, temp_val, options);\n\t\t\t\t} break;\n\t\t\t\tcase 0x027e /* RK */: {\n\t\t\t\t\ttemp_val = ({ixfe: val.ixfe, XF: XFs[val.ixfe], v:val.rknum, t:'n'}/*:any*/);\n\t\t\t\t\tif(BIFF2Fmt > 0) temp_val.z = (temp_val.XF && temp_val.XF.numFmtId) && BIFF2FmtTable[temp_val.XF.numFmtId] || BIFF2FmtTable[(temp_val.ixfe>>8) & 0x3F];\n\t\t\t\t\tsafe_format_xf(temp_val, options, wb.opts.Date1904);\n\t\t\t\t\taddcell({c:val.c, r:val.r}, temp_val, options);\n\t\t\t\t} break;\n\t\t\t\tcase 0x00bd /* MulRk */: {\n\t\t\t\t\tfor(var j = val.c; j <= val.C; ++j) {\n\t\t\t\t\t\tvar ixfe = val.rkrec[j-val.c][0];\n\t\t\t\t\t\ttemp_val= ({ixfe:ixfe, XF:XFs[ixfe], v:val.rkrec[j-val.c][1], t:'n'}/*:any*/);\n\t\t\t\t\t\tif(BIFF2Fmt > 0) temp_val.z = (temp_val.XF && temp_val.XF.numFmtId) && BIFF2FmtTable[temp_val.XF.numFmtId] || BIFF2FmtTable[(temp_val.ixfe>>8) & 0x3F];\n\t\t\t\t\t\tsafe_format_xf(temp_val, options, wb.opts.Date1904);\n\t\t\t\t\t\taddcell({c:j, r:val.r}, temp_val, options);\n\t\t\t\t\t}\n\t\t\t\t} break;\n\t\t\t\tcase 0x0006: case 0x0206: case 0x0406 /* Formula */: {\n\t\t\t\t\tif(val.val == 'String') { last_formula = val; break; }\n\t\t\t\t\ttemp_val = make_cell(val.val, val.cell.ixfe, val.tt);\n\t\t\t\t\ttemp_val.XF = XFs[temp_val.ixfe];\n\t\t\t\t\tif(options.cellFormula) {\n\t\t\t\t\t\tvar _f = val.formula;\n\t\t\t\t\t\tif(_f && _f[0] && _f[0][0] && _f[0][0][0] == 'PtgExp') {\n\t\t\t\t\t\t\tvar _fr = _f[0][0][1][0], _fc = _f[0][0][1][1];\n\t\t\t\t\t\t\tvar _fe = encode_cell({r:_fr, c:_fc});\n\t\t\t\t\t\t\tif(sharedf[_fe]) temp_val.f = \"\"+stringify_formula(val.formula,range,val.cell,supbooks, opts);\n\t\t\t\t\t\t\telse temp_val.F = ((options.dense ? (out[\"!data\"][_fr]||[])[_fc]: out[_fe]) || {}).F;\n\t\t\t\t\t\t} else temp_val.f = \"\"+stringify_formula(val.formula,range,val.cell,supbooks, opts);\n\t\t\t\t\t}\n\t\t\t\t\tif(BIFF2Fmt > 0) temp_val.z = (temp_val.XF && temp_val.XF.numFmtId) && BIFF2FmtTable[temp_val.XF.numFmtId] || BIFF2FmtTable[(temp_val.ixfe>>8) & 0x3F];\n\t\t\t\t\tsafe_format_xf(temp_val, options, wb.opts.Date1904);\n\t\t\t\t\taddcell(val.cell, temp_val, options);\n\t\t\t\t\tlast_formula = val;\n\t\t\t\t} break;\n\t\t\t\tcase 0x0007: case 0x0207 /* String */: {\n\t\t\t\t\tif(last_formula) { /* technically always true */\n\t\t\t\t\t\tlast_formula.val = val;\n\t\t\t\t\t\ttemp_val = make_cell(val, last_formula.cell.ixfe, 's');\n\t\t\t\t\t\ttemp_val.XF = XFs[temp_val.ixfe];\n\t\t\t\t\t\tif(options.cellFormula) {\n\t\t\t\t\t\t\ttemp_val.f = \"\"+stringify_formula(last_formula.formula, range, last_formula.cell, supbooks, opts);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(BIFF2Fmt > 0) temp_val.z = (temp_val.XF && temp_val.XF.numFmtId) && BIFF2FmtTable[temp_val.XF.numFmtId] || BIFF2FmtTable[(temp_val.ixfe>>8) & 0x3F];\n\t\t\t\t\t\tsafe_format_xf(temp_val, options, wb.opts.Date1904);\n\t\t\t\t\t\taddcell(last_formula.cell, temp_val, options);\n\t\t\t\t\t\tlast_formula = null;\n\t\t\t\t\t} else throw new Error(\"String record expects Formula\");\n\t\t\t\t} break;\n\t\t\t\tcase 0x0021: case 0x0221 /* Array */: {\n\t\t\t\t\tarrayf.push(val);\n\t\t\t\t\tvar _arraystart = encode_cell(val[0].s);\n\t\t\t\t\tcc = options.dense ? (out[\"!data\"][val[0].s.r]||[])[val[0].s.c] : out[_arraystart];\n\t\t\t\t\tif(options.cellFormula && cc) {\n\t\t\t\t\t\tif(!last_formula) break; /* technically unreachable */\n\t\t\t\t\t\tif(!_arraystart || !cc) break;\n\t\t\t\t\t\tcc.f = \"\"+stringify_formula(val[1], range, val[0], supbooks, opts);\n\t\t\t\t\t\tcc.F = encode_range(val[0]);\n\t\t\t\t\t}\n\t\t\t\t} break;\n\t\t\t\tcase 0x04bc /* ShrFmla */: {\n\t\t\t\t\tif(!options.cellFormula) break;\n\t\t\t\t\tif(last_cell) {\n\t\t\t\t\t\t/* TODO: capture range */\n\t\t\t\t\t\tif(!last_formula) break; /* technically unreachable */\n\t\t\t\t\t\tsharedf[encode_cell(last_formula.cell)]= val[0];\n\t\t\t\t\t\tcc = options.dense ? (out[\"!data\"][last_formula.cell.r]||[])[last_formula.cell.c] : out[encode_cell(last_formula.cell)];\n\t\t\t\t\t\t(cc||{}).f = \"\"+stringify_formula(val[0], range, lastcell, supbooks, opts);\n\t\t\t\t\t}\n\t\t\t\t} break;\n\t\t\t\tcase 0x00fd /* LabelSst */:\n\t\t\t\t\ttemp_val=make_cell(sst[val.isst].t, val.ixfe, 's');\n\t\t\t\t\tif(sst[val.isst].h) temp_val.h = sst[val.isst].h;\n\t\t\t\t\ttemp_val.XF = XFs[temp_val.ixfe];\n\t\t\t\t\tif(BIFF2Fmt > 0) temp_val.z = (temp_val.XF && temp_val.XF.numFmtId) && BIFF2FmtTable[temp_val.XF.numFmtId] || BIFF2FmtTable[(temp_val.ixfe>>8) & 0x3F];\n\t\t\t\t\tsafe_format_xf(temp_val, options, wb.opts.Date1904);\n\t\t\t\t\taddcell({c:val.c, r:val.r}, temp_val, options);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0x0201 /* Blank */: if(options.sheetStubs) {\n\t\t\t\t\ttemp_val = ({ixfe: val.ixfe, XF: XFs[val.ixfe], t:'z'}/*:any*/);\n\t\t\t\t\tif(BIFF2Fmt > 0) temp_val.z = (temp_val.XF && temp_val.XF.numFmtId) && BIFF2FmtTable[temp_val.XF.numFmtId] || BIFF2FmtTable[(temp_val.ixfe>>8) & 0x3F];\n\t\t\t\t\tsafe_format_xf(temp_val, options, wb.opts.Date1904);\n\t\t\t\t\taddcell({c:val.c, r:val.r}, temp_val, options);\n\t\t\t\t} break;\n\t\t\t\tcase 0x00be /* MulBlank */: if(options.sheetStubs) {\n\t\t\t\t\tfor(var _j = val.c; _j <= val.C; ++_j) {\n\t\t\t\t\t\tvar _ixfe = val.ixfe[_j-val.c];\n\t\t\t\t\t\ttemp_val= ({ixfe:_ixfe, XF:XFs[_ixfe], t:'z'}/*:any*/);\n\t\t\t\t\t\tif(BIFF2Fmt > 0) temp_val.z = (temp_val.XF && temp_val.XF.numFmtId) && BIFF2FmtTable[temp_val.XF.numFmtId] || BIFF2FmtTable[(temp_val.ixfe>>8) & 0x3F];\n\t\t\t\t\t\tsafe_format_xf(temp_val, options, wb.opts.Date1904);\n\t\t\t\t\t\taddcell({c:_j, r:val.r}, temp_val, options);\n\t\t\t\t\t}\n\t\t\t\t} break;\n\t\t\t\tcase 0x00d6 /* RString */:\n\t\t\t\tcase 0x0204 /* Label */: case 0x0004 /* BIFF2STR */:\n\t\t\t\t\ttemp_val=make_cell(val.val, val.ixfe, 's');\n\t\t\t\t\ttemp_val.XF = XFs[temp_val.ixfe];\n\t\t\t\t\tif(BIFF2Fmt > 0) temp_val.z = (temp_val.XF && temp_val.XF.numFmtId) && BIFF2FmtTable[temp_val.XF.numFmtId] || BIFF2FmtTable[(temp_val.ixfe>>8) & 0x3F];\n\t\t\t\t\tsafe_format_xf(temp_val, options, wb.opts.Date1904);\n\t\t\t\t\taddcell({c:val.c, r:val.r}, temp_val, options);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 0x0000: case 0x0200 /* Dimensions */: {\n\t\t\t\t\tif(file_depth === 1) range = val; /* TODO: stack */\n\t\t\t\t} break;\n\t\t\t\tcase 0x00fc /* SST */: {\n\t\t\t\t\tsst = val;\n\t\t\t\t} break;\n\t\t\t\tcase 0x041e /* Format */: { /* val = [id, fmt] */\n\t\t\t\t\tif(opts.biff >= 3 && opts.biff <= 4) {\n\t\t\t\t\t\tBIFF2FmtTable[BIFF2Fmt++] = val[1];\n\t\t\t\t\t\tfor(var b4idx = 0; b4idx < BIFF2Fmt + 163; ++b4idx) if(table_fmt[b4idx] == val[1]) break;\n\t\t\t\t\t\tif(b4idx >= 163) SSF__load(val[1], BIFF2Fmt + 163);\n\t\t\t\t\t}\n\t\t\t\t\telse SSF__load(val[1], val[0]);\n\t\t\t\t} break;\n\t\t\t\tcase 0x001e /* BIFF2FORMAT */: {\n\t\t\t\t\tBIFF2FmtTable[BIFF2Fmt++] = val;\n\t\t\t\t\tfor(var b2idx = 0; b2idx < BIFF2Fmt + 163; ++b2idx) if(table_fmt[b2idx] == val) break;\n\t\t\t\t\tif(b2idx >= 163) SSF__load(val, BIFF2Fmt + 163);\n\t\t\t\t} break;\n\n\t\t\t\tcase 0x00e5 /* MergeCells */: merges = merges.concat(val); break;\n\n\t\t\t\tcase 0x005d /* Obj */: objects[val.cmo[0]] = opts.lastobj = val; break;\n\t\t\t\tcase 0x01b6 /* TxO */: opts.lastobj.TxO = val; break;\n\t\t\t\tcase 0x007f /* ImData */: opts.lastobj.ImData = val; break;\n\n\t\t\t\tcase 0x01b8 /* HLink */: {\n\t\t\t\t\tfor(rngR = val[0].s.r; rngR <= val[0].e.r; ++rngR)\n\t\t\t\t\t\tfor(rngC = val[0].s.c; rngC <= val[0].e.c; ++rngC) {\n\t\t\t\t\t\t\tcc = options.dense ? (out[\"!data\"][rngR]||[])[rngC] : out[encode_cell({c:rngC,r:rngR})];\n\t\t\t\t\t\t\tif(cc) cc.l = val[1];\n\t\t\t\t\t\t}\n\t\t\t\t} break;\n\t\t\t\tcase 0x0800 /* HLinkTooltip */: {\n\t\t\t\t\tfor(rngR = val[0].s.r; rngR <= val[0].e.r; ++rngR)\n\t\t\t\t\t\tfor(rngC = val[0].s.c; rngC <= val[0].e.c; ++rngC) {\n\t\t\t\t\t\t\tcc = options.dense ? (out[\"!data\"][rngR]||[])[rngC] : out[encode_cell({c:rngC,r:rngR})];\n\t\t\t\t\t\t\tif(cc && cc.l) cc.l.Tooltip = val[1];\n\t\t\t\t\t\t\t}\n\t\t\t\t} break;\n\t\t\t\tcase 0x001c /* Note */: {\n\t\t\t\t\t/* TODO: comment continuation (row == -1 / 0xFFFF) */\n\t\t\t\t\tcc = options.dense ? (out[\"!data\"][val[0].r]||[])[val[0].c] : out[encode_cell(val[0])];\n\t\t\t\t\tif(!cc) {\n\t\t\t\t\t\tif(options.dense) {\n\t\t\t\t\t\t\tif(!out[\"!data\"][val[0].r]) out[\"!data\"][val[0].r] = [];\n\t\t\t\t\t\t\tcc = out[\"!data\"][val[0].r][val[0].c] = ({t:\"z\"}/*:any*/);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcc = out[encode_cell(val[0])] = ({t:\"z\"}/*:any*/);\n\t\t\t\t\t\t}\n\t\t\t\t\t\trange.e.r = Math.max(range.e.r, val[0].r);\n\t\t\t\t\t\trange.s.r = Math.min(range.s.r, val[0].r);\n\t\t\t\t\t\trange.e.c = Math.max(range.e.c, val[0].c);\n\t\t\t\t\t\trange.s.c = Math.min(range.s.c, val[0].c);\n\t\t\t\t\t}\n\t\t\t\t\tif(!cc.c) cc.c = [];\n\t\t\t\t\tif(opts.biff <= 5 && opts.biff >= 2) cmnt = {a:\"SheetJ5\", t:val[1]};\n\t\t\t\t\telse {\n\t\t\t\t\t\tvar noteobj = objects[val[2]];\n\t\t\t\t\t\tcmnt = {a:val[1],t:noteobj.TxO.t};\n\t\t\t\t\t\tif(val[3] != null && !(val[3] & 0x02)) cc.c.hidden = true;\n\t\t\t\t\t}\n\t\t\t\t\tcc.c.push(cmnt);\n\t\t\t\t} break;\n\t\t\t\tcase 0x087d /* XFExt */: update_xfext(XFs[val.ixfe], val.ext); break;\n\t\t\t\tcase 0x007d /* ColInfo */: {\n\t\t\t\t\tif(!opts.cellStyles) break;\n\t\t\t\t\twhile(val.e >= val.s) {\n\t\t\t\t\t\tcolinfo[val.e--] = { width: val.w/256, level: (val.level || 0), hidden: !!(val.flags & 1) };\n\t\t\t\t\t\tif(!seencol) { seencol = true; find_mdw_colw(val.w/256); }\n\t\t\t\t\t\tprocess_col(colinfo[val.e+1]);\n\t\t\t\t\t}\n\t\t\t\t} break;\n\t\t\t\tcase 0x0208 /* Row */: {\n\t\t\t\t\tvar rowobj = {};\n\t\t\t\t\tif(val.level != null) { rowinfo[val.r] = rowobj; rowobj.level = val.level; }\n\t\t\t\t\tif(val.hidden) { rowinfo[val.r] = rowobj; rowobj.hidden = true; }\n\t\t\t\t\tif(val.hpt) {\n\t\t\t\t\t\trowinfo[val.r] = rowobj;\n\t\t\t\t\t\trowobj.hpt = val.hpt; rowobj.hpx = pt2px(val.hpt);\n\t\t\t\t\t}\n\t\t\t\t} break;\n\t\t\t\tcase 0x0026 /* LeftMargin */:\n\t\t\t\tcase 0x0027 /* RightMargin */:\n\t\t\t\tcase 0x0028 /* TopMargin */:\n\t\t\t\tcase 0x0029 /* BottomMargin */:\n\t\t\t\t\tif(!out['!margins']) default_margins(out['!margins'] = {});\n\t\t\t\t\tout['!margins'][({0x26: \"left\", 0x27:\"right\", 0x28:\"top\", 0x29:\"bottom\"})[RecordType]] = val;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0x00a1 /* Setup */: // TODO\n\t\t\t\t\tif(!out['!margins']) default_margins(out['!margins'] = {});\n\t\t\t\t\tout['!margins'].header = val.header;\n\t\t\t\t\tout['!margins'].footer = val.footer;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0x023e /* Window2 */: // TODO\n\t\t\t\t\t// $FlowIgnore\n\t\t\t\t\tif(val.RTL) Workbook.Views[0].RTL = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 0x0092 /* Palette */: palette = val; break;\n\t\t\t\tcase 0x0896 /* Theme */: themes = val; break;\n\t\t\t\tcase 0x008c /* Country */: country = val; break;\n\t\t\t\tcase 0x01ba /* CodeName */: {\n\t\t\t\t\t/*:: if(!Workbook.WBProps) Workbook.WBProps = {}; */\n\t\t\t\t\tif(!cur_sheet) Workbook.WBProps.CodeName = val || \"ThisWorkbook\";\n\t\t\t\t\telse wsprops.CodeName = val || wsprops.name;\n\t\t\t\t} break;\n\t\t\t}\n\t\t} else {\n\t\t\tif(!R) console.error(\"Missing Info for XLS Record 0x\" + RecordType.toString(16));\n\t\t\tblob.l += length;\n\t\t}\n\t}\n\twb.SheetNames=keys(Directory).sort(function(a,b) { return Number(a) - Number(b); }).map(function(x){return Directory[x].name;});\n\tif(!options.bookSheets) wb.Sheets=Sheets;\n\tif(!wb.SheetNames.length && Preamble[\"!ref\"]) {\n\t\twb.SheetNames.push(\"Sheet1\");\n\t\t/*jshint -W069 */\n\t\tif(wb.Sheets) wb.Sheets[\"Sheet1\"] = Preamble;\n\t\t/*jshint +W069 */\n\t} else wb.Preamble=Preamble;\n\tif(wb.Sheets) FilterDatabases.forEach(function(r,i) { wb.Sheets[wb.SheetNames[i]]['!autofilter'] = r; });\n\twb.Strings = sst;\n\twb.SSF = dup(table_fmt);\n\tif(opts.enc) wb.Encryption = opts.enc;\n\tif(themes) wb.Themes = themes;\n\twb.Metadata = {};\n\tif(country !== undefined) wb.Metadata.Country = country;\n\tif(supbooks.names.length > 0) Workbook.Names = supbooks.names;\n\twb.Workbook = Workbook;\n\treturn wb;\n}\n\n/* TODO: split props*/\nvar PSCLSID = {\n\tSI: \"e0859ff2f94f6810ab9108002b27b3d9\",\n\tDSI: \"02d5cdd59c2e1b10939708002b2cf9ae\",\n\tUDI: \"05d5cdd59c2e1b10939708002b2cf9ae\"\n};\nfunction parse_xls_props(cfb/*:CFBContainer*/, props, o) {\n\t/* [MS-OSHARED] 2.3.3.2.2 Document Summary Information Property Set */\n\tvar DSI = CFB.find(cfb, '/!DocumentSummaryInformation');\n\tif(DSI && DSI.size > 0) try {\n\t\tvar DocSummary = parse_PropertySetStream(DSI, DocSummaryPIDDSI, PSCLSID.DSI);\n\t\tfor(var d in DocSummary) props[d] = DocSummary[d];\n\t} catch(e) {if(o.WTF) throw e;/* empty */}\n\n\t/* [MS-OSHARED] 2.3.3.2.1 Summary Information Property Set*/\n\tvar SI = CFB.find(cfb, '/!SummaryInformation');\n\tif(SI && SI.size > 0) try {\n\t\tvar Summary = parse_PropertySetStream(SI, SummaryPIDSI, PSCLSID.SI);\n\t\tfor(var s in Summary) if(props[s] == null) props[s] = Summary[s];\n\t} catch(e) {if(o.WTF) throw e;/* empty */}\n\n\tif(props.HeadingPairs && props.TitlesOfParts) {\n\t\tload_props_pairs(props.HeadingPairs, props.TitlesOfParts, props, o);\n\t\tdelete props.HeadingPairs; delete props.TitlesOfParts;\n\t}\n}\nfunction write_xls_props(wb/*:Workbook*/, cfb/*:CFBContainer*/) {\n\tvar DSEntries = [], SEntries = [], CEntries = [];\n\tvar i = 0, Keys;\n\tvar DocSummaryRE/*:{[key:string]:string}*/ = evert_key(DocSummaryPIDDSI, \"n\");\n\tvar SummaryRE/*:{[key:string]:string}*/ = evert_key(SummaryPIDSI, \"n\");\n\tif(wb.Props) {\n\t\tKeys = keys(wb.Props);\n\t\t// $FlowIgnore\n\t\tfor(i = 0; i < Keys.length; ++i) (Object.prototype.hasOwnProperty.call(DocSummaryRE, Keys[i]) ? DSEntries : Object.prototype.hasOwnProperty.call(SummaryRE, Keys[i]) ? SEntries : CEntries).push([Keys[i], wb.Props[Keys[i]]]);\n\t}\n\tif(wb.Custprops) {\n\t\tKeys = keys(wb.Custprops);\n\t\t// $FlowIgnore\n\t\tfor(i = 0; i < Keys.length; ++i) if(!Object.prototype.hasOwnProperty.call((wb.Props||{}), Keys[i])) (Object.prototype.hasOwnProperty.call(DocSummaryRE, Keys[i]) ? DSEntries : Object.prototype.hasOwnProperty.call(SummaryRE, Keys[i]) ? SEntries : CEntries).push([Keys[i], wb.Custprops[Keys[i]]]);\n\t}\n\tvar CEntries2 = [];\n\tfor(i = 0; i < CEntries.length; ++i) {\n\t\tif(XLSPSSkip.indexOf(CEntries[i][0]) > -1 || PseudoPropsPairs.indexOf(CEntries[i][0]) > -1) continue;\n\t\tif(CEntries[i][1] == null) continue;\n\t\tCEntries2.push(CEntries[i]);\n\t}\n\tif(SEntries.length) CFB.utils.cfb_add(cfb, \"/\\u0005SummaryInformation\", write_PropertySetStream(SEntries, PSCLSID.SI, SummaryRE, SummaryPIDSI));\n\tif(DSEntries.length || CEntries2.length) CFB.utils.cfb_add(cfb, \"/\\u0005DocumentSummaryInformation\", write_PropertySetStream(DSEntries, PSCLSID.DSI, DocSummaryRE, DocSummaryPIDDSI, CEntries2.length ? CEntries2 : null, PSCLSID.UDI));\n}\n\nfunction parse_xlscfb(cfb/*:any*/, options/*:?ParseOpts*/)/*:Workbook*/ {\nif(!options) options = {};\nfix_read_opts(options);\nreset_cp();\nif(options.codepage) set_ansi(options.codepage);\nvar CompObj/*:?CFBEntry*/, WB/*:?any*/;\nif(cfb.FullPaths) {\n\tif(CFB.find(cfb, '/encryption')) throw new Error(\"File is password-protected\");\n\tCompObj = CFB.find(cfb, '!CompObj');\n\tWB = CFB.find(cfb, '/Workbook') || CFB.find(cfb, '/Book');\n} else {\n\tswitch(options.type) {\n\t\tcase 'base64': cfb = s2a(Base64_decode(cfb)); break;\n\t\tcase 'binary': cfb = s2a(cfb); break;\n\t\tcase 'buffer': break;\n\t\tcase 'array': if(!Array.isArray(cfb)) cfb = Array.prototype.slice.call(cfb); break;\n\t}\n\tprep_blob(cfb, 0);\n\tWB = ({content: cfb}/*:any*/);\n}\nvar /*::CompObjP, */WorkbookP/*:: :Workbook = XLSX.utils.book_new(); */;\n\nvar _data/*:?any*/;\nif(CompObj) /*::CompObjP = */parse_compobj(CompObj);\nif(options.bookProps && !options.bookSheets) WorkbookP = ({}/*:any*/);\nelse/*:: if(cfb instanceof CFBContainer) */ {\n\tvar T = has_buf ? 'buffer' : 'array';\n\tif(WB && WB.content) WorkbookP = parse_workbook(WB.content, options);\n\t/* Quattro Pro 7-8 */\n\telse if((_data=CFB.find(cfb, 'PerfectOffice_MAIN')) && _data.content) WorkbookP = WK_.to_workbook(_data.content, (options.type = T, options));\n\t/* Quattro Pro 9 */\n\telse if((_data=CFB.find(cfb, 'NativeContent_MAIN')) && _data.content) WorkbookP = WK_.to_workbook(_data.content, (options.type = T, options));\n\t/* Works 4 for Mac */\n\telse if((_data=CFB.find(cfb, 'MN0')) && _data.content) throw new Error(\"Unsupported Works 4 for Mac file\");\n\telse throw new Error(\"Cannot find Workbook stream\");\n\tif(options.bookVBA && cfb.FullPaths && CFB.find(cfb, '/_VBA_PROJECT_CUR/VBA/dir')) WorkbookP.vbaraw = make_vba_xls(cfb);\n}\n\nvar props = {};\nif(cfb.FullPaths) parse_xls_props(/*::((*/cfb/*:: :any):CFBContainer)*/, props, options);\n\nWorkbookP.Props = WorkbookP.Custprops = props; /* TODO: split up properties */\nif(options.bookFiles) WorkbookP.cfb = cfb;\n/*WorkbookP.CompObjP = CompObjP; // TODO: storage? */\nreturn WorkbookP;\n}\n\n\nfunction write_xlscfb(wb/*:Workbook*/, opts/*:WriteOpts*/)/*:CFBContainer*/ {\n\tvar o = opts || {};\n\tvar cfb = CFB.utils.cfb_new({root:\"R\"});\n\tvar wbpath = \"/Workbook\";\n\tswitch(o.bookType || \"xls\") {\n\t\tcase \"xls\": o.bookType = \"biff8\";\n\t\t/* falls through */\n\t\tcase \"xla\": if(!o.bookType) o.bookType = \"xla\";\n\t\t/* falls through */\n\t\tcase \"biff8\": wbpath = \"/Workbook\"; o.biff = 8; break;\n\t\tcase \"biff5\": wbpath = \"/Book\"; o.biff = 5; break;\n\t\tdefault: throw new Error(\"invalid type \" + o.bookType + \" for XLS CFB\");\n\t}\n\tCFB.utils.cfb_add(cfb, wbpath, write_biff_buf(wb, o));\n\tif(o.biff == 8 && (wb.Props || wb.Custprops)) write_xls_props(wb, cfb);\n\t// TODO: SI, DSI, CO\n\tif(o.biff == 8 && wb.vbaraw) fill_vba_xls(cfb, CFB.read(wb.vbaraw, {type: typeof wb.vbaraw == \"string\" ? \"binary\" : \"buffer\"}));\n\treturn cfb;\n}\n/* [MS-XLSB] 2.3 Record Enumeration */\nvar XLSBRecordEnum = {\n\t0x0000: { /* n:\"BrtRowHdr\", */ f:parse_BrtRowHdr },\n\t0x0001: { /* n:\"BrtCellBlank\", */ f:parse_BrtCellBlank },\n\t0x0002: { /* n:\"BrtCellRk\", */ f:parse_BrtCellRk },\n\t0x0003: { /* n:\"BrtCellError\", */ f:parse_BrtCellError },\n\t0x0004: { /* n:\"BrtCellBool\", */ f:parse_BrtCellBool },\n\t0x0005: { /* n:\"BrtCellReal\", */ f:parse_BrtCellReal },\n\t0x0006: { /* n:\"BrtCellSt\", */ f:parse_BrtCellSt },\n\t0x0007: { /* n:\"BrtCellIsst\", */ f:parse_BrtCellIsst },\n\t0x0008: { /* n:\"BrtFmlaString\", */ f:parse_BrtFmlaString },\n\t0x0009: { /* n:\"BrtFmlaNum\", */ f:parse_BrtFmlaNum },\n\t0x000A: { /* n:\"BrtFmlaBool\", */ f:parse_BrtFmlaBool },\n\t0x000B: { /* n:\"BrtFmlaError\", */ f:parse_BrtFmlaError },\n\t0x000C: { /* n:\"BrtShortBlank\", */ f:parse_BrtShortBlank },\n\t0x000D: { /* n:\"BrtShortRk\", */ f:parse_BrtShortRk },\n\t0x000E: { /* n:\"BrtShortError\", */ f:parse_BrtShortError },\n\t0x000F: { /* n:\"BrtShortBool\", */ f:parse_BrtShortBool },\n\t0x0010: { /* n:\"BrtShortReal\", */ f:parse_BrtShortReal },\n\t0x0011: { /* n:\"BrtShortSt\", */ f:parse_BrtShortSt },\n\t0x0012: { /* n:\"BrtShortIsst\", */ f:parse_BrtShortIsst },\n\t0x0013: { /* n:\"BrtSSTItem\", */ f:parse_RichStr },\n\t0x0014: { /* n:\"BrtPCDIMissing\" */ },\n\t0x0015: { /* n:\"BrtPCDINumber\" */ },\n\t0x0016: { /* n:\"BrtPCDIBoolean\" */ },\n\t0x0017: { /* n:\"BrtPCDIError\" */ },\n\t0x0018: { /* n:\"BrtPCDIString\" */ },\n\t0x0019: { /* n:\"BrtPCDIDatetime\" */ },\n\t0x001A: { /* n:\"BrtPCDIIndex\" */ },\n\t0x001B: { /* n:\"BrtPCDIAMissing\" */ },\n\t0x001C: { /* n:\"BrtPCDIANumber\" */ },\n\t0x001D: { /* n:\"BrtPCDIABoolean\" */ },\n\t0x001E: { /* n:\"BrtPCDIAError\" */ },\n\t0x001F: { /* n:\"BrtPCDIAString\" */ },\n\t0x0020: { /* n:\"BrtPCDIADatetime\" */ },\n\t0x0021: { /* n:\"BrtPCRRecord\" */ },\n\t0x0022: { /* n:\"BrtPCRRecordDt\" */ },\n\t0x0023: { /* n:\"BrtFRTBegin\", */ T:1 },\n\t0x0024: { /* n:\"BrtFRTEnd\", */ T:-1 },\n\t0x0025: { /* n:\"BrtACBegin\", */ T:1 },\n\t0x0026: { /* n:\"BrtACEnd\", */ T:-1 },\n\t0x0027: { /* n:\"BrtName\", */ f:parse_BrtName },\n\t0x0028: { /* n:\"BrtIndexRowBlock\" */ },\n\t0x002A: { /* n:\"BrtIndexBlock\" */ },\n\t0x002B: { /* n:\"BrtFont\", */ f:parse_BrtFont },\n\t0x002C: { /* n:\"BrtFmt\", */ f:parse_BrtFmt },\n\t0x002D: { /* n:\"BrtFill\", */ f:parse_BrtFill },\n\t0x002E: { /* n:\"BrtBorder\", */ f:parse_BrtBorder },\n\t0x002F: { /* n:\"BrtXF\", */ f:parse_BrtXF },\n\t0x0030: { /* n:\"BrtStyle\" */ },\n\t0x0031: { /* n:\"BrtCellMeta\", */ f:parse_Int32LE },\n\t0x0032: { /* n:\"BrtValueMeta\" */ },\n\t0x0033: { /* n:\"BrtMdb\" */ f:parse_BrtMdb },\n\t0x0034: { /* n:\"BrtBeginFmd\", */ T:1 },\n\t0x0035: { /* n:\"BrtEndFmd\", */ T:-1 },\n\t0x0036: { /* n:\"BrtBeginMdx\", */ T:1 },\n\t0x0037: { /* n:\"BrtEndMdx\", */ T:-1 },\n\t0x0038: { /* n:\"BrtBeginMdxTuple\", */ T:1 },\n\t0x0039: { /* n:\"BrtEndMdxTuple\", */ T:-1 },\n\t0x003A: { /* n:\"BrtMdxMbrIstr\" */ },\n\t0x003B: { /* n:\"BrtStr\" */ },\n\t0x003C: { /* n:\"BrtColInfo\", */ f:parse_ColInfo },\n\t0x003E: { /* n:\"BrtCellRString\", */ f:parse_BrtCellRString },\n\t0x003F: { /* n:\"BrtCalcChainItem$\", */ f:parse_BrtCalcChainItem$ },\n\t0x0040: { /* n:\"BrtDVal\", */ f:parse_BrtDVal },\n\t0x0041: { /* n:\"BrtSxvcellNum\" */ },\n\t0x0042: { /* n:\"BrtSxvcellStr\" */ },\n\t0x0043: { /* n:\"BrtSxvcellBool\" */ },\n\t0x0044: { /* n:\"BrtSxvcellErr\" */ },\n\t0x0045: { /* n:\"BrtSxvcellDate\" */ },\n\t0x0046: { /* n:\"BrtSxvcellNil\" */ },\n\t0x0080: { /* n:\"BrtFileVersion\" */ },\n\t0x0081: { /* n:\"BrtBeginSheet\", */ T:1 },\n\t0x0082: { /* n:\"BrtEndSheet\", */ T:-1 },\n\t0x0083: { /* n:\"BrtBeginBook\", */ T:1, f:parsenoop, p:0 },\n\t0x0084: { /* n:\"BrtEndBook\", */ T:-1 },\n\t0x0085: { /* n:\"BrtBeginWsViews\", */ T:1 },\n\t0x0086: { /* n:\"BrtEndWsViews\", */ T:-1 },\n\t0x0087: { /* n:\"BrtBeginBookViews\", */ T:1 },\n\t0x0088: { /* n:\"BrtEndBookViews\", */ T:-1 },\n\t0x0089: { /* n:\"BrtBeginWsView\", */ T:1, f:parse_BrtBeginWsView },\n\t0x008A: { /* n:\"BrtEndWsView\", */ T:-1 },\n\t0x008B: { /* n:\"BrtBeginCsViews\", */ T:1 },\n\t0x008C: { /* n:\"BrtEndCsViews\", */ T:-1 },\n\t0x008D: { /* n:\"BrtBeginCsView\", */ T:1 },\n\t0x008E: { /* n:\"BrtEndCsView\", */ T:-1 },\n\t0x008F: { /* n:\"BrtBeginBundleShs\", */ T:1 },\n\t0x0090: { /* n:\"BrtEndBundleShs\", */ T:-1 },\n\t0x0091: { /* n:\"BrtBeginSheetData\", */ T:1 },\n\t0x0092: { /* n:\"BrtEndSheetData\", */ T:-1 },\n\t0x0093: { /* n:\"BrtWsProp\", */ f:parse_BrtWsProp },\n\t0x0094: { /* n:\"BrtWsDim\", */ f:parse_BrtWsDim, p:16 },\n\t0x0097: { /* n:\"BrtPane\", */ f:parse_BrtPane },\n\t0x0098: { /* n:\"BrtSel\" */ },\n\t0x0099: { /* n:\"BrtWbProp\", */ f:parse_BrtWbProp },\n\t0x009A: { /* n:\"BrtWbFactoid\" */ },\n\t0x009B: { /* n:\"BrtFileRecover\" */ },\n\t0x009C: { /* n:\"BrtBundleSh\", */ f:parse_BrtBundleSh },\n\t0x009D: { /* n:\"BrtCalcProp\" */ },\n\t0x009E: { /* n:\"BrtBookView\" */ },\n\t0x009F: { /* n:\"BrtBeginSst\", */ T:1, f:parse_BrtBeginSst },\n\t0x00A0: { /* n:\"BrtEndSst\", */ T:-1 },\n\t0x00A1: { /* n:\"BrtBeginAFilter\", */ T:1, f:parse_UncheckedRfX },\n\t0x00A2: { /* n:\"BrtEndAFilter\", */ T:-1 },\n\t0x00A3: { /* n:\"BrtBeginFilterColumn\", */ T:1 },\n\t0x00A4: { /* n:\"BrtEndFilterColumn\", */ T:-1 },\n\t0x00A5: { /* n:\"BrtBeginFilters\", */ T:1 },\n\t0x00A6: { /* n:\"BrtEndFilters\", */ T:-1 },\n\t0x00A7: { /* n:\"BrtFilter\" */ },\n\t0x00A8: { /* n:\"BrtColorFilter\" */ },\n\t0x00A9: { /* n:\"BrtIconFilter\" */ },\n\t0x00AA: { /* n:\"BrtTop10Filter\" */ },\n\t0x00AB: { /* n:\"BrtDynamicFilter\" */ },\n\t0x00AC: { /* n:\"BrtBeginCustomFilters\", */ T:1 },\n\t0x00AD: { /* n:\"BrtEndCustomFilters\", */ T:-1 },\n\t0x00AE: { /* n:\"BrtCustomFilter\" */ },\n\t0x00AF: { /* n:\"BrtAFilterDateGroupItem\" */ },\n\t0x00B0: { /* n:\"BrtMergeCell\", */ f:parse_BrtMergeCell },\n\t0x00B1: { /* n:\"BrtBeginMergeCells\", */ T:1 },\n\t0x00B2: { /* n:\"BrtEndMergeCells\", */ T:-1 },\n\t0x00B3: { /* n:\"BrtBeginPivotCacheDef\", */ T:1 },\n\t0x00B4: { /* n:\"BrtEndPivotCacheDef\", */ T:-1 },\n\t0x00B5: { /* n:\"BrtBeginPCDFields\", */ T:1 },\n\t0x00B6: { /* n:\"BrtEndPCDFields\", */ T:-1 },\n\t0x00B7: { /* n:\"BrtBeginPCDField\", */ T:1 },\n\t0x00B8: { /* n:\"BrtEndPCDField\", */ T:-1 },\n\t0x00B9: { /* n:\"BrtBeginPCDSource\", */ T:1 },\n\t0x00BA: { /* n:\"BrtEndPCDSource\", */ T:-1 },\n\t0x00BB: { /* n:\"BrtBeginPCDSRange\", */ T:1 },\n\t0x00BC: { /* n:\"BrtEndPCDSRange\", */ T:-1 },\n\t0x00BD: { /* n:\"BrtBeginPCDFAtbl\", */ T:1 },\n\t0x00BE: { /* n:\"BrtEndPCDFAtbl\", */ T:-1 },\n\t0x00BF: { /* n:\"BrtBeginPCDIRun\", */ T:1 },\n\t0x00C0: { /* n:\"BrtEndPCDIRun\", */ T:-1 },\n\t0x00C1: { /* n:\"BrtBeginPivotCacheRecords\", */ T:1 },\n\t0x00C2: { /* n:\"BrtEndPivotCacheRecords\", */ T:-1 },\n\t0x00C3: { /* n:\"BrtBeginPCDHierarchies\", */ T:1 },\n\t0x00C4: { /* n:\"BrtEndPCDHierarchies\", */ T:-1 },\n\t0x00C5: { /* n:\"BrtBeginPCDHierarchy\", */ T:1 },\n\t0x00C6: { /* n:\"BrtEndPCDHierarchy\", */ T:-1 },\n\t0x00C7: { /* n:\"BrtBeginPCDHFieldsUsage\", */ T:1 },\n\t0x00C8: { /* n:\"BrtEndPCDHFieldsUsage\", */ T:-1 },\n\t0x00C9: { /* n:\"BrtBeginExtConnection\", */ T:1 },\n\t0x00CA: { /* n:\"BrtEndExtConnection\", */ T:-1 },\n\t0x00CB: { /* n:\"BrtBeginECDbProps\", */ T:1 },\n\t0x00CC: { /* n:\"BrtEndECDbProps\", */ T:-1 },\n\t0x00CD: { /* n:\"BrtBeginECOlapProps\", */ T:1 },\n\t0x00CE: { /* n:\"BrtEndECOlapProps\", */ T:-1 },\n\t0x00CF: { /* n:\"BrtBeginPCDSConsol\", */ T:1 },\n\t0x00D0: { /* n:\"BrtEndPCDSConsol\", */ T:-1 },\n\t0x00D1: { /* n:\"BrtBeginPCDSCPages\", */ T:1 },\n\t0x00D2: { /* n:\"BrtEndPCDSCPages\", */ T:-1 },\n\t0x00D3: { /* n:\"BrtBeginPCDSCPage\", */ T:1 },\n\t0x00D4: { /* n:\"BrtEndPCDSCPage\", */ T:-1 },\n\t0x00D5: { /* n:\"BrtBeginPCDSCPItem\", */ T:1 },\n\t0x00D6: { /* n:\"BrtEndPCDSCPItem\", */ T:-1 },\n\t0x00D7: { /* n:\"BrtBeginPCDSCSets\", */ T:1 },\n\t0x00D8: { /* n:\"BrtEndPCDSCSets\", */ T:-1 },\n\t0x00D9: { /* n:\"BrtBeginPCDSCSet\", */ T:1 },\n\t0x00DA: { /* n:\"BrtEndPCDSCSet\", */ T:-1 },\n\t0x00DB: { /* n:\"BrtBeginPCDFGroup\", */ T:1 },\n\t0x00DC: { /* n:\"BrtEndPCDFGroup\", */ T:-1 },\n\t0x00DD: { /* n:\"BrtBeginPCDFGItems\", */ T:1 },\n\t0x00DE: { /* n:\"BrtEndPCDFGItems\", */ T:-1 },\n\t0x00DF: { /* n:\"BrtBeginPCDFGRange\", */ T:1 },\n\t0x00E0: { /* n:\"BrtEndPCDFGRange\", */ T:-1 },\n\t0x00E1: { /* n:\"BrtBeginPCDFGDiscrete\", */ T:1 },\n\t0x00E2: { /* n:\"BrtEndPCDFGDiscrete\", */ T:-1 },\n\t0x00E3: { /* n:\"BrtBeginPCDSDTupleCache\", */ T:1 },\n\t0x00E4: { /* n:\"BrtEndPCDSDTupleCache\", */ T:-1 },\n\t0x00E5: { /* n:\"BrtBeginPCDSDTCEntries\", */ T:1 },\n\t0x00E6: { /* n:\"BrtEndPCDSDTCEntries\", */ T:-1 },\n\t0x00E7: { /* n:\"BrtBeginPCDSDTCEMembers\", */ T:1 },\n\t0x00E8: { /* n:\"BrtEndPCDSDTCEMembers\", */ T:-1 },\n\t0x00E9: { /* n:\"BrtBeginPCDSDTCEMember\", */ T:1 },\n\t0x00EA: { /* n:\"BrtEndPCDSDTCEMember\", */ T:-1 },\n\t0x00EB: { /* n:\"BrtBeginPCDSDTCQueries\", */ T:1 },\n\t0x00EC: { /* n:\"BrtEndPCDSDTCQueries\", */ T:-1 },\n\t0x00ED: { /* n:\"BrtBeginPCDSDTCQuery\", */ T:1 },\n\t0x00EE: { /* n:\"BrtEndPCDSDTCQuery\", */ T:-1 },\n\t0x00EF: { /* n:\"BrtBeginPCDSDTCSets\", */ T:1 },\n\t0x00F0: { /* n:\"BrtEndPCDSDTCSets\", */ T:-1 },\n\t0x00F1: { /* n:\"BrtBeginPCDSDTCSet\", */ T:1 },\n\t0x00F2: { /* n:\"BrtEndPCDSDTCSet\", */ T:-1 },\n\t0x00F3: { /* n:\"BrtBeginPCDCalcItems\", */ T:1 },\n\t0x00F4: { /* n:\"BrtEndPCDCalcItems\", */ T:-1 },\n\t0x00F5: { /* n:\"BrtBeginPCDCalcItem\", */ T:1 },\n\t0x00F6: { /* n:\"BrtEndPCDCalcItem\", */ T:-1 },\n\t0x00F7: { /* n:\"BrtBeginPRule\", */ T:1 },\n\t0x00F8: { /* n:\"BrtEndPRule\", */ T:-1 },\n\t0x00F9: { /* n:\"BrtBeginPRFilters\", */ T:1 },\n\t0x00FA: { /* n:\"BrtEndPRFilters\", */ T:-1 },\n\t0x00FB: { /* n:\"BrtBeginPRFilter\", */ T:1 },\n\t0x00FC: { /* n:\"BrtEndPRFilter\", */ T:-1 },\n\t0x00FD: { /* n:\"BrtBeginPNames\", */ T:1 },\n\t0x00FE: { /* n:\"BrtEndPNames\", */ T:-1 },\n\t0x00FF: { /* n:\"BrtBeginPName\", */ T:1 },\n\t0x0100: { /* n:\"BrtEndPName\", */ T:-1 },\n\t0x0101: { /* n:\"BrtBeginPNPairs\", */ T:1 },\n\t0x0102: { /* n:\"BrtEndPNPairs\", */ T:-1 },\n\t0x0103: { /* n:\"BrtBeginPNPair\", */ T:1 },\n\t0x0104: { /* n:\"BrtEndPNPair\", */ T:-1 },\n\t0x0105: { /* n:\"BrtBeginECWebProps\", */ T:1 },\n\t0x0106: { /* n:\"BrtEndECWebProps\", */ T:-1 },\n\t0x0107: { /* n:\"BrtBeginEcWpTables\", */ T:1 },\n\t0x0108: { /* n:\"BrtEndECWPTables\", */ T:-1 },\n\t0x0109: { /* n:\"BrtBeginECParams\", */ T:1 },\n\t0x010A: { /* n:\"BrtEndECParams\", */ T:-1 },\n\t0x010B: { /* n:\"BrtBeginECParam\", */ T:1 },\n\t0x010C: { /* n:\"BrtEndECParam\", */ T:-1 },\n\t0x010D: { /* n:\"BrtBeginPCDKPIs\", */ T:1 },\n\t0x010E: { /* n:\"BrtEndPCDKPIs\", */ T:-1 },\n\t0x010F: { /* n:\"BrtBeginPCDKPI\", */ T:1 },\n\t0x0110: { /* n:\"BrtEndPCDKPI\", */ T:-1 },\n\t0x0111: { /* n:\"BrtBeginDims\", */ T:1 },\n\t0x0112: { /* n:\"BrtEndDims\", */ T:-1 },\n\t0x0113: { /* n:\"BrtBeginDim\", */ T:1 },\n\t0x0114: { /* n:\"BrtEndDim\", */ T:-1 },\n\t0x0115: { /* n:\"BrtIndexPartEnd\" */ },\n\t0x0116: { /* n:\"BrtBeginStyleSheet\", */ T:1 },\n\t0x0117: { /* n:\"BrtEndStyleSheet\", */ T:-1 },\n\t0x0118: { /* n:\"BrtBeginSXView\", */ T:1 },\n\t0x0119: { /* n:\"BrtEndSXVI\", */ T:-1 },\n\t0x011A: { /* n:\"BrtBeginSXVI\", */ T:1 },\n\t0x011B: { /* n:\"BrtBeginSXVIs\", */ T:1 },\n\t0x011C: { /* n:\"BrtEndSXVIs\", */ T:-1 },\n\t0x011D: { /* n:\"BrtBeginSXVD\", */ T:1 },\n\t0x011E: { /* n:\"BrtEndSXVD\", */ T:-1 },\n\t0x011F: { /* n:\"BrtBeginSXVDs\", */ T:1 },\n\t0x0120: { /* n:\"BrtEndSXVDs\", */ T:-1 },\n\t0x0121: { /* n:\"BrtBeginSXPI\", */ T:1 },\n\t0x0122: { /* n:\"BrtEndSXPI\", */ T:-1 },\n\t0x0123: { /* n:\"BrtBeginSXPIs\", */ T:1 },\n\t0x0124: { /* n:\"BrtEndSXPIs\", */ T:-1 },\n\t0x0125: { /* n:\"BrtBeginSXDI\", */ T:1 },\n\t0x0126: { /* n:\"BrtEndSXDI\", */ T:-1 },\n\t0x0127: { /* n:\"BrtBeginSXDIs\", */ T:1 },\n\t0x0128: { /* n:\"BrtEndSXDIs\", */ T:-1 },\n\t0x0129: { /* n:\"BrtBeginSXLI\", */ T:1 },\n\t0x012A: { /* n:\"BrtEndSXLI\", */ T:-1 },\n\t0x012B: { /* n:\"BrtBeginSXLIRws\", */ T:1 },\n\t0x012C: { /* n:\"BrtEndSXLIRws\", */ T:-1 },\n\t0x012D: { /* n:\"BrtBeginSXLICols\", */ T:1 },\n\t0x012E: { /* n:\"BrtEndSXLICols\", */ T:-1 },\n\t0x012F: { /* n:\"BrtBeginSXFormat\", */ T:1 },\n\t0x0130: { /* n:\"BrtEndSXFormat\", */ T:-1 },\n\t0x0131: { /* n:\"BrtBeginSXFormats\", */ T:1 },\n\t0x0132: { /* n:\"BrtEndSxFormats\", */ T:-1 },\n\t0x0133: { /* n:\"BrtBeginSxSelect\", */ T:1 },\n\t0x0134: { /* n:\"BrtEndSxSelect\", */ T:-1 },\n\t0x0135: { /* n:\"BrtBeginISXVDRws\", */ T:1 },\n\t0x0136: { /* n:\"BrtEndISXVDRws\", */ T:-1 },\n\t0x0137: { /* n:\"BrtBeginISXVDCols\", */ T:1 },\n\t0x0138: { /* n:\"BrtEndISXVDCols\", */ T:-1 },\n\t0x0139: { /* n:\"BrtEndSXLocation\", */ T:-1 },\n\t0x013A: { /* n:\"BrtBeginSXLocation\", */ T:1 },\n\t0x013B: { /* n:\"BrtEndSXView\", */ T:-1 },\n\t0x013C: { /* n:\"BrtBeginSXTHs\", */ T:1 },\n\t0x013D: { /* n:\"BrtEndSXTHs\", */ T:-1 },\n\t0x013E: { /* n:\"BrtBeginSXTH\", */ T:1 },\n\t0x013F: { /* n:\"BrtEndSXTH\", */ T:-1 },\n\t0x0140: { /* n:\"BrtBeginISXTHRws\", */ T:1 },\n\t0x0141: { /* n:\"BrtEndISXTHRws\", */ T:-1 },\n\t0x0142: { /* n:\"BrtBeginISXTHCols\", */ T:1 },\n\t0x0143: { /* n:\"BrtEndISXTHCols\", */ T:-1 },\n\t0x0144: { /* n:\"BrtBeginSXTDMPS\", */ T:1 },\n\t0x0145: { /* n:\"BrtEndSXTDMPs\", */ T:-1 },\n\t0x0146: { /* n:\"BrtBeginSXTDMP\", */ T:1 },\n\t0x0147: { /* n:\"BrtEndSXTDMP\", */ T:-1 },\n\t0x0148: { /* n:\"BrtBeginSXTHItems\", */ T:1 },\n\t0x0149: { /* n:\"BrtEndSXTHItems\", */ T:-1 },\n\t0x014A: { /* n:\"BrtBeginSXTHItem\", */ T:1 },\n\t0x014B: { /* n:\"BrtEndSXTHItem\", */ T:-1 },\n\t0x014C: { /* n:\"BrtBeginMetadata\", */ T:1 },\n\t0x014D: { /* n:\"BrtEndMetadata\", */ T:-1 },\n\t0x014E: { /* n:\"BrtBeginEsmdtinfo\", */ T:1 },\n\t0x014F: { /* n:\"BrtMdtinfo\", */ f:parse_BrtMdtinfo },\n\t0x0150: { /* n:\"BrtEndEsmdtinfo\", */ T:-1 },\n\t0x0151: { /* n:\"BrtBeginEsmdb\", */ f:parse_BrtBeginEsmdb, T:1 },\n\t0x0152: { /* n:\"BrtEndEsmdb\", */ T:-1 },\n\t0x0153: { /* n:\"BrtBeginEsfmd\", */ T:1 },\n\t0x0154: { /* n:\"BrtEndEsfmd\", */ T:-1 },\n\t0x0155: { /* n:\"BrtBeginSingleCells\", */ T:1 },\n\t0x0156: { /* n:\"BrtEndSingleCells\", */ T:-1 },\n\t0x0157: { /* n:\"BrtBeginList\", */ T:1 },\n\t0x0158: { /* n:\"BrtEndList\", */ T:-1 },\n\t0x0159: { /* n:\"BrtBeginListCols\", */ T:1 },\n\t0x015A: { /* n:\"BrtEndListCols\", */ T:-1 },\n\t0x015B: { /* n:\"BrtBeginListCol\", */ T:1 },\n\t0x015C: { /* n:\"BrtEndListCol\", */ T:-1 },\n\t0x015D: { /* n:\"BrtBeginListXmlCPr\", */ T:1 },\n\t0x015E: { /* n:\"BrtEndListXmlCPr\", */ T:-1 },\n\t0x015F: { /* n:\"BrtListCCFmla\" */ },\n\t0x0160: { /* n:\"BrtListTrFmla\" */ },\n\t0x0161: { /* n:\"BrtBeginExternals\", */ T:1 },\n\t0x0162: { /* n:\"BrtEndExternals\", */ T:-1 },\n\t0x0163: { /* n:\"BrtSupBookSrc\", */ f:parse_RelID},\n\t0x0165: { /* n:\"BrtSupSelf\" */ },\n\t0x0166: { /* n:\"BrtSupSame\" */ },\n\t0x0167: { /* n:\"BrtSupTabs\" */ },\n\t0x0168: { /* n:\"BrtBeginSupBook\", */ T:1 },\n\t0x0169: { /* n:\"BrtPlaceholderName\" */ },\n\t0x016A: { /* n:\"BrtExternSheet\", */ f:parse_ExternSheet },\n\t0x016B: { /* n:\"BrtExternTableStart\" */ },\n\t0x016C: { /* n:\"BrtExternTableEnd\" */ },\n\t0x016E: { /* n:\"BrtExternRowHdr\" */ },\n\t0x016F: { /* n:\"BrtExternCellBlank\" */ },\n\t0x0170: { /* n:\"BrtExternCellReal\" */ },\n\t0x0171: { /* n:\"BrtExternCellBool\" */ },\n\t0x0172: { /* n:\"BrtExternCellError\" */ },\n\t0x0173: { /* n:\"BrtExternCellString\" */ },\n\t0x0174: { /* n:\"BrtBeginEsmdx\", */ T:1 },\n\t0x0175: { /* n:\"BrtEndEsmdx\", */ T:-1 },\n\t0x0176: { /* n:\"BrtBeginMdxSet\", */ T:1 },\n\t0x0177: { /* n:\"BrtEndMdxSet\", */ T:-1 },\n\t0x0178: { /* n:\"BrtBeginMdxMbrProp\", */ T:1 },\n\t0x0179: { /* n:\"BrtEndMdxMbrProp\", */ T:-1 },\n\t0x017A: { /* n:\"BrtBeginMdxKPI\", */ T:1 },\n\t0x017B: { /* n:\"BrtEndMdxKPI\", */ T:-1 },\n\t0x017C: { /* n:\"BrtBeginEsstr\", */ T:1 },\n\t0x017D: { /* n:\"BrtEndEsstr\", */ T:-1 },\n\t0x017E: { /* n:\"BrtBeginPRFItem\", */ T:1 },\n\t0x017F: { /* n:\"BrtEndPRFItem\", */ T:-1 },\n\t0x0180: { /* n:\"BrtBeginPivotCacheIDs\", */ T:1 },\n\t0x0181: { /* n:\"BrtEndPivotCacheIDs\", */ T:-1 },\n\t0x0182: { /* n:\"BrtBeginPivotCacheID\", */ T:1 },\n\t0x0183: { /* n:\"BrtEndPivotCacheID\", */ T:-1 },\n\t0x0184: { /* n:\"BrtBeginISXVIs\", */ T:1 },\n\t0x0185: { /* n:\"BrtEndISXVIs\", */ T:-1 },\n\t0x0186: { /* n:\"BrtBeginColInfos\", */ T:1 },\n\t0x0187: { /* n:\"BrtEndColInfos\", */ T:-1 },\n\t0x0188: { /* n:\"BrtBeginRwBrk\", */ T:1 },\n\t0x0189: { /* n:\"BrtEndRwBrk\", */ T:-1 },\n\t0x018A: { /* n:\"BrtBeginColBrk\", */ T:1 },\n\t0x018B: { /* n:\"BrtEndColBrk\", */ T:-1 },\n\t0x018C: { /* n:\"BrtBrk\" */ },\n\t0x018D: { /* n:\"BrtUserBookView\" */ },\n\t0x018E: { /* n:\"BrtInfo\" */ },\n\t0x018F: { /* n:\"BrtCUsr\" */ },\n\t0x0190: { /* n:\"BrtUsr\" */ },\n\t0x0191: { /* n:\"BrtBeginUsers\", */ T:1 },\n\t0x0193: { /* n:\"BrtEOF\" */ },\n\t0x0194: { /* n:\"BrtUCR\" */ },\n\t0x0195: { /* n:\"BrtRRInsDel\" */ },\n\t0x0196: { /* n:\"BrtRREndInsDel\" */ },\n\t0x0197: { /* n:\"BrtRRMove\" */ },\n\t0x0198: { /* n:\"BrtRREndMove\" */ },\n\t0x0199: { /* n:\"BrtRRChgCell\" */ },\n\t0x019A: { /* n:\"BrtRREndChgCell\" */ },\n\t0x019B: { /* n:\"BrtRRHeader\" */ },\n\t0x019C: { /* n:\"BrtRRUserView\" */ },\n\t0x019D: { /* n:\"BrtRRRenSheet\" */ },\n\t0x019E: { /* n:\"BrtRRInsertSh\" */ },\n\t0x019F: { /* n:\"BrtRRDefName\" */ },\n\t0x01A0: { /* n:\"BrtRRNote\" */ },\n\t0x01A1: { /* n:\"BrtRRConflict\" */ },\n\t0x01A2: { /* n:\"BrtRRTQSIF\" */ },\n\t0x01A3: { /* n:\"BrtRRFormat\" */ },\n\t0x01A4: { /* n:\"BrtRREndFormat\" */ },\n\t0x01A5: { /* n:\"BrtRRAutoFmt\" */ },\n\t0x01A6: { /* n:\"BrtBeginUserShViews\", */ T:1 },\n\t0x01A7: { /* n:\"BrtBeginUserShView\", */ T:1 },\n\t0x01A8: { /* n:\"BrtEndUserShView\", */ T:-1 },\n\t0x01A9: { /* n:\"BrtEndUserShViews\", */ T:-1 },\n\t0x01AA: { /* n:\"BrtArrFmla\", */ f:parse_BrtArrFmla },\n\t0x01AB: { /* n:\"BrtShrFmla\", */ f:parse_BrtShrFmla },\n\t0x01AC: { /* n:\"BrtTable\" */ },\n\t0x01AD: { /* n:\"BrtBeginExtConnections\", */ T:1 },\n\t0x01AE: { /* n:\"BrtEndExtConnections\", */ T:-1 },\n\t0x01AF: { /* n:\"BrtBeginPCDCalcMems\", */ T:1 },\n\t0x01B0: { /* n:\"BrtEndPCDCalcMems\", */ T:-1 },\n\t0x01B1: { /* n:\"BrtBeginPCDCalcMem\", */ T:1 },\n\t0x01B2: { /* n:\"BrtEndPCDCalcMem\", */ T:-1 },\n\t0x01B3: { /* n:\"BrtBeginPCDHGLevels\", */ T:1 },\n\t0x01B4: { /* n:\"BrtEndPCDHGLevels\", */ T:-1 },\n\t0x01B5: { /* n:\"BrtBeginPCDHGLevel\", */ T:1 },\n\t0x01B6: { /* n:\"BrtEndPCDHGLevel\", */ T:-1 },\n\t0x01B7: { /* n:\"BrtBeginPCDHGLGroups\", */ T:1 },\n\t0x01B8: { /* n:\"BrtEndPCDHGLGroups\", */ T:-1 },\n\t0x01B9: { /* n:\"BrtBeginPCDHGLGroup\", */ T:1 },\n\t0x01BA: { /* n:\"BrtEndPCDHGLGroup\", */ T:-1 },\n\t0x01BB: { /* n:\"BrtBeginPCDHGLGMembers\", */ T:1 },\n\t0x01BC: { /* n:\"BrtEndPCDHGLGMembers\", */ T:-1 },\n\t0x01BD: { /* n:\"BrtBeginPCDHGLGMember\", */ T:1 },\n\t0x01BE: { /* n:\"BrtEndPCDHGLGMember\", */ T:-1 },\n\t0x01BF: { /* n:\"BrtBeginQSI\", */ T:1 },\n\t0x01C0: { /* n:\"BrtEndQSI\", */ T:-1 },\n\t0x01C1: { /* n:\"BrtBeginQSIR\", */ T:1 },\n\t0x01C2: { /* n:\"BrtEndQSIR\", */ T:-1 },\n\t0x01C3: { /* n:\"BrtBeginDeletedNames\", */ T:1 },\n\t0x01C4: { /* n:\"BrtEndDeletedNames\", */ T:-1 },\n\t0x01C5: { /* n:\"BrtBeginDeletedName\", */ T:1 },\n\t0x01C6: { /* n:\"BrtEndDeletedName\", */ T:-1 },\n\t0x01C7: { /* n:\"BrtBeginQSIFs\", */ T:1 },\n\t0x01C8: { /* n:\"BrtEndQSIFs\", */ T:-1 },\n\t0x01C9: { /* n:\"BrtBeginQSIF\", */ T:1 },\n\t0x01CA: { /* n:\"BrtEndQSIF\", */ T:-1 },\n\t0x01CB: { /* n:\"BrtBeginAutoSortScope\", */ T:1 },\n\t0x01CC: { /* n:\"BrtEndAutoSortScope\", */ T:-1 },\n\t0x01CD: { /* n:\"BrtBeginConditionalFormatting\", */ T:1 },\n\t0x01CE: { /* n:\"BrtEndConditionalFormatting\", */ T:-1 },\n\t0x01CF: { /* n:\"BrtBeginCFRule\", */ T:1 },\n\t0x01D0: { /* n:\"BrtEndCFRule\", */ T:-1 },\n\t0x01D1: { /* n:\"BrtBeginIconSet\", */ T:1 },\n\t0x01D2: { /* n:\"BrtEndIconSet\", */ T:-1 },\n\t0x01D3: { /* n:\"BrtBeginDatabar\", */ T:1 },\n\t0x01D4: { /* n:\"BrtEndDatabar\", */ T:-1 },\n\t0x01D5: { /* n:\"BrtBeginColorScale\", */ T:1 },\n\t0x01D6: { /* n:\"BrtEndColorScale\", */ T:-1 },\n\t0x01D7: { /* n:\"BrtCFVO\" */ },\n\t0x01D8: { /* n:\"BrtExternValueMeta\" */ },\n\t0x01D9: { /* n:\"BrtBeginColorPalette\", */ T:1 },\n\t0x01DA: { /* n:\"BrtEndColorPalette\", */ T:-1 },\n\t0x01DB: { /* n:\"BrtIndexedColor\" */ },\n\t0x01DC: { /* n:\"BrtMargins\", */ f:parse_BrtMargins },\n\t0x01DD: { /* n:\"BrtPrintOptions\" */ },\n\t0x01DE: { /* n:\"BrtPageSetup\" */ },\n\t0x01DF: { /* n:\"BrtBeginHeaderFooter\", */ T:1 },\n\t0x01E0: { /* n:\"BrtEndHeaderFooter\", */ T:-1 },\n\t0x01E1: { /* n:\"BrtBeginSXCrtFormat\", */ T:1 },\n\t0x01E2: { /* n:\"BrtEndSXCrtFormat\", */ T:-1 },\n\t0x01E3: { /* n:\"BrtBeginSXCrtFormats\", */ T:1 },\n\t0x01E4: { /* n:\"BrtEndSXCrtFormats\", */ T:-1 },\n\t0x01E5: { /* n:\"BrtWsFmtInfo\", */ f:parse_BrtWsFmtInfo },\n\t0x01E6: { /* n:\"BrtBeginMgs\", */ T:1 },\n\t0x01E7: { /* n:\"BrtEndMGs\", */ T:-1 },\n\t0x01E8: { /* n:\"BrtBeginMGMaps\", */ T:1 },\n\t0x01E9: { /* n:\"BrtEndMGMaps\", */ T:-1 },\n\t0x01EA: { /* n:\"BrtBeginMG\", */ T:1 },\n\t0x01EB: { /* n:\"BrtEndMG\", */ T:-1 },\n\t0x01EC: { /* n:\"BrtBeginMap\", */ T:1 },\n\t0x01ED: { /* n:\"BrtEndMap\", */ T:-1 },\n\t0x01EE: { /* n:\"BrtHLink\", */ f:parse_BrtHLink },\n\t0x01EF: { /* n:\"BrtBeginDCon\", */ T:1 },\n\t0x01F0: { /* n:\"BrtEndDCon\", */ T:-1 },\n\t0x01F1: { /* n:\"BrtBeginDRefs\", */ T:1 },\n\t0x01F2: { /* n:\"BrtEndDRefs\", */ T:-1 },\n\t0x01F3: { /* n:\"BrtDRef\" */ },\n\t0x01F4: { /* n:\"BrtBeginScenMan\", */ T:1 },\n\t0x01F5: { /* n:\"BrtEndScenMan\", */ T:-1 },\n\t0x01F6: { /* n:\"BrtBeginSct\", */ T:1 },\n\t0x01F7: { /* n:\"BrtEndSct\", */ T:-1 },\n\t0x01F8: { /* n:\"BrtSlc\" */ },\n\t0x01F9: { /* n:\"BrtBeginDXFs\", */ T:1 },\n\t0x01FA: { /* n:\"BrtEndDXFs\", */ T:-1 },\n\t0x01FB: { /* n:\"BrtDXF\" */ },\n\t0x01FC: { /* n:\"BrtBeginTableStyles\", */ T:1 },\n\t0x01FD: { /* n:\"BrtEndTableStyles\", */ T:-1 },\n\t0x01FE: { /* n:\"BrtBeginTableStyle\", */ T:1 },\n\t0x01FF: { /* n:\"BrtEndTableStyle\", */ T:-1 },\n\t0x0200: { /* n:\"BrtTableStyleElement\" */ },\n\t0x0201: { /* n:\"BrtTableStyleClient\" */ },\n\t0x0202: { /* n:\"BrtBeginVolDeps\", */ T:1 },\n\t0x0203: { /* n:\"BrtEndVolDeps\", */ T:-1 },\n\t0x0204: { /* n:\"BrtBeginVolType\", */ T:1 },\n\t0x0205: { /* n:\"BrtEndVolType\", */ T:-1 },\n\t0x0206: { /* n:\"BrtBeginVolMain\", */ T:1 },\n\t0x0207: { /* n:\"BrtEndVolMain\", */ T:-1 },\n\t0x0208: { /* n:\"BrtBeginVolTopic\", */ T:1 },\n\t0x0209: { /* n:\"BrtEndVolTopic\", */ T:-1 },\n\t0x020A: { /* n:\"BrtVolSubtopic\" */ },\n\t0x020B: { /* n:\"BrtVolRef\" */ },\n\t0x020C: { /* n:\"BrtVolNum\" */ },\n\t0x020D: { /* n:\"BrtVolErr\" */ },\n\t0x020E: { /* n:\"BrtVolStr\" */ },\n\t0x020F: { /* n:\"BrtVolBool\" */ },\n\t0x0210: { /* n:\"BrtBeginCalcChain$\", */ T:1 },\n\t0x0211: { /* n:\"BrtEndCalcChain$\", */ T:-1 },\n\t0x0212: { /* n:\"BrtBeginSortState\", */ T:1 },\n\t0x0213: { /* n:\"BrtEndSortState\", */ T:-1 },\n\t0x0214: { /* n:\"BrtBeginSortCond\", */ T:1 },\n\t0x0215: { /* n:\"BrtEndSortCond\", */ T:-1 },\n\t0x0216: { /* n:\"BrtBookProtection\" */ },\n\t0x0217: { /* n:\"BrtSheetProtection\" */ },\n\t0x0218: { /* n:\"BrtRangeProtection\" */ },\n\t0x0219: { /* n:\"BrtPhoneticInfo\" */ },\n\t0x021A: { /* n:\"BrtBeginECTxtWiz\", */ T:1 },\n\t0x021B: { /* n:\"BrtEndECTxtWiz\", */ T:-1 },\n\t0x021C: { /* n:\"BrtBeginECTWFldInfoLst\", */ T:1 },\n\t0x021D: { /* n:\"BrtEndECTWFldInfoLst\", */ T:-1 },\n\t0x021E: { /* n:\"BrtBeginECTwFldInfo\", */ T:1 },\n\t0x0224: { /* n:\"BrtFileSharing\" */ },\n\t0x0225: { /* n:\"BrtOleSize\" */ },\n\t0x0226: { /* n:\"BrtDrawing\", */ f:parse_RelID },\n\t0x0227: { /* n:\"BrtLegacyDrawing\", */ f:parse_XLNullableWideString },\n\t0x0228: { /* n:\"BrtLegacyDrawingHF\" */ },\n\t0x0229: { /* n:\"BrtWebOpt\" */ },\n\t0x022A: { /* n:\"BrtBeginWebPubItems\", */ T:1 },\n\t0x022B: { /* n:\"BrtEndWebPubItems\", */ T:-1 },\n\t0x022C: { /* n:\"BrtBeginWebPubItem\", */ T:1 },\n\t0x022D: { /* n:\"BrtEndWebPubItem\", */ T:-1 },\n\t0x022E: { /* n:\"BrtBeginSXCondFmt\", */ T:1 },\n\t0x022F: { /* n:\"BrtEndSXCondFmt\", */ T:-1 },\n\t0x0230: { /* n:\"BrtBeginSXCondFmts\", */ T:1 },\n\t0x0231: { /* n:\"BrtEndSXCondFmts\", */ T:-1 },\n\t0x0232: { /* n:\"BrtBkHim\" */ },\n\t0x0234: { /* n:\"BrtColor\" */ },\n\t0x0235: { /* n:\"BrtBeginIndexedColors\", */ T:1 },\n\t0x0236: { /* n:\"BrtEndIndexedColors\", */ T:-1 },\n\t0x0239: { /* n:\"BrtBeginMRUColors\", */ T:1 },\n\t0x023A: { /* n:\"BrtEndMRUColors\", */ T:-1 },\n\t0x023C: { /* n:\"BrtMRUColor\" */ },\n\t0x023D: { /* n:\"BrtBeginDVals\", */ T:1 },\n\t0x023E: { /* n:\"BrtEndDVals\", */ T:-1 },\n\t0x0241: { /* n:\"BrtSupNameStart\" */ },\n\t0x0242: { /* n:\"BrtSupNameValueStart\" */ },\n\t0x0243: { /* n:\"BrtSupNameValueEnd\" */ },\n\t0x0244: { /* n:\"BrtSupNameNum\" */ },\n\t0x0245: { /* n:\"BrtSupNameErr\" */ },\n\t0x0246: { /* n:\"BrtSupNameSt\" */ },\n\t0x0247: { /* n:\"BrtSupNameNil\" */ },\n\t0x0248: { /* n:\"BrtSupNameBool\" */ },\n\t0x0249: { /* n:\"BrtSupNameFmla\" */ },\n\t0x024A: { /* n:\"BrtSupNameBits\" */ },\n\t0x024B: { /* n:\"BrtSupNameEnd\" */ },\n\t0x024C: { /* n:\"BrtEndSupBook\", */ T:-1 },\n\t0x024D: { /* n:\"BrtCellSmartTagProperty\" */ },\n\t0x024E: { /* n:\"BrtBeginCellSmartTag\", */ T:1 },\n\t0x024F: { /* n:\"BrtEndCellSmartTag\", */ T:-1 },\n\t0x0250: { /* n:\"BrtBeginCellSmartTags\", */ T:1 },\n\t0x0251: { /* n:\"BrtEndCellSmartTags\", */ T:-1 },\n\t0x0252: { /* n:\"BrtBeginSmartTags\", */ T:1 },\n\t0x0253: { /* n:\"BrtEndSmartTags\", */ T:-1 },\n\t0x0254: { /* n:\"BrtSmartTagType\" */ },\n\t0x0255: { /* n:\"BrtBeginSmartTagTypes\", */ T:1 },\n\t0x0256: { /* n:\"BrtEndSmartTagTypes\", */ T:-1 },\n\t0x0257: { /* n:\"BrtBeginSXFilters\", */ T:1 },\n\t0x0258: { /* n:\"BrtEndSXFilters\", */ T:-1 },\n\t0x0259: { /* n:\"BrtBeginSXFILTER\", */ T:1 },\n\t0x025A: { /* n:\"BrtEndSXFilter\", */ T:-1 },\n\t0x025B: { /* n:\"BrtBeginFills\", */ T:1 },\n\t0x025C: { /* n:\"BrtEndFills\", */ T:-1 },\n\t0x025D: { /* n:\"BrtBeginCellWatches\", */ T:1 },\n\t0x025E: { /* n:\"BrtEndCellWatches\", */ T:-1 },\n\t0x025F: { /* n:\"BrtCellWatch\" */ },\n\t0x0260: { /* n:\"BrtBeginCRErrs\", */ T:1 },\n\t0x0261: { /* n:\"BrtEndCRErrs\", */ T:-1 },\n\t0x0262: { /* n:\"BrtCrashRecErr\" */ },\n\t0x0263: { /* n:\"BrtBeginFonts\", */ T:1 },\n\t0x0264: { /* n:\"BrtEndFonts\", */ T:-1 },\n\t0x0265: { /* n:\"BrtBeginBorders\", */ T:1 },\n\t0x0266: { /* n:\"BrtEndBorders\", */ T:-1 },\n\t0x0267: { /* n:\"BrtBeginFmts\", */ T:1 },\n\t0x0268: { /* n:\"BrtEndFmts\", */ T:-1 },\n\t0x0269: { /* n:\"BrtBeginCellXFs\", */ T:1 },\n\t0x026A: { /* n:\"BrtEndCellXFs\", */ T:-1 },\n\t0x026B: { /* n:\"BrtBeginStyles\", */ T:1 },\n\t0x026C: { /* n:\"BrtEndStyles\", */ T:-1 },\n\t0x0271: { /* n:\"BrtBigName\" */ },\n\t0x0272: { /* n:\"BrtBeginCellStyleXFs\", */ T:1 },\n\t0x0273: { /* n:\"BrtEndCellStyleXFs\", */ T:-1 },\n\t0x0274: { /* n:\"BrtBeginComments\", */ T:1 },\n\t0x0275: { /* n:\"BrtEndComments\", */ T:-1 },\n\t0x0276: { /* n:\"BrtBeginCommentAuthors\", */ T:1 },\n\t0x0277: { /* n:\"BrtEndCommentAuthors\", */ T:-1 },\n\t0x0278: { /* n:\"BrtCommentAuthor\", */ f:parse_BrtCommentAuthor },\n\t0x0279: { /* n:\"BrtBeginCommentList\", */ T:1 },\n\t0x027A: { /* n:\"BrtEndCommentList\", */ T:-1 },\n\t0x027B: { /* n:\"BrtBeginComment\", */ T:1, f:parse_BrtBeginComment},\n\t0x027C: { /* n:\"BrtEndComment\", */ T:-1 },\n\t0x027D: { /* n:\"BrtCommentText\", */ f:parse_BrtCommentText },\n\t0x027E: { /* n:\"BrtBeginOleObjects\", */ T:1 },\n\t0x027F: { /* n:\"BrtOleObject\" */ },\n\t0x0280: { /* n:\"BrtEndOleObjects\", */ T:-1 },\n\t0x0281: { /* n:\"BrtBeginSxrules\", */ T:1 },\n\t0x0282: { /* n:\"BrtEndSxRules\", */ T:-1 },\n\t0x0283: { /* n:\"BrtBeginActiveXControls\", */ T:1 },\n\t0x0284: { /* n:\"BrtActiveX\" */ },\n\t0x0285: { /* n:\"BrtEndActiveXControls\", */ T:-1 },\n\t0x0286: { /* n:\"BrtBeginPCDSDTCEMembersSortBy\", */ T:1 },\n\t0x0288: { /* n:\"BrtBeginCellIgnoreECs\", */ T:1 },\n\t0x0289: { /* n:\"BrtCellIgnoreEC\" */ },\n\t0x028A: { /* n:\"BrtEndCellIgnoreECs\", */ T:-1 },\n\t0x028B: { /* n:\"BrtCsProp\", */ f:parse_BrtCsProp },\n\t0x028C: { /* n:\"BrtCsPageSetup\" */ },\n\t0x028D: { /* n:\"BrtBeginUserCsViews\", */ T:1 },\n\t0x028E: { /* n:\"BrtEndUserCsViews\", */ T:-1 },\n\t0x028F: { /* n:\"BrtBeginUserCsView\", */ T:1 },\n\t0x0290: { /* n:\"BrtEndUserCsView\", */ T:-1 },\n\t0x0291: { /* n:\"BrtBeginPcdSFCIEntries\", */ T:1 },\n\t0x0292: { /* n:\"BrtEndPCDSFCIEntries\", */ T:-1 },\n\t0x0293: { /* n:\"BrtPCDSFCIEntry\" */ },\n\t0x0294: { /* n:\"BrtBeginListParts\", */ T:1 },\n\t0x0295: { /* n:\"BrtListPart\" */ },\n\t0x0296: { /* n:\"BrtEndListParts\", */ T:-1 },\n\t0x0297: { /* n:\"BrtSheetCalcProp\" */ },\n\t0x0298: { /* n:\"BrtBeginFnGroup\", */ T:1 },\n\t0x0299: { /* n:\"BrtFnGroup\" */ },\n\t0x029A: { /* n:\"BrtEndFnGroup\", */ T:-1 },\n\t0x029B: { /* n:\"BrtSupAddin\" */ },\n\t0x029C: { /* n:\"BrtSXTDMPOrder\" */ },\n\t0x029D: { /* n:\"BrtCsProtection\" */ },\n\t0x029F: { /* n:\"BrtBeginWsSortMap\", */ T:1 },\n\t0x02A0: { /* n:\"BrtEndWsSortMap\", */ T:-1 },\n\t0x02A1: { /* n:\"BrtBeginRRSort\", */ T:1 },\n\t0x02A2: { /* n:\"BrtEndRRSort\", */ T:-1 },\n\t0x02A3: { /* n:\"BrtRRSortItem\" */ },\n\t0x02A4: { /* n:\"BrtFileSharingIso\" */ },\n\t0x02A5: { /* n:\"BrtBookProtectionIso\" */ },\n\t0x02A6: { /* n:\"BrtSheetProtectionIso\" */ },\n\t0x02A7: { /* n:\"BrtCsProtectionIso\" */ },\n\t0x02A8: { /* n:\"BrtRangeProtectionIso\" */ },\n\t0x02A9: { /* n:\"BrtDValList\" */ },\n\t0x0400: { /* n:\"BrtRwDescent\" */ },\n\t0x0401: { /* n:\"BrtKnownFonts\" */ },\n\t0x0402: { /* n:\"BrtBeginSXTupleSet\", */ T:1 },\n\t0x0403: { /* n:\"BrtEndSXTupleSet\", */ T:-1 },\n\t0x0404: { /* n:\"BrtBeginSXTupleSetHeader\", */ T:1 },\n\t0x0405: { /* n:\"BrtEndSXTupleSetHeader\", */ T:-1 },\n\t0x0406: { /* n:\"BrtSXTupleSetHeaderItem\" */ },\n\t0x0407: { /* n:\"BrtBeginSXTupleSetData\", */ T:1 },\n\t0x0408: { /* n:\"BrtEndSXTupleSetData\", */ T:-1 },\n\t0x0409: { /* n:\"BrtBeginSXTupleSetRow\", */ T:1 },\n\t0x040A: { /* n:\"BrtEndSXTupleSetRow\", */ T:-1 },\n\t0x040B: { /* n:\"BrtSXTupleSetRowItem\" */ },\n\t0x040C: { /* n:\"BrtNameExt\" */ },\n\t0x040D: { /* n:\"BrtPCDH14\" */ },\n\t0x040E: { /* n:\"BrtBeginPCDCalcMem14\", */ T:1 },\n\t0x040F: { /* n:\"BrtEndPCDCalcMem14\", */ T:-1 },\n\t0x0410: { /* n:\"BrtSXTH14\" */ },\n\t0x0411: { /* n:\"BrtBeginSparklineGroup\", */ T:1 },\n\t0x0412: { /* n:\"BrtEndSparklineGroup\", */ T:-1 },\n\t0x0413: { /* n:\"BrtSparkline\" */ },\n\t0x0414: { /* n:\"BrtSXDI14\" */ },\n\t0x0415: { /* n:\"BrtWsFmtInfoEx14\" */ },\n\t0x0416: { /* n:\"BrtBeginConditionalFormatting14\", */ T:1 },\n\t0x0417: { /* n:\"BrtEndConditionalFormatting14\", */ T:-1 },\n\t0x0418: { /* n:\"BrtBeginCFRule14\", */ T:1 },\n\t0x0419: { /* n:\"BrtEndCFRule14\", */ T:-1 },\n\t0x041A: { /* n:\"BrtCFVO14\" */ },\n\t0x041B: { /* n:\"BrtBeginDatabar14\", */ T:1 },\n\t0x041C: { /* n:\"BrtBeginIconSet14\", */ T:1 },\n\t0x041D: { /* n:\"BrtDVal14\", */ f: parse_BrtDVal14 },\n\t0x041E: { /* n:\"BrtBeginDVals14\", */ T:1 },\n\t0x041F: { /* n:\"BrtColor14\" */ },\n\t0x0420: { /* n:\"BrtBeginSparklines\", */ T:1 },\n\t0x0421: { /* n:\"BrtEndSparklines\", */ T:-1 },\n\t0x0422: { /* n:\"BrtBeginSparklineGroups\", */ T:1 },\n\t0x0423: { /* n:\"BrtEndSparklineGroups\", */ T:-1 },\n\t0x0425: { /* n:\"BrtSXVD14\" */ },\n\t0x0426: { /* n:\"BrtBeginSXView14\", */ T:1 },\n\t0x0427: { /* n:\"BrtEndSXView14\", */ T:-1 },\n\t0x0428: { /* n:\"BrtBeginSXView16\", */ T:1 },\n\t0x0429: { /* n:\"BrtEndSXView16\", */ T:-1 },\n\t0x042A: { /* n:\"BrtBeginPCD14\", */ T:1 },\n\t0x042B: { /* n:\"BrtEndPCD14\", */ T:-1 },\n\t0x042C: { /* n:\"BrtBeginExtConn14\", */ T:1 },\n\t0x042D: { /* n:\"BrtEndExtConn14\", */ T:-1 },\n\t0x042E: { /* n:\"BrtBeginSlicerCacheIDs\", */ T:1 },\n\t0x042F: { /* n:\"BrtEndSlicerCacheIDs\", */ T:-1 },\n\t0x0430: { /* n:\"BrtBeginSlicerCacheID\", */ T:1 },\n\t0x0431: { /* n:\"BrtEndSlicerCacheID\", */ T:-1 },\n\t0x0433: { /* n:\"BrtBeginSlicerCache\", */ T:1 },\n\t0x0434: { /* n:\"BrtEndSlicerCache\", */ T:-1 },\n\t0x0435: { /* n:\"BrtBeginSlicerCacheDef\", */ T:1 },\n\t0x0436: { /* n:\"BrtEndSlicerCacheDef\", */ T:-1 },\n\t0x0437: { /* n:\"BrtBeginSlicersEx\", */ T:1 },\n\t0x0438: { /* n:\"BrtEndSlicersEx\", */ T:-1 },\n\t0x0439: { /* n:\"BrtBeginSlicerEx\", */ T:1 },\n\t0x043A: { /* n:\"BrtEndSlicerEx\", */ T:-1 },\n\t0x043B: { /* n:\"BrtBeginSlicer\", */ T:1 },\n\t0x043C: { /* n:\"BrtEndSlicer\", */ T:-1 },\n\t0x043D: { /* n:\"BrtSlicerCachePivotTables\" */ },\n\t0x043E: { /* n:\"BrtBeginSlicerCacheOlapImpl\", */ T:1 },\n\t0x043F: { /* n:\"BrtEndSlicerCacheOlapImpl\", */ T:-1 },\n\t0x0440: { /* n:\"BrtBeginSlicerCacheLevelsData\", */ T:1 },\n\t0x0441: { /* n:\"BrtEndSlicerCacheLevelsData\", */ T:-1 },\n\t0x0442: { /* n:\"BrtBeginSlicerCacheLevelData\", */ T:1 },\n\t0x0443: { /* n:\"BrtEndSlicerCacheLevelData\", */ T:-1 },\n\t0x0444: { /* n:\"BrtBeginSlicerCacheSiRanges\", */ T:1 },\n\t0x0445: { /* n:\"BrtEndSlicerCacheSiRanges\", */ T:-1 },\n\t0x0446: { /* n:\"BrtBeginSlicerCacheSiRange\", */ T:1 },\n\t0x0447: { /* n:\"BrtEndSlicerCacheSiRange\", */ T:-1 },\n\t0x0448: { /* n:\"BrtSlicerCacheOlapItem\" */ },\n\t0x0449: { /* n:\"BrtBeginSlicerCacheSelections\", */ T:1 },\n\t0x044A: { /* n:\"BrtSlicerCacheSelection\" */ },\n\t0x044B: { /* n:\"BrtEndSlicerCacheSelections\", */ T:-1 },\n\t0x044C: { /* n:\"BrtBeginSlicerCacheNative\", */ T:1 },\n\t0x044D: { /* n:\"BrtEndSlicerCacheNative\", */ T:-1 },\n\t0x044E: { /* n:\"BrtSlicerCacheNativeItem\" */ },\n\t0x044F: { /* n:\"BrtRangeProtection14\" */ },\n\t0x0450: { /* n:\"BrtRangeProtectionIso14\" */ },\n\t0x0451: { /* n:\"BrtCellIgnoreEC14\" */ },\n\t0x0457: { /* n:\"BrtList14\" */ },\n\t0x0458: { /* n:\"BrtCFIcon\" */ },\n\t0x0459: { /* n:\"BrtBeginSlicerCachesPivotCacheIDs\", */ T:1 },\n\t0x045A: { /* n:\"BrtEndSlicerCachesPivotCacheIDs\", */ T:-1 },\n\t0x045B: { /* n:\"BrtBeginSlicers\", */ T:1 },\n\t0x045C: { /* n:\"BrtEndSlicers\", */ T:-1 },\n\t0x045D: { /* n:\"BrtWbProp14\" */ },\n\t0x045E: { /* n:\"BrtBeginSXEdit\", */ T:1 },\n\t0x045F: { /* n:\"BrtEndSXEdit\", */ T:-1 },\n\t0x0460: { /* n:\"BrtBeginSXEdits\", */ T:1 },\n\t0x0461: { /* n:\"BrtEndSXEdits\", */ T:-1 },\n\t0x0462: { /* n:\"BrtBeginSXChange\", */ T:1 },\n\t0x0463: { /* n:\"BrtEndSXChange\", */ T:-1 },\n\t0x0464: { /* n:\"BrtBeginSXChanges\", */ T:1 },\n\t0x0465: { /* n:\"BrtEndSXChanges\", */ T:-1 },\n\t0x0466: { /* n:\"BrtSXTupleItems\" */ },\n\t0x0468: { /* n:\"BrtBeginSlicerStyle\", */ T:1 },\n\t0x0469: { /* n:\"BrtEndSlicerStyle\", */ T:-1 },\n\t0x046A: { /* n:\"BrtSlicerStyleElement\" */ },\n\t0x046B: { /* n:\"BrtBeginStyleSheetExt14\", */ T:1 },\n\t0x046C: { /* n:\"BrtEndStyleSheetExt14\", */ T:-1 },\n\t0x046D: { /* n:\"BrtBeginSlicerCachesPivotCacheID\", */ T:1 },\n\t0x046E: { /* n:\"BrtEndSlicerCachesPivotCacheID\", */ T:-1 },\n\t0x046F: { /* n:\"BrtBeginConditionalFormattings\", */ T:1 },\n\t0x0470: { /* n:\"BrtEndConditionalFormattings\", */ T:-1 },\n\t0x0471: { /* n:\"BrtBeginPCDCalcMemExt\", */ T:1 },\n\t0x0472: { /* n:\"BrtEndPCDCalcMemExt\", */ T:-1 },\n\t0x0473: { /* n:\"BrtBeginPCDCalcMemsExt\", */ T:1 },\n\t0x0474: { /* n:\"BrtEndPCDCalcMemsExt\", */ T:-1 },\n\t0x0475: { /* n:\"BrtPCDField14\" */ },\n\t0x0476: { /* n:\"BrtBeginSlicerStyles\", */ T:1 },\n\t0x0477: { /* n:\"BrtEndSlicerStyles\", */ T:-1 },\n\t0x0478: { /* n:\"BrtBeginSlicerStyleElements\", */ T:1 },\n\t0x0479: { /* n:\"BrtEndSlicerStyleElements\", */ T:-1 },\n\t0x047A: { /* n:\"BrtCFRuleExt\" */ },\n\t0x047B: { /* n:\"BrtBeginSXCondFmt14\", */ T:1 },\n\t0x047C: { /* n:\"BrtEndSXCondFmt14\", */ T:-1 },\n\t0x047D: { /* n:\"BrtBeginSXCondFmts14\", */ T:1 },\n\t0x047E: { /* n:\"BrtEndSXCondFmts14\", */ T:-1 },\n\t0x0480: { /* n:\"BrtBeginSortCond14\", */ T:1 },\n\t0x0481: { /* n:\"BrtEndSortCond14\", */ T:-1 },\n\t0x0482: { /* n:\"BrtEndDVals14\", */ T:-1 },\n\t0x0483: { /* n:\"BrtEndIconSet14\", */ T:-1 },\n\t0x0484: { /* n:\"BrtEndDatabar14\", */ T:-1 },\n\t0x0485: { /* n:\"BrtBeginColorScale14\", */ T:1 },\n\t0x0486: { /* n:\"BrtEndColorScale14\", */ T:-1 },\n\t0x0487: { /* n:\"BrtBeginSxrules14\", */ T:1 },\n\t0x0488: { /* n:\"BrtEndSxrules14\", */ T:-1 },\n\t0x0489: { /* n:\"BrtBeginPRule14\", */ T:1 },\n\t0x048A: { /* n:\"BrtEndPRule14\", */ T:-1 },\n\t0x048B: { /* n:\"BrtBeginPRFilters14\", */ T:1 },\n\t0x048C: { /* n:\"BrtEndPRFilters14\", */ T:-1 },\n\t0x048D: { /* n:\"BrtBeginPRFilter14\", */ T:1 },\n\t0x048E: { /* n:\"BrtEndPRFilter14\", */ T:-1 },\n\t0x048F: { /* n:\"BrtBeginPRFItem14\", */ T:1 },\n\t0x0490: { /* n:\"BrtEndPRFItem14\", */ T:-1 },\n\t0x0491: { /* n:\"BrtBeginCellIgnoreECs14\", */ T:1 },\n\t0x0492: { /* n:\"BrtEndCellIgnoreECs14\", */ T:-1 },\n\t0x0493: { /* n:\"BrtDxf14\" */ },\n\t0x0494: { /* n:\"BrtBeginDxF14s\", */ T:1 },\n\t0x0495: { /* n:\"BrtEndDxf14s\", */ T:-1 },\n\t0x0499: { /* n:\"BrtFilter14\" */ },\n\t0x049A: { /* n:\"BrtBeginCustomFilters14\", */ T:1 },\n\t0x049C: { /* n:\"BrtCustomFilter14\" */ },\n\t0x049D: { /* n:\"BrtIconFilter14\" */ },\n\t0x049E: { /* n:\"BrtPivotCacheConnectionName\" */ },\n\t0x0800: { /* n:\"BrtBeginDecoupledPivotCacheIDs\", */ T:1 },\n\t0x0801: { /* n:\"BrtEndDecoupledPivotCacheIDs\", */ T:-1 },\n\t0x0802: { /* n:\"BrtDecoupledPivotCacheID\" */ },\n\t0x0803: { /* n:\"BrtBeginPivotTableRefs\", */ T:1 },\n\t0x0804: { /* n:\"BrtEndPivotTableRefs\", */ T:-1 },\n\t0x0805: { /* n:\"BrtPivotTableRef\" */ },\n\t0x0806: { /* n:\"BrtSlicerCacheBookPivotTables\" */ },\n\t0x0807: { /* n:\"BrtBeginSxvcells\", */ T:1 },\n\t0x0808: { /* n:\"BrtEndSxvcells\", */ T:-1 },\n\t0x0809: { /* n:\"BrtBeginSxRow\", */ T:1 },\n\t0x080A: { /* n:\"BrtEndSxRow\", */ T:-1 },\n\t0x080C: { /* n:\"BrtPcdCalcMem15\" */ },\n\t0x0813: { /* n:\"BrtQsi15\" */ },\n\t0x0814: { /* n:\"BrtBeginWebExtensions\", */ T:1 },\n\t0x0815: { /* n:\"BrtEndWebExtensions\", */ T:-1 },\n\t0x0816: { /* n:\"BrtWebExtension\" */ },\n\t0x0817: { /* n:\"BrtAbsPath15\" */ },\n\t0x0818: { /* n:\"BrtBeginPivotTableUISettings\", */ T:1 },\n\t0x0819: { /* n:\"BrtEndPivotTableUISettings\", */ T:-1 },\n\t0x081B: { /* n:\"BrtTableSlicerCacheIDs\" */ },\n\t0x081C: { /* n:\"BrtTableSlicerCacheID\" */ },\n\t0x081D: { /* n:\"BrtBeginTableSlicerCache\", */ T:1 },\n\t0x081E: { /* n:\"BrtEndTableSlicerCache\", */ T:-1 },\n\t0x081F: { /* n:\"BrtSxFilter15\" */ },\n\t0x0820: { /* n:\"BrtBeginTimelineCachePivotCacheIDs\", */ T:1 },\n\t0x0821: { /* n:\"BrtEndTimelineCachePivotCacheIDs\", */ T:-1 },\n\t0x0822: { /* n:\"BrtTimelineCachePivotCacheID\" */ },\n\t0x0823: { /* n:\"BrtBeginTimelineCacheIDs\", */ T:1 },\n\t0x0824: { /* n:\"BrtEndTimelineCacheIDs\", */ T:-1 },\n\t0x0825: { /* n:\"BrtBeginTimelineCacheID\", */ T:1 },\n\t0x0826: { /* n:\"BrtEndTimelineCacheID\", */ T:-1 },\n\t0x0827: { /* n:\"BrtBeginTimelinesEx\", */ T:1 },\n\t0x0828: { /* n:\"BrtEndTimelinesEx\", */ T:-1 },\n\t0x0829: { /* n:\"BrtBeginTimelineEx\", */ T:1 },\n\t0x082A: { /* n:\"BrtEndTimelineEx\", */ T:-1 },\n\t0x082B: { /* n:\"BrtWorkBookPr15\" */ },\n\t0x082C: { /* n:\"BrtPCDH15\" */ },\n\t0x082D: { /* n:\"BrtBeginTimelineStyle\", */ T:1 },\n\t0x082E: { /* n:\"BrtEndTimelineStyle\", */ T:-1 },\n\t0x082F: { /* n:\"BrtTimelineStyleElement\" */ },\n\t0x0830: { /* n:\"BrtBeginTimelineStylesheetExt15\", */ T:1 },\n\t0x0831: { /* n:\"BrtEndTimelineStylesheetExt15\", */ T:-1 },\n\t0x0832: { /* n:\"BrtBeginTimelineStyles\", */ T:1 },\n\t0x0833: { /* n:\"BrtEndTimelineStyles\", */ T:-1 },\n\t0x0834: { /* n:\"BrtBeginTimelineStyleElements\", */ T:1 },\n\t0x0835: { /* n:\"BrtEndTimelineStyleElements\", */ T:-1 },\n\t0x0836: { /* n:\"BrtDxf15\" */ },\n\t0x0837: { /* n:\"BrtBeginDxfs15\", */ T:1 },\n\t0x0838: { /* n:\"BrtEndDxfs15\", */ T:-1 },\n\t0x0839: { /* n:\"BrtSlicerCacheHideItemsWithNoData\" */ },\n\t0x083A: { /* n:\"BrtBeginItemUniqueNames\", */ T:1 },\n\t0x083B: { /* n:\"BrtEndItemUniqueNames\", */ T:-1 },\n\t0x083C: { /* n:\"BrtItemUniqueName\" */ },\n\t0x083D: { /* n:\"BrtBeginExtConn15\", */ T:1 },\n\t0x083E: { /* n:\"BrtEndExtConn15\", */ T:-1 },\n\t0x083F: { /* n:\"BrtBeginOledbPr15\", */ T:1 },\n\t0x0840: { /* n:\"BrtEndOledbPr15\", */ T:-1 },\n\t0x0841: { /* n:\"BrtBeginDataFeedPr15\", */ T:1 },\n\t0x0842: { /* n:\"BrtEndDataFeedPr15\", */ T:-1 },\n\t0x0843: { /* n:\"BrtTextPr15\" */ },\n\t0x0844: { /* n:\"BrtRangePr15\" */ },\n\t0x0845: { /* n:\"BrtDbCommand15\" */ },\n\t0x0846: { /* n:\"BrtBeginDbTables15\", */ T:1 },\n\t0x0847: { /* n:\"BrtEndDbTables15\", */ T:-1 },\n\t0x0848: { /* n:\"BrtDbTable15\" */ },\n\t0x0849: { /* n:\"BrtBeginDataModel\", */ T:1 },\n\t0x084A: { /* n:\"BrtEndDataModel\", */ T:-1 },\n\t0x084B: { /* n:\"BrtBeginModelTables\", */ T:1 },\n\t0x084C: { /* n:\"BrtEndModelTables\", */ T:-1 },\n\t0x084D: { /* n:\"BrtModelTable\" */ },\n\t0x084E: { /* n:\"BrtBeginModelRelationships\", */ T:1 },\n\t0x084F: { /* n:\"BrtEndModelRelationships\", */ T:-1 },\n\t0x0850: { /* n:\"BrtModelRelationship\" */ },\n\t0x0851: { /* n:\"BrtBeginECTxtWiz15\", */ T:1 },\n\t0x0852: { /* n:\"BrtEndECTxtWiz15\", */ T:-1 },\n\t0x0853: { /* n:\"BrtBeginECTWFldInfoLst15\", */ T:1 },\n\t0x0854: { /* n:\"BrtEndECTWFldInfoLst15\", */ T:-1 },\n\t0x0855: { /* n:\"BrtBeginECTWFldInfo15\", */ T:1 },\n\t0x0856: { /* n:\"BrtFieldListActiveItem\" */ },\n\t0x0857: { /* n:\"BrtPivotCacheIdVersion\" */ },\n\t0x0858: { /* n:\"BrtSXDI15\" */ },\n\t0x0859: { /* n:\"BrtBeginModelTimeGroupings\", */ T:1 },\n\t0x085A: { /* n:\"BrtEndModelTimeGroupings\", */ T:-1 },\n\t0x085B: { /* n:\"BrtBeginModelTimeGrouping\", */ T:1 },\n\t0x085C: { /* n:\"BrtEndModelTimeGrouping\", */ T:-1 },\n\t0x085D: { /* n:\"BrtModelTimeGroupingCalcCol\" */ },\n\t0x0C00: { /* n:\"BrtUid\" */ },\n\t0x0C01: { /* n:\"BrtRevisionPtr\" */ },\n\t0x1000: { /* n:\"BrtBeginDynamicArrayPr\", */ T:1 },\n\t0x1001: { /* n:\"BrtEndDynamicArrayPr\", */ T:-1 },\n\t0x138A: { /* n:\"BrtBeginRichValueBlock\", */ T:1 },\n\t0x138B: { /* n:\"BrtEndRichValueBlock\", */ T:-1 },\n\t0x13D9: { /* n:\"BrtBeginRichFilters\", */ T:1 },\n\t0x13DA: { /* n:\"BrtEndRichFilters\", */ T:-1 },\n\t0x13DB: { /* n:\"BrtRichFilter\" */ },\n\t0x13DC: { /* n:\"BrtBeginRichFilterColumn\", */ T:1 },\n\t0x13DD: { /* n:\"BrtEndRichFilterColumn\", */ T:-1 },\n\t0x13DE: { /* n:\"BrtBeginCustomRichFilters\", */ T:1 },\n\t0x13DF: { /* n:\"BrtEndCustomRichFilters\", */ T:-1 },\n\t0x13E0: { /* n:\"BrtCustomRichFilter\" */ },\n\t0x13E1: { /* n:\"BrtTop10RichFilter\" */ },\n\t0x13E2: { /* n:\"BrtDynamicRichFilter\" */ },\n\t0x13E4: { /* n:\"BrtBeginRichSortCondition\", */ T:1 },\n\t0x13E5: { /* n:\"BrtEndRichSortCondition\", */ T:-1 },\n\t0x13E6: { /* n:\"BrtRichFilterDateGroupItem\" */ },\n\t0x13E7: { /* n:\"BrtBeginCalcFeatures\", */ T:1 },\n\t0x13E8: { /* n:\"BrtEndCalcFeatures\", */ T:-1 },\n\t0x13E9: { /* n:\"BrtCalcFeature\" */ },\n\t0x13EB: { /* n:\"BrtExternalLinksPr\" */ },\n\t0xFFFF: { n:\"\" }\n};\n\n/* [MS-XLS] 2.3 Record Enumeration (and other sources) */\nvar XLSRecordEnum = {\n\t/* [MS-XLS] 2.3 Record Enumeration 2021-08-17 */\n\t0x0006: { /* n:\"Formula\", */ f:parse_Formula },\n\t0x000a: { /* n:\"EOF\", */ f:parsenoop2 },\n\t0x000c: { /* n:\"CalcCount\", */ f:parseuint16 }, //\n\t0x000d: { /* n:\"CalcMode\", */ f:parseuint16 }, //\n\t0x000e: { /* n:\"CalcPrecision\", */ f:parsebool }, //\n\t0x000f: { /* n:\"CalcRefMode\", */ f:parsebool }, //\n\t0x0010: { /* n:\"CalcDelta\", */ f:parse_Xnum }, //\n\t0x0011: { /* n:\"CalcIter\", */ f:parsebool }, //\n\t0x0012: { /* n:\"Protect\", */ f:parsebool },\n\t0x0013: { /* n:\"Password\", */ f:parseuint16 },\n\t0x0014: { /* n:\"Header\", */ f:parse_XLHeaderFooter },\n\t0x0015: { /* n:\"Footer\", */ f:parse_XLHeaderFooter },\n\t0x0017: { /* n:\"ExternSheet\", */ f:parse_ExternSheet },\n\t0x0018: { /* n:\"Lbl\", */ f:parse_Lbl },\n\t0x0019: { /* n:\"WinProtect\", */ f:parsebool },\n\t0x001a: { /* n:\"VerticalPageBreaks\", */ },\n\t0x001b: { /* n:\"HorizontalPageBreaks\", */ },\n\t0x001c: { /* n:\"Note\", */ f:parse_Note },\n\t0x001d: { /* n:\"Selection\", */ },\n\t0x0022: { /* n:\"Date1904\", */ f:parsebool },\n\t0x0023: { /* n:\"ExternName\", */ f:parse_ExternName },\n\t0x0026: { /* n:\"LeftMargin\", */ f:parse_Xnum }, // *\n\t0x0027: { /* n:\"RightMargin\", */ f:parse_Xnum }, // *\n\t0x0028: { /* n:\"TopMargin\", */ f:parse_Xnum }, // *\n\t0x0029: { /* n:\"BottomMargin\", */ f:parse_Xnum }, // *\n\t0x002a: { /* n:\"PrintRowCol\", */ f:parsebool },\n\t0x002b: { /* n:\"PrintGrid\", */ f:parsebool },\n\t0x002f: { /* n:\"FilePass\", */ f:parse_FilePass },\n\t0x0031: { /* n:\"Font\", */ f:parse_Font },\n\t0x0033: { /* n:\"PrintSize\", */ f:parseuint16 },\n\t0x003c: { /* n:\"Continue\", */ },\n\t0x003d: { /* n:\"Window1\", */ f:parse_Window1 },\n\t0x0040: { /* n:\"Backup\", */ f:parsebool },\n\t0x0041: { /* n:\"Pane\", */ f:parse_Pane },\n\t0x0042: { /* n:\"CodePage\", */ f:parseuint16 },\n\t0x004d: { /* n:\"Pls\", */ },\n\t0x0050: { /* n:\"DCon\", */ },\n\t0x0051: { /* n:\"DConRef\", */ },\n\t0x0052: { /* n:\"DConName\", */ },\n\t0x0055: { /* n:\"DefColWidth\", */ f:parseuint16 },\n\t0x0059: { /* n:\"XCT\", */ },\n\t0x005a: { /* n:\"CRN\", */ },\n\t0x005b: { /* n:\"FileSharing\", */ },\n\t0x005c: { /* n:\"WriteAccess\", */ f:parse_WriteAccess },\n\t0x005d: { /* n:\"Obj\", */ f:parse_Obj },\n\t0x005e: { /* n:\"Uncalced\", */ },\n\t0x005f: { /* n:\"CalcSaveRecalc\", */ f:parsebool }, //\n\t0x0060: { /* n:\"Template\", */ },\n\t0x0061: { /* n:\"Intl\", */ },\n\t0x0063: { /* n:\"ObjProtect\", */ f:parsebool },\n\t0x007d: { /* n:\"ColInfo\", */ f:parse_ColInfo },\n\t0x0080: { /* n:\"Guts\", */ f:parse_Guts },\n\t0x0081: { /* n:\"WsBool\", */ f:parse_WsBool },\n\t0x0082: { /* n:\"GridSet\", */ f:parseuint16 },\n\t0x0083: { /* n:\"HCenter\", */ f:parsebool },\n\t0x0084: { /* n:\"VCenter\", */ f:parsebool },\n\t0x0085: { /* n:\"BoundSheet8\", */ f:parse_BoundSheet8 },\n\t0x0086: { /* n:\"WriteProtect\", */ },\n\t0x008c: { /* n:\"Country\", */ f:parse_Country },\n\t0x008d: { /* n:\"HideObj\", */ f:parseuint16 },\n\t0x0090: { /* n:\"Sort\", */ },\n\t0x0092: { /* n:\"Palette\", */ f:parse_Palette },\n\t0x0097: { /* n:\"Sync\", */ },\n\t0x0098: { /* n:\"LPr\", */ },\n\t0x0099: { /* n:\"DxGCol\", */ },\n\t0x009a: { /* n:\"FnGroupName\", */ },\n\t0x009b: { /* n:\"FilterMode\", */ },\n\t0x009c: { /* n:\"BuiltInFnGroupCount\", */ f:parseuint16 },\n\t0x009d: { /* n:\"AutoFilterInfo\", */ },\n\t0x009e: { /* n:\"AutoFilter\", */ },\n\t0x00a0: { /* n:\"Scl\", */ f:parse_Scl },\n\t0x00a1: { /* n:\"Setup\", */ f:parse_Setup },\n\t0x00ae: { /* n:\"ScenMan\", */ },\n\t0x00af: { /* n:\"SCENARIO\", */ },\n\t0x00b0: { /* n:\"SxView\", */ },\n\t0x00b1: { /* n:\"Sxvd\", */ },\n\t0x00b2: { /* n:\"SXVI\", */ },\n\t0x00b4: { /* n:\"SxIvd\", */ },\n\t0x00b5: { /* n:\"SXLI\", */ },\n\t0x00b6: { /* n:\"SXPI\", */ },\n\t0x00b8: { /* n:\"DocRoute\", */ },\n\t0x00b9: { /* n:\"RecipName\", */ },\n\t0x00bd: { /* n:\"MulRk\", */ f:parse_MulRk },\n\t0x00be: { /* n:\"MulBlank\", */ f:parse_MulBlank },\n\t0x00c1: { /* n:\"Mms\", */ f:parsenoop2 },\n\t0x00c5: { /* n:\"SXDI\", */ },\n\t0x00c6: { /* n:\"SXDB\", */ },\n\t0x00c7: { /* n:\"SXFDB\", */ },\n\t0x00c8: { /* n:\"SXDBB\", */ },\n\t0x00c9: { /* n:\"SXNum\", */ },\n\t0x00ca: { /* n:\"SxBool\", */ f:parsebool },\n\t0x00cb: { /* n:\"SxErr\", */ },\n\t0x00cc: { /* n:\"SXInt\", */ },\n\t0x00cd: { /* n:\"SXString\", */ },\n\t0x00ce: { /* n:\"SXDtr\", */ },\n\t0x00cf: { /* n:\"SxNil\", */ },\n\t0x00d0: { /* n:\"SXTbl\", */ },\n\t0x00d1: { /* n:\"SXTBRGIITM\", */ },\n\t0x00d2: { /* n:\"SxTbpg\", */ },\n\t0x00d3: { /* n:\"ObProj\", */ },\n\t0x00d5: { /* n:\"SXStreamID\", */ },\n\t0x00d7: { /* n:\"DBCell\", */ },\n\t0x00d8: { /* n:\"SXRng\", */ },\n\t0x00d9: { /* n:\"SxIsxoper\", */ },\n\t0x00da: { /* n:\"BookBool\", */ f:parseuint16 },\n\t0x00dc: { /* n:\"DbOrParamQry\", */ },\n\t0x00dd: { /* n:\"ScenarioProtect\", */ f:parsebool },\n\t0x00de: { /* n:\"OleObjectSize\", */ },\n\t0x00e0: { /* n:\"XF\", */ f:parse_XF },\n\t0x00e1: { /* n:\"InterfaceHdr\", */ f:parse_InterfaceHdr },\n\t0x00e2: { /* n:\"InterfaceEnd\", */ f:parsenoop2 },\n\t0x00e3: { /* n:\"SXVS\", */ },\n\t0x00e5: { /* n:\"MergeCells\", */ f:parse_MergeCells },\n\t0x00e9: { /* n:\"BkHim\", */ },\n\t0x00eb: { /* n:\"MsoDrawingGroup\", */ },\n\t0x00ec: { /* n:\"MsoDrawing\", */ },\n\t0x00ed: { /* n:\"MsoDrawingSelection\", */ },\n\t0x00ef: { /* n:\"PhoneticInfo\", */ },\n\t0x00f0: { /* n:\"SxRule\", */ },\n\t0x00f1: { /* n:\"SXEx\", */ },\n\t0x00f2: { /* n:\"SxFilt\", */ },\n\t0x00f4: { /* n:\"SxDXF\", */ },\n\t0x00f5: { /* n:\"SxItm\", */ },\n\t0x00f6: { /* n:\"SxName\", */ },\n\t0x00f7: { /* n:\"SxSelect\", */ },\n\t0x00f8: { /* n:\"SXPair\", */ },\n\t0x00f9: { /* n:\"SxFmla\", */ },\n\t0x00fb: { /* n:\"SxFormat\", */ },\n\t0x00fc: { /* n:\"SST\", */ f:parse_SST },\n\t0x00fd: { /* n:\"LabelSst\", */ f:parse_LabelSst },\n\t0x00ff: { /* n:\"ExtSST\", */ f:parse_ExtSST },\n\t0x0100: { /* n:\"SXVDEx\", */ },\n\t0x0103: { /* n:\"SXFormula\", */ },\n\t0x0122: { /* n:\"SXDBEx\", */ },\n\t0x0137: { /* n:\"RRDInsDel\", */ },\n\t0x0138: { /* n:\"RRDHead\", */ },\n\t0x013b: { /* n:\"RRDChgCell\", */ },\n\t0x013d: { /* n:\"RRTabId\", */ f:parseuint16a },\n\t0x013e: { /* n:\"RRDRenSheet\", */ },\n\t0x013f: { /* n:\"RRSort\", */ },\n\t0x0140: { /* n:\"RRDMove\", */ },\n\t0x014a: { /* n:\"RRFormat\", */ },\n\t0x014b: { /* n:\"RRAutoFmt\", */ },\n\t0x014d: { /* n:\"RRInsertSh\", */ },\n\t0x014e: { /* n:\"RRDMoveBegin\", */ },\n\t0x014f: { /* n:\"RRDMoveEnd\", */ },\n\t0x0150: { /* n:\"RRDInsDelBegin\", */ },\n\t0x0151: { /* n:\"RRDInsDelEnd\", */ },\n\t0x0152: { /* n:\"RRDConflict\", */ },\n\t0x0153: { /* n:\"RRDDefName\", */ },\n\t0x0154: { /* n:\"RRDRstEtxp\", */ },\n\t0x015f: { /* n:\"LRng\", */ },\n\t0x0160: { /* n:\"UsesELFs\", */ f:parsebool },\n\t0x0161: { /* n:\"DSF\", */ f:parsenoop2 },\n\t0x0191: { /* n:\"CUsr\", */ },\n\t0x0192: { /* n:\"CbUsr\", */ },\n\t0x0193: { /* n:\"UsrInfo\", */ },\n\t0x0194: { /* n:\"UsrExcl\", */ },\n\t0x0195: { /* n:\"FileLock\", */ },\n\t0x0196: { /* n:\"RRDInfo\", */ },\n\t0x0197: { /* n:\"BCUsrs\", */ },\n\t0x0198: { /* n:\"UsrChk\", */ },\n\t0x01a9: { /* n:\"UserBView\", */ },\n\t0x01aa: { /* n:\"UserSViewBegin\", */ },\n\t0x01ab: { /* n:\"UserSViewEnd\", */ },\n\t0x01ac: { /* n:\"RRDUserView\", */ },\n\t0x01ad: { /* n:\"Qsi\", */ },\n\t0x01ae: { /* n:\"SupBook\", */ f:parse_SupBook },\n\t0x01af: { /* n:\"Prot4Rev\", */ f:parsebool },\n\t0x01b0: { /* n:\"CondFmt\", */ },\n\t0x01b1: { /* n:\"CF\", */ },\n\t0x01b2: { /* n:\"DVal\", */ },\n\t0x01b5: { /* n:\"DConBin\", */ },\n\t0x01b6: { /* n:\"TxO\", */ f:parse_TxO },\n\t0x01b7: { /* n:\"RefreshAll\", */ f:parsebool }, //\n\t0x01b8: { /* n:\"HLink\", */ f:parse_HLink },\n\t0x01b9: { /* n:\"Lel\", */ },\n\t0x01ba: { /* n:\"CodeName\", */ f:parse_XLUnicodeString },\n\t0x01bb: { /* n:\"SXFDBType\", */ },\n\t0x01bc: { /* n:\"Prot4RevPass\", */ f:parseuint16 },\n\t0x01bd: { /* n:\"ObNoMacros\", */ },\n\t0x01be: { /* n:\"Dv\", */ },\n\t0x01c0: { /* n:\"Excel9File\", */ f:parsenoop2 },\n\t0x01c1: { /* n:\"RecalcId\", */ f:parse_RecalcId, r:2},\n\t0x01c2: { /* n:\"EntExU2\", */ f:parsenoop2 },\n\t0x0200: { /* n:\"Dimensions\", */ f:parse_Dimensions },\n\t0x0201: { /* n:\"Blank\", */ f:parse_Blank },\n\t0x0203: { /* n:\"Number\", */ f:parse_Number },\n\t0x0204: { /* n:\"Label\", */ f:parse_Label },\n\t0x0205: { /* n:\"BoolErr\", */ f:parse_BoolErr },\n\t0x0207: { /* n:\"String\", */ f:parse_String },\n\t0x0208: { /* n:\"Row\", */ f:parse_Row },\n\t0x020b: { /* n:\"Index\", */ },\n\t0x0221: { /* n:\"Array\", */ f:parse_Array },\n\t0x0225: { /* n:\"DefaultRowHeight\", */ f:parse_DefaultRowHeight },\n\t0x0236: { /* n:\"Table\", */ },\n\t0x023e: { /* n:\"Window2\", */ f:parse_Window2 },\n\t0x027e: { /* n:\"RK\", */ f:parse_RK },\n\t0x0293: { /* n:\"Style\", */ },\n\t0x0418: { /* n:\"BigName\", */ },\n\t0x041e: { /* n:\"Format\", */ f:parse_Format },\n\t0x043c: { /* n:\"ContinueBigName\", */ },\n\t0x04bc: { /* n:\"ShrFmla\", */ f:parse_ShrFmla },\n\t0x0800: { /* n:\"HLinkTooltip\", */ f:parse_HLinkTooltip },\n\t0x0801: { /* n:\"WebPub\", */ },\n\t0x0802: { /* n:\"QsiSXTag\", */ },\n\t0x0803: { /* n:\"DBQueryExt\", */ },\n\t0x0804: { /* n:\"ExtString\", */ },\n\t0x0805: { /* n:\"TxtQry\", */ },\n\t0x0806: { /* n:\"Qsir\", */ },\n\t0x0807: { /* n:\"Qsif\", */ },\n\t0x0808: { /* n:\"RRDTQSIF\", */ },\n\t0x0809: { /* n:\"BOF\", */ f:parse_BOF },\n\t0x080a: { /* n:\"OleDbConn\", */ },\n\t0x080b: { /* n:\"WOpt\", */ },\n\t0x080c: { /* n:\"SXViewEx\", */ },\n\t0x080d: { /* n:\"SXTH\", */ },\n\t0x080e: { /* n:\"SXPIEx\", */ },\n\t0x080f: { /* n:\"SXVDTEx\", */ },\n\t0x0810: { /* n:\"SXViewEx9\", */ },\n\t0x0812: { /* n:\"ContinueFrt\", */ },\n\t0x0813: { /* n:\"RealTimeData\", */ },\n\t0x0850: { /* n:\"ChartFrtInfo\", */ },\n\t0x0851: { /* n:\"FrtWrapper\", */ },\n\t0x0852: { /* n:\"StartBlock\", */ },\n\t0x0853: { /* n:\"EndBlock\", */ },\n\t0x0854: { /* n:\"StartObject\", */ },\n\t0x0855: { /* n:\"EndObject\", */ },\n\t0x0856: { /* n:\"CatLab\", */ },\n\t0x0857: { /* n:\"YMult\", */ },\n\t0x0858: { /* n:\"SXViewLink\", */ },\n\t0x0859: { /* n:\"PivotChartBits\", */ },\n\t0x085a: { /* n:\"FrtFontList\", */ },\n\t0x0862: { /* n:\"SheetExt\", */ },\n\t0x0863: { /* n:\"BookExt\", */ r:12},\n\t0x0864: { /* n:\"SXAddl\", */ },\n\t0x0865: { /* n:\"CrErr\", */ },\n\t0x0866: { /* n:\"HFPicture\", */ },\n\t0x0867: { /* n:\"FeatHdr\", */ f:parsenoop2 },\n\t0x0868: { /* n:\"Feat\", */ },\n\t0x086a: { /* n:\"DataLabExt\", */ },\n\t0x086b: { /* n:\"DataLabExtContents\", */ },\n\t0x086c: { /* n:\"CellWatch\", */ },\n\t0x0871: { /* n:\"FeatHdr11\", */ },\n\t0x0872: { /* n:\"Feature11\", */ },\n\t0x0874: { /* n:\"DropDownObjIds\", */ },\n\t0x0875: { /* n:\"ContinueFrt11\", */ },\n\t0x0876: { /* n:\"DConn\", */ },\n\t0x0877: { /* n:\"List12\", */ },\n\t0x0878: { /* n:\"Feature12\", */ },\n\t0x0879: { /* n:\"CondFmt12\", */ },\n\t0x087a: { /* n:\"CF12\", */ },\n\t0x087b: { /* n:\"CFEx\", */ },\n\t0x087c: { /* n:\"XFCRC\", */ f:parse_XFCRC, r:12 },\n\t0x087d: { /* n:\"XFExt\", */ f:parse_XFExt, r:12 },\n\t0x087e: { /* n:\"AutoFilter12\", */ },\n\t0x087f: { /* n:\"ContinueFrt12\", */ },\n\t0x0884: { /* n:\"MDTInfo\", */ },\n\t0x0885: { /* n:\"MDXStr\", */ },\n\t0x0886: { /* n:\"MDXTuple\", */ },\n\t0x0887: { /* n:\"MDXSet\", */ },\n\t0x0888: { /* n:\"MDXProp\", */ },\n\t0x0889: { /* n:\"MDXKPI\", */ },\n\t0x088a: { /* n:\"MDB\", */ },\n\t0x088b: { /* n:\"PLV\", */ },\n\t0x088c: { /* n:\"Compat12\", */ f:parsebool, r:12 },\n\t0x088d: { /* n:\"DXF\", */ },\n\t0x088e: { /* n:\"TableStyles\", */ r:12 },\n\t0x088f: { /* n:\"TableStyle\", */ },\n\t0x0890: { /* n:\"TableStyleElement\", */ },\n\t0x0892: { /* n:\"StyleExt\", */ },\n\t0x0893: { /* n:\"NamePublish\", */ },\n\t0x0894: { /* n:\"NameCmt\", */ f:parse_NameCmt, r:12 },\n\t0x0895: { /* n:\"SortData\", */ },\n\t0x0896: { /* n:\"Theme\", */ f:parse_Theme, r:12 },\n\t0x0897: { /* n:\"GUIDTypeLib\", */ },\n\t0x0898: { /* n:\"FnGrp12\", */ },\n\t0x0899: { /* n:\"NameFnGrp12\", */ },\n\t0x089a: { /* n:\"MTRSettings\", */ f:parse_MTRSettings, r:12 },\n\t0x089b: { /* n:\"CompressPictures\", */ f:parsenoop2 },\n\t0x089c: { /* n:\"HeaderFooter\", */ },\n\t0x089d: { /* n:\"CrtLayout12\", */ },\n\t0x089e: { /* n:\"CrtMlFrt\", */ },\n\t0x089f: { /* n:\"CrtMlFrtContinue\", */ },\n\t0x08a3: { /* n:\"ForceFullCalculation\", */ f:parse_ForceFullCalculation },\n\t0x08a4: { /* n:\"ShapePropsStream\", */ },\n\t0x08a5: { /* n:\"TextPropsStream\", */ },\n\t0x08a6: { /* n:\"RichTextStream\", */ },\n\t0x08a7: { /* n:\"CrtLayout12A\", */ },\n\t0x1001: { /* n:\"Units\", */ },\n\t0x1002: { /* n:\"Chart\", */ },\n\t0x1003: { /* n:\"Series\", */ },\n\t0x1006: { /* n:\"DataFormat\", */ },\n\t0x1007: { /* n:\"LineFormat\", */ },\n\t0x1009: { /* n:\"MarkerFormat\", */ },\n\t0x100a: { /* n:\"AreaFormat\", */ },\n\t0x100b: { /* n:\"PieFormat\", */ },\n\t0x100c: { /* n:\"AttachedLabel\", */ },\n\t0x100d: { /* n:\"SeriesText\", */ },\n\t0x1014: { /* n:\"ChartFormat\", */ },\n\t0x1015: { /* n:\"Legend\", */ },\n\t0x1016: { /* n:\"SeriesList\", */ },\n\t0x1017: { /* n:\"Bar\", */ },\n\t0x1018: { /* n:\"Line\", */ },\n\t0x1019: { /* n:\"Pie\", */ },\n\t0x101a: { /* n:\"Area\", */ },\n\t0x101b: { /* n:\"Scatter\", */ },\n\t0x101c: { /* n:\"CrtLine\", */ },\n\t0x101d: { /* n:\"Axis\", */ },\n\t0x101e: { /* n:\"Tick\", */ },\n\t0x101f: { /* n:\"ValueRange\", */ },\n\t0x1020: { /* n:\"CatSerRange\", */ },\n\t0x1021: { /* n:\"AxisLine\", */ },\n\t0x1022: { /* n:\"CrtLink\", */ },\n\t0x1024: { /* n:\"DefaultText\", */ },\n\t0x1025: { /* n:\"Text\", */ },\n\t0x1026: { /* n:\"FontX\", */ f:parseuint16 },\n\t0x1027: { /* n:\"ObjectLink\", */ },\n\t0x1032: { /* n:\"Frame\", */ },\n\t0x1033: { /* n:\"Begin\", */ },\n\t0x1034: { /* n:\"End\", */ },\n\t0x1035: { /* n:\"PlotArea\", */ },\n\t0x103a: { /* n:\"Chart3d\", */ },\n\t0x103c: { /* n:\"PicF\", */ },\n\t0x103d: { /* n:\"DropBar\", */ },\n\t0x103e: { /* n:\"Radar\", */ },\n\t0x103f: { /* n:\"Surf\", */ },\n\t0x1040: { /* n:\"RadarArea\", */ },\n\t0x1041: { /* n:\"AxisParent\", */ },\n\t0x1043: { /* n:\"LegendException\", */ },\n\t0x1044: { /* n:\"ShtProps\", */ f:parse_ShtProps },\n\t0x1045: { /* n:\"SerToCrt\", */ },\n\t0x1046: { /* n:\"AxesUsed\", */ },\n\t0x1048: { /* n:\"SBaseRef\", */ },\n\t0x104a: { /* n:\"SerParent\", */ },\n\t0x104b: { /* n:\"SerAuxTrend\", */ },\n\t0x104e: { /* n:\"IFmtRecord\", */ },\n\t0x104f: { /* n:\"Pos\", */ },\n\t0x1050: { /* n:\"AlRuns\", */ },\n\t0x1051: { /* n:\"BRAI\", */ },\n\t0x105b: { /* n:\"SerAuxErrBar\", */ },\n\t0x105c: { /* n:\"ClrtClient\", */ f:parse_ClrtClient },\n\t0x105d: { /* n:\"SerFmt\", */ },\n\t0x105f: { /* n:\"Chart3DBarShape\", */ },\n\t0x1060: { /* n:\"Fbi\", */ },\n\t0x1061: { /* n:\"BopPop\", */ },\n\t0x1062: { /* n:\"AxcExt\", */ },\n\t0x1063: { /* n:\"Dat\", */ },\n\t0x1064: { /* n:\"PlotGrowth\", */ },\n\t0x1065: { /* n:\"SIIndex\", */ },\n\t0x1066: { /* n:\"GelFrame\", */ },\n\t0x1067: { /* n:\"BopPopCustom\", */ },\n\t0x1068: { /* n:\"Fbi2\", */ },\n\n\t0x0000: { /* n:\"Dimensions\", */ f:parse_Dimensions },\n\t0x0001: { /* n:\"BIFF2BLANK\", */ },\n\t0x0002: { /* n:\"BIFF2INT\", */ f:parse_BIFF2INT },\n\t0x0003: { /* n:\"BIFF2NUM\", */ f:parse_BIFF2NUM },\n\t0x0004: { /* n:\"BIFF2STR\", */ f:parse_BIFF2STR },\n\t0x0005: { /* n:\"BIFF2BOOLERR\", */ f:parse_BIFF2BOOLERR },\n\t0x0007: { /* n:\"String\", */ f:parse_BIFF2STRING },\n\t0x0008: { /* n:\"BIFF2ROW\", */ },\n\t0x0009: { /* n:\"BOF\", */ f:parse_BOF },\n\t0x000b: { /* n:\"Index\", */ },\n\t0x0016: { /* n:\"ExternCount\", */ f:parseuint16 },\n\t0x001e: { /* n:\"BIFF2FORMAT\", */ f:parse_BIFF2Format },\n\t0x001f: { /* n:\"BIFF2FMTCNT\", */ }, /* 16-bit cnt of BIFF2FORMAT records */\n\t0x0020: { /* n:\"BIFF2COLINFO\", */ },\n\t0x0021: { /* n:\"Array\", */ f:parse_Array },\n\t0x0024: { /* n:\"COLWIDTH\", */ },\n\t0x0025: { /* n:\"DefaultRowHeight\", */ f:parse_DefaultRowHeight },\n\t// 0x002c ??\n\t// 0x002d ??\n\t// 0x002e ??\n\t// 0x0030 FONTCOUNT: number of fonts\n\t0x0032: { /* n:\"BIFF2FONTXTRA\", */ f:parse_BIFF2FONTXTRA },\n\t// 0x0035: INFOOPTS\n\t// 0x0036: TABLE (BIFF2 only)\n\t// 0x0037: TABLE2 (BIFF2 only)\n\t// 0x0038: WNDESK\n\t// 0x0039 ??\n\t// 0x003a: BEGINPREF\n\t// 0x003b: ENDPREF\n\t0x003e: { /* n:\"BIFF2WINDOW2\", */ },\n\t// 0x003f ??\n\t// 0x0046: SHOWSCROLL\n\t// 0x0047: SHOWFORMULA\n\t// 0x0048: STATUSBAR\n\t// 0x0049: SHORTMENUS\n\t// 0x004A:\n\t// 0x004B:\n\t// 0x004C:\n\t// 0x004E:\n\t// 0x004F:\n\t// 0x0058: TOOLBAR (BIFF3)\n\n\t/* - - - */\n\t0x0034: { /* n:\"DDEObjName\", */ },\n\t0x0043: { /* n:\"BIFF2XF\", */ f:parse_BIFF2XF },\n\t0x0044: { /* n:\"BIFF2XFINDEX\", */ f:parseuint16 },\n\t0x0045: { /* n:\"BIFF2FONTCLR\", */ },\n\t0x0056: { /* n:\"BIFF4FMTCNT\", */ }, /* 16-bit cnt, similar to BIFF2 */\n\t0x007e: { /* n:\"RK\", */ }, /* Not necessarily same as 0x027e */\n\t0x007f: { /* n:\"ImData\", */ f:parse_ImData },\n\t0x0087: { /* n:\"Addin\", */ },\n\t0x0088: { /* n:\"Edg\", */ },\n\t0x0089: { /* n:\"Pub\", */ },\n\t// 0x8A\n\t// 0x8B LH: alternate menu key flag (BIFF3/4)\n\t// 0x8E\n\t0x008F: { /* n:\"BIFF4SheetInfo\", */ f:parse_BIFF4SheetInfo },\n\t0x0091: { /* n:\"Sub\", */ },\n\t// 0x93 STYLE\n\t0x0094: { /* n:\"LHRecord\", */ },\n\t0x0095: { /* n:\"LHNGraph\", */ },\n\t0x0096: { /* n:\"Sound\", */ },\n\t// 0xA2 FNPROTO: function prototypes (BIFF4)\n\t// 0xA3\n\t// 0xA8\n\t0x00a9: { /* n:\"CoordList\", */ },\n\t0x00ab: { /* n:\"GCW\", */ },\n\t0x00bc: { /* n:\"ShrFmla\", */ }, /* Not necessarily same as 0x04bc */\n\t0x00bf: { /* n:\"ToolbarHdr\", */ },\n\t0x00c0: { /* n:\"ToolbarEnd\", */ },\n\t0x00c2: { /* n:\"AddMenu\", */ },\n\t0x00c3: { /* n:\"DelMenu\", */ },\n\t0x00d6: { /* n:\"RString\", */ f:parse_RString },\n\t0x00df: { /* n:\"UDDesc\", */ },\n\t0x00ea: { /* n:\"TabIdConf\", */ },\n\t0x0162: { /* n:\"XL5Modify\", */ },\n\t0x01a5: { /* n:\"FileSharing2\", */ },\n\t0x0206: { /* n:\"Formula\", */ f:parse_Formula },\n\t0x0209: { /* n:\"BOF\", */ f:parse_BOF },\n\t0x0218: { /* n:\"Lbl\", */ f:parse_Lbl },\n\t0x0223: { /* n:\"ExternName\", */ f:parse_ExternName },\n\t0x0231: { /* n:\"Font\", */ },\n\t0x0243: { /* n:\"BIFF3XF\", */ f:parse_BIFF3XF },\n\t0x0406: { /* n:\"Formula\", */ f:parse_Formula },\n\t0x0409: { /* n:\"BOF\", */ f:parse_BOF },\n\t0x0443: { /* n:\"BIFF4XF\", */ f:parse_BIFF4XF },\n\t0x086d: { /* n:\"FeatInfo\", */ },\n\t0x0873: { /* n:\"FeatInfo11\", */ },\n\t0x0881: { /* n:\"SXAddl12\", */ },\n\t0x08c0: { /* n:\"AutoWebPub\", */ },\n\t0x08c1: { /* n:\"ListObj\", */ },\n\t0x08c2: { /* n:\"ListField\", */ },\n\t0x08c3: { /* n:\"ListDV\", */ },\n\t0x08c4: { /* n:\"ListCondFmt\", */ },\n\t0x08c5: { /* n:\"ListCF\", */ },\n\t0x08c6: { /* n:\"FMQry\", */ },\n\t0x08c7: { /* n:\"FMSQry\", */ },\n\t0x08c8: { /* n:\"PLV\", */ },\n\t0x08c9: { /* n:\"LnExt\", */ },\n\t0x08ca: { /* n:\"MkrExt\", */ },\n\t0x08cb: { /* n:\"CrtCoopt\", */ },\n\t0x08d6: { /* n:\"FRTArchId$\", */ r:12 },\n\n\t/* --- multiplan 4 records --- */\n\t0x0065: { /* n:\"\", */ }, // one per window\n\t0x0066: { /* n:\"\", */ }, // calc settings\n\t0x0069: { /* n:\"\", */ }, // print header\n\t0x006a: { /* n:\"\", */ }, // print footer\n\t0x006b: { /* n:\"\", */ }, // print settings\n\t0x006d: { /* n:\"\", */ }, // one per window\n\t0x0070: { /* n:\"\", */ }, // includes default col width\n\t0x0072: { /* n:\"\", */ }, // includes selected cell\n\n\t0x7262: {}\n};\n\nfunction write_biff_rec(ba/*:BufArray*/, type/*:number*/, payload, length/*:?number*/)/*:void*/ {\n\tvar t/*:number*/ = type;\n\tif(isNaN(t)) return;\n\tvar len = length || (payload||[]).length || 0;\n\tvar o = ba.next(4);\n\to.write_shift(2, t);\n\to.write_shift(2, len);\n\tif(/*:: len != null &&*/len > 0 && is_buf(payload)) ba.push(payload);\n}\n\nfunction write_biff_continue(ba/*:BufArray*/, type/*:number*/, payload, length/*:?number*/)/*:void*/ {\n\tvar len = length || (payload||[]).length || 0;\n\tif(len <= 8224) return write_biff_rec(ba, type, payload, len);\n\tvar t = type;\n\tif(isNaN(t)) return;\n\tvar parts = payload.parts || [], sidx = 0;\n\tvar i = 0, w = 0;\n\twhile(w + (parts[sidx] || 8224) <= 8224) { w+= (parts[sidx] || 8224); sidx++; }\n\tvar o = ba.next(4);\n\to.write_shift(2, t);\n\to.write_shift(2, w);\n\tba.push(payload.slice(i, i + w));\n\ti += w;\n\twhile(i < len) {\n\t\to = ba.next(4);\n\t\to.write_shift(2, 0x3c); // TODO: figure out correct continue type\n\t\tw = 0;\n\t\twhile(w + (parts[sidx] || 8224) <= 8224) { w+= (parts[sidx] || 8224); sidx++; }\n\t\to.write_shift(2, w);\n\t\tba.push(payload.slice(i, i+w)); i+= w;\n\t}\n}\n\nfunction write_BIFF2BERR(r/*:number*/, c/*:number*/, val, t/*:?string*/) {\n\tvar out = new_buf(9);\n\twrite_BIFF2Cell(out, r, c);\n\twrite_Bes(val, t || 'b', out);\n\treturn out;\n}\n\n/* TODO: codepage, large strings */\nfunction write_BIFF2LABEL(r/*:number*/, c/*:number*/, val) {\n\tvar out = new_buf(8 + 2*val.length);\n\twrite_BIFF2Cell(out, r, c);\n\tout.write_shift(1, val.length);\n\tout.write_shift(val.length, val, 'sbcs');\n\treturn out.l < out.length ? out.slice(0, out.l) : out;\n}\n\nfunction write_comments_biff2(ba/*:BufArray*/, comments/*:Array<[Comment[], number, number]>*/) {\n\tcomments.forEach(function(data) {\n\t\tvar text = data[0].map(function(cc) { return cc.t; }).join(\"\");\n\t\t// TODO: should '\\n' be translated to '\\r' to correct for Excel 5.0 bug when exporting to BIFF2/3 ?\n\t\tif(text.length <= 2048) return write_biff_rec(ba, 0x001C, write_NOTE_BIFF2(text, data[1], data[2]));\n\t\twrite_biff_rec(ba, 0x001C, write_NOTE_BIFF2(text.slice(0, 2048), data[1], data[2], text.length));\n\t\tfor(var i = 2048; i < text.length; i += 2048)\n\t\t\twrite_biff_rec(ba, 0x001C, write_NOTE_BIFF2(text.slice(i, Math.min(i+2048, text.length)), -1, -1, Math.min(2048, text.length - i)));\n\t});\n}\n\n/* TODO: BIFF3/4 use different records -- see comments*/\nfunction write_ws_biff2_cell(ba/*:BufArray*/, cell/*:Cell*/, R/*:number*/, C/*:number*/, opts, date1904/*:boolean*/) {\n\tvar ifmt = 0;\n\tif(cell.z != null) {\n\t\tifmt = opts._BIFF2FmtTable.indexOf(cell.z);\n\t\tif(ifmt == -1) { opts._BIFF2FmtTable.push(cell.z); ifmt = opts._BIFF2FmtTable.length - 1; }\n\t}\n\tvar ixfe = 0;\n\tif(cell.z != null) {\n\t\tfor(; ixfe < opts.cellXfs.length; ++ixfe) if(opts.cellXfs[ixfe].numFmtId == ifmt) break;\n\t\tif(ixfe == opts.cellXfs.length) opts.cellXfs.push({numFmtId: ifmt});\n\t}\n\tif(cell.v != null) switch(cell.t) {\n\t\tcase 'd': case 'n':\n\t\t\tvar v = cell.t == 'd' ? datenum(parseDate(cell.v, date1904), date1904) : cell.v;\n\t\t\tif(opts.biff == 2 && (v == (v|0)) && (v >= 0) && (v < 65536))\n\t\t\t\t// 0x027E (RK) in BIFF3/4\n\t\t\t\twrite_biff_rec(ba, 0x0002, write_BIFF2INT(R, C, v, ixfe, ifmt));\n\t\t\telse if(isNaN(v))\n\t\t\t\t// 0x0205 in BIFF3/4\n\t\t\t\twrite_biff_rec(ba, 0x0005, write_BIFF2BERR(R, C, 0x24, \"e\")); // #NUM!\n\t\t\telse if(!isFinite(v))\n\t\t\t\t// 0x0205 in BIFF3/4\n\t\t\t\twrite_biff_rec(ba, 0x0005, write_BIFF2BERR(R, C, 0x07, \"e\")); // #DIV/0!\n\t\t\telse\n\t\t\t\t// 0x0203 in BIFF3/4\n\t\t\t\twrite_biff_rec(ba, 0x0003, write_BIFF2NUM(R,C, v, ixfe, ifmt));\n\t\t\treturn;\n\t\tcase 'b': case 'e':\n\t\t\t// 0x0205 in BIFF3/4\n\t\t\twrite_biff_rec(ba, 0x0005, write_BIFF2BERR(R, C, cell.v, cell.t)); return;\n\t\t/* TODO: codepage, sst */\n\t\tcase 's': case 'str':\n\t\t\t// 0x0204 in BIFF3/4\n\t\t\twrite_biff_rec(ba, 0x0004, write_BIFF2LABEL(R, C, cell.v == null ? \"\" : String(cell.v).slice(0,255)));\n\t\t\treturn;\n\t}\n\t// 0x0201 in BIFF3/4\n\twrite_biff_rec(ba, 0x0001, write_BIFF2Cell(null, R, C));\n}\n\nfunction write_ws_biff2(ba/*:BufArray*/, ws/*:Worksheet*/, idx/*:number*/, opts, wb/*:Workbook*/) {\n\tvar dense = ws[\"!data\"] != null;\n\tvar range = safe_decode_range(ws['!ref'] || \"A1\"), rr = \"\", cols/*:Array*/ = [];\n\tif(range.e.c > 0xFF || range.e.r > 0x3FFF) {\n\t\tif(opts.WTF) throw new Error(\"Range \" + (ws['!ref'] || \"A1\") + \" exceeds format limit A1:IV16384\");\n\t\trange.e.c = Math.min(range.e.c, 0xFF);\n\t\trange.e.r = Math.min(range.e.r, 0x3FFF);\n\t}\n\tvar date1904 = (((wb||{}).Workbook||{}).WBProps||{}).date1904;\n\tvar row = [], comments = [];\n\t/* TODO: 0x0000 / 0x0200 dimensions? */\n\tfor(var C = range.s.c; C <= range.e.c; ++C) cols[C] = encode_col(C);\n\tfor(var R = range.s.r; R <= range.e.r; ++R) {\n\t\tif(dense) row = ws[\"!data\"][R] || [];\n\t\trr = encode_row(R);\n\t\tfor(C = range.s.c; C <= range.e.c; ++C) {\n\t\t\tvar cell = dense ? row[C] : ws[cols[C] + rr];\n\t\t\tif(!cell) continue;\n\t\t\t/* write cell */\n\t\t\twrite_ws_biff2_cell(ba, cell, R, C, opts, date1904);\n\t\t\tif(cell.c) comments.push([cell.c, R, C]);\n\t\t}\n\t}\n\n\t/* ... 0x12 0x19 0x13 (Password) */\n\twrite_comments_biff2(ba, comments);\n\t/* 0x3d (Window1) ... */\n}\n\n/* Based on test files */\nfunction write_biff2_buf(wb/*:Workbook*/, opts/*:WriteOpts*/) {\n\tvar o = opts || {};\n\n\tvar ba = buf_array();\n\tvar idx = 0;\n\tfor(var i=0;i*/ = [\"General\"]; o._Fonts = [];\n\tvar body = buf_array();\n\twrite_ws_biff2(body, wb.Sheets[wb.SheetNames[idx]], idx, o, wb);\n\n\to._BIFF2FmtTable.forEach(function(f) {\n\t\tif(o.biff <= 3) write_biff_rec(ba, 0x001E, write_BIFF2Format(f));\n\t\telse write_biff_rec(ba, 0x041E, write_BIFF4Format(f));\n\t});\n\to.cellXfs.forEach(function(xf) {\n\t\tswitch(o.biff) {\n\t\t\tcase 2: write_biff_rec(ba, 0x0043, write_BIFF2XF(xf)); break;\n\t\t\tcase 3: write_biff_rec(ba, 0x0243, write_BIFF3XF(xf)); break;\n\t\t\tcase 4: write_biff_rec(ba, 0x0443, write_BIFF4XF(xf)); break;\n\t\t}\n\t});\n\tdelete o._BIFF2FmtTable; delete o.cellXfs; delete o._Fonts;\n\n\tba.push(body.end());\n\twrite_biff_rec(ba, 0x000A);\n\treturn ba.end();\n}\n\nvar b8oid = 1, b8ocnts/*:Array<[number, number, number]>*/ = [];\nfunction write_MsoDrawingGroup() {\n\tvar buf = new_buf(82 + 8 * b8ocnts.length);\n\t/* [MS-ODRAW] 2.2.12 OfficeArtDggContainer */\n\tbuf.write_shift(2, 0x0F);\n\tbuf.write_shift(2, 0xF000);\n\tbuf.write_shift(4, 74 + 8 * b8ocnts.length);\n\t/* 2.2.48 OfficeArtFDGGBlock */\n\t{\n\t\tbuf.write_shift(2, 0);\n\t\tbuf.write_shift(2, 0xF006);\n\t\tbuf.write_shift(4, 16 + 8 * b8ocnts.length);\n\t\t/* 2.2.47 OfficeArtFDGG */\n\t\t{\n\t\t\tbuf.write_shift(4, b8oid);\n\t\t\tbuf.write_shift(4, b8ocnts.length+1);\n\t\t\tvar acc = 0; for(var i = 0; i < b8ocnts.length; ++i) acc += (b8ocnts[i] && b8ocnts[i][1] || 0); buf.write_shift(4, acc);\n\t\t\tbuf.write_shift(4, b8ocnts.length);\n\t\t}\n\t\t/* 2.2.46 OfficeArtIDCL + */\n\t\tb8ocnts.forEach(function(b8) {\n\t\t\tbuf.write_shift(4, b8[0]);\n\t\t\tbuf.write_shift(4, b8[2]);\n\t\t});\n\t}\n\t/* 2.2.9 OfficeArtFOPT */\n\t{\n\t\tbuf.write_shift(2, 0x33); // 0x03 | (3 << 4)\n\t\tbuf.write_shift(2, 0xF00B);\n\t\tbuf.write_shift(4, 0x12); // 3 * 6\n\t\t/* 2.3.21.15 Text Boolean Properties */\n\t\tbuf.write_shift(2, 0xBF); buf.write_shift(4, 0x00080008);\n\t\t/* 2.3.7.2 fillColor */\n\t\tbuf.write_shift(2, 0x0181); buf.write_shift(4, 0x08000041);\n\t\t/* 2.3.8.1 lineColor */\n\t\tbuf.write_shift(2, 0x01C0); buf.write_shift(4, 0x08000040);\n\t}\n\t/* 2.2.45 OfficeArtSplitMenuColorContainer */\n\t{\n\t\tbuf.write_shift(2, 0x40);\n\t\tbuf.write_shift(2, 0xF11E);\n\t\tbuf.write_shift(4, 16);\n\t\tbuf.write_shift(4, 0x0800000D);\n\t\tbuf.write_shift(4, 0x0800000C);\n\t\tbuf.write_shift(4, 0x08000017);\n\t\tbuf.write_shift(4, 0x100000F7);\n\t}\n\treturn buf;\n}\nfunction write_comments_biff8(ba/*:BufArray*/, comments/*:Array<[Comment[], number, number]>*/) {\n\tvar notes/*:Array*/ = [], sz = 0, pl = buf_array(), baseid = b8oid;\n\tvar _oasc;\n\tcomments.forEach(function(c, ci) {\n\t\tvar author = \"\";\n\t\tvar text = c[0].map(function(t) { if(t.a && !author) author = t.a; return t.t; }).join(\"\");\n\t\t++b8oid;\n\n\t\t/* 2.2.14 OfficeArtSpContainer */\n\t\t{\n\t\t\tvar oasc = new_buf(0x96);\n\t\t\toasc.write_shift(2, 0x0F);\n\t\t\toasc.write_shift(2, 0xF004);\n\t\t\toasc.write_shift(4, 0x96);\n\t\t\t/* 2.2.40 OfficeArtFSP */\n\t\t\t{\n\t\t\t\toasc.write_shift(2, 0xca2); // 0x02 | (0xca << 4)\n\t\t\t\toasc.write_shift(2, 0xF00A);\n\t\t\t\toasc.write_shift(4, 8);\n\t\t\t\toasc.write_shift(4, b8oid);\n\t\t\t\toasc.write_shift(4, 0xA00);\n\t\t\t}\n\t\t\t/* 2.2.9 OfficeArtFOPT */\n\t\t\t{\n\t\t\t\toasc.write_shift(2, 0xE3); // 0x03 | (14 << 4)\n\t\t\t\toasc.write_shift(2, 0xF00B);\n\t\t\t\toasc.write_shift(4, 0x54); // 14 * 6\n\t\t\t\t/* 2.3.21.1 ITxid */\n\t\t\t\toasc.write_shift(2, 0x80); oasc.write_shift(4, 0);\n\t\t\t\t/* 2.3.21.12 txdir */\n\t\t\t\toasc.write_shift(2, 0x8B); oasc.write_shift(4, 0x02);\n\t\t\t\t/* 2.3.21.15 Text Boolean Properties */\n\t\t\t\toasc.write_shift(2, 0xBF); oasc.write_shift(4, 0x00080008);\n\t\t\t\t/* 2.3.6.30 cxk */\n\t\t\t\toasc.write_shift(2, 0x0158); oasc.l += 4;\n\t\t\t\t/* 2.3.7.2 fillColor */\n\t\t\t\toasc.write_shift(2, 0x0181); oasc.write_shift(4, 0x08000050);\n\t\t\t\t/* 2.3.7.4 fillBackColor */\n\t\t\t\toasc.write_shift(2, 0x0183); oasc.write_shift(4, 0x08000050);\n\t\t\t\t/* 2.3.7.6 fillCrMod */\n\t\t\t\toasc.write_shift(2, 0x0185); oasc.write_shift(4, 0x100000F4);\n\t\t\t\t/* 2.3.7.43 Fill Style Boolean Properties */\n\t\t\t\toasc.write_shift(2, 0x01BF); oasc.write_shift(4, 0x00100010);\n\t\t\t\t/* 2.3.8.1 lineColor */\n\t\t\t\toasc.write_shift(2, 0x01C0); oasc.write_shift(4, 0x08000051);\n\t\t\t\t/* 2.3.8.4 lineCrMod */\n\t\t\t\toasc.write_shift(2, 0x01C3); oasc.write_shift(4, 0x100000F4);\n\t\t\t\t/* 2.3.13.2 shadowColor */\n\t\t\t\toasc.write_shift(2, 0x0201); oasc.write_shift(4, 0x08000051);\n\t\t\t\t/* 2.3.13.4 shadowCrMod */\n\t\t\t\toasc.write_shift(2, 0x0203); oasc.write_shift(4, 0x100000F4);\n\t\t\t\t/* 2.3.13.23 Shadow Style Boolean Properties */\n\t\t\t\toasc.write_shift(2, 0x023F); oasc.write_shift(4, 0x00030001);\n\t\t\t\t/* 2.3.4.44 Group Shape Boolean Properties */\n\t\t\t\toasc.write_shift(2, 0x03BF); oasc.write_shift(4, 0x00020000 | (c[0].hidden ? 2 : 0));\n\t\t\t}\n\t\t\t/* [MS-XLS] 2.5.193 OfficeArtClientAnchorSheet */\n\t\t\t{\n\t\t\t\toasc.l += 2;\n\t\t\t\toasc.write_shift(2, 0xF010);\n\t\t\t\toasc.write_shift(4, 0x12);\n\t\t\t\toasc.write_shift(2, 0x3); // do not move or size with cells\n\t\t\t\toasc.write_shift(2, c[2] + 2); oasc.l += 2;\n\t\t\t\toasc.write_shift(2, c[1] + 1); oasc.l += 2;\n\t\t\t\toasc.write_shift(2, c[2] + 4); oasc.l += 2;\n\t\t\t\toasc.write_shift(2, c[1] + 5); oasc.l += 2;\n\t\t\t}\n\t\t\t/* [MS-XLS] 2.5.194 OfficeArtClientData */\n\t\t\t{\n\t\t\t\toasc.l += 2;\n\t\t\t\toasc.write_shift(2, 0xF011);\n\t\t\t\toasc.l += 4;\n\t\t\t}\n\t\t\toasc.l = 0x96;\n\t\t\tif(ci == 0) /* write_biff_rec(pl, 0x003C, oasc); */ _oasc = oasc;\n\t\t\telse write_biff_rec(pl, 0x00EC, oasc);\n\t\t}\n\t\tsz += 0x96;\n\n\t\t/* [MS-XLS] 2.4.181 Obj */\n\t\t{\n\t\t\tvar obj = new_buf(52); // 22 + 26 + 4\n\t\t\t/* [MS-XLS] 2.5.143 FtCmo */\n\t\t\tobj.write_shift(2, 0x15);\n\t\t\tobj.write_shift(2, 0x12);\n\t\t\tobj.write_shift(2, 0x19);\n\t\t\tobj.write_shift(2, b8oid);\n\t\t\tobj.write_shift(2, 0);\n\t\t\tobj.l = 22;\n\t\t\t/* [MS-XLS] 2.5.149 FtNts */\n\t\t\tobj.write_shift(2, 0x0D);\n\t\t\tobj.write_shift(2, 0x16);\n\t\t\tobj.write_shift(4, 0x62726272);\n\t\t\tobj.write_shift(4, 0x95374305);\n\t\t\tobj.write_shift(4, 0x80301328);\n\t\t\tobj.write_shift(4, 0x69696904 + b8oid*256);\n\t\t\tobj.write_shift(2,0);\n\t\t\tobj.write_shift(4,0);\n\t\t\t// reserved\n\t\t\tobj.l += 4;\n\t\t\twrite_biff_rec(pl, 0x005D, obj);\n\t\t}\n\n\t\t/* [MS-XLS] 2.5.195 OfficeArtClientTextbox */\n\t\t{\n\t\t\tvar oact = new_buf(8);\n\t\t\toact.l += 2;\n\t\t\toact.write_shift(2, 0xF00D);\n\t\t\toact.l += 4;\n\t\t\twrite_biff_rec(pl, 0x00EC, oact);\n\t\t}\n\t\tsz += 8;\n\n\t\t/* [MS-XLS] 2.4.329 TxO */\n\t\t{\n\t\t\tvar txo = new_buf(18);\n\t\t\ttxo.write_shift(2, 0x12);\n\t\t\ttxo.l += 8;\n\t\t\ttxo.write_shift(2, text.length);\n\t\t\ttxo.write_shift(2, 0x10);\n\t\t\ttxo.l += 4;\n\t\t\twrite_biff_rec(pl, 0x01b6, txo);\n\t\t\t/* text continue record TODO: switch to wide strings */\n\t\t\t{\n\t\t\t\tvar cont = new_buf(1 + text.length);\n\t\t\t\tcont.write_shift(1, 0);\n\t\t\t\tcont.write_shift(text.length, text, \"sbcs\");\n\t\t\t\twrite_biff_rec(pl, 0x003C, cont);\n\t\t\t}\n\t\t\t/* formatting continue records */\n\t\t\t{\n\t\t\t\tvar conf = new_buf(0x10);\n\t\t\t\tconf.l += 8;\n\t\t\t\tconf.write_shift(2, text.length);\n\t\t\t\tconf.l += 6;\n\t\t\t\twrite_biff_rec(pl, 0x003C, conf);\n\t\t\t}\n\t\t}\n\n\t\t/* 2.4.179 Note */\n\t\t{\n\t\t\tvar notesh = new_buf(12 + author.length);\n\t\t\tnotesh.write_shift(2, c[1]);\n\t\t\tnotesh.write_shift(2, c[2]);\n\t\t\tnotesh.write_shift(2, 0 | (c[0].hidden ? 0 : 2));\n\t\t\tnotesh.write_shift(2, b8oid);\n\t\t\tnotesh.write_shift(2, author.length);\n\t\t\tnotesh.write_shift(1, 0);\n\t\t\tnotesh.write_shift(author.length, author, \"sbcs\");\n\t\t\tnotesh.l ++;\n\t\t\tnotes.push(notesh);\n\t\t}\n\t});\n\t/* [MS-ODRAW] 2.2.13 OfficeArtDgContainer */\n\t{\n\t\tvar hdr = new_buf(80);\n\t\thdr.write_shift(2, 0x0F);\n\t\thdr.write_shift(2, 0xF002);\n\t\thdr.write_shift(4, sz + hdr.length - 8);\n\t\t/* [MS-ODRAW] 2.2.49 OfficeArtFDG */\n\t\t{\n\t\t\thdr.write_shift(2, 0x10);\n\t\t\thdr.write_shift(2, 0xF008);\n\t\t\thdr.write_shift(4, 0x08);\n\t\t\thdr.write_shift(4, comments.length + 1);\n\t\t\thdr.write_shift(4, b8oid);\n\t\t}\n\t\t/* [MS-ODRAW] 2.2.16 OfficeArtSpgrContainer */\n\t\t{\n\t\t\thdr.write_shift(2, 0x0f);\n\t\t\thdr.write_shift(2, 0xF003);\n\t\t\thdr.write_shift(4, sz + 0x30);\n\t\t\t/* [MS-ODRAW] 2.2.14 OfficeArtSpContainer */\n\t\t\t{\n\t\t\t\thdr.write_shift(2, 0x0f);\n\t\t\t\thdr.write_shift(2, 0xF004);\n\t\t\t\thdr.write_shift(4, 0x28);\n\t\t\t\t/* [MS-ODRAW] 2.2.38 OfficeArtFSPGR */\n\t\t\t\t{\n\t\t\t\t\thdr.write_shift(2, 0x01);\n\t\t\t\t\thdr.write_shift(2, 0xF009);\n\t\t\t\t\thdr.write_shift(4, 0x10);\n\t\t\t\t\thdr.l += 16;\n\t\t\t\t}\n\t\t\t\t/* [MS-ODRAW] 2.2.40 OfficeArtFSP */\n\t\t\t\t{\n\t\t\t\t\thdr.write_shift(2, 0x02);\n\t\t\t\t\thdr.write_shift(2, 0xF00A);\n\t\t\t\t\thdr.write_shift(4, 0x08);\n\t\t\t\t\thdr.write_shift(4, baseid);\n\t\t\t\t\thdr.write_shift(4, 0x05);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\twrite_biff_rec(ba, 0x00EC, /* hdr */ _oasc ? bconcat([hdr, _oasc]) : hdr);\n\t}\n\tba.push(pl.end());\n\tnotes.forEach(function(n) { write_biff_rec(ba, 0x001C, n); });\n\tb8ocnts.push([baseid, comments.length + 1, b8oid]);\n\t++b8oid;\n}\n\nfunction write_FONTS_biff8(ba, data, opts) {\n\twrite_biff_rec(ba, 0x0031 /* Font */, write_Font({\n\t\tsz:12,\n\t\tcolor: {theme:1},\n\t\tname: \"Arial\",\n\t\tfamily: 2,\n\t\tscheme: \"minor\"\n\t}, opts));\n}\n\n\nfunction write_FMTS_biff8(ba, NF/*:?SSFTable*/, opts) {\n\tif(!NF) return;\n\t[[5,8],[23,26],[41,44],[/*63*/50,/*66],[164,*/392]].forEach(function(r) {\n\t\t/*:: if(!NF) return; */\n\t\tfor(var i = r[0]; i <= r[1]; ++i) if(NF[i] != null) write_biff_rec(ba, 0x041E /* Format */, write_Format(i, NF[i], opts));\n\t});\n}\n\nfunction write_FEAT(ba, ws) {\n\t/* [MS-XLS] 2.4.112 */\n\tvar o = new_buf(19);\n\to.write_shift(4, 0x867); o.write_shift(4, 0); o.write_shift(4, 0);\n\to.write_shift(2, 3); o.write_shift(1, 1); o.write_shift(4, 0);\n\twrite_biff_rec(ba, 0x0867 /* FeatHdr */, o);\n\t/* [MS-XLS] 2.4.111 */\n\to = new_buf(39);\n\to.write_shift(4, 0x868); o.write_shift(4, 0); o.write_shift(4, 0);\n\to.write_shift(2, 3); o.write_shift(1, 0); o.write_shift(4, 0);\n\to.write_shift(2, 1); o.write_shift(4, 4); o.write_shift(2, 0);\n\twrite_Ref8U(safe_decode_range(ws['!ref']||\"A1\"), o);\n\to.write_shift(4, 4);\n\twrite_biff_rec(ba, 0x0868 /* Feat */, o);\n}\n\nfunction write_CELLXFS_biff8(ba, opts) {\n\tfor(var i = 0; i < 16; ++i) write_biff_rec(ba, 0x00e0 /* XF */, write_XF({numFmtId:0, style:true}, 0, opts));\n\topts.cellXfs.forEach(function(c) {\n\t\twrite_biff_rec(ba, 0x00e0 /* XF */, write_XF(c, 0, opts));\n\t});\n}\n\nfunction write_ws_biff8_hlinks(ba/*:BufArray*/, ws) {\n\tfor(var R=0; R*/ = [];\n\tvar range = safe_decode_range(ws['!ref'] || \"A1\");\n\tvar MAX_ROWS = b8 ? 65536 : 16384;\n\tif(range.e.c > 0xFF || range.e.r >= MAX_ROWS) {\n\t\tif(opts.WTF) throw new Error(\"Range \" + (ws['!ref'] || \"A1\") + \" exceeds format limit A1:IV\" + MAX_ROWS);\n\t\trange.e.c = Math.min(range.e.c, 0xFF);\n\t\trange.e.r = Math.min(range.e.r, MAX_ROWS-1);\n\t}\n\n\twrite_biff_rec(ba, 0x0809, write_BOF(wb, 0x10, opts));\n\t/* [Uncalced] Index */\n\twrite_biff_rec(ba, 0x000d /* CalcMode */, writeuint16(1));\n\twrite_biff_rec(ba, 0x000c /* CalcCount */, writeuint16(100));\n\twrite_biff_rec(ba, 0x000f /* CalcRefMode */, writebool(true));\n\twrite_biff_rec(ba, 0x0011 /* CalcIter */, writebool(false));\n\twrite_biff_rec(ba, 0x0010 /* CalcDelta */, write_Xnum(0.001));\n\twrite_biff_rec(ba, 0x005f /* CalcSaveRecalc */, writebool(true));\n\twrite_biff_rec(ba, 0x002a /* PrintRowCol */, writebool(false));\n\twrite_biff_rec(ba, 0x002b /* PrintGrid */, writebool(false));\n\twrite_biff_rec(ba, 0x0082 /* GridSet */, writeuint16(1));\n\twrite_biff_rec(ba, 0x0080 /* Guts */, write_Guts([0,0]));\n\t/* DefaultRowHeight WsBool [Sync] [LPr] [HorizontalPageBreaks] [VerticalPageBreaks] */\n\t/* Header (string) */\n\t/* Footer (string) */\n\twrite_biff_rec(ba, 0x0083 /* HCenter */, writebool(false));\n\twrite_biff_rec(ba, 0x0084 /* VCenter */, writebool(false));\n\t/* ... */\n\tif(b8) write_ws_cols_biff8(ba, ws[\"!cols\"]);\n\t/* ... */\n\twrite_biff_rec(ba, 0x0200 /* Dimensions */, write_Dimensions(range, opts));\n\t/* ... */\n\n\tvar date1904 = (((wb||{}).Workbook||{}).WBProps||{}).date1904;\n\tif(b8) ws['!links'] = [];\n\tfor(var C = range.s.c; C <= range.e.c; ++C) cols[C] = encode_col(C);\n\tvar comments = [];\n\tvar row = [];\n\tfor(var R = range.s.r; R <= range.e.r; ++R) {\n\t\tif(dense) row = ws[\"!data\"][R] || [];\n\t\trr = encode_row(R);\n\t\tfor(C = range.s.c; C <= range.e.c; ++C) {\n\t\t\tvar cell = dense ? row[C] : ws[cols[C] + rr];\n\t\t\tif(!cell) continue;\n\t\t\t/* write cell */\n\t\t\twrite_ws_biff8_cell(ba, cell, R, C, opts, date1904);\n\t\t\tif(b8 && cell.l) ws['!links'].push([cols[C] + rr, cell.l]);\n\t\t\tif(cell.c) comments.push([cell.c, R, C]);\n\t\t}\n\t}\n\tvar cname/*:string*/ = _sheet.CodeName || _sheet.name || s;\n\t/* ... */\n\tif(b8) write_comments_biff8(ba, comments); else write_comments_biff2(ba, comments);\n\t/* ... */\n\tif(b8) write_biff_rec(ba, 0x023e /* Window2 */, write_Window2((_WB.Views||[])[0]));\n\t/* ... */\n\tif(b8 && (ws['!merges']||[]).length) write_biff_rec(ba, 0x00e5 /* MergeCells */, write_MergeCells(ws['!merges']));\n\t/* [LRng] *QUERYTABLE [PHONETICINFO] CONDFMTS */\n\tif(b8) write_ws_biff8_hlinks(ba, ws);\n\t/* [DVAL] */\n\twrite_biff_rec(ba, 0x01ba /* CodeName */, write_XLUnicodeString(cname, opts));\n\t/* *WebPub *CellWatch [SheetExt] */\n\tif(b8) write_FEAT(ba, ws);\n\t/* *FEAT11 *RECORD12 */\n\twrite_biff_rec(ba, 0x000a /* EOF */);\n\treturn ba.end();\n}\n\n/* [MS-XLS] 2.1.7.20.3 */\nfunction write_biff8_global(wb/*:Workbook*/, bufs, opts/*:WriteOpts*/) {\n\tvar A = buf_array();\n\tvar _WB/*:WBWBProps*/ = ((wb||{}).Workbook||{}/*:any*/);\n\tvar _sheets/*:Array*/ = (_WB.Sheets||[]);\n\tvar _wb/*:WBProps*/ = /*::((*/_WB.WBProps||{/*::CodeName:\"ThisWorkbook\"*/}/*:: ):any)*/;\n\tvar b8 = opts.biff == 8, b5 = opts.biff == 5;\n\twrite_biff_rec(A, 0x0809, write_BOF(wb, 0x05, opts));\n\tif(opts.bookType == \"xla\") write_biff_rec(A, 0x0087 /* Addin */);\n\twrite_biff_rec(A, 0x00e1 /* InterfaceHdr */, b8 ? writeuint16(0x04b0) : null);\n\twrite_biff_rec(A, 0x00c1 /* Mms */, writezeroes(2));\n\tif(b5) write_biff_rec(A, 0x00bf /* ToolbarHdr */);\n\tif(b5) write_biff_rec(A, 0x00c0 /* ToolbarEnd */);\n\twrite_biff_rec(A, 0x00e2 /* InterfaceEnd */);\n\twrite_biff_rec(A, 0x005c /* WriteAccess */, write_WriteAccess(\"SheetJS\", opts));\n\t/* [FileSharing] */\n\twrite_biff_rec(A, 0x0042 /* CodePage */, writeuint16(b8 ? 0x04b0 : 0x04E4));\n\t/* *2047 Lel */\n\tif(b8) write_biff_rec(A, 0x0161 /* DSF */, writeuint16(0));\n\tif(b8) write_biff_rec(A, 0x01c0 /* Excel9File */);\n\twrite_biff_rec(A, 0x013d /* RRTabId */, write_RRTabId(wb.SheetNames.length));\n\tif(b8 && wb.vbaraw) write_biff_rec(A, 0x00d3 /* ObProj */);\n\t/* [ObNoMacros] */\n\tif(b8 && wb.vbaraw) {\n\t\tvar cname/*:string*/ = _wb.CodeName || \"ThisWorkbook\";\n\t\twrite_biff_rec(A, 0x01ba /* CodeName */, write_XLUnicodeString(cname, opts));\n\t}\n\twrite_biff_rec(A, 0x009c /* BuiltInFnGroupCount */, writeuint16(0x11));\n\t/* *FnGroupName *FnGrp12 */\n\t/* *Lbl */\n\t/* [OleObjectSize] */\n\twrite_biff_rec(A, 0x0019 /* WinProtect */, writebool(false));\n\twrite_biff_rec(A, 0x0012 /* Protect */, writebool(false));\n\twrite_biff_rec(A, 0x0013 /* Password */, writeuint16(0));\n\tif(b8) write_biff_rec(A, 0x01af /* Prot4Rev */, writebool(false));\n\tif(b8) write_biff_rec(A, 0x01bc /* Prot4RevPass */, writeuint16(0));\n\twrite_biff_rec(A, 0x003d /* Window1 */, write_Window1(opts));\n\twrite_biff_rec(A, 0x0040 /* Backup */, writebool(false));\n\twrite_biff_rec(A, 0x008d /* HideObj */, writeuint16(0));\n\twrite_biff_rec(A, 0x0022 /* Date1904 */, writebool(safe1904(wb)==\"true\"));\n\twrite_biff_rec(A, 0x000e /* CalcPrecision */, writebool(true));\n\tif(b8) write_biff_rec(A, 0x01b7 /* RefreshAll */, writebool(false));\n\twrite_biff_rec(A, 0x00DA /* BookBool */, writeuint16(0));\n\t/* ... */\n\twrite_FONTS_biff8(A, wb, opts);\n\twrite_FMTS_biff8(A, wb.SSF, opts);\n\twrite_CELLXFS_biff8(A, opts);\n\t/* ... */\n\tif(b8) write_biff_rec(A, 0x0160 /* UsesELFs */, writebool(false));\n\tvar a = A.end();\n\n\tvar C = buf_array();\n\t/* METADATA [MTRSettings] [ForceFullCalculation] */\n\tif(b8) write_biff_rec(C, 0x008C /* Country */, write_Country());\n\t/* *SUPBOOK *LBL *RTD [RecalcId] *HFPicture */\n\n\t/* BIFF8: MsoDrawingGroup [*Continue] */\n\tif(b8 && b8ocnts.length) write_biff_rec(C, 0x00EB /* MsoDrawingGroup */, write_MsoDrawingGroup());\n\t/* BIFF8: [SST *Continue] ExtSST */\n\tif(b8 && opts.Strings) write_biff_continue(C, 0x00FC /* SST */, write_SST(opts.Strings, opts));\n\n\t/* *WebPub [WOpt] [CrErr] [BookExt] *FeatHdr *DConn [THEME] [CompressPictures] [Compat12] [GUIDTypeLib] */\n\twrite_biff_rec(C, 0x000A /* EOF */);\n\tvar c = C.end();\n\n\tvar B = buf_array();\n\tvar blen = 0, j = 0;\n\tfor(j = 0; j < wb.SheetNames.length; ++j) blen += (b8 ? 12 : 11) + (b8 ? 2 : 1) * wb.SheetNames[j].length;\n\tvar start = a.length + blen + c.length;\n\tfor(j = 0; j < wb.SheetNames.length; ++j) {\n\t\tvar _sheet/*:WBWSProp*/ = _sheets[j] || ({}/*:any*/);\n\t\twrite_biff_rec(B, 0x0085 /* BoundSheet8 */, write_BoundSheet8({pos:start, hs:_sheet.Hidden||0, dt:0, name:wb.SheetNames[j]}, opts));\n\t\tstart += bufs[j].length;\n\t}\n\t/* 1*BoundSheet8 */\n\tvar b = B.end();\n\tif(blen != b.length) throw new Error(\"BS8 \" + blen + \" != \" + b.length);\n\n\tvar out = [];\n\tif(a.length) out.push(a);\n\tif(b.length) out.push(b);\n\tif(c.length) out.push(c);\n\treturn bconcat(out);\n}\n\n/* [MS-XLS] 2.1.7.20 Workbook Stream */\nfunction write_biff8_buf(wb/*:Workbook*/, opts/*:WriteOpts*/) {\n\tvar o = opts || {};\n\tvar bufs = [];\n\n\tif(wb && !wb.SSF) {\n\t\twb.SSF = dup(table_fmt);\n\t}\n\tif(wb && wb.SSF) {\n\t\tmake_ssf(); SSF_load_table(wb.SSF);\n\t\t// $FlowIgnore\n\t\to.revssf = evert_num(wb.SSF); o.revssf[wb.SSF[65535]] = 0;\n\t\to.ssf = wb.SSF;\n\t}\n\n\tb8oid = 1; b8ocnts = [];\n\to.Strings = /*::((*/[]/*:: :any):SST)*/; o.Strings.Count = 0; o.Strings.Unique = 0;\n\tfix_write_opts(o);\n\n\to.cellXfs = [];\n\tget_cell_style(o.cellXfs, {}, {revssf:{\"General\":0}});\n\n\tif(!wb.Props) wb.Props = {};\n\n\tfor(var i = 0; i < wb.SheetNames.length; ++i) bufs[bufs.length] = write_ws_biff8(i, o, wb);\n\tbufs.unshift(write_biff8_global(wb, bufs, o));\n\treturn bconcat(bufs);\n}\n\nfunction write_biff_buf(wb/*:Workbook*/, opts/*:WriteOpts*/) {\n\tfor(var i = 0; i <= wb.SheetNames.length; ++i) {\n\t\tvar ws = wb.Sheets[wb.SheetNames[i]];\n\t\tif(!ws || !ws[\"!ref\"]) continue;\n\t\tvar range = decode_range(ws[\"!ref\"]);\n\t\tif(range.e.c > 255) { // note: 255 is IV\n\t\t\tif(typeof console != \"undefined\" && console.error) console.error(\"Worksheet '\" + wb.SheetNames[i] + \"' extends beyond column IV (255). Data may be lost.\");\n\t\t}\n\t\tif(range.e.r > 65535) {\n\t\t\tif(typeof console != \"undefined\" && console.error) console.error(\"Worksheet '\" + wb.SheetNames[i] + \"' extends beyond row 65536. Data may be lost.\");\n\t\t}\n\t}\n\n\tvar o = opts || {};\n\tswitch(o.biff || 2) {\n\t\tcase 8: case 5: return write_biff8_buf(wb, opts);\n\t\tcase 4: case 3: case 2: return write_biff2_buf(wb, opts);\n\t}\n\tthrow new Error(\"invalid type \" + o.bookType + \" for BIFF\");\n}\n/* note: browser DOM element cannot see mso- style attrs, must parse */\nfunction html_to_sheet(str/*:string*/, _opts)/*:Workbook*/ {\n\tvar opts = _opts || {};\n\tvar dense = (opts.dense != null) ? opts.dense : DENSE;\n\tvar ws/*:Worksheet*/ = ({}/*:any*/); if(dense) ws[\"!data\"] = [];\n\tstr = str_remove_ng(str, \"\");\n\tvar mtch/*:any*/ = str.match(/\");\n\tvar mtch2/*:any*/ = str.match(/<\\/table/i);\n\tvar i/*:number*/ = mtch.index, j/*:number*/ = mtch2 && mtch2.index || str.length;\n\tvar rows = split_regex(str.slice(i, j), /(:?]*>)/i, \"\");\n\tvar R = -1, C = 0, RS = 0, CS = 0;\n\tvar range/*:Range*/ = {s:{r:10000000, c:10000000},e:{r:0,c:0}};\n\tvar merges/*:Array*/ = [];\n\tfor(i = 0; i < rows.length; ++i) {\n\t\tvar row = rows[i].trim();\n\t\tvar hd = row.slice(0,3).toLowerCase();\n\t\tif(hd == \"/i);\n\t\tfor(j = 0; j < cells.length; ++j) {\n\t\t\tvar cell = cells[j].trim();\n\t\t\tif(!cell.match(/\")) > -1) m = m.slice(cc+1);\n\t\t\tfor(var midx = 0; midx < merges.length; ++midx) {\n\t\t\t\tvar _merge/*:Range*/ = merges[midx];\n\t\t\t\tif(_merge.s.c == C && _merge.s.r < R && R <= _merge.e.r) { C = _merge.e.c + 1; midx = -1; }\n\t\t\t}\n\t\t\tvar tag = parsexmltag(cell.slice(0, cell.indexOf(\">\")));\n\t\t\tCS = tag.colspan ? +tag.colspan : 1;\n\t\t\tif((RS = +tag.rowspan)>1 || CS>1) merges.push({s:{r:R,c:C},e:{r:R + (RS||1) - 1, c:C + CS - 1}});\n\t\t\tvar _t/*:string*/ = tag.t || tag[\"data-t\"] || \"\";\n\t\t\t/* TODO: generate stub cells */\n\t\t\tif(!m.length) { C += CS; continue; }\n\t\t\tm = htmldecode(m);\n\t\t\tif(range.s.r > R) range.s.r = R; if(range.e.r < R) range.e.r = R;\n\t\t\tif(range.s.c > C) range.s.c = C; if(range.e.c < C) range.e.c = C;\n\t\t\tif(!m.length) { C += CS; continue; }\n\t\t\tvar o/*:Cell*/ = {t:'s', v:m};\n\t\t\tif(opts.raw || !m.trim().length || _t == 's'){}\n\t\t\telse if(m === 'TRUE') o = {t:'b', v:true};\n\t\t\telse if(m === 'FALSE') o = {t:'b', v:false};\n\t\t\telse if(!isNaN(fuzzynum(m))) o = {t:'n', v:fuzzynum(m)};\n\t\t\telse if(!isNaN(fuzzydate(m).getDate())) {\n\t\t\t\to = ({t:'d', v:parseDate(m)}/*:any*/);\n\t\t\t\tif(opts.UTC === false) o.v = utc_to_local(o.v);\n\t\t\t\tif(!opts.cellDates) o = ({t:'n', v:datenum(o.v)}/*:any*/);\n\t\t\t\to.z = opts.dateNF || table_fmt[14];\n\t\t\t} else if(m.charCodeAt(0) == 35 /* # */ && RBErr[m] != null) {\n\t\t\t\to.t = 'e'; o.w = m; o.v = RBErr[m];\n\t\t\t}\n\t\t\tif(o.cellText !== false) o.w = m;\n\t\t\tif(dense) { if(!ws[\"!data\"][R]) ws[\"!data\"][R] = []; ws[\"!data\"][R][C] = o; }\n\t\t\telse ws[encode_cell({r:R, c:C})] = o;\n\t\t\tC += CS;\n\t\t}\n\t}\n\tws['!ref'] = encode_range(range);\n\tif(merges.length) ws[\"!merges\"] = merges;\n\treturn ws;\n}\nfunction make_html_row(ws/*:Worksheet*/, r/*:Range*/, R/*:number*/, o/*:Sheet2HTMLOpts*/)/*:string*/ {\n\tvar M/*:Array*/ = (ws['!merges'] ||[]);\n\tvar oo/*:Array*/ = [];\n\tvar sp = ({}/*:any*/);\n\tvar dense = ws[\"!data\"] != null;\n\tfor(var C = r.s.c; C <= r.e.c; ++C) {\n\t\tvar RS = 0, CS = 0;\n\t\tfor(var j = 0; j < M.length; ++j) {\n\t\t\tif(M[j].s.r > R || M[j].s.c > C) continue;\n\t\t\tif(M[j].e.r < R || M[j].e.c < C) continue;\n\t\t\tif(M[j].s.r < R || M[j].s.c < C) { RS = -1; break; }\n\t\t\tRS = M[j].e.r - M[j].s.r + 1; CS = M[j].e.c - M[j].s.c + 1; break;\n\t\t}\n\t\tif(RS < 0) continue;\n\t\tvar coord = encode_col(C) + encode_row(R);\n\t\tvar cell = dense ? (ws[\"!data\"][R]||[])[C] : ws[coord];\n\t\tif(cell && cell.t == 'n' && cell.v != null && !isFinite(cell.v)) {\n\t\t\tif(isNaN(cell.v)) cell = ({t:'e', v:0x24, w:BErr[0x24]});\n\t\t\telse cell = ({t:'e', v:0x07, w:BErr[0x07]});\n\t\t}\n\t\t/* TODO: html entities */\n\t\tvar w = (cell && cell.v != null) && (cell.h || escapehtml(cell.w || (format_cell(cell), cell.w) || \"\")) || \"\";\n\t\tsp = ({}/*:any*/);\n\t\tif(RS > 1) sp.rowspan = RS;\n\t\tif(CS > 1) sp.colspan = CS;\n\t\tif(o.editable) w = '' + w + '';\n\t\telse if(cell) {\n\t\t\tsp[\"data-t\"] = cell && cell.t || 'z';\n\t\t\t// note: data-v is unaffected by the timezone interpretation\n\t\t\tif(cell.v != null) sp[\"data-v\"] = escapehtml(cell.v instanceof Date ? cell.v.toISOString() : cell.v);\n\t\t\tif(cell.z != null) sp[\"data-z\"] = cell.z;\n\t\t\tif(cell.l && (cell.l.Target || \"#\").charAt(0) != \"#\") w = '' + w + '';\n\t\t}\n\t\tsp.id = (o.id || \"sjs\") + \"-\" + coord;\n\t\too.push(writextag('td', w, sp));\n\t}\n\tvar preamble = \"\";\n\treturn preamble + oo.join(\"\") + \"\";\n}\n\nvar HTML_BEGIN = 'SheetJS Table Export';\nvar HTML_END = '';\n\nfunction html_to_workbook(str/*:string*/, opts)/*:Workbook*/ {\n\tvar mtch = str_match_xml_ig(str, \"table\");\n\tif(!mtch || mtch.length == 0) throw new Error(\"Invalid HTML: could not find
\");\n\tif(mtch.length == 1) {\n\t\tvar w = sheet_to_workbook(html_to_sheet(mtch[0], opts), opts);\n\t\tw.bookType = \"html\";\n\t\treturn w;\n\t}\n\tvar wb = book_new();\n\tmtch.forEach(function(s, idx) { book_append_sheet(wb, html_to_sheet(s, opts), \"Sheet\" + (idx+1)); });\n\twb.bookType = \"html\";\n\treturn wb;\n}\n\nfunction make_html_preamble(ws/*:Worksheet*/, R/*:Range*/, o/*:Sheet2HTMLOpts*/)/*:string*/ {\n\tvar out/*:Array*/ = [];\n\treturn out.join(\"\") + '';\n}\n\nfunction sheet_to_html(ws/*:Worksheet*/, opts/*:?Sheet2HTMLOpts*//*, wb:?Workbook*/)/*:string*/ {\n\tvar o = opts || {};\n\tvar header = o.header != null ? o.header : HTML_BEGIN;\n\tvar footer = o.footer != null ? o.footer : HTML_END;\n\tvar out/*:Array*/ = [header];\n\tvar r = decode_range(ws['!ref'] || \"A1\");\n\tout.push(make_html_preamble(ws, r, o));\n\tif(ws[\"!ref\"]) for(var R = r.s.r; R <= r.e.r; ++R) out.push(make_html_row(ws, r, R, o));\n\tout.push(\"
\" + footer);\n\treturn out.join(\"\");\n}\n\nfunction sheet_add_dom(ws/*:Worksheet*/, table/*:HTMLElement*/, _opts/*:?any*/)/*:Worksheet*/ {\n\tvar rows/*:HTMLCollection*/ = table.rows;\n\tif(!rows) {\n\t\t/* not an HTML TABLE */\n\t\tthrow \"Unsupported origin when \" + table.tagName + \" is not a TABLE\";\n\t}\n\n\tvar opts = _opts || {};\n\tvar dense = ws[\"!data\"] != null;\n\tvar or_R = 0, or_C = 0;\n\tif(opts.origin != null) {\n\t\tif(typeof opts.origin == 'number') or_R = opts.origin;\n\t\telse {\n\t\t\tvar _origin/*:CellAddress*/ = typeof opts.origin == \"string\" ? decode_cell(opts.origin) : opts.origin;\n\t\t\tor_R = _origin.r; or_C = _origin.c;\n\t\t}\n\t}\n\n\tvar sheetRows = Math.min(opts.sheetRows||10000000, rows.length);\n\tvar range/*:Range*/ = {s:{r:0,c:0},e:{r:or_R,c:or_C}};\n\tif(ws[\"!ref\"]) {\n\t\tvar _range/*:Range*/ = decode_range(ws[\"!ref\"]);\n\t\trange.s.r = Math.min(range.s.r, _range.s.r);\n\t\trange.s.c = Math.min(range.s.c, _range.s.c);\n\t\trange.e.r = Math.max(range.e.r, _range.e.r);\n\t\trange.e.c = Math.max(range.e.c, _range.e.c);\n\t\tif(or_R == -1) range.e.r = or_R = _range.e.r + 1;\n\t}\n\tvar merges/*:Array*/ = [], midx = 0;\n\tvar rowinfo/*:Array*/ = ws[\"!rows\"] || (ws[\"!rows\"] = []);\n\tvar _R = 0, R = 0, _C = 0, C = 0, RS = 0, CS = 0;\n\tif(!ws[\"!cols\"]) ws['!cols'] = [];\n\tfor(; _R < rows.length && R < sheetRows; ++_R) {\n\t\tvar row/*:HTMLTableRowElement*/ = rows[_R];\n\t\tif (is_dom_element_hidden(row)) {\n\t\t\tif (opts.display) continue;\n\t\t\trowinfo[R] = {hidden: true};\n\t\t}\n\t\tvar elts/*:HTMLCollection*/ = (row.cells);\n\t\tfor(_C = C = 0; _C < elts.length; ++_C) {\n\t\t\tvar elt/*:HTMLTableCellElement*/ = elts[_C];\n\t\t\tif (opts.display && is_dom_element_hidden(elt)) continue;\n\t\t\tvar v/*:?string*/ = elt.hasAttribute('data-v') ? elt.getAttribute('data-v') : elt.hasAttribute('v') ? elt.getAttribute('v') : htmldecode(elt.innerHTML);\n\t\t\tvar z/*:?string*/ = elt.getAttribute('data-z') || elt.getAttribute('z');\n\t\t\tfor(midx = 0; midx < merges.length; ++midx) {\n\t\t\t\tvar m/*:Range*/ = merges[midx];\n\t\t\t\tif(m.s.c == C + or_C && m.s.r < R + or_R && R + or_R <= m.e.r) { C = m.e.c+1 - or_C; midx = -1; }\n\t\t\t}\n\t\t\t/* TODO: figure out how to extract nonstandard mso- style */\n\t\t\tCS = +elt.getAttribute(\"colspan\") || 1;\n\t\t\tif( ((RS = (+elt.getAttribute(\"rowspan\") || 1)))>1 || CS>1) merges.push({s:{r:R + or_R,c:C + or_C},e:{r:R + or_R + (RS||1) - 1, c:C + or_C + (CS||1) - 1}});\n\t\t\tvar o/*:Cell*/ = {t:'s', v:v};\n\t\t\tvar _t/*:string*/ = elt.getAttribute(\"data-t\") || elt.getAttribute(\"t\") || \"\";\n\t\t\tif(v != null) {\n\t\t\t\tif(v.length == 0) o.t = _t || 'z';\n\t\t\t\telse if(opts.raw || v.trim().length == 0 || _t == \"s\"){}\n\t\t\t\telse if(_t == \"e\" && BErr[+v]) o = {t:'e', v:+v, w: BErr[+v]};\n\t\t\t\telse if(v === 'TRUE') o = {t:'b', v:true};\n\t\t\t\telse if(v === 'FALSE') o = {t:'b', v:false};\n\t\t\t\telse if(!isNaN(fuzzynum(v))) o = {t:'n', v:fuzzynum(v)};\n\t\t\t\telse if(!isNaN(fuzzydate(v).getDate())) {\n\t\t\t\t\to = ({t:'d', v:parseDate(v)}/*:any*/);\n\t\t\t\t\tif(opts.UTC) o.v = local_to_utc(o.v);\n\t\t\t\t\tif(!opts.cellDates) o = ({t:'n', v:datenum(o.v)}/*:any*/);\n\t\t\t\t\to.z = opts.dateNF || table_fmt[14];\n\t\t\t\t} else if(v.charCodeAt(0) == 35 /* # */ && RBErr[v] != null) o = ({t:'e', v: RBErr[v], w: v});\n\t\t\t}\n\t\t\tif(o.z === undefined && z != null) o.z = z;\n\t\t\t/* The first link is used. Links are assumed to be fully specified.\n\t\t\t * TODO: The right way to process relative links is to make a new */\n\t\t\tvar l = \"\", Aelts = elt.getElementsByTagName(\"A\");\n\t\t\tif(Aelts && Aelts.length) for(var Aelti = 0; Aelti < Aelts.length; ++Aelti)\tif(Aelts[Aelti].hasAttribute(\"href\")) {\n\t\t\t\tl = Aelts[Aelti].getAttribute(\"href\"); if(l.charAt(0) != \"#\") break;\n\t\t\t}\n\t\t\tif(l && l.charAt(0) != \"#\" &&\tl.slice(0, 11).toLowerCase() != 'javascript:') o.l = ({ Target: l });\n\t\t\tif(dense) { if(!ws[\"!data\"][R + or_R]) ws[\"!data\"][R + or_R] = []; ws[\"!data\"][R + or_R][C + or_C] = o; }\n\t\t\telse ws[encode_cell({c:C + or_C, r:R + or_R})] = o;\n\t\t\tif(range.e.c < C + or_C) range.e.c = C + or_C;\n\t\t\tC += CS;\n\t\t}\n\t\t++R;\n\t}\n\tif(merges.length) ws['!merges'] = (ws[\"!merges\"] || []).concat(merges);\n\trange.e.r = Math.max(range.e.r, R - 1 + or_R);\n\tws['!ref'] = encode_range(range);\n\tif(R >= sheetRows) ws['!fullref'] = encode_range((range.e.r = rows.length-_R+R-1 + or_R,range)); // We can count the real number of rows to parse but we don't to improve the performance\n\treturn ws;\n}\n\nfunction parse_dom_table(table/*:HTMLElement*/, _opts/*:?any*/)/*:Worksheet*/ {\n\tvar opts = _opts || {};\n\tvar ws/*:Worksheet*/ = ({}/*:any*/); if(opts.dense) ws[\"!data\"] = [];\n\treturn sheet_add_dom(ws, table, _opts);\n}\n\nfunction table_to_book(table/*:HTMLElement*/, opts/*:?any*/)/*:Workbook*/ {\n\tvar o = sheet_to_workbook(parse_dom_table(table, opts), opts);\n\t//o.bookType = \"dom\"; // TODO: define a type for this\n\treturn o;\n}\n\nfunction is_dom_element_hidden(element/*:HTMLElement*/)/*:boolean*/ {\n\tvar display/*:string*/ = '';\n\tvar get_computed_style/*:?function*/ = get_get_computed_style_function(element);\n\tif(get_computed_style) display = get_computed_style(element).getPropertyValue('display');\n\tif(!display) display = element.style && element.style.display;\n\treturn display === 'none';\n}\n\n/* global getComputedStyle */\nfunction get_get_computed_style_function(element/*:HTMLElement*/)/*:?function*/ {\n\t// The proper getComputedStyle implementation is the one defined in the element window\n\tif(element.ownerDocument.defaultView && typeof element.ownerDocument.defaultView.getComputedStyle === 'function') return element.ownerDocument.defaultView.getComputedStyle;\n\t// If it is not available, try to get one from the global namespace\n\tif(typeof getComputedStyle === 'function') return getComputedStyle;\n\treturn null;\n}\n/* OpenDocument */\nfunction parse_text_p(text/*:string*//*::, tag*/)/*:Array*/ {\n\t/* 6.1.2 White Space Characters */\n\tvar fixed = text\n\t\t.replace(/[\\t\\r\\n]/g, \" \").trim().replace(/ +/g, \" \")\n\t\t.replace(//g,\" \")\n\t\t.replace(//g, function($$,$1) { return Array(parseInt($1,10)+1).join(\" \"); })\n\t\t.replace(/]*\\/>/g,\"\\t\")\n\t\t.replace(//g,\"\\n\");\n\tvar v = unescapexml(fixed.replace(/<[^<>]*>/g,\"\"));\n\n\treturn [v];\n}\n\n/* Note: ODS can stick styles in content.xml or styles.xml, FODS blurs lines */\nfunction parse_ods_styles(d/*:string*/, _opts, _nfm) {\n\tvar number_format_map = _nfm || {};\n\tvar str = xlml_normalize(d);\n\txlmlregex.lastIndex = 0;\n\tstr = remove_doctype(str_remove_ng(str, \"\"));\n\tvar Rn, NFtag, NF = \"\", tNF = \"\", y, etpos = 0, tidx = -1, infmt = false, payload = \"\";\n\twhile((Rn = xlmlregex.exec(str))) {\n\t\tswitch((Rn[3]=Rn[3].replace(/_[\\s\\S]*$/,\"\"))) {\n\t\t/* Number Format Definitions */\n\t\tcase 'number-style': // 16.29.2\n\t\tcase 'currency-style': // 16.29.8\n\t\tcase 'percentage-style': // 16.29.10\n\t\tcase 'date-style': // 16.29.11\n\t\tcase 'time-style': // 16.29.19\n\t\tcase 'text-style': // 16.29.26\n\t\t\tif(Rn[1]==='/') {\n\t\t\t\tinfmt = false;\n\t\t\t\tif(NFtag['truncate-on-overflow'] == \"false\") {\n\t\t\t\t\tif(NF.match(/h/)) NF = NF.replace(/h+/, \"[$&]\");\n\t\t\t\t\telse if(NF.match(/m/)) NF = NF.replace(/m+/, \"[$&]\");\n\t\t\t\t\telse if(NF.match(/s/)) NF = NF.replace(/s+/, \"[$&]\");\n\t\t\t\t}\n\t\t\t\tnumber_format_map[NFtag.name] = NF;\n\t\t\t\tNF = \"\";\n\t\t\t} else if(Rn[0].charAt(Rn[0].length-2) !== '/') {\n\t\t\t\tinfmt = true;\n\t\t\t\tNF = \"\";\n\t\t\t\tNFtag = parsexmltag(Rn[0], false);\n\t\t\t} break;\n\n\t\t// LibreOffice bug https://bugs.documentfoundation.org/show_bug.cgi?id=149484\n\t\tcase 'boolean-style': // 16.29.24\n\t\t\tif(Rn[1]==='/') {\n\t\t\t\tinfmt = false;\n\t\t\t\tnumber_format_map[NFtag.name] = \"General\";\n\t\t\t\tNF = \"\";\n\t\t\t} else if(Rn[0].charAt(Rn[0].length-2) !== '/') {\n\t\t\t\tinfmt = true;\n\t\t\t\tNF = \"\";\n\t\t\t\tNFtag = parsexmltag(Rn[0], false);\n\t\t\t} break;\n\n\t\t/* Number Format Elements */\n\t\tcase 'boolean': // 16.29.25\n\t\t\tNF += \"General\"; // ODF spec is unfortunately underspecified here\n\t\t\tbreak;\n\n\t\tcase 'text': // 16.29.27\n\t\t\tif(Rn[1]==='/') {\n\t\t\t\tpayload = str.slice(tidx, xlmlregex.lastIndex - Rn[0].length);\n\t\t\t\t// NOTE: Excel has a different interpretation of \"%%\" and friends\n\t\t\t\tif(payload == \"%\" && NFtag[0] == ' 16.29.12\n\t\t\ty = parsexmltag(Rn[0], false);\n\t\t\tswitch(y[\"style\"]) {\n\t\t\t\tcase \"short\": NF += \"d\"; break;\n\t\t\t\tcase \"long\": NF += \"dd\"; break;\n\t\t\t\tdefault: NF += \"dd\"; break; // TODO: error condition\n\t\t\t}\n\t\t} break;\n\n\t\tcase 'day-of-week': { // 16.29.16\n\t\t\ty = parsexmltag(Rn[0], false);\n\t\t\tswitch(y[\"style\"]) {\n\t\t\t\tcase \"short\": NF += \"ddd\"; break;\n\t\t\t\tcase \"long\": NF += \"dddd\"; break;\n\t\t\t\tdefault: NF += \"ddd\"; break;\n\t\t\t}\n\t\t} break;\n\n\t\tcase 'era': { // 16.29.15 TODO: proper mapping\n\t\t\ty = parsexmltag(Rn[0], false);\n\t\t\tswitch(y[\"style\"]) {\n\t\t\t\tcase \"short\": NF += \"ee\"; break;\n\t\t\t\tcase \"long\": NF += \"eeee\"; break;\n\t\t\t\tdefault: NF += \"eeee\"; break; // TODO: error condition\n\t\t\t}\n\t\t} break;\n\n\t\tcase 'hours': { // 16.29.20\n\t\t\ty = parsexmltag(Rn[0], false);\n\t\t\tswitch(y[\"style\"]) {\n\t\t\t\tcase \"short\": NF += \"h\"; break;\n\t\t\t\tcase \"long\": NF += \"hh\"; break;\n\t\t\t\tdefault: NF += \"hh\"; break; // TODO: error condition\n\t\t\t}\n\t\t} break;\n\n\t\tcase 'minutes': { // 16.29.21\n\t\t\ty = parsexmltag(Rn[0], false);\n\t\t\tswitch(y[\"style\"]) {\n\t\t\t\tcase \"short\": NF += \"m\"; break;\n\t\t\t\tcase \"long\": NF += \"mm\"; break;\n\t\t\t\tdefault: NF += \"mm\"; break; // TODO: error condition\n\t\t\t}\n\t\t} break;\n\n\t\tcase 'month': { // 16.29.13\n\t\t\ty = parsexmltag(Rn[0], false);\n\t\t\tif(y[\"textual\"]) NF += \"mm\";\n\t\t\tswitch(y[\"style\"]) {\n\t\t\t\tcase \"short\": NF += \"m\"; break;\n\t\t\t\tcase \"long\": NF += \"mm\"; break;\n\t\t\t\tdefault: NF += \"m\"; break;\n\t\t\t}\n\t\t} break;\n\n\t\tcase 'seconds': { // 16.29.22\n\t\t\ty = parsexmltag(Rn[0], false);\n\t\t\tswitch(y[\"style\"]) {\n\t\t\t\tcase \"short\": NF += \"s\"; break;\n\t\t\t\tcase \"long\": NF += \"ss\"; break;\n\t\t\t\tdefault: NF += \"ss\"; break; // TODO: error condition\n\t\t\t}\n\t\t\tif(y[\"decimal-places\"]) NF += \".\" + fill(\"0\", +y[\"decimal-places\"]);\n\t\t} break;\n\n\t\tcase 'year': { // 16.29.14\n\t\t\ty = parsexmltag(Rn[0], false);\n\t\t\tswitch(y[\"style\"]) {\n\t\t\t\tcase \"short\": NF += \"yy\"; break;\n\t\t\t\tcase \"long\": NF += \"yyyy\"; break;\n\t\t\t\tdefault: NF += \"yy\"; break; // TODO: error condition\n\t\t\t}\n\t\t} break;\n\n\t\tcase 'am-pm': // 16.29.23\n\t\t\tNF += \"AM/PM\"; // LO autocorrects A/P -> AM/PM\n\t\t\tbreak;\n\n\t\tcase 'week-of-year': // 16.29.17\n\t\tcase 'quarter': // 16.29.18\n\t\t\tconsole.error(\"Excel does not support ODS format token \" + Rn[3]);\n\t\t\tbreak;\n\n\t\tcase 'fill-character': // 16.29.5\n\t\t\tif(Rn[1]==='/') {\n\t\t\t\tpayload = str.slice(tidx, xlmlregex.lastIndex - Rn[0].length);\n\t\t\t\t// NOTE: Excel has a different interpretation of \"%%\" and friends\n\t\t\t\tNF += '\"' + payload.replace(/\"/g, '\"\"') + '\"*';\n\t\t\t} else if(Rn[0].charAt(Rn[0].length-2) !== '/') {\n\t\t\t\ttidx = xlmlregex.lastIndex;\n\t\t\t} break;\n\n\t\tcase 'scientific-number': // 16.29.6\n\t\t\t// TODO: find a mapping for all parameters\n\t\t\ty = parsexmltag(Rn[0], false);\n\t\t\tNF += \"0.\" + fill(\"0\", +y[\"min-decimal-places\"] || +y[\"decimal-places\"] || 2) + fill(\"?\", +y[\"decimal-places\"] - +y[\"min-decimal-places\"] || 0) + \"E\" + (parsexmlbool(y[\"forced-exponent-sign\"]) ? \"+\" : \"\") + fill(\"0\", +y[\"min-exponent-digits\"] || 2);\n\t\t\tbreak;\n\n\t\tcase 'fraction': // 16.29.7\n\t\t\t// TODO: find a mapping for all parameters\n\t\t\ty = parsexmltag(Rn[0], false);\n\t\t\tif(!+y[\"min-integer-digits\"]) NF += \"#\";\n\t\t\telse NF += fill(\"0\", +y[\"min-integer-digits\"]);\n\t\t\tNF += \" \";\n\t\t\tNF += fill(\"?\", +y[\"min-numerator-digits\"] || 1);\n\t\t\tNF += \"/\";\n\t\t\tif(+y[\"denominator-value\"]) NF += y[\"denominator-value\"];\n\t\t\telse NF += fill(\"?\", +y[\"min-denominator-digits\"] || 1);\n\t\t\tbreak;\n\n\t\tcase 'currency-symbol': // 16.29.9\n\t\t\t// TODO: localization with [$-...]\n\t\t\tif(Rn[1]==='/') {\n\t\t\t\tNF += '\"' + str.slice(tidx, xlmlregex.lastIndex - Rn[0].length).replace(/\"/g, '\"\"') + '\"';\n\t\t\t} else if(Rn[0].charAt(Rn[0].length-2) !== '/') {\n\t\t\t\ttidx = xlmlregex.lastIndex;\n\t\t\t} else NF += \"$\";\n\t\t\tbreak;\n\n\t\tcase 'text-properties': // 16.29.29\n\t\t\ty = parsexmltag(Rn[0], false);\n\t\t\tswitch((y[\"color\"]||\"\").toLowerCase().replace(\"#\", \"\")) {\n\t\t\t\tcase \"ff0000\": case \"red\": NF = \"[Red]\" + NF; break;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'text-content': // 16.29.28\n\t\t\tNF += \"@\";\n\t\t\tbreak;\n\n\t\tcase 'map': // 16.3\n\t\t\t// TODO: handle more complex maps\n\t\t\ty = parsexmltag(Rn[0], false);\n\t\t\tif(unescapexml(y[\"condition\"]) == \"value()>=0\") NF = number_format_map[y[\"apply-style-name\"]] + \";\" + NF;\n\t\t\telse console.error(\"ODS number format may be incorrect: \" + y[\"condition\"]);\n\t\t\tbreak;\n\n\t\tcase 'number': // 16.29.3\n\t\t\t// TODO: handle all the attributes\n\t\t\tif(Rn[1]==='/') break;\n\t\t\ty = parsexmltag(Rn[0], false);\n\t\t\ttNF = \"\";\n\t\t\ttNF += fill(\"0\", +y[\"min-integer-digits\"] || 1);\n\t\t\tif(parsexmlbool(y[\"grouping\"])) tNF = commaify(fill(\"#\", Math.max(0, 4 - tNF.length)) + tNF);\n\t\t\tif(+y[\"min-decimal-places\"] || +y[\"decimal-places\"]) tNF += \".\";\n\t\t\tif(+y[\"min-decimal-places\"]) tNF += fill(\"0\", +y[\"min-decimal-places\"] || 1);\n\t\t\tif(+y[\"decimal-places\"] - (+y[\"min-decimal-places\"]||0)) tNF += fill(\"0\", +y[\"decimal-places\"] - (+y[\"min-decimal-places\"]||0)); // TODO: should this be \"#\" ?\n\t\t\tNF += tNF;\n\t\t\tbreak;\n\n\t\tcase 'embedded-text': // 16.29.4\n\t\t\t// TODO: verify interplay with grouping et al\n\t\t\tif(Rn[1]==='/') {\n\t\t\t\tif(etpos == 0) NF += '\"' + str.slice(tidx, xlmlregex.lastIndex - Rn[0].length).replace(/\"/g, '\"\"') + '\"';\n\t\t\t\telse NF = NF.slice(0, etpos) + '\"' + str.slice(tidx, xlmlregex.lastIndex - Rn[0].length).replace(/\"/g, '\"\"') + '\"' + NF.slice(etpos);\n\t\t\t} else if(Rn[0].charAt(Rn[0].length-2) !== '/') {\n\t\t\t\ttidx = xlmlregex.lastIndex;\n\t\t\t\tetpos = -+parsexmltag(Rn[0], false)[\"position\"] || 0;\n\t\t\t} break;\n\n\t}}\n\treturn number_format_map;\n}\n\nfunction parse_content_xml(d/*:string*/, _opts, _nfm)/*:Workbook*/ {\n\t\tvar opts = _opts || {};\n\t\tif(DENSE != null && opts.dense == null) opts.dense = DENSE;\n\t\tvar str = xlml_normalize(d);\n\t\tvar state/*:Array*/ = [], tmp;\n\t\tvar tag/*:: = {}*/;\n\t\tvar nfidx, NF = \"\", pidx = 0;\n\t\tvar sheetag/*:: = {name:\"\", '名称':\"\"}*/;\n\t\tvar rowtag/*:: = {'行号':\"\"}*/;\n\t\tvar Sheets = {}, SheetNames/*:Array*/ = [];\n\t\tvar ws = ({}/*:any*/); if(opts.dense) ws[\"!data\"] = [];\n\t\tvar Rn, q/*:: :any = ({t:\"\", v:null, z:null, w:\"\",c:[],}:any)*/;\n\t\tvar ctag = ({value:\"\"}/*:any*/), ctag2 = ({}/*:any*/);\n\t\tvar textp = \"\", textpidx = 0, textptag/*:: = {}*/, oldtextp = \"\", oldtextpidx = 0;\n\t\tvar textR = [], oldtextR = [];\n\t\tvar R = -1, C = -1, range = {s: {r:1000000,c:10000000}, e: {r:0, c:0}};\n\t\tvar row_ol = 0;\n\t\tvar number_format_map = _nfm || {}, styles = {};\n\t\tvar merges/*:Array*/ = [], mrange = {}, mR = 0, mC = 0;\n\t\tvar rowinfo/*:Array*/ = [], rowpeat = 1, colpeat = 1;\n\t\tvar arrayf/*:Array<[Range, string]>*/ = [];\n\t\tvar WB = {Names:[], WBProps:{}};\n\t\tvar atag = ({}/*:any*/);\n\t\tvar _Ref/*:[string, string]*/ = [\"\", \"\"];\n\t\tvar comments/*:Array*/ = [], comment/*:Comment*/ = ({}/*:any*/);\n\t\tvar creator = \"\", creatoridx = 0;\n\t\tvar isstub = false, intable = false;\n\t\tvar i = 0;\n\t\txlmlregex.lastIndex = 0;\n\t\tstr = remove_doctype(str_remove_ng(str, \"\"));\n\t\twhile((Rn = xlmlregex.exec(str))) switch((Rn[3]=Rn[3].replace(/_[\\s\\S]*$/,\"\"))) {\n\n\t\t\tcase 'table': case '工作表': // 9.1.2 \n\t\t\t\tif(Rn[1]==='/') {\n\t\t\t\t\tif(range.e.c >= range.s.c && range.e.r >= range.s.r) ws['!ref'] = encode_range(range);\n\t\t\t\t\telse ws['!ref'] = \"A1:A1\";\n\t\t\t\t\tif(opts.sheetRows > 0 && opts.sheetRows <= range.e.r) {\n\t\t\t\t\t\tws['!fullref'] = ws['!ref'];\n\t\t\t\t\t\trange.e.r = opts.sheetRows - 1;\n\t\t\t\t\t\tws['!ref'] = encode_range(range);\n\t\t\t\t\t}\n\t\t\t\t\tif(merges.length) ws['!merges'] = merges;\n\t\t\t\t\tif(rowinfo.length) ws[\"!rows\"] = rowinfo;\n\t\t\t\t\tsheetag.name = sheetag['名称'] || sheetag.name;\n\t\t\t\t\tif(typeof JSON !== 'undefined') JSON.stringify(sheetag);\n\t\t\t\t\tSheetNames.push(sheetag.name);\n\t\t\t\t\tSheets[sheetag.name] = ws;\n\t\t\t\t\tintable = false;\n\t\t\t\t}\n\t\t\t\telse if(Rn[0].charAt(Rn[0].length-2) !== '/') {\n\t\t\t\t\tsheetag = parsexmltag(Rn[0], false);\n\t\t\t\t\tR = C = -1;\n\t\t\t\t\trange.s.r = range.s.c = 10000000; range.e.r = range.e.c = 0;\n\t\t\t\t\tws = ({}/*:any*/); if(opts.dense) ws[\"!data\"] = []; merges = [];\n\t\t\t\t\trowinfo = [];\n\t\t\t\t\tintable = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'table-row-group': // 9.1.9 \n\t\t\t\tif(Rn[1] === \"/\") --row_ol; else ++row_ol;\n\t\t\t\tbreak;\n\t\t\tcase 'table-row': case '行': // 9.1.3 \n\t\t\t\tif(Rn[1] === '/') { R+=rowpeat; rowpeat = 1; break; }\n\t\t\t\trowtag = parsexmltag(Rn[0], false);\n\t\t\t\tif(rowtag['行号']) R = rowtag['行号'] - 1; else if(R == -1) R = 0;\n\t\t\t\trowpeat = +rowtag['number-rows-repeated'] || 1;\n\t\t\t\t/* TODO: remove magic */\n\t\t\t\tif(rowpeat < 10) for(i = 0; i < rowpeat; ++i) if(row_ol > 0) rowinfo[R + i] = {level: row_ol};\n\t\t\t\tC = -1; break;\n\t\t\tcase 'covered-table-cell': // 9.1.5 \n\t\t\t\tif(Rn[1] !== '/') {\n\t\t\t\t\t++C;\n\t\t\t\t\tctag = parsexmltag(Rn[0], false);\n\t\t\t\t\tcolpeat = parseInt(ctag['number-columns-repeated']||\"1\",10) || 1;\n\t\t\t\t\tif(opts.sheetStubs) {\n\t\t\t\t\t\twhile(colpeat-- > 0) {\n\t\t\t\t\t\t\tif(opts.dense) { if(!ws[\"!data\"][R]) ws[\"!data\"][R] = []; ws[\"!data\"][R][C] = {t:'z'}; }\n\t\t\t\t\t\t\telse ws[encode_cell({r:R,c:C})] = {t:'z'};\n\t\t\t\t\t\t\t++C;\n\t\t\t\t\t\t} --C;\n\t\t\t\t\t}\n\t\t\t\t\telse C += colpeat - 1;\n\t\t\t\t}\n\t\t\t\ttextp = \"\"; textR = [];\n\t\t\t\tbreak; /* stub */\n\t\t\tcase 'table-cell': case '数据':\n\t\t\t\tif(Rn[0].charAt(Rn[0].length-2) === '/') {\n\t\t\t\t\t++C;\n\t\t\t\t\tctag = parsexmltag(Rn[0], false);\n\t\t\t\t\tcolpeat = parseInt(ctag['number-columns-repeated']||\"1\", 10)||1;\n\t\t\t\t\tq = ({t:'z', v:null/*:: , z:null, w:\"\",c:[]*/}/*:any*/);\n\t\t\t\t\tif(ctag.formula && opts.cellFormula != false) q.f = ods_to_csf_formula(unescapexml(ctag.formula));\n\t\t\t\t\tif(ctag[\"style-name\"] && styles[ctag[\"style-name\"]]) q.z = styles[ctag[\"style-name\"]];\n\t\t\t\t\tif((ctag['数据类型'] || ctag['value-type']) == \"string\") {\n\t\t\t\t\t\tq.t = \"s\"; q.v = unescapexml(ctag['string-value'] || \"\");\n\t\t\t\t\t\tif(opts.dense) {\n\t\t\t\t\t\t\tif(!ws[\"!data\"][R]) ws[\"!data\"][R] = [];\n\t\t\t\t\t\t\tws[\"!data\"][R][C] = q;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tws[encode_col(C) + encode_row(R)] = q;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tC+= colpeat-1;\n\t\t\t\t} else if(Rn[1]!=='/') {\n\t\t\t\t\t++C;\n\t\t\t\t\ttextp = oldtextp = \"\"; textpidx = oldtextpidx = 0; textR = []; oldtextR = [];\n\t\t\t\t\tcolpeat = 1;\n\t\t\t\t\tvar rptR = rowpeat ? R + rowpeat - 1 : R;\n\t\t\t\t\tif(C > range.e.c) range.e.c = C;\n\t\t\t\t\tif(C < range.s.c) range.s.c = C;\n\t\t\t\t\tif(R < range.s.r) range.s.r = R;\n\t\t\t\t\tif(rptR > range.e.r) range.e.r = rptR;\n\t\t\t\t\tctag = parsexmltag(Rn[0], false);\n\t\t\t\t\tctag2 = parsexmltagraw(Rn[0], true);\n\t\t\t\t\tcomments = []; comment = ({}/*:any*/);\n\t\t\t\t\tq = ({t:ctag['数据类型'] || ctag['value-type'], v:null/*:: , z:null, w:\"\",c:[]*/}/*:any*/);\n\t\t\t\t\tif(ctag[\"style-name\"] && styles[ctag[\"style-name\"]]) q.z = styles[ctag[\"style-name\"]];\n\t\t\t\t\tif(opts.cellFormula) {\n\t\t\t\t\t\tif(ctag.formula) ctag.formula = unescapexml(ctag.formula);\n\t\t\t\t\t\tif(ctag['number-matrix-columns-spanned'] && ctag['number-matrix-rows-spanned']) {\n\t\t\t\t\t\t\tmR = parseInt(ctag['number-matrix-rows-spanned'],10) || 0;\n\t\t\t\t\t\t\tmC = parseInt(ctag['number-matrix-columns-spanned'],10) || 0;\n\t\t\t\t\t\t\tmrange = {s: {r:R,c:C}, e:{r:R + mR-1,c:C + mC-1}};\n\t\t\t\t\t\t\tq.F = encode_range(mrange);\n\t\t\t\t\t\t\tarrayf.push([mrange, q.F]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(ctag.formula) q.f = ods_to_csf_formula(ctag.formula);\n\t\t\t\t\t\telse for(i = 0; i < arrayf.length; ++i)\n\t\t\t\t\t\t\tif(R >= arrayf[i][0].s.r && R <= arrayf[i][0].e.r)\n\t\t\t\t\t\t\t\tif(C >= arrayf[i][0].s.c && C <= arrayf[i][0].e.c)\n\t\t\t\t\t\t\t\t\tq.F = arrayf[i][1];\n\t\t\t\t\t}\n\t\t\t\t\tif(ctag['number-columns-spanned'] || ctag['number-rows-spanned']) {\n\t\t\t\t\t\tmR = parseInt(ctag['number-rows-spanned']||\"1\",10) || 1;\n\t\t\t\t\t\tmC = parseInt(ctag['number-columns-spanned']||\"1\",10) || 1;\n\t\t\t\t\t\tif(mR * mC > 1) {\n\t\t\t\t\t\t\tmrange = {s: {r:R,c:C}, e:{r:R + mR-1,c:C + mC-1}};\n\t\t\t\t\t\t\tmerges.push(mrange);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t/* 19.675.2 table:number-columns-repeated */\n\t\t\t\t\tif(ctag['number-columns-repeated']) colpeat = parseInt(ctag['number-columns-repeated'], 10);\n\n\t\t\t\t\t/* 19.385 office:value-type TODO: verify ODS and UOS */\n\t\t\t\t\tswitch(q.t) {\n\t\t\t\t\t\tcase 'boolean': q.t = 'b'; q.v = parsexmlbool(ctag['boolean-value']) || (+ctag['boolean-value'] >= 1); break;\n\t\t\t\t\t\tcase 'float': q.t = 'n'; q.v = parseFloat(ctag.value);\n\t\t\t\t\t\t\tif(opts.cellDates && q.z && fmt_is_date(q.z)) { q.v = numdate(q.v + (WB.WBProps.date1904 ? 1462 : 0)); q.t = typeof q.v == \"number\" ? 'n' : 'd'; }\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'percentage': q.t = 'n'; q.v = parseFloat(ctag.value); break;\n\t\t\t\t\t\tcase 'currency': q.t = 'n'; q.v = parseFloat(ctag.value); break;\n\t\t\t\t\t\tcase 'date': q.t = 'd'; q.v = parseDate(ctag['date-value'], WB.WBProps.date1904);\n\t\t\t\t\t\t\tif(!opts.cellDates) { q.t = 'n'; q.v = datenum(q.v, WB.WBProps.date1904); }\n\t\t\t\t\t\t\tif(!q.z) q.z = 'm/d/yy'; break;\n\t\t\t\t\t\t/* NOTE: for `time`, Excel ODS export incorrectly uses durations relative to 1900 epoch even if 1904 is specified */\n\t\t\t\t\t\tcase 'time': q.t = 'n'; q.v = parse_isodur(ctag['time-value'])/86400;\n\t\t\t\t\t\t\tif(opts.cellDates) { q.v = numdate(q.v); q.t = typeof q.v == \"number\" ? 'n' : 'd'; }\n\t\t\t\t\t\t\tif(!q.z) q.z = 'HH:MM:SS'; break;\n\t\t\t\t\t\tcase 'number': q.t = 'n'; q.v = parseFloat(ctag['数据数值']);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif(q.t === 'string' || q.t === 'text' || !q.t) {\n\t\t\t\t\t\t\t\tq.t = 's';\n\t\t\t\t\t\t\t\tif(ctag['string-value'] != null) { textp = unescapexml(ctag['string-value']); textR = []; }\n\t\t\t\t\t\t\t} else throw new Error('Unsupported value type ' + q.t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tisstub = false;\n\t\t\t\t\tif(ctag2['calcext:value-type'] == \"error\" && RBErr[textp] != null) {\n\t\t\t\t\t\tq.t = 'e'; q.w = textp; q.v = RBErr[textp];\n\t\t\t\t\t}\n\t\t\t\t\tif(q.t === 's') {\n\t\t\t\t\t\tq.v = textp || '';\n\t\t\t\t\t\tif(textR.length) q.R = textR;\n\t\t\t\t\t\tisstub = textpidx == 0;\n\t\t\t\t\t}\n\t\t\t\t\tif(atag.Target) q.l = atag;\n\t\t\t\t\tif(comments.length > 0) { q.c = comments; comments = []; }\n\t\t\t\t\tif(textp && opts.cellText !== false) q.w = textp;\n\t\t\t\t\tif(isstub) { q.t = \"z\"; delete q.v; }\n\t\t\t\t\tif(!isstub || opts.sheetStubs) {\n\t\t\t\t\t\tif(!(opts.sheetRows && opts.sheetRows <= R)) {\n\t\t\t\t\t\t\tfor(var rpt = 0; rpt < rowpeat; ++rpt) {\n\t\t\t\t\t\t\t\tcolpeat = parseInt(ctag['number-columns-repeated']||\"1\", 10);\n\t\t\t\t\t\t\t\tif(opts.dense) {\n\t\t\t\t\t\t\t\t\tif(!ws[\"!data\"][R + rpt]) ws[\"!data\"][R + rpt] = [];\n\t\t\t\t\t\t\t\t\tws[\"!data\"][R + rpt][C] = rpt == 0 ? q : dup(q);\n\t\t\t\t\t\t\t\t\twhile(--colpeat > 0) ws[\"!data\"][R + rpt][C + colpeat] = dup(q);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tws[encode_cell({r:R + rpt,c:C})] = q;\n\t\t\t\t\t\t\t\t\twhile(--colpeat > 0) ws[encode_cell({r:R + rpt,c:C + colpeat})] = dup(q);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(range.e.c <= C) range.e.c = C;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcolpeat = parseInt(ctag['number-columns-repeated']||\"1\", 10);\n\t\t\t\t\tC += colpeat-1; colpeat = 0;\n\t\t\t\t\tq = {/*:: t:\"\", v:null, z:null, w:\"\",c:[]*/};\n\t\t\t\t\ttextp = \"\"; textR = [];\n\t\t\t\t}\n\t\t\t\tatag = ({}/*:any*/);\n\t\t\t\tbreak; // 9.1.4 \n\n\t\t\t/* pure state */\n\t\t\tcase 'document': // TODO: is the root for FODS\n\t\t\tcase 'document-content': case '电子表格文档': // 3.1.3.2 \n\t\t\tcase 'spreadsheet': case '主体': // 3.7 \n\t\t\tcase 'scripts': // 3.12 \n\t\t\tcase 'styles': // TODO \n\t\t\tcase 'font-face-decls': // 3.14 \n\t\t\tcase 'master-styles': // 3.15.4 -- relevant for FODS\n\t\t\t\tif(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw \"Bad state: \"+tmp;}\n\t\t\t\telse if(Rn[0].charAt(Rn[0].length-2) !== '/') state.push([Rn[3], true]);\n\t\t\t\tbreak;\n\n\t\t\tcase 'annotation': // 14.1 \n\t\t\t\tif(Rn[1]==='/'){\n\t\t\t\t\tif((tmp=state.pop())[0]!==Rn[3]) throw \"Bad state: \"+tmp;\n\t\t\t\t\tcomment.t = textp;\n\t\t\t\t\tif(textR.length) /*::(*/comment/*:: :any)*/.R = textR;\n\t\t\t\t\tcomment.a = creator;\n\t\t\t\t\tcomments.push(comment);\n\t\t\t\t\ttextp = oldtextp; textpidx = oldtextpidx; textR = oldtextR;\n\t\t\t\t}\n\t\t\t\telse if(Rn[0].charAt(Rn[0].length-2) !== '/') {\n\t\t\t\t\tstate.push([Rn[3], false]);\n\t\t\t\t\tvar annotag = parsexmltag(Rn[0], true);\n\t\t\t\t\t/* office:display TODO: check if there is a global override */\n\t\t\t\t\tif(!(annotag[\"display\"] && parsexmlbool(annotag[\"display\"]))) comments.hidden = true;\n\t\t\t\t\toldtextp = textp; oldtextpidx = textpidx; oldtextR = textR;\n\t\t\t\t\ttextp = \"\"; textpidx = 0; textR = [];\n\t\t\t\t}\n\t\t\t\tcreator = \"\"; creatoridx = 0;\n\t\t\t\tbreak;\n\n\t\t\tcase 'creator': // 4.3.2.7 \n\t\t\t\tif(Rn[1]==='/') { creator = str.slice(creatoridx,Rn.index); }\n\t\t\t\telse creatoridx = Rn.index + Rn[0].length;\n\t\t\t\tbreak;\n\n\t\t\t/* ignore state */\n\t\t\tcase 'meta': case '元数据': // TODO: FODS/UOF\n\t\t\tcase 'settings': // TODO: \n\t\t\tcase 'config-item-set': // TODO: \n\t\t\tcase 'config-item-map-indexed': // TODO: \n\t\t\tcase 'config-item-map-entry': // TODO: \n\t\t\tcase 'config-item-map-named': // TODO: \n\t\t\tcase 'shapes': // 9.2.8 \n\t\t\tcase 'frame': // 10.4.2 \n\t\t\tcase 'text-box': // 10.4.3 \n\t\t\tcase 'image': // 10.4.4 \n\t\t\tcase 'data-pilot-tables': // 9.6.2 \n\t\t\tcase 'list-style': // 16.30 \n\t\t\tcase 'form': // 13.13 \n\t\t\tcase 'dde-links': // 9.8 \n\t\t\tcase 'event-listeners': // TODO\n\t\t\tcase 'chart': // TODO\n\t\t\t\tif(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw \"Bad state: \"+tmp;}\n\t\t\t\telse if(Rn[0].charAt(Rn[0].length-2) !== '/') state.push([Rn[3], false]);\n\t\t\t\ttextp = \"\"; textpidx = 0; textR = [];\n\t\t\t\tbreak;\n\n\t\t\tcase 'scientific-number': // \n\t\t\tcase 'currency-symbol': // \n\t\t\tcase 'fill-character': // 16.29.5 \n\t\t\t\tbreak;\n\n\t\t\tcase 'text-style': // 16.27.25 \n\t\t\tcase 'boolean-style': // 16.27.23 \n\t\t\tcase 'number-style': // 16.27.2 \n\t\t\tcase 'currency-style': // 16.29.8 \n\t\t\tcase 'percentage-style': // 16.27.9 \n\t\t\tcase 'date-style': // 16.27.10 \n\t\t\tcase 'time-style': // 16.27.18 \n\t\t\t\tif(Rn[1]==='/'){\n\t\t\t\t\tvar xlmlidx = xlmlregex.lastIndex;\n\t\t\t\t\tparse_ods_styles(str.slice(nfidx, xlmlregex.lastIndex), _opts, number_format_map);\n\t\t\t\t\txlmlregex.lastIndex = xlmlidx;\n\t\t\t\t} else if(Rn[0].charAt(Rn[0].length-2) !== '/') {\n\t\t\t\t\tnfidx = xlmlregex.lastIndex - Rn[0].length;\n\t\t\t\t} break;\n\n\t\t\tcase 'script': break; // 3.13 \n\t\t\tcase 'libraries': break; // TODO: \n\t\t\tcase 'automatic-styles': break; // 3.15.3 \n\n\t\t\tcase 'default-style': // TODO: \n\t\t\tcase 'page-layout': break; // TODO: \n\t\t\tcase 'style': { // 16.2 \n\t\t\t\tvar styletag = parsexmltag(Rn[0], false);\n\t\t\t\tif(styletag[\"family\"] == \"table-cell\" && number_format_map[styletag[\"data-style-name\"]]) styles[styletag[\"name\"]] = number_format_map[styletag[\"data-style-name\"]];\n\t\t\t} break;\n\t\t\tcase 'map': break; // 16.3 \n\t\t\tcase 'font-face': break; // 16.21 \n\n\t\t\tcase 'paragraph-properties': break; // 17.6 \n\t\t\tcase 'table-properties': break; // 17.15 \n\t\t\tcase 'table-column-properties': break; // 17.16 \n\t\t\tcase 'table-row-properties': break; // 17.17 \n\t\t\tcase 'table-cell-properties': break; // 17.18 \n\n\t\t\tcase 'number': // 16.27.3 \n\t\t\t\tbreak;\n\n\t\t\tcase 'fraction': break; // TODO 16.27.6 \n\n\t\t\tcase 'day': // 16.27.11 \n\t\t\tcase 'month': // 16.27.12 \n\t\t\tcase 'year': // 16.27.13 \n\t\t\tcase 'era': // 16.27.14 \n\t\t\tcase 'day-of-week': // 16.27.15 \n\t\t\tcase 'week-of-year': // 16.27.16 \n\t\t\tcase 'quarter': // 16.27.17 \n\t\t\tcase 'hours': // 16.27.19 \n\t\t\tcase 'minutes': // 16.27.20 \n\t\t\tcase 'seconds': // 16.27.21 \n\t\t\tcase 'am-pm': // 16.27.22 \n\t\t\t\tbreak;\n\n\t\t\tcase 'boolean': break; // 16.27.24 \n\t\t\tcase 'text': // 16.27.26 \n\t\t\t\tif(Rn[0].slice(-2) === \"/>\") break;\n\t\t\t\telse if(Rn[1]===\"/\") switch(state[state.length-1][0]) {\n\t\t\t\t\tcase 'number-style':\n\t\t\t\t\tcase 'date-style':\n\t\t\t\t\tcase 'time-style':\n\t\t\t\t\t\tNF += str.slice(pidx, Rn.index);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse pidx = Rn.index + Rn[0].length;\n\t\t\t\tbreak;\n\n\t\t\tcase 'named-range': // 9.4.12 \n\t\t\t\ttag = parsexmltag(Rn[0], false);\n\t\t\t\t_Ref = ods_to_csf_3D(tag['cell-range-address']);\n\t\t\t\tvar nrange = ({Name:tag.name, Ref:_Ref[0] + '!' + _Ref[1]}/*:any*/);\n\t\t\t\tif(intable) nrange.Sheet = SheetNames.length;\n\t\t\t\tWB.Names.push(nrange);\n\t\t\t\tbreak;\n\n\t\t\tcase 'text-content': break; // 16.27.27 \n\t\t\tcase 'text-properties': break; // 16.27.27 \n\t\t\tcase 'embedded-text': break; // 16.27.4 \n\n\t\t\tcase 'body': case '电子表格': break; // 3.3 16.9.6 19.726.3\n\n\t\t\tcase 'forms': break; // 12.25.2 13.2\n\t\t\tcase 'table-column': break; // 9.1.6 \n\t\t\tcase 'table-header-rows': break; // 9.1.7 \n\t\t\tcase 'table-rows': break; // 9.1.12 \n\t\t\t/* TODO: outline levels */\n\t\t\tcase 'table-column-group': break; // 9.1.10 \n\t\t\tcase 'table-header-columns': break; // 9.1.11 \n\t\t\tcase 'table-columns': break; // 9.1.12 \n\n\t\t\tcase 'null-date': // 9.4.2 \n\t\t\t\ttag = parsexmltag(Rn[0], false);\n\t\t\t\tswitch(tag[\"date-value\"]) {\n\t\t\t\t\tcase \"1904-01-01\": WB.WBProps.date1904 = true; break;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'graphic-properties': break; // 17.21 \n\t\t\tcase 'calculation-settings': break; // 9.4.1 \n\t\t\tcase 'named-expressions': break; // 9.4.11 \n\t\t\tcase 'label-range': break; // 9.4.9 \n\t\t\tcase 'label-ranges': break; // 9.4.10 \n\t\t\tcase 'named-expression': break; // 9.4.13 \n\t\t\tcase 'sort': break; // 9.4.19 \n\t\t\tcase 'sort-by': break; // 9.4.20 \n\t\t\tcase 'sort-groups': break; // 9.4.22 \n\n\t\t\tcase 'tab': break; // 6.1.4 \n\t\t\tcase 'line-break': break; // 6.1.5 \n\t\t\tcase 'span': break; // 6.1.7 \n\t\t\tcase 'p': case '文本串': // 5.1.3 \n\t\t\t\tif(['master-styles'].indexOf(state[state.length-1][0]) > -1) break;\n\t\t\t\tif(Rn[1]==='/' && (!ctag || !ctag['string-value'])) {\n\t\t\t\t\tvar ptp = parse_text_p(str.slice(textpidx,Rn.index), textptag);\n\t\t\t\t\ttextp = (textp.length > 0 ? textp + \"\\n\" : \"\") + ptp[0];\n\t\t\t\t} else if(Rn[0].slice(-2) == \"/>\") {\n\t\t\t\t\t/* TODO: is self-closing 文本串 valid? */\n\t\t\t\t\ttextp += \"\\n\";\n\t\t\t\t} else { textptag = parsexmltag(Rn[0], false); textpidx = Rn.index + Rn[0].length; }\n\t\t\t\tbreak; // \n\t\t\tcase 's': break; // \n\n\t\t\tcase 'database-range': // 9.4.15 \n\t\t\t\tif(Rn[1]==='/') break;\n\t\t\t\ttry {\n\t\t\t\t\t_Ref = ods_to_csf_3D(parsexmltag(Rn[0])['target-range-address']);\n\t\t\t\t\tSheets[_Ref[0]]['!autofilter'] = { ref:_Ref[1] };\n\t\t\t\t} catch(e) {/* empty */}\n\t\t\t\tbreak;\n\n\t\t\tcase 'date': break; // <*:date>\n\n\t\t\tcase 'object': break; // 10.4.6.2 \n\t\t\tcase 'title': case '标题': break; // <*:title> OR \n\t\t\tcase 'desc': break; // <*:desc>\n\t\t\tcase 'binary-data': break; // 10.4.5 TODO: b64 blob\n\n\t\t\t/* 9.2 Advanced Tables */\n\t\t\tcase 'table-source': break; // 9.2.6\n\t\t\tcase 'scenario': break; // 9.2.6\n\n\t\t\tcase 'iteration': break; // 9.4.3 \n\t\t\tcase 'content-validations': break; // 9.4.4 \n\n\t\t\t/* 9.5 Filters */\n\t\t\tcase 'filter': break; // 9.5.2 \n\t\t\tcase 'filter-and': break; // 9.5.3 \n\t\t\tcase 'filter-or': break; // 9.5.4 \n\t\t\tcase 'filter-condition': break; // 9.5.5 \n\t\t\tcase 'filter-set-item': break; // 9.5.6 \n\n\t\t\tcase 'list-level-style-bullet': break; // 16.31 \n\t\t\tcase 'page-count': break; // TODO \n\t\t\tcase 'time': break; // TODO \n\n\t\t\t/* 9.3 Advanced Table Cells */\n\t\t\tcase 'cell-range-source': break; // 9.3.1 \n\t\t\tcase 'property': break; // 13.8 \n\n\t\t\tcase 'a': // 6.1.8 hyperlink\n\t\t\t\tif(Rn[1]!== '/') {\n\t\t\t\t\tatag = parsexmltag(Rn[0], false);\n\t\t\t\t\tif(!atag.href) break;\n\t\t\t\t\tatag.Target = unescapexml(atag.href); delete atag.href;\n\t\t\t\t\tif(atag.Target.charAt(0) == \"#\" && atag.Target.indexOf(\".\") > -1) {\n\t\t\t\t\t\t_Ref = ods_to_csf_3D(atag.Target.slice(1));\n\t\t\t\t\t\tatag.Target = \"#\" + _Ref[0] + \"!\" + _Ref[1];\n\t\t\t\t\t} else if(atag.Target.match(/^\\.\\.[\\\\\\/]/)) atag.Target = atag.Target.slice(3);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t/* non-standard */\n\t\t\tcase 'table-protection': break;\n\t\t\tcase 'data-pilot-grand-total': break; // ',\n\t\t\t'',\n\t\t\t\t'',\n\t\t\t\t'',\n\t\t\t\t'',\n\t\t\t\t'',\n\t\t\t'',\n\t\t''\n\t].join(\"\");\n\n\tvar payload = '' + master_styles + '';\n\n\treturn function wso(/*::wb, opts*/) {\n\t\treturn XML_HEADER + payload;\n\t};\n})();\n\n// TODO: find out if anyone actually read the spec. LO has some wild errors\nfunction write_number_format_ods(nf/*:string*/, nfidx/*:string*/)/*:string*/ {\n\tvar type = \"number\", payload = \"\", nopts = { \"style:name\": nfidx }, c = \"\", i = 0;\n\tnf = nf.replace(/\"[$]\"/g, \"$\");\n\t/* TODO: replace with an actual parser based on a real grammar */\n\tj: {\n\t\t// TODO: support style maps\n\t\tif(nf.indexOf(\";\") > -1) {\n\t\t\tconsole.error(\"Unsupported ODS Style Map exported. Using first branch of \" + nf);\n\t\t\tnf = nf.slice(0, nf.indexOf(\";\"));\n\t\t}\n\n\t\tif(nf == \"@\") { type = \"text\"; payload = \"\"; break j; }\n\n\t\t/* currency flag */\n\t\tif(nf.indexOf(/\\$/) > -1) { type = \"currency\"; }\n\n\t\t/* opening string literal */\n\t\tif(nf[i] == '\"') {\n\t\t\tc = \"\";\n\t\t\twhile(nf[++i] != '\"' || nf[++i] == '\"') c += nf[i]; --i;\n\t\t\tif(nf[i+1] == \"*\") {\n\t\t\t\ti++;\n\t\t\t\tpayload += '' + escapexml(c.replace(/\"\"/g, '\"')) + '';\n\t\t\t} else {\n\t\t\t\tpayload += '' + escapexml(c.replace(/\"\"/g, '\"')) + '';\n\t\t\t}\n\t\t\tnf = nf.slice(i+1); i = 0;\n\t\t}\n\n\t\t/* fractions */\n\t\tvar t = nf.match(/# (\\?+)\\/(\\?+)/);\n\t\tif(t) { payload += writextag(\"number:fraction\", null, {\"number:min-integer-digits\":0, \"number:min-numerator-digits\": t[1].length, \"number:max-denominator-value\": Math.max(+(t[1].replace(/./g, \"9\")), +(t[2].replace(/./g, \"9\"))) }); break j; }\n\t\tif((t=nf.match(/# (\\?+)\\/(\\d+)/))) { payload += writextag(\"number:fraction\", null, {\"number:min-integer-digits\":0, \"number:min-numerator-digits\": t[1].length, \"number:denominator-value\": +t[2]}); break j; }\n\n\t\t/* percentages */\n\t\tif((t=nf.match(/\\b(\\d+)(|\\.\\d+)%/))) { type = \"percentage\"; payload += writextag(\"number:number\", null, {\"number:decimal-places\": t[2] && t.length - 1 || 0, \"number:min-decimal-places\": t[2] && t.length - 1 || 0, \"number:min-integer-digits\": t[1].length }) + \"%\"; break j; }\n\n\t\t/* datetime */\n\t\tvar has_time = false;\n\t\tif([\"y\",\"m\",\"d\"].indexOf(nf[0]) > -1) {\n\t\t\ttype = \"date\";\n\t\t\tk: for(; i < nf.length; ++i) switch((c = nf[i].toLowerCase())) {\n\t\t\t\tcase \"h\": case \"s\": has_time = true; --i; break k;\n\t\t\t\tcase \"m\":\n\t\t\t\t\tl: for(var h = i+1; h < nf.length; ++h) switch(nf[h]) {\n\t\t\t\t\t\tcase \"y\": case \"d\": break l;\n\t\t\t\t\t\tcase \"h\": case \"s\": has_time = true; --i; break k;\n\t\t\t\t\t}\n\t\t\t\t\t/* falls through */\n\t\t\t\tcase \"y\": case \"d\":\n\t\t\t\t\twhile((nf[++i]||\"\").toLowerCase() == c[0]) c += c[0]; --i;\n\t\t\t\t\tswitch(c) {\n\t\t\t\t\t\tcase \"y\": case \"yy\": payload += \"\"; break;\n\t\t\t\t\t\tcase \"yyy\": case \"yyyy\": payload += ''; break;\n\t\t\t\t\t\tcase \"mmmmm\": console.error(\"ODS has no equivalent of format |mmmmm|\");\n\t\t\t\t\t\t\t/* falls through */\n\t\t\t\t\t\tcase \"m\": case \"mm\": case \"mmm\": case \"mmmm\":\n\t\t\t\t\t\t\tpayload += '= 3 ? \"true\" : \"false\") + '\"/>';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"d\": case \"dd\": payload += ''; break;\n\t\t\t\t\t\tcase \"ddd\": case \"dddd\": payload += ''; break;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase '\"':\n\t\t\t\t\twhile(nf[++i] != '\"' || nf[++i] == '\"') c += nf[i]; --i;\n\t\t\t\t\tpayload += '' + escapexml(c.slice(1).replace(/\"\"/g, '\"')) + '';\n\t\t\t\t\tbreak;\n\t\t\t\tcase '\\\\': c = nf[++i];\n\t\t\t\t\tpayload += '' + escapexml(c) + ''; break;\n\t\t\t\tcase '/': case ':': payload += '' + escapexml(c) + ''; break;\n\t\t\t\tdefault: console.error(\"unrecognized character \" + c + \" in ODF format \" + nf);\n\t\t\t}\n\t\t\tif(!has_time) break j;\n\t\t\tnf = nf.slice(i+1); i = 0;\n\t\t}\n\t\tif(nf.match(/^\\[?[hms]/)) {\n\t\t\tif(type == \"number\") type = \"time\";\n\t\t\tif(nf.match(/\\[/)) {\n\t\t\t\tnf = nf.replace(/[\\[\\]]/g, \"\");\n\t\t\t\tnopts['number:truncate-on-overflow'] = \"false\";\n\t\t\t}\n\t\t\tfor(; i < nf.length; ++i) switch((c = nf[i].toLowerCase())) {\n\t\t\t\tcase \"h\": case \"m\": case \"s\":\n\t\t\t\t\twhile((nf[++i]||\"\").toLowerCase() == c[0]) c += c[0]; --i;\n\t\t\t\t\tswitch(c) {\n\t\t\t\t\t\tcase \"h\": case \"hh\": payload += ''; break;\n\t\t\t\t\t\tcase \"m\": case \"mm\": payload += ''; break;\n\t\t\t\t\t\tcase \"s\": case \"ss\":\n\t\t\t\t\t\t\tif(nf[i+1] == \".\") do { c += nf[i+1]; ++i; } while(nf[i+1] == \"0\");\n\t\t\t\t\t\t\tpayload += ''; break;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase '\"':\n\t\t\t\t\twhile(nf[++i] != '\"' || nf[++i] == '\"') c += nf[i]; --i;\n\t\t\t\t\tpayload += '' + escapexml(c.slice(1).replace(/\"\"/g, '\"')) + '';\n\t\t\t\t\tbreak;\n\t\t\t\tcase '/': case ':': payload += '' + escapexml(c) + ''; break;\n\t\t\t\tcase \"a\":\n\t\t\t\t\tif(nf.slice(i, i+3).toLowerCase() == \"a/p\") { payload += ''; i += 2; break; } // Note: ODF does not support A/P\n\t\t\t\t\tif(nf.slice(i, i+5).toLowerCase() == \"am/pm\") { payload += ''; i += 4; break; }\n\t\t\t\t\t/* falls through */\n\t\t\t\tdefault: console.error(\"unrecognized character \" + c + \" in ODF format \" + nf);\n\t\t\t}\n\t\t\tbreak j;\n\t\t}\n\n\t\t/* currency flag */\n\t\tif(nf.indexOf(/\\$/) > -1) { type = \"currency\"; }\n\n\t\t/* should be in a char loop */\n\t\tif(nf[0] == \"$\") { payload += '$'; nf = nf.slice(1); i = 0; }\n\t\ti = 0; if(nf[i] == '\"') {\n\t\t\twhile(nf[++i] != '\"' || nf[++i] == '\"') c += nf[i]; --i;\n\t\t\tif(nf[i+1] == \"*\") {\n\t\t\t\ti++;\n\t\t\t\tpayload += '' + escapexml(c.replace(/\"\"/g, '\"')) + '';\n\t\t\t} else {\n\t\t\t\tpayload += '' + escapexml(c.replace(/\"\"/g, '\"')) + '';\n\t\t\t}\n\t\t\tnf = nf.slice(i+1); i = 0;\n\t\t}\n\n\t\t/* number TODO: interstitial text e.g. 000)000-0000 */\n\t\tvar np = nf.match(/([#0][0#,]*)(\\.[0#]*|)(E[+]?0*|)/i);\n\t\tif(!np || !np[0]) console.error(\"Could not find numeric part of \" + nf);\n\t\telse {\n\t\t\tvar base = np[1].replace(/,/g, \"\");\n\t\t\tpayload += ' -1 ? ' number:grouping=\"true\"' : \"\") +\n\t\t\t\t(np[2] && ' number:decimal-places=\"' + (np[2].length - 1) + '\"' || ' number:decimal-places=\"0\"') +\n\t\t\t\t(np[3] && np[3].indexOf(\"+\") > -1 ? ' number:forced-exponent-sign=\"true\"' : \"\" ) +\n\t\t\t\t(np[3] ? ' number:min-exponent-digits=\"' + np[3].match(/0+/)[0].length + '\"' : \"\" ) +\n\t\t\t\t'>' +\n\t\t\t\t/* TODO: interstitial text placeholders */\n\t\t\t\t'';\n\t\t\ti = np.index + np[0].length;\n\t\t}\n\n\t\t/* residual text */\n\t\tif(nf[i] == '\"') {\n\t\t\tc = \"\";\n\t\t\twhile(nf[++i] != '\"' || nf[++i] == '\"') c += nf[i]; --i;\n\t\t\tpayload += '' + escapexml(c.replace(/\"\"/g, '\"')) + '';\n\t\t}\n\t}\n\n\tif(!payload) { console.error(\"Could not generate ODS number format for |\" + nf + \"|\"); return \"\"; }\n\treturn writextag(\"number:\" + type + \"-style\", payload, nopts);\n}\n\nfunction write_names_ods(Names, SheetNames, idx) {\n\t//var scoped = Names.filter(function(name) { return name.Sheet == (idx == -1 ? null : idx); });\n\tvar scoped = []; for(var namei = 0; namei < Names.length; ++namei) {\n\t\tvar name = Names[namei];\n\t\tif(!name) continue;\n\t\tif(name.Sheet == (idx == -1 ? null : idx)) scoped.push(name);\n\t}\n\tif(!scoped.length) return \"\";\n\treturn \" \\n\" + scoped.map(function(name) {\n\t\tvar odsref = (idx == -1 ? \"$\" : \"\") + csf_to_ods_3D(name.Ref);\n\t\treturn \" \" + writextag(\"table:named-range\", null, {\n\t\t\t\"table:name\": name.Name,\n\t\t\t\"table:cell-range-address\": odsref,\n\t\t\t\"table:base-cell-address\": odsref.replace(/[\\.][^\\.]*$/, \".$A$1\")\n\t\t});\n\t}).join(\"\\n\") + \"\\n \\n\";\n}\nvar write_content_ods/*:{(wb:any, opts:any):string}*/ = /* @__PURE__ */(function() {\n\t/* 6.1.2 White Space Characters */\n\tvar write_text_p = function(text/*:string*/, span)/*:string*/ {\n\t\treturn escapexml(text)\n\t\t\t.replace(/ +/g, function($$){return '';})\n\t\t\t.replace(/\\t/g, \"\")\n\t\t\t.replace(/\\n/g, span ? \"\": \"\")\n\t\t\t.replace(/^ /, \"\").replace(/ $/, \"\");\n\t};\n\n\tvar null_cell_xml = ' \\n';\n\tvar write_ws = function(ws, wb/*:Workbook*/, i/*:number*/, opts, nfs, date1904)/*:string*/ {\n\t\t/* Section 9 Tables */\n\t\tvar o/*:Array*/ = [];\n\t\to.push(' \\n');\n\t\tvar R=0,C=0, range = decode_range(ws['!ref']||\"A1\");\n\t\tvar marr/*:Array*/ = ws['!merges'] || [], mi = 0;\n\t\tvar dense = ws[\"!data\"] != null;\n\t\tif(ws[\"!cols\"]) {\n\t\t\tfor(C = 0; C <= range.e.c; ++C) o.push(' \\n');\n\t\t}\n\t\tvar H = \"\", ROWS = ws[\"!rows\"]||[];\n\t\tfor(R = 0; R < range.s.r; ++R) {\n\t\t\tH = ROWS[R] ? ' table:style-name=\"ro' + ROWS[R].ods + '\"' : \"\";\n\t\t\to.push(' \\n');\n\t\t}\n\t\tfor(; R <= range.e.r; ++R) {\n\t\t\tH = ROWS[R] ? ' table:style-name=\"ro' + ROWS[R].ods + '\"' : \"\";\n\t\t\to.push(' \\n');\n\t\t\tfor(C=0; C < range.s.c; ++C) o.push(null_cell_xml);\n\t\t\tfor(; C <= range.e.c; ++C) {\n\t\t\t\tvar skip = false, ct = {}, textp = \"\";\n\t\t\t\tfor(mi = 0; mi != marr.length; ++mi) {\n\t\t\t\t\tif(marr[mi].s.c > C) continue;\n\t\t\t\t\tif(marr[mi].s.r > R) continue;\n\t\t\t\t\tif(marr[mi].e.c < C) continue;\n\t\t\t\t\tif(marr[mi].e.r < R) continue;\n\t\t\t\t\tif(marr[mi].s.c != C || marr[mi].s.r != R) skip = true;\n\t\t\t\t\tct['table:number-columns-spanned'] = (marr[mi].e.c - marr[mi].s.c + 1);\n\t\t\t\t\tct['table:number-rows-spanned'] = (marr[mi].e.r - marr[mi].s.r + 1);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif(skip) { o.push(' \\n'); continue; }\n\t\t\t\tvar ref = encode_cell({r:R, c:C}), cell = dense ? (ws[\"!data\"][R]||[])[C]: ws[ref];\n\t\t\t\tif(cell && cell.f) {\n\t\t\t\t\tct['table:formula'] = escapexml(csf_to_ods_formula(cell.f));\n\t\t\t\t\tif(cell.F) {\n\t\t\t\t\t\tif(cell.F.slice(0, ref.length) == ref) {\n\t\t\t\t\t\t\tvar _Fref = decode_range(cell.F);\n\t\t\t\t\t\t\tct['table:number-matrix-columns-spanned'] = (_Fref.e.c - _Fref.s.c + 1);\n\t\t\t\t\t\t\tct['table:number-matrix-rows-spanned'] = (_Fref.e.r - _Fref.s.r + 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(!cell) { o.push(null_cell_xml); continue; }\n\t\t\t\tswitch(cell.t) {\n\t\t\t\t\tcase 'b':\n\t\t\t\t\t\ttextp = (cell.v ? 'TRUE' : 'FALSE');\n\t\t\t\t\t\tct['office:value-type'] = \"boolean\";\n\t\t\t\t\t\tct['office:boolean-value'] = (cell.v ? 'true' : 'false');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'n':\n\t\t\t\t\t\tif(!isFinite(cell.v)) {\n\t\t\t\t\t\t\tif(isNaN(cell.v)) {\n\t\t\t\t\t\t\t\ttextp = \"#NUM!\";\n\t\t\t\t\t\t\t\tct['table:formula'] = \"of:=#NUM!\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttextp = \"#DIV/0!\";\n\t\t\t\t\t\t\t\tct['table:formula'] = \"of:=\" + (cell.v < 0 ? \"-\" : \"\") + \"1/0\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tct['office:string-value'] = \"\";\n\t\t\t\t\t\t\tct['office:value-type'] = \"string\";\n\t\t\t\t\t\t\tct['calcext:value-type'] = \"error\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttextp = (cell.w||String(cell.v||0));\n\t\t\t\t\t\t\tct['office:value-type'] = \"float\";\n\t\t\t\t\t\t\tct['office:value'] = (cell.v||0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 's': case 'str':\n\t\t\t\t\t\ttextp = cell.v == null ? \"\" : cell.v;\n\t\t\t\t\t\tct['office:value-type'] = \"string\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'd':\n\t\t\t\t\t\ttextp = (cell.w||(parseDate(cell.v, date1904).toISOString()));\n\t\t\t\t\t\tct['office:value-type'] = \"date\";\n\t\t\t\t\t\tct['office:date-value'] = (parseDate(cell.v, date1904).toISOString());\n\t\t\t\t\t\tct['table:style-name'] = \"ce1\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t//case 'e': // TODO: translate to ODS errors\n\t\t\t\t\tdefault: o.push(null_cell_xml); continue; // TODO: empty cell with comments\n\t\t\t\t}\n\t\t\t\tvar text_p = write_text_p(textp);\n\t\t\t\tif(cell.l && cell.l.Target) {\n\t\t\t\t\tvar _tgt = cell.l.Target;\n\t\t\t\t\t_tgt = _tgt.charAt(0) == \"#\" ? \"#\" + csf_to_ods_3D(_tgt.slice(1)) : _tgt;\n\t\t\t\t\t// TODO: choose correct parent path format based on link delimiters\n\t\t\t\t\tif(_tgt.charAt(0) != \"#\" && !_tgt.match(/^\\w+:/)) _tgt = '../' + _tgt;\n\t\t\t\t\ttext_p = writextag('text:a', text_p, {'xlink:href': _tgt.replace(/&/g, \"&\")});\n\t\t\t\t}\n\t\t\t\tif(nfs[cell.z]) ct[\"table:style-name\"] = \"ce\" + nfs[cell.z].slice(1);\n\t\t\t\tvar payload = writextag('text:p', text_p, {});\n\t\t\t\tif(cell.c) {\n\t\t\t\t\tvar acreator = \"\", apayload = \"\", aprops = {};\n\t\t\t\t\tfor(var ci = 0; ci < cell.c.length; ++ci) {\n\t\t\t\t\t\tif(!acreator && cell.c[ci].a) acreator = cell.c[ci].a;\n\t\t\t\t\t\tapayload += \"\" + write_text_p(cell.c[ci].t) + \"\";\n\t\t\t\t\t}\n\t\t\t\t\tif(!cell.c.hidden) aprops[\"office:display\"] = true;\n\t\t\t\t\tpayload = writextag('office:annotation', apayload, aprops) + payload;\n\t\t\t\t}\n\t\t\t\to.push(' ' + writextag('table:table-cell', payload, ct) + '\\n');\n\t\t\t}\n\t\t\to.push(' \\n');\n\t\t}\n\t\tif((wb.Workbook||{}).Names) o.push(write_names_ods(wb.Workbook.Names, wb.SheetNames, i));\n\t\to.push(' \\n');\n\t\treturn o.join(\"\");\n\t};\n\n\tvar write_automatic_styles_ods = function(o/*:Array*/, wb) {\n\t\to.push(' \\n');\n\n\t\t/* column styles */\n\t\tvar cidx = 0;\n\t\twb.SheetNames.map(function(n) { return wb.Sheets[n]; }).forEach(function(ws) {\n\t\t\tif(!ws) return;\n\t\t\tif(ws[\"!cols\"]) {\n\t\t\t\tfor(var C = 0; C < ws[\"!cols\"].length; ++C) if(ws[\"!cols\"][C]) {\n\t\t\t\t\tvar colobj = ws[\"!cols\"][C];\n\t\t\t\t\tif(colobj.width == null && colobj.wpx == null && colobj.wch == null) continue;\n\t\t\t\t\tprocess_col(colobj);\n\t\t\t\t\tcolobj.ods = cidx;\n\t\t\t\t\tvar w = ws[\"!cols\"][C].wpx + \"px\";\n\t\t\t\t\to.push(' \\n');\n\t\t\t\t\to.push(' \\n');\n\t\t\t\t\to.push(' \\n');\n\t\t\t\t\t++cidx;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t/* row styles */\n\t\tvar ridx = 0;\n\t\twb.SheetNames.map(function(n) { return wb.Sheets[n]; }).forEach(function(ws) {\n\t\t\tif(!ws) return;\n\t\t\tif(ws[\"!rows\"]) {\n\t\t\t\tfor(var R = 0; R < ws[\"!rows\"].length; ++R) if(ws[\"!rows\"][R]) {\n\t\t\t\t\tws[\"!rows\"][R].ods = ridx;\n\t\t\t\t\tvar h = ws[\"!rows\"][R].hpx + \"px\";\n\t\t\t\t\to.push(' \\n');\n\t\t\t\t\to.push(' \\n');\n\t\t\t\t\to.push(' \\n');\n\t\t\t\t\t++ridx;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t/* table */\n\t\to.push(' \\n');\n\t\to.push(' \\n');\n\t\to.push(' \\n');\n\n\t\to.push(' \\n');\n\t\to.push(' \\n');\n\t\to.push(' /\\n');\n\t\to.push(' \\n');\n\t\to.push(' /\\n');\n\t\to.push(' \\n');\n\t\to.push(' \\n');\n\n\t\t/* number formats, table cells, text */\n\t\tvar nfs = {};\n\t\tvar nfi = 69;\n\t\twb.SheetNames.map(function(n) { return wb.Sheets[n]; }).forEach(function(ws) {\n\t\t\tif(!ws) return;\n\t\t\tvar dense = (ws[\"!data\"] != null);\n\t\t\tif(!ws[\"!ref\"]) return;\n\t\t\tvar range = decode_range(ws[\"!ref\"]);\n\t\t\tfor(var R = 0; R <= range.e.r; ++R) for(var C = 0; C <= range.e.c; ++C) {\n\t\t\t\tvar c = dense ? (ws[\"!data\"][R]||[])[C] : ws[encode_cell({r:R,c:C})];\n\t\t\t\tif(!c || !c.z || c.z.toLowerCase() == \"general\") continue;\n\t\t\t\tif(!nfs[c.z]) {\n\t\t\t\t\tvar out = write_number_format_ods(c.z, \"N\" + nfi);\n\t\t\t\t\tif(out) { nfs[c.z] = \"N\" + nfi; ++nfi; o.push(out + \"\\n\"); }\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\to.push(' \\n');\n\t\tkeys(nfs).forEach(function(nf) {\n\t\t\to.push('\\n');\n\t\t});\n\n\t\t/* page-layout */\n\n\t\to.push(' \\n');\n\t\treturn nfs;\n\t};\n\n\treturn function wcx(wb, opts) {\n\t\tvar o = [XML_HEADER];\n\t\t/* 3.1.3.2 */\n\t\tvar attr = wxt_helper({\n\t\t\t'xmlns:office': \"urn:oasis:names:tc:opendocument:xmlns:office:1.0\",\n\t\t\t'xmlns:table': \"urn:oasis:names:tc:opendocument:xmlns:table:1.0\",\n\t\t\t'xmlns:style': \"urn:oasis:names:tc:opendocument:xmlns:style:1.0\",\n\t\t\t'xmlns:text': \"urn:oasis:names:tc:opendocument:xmlns:text:1.0\",\n\t\t\t'xmlns:draw': \"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0\",\n\t\t\t'xmlns:fo': \"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0\",\n\t\t\t'xmlns:xlink': \"http://www.w3.org/1999/xlink\",\n\t\t\t'xmlns:dc': \"http://purl.org/dc/elements/1.1/\",\n\t\t\t'xmlns:meta': \"urn:oasis:names:tc:opendocument:xmlns:meta:1.0\",\n\t\t\t'xmlns:number': \"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0\",\n\t\t\t'xmlns:presentation': \"urn:oasis:names:tc:opendocument:xmlns:presentation:1.0\",\n\t\t\t'xmlns:svg': \"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0\",\n\t\t\t'xmlns:chart': \"urn:oasis:names:tc:opendocument:xmlns:chart:1.0\",\n\t\t\t'xmlns:dr3d': \"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0\",\n\t\t\t'xmlns:math': \"http://www.w3.org/1998/Math/MathML\",\n\t\t\t'xmlns:form': \"urn:oasis:names:tc:opendocument:xmlns:form:1.0\",\n\t\t\t'xmlns:script': \"urn:oasis:names:tc:opendocument:xmlns:script:1.0\",\n\t\t\t'xmlns:ooo': \"http://openoffice.org/2004/office\",\n\t\t\t'xmlns:ooow': \"http://openoffice.org/2004/writer\",\n\t\t\t'xmlns:oooc': \"http://openoffice.org/2004/calc\",\n\t\t\t'xmlns:dom': \"http://www.w3.org/2001/xml-events\",\n\t\t\t'xmlns:xforms': \"http://www.w3.org/2002/xforms\",\n\t\t\t'xmlns:xsd': \"http://www.w3.org/2001/XMLSchema\",\n\t\t\t'xmlns:xsi': \"http://www.w3.org/2001/XMLSchema-instance\",\n\t\t\t'xmlns:sheet': \"urn:oasis:names:tc:opendocument:sh33tjs:1.0\",\n\t\t\t'xmlns:rpt': \"http://openoffice.org/2005/report\",\n\t\t\t'xmlns:of': \"urn:oasis:names:tc:opendocument:xmlns:of:1.2\",\n\t\t\t'xmlns:xhtml': \"http://www.w3.org/1999/xhtml\",\n\t\t\t'xmlns:grddl': \"http://www.w3.org/2003/g/data-view#\",\n\t\t\t'xmlns:tableooo': \"http://openoffice.org/2009/table\",\n\t\t\t'xmlns:drawooo': \"http://openoffice.org/2010/draw\",\n\t\t\t'xmlns:calcext': \"urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0\",\n\t\t\t'xmlns:loext': \"urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0\",\n\t\t\t'xmlns:field': \"urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0\",\n\t\t\t'xmlns:formx': \"urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0\",\n\t\t\t'xmlns:css3t': \"http://www.w3.org/TR/css3-text/\",\n\t\t\t'office:version': \"1.2\"\n\t\t});\n\n\t\tvar fods = wxt_helper({\n\t\t\t'xmlns:config': \"urn:oasis:names:tc:opendocument:xmlns:config:1.0\",\n\t\t\t'office:mimetype': \"application/vnd.oasis.opendocument.spreadsheet\"\n\t\t});\n\n\t\tif(opts.bookType == \"fods\") {\n\t\t\to.push('\\n');\n\t\t\to.push(write_meta_ods().replace(/]*?>/, \"\").replace(/<\\/office:document-meta>/, \"\") + \"\\n\");\n\t\t\t// TODO: settings (equiv of settings.xml for ODS)\n\t\t} else o.push('\\n');\n\t\t// o.push(' \\n');\n\t\tvar nfs = write_automatic_styles_ods(o, wb);\n\t\to.push(' \\n');\n\t\to.push(' \\n');\n\t\tif(((wb.Workbook||{}).WBProps||{}).date1904) o.push(' \\n \\n \\n');\n\t\tfor(var i = 0; i != wb.SheetNames.length; ++i) o.push(write_ws(wb.Sheets[wb.SheetNames[i]], wb, i, opts, nfs, ((wb.Workbook||{}).WBProps||{}).date1904));\n\t\tif((wb.Workbook||{}).Names) o.push(write_names_ods(wb.Workbook.Names, wb.SheetNames, -1));\n\t\to.push(' \\n');\n\t\to.push(' \\n');\n\t\tif(opts.bookType == \"fods\") o.push('');\n\t\telse o.push('');\n\t\treturn o.join(\"\");\n\t};\n})();\n\nfunction write_ods(wb/*:any*/, opts/*:any*/) {\n\tif(opts.bookType == \"fods\") return write_content_ods(wb, opts);\n\n\tvar zip = zip_new();\n\tvar f = \"\";\n\n\tvar manifest/*:Array >*/ = [];\n\tvar rdf/*:Array<[string, string]>*/ = [];\n\n\t/* Part 3 Section 3.3 MIME Media Type */\n\tf = \"mimetype\";\n\tzip_add_file(zip, f, \"application/vnd.oasis.opendocument.spreadsheet\");\n\n\t/* Part 1 Section 2.2 Documents */\n\tf = \"content.xml\";\n\tzip_add_file(zip, f, write_content_ods(wb, opts));\n\tmanifest.push([f, \"text/xml\"]);\n\trdf.push([f, \"ContentFile\"]);\n\n\t/* TODO: these are hard-coded styles to satiate excel */\n\tf = \"styles.xml\";\n\tzip_add_file(zip, f, write_styles_ods(wb, opts));\n\tmanifest.push([f, \"text/xml\"]);\n\trdf.push([f, \"StylesFile\"]);\n\n\t/* TODO: this is hard-coded to satiate excel */\n\tf = \"meta.xml\";\n\tzip_add_file(zip, f, XML_HEADER + write_meta_ods(/*::wb, opts*/));\n\tmanifest.push([f, \"text/xml\"]);\n\trdf.push([f, \"MetadataFile\"]);\n\n\t/* Part 3 Section 6 Metadata Manifest File */\n\tf = \"manifest.rdf\";\n\tzip_add_file(zip, f, write_rdf(rdf/*, opts*/));\n\tmanifest.push([f, \"application/rdf+xml\"]);\n\n\t/* Part 3 Section 4 Manifest File */\n\tf = \"META-INF/manifest.xml\";\n\tzip_add_file(zip, f, write_manifest(manifest/*, opts*/));\n\n\treturn zip;\n}\n\n/*! sheetjs (C) 2013-present SheetJS -- http://sheetjs.com */\nvar subarray = function() {\n try {\n if (typeof Uint8Array == \"undefined\")\n return \"slice\";\n if (typeof Uint8Array.prototype.subarray == \"undefined\")\n return \"slice\";\n if (typeof Buffer !== \"undefined\") {\n if (typeof Buffer.prototype.subarray == \"undefined\")\n return \"slice\";\n if ((typeof Buffer.from == \"function\" ? Buffer.from([72, 62]) : new Buffer([72, 62])) instanceof Uint8Array)\n return \"subarray\";\n return \"slice\";\n }\n return \"subarray\";\n } catch (e) {\n return \"slice\";\n }\n}();\nfunction u8_to_dataview(array) {\n return new DataView(array.buffer, array.byteOffset, array.byteLength);\n}\nfunction u8str(u8) {\n return typeof TextDecoder != \"undefined\" ? new TextDecoder().decode(u8) : utf8read(a2s(u8));\n}\nfunction stru8(str) {\n return typeof TextEncoder != \"undefined\" ? new TextEncoder().encode(str) : s2a(utf8write(str));\n}\nfunction u8concat(u8a) {\n var len = 0;\n for (var i = 0; i < u8a.length; ++i)\n len += u8a[i].length;\n var out = new Uint8Array(len);\n var off = 0;\n for (i = 0; i < u8a.length; ++i) {\n var u8 = u8a[i], L = u8.length;\n if (L < 250) {\n for (var j = 0; j < L; ++j)\n out[off++] = u8[j];\n } else {\n out.set(u8, off);\n off += L;\n }\n }\n return out;\n}\nfunction popcnt(x) {\n x -= x >> 1 & 1431655765;\n x = (x & 858993459) + (x >> 2 & 858993459);\n return (x + (x >> 4) & 252645135) * 16843009 >>> 24;\n}\nfunction readDecimal128LE(buf, offset) {\n var exp = (buf[offset + 15] & 127) << 7 | buf[offset + 14] >> 1;\n var mantissa = buf[offset + 14] & 1;\n for (var j = offset + 13; j >= offset; --j)\n mantissa = mantissa * 256 + buf[j];\n return (buf[offset + 15] & 128 ? -mantissa : mantissa) * Math.pow(10, exp - 6176);\n}\nfunction writeDecimal128LE(buf, offset, value) {\n var exp = Math.floor(value == 0 ? 0 : Math.LOG10E * Math.log(Math.abs(value))) + 6176 - 16;\n var mantissa = value / Math.pow(10, exp - 6176);\n buf[offset + 15] |= exp >> 7;\n buf[offset + 14] |= (exp & 127) << 1;\n for (var i = 0; mantissa >= 1; ++i, mantissa /= 256)\n buf[offset + i] = mantissa & 255;\n buf[offset + 15] |= value >= 0 ? 0 : 128;\n}\nfunction parse_varint49(buf, ptr) {\n var l = ptr.l;\n var usz = buf[l] & 127;\n varint:\n if (buf[l++] >= 128) {\n usz |= (buf[l] & 127) << 7;\n if (buf[l++] < 128)\n break varint;\n usz |= (buf[l] & 127) << 14;\n if (buf[l++] < 128)\n break varint;\n usz |= (buf[l] & 127) << 21;\n if (buf[l++] < 128)\n break varint;\n usz += (buf[l] & 127) * Math.pow(2, 28);\n ++l;\n if (buf[l++] < 128)\n break varint;\n usz += (buf[l] & 127) * Math.pow(2, 35);\n ++l;\n if (buf[l++] < 128)\n break varint;\n usz += (buf[l] & 127) * Math.pow(2, 42);\n ++l;\n if (buf[l++] < 128)\n break varint;\n }\n ptr.l = l;\n return usz;\n}\nfunction write_varint49(v) {\n var usz = new Uint8Array(7);\n usz[0] = v & 127;\n var L = 1;\n sz:\n if (v > 127) {\n usz[L - 1] |= 128;\n usz[L] = v >> 7 & 127;\n ++L;\n if (v <= 16383)\n break sz;\n usz[L - 1] |= 128;\n usz[L] = v >> 14 & 127;\n ++L;\n if (v <= 2097151)\n break sz;\n usz[L - 1] |= 128;\n usz[L] = v >> 21 & 127;\n ++L;\n if (v <= 268435455)\n break sz;\n usz[L - 1] |= 128;\n usz[L] = v / 256 >>> 21 & 127;\n ++L;\n if (v <= 34359738367)\n break sz;\n usz[L - 1] |= 128;\n usz[L] = v / 65536 >>> 21 & 127;\n ++L;\n if (v <= 4398046511103)\n break sz;\n usz[L - 1] |= 128;\n usz[L] = v / 16777216 >>> 21 & 127;\n ++L;\n }\n return usz[subarray](0, L);\n}\nfunction parse_packed_varints(buf) {\n var ptr = { l: 0 };\n var out = [];\n while (ptr.l < buf.length)\n out.push(parse_varint49(buf, ptr));\n return out;\n}\nfunction write_packed_varints(nums) {\n return u8concat(nums.map(function(x) {\n return write_varint49(x);\n }));\n}\nfunction varint_to_i32(buf) {\n var l = 0, i32 = buf[l] & 127;\n if (buf[l++] < 128)\n return i32;\n i32 |= (buf[l] & 127) << 7;\n if (buf[l++] < 128)\n return i32;\n i32 |= (buf[l] & 127) << 14;\n if (buf[l++] < 128)\n return i32;\n i32 |= (buf[l] & 127) << 21;\n if (buf[l++] < 128)\n return i32;\n i32 |= (buf[l] & 15) << 28;\n return i32;\n}\nfunction varint_to_u64(buf) {\n var l = 0, lo = buf[l] & 127, hi = 0;\n varint:\n if (buf[l++] >= 128) {\n lo |= (buf[l] & 127) << 7;\n if (buf[l++] < 128)\n break varint;\n lo |= (buf[l] & 127) << 14;\n if (buf[l++] < 128)\n break varint;\n lo |= (buf[l] & 127) << 21;\n if (buf[l++] < 128)\n break varint;\n lo |= (buf[l] & 127) << 28;\n hi = buf[l] >> 4 & 7;\n if (buf[l++] < 128)\n break varint;\n hi |= (buf[l] & 127) << 3;\n if (buf[l++] < 128)\n break varint;\n hi |= (buf[l] & 127) << 10;\n if (buf[l++] < 128)\n break varint;\n hi |= (buf[l] & 127) << 17;\n if (buf[l++] < 128)\n break varint;\n hi |= (buf[l] & 127) << 24;\n if (buf[l++] < 128)\n break varint;\n hi |= (buf[l] & 127) << 31;\n }\n return [lo >>> 0, hi >>> 0];\n}\nfunction parse_shallow(buf) {\n var out = [], ptr = { l: 0 };\n while (ptr.l < buf.length) {\n var off = ptr.l;\n var num = parse_varint49(buf, ptr);\n var type = num & 7;\n num = num / 8 | 0;\n var data;\n var l = ptr.l;\n switch (type) {\n case 0:\n {\n while (buf[l++] >= 128)\n ;\n data = buf[subarray](ptr.l, l);\n ptr.l = l;\n }\n break;\n case 1:\n {\n data = buf[subarray](l, l + 8);\n ptr.l = l + 8;\n }\n break;\n case 2:\n {\n var len = parse_varint49(buf, ptr);\n data = buf[subarray](ptr.l, ptr.l + len);\n ptr.l += len;\n }\n break;\n case 5:\n {\n data = buf[subarray](l, l + 4);\n ptr.l = l + 4;\n }\n break;\n default:\n throw new Error(\"PB Type \".concat(type, \" for Field \").concat(num, \" at offset \").concat(off));\n }\n var v = { data: data, type: type };\n if (out[num] == null)\n out[num] = [];\n out[num].push(v);\n }\n return out;\n}\nfunction write_shallow(proto) {\n var out = [];\n proto.forEach(function(field, idx) {\n if (idx == 0)\n return;\n field.forEach(function(item) {\n if (!item.data)\n return;\n out.push(write_varint49(idx * 8 + item.type));\n if (item.type == 2)\n out.push(write_varint49(item.data.length));\n out.push(item.data);\n });\n });\n return u8concat(out);\n}\nfunction mappa(data, cb) {\n return (data == null ? void 0 : data.map(function(d) {\n return cb(d.data);\n })) || [];\n}\nfunction parse_iwa_file(buf) {\n var _a;\n var out = [], ptr = { l: 0 };\n while (ptr.l < buf.length) {\n var len = parse_varint49(buf, ptr);\n var ai = parse_shallow(buf[subarray](ptr.l, ptr.l + len));\n ptr.l += len;\n var res = {\n id: varint_to_i32(ai[1][0].data),\n messages: []\n };\n ai[2].forEach(function(b) {\n var mi = parse_shallow(b.data);\n var fl = varint_to_i32(mi[3][0].data);\n res.messages.push({\n meta: mi,\n data: buf[subarray](ptr.l, ptr.l + fl)\n });\n ptr.l += fl;\n });\n if ((_a = ai[3]) == null ? void 0 : _a[0])\n res.merge = varint_to_i32(ai[3][0].data) >>> 0 > 0;\n out.push(res);\n }\n return out;\n}\nfunction write_iwa_file(ias) {\n var bufs = [];\n ias.forEach(function(ia) {\n var ai = [\n [],\n [{ data: write_varint49(ia.id), type: 0 }],\n []\n ];\n if (ia.merge != null)\n ai[3] = [{ data: write_varint49(+!!ia.merge), type: 0 }];\n var midata = [];\n ia.messages.forEach(function(mi) {\n midata.push(mi.data);\n mi.meta[3] = [{ type: 0, data: write_varint49(mi.data.length) }];\n ai[2].push({ data: write_shallow(mi.meta), type: 2 });\n });\n var aipayload = write_shallow(ai);\n bufs.push(write_varint49(aipayload.length));\n bufs.push(aipayload);\n midata.forEach(function(mid) {\n return bufs.push(mid);\n });\n });\n return u8concat(bufs);\n}\nfunction parse_snappy_chunk(type, buf) {\n if (type != 0)\n throw new Error(\"Unexpected Snappy chunk type \".concat(type));\n var ptr = { l: 0 };\n var usz = parse_varint49(buf, ptr);\n var chunks = [];\n var l = ptr.l;\n while (l < buf.length) {\n var tag = buf[l] & 3;\n if (tag == 0) {\n var len = buf[l++] >> 2;\n if (len < 60)\n ++len;\n else {\n var c = len - 59;\n len = buf[l];\n if (c > 1)\n len |= buf[l + 1] << 8;\n if (c > 2)\n len |= buf[l + 2] << 16;\n if (c > 3)\n len |= buf[l + 3] << 24;\n len >>>= 0;\n len++;\n l += c;\n }\n chunks.push(buf[subarray](l, l + len));\n l += len;\n continue;\n } else {\n var offset = 0, length = 0;\n if (tag == 1) {\n length = (buf[l] >> 2 & 7) + 4;\n offset = (buf[l++] & 224) << 3;\n offset |= buf[l++];\n } else {\n length = (buf[l++] >> 2) + 1;\n if (tag == 2) {\n offset = buf[l] | buf[l + 1] << 8;\n l += 2;\n } else {\n offset = (buf[l] | buf[l + 1] << 8 | buf[l + 2] << 16 | buf[l + 3] << 24) >>> 0;\n l += 4;\n }\n }\n if (offset == 0)\n throw new Error(\"Invalid offset 0\");\n var j = chunks.length - 1, off = offset;\n while (j >= 0 && off >= chunks[j].length) {\n off -= chunks[j].length;\n --j;\n }\n if (j < 0) {\n if (off == 0)\n off = chunks[j = 0].length;\n else\n throw new Error(\"Invalid offset beyond length\");\n }\n if (length < off)\n chunks.push(chunks[j][subarray](chunks[j].length - off, chunks[j].length - off + length));\n else {\n if (off > 0) {\n chunks.push(chunks[j][subarray](chunks[j].length - off));\n length -= off;\n }\n ++j;\n while (length >= chunks[j].length) {\n chunks.push(chunks[j]);\n length -= chunks[j].length;\n ++j;\n }\n if (length)\n chunks.push(chunks[j][subarray](0, length));\n }\n if (chunks.length > 25)\n chunks = [u8concat(chunks)];\n }\n }\n var clen = 0;\n for (var u8i = 0; u8i < chunks.length; ++u8i)\n clen += chunks[u8i].length;\n if (clen != usz)\n throw new Error(\"Unexpected length: \".concat(clen, \" != \").concat(usz));\n return chunks;\n}\nfunction decompress_iwa_file(buf) {\n if (Array.isArray(buf))\n buf = new Uint8Array(buf);\n var out = [];\n var l = 0;\n while (l < buf.length) {\n var t = buf[l++];\n var len = buf[l] | buf[l + 1] << 8 | buf[l + 2] << 16;\n l += 3;\n out.push.apply(out, parse_snappy_chunk(t, buf[subarray](l, l + len)));\n l += len;\n }\n if (l !== buf.length)\n throw new Error(\"data is not a valid framed stream!\");\n return out.length == 1 ? out[0] : u8concat(out);\n}\nfunction compress_iwa_file(buf) {\n var out = [];\n var l = 0;\n while (l < buf.length) {\n var c = Math.min(buf.length - l, 268435455);\n var frame = new Uint8Array(4);\n out.push(frame);\n var usz = write_varint49(c);\n var L = usz.length;\n out.push(usz);\n if (c <= 60) {\n L++;\n out.push(new Uint8Array([c - 1 << 2]));\n } else if (c <= 256) {\n L += 2;\n out.push(new Uint8Array([240, c - 1 & 255]));\n } else if (c <= 65536) {\n L += 3;\n out.push(new Uint8Array([244, c - 1 & 255, c - 1 >> 8 & 255]));\n } else if (c <= 16777216) {\n L += 4;\n out.push(new Uint8Array([248, c - 1 & 255, c - 1 >> 8 & 255, c - 1 >> 16 & 255]));\n } else if (c <= 4294967296) {\n L += 5;\n out.push(new Uint8Array([252, c - 1 & 255, c - 1 >> 8 & 255, c - 1 >> 16 & 255, c - 1 >>> 24 & 255]));\n }\n out.push(buf[subarray](l, l + c));\n L += c;\n frame[0] = 0;\n frame[1] = L & 255;\n frame[2] = L >> 8 & 255;\n frame[3] = L >> 16 & 255;\n l += c;\n }\n return u8concat(out);\n}\nvar numbers_lut_new = function() {\n return { sst: [], rsst: [], ofmt: [], nfmt: [], fmla: [], ferr: [], cmnt: [] };\n};\nfunction numbers_format_cell(cell, t, flags, ofmt, nfmt) {\n var _a, _b, _c, _d;\n var ctype = t & 255, ver = t >> 8;\n var fmt = ver >= 5 ? nfmt : ofmt;\n dur:\n if (flags & (ver > 4 ? 8 : 4) && cell.t == \"n\" && ctype == 7) {\n var dstyle = ((_a = fmt[7]) == null ? void 0 : _a[0]) ? varint_to_i32(fmt[7][0].data) : -1;\n if (dstyle == -1)\n break dur;\n var dmin = ((_b = fmt[15]) == null ? void 0 : _b[0]) ? varint_to_i32(fmt[15][0].data) : -1;\n var dmax = ((_c = fmt[16]) == null ? void 0 : _c[0]) ? varint_to_i32(fmt[16][0].data) : -1;\n var auto = ((_d = fmt[40]) == null ? void 0 : _d[0]) ? varint_to_i32(fmt[40][0].data) : -1;\n var d = cell.v, dd = d;\n autodur:\n if (auto) {\n if (d == 0) {\n dmin = dmax = 2;\n break autodur;\n }\n if (d >= 604800)\n dmin = 1;\n else if (d >= 86400)\n dmin = 2;\n else if (d >= 3600)\n dmin = 4;\n else if (d >= 60)\n dmin = 8;\n else if (d >= 1)\n dmin = 16;\n else\n dmin = 32;\n if (Math.floor(d) != d)\n dmax = 32;\n else if (d % 60)\n dmax = 16;\n else if (d % 3600)\n dmax = 8;\n else if (d % 86400)\n dmax = 4;\n else if (d % 604800)\n dmax = 2;\n if (dmax < dmin)\n dmax = dmin;\n }\n if (dmin == -1 || dmax == -1)\n break dur;\n var dstr = [], zstr = [];\n if (dmin == 1) {\n dd = d / 604800;\n if (dmax == 1) {\n zstr.push('d\"d\"');\n } else {\n dd |= 0;\n d -= 604800 * dd;\n }\n dstr.push(dd + (dstyle == 2 ? \" week\" + (dd == 1 ? \"\" : \"s\") : dstyle == 1 ? \"w\" : \"\"));\n }\n if (dmin <= 2 && dmax >= 2) {\n dd = d / 86400;\n if (dmax > 2) {\n dd |= 0;\n d -= 86400 * dd;\n }\n zstr.push('d\"d\"');\n dstr.push(dd + (dstyle == 2 ? \" day\" + (dd == 1 ? \"\" : \"s\") : dstyle == 1 ? \"d\" : \"\"));\n }\n if (dmin <= 4 && dmax >= 4) {\n dd = d / 3600;\n if (dmax > 4) {\n dd |= 0;\n d -= 3600 * dd;\n }\n zstr.push((dmin >= 4 ? \"[h]\" : \"h\") + '\"h\"');\n dstr.push(dd + (dstyle == 2 ? \" hour\" + (dd == 1 ? \"\" : \"s\") : dstyle == 1 ? \"h\" : \"\"));\n }\n if (dmin <= 8 && dmax >= 8) {\n dd = d / 60;\n if (dmax > 8) {\n dd |= 0;\n d -= 60 * dd;\n }\n zstr.push((dmin >= 8 ? \"[m]\" : \"m\") + '\"m\"');\n if (dstyle == 0)\n dstr.push((dmin == 8 && dmax == 8 || dd >= 10 ? \"\" : \"0\") + dd);\n else\n dstr.push(dd + (dstyle == 2 ? \" minute\" + (dd == 1 ? \"\" : \"s\") : dstyle == 1 ? \"m\" : \"\"));\n }\n if (dmin <= 16 && dmax >= 16) {\n dd = d;\n if (dmax > 16) {\n dd |= 0;\n d -= dd;\n }\n zstr.push((dmin >= 16 ? \"[s]\" : \"s\") + '\"s\"');\n if (dstyle == 0)\n dstr.push((dmax == 16 && dmin == 16 || dd >= 10 ? \"\" : \"0\") + dd);\n else\n dstr.push(dd + (dstyle == 2 ? \" second\" + (dd == 1 ? \"\" : \"s\") : dstyle == 1 ? \"s\" : \"\"));\n }\n if (dmax >= 32) {\n dd = Math.round(1e3 * d);\n if (dmin < 32)\n zstr.push('.000\"ms\"');\n if (dstyle == 0)\n dstr.push((dd >= 100 ? \"\" : dd >= 10 ? \"0\" : \"00\") + dd);\n else\n dstr.push(dd + (dstyle == 2 ? \" millisecond\" + (dd == 1 ? \"\" : \"s\") : dstyle == 1 ? \"ms\" : \"\"));\n }\n cell.w = dstr.join(dstyle == 0 ? \":\" : \" \");\n cell.z = zstr.join(dstyle == 0 ? '\":\"' : \" \");\n if (dstyle == 0)\n cell.w = cell.w.replace(/:(\\d\\d\\d)$/, \".$1\");\n }\n}\nfunction parse_old_storage(buf, lut, v, opts) {\n var dv = u8_to_dataview(buf);\n var flags = dv.getUint32(4, true);\n var ridx = -1, sidx = -1, zidx = -1, ieee = NaN, dc = 0, dt = new Date(Date.UTC(2001, 0, 1));\n var doff = v > 1 ? 12 : 8;\n if (flags & 2) {\n zidx = dv.getUint32(doff, true);\n doff += 4;\n }\n doff += popcnt(flags & (v > 1 ? 3468 : 396)) * 4;\n if (flags & 512) {\n ridx = dv.getUint32(doff, true);\n doff += 4;\n }\n doff += popcnt(flags & (v > 1 ? 12288 : 4096)) * 4;\n if (flags & 16) {\n sidx = dv.getUint32(doff, true);\n doff += 4;\n }\n if (flags & 32) {\n ieee = dv.getFloat64(doff, true);\n doff += 8;\n }\n if (flags & 64) {\n dt.setTime(dt.getTime() + (dc = dv.getFloat64(doff, true)) * 1e3);\n doff += 8;\n }\n if (v > 1) {\n flags = dv.getUint32(8, true) >>> 16;\n if (flags & 255) {\n if (zidx == -1)\n zidx = dv.getUint32(doff, true);\n doff += 4;\n }\n }\n var ret;\n var t = buf[v >= 4 ? 1 : 2];\n switch (t) {\n case 0:\n return void 0;\n case 2:\n ret = { t: \"n\", v: ieee };\n break;\n case 3:\n ret = { t: \"s\", v: lut.sst[sidx] };\n break;\n case 5:\n {\n if (opts == null ? void 0 : opts.cellDates)\n ret = { t: \"d\", v: dt };\n else\n ret = { t: \"n\", v: dc / 86400 + 35430, z: table_fmt[14] };\n }\n break;\n case 6:\n ret = { t: \"b\", v: ieee > 0 };\n break;\n case 7:\n ret = { t: \"n\", v: ieee };\n break;\n case 8:\n ret = { t: \"e\", v: 0 };\n break;\n case 9:\n {\n if (ridx > -1) {\n var rts = lut.rsst[ridx];\n ret = { t: \"s\", v: rts.v };\n if (rts.l)\n ret.l = { Target: rts.l };\n } else\n throw new Error(\"Unsupported cell type \".concat(buf[subarray](0, 4)));\n }\n break;\n default:\n throw new Error(\"Unsupported cell type \".concat(buf[subarray](0, 4)));\n }\n if (zidx > -1)\n numbers_format_cell(ret, t | v << 8, flags, lut.ofmt[zidx], lut.nfmt[zidx]);\n if (t == 7)\n ret.v /= 86400;\n return ret;\n}\nfunction parse_new_storage(buf, lut, opts) {\n var dv = u8_to_dataview(buf);\n var flags = dv.getUint32(4, true);\n var fields = dv.getUint32(8, true);\n var doff = 12;\n var ridx = -1, sidx = -1, zidx = -1, d128 = NaN, ieee = NaN, dc = 0, dt = new Date(Date.UTC(2001, 0, 1)), eidx = -1, fidx = -1;\n if (fields & 1) {\n d128 = readDecimal128LE(buf, doff);\n doff += 16;\n }\n if (fields & 2) {\n ieee = dv.getFloat64(doff, true);\n doff += 8;\n }\n if (fields & 4) {\n dt.setTime(dt.getTime() + (dc = dv.getFloat64(doff, true)) * 1e3);\n doff += 8;\n }\n if (fields & 8) {\n sidx = dv.getUint32(doff, true);\n doff += 4;\n }\n if (fields & 16) {\n ridx = dv.getUint32(doff, true);\n doff += 4;\n }\n doff += popcnt(fields & 480) * 4;\n if (fields & 512) {\n fidx = dv.getUint32(doff, true);\n doff += 4;\n }\n doff += popcnt(fields & 1024) * 4;\n if (fields & 2048) {\n eidx = dv.getUint32(doff, true);\n doff += 4;\n }\n var ret;\n var t = buf[1];\n switch (t) {\n case 0:\n ret = { t: \"z\" };\n break;\n case 2:\n ret = { t: \"n\", v: d128 };\n break;\n case 3:\n ret = { t: \"s\", v: lut.sst[sidx] };\n break;\n case 5:\n {\n if (opts == null ? void 0 : opts.cellDates)\n ret = { t: \"d\", v: dt };\n else\n ret = { t: \"n\", v: dc / 86400 + 35430, z: table_fmt[14] };\n }\n break;\n case 6:\n ret = { t: \"b\", v: ieee > 0 };\n break;\n case 7:\n ret = { t: \"n\", v: ieee };\n break;\n case 8:\n ret = { t: \"e\", v: 0 };\n break;\n case 9:\n {\n if (ridx > -1) {\n var rts = lut.rsst[ridx];\n ret = { t: \"s\", v: rts.v };\n if (rts.l)\n ret.l = { Target: rts.l };\n } else\n throw new Error(\"Unsupported cell type \".concat(buf[1], \" : \").concat(fields & 31, \" : \").concat(buf[subarray](0, 4)));\n }\n break;\n case 10:\n ret = { t: \"n\", v: d128 };\n break;\n default:\n throw new Error(\"Unsupported cell type \".concat(buf[1], \" : \").concat(fields & 31, \" : \").concat(buf[subarray](0, 4)));\n }\n doff += popcnt(fields & 4096) * 4;\n if (fields & 516096) {\n if (zidx == -1)\n zidx = dv.getUint32(doff, true);\n doff += 4;\n }\n if (fields & 524288) {\n var cmntidx = dv.getUint32(doff, true);\n doff += 4;\n if (lut.cmnt[cmntidx])\n ret.c = iwa_to_s5s_comment(lut.cmnt[cmntidx]);\n }\n if (zidx > -1)\n numbers_format_cell(ret, t | 5 << 8, fields >> 13, lut.ofmt[zidx], lut.nfmt[zidx]);\n if (t == 7)\n ret.v /= 86400;\n return ret;\n}\nfunction write_new_storage(cell, lut) {\n var out = new Uint8Array(32), dv = u8_to_dataview(out), l = 12, fields = 0;\n out[0] = 5;\n switch (cell.t) {\n case \"n\":\n if (cell.z && fmt_is_date(cell.z)) {\n out[1] = 5;\n dv.setFloat64(l, (numdate(cell.v + 1462).getTime() - Date.UTC(2001, 0, 1)) / 1e3, true);\n fields |= 4;\n l += 8;\n break;\n } else {\n out[1] = 2;\n writeDecimal128LE(out, l, cell.v);\n fields |= 1;\n l += 16;\n }\n break;\n case \"b\":\n out[1] = 6;\n dv.setFloat64(l, cell.v ? 1 : 0, true);\n fields |= 2;\n l += 8;\n break;\n case \"s\":\n {\n var s = cell.v == null ? \"\" : String(cell.v);\n if (cell.l) {\n var irsst = lut.rsst.findIndex(function(v) {\n var _a;\n return v.v == s && v.l == ((_a = cell.l) == null ? void 0 : _a.Target);\n });\n if (irsst == -1)\n lut.rsst[irsst = lut.rsst.length] = { v: s, l: cell.l.Target };\n out[1] = 9;\n dv.setUint32(l, irsst, true);\n fields |= 16;\n l += 4;\n } else {\n var isst = lut.sst.indexOf(s);\n if (isst == -1)\n lut.sst[isst = lut.sst.length] = s;\n out[1] = 3;\n dv.setUint32(l, isst, true);\n fields |= 8;\n l += 4;\n }\n }\n break;\n case \"d\":\n out[1] = 5;\n dv.setFloat64(l, (cell.v.getTime() - Date.UTC(2001, 0, 1)) / 1e3, true);\n fields |= 4;\n l += 8;\n break;\n case \"z\":\n out[1] = 0;\n break;\n default:\n throw \"unsupported cell type \" + cell.t;\n }\n if (cell.c) {\n lut.cmnt.push(s5s_to_iwa_comment(cell.c));\n dv.setUint32(l, lut.cmnt.length - 1, true);\n fields |= 524288;\n l += 4;\n }\n dv.setUint32(8, fields, true);\n return out[subarray](0, l);\n}\nfunction write_old_storage(cell, lut) {\n var out = new Uint8Array(32), dv = u8_to_dataview(out), l = 12, fields = 0, s = \"\";\n out[0] = 4;\n switch (cell.t) {\n case \"n\":\n break;\n case \"b\":\n break;\n case \"s\":\n {\n s = cell.v == null ? \"\" : String(cell.v);\n if (cell.l) {\n var irsst = lut.rsst.findIndex(function(v) {\n var _a;\n return v.v == s && v.l == ((_a = cell.l) == null ? void 0 : _a.Target);\n });\n if (irsst == -1)\n lut.rsst[irsst = lut.rsst.length] = { v: s, l: cell.l.Target };\n out[1] = 9;\n dv.setUint32(l, irsst, true);\n fields |= 512;\n l += 4;\n } else {\n }\n }\n break;\n case \"d\":\n break;\n case \"e\":\n break;\n case \"z\":\n break;\n default:\n throw \"unsupported cell type \" + cell.t;\n }\n if (cell.c) {\n dv.setUint32(l, lut.cmnt.length - 1, true);\n fields |= 4096;\n l += 4;\n }\n switch (cell.t) {\n case \"n\":\n out[1] = 2;\n dv.setFloat64(l, cell.v, true);\n fields |= 32;\n l += 8;\n break;\n case \"b\":\n out[1] = 6;\n dv.setFloat64(l, cell.v ? 1 : 0, true);\n fields |= 32;\n l += 8;\n break;\n case \"s\":\n {\n s = cell.v == null ? \"\" : String(cell.v);\n if (cell.l) {\n } else {\n var isst = lut.sst.indexOf(s);\n if (isst == -1)\n lut.sst[isst = lut.sst.length] = s;\n out[1] = 3;\n dv.setUint32(l, isst, true);\n fields |= 16;\n l += 4;\n }\n }\n break;\n case \"d\":\n out[1] = 5;\n dv.setFloat64(l, (cell.v.getTime() - Date.UTC(2001, 0, 1)) / 1e3, true);\n fields |= 64;\n l += 8;\n break;\n case \"z\":\n out[1] = 0;\n break;\n default:\n throw \"unsupported cell type \" + cell.t;\n }\n dv.setUint32(8, fields, true);\n return out[subarray](0, l);\n}\nfunction parse_cell_storage(buf, lut, opts) {\n switch (buf[0]) {\n case 0:\n case 1:\n case 2:\n case 3:\n case 4:\n return parse_old_storage(buf, lut, buf[0], opts);\n case 5:\n return parse_new_storage(buf, lut, opts);\n default:\n throw new Error(\"Unsupported payload version \".concat(buf[0]));\n }\n}\nfunction parse_TSP_Reference(buf) {\n var pb = parse_shallow(buf);\n return varint_to_i32(pb[1][0].data);\n}\nfunction write_TSP_Reference(idx) {\n return write_shallow([\n [],\n [{ type: 0, data: write_varint49(idx) }]\n ]);\n}\nfunction numbers_add_oref(iwa, ref) {\n var _a;\n var orefs = ((_a = iwa.messages[0].meta[5]) == null ? void 0 : _a[0]) ? parse_packed_varints(iwa.messages[0].meta[5][0].data) : [];\n var orefidx = orefs.indexOf(ref);\n if (orefidx == -1) {\n orefs.push(ref);\n iwa.messages[0].meta[5] = [{ type: 2, data: write_packed_varints(orefs) }];\n }\n}\nfunction numbers_del_oref(iwa, ref) {\n var _a;\n var orefs = ((_a = iwa.messages[0].meta[5]) == null ? void 0 : _a[0]) ? parse_packed_varints(iwa.messages[0].meta[5][0].data) : [];\n iwa.messages[0].meta[5] = [{ type: 2, data: write_packed_varints(orefs.filter(function(r) {\n return r != ref;\n })) }];\n}\nfunction parse_TST_TableDataList(M, root) {\n var pb = parse_shallow(root.data);\n var type = varint_to_i32(pb[1][0].data);\n var entries = pb[3];\n var data = [];\n (entries || []).forEach(function(entry) {\n var _a, _b;\n var le = parse_shallow(entry.data);\n if (!le[1])\n return;\n var key = varint_to_i32(le[1][0].data) >>> 0;\n switch (type) {\n case 1:\n data[key] = u8str(le[3][0].data);\n break;\n case 8:\n {\n var rt = M[parse_TSP_Reference(le[9][0].data)][0];\n var rtp = parse_shallow(rt.data);\n var rtpref = M[parse_TSP_Reference(rtp[1][0].data)][0];\n var mtype = varint_to_i32(rtpref.meta[1][0].data);\n if (mtype != 2001)\n throw new Error(\"2000 unexpected reference to \".concat(mtype));\n var tswpsa = parse_shallow(rtpref.data);\n var richtext = { v: tswpsa[3].map(function(x) {\n return u8str(x.data);\n }).join(\"\") };\n data[key] = richtext;\n sfields:\n if ((_a = tswpsa == null ? void 0 : tswpsa[11]) == null ? void 0 : _a[0]) {\n var smartfields = (_b = parse_shallow(tswpsa[11][0].data)) == null ? void 0 : _b[1];\n if (!smartfields)\n break sfields;\n smartfields.forEach(function(sf) {\n var _a2, _b2, _c;\n var attr = parse_shallow(sf.data);\n if ((_a2 = attr[2]) == null ? void 0 : _a2[0]) {\n var obj = M[parse_TSP_Reference((_b2 = attr[2]) == null ? void 0 : _b2[0].data)][0];\n var objtype = varint_to_i32(obj.meta[1][0].data);\n switch (objtype) {\n case 2032:\n var hlink = parse_shallow(obj.data);\n if (((_c = hlink == null ? void 0 : hlink[2]) == null ? void 0 : _c[0]) && !richtext.l)\n richtext.l = u8str(hlink[2][0].data);\n break;\n case 2039:\n break;\n default:\n console.log(\"unrecognized ObjectAttribute type \".concat(objtype));\n }\n }\n });\n }\n }\n break;\n case 2:\n data[key] = parse_shallow(le[6][0].data);\n break;\n case 3:\n data[key] = parse_shallow(le[5][0].data);\n break;\n case 10:\n {\n var cs = M[parse_TSP_Reference(le[10][0].data)][0];\n data[key] = parse_TSD_CommentStorageArchive(M, cs.data);\n }\n break;\n default:\n throw type;\n }\n });\n return data;\n}\nfunction parse_TST_TileRowInfo(u8, type) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;\n var pb = parse_shallow(u8);\n var R = varint_to_i32(pb[1][0].data) >>> 0;\n var cnt = varint_to_i32(pb[2][0].data) >>> 0;\n var wide_offsets = ((_b = (_a = pb[8]) == null ? void 0 : _a[0]) == null ? void 0 : _b.data) && varint_to_i32(pb[8][0].data) > 0 || false;\n var used_storage_u8, used_storage;\n if (((_d = (_c = pb[7]) == null ? void 0 : _c[0]) == null ? void 0 : _d.data) && type != 0) {\n used_storage_u8 = (_f = (_e = pb[7]) == null ? void 0 : _e[0]) == null ? void 0 : _f.data;\n used_storage = (_h = (_g = pb[6]) == null ? void 0 : _g[0]) == null ? void 0 : _h.data;\n } else if (((_j = (_i = pb[4]) == null ? void 0 : _i[0]) == null ? void 0 : _j.data) && type != 1) {\n used_storage_u8 = (_l = (_k = pb[4]) == null ? void 0 : _k[0]) == null ? void 0 : _l.data;\n used_storage = (_n = (_m = pb[3]) == null ? void 0 : _m[0]) == null ? void 0 : _n.data;\n } else\n throw \"NUMBERS Tile missing \".concat(type, \" cell storage\");\n var width = wide_offsets ? 4 : 1;\n var used_storage_offsets = u8_to_dataview(used_storage_u8);\n var offsets = [];\n for (var C = 0; C < used_storage_u8.length / 2; ++C) {\n var off = used_storage_offsets.getUint16(C * 2, true);\n if (off < 65535)\n offsets.push([C, off]);\n }\n if (offsets.length != cnt)\n throw \"Expected \".concat(cnt, \" cells, found \").concat(offsets.length);\n var cells = [];\n for (C = 0; C < offsets.length - 1; ++C)\n cells[offsets[C][0]] = used_storage[subarray](offsets[C][1] * width, offsets[C + 1][1] * width);\n if (offsets.length >= 1)\n cells[offsets[offsets.length - 1][0]] = used_storage[subarray](offsets[offsets.length - 1][1] * width);\n return { R: R, cells: cells };\n}\nfunction parse_TST_Tile(M, root) {\n var _a;\n var pb = parse_shallow(root.data);\n var storage = -1;\n if ((_a = pb == null ? void 0 : pb[7]) == null ? void 0 : _a[0]) {\n if (varint_to_i32(pb[7][0].data) >>> 0)\n storage = 1;\n else\n storage = 0;\n }\n var ri = mappa(pb[5], function(u8) {\n return parse_TST_TileRowInfo(u8, storage);\n });\n return {\n nrows: varint_to_i32(pb[4][0].data) >>> 0,\n data: ri.reduce(function(acc, x) {\n if (!acc[x.R])\n acc[x.R] = [];\n x.cells.forEach(function(cell, C) {\n if (acc[x.R][C])\n throw new Error(\"Duplicate cell r=\".concat(x.R, \" c=\").concat(C));\n acc[x.R][C] = cell;\n });\n return acc;\n }, [])\n };\n}\nfunction parse_TSD_CommentStorageArchive(M, data) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;\n var out = { t: \"\", a: \"\" };\n var csp = parse_shallow(data);\n if ((_b = (_a = csp == null ? void 0 : csp[1]) == null ? void 0 : _a[0]) == null ? void 0 : _b.data)\n out.t = u8str((_d = (_c = csp == null ? void 0 : csp[1]) == null ? void 0 : _c[0]) == null ? void 0 : _d.data) || \"\";\n if ((_f = (_e = csp == null ? void 0 : csp[3]) == null ? void 0 : _e[0]) == null ? void 0 : _f.data) {\n var as = M[parse_TSP_Reference((_h = (_g = csp == null ? void 0 : csp[3]) == null ? void 0 : _g[0]) == null ? void 0 : _h.data)][0];\n var asp = parse_shallow(as.data);\n if ((_j = (_i = asp[1]) == null ? void 0 : _i[0]) == null ? void 0 : _j.data)\n out.a = u8str(asp[1][0].data);\n }\n if (csp == null ? void 0 : csp[4]) {\n out.replies = [];\n csp[4].forEach(function(pi) {\n var cs = M[parse_TSP_Reference(pi.data)][0];\n out.replies.push(parse_TSD_CommentStorageArchive(M, cs.data));\n });\n }\n return out;\n}\nfunction iwa_to_s5s_comment(iwa) {\n var out = [];\n out.push({ t: iwa.t || \"\", a: iwa.a, T: iwa.replies && iwa.replies.length > 0 });\n if (iwa.replies)\n iwa.replies.forEach(function(reply) {\n out.push({ t: reply.t || \"\", a: reply.a, T: true });\n });\n return out;\n}\nfunction s5s_to_iwa_comment(s5s) {\n var out = { a: \"\", t: \"\", replies: [] };\n for (var i = 0; i < s5s.length; ++i) {\n if (i == 0) {\n out.a = s5s[i].a;\n out.t = s5s[i].t;\n } else {\n out.replies.push({ a: s5s[i].a, t: s5s[i].t });\n }\n }\n return out;\n}\nfunction parse_TST_TableModelArchive(M, root, ws, opts) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;\n var pb = parse_shallow(root.data);\n var range = { s: { r: 0, c: 0 }, e: { r: 0, c: 0 } };\n range.e.r = (varint_to_i32(pb[6][0].data) >>> 0) - 1;\n if (range.e.r < 0)\n throw new Error(\"Invalid row varint \".concat(pb[6][0].data));\n range.e.c = (varint_to_i32(pb[7][0].data) >>> 0) - 1;\n if (range.e.c < 0)\n throw new Error(\"Invalid col varint \".concat(pb[7][0].data));\n ws[\"!ref\"] = encode_range(range);\n var dense = ws[\"!data\"] != null, dws = ws;\n var store = parse_shallow(pb[4][0].data);\n var lut = numbers_lut_new();\n if ((_a = store[4]) == null ? void 0 : _a[0])\n lut.sst = parse_TST_TableDataList(M, M[parse_TSP_Reference(store[4][0].data)][0]);\n if ((_b = store[6]) == null ? void 0 : _b[0])\n lut.fmla = parse_TST_TableDataList(M, M[parse_TSP_Reference(store[6][0].data)][0]);\n if ((_c = store[11]) == null ? void 0 : _c[0])\n lut.ofmt = parse_TST_TableDataList(M, M[parse_TSP_Reference(store[11][0].data)][0]);\n if ((_d = store[12]) == null ? void 0 : _d[0])\n lut.ferr = parse_TST_TableDataList(M, M[parse_TSP_Reference(store[12][0].data)][0]);\n if ((_e = store[17]) == null ? void 0 : _e[0])\n lut.rsst = parse_TST_TableDataList(M, M[parse_TSP_Reference(store[17][0].data)][0]);\n if ((_f = store[19]) == null ? void 0 : _f[0])\n lut.cmnt = parse_TST_TableDataList(M, M[parse_TSP_Reference(store[19][0].data)][0]);\n if ((_g = store[22]) == null ? void 0 : _g[0])\n lut.nfmt = parse_TST_TableDataList(M, M[parse_TSP_Reference(store[22][0].data)][0]);\n var tile = parse_shallow(store[3][0].data);\n var _R = 0;\n if (!((_h = store[9]) == null ? void 0 : _h[0]))\n throw \"NUMBERS file missing row tree\";\n var rtt = parse_shallow(store[9][0].data)[1].map(function(p) {\n return parse_shallow(p.data);\n });\n rtt.forEach(function(kv) {\n _R = varint_to_i32(kv[1][0].data);\n var tidx = varint_to_i32(kv[2][0].data);\n var t = tile[1][tidx];\n if (!t)\n throw \"NUMBERS missing tile \" + tidx;\n var tl = parse_shallow(t.data);\n var ref2 = M[parse_TSP_Reference(tl[2][0].data)][0];\n var mtype2 = varint_to_i32(ref2.meta[1][0].data);\n if (mtype2 != 6002)\n throw new Error(\"6001 unexpected reference to \".concat(mtype2));\n var _tile = parse_TST_Tile(M, ref2);\n _tile.data.forEach(function(row, R) {\n row.forEach(function(buf, C) {\n var res = parse_cell_storage(buf, lut, opts);\n if (res) {\n if (dense) {\n if (!dws[\"!data\"][_R + R])\n dws[\"!data\"][_R + R] = [];\n dws[\"!data\"][_R + R][C] = res;\n } else {\n ws[encode_col(C) + encode_row(_R + R)] = res;\n }\n }\n });\n });\n _R += _tile.nrows;\n });\n if ((_i = store[13]) == null ? void 0 : _i[0]) {\n var ref = M[parse_TSP_Reference(store[13][0].data)][0];\n var mtype = varint_to_i32(ref.meta[1][0].data);\n if (mtype != 6144)\n throw new Error(\"Expected merge type 6144, found \".concat(mtype));\n ws[\"!merges\"] = (_j = parse_shallow(ref.data)) == null ? void 0 : _j[1].map(function(pi) {\n var merge = parse_shallow(pi.data);\n var origin = u8_to_dataview(parse_shallow(merge[1][0].data)[1][0].data), size = u8_to_dataview(parse_shallow(merge[2][0].data)[1][0].data);\n return {\n s: { r: origin.getUint16(0, true), c: origin.getUint16(2, true) },\n e: {\n r: origin.getUint16(0, true) + size.getUint16(0, true) - 1,\n c: origin.getUint16(2, true) + size.getUint16(2, true) - 1\n }\n };\n });\n }\n if (!((_k = ws[\"!merges\"]) == null ? void 0 : _k.length) && ((_l = pb[47]) == null ? void 0 : _l[0])) {\n var merge_owner = parse_shallow(pb[47][0].data);\n if ((_m = merge_owner[2]) == null ? void 0 : _m[0]) {\n var formula_store = parse_shallow(merge_owner[2][0].data);\n if ((_n = formula_store[3]) == null ? void 0 : _n[0]) {\n ws[\"!merges\"] = mappa(formula_store[3], function(u) {\n var _a2, _b2, _c2, _d2, _e2;\n var formula_pair = parse_shallow(u);\n var formula = parse_shallow(formula_pair[2][0].data);\n var AST_node_array = parse_shallow(formula[1][0].data);\n if (!((_a2 = AST_node_array[1]) == null ? void 0 : _a2[0]))\n return;\n var AST_node0 = parse_shallow(AST_node_array[1][0].data);\n var AST_node_type = varint_to_i32(AST_node0[1][0].data);\n if (AST_node_type != 67)\n return;\n var AST_colon_tract = parse_shallow(AST_node0[40][0].data);\n if (!((_b2 = AST_colon_tract[3]) == null ? void 0 : _b2[0]) || !((_c2 = AST_colon_tract[4]) == null ? void 0 : _c2[0]))\n return;\n var colrange = parse_shallow(AST_colon_tract[3][0].data);\n var rowrange = parse_shallow(AST_colon_tract[4][0].data);\n var c = varint_to_i32(colrange[1][0].data);\n var C = ((_d2 = colrange[2]) == null ? void 0 : _d2[0]) ? varint_to_i32(colrange[2][0].data) : c;\n var r = varint_to_i32(rowrange[1][0].data);\n var R = ((_e2 = rowrange[2]) == null ? void 0 : _e2[0]) ? varint_to_i32(rowrange[2][0].data) : r;\n return { s: { r: r, c: c }, e: { r: R, c: C } };\n }).filter(function(x) {\n return x != null;\n });\n }\n }\n }\n}\nfunction parse_TST_TableInfoArchive(M, root, opts) {\n var pb = parse_shallow(root.data);\n var out = { \"!ref\": \"A1\" };\n if (opts == null ? void 0 : opts.dense)\n out[\"!data\"] = [];\n var tableref = M[parse_TSP_Reference(pb[2][0].data)];\n var mtype = varint_to_i32(tableref[0].meta[1][0].data);\n if (mtype != 6001)\n throw new Error(\"6000 unexpected reference to \".concat(mtype));\n parse_TST_TableModelArchive(M, tableref[0], out, opts);\n return out;\n}\nfunction parse_TN_SheetArchive(M, root, opts) {\n var _a;\n var pb = parse_shallow(root.data);\n var out = {\n name: ((_a = pb[1]) == null ? void 0 : _a[0]) ? u8str(pb[1][0].data) : \"\",\n sheets: []\n };\n var shapeoffs = mappa(pb[2], parse_TSP_Reference);\n shapeoffs.forEach(function(off) {\n M[off].forEach(function(m) {\n var mtype = varint_to_i32(m.meta[1][0].data);\n if (mtype == 6e3)\n out.sheets.push(parse_TST_TableInfoArchive(M, m, opts));\n });\n });\n return out;\n}\nfunction parse_TN_DocumentArchive(M, root, opts) {\n var _a;\n var out = book_new();\n out.Workbook = { WBProps: { date1904: true } };\n var pb = parse_shallow(root.data);\n if ((_a = pb[2]) == null ? void 0 : _a[0])\n throw new Error(\"Keynote presentations are not supported\");\n var sheetoffs = mappa(pb[1], parse_TSP_Reference);\n sheetoffs.forEach(function(off) {\n M[off].forEach(function(m) {\n var mtype = varint_to_i32(m.meta[1][0].data);\n if (mtype == 2) {\n var root2 = parse_TN_SheetArchive(M, m, opts);\n root2.sheets.forEach(function(sheet, idx) {\n book_append_sheet(out, sheet, idx == 0 ? root2.name : root2.name + \"_\" + idx, true);\n });\n }\n });\n });\n if (out.SheetNames.length == 0)\n throw new Error(\"Empty NUMBERS file\");\n out.bookType = \"numbers\";\n return out;\n}\nfunction parse_numbers_iwa(cfb, opts) {\n var _a, _b, _c, _d, _e, _f, _g;\n var M = {}, indices = [];\n cfb.FullPaths.forEach(function(p) {\n if (p.match(/\\.iwpv2/))\n throw new Error(\"Unsupported password protection\");\n });\n cfb.FileIndex.forEach(function(s) {\n if (!s.name.match(/\\.iwa$/))\n return;\n if (s.content[0] != 0)\n return;\n var o;\n try {\n o = decompress_iwa_file(s.content);\n } catch (e) {\n return console.log(\"?? \" + s.content.length + \" \" + (e.message || e));\n }\n var packets;\n try {\n packets = parse_iwa_file(o);\n } catch (e) {\n return console.log(\"## \" + (e.message || e));\n }\n packets.forEach(function(packet) {\n M[packet.id] = packet.messages;\n indices.push(packet.id);\n });\n });\n if (!indices.length)\n throw new Error(\"File has no messages\");\n if (((_c = (_b = (_a = M == null ? void 0 : M[1]) == null ? void 0 : _a[0].meta) == null ? void 0 : _b[1]) == null ? void 0 : _c[0].data) && varint_to_i32(M[1][0].meta[1][0].data) == 1e4)\n throw new Error(\"Pages documents are not supported\");\n var docroot = ((_g = (_f = (_e = (_d = M == null ? void 0 : M[1]) == null ? void 0 : _d[0]) == null ? void 0 : _e.meta) == null ? void 0 : _f[1]) == null ? void 0 : _g[0].data) && varint_to_i32(M[1][0].meta[1][0].data) == 1 && M[1][0];\n if (!docroot)\n indices.forEach(function(idx) {\n M[idx].forEach(function(iwam) {\n var mtype = varint_to_i32(iwam.meta[1][0].data) >>> 0;\n if (mtype == 1) {\n if (!docroot)\n docroot = iwam;\n else\n throw new Error(\"Document has multiple roots\");\n }\n });\n });\n if (!docroot)\n throw new Error(\"Cannot find Document root\");\n return parse_TN_DocumentArchive(M, docroot, opts);\n}\nfunction write_TST_TileRowInfo(data, lut, wide) {\n var _a, _b, _c;\n var tri = [\n [],\n [{ type: 0, data: write_varint49(0) }],\n [{ type: 0, data: write_varint49(0) }],\n [{ type: 2, data: new Uint8Array([]) }],\n [{ type: 2, data: new Uint8Array(Array.from({ length: 510 }, function() {\n return 255;\n })) }],\n [{ type: 0, data: write_varint49(5) }],\n [{ type: 2, data: new Uint8Array([]) }],\n [{ type: 2, data: new Uint8Array(Array.from({ length: 510 }, function() {\n return 255;\n })) }],\n [{ type: 0, data: write_varint49(1) }]\n ];\n if (!((_a = tri[6]) == null ? void 0 : _a[0]) || !((_b = tri[7]) == null ? void 0 : _b[0]))\n throw \"Mutation only works on post-BNC storages!\";\n var cnt = 0;\n if (tri[7][0].data.length < 2 * data.length) {\n var new_7 = new Uint8Array(2 * data.length);\n new_7.set(tri[7][0].data);\n tri[7][0].data = new_7;\n }\n if (tri[4][0].data.length < 2 * data.length) {\n var new_4 = new Uint8Array(2 * data.length);\n new_4.set(tri[4][0].data);\n tri[4][0].data = new_4;\n }\n var dv = u8_to_dataview(tri[7][0].data), last_offset = 0, cell_storage = [];\n var _dv = u8_to_dataview(tri[4][0].data), _last_offset = 0, _cell_storage = [];\n var width = wide ? 4 : 1;\n for (var C = 0; C < data.length; ++C) {\n if (data[C] == null || data[C].t == \"z\" && !((_c = data[C].c) == null ? void 0 : _c.length) || data[C].t == \"e\") {\n dv.setUint16(C * 2, 65535, true);\n _dv.setUint16(C * 2, 65535);\n continue;\n }\n dv.setUint16(C * 2, last_offset / width, true);\n _dv.setUint16(C * 2, _last_offset / width, true);\n var celload, _celload;\n switch (data[C].t) {\n case \"d\":\n if (data[C].v instanceof Date) {\n celload = write_new_storage(data[C], lut);\n _celload = write_old_storage(data[C], lut);\n break;\n }\n celload = write_new_storage(data[C], lut);\n _celload = write_old_storage(data[C], lut);\n break;\n case \"s\":\n case \"n\":\n case \"b\":\n case \"z\":\n celload = write_new_storage(data[C], lut);\n _celload = write_old_storage(data[C], lut);\n break;\n default:\n throw new Error(\"Unsupported value \" + data[C]);\n }\n cell_storage.push(celload);\n last_offset += celload.length;\n {\n _cell_storage.push(_celload);\n _last_offset += _celload.length;\n }\n ++cnt;\n }\n tri[2][0].data = write_varint49(cnt);\n tri[5][0].data = write_varint49(5);\n for (; C < tri[7][0].data.length / 2; ++C) {\n dv.setUint16(C * 2, 65535, true);\n _dv.setUint16(C * 2, 65535, true);\n }\n tri[6][0].data = u8concat(cell_storage);\n tri[3][0].data = u8concat(_cell_storage);\n tri[8] = [{ type: 0, data: write_varint49(wide ? 1 : 0) }];\n return tri;\n}\nfunction write_iwam(type, payload) {\n return {\n meta: [\n [],\n [{ type: 0, data: write_varint49(type) }]\n ],\n data: payload\n };\n}\nfunction get_unique_msgid(dep, dependents) {\n if (!dependents.last)\n dependents.last = 927262;\n for (var i = dependents.last; i < 2e6; ++i)\n if (!dependents[i]) {\n dependents[dependents.last = i] = dep;\n return i;\n }\n throw new Error(\"Too many messages\");\n}\nfunction build_numbers_deps(cfb) {\n var dependents = {};\n var indices = [];\n cfb.FileIndex.map(function(fi, idx) {\n return [fi, cfb.FullPaths[idx]];\n }).forEach(function(row) {\n var fi = row[0], fp = row[1];\n if (fi.type != 2)\n return;\n if (!fi.name.match(/\\.iwa/))\n return;\n if (fi.content[0] != 0)\n return;\n parse_iwa_file(decompress_iwa_file(fi.content)).forEach(function(packet) {\n indices.push(packet.id);\n dependents[packet.id] = { deps: [], location: fp, type: varint_to_i32(packet.messages[0].meta[1][0].data) };\n });\n });\n cfb.FileIndex.forEach(function(fi) {\n if (!fi.name.match(/\\.iwa/))\n return;\n if (fi.content[0] != 0)\n return;\n parse_iwa_file(decompress_iwa_file(fi.content)).forEach(function(ia) {\n ia.messages.forEach(function(mess) {\n [5, 6].forEach(function(f) {\n if (!mess.meta[f])\n return;\n mess.meta[f].forEach(function(x) {\n dependents[ia.id].deps.push(varint_to_i32(x.data));\n });\n });\n });\n });\n });\n return dependents;\n}\nfunction write_TSP_Color_RGB(r, g, b) {\n return write_shallow([\n [],\n [{ type: 0, data: write_varint49(1) }],\n [],\n [{ type: 5, data: new Uint8Array(Float32Array.from([r / 255]).buffer) }],\n [{ type: 5, data: new Uint8Array(Float32Array.from([g / 255]).buffer) }],\n [{ type: 5, data: new Uint8Array(Float32Array.from([b / 255]).buffer) }],\n [{ type: 5, data: new Uint8Array(Float32Array.from([1]).buffer) }],\n [],\n [],\n [],\n [],\n [],\n [{ type: 0, data: write_varint49(1) }]\n ]);\n}\nfunction get_author_color(n) {\n switch (n) {\n case 0:\n return write_TSP_Color_RGB(99, 222, 171);\n case 1:\n return write_TSP_Color_RGB(162, 197, 240);\n case 2:\n return write_TSP_Color_RGB(255, 189, 189);\n }\n return write_TSP_Color_RGB(Math.random() * 255, Math.random() * 255, Math.random() * 255);\n}\nfunction write_numbers_iwa(wb, opts) {\n if (!opts || !opts.numbers)\n throw new Error(\"Must pass a `numbers` option -- check the README\");\n var cfb = CFB.read(opts.numbers, { type: \"base64\" });\n var deps = build_numbers_deps(cfb);\n var docroot = numbers_iwa_find(cfb, deps, 1);\n if (docroot == null)\n throw \"Could not find message \".concat(1, \" in Numbers template\");\n var sheetrefs = mappa(parse_shallow(docroot.messages[0].data)[1], parse_TSP_Reference);\n if (sheetrefs.length > 1)\n throw new Error(\"Template NUMBERS file must have exactly one sheet\");\n wb.SheetNames.forEach(function(name, idx) {\n if (idx >= 1) {\n numbers_add_ws(cfb, deps, idx + 1);\n docroot = numbers_iwa_find(cfb, deps, 1);\n sheetrefs = mappa(parse_shallow(docroot.messages[0].data)[1], parse_TSP_Reference);\n }\n write_numbers_ws(cfb, deps, wb.Sheets[name], name, idx, sheetrefs[idx]);\n });\n return cfb;\n}\nfunction numbers_iwa_doit(cfb, deps, id, cb) {\n var entry = CFB.find(cfb, deps[id].location);\n if (!entry)\n throw \"Could not find \".concat(deps[id].location, \" in Numbers template\");\n var x = parse_iwa_file(decompress_iwa_file(entry.content));\n var ainfo = x.find(function(packet) {\n return packet.id == id;\n });\n cb(ainfo, x);\n entry.content = compress_iwa_file(write_iwa_file(x));\n entry.size = entry.content.length;\n}\nfunction numbers_iwa_find(cfb, deps, id) {\n var entry = CFB.find(cfb, deps[id].location);\n if (!entry)\n throw \"Could not find \".concat(deps[id].location, \" in Numbers template\");\n var x = parse_iwa_file(decompress_iwa_file(entry.content));\n var ainfo = x.find(function(packet) {\n return packet.id == id;\n });\n return ainfo;\n}\nfunction numbers_add_meta(mlist, newid, newloc) {\n mlist[3].push({ type: 2, data: write_shallow([\n [],\n [{ type: 0, data: write_varint49(newid) }],\n [{ type: 2, data: stru8(newloc.replace(/-[\\s\\S]*$/, \"\")) }],\n [{ type: 2, data: stru8(newloc) }],\n [{ type: 2, data: new Uint8Array([2, 0, 0]) }],\n [{ type: 2, data: new Uint8Array([2, 0, 0]) }],\n [],\n [],\n [],\n [],\n [{ type: 0, data: write_varint49(0) }],\n [],\n [{ type: 0, data: write_varint49(0) }]\n ]) });\n mlist[1] = [{ type: 0, data: write_varint49(Math.max(newid + 1, varint_to_i32(mlist[1][0].data))) }];\n}\nfunction numbers_add_msg(cfb, type, msg, path, deps, id) {\n if (!id)\n id = get_unique_msgid({ deps: [], location: \"\", type: type }, deps);\n var loc = \"\".concat(path, \"-\").concat(id, \".iwa\");\n deps[id].location = \"Root Entry\" + loc;\n CFB.utils.cfb_add(cfb, loc, compress_iwa_file(write_iwa_file([{\n id: id,\n messages: [write_iwam(type, write_shallow(msg))]\n }])));\n var newloc = loc.replace(/^[\\/]/, \"\").replace(/^Index\\//, \"\").replace(/\\.iwa$/, \"\");\n numbers_iwa_doit(cfb, deps, 2, function(ai) {\n var mlist = parse_shallow(ai.messages[0].data);\n numbers_add_meta(mlist, id || 0, newloc);\n ai.messages[0].data = write_shallow(mlist);\n });\n return id;\n}\nfunction numbers_meta_add_dep(mlist, deps, id, dep) {\n var loc = deps[id].location.replace(/^Root Entry\\//, \"\").replace(/^Index\\//, \"\").replace(/\\.iwa$/, \"\");\n var parentidx = mlist[3].findIndex(function(m) {\n var _a, _b;\n var mm = parse_shallow(m.data);\n if ((_a = mm[3]) == null ? void 0 : _a[0])\n return u8str(mm[3][0].data) == loc;\n if (((_b = mm[2]) == null ? void 0 : _b[0]) && u8str(mm[2][0].data) == loc)\n return true;\n return false;\n });\n var parent = parse_shallow(mlist[3][parentidx].data);\n if (!parent[6])\n parent[6] = [];\n (Array.isArray(dep) ? dep : [dep]).forEach(function(dep2) {\n parent[6].push({\n type: 2,\n data: write_shallow([\n [],\n [{ type: 0, data: write_varint49(dep2) }]\n ])\n });\n });\n mlist[3][parentidx].data = write_shallow(parent);\n}\nfunction numbers_meta_del_dep(mlist, deps, id, dep) {\n var loc = deps[id].location.replace(/^Root Entry\\//, \"\").replace(/^Index\\//, \"\").replace(/\\.iwa$/, \"\");\n var parentidx = mlist[3].findIndex(function(m) {\n var _a, _b;\n var mm = parse_shallow(m.data);\n if ((_a = mm[3]) == null ? void 0 : _a[0])\n return u8str(mm[3][0].data) == loc;\n if (((_b = mm[2]) == null ? void 0 : _b[0]) && u8str(mm[2][0].data) == loc)\n return true;\n return false;\n });\n var parent = parse_shallow(mlist[3][parentidx].data);\n if (!parent[6])\n parent[6] = [];\n parent[6] = parent[6].filter(function(m) {\n return varint_to_i32(parse_shallow(m.data)[1][0].data) != dep;\n });\n mlist[3][parentidx].data = write_shallow(parent);\n}\nfunction numbers_add_ws(cfb, deps, wsidx) {\n var sheetref = -1, newsheetref = -1;\n var remap = {};\n numbers_iwa_doit(cfb, deps, 1, function(docroot, arch) {\n var doc = parse_shallow(docroot.messages[0].data);\n sheetref = parse_TSP_Reference(parse_shallow(docroot.messages[0].data)[1][0].data);\n newsheetref = get_unique_msgid({ deps: [1], location: deps[sheetref].location, type: 2 }, deps);\n remap[sheetref] = newsheetref;\n numbers_add_oref(docroot, newsheetref);\n doc[1].push({ type: 2, data: write_TSP_Reference(newsheetref) });\n var sheet = numbers_iwa_find(cfb, deps, sheetref);\n sheet.id = newsheetref;\n if (deps[1].location == deps[newsheetref].location)\n arch.push(sheet);\n else\n numbers_iwa_doit(cfb, deps, newsheetref, function(_, x) {\n return x.push(sheet);\n });\n docroot.messages[0].data = write_shallow(doc);\n });\n var tiaref = -1;\n numbers_iwa_doit(cfb, deps, newsheetref, function(sheetroot, arch) {\n var sa = parse_shallow(sheetroot.messages[0].data);\n for (var i = 3; i <= 69; ++i)\n delete sa[i];\n var drawables = mappa(sa[2], parse_TSP_Reference);\n drawables.forEach(function(n) {\n return numbers_del_oref(sheetroot, n);\n });\n tiaref = get_unique_msgid({ deps: [newsheetref], location: deps[drawables[0]].location, type: deps[drawables[0]].type }, deps);\n numbers_add_oref(sheetroot, tiaref);\n remap[drawables[0]] = tiaref;\n sa[2] = [{ type: 2, data: write_TSP_Reference(tiaref) }];\n var tia = numbers_iwa_find(cfb, deps, drawables[0]);\n tia.id = tiaref;\n if (deps[drawables[0]].location == deps[newsheetref].location)\n arch.push(tia);\n else {\n numbers_iwa_doit(cfb, deps, 2, function(ai) {\n var mlist = parse_shallow(ai.messages[0].data);\n numbers_meta_add_dep(mlist, deps, newsheetref, tiaref);\n ai.messages[0].data = write_shallow(mlist);\n });\n numbers_iwa_doit(cfb, deps, tiaref, function(_, x) {\n return x.push(tia);\n });\n }\n sheetroot.messages[0].data = write_shallow(sa);\n });\n var tmaref = -1;\n numbers_iwa_doit(cfb, deps, tiaref, function(tiaroot, arch) {\n var tia = parse_shallow(tiaroot.messages[0].data);\n var da = parse_shallow(tia[1][0].data);\n for (var i = 3; i <= 69; ++i)\n delete da[i];\n var dap = parse_TSP_Reference(da[2][0].data);\n da[2][0].data = write_TSP_Reference(remap[dap]);\n tia[1][0].data = write_shallow(da);\n var oldtmaref = parse_TSP_Reference(tia[2][0].data);\n numbers_del_oref(tiaroot, oldtmaref);\n tmaref = get_unique_msgid({ deps: [tiaref], location: deps[oldtmaref].location, type: deps[oldtmaref].type }, deps);\n numbers_add_oref(tiaroot, tmaref);\n remap[oldtmaref] = tmaref;\n tia[2][0].data = write_TSP_Reference(tmaref);\n var tma = numbers_iwa_find(cfb, deps, oldtmaref);\n tma.id = tmaref;\n if (deps[tiaref].location == deps[tmaref].location)\n arch.push(tma);\n else\n numbers_iwa_doit(cfb, deps, tmaref, function(_, x) {\n return x.push(tma);\n });\n tiaroot.messages[0].data = write_shallow(tia);\n });\n numbers_iwa_doit(cfb, deps, tmaref, function(tmaroot, arch) {\n var _a, _b;\n var tma = parse_shallow(tmaroot.messages[0].data);\n var uuid = u8str(tma[1][0].data), new_uuid = uuid.replace(/-[A-Z0-9]*/, \"-\".concat((\"0000\" + wsidx.toString(16)).slice(-4)));\n tma[1][0].data = stru8(new_uuid);\n [12, 13, 29, 31, 32, 33, 39, 44, 47, 81, 82, 84].forEach(function(n) {\n return delete tma[n];\n });\n if (tma[45]) {\n var srrta = parse_shallow(tma[45][0].data);\n var ref = parse_TSP_Reference(srrta[1][0].data);\n numbers_del_oref(tmaroot, ref);\n delete tma[45];\n }\n if (tma[70]) {\n var hsoa = parse_shallow(tma[70][0].data);\n (_a = hsoa[2]) == null ? void 0 : _a.forEach(function(item) {\n var hsa = parse_shallow(item.data);\n [2, 3].map(function(n) {\n return hsa[n][0];\n }).forEach(function(hseadata) {\n var hsea = parse_shallow(hseadata.data);\n if (!hsea[8])\n return;\n var ref2 = parse_TSP_Reference(hsea[8][0].data);\n numbers_del_oref(tmaroot, ref2);\n });\n });\n delete tma[70];\n }\n [\n 46,\n 30,\n 34,\n 35,\n 36,\n 38,\n 48,\n 49,\n 60,\n 61,\n 62,\n 63,\n 64,\n 71,\n 72,\n 73,\n 74,\n 75,\n 85,\n 86,\n 87,\n 88,\n 89\n ].forEach(function(n) {\n if (!tma[n])\n return;\n var ref2 = parse_TSP_Reference(tma[n][0].data);\n delete tma[n];\n numbers_del_oref(tmaroot, ref2);\n });\n var store = parse_shallow(tma[4][0].data);\n {\n [2, 4, 5, 6, 11, 12, 13, 15, 16, 17, 18, 19, 20, 21, 22].forEach(function(n) {\n var _a2;\n if (!((_a2 = store[n]) == null ? void 0 : _a2[0]))\n return;\n var oldref = parse_TSP_Reference(store[n][0].data);\n var newref = get_unique_msgid({ deps: [tmaref], location: deps[oldref].location, type: deps[oldref].type }, deps);\n numbers_del_oref(tmaroot, oldref);\n numbers_add_oref(tmaroot, newref);\n remap[oldref] = newref;\n var msg = numbers_iwa_find(cfb, deps, oldref);\n msg.id = newref;\n if (deps[oldref].location == deps[tmaref].location)\n arch.push(msg);\n else {\n deps[newref].location = deps[oldref].location.replace(oldref.toString(), newref.toString());\n if (deps[newref].location == deps[oldref].location)\n deps[newref].location = deps[newref].location.replace(/\\.iwa/, \"-\".concat(newref, \".iwa\"));\n CFB.utils.cfb_add(cfb, deps[newref].location, compress_iwa_file(write_iwa_file([msg])));\n var newloc = deps[newref].location.replace(/^Root Entry\\//, \"\").replace(/^Index\\//, \"\").replace(/\\.iwa$/, \"\");\n numbers_iwa_doit(cfb, deps, 2, function(ai) {\n var mlist = parse_shallow(ai.messages[0].data);\n numbers_add_meta(mlist, newref, newloc);\n numbers_meta_add_dep(mlist, deps, tmaref, newref);\n ai.messages[0].data = write_shallow(mlist);\n });\n }\n store[n][0].data = write_TSP_Reference(newref);\n });\n var row_headers = parse_shallow(store[1][0].data);\n {\n (_b = row_headers[2]) == null ? void 0 : _b.forEach(function(tspref) {\n var oldref = parse_TSP_Reference(tspref.data);\n var newref = get_unique_msgid({ deps: [tmaref], location: deps[oldref].location, type: deps[oldref].type }, deps);\n numbers_del_oref(tmaroot, oldref);\n numbers_add_oref(tmaroot, newref);\n remap[oldref] = newref;\n var msg = numbers_iwa_find(cfb, deps, oldref);\n msg.id = newref;\n if (deps[oldref].location == deps[tmaref].location) {\n arch.push(msg);\n } else {\n deps[newref].location = deps[oldref].location.replace(oldref.toString(), newref.toString());\n if (deps[newref].location == deps[oldref].location)\n deps[newref].location = deps[newref].location.replace(/\\.iwa/, \"-\".concat(newref, \".iwa\"));\n CFB.utils.cfb_add(cfb, deps[newref].location, compress_iwa_file(write_iwa_file([msg])));\n var newloc = deps[newref].location.replace(/^Root Entry\\//, \"\").replace(/^Index\\//, \"\").replace(/\\.iwa$/, \"\");\n numbers_iwa_doit(cfb, deps, 2, function(ai) {\n var mlist = parse_shallow(ai.messages[0].data);\n numbers_add_meta(mlist, newref, newloc);\n numbers_meta_add_dep(mlist, deps, tmaref, newref);\n ai.messages[0].data = write_shallow(mlist);\n });\n }\n tspref.data = write_TSP_Reference(newref);\n });\n }\n store[1][0].data = write_shallow(row_headers);\n var tiles = parse_shallow(store[3][0].data);\n {\n tiles[1].forEach(function(t) {\n var tst = parse_shallow(t.data);\n var oldtileref = parse_TSP_Reference(tst[2][0].data);\n var newtileref = remap[oldtileref];\n if (!remap[oldtileref]) {\n newtileref = get_unique_msgid({ deps: [tmaref], location: \"\", type: deps[oldtileref].type }, deps);\n deps[newtileref].location = \"Root Entry/Index/Tables/Tile-\".concat(newtileref, \".iwa\");\n remap[oldtileref] = newtileref;\n var oldtile = numbers_iwa_find(cfb, deps, oldtileref);\n oldtile.id = newtileref;\n numbers_del_oref(tmaroot, oldtileref);\n numbers_add_oref(tmaroot, newtileref);\n CFB.utils.cfb_add(cfb, \"/Index/Tables/Tile-\".concat(newtileref, \".iwa\"), compress_iwa_file(write_iwa_file([oldtile])));\n numbers_iwa_doit(cfb, deps, 2, function(ai) {\n var mlist = parse_shallow(ai.messages[0].data);\n mlist[3].push({ type: 2, data: write_shallow([\n [],\n [{ type: 0, data: write_varint49(newtileref) }],\n [{ type: 2, data: stru8(\"Tables/Tile\") }],\n [{ type: 2, data: stru8(\"Tables/Tile-\".concat(newtileref)) }],\n [{ type: 2, data: new Uint8Array([2, 0, 0]) }],\n [{ type: 2, data: new Uint8Array([2, 0, 0]) }],\n [],\n [],\n [],\n [],\n [{ type: 0, data: write_varint49(0) }],\n [],\n [{ type: 0, data: write_varint49(0) }]\n ]) });\n mlist[1] = [{ type: 0, data: write_varint49(Math.max(newtileref + 1, varint_to_i32(mlist[1][0].data))) }];\n numbers_meta_add_dep(mlist, deps, tmaref, newtileref);\n ai.messages[0].data = write_shallow(mlist);\n });\n }\n tst[2][0].data = write_TSP_Reference(newtileref);\n t.data = write_shallow(tst);\n });\n }\n store[3][0].data = write_shallow(tiles);\n }\n tma[4][0].data = write_shallow(store);\n tmaroot.messages[0].data = write_shallow(tma);\n });\n}\nfunction write_numbers_ws(cfb, deps, ws, wsname, sheetidx, rootref) {\n var drawables = [];\n numbers_iwa_doit(cfb, deps, rootref, function(docroot) {\n var sheetref = parse_shallow(docroot.messages[0].data);\n {\n sheetref[1] = [{ type: 2, data: stru8(wsname) }];\n drawables = mappa(sheetref[2], parse_TSP_Reference);\n }\n docroot.messages[0].data = write_shallow(sheetref);\n });\n var tia = numbers_iwa_find(cfb, deps, drawables[0]);\n var tmaref = parse_TSP_Reference(parse_shallow(tia.messages[0].data)[2][0].data);\n numbers_iwa_doit(cfb, deps, tmaref, function(docroot, x) {\n return write_numbers_tma(cfb, deps, ws, docroot, x, tmaref);\n });\n}\nvar USE_WIDE_ROWS = true;\nfunction write_numbers_tma(cfb, deps, ws, tmaroot, tmafile, tmaref) {\n if (!ws[\"!ref\"])\n throw new Error(\"Cannot export empty sheet to NUMBERS\");\n var range = decode_range(ws[\"!ref\"]);\n range.s.r = range.s.c = 0;\n var trunc = false;\n if (range.e.c > 999) {\n trunc = true;\n range.e.c = 999;\n }\n if (range.e.r > 999999) {\n trunc = true;\n range.e.r = 999999;\n }\n if (trunc)\n console.error(\"Truncating to \".concat(encode_range(range)));\n var data = [];\n if (ws[\"!data\"])\n data = ws[\"!data\"];\n else {\n var colstr = [];\n for (var _C = 0; _C <= range.e.c; ++_C)\n colstr[_C] = encode_col(_C);\n for (var R_ = 0; R_ <= range.e.r; ++R_) {\n data[R_] = [];\n var _R = \"\" + (R_ + 1);\n for (_C = 0; _C <= range.e.c; ++_C) {\n var _cell = ws[colstr[_C] + _R];\n if (!_cell)\n continue;\n data[R_][_C] = _cell;\n }\n }\n }\n var LUT = {\n cmnt: [{ a: \"~54ee77S~\", t: \"... the people who are crazy enough to think they can change the world, are the ones who do.\" }],\n ferr: [],\n fmla: [],\n nfmt: [],\n ofmt: [],\n rsst: [{ v: \"~54ee77S~\", l: \"https://sheetjs.com/\" }],\n sst: [\"~Sh33tJ5~\"]\n };\n var pb = parse_shallow(tmaroot.messages[0].data);\n {\n pb[6][0].data = write_varint49(range.e.r + 1);\n pb[7][0].data = write_varint49(range.e.c + 1);\n delete pb[46];\n var store = parse_shallow(pb[4][0].data);\n {\n var row_header_ref = parse_TSP_Reference(parse_shallow(store[1][0].data)[2][0].data);\n numbers_iwa_doit(cfb, deps, row_header_ref, function(rowhead, _x) {\n var _a;\n var base_bucket = parse_shallow(rowhead.messages[0].data);\n if ((_a = base_bucket == null ? void 0 : base_bucket[2]) == null ? void 0 : _a[0])\n for (var R2 = 0; R2 < data.length; ++R2) {\n var _bucket = parse_shallow(base_bucket[2][0].data);\n _bucket[1][0].data = write_varint49(R2);\n _bucket[4][0].data = write_varint49(data[R2].length);\n base_bucket[2][R2] = { type: base_bucket[2][0].type, data: write_shallow(_bucket) };\n }\n rowhead.messages[0].data = write_shallow(base_bucket);\n });\n var col_header_ref = parse_TSP_Reference(store[2][0].data);\n numbers_iwa_doit(cfb, deps, col_header_ref, function(colhead, _x) {\n var base_bucket = parse_shallow(colhead.messages[0].data);\n for (var C = 0; C <= range.e.c; ++C) {\n var _bucket = parse_shallow(base_bucket[2][0].data);\n _bucket[1][0].data = write_varint49(C);\n _bucket[4][0].data = write_varint49(range.e.r + 1);\n base_bucket[2][C] = { type: base_bucket[2][0].type, data: write_shallow(_bucket) };\n }\n colhead.messages[0].data = write_shallow(base_bucket);\n });\n var rbtree = parse_shallow(store[9][0].data);\n rbtree[1] = [];\n var tilestore = parse_shallow(store[3][0].data);\n {\n var tstride = 256;\n tilestore[2] = [{ type: 0, data: write_varint49(tstride) }];\n var tileref = parse_TSP_Reference(parse_shallow(tilestore[1][0].data)[2][0].data);\n var save_token = function() {\n var metadata = numbers_iwa_find(cfb, deps, 2);\n var mlist = parse_shallow(metadata.messages[0].data);\n var mlst = mlist[3].filter(function(m) {\n return varint_to_i32(parse_shallow(m.data)[1][0].data) == tileref;\n });\n return (mlst == null ? void 0 : mlst.length) ? varint_to_i32(parse_shallow(mlst[0].data)[12][0].data) : 0;\n }();\n {\n CFB.utils.cfb_del(cfb, deps[tileref].location);\n numbers_iwa_doit(cfb, deps, 2, function(ai) {\n var mlist = parse_shallow(ai.messages[0].data);\n mlist[3] = mlist[3].filter(function(m) {\n return varint_to_i32(parse_shallow(m.data)[1][0].data) != tileref;\n });\n numbers_meta_del_dep(mlist, deps, tmaref, tileref);\n ai.messages[0].data = write_shallow(mlist);\n });\n numbers_del_oref(tmaroot, tileref);\n }\n tilestore[1] = [];\n var ntiles = Math.ceil((range.e.r + 1) / tstride);\n for (var tidx = 0; tidx < ntiles; ++tidx) {\n var newtileid = get_unique_msgid({\n deps: [],\n location: \"\",\n type: 6002\n }, deps);\n deps[newtileid].location = \"Root Entry/Index/Tables/Tile-\".concat(newtileid, \".iwa\");\n var tiledata = [\n [],\n [{ type: 0, data: write_varint49(0) }],\n [{ type: 0, data: write_varint49(Math.min(range.e.r + 1, (tidx + 1) * tstride)) }],\n [{ type: 0, data: write_varint49(0) }],\n [{ type: 0, data: write_varint49(Math.min((tidx + 1) * tstride, range.e.r + 1) - tidx * tstride) }],\n [],\n [{ type: 0, data: write_varint49(5) }],\n [{ type: 0, data: write_varint49(1) }],\n [{ type: 0, data: write_varint49(USE_WIDE_ROWS ? 1 : 0) }]\n ];\n for (var R = tidx * tstride; R <= Math.min(range.e.r, (tidx + 1) * tstride - 1); ++R) {\n var tilerow = write_TST_TileRowInfo(data[R], LUT, USE_WIDE_ROWS);\n tilerow[1][0].data = write_varint49(R - tidx * tstride);\n tiledata[5].push({ data: write_shallow(tilerow), type: 2 });\n }\n tilestore[1].push({ type: 2, data: write_shallow([\n [],\n [{ type: 0, data: write_varint49(tidx) }],\n [{ type: 2, data: write_TSP_Reference(newtileid) }]\n ]) });\n var newtile = {\n id: newtileid,\n messages: [write_iwam(6002, write_shallow(tiledata))]\n };\n var tilecontent = compress_iwa_file(write_iwa_file([newtile]));\n CFB.utils.cfb_add(cfb, \"/Index/Tables/Tile-\".concat(newtileid, \".iwa\"), tilecontent);\n numbers_iwa_doit(cfb, deps, 2, function(ai) {\n var mlist = parse_shallow(ai.messages[0].data);\n mlist[3].push({ type: 2, data: write_shallow([\n [],\n [{ type: 0, data: write_varint49(newtileid) }],\n [{ type: 2, data: stru8(\"Tables/Tile\") }],\n [{ type: 2, data: stru8(\"Tables/Tile-\".concat(newtileid)) }],\n [{ type: 2, data: new Uint8Array([2, 0, 0]) }],\n [{ type: 2, data: new Uint8Array([2, 0, 0]) }],\n [],\n [],\n [],\n [],\n [{ type: 0, data: write_varint49(0) }],\n [],\n [{ type: 0, data: write_varint49(save_token) }]\n ]) });\n mlist[1] = [{ type: 0, data: write_varint49(Math.max(newtileid + 1, varint_to_i32(mlist[1][0].data))) }];\n numbers_meta_add_dep(mlist, deps, tmaref, newtileid);\n ai.messages[0].data = write_shallow(mlist);\n });\n numbers_add_oref(tmaroot, newtileid);\n rbtree[1].push({ type: 2, data: write_shallow([\n [],\n [{ type: 0, data: write_varint49(tidx * tstride) }],\n [{ type: 0, data: write_varint49(tidx) }]\n ]) });\n }\n }\n store[3][0].data = write_shallow(tilestore);\n store[9][0].data = write_shallow(rbtree);\n store[10] = [{ type: 2, data: new Uint8Array([]) }];\n if (ws[\"!merges\"]) {\n var mergeid = get_unique_msgid({\n type: 6144,\n deps: [tmaref],\n location: deps[tmaref].location\n }, deps);\n tmafile.push({\n id: mergeid,\n messages: [write_iwam(6144, write_shallow([\n [],\n ws[\"!merges\"].map(function(m) {\n return { type: 2, data: write_shallow([\n [],\n [{ type: 2, data: write_shallow([\n [],\n [{ type: 5, data: new Uint8Array(new Uint16Array([m.s.r, m.s.c]).buffer) }]\n ]) }],\n [{ type: 2, data: write_shallow([\n [],\n [{ type: 5, data: new Uint8Array(new Uint16Array([m.e.r - m.s.r + 1, m.e.c - m.s.c + 1]).buffer) }]\n ]) }]\n ]) };\n })\n ]))]\n });\n store[13] = [{ type: 2, data: write_TSP_Reference(mergeid) }];\n numbers_iwa_doit(cfb, deps, 2, function(ai) {\n var mlist = parse_shallow(ai.messages[0].data);\n numbers_meta_add_dep(mlist, deps, tmaref, mergeid);\n ai.messages[0].data = write_shallow(mlist);\n });\n numbers_add_oref(tmaroot, mergeid);\n } else\n delete store[13];\n var sstref = parse_TSP_Reference(store[4][0].data);\n numbers_iwa_doit(cfb, deps, sstref, function(sstroot) {\n var sstdata = parse_shallow(sstroot.messages[0].data);\n {\n sstdata[3] = [];\n LUT.sst.forEach(function(str, i) {\n if (i == 0)\n return;\n sstdata[3].push({ type: 2, data: write_shallow([\n [],\n [{ type: 0, data: write_varint49(i) }],\n [{ type: 0, data: write_varint49(1) }],\n [{ type: 2, data: stru8(str) }]\n ]) });\n });\n }\n sstroot.messages[0].data = write_shallow(sstdata);\n });\n var rsstref = parse_TSP_Reference(store[17][0].data);\n numbers_iwa_doit(cfb, deps, rsstref, function(rsstroot) {\n var rsstdata = parse_shallow(rsstroot.messages[0].data);\n rsstdata[3] = [];\n var style_indices = [\n 904980,\n 903835,\n 903815,\n 903845\n ];\n LUT.rsst.forEach(function(rsst, i) {\n if (i == 0)\n return;\n var tswpsa = [\n [],\n [{ type: 0, data: new Uint8Array([5]) }],\n [],\n [{ type: 2, data: stru8(rsst.v) }]\n ];\n tswpsa[10] = [{ type: 0, data: new Uint8Array([1]) }];\n tswpsa[19] = [{ type: 2, data: new Uint8Array([10, 6, 8, 0, 18, 2, 101, 110]) }];\n tswpsa[5] = [{ type: 2, data: new Uint8Array([10, 8, 8, 0, 18, 4, 8, 155, 149, 55]) }];\n tswpsa[2] = [{ type: 2, data: new Uint8Array([8, 148, 158, 55]) }];\n tswpsa[6] = [{ type: 2, data: new Uint8Array([10, 6, 8, 0, 16, 0, 24, 0]) }];\n tswpsa[7] = [{ type: 2, data: new Uint8Array([10, 8, 8, 0, 18, 4, 8, 135, 149, 55]) }];\n tswpsa[8] = [{ type: 2, data: new Uint8Array([10, 8, 8, 0, 18, 4, 8, 165, 149, 55]) }];\n tswpsa[14] = [{ type: 2, data: new Uint8Array([10, 6, 8, 0, 16, 0, 24, 0]) }];\n tswpsa[24] = [{ type: 2, data: new Uint8Array([10, 6, 8, 0, 16, 0, 24, 0]) }];\n var tswpsaid = get_unique_msgid({ deps: [], location: \"\", type: 2001 }, deps);\n var tswpsarefs = [];\n if (rsst.l) {\n var newhlinkid = numbers_add_msg(cfb, 2032, [\n [],\n [],\n [{ type: 2, data: stru8(rsst.l) }]\n ], \"/Index/Tables/DataList\", deps);\n tswpsa[11] = [];\n var smartfield = [[], []];\n if (!smartfield[1])\n smartfield[1] = [];\n smartfield[1].push({ type: 2, data: write_shallow([\n [],\n [{ type: 0, data: write_varint49(0) }],\n [{ type: 2, data: write_TSP_Reference(newhlinkid) }]\n ]) });\n tswpsa[11][0] = { type: 2, data: write_shallow(smartfield) };\n tswpsarefs.push(newhlinkid);\n }\n numbers_add_msg(cfb, 2001, tswpsa, \"/Index/Tables/DataList\", deps, tswpsaid);\n numbers_iwa_doit(cfb, deps, tswpsaid, function(iwa) {\n style_indices.forEach(function(ref) {\n return numbers_add_oref(iwa, ref);\n });\n tswpsarefs.forEach(function(ref) {\n return numbers_add_oref(iwa, ref);\n });\n });\n var rtpaid = numbers_add_msg(cfb, 6218, [\n [],\n [{ type: 2, data: write_TSP_Reference(tswpsaid) }],\n [],\n [{ type: 2, data: new Uint8Array([13, 255, 255, 255, 0, 18, 10, 16, 255, 255, 1, 24, 255, 255, 255, 255, 7]) }]\n ], \"/Index/Tables/DataList\", deps);\n numbers_iwa_doit(cfb, deps, rtpaid, function(iwa) {\n return numbers_add_oref(iwa, tswpsaid);\n });\n rsstdata[3].push({ type: 2, data: write_shallow([\n [],\n [{ type: 0, data: write_varint49(i) }],\n [{ type: 0, data: write_varint49(1) }],\n [],\n [],\n [],\n [],\n [],\n [],\n [{ type: 2, data: write_TSP_Reference(rtpaid) }]\n ]) });\n numbers_add_oref(rsstroot, rtpaid);\n numbers_iwa_doit(cfb, deps, 2, function(ai) {\n var mlist = parse_shallow(ai.messages[0].data);\n numbers_meta_add_dep(mlist, deps, rsstref, rtpaid);\n numbers_meta_add_dep(mlist, deps, rtpaid, tswpsaid);\n numbers_meta_add_dep(mlist, deps, tswpsaid, tswpsarefs);\n numbers_meta_add_dep(mlist, deps, tswpsaid, style_indices);\n ai.messages[0].data = write_shallow(mlist);\n });\n });\n rsstroot.messages[0].data = write_shallow(rsstdata);\n });\n if (LUT.cmnt.length > 1) {\n var cmntref = parse_TSP_Reference(store[19][0].data);\n var authors = {}, iauthor = 0;\n numbers_iwa_doit(cfb, deps, cmntref, function(cmntroot) {\n var cmntdata = parse_shallow(cmntroot.messages[0].data);\n {\n cmntdata[3] = [];\n LUT.cmnt.forEach(function(cc, i) {\n if (i == 0)\n return;\n var replies = [];\n if (cc.replies)\n cc.replies.forEach(function(c) {\n if (!authors[c.a || \"\"])\n authors[c.a || \"\"] = numbers_add_msg(cfb, 212, [\n [],\n [{ type: 2, data: stru8(c.a || \"\") }],\n [{ type: 2, data: get_author_color(++iauthor) }],\n [],\n [{ type: 0, data: write_varint49(0) }]\n ], \"/Index/Tables/DataList\", deps);\n var aaaid2 = authors[c.a || \"\"];\n var csaid2 = numbers_add_msg(cfb, 3056, [\n [],\n [{ type: 2, data: stru8(c.t || \"\") }],\n [{ type: 2, data: write_shallow([\n [],\n [{ type: 1, data: new Uint8Array([0, 0, 0, 128, 116, 109, 182, 65]) }]\n ]) }],\n [{ type: 2, data: write_TSP_Reference(aaaid2) }]\n ], \"/Index/Tables/DataList\", deps);\n numbers_iwa_doit(cfb, deps, csaid2, function(iwa) {\n return numbers_add_oref(iwa, aaaid2);\n });\n replies.push(csaid2);\n numbers_iwa_doit(cfb, deps, 2, function(ai) {\n var mlist = parse_shallow(ai.messages[0].data);\n numbers_meta_add_dep(mlist, deps, csaid2, aaaid2);\n ai.messages[0].data = write_shallow(mlist);\n });\n });\n if (!authors[cc.a || \"\"])\n authors[cc.a || \"\"] = numbers_add_msg(cfb, 212, [\n [],\n [{ type: 2, data: stru8(cc.a || \"\") }],\n [{ type: 2, data: get_author_color(++iauthor) }],\n [],\n [{ type: 0, data: write_varint49(0) }]\n ], \"/Index/Tables/DataList\", deps);\n var aaaid = authors[cc.a || \"\"];\n var csaid = numbers_add_msg(cfb, 3056, [\n [],\n [{ type: 2, data: stru8(cc.t || \"\") }],\n [{ type: 2, data: write_shallow([\n [],\n [{ type: 1, data: new Uint8Array([0, 0, 0, 128, 116, 109, 182, 65]) }]\n ]) }],\n [{ type: 2, data: write_TSP_Reference(aaaid) }],\n replies.map(function(r) {\n return { type: 2, data: write_TSP_Reference(r) };\n }),\n [{ type: 2, data: write_shallow([\n [],\n [{ type: 0, data: write_varint49(i) }],\n [{ type: 0, data: write_varint49(0) }]\n ]) }]\n ], \"/Index/Tables/DataList\", deps);\n numbers_iwa_doit(cfb, deps, csaid, function(iwa) {\n numbers_add_oref(iwa, aaaid);\n replies.forEach(function(r) {\n return numbers_add_oref(iwa, r);\n });\n });\n cmntdata[3].push({ type: 2, data: write_shallow([\n [],\n [{ type: 0, data: write_varint49(i) }],\n [{ type: 0, data: write_varint49(1) }],\n [],\n [],\n [],\n [],\n [],\n [],\n [],\n [{ type: 2, data: write_TSP_Reference(csaid) }]\n ]) });\n numbers_add_oref(cmntroot, csaid);\n numbers_iwa_doit(cfb, deps, 2, function(ai) {\n var mlist = parse_shallow(ai.messages[0].data);\n numbers_meta_add_dep(mlist, deps, cmntref, csaid);\n numbers_meta_add_dep(mlist, deps, csaid, aaaid);\n if (replies.length)\n numbers_meta_add_dep(mlist, deps, csaid, replies);\n ai.messages[0].data = write_shallow(mlist);\n });\n });\n }\n cmntdata[2][0].data = write_varint49(LUT.cmnt.length + 1);\n cmntroot.messages[0].data = write_shallow(cmntdata);\n });\n }\n }\n pb[4][0].data = write_shallow(store);\n }\n tmaroot.messages[0].data = write_shallow(pb);\n}\nfunction fix_opts_func(defaults/*:Array >*/)/*:{(o:any):void}*/ {\n\treturn function fix_opts(opts) {\n\t\tfor(var i = 0; i != defaults.length; ++i) {\n\t\t\tvar d = defaults[i];\n\t\t\tif(opts[d[0]] === undefined) opts[d[0]] = d[1];\n\t\t\tif(d[2] === 'n') opts[d[0]] = Number(opts[d[0]]);\n\t\t}\n\t};\n}\n\nfunction fix_read_opts(opts) {\nfix_opts_func([\n\t['cellNF', false], /* emit cell number format string as .z */\n\t['cellHTML', true], /* emit html string as .h */\n\t['cellFormula', true], /* emit formulae as .f */\n\t['cellStyles', false], /* emits style/theme as .s */\n\t['cellText', true], /* emit formatted text as .w */\n\t['cellDates', false], /* emit date cells with type `d` */\n\n\t['sheetStubs', false], /* emit empty cells */\n\t['sheetRows', 0, 'n'], /* read n rows (0 = read all rows) */\n\n\t['bookDeps', false], /* parse calculation chains */\n\t['bookSheets', false], /* only try to get sheet names (no Sheets) */\n\t['bookProps', false], /* only try to get properties (no Sheets) */\n\t['bookFiles', false], /* include raw file structure (keys, files, cfb) */\n\t['bookVBA', false], /* include vba raw data (vbaraw) */\n\n\t['password',''], /* password */\n\t['WTF', false] /* WTF mode (throws errors) */\n])(opts);\n}\n\nfunction fix_write_opts(opts) {\nfix_opts_func([\n\t['cellDates', false], /* write date cells with type `d` */\n\n\t['bookSST', false], /* Generate Shared String Table */\n\n\t['bookType', 'xlsx'], /* Type of workbook (xlsx/m/b) */\n\n\t['compression', false], /* Use file compression */\n\n\t['WTF', false] /* WTF mode (throws errors) */\n])(opts);\n}\nfunction get_sheet_type(n/*:string*/)/*:string*/ {\n\tif(RELS.WS.indexOf(n) > -1) return \"sheet\";\n\tif(RELS.CS && n == RELS.CS) return \"chart\";\n\tif(RELS.DS && n == RELS.DS) return \"dialog\";\n\tif(RELS.MS && n == RELS.MS) return \"macro\";\n\treturn (n && n.length) ? n : \"sheet\";\n}\nfunction safe_parse_wbrels(wbrels, sheets) {\n\tif(!wbrels) return 0;\n\ttry {\n\t\twbrels = sheets.map(function pwbr(w) { if(!w.id) w.id = w.strRelID; return [w.name, wbrels['!id'][w.id].Target, get_sheet_type(wbrels['!id'][w.id].Type)]; });\n\t} catch(e) { return null; }\n\treturn !wbrels || wbrels.length === 0 ? null : wbrels;\n}\n\nfunction parse_sheet_legacy_drawing(sheet, type, zip, path, idx, opts, wb, comments) {\n\tif(!sheet || !sheet['!legdrawel']) return;\n\tvar dfile = resolve_path(sheet['!legdrawel'].Target, path);\n\tvar draw = getzipstr(zip, dfile, true);\n\tif(draw) parse_vml(utf8read(draw), sheet, comments||[]);\n}\n\nfunction safe_parse_sheet(zip, path/*:string*/, relsPath/*:string*/, sheet, idx/*:number*/, sheetRels, sheets, stype/*:string*/, opts, wb, themes, styles) {\n\ttry {\n\t\tsheetRels[sheet]=parse_rels(getzipstr(zip, relsPath, true), path);\n\t\tvar data = getzipdata(zip, path);\n\t\tvar _ws;\n\t\tswitch(stype) {\n\t\t\tcase 'sheet': _ws = parse_ws(data, path, idx, opts, sheetRels[sheet], wb, themes, styles); break;\n\t\t\tcase 'chart': _ws = parse_cs(data, path, idx, opts, sheetRels[sheet], wb, themes, styles);\n\t\t\t\tif(!_ws || !_ws['!drawel']) break;\n\t\t\t\tvar dfile = resolve_path(_ws['!drawel'].Target, path);\n\t\t\t\tvar drelsp = get_rels_path(dfile);\n\t\t\t\tvar draw = parse_drawing(getzipstr(zip, dfile, true), parse_rels(getzipstr(zip, drelsp, true), dfile));\n\t\t\t\tvar chartp = resolve_path(draw, dfile);\n\t\t\t\tvar crelsp = get_rels_path(chartp);\n\t\t\t\t_ws = parse_chart(getzipstr(zip, chartp, true), chartp, opts, parse_rels(getzipstr(zip, crelsp, true), chartp), wb, _ws);\n\t\t\t\tbreak;\n\t\t\tcase 'macro': _ws = parse_ms(data, path, idx, opts, sheetRels[sheet], wb, themes, styles); break;\n\t\t\tcase 'dialog': _ws = parse_ds(data, path, idx, opts, sheetRels[sheet], wb, themes, styles); break;\n\t\t\tdefault: throw new Error(\"Unrecognized sheet type \" + stype);\n\t\t}\n\t\tsheets[sheet] = _ws;\n\n\t\t/* scan rels for comments and threaded comments */\n\t\tvar comments = [], tcomments = [];\n\t\tif(sheetRels && sheetRels[sheet]) keys(sheetRels[sheet]).forEach(function(n) {\n\t\t\tvar dfile = \"\";\n\t\t\tif(sheetRels[sheet][n].Type == RELS.CMNT) {\n\t\t\t\tdfile = resolve_path(sheetRels[sheet][n].Target, path);\n\t\t\t\tcomments = parse_cmnt(getzipdata(zip, dfile, true), dfile, opts);\n\t\t\t\tif(!comments || !comments.length) return;\n\t\t\t\tsheet_insert_comments(_ws, comments, false);\n\t\t\t}\n\t\t\tif(sheetRels[sheet][n].Type == RELS.TCMNT) {\n\t\t\t\tdfile = resolve_path(sheetRels[sheet][n].Target, path);\n\t\t\t\ttcomments = tcomments.concat(parse_tcmnt_xml(getzipdata(zip, dfile, true), opts));\n\t\t\t}\n\t\t});\n\t\tif(tcomments && tcomments.length) sheet_insert_comments(_ws, tcomments, true, opts.people || []);\n\t\tparse_sheet_legacy_drawing(_ws, stype, zip, path, idx, opts, wb, comments);\n\t} catch(e) { if(opts.WTF) throw e; }\n}\n\nfunction strip_front_slash(x/*:string*/)/*:string*/ { return x.charAt(0) == '/' ? x.slice(1) : x; }\n\nfunction parse_zip(zip/*:ZIP*/, opts/*:?ParseOpts*/)/*:Workbook*/ {\n\tmake_ssf();\n\topts = opts || {};\n\tfix_read_opts(opts);\n\n\t/* OpenDocument Part 3 Section 2.2.1 OpenDocument Package */\n\tif(safegetzipfile(zip, 'META-INF/manifest.xml')) return parse_ods(zip, opts);\n\t/* UOC */\n\tif(safegetzipfile(zip, 'objectdata.xml')) return parse_ods(zip, opts);\n\t/* Numbers */\n\tif(safegetzipfile(zip, 'Index/Document.iwa')) {\n\t\tif(typeof Uint8Array == \"undefined\") throw new Error('NUMBERS file parsing requires Uint8Array support');\n\t\tif(typeof parse_numbers_iwa != \"undefined\") {\n\t\t\tif(zip.FileIndex) return parse_numbers_iwa(zip, opts);\n\t\t\tvar _zip = CFB.utils.cfb_new();\n\t\t\tzipentries(zip).forEach(function(e) { zip_add_file(_zip, e, getzipbin(zip, e)); });\n\t\t\treturn parse_numbers_iwa(_zip, opts);\n\t\t}\n\t\tthrow new Error('Unsupported NUMBERS file');\n\t}\n\tif(!safegetzipfile(zip, '[Content_Types].xml')) {\n\t\tif(safegetzipfile(zip, 'index.xml.gz')) throw new Error('Unsupported NUMBERS 08 file');\n\t\tif(safegetzipfile(zip, 'index.xml')) throw new Error('Unsupported NUMBERS 09 file');\n\t\tvar index_zip = CFB.find(zip, 'Index.zip');\n\t\tif(index_zip) {\n\t\t\topts = dup(opts);\n\t\t\tdelete opts.type;\n\t\t\tif(typeof index_zip.content == \"string\") opts.type = \"binary\";\n\t\t\t// TODO: Bun buffer bug\n\t\t\tif(typeof Bun !== \"undefined\" && Buffer.isBuffer(index_zip.content)) return readSync(new Uint8Array(index_zip.content), opts);\n\t\t\treturn readSync(index_zip.content, opts);\n\t\t}\n\t\tthrow new Error('Unsupported ZIP file');\n\t}\n\n\tvar entries = zipentries(zip);\n\tvar dir = parse_ct((getzipstr(zip, '[Content_Types].xml')/*:?any*/));\n\tvar xlsb = false;\n\tvar sheets, binname;\n\tif(dir.workbooks.length === 0) {\n\t\tbinname = \"xl/workbook.xml\";\n\t\tif(getzipdata(zip,binname, true)) dir.workbooks.push(binname);\n\t}\n\tif(dir.workbooks.length === 0) {\n\t\tbinname = \"xl/workbook.bin\";\n\t\tif(!getzipdata(zip,binname,true)) throw new Error(\"Could not find workbook\");\n\t\tdir.workbooks.push(binname);\n\t\txlsb = true;\n\t}\n\tif(dir.workbooks[0].slice(-3) == \"bin\") xlsb = true;\n\n\tvar themes = ({}/*:any*/);\n\tvar styles = ({}/*:any*/);\n\tif(!opts.bookSheets && !opts.bookProps) {\n\t\tstrs = [];\n\t\tif(dir.sst) try { strs=parse_sst(getzipdata(zip, strip_front_slash(dir.sst)), dir.sst, opts); } catch(e) { if(opts.WTF) throw e; }\n\n\t\tif(opts.cellStyles && dir.themes.length) themes = parse_theme_xml(getzipstr(zip, dir.themes[0].replace(/^\\//,''), true)||\"\", opts);\n\n\t\tif(dir.style) styles = parse_sty(getzipdata(zip, strip_front_slash(dir.style)), dir.style, themes, opts);\n\t}\n\n\t/*var externbooks = */dir.links.map(function(link) {\n\t\ttry {\n\t\t\tvar rels = parse_rels(getzipstr(zip, get_rels_path(strip_front_slash(link))), link);\n\t\t\treturn parse_xlink(getzipdata(zip, strip_front_slash(link)), rels, link, opts);\n\t\t} catch(e) {}\n\t});\n\n\tvar wb = parse_wb(getzipdata(zip, strip_front_slash(dir.workbooks[0])), dir.workbooks[0], opts);\n\n\tvar props = {}, propdata = \"\";\n\n\tif(dir.coreprops.length) {\n\t\tpropdata = getzipdata(zip, strip_front_slash(dir.coreprops[0]), true);\n\t\tif(propdata) props = parse_core_props(propdata);\n\t\tif(dir.extprops.length !== 0) {\n\t\t\tpropdata = getzipdata(zip, strip_front_slash(dir.extprops[0]), true);\n\t\t\tif(propdata) parse_ext_props(propdata, props, opts);\n\t\t}\n\t}\n\n\tvar custprops = {};\n\tif(!opts.bookSheets || opts.bookProps) {\n\t\tif (dir.custprops.length !== 0) {\n\t\t\tpropdata = getzipstr(zip, strip_front_slash(dir.custprops[0]), true);\n\t\t\tif(propdata) custprops = parse_cust_props(propdata, opts);\n\t\t}\n\t}\n\n\tvar out = ({}/*:any*/);\n\tif(opts.bookSheets || opts.bookProps) {\n\t\tif(wb.Sheets) sheets = wb.Sheets.map(function pluck(x){ return x.name; });\n\t\telse if(props.Worksheets && props.SheetNames.length > 0) sheets=props.SheetNames;\n\t\tif(opts.bookProps) { out.Props = props; out.Custprops = custprops; }\n\t\tif(opts.bookSheets && typeof sheets !== 'undefined') out.SheetNames = sheets;\n\t\tif(opts.bookSheets ? out.SheetNames : opts.bookProps) return out;\n\t}\n\tsheets = {};\n\n\tvar deps = {};\n\tif(opts.bookDeps && dir.calcchain) deps=parse_cc(getzipdata(zip, strip_front_slash(dir.calcchain)),dir.calcchain,opts);\n\n\tvar i=0;\n\tvar sheetRels = ({}/*:any*/);\n\tvar path, relsPath;\n\n\t{\n\t\tvar wbsheets = wb.Sheets;\n\t\tprops.Worksheets = wbsheets.length;\n\t\tprops.SheetNames = [];\n\t\tfor(var j = 0; j != wbsheets.length; ++j) {\n\t\t\tprops.SheetNames[j] = wbsheets[j].name;\n\t\t}\n\t}\n\n\tvar wbext = xlsb ? \"bin\" : \"xml\";\n\tvar wbrelsi = dir.workbooks[0].lastIndexOf(\"/\");\n\tvar wbrelsfile = (dir.workbooks[0].slice(0, wbrelsi+1) + \"_rels/\" + dir.workbooks[0].slice(wbrelsi+1) + \".rels\").replace(/^\\//,\"\");\n\tif(!safegetzipfile(zip, wbrelsfile)) wbrelsfile = 'xl/_rels/workbook.' + wbext + '.rels';\n\tvar wbrels = parse_rels(getzipstr(zip, wbrelsfile, true), wbrelsfile.replace(/_rels.*/, \"s5s\"));\n\n\tif((dir.metadata || []).length >= 1) {\n\t\t/* TODO: MDX and other types of metadata */\n\t\topts.xlmeta = parse_xlmeta(getzipdata(zip, strip_front_slash(dir.metadata[0])),dir.metadata[0],opts);\n\t}\n\n\tif((dir.people || []).length >= 1) {\n\t\topts.people = parse_people_xml(getzipdata(zip, strip_front_slash(dir.people[0])),opts);\n\t}\n\n\tif(wbrels) wbrels = safe_parse_wbrels(wbrels, wb.Sheets);\n\n\t/* Numbers iOS hack */\n\tvar nmode = (getzipdata(zip,\"xl/worksheets/sheet.xml\",true))?1:0;\n\twsloop: for(i = 0; i != props.Worksheets; ++i) {\n\t\tvar stype = \"sheet\";\n\t\tif(wbrels && wbrels[i]) {\n\t\t\tpath = 'xl/' + (wbrels[i][1]).replace(/[\\/]?xl\\//, \"\");\n\t\t\tif(!safegetzipfile(zip, path)) path = wbrels[i][1];\n\t\t\tif(!safegetzipfile(zip, path)) path = wbrelsfile.replace(/_rels\\/[\\S\\s]*$/,\"\") + wbrels[i][1];\n\t\t\tstype = wbrels[i][2];\n\t\t} else {\n\t\t\tpath = 'xl/worksheets/sheet'+(i+1-nmode)+\".\" + wbext;\n\t\t\tpath = path.replace(/sheet0\\./,\"sheet.\");\n\t\t}\n\t\trelsPath = path.replace(/^(.*)(\\/)([^\\/]*)$/, \"$1/_rels/$3.rels\");\n\t\tif(opts && opts.sheets != null) switch(typeof opts.sheets) {\n\t\t\tcase \"number\": if(i != opts.sheets) continue wsloop; break;\n\t\t\tcase \"string\": if(props.SheetNames[i].toLowerCase() != opts.sheets.toLowerCase()) continue wsloop; break;\n\t\t\tdefault: if(Array.isArray && Array.isArray(opts.sheets)) {\n\t\t\t\tvar snjseen = false;\n\t\t\t\tfor(var snj = 0; snj != opts.sheets.length; ++snj) {\n\t\t\t\t\tif(typeof opts.sheets[snj] == \"number\" && opts.sheets[snj] == i) snjseen=1;\n\t\t\t\t\tif(typeof opts.sheets[snj] == \"string\" && opts.sheets[snj].toLowerCase() == props.SheetNames[i].toLowerCase()) snjseen = 1;\n\t\t\t\t}\n\t\t\t\tif(!snjseen) continue wsloop;\n\t\t\t}\n\t\t}\n\t\tsafe_parse_sheet(zip, path, relsPath, props.SheetNames[i], i, sheetRels, sheets, stype, opts, wb, themes, styles);\n\t}\n\n\tout = ({\n\t\tDirectory: dir,\n\t\tWorkbook: wb,\n\t\tProps: props,\n\t\tCustprops: custprops,\n\t\tDeps: deps,\n\t\tSheets: sheets,\n\t\tSheetNames: props.SheetNames,\n\t\tStrings: strs,\n\t\tStyles: styles,\n\t\tThemes: themes,\n\t\tSSF: dup(table_fmt)\n\t}/*:any*/);\n\tif(opts && opts.bookFiles) {\n\t\tif(zip.files) {\n\t\t\tout.keys = entries;\n\t\t\tout.files = zip.files;\n\t\t} else {\n\t\t\tout.keys = [];\n\t\t\tout.files = {};\n\t\t\tzip.FullPaths.forEach(function(p, idx) {\n\t\t\t\tp = p.replace(/^Root Entry[\\/]/, \"\");\n\t\t\t\tout.keys.push(p);\n\t\t\t\tout.files[p] = zip.FileIndex[idx];\n\t\t\t});\n\t\t}\n\t}\n\tif(opts && opts.bookVBA) {\n\t\tif(dir.vba.length > 0) out.vbaraw = getzipdata(zip,strip_front_slash(dir.vba[0]),true);\n\t\telse if(dir.defaults && dir.defaults.bin === CT_VBA) out.vbaraw = getzipdata(zip, 'xl/vbaProject.bin',true);\n\t}\n\t// TODO: pass back content types metadata for xlsm/xlsx resolution\n\tout.bookType = xlsb ? \"xlsb\" : \"xlsx\";\n\treturn out;\n}\n\n/* [MS-OFFCRYPTO] 2.1.1 */\nfunction parse_xlsxcfb(cfb, _opts/*:?ParseOpts*/)/*:Workbook*/ {\n\tvar opts = _opts || {};\n\tvar f = 'Workbook', data = CFB.find(cfb, f);\n\ttry {\n\tf = '/!DataSpaces/Version';\n\tdata = CFB.find(cfb, f); if(!data || !data.content) throw new Error(\"ECMA-376 Encrypted file missing \" + f);\n\t/*var version = */parse_DataSpaceVersionInfo(data.content);\n\n\t/* 2.3.4.1 */\n\tf = '/!DataSpaces/DataSpaceMap';\n\tdata = CFB.find(cfb, f); if(!data || !data.content) throw new Error(\"ECMA-376 Encrypted file missing \" + f);\n\tvar dsm = parse_DataSpaceMap(data.content);\n\tif(dsm.length !== 1 || dsm[0].comps.length !== 1 || dsm[0].comps[0].t !== 0 || dsm[0].name !== \"StrongEncryptionDataSpace\" || dsm[0].comps[0].v !== \"EncryptedPackage\")\n\t\tthrow new Error(\"ECMA-376 Encrypted file bad \" + f);\n\n\t/* 2.3.4.2 */\n\tf = '/!DataSpaces/DataSpaceInfo/StrongEncryptionDataSpace';\n\tdata = CFB.find(cfb, f); if(!data || !data.content) throw new Error(\"ECMA-376 Encrypted file missing \" + f);\n\tvar seds = parse_DataSpaceDefinition(data.content);\n\tif(seds.length != 1 || seds[0] != \"StrongEncryptionTransform\")\n\t\tthrow new Error(\"ECMA-376 Encrypted file bad \" + f);\n\n\t/* 2.3.4.3 */\n\tf = '/!DataSpaces/TransformInfo/StrongEncryptionTransform/!Primary';\n\tdata = CFB.find(cfb, f); if(!data || !data.content) throw new Error(\"ECMA-376 Encrypted file missing \" + f);\n\t/*var hdr = */parse_Primary(data.content);\n\t} catch(e) {}\n\n\tf = '/EncryptionInfo';\n\tdata = CFB.find(cfb, f); if(!data || !data.content) throw new Error(\"ECMA-376 Encrypted file missing \" + f);\n\tvar einfo = parse_EncryptionInfo(data.content);\n\n\t/* 2.3.4.4 */\n\tf = '/EncryptedPackage';\n\tdata = CFB.find(cfb, f); if(!data || !data.content) throw new Error(\"ECMA-376 Encrypted file missing \" + f);\n\n/*global decrypt_agile */\n/*:: declare var decrypt_agile:any; */\n\tif(einfo[0] == 0x04 && typeof decrypt_agile !== 'undefined') return decrypt_agile(einfo[1], data.content, opts.password || \"\", opts);\n/*global decrypt_std76 */\n/*:: declare var decrypt_std76:any; */\n\tif(einfo[0] == 0x02 && typeof decrypt_std76 !== 'undefined') return decrypt_std76(einfo[1], data.content, opts.password || \"\", opts);\n\tthrow new Error(\"File is password-protected\");\n}\n\nfunction write_zip_xlsb(wb/*:Workbook*/, opts/*:WriteOpts*/)/*:ZIP*/ {\n\tif(wb && !wb.SSF) {\n\t\twb.SSF = dup(table_fmt);\n\t}\n\tif(wb && wb.SSF) {\n\t\tmake_ssf(); SSF_load_table(wb.SSF);\n\t\t// $FlowIgnore\n\t\topts.revssf = evert_num(wb.SSF); opts.revssf[wb.SSF[65535]] = 0;\n\t\topts.ssf = wb.SSF;\n\t}\n\topts.rels = {}; opts.wbrels = {};\n\topts.Strings = /*::((*/[]/*:: :any):SST)*/; opts.Strings.Count = 0; opts.Strings.Unique = 0;\n\tif(browser_has_Map) opts.revStrings = new Map();\n\telse { opts.revStrings = {}; opts.revStrings.foo = []; delete opts.revStrings.foo; }\n\tvar wbext = \"bin\";\n\tvar vbafmt = true;\n\tvar ct = new_ct();\n\tfix_write_opts(opts = opts || {});\n\tvar zip = zip_new();\n\tvar f = \"\", rId = 0;\n\n\topts.cellXfs = [];\n\tget_cell_style(opts.cellXfs, {}, {revssf:{\"General\":0}});\n\n\tif(!wb.Props) wb.Props = {};\n\n\tf = \"docProps/core.xml\";\n\tzip_add_file(zip, f, write_core_props(wb.Props, opts));\n\tct.coreprops.push(f);\n\tadd_rels(opts.rels, 2, f, RELS.CORE_PROPS);\n\n\t/*::if(!wb.Props) throw \"unreachable\"; */\n\tf = \"docProps/app.xml\";\n\tif(wb.Props && wb.Props.SheetNames){/* empty */}\n\telse if(!wb.Workbook || !wb.Workbook.Sheets) wb.Props.SheetNames = wb.SheetNames;\n\telse {\n\t\tvar _sn = [];\n\t\tfor(var _i = 0; _i < wb.SheetNames.length; ++_i)\n\t\t\tif((wb.Workbook.Sheets[_i]||{}).Hidden != 2) _sn.push(wb.SheetNames[_i]);\n\t\twb.Props.SheetNames = _sn;\n\t}\n\twb.Props.Worksheets = wb.Props.SheetNames.length;\n\tzip_add_file(zip, f, write_ext_props(wb.Props, opts));\n\tct.extprops.push(f);\n\tadd_rels(opts.rels, 3, f, RELS.EXT_PROPS);\n\n\tif(wb.Custprops !== wb.Props && keys(wb.Custprops||{}).length > 0) {\n\t\tf = \"docProps/custom.xml\";\n\t\tzip_add_file(zip, f, write_cust_props(wb.Custprops, opts));\n\t\tct.custprops.push(f);\n\t\tadd_rels(opts.rels, 4, f, RELS.CUST_PROPS);\n\t}\n\n\tvar people = [\"SheetJ5\"];\n\topts.tcid = 0;\n\n\tfor(rId=1;rId <= wb.SheetNames.length; ++rId) {\n\t\tvar wsrels = {'!id':{}};\n\t\tvar ws = wb.Sheets[wb.SheetNames[rId-1]];\n\t\tvar _type = (ws || {})[\"!type\"] || \"sheet\";\n\t\tswitch(_type) {\n\t\tcase \"chart\":\n\t\t\t/* falls through */\n\t\tdefault:\n\t\t\tf = \"xl/worksheets/sheet\" + rId + \".\" + wbext;\n\t\t\tzip_add_file(zip, f, write_ws_bin(rId-1, opts, wb, wsrels));\n\t\t\tct.sheets.push(f);\n\t\t\tadd_rels(opts.wbrels, -1, \"worksheets/sheet\" + rId + \".\" + wbext, RELS.WS[0]);\n\t\t}\n\n\t\tif(ws) {\n\t\t\tvar comments = ws['!comments'];\n\t\t\tvar need_vml = false;\n\t\t\tvar cf = \"\";\n\t\t\tif(comments && comments.length > 0) {\n\t\t\t\tvar needtc = false;\n\t\t\t\tcomments.forEach(function(carr) {\n\t\t\t\t\tcarr[1].forEach(function(c) { if(c.T == true) needtc = true; });\n\t\t\t\t});\n\t\t\t\tif(needtc) {\n\t\t\t\t\tcf = \"xl/threadedComments/threadedComment\" + rId + \".xml\";\n\t\t\t\t\tzip_add_file(zip, cf, write_tcmnt_xml(comments, people, opts));\n\t\t\t\t\tct.threadedcomments.push(cf);\n\t\t\t\t\tadd_rels(wsrels, -1, \"../threadedComments/threadedComment\" + rId + \".xml\", RELS.TCMNT);\n\t\t\t\t}\n\n\t\t\t\tcf = \"xl/comments\" + rId + \".\" + wbext;\n\t\t\t\tzip_add_file(zip, cf, write_comments_bin(comments, opts));\n\t\t\t\tct.comments.push(cf);\n\t\t\t\tadd_rels(wsrels, -1, \"../comments\" + rId + \".\" + wbext, RELS.CMNT);\n\t\t\t\tneed_vml = true;\n\t\t\t}\n\t\t\tif(ws['!legacy']) {\n\t\t\t\tif(need_vml) zip_add_file(zip, \"xl/drawings/vmlDrawing\" + (rId) + \".vml\", write_vml(rId, ws['!comments']));\n\t\t\t}\n\t\t\tdelete ws['!comments'];\n\t\t\tdelete ws['!legacy'];\n\t\t}\n\n\t\tif(wsrels['!id'].rId1) zip_add_file(zip, get_rels_path(f), write_rels(wsrels));\n\t}\n\n\tif(opts.Strings != null && opts.Strings.length > 0) {\n\t\tf = \"xl/sharedStrings.\" + wbext;\n\t\tzip_add_file(zip, f, write_sst_bin(opts.Strings, opts));\n\t\tct.strs.push(f);\n\t\tadd_rels(opts.wbrels, -1, \"sharedStrings.\" + wbext, RELS.SST);\n\t}\n\n\tf = \"xl/workbook.\" + wbext;\n\tzip_add_file(zip, f, write_wb_bin(wb, opts));\n\tct.workbooks.push(f);\n\tadd_rels(opts.rels, 1, f, RELS.WB);\n\n\t/* TODO: something more intelligent with themes */\n\n\tf = \"xl/theme/theme1.xml\";\n\tvar ww = write_theme(wb.Themes, opts);\n\tzip_add_file(zip, f, ww);\n\tct.themes.push(f);\n\tadd_rels(opts.wbrels, -1, \"theme/theme1.xml\", RELS.THEME);\n\n\t/* TODO: something more intelligent with styles */\n\n\tf = \"xl/styles.\" + wbext;\n\tzip_add_file(zip, f, write_sty_bin(wb, opts));\n\tct.styles.push(f);\n\tadd_rels(opts.wbrels, -1, \"styles.\" + wbext, RELS.STY);\n\n\tif(wb.vbaraw && vbafmt) {\n\t\tf = \"xl/vbaProject.bin\";\n\t\tzip_add_file(zip, f, wb.vbaraw);\n\t\tct.vba.push(f);\n\t\tadd_rels(opts.wbrels, -1, \"vbaProject.bin\", RELS.VBA);\n\t}\n\n\tf = \"xl/metadata.\" + wbext;\n\tzip_add_file(zip, f, write_xlmeta_bin());\n\tct.metadata.push(f);\n\tadd_rels(opts.wbrels, -1, \"metadata.\" + wbext, RELS.XLMETA);\n\n\tif(people.length > 1) {\n\t\tf = \"xl/persons/person.xml\";\n\t\tzip_add_file(zip, f, write_people_xml(people, opts));\n\t\tct.people.push(f);\n\t\tadd_rels(opts.wbrels, -1, \"persons/person.xml\", RELS.PEOPLE);\n\t}\n\n\tzip_add_file(zip, \"[Content_Types].xml\", write_ct(ct, opts));\n\tzip_add_file(zip, '_rels/.rels', write_rels(opts.rels));\n\tzip_add_file(zip, 'xl/_rels/workbook.' + wbext + '.rels', write_rels(opts.wbrels));\n\n\tdelete opts.revssf; delete opts.ssf;\n\treturn zip;\n}\n\nfunction write_zip_xlsx(wb/*:Workbook*/, opts/*:WriteOpts*/)/*:ZIP*/ {\n\tif(wb && !wb.SSF) {\n\t\twb.SSF = dup(table_fmt);\n\t}\n\tif(wb && wb.SSF) {\n\t\tmake_ssf(); SSF_load_table(wb.SSF);\n\t\t// $FlowIgnore\n\t\topts.revssf = evert_num(wb.SSF); opts.revssf[wb.SSF[65535]] = 0;\n\t\topts.ssf = wb.SSF;\n\t}\n\topts.rels = {}; opts.wbrels = {};\n\topts.Strings = /*::((*/[]/*:: :any):SST)*/; opts.Strings.Count = 0; opts.Strings.Unique = 0;\n\tif(browser_has_Map) opts.revStrings = new Map();\n\telse { opts.revStrings = {}; opts.revStrings.foo = []; delete opts.revStrings.foo; }\n\tvar wbext = \"xml\";\n\tvar vbafmt = VBAFMTS.indexOf(opts.bookType) > -1;\n\tvar ct = new_ct();\n\tfix_write_opts(opts = opts || {});\n\tvar zip = zip_new();\n\tvar f = \"\", rId = 0;\n\n\topts.cellXfs = [];\n\tget_cell_style(opts.cellXfs, {}, {revssf:{\"General\":0}});\n\n\tif(!wb.Props) wb.Props = {};\n\n\tf = \"docProps/core.xml\";\n\tzip_add_file(zip, f, write_core_props(wb.Props, opts));\n\tct.coreprops.push(f);\n\tadd_rels(opts.rels, 2, f, RELS.CORE_PROPS);\n\n\t/*::if(!wb.Props) throw \"unreachable\"; */\n\tf = \"docProps/app.xml\";\n\tif(wb.Props && wb.Props.SheetNames){/* empty */}\n\telse if(!wb.Workbook || !wb.Workbook.Sheets) wb.Props.SheetNames = wb.SheetNames;\n\telse {\n\t\tvar _sn = [];\n\t\tfor(var _i = 0; _i < wb.SheetNames.length; ++_i)\n\t\t\tif((wb.Workbook.Sheets[_i]||{}).Hidden != 2) _sn.push(wb.SheetNames[_i]);\n\t\twb.Props.SheetNames = _sn;\n\t}\n\twb.Props.Worksheets = wb.Props.SheetNames.length;\n\tzip_add_file(zip, f, write_ext_props(wb.Props, opts));\n\tct.extprops.push(f);\n\tadd_rels(opts.rels, 3, f, RELS.EXT_PROPS);\n\n\tif(wb.Custprops !== wb.Props && keys(wb.Custprops||{}).length > 0) {\n\t\tf = \"docProps/custom.xml\";\n\t\tzip_add_file(zip, f, write_cust_props(wb.Custprops, opts));\n\t\tct.custprops.push(f);\n\t\tadd_rels(opts.rels, 4, f, RELS.CUST_PROPS);\n\t}\n\n\tvar people = [\"SheetJ5\"];\n\topts.tcid = 0;\n\n\tfor(rId=1;rId <= wb.SheetNames.length; ++rId) {\n\t\tvar wsrels = {'!id':{}};\n\t\tvar ws = wb.Sheets[wb.SheetNames[rId-1]];\n\t\tvar _type = (ws || {})[\"!type\"] || \"sheet\";\n\t\tswitch(_type) {\n\t\tcase \"chart\":\n\t\t\t/* falls through */\n\t\tdefault:\n\t\t\tf = \"xl/worksheets/sheet\" + rId + \".\" + wbext;\n\t\t\tzip_add_file(zip, f, write_ws_xml(rId-1, opts, wb, wsrels));\n\t\t\tct.sheets.push(f);\n\t\t\tadd_rels(opts.wbrels, -1, \"worksheets/sheet\" + rId + \".\" + wbext, RELS.WS[0]);\n\t\t}\n\n\t\tif(ws) {\n\t\t\tvar comments = ws['!comments'];\n\t\t\tvar need_vml = false;\n\t\t\tvar cf = \"\";\n\t\t\tif(comments && comments.length > 0) {\n\t\t\t\tvar needtc = false;\n\t\t\t\tcomments.forEach(function(carr) {\n\t\t\t\t\tcarr[1].forEach(function(c) { if(c.T == true) needtc = true; });\n\t\t\t\t});\n\t\t\t\tif(needtc) {\n\t\t\t\t\tcf = \"xl/threadedComments/threadedComment\" + rId + \".xml\";\n\t\t\t\t\tzip_add_file(zip, cf, write_tcmnt_xml(comments, people, opts));\n\t\t\t\t\tct.threadedcomments.push(cf);\n\t\t\t\t\tadd_rels(wsrels, -1, \"../threadedComments/threadedComment\" + rId + \".xml\", RELS.TCMNT);\n\t\t\t\t}\n\n\t\t\t\tcf = \"xl/comments\" + rId + \".\" + wbext;\n\t\t\t\tzip_add_file(zip, cf, write_comments_xml(comments, opts));\n\t\t\t\tct.comments.push(cf);\n\t\t\t\tadd_rels(wsrels, -1, \"../comments\" + rId + \".\" + wbext, RELS.CMNT);\n\t\t\t\tneed_vml = true;\n\t\t\t}\n\t\t\tif(ws['!legacy']) {\n\t\t\t\tif(need_vml) zip_add_file(zip, \"xl/drawings/vmlDrawing\" + (rId) + \".vml\", write_vml(rId, ws['!comments']));\n\t\t\t}\n\t\t\tdelete ws['!comments'];\n\t\t\tdelete ws['!legacy'];\n\t\t}\n\n\t\tif(wsrels['!id'].rId1) zip_add_file(zip, get_rels_path(f), write_rels(wsrels));\n\t}\n\n\tif(opts.Strings != null && opts.Strings.length > 0) {\n\t\tf = \"xl/sharedStrings.\" + wbext;\n\t\tzip_add_file(zip, f, write_sst_xml(opts.Strings, opts));\n\t\tct.strs.push(f);\n\t\tadd_rels(opts.wbrels, -1, \"sharedStrings.\" + wbext, RELS.SST);\n\t}\n\n\tf = \"xl/workbook.\" + wbext;\n\tzip_add_file(zip, f, write_wb_xml(wb, opts));\n\tct.workbooks.push(f);\n\tadd_rels(opts.rels, 1, f, RELS.WB);\n\n\t/* TODO: something more intelligent with themes */\n\n\tf = \"xl/theme/theme1.xml\";\n\tzip_add_file(zip, f, write_theme(wb.Themes, opts));\n\tct.themes.push(f);\n\tadd_rels(opts.wbrels, -1, \"theme/theme1.xml\", RELS.THEME);\n\n\t/* TODO: something more intelligent with styles */\n\n\tf = \"xl/styles.\" + wbext;\n\tzip_add_file(zip, f, write_sty_xml(wb, opts));\n\tct.styles.push(f);\n\tadd_rels(opts.wbrels, -1, \"styles.\" + wbext, RELS.STY);\n\n\tif(wb.vbaraw && vbafmt) {\n\t\tf = \"xl/vbaProject.bin\";\n\t\tzip_add_file(zip, f, wb.vbaraw);\n\t\tct.vba.push(f);\n\t\tadd_rels(opts.wbrels, -1, \"vbaProject.bin\", RELS.VBA);\n\t}\n\n\tf = \"xl/metadata.\" + wbext;\n\tzip_add_file(zip, f, write_xlmeta_xml());\n\tct.metadata.push(f);\n\tadd_rels(opts.wbrels, -1, \"metadata.\" + wbext, RELS.XLMETA);\n\n\tif(people.length > 1) {\n\t\tf = \"xl/persons/person.xml\";\n\t\tzip_add_file(zip, f, write_people_xml(people, opts));\n\t\tct.people.push(f);\n\t\tadd_rels(opts.wbrels, -1, \"persons/person.xml\", RELS.PEOPLE);\n\t}\n\n\tzip_add_file(zip, \"[Content_Types].xml\", write_ct(ct, opts));\n\tzip_add_file(zip, '_rels/.rels', write_rels(opts.rels));\n\tzip_add_file(zip, 'xl/_rels/workbook.' + wbext + '.rels', write_rels(opts.wbrels));\n\n\tdelete opts.revssf; delete opts.ssf;\n\treturn zip;\n}\n\nfunction firstbyte(f/*:RawData*/,o/*:?TypeOpts*/)/*:Array*/ {\n\tvar x = \"\";\n\tswitch((o||{}).type || \"base64\") {\n\t\tcase 'buffer': return [f[0], f[1], f[2], f[3], f[4], f[5], f[6], f[7]];\n\t\tcase 'base64': x = Base64_decode(f.slice(0,12)); break;\n\t\tcase 'binary': x = f; break;\n\t\tcase 'array': return [f[0], f[1], f[2], f[3], f[4], f[5], f[6], f[7]];\n\t\tdefault: throw new Error(\"Unrecognized type \" + (o && o.type || \"undefined\"));\n\t}\n\treturn [x.charCodeAt(0), x.charCodeAt(1), x.charCodeAt(2), x.charCodeAt(3), x.charCodeAt(4), x.charCodeAt(5), x.charCodeAt(6), x.charCodeAt(7)];\n}\n\nfunction read_cfb(cfb/*:CFBContainer*/, opts/*:?ParseOpts*/)/*:Workbook*/ {\n\tif(CFB.find(cfb, \"EncryptedPackage\")) return parse_xlsxcfb(cfb, opts);\n\treturn parse_xlscfb(cfb, opts);\n}\n\nfunction read_zip(data/*:RawData*/, opts/*:?ParseOpts*/)/*:Workbook*/ {\n\tvar zip, d = data;\n\tvar o = opts||{};\n\tif(!o.type) o.type = (has_buf && Buffer.isBuffer(data)) ? \"buffer\" : \"base64\";\n\tzip = zip_read(d, o);\n\treturn parse_zip(zip, o);\n}\n\nfunction read_plaintext(data/*:string*/, o/*:ParseOpts*/)/*:Workbook*/ {\n\tvar i = 0;\n\tmain: while(i < data.length) switch(data.charCodeAt(i)) {\n\t\tcase 0x0A: case 0x0D: case 0x20: ++i; break;\n\t\tcase 0x3C: return parse_xlml(data.slice(i),o);\n\t\tdefault: break main;\n\t}\n\treturn PRN.to_workbook(data, o);\n}\n\nfunction read_plaintext_raw(data/*:RawData*/, o/*:ParseOpts*/)/*:Workbook*/ {\n\tvar str = \"\", bytes = firstbyte(data, o);\n\tswitch(o.type) {\n\t\tcase 'base64': str = Base64_decode(data); break;\n\t\tcase 'binary': str = data; break;\n\t\tcase 'buffer': str = data.toString('binary'); break;\n\t\tcase 'array': str = cc2str(data); break;\n\t\tdefault: throw new Error(\"Unrecognized type \" + o.type);\n\t}\n\tif(bytes[0] == 0xEF && bytes[1] == 0xBB && bytes[2] == 0xBF) str = utf8read(str);\n\to.type = \"binary\";\n\treturn read_plaintext(str, o);\n}\n\nfunction read_utf16(data/*:RawData*/, o/*:ParseOpts*/)/*:Workbook*/ {\n\tvar d = data;\n\tif(o.type == 'base64') d = Base64_decode(d);\n\tif(typeof ArrayBuffer !== \"undefined\" && data instanceof ArrayBuffer) d = new Uint8Array(data);\n\td = typeof $cptable !== \"undefined\" ? $cptable.utils.decode(1200, d.slice(2), 'str') : (\n\t\t(has_buf && Buffer.isBuffer(data)) ? data.slice(2).toString(\"utf16le\") :\n\t\t(typeof Uint8Array !== \"undefined\" && d instanceof Uint8Array) ? (\n\t\t\ttypeof TextDecoder !== \"undefined\" ? new TextDecoder(\"utf-16le\").decode(d.slice(2)) : utf16lereadu(d.slice(2))\n\t\t) : utf16leread(d.slice(2))\n\t);\n\to.type = \"binary\";\n\treturn read_plaintext(d, o);\n}\n\nfunction bstrify(data/*:string*/)/*:string*/ {\n\treturn !data.match(/[^\\x00-\\x7F]/) ? data : utf8write(data);\n}\n\nfunction read_prn(data, d, o, str) {\n\tif(str) { o.type = \"string\"; return PRN.to_workbook(data, o); }\n\treturn PRN.to_workbook(d, o);\n}\n\nfunction readSync(data/*:RawData*/, opts/*:?ParseOpts*/)/*:Workbook*/ {\n\treset_cp();\n\tvar o = opts||{};\n\tif(o.codepage && typeof $cptable === \"undefined\") console.error(\"Codepage tables are not loaded. Non-ASCII characters may not give expected results\");\n\tif(typeof ArrayBuffer !== 'undefined' && data instanceof ArrayBuffer) return readSync(new Uint8Array(data), (o = dup(o), o.type = \"array\", o));\n\t/* Javet projects `byte[]` to `Int8Array` */\n\tif(typeof Int8Array !== 'undefined' && data instanceof Int8Array) return readSync(new Uint8Array(data.buffer, data.byteOffset, data.length), o);\n\tif(typeof Uint8Array !== 'undefined' && data instanceof Uint8Array && !o.type) o.type = typeof Deno !== \"undefined\" ? \"buffer\" : \"array\";\n\tvar d = data, n = [0,0,0,0], str = false;\n\tif(o.cellStyles) { o.cellNF = true; o.sheetStubs = true; }\n\t_ssfopts = {};\n\tif(o.dateNF) _ssfopts.dateNF = o.dateNF;\n\tif(!o.type) o.type = (has_buf && Buffer.isBuffer(data)) ? \"buffer\" : \"base64\";\n\tif(o.type == \"file\") { o.type = has_buf ? \"buffer\" : \"binary\"; d = read_binary(data); if(typeof Uint8Array !== 'undefined' && !has_buf) o.type = \"array\"; }\n\tif(o.type == \"string\") { str = true; o.type = \"binary\"; o.codepage = 65001; d = bstrify(data); }\n\tif(o.type == 'array' && typeof Uint8Array !== 'undefined' && data instanceof Uint8Array && typeof ArrayBuffer !== 'undefined') {\n\t\t// $FlowIgnore\n\t\tvar ab=new ArrayBuffer(3), vu=new Uint8Array(ab); vu.foo=\"bar\";\n\t\t// $FlowIgnore\n\t\tif(!vu.foo) {o=dup(o); o.type='array'; return readSync(ab2a(d), o);}\n\t}\n\tswitch((n = firstbyte(d, o))[0]) {\n\t\tcase 0xD0: if(n[1] === 0xCF && n[2] === 0x11 && n[3] === 0xE0 && n[4] === 0xA1 && n[5] === 0xB1 && n[6] === 0x1A && n[7] === 0xE1) return read_cfb(CFB.read(d, o), o); break;\n\t\tcase 0x09: if(n[1] <= 0x08) return parse_xlscfb(d, o); break;\n\t\tcase 0x3C: return parse_xlml(d, o);\n\t\tcase 0x49:\n\t\t\tif(n[1] === 0x49 && n[2] === 0x2a && n[3] === 0x00) throw new Error(\"TIFF Image File is not a spreadsheet\");\n\t\t\tif(n[1] === 0x44) return read_wb_ID(d, o);\n\t\t\tbreak;\n\t\tcase 0x54: if(n[1] === 0x41 && n[2] === 0x42 && n[3] === 0x4C) return DIF.to_workbook(d, o); break;\n\t\tcase 0x50: return (n[1] === 0x4B && n[2] < 0x09 && n[3] < 0x09) ? read_zip(d, o) : read_prn(data, d, o, str);\n\t\tcase 0xEF: return n[3] === 0x3C ? parse_xlml(d, o) : read_prn(data, d, o, str);\n\t\tcase 0xFF:\n\t\t\tif(n[1] === 0xFE) { return read_utf16(d, o); }\n\t\t\telse if(n[1] === 0x00 && n[2] === 0x02 && n[3] === 0x00) return WK_.to_workbook(d, o);\n\t\t\tbreak;\n\t\tcase 0x00:\n\t\t\tif(n[1] === 0x00) {\n\t\t\t\tif(n[2] >= 0x02 && n[3] === 0x00) return WK_.to_workbook(d, o);\n\t\t\t\tif(n[2] === 0x00 && (n[3] === 0x08 || n[3] === 0x09)) return WK_.to_workbook(d, o);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 0x03: case 0x83: case 0x8B: case 0x8C: return DBF.to_workbook(d, o);\n\t\tcase 0x7B: if(n[1] === 0x5C && n[2] === 0x72 && n[3] === 0x74) return rtf_to_workbook(d, o); break;\n\t\tcase 0x0A: case 0x0D: case 0x20: return read_plaintext_raw(d, o);\n\t\tcase 0x89: if(n[1] === 0x50 && n[2] === 0x4E && n[3] === 0x47) throw new Error(\"PNG Image File is not a spreadsheet\"); break;\n\t\tcase 0x08: if(n[1] === 0xE7) throw new Error(\"Unsupported Multiplan 1.x file!\"); break;\n\t\tcase 0x0C:\n\t\t\tif(n[1] === 0xEC) throw new Error(\"Unsupported Multiplan 2.x file!\");\n\t\t\tif(n[1] === 0xED) throw new Error(\"Unsupported Multiplan 3.x file!\");\n\t\t\tbreak;\n\t}\n\tif(DBF_SUPPORTED_VERSIONS.indexOf(n[0]) > -1 && n[2] <= 12 && n[3] <= 31) return DBF.to_workbook(d, o);\n\treturn read_prn(data, d, o, str);\n}\n\nfunction readFileSync(filename/*:string*/, opts/*:?ParseOpts*/)/*:Workbook*/ {\n\tvar o = opts||{}; o.type = 'file';\n\treturn readSync(filename, o);\n}\nfunction write_cfb_ctr(cfb/*:CFBContainer*/, o/*:WriteOpts*/)/*:any*/ {\n\tswitch(o.type) {\n\t\tcase \"base64\": case \"binary\": break;\n\t\tcase \"buffer\": case \"array\": o.type = \"\"; break;\n\t\tcase \"file\": return write_dl(o.file, CFB.write(cfb, {type:has_buf ? 'buffer' : \"\"}));\n\t\tcase \"string\": throw new Error(\"'string' output type invalid for '\" + o.bookType + \"' files\");\n\t\tdefault: throw new Error(\"Unrecognized type \" + o.type);\n\t}\n\treturn CFB.write(cfb, o);\n}\n\nfunction write_zip(wb/*:Workbook*/, opts/*:WriteOpts*/)/*:ZIP*/ {\n\tswitch(opts.bookType) {\n\t\tcase \"ods\": return write_ods(wb, opts);\n\t\tcase \"numbers\": return write_numbers_iwa(wb, opts);\n\t\tcase \"xlsb\": return write_zip_xlsb(wb, opts);\n\t\tdefault: return write_zip_xlsx(wb, opts);\n\t}\n}\n\n/*:: declare var encrypt_agile:any; */\nfunction write_zip_type(wb/*:Workbook*/, opts/*:?WriteOpts*/)/*:any*/ {\n\tvar o = dup(opts||{});\n\tvar z = write_zip(wb, o);\n\treturn write_zip_denouement(z, o);\n}\nfunction write_zip_typeXLSX(wb/*:Workbook*/, opts/*:?WriteOpts*/)/*:any*/ {\n\tvar o = dup(opts||{});\n\tvar z = write_zip_xlsx(wb, o);\n\treturn write_zip_denouement(z, o);\n}\nfunction write_zip_denouement(z/*:any*/, o/*:?WriteOpts*/)/*:any*/ {\n\tvar oopts = {};\n\tvar ftype = has_buf ? \"nodebuffer\" : (typeof Uint8Array !== \"undefined\" ? \"array\" : \"string\");\n\tif(o.compression) oopts.compression = 'DEFLATE';\n\tif(o.password) oopts.type = ftype;\n\telse switch(o.type) {\n\t\tcase \"base64\": oopts.type = \"base64\"; break;\n\t\tcase \"binary\": oopts.type = \"string\"; break;\n\t\tcase \"string\": throw new Error(\"'string' output type invalid for '\" + o.bookType + \"' files\");\n\t\tcase \"buffer\":\n\t\tcase \"file\": oopts.type = ftype; break;\n\t\tdefault: throw new Error(\"Unrecognized type \" + o.type);\n\t}\n\tvar out = z.FullPaths ? CFB.write(z, {fileType:\"zip\", type: /*::(*/{\"nodebuffer\": \"buffer\", \"string\": \"binary\"}/*:: :any)*/[oopts.type] || oopts.type, compression: !!o.compression}) : z.generate(oopts);\n\tif(typeof Deno !== \"undefined\") {\n\t\tif(typeof out == \"string\") {\n\t\t\tif(o.type == \"binary\" || o.type == \"base64\") return out;\n\t\t\tout = new Uint8Array(s2ab(out));\n\t\t}\n\t}\n/*jshint -W083 */\n\tif(o.password && typeof encrypt_agile !== 'undefined') return write_cfb_ctr(encrypt_agile(out, o.password), o); // eslint-disable-line no-undef\n/*jshint +W083 */\n\tif(o.type === \"file\") return write_dl(o.file, out);\n\treturn o.type == \"string\" ? utf8read(/*::(*/out/*:: :any)*/) : out;\n}\n\nfunction write_cfb_type(wb/*:Workbook*/, opts/*:?WriteOpts*/)/*:any*/ {\n\tvar o = opts||{};\n\tvar cfb/*:CFBContainer*/ = write_xlscfb(wb, o);\n\treturn write_cfb_ctr(cfb, o);\n}\n\nfunction write_string_type(out/*:string*/, opts/*:WriteOpts*/, bom/*:?string*/)/*:any*/ {\n\tif(!bom) bom = \"\";\n\tvar o = bom + out;\n\tswitch(opts.type) {\n\t\tcase \"base64\": return Base64_encode(utf8write(o));\n\t\tcase \"binary\": return utf8write(o);\n\t\tcase \"string\": return out;\n\t\tcase \"file\": return write_dl(opts.file, o, 'utf8');\n\t\tcase \"buffer\": {\n\t\t\tif(has_buf) return Buffer_from(o, 'utf8');\n\t\t\telse if(typeof TextEncoder !== \"undefined\") return new TextEncoder().encode(o);\n\t\t\telse return write_string_type(o, {type:'binary'}).split(\"\").map(function(c) { return c.charCodeAt(0); });\n\t\t}\n\t}\n\tthrow new Error(\"Unrecognized type \" + opts.type);\n}\n\nfunction write_stxt_type(out/*:string*/, opts/*:WriteOpts*/)/*:any*/ {\n\tswitch(opts.type) {\n\t\tcase \"base64\": return Base64_encode_pass(out);\n\t\tcase \"binary\": return out;\n\t\tcase \"string\": return out; /* override in sheet_to_txt */\n\t\tcase \"file\": return write_dl(opts.file, out, 'binary');\n\t\tcase \"buffer\": {\n\t\t\tif(has_buf) return Buffer_from(out, 'binary');\n\t\t\telse return out.split(\"\").map(function(c) { return c.charCodeAt(0); });\n\t\t}\n\t}\n\tthrow new Error(\"Unrecognized type \" + opts.type);\n}\n\n/* TODO: test consistency */\nfunction write_binary_type(out, opts/*:WriteOpts*/)/*:any*/ {\n\tswitch(opts.type) {\n\t\tcase \"string\":\n\t\tcase \"base64\":\n\t\tcase \"binary\":\n\t\t\tvar bstr = \"\";\n\t\t\t// $FlowIgnore\n\t\t\tfor(var i = 0; i < out.length; ++i) bstr += String.fromCharCode(out[i]);\n\t\t\treturn opts.type == 'base64' ? Base64_encode(bstr) : opts.type == 'string' ? utf8read(bstr) : bstr;\n\t\tcase \"file\": return write_dl(opts.file, out);\n\t\tcase \"buffer\": return out;\n\t\tdefault: throw new Error(\"Unrecognized type \" + opts.type);\n\t}\n}\n\nfunction writeSyncXLSX(wb/*:Workbook*/, opts/*:?WriteOpts*/) {\n\treset_cp();\n\tcheck_wb(wb);\n\tvar o = dup(opts||{});\n\tif(o.cellStyles) { o.cellNF = true; o.sheetStubs = true; }\n\tif(o.type == \"array\") { o.type = \"binary\"; var out/*:string*/ = (writeSyncXLSX(wb, o)/*:any*/); o.type = \"array\"; return s2ab(out); }\n\treturn write_zip_typeXLSX(wb, o);\n}\n\nfunction writeSync(wb/*:Workbook*/, opts/*:?WriteOpts*/) {\n\treset_cp();\n\tcheck_wb(wb);\n\tvar o = dup(opts||{});\n\tif(o.cellStyles) { o.cellNF = true; o.sheetStubs = true; }\n\tif(o.type == \"array\") { o.type = \"binary\"; var out/*:string*/ = (writeSync(wb, o)/*:any*/); o.type = \"array\"; return s2ab(out); }\n\tvar idx = 0;\n\tif(o.sheet) {\n\t\tif(typeof o.sheet == \"number\") idx = o.sheet;\n\t\telse idx = wb.SheetNames.indexOf(o.sheet);\n\t\tif(!wb.SheetNames[idx]) throw new Error(\"Sheet not found: \" + o.sheet + \" : \" + (typeof o.sheet));\n\t}\n\tswitch(o.bookType || 'xlsb') {\n\t\tcase 'xml':\n\t\tcase 'xlml': return write_string_type(write_xlml(wb, o), o);\n\t\tcase 'slk':\n\t\tcase 'sylk': return write_string_type(SYLK.from_sheet(wb.Sheets[wb.SheetNames[idx]], o, wb), o);\n\t\tcase 'htm':\n\t\tcase 'html': return write_string_type(sheet_to_html(wb.Sheets[wb.SheetNames[idx]], o), o);\n\t\tcase 'txt': return write_stxt_type(sheet_to_txt(wb.Sheets[wb.SheetNames[idx]], o), o);\n\t\tcase 'csv': return write_string_type(sheet_to_csv(wb.Sheets[wb.SheetNames[idx]], o), o, \"\\ufeff\");\n\t\tcase 'dif': return write_string_type(DIF.from_sheet(wb.Sheets[wb.SheetNames[idx]], o), o);\n\t\tcase 'dbf': return write_binary_type(DBF.from_sheet(wb.Sheets[wb.SheetNames[idx]], o), o);\n\t\tcase 'prn': return write_string_type(PRN.from_sheet(wb.Sheets[wb.SheetNames[idx]], o), o);\n\t\tcase 'rtf': return write_string_type(sheet_to_rtf(wb.Sheets[wb.SheetNames[idx]], o), o);\n\t\tcase 'eth': return write_string_type(ETH.from_sheet(wb.Sheets[wb.SheetNames[idx]], o), o);\n\t\tcase 'fods': return write_string_type(write_ods(wb, o), o);\n\t\tcase 'wk1': return write_binary_type(WK_.sheet_to_wk1(wb.Sheets[wb.SheetNames[idx]], o), o);\n\t\tcase 'wk3': return write_binary_type(WK_.book_to_wk3(wb, o), o);\n\t\tcase 'biff2': if(!o.biff) o.biff = 2; /* falls through */\n\t\tcase 'biff3': if(!o.biff) o.biff = 3; /* falls through */\n\t\tcase 'biff4': if(!o.biff) o.biff = 4; return write_binary_type(write_biff_buf(wb, o), o);\n\t\tcase 'biff5': if(!o.biff) o.biff = 5; /* falls through */\n\t\tcase 'biff8':\n\t\tcase 'xla':\n\t\tcase 'xls': if(!o.biff) o.biff = 8; return write_cfb_type(wb, o);\n\t\tcase 'xlsx':\n\t\tcase 'xlsm':\n\t\tcase 'xlam':\n\t\tcase 'xlsb':\n\t\tcase 'numbers':\n\t\tcase 'ods': return write_zip_type(wb, o);\n\t\tdefault: throw new Error (\"Unrecognized bookType |\" + o.bookType + \"|\");\n\t}\n}\n\nfunction resolve_book_type(o/*:WriteFileOpts*/) {\n\tif(o.bookType) return;\n\tvar _BT = {\n\t\t\"xls\": \"biff8\",\n\t\t\"htm\": \"html\",\n\t\t\"slk\": \"sylk\",\n\t\t\"socialcalc\": \"eth\",\n\t\t\"Sh33tJS\": \"WTF\"\n\t};\n\tvar ext = o.file.slice(o.file.lastIndexOf(\".\")).toLowerCase();\n\tif(ext.match(/^\\.[a-z]+$/)) o.bookType = ext.slice(1);\n\to.bookType = _BT[o.bookType] || o.bookType;\n}\n\nfunction writeFileSync(wb/*:Workbook*/, filename/*:string*/, opts/*:?WriteFileOpts*/) {\n\tvar o = opts||{}; o.type = 'file';\n\to.file = filename;\n\tresolve_book_type(o);\n\treturn writeSync(wb, o);\n}\n\nfunction writeFileSyncXLSX(wb/*:Workbook*/, filename/*:string*/, opts/*:?WriteFileOpts*/) {\n\tvar o = opts||{}; o.type = 'file';\n\to.file = filename;\n\tresolve_book_type(o);\n\treturn writeSyncXLSX(wb, o);\n}\n\n\nfunction writeFileAsync(filename/*:string*/, wb/*:Workbook*/, opts/*:?WriteFileOpts*/, cb/*:?(e?:ErrnoError)=>void*/) {\n\tvar o = opts||{}; o.type = 'file';\n\to.file = filename;\n\tresolve_book_type(o);\n\to.type = 'buffer';\n\tvar _cb = cb; if(!(_cb instanceof Function)) _cb = (opts/*:any*/);\n\treturn _fs.writeFile(filename, writeSync(wb, o), _cb);\n}\n/*::\ntype MJRObject = {\n\trow: any;\n\tisempty: boolean;\n};\n*/\nfunction make_json_row(sheet/*:Worksheet*/, r/*:Range*/, R/*:number*/, cols/*:Array*/, header/*:number*/, hdr/*:Array*/, o/*:Sheet2JSONOpts*/)/*:MJRObject*/ {\n\tvar rr = encode_row(R);\n\tvar defval = o.defval, raw = o.raw || !Object.prototype.hasOwnProperty.call(o, \"raw\");\n\tvar isempty = true, dense = (sheet[\"!data\"] != null);\n\tvar row/*:any*/ = (header === 1) ? [] : {};\n\tif(header !== 1) {\n\t\tif(Object.defineProperty) try { Object.defineProperty(row, '__rowNum__', {value:R, enumerable:false}); } catch(e) { row.__rowNum__ = R; }\n\t\telse row.__rowNum__ = R;\n\t}\n\tif(!dense || sheet[\"!data\"][R]) for (var C = r.s.c; C <= r.e.c; ++C) {\n\t\tvar val = dense ? (sheet[\"!data\"][R]||[])[C] : sheet[cols[C] + rr];\n\t\tif(val == null || val.t === undefined) {\n\t\t\tif(defval === undefined) continue;\n\t\t\tif(hdr[C] != null) { row[hdr[C]] = defval; }\n\t\t\tcontinue;\n\t\t}\n\t\tvar v = val.v;\n\t\tswitch(val.t){\n\t\t\tcase 'z': if(v == null) break; continue;\n\t\t\tcase 'e': v = (v == 0 ? null : void 0); break;\n\t\t\tcase 's': case 'b':\n\t\t\tcase 'n': if(!val.z || !fmt_is_date(val.z)) break;\n\t\t\tv = numdate(v); // TODO: date1904 setting should also be stored in worksheet object\n\t\t\tif(typeof v == \"number\") break;\n\t\t\t/* falls through */\n\t\t\tcase 'd': if(!(o && (o.UTC||(o.raw === false)))) v = utc_to_local(new Date(v)); break;\n\t\t\tdefault: throw new Error('unrecognized type ' + val.t);\n\t\t}\n\t\tif(hdr[C] != null) {\n\t\t\tif(v == null) {\n\t\t\t\tif(val.t == \"e\" && v === null) row[hdr[C]] = null;\n\t\t\t\telse if(defval !== undefined) row[hdr[C]] = defval;\n\t\t\t\telse if(raw && v === null) row[hdr[C]] = null;\n\t\t\t\telse continue;\n\t\t\t} else {\n\t\t\t\trow[hdr[C]] = (val.t === 'n' && typeof o.rawNumbers === 'boolean' ? o.rawNumbers : raw) ? v : format_cell(val, v, o);\n\t\t\t}\n\t\t\tif(v != null) isempty = false;\n\t\t}\n\t}\n\treturn { row: row, isempty: isempty };\n}\n\n\nfunction sheet_to_json(sheet/*:Worksheet*/, opts/*:?Sheet2JSONOpts*/) {\n\tif(sheet == null || sheet[\"!ref\"] == null) return [];\n\tvar val = {t:'n',v:0}, header = 0, offset = 1, hdr/*:Array*/ = [], v=0, vv=\"\";\n\tvar r = {s:{r:0,c:0},e:{r:0,c:0}};\n\tvar o = opts || {};\n\tvar range = o.range != null ? o.range : sheet[\"!ref\"];\n\tif(o.header === 1) header = 1;\n\telse if(o.header === \"A\") header = 2;\n\telse if(Array.isArray(o.header)) header = 3;\n\telse if(o.header == null) header = 0;\n\tswitch(typeof range) {\n\t\tcase 'string': r = safe_decode_range(range); break;\n\t\tcase 'number': r = safe_decode_range(sheet[\"!ref\"]); r.s.r = range; break;\n\t\tdefault: r = range;\n\t}\n\tif(header > 0) offset = 0;\n\tvar rr = encode_row(r.s.r);\n\tvar cols/*:Array*/ = [];\n\tvar out/*:Array*/ = [];\n\tvar outi = 0, counter = 0;\n\tvar dense = sheet[\"!data\"] != null;\n\tvar R = r.s.r, C = 0;\n\tvar header_cnt = {};\n\tif(dense && !sheet[\"!data\"][R]) sheet[\"!data\"][R] = [];\n\tvar colinfo/*:Array*/ = o.skipHidden && sheet[\"!cols\"] || [];\n\tvar rowinfo/*:Array*/ = o.skipHidden && sheet[\"!rows\"] || [];\n\tfor(C = r.s.c; C <= r.e.c; ++C) {\n\t\tif(((colinfo[C]||{}).hidden)) continue;\n\t\tcols[C] = encode_col(C);\n\t\tval = dense ? sheet[\"!data\"][R][C] : sheet[cols[C] + rr];\n\t\tswitch(header) {\n\t\t\tcase 1: hdr[C] = C - r.s.c; break;\n\t\t\tcase 2: hdr[C] = cols[C]; break;\n\t\t\tcase 3: hdr[C] = o.header[C - r.s.c]; break;\n\t\t\tdefault:\n\t\t\t\tif(val == null) val = {w: \"__EMPTY\", t: \"s\"};\n\t\t\t\tvv = v = format_cell(val, null, o);\n\t\t\t\tcounter = header_cnt[v] || 0;\n\t\t\t\tif(!counter) header_cnt[v] = 1;\n\t\t\t\telse {\n\t\t\t\t\tdo { vv = v + \"_\" + (counter++); } while(header_cnt[vv]); header_cnt[v] = counter;\n\t\t\t\t\theader_cnt[vv] = 1;\n\t\t\t\t}\n\t\t\t\thdr[C] = vv;\n\t\t}\n\t}\n\tfor (R = r.s.r + offset; R <= r.e.r; ++R) {\n\t\tif ((rowinfo[R]||{}).hidden) continue;\n\t\tvar row = make_json_row(sheet, r, R, cols, header, hdr, o);\n\t\tif((row.isempty === false) || (header === 1 ? o.blankrows !== false : !!o.blankrows)) out[outi++] = row.row;\n\t}\n\tout.length = outi;\n\treturn out;\n}\n\nvar qreg = /\"/g;\nfunction make_csv_row(sheet/*:Worksheet*/, r/*:Range*/, R/*:number*/, cols/*:Array*/, fs/*:number*/, rs/*:number*/, FS/*:string*/, w/*:number*/, o/*:Sheet2CSVOpts*/)/*:?string*/ {\n\tvar isempty = true;\n\tvar row/*:Array*/ = [], txt = \"\", rr = encode_row(R);\n\tvar dense = sheet[\"!data\"] != null;\n\tvar datarow = dense && sheet[\"!data\"][R] || [];\n\tfor(var C = r.s.c; C <= r.e.c; ++C) {\n\t\tif (!cols[C]) continue;\n\t\tvar val = dense ? datarow[C]: sheet[cols[C] + rr];\n\t\tif(val == null) txt = \"\";\n\t\telse if(val.v != null) {\n\t\t\tisempty = false;\n\t\t\ttxt = ''+(o.rawNumbers && val.t == \"n\" ? val.v : format_cell(val, null, o));\n\t\t\tfor(var i = 0, cc = 0; i !== txt.length; ++i) if((cc = txt.charCodeAt(i)) === fs || cc === rs || cc === 34 || o.forceQuotes) {txt = \"\\\"\" + txt.replace(qreg, '\"\"') + \"\\\"\"; break; }\n\t\t\tif(txt == \"ID\" && w == 0 && row.length == 0) txt = '\"ID\"';\n\t\t} else if(val.f != null && !val.F) {\n\t\t\tisempty = false;\n\t\t\ttxt = '=' + val.f; if(txt.indexOf(\",\") >= 0) txt = '\"' + txt.replace(qreg, '\"\"') + '\"';\n\t\t} else txt = \"\";\n\t\t/* NOTE: Excel CSV does not support array formulae */\n\t\trow.push(txt);\n\t}\n\tif(o.strip) while(row[row.length - 1] === \"\") --row.length;\n\tif(o.blankrows === false && isempty) return null;\n\treturn row.join(FS);\n}\n\nfunction sheet_to_csv(sheet/*:Worksheet*/, opts/*:?Sheet2CSVOpts*/)/*:string*/ {\n\tvar out/*:Array*/ = [];\n\tvar o = opts == null ? {} : opts;\n\tif(sheet == null || sheet[\"!ref\"] == null) return \"\";\n\tvar r = safe_decode_range(sheet[\"!ref\"]);\n\tvar FS = o.FS !== undefined ? o.FS : \",\", fs = FS.charCodeAt(0);\n\tvar RS = o.RS !== undefined ? o.RS : \"\\n\", rs = RS.charCodeAt(0);\n\tvar row = \"\", cols/*:Array*/ = [];\n\tvar colinfo/*:Array*/ = o.skipHidden && sheet[\"!cols\"] || [];\n\tvar rowinfo/*:Array*/ = o.skipHidden && sheet[\"!rows\"] || [];\n\tfor(var C = r.s.c; C <= r.e.c; ++C) if (!((colinfo[C]||{}).hidden)) cols[C] = encode_col(C);\n\tvar w = 0;\n\tfor(var R = r.s.r; R <= r.e.r; ++R) {\n\t\tif ((rowinfo[R]||{}).hidden) continue;\n\t\trow = make_csv_row(sheet, r, R, cols, fs, rs, FS, w, o);\n\t\tif(row == null) { continue; }\n\t\tif(row || (o.blankrows !== false)) out.push((w++ ? RS : \"\") + row);\n\t}\n\treturn out.join(\"\");\n}\n\nfunction sheet_to_txt(sheet/*:Worksheet*/, opts/*:?Sheet2CSVOpts*/) {\n\tif(!opts) opts = {}; opts.FS = \"\\t\"; opts.RS = \"\\n\";\n\tvar s = sheet_to_csv(sheet, opts);\n\tif(typeof $cptable == 'undefined' || opts.type == 'string') return s;\n\tvar o = $cptable.utils.encode(1200, s, 'str');\n\treturn String.fromCharCode(255) + String.fromCharCode(254) + o;\n}\n\nfunction sheet_to_formulae(sheet/*:Worksheet*/, opts/*:?Sheet2FormulaOpts*/)/*:Array*/ {\n\tvar y = \"\", x, val=\"\";\n\tif(sheet == null || sheet[\"!ref\"] == null) return [];\n\tvar r = safe_decode_range(sheet['!ref']), rr = \"\", cols/*:Array*/ = [], C;\n\tvar cmds/*:Array*/ = [];\n\tvar dense = sheet[\"!data\"] != null;\n\tfor(C = r.s.c; C <= r.e.c; ++C) cols[C] = encode_col(C);\n\tfor(var R = r.s.r; R <= r.e.r; ++R) {\n\t\trr = encode_row(R);\n\t\tfor(C = r.s.c; C <= r.e.c; ++C) {\n\t\t\ty = cols[C] + rr;\n\t\t\tx = dense ? (sheet[\"!data\"][R]||[])[C] : sheet[y];\n\t\t\tval = \"\";\n\t\t\tif(x === undefined) continue;\n\t\t\telse if(x.F != null) {\n\t\t\t\ty = x.F;\n\t\t\t\tif(!x.f) continue;\n\t\t\t\tval = x.f;\n\t\t\t\tif(y.indexOf(\":\") == -1) y = y + \":\" + y;\n\t\t\t}\n\t\t\tif(x.f != null) val = x.f;\n\t\t\telse if(opts && opts.values === false) continue;\n\t\t\telse if(x.t == 'z') continue;\n\t\t\telse if(x.t == 'n' && x.v != null) val = \"\" + x.v;\n\t\t\telse if(x.t == 'b') val = x.v ? \"TRUE\" : \"FALSE\";\n\t\t\telse if(x.w !== undefined) val = \"'\" + x.w;\n\t\t\telse if(x.v === undefined) continue;\n\t\t\telse if(x.t == 's') val = \"'\" + x.v;\n\t\t\telse val = \"\"+x.v;\n\t\t\tcmds[cmds.length] = y + \"=\" + val;\n\t\t}\n\t}\n\treturn cmds;\n}\n\nfunction sheet_add_json(_ws/*:?Worksheet*/, js/*:Array*/, opts)/*:Worksheet*/ {\n\tvar o = opts || {};\n\tvar dense = _ws ? (_ws[\"!data\"] != null) : o.dense;\n\tif(DENSE != null && dense == null) dense = DENSE;\n\tvar offset = +!o.skipHeader;\n\tvar ws/*:Worksheet*/ = _ws || ({});\n\tif(!_ws && dense) ws[\"!data\"] = [];\n\tvar _R = 0, _C = 0;\n\tif(ws && o.origin != null) {\n\t\tif(typeof o.origin == 'number') _R = o.origin;\n\t\telse {\n\t\t\tvar _origin/*:CellAddress*/ = typeof o.origin == \"string\" ? decode_cell(o.origin) : o.origin;\n\t\t\t_R = _origin.r; _C = _origin.c;\n\t\t}\n\t}\n\tvar range/*:Range*/ = ({s: {c:0, r:0}, e: {c:_C, r:_R + js.length - 1 + offset}}/*:any*/);\n\tif(ws['!ref']) {\n\t\tvar _range = safe_decode_range(ws['!ref']);\n\t\trange.e.c = Math.max(range.e.c, _range.e.c);\n\t\trange.e.r = Math.max(range.e.r, _range.e.r);\n\t\tif(_R == -1) { _R = _range.e.r + 1; range.e.r = _R + js.length - 1 + offset; }\n\t} else {\n\t\tif(_R == -1) { _R = 0; range.e.r = js.length - 1 + offset; }\n\t}\n\tvar hdr/*:Array*/ = o.header || [], C = 0;\n\tvar ROW = [];\n\tjs.forEach(function (JS, R/*:number*/) {\n\t\tif(dense && !ws[\"!data\"][_R + R + offset]) ws[\"!data\"][_R + R + offset] = [];\n\t\tif(dense) ROW = ws[\"!data\"][_R + R + offset];\n\t\tkeys(JS).forEach(function(k) {\n\t\t\tif((C=hdr.indexOf(k)) == -1) hdr[C=hdr.length] = k;\n\t\t\tvar v = JS[k];\n\t\t\tvar t = 'z';\n\t\t\tvar z = \"\";\n\t\t\tvar ref = dense ? \"\" : (encode_col(_C + C) + encode_row(_R + R + offset));\n\t\t\tvar cell/*:Cell*/ = dense ? ROW[_C + C] : ws[ref];\n\t\t\tif(v && typeof v === 'object' && !(v instanceof Date)){\n\t\t\t\tif(dense) ROW[_C + C] = v;\n\t\t\t\telse ws[ref] = v;\n\t\t\t} else {\n\t\t\t\tif(typeof v == 'number') t = 'n';\n\t\t\t\telse if(typeof v == 'boolean') t = 'b';\n\t\t\t\telse if(typeof v == 'string') t = 's';\n\t\t\t\telse if(v instanceof Date) {\n\t\t\t\t\tt = 'd';\n\t\t\t\t\tif(!o.UTC) v = local_to_utc(v);\n\t\t\t\t\tif(!o.cellDates) { t = 'n'; v = datenum(v); }\n\t\t\t\t\tz = (cell != null && cell.z && fmt_is_date(cell.z)) ? cell.z : (o.dateNF || table_fmt[14]);\n\t\t\t\t}\n\t\t\t\telse if(v === null && o.nullError) { t = 'e'; v = 0; }\n\t\t\t\tif(!cell) {\n\t\t\t\t\tif(!dense) ws[ref] = cell = ({t:t, v:v}/*:any*/);\n\t\t\t\t\telse ROW[_C + C] = cell = ({t:t, v:v}/*:any*/);\n\t\t\t\t} else {\n\t\t\t\t\tcell.t = t; cell.v = v;\n\t\t\t\t\tdelete cell.w; delete cell.R;\n\t\t\t\t\tif(z) cell.z = z;\n\t\t\t\t}\n\t\t\t\tif(z) cell.z = z;\n\t\t\t}\n\t\t});\n\t});\n\trange.e.c = Math.max(range.e.c, _C + hdr.length - 1);\n\tvar __R = encode_row(_R);\n\tif(dense && !ws[\"!data\"][_R]) ws[\"!data\"][_R] = [];\n\tif(offset) for(C = 0; C < hdr.length; ++C) {\n\t\tif(dense) ws[\"!data\"][_R][C + _C] = {t:'s', v:hdr[C]};\n\t\telse ws[encode_col(C + _C) + __R] = {t:'s', v:hdr[C]};\n\t}\n\tws['!ref'] = encode_range(range);\n\treturn ws;\n}\nfunction json_to_sheet(js/*:Array*/, opts)/*:Worksheet*/ { return sheet_add_json(null, js, opts); }\n\n/* get cell, creating a stub if necessary */\nfunction ws_get_cell_stub(ws/*:Worksheet*/, R, C/*:?number*/)/*:Cell*/ {\n\t/* A1 cell address */\n\tif(typeof R == \"string\") {\n\t\tif(ws[\"!data\"] != null) {\n\t\t\tvar RC = decode_cell(R);\n\t\t\tif(!ws[\"!data\"][RC.r]) ws[\"!data\"][RC.r] = [];\n\t\t\treturn ws[\"!data\"][RC.r][RC.c] || (ws[\"!data\"][RC.r][RC.c] = {t:'z'});\n\t\t}\n\t\treturn ws[R] || (ws[R] = {t:'z'});\n\t}\n\t/* cell address object */\n\tif(typeof R != \"number\") return ws_get_cell_stub(ws, encode_cell(R));\n\t/* R and C are 0-based indices */\n\treturn ws_get_cell_stub(ws, encode_col(C||0) + encode_row(R));\n}\n\n/* find sheet index for given name / validate index */\nfunction wb_sheet_idx(wb/*:Workbook*/, sh/*:number|string*/) {\n\tif(typeof sh == \"number\") {\n\t\tif(sh >= 0 && wb.SheetNames.length > sh) return sh;\n\t\tthrow new Error(\"Cannot find sheet # \" + sh);\n\t} else if(typeof sh == \"string\") {\n\t\tvar idx = wb.SheetNames.indexOf(sh);\n\t\tif(idx > -1) return idx;\n\t\tthrow new Error(\"Cannot find sheet name |\" + sh + \"|\");\n\t} else throw new Error(\"Cannot find sheet |\" + sh + \"|\");\n}\n\n/* simple blank or single-sheet workbook object */\nfunction book_new(ws/*:?Worksheet*/, wsname/*:?string*/)/*:Workbook*/ {\n\tvar wb = { SheetNames: [], Sheets: {} };\n\tif(ws) book_append_sheet(wb, ws, wsname || \"Sheet1\");\n\treturn wb;\n}\n\n/* add a worksheet to the end of a given workbook */\nfunction book_append_sheet(wb/*:Workbook*/, ws/*:Worksheet*/, name/*:?string*/, roll/*:?boolean*/)/*:string*/ {\n\tvar i = 1;\n\tif(!name) for(; i <= 0xFFFF; ++i, name = undefined) if(wb.SheetNames.indexOf(name = \"Sheet\" + i) == -1) break;\n\tif(!name || wb.SheetNames.length >= 0xFFFF) throw new Error(\"Too many worksheets\");\n\tif(roll && wb.SheetNames.indexOf(name) >= 0 && name.length < 32) {\n\t\tvar m = name.match(/\\d+$/); // at this point, name length is capped at 32\n\t\ti = m && +m[0] || 0;\n\t\tvar root = m && name.slice(0, m.index) || name;\n\t\tfor(++i; i <= 0xFFFF; ++i) if(wb.SheetNames.indexOf(name = root + i) == -1) break;\n\t}\n\tcheck_ws_name(name);\n\tif(wb.SheetNames.indexOf(name) >= 0) throw new Error(\"Worksheet with name |\" + name + \"| already exists!\");\n\n\twb.SheetNames.push(name);\n\twb.Sheets[name] = ws;\n\treturn name;\n}\n\n/* set sheet visibility (visible/hidden/very hidden) */\nfunction book_set_sheet_visibility(wb/*:Workbook*/, sh/*:number|string*/, vis/*:number*/) {\n\tif(!wb.Workbook) wb.Workbook = {};\n\tif(!wb.Workbook.Sheets) wb.Workbook.Sheets = [];\n\n\tvar idx = wb_sheet_idx(wb, sh);\n\t// $FlowIgnore\n\tif(!wb.Workbook.Sheets[idx]) wb.Workbook.Sheets[idx] = {};\n\n\tswitch(vis) {\n\t\tcase 0: case 1: case 2: break;\n\t\tdefault: throw new Error(\"Bad sheet visibility setting \" + vis);\n\t}\n\t// $FlowIgnore\n\twb.Workbook.Sheets[idx].Hidden = vis;\n}\n\n/* set number format */\nfunction cell_set_number_format(cell/*:Cell*/, fmt/*:string|number*/) {\n\tcell.z = fmt;\n\treturn cell;\n}\n\n/* set cell hyperlink */\nfunction cell_set_hyperlink(cell/*:Cell*/, target/*:string*/, tooltip/*:?string*/) {\n\tif(!target) {\n\t\tdelete cell.l;\n\t} else {\n\t\tcell.l = ({ Target: target }/*:Hyperlink*/);\n\t\tif(tooltip) cell.l.Tooltip = tooltip;\n\t}\n\treturn cell;\n}\nfunction cell_set_internal_link(cell/*:Cell*/, range/*:string*/, tooltip/*:?string*/) { return cell_set_hyperlink(cell, \"#\" + range, tooltip); }\n\n/* add to cell comments */\nfunction cell_add_comment(cell/*:Cell*/, text/*:string*/, author/*:?string*/) {\n\tif(!cell.c) cell.c = [];\n\tcell.c.push({t:text, a:author||\"SheetJS\"});\n}\n\n/* set array formula and flush related cells */\nfunction sheet_set_array_formula(ws/*:Worksheet*/, range, formula/*:string*/, dynamic/*:boolean*/) {\n\tvar rng = typeof range != \"string\" ? range : safe_decode_range(range);\n\tvar rngstr = typeof range == \"string\" ? range : encode_range(range);\n\tfor(var R = rng.s.r; R <= rng.e.r; ++R) for(var C = rng.s.c; C <= rng.e.c; ++C) {\n\t\tvar cell = ws_get_cell_stub(ws, R, C);\n\t\tcell.t = 'n';\n\t\tcell.F = rngstr;\n\t\tdelete cell.v;\n\t\tif(R == rng.s.r && C == rng.s.c) {\n\t\t\tcell.f = formula;\n\t\t\tif(dynamic) cell.D = true;\n\t\t}\n\t}\n\tvar wsr = decode_range(ws[\"!ref\"]);\n\tif(wsr.s.r > rng.s.r) wsr.s.r = rng.s.r;\n\tif(wsr.s.c > rng.s.c) wsr.s.c = rng.s.c;\n\tif(wsr.e.r < rng.e.r) wsr.e.r = rng.e.r;\n\tif(wsr.e.c < rng.e.c) wsr.e.c = rng.e.c;\n\tws[\"!ref\"] = encode_range(wsr);\n\treturn ws;\n}\n\nvar utils/*:any*/ = {\n\tencode_col: encode_col,\n\tencode_row: encode_row,\n\tencode_cell: encode_cell,\n\tencode_range: encode_range,\n\tdecode_col: decode_col,\n\tdecode_row: decode_row,\n\tsplit_cell: split_cell,\n\tdecode_cell: decode_cell,\n\tdecode_range: decode_range,\n\tformat_cell: format_cell,\n\tsheet_new: sheet_new,\n\tsheet_add_aoa: sheet_add_aoa,\n\tsheet_add_json: sheet_add_json,\n\tsheet_add_dom: sheet_add_dom,\n\taoa_to_sheet: aoa_to_sheet,\n\tjson_to_sheet: json_to_sheet,\n\ttable_to_sheet: parse_dom_table,\n\ttable_to_book: table_to_book,\n\tsheet_to_csv: sheet_to_csv,\n\tsheet_to_txt: sheet_to_txt,\n\tsheet_to_json: sheet_to_json,\n\tsheet_to_html: sheet_to_html,\n\tsheet_to_formulae: sheet_to_formulae,\n\tsheet_to_row_object_array: sheet_to_json,\n\tsheet_get_cell: ws_get_cell_stub,\n\tbook_new: book_new,\n\tbook_append_sheet: book_append_sheet,\n\tbook_set_sheet_visibility: book_set_sheet_visibility,\n\tcell_set_number_format: cell_set_number_format,\n\tcell_set_hyperlink: cell_set_hyperlink,\n\tcell_set_internal_link: cell_set_internal_link,\n\tcell_add_comment: cell_add_comment,\n\tsheet_set_array_formula: sheet_set_array_formula,\n\tconsts: {\n\t\tSHEET_VISIBLE: 0,\n\t\tSHEET_HIDDEN: 1,\n\t\tSHEET_VERY_HIDDEN: 2\n\t}\n};\n\nvar _Readable;\nfunction set_readable(R) { _Readable = R; }\n\nfunction write_csv_stream(sheet/*:Worksheet*/, opts/*:?Sheet2CSVOpts*/) {\n\tvar stream = _Readable();\n\tvar o = opts == null ? {} : opts;\n\tif(sheet == null || sheet[\"!ref\"] == null) { stream.push(null); return stream; }\n\tvar r = safe_decode_range(sheet[\"!ref\"]);\n\tvar FS = o.FS !== undefined ? o.FS : \",\", fs = FS.charCodeAt(0);\n\tvar RS = o.RS !== undefined ? o.RS : \"\\n\", rs = RS.charCodeAt(0);\n\tvar row/*:?string*/ = \"\", cols/*:Array*/ = [];\n\tvar colinfo/*:Array*/ = o.skipHidden && sheet[\"!cols\"] || [];\n\tvar rowinfo/*:Array*/ = o.skipHidden && sheet[\"!rows\"] || [];\n\tfor(var C = r.s.c; C <= r.e.c; ++C) if (!((colinfo[C]||{}).hidden)) cols[C] = encode_col(C);\n\tvar R = r.s.r;\n\tvar BOM = false, w = 0;\n\tstream._read = function() {\n\t\tif(!BOM) { BOM = true; return stream.push(\"\\uFEFF\"); }\n\t\twhile(R <= r.e.r) {\n\t\t\t++R;\n\t\t\tif ((rowinfo[R-1]||{}).hidden) continue;\n\t\t\trow = make_csv_row(sheet, r, R-1, cols, fs, rs, FS, w, o);\n\t\t\tif(row != null) {\n\t\t\t\tif(row || (o.blankrows !== false)) return stream.push((w++ ? RS : \"\") + row);\n\t\t\t}\n\t\t}\n\t\treturn stream.push(null);\n\t};\n\treturn stream;\n}\n\nfunction write_html_stream(ws/*:Worksheet*/, opts/*:?Sheet2HTMLOpts*/) {\n\tvar stream = _Readable();\n\n\tvar o = opts || {};\n\tvar header = o.header != null ? o.header : HTML_BEGIN;\n\tvar footer = o.footer != null ? o.footer : HTML_END;\n\tstream.push(header);\n\tvar r = decode_range(ws['!ref']);\n\tstream.push(make_html_preamble(ws, r, o));\n\tvar R = r.s.r;\n\tvar end = false;\n\tstream._read = function() {\n\t\tif(R > r.e.r) {\n\t\t\tif(!end) { end = true; stream.push(\"\" + footer); }\n\t\t\treturn stream.push(null);\n\t\t}\n\t\twhile(R <= r.e.r) {\n\t\t\tstream.push(make_html_row(ws, r, R, o));\n\t\t\t++R;\n\t\t\tbreak;\n\t\t}\n\t};\n\treturn stream;\n}\n\nfunction write_json_stream(sheet/*:Worksheet*/, opts/*:?Sheet2CSVOpts*/) {\n\tvar stream = _Readable({objectMode:true});\n\n\tif(sheet == null || sheet[\"!ref\"] == null) { stream.push(null); return stream; }\n\tvar val = {t:'n',v:0}, header = 0, offset = 1, hdr/*:Array*/ = [], v=0, vv=\"\";\n\tvar r = {s:{r:0,c:0},e:{r:0,c:0}};\n\tvar o = opts || {};\n\tvar range = o.range != null ? o.range : sheet[\"!ref\"];\n\tif(o.header === 1) header = 1;\n\telse if(o.header === \"A\") header = 2;\n\telse if(Array.isArray(o.header)) header = 3;\n\tswitch(typeof range) {\n\t\tcase 'string': r = safe_decode_range(range); break;\n\t\tcase 'number': r = safe_decode_range(sheet[\"!ref\"]); r.s.r = range; break;\n\t\tdefault: r = range;\n\t}\n\tif(header > 0) offset = 0;\n\tvar rr = encode_row(r.s.r);\n\tvar cols/*:Array*/ = [];\n\tvar counter = 0;\n\tvar dense = sheet[\"!data\"] != null;\n\tvar R = r.s.r, C = 0;\n\tvar header_cnt = {};\n\tif(dense && !sheet[\"!data\"][R]) sheet[\"!data\"][R] = [];\n\tvar colinfo/*:Array*/ = o.skipHidden && sheet[\"!cols\"] || [];\n\tvar rowinfo/*:Array*/ = o.skipHidden && sheet[\"!rows\"] || [];\n\tfor(C = r.s.c; C <= r.e.c; ++C) {\n\t\tif(((colinfo[C]||{}).hidden)) continue;\n\t\tcols[C] = encode_col(C);\n\t\tval = dense ? sheet[\"!data\"][R][C] : sheet[cols[C] + rr];\n\t\tswitch(header) {\n\t\t\tcase 1: hdr[C] = C - r.s.c; break;\n\t\t\tcase 2: hdr[C] = cols[C]; break;\n\t\t\tcase 3: hdr[C] = o.header[C - r.s.c]; break;\n\t\t\tdefault:\n\t\t\t\tif(val == null) val = {w: \"__EMPTY\", t: \"s\"};\n\t\t\t\tvv = v = format_cell(val, null, o);\n\t\t\t\tcounter = header_cnt[v] || 0;\n\t\t\t\tif(!counter) header_cnt[v] = 1;\n\t\t\t\telse {\n\t\t\t\t\tdo { vv = v + \"_\" + (counter++); } while(header_cnt[vv]); header_cnt[v] = counter;\n\t\t\t\t\theader_cnt[vv] = 1;\n\t\t\t\t}\n\t\t\t\thdr[C] = vv;\n\t\t}\n\t}\n\tR = r.s.r + offset;\n\tstream._read = function() {\n\t\twhile(R <= r.e.r) {\n\t\t\tif ((rowinfo[R-1]||{}).hidden) continue;\n\t\t\tvar row = make_json_row(sheet, r, R, cols, header, hdr, o);\n\t\t\t++R;\n\t\t\tif((row.isempty === false) || (header === 1 ? o.blankrows !== false : !!o.blankrows)) {\n\t\t\t\tstream.push(row.row);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\treturn stream.push(null);\n\t};\n\treturn stream;\n}\n\nfunction write_xlml_stream(wb/*:Workbook*/, o/*:?Sheet2XLMLOpts*/) {\n\tvar stream = _Readable();\n\tvar opts = o == null ? {} : o;\n\tvar stride = +opts.stride || 10;\n\tif(!wb.SSF) wb.SSF = dup(table_fmt);\n\tif(wb.SSF) {\n\t\tmake_ssf(); SSF_load_table(wb.SSF);\n\t\t// $FlowIgnore\n\t\topts.revssf = evert_num(wb.SSF); opts.revssf[wb.SSF[65535]] = 0;\n\t\topts.ssf = wb.SSF;\n\t\topts.cellXfs = [];\n\t\tget_cell_style(opts.cellXfs, {}, {revssf:{\"General\":0}});\n\t}\n\n\t/* do one pass to determine styles since they must be added before tables */\n\twb.SheetNames.forEach(function(n) {\n\t\tvar ws = wb.Sheets[n];\n\t\tif(!ws || !ws[\"!ref\"]) return;\n\t\tvar range = decode_range(ws[\"!ref\"]);\n\t\tvar dense = ws[\"!data\"] != null;\n\t\tvar ddata = dense ? ws[\"!data\"] : [];\n\t\tvar addr = {r:0,c:0};\n\t\tfor(var R = range.s.r; R <= range.e.r; ++R) {\n\t\t\taddr.r = R;\n\t\t\tif(dense && !ddata[R]) continue;\n\t\t\tfor(var C = range.s.c; C <= range.e.c; ++C) {\n\t\t\t\taddr.c = C;\n\t\t\t\tvar cell = dense ? ddata[R][C] : ws[encode_col(C) + encode_row(R)];\n\t\t\t\tif(!cell) continue;\n\t\t\t\tif(cell.t == \"d\" && cell.z == null) { cell = dup(cell); cell.z = table_fmt[14]; }\n\t\t\t\tvoid get_cell_style(opts.cellXfs, cell, opts);\n\t\t\t}\n\t\t}\n\t});\n\tvar sty = write_sty_xlml(wb, opts);\n\n\tvar stage = 0, wsidx = 0, ws = wb.Sheets[wb.SheetNames[wsidx]], range = safe_decode_range(ws), R = -1, T = false;\n\n\tvar marr = [], mi = 0, dense = false, darr = [], addr = {r:0,c:0};\n\n\tstream._read = function() { switch(stage) {\n\t\t/* header */\n\t\tcase 0: {\n\t\t\tstage = 1;\n\t\t\tstream.push(XML_HEADER);\n\t\t\tstream.push(\"\");\n\t\t} break;\n\n\t\t/* preamble */\n\t\tcase 1: {\n\t\t\tstage = 2;\n\t\t\tstream.push(write_props_xlml(wb, opts));\n\t\t\tstream.push(write_wb_xlml(wb, opts));\n\t\t} break;\n\n\t\t/* style and name tables */\n\t\tcase 2: {\n\t\t\tstage = 3;\n\t\t\tstream.push(sty);\n\t\t\tstream.push(write_names_xlml(wb, opts));\n\t\t} break;\n\n\t\t/* worksheet preamble */\n\t\tcase 3: {\n\t\t\tT = false;\n\t\t\tif(wsidx >= wb.SheetNames.length) { stage = -1; stream.push(\"\"); break; }\n\n\t\t\tstream.push(\"\");\n\n\t\t\tws = wb.Sheets[wb.SheetNames[wsidx]];\n\t\t\tif(!ws) { stream.push(\"\"); return void ++wsidx; }\n\n\t\t\tvar names = write_ws_xlml_names(ws, opts, wsidx, wb);\n\t\t\tif(names.length) stream.push(\"\" + names + \"\");\n\n\t\t\tif(!ws[\"!ref\"]) return (stage = 5);\n\t\t\trange = safe_decode_range(ws[\"!ref\"]);\n\t\t\tR = range.s.r;\n\t\t\tstage = 4;\n\t\t} break;\n\n\t\t/* worksheet intramble */\n\t\tcase 4: {\n\t\t\tif(R < 0 || R > range.e.r) { if(T) stream.push(\"\"); return void (stage = 5); }\n\n\t\t\tif(R <= range.s.r) {\n\t\t\t\tif(ws['!cols']) ws['!cols'].forEach(function(n, i) {\n\t\t\t\t\tprocess_col(n);\n\t\t\t\t\tvar w = !!n.width;\n\t\t\t\t\tvar p = col_obj_w(i, n);\n\t\t\t\t\tvar k/*:any*/ = {\"ss:Index\":i+1};\n\t\t\t\t\tif(w) k['ss:Width'] = width2px(p.width);\n\t\t\t\t\tif(n.hidden) k['ss:Hidden']=\"1\";\n\t\t\t\t\tif(!T) { T = true; stream.push(\"\"); }\n\t\t\t\t\tstream.push(writextag(\"Column\",null,k));\n\t\t\t\t});\n\t\t\t\tdense = ws[\"!data\"] != null;\n\t\t\t\tif(dense) darr = ws[\"!data\"];\n\t\t\t\taddr.r = addr.c = 0;\n\t\t\t}\n\n\t\t\t/* process `stride` rows per invocation */\n\t\t\tfor(var cnt = 0; R <= range.e.r && cnt < stride; ++R, ++cnt) {\n\t\t\t\tvar row = [write_ws_xlml_row(R, (ws['!rows']||[])[R])];\n\t\t\t\taddr.r = R;\n\t\t\t\tif(!(dense && !darr[R])) for(var C = range.s.c; C <= range.e.c; ++C) {\n\t\t\t\t\taddr.c = C;\n\t\t\t\t\tvar skip = false;\n\t\t\t\t\tfor(mi = 0; mi != marr.length; ++mi) {\n\t\t\t\t\t\tif(marr[mi].s.c > C) continue;\n\t\t\t\t\t\tif(marr[mi].s.r > R) continue;\n\t\t\t\t\t\tif(marr[mi].e.c < C) continue;\n\t\t\t\t\t\tif(marr[mi].e.r < R) continue;\n\t\t\t\t\t\tif(marr[mi].s.c != C || marr[mi].s.r != R) skip = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif(skip) continue;\n\t\t\t\t\tvar ref = encode_col(C) + encode_row(R), cell = dense ? darr[R][C] : ws[ref];\n\t\t\t\t\trow.push(write_ws_xlml_cell(cell, ref, ws, opts, wsidx, wb, addr));\n\t\t\t\t}\n\t\t\t\trow.push(\"\");\n\t\t\t\tif(!T) { T = true; stream.push(\"
\"); }\n\t\t\t\tstream.push(row.join(\"\"));\n\t\t\t}\n\t\t} break;\n\n\t\t/* worksheet postamble */\n\t\tcase 5: {\n\t\t\tstream.push(write_ws_xlml_wsopts(ws, opts, wsidx, wb));\n\t\t\tif(ws && ws[\"!autofilter\"]) stream.push('');\n\t\t\tstream.push(\"\");\n\t\t\twsidx++; R = -1;\n\t\t\treturn void (stage = 3);\n\t\t}\n\n\t\t/* footer */\n\t\tcase -1: {\n\t\t\tstage = -2;\n\t\t\tstream.push(\"\");\n\t\t} break;\n\n\t\t/* exeunt */\n\t\tcase -2: stream.push(null); break;\n\t}};\n\treturn stream;\n}\n\nvar __stream = {\n\tto_json: write_json_stream,\n\tto_html: write_html_stream,\n\tto_csv: write_csv_stream,\n\tto_xlml: write_xlml_stream,\n\tset_readable: set_readable\n};\nexport const version = XLSX.version;\nexport {\n\tparse_xlscfb,\n\tparse_zip,\n\treadSync as read,\n\treadFileSync as readFile,\n\treadFileSync,\n\twriteSync as write,\n\twriteFileSync as writeFile,\n\twriteFileSync,\n\twriteFileAsync,\n\twriteSyncXLSX as writeXLSX,\n\twriteFileSyncXLSX as writeFileXLSX,\n\tutils,\n\tset_fs,\n\tset_cptable,\n\t__stream as stream,\n\tSSF,\n\tCFB\n};\nexport default {\n\tparse_xlscfb,\n\tparse_zip,\n\tread: readSync,\n\treadFile: readFileSync,\n\treadFileSync,\n\twrite: writeSync,\n\twriteFile: writeFileSync,\n\twriteFileSync,\n\twriteFileAsync,\n\twriteXLSX: writeSyncXLSX,\n\twriteFileXLSX: writeFileSyncXLSX,\n\tutils,\n\tset_fs,\n\tset_cptable,\n\tstream: __stream,\n\tSSF,\n\tCFB\n}\n"],"sourceRoot":""}