2016-12-31 08:20:45 +00:00
/* xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
2017-02-03 20:50:45 +00:00
var XLSX = { } ; ( function make _xlsx ( XLSX ) { XLSX . version = "0.8.2" ; var current _codepage = 1200 , current _cptable ; if ( typeof module !== "undefined" && typeof require !== "undefined" ) { if ( typeof cptable === "undefined" ) cptable = require ( "./dist/cpexcel" ) ; current _cptable = cptable [ current _codepage ] } function reset _cp ( ) { set _cp ( 1200 ) } var set _cp = function ( cp ) { current _codepage = cp } ; function char _codes ( data ) { var o = [ ] ; for ( var i = 0 , len = data . length ; i < len ; ++ i ) o [ i ] = data . charCodeAt ( i ) ; return o } var debom _xml = function ( data ) { return data } ; var _getchar = function _gc1 ( x ) { return String . fromCharCode ( x ) } ; if ( typeof cptable !== "undefined" ) { set _cp = function ( cp ) { current _codepage = cp ; current _cptable = cptable [ cp ] } ; debom _xml = function ( data ) { if ( data . charCodeAt ( 0 ) === 255 && data . charCodeAt ( 1 ) === 254 ) { return cptable . utils . decode ( 1200 , char _codes ( data . substr ( 2 ) ) ) } return data } ; _getchar = function _gc2 ( x ) { if ( current _codepage === 1200 ) return String . fromCharCode ( x ) ; return cptable . utils . decode ( current _codepage , [ x & 255 , x >> 8 ] ) [ 0 ] } } var Base64 = function make _b64 ( ) { var map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" ; return { encode : function ( input , utf8 ) { var o = "" ; var c1 , c2 , c3 , e1 , e2 , e3 , e4 ; for ( var i = 0 ; i < input . length ; ) { c1 = input . charCodeAt ( i ++ ) ; c2 = input . charCodeAt ( i ++ ) ; c3 = input . charCodeAt ( i ++ ) ; e1 = c1 >> 2 ; e2 = ( c1 & 3 ) << 4 | c2 >> 4 ; e3 = ( c2 & 15 ) << 2 | c3 >> 6 ; e4 = c3 & 63 ; if ( isNaN ( c2 ) ) { e3 = e4 = 64 } else if ( isNaN ( c3 ) ) { e4 = 64 } o += map . charAt ( e1 ) + map . charAt ( e2 ) + map . charAt ( e3 ) + map . charAt ( e4 ) } return o } , decode : function b64 _decode ( input , utf8 ) { var o = "" ; var c1 , c2 , c3 ; var e1 , e2 , e3 , e4 ; input = input . replace ( /[^A-Za-z0-9\+\/\=]/g , "" ) ; for ( var i = 0 ; i < input . length ; ) { e1 = map . indexOf ( input . charAt ( i ++ ) ) ; e2 = map . indexOf ( input . charAt ( i ++ ) ) ; e3 = map . indexOf ( input . charAt ( i ++ ) ) ; e4 = map . indexOf ( input . charAt ( i ++ ) ) ; c1 = e1 << 2 | e2 >> 4 ; c2 = ( e2 & 15 ) << 4 | e3 >> 2 ; c3 = ( e3 & 3 ) << 6 | e4 ; o += String . fromCharCode ( c1 ) ; if ( e3 != 64 ) { o += String . fromCharCode ( c2 ) } if ( e4 != 64 ) { o += String . fromCharCode ( c3 ) } } return o } } } ( ) ; var has _buf = typeof Buffer !== "undefined" ; function new _raw _buf ( len ) { return new ( has _buf ? Buffer : Array ) ( len ) } function s2a ( s ) { if ( has _buf ) return new Buffer ( s , "binary" ) ; return s . split ( "" ) . map ( function ( x ) { return x . charCodeAt ( 0 ) & 255 } ) } var bconcat = function ( bufs ) { return [ ] . concat . apply ( [ ] , bufs ) } ; var chr0 = /\u0000/g , chr1 = /[\u0001-\u0006]/ ; var SSF = { } ; var make _ssf = function make _ssf ( SSF ) { SSF . version = "0.8.1" ; function _strrev ( x ) { var o = "" , i = x . length - 1 ; while ( i >= 0 ) o += x . charAt ( i -- ) ; return o } function fill ( c , l ) { var o = "" ; while ( o . length < l ) o += c ; return o } function pad0 ( v , d ) { var t = "" + v ; return t . length >= d ? t : fill ( "0" , d - t . length ) + t } function pad _ ( v , d ) { var t = "" + v ; return t . length >= d ? t : fill ( " " , d - t . length ) + t } function rpad _ ( v , d ) { var t = "" + v ; return t . length >= d ? t : t + fill ( " " , d - t . length ) } function pad0r1 ( v , d ) { var t = "" + Math . round ( v ) ; return t . length >= d ? t : fill ( "0" , d - t . length ) + t } function pad0r2 ( v , d ) { var t = "" + v ; return t . length >= d ? t : fill ( "0" , d - t . length ) + t } var p2 _32 = Math . pow ( 2 , 32 ) ; function pad0r ( v , d ) { if ( v > p2 _32 || v < - p2 _32 ) return pad0r1 ( v , d ) ; var i = Math . round ( v ) ; return pad0r2 ( i , d ) } function isgeneral ( s , i ) { 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 } var opts _fmt = [ [ "date1904" , 0 ] , [ "output" , "" ] , [ "WTF" , false ] ] ; function fixopts ( o ) { for ( var y = 0 ; y != opts _fmt . length ; ++ y ) if ( o [ opts _fmt [ y ] [ 0 ] ] === undefined ) o [ opts _fmt [ y ] [ 0 ] ] = opts _fmt [ y ] [ 1 ] } SSF . opts = opts _fmt ; var table _fmt = { 0 : "General" , 1 : "0" , 2 : "0.00" , 3 : "#,##0" , 4 : "#,##0.00" , 9 : "0%" , 10 : "0.00%" , 11 : "0.00E+00" , 12 : "# ?/?" , 13 : "# ??/??" , 14 : "m/d/yy" , 15 : "d-mmm-yy" , 16 : "d-mmm" , 17 : "mmm-yy" , 18 : "h:mm AM/PM" , 19 : "h:mm:ss AM/PM" , 20 : "h:mm" , 21 : "h:mm:ss" , 22 : "m/d/yy h:mm" , 37 : "#,##0 ;(#,##0)" , 38 : "#,##0 ;[Red](#,##0)" , 39 : "#,##0.00;(#,##0.00)" , 40 : "#,##0.00;[Red](#,##0.00)" , 45 : "mm:ss" , 46 : "[h]:mm:ss" , 47 : "mmss.0" , 48 : "##0.0E+0" , 49 : "@" , 56 : '"上午/下午 "hh"時"mm"分"ss"秒 "' , 65535 : "General" } ; var days = [ [ "Sun" , "Sunday" ] , [ "Mon" , "Monday" ] , [ "Tue" , "Tuesday" ] , [ "Wed" , "Wednesday" ] , [ "Thu" , "Thursday" ] , [ "Fri" , "Friday" ] , [ "Sat" , "Saturday" ] ] ; var months = [ [ "J" , "Jan" , "January" ] , [ "F" , "Feb" , "February" ] , [ "M" , "Mar" , "March" ] , [ "A" , "Apr" , "April" ] , [ "M" , "May" , "May" ] , [ "J" , "Jun" ,
jj = j * 4 & modulus ; if ( ssz < 4 + jj ) throw "FAT boundary crossed: " + j + " 4 " + ssz ; j = _ _readInt32LE ( sectors [ addr ] , jj ) } return { nodes : buf , data : _ _toBuffer ( [ buf _chain ] ) } } function make _sector _list ( sectors , dir _start , fat _addrs , ssz ) { var sl = sectors . length , sector _list = new Array ( sl ) ; var chkd = new Array ( sl ) , buf , buf _chain ; var modulus = ssz - 1 , i , j , k , jj ; for ( i = 0 ; i < sl ; ++ i ) { buf = [ ] ; k = i + dir _start ; if ( k >= sl ) k -= sl ; if ( chkd [ k ] === true ) continue ; buf _chain = [ ] ; for ( j = k ; j >= 0 ; ) { chkd [ j ] = true ; buf [ buf . length ] = j ; buf _chain . push ( sectors [ j ] ) ; var addr = fat _addrs [ Math . floor ( j * 4 / ssz ) ] ; jj = j * 4 & modulus ; if ( ssz < 4 + jj ) throw "FAT boundary crossed: " + j + " 4 " + ssz ; j = _ _readInt32LE ( sectors [ addr ] , jj ) } sector _list [ k ] = { nodes : buf , data : _ _toBuffer ( [ buf _chain ] ) } } return sector _list } function read _directory ( dir _start , sector _list , sectors , Paths , nmfs , files , FileIndex ) { var blob ; var minifat _store = 0 , pl = Paths . length ? 2 : 0 ; var sector = sector _list [ dir _start ] . data ; var i = 0 , namelen = 0 , name , o , ctime , mtime ; for ( ; i < sector . length ; i += 128 ) { blob = sector . slice ( i , i + 128 ) ; prep _blob ( blob , 64 ) ; namelen = blob . read _shift ( 2 ) ; if ( namelen === 0 ) continue ; name = _ _utf16le ( blob , 0 , namelen - pl ) ; Paths . push ( name ) ; o = { name : name , type : blob . read _shift ( 1 ) , color : blob . read _shift ( 1 ) , L : blob . read _shift ( 4 , "i" ) , R : blob . read _shift ( 4 , "i" ) , C : blob . read _shift ( 4 , "i" ) , clsid : blob . read _shift ( 16 ) , state : blob . read _shift ( 4 , "i" ) } ; ctime = blob . read _shift ( 2 ) + blob . read _shift ( 2 ) + blob . read _shift ( 2 ) + blob . read _shift ( 2 ) ; if ( ctime !== 0 ) { o . ctime = ctime ; o . ct = read _date ( blob , blob . l - 8 ) } mtime = blob . read _shift ( 2 ) + blob . read _shift ( 2 ) + blob . read _shift ( 2 ) + blob . read _shift ( 2 ) ; if ( mtime !== 0 ) { o . mtime = mtime ; o . mt = read _date ( blob , blob . l - 8 ) } o . start = blob . read _shift ( 4 , "i" ) ; o . size = blob . read _shift ( 4 , "i" ) ; if ( o . type === 5 ) { minifat _store = o . start ; if ( nmfs > 0 && minifat _store !== ENDOFCHAIN ) sector _list [ minifat _store ] . name = "!StreamData" } else if ( o . size >= 4096 ) { o . storage = "fat" ; if ( sector _list [ o . start ] === undefined ) sector _list [ o . start ] = get _sector _list ( sectors , o . start , sector _list . fat _addrs , sector _list . ssz ) ; sector _list [ o . start ] . name = o . name ; o . content = sector _list [ o . start ] . data . slice ( 0 , o . size ) ; prep _blob ( o . content , 0 ) } else { o . storage = "minifat" ; if ( minifat _store !== ENDOFCHAIN && o . start !== ENDOFCHAIN ) { o . content = sector _list [ minifat _store ] . data . slice ( o . start * MSSZ , o . start * MSSZ + o . size ) ; prep _blob ( o . content , 0 ) } } files [ name ] = o ; FileIndex . push ( o ) } } function read _date ( blob , offset ) { return new Date ( ( _ _readUInt32LE ( blob , offset + 4 ) / 1e7 * Math . pow ( 2 , 32 ) + _ _readUInt32LE ( blob , offset ) / 1e7 - 11644473600 ) * 1e3 ) } var fs ; function readFileSync ( filename , options ) { if ( fs === undefined ) fs = require ( "fs" ) ; return parse ( fs . readFileSync ( filename ) , options ) } function readSync ( blob , options ) { switch ( options !== undefined && options . type !== undefined ? options . type : "base64" ) { case "file" : return readFileSync ( blob , options ) ; case "base64" : return parse ( s2a ( Base64 . decode ( blob ) ) , options ) ; case "binary" : return parse ( s2a ( blob ) , options ) } return parse ( blob ) } var MSSZ = 64 ; var ENDOFCHAIN = - 2 ; var HEADER _SIGNATURE = "d0cf11e0a1b11ae1" ; var HEADER _CLSID = "00000000000000000000000000000000" ; var consts = { MAXREGSECT : - 6 , DIFSECT : - 4 , FATSECT : - 3 , ENDOFCHAIN : ENDOFCHAIN , FREESECT : - 1 , HEADER _SIGNATURE : HEADER _SIGNATURE , HEADER _MINOR _VERSION : "3e00" , MAXREGSID : - 6 , NOSTREAM : - 1 , HEADER _CLSID : HEADER _CLSID , EntryTypes : [ "unknown" , "storage" , "stream" , "lockbytes" , "property" , "root" ] } ; exports . read = readSync ; exports . parse = parse ; exports . utils = { ReadShift : ReadShift , CheckField : CheckField , prep _blob : prep _blob , bconcat : bconcat , consts : consts } ; return exports } ( ) ; if ( typeof require !== "undefined" && typeof module !== "undefined" && typeof DO _NOT _EXPORT _CFB === "undefined" ) { module . exports = CFB } function isval ( x ) { return x !== undefined && x !== null } function keys ( o ) { return Object . keys ( o ) } function evert _key ( obj , key ) { var o = [ ] , K = keys ( obj ) ; for ( var i = 0 ; i !== K . length ; ++ i ) o [ obj [ K [ i ] ] [ key ] ] = K [ i ] ; return o } function evert ( obj ) { var o = [ ] , K = keys ( obj ) ; for ( var i = 0 ; i !== K . length ; ++ i ) o [ obj [ K [ i ] ] ] = K [ i ] ; return o } function evert _num ( obj ) { var o = [ ] , K = keys ( obj ) ; for ( var i = 0 ; i !== K . length ; ++ i ) o [ obj [ K [ i ] ] ] = parseInt ( K [ i ] , 10 ) ; return o } function evert _arr ( obj ) { var o = [ ] , K = keys ( obj ) ; for ( var i = 0 ; i !== K . length ; ++ i ) { if ( o [ obj [ K [ i ] ] ] == null ) o [ obj [ K [ i ] ] ] = [ ] ; o [ obj [ K [ i ] ] ] . push ( K [ i ] ) } return o } function datenum ( v , date1904 ) { if ( date1904 ) v += 1462 ; var epoch = Date . parse (
xlsb : "application/vnd.ms-excel.sharedStrings" } , sheets : { xlsx : "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" , xlsb : "application/vnd.ms-excel.worksheet" } , styles : { xlsx : "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml" , xlsb : "application/vnd.ms-excel.styles" } } ; keys ( o ) . forEach ( function ( k ) { if ( ! o [ k ] . xlsm ) o [ k ] . xlsm = o [ k ] . xlsx } ) ; keys ( o ) . forEach ( function ( k ) { keys ( o [ k ] ) . forEach ( function ( v ) { ct2type [ o [ k ] [ v ] ] = k } ) } ) ; return o } ( ) ; var type2ct = evert _arr ( ct2type ) ; XMLNS . CT = "http://schemas.openxmlformats.org/package/2006/content-types" ; function parse _ct ( data , opts ) { var ctext = { } ; if ( ! data || ! data . match ) return data ; var ct = { workbooks : [ ] , sheets : [ ] , calcchains : [ ] , themes : [ ] , styles : [ ] , coreprops : [ ] , extprops : [ ] , custprops : [ ] , strs : [ ] , comments : [ ] , vba : [ ] , TODO : [ ] , rels : [ ] , xmlns : "" } ; ( data . match ( tagregex ) || [ ] ) . forEach ( function ( x ) { var y = parsexmltag ( x ) ; switch ( y [ 0 ] . replace ( nsregex , "<" ) ) { case "<?xml" : break ; case "<Types" : ct . xmlns = y [ "xmlns" + ( y [ 0 ] . match ( /<(\w+):/ ) || [ "" , "" ] ) [ 1 ] ] ; break ; case "<Default" : ctext [ y . Extension ] = y . ContentType ; break ; case "<Override" : if ( ct [ ct2type [ y . ContentType ] ] !== undefined ) ct [ ct2type [ y . ContentType ] ] . push ( y . PartName ) ; else if ( opts . WTF ) console . error ( y ) ; break } } ) ; if ( ct . xmlns !== XMLNS . CT ) throw new Error ( "Unknown Namespace: " + ct . xmlns ) ; ct . calcchain = ct . calcchains . length > 0 ? ct . calcchains [ 0 ] : "" ; ct . sst = ct . strs . length > 0 ? ct . strs [ 0 ] : "" ; ct . style = ct . styles . length > 0 ? ct . styles [ 0 ] : "" ; ct . defaults = ctext ; delete ct . calcchains ; return ct } var CTYPE _XML _ROOT = writextag ( "Types" , null , { xmlns : XMLNS . CT , "xmlns:xsd" : XMLNS . xsd , "xmlns:xsi" : XMLNS . xsi } ) ; var CTYPE _DEFAULTS = [ [ "xml" , "application/xml" ] , [ "bin" , "application/vnd.ms-excel.sheet.binary.macroEnabled.main" ] , [ "rels" , type2ct . rels [ 0 ] ] ] . map ( function ( x ) { return writextag ( "Default" , null , { Extension : x [ 0 ] , ContentType : x [ 1 ] } ) } ) ; function write _ct ( ct , opts ) { var o = [ ] , v ; o [ o . length ] = XML _HEADER ; o [ o . length ] = CTYPE _XML _ROOT ; o = o . concat ( CTYPE _DEFAULTS ) ; var f1 = function ( w ) { if ( ct [ w ] && ct [ w ] . length > 0 ) { v = ct [ w ] [ 0 ] ; o [ o . length ] = writextag ( "Override" , null , { PartName : ( v [ 0 ] == "/" ? "" : "/" ) + v , ContentType : CT _LIST [ w ] [ opts . bookType || "xlsx" ] } ) } } ; var f2 = function ( w ) { ct [ w ] . forEach ( function ( v ) { o [ o . length ] = writextag ( "Override" , null , { PartName : ( v [ 0 ] == "/" ? "" : "/" ) + v , ContentType : CT _LIST [ w ] [ opts . bookType || "xlsx" ] } ) } ) } ; var f3 = function ( t ) { ( ct [ t ] || [ ] ) . forEach ( function ( v ) { o [ o . length ] = writextag ( "Override" , null , { PartName : ( v [ 0 ] == "/" ? "" : "/" ) + v , ContentType : type2ct [ t ] [ 0 ] } ) } ) } ; f1 ( "workbooks" ) ; f2 ( "sheets" ) ; f3 ( "themes" ) ; [ "strs" , "styles" ] . forEach ( f1 ) ; [ "coreprops" , "extprops" , "custprops" ] . forEach ( f3 ) ; if ( o . length > 2 ) { o [ o . length ] = "</Types>" ; o [ 1 ] = o [ 1 ] . replace ( "/>" , ">" ) } return o . join ( "" ) } var RELS = { WB : "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" , SHEET : "http://sheetjs.openxmlformats.org/officeDocument/2006/relationships/officeDocument" } ; function parse _rels ( data , currentFilePath ) { if ( ! data ) return data ; if ( currentFilePath . charAt ( 0 ) !== "/" ) { currentFilePath = "/" + currentFilePath } var rels = { } ; var hash = { } ; var resolveRelativePathIntoAbsolute = function ( to ) { var toksFrom = currentFilePath . split ( "/" ) ; toksFrom . pop ( ) ; var toksTo = to . split ( "/" ) ; var reversed = [ ] ; while ( toksTo . length !== 0 ) { var tokTo = toksTo . shift ( ) ; if ( tokTo === ".." ) { toksFrom . pop ( ) } else if ( tokTo !== "." ) { toksFrom . push ( tokTo ) } } return toksFrom . join ( "/" ) } ; data . match ( tagregex ) . forEach ( function ( x ) { var y = parsexmltag ( x ) ; if ( y [ 0 ] === "<Relationship" ) { var rel = { } ; rel . Type = y . Type ; rel . Target = y . Target ; rel . Id = y . Id ; rel . TargetMode = y . TargetMode ; var canonictarget = y . TargetMode === "External" ? y . Target : resolveRelativePathIntoAbsolute ( y . Target ) ; rels [ canonictarget ] = rel ; hash [ y . Id ] = rel } } ) ; rels [ "!id" ] = hash ; return rels } XMLNS . RELS = "http://schemas.openxmlformats.org/package/2006/relationships" ; var RELS _ROOT = writextag ( "Relationships" , null , { xmlns : XMLNS . RELS } ) ; function write _rels ( rels ) { var o = [ ] ; o [ o . length ] = XML _HEADER ; o [ o . length ] = RELS _ROOT ; keys ( rels [ "!id" ] ) . forEach ( function ( rid ) { var rel = rels [ "!id" ] [ rid ] ; o [ o . length ] = writextag ( "Relationship" , null , rel ) } ) ; if ( o . length > 2 ) { o [ o . length ] = "</Relationships>" ; o [ 1 ] = o [ 1 ] . replace ( "/>" , ">" ) } return o . join ( "" ) } var CORE _PROPS = [ [ "cp:category" , "Category" ] , [ "cp:contentStatus" , "ContentStatus" ] , [ " cp : keywords
return o } function parse _ClrtClient ( blob , length ) { var ccv = blob . read _shift ( 2 ) ; var o = [ ] ; while ( ccv -- > 0 ) o . push ( parse _LongRGB ( blob , 8 ) ) ; return o } function parse _Palette ( blob , length ) { var ccv = blob . read _shift ( 2 ) ; var o = [ ] ; while ( ccv -- > 0 ) o . push ( parse _LongRGB ( blob , 8 ) ) ; return o } function parse _XFCRC ( blob , length ) { blob . l += 2 ; var o = { cxfs : 0 , crc : 0 } ; o . cxfs = blob . read _shift ( 2 ) ; o . crc = blob . read _shift ( 4 ) ; return o } var parse _Style = parsenoop ; var parse _StyleExt = parsenoop ; var parse _ColInfo = parsenoop ; var parse _Window2 = parsenoop ; var parse _Backup = parsebool ; var parse _Blank = parse _XLSCell ; var parse _BottomMargin = parse _Xnum ; var parse _BuiltInFnGroupCount = parseuint16 ; var parse _CalcCount = parseuint16 ; var parse _CalcDelta = parse _Xnum ; var parse _CalcIter = parsebool ; var parse _CalcMode = parseuint16 ; var parse _CalcPrecision = parsebool ; var parse _CalcRefMode = parsenoop2 ; var parse _CalcSaveRecalc = parsebool ; var parse _CodePage = parseuint16 ; var parse _Compat12 = parsebool ; var parse _Date1904 = parsebool ; var parse _DefColWidth = parseuint16 ; var parse _DSF = parsenoop2 ; var parse _EntExU2 = parsenoop2 ; var parse _EOF = parsenoop2 ; var parse _Excel9File = parsenoop2 ; var parse _FeatHdr = parsenoop2 ; var parse _FontX = parseuint16 ; var parse _Footer = parse _XLHeaderFooter ; var parse _GridSet = parseuint16 ; var parse _HCenter = parsebool ; var parse _Header = parse _XLHeaderFooter ; var parse _HideObj = parse _HideObjEnum ; var parse _InterfaceEnd = parsenoop2 ; var parse _LeftMargin = parse _Xnum ; var parse _Mms = parsenoop2 ; var parse _ObjProtect = parsebool ; var parse _Password = parseuint16 ; var parse _PrintGrid = parsebool ; var parse _PrintRowCol = parsebool ; var parse _PrintSize = parseuint16 ; var parse _Prot4Rev = parsebool ; var parse _Prot4RevPass = parseuint16 ; var parse _Protect = parsebool ; var parse _RefreshAll = parsebool ; var parse _RightMargin = parse _Xnum ; var parse _RRTabId = parseuint16a ; var parse _ScenarioProtect = parsebool ; var parse _Scl = parseuint16a ; var parse _String = parse _XLUnicodeString ; var parse _SxBool = parsebool ; var parse _TopMargin = parse _Xnum ; var parse _UsesELFs = parsebool ; var parse _VCenter = parsebool ; var parse _WinProtect = parsebool ; var parse _WriteProtect = parsenoop ; var parse _VerticalPageBreaks = parsenoop ; var parse _HorizontalPageBreaks = parsenoop ; var parse _Selection = parsenoop ; var parse _Continue = parsenoop ; var parse _Pane = parsenoop ; var parse _Pls = parsenoop ; var parse _DCon = parsenoop ; var parse _DConRef = parsenoop ; var parse _DConName = parsenoop ; var parse _XCT = parsenoop ; var parse _CRN = parsenoop ; var parse _FileSharing = parsenoop ; var parse _Uncalced = parsenoop ; var parse _Template = parsenoop ; var parse _Intl = parsenoop ; var parse _WsBool = parsenoop ; var parse _Sort = parsenoop ; var parse _Sync = parsenoop ; var parse _LPr = parsenoop ; var parse _DxGCol = parsenoop ; var parse _FnGroupName = parsenoop ; var parse _FilterMode = parsenoop ; var parse _AutoFilterInfo = parsenoop ; var parse _AutoFilter = parsenoop ; var parse _Setup = parsenoop ; var parse _ScenMan = parsenoop ; var parse _SCENARIO = parsenoop ; var parse _SxView = parsenoop ; var parse _Sxvd = parsenoop ; var parse _SXVI = parsenoop ; var parse _SxIvd = parsenoop ; var parse _SXLI = parsenoop ; var parse _SXPI = parsenoop ; var parse _DocRoute = parsenoop ; var parse _RecipName = parsenoop ; var parse _MulBlank = parsenoop ; var parse _SXDI = parsenoop ; var parse _SXDB = parsenoop ; var parse _SXFDB = parsenoop ; var parse _SXDBB = parsenoop ; var parse _SXNum = parsenoop ; var parse _SxErr = parsenoop ; var parse _SXInt = parsenoop ; var parse _SXString = parsenoop ; var parse _SXDtr = parsenoop ; var parse _SxNil = parsenoop ; var parse _SXTbl = parsenoop ; var parse _SXTBRGIITM = parsenoop ; var parse _SxTbpg = parsenoop ; var parse _ObProj = parsenoop ; var parse _SXStreamID = parsenoop ; var parse _DBCell = parsenoop ; var parse _SXRng = parsenoop ; var parse _SxIsxoper = parsenoop ; var parse _BookBool = parsenoop ; var parse _DbOrParamQry = parsenoop ; var parse _OleObjectSize = parsenoop ; var parse _SXVS = parsenoop ; var parse _BkHim = parsenoop ; var parse _MsoDrawingGroup = parsenoop ; var parse _MsoDrawing = parsenoop ; var parse _MsoDrawingSelection = parsenoop ; var parse _PhoneticInfo = parsenoop ; var parse _SxRule = parsenoop ; var parse _SXEx = parsenoop ; var parse _SxFilt = parsenoop ; var parse _SxDXF = parsenoop ; var parse _SxItm = parsenoop ; var parse _SxName = parsenoop ; var parse _SxSelect = parsenoop ; var parse _SXPair = parsenoop ; var parse _SxFmla = parsenoop ; var parse _SxFormat = parsenoop ; var
2016-12-31 08:20:45 +00:00
} function parse _Theme ( blob , length ) { var dwThemeVersion = blob . read _shift ( 4 ) ; if ( dwThemeVersion === 124226 ) return ; blob . l += length - 4 } function parse _ColorTheme ( blob , length ) { return blob . read _shift ( 4 ) } function parse _FullColorExt ( blob , length ) { var o = { } ; o . xclrType = blob . read _shift ( 2 ) ; o . nTintShade = blob . read _shift ( 2 ) ; switch ( o . xclrType ) { case 0 : blob . l += 4 ; break ; case 1 : o . xclrValue = parse _IcvXF ( blob , 4 ) ; break ; case 2 : o . xclrValue = parse _LongRGBA ( blob , 4 ) ; break ; case 3 : o . xclrValue = parse _ColorTheme ( blob , 4 ) ; break ; case 4 : blob . l += 4 ; break } blob . l += 8 ; return o } function parse _IcvXF ( blob , length ) { return parsenoop ( blob , length ) } function parse _XFExtGradient ( blob , length ) { return parsenoop ( blob , length ) } function parse _ExtProp ( blob , length ) { var extType = blob . read _shift ( 2 ) ; var cb = blob . read _shift ( 2 ) ; var o = [ extType ] ; switch ( extType ) { case 4 : case 5 : case 7 : case 8 : case 9 : case 10 : case 11 : case 13 : o [ 1 ] = parse _FullColorExt ( blob , cb ) ; break ; case 6 : o [ 1 ] = parse _XFExtGradient ( blob , cb ) ; break ; case 14 : case 15 : o [ 1 ] = blob . read _shift ( cb === 5 ? 1 : 2 ) ; break ; default : throw new Error ( "Unrecognized ExtProp type: " + extType + " " + cb ) } return o } function parse _XFExt ( blob , length ) { var end = blob . l + length ; blob . l += 2 ; var ixfe = blob . read _shift ( 2 ) ; blob . l += 2 ; var cexts = blob . read _shift ( 2 ) ; var ext = [ ] ; while ( cexts -- > 0 ) ext . push ( parse _ExtProp ( blob , end - blob . l ) ) ; return { ixfe : ixfe , ext : ext } } function update _xfext ( xf , xfext ) { xfext . forEach ( function ( xfe ) { switch ( xfe [ 0 ] ) { case 4 : break ; case 5 : break ; case 7 : case 8 : case 9 : case 10 : break ; case 13 : break ; case 14 : break ; default : throw "bafuq" + xfe [ 0 ] . toString ( 16 ) } } ) } function parse _cc _xml ( data , opts ) { var d = [ ] ; var l = 0 , i = 1 ; ( data . match ( tagregex ) || [ ] ) . forEach ( function ( x ) { var y = parsexmltag ( x ) ; switch ( y [ 0 ] ) { case "<?xml" : break ; case "<calcChain" : case "<calcChain>" : case "</calcChain>" : break ; case "<c" : delete y [ 0 ] ; if ( y . i ) i = y . i ; else y . i = i ; d . push ( y ) ; break } } ) ; return d } function write _cc _xml ( data , opts ) { } function parse _BrtCalcChainItem$ ( data , length ) { var out = { } ; out . i = data . read _shift ( 4 ) ; var cell = { } ; cell . r = data . read _shift ( 4 ) ; cell . c = data . read _shift ( 4 ) ; out . r = encode _cell ( cell ) ; var flags = data . read _shift ( 1 ) ; if ( flags & 2 ) out . l = "1" ; if ( flags & 8 ) out . a = "1" ; return out } function parse _cc _bin ( data , opts ) { var out = [ ] ; var pass = false ; recordhopper ( data , function hopper _cc ( val , R , RT ) { switch ( R . n ) { case "BrtCalcChainItem$" : out . push ( val ) ; break ; case "BrtBeginCalcChain$" : break ; case "BrtEndCalcChain$" : break ; default : if ( ! pass || opts . WTF ) throw new Error ( "Unexpected record " + RT + " " + R . n ) } } ) ; return out } function write _cc _bin ( data , opts ) { } function parse _comments ( zip , dirComments , sheets , sheetRels , opts ) { for ( var i = 0 ; i != dirComments . length ; ++ i ) { var canonicalpath = dirComments [ i ] ; var comments = parse _cmnt ( getzipdata ( zip , canonicalpath . replace ( /^\// , "" ) , true ) , canonicalpath , opts ) ; if ( ! comments || ! comments . length ) continue ; var sheetNames = keys ( sheets ) ; for ( var j = 0 ; j != sheetNames . length ; ++ j ) { var sheetName = sheetNames [ j ] ; var rels = sheetRels [ sheetName ] ; if ( rels ) { var rel = rels [ canonicalpath ] ; if ( rel ) insertCommentsIntoSheet ( sheetName , sheets [ sheetName ] , comments ) } } } } function insertCommentsIntoSheet ( sheetName , sheet , comments ) { comments . forEach ( function ( comment ) { var cell = sheet [ comment . ref ] ; if ( ! cell ) { cell = { } ; sheet [ comment . ref ] = cell ; var range = safe _decode _range ( sheet [ "!ref" ] || "BDWGO1000001:A1" ) ; var thisCell = decode _cell ( comment . ref ) ; if ( range . s . r > thisCell . r ) range . s . r = thisCell . r ; if ( range . e . r < thisCell . r ) range . e . r = thisCell . r ; if ( range . s . c > thisCell . c ) range . s . c = thisCell . c ; if ( range . e . c < thisCell . c ) range . e . c = thisCell . c ; var encoded = encode _range ( range ) ; if ( encoded !== sheet [ "!ref" ] ) sheet [ "!ref" ] = encoded } if ( ! cell . c ) cell . c = [ ] ; var o = { a : comment . author , t : comment . t , r : comment . r } ; if ( comment . h ) o . h = comment . h ; cell . c . push ( o ) } ) } function parse _comments _xml ( data , opts ) { if ( data . match ( /<(?:\w+:)?comments *\/>/ ) ) return [ ] ; var authors = [ ] ; var commentList = [ ] ; data . match ( /<(?:\w+:)?authors>([^\u2603]*)<\/(?:\w+:)?authors>/ ) [ 1 ] . split ( /<\/\w*:?author>/ ) . forEach ( function ( x ) { if ( x === "" || x . trim ( ) === "" ) return ; authors . push ( x . match ( /<(?:\w+:)?author[^>]*>(.*)/ ) [ 1 ] ) } ) ; ( data . match ( /<(?:\w+:)?commentList>([^\u2603]*)<\/(?:\w+:)?commentList>/ ) || [ "" , "" ] ) [ 1 ] . split ( /<\/\w*:?comment>/ ) . forEach ( function ( x , index ) { if ( x === "" || x . trim ( ) === "" ) return ; var y = parsexmltag ( x . match ( / < ( ? : \ w
2017-02-03 20:50:45 +00:00
291 : "LOGINV" , 292 : "NEGBINOMDIST" , 293 : "NORMDIST" , 294 : "NORMSDIST" , 295 : "NORMINV" , 296 : "NORMSINV" , 297 : "STANDARDIZE" , 298 : "ODD" , 299 : "PERMUT" , 300 : "POISSON" , 301 : "TDIST" , 302 : "WEIBULL" , 303 : "SUMXMY2" , 304 : "SUMX2MY2" , 305 : "SUMX2PY2" , 306 : "CHITEST" , 307 : "CORREL" , 308 : "COVAR" , 309 : "FORECAST" , 310 : "FTEST" , 311 : "INTERCEPT" , 312 : "PEARSON" , 313 : "RSQ" , 314 : "STEYX" , 315 : "SLOPE" , 316 : "TTEST" , 317 : "PROB" , 318 : "DEVSQ" , 319 : "GEOMEAN" , 320 : "HARMEAN" , 321 : "SUMSQ" , 322 : "KURT" , 323 : "SKEW" , 324 : "ZTEST" , 325 : "LARGE" , 326 : "SMALL" , 327 : "QUARTILE" , 328 : "PERCENTILE" , 329 : "PERCENTRANK" , 330 : "MODE" , 331 : "TRIMMEAN" , 332 : "TINV" , 334 : "MOVIE.COMMAND" , 335 : "GET.MOVIE" , 336 : "CONCATENATE" , 337 : "POWER" , 338 : "PIVOT.ADD.DATA" , 339 : "GET.PIVOT.TABLE" , 340 : "GET.PIVOT.FIELD" , 341 : "GET.PIVOT.ITEM" , 342 : "RADIANS" , 343 : "DEGREES" , 344 : "SUBTOTAL" , 345 : "SUMIF" , 346 : "COUNTIF" , 347 : "COUNTBLANK" , 348 : "SCENARIO.GET" , 349 : "OPTIONS.LISTS.GET" , 350 : "ISPMT" , 351 : "DATEDIF" , 352 : "DATESTRING" , 353 : "NUMBERSTRING" , 354 : "ROMAN" , 355 : "OPEN.DIALOG" , 356 : "SAVE.DIALOG" , 357 : "VIEW.GET" , 358 : "GETPIVOTDATA" , 359 : "HYPERLINK" , 360 : "PHONETIC" , 361 : "AVERAGEA" , 362 : "MAXA" , 363 : "MINA" , 364 : "STDEVPA" , 365 : "VARPA" , 366 : "STDEVA" , 367 : "VARA" , 368 : "BAHTTEXT" , 369 : "THAIDAYOFWEEK" , 370 : "THAIDIGIT" , 371 : "THAIMONTHOFYEAR" , 372 : "THAINUMSOUND" , 373 : "THAINUMSTRING" , 374 : "THAISTRINGLENGTH" , 375 : "ISTHAIDIGIT" , 376 : "ROUNDBAHTDOWN" , 377 : "ROUNDBAHTUP" , 378 : "THAIYEAR" , 379 : "RTD" } ; var FtabArgc = { 2 : 1 , 3 : 1 , 15 : 1 , 16 : 1 , 17 : 1 , 18 : 1 , 20 : 1 , 21 : 1 , 22 : 1 , 23 : 1 , 24 : 1 , 25 : 1 , 26 : 1 , 27 : 2 , 30 : 2 , 31 : 3 , 32 : 1 , 33 : 1 , 38 : 1 , 39 : 2 , 40 : 3 , 41 : 3 , 42 : 3 , 43 : 3 , 44 : 3 , 45 : 3 , 47 : 3 , 48 : 2 , 53 : 1 , 61 : 3 , 65 : 3 , 66 : 3 , 67 : 1 , 68 : 1 , 69 : 1 , 71 : 1 , 72 : 1 , 73 : 1 , 75 : 1 , 76 : 1 , 77 : 1 , 79 : 2 , 80 : 2 , 83 : 1 , 86 : 1 , 90 : 1 , 97 : 2 , 98 : 1 , 99 : 1 , 105 : 1 , 111 : 1 , 112 : 1 , 113 : 1 , 114 : 1 , 117 : 2 , 118 : 1 , 119 : 4 , 121 : 1 , 126 : 1 , 127 : 1 , 128 : 1 , 129 : 1 , 130 : 1 , 131 : 1 , 133 : 1 , 134 : 1 , 135 : 1 , 136 : 2 , 137 : 2 , 138 : 2 , 140 : 1 , 141 : 1 , 142 : 3 , 143 : 4 , 162 : 1 , 163 : 1 , 164 : 1 , 165 : 2 , 172 : 1 , 175 : 2 , 176 : 2 , 177 : 3 , 178 : 2 , 179 : 1 , 184 : 1 , 189 : 3 , 190 : 1 , 195 : 3 , 196 : 3 , 198 : 1 , 199 : 3 , 201 : 1 , 207 : 4 , 210 : 3 , 211 : 1 , 212 : 2 , 213 : 2 , 214 : 1 , 215 : 1 , 229 : 1 , 230 : 1 , 231 : 1 , 232 : 1 , 233 : 1 , 234 : 1 , 235 : 3 , 244 : 1 , 252 : 2 , 257 : 1 , 261 : 1 , 271 : 1 , 273 : 4 , 274 : 2 , 275 : 2 , 276 : 2 , 277 : 3 , 278 : 3 , 279 : 1 , 280 : 3 , 281 : 3 , 282 : 3 , 283 : 1 , 284 : 1 , 285 : 2 , 286 : 4 , 287 : 3 , 288 : 2 , 289 : 4 , 290 : 3 , 291 : 3 , 292 : 3 , 293 : 4 , 294 : 1 , 295 : 3 , 296 : 1 , 297 : 3 , 298 : 1 , 299 : 2 , 300 : 3 , 301 : 3 , 302 : 4 , 303 : 2 , 304 : 2 , 305 : 2 , 306 : 2 , 307 : 2 , 308 : 2 , 309 : 3 , 310 : 2 , 311 : 2 , 312 : 2 , 313 : 2 , 314 : 2 , 315 : 2 , 316 : 4 , 325 : 2 , 326 : 2 , 327 : 2 , 328 : 2 , 331 : 2 , 332 : 2 , 337 : 2 , 342 : 1 , 343 : 1 , 346 : 2 , 347 : 1 , 350 : 4 , 351 : 3 , 352 : 1 , 353 : 2 , 360 : 1 , 368 : 1 , 369 : 1 , 370 : 1 , 371 : 1 , 372 : 1 , 373 : 1 , 374 : 1 , 375 : 1 , 376 : 1 , 377 : 1 , 378 : 1 , 65535 : 0 } ; var XLSXFutureFunctions = { "_xlfn.ACOT" : "ACOT" , "_xlfn.ACOTH" : "ACOTH" , "_xlfn.AGGREGATE" : "AGGREGATE" , "_xlfn.ARABIC" : "ARABIC" , "_xlfn.AVERAGEIF" : "AVERAGEIF" , "_xlfn.AVERAGEIFS" : "AVERAGEIFS" , "_xlfn.BASE" : "BASE" , "_xlfn.BETA.DIST" : "BETA.DIST" , "_xlfn.BETA.INV" : "BETA.INV" , "_xlfn.BINOM.DIST" : "BINOM.DIST" , "_xlfn.BINOM.DIST.RANGE" : "BINOM.DIST.RANGE" , "_xlfn.BINOM.INV" : "BINOM.INV" , "_xlfn.BITAND" : "BITAND" , "_xlfn.BITLSHIFT" : "BITLSHIFT" , "_xlfn.BITOR" : "BITOR" , "_xlfn.BITRSHIFT" : "BITRSHIFT" , "_xlfn.BITXOR" : "BITXOR" , "_xlfn.CEILING.MATH" : "CEILING.MATH" , "_xlfn.CEILING.PRECISE" : "CEILING.PRECISE" , "_xlfn.CHISQ.DIST" : "CHISQ.DIST" , "_xlfn.CHISQ.DIST.RT" : "CHISQ.DIST.RT" , "_xlfn.CHISQ.INV" : "CHISQ.INV" , "_xlfn.CHISQ.INV.RT" : "CHISQ.INV.RT" , "_xlfn.CHISQ.TEST" : "CHISQ.TEST" , "_xlfn.COMBINA" : "COMBINA" , "_xlfn.CONFIDENCE.NORM" : "CONFIDENCE.NORM" , "_xlfn.CONFIDENCE.T" : "CONFIDENCE.T" , "_xlfn.COT" : "COT" , "_xlfn.COTH" : "COTH" , "_xlfn.COUNTIFS" : "COUNTIFS" , "_xlfn.COVARIANCE.P" : "COVARIANCE.P" , "_xlfn.COVARIANCE.S" : "COVARIANCE.S" , "_xlfn.CSC" : "CSC" , "_xlfn.CSCH" : "CSCH" , "_xlfn.DAYS" : "DAYS" , "_xlfn.DECIMAL" : "DECIMAL" , "_xlfn.ECMA.CEILING" : "ECMA.CEILING" , "_xlfn.ERF.PRECISE" : "ERF.PRECISE" , "_xlfn.ERFC.PRECISE" : "ERFC.PRECISE" , "_xlfn.EXPON.DIST" : "EXPON.DIST" , "_xlfn.F.DIST" : "F.DIST" , "_xlfn.F.DIST.RT" : "F.DIST.RT" , "_xlfn.F.INV" : "F.INV" , "_xlfn.F.INV.RT" : "F.INV.RT" , "_xlfn.F.TEST" : "F.TEST" , "_xlfn.FILTERXML" : "FILTERXML" , "_xlfn.FLOOR.MATH" : "FLOOR.MATH" , "_xlfn.FLOOR.PRECISE" : "FLOOR.PRECISE" , "_xlfn.FORMULATEXT" : "FORMULATEXT" , "_xlfn.GAMMA" : "GAMMA" , "_xlfn.GAMMA.DIST" : "GAMMA.DIST" , "_xlfn.GAMMA.INV" : "GAMMA.INV" , "_xlfn.GAMMALN.PRECISE" : "GAMMALN.PRECISE" , "_xlfn.GAUSS" : "GAUSS" , "_xlfn.HYPGEOM.DIST" : "HYPGEOM.DIST" , "_xlfn.IFNA" : "IFNA" , "_xlfn.IFERROR" : "IFERROR" , " _xlf
break ; case "BrtEndBundleShs" : break ; case "BrtBeginFnGroup" : break ; case "BrtEndFnGroup" : break ; case "BrtBeginExternals" : break ; case "BrtSupSelf" : break ; case "BrtSupBookSrc" : break ; case "BrtExternSheet" : break ; case "BrtEndExternals" : break ; case "BrtName" : break ; case "BrtCalcProp" : break ; case "BrtUserBookView" : break ; case "BrtBeginPivotCacheIDs" : break ; case "BrtBeginPivotCacheID" : break ; case "BrtEndPivotCacheID" : break ; case "BrtEndPivotCacheIDs" : break ; case "BrtWebOpt" : break ; case "BrtFileRecover" : break ; case "BrtFileSharing" : break ; case "BrtBeginSmartTagTypes" : break ; case "BrtSmartTagType" : break ; case "BrtEndSmartTagTypes" : break ; case "BrtFRTBegin" : pass = true ; break ; case "BrtFRTArchID$" : break ; case "BrtWorkBookPr15" : break ; case "BrtFRTEnd" : pass = false ; break ; case "BrtEndBook" : break ; default : if ( ! pass || opts . WTF ) throw new Error ( "Unexpected record " + R . n ) } } ) ; parse _wb _defaults ( wb ) ; return wb } function write _BUNDLESHS ( ba , wb , opts ) { write _record ( ba , "BrtBeginBundleShs" ) ; for ( var idx = 0 ; idx != wb . SheetNames . length ; ++ idx ) { var d = { hsState : 0 , iTabID : idx + 1 , strRelID : "rId" + ( idx + 1 ) , name : wb . SheetNames [ idx ] } ; write _record ( ba , "BrtBundleSh" , write _BrtBundleSh ( d ) ) } write _record ( ba , "BrtEndBundleShs" ) } function write _BrtFileVersion ( data , o ) { if ( ! o ) o = new _buf ( 127 ) ; for ( var i = 0 ; i != 4 ; ++ i ) o . write _shift ( 4 , 0 ) ; write _XLWideString ( "SheetJS" , o ) ; write _XLWideString ( XLSX . version , o ) ; write _XLWideString ( XLSX . version , o ) ; write _XLWideString ( "7262" , o ) ; o . length = o . l ; return o . length > o . l ? o . slice ( 0 , o . l ) : o } function write _BOOKVIEWS ( ba , wb , opts ) { write _record ( ba , "BrtBeginBookViews" ) ; write _record ( ba , "BrtEndBookViews" ) } function write _BrtCalcProp ( data , o ) { if ( ! o ) o = new _buf ( 26 ) ; o . write _shift ( 4 , 0 ) ; o . write _shift ( 4 , 1 ) ; o . write _shift ( 4 , 0 ) ; write _Xnum ( 0 , o ) ; o . write _shift ( - 4 , 1023 ) ; o . write _shift ( 1 , 51 ) ; o . write _shift ( 1 , 0 ) ; return o } function write _BrtFileRecover ( data , o ) { if ( ! o ) o = new _buf ( 1 ) ; o . write _shift ( 1 , 0 ) ; return o } function write _wb _bin ( wb , opts ) { var ba = buf _array ( ) ; write _record ( ba , "BrtBeginBook" ) ; write _record ( ba , "BrtFileVersion" , write _BrtFileVersion ( ) ) ; if ( 0 ) write _record ( ba , "BrtWbProp" , write _BrtWbProp ( ) ) ; if ( 0 ) write _BOOKVIEWS ( ba , wb , opts ) ; write _BUNDLESHS ( ba , wb , opts ) ; if ( 0 ) write _record ( ba , "BrtCalcProp" , write _BrtCalcProp ( ) ) ; if ( 0 ) write _record ( ba , "BrtFileRecover" , write _BrtFileRecover ( ) ) ; write _record ( ba , "BrtEndBook" ) ; return ba . end ( ) } function parse _wb ( data , name , opts ) { return ( name . substr ( - 4 ) === ".bin" ? parse _wb _bin : parse _wb _xml ) ( data , opts ) } function parse _ws ( data , name , opts , rels ) { return ( name . substr ( - 4 ) === ".bin" ? parse _ws _bin : parse _ws _xml ) ( data , opts , rels ) } function parse _sty ( data , name , opts ) { return ( name . substr ( - 4 ) === ".bin" ? parse _sty _bin : parse _sty _xml ) ( data , opts ) } function parse _theme ( data , name , opts ) { return parse _theme _xml ( data , opts ) } function parse _sst ( data , name , opts ) { return ( name . substr ( - 4 ) === ".bin" ? parse _sst _bin : parse _sst _xml ) ( data , opts ) } function parse _cmnt ( data , name , opts ) { return ( name . substr ( - 4 ) === ".bin" ? parse _comments _bin : parse _comments _xml ) ( data , opts ) } function parse _cc ( data , name , opts ) { return ( name . substr ( - 4 ) === ".bin" ? parse _cc _bin : parse _cc _xml ) ( data , opts ) } function write _wb ( wb , name , opts ) { return ( name . substr ( - 4 ) === ".bin" ? write _wb _bin : write _wb _xml ) ( wb , opts ) } function write _ws ( data , name , opts , wb ) { return ( name . substr ( - 4 ) === ".bin" ? write _ws _bin : write _ws _xml ) ( data , opts , wb ) } function write _sty ( data , name , opts ) { return ( name . substr ( - 4 ) === ".bin" ? write _sty _bin : write _sty _xml ) ( data , opts ) } function write _sst ( data , name , opts ) { return ( name . substr ( - 4 ) === ".bin" ? write _sst _bin : write _sst _xml ) ( data , opts ) } var attregexg2 = /([\w:]+)=((?:")([^"]*)(?:")|(?:')([^']*)(?:'))/g ; var attregex2 = /([\w:]+)=((?:")(?:[^"]*)(?:")|(?:')(?:[^']*)(?:'))/ ; var _chr = function ( c ) { return String . fromCharCode ( c ) } ; function xlml _parsexmltag ( tag , skip _root ) { var words = tag . split ( /\s+/ ) ; var z = [ ] ; if ( ! skip _root ) z [ 0 ] = words [ 0 ] ; if ( words . length === 1 ) return z ; var m = tag . match ( attregexg2 ) , y , j , w , i ; if ( m ) for ( i = 0 ; i != m . length ; ++ i ) { y = m [ i ] . match ( attregex2 ) ; if ( ( j = y [ 1 ] . indexOf ( ":" ) ) === - 1 ) z [ y [ 1 ] ] = y [ 2 ] . substr ( 1 , y [ 2 ] . length - 2 ) ; else { if ( y [ 1 ] . substr ( 0 , 6 ) === "xmlns:" ) w = "xmlns" + y [ 1 ] . substr ( 6 ) ; else w = y [ 1 ] . substr ( j + 1 ) ; z [ w ] = y [ 2 ] . substr ( 1 , y [ 2 ] . length - 2 ) } } return z } function xlml _parsexmltagobj ( tag ) { var words = tag . split ( /\s+/ ) ; var z = { } ; if ( words . length === 1 ) return z ; var m = tag . match ( attregexg2
break ; case "Pie" : case "Scatter" : break ; case "PieFormat" : case "MarkerFormat" : break ; case "StartObject" : case "EndObject" : break ; case "AlRuns" : case "ObjectLink" : break ; case "SIIndex" : break ; case "AttachedLabel" : case "YMult" : break ; case "Line" : case "Bar" : break ; case "Surf" : break ; case "AxisParent" : break ; case "Pos" : break ; case "ValueRange" : break ; case "SXViewEx9" : break ; case "SXViewLink" : break ; case "PivotChartBits" : break ; case "SBaseRef" : break ; case "TextPropsStream" : break ; case "LnExt" : break ; case "MkrExt" : break ; case "CrtCoopt" : break ; case "Qsi" : case "Qsif" : case "Qsir" : case "QsiSXTag" : break ; case "TxtQry" : break ; case "FilterMode" : break ; case "AutoFilter" : case "AutoFilterInfo" : break ; case "AutoFilter12" : break ; case "DropDownObjIds" : break ; case "Sort" : break ; case "SortData" : break ; case "ShapePropsStream" : break ; case "MsoDrawing" : case "MsoDrawingGroup" : case "MsoDrawingSelection" : break ; case "ImData" : break ; case "WebPub" : case "AutoWebPub" : case "RightMargin" : case "LeftMargin" : case "TopMargin" : case "BottomMargin" : case "HeaderFooter" : case "HFPicture" : case "PLV" : case "HorizontalPageBreaks" : case "VerticalPageBreaks" : case "Backup" : case "CompressPictures" : case "Compat12" : break ; case "Continue" : case "ContinueFrt12" : break ; case "FrtFontList" : case "FrtWrapper" : break ; case "ExternCount" : break ; case "RString" : break ; case "TabIdConf" : case "Radar" : case "RadarArea" : case "DropBar" : case "Intl" : case "CoordList" : case "SerAuxErrBar" : break ; default : switch ( R . n ) { case "SCENARIO" : case "DConBin" : case "PicF" : case "DataLabExt" : case "Lel" : case "BopPop" : case "BopPopCustom" : case "RealTimeData" : case "Name" : break ; default : if ( options . WTF ) throw "Unrecognized Record " + R . n } } } } } else blob . l += length } var sheetnamesraw = opts . biff === 2 ? [ "Sheet1" ] : Object . keys ( Directory ) . sort ( function ( a , b ) { return Number ( a ) - Number ( b ) } ) . map ( function ( x ) { return Directory [ x ] . name } ) ; var sheetnames = sheetnamesraw . slice ( ) ; wb . Directory = sheetnamesraw ; wb . SheetNames = sheetnamesraw ; if ( ! options . bookSheets ) wb . Sheets = Sheets ; wb . Preamble = Preamble ; wb . Strings = sst ; wb . SSF = SSF . get _table ( ) ; if ( opts . enc ) wb . Encryption = opts . enc ; wb . Metadata = { } ; if ( country !== undefined ) wb . Metadata . Country = country ; return wb } function parse _xlscfb ( cfb , options ) { if ( ! options ) options = { } ; fix _read _opts ( options ) ; reset _cp ( ) ; var CompObj , Summary , Workbook ; if ( cfb . find ) { CompObj = cfb . find ( "!CompObj" ) ; Summary = cfb . find ( "!SummaryInformation" ) ; Workbook = cfb . find ( "/Workbook" ) } else { prep _blob ( cfb , 0 ) ; Workbook = { content : cfb } } if ( ! Workbook ) Workbook = cfb . find ( "/Book" ) ; var CompObjP , SummaryP , WorkbookP ; if ( CompObj ) CompObjP = parse _compobj ( CompObj ) ; if ( options . bookProps && ! options . bookSheets ) WorkbookP = { } ; else { if ( Workbook ) WorkbookP = parse _workbook ( Workbook . content , options , ! ! Workbook . find ) ; else throw new Error ( "Cannot find Workbook stream" ) } if ( cfb . find ) parse _props ( cfb ) ; var props = { } ; for ( var y in cfb . Summary ) props [ y ] = cfb . Summary [ y ] ; for ( y in cfb . DocSummary ) props [ y ] = cfb . DocSummary [ y ] ; WorkbookP . Props = WorkbookP . Custprops = props ; if ( options . bookFiles ) WorkbookP . cfb = cfb ; WorkbookP . CompObjP = CompObjP ; return WorkbookP } function parse _props ( cfb ) { var DSI = cfb . find ( "!DocumentSummaryInformation" ) ; if ( DSI ) try { cfb . DocSummary = parse _PropertySetStream ( DSI , DocSummaryPIDDSI ) } catch ( e ) { } var SI = cfb . find ( "!SummaryInformation" ) ; if ( SI ) try { cfb . Summary = parse _PropertySetStream ( SI , SummaryPIDSI ) } catch ( e ) { } } var XLSBRecordEnum = { 0 : { n : "BrtRowHdr" , f : parse _BrtRowHdr } , 1 : { n : "BrtCellBlank" , f : parse _BrtCellBlank } , 2 : { n : "BrtCellRk" , f : parse _BrtCellRk } , 3 : { n : "BrtCellError" , f : parse _BrtCellError } , 4 : { n : "BrtCellBool" , f : parse _BrtCellBool } , 5 : { n : "BrtCellReal" , f : parse _BrtCellReal } , 6 : { n : "BrtCellSt" , f : parse _BrtCellSt } , 7 : { n : "BrtCellIsst" , f : parse _BrtCellIsst } , 8 : { n : "BrtFmlaString" , f : parse _BrtFmlaString } , 9 : { n : "BrtFmlaNum" , f : parse _BrtFmlaNum } , 10 : { n : "BrtFmlaBool" , f : parse _BrtFmlaBool } , 11 : { n : "BrtFmlaError" , f : parse _BrtFmlaError } , 16 : { n : "BrtFRTArchID$" , f : parse _BrtFRTArchID$ } , 19 : { n : "BrtSSTItem" , f : parse _RichStr } , 20 : { n : "BrtPCDIMissing" , f : parsenoop } , 21 : { n : "BrtPCDINumber" , f : parsenoop } , 22 : { n : "BrtPCDIBoolean" , f : parsenoop } , 23 : { n : "BrtPCDIError" , f : parsenoop } , 24 : { n : "BrtPCDIString" , f : parsenoop } , 25 : { n : "BrtPCDIDatetime" , f : parsenoop } , 26 : { n : "BrtPCDIIndex" , f : parsenoop } , 27 : { n : "BrtPCDIAMissing" , f : parsenoop } , 28 : { n : "BrtPCDIANumber" , f : parsenoop } , 29 : { n : "BrtPCDIABoolean" , f : parsenoop } , 30 : { n : " Brt
} , 2053 : { n : "BrtPivotTableRef" , f : parsenoop } , 2054 : { n : "BrtSlicerCacheBookPivotTables" , f : parsenoop } , 2055 : { n : "BrtBeginSxvcells" , f : parsenoop } , 2056 : { n : "BrtEndSxvcells" , f : parsenoop } , 2057 : { n : "BrtBeginSxRow" , f : parsenoop } , 2058 : { n : "BrtEndSxRow" , f : parsenoop } , 2060 : { n : "BrtPcdCalcMem15" , f : parsenoop } , 2067 : { n : "BrtQsi15" , f : parsenoop } , 2068 : { n : "BrtBeginWebExtensions" , f : parsenoop } , 2069 : { n : "BrtEndWebExtensions" , f : parsenoop } , 2070 : { n : "BrtWebExtension" , f : parsenoop } , 2071 : { n : "BrtAbsPath15" , f : parsenoop } , 2072 : { n : "BrtBeginPivotTableUISettings" , f : parsenoop } , 2073 : { n : "BrtEndPivotTableUISettings" , f : parsenoop } , 2075 : { n : "BrtTableSlicerCacheIDs" , f : parsenoop } , 2076 : { n : "BrtTableSlicerCacheID" , f : parsenoop } , 2077 : { n : "BrtBeginTableSlicerCache" , f : parsenoop } , 2078 : { n : "BrtEndTableSlicerCache" , f : parsenoop } , 2079 : { n : "BrtSxFilter15" , f : parsenoop } , 2080 : { n : "BrtBeginTimelineCachePivotCacheIDs" , f : parsenoop } , 2081 : { n : "BrtEndTimelineCachePivotCacheIDs" , f : parsenoop } , 2082 : { n : "BrtTimelineCachePivotCacheID" , f : parsenoop } , 2083 : { n : "BrtBeginTimelineCacheIDs" , f : parsenoop } , 2084 : { n : "BrtEndTimelineCacheIDs" , f : parsenoop } , 2085 : { n : "BrtBeginTimelineCacheID" , f : parsenoop } , 2086 : { n : "BrtEndTimelineCacheID" , f : parsenoop } , 2087 : { n : "BrtBeginTimelinesEx" , f : parsenoop } , 2088 : { n : "BrtEndTimelinesEx" , f : parsenoop } , 2089 : { n : "BrtBeginTimelineEx" , f : parsenoop } , 2090 : { n : "BrtEndTimelineEx" , f : parsenoop } , 2091 : { n : "BrtWorkBookPr15" , f : parsenoop } , 2092 : { n : "BrtPCDH15" , f : parsenoop } , 2093 : { n : "BrtBeginTimelineStyle" , f : parsenoop } , 2094 : { n : "BrtEndTimelineStyle" , f : parsenoop } , 2095 : { n : "BrtTimelineStyleElement" , f : parsenoop } , 2096 : { n : "BrtBeginTimelineStylesheetExt15" , f : parsenoop } , 2097 : { n : "BrtEndTimelineStylesheetExt15" , f : parsenoop } , 2098 : { n : "BrtBeginTimelineStyles" , f : parsenoop } , 2099 : { n : "BrtEndTimelineStyles" , f : parsenoop } , 2100 : { n : "BrtBeginTimelineStyleElements" , f : parsenoop } , 2101 : { n : "BrtEndTimelineStyleElements" , f : parsenoop } , 2102 : { n : "BrtDxf15" , f : parsenoop } , 2103 : { n : "BrtBeginDxfs15" , f : parsenoop } , 2104 : { n : "brtEndDxfs15" , f : parsenoop } , 2105 : { n : "BrtSlicerCacheHideItemsWithNoData" , f : parsenoop } , 2106 : { n : "BrtBeginItemUniqueNames" , f : parsenoop } , 2107 : { n : "BrtEndItemUniqueNames" , f : parsenoop } , 2108 : { n : "BrtItemUniqueName" , f : parsenoop } , 2109 : { n : "BrtBeginExtConn15" , f : parsenoop } , 2110 : { n : "BrtEndExtConn15" , f : parsenoop } , 2111 : { n : "BrtBeginOledbPr15" , f : parsenoop } , 2112 : { n : "BrtEndOledbPr15" , f : parsenoop } , 2113 : { n : "BrtBeginDataFeedPr15" , f : parsenoop } , 2114 : { n : "BrtEndDataFeedPr15" , f : parsenoop } , 2115 : { n : "BrtTextPr15" , f : parsenoop } , 2116 : { n : "BrtRangePr15" , f : parsenoop } , 2117 : { n : "BrtDbCommand15" , f : parsenoop } , 2118 : { n : "BrtBeginDbTables15" , f : parsenoop } , 2119 : { n : "BrtEndDbTables15" , f : parsenoop } , 2120 : { n : "BrtDbTable15" , f : parsenoop } , 2121 : { n : "BrtBeginDataModel" , f : parsenoop } , 2122 : { n : "BrtEndDataModel" , f : parsenoop } , 2123 : { n : "BrtBeginModelTables" , f : parsenoop } , 2124 : { n : "BrtEndModelTables" , f : parsenoop } , 2125 : { n : "BrtModelTable" , f : parsenoop } , 2126 : { n : "BrtBeginModelRelationships" , f : parsenoop } , 2127 : { n : "BrtEndModelRelationships" , f : parsenoop } , 2128 : { n : "BrtModelRelationship" , f : parsenoop } , 2129 : { n : "BrtBeginECTxtWiz15" , f : parsenoop } , 2130 : { n : "BrtEndECTxtWiz15" , f : parsenoop } , 2131 : { n : "BrtBeginECTWFldInfoLst15" , f : parsenoop } , 2132 : { n : "BrtEndECTWFldInfoLst15" , f : parsenoop } , 2133 : { n : "BrtBeginECTWFldInfo15" , f : parsenoop } , 2134 : { n : "BrtFieldListActiveItem" , f : parsenoop } , 2135 : { n : "BrtPivotCacheIdVersion" , f : parsenoop } , 2136 : { n : "BrtSXDI15" , f : parsenoop } , 65535 : { n : "" , f : parsenoop } } ; var evert _RE = evert _key ( XLSBRecordEnum , "n" ) ; var XLSRecordEnum = { 3 : { n : "BIFF2NUM" , f : parse _BIFF2NUM } , 4 : { n : "BIFF2STR" , f : parse _BIFF2STR } , 6 : { n : "Formula" , f : parse _Formula } , 9 : { n : "BOF" , f : parse _BOF } , 10 : { n : "EOF" , f : parse _EOF } , 12 : { n : "CalcCount" , f : parse _CalcCount } , 13 : { n : "CalcMode" , f : parse _CalcMode } , 14 : { n : "CalcPrecision" , f : parse _CalcPrecision } , 15 : { n : "CalcRefMode" , f : parse _CalcRefMode } , 16 : { n : "CalcDelta" , f : parse _CalcDelta } , 17 : { n : "CalcIter" , f : parse _CalcIter } , 18 : { n : "Protect" , f : parse _Protect } , 19 : { n : "Password" , f : parse _Password } , 20 : { n : "Header" , f : parse _Header } , 21 : { n : "Footer" , f : parse _Footer } , 23 : { n : "ExternSheet" , f : parse _ExternSheet } , 24 : { n : "Lbl" , f : parse _Lbl } , 25 : { n : "WinProtect" , f : parse _WinProtect } , 26 : { n : "VerticalPageBreaks" , f : parse _VerticalPageBreaks } , 27 : { n : "HorizontalPageBreaks" , f : parse _HorizontalPag
val = "" ; if ( x === undefined ) continue ; if ( x . f != null ) val = x . f ; else if ( x . w !== undefined ) val = "'" + x . w ; else if ( x . v === undefined ) continue ; else val = "" + x . v ; cmds [ i ++ ] = y + "=" + val } } cmds . length = i ; return cmds } var utils = { encode _col : encode _col , encode _row : encode _row , encode _cell : encode _cell , encode _range : encode _range , decode _col : decode _col , decode _row : decode _row , split _cell : split _cell , decode _cell : decode _cell , decode _range : decode _range , format _cell : format _cell , get _formulae : sheet _to _formulae , make _csv : sheet _to _csv , make _json : sheet _to _json , make _formulae : sheet _to _formulae , sheet _to _csv : sheet _to _csv , sheet _to _json : sheet _to _json , sheet _to _formulae : sheet _to _formulae , sheet _to _row _object _array : sheet _to _row _object _array } ; XLSX . parse _xlscfb = parse _xlscfb ; XLSX . parse _zip = parse _zip ; XLSX . read = readSync ; XLSX . readFile = readFileSync ; XLSX . readFileSync = readFileSync ; XLSX . write = writeSync ; XLSX . writeFile = writeFileSync ; XLSX . writeFileSync = writeFileSync ; XLSX . utils = utils ; XLSX . CFB = CFB ; XLSX . SSF = SSF } ) ( typeof exports !== "undefined" ? exports : XLSX ) ; var XLS = XLSX ;