2016-12-31 08:20:45 +00:00
/* xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
2017-04-09 04:03:19 +00:00
var XLSX = { } ; ( function make _xlsx ( XLSX ) { XLSX . version = "0.9.10" ; var current _codepage = 1200 , current _cptable ; if ( typeof module !== "undefined" && typeof require !== "undefined" ) { if ( typeof cptable === "undefined" ) cptable = require ( "./dist/cpexcel.js" ) ; current _cptable = cptable [ current _codepage ] } function reset _cp ( ) { set _cp ( 1200 ) } var set _cp = function ( cp ) { current _codepage = cp } ; function char _codes ( data ) { var o = [ ] ; for ( var i = 0 , len = data . length ; i < len ; ++ i ) o [ i ] = data . charCodeAt ( i ) ; return o } var debom = function ( data ) { var c1 = data . charCodeAt ( 0 ) , c2 = data . charCodeAt ( 1 ) ; if ( c1 == 255 && c2 == 254 ) return data . substr ( 2 ) ; if ( c1 == 254 && c2 == 255 ) return data . substr ( 2 ) ; if ( c1 == 65279 ) return data . substr ( 1 ) ; return data } ; var _getchar = function _gc1 ( x ) { return String . fromCharCode ( x ) } ; if ( typeof cptable !== "undefined" ) { set _cp = function ( cp ) { current _codepage = cp ; current _cptable = cptable [ cp ] } ; debom = function ( data ) { if ( data . charCodeAt ( 0 ) === 255 && data . charCodeAt ( 1 ) === 254 ) { return cptable . utils . decode ( 1200 , char _codes ( data . substr ( 2 ) ) ) } return data } ; _getchar = function _gc2 ( x ) { if ( current _codepage === 1200 ) return String . fromCharCode ( x ) ; return cptable . utils . decode ( current _codepage , [ x & 255 , x >> 8 ] ) [ 0 ] } } var DENSE = null ; var Base64 = function make _b64 ( ) { var map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" ; return { encode : function ( input , utf8 ) { var o = "" ; var c1 , c2 , c3 , e1 , e2 , e3 , e4 ; for ( var i = 0 ; i < input . length ; ) { c1 = input . charCodeAt ( i ++ ) ; c2 = input . charCodeAt ( i ++ ) ; c3 = input . charCodeAt ( i ++ ) ; e1 = c1 >> 2 ; e2 = ( c1 & 3 ) << 4 | c2 >> 4 ; e3 = ( c2 & 15 ) << 2 | c3 >> 6 ; e4 = c3 & 63 ; if ( isNaN ( c2 ) ) { e3 = e4 = 64 } else if ( isNaN ( c3 ) ) { e4 = 64 } o += map . charAt ( e1 ) + map . charAt ( e2 ) + map . charAt ( e3 ) + map . charAt ( e4 ) } return o } , decode : function b64 _decode ( input , utf8 ) { var o = "" ; var c1 , c2 , c3 ; var e1 , e2 , e3 , e4 ; input = input . replace ( /[^A-Za-z0-9\+\/\=]/g , "" ) ; for ( var i = 0 ; i < input . length ; ) { e1 = map . indexOf ( input . charAt ( i ++ ) ) ; e2 = map . indexOf ( input . charAt ( i ++ ) ) ; e3 = map . indexOf ( input . charAt ( i ++ ) ) ; e4 = map . indexOf ( input . charAt ( i ++ ) ) ; c1 = e1 << 2 | e2 >> 4 ; c2 = ( e2 & 15 ) << 4 | e3 >> 2 ; c3 = ( e3 & 3 ) << 6 | e4 ; o += String . fromCharCode ( c1 ) ; if ( e3 != 64 ) { o += String . fromCharCode ( c2 ) } if ( e4 != 64 ) { o += String . fromCharCode ( c3 ) } } return o } } } ( ) ; var has _buf = typeof Buffer !== "undefined" && typeof process !== "undefined" && typeof process . versions !== "undefined" && process . versions . node ; function new _raw _buf ( len ) { return new ( has _buf ? Buffer : Array ) ( len ) } function s2a ( s ) { if ( has _buf ) return new Buffer ( s , "binary" ) ; return s . split ( "" ) . map ( function ( x ) { return x . charCodeAt ( 0 ) & 255 } ) } var bconcat = function ( bufs ) { return [ ] . concat . apply ( [ ] , bufs ) } ; var chr0 = /\u0000/g , chr1 = /[\u0001-\u0006]/ ; var SSF = { } ; var make _ssf = function make _ssf ( SSF ) { SSF . version = "0.9.0" ; function _strrev ( x ) { var o = "" , i = x . length - 1 ; while ( i >= 0 ) o += x . charAt ( i -- ) ; return o } function fill ( c , l ) { var o = "" ; while ( o . length < l ) o += c ; return o } function pad0 ( v , d ) { var t = "" + v ; return t . length >= d ? t : fill ( "0" , d - t . length ) + t } function pad _ ( v , d ) { var t = "" + v ; return t . length >= d ? t : fill ( " " , d - t . length ) + t } function rpad _ ( v , d ) { var t = "" + v ; return t . length >= d ? t : t + fill ( " " , d - t . length ) } function pad0r1 ( v , d ) { var t = "" + Math . round ( v ) ; return t . length >= d ? t : fill ( "0" , d - t . length ) + t } function pad0r2 ( v , d ) { var t = "" + v ; return t . length >= d ? t : fill ( "0" , d - t . length ) + t } var p2 _32 = Math . pow ( 2 , 32 ) ; function pad0r ( v , d ) { if ( v > p2 _32 || v < - p2 _32 ) return pad0r1 ( v , d ) ; var i = Math . round ( v ) ; return pad0r2 ( i , d ) } function isgeneral ( s , i ) { i = i || 0 ; return s . length >= 7 + i && ( s . charCodeAt ( i ) | 32 ) === 103 && ( s . charCodeAt ( i + 1 ) | 32 ) === 101 && ( s . charCodeAt ( i + 2 ) | 32 ) === 110 && ( s . charCodeAt ( i + 3 ) | 32 ) === 101 && ( s . charCodeAt ( i + 4 ) | 32 ) === 114 && ( s . charCodeAt ( i + 5 ) | 32 ) === 97 && ( s . charCodeAt ( i + 6 ) | 32 ) === 108 } var opts _fmt = [ [ "date1904" , 0 ] , [ "output" , "" ] , [ "WTF" , false ] ] ; function fixopts ( o ) { for ( var y = 0 ; y != opts _fmt . length ; ++ y ) if ( o [ opts _fmt [ y ] [ 0 ] ] === undefined ) o [ opts _fmt [ y ] [ 0 ] ] = opts _fmt [ y ] [ 1 ] } SSF . opts = opts _fmt ; var table _fmt = { 0 : "General" , 1 : "0" , 2 : "0.00" , 3 : "#,##0" , 4 : "#,##0.00" , 9 : "0%" , 10 : "0.00%" , 11 : "0.00E+00" , 12 : "# ?/?" , 13 : "# ??/??" , 14 : "m/d/yy" , 15 : "d-mmm-yy" , 16 : "d-mmm" , 17 : "mmm-yy" , 18 : "h:mm AM/PM" , 19 : "h:mm:ss AM/PM" , 20 : "h:mm" , 21 : "h:mm:ss" , 22 : "m/d/yy h:mm" , 37 : "#,##0 ;(#,##0)" , 38 : "#,##0 ;[Red](#,##0)" , 39 : "#,##0.00;(#,##0.00)" , 40 : "#,##0.00;[Red](#,##0.00)" , 45 : "mm:ss" , 46 : "[h]:mm:ss" , 47 : "mmss.0" , 48 : "##0.0E+0" , 49 : "@" , 56 : '"上午/下午 "hh"時"mm"分"ss"秒 "' , 6553
if ( R !== - 1 && dad [ R ] !== R ) dad [ i ] = dad [ R ] } if ( C !== - 1 ) dad [ C ] = i ; if ( L !== - 1 ) { dad [ L ] = dad [ i ] ; q . push ( L ) } if ( R !== - 1 ) { dad [ R ] = dad [ i ] ; q . push ( R ) } } for ( i = 1 ; i !== pl ; ++ i ) if ( dad [ i ] === i ) { if ( R !== - 1 && dad [ R ] !== R ) dad [ i ] = dad [ R ] ; else if ( L !== - 1 && dad [ L ] !== L ) dad [ i ] = dad [ L ] } for ( i = 1 ; i < pl ; ++ i ) { if ( FI [ i ] . type === 0 ) continue ; j = dad [ i ] ; if ( j === 0 ) FP [ i ] = FP [ 0 ] + "/" + FP [ i ] ; else while ( j !== 0 ) { FP [ i ] = FP [ j ] + "/" + FP [ i ] ; j = dad [ j ] } dad [ i ] = 0 } FP [ 0 ] += "/" ; for ( i = 1 ; i < pl ; ++ i ) { if ( FI [ i ] . type !== 2 ) FP [ i ] += "/" ; FPD [ FP [ i ] ] = FI [ i ] } } function make _find _path ( FullPaths , Paths , FileIndex , files , root _name ) { var UCFullPaths = new Array ( FullPaths . length ) ; var UCPaths = new Array ( Paths . length ) , i ; for ( i = 0 ; i < FullPaths . length ; ++ i ) UCFullPaths [ i ] = FullPaths [ i ] . toUpperCase ( ) . replace ( chr0 , "" ) . replace ( chr1 , "!" ) ; for ( i = 0 ; i < Paths . length ; ++ i ) UCPaths [ i ] = Paths [ i ] . toUpperCase ( ) . replace ( chr0 , "" ) . replace ( chr1 , "!" ) ; return function find _path ( path ) { var k ; if ( path . charCodeAt ( 0 ) === 47 ) { k = true ; path = root _name + path } else k = path . indexOf ( "/" ) !== - 1 ; var UCPath = path . toUpperCase ( ) . replace ( chr0 , "" ) . replace ( chr1 , "!" ) ; var w = k === true ? UCFullPaths . indexOf ( UCPath ) : UCPaths . indexOf ( UCPath ) ; if ( w === - 1 ) return null ; return k === true ? FileIndex [ w ] : files [ Paths [ w ] ] } } function sleuth _fat ( idx , cnt , sectors , ssz , fat _addrs ) { var q ; if ( idx === ENDOFCHAIN ) { if ( cnt !== 0 ) throw new Error ( "DIFAT chain shorter than expected" ) } else if ( idx !== - 1 ) { var sector = sectors [ idx ] , m = ( ssz >>> 2 ) - 1 ; if ( ! sector ) return ; for ( var i = 0 ; i < m ; ++ i ) { if ( ( q = _ _readInt32LE ( sector , i * 4 ) ) === ENDOFCHAIN ) break ; fat _addrs . push ( q ) } sleuth _fat ( _ _readInt32LE ( sector , ssz - 4 ) , cnt - 1 , sectors , ssz , fat _addrs ) } } function get _sector _list ( sectors , start , fat _addrs , ssz , chkd ) { var sl = sectors . length ; var buf , buf _chain ; if ( ! chkd ) chkd = new Array ( sl ) ; var modulus = ssz - 1 , j , jj ; buf = [ ] ; buf _chain = [ ] ; for ( j = start ; j >= 0 ; ) { chkd [ j ] = true ; buf [ buf . length ] = j ; buf _chain . push ( sectors [ j ] ) ; var addr = fat _addrs [ Math . floor ( j * 4 / ssz ) ] ; jj = j * 4 & modulus ; if ( ssz < 4 + jj ) throw new Error ( "FAT boundary crossed: " + j + " 4 " + ssz ) ; if ( ! sectors [ addr ] ) break ; j = _ _readInt32LE ( sectors [ addr ] , jj ) } return { nodes : buf , data : _ _toBuffer ( [ buf _chain ] ) } } function make _sector _list ( sectors , dir _start , fat _addrs , ssz ) { var sl = sectors . length , sector _list = new Array ( sl ) ; var chkd = new Array ( sl ) , buf , buf _chain ; var modulus = ssz - 1 , i , j , k , jj ; for ( i = 0 ; i < sl ; ++ i ) { buf = [ ] ; k = i + dir _start ; if ( k >= sl ) k -= sl ; if ( chkd [ k ] === true ) continue ; buf _chain = [ ] ; for ( j = k ; j >= 0 ; ) { chkd [ j ] = true ; buf [ buf . length ] = j ; buf _chain . push ( sectors [ j ] ) ; var addr = fat _addrs [ Math . floor ( j * 4 / ssz ) ] ; jj = j * 4 & modulus ; if ( ssz < 4 + jj ) throw new Error ( "FAT boundary crossed: " + j + " 4 " + ssz ) ; if ( ! sectors [ addr ] ) break ; j = _ _readInt32LE ( sectors [ addr ] , jj ) } sector _list [ k ] = { nodes : buf , data : _ _toBuffer ( [ buf _chain ] ) } } return sector _list } function read _directory ( dir _start , sector _list , sectors , Paths , nmfs , files , FileIndex ) { var blob ; var minifat _store = 0 , pl = Paths . length ? 2 : 0 ; var sector = sector _list [ dir _start ] . data ; var i = 0 , namelen = 0 , name , o , ctime , mtime ; for ( ; i < sector . length ; i += 128 ) { blob = sector . slice ( i , i + 128 ) ; prep _blob ( blob , 64 ) ; namelen = blob . read _shift ( 2 ) ; if ( namelen === 0 ) continue ; name = _ _utf16le ( blob , 0 , namelen - pl ) ; Paths . push ( name ) ; o = { name : name , type : blob . read _shift ( 1 ) , color : blob . read _shift ( 1 ) , L : blob . read _shift ( 4 , "i" ) , R : blob . read _shift ( 4 , "i" ) , C : blob . read _shift ( 4 , "i" ) , clsid : blob . read _shift ( 16 ) , state : blob . read _shift ( 4 , "i" ) } ; ctime = blob . read _shift ( 2 ) + blob . read _shift ( 2 ) + blob . read _shift ( 2 ) + blob . read _shift ( 2 ) ; if ( ctime !== 0 ) { o . ctime = ctime ; o . ct = read _date ( blob , blob . l - 8 ) } mtime = blob . read _shift ( 2 ) + blob . read _shift ( 2 ) + blob . read _shift ( 2 ) + blob . read _shift ( 2 ) ; if ( mtime !== 0 ) { o . mtime = mtime ; o . mt = read _date ( blob , blob . l - 8 ) } o . start = blob . read _shift ( 4 , "i" ) ; o . size = blob . read _shift ( 4 , "i" ) ; if ( o . type === 5 ) { minifat _store = o . start ; if ( nmfs > 0 && minifat _store !== ENDOFCHAIN ) sector _list [ minifat _store ] . name = "!StreamData" } else if ( o . size >= 4096 ) { o . storage = "fat" ; if ( sector _list [ o . start ] === undefined ) sector _list [ o . start ] = get _sector _list ( sectors , o . start , sector _list . fat _addrs , sector _list . ssz ) ; sector _list [ o . start ] . name = o . name ; o . content = sector _list [ o . start ] . data . slice ( 0 , o . size ) ; prep _blob ( o . content , 0 ) } else { o . storage = "minifat" ; if ( minifat _store !== ENDOFCHAIN && o . start !== ENDOFCHAIN ) { o . content = sector _list [ minifat _store ] . data . slice ( o . start * MSSZ , o . start * MSSZ + o . size ) ; prep _blob ( o . content , 0 ) } } files [ name ] = o ; FileIndex . p
} , 16 : { n : "LinksDirty" , t : VT _BOOL } , 17 : { n : "CharacterCount" , t : VT _I4 } , 19 : { n : "SharedDoc" , t : VT _BOOL } , 22 : { n : "HLinksChanged" , t : VT _BOOL } , 23 : { n : "AppVersion" , t : VT _I4 , p : "version" } , 26 : { n : "ContentType" , t : VT _STRING } , 27 : { n : "ContentStatus" , t : VT _STRING } , 28 : { n : "Language" , t : VT _STRING } , 29 : { n : "Version" , t : VT _STRING } , 255 : { } } ; var SummaryPIDSI = { 1 : { n : "CodePage" , t : VT _I2 } , 2 : { n : "Title" , t : VT _STRING } , 3 : { n : "Subject" , t : VT _STRING } , 4 : { n : "Author" , t : VT _STRING } , 5 : { n : "Keywords" , t : VT _STRING } , 6 : { n : "Comments" , t : VT _STRING } , 7 : { n : "Template" , t : VT _STRING } , 8 : { n : "LastAuthor" , t : VT _STRING } , 9 : { n : "RevNumber" , t : VT _STRING } , 10 : { n : "EditTime" , t : VT _FILETIME } , 11 : { n : "LastPrinted" , t : VT _FILETIME } , 12 : { n : "CreatedDate" , t : VT _FILETIME } , 13 : { n : "ModifiedDate" , t : VT _FILETIME } , 14 : { n : "PageCount" , t : VT _I4 } , 15 : { n : "WordCount" , t : VT _I4 } , 16 : { n : "CharCount" , t : VT _I4 } , 17 : { n : "Thumbnail" , t : VT _CF } , 18 : { n : "ApplicationName" , t : VT _LPSTR } , 19 : { n : "DocumentSecurity" , t : VT _I4 } , 255 : { } } ; var SpecialProperties = { 2147483648 : { n : "Locale" , t : VT _UI4 } , 2147483651 : { n : "Behavior" , t : VT _UI4 } , 1919054434 : { } } ; ( function ( ) { for ( var y in SpecialProperties ) if ( SpecialProperties . hasOwnProperty ( y ) ) DocSummaryPIDDSI [ y ] = SummaryPIDSI [ y ] = SpecialProperties [ y ] } ) ( ) ; var CountryEnum = { 1 : "US" , 2 : "CA" , 3 : "" , 7 : "RU" , 20 : "EG" , 30 : "GR" , 31 : "NL" , 32 : "BE" , 33 : "FR" , 34 : "ES" , 36 : "HU" , 39 : "IT" , 41 : "CH" , 43 : "AT" , 44 : "GB" , 45 : "DK" , 46 : "SE" , 47 : "NO" , 48 : "PL" , 49 : "DE" , 52 : "MX" , 55 : "BR" , 61 : "AU" , 64 : "NZ" , 66 : "TH" , 81 : "JP" , 82 : "KR" , 84 : "VN" , 86 : "CN" , 90 : "TR" , 105 : "JS" , 213 : "DZ" , 216 : "MA" , 218 : "LY" , 351 : "PT" , 354 : "IS" , 358 : "FI" , 420 : "CZ" , 886 : "TW" , 961 : "LB" , 962 : "JO" , 963 : "SY" , 964 : "IQ" , 965 : "KW" , 966 : "SA" , 971 : "AE" , 972 : "IL" , 974 : "QA" , 981 : "IR" , 65535 : "US" } ; var XLSFillPattern = [ null , "solid" , "mediumGray" , "darkGray" , "lightGray" , "darkHorizontal" , "darkVertical" , "darkDown" , "darkUp" , "darkGrid" , "darkTrellis" , "lightHorizontal" , "lightVertical" , "lightDown" , "lightUp" , "lightGrid" , "lightTrellis" , "gray125" , "gray0625" ] ; function rgbify ( arr ) { return arr . map ( function ( x ) { return [ x >> 16 & 255 , x >> 8 & 255 , x & 255 ] } ) } var XLSIcv = rgbify ( [ 0 , 16777215 , 16711680 , 65280 , 255 , 16776960 , 16711935 , 65535 , 0 , 16777215 , 16711680 , 65280 , 255 , 16776960 , 16711935 , 65535 , 8388608 , 32768 , 128 , 8421376 , 8388736 , 32896 , 12632256 , 8421504 , 10066431 , 10040166 , 16777164 , 13434879 , 6684774 , 16744576 , 26316 , 13421823 , 128 , 16711935 , 16776960 , 65535 , 8388736 , 8388608 , 32896 , 255 , 52479 , 13434879 , 13434828 , 16777113 , 10079487 , 16751052 , 13408767 , 16764057 , 3368703 , 3394764 , 10079232 , 16763904 , 16750848 , 16737792 , 6710937 , 9868950 , 13158 , 3381606 , 13056 , 3355392 , 10040064 , 10040166 , 3355545 , 3355443 , 16777215 , 0 ] ) ; var ct2type = { "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" : "workbooks" , "application/vnd.ms-excel.binIndexWs" : "TODO" , "application/vnd.ms-excel.intlmacrosheet" : "TODO" , "application/vnd.ms-excel.binIndexMs" : "TODO" , "application/vnd.openxmlformats-package.core-properties+xml" : "coreprops" , "application/vnd.openxmlformats-officedocument.custom-properties+xml" : "custprops" , "application/vnd.openxmlformats-officedocument.extended-properties+xml" : "extprops" , "application/vnd.openxmlformats-officedocument.customXmlProperties+xml" : "TODO" , "application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty" : "TODO" , "application/vnd.ms-excel.pivotTable" : "TODO" , "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml" : "TODO" , "application/vnd.ms-office.chartcolorstyle+xml" : "TODO" , "application/vnd.ms-office.chartstyle+xml" : "TODO" , "application/vnd.ms-excel.calcChain" : "calcchains" , "application/vnd.openxmlformats-officedocument.spreadsheetml.calcChain+xml" : "calcchains" , "application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings" : "TODO" , "application/vnd.ms-office.activeX" : "TODO" , "application/vnd.ms-office.activeX+xml" : "TODO" , "application/vnd.ms-excel.attachedToolbars" : "TODO" , "application/vnd.ms-excel.connections" : "TODO" , "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml" : "TODO" , "application/vnd.ms-excel.externalLink" : "TODO" , "application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml" : "TODO" , "application/vnd.ms-excel.sheetMetadata" : "TODO" , "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml" : "TODO" , " application / vnd . ms - exc
length -= 16 ; switch ( clsid ) { case "e0c9ea79f9bace118c8200aa004ba90b" : return parse _URLMoniker ( blob , length ) ; case "0303000000000000c000000000000046" : return parse _FileMoniker ( blob , length ) ; default : throw new Error ( "Unsupported Moniker " + clsid ) } } ; var parse _HyperlinkString = function ( blob , length ) { var len = blob . read _shift ( 4 ) ; var o = blob . read _shift ( len , "utf16le" ) . replace ( chr0 , "" ) ; return o } ; var parse _Hyperlink = function ( blob , length ) { var end = blob . l + length ; var sVer = blob . read _shift ( 4 ) ; if ( sVer !== 2 ) throw new Error ( "Unrecognized streamVersion: " + sVer ) ; var flags = blob . read _shift ( 2 ) ; blob . l += 2 ; var displayName , targetFrameName , moniker , oleMoniker , location , guid , fileTime ; if ( flags & 16 ) displayName = parse _HyperlinkString ( blob , end - blob . l ) ; if ( flags & 128 ) targetFrameName = parse _HyperlinkString ( blob , end - blob . l ) ; if ( ( flags & 257 ) === 257 ) moniker = parse _HyperlinkString ( blob , end - blob . l ) ; if ( ( flags & 257 ) === 1 ) oleMoniker = parse _HyperlinkMoniker ( blob , end - blob . l ) ; if ( flags & 8 ) location = parse _HyperlinkString ( blob , end - blob . l ) ; if ( flags & 32 ) guid = blob . read _shift ( 16 ) ; if ( flags & 64 ) fileTime = parse _FILETIME ( blob , 8 ) ; blob . l = end ; var target = targetFrameName || moniker || oleMoniker ; if ( location ) target += "#" + location ; return { Target : target } } ; function parse _LongRGBA ( blob , length ) { var r = blob . read _shift ( 1 ) , g = blob . read _shift ( 1 ) , b = blob . read _shift ( 1 ) , a = blob . read _shift ( 1 ) ; return [ r , g , b , a ] } function parse _LongRGB ( blob , length ) { var x = parse _LongRGBA ( blob , length ) ; x [ 3 ] = 0 ; return x } function parse _XLSCell ( blob , length ) { var rw = blob . read _shift ( 2 ) ; var col = blob . read _shift ( 2 ) ; var ixfe = blob . read _shift ( 2 ) ; return { r : rw , c : col , ixfe : ixfe } } function parse _frtHeader ( blob ) { var rt = blob . read _shift ( 2 ) ; var flags = blob . read _shift ( 2 ) ; blob . l += 8 ; return { type : rt , flags : flags } } function parse _OptXLUnicodeString ( blob , length , opts ) { return length === 0 ? "" : parse _XLUnicodeString2 ( blob , length , opts ) } var HIDEOBJENUM = [ "SHOWALL" , "SHOWPLACEHOLDER" , "HIDEALL" ] ; var parse _HideObjEnum = parseuint16 ; function parse _XTI ( blob , length ) { var iSupBook = blob . read _shift ( 2 ) , itabFirst = blob . read _shift ( 2 , "i" ) , itabLast = blob . read _shift ( 2 , "i" ) ; return [ iSupBook , itabFirst , itabLast ] } function parse _RkRec ( blob , length ) { var ixfe = blob . read _shift ( 2 ) ; var RK = parse _RkNumber ( blob ) ; return [ ixfe , RK ] } function parse _AddinUdf ( blob , length , opts ) { blob . l += 4 ; length -= 4 ; var l = blob . l + length ; var udfName = parse _ShortXLUnicodeString ( blob , length , opts ) ; var cb = blob . read _shift ( 2 ) ; l -= blob . l ; if ( cb !== l ) throw new Error ( "Malformed AddinUdf: padding = " + l + " != " + cb ) ; blob . l += cb ; return udfName } function parse _Ref8U ( blob , length ) { var rwFirst = blob . read _shift ( 2 ) ; var rwLast = blob . read _shift ( 2 ) ; var colFirst = blob . read _shift ( 2 ) ; var colLast = blob . read _shift ( 2 ) ; return { s : { c : colFirst , r : rwFirst } , e : { c : colLast , r : rwLast } } } function parse _RefU ( blob , length ) { var rwFirst = blob . read _shift ( 2 ) ; var rwLast = blob . read _shift ( 2 ) ; var colFirst = blob . read _shift ( 1 ) ; var colLast = blob . read _shift ( 1 ) ; return { s : { c : colFirst , r : rwFirst } , e : { c : colLast , r : rwLast } } } var parse _Ref = parse _RefU ; function parse _FtCmo ( blob , length ) { blob . l += 4 ; var ot = blob . read _shift ( 2 ) ; var id = blob . read _shift ( 2 ) ; var flags = blob . read _shift ( 2 ) ; blob . l += 12 ; return [ id , ot , flags ] } function parse _FtNts ( blob , length ) { var out = { } ; blob . l += 4 ; blob . l += 16 ; out . fSharedNote = blob . read _shift ( 2 ) ; blob . l += 4 ; return out } function parse _FtCf ( blob , length ) { var out = { } ; blob . l += 4 ; blob . cf = blob . read _shift ( 2 ) ; return out } var FtTab = { 21 : parse _FtCmo , 19 : parsenoop , 18 : function ( blob , length ) { blob . l += 12 } , 17 : function ( blob , length ) { blob . l += 8 } , 16 : parsenoop , 15 : parsenoop , 13 : parse _FtNts , 12 : function ( blob , length ) { blob . l += 24 } , 11 : function ( blob , length ) { blob . l += 10 } , 10 : function ( blob , length ) { blob . l += 16 } , 9 : parsenoop , 8 : function ( blob , length ) { blob . l += 6 } , 7 : parse _FtCf , 6 : function ( blob , length ) { blob . l += 6 } , 4 : parsenoop , 0 : function ( blob , length ) { blob . l += 4 } } ; function parse _FtArray ( blob , length , ot ) { var s = blob . l ; var fts = [ ] ; while ( blob . l < s + length ) { var ft = blob . read _shift ( 2 ) ; blob . l -= 2 ; try { fts . push ( FtTab [ ft ] ( blob , s + length - blob . l ) ) } catch ( e ) { blob . l = s + length ; return fts } } if ( blob . l != s + length ) blob . l = s + length ; return fts } var parse _FontIndex = parseuint16 ; function parse _BOF ( blob , length ) { var o = { BIFFVer : 0 , dt : 0 } ; o . BIFFVer = blob . read _shift ( 2 ) ; length -= 2 ; if ( length >= 2 ) { o . dt = blob . read _shift ( 2 ) ; blob . l -= 2 } switch ( o . BIFFVer ) { case 1536 :
arr [ R ] [ C ++ ] = data !== "" ? data : null ; break } if ( data === "EOD" ) break } return arr } function dif _to _sheet ( str , opts ) { return aoa _to _sheet ( dif _to _aoa ( str , opts ) , opts ) } function dif _to _workbook ( str , opts ) { return sheet _to _workbook ( dif _to _sheet ( str , opts ) , opts ) } var sheet _to _dif = function ( ) { var push _field = function pf ( o , topic , v , n , s ) { o . push ( topic ) ; o . push ( v + "," + n ) ; o . push ( '"' + s . replace ( /"/g , '""' ) + '"' ) } ; var push _value = function po ( o , type , v , s ) { o . push ( type + "," + v ) ; o . push ( type == 1 ? '"' + s . replace ( /"/g , '""' ) + '"' : s ) } ; return function sheet _to _dif ( ws , opts ) { var o = [ ] ; var r = decode _range ( ws [ "!ref" ] ) , cell ; var dense = Array . isArray ( ws ) ; push _field ( o , "TABLE" , 0 , 1 , "sheetjs" ) ; push _field ( o , "VECTORS" , 0 , r . e . r - r . s . r + 1 , "" ) ; push _field ( o , "TUPLES" , 0 , r . e . c - r . s . c + 1 , "" ) ; push _field ( o , "DATA" , 0 , 0 , "" ) ; for ( var R = r . s . r ; R <= r . e . r ; ++ R ) { push _value ( o , - 1 , 0 , "BOT" ) ; for ( var C = r . s . c ; C <= r . e . c ; ++ C ) { var coord = encode _cell ( { r : R , c : C } ) ; cell = dense ? ( ws [ R ] || [ ] ) [ C ] : ws [ coord ] ; if ( ! cell || cell . v == null ) { push _value ( o , 1 , 0 , "" ) ; continue } switch ( cell . t ) { case "n" : push _value ( o , 0 , cell . v , "V" ) ; break ; case "b" : push _value ( o , 0 , cell . v ? 1 : 0 , cell . v ? "TRUE" : "FALSE" ) ; break ; case "s" : push _value ( o , 1 , 0 , cell . v ) ; break ; default : push _value ( o , 1 , 0 , "" ) } } } push _value ( o , - 1 , 0 , "EOD" ) ; var RS = "\r\n" ; var oo = o . join ( RS ) ; return oo } } ( ) ; return { to _workbook : dif _to _workbook , to _sheet : dif _to _sheet , from _sheet : sheet _to _dif } } ( ) ; var PRN = function ( ) { function set _text _arr ( data , arr , R , C ) { if ( data === "TRUE" ) arr [ R ] [ C ] = true ; else if ( data === "FALSE" ) arr [ R ] [ C ] = false ; else if ( data === "" ) { } else if ( + data == + data ) arr [ R ] [ C ] = + data ; else arr [ R ] [ C ] = data } function prn _to _aoa _str ( f , opts ) { var arr = [ ] ; if ( ! f || f . length === 0 ) return arr ; var lines = f . split ( /[\r\n]/ ) ; var L = lines . length - 1 ; while ( L >= 0 && lines [ L ] . length === 0 ) -- L ; var start = 10 , idx = 0 ; var R = 0 ; for ( ; R <= L ; ++ R ) { idx = lines [ R ] . indexOf ( " " ) ; if ( idx == - 1 ) idx = lines [ R ] . length ; else idx ++ ; start = Math . max ( start , idx ) } for ( R = 0 ; R <= L ; ++ R ) { arr [ R ] = [ ] ; var C = 0 ; set _text _arr ( lines [ R ] . slice ( 0 , start ) . trim ( ) , arr , R , C ) ; for ( C = 1 ; C <= ( lines [ R ] . length - start ) / 10 + 1 ; ++ C ) set _text _arr ( lines [ R ] . slice ( start + ( C - 1 ) * 10 , start + C * 10 ) . trim ( ) , arr , R , C ) } return arr } function dsv _to _sheet _str ( str , opts ) { var o = opts || { } ; var sep = "" ; if ( DENSE != null && o . dense == null ) o . dense = DENSE ; var ws = o . dense ? [ ] : { } ; var range = { s : { c : 0 , r : 0 } , e : { c : 0 , r : 0 } } ; if ( str . substr ( 0 , 4 ) == "sep=" && str . charCodeAt ( 5 ) == 10 ) { sep = str . charAt ( 4 ) ; str = str . substr ( 6 ) } if ( str . substr ( 0 , 1024 ) . indexOf ( "\t" ) == - 1 ) sep = "," ; else sep = "\t" ; var R = 0 , C = 0 , v = 0 ; var start = 0 , end = 0 , sepcc = sep . charCodeAt ( 0 ) , instr = false , cc = 0 ; str = str . replace ( /\r\n/g , "\n" ) ; for ( ; end < str . length ; ++ end ) switch ( cc = str . charCodeAt ( end ) ) { case 34 : instr = ! instr ; break ; case sepcc : case 10 : if ( instr ) break ; var s = str . slice ( start , end ) ; var cell = { } ; if ( s . charCodeAt ( 0 ) == 61 ) { cell . t = "n" ; cell . f = s . substr ( 1 ) } else if ( s == "TRUE" ) { cell . t = "b" ; cell . v = true } else if ( s == "FALSE" ) { cell . t = "b" ; cell . v = false } else if ( ! isNaN ( v = parseFloat ( s ) ) ) { cell . t = "n" ; cell . w = s ; cell . v = v } else { cell . t = "s" ; cell . v = s . replace ( /^"/ , "" ) . replace ( /"$/ , "" ) . replace ( /""/g , '"' ) } if ( o . dense ) { if ( ! ws [ R ] ) ws [ R ] = [ ] ; ws [ R ] [ C ] = cell } else ws [ encode _cell ( { c : C , r : R } ) ] = cell ; start = end + 1 ; if ( range . e . c < C ) range . e . c = C ; if ( range . e . r < R ) range . e . r = R ; if ( cc == sepcc ) ++ C ; else { C = 0 ; ++ R } break ; default : break } ws [ "!ref" ] = encode _range ( range ) ; return ws } function prn _to _sheet _str ( str , opts ) { if ( str . substr ( 0 , 4 ) == "sep=" ) return dsv _to _sheet _str ( str , opts ) ; if ( str . indexOf ( "\t" ) >= 0 || str . indexOf ( "," ) >= 0 ) return dsv _to _sheet _str ( str , opts ) ; return aoa _to _sheet ( prn _to _aoa _str ( str , opts ) , opts ) } function prn _to _sheet ( d , opts ) { switch ( opts . type ) { case "base64" : return prn _to _sheet _str ( Base64 . decode ( d ) , opts ) ; case "binary" : return prn _to _sheet _str ( d , opts ) ; case "buffer" : return prn _to _sheet _str ( d . toString ( "binary" ) , opts ) ; case "array" : return prn _to _sheet _str ( cc2str ( d ) , opts ) } throw new Error ( "Unrecognized type " + opts . type ) } function prn _to _workbook ( str , opts ) { return sheet _to _workbook ( prn _to _sheet ( str , opts ) , opts ) } function sheet _to _prn ( ws , opts ) { var o = [ ] ; var r = decode _range ( ws [ "!ref" ] ) , cell ; var dense = Array . isArray ( ws ) ; for ( var R = r . s . r ; R <= r . e . r ; ++ R ) { var oo = [ ] ; for ( var C = r . s . c ; C <= r . e . c ; ++ C ) { var coord = encode _cell ( { r : R , c : C } ) ; cell = dense ? ( ws [ R ] || [ ] ) [ C ] : ws [ coord ] ; if ( ! cell || cell . v == null ) { oo . push ( " " ) ; continue } var w = ( cell . w || ( format _cell ( cell ) , cell . w ) || "" ) . substr ( 0 , 10 ) ; wh
out . bCharSet = data . read _shift ( 1 ) ; data . l ++ ; out . brtColor = parse _BrtColor ( data , 8 ) ; out . bFontScheme = data . read _shift ( 1 ) ; out . name = parse _XLWideString ( data , length - 21 ) ; out . flags . Bold = out . bls === 700 ; out . flags . Italic = out . grbit . fItalic ; out . flags . Strikeout = out . grbit . fStrikeout ; out . flags . Outline = out . grbit . fOutline ; out . flags . Shadow = out . grbit . fShadow ; out . flags . Condense = out . grbit . fCondense ; out . flags . Extend = out . grbit . fExtend ; out . flags . Sub = out . sss & 2 ; out . flags . Sup = out . sss & 1 ; return out } function parse _BrtXF ( data , length ) { var ixfeParent = data . read _shift ( 2 ) ; var ifmt = data . read _shift ( 2 ) ; parsenoop ( data , length - 4 ) ; return { ixfe : ixfeParent , ifmt : ifmt } } function parse _sty _bin ( data , themes , opts ) { var styles = { } ; styles . NumberFmt = [ ] ; for ( var y in SSF . _table ) styles . NumberFmt [ y ] = SSF . _table [ y ] ; styles . CellXf = [ ] ; var state = [ ] ; var pass = false ; recordhopper ( data , function hopper _sty ( val , R _n , RT ) { switch ( RT ) { case 44 : styles . NumberFmt [ val [ 0 ] ] = val [ 1 ] ; SSF . load ( val [ 1 ] , val [ 0 ] ) ; break ; case 43 : break ; case 1025 : break ; case 45 : break ; case 46 : break ; case 47 : if ( state [ state . length - 1 ] == "BrtBeginCellXFs" ) { styles . CellXf . push ( val ) } break ; case 48 : case 507 : case 572 : case 475 : break ; case 1171 : case 2102 : case 1130 : case 512 : case 2095 : break ; case 35 : pass = true ; break ; case 36 : pass = false ; break ; case 37 : state . push ( R _n ) ; break ; case 38 : state . pop ( ) ; break ; default : if ( ( R _n || "" ) . indexOf ( "Begin" ) > 0 ) state . push ( R _n ) ; else if ( ( R _n || "" ) . indexOf ( "End" ) > 0 ) state . pop ( ) ; else if ( ! pass || opts . WTF ) throw new Error ( "Unexpected record " + RT + " " + R _n ) } } ) ; return styles } function write _sty _bin ( data , opts ) { var ba = buf _array ( ) ; write _record ( ba , "BrtBeginStyleSheet" ) ; write _record ( ba , "BrtEndStyleSheet" ) ; return ba . end ( ) } RELS . THEME = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" ; function parse _clrScheme ( t , themes , opts ) { themes . themeElements . clrScheme = [ ] ; var color = { } ; ( t [ 0 ] . match ( tagregex ) || [ ] ) . forEach ( function ( x ) { var y = parsexmltag ( x ) ; switch ( y [ 0 ] ) { case "<a:clrScheme" : case "</a:clrScheme>" : break ; case "<a:srgbClr" : color . rgb = y . val ; break ; case "<a:sysClr" : color . rgb = y . lastClr ; break ; case "<a:dk1>" : case "</a:dk1>" : case "<a:dk2>" : case "</a:dk2>" : case "<a:lt1>" : case "</a:lt1>" : case "<a:lt2>" : case "</a:lt2>" : case "<a:accent1>" : case "</a:accent1>" : case "<a:accent2>" : case "</a:accent2>" : case "<a:accent3>" : case "</a:accent3>" : case "<a:accent4>" : case "</a:accent4>" : case "<a:accent5>" : case "</a:accent5>" : case "<a:accent6>" : case "</a:accent6>" : case "<a:hlink>" : case "</a:hlink>" : case "<a:folHlink>" : case "</a:folHlink>" : if ( y [ 0 ] [ 1 ] === "/" ) { themes . themeElements . clrScheme . push ( color ) ; color = { } } else { color . name = y [ 0 ] . substring ( 3 , y [ 0 ] . length - 1 ) } break ; default : if ( opts && opts . WTF ) throw new Error ( "Unrecognized " + y [ 0 ] + " in clrScheme" ) } } ) } function parse _fontScheme ( t , themes , opts ) { } function parse _fmtScheme ( t , themes , opts ) { } var clrsregex = /<a:clrScheme([^>]*)>[^\u2603]*<\/a:clrScheme>/ ; var fntsregex = /<a:fontScheme([^>]*)>[^\u2603]*<\/a:fontScheme>/ ; var fmtsregex = /<a:fmtScheme([^>]*)>[^\u2603]*<\/a:fmtScheme>/ ; function parse _themeElements ( data , themes , opts ) { themes . themeElements = { } ; var t ; [ [ "clrScheme" , clrsregex , parse _clrScheme ] , [ "fontScheme" , fntsregex , parse _fontScheme ] , [ "fmtScheme" , fmtsregex , parse _fmtScheme ] ] . forEach ( function ( m ) { if ( ! ( t = data . match ( m [ 1 ] ) ) ) throw new Error ( m [ 0 ] + " not found in themeElements" ) ; m [ 2 ] ( t , themes , opts ) } ) } var themeltregex = /<a:themeElements([^>]*)>[^\u2603]*<\/a:themeElements>/ ; function parse _theme _xml ( data , opts ) { if ( ! data || data . length === 0 ) return parse _theme _xml ( write _theme ( ) ) ; var t ; var themes = { } ; if ( ! ( t = data . match ( themeltregex ) ) ) throw new Error ( "themeElements not found in theme" ) ; parse _themeElements ( t [ 0 ] , themes , opts ) ; return themes } function write _theme ( Themes , opts ) { var o = [ XML _HEADER ] ; o [ o . length ] = '<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme">' ; o [ o . length ] = "<a:themeElements>" ; o [ o . length ] = '<a:clrScheme name="Office">' ; o [ o . length ] = '<a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1>' ; o [ o . length ] = '<a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1>' ; o [ o . length ] = '<a:dk2><a:srgbClr val="1F497D"/></a:dk2>' ; o [ o . length ] = '<a:lt2><a:srgbClr val="EEECE1"/></a:lt2>' ; o [ o . length ] = '<a:accent1><a:srgbClr val="4F81BD"/></a:accent1>' ; o [ o . length ] = '
function parse _PtgNameX ( blob , length , opts ) { if ( opts . biff == 5 ) return parse _PtgNameX _BIFF5 ( blob , length , opts ) ; var type = blob . read _shift ( 1 ) >>> 5 & 3 ; var ixti = blob . read _shift ( 2 ) ; var nameindex = blob . read _shift ( 4 ) ; return [ type , ixti , nameindex ] } function parse _PtgNameX _BIFF5 ( blob , length , opts ) { var type = blob . read _shift ( 1 ) >>> 5 & 3 ; var ixti = blob . read _shift ( 2 , "i" ) ; blob . l += 8 ; var nameindex = blob . read _shift ( 2 ) ; blob . l += 12 ; return [ type , ixti , nameindex ] } function parse _PtgMemArea ( blob , length , opts ) { var type = blob . read _shift ( 1 ) >>> 5 & 3 ; blob . l += opts && opts . biff == 2 ? 3 : 4 ; var cce = blob . read _shift ( opts && opts . biff == 2 ? 1 : 2 ) ; return [ type , cce ] } function parse _PtgMemFunc ( blob , length , opts ) { var type = blob . read _shift ( 1 ) >>> 5 & 3 ; var cce = blob . read _shift ( opts && opts . biff == 2 ? 1 : 2 ) ; return [ type , cce ] } function parse _PtgRefErr ( blob , length , opts ) { var type = blob . read _shift ( 1 ) >>> 5 & 3 ; blob . l += 4 ; if ( opts . biff == 12 ) blob . l += 2 ; return [ type ] } function parse _PtgRefErr3d ( blob , length , opts ) { var type = ( blob [ blob . l ++ ] & 96 ) >> 5 ; var ixti = blob . read _shift ( 2 ) ; var w = 4 ; if ( opts ) switch ( opts . biff ) { case 5 : throw new Error ( "PtgRefErr3d -- 5" ) ; case 12 : w = 6 ; break } blob . l += w ; return [ type , ixti ] } var parse _PtgAdd = parseread1 ; var parse _PtgDiv = parseread1 ; var parse _PtgEq = parseread1 ; var parse _PtgGe = parseread1 ; var parse _PtgGt = parseread1 ; var parse _PtgIsect = parseread1 ; var parse _PtgLe = parseread1 ; var parse _PtgLt = parseread1 ; var parse _PtgMissArg = parseread1 ; var parse _PtgMul = parseread1 ; var parse _PtgNe = parseread1 ; var parse _PtgParen = parseread1 ; var parse _PtgPercent = parseread1 ; var parse _PtgPower = parseread1 ; var parse _PtgRange = parseread1 ; var parse _PtgSub = parseread1 ; var parse _PtgUminus = parseread1 ; var parse _PtgUnion = parseread1 ; var parse _PtgUplus = parseread1 ; var parse _PtgMemErr = parsenoop ; var parse _PtgMemNoMem = parsenoop ; var parse _PtgTbl = parsenoop ; var PtgTypes = { 1 : { n : "PtgExp" , f : parse _PtgExp } , 2 : { n : "PtgTbl" , f : parse _PtgTbl } , 3 : { n : "PtgAdd" , f : parse _PtgAdd } , 4 : { n : "PtgSub" , f : parse _PtgSub } , 5 : { n : "PtgMul" , f : parse _PtgMul } , 6 : { n : "PtgDiv" , f : parse _PtgDiv } , 7 : { n : "PtgPower" , f : parse _PtgPower } , 8 : { n : "PtgConcat" , f : parse _PtgConcat } , 9 : { n : "PtgLt" , f : parse _PtgLt } , 10 : { n : "PtgLe" , f : parse _PtgLe } , 11 : { n : "PtgEq" , f : parse _PtgEq } , 12 : { n : "PtgGe" , f : parse _PtgGe } , 13 : { n : "PtgGt" , f : parse _PtgGt } , 14 : { n : "PtgNe" , f : parse _PtgNe } , 15 : { n : "PtgIsect" , f : parse _PtgIsect } , 16 : { n : "PtgUnion" , f : parse _PtgUnion } , 17 : { n : "PtgRange" , f : parse _PtgRange } , 18 : { n : "PtgUplus" , f : parse _PtgUplus } , 19 : { n : "PtgUminus" , f : parse _PtgUminus } , 20 : { n : "PtgPercent" , f : parse _PtgPercent } , 21 : { n : "PtgParen" , f : parse _PtgParen } , 22 : { n : "PtgMissArg" , f : parse _PtgMissArg } , 23 : { n : "PtgStr" , f : parse _PtgStr } , 28 : { n : "PtgErr" , f : parse _PtgErr } , 29 : { n : "PtgBool" , f : parse _PtgBool } , 30 : { n : "PtgInt" , f : parse _PtgInt } , 31 : { n : "PtgNum" , f : parse _PtgNum } , 32 : { n : "PtgArray" , f : parse _PtgArray } , 33 : { n : "PtgFunc" , f : parse _PtgFunc } , 34 : { n : "PtgFuncVar" , f : parse _PtgFuncVar } , 35 : { n : "PtgName" , f : parse _PtgName } , 36 : { n : "PtgRef" , f : parse _PtgRef } , 37 : { n : "PtgArea" , f : parse _PtgArea } , 38 : { n : "PtgMemArea" , f : parse _PtgMemArea } , 39 : { n : "PtgMemErr" , f : parse _PtgMemErr } , 40 : { n : "PtgMemNoMem" , f : parse _PtgMemNoMem } , 41 : { n : "PtgMemFunc" , f : parse _PtgMemFunc } , 42 : { n : "PtgRefErr" , f : parse _PtgRefErr } , 43 : { n : "PtgAreaErr" , f : parse _PtgAreaErr } , 44 : { n : "PtgRefN" , f : parse _PtgRefN } , 45 : { n : "PtgAreaN" , f : parse _PtgAreaN } , 57 : { n : "PtgNameX" , f : parse _PtgNameX } , 58 : { n : "PtgRef3d" , f : parse _PtgRef3d } , 59 : { n : "PtgArea3d" , f : parse _PtgArea3d } , 60 : { n : "PtgRefErr3d" , f : parse _PtgRefErr3d } , 61 : { n : "PtgAreaErr3d" , f : parse _PtgAreaErr3d } , 255 : { } } ; var PtgDupes = { 64 : 32 , 96 : 32 , 65 : 33 , 97 : 33 , 66 : 34 , 98 : 34 , 67 : 35 , 99 : 35 , 68 : 36 , 100 : 36 , 69 : 37 , 101 : 37 , 70 : 38 , 102 : 38 , 71 : 39 , 103 : 39 , 72 : 40 , 104 : 40 , 73 : 41 , 105 : 41 , 74 : 42 , 106 : 42 , 75 : 43 , 107 : 43 , 76 : 44 , 108 : 44 , 77 : 45 , 109 : 45 , 89 : 57 , 121 : 57 , 90 : 58 , 122 : 58 , 91 : 59 , 123 : 59 , 92 : 60 , 124 : 60 , 93 : 61 , 125 : 61 } ; ( function ( ) { for ( var y in PtgDupes ) PtgTypes [ y ] = PtgTypes [ PtgDupes [ y ] ] } ) ( ) ; var Ptg18 = { } ; var Ptg19 = { 1 : { n : "PtgAttrSemi" , f : parse _PtgAttrSemi } , 2 : { n : "PtgAttrIf" , f : parse _PtgAttrIf } , 4 : { n : "PtgAttrChoose" , f : parse _PtgAttrChoose } , 8 : { n : "PtgAttrGoto" , f : parse _PtgAttrGoto } , 16 : { n : "PtgAttrSum" , f : parse _PtgAttrSum } , 32 : { n : "PtgAttrBaxcel" , f : parse _PtgAttrBaxcel } , 64 : { n : "PtgAttrSpace" , f : parse _PtgAttrSpace } , 65 : { n : "PtgAttrSpaceSemi" , f : parse _PtgAttrSpaceSemi } , 128 : { n : "PtgAttrIfError" , f : parse _PtgAttrIfError } , 255 : { } } ; function parse _Formula ( blob
function get _sst _id ( sst , str ) { for ( var i = 0 , len = sst . length ; i < len ; ++ i ) if ( sst [ i ] . t === str ) { sst . Count ++ ; return i } sst [ len ] = { t : str } ; sst . Count ++ ; sst . Unique ++ ; return len } function col _obj _w ( C , col ) { var p = { min : C + 1 , max : C + 1 } ; var width = - 1 ; if ( col . MDW ) MDW = col . MDW ; if ( col . width != null ) p . customWidth = 1 ; else if ( col . wpx != null ) width = px2char ( col . wpx ) ; else if ( col . wch != null ) width = col . wch ; if ( width > - 1 ) { p . width = char2width ( width ) ; p . customWidth = 1 } else p . width = col . width ; return p } function get _cell _style ( styles , cell , opts ) { var z = opts . revssf [ cell . z != null ? cell . z : "General" ] ; for ( var i = 0 , len = styles . length ; i != len ; ++ i ) if ( styles [ i ] . numFmtId === z ) return i ; styles [ len ] = { numFmtId : z , fontId : 0 , fillId : 0 , borderId : 0 , xfId : 0 , applyNumberFormat : 1 } ; return len } function safe _format ( p , fmtid , fillid , opts , themes , styles ) { if ( p . t === "z" ) return ; if ( p . t === "d" && typeof p . v === "string" ) p . v = parseDate ( p . v ) ; try { if ( p . t === "e" ) p . w = p . w || BErr [ p . v ] ; else if ( fmtid === 0 ) { if ( p . t === "n" ) { if ( ( p . v | 0 ) === p . v ) p . w = SSF . _general _int ( p . v , _ssfopts ) ; else p . w = SSF . _general _num ( p . v , _ssfopts ) } else if ( p . t === "d" ) { var dd = datenum ( p . v ) ; if ( ( dd | 0 ) === dd ) p . w = SSF . _general _int ( dd , _ssfopts ) ; else p . w = SSF . _general _num ( dd , _ssfopts ) } else if ( p . v === undefined ) return "" ; else p . w = SSF . _general ( p . v , _ssfopts ) } else if ( p . t === "d" ) p . w = SSF . format ( fmtid , datenum ( p . v ) , _ssfopts ) ; else p . w = SSF . format ( fmtid , p . v , _ssfopts ) ; if ( opts . cellNF ) p . z = SSF . _table [ fmtid ] } catch ( e ) { if ( opts . WTF ) throw e } if ( fillid ) try { p . s = styles . Fills [ fillid ] ; if ( p . s . fgColor && p . s . fgColor . theme ) { p . s . fgColor . rgb = rgb _tint ( themes . themeElements . clrScheme [ p . s . fgColor . theme ] . rgb , p . s . fgColor . tint || 0 ) ; if ( opts . WTF ) p . s . fgColor . raw _rgb = themes . themeElements . clrScheme [ p . s . fgColor . theme ] . rgb } if ( p . s . bgColor && p . s . bgColor . theme ) { p . s . bgColor . rgb = rgb _tint ( themes . themeElements . clrScheme [ p . s . bgColor . theme ] . rgb , p . s . bgColor . tint || 0 ) ; if ( opts . WTF ) p . s . bgColor . raw _rgb = themes . themeElements . clrScheme [ p . s . bgColor . theme ] . rgb } } catch ( e ) { if ( opts . WTF ) throw e } } function parse _ws _xml _dim ( ws , s ) { var d = safe _decode _range ( s ) ; if ( d . s . r <= d . e . r && d . s . c <= d . e . c && d . s . r >= 0 && d . s . c >= 0 ) ws [ "!ref" ] = encode _range ( d ) } var mergecregex = /<(?:\w:)?mergeCell ref="[A-Z0-9:]+"\s*[\/]?>/g ; var sheetdataregex = /<(?:\w+:)?sheetData>([^\u2603]*)<\/(?:\w+:)?sheetData>/ ; var hlinkregex = /<(?:\w:)?hyperlink [^>]*>/gm ; var dimregex = /"(\w*:\w*)"/ ; var colregex = /<(?:\w:)?col[^>]*[\/]?>/g ; function parse _ws _xml ( data , opts , rels , wb , themes , styles ) { if ( ! data ) return data ; if ( DENSE != null && opts . dense == null ) opts . dense = DENSE ; var s = opts . dense ? [ ] : { } ; var ridx = ( data . match ( /<(?:\w*:)?dimension/ ) || { index : - 1 } ) . index ; if ( ridx > 0 ) { var ref = data . substr ( ridx , 50 ) . match ( dimregex ) ; if ( ref != null ) parse _ws _xml _dim ( s , ref [ 1 ] ) } var mergecells = [ ] ; var merges = data . match ( mergecregex ) ; if ( merges ) for ( ridx = 0 ; ridx != merges . length ; ++ ridx ) mergecells [ ridx ] = safe _decode _range ( merges [ ridx ] . substr ( merges [ ridx ] . indexOf ( '"' ) + 1 ) ) ; var columns = [ ] ; if ( opts . cellStyles ) { var cols = data . match ( colregex ) ; if ( cols ) parse _ws _xml _cols ( columns , cols ) } var refguess = { s : { r : 2e6 , c : 2e6 } , e : { r : 0 , c : 0 } } ; var mtch = data . match ( sheetdataregex ) ; if ( mtch ) parse _ws _xml _data ( mtch [ 1 ] , s , opts , refguess , themes , styles ) ; var hlink = data . match ( hlinkregex ) ; if ( hlink ) parse _ws _xml _hlinks ( s , hlink , rels ) ; if ( ! s [ "!ref" ] && refguess . e . c >= refguess . s . c && refguess . e . r >= refguess . s . r ) s [ "!ref" ] = encode _range ( refguess ) ; if ( opts . sheetRows > 0 && s [ "!ref" ] ) { var tmpref = safe _decode _range ( s [ "!ref" ] ) ; if ( opts . sheetRows < + tmpref . e . r ) { tmpref . e . r = opts . sheetRows - 1 ; if ( tmpref . e . r > refguess . e . r ) tmpref . e . r = refguess . e . r ; if ( tmpref . e . r < tmpref . s . r ) tmpref . s . r = tmpref . e . r ; if ( tmpref . e . c > refguess . e . c ) tmpref . e . c = refguess . e . c ; if ( tmpref . e . c < tmpref . s . c ) tmpref . s . c = tmpref . e . c ; s [ "!fullref" ] = s [ "!ref" ] ; s [ "!ref" ] = encode _range ( tmpref ) } } if ( mergecells . length > 0 ) s [ "!merges" ] = mergecells ; if ( columns . length > 0 ) s [ "!cols" ] = columns ; return s } function write _ws _xml _merges ( merges ) { if ( merges . length == 0 ) return "" ; var o = '<mergeCells count="' + merges . length + '">' ; for ( var i = 0 ; i != merges . length ; ++ i ) o += '<mergeCell ref="' + encode _range ( merges [ i ] ) + '"/>' ; return o + "</mergeCells>" } function write _ws _xml _protection ( sp ) { var o = { sheet : 1 } ; var deffalse = [ "objects" , "scenarios" , "selectLockedCells" , "selectUnlockedCells" ] ; var deftrue = [ "formatColumns" , "formatRows" , "formatCells" , "insertColumns" , " inse
break ; case "<fileVersion" : delete y [ 0 ] ; wb . AppVersion = y ; break ; case "<fileVersion/>" : case "</fileVersion>" : break ; case "<fileSharing" : case "<fileSharing/>" : break ; case "<workbookPr" : delete y [ 0 ] ; wb . WBProps = y ; break ; case "<workbookPr/>" : delete y [ 0 ] ; wb . WBProps = y ; break ; case "</workbookPr>" : break ; case "<workbookProtection" : break ; case "<workbookProtection/>" : break ; case "<bookViews>" : case "</bookViews>" : break ; case "<workbookView" : delete y [ 0 ] ; wb . WBView . push ( y ) ; break ; case "</workbookView>" : break ; case "<sheets>" : case "</sheets>" : break ; case "<sheet" : switch ( y . state ) { case "hidden" : y . Hidden = 1 ; break ; case "veryHidden" : y . Hidden = 2 ; break ; default : y . Hidden = 0 } delete y . state ; y . name = unescapexml ( utf8read ( y . name ) ) ; delete y [ 0 ] ; wb . Sheets . push ( y ) ; break ; case "</sheet>" : break ; case "<functionGroups" : case "<functionGroups/>" : break ; case "<functionGroup" : break ; case "<externalReferences" : 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 ; dnstart = idx + x . length } break ; case "</definedName>" : { dname . Ref = data . slice ( dnstart , idx ) ; wb . Names [ dname . Name ] = dname ; wb . Names [ "!names" ] . push ( dname . Name ) } 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 ; 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 ( 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 _BrtFRTArch
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 . enc . insitu _decrypt ( d ) } bufs . push ( d ) ; blob . l += l ; var next = XLSRecordEnum [ _ _readUInt16LE ( blob , blob . l ) ] ; while ( next != null && next . n === "Continue" ) { l = _ _readUInt16LE ( blob , blob . l + 2 ) ; bufs . push ( blob . slice ( blob . l + 4 , blob . l + 4 + l ) ) ; blob . l += 4 + l ; next = XLSRecordEnum [ _ _readUInt16LE ( blob , blob . l ) ] } var b = bconcat ( bufs ) ; prep _blob ( b , 0 ) ; var ll = 0 ; b . lens = [ ] ; for ( var j = 0 ; j < bufs . length ; ++ j ) { b . lens . push ( ll ) ; ll += bufs [ j ] . length } return R . f ( b , b . length , opts ) } function safe _format _xf ( p , opts , date1904 ) { if ( p . t === "z" ) return ; if ( p . t === "e" ) { p . w = p . w || BErr [ p . v ] } if ( ! p . XF ) return ; try { var fmtid = p . XF . ifmt || 0 ; if ( p . t === "e" ) { } else if ( fmtid === 0 ) { if ( p . t === "n" ) { if ( ( p . v | 0 ) === p . v ) p . w = SSF . _general _int ( p . v ) ; else p . w = SSF . _general _num ( p . v ) } else p . w = SSF . _general ( p . v ) } else p . w = SSF . format ( fmtid , p . v , { date1904 : ! ! date1904 } ) ; if ( opts . cellDates && fmtid && p . t == "n" && SSF . is _date ( SSF . _table [ fmtid ] ) ) { var _d = SSF . parse _date _code ( p . v ) ; if ( _d ) { p . t = "d" ; p . v = new Date ( Date . UTC ( _d . y , _d . m - 1 , _d . d , _d . H , _d . M , _d . S , _d . u ) ) } } if ( opts . cellNF ) p . z = SSF . _table [ fmtid ] } catch ( e ) { if ( opts . WTF ) throw e } } function make _cell ( val , ixfe , t ) { return { v : val , ixfe : ixfe , t : t } } function parse _workbook ( blob , options ) { var wb = { opts : { } } ; var Sheets = { } ; if ( DENSE != null && options . dense == null ) options . dense = DENSE ; var out = options . dense ? [ ] : { } ; var Directory = { } ; var found _sheet = false ; var range = { } ; var last _formula = null ; var sst = [ ] ; var cur _sheet = "" ; var Preamble = { } ; var lastcell , last _cell = "" , cc , cmnt , rng , rngC , rngR ; var shared _formulae = { } ; var array _formulae = [ ] ; var temp _val ; var country ; var cell _valid = true ; var XFs = [ ] ; var palette = [ ] ; var Workbook = { Sheets : [ ] } , wsprops = { } ; var get _rgb = function getrgb ( icv ) { if ( icv < 8 ) return XLSIcv [ icv ] ; if ( icv < 64 ) return palette [ icv - 8 ] || XLSIcv [ icv ] ; return XLSIcv [ icv ] } ; var process _cell _style = function pcs ( cell , line , options ) { var xfd = line . XF . data ; if ( ! xfd || ! xfd . patternType || ! options || ! options . cellStyles ) return ; line . s = { } ; line . s . patternType = xfd . patternType ; var t ; if ( t = rgb2Hex ( get _rgb ( xfd . icvFore ) ) ) { line . s . fgColor = { rgb : t } } if ( t = rgb2Hex ( get _rgb ( xfd . icvBack ) ) ) { line . s . bgColor = { rgb : t } } } ; var addcell = function addcell ( cell , line , options ) { if ( file _depth > 1 ) return ; if ( ! cell _valid ) return ; if ( options . cellStyles && line . XF && line . XF . data ) process _cell _style ( cell , line , options ) ; lastcell = cell ; last _cell = encode _cell ( cell ) ; if ( range . s ) { if ( cell . r < range . s . r ) range . s . r = cell . r ; if ( cell . c < range . s . c ) range . s . c = cell . c } if ( range . e ) { if ( cell . r + 1 > range . e . r ) range . e . r = cell . r + 1 ; if ( cell . c + 1 > range . e . c ) range . e . c = cell . c + 1 } if ( options . cellFormula && line . f ) { for ( var afi = 0 ; afi < array _formulae . length ; ++ afi ) { if ( array _formulae [ afi ] [ 0 ] . s . c > cell . c ) continue ; if ( array _formulae [ afi ] [ 0 ] . s . r > cell . r ) continue ; if ( array _formulae [ afi ] [ 0 ] . e . c < cell . c ) continue ; if ( array _formulae [ afi ] [ 0 ] . e . r < cell . r ) continue ; line . F = encode _range ( array _formulae [ afi ] [ 0 ] ) ; if ( array _formulae [ afi ] [ 0 ] . s . c != cell . c ) delete line . f ; if ( array _formulae [ afi ] [ 0 ] . s . r != cell . r ) delete line . f ; if ( line . f ) line . f = "" + stringify _formula ( array _formulae [ afi ] [ 1 ] , range , cell , supbooks , opts ) ; break } } if ( options . sheetRows && lastcell . r >= option
} , 398 : { n : "BrtInfo" , f : parsenoop } , 399 : { n : "BrtCUsr" , f : parsenoop } , 400 : { n : "BrtUsr" , f : parsenoop } , 401 : { n : "BrtBeginUsers" , f : parsenoop } , 403 : { n : "BrtEOF" , f : parsenoop } , 404 : { n : "BrtUCR" , f : parsenoop } , 405 : { n : "BrtRRInsDel" , f : parsenoop } , 406 : { n : "BrtRREndInsDel" , f : parsenoop } , 407 : { n : "BrtRRMove" , f : parsenoop } , 408 : { n : "BrtRREndMove" , f : parsenoop } , 409 : { n : "BrtRRChgCell" , f : parsenoop } , 410 : { n : "BrtRREndChgCell" , f : parsenoop } , 411 : { n : "BrtRRHeader" , f : parsenoop } , 412 : { n : "BrtRRUserView" , f : parsenoop } , 413 : { n : "BrtRRRenSheet" , f : parsenoop } , 414 : { n : "BrtRRInsertSh" , f : parsenoop } , 415 : { n : "BrtRRDefName" , f : parsenoop } , 416 : { n : "BrtRRNote" , f : parsenoop } , 417 : { n : "BrtRRConflict" , f : parsenoop } , 418 : { n : "BrtRRTQSIF" , f : parsenoop } , 419 : { n : "BrtRRFormat" , f : parsenoop } , 420 : { n : "BrtRREndFormat" , f : parsenoop } , 421 : { n : "BrtRRAutoFmt" , f : parsenoop } , 422 : { n : "BrtBeginUserShViews" , f : parsenoop } , 423 : { n : "BrtBeginUserShView" , f : parsenoop } , 424 : { n : "BrtEndUserShView" , f : parsenoop } , 425 : { n : "BrtEndUserShViews" , f : parsenoop } , 426 : { n : "BrtArrFmla" , f : parse _BrtArrFmla } , 427 : { n : "BrtShrFmla" , f : parse _BrtShrFmla } , 428 : { n : "BrtTable" , f : parsenoop } , 429 : { n : "BrtBeginExtConnections" , f : parsenoop } , 430 : { n : "BrtEndExtConnections" , f : parsenoop } , 431 : { n : "BrtBeginPCDCalcMems" , f : parsenoop } , 432 : { n : "BrtEndPCDCalcMems" , f : parsenoop } , 433 : { n : "BrtBeginPCDCalcMem" , f : parsenoop } , 434 : { n : "BrtEndPCDCalcMem" , f : parsenoop } , 435 : { n : "BrtBeginPCDHGLevels" , f : parsenoop } , 436 : { n : "BrtEndPCDHGLevels" , f : parsenoop } , 437 : { n : "BrtBeginPCDHGLevel" , f : parsenoop } , 438 : { n : "BrtEndPCDHGLevel" , f : parsenoop } , 439 : { n : "BrtBeginPCDHGLGroups" , f : parsenoop } , 440 : { n : "BrtEndPCDHGLGroups" , f : parsenoop } , 441 : { n : "BrtBeginPCDHGLGroup" , f : parsenoop } , 442 : { n : "BrtEndPCDHGLGroup" , f : parsenoop } , 443 : { n : "BrtBeginPCDHGLGMembers" , f : parsenoop } , 444 : { n : "BrtEndPCDHGLGMembers" , f : parsenoop } , 445 : { n : "BrtBeginPCDHGLGMember" , f : parsenoop } , 446 : { n : "BrtEndPCDHGLGMember" , f : parsenoop } , 447 : { n : "BrtBeginQSI" , f : parsenoop } , 448 : { n : "BrtEndQSI" , f : parsenoop } , 449 : { n : "BrtBeginQSIR" , f : parsenoop } , 450 : { n : "BrtEndQSIR" , f : parsenoop } , 451 : { n : "BrtBeginDeletedNames" , f : parsenoop } , 452 : { n : "BrtEndDeletedNames" , f : parsenoop } , 453 : { n : "BrtBeginDeletedName" , f : parsenoop } , 454 : { n : "BrtEndDeletedName" , f : parsenoop } , 455 : { n : "BrtBeginQSIFs" , f : parsenoop } , 456 : { n : "BrtEndQSIFs" , f : parsenoop } , 457 : { n : "BrtBeginQSIF" , f : parsenoop } , 458 : { n : "BrtEndQSIF" , f : parsenoop } , 459 : { n : "BrtBeginAutoSortScope" , f : parsenoop } , 460 : { n : "BrtEndAutoSortScope" , f : parsenoop } , 461 : { n : "BrtBeginConditionalFormatting" , f : parsenoop } , 462 : { n : "BrtEndConditionalFormatting" , f : parsenoop } , 463 : { n : "BrtBeginCFRule" , f : parsenoop } , 464 : { n : "BrtEndCFRule" , f : parsenoop } , 465 : { n : "BrtBeginIconSet" , f : parsenoop } , 466 : { n : "BrtEndIconSet" , f : parsenoop } , 467 : { n : "BrtBeginDatabar" , f : parsenoop } , 468 : { n : "BrtEndDatabar" , f : parsenoop } , 469 : { n : "BrtBeginColorScale" , f : parsenoop } , 470 : { n : "BrtEndColorScale" , f : parsenoop } , 471 : { n : "BrtCFVO" , f : parsenoop } , 472 : { n : "BrtExternValueMeta" , f : parsenoop } , 473 : { n : "BrtBeginColorPalette" , f : parsenoop } , 474 : { n : "BrtEndColorPalette" , f : parsenoop } , 475 : { n : "BrtIndexedColor" , f : parsenoop } , 476 : { n : "BrtMargins" , f : parsenoop } , 477 : { n : "BrtPrintOptions" , f : parsenoop } , 478 : { n : "BrtPageSetup" , f : parsenoop } , 479 : { n : "BrtBeginHeaderFooter" , f : parsenoop } , 480 : { n : "BrtEndHeaderFooter" , f : parsenoop } , 481 : { n : "BrtBeginSXCrtFormat" , f : parsenoop } , 482 : { n : "BrtEndSXCrtFormat" , f : parsenoop } , 483 : { n : "BrtBeginSXCrtFormats" , f : parsenoop } , 484 : { n : "BrtEndSXCrtFormats" , f : parsenoop } , 485 : { n : "BrtWsFmtInfo" , f : parsenoop } , 486 : { n : "BrtBeginMgs" , f : parsenoop } , 487 : { n : "BrtEndMGs" , f : parsenoop } , 488 : { n : "BrtBeginMGMaps" , f : parsenoop } , 489 : { n : "BrtEndMGMaps" , f : parsenoop } , 490 : { n : "BrtBeginMG" , f : parsenoop } , 491 : { n : "BrtEndMG" , f : parsenoop } , 492 : { n : "BrtBeginMap" , f : parsenoop } , 493 : { n : "BrtEndMap" , f : parsenoop } , 494 : { n : "BrtHLink" , f : parse _BrtHLink } , 495 : { n : "BrtBeginDCon" , f : parsenoop } , 496 : { n : "BrtEndDCon" , f : parsenoop } , 497 : { n : "BrtBeginDRefs" , f : parsenoop } , 498 : { n : "BrtEndDRefs" , f : parsenoop } , 499 : { n : "BrtDRef" , f : parsenoop } , 500 : { n : "BrtBeginScenMan" , f : parsenoop } , 501 : { n : "BrtEndScenMan" , f : parsenoop } , 502 : { n : "BrtBeginSct" , f : parsenoop } , 503 : { n : "BrtEndSct" , f : parsenoop } , 504 : { n : "BrtSlc" , f : parsenoop } , 505 : { n : "BrtBeginDXFs" , f : parsenoop } , 506 : { n : "BrtEndDXFs" , f : parsenoop } , 507 : { n : "BrtDXF" , f : parsenoop } , 508 : { n : "BrtBeginTableStyles" , f : parsenoop } ,
} , 4166 : { n : "AxesUsed" , f : parse _AxesUsed } , 4168 : { n : "SBaseRef" , f : parse _SBaseRef } , 4170 : { n : "SerParent" , f : parse _SerParent } , 4171 : { n : "SerAuxTrend" , f : parse _SerAuxTrend } , 4174 : { n : "IFmtRecord" , f : parse _IFmtRecord } , 4175 : { n : "Pos" , f : parse _Pos } , 4176 : { n : "AlRuns" , f : parse _AlRuns } , 4177 : { n : "BRAI" , f : parse _BRAI } , 4187 : { n : "SerAuxErrBar" , f : parse _SerAuxErrBar } , 4188 : { n : "ClrtClient" , f : parse _ClrtClient } , 4189 : { n : "SerFmt" , f : parse _SerFmt } , 4191 : { n : "Chart3DBarShape" , f : parse _Chart3DBarShape } , 4192 : { n : "Fbi" , f : parse _Fbi } , 4193 : { n : "BopPop" , f : parse _BopPop } , 4194 : { n : "AxcExt" , f : parse _AxcExt } , 4195 : { n : "Dat" , f : parse _Dat } , 4196 : { n : "PlotGrowth" , f : parse _PlotGrowth } , 4197 : { n : "SIIndex" , f : parse _SIIndex } , 4198 : { n : "GelFrame" , f : parse _GelFrame } , 4199 : { n : "BopPopCustom" , f : parse _BopPopCustom } , 4200 : { n : "Fbi2" , f : parse _Fbi2 } , 0 : { n : "Dimensions" , f : parse _Dimensions } , 2 : { n : "BIFF2INT" , f : parse _BIFF2INT } , 5 : { n : "BoolErr" , f : parse _BoolErr } , 7 : { n : "String" , f : parse _BIFF2STRING } , 8 : { n : "BIFF2ROW" , f : parsenoop } , 11 : { n : "Index" , f : parse _Index } , 30 : { n : "BIFF2FORMAT" , f : parse _BIFF2Format } , 31 : { n : "BIFF2FMTCNT" , f : parsenoop } , 22 : { n : "ExternCount" , f : parsenoop } , 33 : { n : "Array" , f : parse _Array } , 37 : { n : "DefaultRowHeight" , f : parse _DefaultRowHeight } , 50 : { n : "BIFF2FONTXTRA" , f : parse _BIFF2FONTXTRA } , 62 : { n : "BIFF2WINDOW2" , f : parsenoop } , 69 : { n : "BIFF2FONTCLR" , f : parsenoop } , 86 : { n : "BIFF4FMTCNT" , f : parsenoop } , 126 : { n : "RK" , f : parsenoop } , 127 : { n : "ImData" , f : parsenoop } , 135 : { n : "Addin" , f : parsenoop } , 136 : { n : "Edg" , f : parsenoop } , 137 : { n : "Pub" , f : parsenoop } , 145 : { n : "Sub" , f : parsenoop } , 148 : { n : "LHRecord" , f : parsenoop } , 149 : { n : "LHNGraph" , f : parsenoop } , 150 : { n : "Sound" , f : parsenoop } , 169 : { n : "CoordList" , f : parsenoop } , 171 : { n : "GCW" , f : parsenoop } , 188 : { n : "ShrFmla" , f : parsenoop } , 194 : { n : "AddMenu" , f : parsenoop } , 195 : { n : "DelMenu" , f : parsenoop } , 214 : { n : "RString" , f : parse _RString } , 223 : { n : "UDDesc" , f : parsenoop } , 234 : { n : "TabIdConf" , f : parsenoop } , 354 : { n : "XL5Modify" , f : parsenoop } , 421 : { n : "FileSharing2" , f : parsenoop } , 521 : { n : "BOF" , f : parse _BOF } , 536 : { n : "Lbl" , f : parse _Lbl } , 547 : { n : "ExternName" , f : parse _ExternName } , 561 : { n : "Font" , f : parsenoop } , 1033 : { n : "BOF" , f : parse _BOF } , 2157 : { n : "FeatInfo" , f : parsenoop } , 2163 : { n : "FeatInfo11" , f : parsenoop } , 2177 : { n : "SXAddl12" , f : parsenoop } , 2240 : { n : "AutoWebPub" , f : parsenoop } , 2241 : { n : "ListObj" , f : parsenoop } , 2242 : { n : "ListField" , f : parsenoop } , 2243 : { n : "ListDV" , f : parsenoop } , 2244 : { n : "ListCondFmt" , f : parsenoop } , 2245 : { n : "ListCF" , f : parsenoop } , 2246 : { n : "FMQry" , f : parsenoop } , 2247 : { n : "FMSQry" , f : parsenoop } , 2248 : { n : "PLV" , f : parsenoop } , 2249 : { n : "LnExt" , f : parsenoop } , 2250 : { n : "MkrExt" , f : parsenoop } , 2251 : { n : "CrtCoopt" , f : parsenoop } , 67 : { n : "BIFF2XF" , f : parsenoop } , 579 : { n : "BIFF3XF" , f : parsenoop } , 1091 : { n : "BIFF4XF" , f : parsenoop } , 29282 : { } } ; function write _biff _rec ( ba , t , payload , length ) { var len = length || ( payload || [ ] ) . length ; var o = ba . next ( 4 + len ) ; o . write _shift ( 2 , t ) ; o . write _shift ( 2 , len ) ; if ( len > 0 && is _buf ( payload ) ) ba . push ( payload ) } function write _BOF ( wb , o ) { if ( o . bookType != "biff2" ) throw "unsupported BIFF version" ; var out = new _buf ( 4 ) ; out . write _shift ( 2 , 2 ) ; out . write _shift ( 2 , 16 ) ; return out } function write _BIFF2Cell ( out , r , c ) { if ( ! out ) out = new _buf ( 7 ) ; out . write _shift ( 2 , r ) ; out . write _shift ( 2 , c ) ; out . write _shift ( 1 , 0 ) ; out . write _shift ( 1 , 0 ) ; out . write _shift ( 1 , 0 ) ; return out } function write _BIFF2INT ( r , c , val ) { var out = new _buf ( 9 ) ; write _BIFF2Cell ( out , r , c ) ; out . write _shift ( 2 , val ) ; return out } function write _BIFF2NUMBER ( r , c , val ) { var out = new _buf ( 15 ) ; write _BIFF2Cell ( out , r , c ) ; out . write _shift ( 8 , val , "f" ) ; return out } function write _BIFF2BERR ( r , c , val , t ) { var out = new _buf ( 9 ) ; write _BIFF2Cell ( out , r , c ) ; if ( t == "e" ) { out . write _shift ( 1 , val ) ; out . write _shift ( 1 , 1 ) } else { out . write _shift ( 1 , val ? 1 : 0 ) ; out . write _shift ( 1 , 0 ) } return out } function write _BIFF2LABEL ( r , c , val ) { var out = new _buf ( 8 + 2 * val . length ) ; write _BIFF2Cell ( out , r , c ) ; out . write _shift ( 1 , val . length ) ; out . write _shift ( val . length , val , "sbcs" ) ; return out . l < out . length ? out . slice ( 0 , out . l ) : out } function write _ws _biff _cell ( ba , cell , R , C , opts ) { if ( cell . v != null ) switch ( cell . t ) { case "d" : case "n" : var v = cell . t == "d" ? datenum ( cell . v ) : cell . v ; if ( v == ( v | 0 ) && v >= 0 && v < 65536 ) write _biff _rec ( ba , 2 , write _BIFF2INT ( R , C , v ) ) ; else write _biff _rec ( ba , 3 , write _BIFF2NUMBER ( R , C , v ) ) ; return ; case "b" : case "e" : write _biff _rec ( ba , 5 , write _BIFF2BERR ( R , C , cell . v , cell . t ) ) ; return ; case "s" : case "str" : write _biff _rec ( ba ,
zip . file ( "xl/_rels/workbook." + wbext + ".rels" , write _rels ( opts . wbrels ) ) ; return zip } function firstbyte ( f , o ) { var x = "" ; switch ( ( o || { } ) . type || "base64" ) { case "buffer" : return [ f [ 0 ] , f [ 1 ] , f [ 2 ] , f [ 3 ] ] ; case "base64" : x = Base64 . decode ( f . substr ( 0 , 24 ) ) ; break ; case "binary" : x = f ; break ; case "array" : return [ f [ 0 ] , f [ 1 ] , f [ 2 ] , f [ 3 ] ] ; default : throw new Error ( "Unrecognized type " + ( o ? o . type : "undefined" ) ) } return [ x . charCodeAt ( 0 ) , x . charCodeAt ( 1 ) , x . charCodeAt ( 2 ) , x . charCodeAt ( 3 ) ] } function read _zip ( data , opts ) { var zip , d = data ; var o = opts || { } ; if ( ! o . type ) o . type = has _buf && Buffer . isBuffer ( data ) ? "buffer" : "base64" ; switch ( o . type ) { case "base64" : zip = new jszip ( d , { base64 : true } ) ; break ; case "binary" : case "array" : zip = new jszip ( d , { base64 : false } ) ; break ; case "buffer" : zip = new jszip ( d ) ; break ; default : throw new Error ( "Unrecognized type " + o . type ) } return parse _zip ( zip , o ) } function read _utf16 ( data , o ) { var d = data ; if ( o . type == "base64" ) d = Base64 . decode ( d ) ; d = cptable . utils . decode ( 1200 , d . slice ( 2 ) ) ; o . type = "binary" ; if ( d . charCodeAt ( 0 ) == 60 ) return parse _xlml ( d , o ) ; return PRN . to _workbook ( d , o ) } function readSync ( data , opts ) { var zip , d = data , n = [ 0 ] ; var o = opts || { } ; if ( ! o . type ) o . type = has _buf && Buffer . isBuffer ( data ) ? "buffer" : "base64" ; if ( o . type == "file" ) { o . type = "buffer" ; d = _fs . readFileSync ( data ) } switch ( ( n = firstbyte ( d , o ) ) [ 0 ] ) { case 208 : return parse _xlscfb ( CFB . read ( d , o ) , o ) ; case 9 : return parse _xlscfb ( s2a ( o . type === "base64" ? Base64 . decode ( d ) : d ) , o ) ; case 60 : return parse _xlml ( d , o ) ; case 73 : if ( n [ 1 ] == 68 ) return SYLK . to _workbook ( d , o ) ; break ; case 84 : if ( n [ 1 ] == 65 && n [ 2 ] == 66 && n [ 3 ] == 76 ) return DIF . to _workbook ( d , o ) ; break ; case 80 : if ( n [ 1 ] == 75 && n [ 2 ] < 32 && n [ 3 ] < 32 ) return read _zip ( d , o ) ; break ; case 239 : return parse _xlml ( d , o ) ; case 255 : if ( n [ 1 ] == 254 ) { return read _utf16 ( d , o ) } break ; case 0 : if ( n [ 1 ] == 0 && n [ 2 ] >= 2 && n [ 3 ] == 0 ) return WK _ . to _workbook ( d , o ) ; break ; case 3 : case 131 : case 139 : return DBF . to _workbook ( d , o ) } if ( n [ 2 ] <= 12 && n [ 3 ] <= 31 ) return DBF . to _workbook ( d , o ) ; if ( 32 > n [ 0 ] || n [ 0 ] > 127 ) throw new Error ( "Unsupported file " + n . join ( "|" ) ) ; return PRN . to _workbook ( d , o ) } function readFileSync ( filename , opts ) { var o = opts || { } ; o . type = "file" ; return readSync ( filename , o ) } function write _zip _type ( wb , opts ) { var o = opts || { } ; var z = write _zip ( wb , o ) ; var oopts = { } ; if ( o . compression ) oopts . compression = "DEFLATE" ; switch ( o . type ) { case "base64" : oopts . type = "base64" ; break ; case "binary" : oopts . type = "string" ; break ; case "buffer" : case "file" : oopts . type = "nodebuffer" ; break ; default : throw new Error ( "Unrecognized type " + o . type ) } if ( o . type === "file" ) return _fs . writeFileSync ( o . file , z . generate ( oopts ) ) ; return z . generate ( oopts ) } function write _bstr _type ( out , opts ) { switch ( opts . type ) { case "base64" : return Base64 . encode ( out ) ; case "binary" : return out ; case "file" : return _fs . writeFileSync ( opts . file , out , "binary" ) ; case "buffer" : { if ( has _buf ) return new Buffer ( out , "utf8" ) ; else return out . split ( "" ) . map ( function ( c ) { return c . charCodeAt ( 0 ) } ) } } throw new Error ( "Unrecognized type " + opts . type ) } function write _string _type ( out , opts ) { switch ( opts . type ) { case "base64" : return Base64 . encode ( out ) ; case "binary" : return out ; case "file" : return _fs . writeFileSync ( opts . file , out , "utf8" ) ; case "buffer" : { if ( has _buf ) return new Buffer ( out , "utf8" ) ; else return out . split ( "" ) . map ( function ( c ) { return c . charCodeAt ( 0 ) } ) } } throw new Error ( "Unrecognized type " + opts . type ) } function write _binary _type ( out , opts ) { switch ( opts . type ) { case "base64" : case "binary" : var bstr = "" ; for ( var i = 0 ; i < out . length ; ++ i ) bstr += String . fromCharCode ( out [ i ] ) ; return opts . type == "base64" ? Base64 . encode ( bstr ) : bstr ; case "file" : return _fs . writeFileSync ( opts . file , out ) ; case "buffer" : return out ; default : throw new Error ( "Unrecognized type " + opts . type ) } } function writeSync ( wb , opts ) { check _wb ( wb ) ; var o = opts || { } ; switch ( o . bookType || "xlsb" ) { case "xml" : case "xlml" : return write _string _type ( write _xlml ( wb , o ) , o ) ; case "slk" : case "sylk" : return write _string _type ( write _slk _str ( wb , o ) , o ) ; case "txt" : return write _bstr _type ( write _txt _str ( wb , o ) , o ) ; case "csv" : return write _string _type ( write _csv _str ( wb , o ) , o ) ; case "dif" : return write _string _type ( write _dif _str ( wb , o ) , o ) ; case "prn" : return write _string _type ( write _prn _str ( wb , o ) , o ) ; case "fods" : return write _string _type ( write _ods ( wb , o ) , o ) ; case "biff2" : return write _binary _type ( write _biff _buf ( wb , o ) , o ) ; case "xlsx" : case "xlsm" : case "xlsb" : case "ods" : re