2016-12-31 08:11:36 +00:00
/* xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
2017-03-28 22:07:46 +00:00
! function ( e ) { if ( "object" == typeof exports && "undefined" != typeof module ) module . exports = e ( ) ; else if ( "function" == typeof define && define . amd ) { JSZip = e ( ) ; define ( [ ] , e ) } else { var f ; "undefined" != typeof window ? f = window : "undefined" != typeof global ? f = global : "undefined" != typeof $ && $ . global ? f = $ . global : "undefined" != typeof self && ( f = self ) , f . JSZip = e ( ) } } ( function ( ) { var define , module , exports ; return function e ( t , n , r ) { function s ( o , u ) { if ( ! n [ o ] ) { if ( ! t [ o ] ) { var a = typeof require == "function" && require ; if ( ! u && a ) return a ( o , ! 0 ) ; if ( i ) return i ( o , ! 0 ) ; throw new Error ( "Cannot find module '" + o + "'" ) } var f = n [ o ] = { exports : { } } ; t [ o ] [ 0 ] . call ( f . exports , function ( e ) { var n = t [ o ] [ 1 ] [ e ] ; return s ( n ? n : e ) } , f , f . exports , e , t , n , r ) } return n [ o ] . exports } var i = typeof require == "function" && require ; for ( var o = 0 ; o < r . length ; o ++ ) s ( r [ o ] ) ; return s } ( { 1 : [ function ( _dereq _ , module , exports ) { "use strict" ; var _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" ; exports . encode = function ( input , utf8 ) { var output = "" ; var chr1 , chr2 , chr3 , enc1 , enc2 , enc3 , enc4 ; var i = 0 ; while ( i < input . length ) { chr1 = input . charCodeAt ( i ++ ) ; chr2 = input . charCodeAt ( i ++ ) ; chr3 = input . charCodeAt ( i ++ ) ; enc1 = chr1 >> 2 ; enc2 = ( chr1 & 3 ) << 4 | chr2 >> 4 ; enc3 = ( chr2 & 15 ) << 2 | chr3 >> 6 ; enc4 = chr3 & 63 ; if ( isNaN ( chr2 ) ) { enc3 = enc4 = 64 } else if ( isNaN ( chr3 ) ) { enc4 = 64 } output = output + _keyStr . charAt ( enc1 ) + _keyStr . charAt ( enc2 ) + _keyStr . charAt ( enc3 ) + _keyStr . charAt ( enc4 ) } return output } ; exports . decode = function ( input , utf8 ) { var output = "" ; var chr1 , chr2 , chr3 ; var enc1 , enc2 , enc3 , enc4 ; var i = 0 ; input = input . replace ( /[^A-Za-z0-9\+\/\=]/g , "" ) ; while ( i < input . length ) { enc1 = _keyStr . indexOf ( input . charAt ( i ++ ) ) ; enc2 = _keyStr . indexOf ( input . charAt ( i ++ ) ) ; enc3 = _keyStr . indexOf ( input . charAt ( i ++ ) ) ; enc4 = _keyStr . indexOf ( input . charAt ( i ++ ) ) ; chr1 = enc1 << 2 | enc2 >> 4 ; chr2 = ( enc2 & 15 ) << 4 | enc3 >> 2 ; chr3 = ( enc3 & 3 ) << 6 | enc4 ; output = output + String . fromCharCode ( chr1 ) ; if ( enc3 != 64 ) { output = output + String . fromCharCode ( chr2 ) } if ( enc4 != 64 ) { output = output + String . fromCharCode ( chr3 ) } } return output } } , { } ] , 2 : [ function ( _dereq _ , module , exports ) { "use strict" ; function CompressedObject ( ) { this . compressedSize = 0 ; this . uncompressedSize = 0 ; this . crc32 = 0 ; this . compressionMethod = null ; this . compressedContent = null } CompressedObject . prototype = { getContent : function ( ) { return null } , getCompressedContent : function ( ) { return null } } ; module . exports = CompressedObject } , { } ] , 3 : [ function ( _dereq _ , module , exports ) { "use strict" ; exports . STORE = { magic : "\0\0" , compress : function ( content ) { return content } , uncompress : function ( content ) { return content } , compressInputType : null , uncompressInputType : null } ; exports . DEFLATE = _dereq _ ( "./flate" ) } , { "./flate" : 8 } ] , 4 : [ function ( _dereq _ , module , exports ) { "use strict" ; var utils = _dereq _ ( "./utils" ) ; var table = [ 0 , 1996959894 , 3993919788 , 2567524794 , 124634137 , 1886057615 , 3915621685 , 2657392035 , 249268274 , 2044508324 , 3772115230 , 2547177864 , 162941995 , 2125561021 , 3887607047 , 2428444049 , 498536548 , 1789927666 , 4089016648 , 2227061214 , 450548861 , 1843258603 , 4107580753 , 2211677639 , 325883990 , 1684777152 , 4251122042 , 2321926636 , 335633487 , 1661365465 , 4195302755 , 2366115317 , 997073096 , 1281953886 , 3579855332 , 2724688242 , 1006888145 , 1258607687 , 3524101629 , 2768942443 , 901097722 , 1119000684 , 3686517206 , 2898065728 , 853044451 , 1172266101 , 3705015759 , 2882616665 , 651767980 , 1373503546 , 3369554304 , 3218104598 , 565507253 , 1454621731 , 3485111705 , 3099436303 , 671266974 , 1594198024 , 3322730930 , 2970347812 , 795835527 , 1483230225 , 3244367275 , 3060149565 , 1994146192 , 31158534 , 2563907772 , 4023717930 , 1907459465 , 112637215 , 2680153253 , 3904427059 , 2013776290 , 251722036 , 2517215374 , 3775830040 , 2137656763 , 141376813 , 2439277719 , 3865271297 , 1802195444 , 476864866 , 2238001368 , 4066508878 , 1812370925 , 453092731 , 2181625025 , 4111451223 , 1706088902 , 314042704 , 2344532202 , 4240017532 , 1658658271 , 366619977 , 2362670323 , 4224994405 , 1303535960 , 984961486 , 2747007092 , 3569037538 , 1256170817 , 1037604311 , 2765210733 , 3554079995 , 1131014506 , 879679996 , 2909243462 , 3663771856 , 1141124467 , 855842277 , 2852801631 , 3708648649 , 1342533948 , 654459306 , 3188396048 , 3373015174 , 1466479909 , 544179635 , 3110523913 , 3462522015 , 1591671054 , 702138776 , 2966460450 , 3352799412 , 1504918807 , 783551873 , 3082640443 , 3233442989 , 3988292384 , 2596254646 , 62317068 , 1957810842 , 3939845945 , 2647816111 , 81470997 , 1943803523 , 3814918930 , 2489596804 , 2
} return res } ; exports . findCompression = function ( compressionMethod ) { for ( var method in compressions ) { if ( ! compressions . hasOwnProperty ( method ) ) { continue } if ( compressions [ method ] . magic === compressionMethod ) { return compressions [ method ] } } return null } ; exports . isRegExp = function ( object ) { return Object . prototype . toString . call ( object ) === "[object RegExp]" } } , { "./compressions" : 3 , "./nodeBuffer" : 11 , "./support" : 17 } ] , 22 : [ function ( _dereq _ , module , exports ) { "use strict" ; var StringReader = _dereq _ ( "./stringReader" ) ; var NodeBufferReader = _dereq _ ( "./nodeBufferReader" ) ; var Uint8ArrayReader = _dereq _ ( "./uint8ArrayReader" ) ; var utils = _dereq _ ( "./utils" ) ; var sig = _dereq _ ( "./signature" ) ; var ZipEntry = _dereq _ ( "./zipEntry" ) ; var support = _dereq _ ( "./support" ) ; var jszipProto = _dereq _ ( "./object" ) ; function ZipEntries ( data , loadOptions ) { this . files = [ ] ; this . loadOptions = loadOptions ; if ( data ) { this . load ( data ) } } ZipEntries . prototype = { checkSignature : function ( expectedSignature ) { var signature = this . reader . readString ( 4 ) ; if ( signature !== expectedSignature ) { throw new Error ( "Corrupted zip or bug : unexpected signature " + "(" + utils . pretty ( signature ) + ", expected " + utils . pretty ( expectedSignature ) + ")" ) } } , readBlockEndOfCentral : function ( ) { this . diskNumber = this . reader . readInt ( 2 ) ; this . diskWithCentralDirStart = this . reader . readInt ( 2 ) ; this . centralDirRecordsOnThisDisk = this . reader . readInt ( 2 ) ; this . centralDirRecords = this . reader . readInt ( 2 ) ; this . centralDirSize = this . reader . readInt ( 4 ) ; this . centralDirOffset = this . reader . readInt ( 4 ) ; this . zipCommentLength = this . reader . readInt ( 2 ) ; this . zipComment = this . reader . readString ( this . zipCommentLength ) ; this . zipComment = jszipProto . utf8decode ( this . zipComment ) } , readBlockZip64EndOfCentral : function ( ) { this . zip64EndOfCentralSize = this . reader . readInt ( 8 ) ; this . versionMadeBy = this . reader . readString ( 2 ) ; this . versionNeeded = this . reader . readInt ( 2 ) ; this . diskNumber = this . reader . readInt ( 4 ) ; this . diskWithCentralDirStart = this . reader . readInt ( 4 ) ; this . centralDirRecordsOnThisDisk = this . reader . readInt ( 8 ) ; this . centralDirRecords = this . reader . readInt ( 8 ) ; this . centralDirSize = this . reader . readInt ( 8 ) ; this . centralDirOffset = this . reader . readInt ( 8 ) ; this . zip64ExtensibleData = { } ; var extraDataSize = this . zip64EndOfCentralSize - 44 , index = 0 , extraFieldId , extraFieldLength , extraFieldValue ; while ( index < extraDataSize ) { extraFieldId = this . reader . readInt ( 2 ) ; extraFieldLength = this . reader . readInt ( 4 ) ; extraFieldValue = this . reader . readString ( extraFieldLength ) ; this . zip64ExtensibleData [ extraFieldId ] = { id : extraFieldId , length : extraFieldLength , value : extraFieldValue } } } , readBlockZip64EndOfCentralLocator : function ( ) { this . diskWithZip64CentralDirStart = this . reader . readInt ( 4 ) ; this . relativeOffsetEndOfZip64CentralDir = this . reader . readInt ( 8 ) ; this . disksCount = this . reader . readInt ( 4 ) ; if ( this . disksCount > 1 ) { throw new Error ( "Multi-volumes zip are not supported" ) } } , readLocalFiles : function ( ) { var i , file ; for ( i = 0 ; i < this . files . length ; i ++ ) { file = this . files [ i ] ; this . reader . setIndex ( file . localHeaderOffset ) ; this . checkSignature ( sig . LOCAL _FILE _HEADER ) ; file . readLocalPart ( this . reader ) ; file . handleUTF8 ( ) } } , readCentralDir : function ( ) { var file ; this . reader . setIndex ( this . centralDirOffset ) ; while ( this . reader . readString ( 4 ) === sig . CENTRAL _FILE _HEADER ) { file = new ZipEntry ( { zip64 : this . zip64 } , this . loadOptions ) ; file . readCentralPart ( this . reader ) ; this . files . push ( file ) } } , readEndOfCentral : function ( ) { var offset = this . reader . lastIndexOfSignature ( sig . CENTRAL _DIRECTORY _END ) ; if ( offset === - 1 ) { throw new Error ( "Corrupted zip : can't find end of central directory" ) } this . reader . setIndex ( offset ) ; this . checkSignature ( sig . CENTRAL _DIRECTORY _END ) ; this . readBlockEndOfCentral ( ) ; if ( this . diskNumber === utils . MAX _VALUE _16BITS || this . diskWithCentralDirStart === utils . MAX _VALUE _16BITS || this . centralDirRecordsOnThisDisk === utils . MAX _VALUE _16BITS || this . centralDirRecords === utils . MAX _VALUE _16BITS || this . centralDirSize === utils . MAX _VALUE _32BITS || this . centralDirOffset === utils . MAX _VALUE _32BITS ) { this . zip64 = true ; offset = this . reader . lastIndexOfSignature ( sig . ZIP64 _CENTRAL _DIRECTORY _LOCATOR ) ; if ( offset === - 1 ) { throw new Error ( "Corrupted zip : can't find the ZIP64 end of central directory locator" ) } this . reader . setIndex ( offset ) ; this . checkSignature ( sig . ZIP64 _CENTRAL _D
var bflush ; for ( ; ; ) { if ( s . lookahead === 0 ) { fill _window ( s ) ; if ( s . lookahead === 0 ) { if ( flush === Z _NO _FLUSH ) { return BS _NEED _MORE } break } } s . match _length = 0 ; bflush = trees . _tr _tally ( s , 0 , s . window [ s . strstart ] ) ; s . lookahead -- ; s . strstart ++ ; if ( bflush ) { flush _block _only ( s , false ) ; if ( s . strm . avail _out === 0 ) { return BS _NEED _MORE } } } s . insert = 0 ; if ( flush === Z _FINISH ) { flush _block _only ( s , true ) ; if ( s . strm . avail _out === 0 ) { return BS _FINISH _STARTED } return BS _FINISH _DONE } if ( s . last _lit ) { flush _block _only ( s , false ) ; if ( s . strm . avail _out === 0 ) { return BS _NEED _MORE } } return BS _BLOCK _DONE } var Config = function ( good _length , max _lazy , nice _length , max _chain , func ) { this . good _length = good _length ; this . max _lazy = max _lazy ; this . nice _length = nice _length ; this . max _chain = max _chain ; this . func = func } ; var configuration _table ; configuration _table = [ new Config ( 0 , 0 , 0 , 0 , deflate _stored ) , new Config ( 4 , 4 , 8 , 4 , deflate _fast ) , new Config ( 4 , 5 , 16 , 8 , deflate _fast ) , new Config ( 4 , 6 , 32 , 32 , deflate _fast ) , new Config ( 4 , 4 , 16 , 16 , deflate _slow ) , new Config ( 8 , 16 , 32 , 32 , deflate _slow ) , new Config ( 8 , 16 , 128 , 128 , deflate _slow ) , new Config ( 8 , 32 , 128 , 256 , deflate _slow ) , new Config ( 32 , 128 , 258 , 1024 , deflate _slow ) , new Config ( 32 , 258 , 258 , 4096 , deflate _slow ) ] ; function lm _init ( s ) { s . window _size = 2 * s . w _size ; zero ( s . head ) ; s . max _lazy _match = configuration _table [ s . level ] . max _lazy ; s . good _match = configuration _table [ s . level ] . good _length ; s . nice _match = configuration _table [ s . level ] . nice _length ; s . max _chain _length = configuration _table [ s . level ] . max _chain ; s . strstart = 0 ; s . block _start = 0 ; s . lookahead = 0 ; s . insert = 0 ; s . match _length = s . prev _length = MIN _MATCH - 1 ; s . match _available = 0 ; s . ins _h = 0 } function DeflateState ( ) { this . strm = null ; this . status = 0 ; this . pending _buf = null ; this . pending _buf _size = 0 ; this . pending _out = 0 ; this . pending = 0 ; this . wrap = 0 ; this . gzhead = null ; this . gzindex = 0 ; this . method = Z _DEFLATED ; this . last _flush = - 1 ; this . w _size = 0 ; this . w _bits = 0 ; this . w _mask = 0 ; this . window = null ; this . window _size = 0 ; this . prev = null ; this . head = null ; this . ins _h = 0 ; this . hash _size = 0 ; this . hash _bits = 0 ; this . hash _mask = 0 ; this . hash _shift = 0 ; this . block _start = 0 ; this . match _length = 0 ; this . prev _match = 0 ; this . match _available = 0 ; this . strstart = 0 ; this . match _start = 0 ; this . lookahead = 0 ; this . prev _length = 0 ; this . max _chain _length = 0 ; this . max _lazy _match = 0 ; this . level = 0 ; this . strategy = 0 ; this . good _match = 0 ; this . nice _match = 0 ; this . dyn _ltree = new utils . Buf16 ( HEAP _SIZE * 2 ) ; this . dyn _dtree = new utils . Buf16 ( ( 2 * D _CODES + 1 ) * 2 ) ; this . bl _tree = new utils . Buf16 ( ( 2 * BL _CODES + 1 ) * 2 ) ; zero ( this . dyn _ltree ) ; zero ( this . dyn _dtree ) ; zero ( this . bl _tree ) ; this . l _desc = null ; this . d _desc = null ; this . bl _desc = null ; this . bl _count = new utils . Buf16 ( MAX _BITS + 1 ) ; this . heap = new utils . Buf16 ( 2 * L _CODES + 1 ) ; zero ( this . heap ) ; this . heap _len = 0 ; this . heap _max = 0 ; this . depth = new utils . Buf16 ( 2 * L _CODES + 1 ) ; zero ( this . depth ) ; this . l _buf = 0 ; this . lit _bufsize = 0 ; this . last _lit = 0 ; this . d _buf = 0 ; this . opt _len = 0 ; this . static _len = 0 ; this . matches = 0 ; this . insert = 0 ; this . bi _buf = 0 ; this . bi _valid = 0 } function deflateResetKeep ( strm ) { var s ; if ( ! strm || ! strm . state ) { return err ( strm , Z _STREAM _ERROR ) } strm . total _in = strm . total _out = 0 ; strm . data _type = Z _UNKNOWN ; s = strm . state ; s . pending = 0 ; s . pending _out = 0 ; if ( s . wrap < 0 ) { s . wrap = - s . wrap } s . status = s . wrap ? INIT _STATE : BUSY _STATE ; strm . adler = s . wrap === 2 ? 0 : 1 ; s . last _flush = Z _NO _FLUSH ; trees . _tr _init ( s ) ; return Z _OK } function deflateReset ( strm ) { var ret = deflateResetKeep ( strm ) ; if ( ret === Z _OK ) { lm _init ( strm . state ) } return ret } function deflateSetHeader ( strm , head ) { if ( ! strm || ! strm . state ) { return Z _STREAM _ERROR } if ( strm . state . wrap !== 2 ) { return Z _STREAM _ERROR } strm . state . gzhead = head ; return Z _OK } function deflateInit2 ( strm , level , method , windowBits , memLevel , strategy ) { if ( ! strm ) { return Z _STREAM _ERROR } var wrap = 1 ; if ( level === Z _DEFAULT _COMPRESSION ) { level = 6 } if ( windowBits < 0 ) { wrap = 0 ; windowBits = - windowBits } else if ( windowBits > 15 ) { wrap = 2 ; windowBits -= 16 } if ( memLevel < 1 || memLevel > MAX _MEM _LEVEL || method !== Z _DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z _FIXED ) { return err ( strm , Z _STREAM _ERROR ) } if ( windowBits === 8 ) { windowBits = 9 } var s = new DeflateState ; strm . state = s ; s . strm = strm ; s . wrap = wrap ; s . gzhead = null ; s . w _bits = windowBits ; s . w _size = 1 << s . w _bits ; s . w _mask = s . w _size - 1 ; s . hash _bits = memLevel + 7 ; s . hash _size = 1 << s . hash _bits ; s . hash _mask = s . hash _size - 1 ; s . hash _shift = ~ ~ ( ( s . hash _b
2017-04-30 16:28:24 +00:00
exports . inflateInfo = "pako inflate (from Nodeca project)" } , { "../utils/common" : 27 , "./adler32" : 29 , "./crc32" : 31 , "./inffast" : 34 , "./inftrees" : 36 } ] , 36 : [ function ( _dereq _ , module , exports ) { "use strict" ; var utils = _dereq _ ( "../utils/common" ) ; var MAXBITS = 15 ; var ENOUGH _LENS = 852 ; var ENOUGH _DISTS = 592 ; var CODES = 0 ; var LENS = 1 ; var DISTS = 2 ; var lbase = [ 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 , 0 , 0 ] ; var lext = [ 16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 17 , 17 , 17 , 17 , 18 , 18 , 18 , 18 , 19 , 19 , 19 , 19 , 20 , 20 , 20 , 20 , 21 , 21 , 21 , 21 , 16 , 72 , 78 ] ; var dbase = [ 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 , 0 , 0 ] ; var dext = [ 16 , 16 , 16 , 16 , 17 , 17 , 18 , 18 , 19 , 19 , 20 , 20 , 21 , 21 , 22 , 22 , 23 , 23 , 24 , 24 , 25 , 25 , 26 , 26 , 27 , 27 , 28 , 28 , 29 , 29 , 64 , 64 ] ; module . exports = function inflate _table ( type , lens , lens _index , codes , table , table _index , work , opts ) { var bits = opts . bits ; var len = 0 ; var sym = 0 ; var min = 0 , max = 0 ; var root = 0 ; var curr = 0 ; var drop = 0 ; var left = 0 ; var used = 0 ; var huff = 0 ; var incr ; var fill ; var low ; var mask ; var next ; var base = null ; var base _index = 0 ; var end ; var count = new utils . Buf16 ( MAXBITS + 1 ) ; var offs = new utils . Buf16 ( MAXBITS + 1 ) ; var extra = null ; var extra _index = 0 ; var here _bits , here _op , here _val ; for ( len = 0 ; len <= MAXBITS ; len ++ ) { count [ len ] = 0 } for ( sym = 0 ; sym < codes ; sym ++ ) { count [ lens [ lens _index + sym ] ] ++ } root = bits ; for ( max = MAXBITS ; max >= 1 ; max -- ) { if ( count [ max ] !== 0 ) { break } } if ( root > max ) { root = max } if ( max === 0 ) { table [ table _index ++ ] = 1 << 24 | 64 << 16 | 0 ; table [ table _index ++ ] = 1 << 24 | 64 << 16 | 0 ; opts . bits = 1 ; return 0 } for ( min = 1 ; min < max ; min ++ ) { if ( count [ min ] !== 0 ) { break } } if ( root < min ) { root = min } left = 1 ; for ( len = 1 ; len <= MAXBITS ; len ++ ) { left <<= 1 ; left -= count [ len ] ; if ( left < 0 ) { return - 1 } } if ( left > 0 && ( type === CODES || max !== 1 ) ) { return - 1 } offs [ 1 ] = 0 ; for ( len = 1 ; len < MAXBITS ; len ++ ) { offs [ len + 1 ] = offs [ len ] + count [ len ] } for ( sym = 0 ; sym < codes ; sym ++ ) { if ( lens [ lens _index + sym ] !== 0 ) { work [ offs [ lens [ lens _index + sym ] ] ++ ] = sym } } if ( type === CODES ) { base = extra = work ; end = 19 } else if ( type === LENS ) { base = lbase ; base _index -= 257 ; extra = lext ; extra _index -= 257 ; end = 256 } else { base = dbase ; extra = dext ; end = - 1 } huff = 0 ; sym = 0 ; len = min ; next = table _index ; curr = root ; drop = 0 ; low = - 1 ; used = 1 << root ; mask = used - 1 ; if ( type === LENS && used > ENOUGH _LENS || type === DISTS && used > ENOUGH _DISTS ) { return 1 } var i = 0 ; for ( ; ; ) { i ++ ; here _bits = len - drop ; if ( work [ sym ] < end ) { here _op = 0 ; here _val = work [ sym ] } else if ( work [ sym ] > end ) { here _op = extra [ extra _index + work [ sym ] ] ; here _val = base [ base _index + work [ sym ] ] } else { here _op = 32 + 64 ; here _val = 0 } incr = 1 << len - drop ; fill = 1 << curr ; min = fill ; do { fill -= incr ; table [ next + ( huff >> drop ) + fill ] = here _bits << 24 | here _op << 16 | here _val | 0 } while ( fill !== 0 ) ; incr = 1 << len - 1 ; while ( huff & incr ) { incr >>= 1 } if ( incr !== 0 ) { huff &= incr - 1 ; huff += incr } else { huff = 0 } sym ++ ; if ( -- count [ len ] === 0 ) { if ( len === max ) { break } len = lens [ lens _index + work [ sym ] ] } if ( len > root && ( huff & mask ) !== low ) { if ( drop === 0 ) { drop = root } next += min ; curr = len - drop ; left = 1 << curr ; while ( curr + drop < max ) { left -= count [ curr + drop ] ; if ( left <= 0 ) { break } curr ++ ; left <<= 1 } used += 1 << curr ; if ( type === LENS && used > ENOUGH _LENS || type === DISTS && used > ENOUGH _DISTS ) { return 1 } low = huff & mask ; table [ low ] = root << 24 | curr << 16 | next - table _index | 0 } } if ( huff !== 0 ) { table [ next + huff ] = len - drop << 24 | 64 << 16 | 0 } opts . bits = root ; return 0 } } , { "../utils/common" : 27 } ] , 37 : [ function ( _dereq _ , module , exports ) { "use strict" ; module . exports = { 2 : "need dictionary" , 1 : "stream end" , 0 : "" , "-1" : "file error" , "-2" : "stream error" , "-3" : "data error" , "-4" : "insufficient memory" , "-5" : "buffer error" , "-6" : "incompatible version" } } , { } ] , 38 : [ function ( _dereq _ , module , exports ) { "use strict" ; var utils = _dereq _ ( "../utils/common" ) ; var Z _FIXED = 4 ; var Z _BINARY = 0 ; var Z _TEXT = 1 ; var Z _UNKNOWN = 2 ; function zero ( buf ) { var len = buf . length ; while ( -- len >= 0 ) { buf [ len ] = 0 } } var STORED _BLOCK = 0 ; var STATIC _TREES = 1 ; var DYN _TREES = 2 ; var MIN _MATCH = 3 ; var MAX _MATCH = 258 ; var LENGTH _CODES = 29 ; var LITERALS = 256 ; var L _CODES = LITERALS + 1 + LENGTH _CODES ; var D _CODES = 30 ; var BL _CODES = 19 ; var HEAP _SIZE = 2 * L _CODES + 1 ; var MAX _BITS = 15 ; var Buf _size = 16 ; var MAX _BL _BITS = 7 ; var END _BLOCK = 256 ; var REP _3 _6 = 16 ; var REPZ _3 _10 = 17 ; var REPZ _11 _138 = 18 ; var extra _lbits = [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 2 , 2 , 2 , 2 , 3 , 3 , 3 , 3 , 4 , 4 , 4 , 4 , 5 , 5 , 5 , 5 , 0 ] ; var extra _dbits = [ 0 , 0 , 0 , 0 , 1 , 1 , 2 , 2 , 3 , 3 , 4 , 4 , 5 , 5 , 6 , 6 , 7 , 7 , 8 , 8 , 9 , 9 , 10 , 10 , 11 , 11 , 12 , 12 , 13 , 13 ] ; var extra _blbits = [ 0 , 0 , 0
if ( fmt . match ( /^00+$/ ) ) return sign + pad0 ( aval , fmt . length ) ; if ( fmt . match ( /^[#?]+$/ ) ) { o = "" + val ; if ( val === 0 ) o = "" ; return o . length > fmt . length ? o : hashq ( fmt . substr ( 0 , fmt . length - o . length ) ) + o } if ( r = fmt . match ( frac1 ) ) return write _num _f2 ( r , aval , sign ) ; if ( fmt . match ( /^#+0+$/ ) ) return sign + pad0 ( aval , fmt . length - fmt . indexOf ( "0" ) ) ; if ( r = fmt . match ( dec1 ) ) { o = ( "" + val ) . replace ( /^([^\.]+)$/ , "$1." + r [ 1 ] ) . replace ( /\.$/ , "." + r [ 1 ] ) ; o = o . replace ( /\.(\d*)$/ , function ( $$ , $1 ) { return "." + $1 + fill ( "0" , r [ 1 ] . length - $1 . length ) } ) ; return fmt . indexOf ( "0." ) !== - 1 ? o : o . replace ( /^0\./ , "." ) } fmt = fmt . replace ( /^#+([0.])/ , "$1" ) ; if ( r = fmt . match ( /^(0*)\.(#*)$/ ) ) { return sign + ( "" + aval ) . replace ( /\.(\d*[1-9])0*$/ , ".$1" ) . replace ( /^(-?\d*)$/ , "$1." ) . replace ( /^0\./ , r [ 1 ] . length ? "0." : "." ) } if ( r = fmt . match ( /^#,##0(\.?)$/ ) ) return sign + commaify ( "" + aval ) ; if ( r = fmt . match ( /^#,##0\.([#0]*0)$/ ) ) { return val < 0 ? "-" + write _num _int ( type , fmt , - val ) : commaify ( "" + val ) + "." + fill ( "0" , r [ 1 ] . length ) } if ( r = fmt . match ( /^#,#*,#0/ ) ) return write _num _int ( type , fmt . replace ( /^#,#*,/ , "" ) , val ) ; if ( r = fmt . match ( /^([0#]+)(\\?-([0#]+))+$/ ) ) { o = _strrev ( write _num _int ( type , fmt . replace ( /[\\-]/g , "" ) , val ) ) ; ri = 0 ; return _strrev ( _strrev ( fmt . replace ( /\\/g , "" ) ) . replace ( /[0#]/g , function ( x ) { return ri < o . length ? o . charAt ( ri ++ ) : x === "0" ? "0" : "" } ) ) } if ( fmt . match ( phone ) ) { o = write _num _int ( type , "##########" , val ) ; return "(" + o . substr ( 0 , 3 ) + ") " + o . substr ( 3 , 3 ) + "-" + o . substr ( 6 ) } var oa = "" ; if ( r = fmt . match ( /^([#0?]+)( ?)\/( ?)([#0?]+)/ ) ) { ri = Math . min ( r [ 4 ] . length , 7 ) ; ff = frac ( aval , Math . pow ( 10 , ri ) - 1 , false ) ; o = "" + sign ; oa = write _num ( "n" , r [ 1 ] , ff [ 1 ] ) ; if ( oa . charAt ( oa . length - 1 ) == " " ) oa = oa . substr ( 0 , oa . length - 1 ) + "0" ; o += oa + r [ 2 ] + "/" + r [ 3 ] ; oa = rpad _ ( ff [ 2 ] , ri ) ; if ( oa . length < r [ 4 ] . length ) oa = hashq ( r [ 4 ] . substr ( r [ 4 ] . length - oa . length ) ) + oa ; o += oa ; return o } if ( r = fmt . match ( /^# ([#0?]+)( ?)\/( ?)([#0?]+)/ ) ) { ri = Math . min ( Math . max ( r [ 1 ] . length , r [ 4 ] . length ) , 7 ) ; ff = frac ( aval , Math . pow ( 10 , ri ) - 1 , true ) ; return sign + ( ff [ 0 ] || ( ff [ 1 ] ? "" : "0" ) ) + " " + ( ff [ 1 ] ? pad _ ( ff [ 1 ] , ri ) + r [ 2 ] + "/" + r [ 3 ] + rpad _ ( ff [ 2 ] , ri ) : fill ( " " , 2 * ri + 1 + r [ 2 ] . length + r [ 3 ] . length ) ) } if ( r = fmt . match ( /^[#0?]+$/ ) ) { o = "" + val ; if ( fmt . length <= o . length ) return o ; return hashq ( fmt . substr ( 0 , fmt . length - o . length ) ) + o } if ( r = fmt . match ( /^([#0]+)\.([#0]+)$/ ) ) { o = "" + val . toFixed ( Math . min ( r [ 2 ] . length , 10 ) ) . replace ( /([^0])0+$/ , "$1" ) ; ri = o . indexOf ( "." ) ; var lres = fmt . indexOf ( "." ) - ri , rres = fmt . length - o . length - lres ; return hashq ( fmt . substr ( 0 , lres ) + o + fmt . substr ( fmt . length - rres ) ) } if ( r = fmt . match ( /^00,000\.([#0]*0)$/ ) ) { return val < 0 ? "-" + write _num _int ( type , fmt , - val ) : commaify ( "" + val ) . replace ( /^\d,\d{3}$/ , "0$&" ) . replace ( /^\d*$/ , function ( $$ ) { return "00," + ( $$ . length < 3 ? pad0 ( 0 , 3 - $$ . length ) : "" ) + $$ } ) + "." + pad0 ( 0 , r [ 1 ] . length ) } switch ( fmt ) { case "#,###" : var x = commaify ( "" + aval ) ; return x !== "0" ? sign + x : "" ; default : } throw new Error ( "unsupported format |" + fmt + "|" ) } return function write _num ( type , fmt , val ) { return ( val | 0 ) === val ? write _num _int ( type , fmt , val ) : write _num _flt ( type , fmt , val ) } } ( ) ; function split _fmt ( fmt ) { var out = [ ] ; var in _str = false , cc ; for ( var i = 0 , j = 0 ; i < fmt . length ; ++ i ) switch ( cc = fmt . charCodeAt ( i ) ) { case 34 : in _str = ! in _str ; break ; case 95 : case 42 : case 92 : ++ i ; break ; case 59 : out [ out . length ] = fmt . substr ( j , i - j ) ; j = i + 1 } out [ out . length ] = fmt . substr ( j ) ; if ( in _str === true ) throw new Error ( "Format |" + fmt + "| unterminated string " ) ; return out } SSF . _split = split _fmt ; var abstime = /\[[HhMmSs]*\]/ ; function fmt _is _date ( fmt ) { var i = 0 , cc = 0 , c = "" , o = "" ; while ( i < fmt . length ) { switch ( c = fmt . charAt ( i ) ) { case "G" : if ( isgeneral ( fmt , i ) ) i += 6 ; i ++ ; break ; case '"' : for ( ; ( cc = fmt . charCodeAt ( ++ i ) ) !== 34 && i < fmt . length ; ) ++ i ; ++ i ; break ; case "\\" : i += 2 ; break ; case "_" : i += 2 ; break ; case "@" : ++ i ; break ; case "B" : case "b" : if ( fmt . charAt ( i + 1 ) === "1" || fmt . charAt ( i + 1 ) === "2" ) return true ; case "M" : case "D" : case "Y" : case "H" : case "S" : case "E" : case "m" : case "d" : case "y" : case "h" : case "s" : case "e" : case "g" : return true ; case "A" : if ( fmt . substr ( i , 3 ) === "A/P" ) return true ; if ( fmt . substr ( i , 5 ) === "AM/PM" ) return true ; ++ i ; break ; case "[" : o = c ; while ( fmt . charAt ( i ++ ) !== "]" && i < fmt . length ) o += fmt . charAt ( i ) ; if ( o . match ( abstime ) ) return true ; break ; case "." : case "0" : case "#" : while ( i < fmt . length && ( "0#?.,E+-%" . indexOf ( c = fmt . charAt ( ++ i ) ) > - 1 || c == "\\" && fmt . charAt ( i + 1 ) == "-" && "0#" . indexOf ( fmt . charAt ( i + 2 ) ) > - 1 ) ) { } break ; case "?" : while ( fmt . charAt ( ++ i ) === c ) { } break ; case "*" : ++ i ; if ( fmt
var bs = ( v < 0 || 1 / v == - Infinity ? 1 : 0 ) << 7 , e = 0 , m = 0 ; var av = bs ? - v : v ; if ( ! isFinite ( av ) ) { e = 2047 ; m = isNaN ( v ) ? 26985 : 0 } else { e = Math . floor ( Math . log ( av ) * Math . LOG2E ) ; m = v * Math . pow ( 2 , 52 - e ) ; if ( e <= - 1023 && ( ! isFinite ( m ) || m < Math . pow ( 2 , 52 ) ) ) { e = - 1022 } else { m -= Math . pow ( 2 , 52 ) ; e += 1023 } } for ( var i = 0 ; i <= 5 ; ++ i , m /= 256 ) b [ idx + i ] = m & 255 ; b [ idx + 6 ] = ( e & 15 ) << 4 | m & 15 ; b [ idx + 7 ] = e >> 4 | bs } var _ _toBuffer , _ _ _toBuffer ; _ _toBuffer = _ _ _toBuffer = function toBuffer _ ( bufs ) { var x = [ ] ; for ( var i = 0 ; i < bufs [ 0 ] . length ; ++ i ) { x . push . apply ( x , bufs [ 0 ] [ i ] ) } return x } ; var _ _utf16le , _ _ _utf16le ; _ _utf16le = _ _ _utf16le = function utf16le _ ( b , s , e ) { var ss = [ ] ; for ( var i = s ; i < e ; i += 2 ) ss . push ( String . fromCharCode ( _ _readUInt16LE ( b , i ) ) ) ; return ss . join ( "" ) } ; var _ _hexlify , _ _ _hexlify ; _ _hexlify = _ _ _hexlify = function hexlify _ ( b , s , l ) { return b . slice ( s , s + l ) . map ( function ( x ) { return ( x < 16 ? "0" : "" ) + x . toString ( 16 ) } ) . join ( "" ) } ; var _ _utf8 , _ _ _utf8 ; _ _utf8 = _ _ _utf8 = function ( b , s , e ) { var ss = [ ] ; for ( var i = s ; i < e ; i ++ ) ss . push ( String . fromCharCode ( _ _readUInt8 ( b , i ) ) ) ; return ss . join ( "" ) } ; var _ _lpstr , _ _ _lpstr ; _ _lpstr = _ _ _lpstr = function lpstr _ ( b , i ) { var len = _ _readUInt32LE ( b , i ) ; return len > 0 ? _ _utf8 ( b , i + 4 , i + 4 + len - 1 ) : "" } ; var _ _lpwstr , _ _ _lpwstr ; _ _lpwstr = _ _ _lpwstr = function lpwstr _ ( b , i ) { var len = 2 * _ _readUInt32LE ( b , i ) ; return len > 0 ? _ _utf8 ( b , i + 4 , i + 4 + len - 1 ) : "" } ; var _ _lpp4 , _ _ _lpp4 ; _ _lpp4 = _ _ _lpp4 = function lpp4 _ ( b , i ) { var len = _ _readUInt32LE ( b , i ) ; return len > 0 ? _ _utf16le ( b , i + 4 , i + 4 + len ) : "" } ; var _ _8lpp4 , _ _ _8lpp4 ; _ _8lpp4 = _ _ _8lpp4 = function lpp4 _8 ( b , i ) { var len = _ _readUInt32LE ( b , i ) ; return len > 0 ? _ _utf8 ( b , i + 4 , i + 4 + len ) : "" } ; var _ _double , _ _ _double ; _ _double = _ _ _double = function ( b , idx ) { return read _double _le ( b , idx ) } ; var is _buf = function is _buf _a ( a ) { return Array . isArray ( a ) } ; if ( has _buf ) { _ _utf16le = function utf16le _b ( b , s , e ) { if ( ! Buffer . isBuffer ( b ) ) return _ _ _utf16le ( b , s , e ) ; return b . toString ( "utf16le" , s , e ) } ; _ _hexlify = function ( b , s , l ) { return Buffer . isBuffer ( b ) ? b . toString ( "hex" , s , s + l ) : _ _ _hexlify ( b , s , l ) } ; _ _lpstr = function lpstr _b ( b , i ) { if ( ! Buffer . isBuffer ( b ) ) return _ _ _lpstr ( b , i ) ; var len = b . readUInt32LE ( i ) ; return len > 0 ? b . toString ( "utf8" , i + 4 , i + 4 + len - 1 ) : "" } ; _ _lpwstr = function lpwstr _b ( b , i ) { if ( ! Buffer . isBuffer ( b ) ) return _ _ _lpwstr ( b , i ) ; var len = 2 * b . readUInt32LE ( i ) ; return b . toString ( "utf16le" , i + 4 , i + 4 + len - 1 ) } ; _ _lpp4 = function lpp4 _b ( b , i ) { if ( ! Buffer . isBuffer ( b ) ) return _ _ _lpp4 ( b , i ) ; var len = b . readUInt32LE ( i ) ; return b . toString ( "utf16le" , i + 4 , i + 4 + len ) } ; _ _8lpp4 = function lpp4 _8b ( b , i ) { if ( ! Buffer . isBuffer ( b ) ) return _ _ _8lpp4 ( b , i ) ; var len = b . readUInt32LE ( i ) ; return b . toString ( "utf8" , i + 4 , i + 4 + len ) } ; _ _utf8 = function utf8 _b ( b , s , e ) { return b . toString ( "utf8" , s , e ) } ; _ _toBuffer = function ( bufs ) { return bufs [ 0 ] . length > 0 && Buffer . isBuffer ( bufs [ 0 ] [ 0 ] ) ? Buffer . concat ( bufs [ 0 ] ) : _ _ _toBuffer ( bufs ) } ; bconcat = function ( bufs ) { return Buffer . isBuffer ( bufs [ 0 ] ) ? Buffer . concat ( bufs ) : [ ] . concat . apply ( [ ] , bufs ) } ; _ _double = function double _ ( b , i ) { if ( Buffer . isBuffer ( b ) ) return b . readDoubleLE ( i ) ; return _ _ _double ( b , i ) } ; is _buf = function is _buf _b ( a ) { return Buffer . isBuffer ( a ) || Array . isArray ( a ) } } if ( typeof cptable !== "undefined" ) { _ _utf16le = function ( b , s , e ) { return cptable . utils . decode ( 1200 , b . slice ( s , e ) ) } ; _ _utf8 = function ( b , s , e ) { return cptable . utils . decode ( 65001 , b . slice ( s , e ) ) } ; _ _lpstr = function ( b , i ) { var len = _ _readUInt32LE ( b , i ) ; return len > 0 ? cptable . utils . decode ( current _codepage , b . slice ( i + 4 , i + 4 + len - 1 ) ) : "" } ; _ _lpwstr = function ( b , i ) { var len = 2 * _ _readUInt32LE ( b , i ) ; return len > 0 ? cptable . utils . decode ( 1200 , b . slice ( i + 4 , i + 4 + len - 1 ) ) : "" } ; _ _lpp4 = function ( b , i ) { var len = _ _readUInt32LE ( b , i ) ; return len > 0 ? cptable . utils . decode ( 1200 , b . slice ( i + 4 , i + 4 + len ) ) : "" } ; _ _8lpp4 = function ( b , i ) { var len = _ _readUInt32LE ( b , i ) ; return len > 0 ? cptable . utils . decode ( 65001 , b . slice ( i + 4 , i + 4 + len ) ) : "" } } var _ _readUInt8 = function ( b , idx ) { return b [ idx ] } ; var _ _readUInt16LE = function ( b , idx ) { return b [ idx + 1 ] * ( 1 << 8 ) + b [ idx ] } ; var _ _readInt16LE = function ( b , idx ) { var u = b [ idx + 1 ] * ( 1 << 8 ) + b [ idx ] ; return u < 32768 ? u : ( 65535 - u + 1 ) * - 1 } ; var _ _readUInt32LE = function ( b , idx ) { return b [ idx + 3 ] * ( 1 << 24 ) + ( b [ idx + 2 ] << 16 ) + ( b [ idx + 1 ] << 8 ) + b [ idx ] } ; var _ _readInt32LE = function ( b , idx ) { return b [ idx + 3 ] << 24 | b [ idx + 2 ] << 16 | b [ idx + 1 ] << 8 | b [ idx ] } ; var _ _ _unhexlify = function ( s ) { return s . match ( /../g ) . map ( function ( x ) { return parseInt ( x , 16 ) } ) } ; var _ _unhexlify = typeof Buffer !== "undefined" ? function ( s ) { return Buffe
var Rn ; var FEtag ; while ( Rn = xlmlregex . exec ( str ) ) switch ( Rn [ 3 ] ) { case "manifest" : break ; case "file-entry" : FEtag = parsexmltag ( Rn [ 0 ] , false ) ; if ( FEtag . path == "/" && FEtag . type !== CT _ODS ) throw new Error ( "This OpenDocument is not a spreadsheet" ) ; break ; case "encryption-data" : case "algorithm" : case "start-key-generation" : case "key-derivation" : throw new Error ( "Unsupported ODS Encryption" ) ; default : if ( opts && opts . WTF ) throw Rn } } function write _manifest ( manifest , opts ) { var o = [ XML _HEADER ] ; o . push ( '<manifest:manifest xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0" manifest:version="1.2">\n' ) ; o . push ( ' <manifest:file-entry manifest:full-path="/" manifest:version="1.2" manifest:media-type="application/vnd.oasis.opendocument.spreadsheet"/>\n' ) ; for ( var i = 0 ; i < manifest . length ; ++ i ) o . push ( ' <manifest:file-entry manifest:full-path="' + manifest [ i ] [ 0 ] + '" manifest:media-type="' + manifest [ i ] [ 1 ] + '"/>\n' ) ; o . push ( "</manifest:manifest>" ) ; return o . join ( "" ) } function write _rdf _type ( file , res , tag ) { return [ ' <rdf:Description rdf:about="' + file + '">\n' , ' <rdf:type rdf:resource="http://docs.oasis-open.org/ns/office/1.2/meta/' + ( tag || "odf" ) + "#" + res + '"/>\n' , " </rdf:Description>\n" ] . join ( "" ) } function write _rdf _has ( base , file ) { return [ ' <rdf:Description rdf:about="' + base + '">\n' , ' <ns0:hasPart xmlns:ns0="http://docs.oasis-open.org/ns/office/1.2/meta/pkg#" rdf:resource="' + file + '"/>\n' , " </rdf:Description>\n" ] . join ( "" ) } function write _rdf ( rdf , opts ) { var o = [ XML _HEADER ] ; o . push ( '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">\n' ) ; for ( var i = 0 ; i != rdf . length ; ++ i ) { o . push ( write _rdf _type ( rdf [ i ] [ 0 ] , rdf [ i ] [ 1 ] ) ) ; o . push ( write _rdf _has ( "" , rdf [ i ] [ 0 ] ) ) } o . push ( write _rdf _type ( "" , "Document" , "pkg" ) ) ; o . push ( "</rdf:RDF>" ) ; return o . join ( "" ) } var CORE _PROPS = [ [ "cp:category" , "Category" ] , [ "cp:contentStatus" , "ContentStatus" ] , [ "cp:keywords" , "Keywords" ] , [ "cp:lastModifiedBy" , "LastAuthor" ] , [ "cp:lastPrinted" , "LastPrinted" ] , [ "cp:revision" , "RevNumber" ] , [ "cp:version" , "Version" ] , [ "dc:creator" , "Author" ] , [ "dc:description" , "Comments" ] , [ "dc:identifier" , "Identifier" ] , [ "dc:language" , "Language" ] , [ "dc:subject" , "Subject" ] , [ "dc:title" , "Title" ] , [ "dcterms:created" , "CreatedDate" , "date" ] , [ "dcterms:modified" , "ModifiedDate" , "date" ] ] ; XMLNS . CORE _PROPS = "http://schemas.openxmlformats.org/package/2006/metadata/core-properties" ; RELS . CORE _PROPS = "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" ; var CORE _PROPS _REGEX = function ( ) { var r = new Array ( CORE _PROPS . length ) ; for ( var i = 0 ; i < CORE _PROPS . length ; ++ i ) { var f = CORE _PROPS [ i ] ; var g = "(?:" + f [ 0 ] . substr ( 0 , f [ 0 ] . indexOf ( ":" ) ) + ":)" + f [ 0 ] . substr ( f [ 0 ] . indexOf ( ":" ) + 1 ) ; r [ i ] = new RegExp ( "<" + g + "[^>]*>(.*)</" + g + ">" ) } return r } ( ) ; function parse _core _props ( data ) { var p = { } ; for ( var i = 0 ; i < CORE _PROPS . length ; ++ i ) { var f = CORE _PROPS [ i ] , cur = data . match ( CORE _PROPS _REGEX [ i ] ) ; if ( cur != null && cur . length > 0 ) p [ f [ 1 ] ] = cur [ 1 ] ; if ( f [ 2 ] === "date" && p [ f [ 1 ] ] ) p [ f [ 1 ] ] = parseDate ( p [ f [ 1 ] ] ) } return p } var CORE _PROPS _XML _ROOT = writextag ( "cp:coreProperties" , null , { "xmlns:cp" : XMLNS . CORE _PROPS , "xmlns:dc" : XMLNS . dc , "xmlns:dcterms" : XMLNS . dcterms , "xmlns:dcmitype" : XMLNS . dcmitype , "xmlns:xsi" : XMLNS . xsi } ) ; function cp _doit ( f , g , h , o , p ) { if ( p [ f ] != null || g == null || g === "" ) return ; p [ f ] = g ; o [ o . length ] = h ? writextag ( f , g , h ) : writetag ( f , g ) } function write _core _props ( cp , _opts ) { var opts = _opts || { } ; var o = [ XML _HEADER , CORE _PROPS _XML _ROOT ] , p = { } ; if ( ! cp && ! opts . Props ) return o . join ( "" ) ; if ( cp ) { if ( 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 ) ; if ( 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 ) } for ( var i = 0 ; i != CORE _PROPS . length ; ++ i ) { var f = CORE _PROPS [ i ] ; var v = opts . Props && opts . Props [ f [ 1 ] ] != null ? opts . Props [ f [ 1 ] ] : cp ? cp [ f [ 1 ] ] : null ; if ( v === true ) v = "1" ; else if ( v === false ) v = "0" ; else if ( typeof v == "number" ) v = String ( v ) ; if ( v != null ) cp _doit ( f [ 0 ] , v , null , o , p ) } if ( o . length > 2 ) { o [ o . length ] = "</cp:coreProperties>" ; o [ 1 ] = o [ 1 ] . replace ( "/>" , ">" ) } return o . join ( "" ) } var EXT _PROPS = [ [ "Application" , "Application" , "string" ] , [ " AppVer
var cUserThreadCount = blob . read _shift ( 4 ) ; return [ fMTREnabled , fUserSetThreadCount , cUserThreadCount ] } function parse _NoteSh ( blob , length , opts ) { if ( opts . biff < 8 ) return ; var row = blob . read _shift ( 2 ) , col = blob . read _shift ( 2 ) ; var flags = blob . read _shift ( 2 ) , idObj = blob . read _shift ( 2 ) ; var stAuthor = parse _XLUnicodeString2 ( blob , 0 , opts ) ; if ( opts . biff < 8 ) blob . read _shift ( 1 ) ; return [ { r : row , c : col } , stAuthor , idObj , flags ] } function parse _Note ( blob , length , opts ) { return parse _NoteSh ( blob , length , opts ) } function parse _MergeCells ( blob , length ) { var merges = [ ] ; var cmcs = blob . read _shift ( 2 ) ; while ( cmcs -- ) merges . push ( parse _Ref8U ( blob , length ) ) ; return merges } function parse _Obj ( blob , length ) { var cmo = parse _FtCmo ( blob , 22 ) ; var fts = parse _FtArray ( blob , length - 22 , cmo [ 1 ] ) ; return { cmo : cmo , ft : fts } } function parse _TxO ( blob , length , opts ) { var s = blob . l ; var texts = "" ; try { blob . l += 4 ; var ot = ( opts . lastobj || { cmo : [ 0 , 0 ] } ) . cmo [ 1 ] ; var controlInfo ; if ( [ 0 , 5 , 7 , 11 , 12 , 14 ] . indexOf ( ot ) == - 1 ) blob . l += 6 ; else controlInfo = parse _ControlInfo ( blob , 6 , opts ) ; var cchText = blob . read _shift ( 2 ) ; var cbRuns = blob . read _shift ( 2 ) ; var ifntEmpty = parse _FontIndex ( blob , 2 ) ; var len = blob . read _shift ( 2 ) ; blob . l += len ; for ( var i = 1 ; i < blob . lens . length - 1 ; ++ i ) { if ( blob . l - s != blob . lens [ i ] ) throw new Error ( "TxO: bad continue record" ) ; var hdr = blob [ blob . l ] ; var t = parse _XLUnicodeStringNoCch ( blob , blob . lens [ i + 1 ] - blob . lens [ i ] - 1 ) ; texts += t ; if ( texts . length >= ( hdr ? cchText : 2 * cchText ) ) break } if ( texts . length !== cchText && texts . length !== cchText * 2 ) { throw new Error ( "cchText: " + cchText + " != " + texts . length ) } blob . l = s + length ; return { t : texts } } catch ( e ) { blob . l = s + length ; return { t : texts } } } var parse _HLink = function ( blob , length ) { var ref = parse _Ref8U ( blob , 8 ) ; blob . l += 16 ; var hlink = parse _Hyperlink ( blob , length - 24 ) ; return [ ref , hlink ] } ; var parse _HLinkTooltip = function ( blob , length ) { var end = blob . l + length ; blob . read _shift ( 2 ) ; var ref = parse _Ref8U ( blob , 8 ) ; var wzTooltip = blob . read _shift ( ( length - 10 ) / 2 , "dbcs-cont" ) ; wzTooltip = wzTooltip . replace ( chr0 , "" ) ; return [ ref , wzTooltip ] } ; function parse _Country ( blob , length ) { var o = [ ] , d ; d = blob . read _shift ( 2 ) ; o [ 0 ] = CountryEnum [ d ] || d ; d = blob . read _shift ( 2 ) ; o [ 1 ] = CountryEnum [ d ] || d ; 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 } function parse _ColInfo ( blob , length , opts ) { if ( ! opts . cellStyles ) return parsenoop ( blob , length ) ; var w = opts && opts . biff >= 12 ? 4 : 2 ; var colFirst = blob . read _shift ( w ) ; var colLast = blob . read _shift ( w ) ; var coldx = blob . read _shift ( w ) ; var ixfe = blob . read _shift ( w ) ; var flags = blob . read _shift ( 2 ) ; if ( w == 2 ) blob . l += 2 ; return { s : colFirst , e : colLast , w : coldx , ixfe : ixfe , flags : flags } } function parse _Setup ( blob , length , opts ) { var o = { } ; blob . l += 16 ; o . header = parse _Xnum ( blob , 8 ) ; o . footer = parse _Xnum ( blob , 8 ) ; blob . l += 2 ; return o } function parse _ShtProps ( blob , length , opts ) { var def = { area : false } ; if ( opts . biff != 5 ) { blob . l += length ; return def } var d = blob . read _shift ( 1 ) ; blob . l += 3 ; if ( d & 16 ) def . area = true ; return def } var parse _Style = parsenoop ; var parse _StyleExt = 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
n : "GRAPHNAME" , f : parsenoop } , 66 : { n : "ZOOM" , f : parsenoop } , 67 : { n : "SYMSPLIT" , f : parsenoop } , 68 : { n : "NSROWS" , f : parsenoop } , 69 : { n : "NSCOLS" , f : parsenoop } , 70 : { n : "RULER" , f : parsenoop } , 71 : { n : "NNAME" , f : parsenoop } , 72 : { n : "ACOMM" , f : parsenoop } , 73 : { n : "AMACRO" , f : parsenoop } , 74 : { n : "PARSE" , f : parsenoop } , 255 : { n : "" , f : parsenoop } } ; var WK3Enum = { 0 : { n : "BOF" , f : parsenoop } , 1 : { n : "EOF" , f : parsenoop } , 3 : { n : "??" , f : parsenoop } , 4 : { n : "??" , f : parsenoop } , 5 : { n : "??" , f : parsenoop } , 6 : { n : "??" , f : parsenoop } , 7 : { n : "??" , f : parsenoop } , 9 : { n : "??" , f : parsenoop } , 10 : { n : "??" , f : parsenoop } , 11 : { n : "??" , f : parsenoop } , 12 : { n : "??" , f : parsenoop } , 14 : { n : "??" , f : parsenoop } , 15 : { n : "??" , f : parsenoop } , 16 : { n : "??" , f : parsenoop } , 17 : { n : "??" , f : parsenoop } , 18 : { n : "??" , f : parsenoop } , 19 : { n : "??" , f : parsenoop } , 21 : { n : "??" , f : parsenoop } , 22 : { n : "LABEL16" , f : parse _LABEL _16 } , 23 : { n : "NUMBER17" , f : parse _NUMBER _17 } , 24 : { n : "NUMBER18" , f : parse _NUMBER _18 } , 25 : { n : "FORMULA19" , f : parse _FORMULA _19 } , 26 : { n : "??" , f : parsenoop } , 27 : { n : "??" , f : parsenoop } , 28 : { n : "??" , f : parsenoop } , 29 : { n : "??" , f : parsenoop } , 30 : { n : "??" , f : parsenoop } , 31 : { n : "??" , f : parsenoop } , 33 : { n : "??" , f : parsenoop } , 37 : { n : "NUMBER25" , f : parse _NUMBER _25 } , 39 : { n : "NUMBER27" , f : parse _NUMBER _27 } , 40 : { n : "FORMULA28" , f : parse _FORMULA _28 } , 255 : { n : "" , f : parsenoop } } ; return { to _workbook : lotus _to _workbook } } ( ) ; var CS2CP = { 0 : 1252 , 1 : 65001 , 2 : 65001 , 77 : 1e4 , 128 : 932 , 129 : 949 , 130 : 1361 , 134 : 936 , 136 : 950 , 161 : 1253 , 162 : 1254 , 163 : 1258 , 177 : 1255 , 178 : 1256 , 186 : 1257 , 204 : 1251 , 222 : 874 , 238 : 1250 , 255 : 1252 , 69 : 6969 } ; var parse _rs = function parse _rs _factory ( ) { var tregex = matchtag ( "t" ) , rpregex = matchtag ( "rPr" ) , rregex = /<(?:\w+:)?r>/g , rend = /<\/(?:\w+:)?r>/ , nlregex = /\r\n/g ; var parse _rpr = function parse _rpr ( rpr , intro , outro ) { var font = { } , cp = 65001 , align = "" ; var m = rpr . match ( tagregex ) , i = 0 ; if ( m ) for ( ; i != m . length ; ++ i ) { var y = parsexmltag ( m [ i ] ) ; switch ( y [ 0 ] . replace ( /\w*:/g , "" ) ) { case "<condense" : break ; case "<extend" : break ; case "<shadow" : if ( ! y . val ) break ; case "<shadow>" : case "<shadow/>" : font . shadow = 1 ; break ; case "</shadow>" : break ; case "<charset" : if ( y . val == "1" ) break ; cp = CS2CP [ parseInt ( y . val , 10 ) ] ; break ; case "<outline" : if ( ! y . val ) break ; case "<outline>" : case "<outline/>" : font . outline = 1 ; break ; case "</outline>" : break ; case "<rFont" : font . name = y . val ; break ; case "<sz" : font . sz = y . val ; break ; case "<strike" : if ( ! y . val ) break ; case "<strike>" : case "<strike/>" : font . strike = 1 ; break ; case "</strike>" : break ; case "<u" : if ( ! y . val ) break ; switch ( y . val ) { case "double" : font . uval = "double" ; break ; case "singleAccounting" : font . uval = "single-accounting" ; break ; case "doubleAccounting" : font . uval = "double-accounting" ; break } case "<u>" : case "<u/>" : font . u = 1 ; break ; case "</u>" : break ; case "<b" : if ( y . val == "0" ) break ; case "<b>" : case "<b/>" : font . b = 1 ; break ; case "</b>" : break ; case "<i" : if ( y . val == "0" ) break ; case "<i>" : case "<i/>" : font . i = 1 ; break ; case "</i>" : break ; case "<color" : if ( y . rgb ) font . color = y . rgb . substr ( 2 , 6 ) ; break ; case "<family" : font . family = y . val ; break ; case "<vertAlign" : align = y . val ; break ; case "<scheme" : break ; default : if ( y [ 0 ] . charCodeAt ( 1 ) !== 47 ) throw "Unrecognized rich format " + y [ 0 ] } } var style = [ ] ; if ( font . u ) style . push ( "text-decoration: underline;" ) ; if ( font . uval ) style . push ( "text-underline-style:" + font . uval + ";" ) ; if ( font . sz ) style . push ( "font-size:" + font . sz + ";" ) ; if ( font . outline ) style . push ( "text-effect: outline;" ) ; if ( font . shadow ) style . push ( "text-shadow: auto;" ) ; intro . push ( '<span style="' + style . join ( "" ) + '">' ) ; if ( font . b ) { intro . push ( "<b>" ) ; outro . push ( "</b>" ) } if ( font . i ) { intro . push ( "<i>" ) ; outro . push ( "</i>" ) } if ( font . strike ) { intro . push ( "<s>" ) ; outro . push ( "</s>" ) } if ( align == "superscript" ) align = "sup" ; else if ( align == "subscript" ) align = "sub" ; if ( align != "" ) { intro . push ( "<" + align + ">" ) ; outro . push ( "</" + align + ">" ) } outro . push ( "</span>" ) ; return cp } ; function parse _r ( r ) { var terms = [ [ ] , "" , [ ] ] ; var t = r . match ( tregex ) , cp = 65001 ; if ( ! isval ( t ) ) return "" ; terms [ 1 ] = t [ 1 ] ; var rpr = r . match ( rpregex ) ; if ( isval ( rpr ) ) cp = parse _rpr ( rpr [ 1 ] , terms [ 0 ] , terms [ 2 ] ) ; return terms [ 0 ] . join ( "" ) + terms [ 1 ] . replace ( nlregex , "<br/>" ) + terms [ 2 ] . join ( "" ) } return function parse _rs ( rs ) { return rs . replace ( rregex , "" ) . split ( rend ) . map ( parse _r ) . join ( "" ) } } ( ) ; var sitregex = /<(?:\w+:)?t[^>]*>([^<]*)<\/(?:\w+:)?t>/g , sirregex = /<(?:\w+:)?r>/ ; var sirphregex = /<(?:\w+:)?rPh.*?>(.*?)<\/(?:\w+:)?rPh>/g ; function parse _si ( x , opts ) { var html = opts ? opts . cellHTML : true ; var z = { } ; if ( ! x ) r
o [ o . length ] = '<a:font script="Uigh" typeface="Microsoft Uighur"/>' ; o [ o . length ] = '<a:font script="Geor" typeface="Sylfaen"/>' ; o [ o . length ] = "</a:majorFont>" ; o [ o . length ] = "<a:minorFont>" ; o [ o . length ] = '<a:latin typeface="Calibri"/>' ; o [ o . length ] = '<a:ea typeface=""/>' ; o [ o . length ] = '<a:cs typeface=""/>' ; o [ o . length ] = '<a:font script="Jpan" typeface="M S Pゴシック"/>' ; o [ o . length ] = '<a:font script="Hang" typeface="맑은 고딕"/>' ; o [ o . length ] = '<a:font script="Hans" typeface="宋体"/>' ; o [ o . length ] = '<a:font script="Hant" typeface="新細明體"/>' ; o [ o . length ] = '<a:font script="Arab" typeface="Arial"/>' ; o [ o . length ] = '<a:font script="Hebr" typeface="Arial"/>' ; o [ o . length ] = '<a:font script="Thai" typeface="Tahoma"/>' ; o [ o . length ] = '<a:font script="Ethi" typeface="Nyala"/>' ; o [ o . length ] = '<a:font script="Beng" typeface="Vrinda"/>' ; o [ o . length ] = '<a:font script="Gujr" typeface="Shruti"/>' ; o [ o . length ] = '<a:font script="Khmr" typeface="DaunPenh"/>' ; o [ o . length ] = '<a:font script="Knda" typeface="Tunga"/>' ; o [ o . length ] = '<a:font script="Guru" typeface="Raavi"/>' ; o [ o . length ] = '<a:font script="Cans" typeface="Euphemia"/>' ; o [ o . length ] = '<a:font script="Cher" typeface="Plantagenet Cherokee"/>' ; o [ o . length ] = '<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>' ; o [ o . length ] = '<a:font script="Tibt" typeface="Microsoft Himalaya"/>' ; o [ o . length ] = '<a:font script="Thaa" typeface="MV Boli"/>' ; o [ o . length ] = '<a:font script="Deva" typeface="Mangal"/>' ; o [ o . length ] = '<a:font script="Telu" typeface="Gautami"/>' ; o [ o . length ] = '<a:font script="Taml" typeface="Latha"/>' ; o [ o . length ] = '<a:font script="Syrc" typeface="Estrangelo Edessa"/>' ; o [ o . length ] = '<a:font script="Orya" typeface="Kalinga"/>' ; o [ o . length ] = '<a:font script="Mlym" typeface="Kartika"/>' ; o [ o . length ] = '<a:font script="Laoo" typeface="DokChampa"/>' ; o [ o . length ] = '<a:font script="Sinh" typeface="Iskoola Pota"/>' ; o [ o . length ] = '<a:font script="Mong" typeface="Mongolian Baiti"/>' ; o [ o . length ] = '<a:font script="Viet" typeface="Arial"/>' ; o [ o . length ] = '<a:font script="Uigh" typeface="Microsoft Uighur"/>' ; o [ o . length ] = '<a:font script="Geor" typeface="Sylfaen"/>' ; o [ o . length ] = "</a:minorFont>" ; o [ o . length ] = "</a:fontScheme>" ; o [ o . length ] = '<a:fmtScheme name="Office">' ; o [ o . length ] = "<a:fillStyleLst>" ; o [ o . length ] = '<a:solidFill><a:schemeClr val="phClr"/></a:solidFill>' ; o [ o . length ] = '<a:gradFill rotWithShape="1">' ; o [ o . length ] = "<a:gsLst>" ; o [ o . length ] = '<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="50000"/><a:satMod val="300000"/></a:schemeClr></a:gs>' ; o [ o . length ] = '<a:gs pos="35000"><a:schemeClr val="phClr"><a:tint val="37000"/><a:satMod val="300000"/></a:schemeClr></a:gs>' ; o [ o . length ] = '<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="15000"/><a:satMod val="350000"/></a:schemeClr></a:gs>' ; o [ o . length ] = "</a:gsLst>" ; o [ o . length ] = '<a:lin ang="16200000" scaled="1"/>' ; o [ o . length ] = "</a:gradFill>" ; o [ o . length ] = '<a:gradFill rotWithShape="1">' ; o [ o . length ] = "<a:gsLst>" ; o [ o . length ] = '<a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="100000"/><a:shade val="100000"/><a:satMod val="130000"/></a:schemeClr></a:gs>' ; o [ o . length ] = '<a:gs pos="100000"><a:schemeClr val="phClr"><a:tint val="50000"/><a:shade val="100000"/><a:satMod val="350000"/></a:schemeClr></a:gs>' ; o [ o . length ] = "</a:gsLst>" ; o [ o . length ] = '<a:lin ang="16200000" scaled="0"/>' ; o [ o . length ] = "</a:gradFill>" ; o [ o . length ] = "</a:fillStyleLst>" ; o [ o . length ] = "<a:lnStyleLst>" ; o [ o . length ] = '<a:ln w="9525" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"><a:shade val="95000"/><a:satMod val="105000"/></a:schemeClr></a:solidFill><a:prstDash val="solid"/></a:ln>' ; o [ o . length ] = '<a:ln w="25400" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>' ; o [ o . length ] = '<a:ln w="38100" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/></a:ln>' ; o [ o . length ] = "</a:lnStyleLst>" ; o [ o . length ] = "<a:effectStyleLst>" ; o [ o . length ] = "<a:effectStyle>" ; o [ o . length ] = "<a:effectLst>" ; o [ o . length ] = ' < a : outerShdw blurRad = "40000" dist = "20000" dir = "5400000" rotWithShape = "0" > < a : srgbClr val = "000000" > < a : alpha val = " 380
return [ rgce , rgcb ] } function parse _Rgce ( blob , length , opts ) { var target = blob . l + length ; var R , id , ptgs = [ ] ; while ( target != blob . l ) { length = target - blob . l ; id = blob [ blob . l ] ; R = PtgTypes [ id ] ; if ( id === 24 || id === 25 ) { id = blob [ blob . l + 1 ] ; R = ( id === 24 ? Ptg18 : Ptg19 ) [ id ] } if ( ! R || ! R . f ) { parsenoop ( blob , length ) } else { ptgs . push ( [ R . n , R . f ( blob , length , opts ) ] ) } } return ptgs } function stringify _array ( f ) { var o = [ ] ; for ( var i = 0 ; i < f . length ; ++ i ) { var x = f [ i ] , r = [ ] ; for ( var j = 0 ; j < x . length ; ++ j ) { var y = x [ j ] ; if ( y ) switch ( y [ 0 ] ) { case 2 : r . push ( '"' + y [ 1 ] . replace ( /"/g , '""' ) + '"' ) ; break ; default : r . push ( y [ 1 ] ) } else r . push ( "" ) } o . push ( r . join ( "," ) ) } return o . join ( ";" ) } var PtgBinOp = { PtgAdd : "+" , PtgConcat : "&" , PtgDiv : "/" , PtgEq : "=" , PtgGe : ">=" , PtgGt : ">" , PtgLe : "<=" , PtgLt : "<" , PtgMul : "*" , PtgNe : "<>" , PtgPower : "^" , PtgSub : "-" } ; function stringify _formula ( formula , range , cell , supbooks , opts ) { var _range = { s : { c : 0 , r : 0 } , e : { c : 0 , r : 0 } } ; var stack = [ ] , e1 , e2 , type , c , ixti = 0 , nameidx = 0 , r , sname = "" ; if ( ! formula [ 0 ] || ! formula [ 0 ] [ 0 ] ) return "" ; var last _sp = - 1 , sp = "" ; for ( var ff = 0 , fflen = formula [ 0 ] . length ; ff < fflen ; ++ ff ) { var f = formula [ 0 ] [ ff ] ; switch ( f [ 0 ] ) { case "PtgUminus" : stack . push ( "-" + stack . pop ( ) ) ; break ; case "PtgUplus" : stack . push ( "+" + stack . pop ( ) ) ; break ; case "PtgPercent" : stack . push ( stack . pop ( ) + "%" ) ; break ; case "PtgAdd" : case "PtgConcat" : case "PtgDiv" : case "PtgEq" : case "PtgGe" : case "PtgGt" : case "PtgLe" : case "PtgLt" : case "PtgMul" : case "PtgNe" : case "PtgPower" : case "PtgSub" : e1 = stack . pop ( ) ; e2 = stack . pop ( ) ; if ( last _sp >= 0 ) { switch ( formula [ 0 ] [ last _sp ] [ 1 ] [ 0 ] ) { case 0 : sp = fill ( " " , formula [ 0 ] [ last _sp ] [ 1 ] [ 1 ] ) ; break ; case 1 : sp = fill ( "\r" , formula [ 0 ] [ last _sp ] [ 1 ] [ 1 ] ) ; break ; default : sp = "" ; if ( opts . WTF ) throw new Error ( "Unexpected PtgAttrSpaceType " + formula [ 0 ] [ last _sp ] [ 1 ] [ 0 ] ) } e2 = e2 + sp ; last _sp = - 1 } stack . push ( e2 + PtgBinOp [ f [ 0 ] ] + e1 ) ; break ; case "PtgIsect" : e1 = stack . pop ( ) ; e2 = stack . pop ( ) ; stack . push ( e2 + " " + e1 ) ; break ; case "PtgUnion" : e1 = stack . pop ( ) ; e2 = stack . pop ( ) ; stack . push ( e2 + "," + e1 ) ; break ; case "PtgRange" : e1 = stack . pop ( ) ; e2 = stack . pop ( ) ; stack . push ( e2 + ":" + e1 ) ; break ; case "PtgAttrChoose" : break ; case "PtgAttrGoto" : break ; case "PtgAttrIf" : break ; case "PtgAttrIfError" : break ; case "PtgRef" : type = f [ 1 ] [ 0 ] ; c = shift _cell _xls ( f [ 1 ] [ 1 ] , _range , opts ) ; stack . push ( encode _cell _xls ( c ) ) ; break ; case "PtgRefN" : type = f [ 1 ] [ 0 ] ; c = cell ? shift _cell _xls ( f [ 1 ] [ 1 ] , cell , opts ) : f [ 1 ] [ 1 ] ; stack . push ( encode _cell _xls ( c ) ) ; break ; case "PtgRef3d" : type = f [ 1 ] [ 0 ] ; ixti = f [ 1 ] [ 1 ] ; c = shift _cell _xls ( f [ 1 ] [ 2 ] , _range , opts ) ; sname = supbooks . SheetNames [ ixti ] ; stack . push ( sname + "!" + encode _cell _xls ( c ) ) ; break ; case "PtgFunc" : case "PtgFuncVar" : var argc = f [ 1 ] [ 0 ] , func = f [ 1 ] [ 1 ] ; if ( ! argc ) argc = 0 ; var args = argc == 0 ? [ ] : stack . slice ( - argc ) ; stack . length -= argc ; if ( func === "User" ) func = args . shift ( ) ; stack . push ( func + "(" + args . join ( "," ) + ")" ) ; break ; case "PtgBool" : stack . push ( f [ 1 ] ? "TRUE" : "FALSE" ) ; break ; case "PtgInt" : stack . push ( f [ 1 ] ) ; break ; case "PtgNum" : stack . push ( String ( f [ 1 ] ) ) ; break ; case "PtgStr" : stack . push ( '"' + f [ 1 ] + '"' ) ; break ; case "PtgErr" : stack . push ( f [ 1 ] ) ; break ; case "PtgAreaN" : type = f [ 1 ] [ 0 ] ; r = shift _range _xls ( f [ 1 ] [ 1 ] , _range , opts ) ; stack . push ( encode _range _xls ( r , opts ) ) ; break ; case "PtgArea" : type = f [ 1 ] [ 0 ] ; r = shift _range _xls ( f [ 1 ] [ 1 ] , _range , opts ) ; stack . push ( encode _range _xls ( r , opts ) ) ; break ; case "PtgArea3d" : type = f [ 1 ] [ 0 ] ; ixti = f [ 1 ] [ 1 ] ; r = f [ 1 ] [ 2 ] ; sname = supbooks && supbooks [ 1 ] ? supbooks [ 1 ] [ ixti + 1 ] : "**MISSING**" ; stack . push ( sname + "!" + encode _range ( r ) ) ; break ; case "PtgAttrSum" : stack . push ( "SUM(" + stack . pop ( ) + ")" ) ; break ; case "PtgAttrSemi" : break ; case "PtgName" : nameidx = f [ 1 ] [ 2 ] ; var lbl = ( supbooks . names || [ ] ) [ nameidx - 1 ] || ( supbooks [ 0 ] || [ ] ) [ nameidx ] ; var name = lbl ? lbl . Name : "**MISSING**" + String ( nameidx ) ; if ( name in XLSXFutureFunctions ) name = XLSXFutureFunctions [ name ] ; stack . push ( name ) ; break ; case "PtgNameX" : var bookidx = f [ 1 ] [ 1 ] ; nameidx = f [ 1 ] [ 2 ] ; var externbook ; if ( opts . biff <= 5 ) { if ( bookidx < 0 ) bookidx = - bookidx ; if ( supbooks [ bookidx ] ) externbook = supbooks [ bookidx ] [ nameidx ] } else { var pnxname = supbooks . SheetNames [ bookidx ] ; var o = "" ; if ( ( ( supbooks [ bookidx ] || [ ] ) [ 0 ] || [ ] ) [ 0 ] == 14849 ) { } else if ( ( ( supbooks [ bookidx ] || [ ] ) [ 0 ] || [ ] ) [ 0 ] == 1025 ) { if ( supbooks [ bookidx ] [ nameidx ] && supbooks [ bookidx ] [ nameidx ] . itab > 0 ) { o = supbooks . SheetNames [ supbooks [ bookidx ] [ nameidx ] . itab - 1 ] + "!" } } else o = supbooks . SheetNames [ nameidx - 1 ] + "!" ; if ( supbooks [ bookidx ] && supbooks [ bookidx ] [ nameidx ] ) o += supbooks [ bookidx ] [ nameidx ] . Name ; else if (
val . Rel = rel } else { val . Target = val . location ; rel = { Target : val . location , TargetMode : "Internal" } ; val . Rel = rel } if ( val . tooltip ) { val . Tooltip = val . tooltip ; delete val . tooltip } var rng = safe _decode _range ( val . ref ) ; for ( var R = rng . s . r ; R <= rng . e . r ; ++ R ) for ( var C = rng . s . c ; C <= rng . e . c ; ++ C ) { var addr = encode _cell ( { c : C , r : R } ) ; if ( dense ) { if ( ! s [ R ] ) s [ R ] = [ ] ; if ( ! s [ R ] [ C ] ) s [ R ] [ C ] = { t : "z" , v : undefined } ; s [ R ] [ C ] . l = val } else { if ( ! s [ addr ] ) s [ addr ] = { t : "z" , v : undefined } ; s [ addr ] . l = val } } } } function parse _ws _xml _margins ( margin ) { var o = { } ; [ "left" , "right" , "top" , "bottom" , "header" , "footer" ] . forEach ( function ( k ) { if ( margin [ k ] ) o [ k ] = parseFloat ( margin [ k ] ) } ) ; return o } function write _ws _xml _margins ( margin ) { default _margins ( margin ) ; return writextag ( "pageMargins" , null , margin ) } function parse _ws _xml _cols ( columns , cols ) { var seencol = false ; for ( var coli = 0 ; coli != cols . length ; ++ coli ) { var coll = parsexmltag ( cols [ coli ] , true ) ; if ( coll . hidden ) coll . hidden = parsexmlbool ( coll . hidden ) ; var colm = parseInt ( coll . min , 10 ) - 1 , colM = parseInt ( coll . max , 10 ) - 1 ; delete coll . min ; delete coll . max ; coll . width = + coll . width ; if ( ! seencol && coll . width ) { seencol = true ; find _mdw _colw ( coll . width ) } process _col ( coll ) ; while ( colm <= colM ) columns [ colm ++ ] = dup ( coll ) } } function write _ws _xml _cols ( ws , cols ) { var o = [ "<cols>" ] , col , width ; for ( var i = 0 ; i != cols . length ; ++ i ) { if ( ! ( col = cols [ i ] ) ) continue ; o [ o . length ] = writextag ( "col" , null , col _obj _w ( i , col ) ) } o [ o . length ] = "</cols>" ; return o . join ( "" ) } function parse _ws _xml _autofilter ( data ) { var o = { ref : ( data . match ( /ref="([^"]*)"/ ) || [ ] ) [ 1 ] } ; return o } function write _ws _xml _autofilter ( data ) { return writextag ( "autoFilter" , null , { ref : data . ref } ) } function write _ws _xml _sheetviews ( ws , opts , idx , wb ) { return writextag ( "sheetViews" , writextag ( "sheetView" , null , { workbookViewId : "0" } ) , { } ) } function write _ws _xml _cell ( cell , ref , ws , opts , idx , wb ) { if ( cell . v === undefined && cell . f === undefined || cell . t === "z" ) return "" ; var vv = "" ; var oldt = cell . t , oldv = cell . v ; switch ( cell . t ) { case "b" : vv = cell . v ? "1" : "0" ; break ; case "n" : vv = "" + cell . v ; break ; case "e" : vv = BErr [ cell . v ] ; break ; case "d" : if ( opts . cellDates ) vv = parseDate ( cell . v ) . toISOString ( ) ; else { cell . t = "n" ; vv = "" + ( cell . v = datenum ( parseDate ( cell . v ) ) ) ; if ( typeof cell . z === "undefined" ) cell . z = SSF . _table [ 14 ] } break ; default : vv = cell . v ; break } var v = writetag ( "v" , escapexml ( vv ) ) , o = { r : ref } ; var os = get _cell _style ( opts . cellXfs , cell , opts ) ; if ( os !== 0 ) o . s = os ; switch ( cell . t ) { case "n" : break ; case "d" : o . t = "d" ; break ; case "b" : o . t = "b" ; break ; case "e" : o . t = "e" ; break ; default : if ( cell . v == null ) { delete cell . t ; break } if ( opts . bookSST ) { v = writetag ( "v" , "" + get _sst _id ( opts . Strings , cell . v ) ) ; o . t = "s" ; break } o . t = "str" ; break } if ( cell . t != oldt ) { cell . t = oldt ; cell . v = oldv } if ( cell . f ) { var ff = cell . F && cell . F . substr ( 0 , ref . length ) == ref ? { t : "array" , ref : cell . F } : null ; v = writextag ( "f" , escapexml ( cell . f ) , ff ) + ( cell . v != null ? v : "" ) } if ( cell . l ) ws [ "!links" ] . push ( [ ref , cell . l ] ) ; if ( cell . c ) ws [ "!comments" ] . push ( [ ref , cell . c ] ) ; return writextag ( "c" , v , o ) } var parse _ws _xml _data = function parse _ws _xml _data _factory ( ) { var cellregex = /<(?:\w+:)?c[ >]/ , rowregex = /<\/(?:\w+:)?row>/ ; var rregex = /r=["']([^"']*)["']/ , isregex = /<(?:\w+:)?is>([\S\s]*?)<\/(?:\w+:)?is>/ ; var refregex = /ref=["']([^"']*)["']/ ; var match _v = matchtag ( "v" ) , match _f = matchtag ( "f" ) ; return function parse _ws _xml _data ( sdata , s , opts , guess , themes , styles ) { var ri = 0 , x = "" , cells = [ ] , cref = [ ] , idx = 0 , i = 0 , cc = 0 , d = "" , p ; var tag , tagr = 0 , tagc = 0 ; var sstr , ftag ; var fmtid = 0 , fillid = 0 , do _format = Array . isArray ( styles . CellXf ) , cf ; var arrayf = [ ] ; var sharedf = [ ] ; var dense = Array . isArray ( s ) ; var rows = [ ] , rowobj = { } , rowrite = false ; for ( var marr = sdata . split ( rowregex ) , mt = 0 , marrlen = marr . length ; mt != marrlen ; ++ mt ) { x = marr [ mt ] . trim ( ) ; var xlen = x . length ; if ( xlen === 0 ) continue ; for ( ri = 0 ; ri < xlen ; ++ ri ) if ( x . charCodeAt ( ri ) === 62 ) break ; ++ ri ; tag = parsexmltag ( x . substr ( 0 , ri ) , true ) ; tagr = tag . r != null ? parseInt ( tag . r , 10 ) : tagr + 1 ; tagc = - 1 ; if ( opts . sheetRows && opts . sheetRows < tagr ) continue ; if ( guess . s . r > tagr - 1 ) guess . s . r = tagr - 1 ; if ( guess . e . r < tagr - 1 ) guess . e . r = tagr - 1 ; if ( opts && opts . cellStyles ) { rowobj = { } ; rowrite = false ; if ( tag . ht ) { rowrite = true ; rowobj . hpt = parseFloat ( tag . ht ) ; rowobj . hpx = pt2px ( rowobj . hpt ) } if ( tag . hidden == "1" ) { rowrite = true ; rowobj . hidden = true } if ( rowrite ) rows [ tagr - 1 ] = rowobj } cells = x . substr ( ri ) . split ( cellregex ) ; for ( ri = 0 ; ri != cells . length ; ++ ri ) { x = cells [ ri ] . trim ( ) ; if ( x . length
case "</externalReferences>" : case "<externalReferences>" : break ; case "<externalReference" : break ; case "<definedNames/>" : break ; case "<definedNames>" : case "<definedNames" : pass = true ; break ; case "</definedNames>" : pass = false ; break ; case "<definedName" : { dname = { } ; dname . Name = y . name ; if ( y . comment ) dname . Comment = y . comment ; if ( y . localSheetId ) dname . Sheet = + y . localSheetId ; dnstart = idx + x . length } break ; case "</definedName>" : { dname . Ref = data . slice ( dnstart , idx ) ; wb . Names . push ( dname ) } break ; case "<definedName/>" : break ; case "<calcPr" : delete y [ 0 ] ; wb . CalcPr = y ; break ; case "<calcPr/>" : delete y [ 0 ] ; wb . CalcPr = y ; break ; case "</calcPr>" : break ; case "<oleSize" : break ; case "<customWorkbookViews>" : case "</customWorkbookViews>" : case "<customWorkbookViews" : break ; case "<customWorkbookView" : case "</customWorkbookView>" : break ; case "<pivotCaches>" : case "</pivotCaches>" : case "<pivotCaches" : break ; case "<pivotCache" : break ; case "<smartTagPr" : case "<smartTagPr/>" : break ; case "<smartTagTypes" : case "<smartTagTypes>" : case "</smartTagTypes>" : break ; case "<smartTagType" : break ; case "<webPublishing" : case "<webPublishing/>" : break ; case "<fileRecoveryPr" : case "<fileRecoveryPr/>" : break ; case "<webPublishObjects>" : case "<webPublishObjects" : case "</webPublishObjects>" : break ; case "<webPublishObject" : break ; case "<extLst>" : case "</extLst>" : case "<extLst/>" : break ; case "<ext" : pass = true ; break ; case "</ext>" : pass = false ; break ; case "<ArchID" : break ; case "<AlternateContent" : pass = true ; break ; case "</AlternateContent>" : pass = false ; break ; default : if ( ! pass && opts . WTF ) throw new Error ( "unrecognized " + y [ 0 ] + " in workbook" ) } return x } ) ; if ( XMLNS . main . indexOf ( wb . xmlns ) === - 1 ) throw new Error ( "Unknown Namespace: " + wb . xmlns ) ; parse _wb _defaults ( wb ) ; return wb } var WB _XML _ROOT = writextag ( "workbook" , null , { xmlns : XMLNS . main [ 0 ] , "xmlns:r" : XMLNS . r } ) ; function safe1904 ( wb ) { if ( ! wb . Workbook ) return "false" ; if ( ! wb . Workbook . WBProps ) return "false" ; return parsexmlbool ( wb . Workbook . WBProps . date1904 ) ? "true" : "false" } function write _wb _xml ( wb , opts ) { var o = [ XML _HEADER ] ; o [ o . length ] = WB _XML _ROOT ; var write _names = wb . Workbook && ( wb . Workbook . Names || [ ] ) . length > 0 ; o [ o . length ] = writextag ( "workbookPr" , null , { date1904 : safe1904 ( wb ) , codeName : "ThisWorkbook" } ) ; o [ o . length ] = "<sheets>" ; var sheets = wb . Workbook && wb . Workbook . Sheets || [ ] ; for ( var i = 0 ; i != wb . SheetNames . length ; ++ i ) { var sht = { name : escapexml ( wb . SheetNames [ i ] . substr ( 0 , 31 ) ) } ; sht . sheetId = "" + ( i + 1 ) ; sht [ "r:id" ] = "rId" + ( i + 1 ) ; if ( sheets [ i ] ) switch ( sheets [ i ] . Hidden ) { case 1 : sht . state = "hidden" ; break ; case 2 : sht . state = "veryHidden" ; break } o [ o . length ] = writextag ( "sheet" , null , sht ) } o [ o . length ] = "</sheets>" ; if ( write _names ) { o [ o . length ] = "<definedNames>" ; if ( wb . Workbook && wb . Workbook . Names ) wb . Workbook . Names . forEach ( function ( n ) { var d = { name : n . Name } ; if ( n . Comment ) d . comment = n . Comment ; if ( n . Sheet != null ) d . localSheetId = "" + n . Sheet ; if ( ! n . Ref ) return ; o [ o . length ] = writextag ( "definedName" , String ( n . Ref ) , d ) } ) ; o [ o . length ] = "</definedNames>" } if ( o . length > 2 ) { o [ o . length ] = "</workbook>" ; o [ 1 ] = o [ 1 ] . replace ( "/>" , ">" ) } return o . join ( "" ) } function parse _BrtBundleSh ( data , length ) { var z = { } ; z . Hidden = data . read _shift ( 4 ) ; z . iTabID = data . read _shift ( 4 ) ; z . strRelID = parse _RelID ( data , length - 8 ) ; z . name = parse _XLWideString ( data ) ; return z } function write _BrtBundleSh ( data , o ) { if ( ! o ) o = new _buf ( 127 ) ; o . write _shift ( 4 , data . Hidden ) ; o . write _shift ( 4 , data . iTabID ) ; write _RelID ( data . strRelID , o ) ; write _XLWideString ( data . name . substr ( 0 , 31 ) , o ) ; return o . length > o . l ? o . slice ( 0 , o . l ) : o } function parse _BrtWbProp ( data , length ) { data . read _shift ( 4 ) ; var dwThemeVersion = data . read _shift ( 4 ) ; var strName = length > 8 ? parse _XLWideString ( data ) : "" ; return [ dwThemeVersion , strName ] } function write _BrtWbProp ( data , o ) { if ( ! o ) o = new _buf ( 68 ) ; o . write _shift ( 4 , 0 ) ; o . write _shift ( 4 , 0 ) ; write _XLSBCodeName ( "ThisWorkbook" , o ) ; return o . slice ( 0 , o . l ) } function parse _BrtFRTArchID$ ( data , length ) { var o = { } ; data . read _shift ( 4 ) ; o . ArchID = data . read _shift ( 4 ) ; data . l += length - 8 ; return o } function parse _BrtName ( data , length , opts ) { var end = data . l + length ; var flags = data . read _shift ( 4 ) ; var chKey = data . read _shift ( 1 ) ; var itab = data . read _shift ( 4 ) ; var name = parse _XLNameWideString ( data ) ; var formula = parse _XLSBNameParsedFormula ( data , 0 , opts ) ; var comment = parse _XLNullableWideString ( data ) ; data . l = end ; var out = { Name : name , Ptg : formula , Comment : comment } ; if ( itab < 268
function write _ws _xlml _cell ( cell , ref , ws , opts , idx , wb , addr ) { if ( ! cell || cell . v == undefined && cell . f == undefined ) return "<Cell></Cell>" ; var attr = { } ; if ( cell . f ) attr [ "ss:Formula" ] = "=" + escapexml ( a1 _to _rc ( cell . f , addr ) ) ; if ( cell . F && cell . F . substr ( 0 , ref . length ) == ref ) { var end = decode _cell ( cell . F . substr ( ref . length + 1 ) ) ; attr [ "ss:ArrayRange" ] = "RC:R" + ( end . r == addr . r ? "" : "[" + ( end . r - addr . r ) + "]" ) + "C" + ( end . c == addr . c ? "" : "[" + ( end . c - addr . c ) + "]" ) } if ( cell . l && cell . l . Target ) { attr [ "ss:HRef" ] = escapexml ( cell . l . Target ) ; if ( cell . l . Tooltip ) attr [ "x:HRefScreenTip" ] = escapexml ( cell . l . Tooltip ) } if ( ws [ "!merges" ] ) { var marr = ws [ "!merges" ] ; for ( var mi = 0 ; mi != marr . length ; ++ mi ) { if ( marr [ mi ] . s . c != addr . c || marr [ mi ] . s . r != addr . r ) continue ; if ( marr [ mi ] . e . c > marr [ mi ] . s . c ) attr [ "ss:MergeAcross" ] = marr [ mi ] . e . c - marr [ mi ] . s . c ; if ( marr [ mi ] . e . r > marr [ mi ] . s . r ) attr [ "ss:MergeDown" ] = marr [ mi ] . e . r - marr [ mi ] . s . r } } var t = "" , p = "" ; switch ( cell . t ) { case "z" : return "" ; case "n" : t = "Number" ; p = String ( cell . v ) ; break ; case "b" : t = "Boolean" ; p = cell . v ? "1" : "0" ; break ; case "e" : t = "Error" ; p = BErr [ cell . v ] ; break ; case "d" : t = "DateTime" ; p = new Date ( cell . v ) . toISOString ( ) ; break ; case "s" : t = "String" ; p = escapexml ( cell . v || "" ) ; break } var _v = cell . v != null ? p : "" ; if ( opts && opts . type == "binary" && typeof cptable !== "undefined" && cell . t == "s" ) { _v = cptable . utils . encode ( 65001 , _v ) ; var _ _v = "" ; for ( var _ _i = 0 ; _ _i < _v . length ; ++ _ _i ) _ _v += String . fromCharCode ( _v [ _ _i ] ) ; _v = _ _v } var m = '<Data ss:Type="' + t + '">' + _v + "</Data>" ; if ( ( cell . c || [ ] ) . length > 0 ) m += write _ws _xlml _comment ( cell . c ) ; return writextag ( "Cell" , m , attr ) } function write _ws _xlml _row ( R , row ) { var o = '<Row ss:Index="' + ( R + 1 ) + '"' ; if ( row ) { if ( row . hpt && ! row . hpx ) row . hpx = pt2px ( row . hpt ) ; if ( row . hpx ) o += ' ss:AutoFitHeight="0" ss:Height="' + row . hpx + '"' ; if ( row . hidden ) o += ' ss:Hidden="1"' } return o + ">" } function write _ws _xlml _table ( ws , opts , idx , wb ) { if ( ! ws [ "!ref" ] ) return "" ; var range = safe _decode _range ( ws [ "!ref" ] ) ; var marr = ws [ "!merges" ] || [ ] , mi = 0 ; var o = [ ] ; if ( ws [ "!cols" ] ) ws [ "!cols" ] . forEach ( function ( n , i ) { process _col ( n ) ; var w = ! ! n . width ; var p = col _obj _w ( i , n ) ; var k = { "ss:Index" : i + 1 } ; if ( w ) k [ "ss:Width" ] = width2px ( p . width ) ; if ( n . hidden ) k [ "ss:Hidden" ] = "1" ; o . push ( writextag ( "Column" , null , k ) ) } ) ; var dense = Array . isArray ( ws ) ; for ( var R = range . s . r ; R <= range . e . r ; ++ R ) { var row = [ write _ws _xlml _row ( R , ( ws [ "!rows" ] || [ ] ) [ R ] ) ] ; for ( var C = range . s . c ; C <= range . e . c ; ++ C ) { var skip = false ; for ( mi = 0 ; mi != marr . length ; ++ mi ) { if ( marr [ mi ] . s . c > C ) continue ; if ( marr [ mi ] . s . r > R ) continue ; if ( marr [ mi ] . e . c < C ) continue ; if ( marr [ mi ] . e . r < R ) continue ; if ( marr [ mi ] . s . c != C || marr [ mi ] . s . r != R ) skip = true ; break } if ( skip ) continue ; var addr = { r : R , c : C } ; var ref = encode _cell ( addr ) , cell = dense ? ( ws [ R ] || [ ] ) [ C ] : ws [ ref ] ; row . push ( write _ws _xlml _cell ( cell , ref , ws , opts , idx , wb , addr ) ) } row . push ( "</Row>" ) ; if ( row . length > 2 ) o . push ( row . join ( "" ) ) } return o . join ( "" ) } function write _ws _xlml ( idx , opts , wb ) { var o = [ ] ; var s = wb . SheetNames [ idx ] ; var ws = wb . Sheets [ s ] ; var t = ws ? write _ws _xlml _table ( ws , opts , idx , wb ) : "" ; if ( t . length > 0 ) o . push ( "<Table>" + t + "</Table>" ) ; o . push ( write _ws _xlml _wsopts ( ws , opts , idx , wb ) ) ; return o . join ( "" ) } function write _xlml ( wb , opts ) { var d = [ ] ; d . push ( write _props _xlml ( wb , opts ) ) ; d . push ( write _wb _xlml ( wb , opts ) ) ; d . push ( write _sty _xlml ( wb , opts ) ) ; for ( var i = 0 ; i < wb . SheetNames . length ; ++ i ) d . push ( writextag ( "Worksheet" , write _ws _xlml ( i , opts , wb ) , { "ss:Name" : escapexml ( wb . SheetNames [ i ] ) } ) ) ; return XML _HEADER + writextag ( "Workbook" , d . join ( "" ) , { xmlns : XLMLNS . ss , "xmlns:o" : XLMLNS . o , "xmlns:x" : XLMLNS . x , "xmlns:ss" : XLMLNS . ss , "xmlns:dt" : XLMLNS . dt , "xmlns:html" : XLMLNS . html } ) } function parse _compobj ( obj ) { var v = { } ; var o = obj . content ; var l = 28 , m ; m = _ _lpstr ( o , l ) ; l += 4 + _ _readUInt32LE ( o , l ) ; v . UserType = m ; m = _ _readUInt32LE ( o , l ) ; l += 4 ; switch ( m ) { case 0 : break ; case 4294967295 : case 4294967294 : l += 4 ; break ; default : if ( m > 400 ) throw new Error ( "Unsupported Clipboard: " + m . toString ( 16 ) ) ; l += m } m = _ _lpstr ( o , l ) ; l += m . length === 0 ? 0 : 5 + m . length ; v . Reserved1 = m ; if ( ( m = _ _readUInt32LE ( o , l ) ) !== 1907550708 ) return v ; throw new Error ( "Unsupported Unicode Extension" ) } function slurp ( R , blob , length , opts ) { var l = length ; var bufs = [ ] ; var d = blob . slice ( blob . l , blob . l + l ) ; if ( opts && opts . enc && opts . enc . insitu _decrypt ) switch ( R . n ) { case "BOF" : case "FilePass" : case "FileLock" : case "InterfaceHdr" : case "RRDInfo" : case "RRDHead" : case "UsrExcl" : break ; default : if ( d . length === 0 ) break ; opts
f : parsenoop } , 283 : { n : "BrtBeginSXVIs" , f : parsenoop } , 284 : { n : "BrtEndSXVIs" , f : parsenoop } , 285 : { n : "BrtBeginSXVD" , f : parsenoop } , 286 : { n : "BrtEndSXVD" , f : parsenoop } , 287 : { n : "BrtBeginSXVDs" , f : parsenoop } , 288 : { n : "BrtEndSXVDs" , f : parsenoop } , 289 : { n : "BrtBeginSXPI" , f : parsenoop } , 290 : { n : "BrtEndSXPI" , f : parsenoop } , 291 : { n : "BrtBeginSXPIs" , f : parsenoop } , 292 : { n : "BrtEndSXPIs" , f : parsenoop } , 293 : { n : "BrtBeginSXDI" , f : parsenoop } , 294 : { n : "BrtEndSXDI" , f : parsenoop } , 295 : { n : "BrtBeginSXDIs" , f : parsenoop } , 296 : { n : "BrtEndSXDIs" , f : parsenoop } , 297 : { n : "BrtBeginSXLI" , f : parsenoop } , 298 : { n : "BrtEndSXLI" , f : parsenoop } , 299 : { n : "BrtBeginSXLIRws" , f : parsenoop } , 300 : { n : "BrtEndSXLIRws" , f : parsenoop } , 301 : { n : "BrtBeginSXLICols" , f : parsenoop } , 302 : { n : "BrtEndSXLICols" , f : parsenoop } , 303 : { n : "BrtBeginSXFormat" , f : parsenoop } , 304 : { n : "BrtEndSXFormat" , f : parsenoop } , 305 : { n : "BrtBeginSXFormats" , f : parsenoop } , 306 : { n : "BrtEndSxFormats" , f : parsenoop } , 307 : { n : "BrtBeginSxSelect" , f : parsenoop } , 308 : { n : "BrtEndSxSelect" , f : parsenoop } , 309 : { n : "BrtBeginISXVDRws" , f : parsenoop } , 310 : { n : "BrtEndISXVDRws" , f : parsenoop } , 311 : { n : "BrtBeginISXVDCols" , f : parsenoop } , 312 : { n : "BrtEndISXVDCols" , f : parsenoop } , 313 : { n : "BrtEndSXLocation" , f : parsenoop } , 314 : { n : "BrtBeginSXLocation" , f : parsenoop } , 315 : { n : "BrtEndSXView" , f : parsenoop } , 316 : { n : "BrtBeginSXTHs" , f : parsenoop } , 317 : { n : "BrtEndSXTHs" , f : parsenoop } , 318 : { n : "BrtBeginSXTH" , f : parsenoop } , 319 : { n : "BrtEndSXTH" , f : parsenoop } , 320 : { n : "BrtBeginISXTHRws" , f : parsenoop } , 321 : { n : "BrtEndISXTHRws" , f : parsenoop } , 322 : { n : "BrtBeginISXTHCols" , f : parsenoop } , 323 : { n : "BrtEndISXTHCols" , f : parsenoop } , 324 : { n : "BrtBeginSXTDMPS" , f : parsenoop } , 325 : { n : "BrtEndSXTDMPs" , f : parsenoop } , 326 : { n : "BrtBeginSXTDMP" , f : parsenoop } , 327 : { n : "BrtEndSXTDMP" , f : parsenoop } , 328 : { n : "BrtBeginSXTHItems" , f : parsenoop } , 329 : { n : "BrtEndSXTHItems" , f : parsenoop } , 330 : { n : "BrtBeginSXTHItem" , f : parsenoop } , 331 : { n : "BrtEndSXTHItem" , f : parsenoop } , 332 : { n : "BrtBeginMetadata" , f : parsenoop } , 333 : { n : "BrtEndMetadata" , f : parsenoop } , 334 : { n : "BrtBeginEsmdtinfo" , f : parsenoop } , 335 : { n : "BrtMdtinfo" , f : parsenoop } , 336 : { n : "BrtEndEsmdtinfo" , f : parsenoop } , 337 : { n : "BrtBeginEsmdb" , f : parsenoop } , 338 : { n : "BrtEndEsmdb" , f : parsenoop } , 339 : { n : "BrtBeginEsfmd" , f : parsenoop } , 340 : { n : "BrtEndEsfmd" , f : parsenoop } , 341 : { n : "BrtBeginSingleCells" , f : parsenoop } , 342 : { n : "BrtEndSingleCells" , f : parsenoop } , 343 : { n : "BrtBeginList" , f : parsenoop } , 344 : { n : "BrtEndList" , f : parsenoop } , 345 : { n : "BrtBeginListCols" , f : parsenoop } , 346 : { n : "BrtEndListCols" , f : parsenoop } , 347 : { n : "BrtBeginListCol" , f : parsenoop } , 348 : { n : "BrtEndListCol" , f : parsenoop } , 349 : { n : "BrtBeginListXmlCPr" , f : parsenoop } , 350 : { n : "BrtEndListXmlCPr" , f : parsenoop } , 351 : { n : "BrtListCCFmla" , f : parsenoop } , 352 : { n : "BrtListTrFmla" , f : parsenoop } , 353 : { n : "BrtBeginExternals" , f : parsenoop } , 354 : { n : "BrtEndExternals" , f : parsenoop } , 355 : { n : "BrtSupBookSrc" , f : parsenoop } , 357 : { n : "BrtSupSelf" , f : parsenoop } , 358 : { n : "BrtSupSame" , f : parsenoop } , 359 : { n : "BrtSupTabs" , f : parsenoop } , 360 : { n : "BrtBeginSupBook" , f : parsenoop } , 361 : { n : "BrtPlaceholderName" , f : parsenoop } , 362 : { n : "BrtExternSheet" , f : parsenoop } , 363 : { n : "BrtExternTableStart" , f : parsenoop } , 364 : { n : "BrtExternTableEnd" , f : parsenoop } , 366 : { n : "BrtExternRowHdr" , f : parsenoop } , 367 : { n : "BrtExternCellBlank" , f : parsenoop } , 368 : { n : "BrtExternCellReal" , f : parsenoop } , 369 : { n : "BrtExternCellBool" , f : parsenoop } , 370 : { n : "BrtExternCellError" , f : parsenoop } , 371 : { n : "BrtExternCellString" , f : parsenoop } , 372 : { n : "BrtBeginEsmdx" , f : parsenoop } , 373 : { n : "BrtEndEsmdx" , f : parsenoop } , 374 : { n : "BrtBeginMdxSet" , f : parsenoop } , 375 : { n : "BrtEndMdxSet" , f : parsenoop } , 376 : { n : "BrtBeginMdxMbrProp" , f : parsenoop } , 377 : { n : "BrtEndMdxMbrProp" , f : parsenoop } , 378 : { n : "BrtBeginMdxKPI" , f : parsenoop } , 379 : { n : "BrtEndMdxKPI" , f : parsenoop } , 380 : { n : "BrtBeginEsstr" , f : parsenoop } , 381 : { n : "BrtEndEsstr" , f : parsenoop } , 382 : { n : "BrtBeginPRFItem" , f : parsenoop } , 383 : { n : "BrtEndPRFItem" , f : parsenoop } , 384 : { n : "BrtBeginPivotCacheIDs" , f : parsenoop } , 385 : { n : "BrtEndPivotCacheIDs" , f : parsenoop } , 386 : { n : "BrtBeginPivotCacheID" , f : parsenoop } , 387 : { n : "BrtEndPivotCacheID" , f : parsenoop } , 388 : { n : "BrtBeginISXVIs" , f : parsenoop } , 389 : { n : "BrtEndISXVIs" , f : parsenoop } , 390 : { n : "BrtBeginColInfos" , f : parsenoop } , 391 : { n : "BrtEndColInfos" , f : parsenoop } , 392 : { n : "BrtBeginRwBrk" , f : parsenoop } , 393 : { n : "BrtEndRwBrk" , f : parsenoop } , 394 : { n : "BrtBeginColBrk" , f : parse
n : "ChartFrtInfo" , f : parse _ChartFrtInfo } , 2129 : { n : "FrtWrapper" , f : parse _FrtWrapper } , 2130 : { n : "StartBlock" , f : parse _StartBlock } , 2131 : { n : "EndBlock" , f : parse _EndBlock } , 2132 : { n : "StartObject" , f : parse _StartObject } , 2133 : { n : "EndObject" , f : parse _EndObject } , 2134 : { n : "CatLab" , f : parse _CatLab } , 2135 : { n : "YMult" , f : parse _YMult } , 2136 : { n : "SXViewLink" , f : parse _SXViewLink } , 2137 : { n : "PivotChartBits" , f : parse _PivotChartBits } , 2138 : { n : "FrtFontList" , f : parse _FrtFontList } , 2146 : { n : "SheetExt" , f : parse _SheetExt } , 2147 : { n : "BookExt" , f : parse _BookExt , r : 12 } , 2148 : { n : "SXAddl" , f : parse _SXAddl } , 2149 : { n : "CrErr" , f : parse _CrErr } , 2150 : { n : "HFPicture" , f : parse _HFPicture } , 2151 : { n : "FeatHdr" , f : parse _FeatHdr } , 2152 : { n : "Feat" , f : parse _Feat } , 2154 : { n : "DataLabExt" , f : parse _DataLabExt } , 2155 : { n : "DataLabExtContents" , f : parse _DataLabExtContents } , 2156 : { n : "CellWatch" , f : parse _CellWatch } , 2161 : { n : "FeatHdr11" , f : parse _FeatHdr11 } , 2162 : { n : "Feature11" , f : parse _Feature11 } , 2164 : { n : "DropDownObjIds" , f : parse _DropDownObjIds } , 2165 : { n : "ContinueFrt11" , f : parse _ContinueFrt11 } , 2166 : { n : "DConn" , f : parse _DConn } , 2167 : { n : "List12" , f : parse _List12 } , 2168 : { n : "Feature12" , f : parse _Feature12 } , 2169 : { n : "CondFmt12" , f : parse _CondFmt12 } , 2170 : { n : "CF12" , f : parse _CF12 } , 2171 : { n : "CFEx" , f : parse _CFEx } , 2172 : { n : "XFCRC" , f : parse _XFCRC , r : 12 } , 2173 : { n : "XFExt" , f : parse _XFExt , r : 12 } , 2174 : { n : "AutoFilter12" , f : parse _AutoFilter12 } , 2175 : { n : "ContinueFrt12" , f : parse _ContinueFrt12 } , 2180 : { n : "MDTInfo" , f : parse _MDTInfo } , 2181 : { n : "MDXStr" , f : parse _MDXStr } , 2182 : { n : "MDXTuple" , f : parse _MDXTuple } , 2183 : { n : "MDXSet" , f : parse _MDXSet } , 2184 : { n : "MDXProp" , f : parse _MDXProp } , 2185 : { n : "MDXKPI" , f : parse _MDXKPI } , 2186 : { n : "MDB" , f : parse _MDB } , 2187 : { n : "PLV" , f : parse _PLV } , 2188 : { n : "Compat12" , f : parse _Compat12 , r : 12 } , 2189 : { n : "DXF" , f : parse _DXF } , 2190 : { n : "TableStyles" , f : parse _TableStyles , r : 12 } , 2191 : { n : "TableStyle" , f : parse _TableStyle } , 2192 : { n : "TableStyleElement" , f : parse _TableStyleElement } , 2194 : { n : "StyleExt" , f : parse _StyleExt } , 2195 : { n : "NamePublish" , f : parse _NamePublish } , 2196 : { n : "NameCmt" , f : parse _NameCmt , r : 12 } , 2197 : { n : "SortData" , f : parse _SortData } , 2198 : { n : "Theme" , f : parse _Theme , r : 12 } , 2199 : { n : "GUIDTypeLib" , f : parse _GUIDTypeLib } , 2200 : { n : "FnGrp12" , f : parse _FnGrp12 } , 2201 : { n : "NameFnGrp12" , f : parse _NameFnGrp12 } , 2202 : { n : "MTRSettings" , f : parse _MTRSettings , r : 12 } , 2203 : { n : "CompressPictures" , f : parse _CompressPictures } , 2204 : { n : "HeaderFooter" , f : parse _HeaderFooter } , 2205 : { n : "CrtLayout12" , f : parse _CrtLayout12 } , 2206 : { n : "CrtMlFrt" , f : parse _CrtMlFrt } , 2207 : { n : "CrtMlFrtContinue" , f : parse _CrtMlFrtContinue } , 2211 : { n : "ForceFullCalculation" , f : parse _ForceFullCalculation } , 2212 : { n : "ShapePropsStream" , f : parse _ShapePropsStream } , 2213 : { n : "TextPropsStream" , f : parse _TextPropsStream } , 2214 : { n : "RichTextStream" , f : parse _RichTextStream } , 2215 : { n : "CrtLayout12A" , f : parse _CrtLayout12A } , 4097 : { n : "Units" , f : parse _Units } , 4098 : { n : "Chart" , f : parse _Chart } , 4099 : { n : "Series" , f : parse _Series } , 4102 : { n : "DataFormat" , f : parse _DataFormat } , 4103 : { n : "LineFormat" , f : parse _LineFormat } , 4105 : { n : "MarkerFormat" , f : parse _MarkerFormat } , 4106 : { n : "AreaFormat" , f : parse _AreaFormat } , 4107 : { n : "PieFormat" , f : parse _PieFormat } , 4108 : { n : "AttachedLabel" , f : parse _AttachedLabel } , 4109 : { n : "SeriesText" , f : parse _SeriesText } , 4116 : { n : "ChartFormat" , f : parse _ChartFormat } , 4117 : { n : "Legend" , f : parse _Legend } , 4118 : { n : "SeriesList" , f : parse _SeriesList } , 4119 : { n : "Bar" , f : parse _Bar } , 4120 : { n : "Line" , f : parse _Line } , 4121 : { n : "Pie" , f : parse _Pie } , 4122 : { n : "Area" , f : parse _Area } , 4123 : { n : "Scatter" , f : parse _Scatter } , 4124 : { n : "CrtLine" , f : parse _CrtLine } , 4125 : { n : "Axis" , f : parse _Axis } , 4126 : { n : "Tick" , f : parse _Tick } , 4127 : { n : "ValueRange" , f : parse _ValueRange } , 4128 : { n : "CatSerRange" , f : parse _CatSerRange } , 4129 : { n : "AxisLine" , f : parse _AxisLine } , 4130 : { n : "CrtLink" , f : parse _CrtLink } , 4132 : { n : "DefaultText" , f : parse _DefaultText } , 4133 : { n : "Text" , f : parse _Text } , 4134 : { n : "FontX" , f : parse _FontX } , 4135 : { n : "ObjectLink" , f : parse _ObjectLink } , 4146 : { n : "Frame" , f : parse _Frame } , 4147 : { n : "Begin" , f : parse _Begin } , 4148 : { n : "End" , f : parse _End } , 4149 : { n : "PlotArea" , f : parse _PlotArea } , 4154 : { n : "Chart3d" , f : parse _Chart3d } , 4156 : { n : "PicF" , f : parse _PicF } , 4157 : { n : "DropBar" , f : parse _DropBar } , 4158 : { n : "Radar" , f : parse _Radar } , 4159 : { n : "Surf" , f : parse _Surf } , 4160 : { n : "RadarArea" , f : parse _RadarArea } , 4161 : { n : "AxisParent" , f : parse _AxisParent } , 41
dir . workbooks . push ( binname ) ; xlsb = true } if ( dir . workbooks [ 0 ] . slice ( - 3 ) == "bin" ) xlsb = true ; if ( xlsb ) set _cp ( 1200 ) ; var themes = { } ; var styles = { } ; if ( ! opts . bookSheets && ! opts . bookProps ) { strs = [ ] ; if ( dir . sst ) strs = parse _sst ( getzipdata ( zip , dir . sst . replace ( /^\// , "" ) ) , dir . sst , opts ) ; if ( opts . cellStyles && dir . themes . length ) themes = parse _theme ( getzipstr ( zip , dir . themes [ 0 ] . replace ( /^\// , "" ) , true ) || "" , dir . themes [ 0 ] , opts ) ; if ( dir . style ) styles = parse _sty ( getzipdata ( zip , dir . style . replace ( /^\// , "" ) ) , dir . style , themes , opts ) } var wb = parse _wb ( getzipdata ( zip , dir . workbooks [ 0 ] . replace ( /^\// , "" ) ) , dir . workbooks [ 0 ] , opts ) ; var props = { } , propdata = "" ; if ( dir . coreprops . length !== 0 ) { propdata = getzipstr ( zip , dir . coreprops [ 0 ] . replace ( /^\// , "" ) , true ) ; if ( propdata ) props = parse _core _props ( propdata ) ; if ( dir . extprops . length !== 0 ) { propdata = getzipstr ( zip , dir . extprops [ 0 ] . replace ( /^\// , "" ) , true ) ; if ( propdata ) parse _ext _props ( propdata , props ) } } var custprops = { } ; if ( ! opts . bookSheets || opts . bookProps ) { if ( dir . custprops . length !== 0 ) { propdata = getzipstr ( zip , dir . custprops [ 0 ] . replace ( /^\// , "" ) , true ) ; if ( propdata ) custprops = parse _cust _props ( propdata , opts ) } } var out = { } ; if ( opts . bookSheets || opts . bookProps ) { if ( wb . Sheets ) sheets = wb . Sheets . map ( function pluck ( x ) { return x . name } ) ; else if ( props . Worksheets && props . SheetNames . length > 0 ) sheets = props . SheetNames ; if ( opts . bookProps ) { out . Props = props ; out . Custprops = custprops } if ( opts . bookSheets && typeof sheets !== "undefined" ) out . SheetNames = sheets ; if ( opts . bookSheets ? out . SheetNames : opts . bookProps ) return out } sheets = { } ; var deps = { } ; if ( opts . bookDeps && dir . calcchain ) deps = parse _cc ( getzipdata ( zip , dir . calcchain . replace ( /^\// , "" ) ) , dir . calcchain , opts ) ; var i = 0 ; var sheetRels = { } ; var path , relsPath ; { var wbsheets = wb . Sheets ; props . Worksheets = wbsheets . length ; props . SheetNames = [ ] ; for ( var j = 0 ; j != wbsheets . length ; ++ j ) { props . SheetNames [ j ] = wbsheets [ j ] . name } } var wbext = xlsb ? "bin" : "xml" ; var wbrelsfile = "xl/_rels/workbook." + wbext + ".rels" ; var wbrels = parse _rels ( getzipstr ( zip , wbrelsfile , true ) , wbrelsfile ) ; if ( wbrels ) wbrels = safe _parse _wbrels ( wbrels , wb . Sheets ) ; var nmode = getzipdata ( zip , "xl/worksheets/sheet.xml" , true ) ? 1 : 0 ; for ( i = 0 ; i != props . Worksheets ; ++ i ) { var stype = "sheet" ; if ( wbrels && wbrels [ i ] ) { path = "xl/" + wbrels [ i ] [ 1 ] . replace ( /[\/]?xl\// , "" ) ; stype = wbrels [ i ] [ 2 ] } else { path = "xl/worksheets/sheet" + ( i + 1 - nmode ) + "." + wbext ; path = path . replace ( /sheet0\./ , "sheet." ) } relsPath = path . replace ( /^(.*)(\/)([^\/]*)$/ , "$1/_rels/$3.rels" ) ; safe _parse _sheet ( zip , path , relsPath , props . SheetNames [ i ] , sheetRels , sheets , stype , opts , wb , themes , styles ) } if ( dir . comments ) parse _comments ( zip , dir . comments , sheets , sheetRels , opts ) ; out = { Directory : dir , Workbook : wb , Props : props , Custprops : custprops , Deps : deps , Sheets : sheets , SheetNames : props . SheetNames , Strings : strs , Styles : styles , Themes : themes , SSF : SSF . get _table ( ) } ; if ( opts . bookFiles ) { out . keys = entries ; out . files = zip . files } if ( opts . bookVBA ) { if ( dir . vba . length > 0 ) out . vbaraw = getzipdata ( zip , dir . vba [ 0 ] . replace ( /^\// , "" ) , true ) ; else if ( dir . defaults && dir . defaults . bin === "application/vnd.ms-office.vbaProject" ) out . vbaraw = getzipdata ( zip , "xl/vbaProject.bin" , true ) } return out } function parse _xlsxcfb ( cfb , opts ) { var f = "Version" ; var data = cfb . find ( f ) ; if ( ! data ) throw new Error ( "ECMA-376 Encrypted file missing " + f ) ; var version = parse _DataSpaceVersionInfo ( data . content ) ; f = "DataSpaceMap" ; data = cfb . find ( f ) ; if ( ! data ) throw new Error ( "ECMA-376 Encrypted file missing " + f ) ; var dsm = parse _DataSpaceMap ( data . content ) ; if ( dsm . length != 1 || dsm [ 0 ] . comps . length != 1 || dsm [ 0 ] . comps [ 0 ] . t != 0 || dsm [ 0 ] . name != "StrongEncryptionDataSpace" || dsm [ 0 ] . comps [ 0 ] . v != "EncryptedPackage" ) throw new Error ( "ECMA-376 Encrypted file bad " + f ) ; f = "StrongEncryptionDataSpace" ; data = cfb . find ( f ) ; if ( ! data ) throw new Error ( "ECMA-376 Encrypted file missing " + f ) ; var seds = parse _DataSpaceDefinition ( data . content ) ; if ( seds . length != 1 || seds [ 0 ] != "StrongEncryptionTransform" ) throw new Error ( "ECMA-376 Encrypted file bad " + f ) ; f = "!Primary" ; data = cfb . find ( f ) ; if ( ! data ) throw new Error ( "ECMA-376 Encrypted file missing " + f ) ; var hdr = parse _Primary ( data . content ) ; f = "EncryptionInfo" ; data = cfb . find ( f ) ; if ( ! data ) throw new Error ( "ECMA-376 Encrypted file missing " + f ) ; var einfo = parse _EncryptionInfo ( data . content ) ; throw new Error ( "File is password-protected" ) } fu