{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///./node_modules/ml-array-utils/src/getEquallySpaced.js","webpack:///./node_modules/ml-fft/src/fftlib.js","webpack:///./node_modules/ml-optimize-lorentzian/node_modules/ml-curve-fitting/src/algebra.js","webpack:///./node_modules/jcampconverter/src/index.js","webpack:///./node_modules/ml-stat/array.js","webpack:///./node_modules/ml-optimize-lorentzian/node_modules/ml-matrix/src/dc/util.js","webpack:///./node_modules/spectra-data/src/SD.js","webpack:///./node_modules/ml-optimize-lorentzian/node_modules/ml-matrix/src/matrix.js","webpack:///./node_modules/ml-matrix/src/matrix.js","webpack:///./node_modules/jszip/lib/utils.js","webpack:///webpack/bootstrap 3b729be728ed5a5b4d68","webpack:///./node_modules/pako/lib/utils/common.js","webpack:///./node_modules/ml-matrix/src/views/base.js","webpack:///./node_modules/jszip/lib/support.js","webpack:///./node_modules/ml-stat/index.js","webpack:///./node_modules/ml-optimize-lorentzian/node_modules/ml-matrix/src/index.js","webpack:///./node_modules/ml-matrix/src/util.js","webpack:///./node_modules/ml-array-min/src/index.js","webpack:///./node_modules/ml-array-max/src/index.js","webpack:///./node_modules/jszip/lib/base64.js","webpack:///./node_modules/jszip/lib/object.js","webpack:///(webpack)/buildin/global.js","webpack:///./node_modules/jszip/lib/compressions.js","webpack:///./node_modules/pako/lib/zlib/messages.js","webpack:///./node_modules/jszip/lib/nodeBuffer.js","webpack:///./node_modules/ml-matrix/src/index.js","webpack:///./node_modules/ml-matrix/src/dc/util.js","webpack:///./node_modules/ml-hclust/src/Cluster.js","webpack:///./node_modules/spectra-data/src/index.js","webpack:///./node_modules/ml-array-utils/src/index.js","webpack:///./node_modules/extend/index.js","webpack:///./node_modules/ml-savitzky-golay-generalized/node_modules/ml-stat/array.js","webpack:///./node_modules/spectra-data/src/filters/Filters.js","webpack:///./node_modules/ml-fft/src/index.js","webpack:///./node_modules/brukerconverter/src/brukerconverter.js","webpack:///./node_modules/buffer/index.js","webpack:///./node_modules/pako/lib/zlib/adler32.js","webpack:///./node_modules/pako/lib/zlib/crc32.js","webpack:///./node_modules/pako/lib/utils/strings.js","webpack:///./node_modules/pako/lib/zlib/zstream.js","webpack:///./node_modules/pako/lib/zlib/constants.js","webpack:///./node_modules/jszip/lib/signature.js","webpack:///./node_modules/jszip/lib/defaults.js","webpack:///./node_modules/jszip/lib/compressedObject.js","webpack:///./node_modules/jszip/lib/utf8.js","webpack:///./node_modules/jszip/lib/stringReader.js","webpack:///./node_modules/jszip/lib/dataReader.js","webpack:///./node_modules/jszip/lib/uint8ArrayReader.js","webpack:///./node_modules/jszip/lib/arrayReader.js","webpack:///./node_modules/spectra-data/src/peakPicking/impurities.js","webpack:///./node_modules/spectra-data-ranges/src/index.js","webpack:///./node_modules/spectra-data-ranges/src/acs/acs.js","webpack:///./node_modules/spectra-nmr-utilities/src/index.js","webpack:///./node_modules/lodash.round/index.js","webpack:///./node_modules/nmr-simulation/src/index.js","webpack:///./node_modules/ml-matrix/src/abstractMatrix.js","webpack:///./node_modules/ml-matrix/src/dc/lu.js","webpack:///./node_modules/ml-matrix/src/dc/svd.js","webpack:///./node_modules/new-array/index.js","webpack:///./node_modules/ml-simple-clustering/src/index.js","webpack:///./node_modules/ml-distance-euclidean/euclidean.js","webpack:///./node_modules/ml-hclust/src/ClusterLeaf.js","webpack:///./node_modules/ml-sparse-matrix/src/SparseMatrix.js","webpack:///./node_modules/binary-search/index.js","webpack:///./node_modules/num-sort/index.js","webpack:///./node_modules/spectra-data/src/peakPicking/peakOptimizer.js","webpack:///./node_modules/ml-matrix-convolution/node_modules/ml-fft/src/fftlib.js","webpack:///./index.js","webpack:///./node_modules/ml-array-utils/src/ArrayUtils.js","webpack:///./node_modules/ml-stat/matrix.js","webpack:///./node_modules/ml-array-utils/src/snv.js","webpack:///./node_modules/ml-array-median/src/index.js","webpack:///./node_modules/median-quickselect/lib/median-quickselect.min.js","webpack:///./node_modules/ml-array-rescale/src/index.js","webpack:///./node_modules/spectra-data/src/jcampEncoder/JcampCreator.js","webpack:///./node_modules/spectra-data/src/jcampEncoder/VectorEncoder.js","webpack:///./node_modules/spectra-data/package.json","webpack:///./node_modules/spectra-data/src/peakPicking/peakPicking.js","webpack:///./node_modules/ml-gsd/src/index.js","webpack:///./node_modules/ml-gsd/src/optimize.js","webpack:///./node_modules/ml-optimize-lorentzian/src/index.js","webpack:///./node_modules/ml-optimize-lorentzian/node_modules/ml-curve-fitting/src/index.js","webpack:///./node_modules/ml-optimize-lorentzian/node_modules/ml-curve-fitting/src/LM.js","webpack:///./node_modules/ml-optimize-lorentzian/node_modules/ml-matrix/src/decompositions.js","webpack:///./node_modules/ml-optimize-lorentzian/node_modules/ml-matrix/src/dc/svd.js","webpack:///./node_modules/ml-optimize-lorentzian/node_modules/ml-matrix/src/dc/evd.js","webpack:///./node_modules/ml-optimize-lorentzian/node_modules/ml-matrix/src/dc/lu.js","webpack:///./node_modules/ml-optimize-lorentzian/node_modules/ml-matrix/src/dc/qr.js","webpack:///./node_modules/ml-optimize-lorentzian/node_modules/ml-matrix/src/dc/cholesky.js","webpack:///./node_modules/ml-gsd/src/gsd.js","webpack:///./node_modules/ml-savitzky-golay-generalized/src/index.js","webpack:///./node_modules/ml-savitzky-golay-generalized/node_modules/ml-stat/index.js","webpack:///./node_modules/ml-savitzky-golay-generalized/node_modules/ml-stat/matrix.js","webpack:///./node_modules/spectra-data/src/NMR.js","webpack:///./node_modules/spectra-data/src/filters/fourierTransform.js","webpack:///./node_modules/ml-fft/src/FFTUtils.js","webpack:///./node_modules/spectra-data/src/filters/zeroFilling.js","webpack:///./node_modules/spectra-data/src/filters/phaseCorrection.js","webpack:///./node_modules/spectra-data/src/filters/digitalFilter.js","webpack:///./node_modules/spectra-data/src/filters/rotate.js","webpack:///./node_modules/spectra-data/src/filters/absoluteValue.js","webpack:///./node_modules/iobuffer/IOBuffer.js","webpack:///./node_modules/jszip/lib/index.js","webpack:///./node_modules/base64-js/index.js","webpack:///./node_modules/ieee754/index.js","webpack:///./node_modules/isarray/index.js","webpack:///./node_modules/jszip/lib/flate.js","webpack:///./node_modules/pako/index.js","webpack:///./node_modules/pako/lib/deflate.js","webpack:///./node_modules/pako/lib/zlib/deflate.js","webpack:///./node_modules/pako/lib/zlib/trees.js","webpack:///./node_modules/pako/lib/inflate.js","webpack:///./node_modules/pako/lib/zlib/inflate.js","webpack:///./node_modules/pako/lib/zlib/inffast.js","webpack:///./node_modules/pako/lib/zlib/inftrees.js","webpack:///./node_modules/pako/lib/zlib/gzheader.js","webpack:///./node_modules/jszip/lib/crc32.js","webpack:///./node_modules/jszip/lib/stringWriter.js","webpack:///./node_modules/jszip/lib/uint8ArrayWriter.js","webpack:///./node_modules/jszip/lib/load.js","webpack:///./node_modules/jszip/lib/zipEntries.js","webpack:///./node_modules/jszip/lib/nodeBufferReader.js","webpack:///./node_modules/jszip/lib/zipEntry.js","webpack:///./node_modules/jszip/lib/deprecatedPublicUtils.js","webpack:///./node_modules/spectra-data/src/peakPicking/peaks2Ranges.js","webpack:///./node_modules/spectra-data/src/peakPicking/jAnalyzer.js","webpack:///./node_modules/spectra-data/src/peakPicking/ImpurityRemover.js","webpack:///./node_modules/spectra-data-ranges/src/range/Ranges.js","webpack:///./node_modules/spectra-data-ranges/src/range/peak2Vector.js","webpack:///./node_modules/nmr-simulation/src/SpinSystem.js","webpack:///./node_modules/ml-matrix/src/symbol-species.js","webpack:///./node_modules/ml-matrix/src/views/transpose.js","webpack:///./node_modules/ml-matrix/src/views/row.js","webpack:///./node_modules/ml-matrix/src/views/sub.js","webpack:///./node_modules/ml-matrix/src/views/selection.js","webpack:///./node_modules/ml-matrix/src/views/column.js","webpack:///./node_modules/ml-matrix/src/views/flipRow.js","webpack:///./node_modules/ml-matrix/src/views/flipColumn.js","webpack:///./node_modules/ml-matrix/src/decompositions.js","webpack:///./node_modules/ml-matrix/src/dc/evd.js","webpack:///./node_modules/ml-matrix/src/dc/qr.js","webpack:///./node_modules/ml-matrix/src/dc/cholesky.js","webpack:///./node_modules/ml-hclust/src/index.js","webpack:///./node_modules/ml-hclust/src/agnes.js","webpack:///./node_modules/heap/index.js","webpack:///./node_modules/heap/lib/heap.js","webpack:///./node_modules/util/util.js","webpack:///./node_modules/process/browser.js","webpack:///./node_modules/util/support/isBufferBrowser.js","webpack:///./node_modules/util/node_modules/inherits/inherits_browser.js","webpack:///./node_modules/ml-distance-matrix/src/index.js","webpack:///./node_modules/ml-hclust/src/diana.js","webpack:///./node_modules/nmr-simulation/src/simulate1D.js","webpack:///./node_modules/ml-hash-table/src/HashTable.js","webpack:///./node_modules/ml-hash-table/src/primeFinder.js","webpack:///./node_modules/number-is-nan/index.js","webpack:///./node_modules/nmr-simulation/src/pauli.js","webpack:///./node_modules/nmr-simulation/src/simulate2D.js","webpack:///./node_modules/spectra-data/src/NMR2D.js","webpack:///./node_modules/spectra-data/src/peakPicking/peakPicking2D.js","webpack:///./node_modules/ml-matrix-peaks-finder/src/index.js","webpack:///./node_modules/ml-matrix-convolution/src/index.js","webpack:///./node_modules/ml-matrix-convolution/node_modules/ml-fft/src/index.js","webpack:///./node_modules/ml-matrix-convolution/node_modules/ml-fft/src/FFTUtils.js","webpack:///./node_modules/ml-matrix-peaks-finder/src/ccLabeling.js","webpack:///./node_modules/ml-disjoint-set/src/DisjointSet.js"],"names":[],"mappings":";AAAA,cACA,2BACA,uCACA,sCACA,IACA,aACA,6CAEA,kBACA,GAAC,yBCyKoB,OACjB,YAtFgB,OAChB,YCqGU,KAAK,MAAI,KAAQ,KC9ChB,KACX,MCuWgE,KAAK,MClOrD,KAAU,OA7Kb,KAAK,MAdX,KAAS,MC1FS,KAAK,OCmaf,KAAK,QC+gCC,KAAK,MC16CX,OAAiB,YC0GhB,KAAK,QARkD,KAAK,MApG9D,OAAO,aVFzB,kBWTA,cAMA,IACA,iBAGA,mBACA,CACA,IACA,KAIA,2CAGA,aAGA,OACA,OAIA,IAzBA,eA4BA,MAGA,uBACA,GACA,kCACA,CACA,gBACA,cAGA,OAGA,iBACA,YACA,q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AsB,CAEd,QACA,eACA,eACA,UAGR,iCAA2B,CAEnB,QACA,gBACA,eACA,UAAO,MAGP,QACA,gBACA,eACA,UAGR,YAAM,CAEE,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAAO,MAGP,QACA,iBACA,eACA,UAAO,MAGP,QACA,qBACA,eACA,UAGR,kBAAY,CAEJ,QACA,cACA,eACA,UAGR,mBAAa,CAEL,QACA,eACA,eACA,UAGR,4BAAsB,CAEd,QACA,eACA,eACA,UAGR,uBAAiB,CAET,QACA,eACA,eACA,UAGR,oBAAe,CAEP,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,eAAS,CAED,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAAO,MAGP,QACA,gBACA,eACA,UAGR,6BAAuB,CAEf,QACA,eACA,eACA,UAAO,KAGP,QACA,eACA,eACA,UAGR,yBAAmB,CAEX,QACA,iBACA,eACA,UAAO,MAGP,QACA,gBACA,eACA,UAAO,MAGP,QACA,gBACA,eACA,UAGR,yBAAmB,CAEX,QACA,cACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,0BAAoB,CAEZ,QACA,eACA,eACA,UAGR,eAAS,CAED,QACA,eACA,eACA,UAGR,eAAS,CAED,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAAO,MAGP,QACA,cACA,eACA,YAGR,qBAAe,CAEP,QACA,iBACA,eACA,UAAO,MAGP,QACA,kBACA,eACA,UAAO,MAGP,QACA,kBACA,eACA,UAGR,2BAAqB,CAEb,QACA,iBACA,eACA,UAAO,MAGP,QACA,kBACA,eACA,UAAO,MAGP,QACA,kBACA,eACA,UAGR,uBAAiB,CAET,QACA,cACA,eACA,UAGR,kBAAY,CAEJ,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,aAGR,kBAAY,CAEJ,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,aAAO,CAEC,QACA,eACA,iBACA,UAGR,gBAAU,CAEF,QACA,eACA,eACA,UAAO,MAGP,QACA,cACA,eACA,UAGR,oBAAc,CAEN,QACA,eACA,eACA,UAGR,mBAAa,CAEL,QACA,eACA,eACA,UAAO,GAGP,QACA,eACA,eACA,UAGR,oBAAc,CAEN,QACA,eACA,eACA,UAAO,MAGP,QACA,cACA,eACA,YAGR,gBAAU,CAEF,QACA,iBACA,eACA,UAAO,MAGP,QACA,iBACA,eACA,UAAO,MAGP,QACA,iBACA,eACA,UAGR,wBAAkB,CAEV,QACA,eACA,eACA,UAGR,uBAAiB,CAET,QACA,eACA,eACA,UAAO,MAGP,QACA,gBACA,eACA,UAGR,eAAS,CAED,QACA,eACA,eACA,UAAO,MAGP,QACA,mBACA,eACA,UAAO,MAGP,QACA,iBACA,eACA,UAGR,qBAAe,CAEP,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAIZ,mBACI,KAAK,CAEG,QACA,aACA,eACA,SAGR,0BAAuB,CAEf,QACA,aACA,eACA,SAGR,WAAK,CAEG,QACA,eACA,eACA,UAGR,mBAAa,CAEL,QACA,eACA,eACA,UAGR,eAAS,CAED,QACA,eACA,eACA,UAGR,oBAAc,CAEN,QACA,eACA,eACA,UAGR,eAAS,CAED,QACA,cACA,eACA,UAGR,4BAAsB,CAEd,QACA,eACA,eACA,UAGR,iCAA2B,CAEnB,QACA,gBACA,eACA,UAAO,MAGP,QACA,gBACA,eACA,UAGR,YAAM,CAEE,QACA,eACA,eACA,UAAO,MAGP,QACA,iBACA,eACA,UAAO,MAGP,QACA,qBACA,eACA,UAGR,kBAAY,CAEJ,QACA,cACA,eACA,UAGR,mBAAa,CAEL,QACA,eACA,eACA,UAGR,4BAAsB,CAEd,QACA,eACA,eACA,UAGR,uBAAiB,CAET,QACA,eACA,eACA,UAGR,qBAAe,CAEP,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,eAAS,CAED,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAAO,MAGP,QACA,gBACA,eACA,UAGR,6BAAuB,CAEf,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,yBAAmB,CAEX,QACA,iBACA,eACA,UAAO,MAGP,QACA,gBACA,eACA,UAAO,GAGP,QACA,gBACA,eACA,UAGR,yBAAmB,CAEX,QACA,cACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,0BAAoB,CAEZ,QACA,eACA,eACA,UAGR,eAAS,CAED,QACA,eACA,eACA,UAGR,eAAS,CAED,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAAO,MAGP,QACA,cACA,eACA,YAGR,qBAAe,CAEP,QACA,iBACA,eACA,UAAO,MAGP,QACA,kBACA,eACA,UAAO,MAGP,QACA,kBACA,eACA,UAGR,0BAAqB,CAEb,QACA,iBACA,eACA,UAAO,MAGP,QACA,kBACA,eACA,UAAO,MAGP,QACA,kBACA,eACA,UAGR,uBAAiB,CAET,QACA,cACA,eACA,UAGR,kBAAY,CAEJ,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,aAGR,kBAAY,CAEJ,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,aAAO,CAEC,QACA,eACA,iBACA,UAGR,gBAAU,CAEF,QACA,eACA,eACA,UAAO,MAGP,QACA,cACA,eACA,UAGR,oBAAc,CAEN,QACA,eACA,eACA,UAGR,mBAAa,CAEL,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,oBAAc,CAEN,QACA,eACA,eACA,UAAO,KAGP,QACA,cACA,eACA,YAGR,eAAU,CAEF,QACA,iBACA,eACA,UAAO,MAGP,QACA,iBACA,eACA,UAAO,MAGP,QACA,iBACA,eACA,UAGR,wBAAkB,CAEV,QACA,eACA,eACA,UAGR,uBAAiB,CAET,QACA,eACA,eACA,UAAO,MAGP,QACA,gBACA,eACA,UAGR,eAAS,CAED,QACA,eACA,eACA,UAAO,MAGP,QACA,mBACA,eACA,UAAO,KAGP,QACA,iBACA,eACA,UAGR,oBAAe,CAEP,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAIZ,aACI,KAAK,CAEG,QACA,aACA,eACA,SAGR,0BAAuB,CAEf,QACA,aACA,eACA,cAGR,UAAK,CAEG,QACA,eACA,eACA,UAGR,mBAAa,CAEL,QACA,eACA,eACA,UAGR,eAAS,CAED,QACA,eACA,eACA,UAGR,oBAAc,CAEN,QACA,eACA,eACA,UAGR,eAAS,CAED,QACA,cACA,eACA,UAGR,4BAAsB,CAEd,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,iCAA2B,CAEnB,QACA,gBACA,eACA,UAAO,MAGP,QACA,gBACA,eACA,UAGR,YAAM,CAEE,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAAO,MAGP,QACA,iBACA,eACA,UAAO,MAGP,QACA,qBACA,eACA,UAGR,kBAAY,CAEJ,QACA,cACA,eACA,UAGR,mBAAa,CAEL,QACA,eACA,eACA,UAGR,2BAAsB,CAEd,QACA,eACA,eACA,UAGR,sBAAiB,CAET,QACA,eACA,eACA,UAGR,qBAAe,CAEP,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,eAAS,CAED,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAAO,MAGP,QACA,gBACA,eACA,UAGR,6BAAuB,CAEf,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,yBAAmB,CAEX,QACA,iBACA,eACA,UAAO,MAGP,QACA,gBACA,eACA,UAAO,MAGP,QACA,gBACA,eACA,UAGR,yBAAmB,CAEX,QACA,cACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,0BAAoB,CAEZ,QACA,eACA,eACA,UAGR,eAAS,CAED,QACA,eACA,eACA,UAGR,eAAS,CAED,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAAO,MAGP,QACA,cACA,eACA,YAGR,qBAAe,CAEP,QACA,iBACA,eACA,UAAO,MAGP,QACA,kBACA,eACA,UAAO,MAGP,QACA,kBACA,eACA,UAGR,2BAAqB,CAEb,QACA,iBACA,eACA,UAAO,MAGP,QACA,kBACA,eACA,UAAO,MAGP,QACA,kBACA,eACA,UAGR,uBAAiB,CAET,QACA,cACA,eACA,UAGR,OACA,yBAAY,CAEJ,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,aAAO,CAEC,QACA,eACA,iBACA,UAGR,gBAAU,CAEF,QACA,eACA,eACA,UAAO,MAGP,QACA,cACA,eACA,UAGR,oBAAc,CAEN,QACA,eACA,eACA,UAGR,mBAAa,CAEL,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,oBAAc,CAEN,QACA,eACA,eACA,UAAO,MAGP,QACA,cACA,eACA,YAGR,gBAAU,CAEF,QACA,iBACA,eACA,UAAO,MAGP,QACA,iBACA,eACA,UAAO,MAGP,QACA,iBACA,eACA,UAGR,OACA,oCAAiB,CAET,QACA,eACA,eACA,UAAO,MAGP,QACA,gBACA,eACA,UAGR,cAAS,CAED,QACA,eACA,eACA,UAAO,KAGP,QACA,mBACA,eACA,UAAO,MAGP,QACA,iBACA,eACA,UAGR,qBAAe,CAEP,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAIZ,aACI,KAAK,CAEG,QACA,aACA,eACA,SAGR,0BAAuB,CAEf,QACA,aACA,eACA,SAGR,WAAK,CAEG,QACA,eACA,eACA,UAGR,kBAAa,CAEL,QACA,eACA,eACA,UAGR,eAAS,CAED,QACA,eACA,eACA,UAGR,oBAAc,CAEN,QACA,eACA,eACA,UAGR,eAAS,CAED,QACA,cACA,eACA,UAGR,4BAAsB,CAEd,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,iCAA2B,CAEnB,QACA,gBACA,eACA,UAAO,MAGP,QACA,gBACA,eACA,UAGR,YAAM,CAEE,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAAO,MAGP,QACA,iBACA,eACA,UAAO,MAGP,QACA,qBACA,eACA,UAGR,kBAAY,CAEJ,QACA,cACA,eACA,UAGR,mBAAa,CAEL,QACA,eACA,eACA,UAGR,2BAAsB,CAEd,QACA,eACA,eACA,UAGR,sBAAiB,CAET,QACA,eACA,eACA,UAGR,qBAAe,CAEP,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,eAAS,CAED,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAAO,MAGP,QACA,gBACA,eACA,UAGR,6BAAuB,CAEf,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,yBAAmB,CAEX,QACA,iBACA,eACA,UAAO,KAGP,QACA,gBACA,eACA,UAAO,MAGP,QACA,gBACA,eACA,UAGR,yBAAmB,CAEX,QACA,cACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,0BAAoB,CAEZ,QACA,eACA,eACA,UAGR,eAAS,CAED,QACA,eACA,eACA,UAGR,eAAS,CAED,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,qBAAe,CAEP,QACA,iBACA,eACA,UAAO,MAGP,QACA,kBACA,eACA,UAAO,MAGP,QACA,kBACA,eACA,UAGR,2BAAqB,CAEb,QACA,iBACA,eACA,UAAO,MAGP,QACA,kBACA,eACA,UAAO,MAGP,QACA,kBACA,eACA,UAGR,uBAAiB,CAET,QACA,cACA,eACA,UAGR,kBAAY,CAEJ,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,aAGR,kBAAY,CAEJ,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,aAAO,CAEC,QACA,eACA,iBACA,UAGR,eAAU,CAEF,QACA,eACA,eACA,UAGR,oBAAc,CAEN,QACA,eACA,eACA,UAGR,mBAAa,CAEL,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,oBAAc,CAEN,QACA,eACA,eACA,UAAO,MAGP,QACA,cACA,eACA,YAGR,gBAAU,CAEF,QACA,iBACA,eACA,UAAO,MAGP,QACA,iBACA,eACA,UAAO,MAGP,QACA,iBACA,eACA,UAGR,wBAAkB,CAEV,QACA,eACA,eACA,UAGR,uBAAiB,CAET,QACA,eACA,eACA,UAAO,KAGP,QACA,gBACA,eACA,UAGR,eAAS,CAED,QACA,eACA,eACA,UAAO,MAGP,QACA,mBACA,eACA,UAAO,MAGP,QACA,iBACA,eACA,UAGR,qBAAe,CAEP,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAIZ,aACI,KAAK,CAEG,QACA,aACA,eACA,SAGR,0BAAuB,CAEf,QACA,aACA,eACA,SAGR,WAAK,CAEG,QACA,eACA,eACA,UAGR,mBAAa,CAEL,QACA,eACA,eACA,UAGR,eAAS,CAED,QACA,eACA,eACA,UAGR,oBAAc,CAEN,QACA,eACA,eACA,UAGR,eAAS,CAED,QACA,cACA,eACA,UAGR,4BAAsB,CAEd,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,iCAA2B,CAEnB,QACA,gBACA,eACA,UAAO,MAGP,QACA,gBACA,eACA,UAGR,YAAM,CAEE,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAAO,KAGP,QACA,iBACA,eACA,UAAO,MAGP,QACA,qBACA,eACA,UAGR,kBAAY,CAEJ,QACA,cACA,eACA,UAGR,mBAAa,CAEL,QACA,eACA,eACA,UAGR,4BAAsB,CAEd,QACA,eACA,eACA,UAGR,uBAAiB,CAET,QACA,eACA,eACA,UAGR,qBAAe,CAEP,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,eAAS,CAED,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAAO,MAGP,QACA,gBACA,eACA,UAGR,6BAAuB,CAEf,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,yBAAmB,CAEX,QACA,iBACA,eACA,UAAO,MAGP,QACA,gBACA,eACA,UAAO,MAGP,QACA,gBACA,eACA,UAGR,yBAAmB,CAEX,QACA,cACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,0BAAoB,CAEZ,QACA,eACA,eACA,UAGR,cAAS,CAED,QACA,eACA,eACA,UAGR,cAAS,CAED,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAAO,MAGP,QACA,cACA,eACA,YAGR,qBAAe,CAEP,QACA,iBACA,eACA,UAAO,MAGP,QACA,kBACA,eACA,UAAO,MAGP,QACA,kBACA,eACA,UAGR,0BAAqB,CAEb,QACA,iBACA,eACA,UAAO,MAGP,QACA,kBACA,eACA,UAAO,MAGP,QACA,kBACA,eACA,UAGR,uBAAiB,CAET,QACA,cACA,eACA,UAGR,kBAAY,CAEJ,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,aAGR,kBAAY,CAEJ,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,aAAO,CAEC,QACA,eACA,iBACA,UAGR,gBAAU,CAEF,QACA,eACA,eACA,UAAO,MAGP,QACA,cACA,eACA,UAGR,oBAAc,CAEN,QACA,eACA,eACA,UAGR,mBAAa,CAEL,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,oBAAc,CAEN,QACA,eACA,eACA,UAAO,MAGP,QACA,cACA,eACA,YAGR,gBAAU,CAEF,QACA,iBACA,eACA,UAAO,MAGP,QACA,iBACA,eACA,UAAO,MAGP,QACA,iBACA,eACA,UAGR,wBAAkB,CAEV,QACA,eACA,eACA,UAGR,uBAAiB,CAET,QACA,eACA,eACA,UAAO,KAGP,QACA,gBACA,eACA,UAGR,eAAS,CAED,QACA,eACA,eACA,UAAO,MAGP,QACA,mBACA,eACA,UAAO,KAGP,QACA,iBACA,eACA,UAGR,oBAAe,CAEP,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAIZ,cACI,KAAK,CAEG,QACA,aACA,eACA,SAGR,0BAAuB,CAEf,QACA,aACA,eACA,SAGR,WAAK,CAEG,QACA,eACA,eACA,UAGR,mBAAa,CAEL,QACA,eACA,eACA,UAGR,eAAS,CAED,QACA,eACA,eACA,UAGR,oBAAc,CAEN,QACA,eACA,eACA,UAGR,eAAS,CAED,QACA,cACA,eACA,UAGR,4BAAsB,CAEd,QACA,eACA,eACA,UAGR,gCAA2B,CAEnB,QACA,gBACA,eACA,UAAO,MAGP,QACA,gBACA,eACA,UAGR,WAAM,CAEE,QACA,eACA,eACA,UAAO,MAGP,QACA,iBACA,eACA,UAAO,MAGP,QACA,qBACA,eACA,UAGR,iBAAY,CAEJ,QACA,cACA,eACA,UAGR,kBAAa,CAEL,QACA,eACA,eACA,UAGR,4BAAsB,CAEd,QACA,eACA,eACA,UAGR,uBAAiB,CAET,QACA,eACA,eACA,UAGR,qBAAe,CAEP,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,eAAS,CAED,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAAO,MAGP,QACA,gBACA,eACA,UAGR,6BAAuB,CAEf,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,yBAAmB,CAEX,QACA,iBACA,eACA,UAAO,MAGP,QACA,gBACA,eACA,UAAO,MAGP,QACA,gBACA,eACA,UAGR,yBAAmB,CAEX,QACA,cACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,0BAAoB,CAEZ,QACA,eACA,eACA,UAGR,eAAS,CAED,QACA,eACA,eACA,UAGR,eAAS,CAED,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,oBAAe,CAEP,QACA,iBACA,eACA,UAAO,MAGP,QACA,kBACA,eACA,UAAO,MAGP,QACA,kBACA,eACA,UAGR,2BAAqB,CAEb,QACA,iBACA,eACA,UAAO,MAGP,QACA,kBACA,eACA,UAAO,KAGP,QACA,kBACA,eACA,UAGR,uBAAiB,CAET,QACA,cACA,eACA,UAGR,kBAAY,CAEJ,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,aAGR,kBAAY,CAEJ,QACA,eACA,eACA,UAAO,KAGP,QACA,eACA,eACA,UAGR,aAAO,CAEC,QACA,eACA,iBACA,UAGR,gBAAU,CAEF,QACA,eACA,eACA,UAGR,oBAAc,CAEN,QACA,eACA,eACA,UAGR,mBAAa,CAEL,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,oBAAc,CAEN,QACA,eACA,eACA,UAAO,KAGP,QACA,cACA,eACA,YAGR,gBAAU,CAEF,QACA,iBACA,eACA,UAAO,MAGP,QACA,iBACA,eACA,UAAO,MAGP,QACA,iBACA,eACA,UAGR,wBAAkB,CAEV,QACA,eACA,eACA,UAGR,sBAAiB,CAET,QACA,eACA,eACA,UAAO,MAGP,QACA,gBACA,eACA,UAGR,eAAS,CAED,QACA,eACA,eACA,UAAO,MAGP,QACA,mBACA,eACA,UAAO,MAGP,QACA,iBACA,eACA,UAGR,qBAAe,CAEP,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAIZ,YACI,KAAK,CAEG,QACA,aACA,eACA,SAGR,0BAAuB,CAEf,QACA,aACA,eACA,SAGR,OACA,mBAAa,CAEL,QACA,eACA,eACA,UAGR,eAAS,CAED,QACA,eACA,eACA,UAGR,oBAAc,CAEN,QACA,eACA,eACA,UAGR,OACA,gCAAsB,CAEd,QACA,eACA,eACA,UAGR,iCAA2B,CAEnB,QACA,gBACA,eACA,UAAO,MAGP,QACA,gBACA,eACA,UAGR,OACA,QACA,cACA,eACA,wBACA,iCAAe,CAEP,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,eAAS,CAED,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAAO,MAGP,QACA,gBACA,eACA,UAGR,6BAAuB,CAEf,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,wBAAmB,CAEX,QACA,iBACA,eACA,UAAO,MAGP,QACA,gBACA,eACA,UAAO,MAGP,QACA,gBACA,eACA,UAGR,wBAAmB,CAEX,QACA,cACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,0BAAoB,CAEZ,QACA,eACA,eACA,UAGR,eAAS,CAED,QACA,eACA,eACA,UAGR,eAAS,CAED,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAGR,qBAAe,CAEP,QACA,iBACA,eACA,UAAO,MAGP,QACA,kBACA,eACA,UAAO,MAGP,QACA,kBACA,eACA,UAGR,2BAAqB,CAEb,QACA,iBACA,eACA,UAAO,MAGP,QACA,kBACA,eACA,UAAO,MAGP,QACA,kBACA,eACA,UAGR,uBAAiB,CAET,QACA,cACA,eACA,UAGR,OACA,cACA,oBAAO,CAEC,QACA,eACA,iBACA,UAGR,gBAAU,CAEF,QACA,eACA,eACA,UAGR,oBAAc,CAEN,QACA,eACA,eACA,UAGR,kBAAa,CAEL,QACA,eACA,eACA,UAGR,mBAAc,CAEN,QACA,eACA,eACA,UAAO,MAGP,QACA,cACA,eACA,YAGR,gBAAU,CAEF,QACA,iBACA,eACA,UAAO,MAGP,QACA,iBACA,eACA,UAAO,MAGP,QACA,iBACA,eACA,UAGR,OACA,oCAAiB,CAET,QACA,eACA,eACA,UAAO,MAGP,QACA,gBACA,eACA,UAGR,OACA,yBAAe,CAEP,QACA,eACA,eACA,UAAO,MAGP,QACA,eACA,eACA,UAAO,mOCvjGf,kGACA,yCCoDmB,eACvB,IAAI,GACJ,KAAmB,CAAf,KAAI,SAAc,EACtB,cAAgB,MAHgB,eAIhC,WAAkB,gDAAQ,SACtB,MACH,iBAN+B,oEAOhC,OACI,EADA,GAAU,OACH,EAAM,EAAU,KAEvB,MAEP,GAE2B,aACxB,IACA,MAAI,EAAU,EAAc,EAAQ,SACpC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EAAI,EAAe,OAC/B,IAAmB,MACf,YAAa,QAGxB,KACJ,CAIT,KAAK,GAAI,GAAI,EAAO,IAChB,QAAK,GAAI,GAAI,EAAO,IAChB,MAAQ,EACR,IACI,OAAO,KAAS,EAAO,KAAY,MAI/C,OAEH,uBCjFD,aA0EyB,aACrB,MACA,aAAK,OACL,UAAK,KACR,C,CAND,EAAiB,QArEX,KACF,cACI,MAAK,MAAQ,GAChB,IAOD,CAAI,MACA,IAAI,GAAO,KAAK,MAEZ,OAIP,aAHO,cAAK,MAET,WAQJ,CAAS,UACL,IAAM,GAAQ,KACd,QAAM,EAAQ,KACd,QAGA,QAAI,EAAM,KAAO,EACb,OACG,SAAI,EAAM,KAAO,EACpB,OAEA,YACA,WAEP,QAOD,CAAK,OACD,QACA,KACI,IADG,KAAM,UACD,EAEZ,cACA,KAA4B,IAArB,KAAU,QACb,IACA,OAAY,EACZ,SACH,QACD,CACH,QAOD,CAAa,cACT,OAAO,MAAU,UAAO,KAC3B,OAlEa","file":"spectra-data.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"spectraData\"] = factory();\n\telse\n\t\troot[\"spectraData\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","'use strict';\n\n/**\n *\n * Function that returns a Number array of equally spaced numberOfPoints\n * containing a representation of intensities of the spectra arguments x\n * and y.\n *\n * The options parameter contains an object in the following form:\n * from: starting point\n * to: last point\n * numberOfPoints: number of points between from and to\n * variant: \"slot\" or \"smooth\" - smooth is the default option\n *\n * The slot variant consist that each point in the new array is calculated\n * averaging the existing points between the slot that belongs to the current\n * value. The smooth variant is the same but takes the integral of the range\n * of the slot and divide by the step size between two points in the new array.\n *\n * @param x - sorted increasing x values\n * @param y\n * @param options\n * @returns {Array} new array with the equally spaced data.\n *\n */\nfunction getEquallySpacedData(x, y, options) {\n    if (x.length>1 && x[0]>x[1]) {\n        x=x.slice().reverse();\n        y=y.slice().reverse();\n    }\n\n    var xLength = x.length;\n    if(xLength !== y.length)\n        throw new RangeError(\"the x and y vector doesn't have the same size.\");\n\n    if (options === undefined) options = {};\n\n    var from = options.from === undefined ? x[0] : options.from\n    if (isNaN(from) || !isFinite(from)) {\n        throw new RangeError(\"'From' value must be a number\");\n    }\n    var to = options.to === undefined ? x[x.length - 1] : options.to;\n    if (isNaN(to) || !isFinite(to)) {\n        throw new RangeError(\"'To' value must be a number\");\n    }\n\n    var reverse = from > to;\n    if(reverse) {\n        var temp = from;\n        from = to;\n        to = temp;\n    }\n\n    var numberOfPoints = options.numberOfPoints === undefined ? 100 : options.numberOfPoints;\n    if (isNaN(numberOfPoints) || !isFinite(numberOfPoints)) {\n        throw new RangeError(\"'Number of points' value must be a number\");\n    }\n    if(numberOfPoints < 1)\n        throw new RangeError(\"the number of point must be higher than 1\");\n\n    var algorithm = options.variant === \"slot\" ? \"slot\" : \"smooth\"; // default value: smooth\n\n    var output = algorithm === \"slot\" ? getEquallySpacedSlot(x, y, from, to, numberOfPoints) : getEquallySpacedSmooth(x, y, from, to, numberOfPoints);\n\n    return reverse ? output.reverse() : output;\n}\n\n/**\n * function that retrieves the getEquallySpacedData with the variant \"smooth\"\n *\n * @param x\n * @param y\n * @param from - Initial point\n * @param to - Final point\n * @param numberOfPoints\n * @returns {Array} - Array of y's equally spaced with the variant \"smooth\"\n */\nfunction getEquallySpacedSmooth(x, y, from, to, numberOfPoints) {\n    var xLength = x.length;\n\n    var step = (to - from) / (numberOfPoints - 1);\n    var halfStep = step / 2;\n\n    var start = from - halfStep;\n    var output = new Array(numberOfPoints);\n\n    var initialOriginalStep = x[1] - x[0];\n    var lastOriginalStep = x[x.length - 1] - x[x.length - 2];\n\n    // Init main variables\n    var min = start;\n    var max = start + step;\n\n    var previousX = Number.MIN_VALUE;\n    var previousY = 0;\n    var nextX = x[0] - initialOriginalStep;\n    var nextY = 0;\n\n    var currentValue = 0;\n    var slope = 0;\n    var intercept = 0;\n    var sumAtMin = 0;\n    var sumAtMax = 0;\n\n    var i = 0; // index of input\n    var j = 0; // index of output\n\n    function getSlope(x0, y0, x1, y1) {\n        return (y1 - y0) / (x1 - x0);\n    }\n\n    main: while(true) {\n        while (nextX - max >= 0) {\n            // no overlap with original point, just consume current value\n            var add = integral(0, max - previousX, slope, previousY);\n            sumAtMax = currentValue + add;\n\n            output[j] = (sumAtMax - sumAtMin) / step;\n            j++;\n\n            if (j === numberOfPoints)\n                break main;\n\n            min = max;\n            max += step;\n            sumAtMin = sumAtMax;\n        }\n\n        if(previousX <= min && min <= nextX) {\n            add = integral(0, min - previousX, slope, previousY);\n            sumAtMin = currentValue + add;\n        }\n\n        currentValue += integral(previousX, nextX, slope, intercept);\n\n        previousX = nextX;\n        previousY = nextY;\n\n        if (i < xLength) {\n            nextX = x[i];\n            nextY = y[i];\n            i++;\n        } else if (i === xLength) {\n            nextX += lastOriginalStep;\n            nextY = 0;\n        }\n        // updating parameters\n        slope = getSlope(previousX, previousY, nextX, nextY);\n        intercept = -slope*previousX + previousY;\n    }\n\n    return output;\n}\n\n/**\n * function that retrieves the getEquallySpacedData with the variant \"slot\"\n *\n * @param x\n * @param y\n * @param from - Initial point\n * @param to - Final point\n * @param numberOfPoints\n * @returns {Array} - Array of y's equally spaced with the variant \"slot\"\n */\nfunction getEquallySpacedSlot(x, y, from, to, numberOfPoints) {\n    var xLength = x.length;\n\n    var step = (to - from) / (numberOfPoints - 1);\n    var halfStep = step / 2;\n    var lastStep = x[x.length - 1] - x[x.length - 2];\n\n    var start = from - halfStep;\n    var output = new Array(numberOfPoints);\n\n    // Init main variables\n    var min = start;\n    var max = start + step;\n\n    var previousX = -Number.MAX_VALUE;\n    var previousY = 0;\n    var nextX = x[0];\n    var nextY = y[0];\n    var frontOutsideSpectra = 0;\n    var backOutsideSpectra = true;\n\n    var currentValue = 0;\n\n    // for slot algorithm\n    var currentPoints = 0;\n\n    var i = 1; // index of input\n    var j = 0; // index of output\n\n    main: while(true) {\n        if (previousX>=nextX) throw (new Error('x must be an increasing serie'));\n        while (previousX - max > 0) {\n            // no overlap with original point, just consume current value\n            if(backOutsideSpectra) {\n                currentPoints++;\n                backOutsideSpectra = false;\n            }\n\n            output[j] = currentPoints <= 0 ? 0 : currentValue / currentPoints;\n            j++;\n\n            if (j === numberOfPoints)\n                break main;\n\n            min = max;\n            max += step;\n            currentValue = 0;\n            currentPoints = 0;\n        }\n\n        if(previousX > min) {\n            currentValue += previousY;\n            currentPoints++;\n        }\n\n        if(previousX === -Number.MAX_VALUE || frontOutsideSpectra > 1)\n            currentPoints--;\n\n        previousX = nextX;\n        previousY = nextY;\n\n        if (i < xLength) {\n            nextX = x[i];\n            nextY = y[i];\n            i++;\n        } else {\n            nextX += lastStep;\n            nextY = 0;\n            frontOutsideSpectra++;\n        }\n    }\n\n    return output;\n}\n/**\n * Function that calculates the integral of the line between two\n * x-coordinates, given the slope and intercept of the line.\n *\n * @param x0\n * @param x1\n * @param slope\n * @param intercept\n * @returns {number} integral value.\n */\nfunction integral(x0, x1, slope, intercept) {\n    return (0.5 * slope * x1 * x1 + intercept * x1) - (0.5 * slope * x0 * x0 + intercept * x0);\n}\n\nexports.getEquallySpacedData = getEquallySpacedData;\nexports.integral = integral;\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-array-utils/src/getEquallySpaced.js","/**\n * Fast Fourier Transform module\n * 1D-FFT/IFFT, 2D-FFT/IFFT (radix-2)\n */\nvar FFT = (function(){\n  var FFT;  \n  \n  if(typeof exports !== 'undefined') {\n    FFT = exports;   // for CommonJS\n  } else {\n    FFT = {};\n  }\n  \n  var version = {\n    release: '0.3.0',\n    date: '2013-03'\n  };\n  FFT.toString = function() {\n    return \"version \" + version.release + \", released \" + version.date;\n  };\n\n  // core operations\n  var _n = 0,          // order\n      _bitrev = null,  // bit reversal table\n      _cstb = null;    // sin/cos table\n\n  var core = {\n    init : function(n) {\n      if(n !== 0 && (n & (n - 1)) === 0) {\n        _n = n;\n        core._initArray();\n        core._makeBitReversalTable();\n        core._makeCosSinTable();\n      } else {\n        throw new Error(\"init: radix-2 required\");\n      }\n    },\n    // 1D-FFT\n    fft1d : function(re, im) {\n      core.fft(re, im, 1);\n    },\n    // 1D-IFFT\n    ifft1d : function(re, im) {\n      var n = 1/_n;\n      core.fft(re, im, -1);\n      for(var i=0; i<_n; i++) {\n        re[i] *= n;\n        im[i] *= n;\n      }\n    },\n     // 1D-IFFT\n    bt1d : function(re, im) {\n      core.fft(re, im, -1);\n    },\n    // 2D-FFT Not very useful if the number of rows have to be equal to cols\n    fft2d : function(re, im) {\n      var tre = [],\n          tim = [],\n          i = 0;\n      // x-axis\n      for(var y=0; y<_n; y++) {\n        i = y*_n;\n        for(var x1=0; x1<_n; x1++) {\n          tre[x1] = re[x1 + i];\n          tim[x1] = im[x1 + i];\n        }\n        core.fft1d(tre, tim);\n        for(var x2=0; x2<_n; x2++) {\n          re[x2 + i] = tre[x2];\n          im[x2 + i] = tim[x2];\n        }\n      }\n      // y-axis\n      for(var x=0; x<_n; x++) {\n        for(var y1=0; y1<_n; y1++) {\n          i = x + y1*_n;\n          tre[y1] = re[i];\n          tim[y1] = im[i];\n        }\n        core.fft1d(tre, tim);\n        for(var y2=0; y2<_n; y2++) {\n          i = x + y2*_n;\n          re[i] = tre[y2];\n          im[i] = tim[y2];\n        }\n      }\n    },\n    // 2D-IFFT\n    ifft2d : function(re, im) {\n      var tre = [],\n          tim = [],\n          i = 0;\n      // x-axis\n      for(var y=0; y<_n; y++) {\n        i = y*_n;\n        for(var x1=0; x1<_n; x1++) {\n          tre[x1] = re[x1 + i];\n          tim[x1] = im[x1 + i];\n        }\n        core.ifft1d(tre, tim);\n        for(var x2=0; x2<_n; x2++) {\n          re[x2 + i] = tre[x2];\n          im[x2 + i] = tim[x2];\n        }\n      }\n      // y-axis\n      for(var x=0; x<_n; x++) {\n        for(var y1=0; y1<_n; y1++) {\n          i = x + y1*_n;\n          tre[y1] = re[i];\n          tim[y1] = im[i];\n        }\n        core.ifft1d(tre, tim);\n        for(var y2=0; y2<_n; y2++) {\n          i = x + y2*_n;\n          re[i] = tre[y2];\n          im[i] = tim[y2];\n        }\n      }\n    },\n    // core operation of FFT\n    fft : function(re, im, inv) {\n      var d, h, ik, m, tmp, wr, wi, xr, xi,\n          n4 = _n >> 2;\n      // bit reversal\n      for(var l=0; l<_n; l++) {\n        m = _bitrev[l];\n        if(l < m) {\n          tmp = re[l];\n          re[l] = re[m];\n          re[m] = tmp;\n          tmp = im[l];\n          im[l] = im[m];\n          im[m] = tmp;\n        }\n      }\n      // butterfly operation\n      for(var k=1; k<_n; k<<=1) {\n        h = 0;\n        d = _n/(k << 1);\n        for(var j=0; j<k; j++) {\n          wr = _cstb[h + n4];\n          wi = inv*_cstb[h];\n          for(var i=j; i<_n; i+=(k<<1)) {\n            ik = i + k;\n            xr = wr*re[ik] + wi*im[ik];\n            xi = wr*im[ik] - wi*re[ik];\n            re[ik] = re[i] - xr;\n            re[i] += xr;\n            im[ik] = im[i] - xi;\n            im[i] += xi;\n          }\n          h += d;\n        }\n      }\n    },\n    // initialize the array (supports TypedArray)\n    _initArray : function() {\n      if(typeof Uint32Array !== 'undefined') {\n        _bitrev = new Uint32Array(_n);\n      } else {\n        _bitrev = [];\n      }\n      if(typeof Float64Array !== 'undefined') {\n        _cstb = new Float64Array(_n*1.25);\n      } else {\n        _cstb = [];\n      }\n    },\n    // zero padding\n    _paddingZero : function() {\n      // TODO\n    },\n    // makes bit reversal table\n    _makeBitReversalTable : function() {\n      var i = 0,\n          j = 0,\n          k = 0;\n      _bitrev[0] = 0;\n      while(++i < _n) {\n        k = _n >> 1;\n        while(k <= j) {\n          j -= k;\n          k >>= 1;\n        }\n        j += k;\n        _bitrev[i] = j;\n      }\n    },\n    // makes trigonometiric function table\n    _makeCosSinTable : function() {\n      var n2 = _n >> 1,\n          n4 = _n >> 2,\n          n8 = _n >> 3,\n          n2p4 = n2 + n4,\n          t = Math.sin(Math.PI/_n),\n          dc = 2*t*t,\n          ds = Math.sqrt(dc*(2 - dc)),\n          c = _cstb[n4] = 1,\n          s = _cstb[0] = 0;\n      t = 2*dc;\n      for(var i=1; i<n8; i++) {\n        c -= dc;\n        dc += t*c;\n        s += ds;\n        ds -= t*s;\n        _cstb[i] = s;\n        _cstb[n4 - i] = c;\n      }\n      if(n8 !== 0) {\n        _cstb[n8] = Math.sqrt(0.5);\n      }\n      for(var j=0; j<n4; j++) {\n        _cstb[n2 - j]  = _cstb[j];\n      }\n      for(var k=0; k<n2p4; k++) {\n        _cstb[k + n2] = -_cstb[k];\n      }\n    }\n  };\n  // aliases (public APIs)\n  var apis = ['init', 'fft1d', 'ifft1d', 'fft2d', 'ifft2d'];\n  for(var i=0; i<apis.length; i++) {\n    FFT[apis[i]] = core[apis[i]];\n  }\n  FFT.bt = core.bt1d;\n  FFT.fft = core.fft1d;\n  FFT.ifft = core.ifft1d;\n  \n  return FFT;\n}).call(this);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-fft/src/fftlib.js","/**\n * Created by acastillo on 8/24/15.\n */\n/**\n * Non in-place function definitions, compatible with mathjs code *\n */\n\n'use strict';\n\nvar Matrix = require('ml-matrix');\n\nfunction matrix(A,B){\n    return new Matrix(A,B);\n}\n\nfunction ones(rows, cols){\n    return Matrix.ones(rows,cols);\n}\n\nfunction eye(rows, cols){\n    return Matrix.eye(rows, cols);\n}\n\nfunction zeros(rows, cols){\n    return Matrix.zeros(rows, cols);\n}\n\nfunction random(rows, cols){\n    return Matrix.rand(rows,cols);\n}\n\nfunction transpose(A){\n    if(typeof A == 'number')\n        return A;\n    var result = A.clone();\n    return result.transpose();\n}\n\nfunction add(A, B){\n    if(typeof A == 'number'&&typeof B === 'number')\n        return A+B;\n    if(typeof A == 'number')\n        return this.add(B,A);\n\n    var result = A.clone();\n    return result.add(B);\n\n}\n\nfunction subtract(A, B){\n    if(typeof A == 'number'&&typeof B === 'number')\n        return A-B;\n    if(typeof A == 'number')\n        return this.subtract(B,A);\n    var result = A.clone();\n    return result.sub(B);\n}\n\nfunction multiply(A, B){\n    if(typeof A == 'number'&&typeof B === 'number')\n        return A*B;\n    if(typeof A == 'number')\n        return this.multiply(B,A);\n\n    var result = A.clone();\n\n    if(typeof B === 'number')\n        result.mul(B);\n    else\n        result = result.mmul(B);\n\n    if(result.rows==1&&result.columns==1)\n        return result[0][0];\n    else\n        return result;\n\n}\n\nfunction dotMultiply(A, B){\n    var result = A.clone();\n    return result.mul(B);\n}\n\nfunction dotDivide(A, B){\n    var result = A.clone();\n    return result.div(B);\n}\n\nfunction diag(A){\n    var diag = null;\n    var rows = A.rows, cols = A.columns, j, r;\n    //It is an array\n    if(typeof cols === \"undefined\" && (typeof A)=='object'){\n        if(A[0]&&A[0].length){\n            rows = A.length;\n            cols = A[0].length;\n            r = Math.min(rows,cols);\n            diag = Matrix.zeros(cols, cols);\n            for (j = 0; j < cols; j++) {\n                diag[j][j]=A[j][j];\n            }\n        }\n        else{\n            cols = A.length;\n            diag = Matrix.zeros(cols, cols);\n            for (j = 0; j < cols; j++) {\n                diag[j][j]=A[j];\n            }\n        }\n\n    }\n    if(rows == 1){\n        diag = Matrix.zeros(cols, cols);\n        for (j = 0; j < cols; j++) {\n            diag[j][j]=A[0][j];\n        }\n    }\n    else{\n        if(rows>0 && cols > 0){\n            r = Math.min(rows,cols);\n            diag = new Array(r);\n            for (j = 0; j < r; j++) {\n                diag[j] = A[j][j];\n            }\n        }\n    }\n    return diag;\n}\n\nfunction min(A, B){\n    if(typeof A==='number' && typeof B ==='number')\n        return Math.min(A,B);\n    var ii = A.rows, jj = A.columns;\n    var result = new Matrix(ii,jj);\n    for (var i = 0; i < ii; i++) {\n        for (var j = 0; j < jj; j++) {\n            if (A[i][j] < B[i][j]) {\n                result[i][j] = A[i][j];\n            }\n            else{\n                result[i][j] = B[i][j];\n            }\n        }\n    }\n    return result;\n}\n\nfunction max(A, B){\n    if(typeof A==='number' && typeof B ==='number')\n        return Math.max(A,B);\n    var ii = A.rows, jj = A.columns;\n    var result = new Matrix(ii,jj);\n    for (var i = 0; i < ii; i++) {\n        for (var j = 0; j < jj; j++) {\n            if (A[i][j] > B[i][j]) {\n                result[i][j] = A[i][j];\n            }\n            else{\n                result[i][j] = B[i][j];\n            }\n        }\n    }\n    return result;\n}\n\nfunction sqrt(A){\n    if(typeof A==='number' )\n        return Math.sqrt(A);\n    var ii = A.rows, jj = A.columns;\n    var result = new Matrix(ii,jj);\n    for (var i = 0; i < ii; i++) {\n        for (var j = 0; j < jj; j++) {\n            result[i][j] = Math.sqrt(A[i][j]);\n\n        }\n    }\n    return result;\n}\n\nfunction abs(A){\n    if(typeof A==='number' )\n        return Math.abs(A);\n    var ii = A.rows, jj = A.columns;\n    var result = new Matrix(ii,jj);\n    for (var i = 0; i < ii; i++) {\n        for (var j = 0; j < jj; j++) {\n            result[i][j] = Math.abs(A[i][j]);\n\n        }\n    }\n    return result;\n}\n\nfunction exp(A){\n    if(typeof A==='number' )\n        return Math.sqrt(A);\n    var ii = A.rows, jj = A.columns;\n    var result = new Matrix(ii,jj);\n    for (var i = 0; i < ii; i++) {\n        for (var j = 0; j < jj; j++) {\n            result[i][j] = Math.exp(A[i][j]);\n        }\n    }\n    return result;\n}\n\nfunction dotPow(A, b){\n    if(typeof A==='number' )\n        return Math.pow(A,b);\n    //console.log(A);\n    var ii = A.rows, jj = A.columns;\n    var result = new Matrix(ii,jj);\n    for (var i = 0; i < ii; i++) {\n        for (var j = 0; j < jj; j++) {\n            result[i][j] = Math.pow(A[i][j],b);\n        }\n    }\n    return result;\n}\n\nfunction solve(A, B){\n    return A.solve(B);\n}\n\nfunction inv(A){\n    if(typeof A ===\"number\")\n        return 1/A;\n    return A.inverse();\n}\n\nmodule.exports = {\n    transpose:transpose,\n    add:add,\n    subtract:subtract,\n    multiply:multiply,\n    dotMultiply:dotMultiply,\n    dotDivide:dotDivide,\n    diag:diag,\n    min:min,\n    max:max,\n    solve:solve,\n    inv:inv,\n    sqrt:sqrt,\n    exp:exp,\n    dotPow:dotPow,\n    abs:abs,\n    matrix:matrix,\n    ones:ones,\n    zeros:zeros,\n    random:random,\n    eye:eye\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-optimize-lorentzian/node_modules/ml-curve-fitting/src/algebra.js","'use strict';\n\nfunction getConverter() {\n    // the following RegExp can only be used for XYdata, some peakTables have values with a \"E-5\" ...\n    const ntuplesSeparator = /[, \\t]+/;\n    const GC_MS_FIELDS = ['TIC', '.RIC', 'SCANNUMBER'];\n\n    function convertToFloatArray(stringArray) {\n        var l = stringArray.length;\n        var floatArray = new Array(l);\n        for (var i = 0; i < l; i++) {\n            floatArray[i] = parseFloat(stringArray[i]);\n        }\n        return floatArray;\n    }\n\n    class Spectrum {}\n\n    const defaultOptions = {\n        keepRecordsRegExp: /^$/,\n        xy: false,\n        withoutXY: false,\n        chromatogram: false,\n        keepSpectra: false,\n        noContour: false,\n        nbContourLevels: 7,\n        noiseMultiplier: 5\n    };\n\n    function convert(jcamp, options) {\n        options = Object.assign({}, defaultOptions, options);\n\n        var wantXY = !options.withoutXY;\n\n        var start = Date.now();\n\n        var ntuples = {};\n        var ldr, dataLabel, dataValue, ldrs;\n        var i, ii, j, position, endLine, infos;\n\n        var result = {};\n        result.profiling = [];\n        result.logs = [];\n        var spectra = [];\n        result.spectra = spectra;\n        result.info = {};\n        var spectrum = new Spectrum();\n\n        if (!(typeof jcamp === 'string')) {\n            throw new TypeError('the JCAMP should be a string');\n        }\n\n        if (result.profiling) {\n            result.profiling.push({\n                action: 'Before split to LDRS',\n                time: Date.now() - start\n            });\n        }\n\n        ldrs = jcamp.split(/[\\r\\n]+##/);\n\n        if (result.profiling) {\n            result.profiling.push({\n                action: 'Split to LDRS',\n                time: Date.now() - start\n            });\n        }\n\n        if (ldrs[0]) ldrs[0] = ldrs[0].replace(/^[\\r\\n ]*##/, '');\n\n        for (i = 0, ii = ldrs.length; i < ii; i++) {\n            ldr = ldrs[i];\n            // This is a new LDR\n            position = ldr.indexOf('=');\n            if (position > 0) {\n                dataLabel = ldr.substring(0, position);\n                dataValue = ldr.substring(position + 1).trim();\n            } else {\n                dataLabel = ldr;\n                dataValue = '';\n            }\n            dataLabel = dataLabel.replace(/[_ -]/g, '').toUpperCase();\n\n            if (dataLabel === 'DATATABLE') {\n                endLine = dataValue.indexOf('\\n');\n                if (endLine === -1) endLine = dataValue.indexOf('\\r');\n                if (endLine > 0) {\n                    var xIndex = -1;\n                    var yIndex = -1;\n                    // ##DATA TABLE= (X++(I..I)), XYDATA\n                    // We need to find the variables\n\n                    infos = dataValue.substring(0, endLine).split(/[ ,;\\t]+/);\n                    if (infos[0].indexOf('++') > 0) {\n                        var firstVariable = infos[0].replace(/.*\\(([a-zA-Z0-9]+)\\+\\+.*/, '$1');\n                        var secondVariable = infos[0].replace(/.*\\.\\.([a-zA-Z0-9]+).*/, '$1');\n                        xIndex = ntuples.symbol.indexOf(firstVariable);\n                        yIndex = ntuples.symbol.indexOf(secondVariable);\n                    }\n\n                    if (xIndex === -1) xIndex = 0;\n                    if (yIndex === -1) yIndex = 0;\n\n                    if (ntuples.first) {\n                        if (ntuples.first.length > xIndex) spectrum.firstX = ntuples.first[xIndex];\n                        if (ntuples.first.length > yIndex) spectrum.firstY = ntuples.first[yIndex];\n                    }\n                    if (ntuples.last) {\n                        if (ntuples.last.length > xIndex) spectrum.lastX = ntuples.last[xIndex];\n                        if (ntuples.last.length > yIndex) spectrum.lastY = ntuples.last[yIndex];\n                    }\n                    if (ntuples.vardim && ntuples.vardim.length > xIndex) {\n                        spectrum.nbPoints = ntuples.vardim[xIndex];\n                    }\n                    if (ntuples.factor) {\n                        if (ntuples.factor.length > xIndex) spectrum.xFactor = ntuples.factor[xIndex];\n                        if (ntuples.factor.length > yIndex) spectrum.yFactor = ntuples.factor[yIndex];\n                    }\n                    if (ntuples.units) {\n                        if (ntuples.units.length > xIndex) spectrum.xUnit = ntuples.units[xIndex];\n                        if (ntuples.units.length > yIndex) spectrum.yUnit = ntuples.units[yIndex];\n                    }\n                    spectrum.datatable = infos[0];\n                    if (infos[1] && infos[1].indexOf('PEAKS') > -1) {\n                        dataLabel = 'PEAKTABLE';\n                    } else if (infos[1] && (infos[1].indexOf('XYDATA') || infos[0].indexOf('++') > 0)) {\n                        dataLabel = 'XYDATA';\n                        spectrum.deltaX = (spectrum.lastX - spectrum.firstX) / (spectrum.nbPoints - 1);\n                    }\n                }\n            }\n\n            if (dataLabel === 'XYDATA') {\n                if (wantXY) {\n                    prepareSpectrum(result, spectrum);\n                    // well apparently we should still consider it is a PEAK TABLE if there are no '++' after\n                    if (dataValue.match(/.*\\+\\+.*/)) {\n                        if (!spectrum.deltaX) {\n                            spectrum.deltaX = (spectrum.lastX - spectrum.firstX) / (spectrum.nbPoints - 1);\n                        }\n                        fastParseXYData(spectrum, dataValue, result);\n                    } else {\n                        parsePeakTable(spectrum, dataValue, result);\n                    }\n                    spectra.push(spectrum);\n                    spectrum = new Spectrum();\n                }\n                continue;\n            } else if (dataLabel === 'PEAKTABLE') {\n                if (wantXY) {\n                    prepareSpectrum(result, spectrum);\n                    parsePeakTable(spectrum, dataValue, result);\n                    spectra.push(spectrum);\n                    spectrum = new Spectrum();\n                }\n                continue;\n            }\n\n\n            if (dataLabel === 'TITLE') {\n                spectrum.title = dataValue;\n            } else if (dataLabel === 'DATATYPE') {\n                spectrum.dataType = dataValue;\n                if (dataValue.indexOf('nD') > -1) {\n                    result.twoD = true;\n                }\n            } else if (dataLabel === 'NTUPLES') {\n                if (dataValue.indexOf('nD') > -1) {\n                    result.twoD = true;\n                }\n            } else if (dataLabel === 'XUNITS') {\n                spectrum.xUnit = dataValue;\n            } else if (dataLabel === 'YUNITS') {\n                spectrum.yUnit = dataValue;\n            } else if (dataLabel === 'FIRSTX') {\n                spectrum.firstX = parseFloat(dataValue);\n            } else if (dataLabel === 'LASTX') {\n                spectrum.lastX = parseFloat(dataValue);\n            } else if (dataLabel === 'FIRSTY') {\n                spectrum.firstY = parseFloat(dataValue);\n            } else if (dataLabel === 'LASTY') {\n                spectrum.lastY = parseFloat(dataValue);\n            } else if (dataLabel === 'NPOINTS') {\n                spectrum.nbPoints = parseFloat(dataValue);\n            } else if (dataLabel === 'XFACTOR') {\n                spectrum.xFactor = parseFloat(dataValue);\n            } else if (dataLabel === 'YFACTOR') {\n                spectrum.yFactor = parseFloat(dataValue);\n            } else if (dataLabel === 'DELTAX') {\n                spectrum.deltaX = parseFloat(dataValue);\n            } else if (dataLabel === '.OBSERVEFREQUENCY' || dataLabel === '$SFO1') {\n                if (!spectrum.observeFrequency) spectrum.observeFrequency = parseFloat(dataValue);\n            } else if (dataLabel === '.OBSERVENUCLEUS') {\n                if (!spectrum.xType) result.xType = dataValue.replace(/[^a-zA-Z0-9]/g, '');\n            } else if (dataLabel === '$SFO2') {\n                if (!result.indirectFrequency) result.indirectFrequency = parseFloat(dataValue);\n\n            } else if (dataLabel === '$OFFSET') { // OFFSET for Bruker spectra\n                result.shiftOffsetNum = 0;\n                if (!result.shiftOffsetVal) result.shiftOffsetVal = parseFloat(dataValue);\n            } else if (dataLabel === '$REFERENCEPOINT') { // OFFSET for Varian spectra\n\n\n                // if we activate this part it does not work for ACD specmanager\n                //         } else if (dataLabel=='.SHIFTREFERENCE') {   // OFFSET FOR Bruker Spectra\n                //                 var parts = dataValue.split(/ *, */);\n                //                 result.shiftOffsetNum = parseInt(parts[2].trim());\n                //                 result.shiftOffsetVal = parseFloat(parts[3].trim());\n            } else if (dataLabel === 'VARNAME') {\n                ntuples.varname = dataValue.split(ntuplesSeparator);\n            } else if (dataLabel === 'SYMBOL') {\n                ntuples.symbol = dataValue.split(ntuplesSeparator);\n            } else if (dataLabel === 'VARTYPE') {\n                ntuples.vartype = dataValue.split(ntuplesSeparator);\n            } else if (dataLabel === 'VARFORM') {\n                ntuples.varform = dataValue.split(ntuplesSeparator);\n            } else if (dataLabel === 'VARDIM') {\n                ntuples.vardim = convertToFloatArray(dataValue.split(ntuplesSeparator));\n            } else if (dataLabel === 'UNITS') {\n                ntuples.units = dataValue.split(ntuplesSeparator);\n            } else if (dataLabel === 'FACTOR') {\n                ntuples.factor = convertToFloatArray(dataValue.split(ntuplesSeparator));\n            } else if (dataLabel === 'FIRST') {\n                ntuples.first = convertToFloatArray(dataValue.split(ntuplesSeparator));\n            } else if (dataLabel === 'LAST') {\n                ntuples.last = convertToFloatArray(dataValue.split(ntuplesSeparator));\n            } else if (dataLabel === 'MIN') {\n                ntuples.min = convertToFloatArray(dataValue.split(ntuplesSeparator));\n            } else if (dataLabel === 'MAX') {\n                ntuples.max = convertToFloatArray(dataValue.split(ntuplesSeparator));\n            } else if (dataLabel === '.NUCLEUS') {\n                if (result.twoD) {\n                    result.yType = dataValue.split(ntuplesSeparator)[0];\n                }\n            } else if (dataLabel === 'PAGE') {\n                spectrum.page = dataValue.trim();\n                spectrum.pageValue = parseFloat(dataValue.replace(/^.*=/, ''));\n                spectrum.pageSymbol = spectrum.page.replace(/[=].*/, '');\n                var pageSymbolIndex = ntuples.symbol.indexOf(spectrum.pageSymbol);\n                var unit = '';\n                if (ntuples.units && ntuples.units[pageSymbolIndex]) {\n                    unit = ntuples.units[pageSymbolIndex];\n                }\n                if (result.indirectFrequency && unit !== 'PPM') {\n                    spectrum.pageValue /= result.indirectFrequency;\n                }\n            } else if (dataLabel === 'RETENTIONTIME') {\n                spectrum.pageValue = parseFloat(dataValue);\n            } else if (isMSField(dataLabel)) {\n                spectrum[convertMSFieldToLabel(dataLabel)] = dataValue;\n            }\n            if (dataLabel.match(options.keepRecordsRegExp)) {\n                result.info[dataLabel] = dataValue.trim();\n            }\n        }\n\n        if (result.profiling) {\n            result.profiling.push({\n                action: 'Finished parsing',\n                time: Date.now() - start\n            });\n        }\n\n        if (Object.keys(ntuples).length > 0) {\n            var newNtuples = [];\n            var keys = Object.keys(ntuples);\n            for (i = 0; i < keys.length; i++) {\n                var key = keys[i];\n                var values = ntuples[key];\n                for (j = 0; j < values.length; j++) {\n                    if (!newNtuples[j]) newNtuples[j] = {};\n                    newNtuples[j][key] = values[j];\n                }\n            }\n            result.ntuples = newNtuples;\n        }\n\n        if (result.twoD && wantXY) {\n            add2D(result, options);\n            if (result.profiling) {\n                result.profiling.push({\n                    action: 'Finished countour plot calculation',\n                    time: Date.now() - start\n                });\n            }\n            if (!options.keepSpectra) {\n                delete result.spectra;\n            }\n        }\n\n        if (options.chromatogram) {\n            options.xy = true;\n        }\n\n        if (options.xy && wantXY) { // the spectraData should not be a oneD array but an object with x and y\n            if (spectra.length > 0) {\n                for (i = 0; i < spectra.length; i++) {\n                    spectrum = spectra[i];\n                    if (spectrum.data.length > 0) {\n                        for (j = 0; j < spectrum.data.length; j++) {\n                            var data = spectrum.data[j];\n                            var newData = {\n                                x: new Array(data.length / 2),\n                                y: new Array(data.length / 2)\n                            };\n                            for (var k = 0; k < data.length; k = k + 2) {\n                                newData.x[k / 2] = data[k];\n                                newData.y[k / 2] = data[k + 1];\n                            }\n                            spectrum.data[j] = newData;\n                        }\n\n                    }\n\n                }\n            }\n        }\n\n        // maybe it is a GC (HPLC) / MS. In this case we add a new format\n        if (options.chromatogram) {\n            if (result.spectra.length > 1) {\n                complexChromatogram(result);\n            } else {\n                simpleChromatogram(result);\n            }\n            if (result.profiling) {\n                result.profiling.push({\n                    action: 'Finished chromatogram calculation',\n                    time: Date.now() - start\n                });\n            }\n        }\n\n        if (result.profiling) {\n            result.profiling.push({\n                action: 'Total time',\n                time: Date.now() - start\n            });\n        }\n\n        return result;\n    }\n\n\n    function convertMSFieldToLabel(value) {\n        return value.toLowerCase().replace(/[^a-z0-9]/g, '');\n    }\n\n    function isMSField(dataLabel) {\n        return GC_MS_FIELDS.indexOf(dataLabel) !== -1;\n    }\n\n    function complexChromatogram(result) {\n        var spectra = result.spectra;\n        var length = spectra.length;\n        var chromatogram = {\n            times: new Array(length),\n            series: {\n                ms: {\n                    dimension: 2,\n                    data: new Array(length)\n                }\n            }\n        };\n\n        var i;\n        var existingGCMSFields = [];\n        for (i = 0; i < GC_MS_FIELDS.length; i++) {\n            var label = convertMSFieldToLabel(GC_MS_FIELDS[i]);\n            if (spectra[0][label]) {\n                existingGCMSFields.push(label);\n                chromatogram.series[label] = {\n                    dimension: 1,\n                    data: new Array(length)\n                };\n            }\n        }\n\n        for (i = 0; i < length; i++) {\n            var spectrum = spectra[i];\n            chromatogram.times[i] = spectrum.pageValue;\n            for (var j = 0; j < existingGCMSFields.length; j++) {\n                chromatogram.series[existingGCMSFields[j]].data[i] = parseFloat(spectrum[existingGCMSFields[j]]);\n            }\n            if (spectrum.data) {\n                chromatogram.series.ms.data[i] = [spectrum.data[0].x, spectrum.data[0].y];\n            }\n\n        }\n        result.chromatogram = chromatogram;\n    }\n\n    function simpleChromatogram(result) {\n        var data = result.spectra[0].data[0];\n        result.chromatogram = {\n            times: data.x.slice(),\n            series: {\n                intensity: {\n                    dimension: 1,\n                    data: data.y.slice()\n                }\n            }\n        };\n    }\n\n    function prepareSpectrum(result, spectrum) {\n        if (!spectrum.xFactor) spectrum.xFactor = 1;\n        if (!spectrum.yFactor) spectrum.yFactor = 1;\n        if (spectrum.observeFrequency) {\n            if (spectrum.xUnit && spectrum.xUnit.toUpperCase() === 'HZ') {\n                spectrum.xUnit = 'PPM';\n                spectrum.xFactor = spectrum.xFactor / spectrum.observeFrequency;\n                spectrum.firstX = spectrum.firstX / spectrum.observeFrequency;\n                spectrum.lastX = spectrum.lastX / spectrum.observeFrequency;\n                spectrum.deltaX = spectrum.deltaX / spectrum.observeFrequency;\n            }\n        }\n        if (result.shiftOffsetVal) {\n            var shift = spectrum.firstX - result.shiftOffsetVal;\n            spectrum.firstX = spectrum.firstX - shift;\n            spectrum.lastX = spectrum.lastX - shift;\n        }\n    }\n\n    function getMedian(data) {\n        data = data.sort(compareNumbers);\n        var l = data.length;\n        return data[Math.floor(l / 2)];\n    }\n\n    function compareNumbers(a, b) {\n        return a - b;\n    }\n\n    function convertTo3DZ(spectra) {\n        var minZ = spectra[0].data[0][0];\n        var maxZ = minZ;\n        var ySize = spectra.length;\n        var xSize = spectra[0].data[0].length / 2;\n        var z = new Array(ySize);\n        for (var i = 0; i < ySize; i++) {\n            z[i] = new Array(xSize);\n            var xVector = spectra[i].data[0];\n            for (var j = 0; j < xSize; j++) {\n                var value = xVector[j * 2 + 1];\n                z[i][j] = value;\n                if (value < minZ) minZ = value;\n                if (value > maxZ) maxZ = value;\n            }\n        }\n        return {\n            z: z,\n            minX: spectra[0].data[0][0],\n            maxX: spectra[0].data[0][spectra[0].data[0].length - 2], // has to be -2 because it is a 1D array [x,y,x,y,...]\n            minY: spectra[0].pageValue,\n            maxY: spectra[ySize - 1].pageValue,\n            minZ: minZ,\n            maxZ: maxZ,\n            noise: getMedian(z[0].map(Math.abs))\n        };\n\n    }\n\n    function add2D(result, options) {\n        var zData = convertTo3DZ(result.spectra);\n        if (!options.noContour) {\n            result.contourLines = generateContourLines(zData, options);\n            delete zData.z;\n        }\n        result.minMax = zData;\n    }\n\n\n    function generateContourLines(zData, options) {\n        var noise = zData.noise;\n        var z = zData.z;\n        var povarHeight0, povarHeight1, povarHeight2, povarHeight3;\n        var isOver0, isOver1, isOver2, isOver3;\n        var nbSubSpectra = z.length;\n        var nbPovars = z[0].length;\n        var pAx, pAy, pBx, pBy;\n\n        var x0 = zData.minX;\n        var xN = zData.maxX;\n        var dx = (xN - x0) / (nbPovars - 1);\n        var y0 = zData.minY;\n        var yN = zData.maxY;\n        var dy = (yN - y0) / (nbSubSpectra - 1);\n        var minZ = zData.minZ;\n        var maxZ = zData.maxZ;\n\n        //System.out.prvarln('y0 '+y0+' yN '+yN);\n        // -------------------------\n        // Povars attribution\n        //\n        // 0----1\n        // |  / |\n        // | /  |\n        // 2----3\n        //\n        // ---------------------d------\n\n        var iter = options.nbContourLevels * 2;\n        var contourLevels = new Array(iter);\n        var lineZValue;\n        for (var level = 0; level < iter; level++) { // multiply by 2 for positif and negatif\n            var contourLevel = {};\n            contourLevels[level] = contourLevel;\n            var side = level % 2;\n            var factor = (maxZ - options.noiseMultiplier * noise) * Math.exp((level >> 1) - options.nbContourLevels);\n            if (side === 0) {\n                lineZValue = factor + options.noiseMultiplier * noise;\n            } else {\n                lineZValue = (0 - factor) - options.noiseMultiplier * noise;\n            }\n            var lines = [];\n            contourLevel.zValue = lineZValue;\n            contourLevel.lines = lines;\n\n            if (lineZValue <= minZ || lineZValue >= maxZ) continue;\n\n            for (var iSubSpectra = 0; iSubSpectra < nbSubSpectra - 1; iSubSpectra++) {\n                var subSpectra = z[iSubSpectra];\n                var subSpectraAfter = z[iSubSpectra + 1];\n                for (var povar = 0; povar < nbPovars - 1; povar++) {\n                    povarHeight0 = subSpectra[povar];\n                    povarHeight1 = subSpectra[povar + 1];\n                    povarHeight2 = subSpectraAfter[povar];\n                    povarHeight3 = subSpectraAfter[povar + 1];\n\n                    isOver0 = (povarHeight0 > lineZValue);\n                    isOver1 = (povarHeight1 > lineZValue);\n                    isOver2 = (povarHeight2 > lineZValue);\n                    isOver3 = (povarHeight3 > lineZValue);\n\n                    // Example povar0 is over the plane and povar1 and\n                    // povar2 are below, we find the varersections and add\n                    // the segment\n                    if (isOver0 !== isOver1 && isOver0 !== isOver2) {\n                        pAx = povar + (lineZValue - povarHeight0) / (povarHeight1 - povarHeight0);\n                        pAy = iSubSpectra;\n                        pBx = povar;\n                        pBy = iSubSpectra + (lineZValue - povarHeight0) / (povarHeight2 - povarHeight0);\n                        lines.push(pAx * dx + x0);\n                        lines.push(pAy * dy + y0);\n                        lines.push(pBx * dx + x0);\n                        lines.push(pBy * dy + y0);\n                    }\n                    // remove push does not help !!!!\n                    if (isOver3 !== isOver1 && isOver3 !== isOver2) {\n                        pAx = povar + 1;\n                        pAy = iSubSpectra + 1 - (lineZValue - povarHeight3) / (povarHeight1 - povarHeight3);\n                        pBx = povar + 1 - (lineZValue - povarHeight3) / (povarHeight2 - povarHeight3);\n                        pBy = iSubSpectra + 1;\n                        lines.push(pAx * dx + x0);\n                        lines.push(pAy * dy + y0);\n                        lines.push(pBx * dx + x0);\n                        lines.push(pBy * dy + y0);\n                    }\n                    // test around the diagonal\n                    if (isOver1 !== isOver2) {\n                        pAx = (povar + 1 - (lineZValue - povarHeight1) / (povarHeight2 - povarHeight1)) * dx + x0;\n                        pAy = (iSubSpectra + (lineZValue - povarHeight1) / (povarHeight2 - povarHeight1)) * dy + y0;\n                        if (isOver1 !== isOver0) {\n                            pBx = povar + 1 - (lineZValue - povarHeight1) / (povarHeight0 - povarHeight1);\n                            pBy = iSubSpectra;\n                            lines.push(pAx);\n                            lines.push(pAy);\n                            lines.push(pBx * dx + x0);\n                            lines.push(pBy * dy + y0);\n                        }\n                        if (isOver2 !== isOver0) {\n                            pBx = povar;\n                            pBy = iSubSpectra + 1 - (lineZValue - povarHeight2) / (povarHeight0 - povarHeight2);\n                            lines.push(pAx);\n                            lines.push(pAy);\n                            lines.push(pBx * dx + x0);\n                            lines.push(pBy * dy + y0);\n                        }\n                        if (isOver1 !== isOver3) {\n                            pBx = povar + 1;\n                            pBy = iSubSpectra + (lineZValue - povarHeight1) / (povarHeight3 - povarHeight1);\n                            lines.push(pAx);\n                            lines.push(pAy);\n                            lines.push(pBx * dx + x0);\n                            lines.push(pBy * dy + y0);\n                        }\n                        if (isOver2 !== isOver3) {\n                            pBx = povar + (lineZValue - povarHeight2) / (povarHeight3 - povarHeight2);\n                            pBy = iSubSpectra + 1;\n                            lines.push(pAx);\n                            lines.push(pAy);\n                            lines.push(pBx * dx + x0);\n                            lines.push(pBy * dy + y0);\n                        }\n                    }\n                }\n            }\n        }\n\n        return {\n            minX: zData.minX,\n            maxX: zData.maxX,\n            minY: zData.minY,\n            maxY: zData.maxY,\n            segments: contourLevels\n        };\n    }\n\n    function fastParseXYData(spectrum, value) {\n        // TODO need to deal with result\n        //  console.log(value);\n        // we check if deltaX is defined otherwise we calculate it\n\n        var yFactor = spectrum.yFactor;\n        var deltaX = spectrum.deltaX;\n\n\n        spectrum.isXYdata = true;\n        // TODO to be improved using 2 array {x:[], y:[]}\n        var currentData = [];\n        spectrum.data = [currentData];\n\n\n        var currentX = spectrum.firstX;\n        var currentY = spectrum.firstY;\n\n        // we skip the first line\n        //\n        var endLine = false;\n        var ascii;\n        for (var i = 0; i < value.length; i++) {\n            ascii = value.charCodeAt(i);\n            if (ascii === 13 || ascii === 10) {\n                endLine = true;\n            } else {\n                if (endLine) break;\n            }\n        }\n\n        // we proceed taking the i after the first line\n        var newLine = true;\n        var isDifference = false;\n        var isLastDifference = false;\n        var lastDifference = 0;\n        var isDuplicate = false;\n        var inComment = false;\n        var currentValue = 0;\n        var isNegative = false;\n        var inValue = false;\n        var skipFirstValue = false;\n        var decimalPosition = 0;\n        for (; i <= value.length; i++) {\n            if (i === value.length) ascii = 13;\n            else ascii = value.charCodeAt(i);\n            if (inComment) {\n                // we should ignore the text if we are after $$\n                if (ascii === 13 || ascii === 10) {\n                    newLine = true;\n                    inComment = false;\n                }\n            } else {\n                // when is it a new value ?\n                // when it is not a digit, . or comma\n                // it is a number that is either new or we continue\n                if (ascii <= 57 && ascii >= 48) { // a number\n                    inValue = true;\n                    if (decimalPosition > 0) {\n                        currentValue += (ascii - 48) / Math.pow(10, decimalPosition++);\n                    } else {\n                        currentValue *= 10;\n                        currentValue += ascii - 48;\n                    }\n                } else if (ascii === 44 || ascii === 46) { // a \",\" or \".\"\n                    inValue = true;\n                    decimalPosition++;\n                } else {\n                    if (inValue) {\n                        // need to process the previous value\n                        if (newLine) {\n                            newLine = false; // we don't check the X value\n                            // console.log(\"NEW LINE\",isDifference, lastDifference);\n                            // if new line and lastDifference, the first value is just a check !\n                            // that we don't check ...\n                            if (isLastDifference) skipFirstValue = true;\n                        } else {\n                            // need to deal with duplicate and differences\n                            if (skipFirstValue) {\n                                skipFirstValue = false;\n                            } else {\n                                if (isDifference) {\n                                    lastDifference = isNegative ? (0 - currentValue) : currentValue;\n                                    isLastDifference = true;\n                                    isDifference = false;\n                                }\n                                var duplicate = isDuplicate ? currentValue - 1 : 1;\n                                for (var j = 0; j < duplicate; j++) {\n                                    if (isLastDifference) {\n                                        currentY += lastDifference;\n                                    } else {\n                                        currentY = isNegative ? (0 - currentValue) : currentValue;\n                                    }\n                                    currentData.push(currentX);\n                                    currentData.push(currentY * yFactor);\n                                    currentX += deltaX;\n                                }\n                            }\n                        }\n                        isNegative = false;\n                        currentValue = 0;\n                        decimalPosition = 0;\n                        inValue = false;\n                        isDuplicate = false;\n                    }\n\n                    // positive SQZ digits @ A B C D E F G H I (ascii 64-73)\n                    if ((ascii < 74) && (ascii > 63)) {\n                        inValue = true;\n                        isLastDifference = false;\n                        currentValue = ascii - 64;\n                    } else\n                    // negative SQZ digits a b c d e f g h i (ascii 97-105)\n                    if ((ascii > 96) && (ascii < 106)) {\n                        inValue = true;\n                        isLastDifference = false;\n                        currentValue = ascii - 96;\n                        isNegative = true;\n                    } else\n                    // DUP digits S T U V W X Y Z s (ascii 83-90, 115)\n                    if (ascii === 115) {\n                        inValue = true;\n                        isDuplicate = true;\n                        currentValue = 9;\n                    } else if ((ascii > 82) && (ascii < 91)) {\n                        inValue = true;\n                        isDuplicate = true;\n                        currentValue = ascii - 82;\n                    } else\n                    // positive DIF digits % J K L M N O P Q R (ascii 37, 74-82)\n                    if ((ascii > 73) && (ascii < 83)) {\n                        inValue = true;\n                        isDifference = true;\n                        currentValue = ascii - 73;\n                    } else\n                    // negative DIF digits j k l m n o p q r (ascii 106-114)\n                    if ((ascii > 105) && (ascii < 115)) {\n                        inValue = true;\n                        isDifference = true;\n                        currentValue = ascii - 105;\n                        isNegative = true;\n                    } else\n                    // $ sign, we need to check the next one\n                    if (ascii === 36 && value.charCodeAt(i + 1) === 36) {\n                        inValue = true;\n                        inComment = true;\n                    } else\n                    // positive DIF digits % J K L M N O P Q R (ascii 37, 74-82)\n                    if (ascii === 37) {\n                        inValue = true;\n                        isDifference = true;\n                        currentValue = 0;\n                        isNegative = false;\n                    } else if (ascii === 45) { // a \"-\"\n                        // check if after there is a number, decimal or comma\n                        var ascii2 = value.charCodeAt(i + 1);\n                        if ((ascii2 >= 48 && ascii2 <= 57) || ascii2 === 44 || ascii2 === 46) {\n                            inValue = true;\n                            isLastDifference = false;\n                            isNegative = true;\n                        }\n                    } else if (ascii === 13 || ascii === 10) {\n                        newLine = true;\n                        inComment = false;\n                    }\n                    // and now analyse the details ... space or tabulation\n                    // if \"+\" we just don't care\n                }\n            }\n        }\n    }\n\n    function parsePeakTable(spectrum, value, result) {\n        var removeCommentRegExp = /\\$\\$.*/;\n        var peakTableSplitRegExp = /[,\\t ]+/;\n\n        spectrum.isPeaktable = true;\n        var i, ii, j, jj, values;\n        var currentData = [];\n        spectrum.data = [currentData];\n\n        // counts for around 20% of the time\n        var lines = value.split(/,? *,?[;\\r\\n]+ */);\n\n        for (i = 1, ii = lines.length; i < ii; i++) {\n            values = lines[i].trim().replace(removeCommentRegExp, '').split(peakTableSplitRegExp);\n            if (values.length % 2 === 0) {\n                for (j = 0, jj = values.length; j < jj; j = j + 2) {\n                    // takes around 40% of the time to add and parse the 2 values nearly exclusively because of parseFloat\n                    currentData.push(parseFloat(values[j]) * spectrum.xFactor);\n                    currentData.push(parseFloat(values[j + 1]) * spectrum.yFactor);\n                }\n            } else {\n                result.logs.push('Format error: ' + values);\n            }\n        }\n    }\n\n\n    return convert;\n\n}\n\nvar convert = getConverter();\n\nfunction JcampConverter(input, options, useWorker) {\n    if (typeof options === 'boolean') {\n        useWorker = options;\n        options = {};\n    }\n    if (useWorker) {\n        return postToWorker(input, options);\n    } else {\n        return convert(input, options);\n    }\n}\n\nvar stamps = {};\nvar worker;\n\nfunction postToWorker(input, options) {\n    if (!worker) {\n        createWorker();\n    }\n    return new Promise(function (resolve) {\n        var stamp = Date.now() + '' + Math.random();\n        stamps[stamp] = resolve;\n        worker.postMessage(JSON.stringify({\n            stamp: stamp,\n            input: input,\n            options: options\n        }));\n    });\n}\n\nfunction createWorker() {\n    var workerURL = URL.createObjectURL(new Blob([\n        'var getConverter =' + getConverter.toString() + ';var convert = getConverter(); onmessage = function (event) { var data = JSON.parse(event.data); postMessage(JSON.stringify({stamp: data.stamp, output: convert(data.input, data.options)})); };'\n    ], {type: 'application/javascript'}));\n    worker = new Worker(workerURL);\n    URL.revokeObjectURL(workerURL);\n    worker.addEventListener('message', function (event) {\n        var data = JSON.parse(event.data);\n        var stamp = data.stamp;\n        if (stamps[stamp]) {\n            stamps[stamp](data.output);\n        }\n    });\n}\n\nfunction createTree(jcamp) {\n    if (typeof jcamp !== 'string') {\n        throw new TypeError('the JCAMP should be a string');\n    }\n\n    var lines = jcamp.split(/[\\r\\n]+/);\n\n    var stack = [];\n    var result = [];\n    var current;\n    var ntupleLevel = 0;\n    for (var i = 0; i < lines.length; i++) {\n        var line = lines[i];\n\n        if (line.substring(0, 9) === '##NTUPLES') {\n            ntupleLevel++;\n        }\n\n        if (line.substring(0, 7) === '##TITLE') {\n            stack.push({\n                title: line.substring(8).trim(),\n                jcamp: line + '\\n',\n                children: []\n            });\n            current = stack[stack.length - 1];\n        } else if (line.substring(0, 5) === '##END' && ntupleLevel === 0) {\n            current.jcamp += line + '\\n';\n            var finished = stack.pop();\n            if (stack.length !== 0) {\n                current = stack[stack.length - 1];\n                current.children.push(finished);\n            } else {\n                current = undefined;\n                result.push(finished);\n            }\n        } else if (current && current.jcamp) {\n            current.jcamp += line + '\\n';\n            if (line.substring(0, 10) === '##DATATYPE') {\n                current.dataType = line.substring(11).trim();\n            }\n        }\n\n        if (line.substring(0, 5) === '##END' && ntupleLevel > 0) {\n            ntupleLevel--;\n        }\n\n    }\n    return result;\n}\n\nmodule.exports = {\n    convert: JcampConverter,\n    createTree: createTree\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/jcampconverter/src/index.js","'use strict';\n\nfunction compareNumbers(a, b) {\n    return a - b;\n}\n\n/**\n * Computes the sum of the given values\n * @param {Array} values\n * @returns {number}\n */\nexports.sum = function sum(values) {\n    var sum = 0;\n    for (var i = 0; i < values.length; i++) {\n        sum += values[i];\n    }\n    return sum;\n};\n\n/**\n * Computes the maximum of the given values\n * @param {Array} values\n * @returns {number}\n */\nexports.max = function max(values) {\n    var max = values[0];\n    var l = values.length;\n    for (var i = 1; i < l; i++) {\n        if (values[i] > max) max = values[i];\n    }\n    return max;\n};\n\n/**\n * Computes the minimum of the given values\n * @param {Array} values\n * @returns {number}\n */\nexports.min = function min(values) {\n    var min = values[0];\n    var l = values.length;\n    for (var i = 1; i < l; i++) {\n        if (values[i] < min) min = values[i];\n    }\n    return min;\n};\n\n/**\n * Computes the min and max of the given values\n * @param {Array} values\n * @returns {{min: number, max: number}}\n */\nexports.minMax = function minMax(values) {\n    var min = values[0];\n    var max = values[0];\n    var l = values.length;\n    for (var i = 1; i < l; i++) {\n        if (values[i] < min) min = values[i];\n        if (values[i] > max) max = values[i];\n    }\n    return {\n        min: min,\n        max: max\n    };\n};\n\n/**\n * Computes the arithmetic mean of the given values\n * @param {Array} values\n * @returns {number}\n */\nexports.arithmeticMean = function arithmeticMean(values) {\n    var sum = 0;\n    var l = values.length;\n    for (var i = 0; i < l; i++) {\n        sum += values[i];\n    }\n    return sum / l;\n};\n\n/**\n * {@link arithmeticMean}\n */\nexports.mean = exports.arithmeticMean;\n\n/**\n * Computes the geometric mean of the given values\n * @param {Array} values\n * @returns {number}\n */\nexports.geometricMean = function geometricMean(values) {\n    var mul = 1;\n    var l = values.length;\n    for (var i = 0; i < l; i++) {\n        mul *= values[i];\n    }\n    return Math.pow(mul, 1 / l);\n};\n\n/**\n * Computes the mean of the log of the given values\n * If the return value is exponentiated, it gives the same result as the\n * geometric mean.\n * @param {Array} values\n * @returns {number}\n */\nexports.logMean = function logMean(values) {\n    var lnsum = 0;\n    var l = values.length;\n    for (var i = 0; i < l; i++) {\n        lnsum += Math.log(values[i]);\n    }\n    return lnsum / l;\n};\n\n/**\n * Computes the weighted grand mean for a list of means and sample sizes\n * @param {Array} means - Mean values for each set of samples\n * @param {Array} samples - Number of original values for each set of samples\n * @returns {number}\n */\nexports.grandMean = function grandMean(means, samples) {\n    var sum = 0;\n    var n = 0;\n    var l = means.length;\n    for (var i = 0; i < l; i++) {\n        sum += samples[i] * means[i];\n        n += samples[i];\n    }\n    return sum / n;\n};\n\n/**\n * Computes the truncated mean of the given values using a given percentage\n * @param {Array} values\n * @param {number} percent - The percentage of values to keep (range: [0,1])\n * @param {boolean} [alreadySorted=false]\n * @returns {number}\n */\nexports.truncatedMean = function truncatedMean(values, percent, alreadySorted) {\n    if (alreadySorted === undefined) alreadySorted = false;\n    if (!alreadySorted) {\n        values = [].concat(values).sort(compareNumbers);\n    }\n    var l = values.length;\n    var k = Math.floor(l * percent);\n    var sum = 0;\n    for (var i = k; i < (l - k); i++) {\n        sum += values[i];\n    }\n    return sum / (l - 2 * k);\n};\n\n/**\n * Computes the harmonic mean of the given values\n * @param {Array} values\n * @returns {number}\n */\nexports.harmonicMean = function harmonicMean(values) {\n    var sum = 0;\n    var l = values.length;\n    for (var i = 0; i < l; i++) {\n        if (values[i] === 0) {\n            throw new RangeError('value at index ' + i + 'is zero');\n        }\n        sum += 1 / values[i];\n    }\n    return l / sum;\n};\n\n/**\n * Computes the contraharmonic mean of the given values\n * @param {Array} values\n * @returns {number}\n */\nexports.contraHarmonicMean = function contraHarmonicMean(values) {\n    var r1 = 0;\n    var r2 = 0;\n    var l = values.length;\n    for (var i = 0; i < l; i++) {\n        r1 += values[i] * values[i];\n        r2 += values[i];\n    }\n    if (r2 < 0) {\n        throw new RangeError('sum of values is negative');\n    }\n    return r1 / r2;\n};\n\n/**\n * Computes the median of the given values\n * @param {Array} values\n * @param {boolean} [alreadySorted=false]\n * @returns {number}\n */\nexports.median = function median(values, alreadySorted) {\n    if (alreadySorted === undefined) alreadySorted = false;\n    if (!alreadySorted) {\n        values = [].concat(values).sort(compareNumbers);\n    }\n    var l = values.length;\n    var half = Math.floor(l / 2);\n    if (l % 2 === 0) {\n        return (values[half - 1] + values[half]) * 0.5;\n    } else {\n        return values[half];\n    }\n};\n\n/**\n * Computes the variance of the given values\n * @param {Array} values\n * @param {boolean} [unbiased=true] - if true, divide by (n-1); if false, divide by n.\n * @returns {number}\n */\nexports.variance = function variance(values, unbiased) {\n    if (unbiased === undefined) unbiased = true;\n    var theMean = exports.mean(values);\n    var theVariance = 0;\n    var l = values.length;\n\n    for (var i = 0; i < l; i++) {\n        var x = values[i] - theMean;\n        theVariance += x * x;\n    }\n\n    if (unbiased) {\n        return theVariance / (l - 1);\n    } else {\n        return theVariance / l;\n    }\n};\n\n/**\n * Computes the standard deviation of the given values\n * @param {Array} values\n * @param {boolean} [unbiased=true] - if true, divide by (n-1); if false, divide by n.\n * @returns {number}\n */\nexports.standardDeviation = function standardDeviation(values, unbiased) {\n    return Math.sqrt(exports.variance(values, unbiased));\n};\n\nexports.standardError = function standardError(values) {\n    return exports.standardDeviation(values) / Math.sqrt(values.length);\n};\n\n/**\n * IEEE Transactions on biomedical engineering, vol. 52, no. 1, january 2005, p. 76-\n * Calculate the standard deviation via the Median of the absolute deviation\n *  The formula for the standard deviation only holds for Gaussian random variables.\n * @returns {{mean: number, stdev: number}}\n */\nexports.robustMeanAndStdev = function robustMeanAndStdev(y) {\n    var mean = 0, stdev = 0;\n    var length = y.length, i = 0;\n    for (i = 0; i < length; i++) {\n        mean += y[i];\n    }\n    mean /= length;\n    var averageDeviations = new Array(length);\n    for (i = 0; i < length; i++)\n        averageDeviations[i] = Math.abs(y[i] - mean);\n    averageDeviations.sort(compareNumbers);\n    if (length % 2 === 1) {\n        stdev = averageDeviations[(length - 1) / 2] / 0.6745;\n    } else {\n        stdev = 0.5 * (averageDeviations[length / 2] + averageDeviations[length / 2 - 1]) / 0.6745;\n    }\n\n    return {\n        mean: mean,\n        stdev: stdev\n    };\n};\n\nexports.quartiles = function quartiles(values, alreadySorted) {\n    if (typeof (alreadySorted) === 'undefined') alreadySorted = false;\n    if (!alreadySorted) {\n        values = [].concat(values).sort(compareNumbers);\n    }\n\n    var quart = values.length / 4;\n    var q1 = values[Math.ceil(quart) - 1];\n    var q2 = exports.median(values, true);\n    var q3 = values[Math.ceil(quart * 3) - 1];\n\n    return {q1: q1, q2: q2, q3: q3};\n};\n\nexports.pooledStandardDeviation = function pooledStandardDeviation(samples, unbiased) {\n    return Math.sqrt(exports.pooledVariance(samples, unbiased));\n};\n\nexports.pooledVariance = function pooledVariance(samples, unbiased) {\n    if (typeof (unbiased) === 'undefined') unbiased = true;\n    var sum = 0;\n    var length = 0, l = samples.length;\n    for (var i = 0; i < l; i++) {\n        var values = samples[i];\n        var vari = exports.variance(values);\n\n        sum += (values.length - 1) * vari;\n\n        if (unbiased)\n            length += values.length - 1;\n        else\n            length += values.length;\n    }\n    return sum / length;\n};\n\nexports.mode = function mode(values) {\n    var l = values.length,\n        itemCount = new Array(l),\n        i;\n    for (i = 0; i < l; i++) {\n        itemCount[i] = 0;\n    }\n    var itemArray = new Array(l);\n    var count = 0;\n\n    for (i = 0; i < l; i++) {\n        var index = itemArray.indexOf(values[i]);\n        if (index >= 0)\n            itemCount[index]++;\n        else {\n            itemArray[count] = values[i];\n            itemCount[count] = 1;\n            count++;\n        }\n    }\n\n    var maxValue = 0, maxIndex = 0;\n    for (i = 0; i < count; i++) {\n        if (itemCount[i] > maxValue) {\n            maxValue = itemCount[i];\n            maxIndex = i;\n        }\n    }\n\n    return itemArray[maxIndex];\n};\n\nexports.covariance = function covariance(vector1, vector2, unbiased) {\n    if (typeof (unbiased) === 'undefined') unbiased = true;\n    var mean1 = exports.mean(vector1);\n    var mean2 = exports.mean(vector2);\n\n    if (vector1.length !== vector2.length)\n        throw 'Vectors do not have the same dimensions';\n\n    var cov = 0, l = vector1.length;\n    for (var i = 0; i < l; i++) {\n        var x = vector1[i] - mean1;\n        var y = vector2[i] - mean2;\n        cov += x * y;\n    }\n\n    if (unbiased)\n        return cov / (l - 1);\n    else\n        return cov / l;\n};\n\nexports.skewness = function skewness(values, unbiased) {\n    if (typeof (unbiased) === 'undefined') unbiased = true;\n    var theMean = exports.mean(values);\n\n    var s2 = 0, s3 = 0, l = values.length;\n    for (var i = 0; i < l; i++) {\n        var dev = values[i] - theMean;\n        s2 += dev * dev;\n        s3 += dev * dev * dev;\n    }\n    var m2 = s2 / l;\n    var m3 = s3 / l;\n\n    var g = m3 / (Math.pow(m2, 3 / 2.0));\n    if (unbiased) {\n        var a = Math.sqrt(l * (l - 1));\n        var b = l - 2;\n        return (a / b) * g;\n    } else {\n        return g;\n    }\n};\n\nexports.kurtosis = function kurtosis(values, unbiased) {\n    if (typeof (unbiased) === 'undefined') unbiased = true;\n    var theMean = exports.mean(values);\n    var n = values.length, s2 = 0, s4 = 0;\n\n    for (var i = 0; i < n; i++) {\n        var dev = values[i] - theMean;\n        s2 += dev * dev;\n        s4 += dev * dev * dev * dev;\n    }\n    var m2 = s2 / n;\n    var m4 = s4 / n;\n\n    if (unbiased) {\n        var v = s2 / (n - 1);\n        var a = (n * (n + 1)) / ((n - 1) * (n - 2) * (n - 3));\n        var b = s4 / (v * v);\n        var c = ((n - 1) * (n - 1)) / ((n - 2) * (n - 3));\n\n        return a * b - 3 * c;\n    } else {\n        return m4 / (m2 * m2) - 3;\n    }\n};\n\nexports.entropy = function entropy(values, eps) {\n    if (typeof (eps) === 'undefined') eps = 0;\n    var sum = 0, l = values.length;\n    for (var i = 0; i < l; i++)\n        sum += values[i] * Math.log(values[i] + eps);\n    return -sum;\n};\n\nexports.weightedMean = function weightedMean(values, weights) {\n    var sum = 0, l = values.length;\n    for (var i = 0; i < l; i++)\n        sum += values[i] * weights[i];\n    return sum;\n};\n\nexports.weightedStandardDeviation = function weightedStandardDeviation(values, weights) {\n    return Math.sqrt(exports.weightedVariance(values, weights));\n};\n\nexports.weightedVariance = function weightedVariance(values, weights) {\n    var theMean = exports.weightedMean(values, weights);\n    var vari = 0, l = values.length;\n    var a = 0, b = 0;\n\n    for (var i = 0; i < l; i++) {\n        var z = values[i] - theMean;\n        var w = weights[i];\n\n        vari += w * (z * z);\n        b += w;\n        a += w * w;\n    }\n\n    return vari * (b / (b * b - a));\n};\n\nexports.center = function center(values, inPlace) {\n    if (typeof (inPlace) === 'undefined') inPlace = false;\n\n    var result = values;\n    if (!inPlace)\n        result = [].concat(values);\n\n    var theMean = exports.mean(result), l = result.length;\n    for (var i = 0; i < l; i++)\n        result[i] -= theMean;\n};\n\nexports.standardize = function standardize(values, standardDev, inPlace) {\n    if (typeof (standardDev) === 'undefined') standardDev = exports.standardDeviation(values);\n    if (typeof (inPlace) === 'undefined') inPlace = false;\n    var l = values.length;\n    var result = inPlace ? values : new Array(l);\n    for (var i = 0; i < l; i++)\n        result[i] = values[i] / standardDev;\n    return result;\n};\n\nexports.cumulativeSum = function cumulativeSum(array) {\n    var l = array.length;\n    var result = new Array(l);\n    result[0] = array[0];\n    for (var i = 1; i < l; i++)\n        result[i] = result[i - 1] + array[i];\n    return result;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-stat/array.js","'use strict';\n\nexports.hypotenuse = function hypotenuse(a, b) {\n    var r;\n    if (Math.abs(a) > Math.abs(b)) {\n        r = b / a;\n        return Math.abs(a) * Math.sqrt(1 + r * r);\n    }\n    if (b !== 0) {\n        r = a / b;\n        return Math.abs(b) * Math.sqrt(1 + r * r);\n    }\n    return 0;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-optimize-lorentzian/node_modules/ml-matrix/src/dc/util.js","\n// small note on the best way to define array\n// http://jsperf.com/lp-array-and-loops/2\n\nimport ArrayUtils from 'ml-array-utils';\nimport min from 'ml-array-min';\nimport max from 'ml-array-max';\nimport getMedian from 'ml-array-median';\nimport rescale from 'ml-array-rescale';\nimport JcampConverter from 'jcampconverter';\nimport JcampCreator from './jcampEncoder/JcampCreator';\nimport peakPicking from './peakPicking/peakPicking';\n\nconst DATACLASS_XY = 1;\nconst DATACLASS_PEAK = 2;\n\n/**\n * Construct the object from the given sd object(output of the jcampconverter or brukerconverter filter)\n * @class SD\n * @param {SD} sd\n * @constructor\n */\nexport default class SD {\n    constructor(sd) {\n        this.sd = sd;\n        this.activeElement = 0;\n    }\n\n    /**\n     * Creates a SD instance from the given jcamp.\n     * @param {string} jcamp - The jcamp string to parse from\n     * @param {object} options - Jcamp parsing options\n     * @param {boolean} [options.keepSpectra=true] - If set to false the spectra data points will not be stored in the instance\n     * @param {RegExp} [options.keepRecordsRegExp=/^.+$/] A regular expression for metadata fields to extract from the jcamp\n     * @return {SD} Return the constructed SD instance\n     */\n    static fromJcamp(jcamp, options = {}) {\n        options = Object.assign({}, {keepSpectra: true, keepRecordsRegExp: /^.+$/}, options, {xy: true});\n        var spectrum = JcampConverter.convert(jcamp, options);\n        return new this(spectrum);\n    }\n\n    /**\n     * This function create a SD instance from xy data\n     * @param {Array} x - X data.\n     * @param {Array} y - Y data.\n     * @param {object} options - Optional parameters\n     * @return {SD} SD instance from x and y data\n     */\n    static fromXY(x, y, options = {}) {\n        const result = {};\n        result.profiling = [];\n        result.logs = [];\n        result.info = {};\n        const spectrum = {};\n        spectrum.isXYdata = true;\n        spectrum.nbPoints = x.length;\n        spectrum.firstX = x[0];\n        spectrum.firstY = y[0];\n        spectrum.lastX = x[spectrum.nbPoints - 1];\n        spectrum.lastY = y[spectrum.nbPoints - 1];\n        spectrum.xFactor = 1;\n        spectrum.yFactor = 1;\n        spectrum.xUnit = options.xUnit;\n        spectrum.yUnit = options.yUnit;\n        spectrum.deltaX = (spectrum.lastX - spectrum.firstX) / (spectrum.nbPoints - 1);\n        spectrum.title = options.title || 'spectra-data from xy';\n        spectrum.dataType = options.dataType;\n        spectrum.data = [{x: x, y: y}];\n        result.twoD = false;\n        result.spectra = [spectrum];\n        return new this(result);\n    }\n\n    /**\n     * This function sets the nactiveSpectrum sub-spectrum as active\n     * @param {number} nactiveSpectrum index of the sub-spectrum to set as active\n     */\n    setActiveElement(nactiveSpectrum) {\n        this.activeElement = nactiveSpectrum;\n    }\n\n    /**\n     * This function returns the index of the active sub-spectrum.\n     * @return {number|*}\n     */\n    getActiveElement() {\n        return this.activeElement;\n    }\n\n    /**\n     * This function returns the units of the independent dimension.\n     * @return {xUnit|*|M.xUnit}\n     */\n    getXUnits() {\n        return this.getSpectrum().xUnit;\n    }\n\n    /**\n     * This function set the units of the independent dimension.\n     * @param {string} units of the independent dimension.\n     */\n    setXUnits(units) {\n        this.getSpectrum().xUnit = units;\n    }\n    /**\n     * * This function returns the units of the dependent variable.\n     * @return {yUnit|*|M.yUnit}\n     */\n    getYUnits() {\n        return this.getSpectrum().yUnit;\n    }\n\n    /**\n     * This function returns the information about the dimensions\n     * @param {number} index of the tuple\n     * @return {number|*}\n     */\n    getSpectraVariable(index) {\n        return this.sd.ntuples[index];\n    }\n\n    /**\n     * Return the current page\n     * @param {number} index - index of spectrum\n     * @return {number}\n     */\n    getPage(index) {\n        return this.sd.spectra[index].page;\n    }\n\n    /**\n     * Return the number of points in the current spectrum\n     * @param {number} i of sub-spectrum\n     * @return {number | *}\n     */\n    getNbPoints(i) {\n        return this.getSpectrumData(i).y.length;\n    }\n\n    /**\n     * Return the first value of the independent dimension\n     * @param {i} i of sub-spectrum\n     * @return {number | *}\n     */\n    getFirstX(i = this.activeElement) {\n        return this.sd.spectra[i].firstX;\n    }\n\n    /**\n     * Set the firstX for this spectrum. You have to force and update of the xAxis after!!!\n     * @param {number} x - The value for firstX\n     * @param {number} i sub-spectrum Default:activeSpectrum\n     */\n    setFirstX(x, i = this.activeElement) {\n        this.sd.spectra[i].firstX = x;\n    }\n\n    /**\n     * Return the last value of the direct dimension\n     * @param {number} i - sub-spectrum Default:activeSpectrum\n     * @return {number}\n     */\n    getLastX(i = this.activeElement) {\n        return this.sd.spectra[i].lastX;\n    }\n\n\n    /**\n     * Set the last value of the direct dimension. You have to force and update of the xAxis after!!!\n     * @param {number} x - The value for lastX\n     * @param {number} i - sub-spectrum Default:activeSpectrum\n     */\n    setLastX(x, i = this.activeElement) {\n        this.sd.spectra[i].lastX = x;\n    }\n\n    /**\n     */\n    /**\n     * Return the first value of the direct dimension\n     * @param {number} i - sub-spectrum Default:activeSpectrum\n     * @return {number}\n     */\n    getFirstY(i = this.activeElement) {\n        return this.sd.spectra[i].firstY;\n    }\n\n    /**\n     * Set the first value of the indirect dimension. Only valid for 2D spectra.\n     * @param {number} y - the value of firstY\n     * @param {number} i - sub-spectrum Default: activeSpectrum\n     */\n    setFirstY(y, i = this.activeElement) {\n        this.sd.spectra[i].firstY = y;\n    }\n\n    /**\n     * Return the first value of the indirect dimension. Only valid for 2D spectra.\n     * @param {number} i - sub-spectrum Default: activeSpectrum\n     * @return {number}\n     */\n    getLastY(i = this.activeElement) {\n        return this.sd.spectra[i].lastY;\n    }\n\n    /**\n     * Return the first value of the indirect dimension\n     * @param {number} y - the value of firstY\n     * @param {number} i - sub-spectrum Default:activeSpectrum\n     */\n    setLastY(y, i = this.activeElement) {\n        this.sd.spectra[i].lastY = y;\n    }\n\n    /**\n     * Set the spectrum data_class. It could be DATACLASS_PEAK=1 or DATACLASS_XY=2\n     * @param {string} dataClass - data_class of the current spectra data\n     */\n    setDataClass(dataClass) {\n        if (dataClass === DATACLASS_PEAK) {\n            this.getSpectrum().isPeaktable = true;\n            this.getSpectrum().isXYdata = false;\n        }\n        if (dataClass === DATACLASS_XY) {\n            this.getSpectrum().isXYdata = true;\n            this.getSpectrum().isPeaktable = false;\n        }\n    }\n\n    /**\n     * Is this a PEAKTABLE spectrum?\n     * @return {boolean}\n     */\n    isDataClassPeak() {\n        if (this.getSpectrum().isPeaktable) {\n            return this.getSpectrum().isPeaktable;\n        }\n        return false;\n    }\n\n    /**\n     * Is this a XY spectrum?\n     * @return {*}\n     */\n    isDataClassXY() {\n        if (this.getSpectrum().isXYdata) {\n            return this.getSpectrum().isXYdata;\n        }\n        return false;\n    }\n\n    /**\n     * Set the data type for this spectrum. It could be one of the following:\n     [\"INFRARED\"||\"IR\",\"IV\",\"NDNMRSPEC\",\"NDNMRFID\",\"NMRSPEC\",\"NMRFID\",\"HPLC\",\"MASS\"\n     * \"UV\", \"RAMAN\" \"GC\"|| \"GASCHROMATOGRAPH\",\"CD\"|| \"DICHRO\",\"XY\",\"DEC\"]\n     * @param {string} dataType\n     */\n    setDataType(dataType) {\n        this.getSpectrum().dataType = dataType;\n    }\n\n    /**\n     * Return the dataType(see: setDataType )\n     * @return {string|string|*|string}\n     */\n    getDataType() {\n        return this.getSpectrum().dataType;\n    }\n\n    /**\n     * Return the i-th sub-spectrum data in the current spectrum\n     * @param {number} i - sub-spectrum Default:activeSpectrum\n     * @return {object}\n     */\n    getSpectrumData(i = this.activeElement) {\n        return this.sd.spectra[i].data[0];\n    }\n\n    /**\n     * Return the i-th sub-spectra in the current spectrum\n     * @param {number} i - sub-spectrum Default:activeSpectrum\n     * @return {object}\n     */\n    getSpectrum(i = this.activeElement) {\n        return this.sd.spectra[i];\n    }\n\n    /**\n     * Return the amount of sub-spectra in this object\n     * @return {*}\n     */\n    getNbSubSpectra() {\n        return this.sd.spectra.length;\n    }\n\n    /**\n     *  Returns an array containing the x values of the spectrum\n     * @param {number} i sub-spectrum Default:activeSpectrum\n     * @return {Array}\n     */\n    getXData(i) {\n        return this.getSpectrumData(i).x;\n    }\n\n    /**\n     * This function returns a double array containing the values with the intensities for the current sub-spectrum.\n     * @param {number} i sub-spectrum Default:activeSpectrum\n     * @return {Array}\n     */\n    getYData(i) {\n        return this.getSpectrumData(i).y;\n    }\n\n    /**\n     * Returns the x value at the specified index for the active sub-spectrum.\n     * @param {number} i array index between 0 and spectrum.getNbPoints()-1\n     * @return {number}\n     */\n    getX(i) {\n        return this.getXData()[i];\n    }\n\n    /**\n     * Returns the y value at the specified index for the active sub-spectrum.\n     * @param {number} i array index between 0 and spectrum.getNbPoints()-1\n     * @return {number}\n     */\n    getY(i) {\n        return this.getYData()[i];\n    }\n\n    /**\n     * Returns a double[2][nbPoints] where the first row contains the x values and the second row the y values.\n     * @param {number} i sub-spectrum Default:activeSpectrum\n     * @return {*[]}\n     */\n    getXYData(i) {\n        return [this.getXData(i), this.getYData(i)];\n    }\n\n    /**\n     * Return the title of the current spectrum.\n     * @param {number} i sub-spectrum Default:activeSpectrum\n     * @return {*}\n     */\n    getTitle(i) {\n        return this.getSpectrum(i).title;\n    }\n\n    /**\n     * Set the title of this spectrum.\n     * @param {string} newTitle The new title\n     * @param {number} i sub-spectrum Default:activeSpectrum\n     */\n    setTitle(newTitle, i) {\n        this.getSpectrum(i).title = newTitle;\n    }\n\n    /**\n     * This function returns the minimal value of Y\n     * @param {number} i sub-spectrum Default:activeSpectrum\n     * @return {number}\n     */\n    getMinY(i) {\n        return min(this.getYData(i));\n    }\n\n    /**\n     * This function returns the maximal value of Y\n     * @param {number} i sub-spectrum Default:activeSpectrum\n     * @return {number}\n     */\n    getMaxY(i) {\n        return max(this.getYData(i));\n    }\n\n    /**\n     * Return the min and max value of Y\n     * @param {number} i sub-spectrum Default:activeSpectrum\n     * @return {{min, max}|*}\n     */\n    getMinMaxY(i) {\n        return {min: this.getMinY(i), max: this.getMaxY(i)};\n    }\n\n\n    /**\n     * Get the noise threshold level of the current spectrum. It uses median instead of the mean\n     * @param {object} options\n     * @param {number} options.from - lower limit in ppm to compute noise level\n     * @param {number} options.to - upper limit in ppm to compute noise level\n     * @return {number}\n     */\n    getNoiseLevel(options = {}) {\n        let data;\n        if (options.from && options.to) {\n            data = this.getVector(options.from, options.to);\n        } else {\n            data = this.getYData();\n        }\n        var median = getMedian(data);\n        return median * this.getNMRPeakThreshold(this.getNucleus(1));\n    }\n\n    /**\n     * Return the xValue for the given index.\n     * @param {number} doublePoint\n     * @return {number}\n     */\n    arrayPointToUnits(doublePoint) {\n        return (this.getFirstX() - (doublePoint * (this.getFirstX() - this.getLastX()) / (this.getNbPoints() - 1)));\n    }\n\n    /**\n     * Returns the index-value for the data array corresponding to a X-value in\n     * units for the element of spectraData to which it is linked (spectraNb).\n     * This method makes use of spectraData.getFirstX(), spectraData.getLastX()\n     * and spectraData.getNbPoints() to derive the return value if it of data class XY\n     * It performs a binary search if the spectrum is a peak table\n     * @param {number} inValue - value in Units to be converted\n     * @return {number} An integer representing the index value of the inValue\n     */\n    unitsToArrayPoint(inValue) {\n        if (this.isDataClassXY()) {\n            return Math.round((this.getFirstX() - inValue) * (-1.0 / this.getDeltaX()));\n        } else if (this.isDataClassPeak()) {\n            var currentArrayPoint = 0;\n            var upperLimit = this.getNbPoints() - 1;\n            var lowerLimit = 0;\n            var midPoint;\n\n            if (this.getFirstX() > this.getLastX()) {\n                upperLimit = 0;\n                lowerLimit = this.getNbPoints() - 1;\n\n                if (inValue > this.getFirstX()) {\n                    return this.getNbPoints();\n                }\n                if (inValue < this.getLastX()) {\n                    return -1;\n                }\n            } else {\n                if (inValue < this.getFirstX()) {\n                    return -1;\n                }\n                if (inValue > this.getLastX()) {\n                    return this.getNbPoints();\n                }\n            }\n\n            while (Math.abs(upperLimit - lowerLimit) > 1) {\n                midPoint = Math.round(Math.floor((upperLimit + lowerLimit) / 2));\n                if (this.getX(midPoint) === inValue) {\n                    return midPoint;\n                }\n                if (this.getX(midPoint) > inValue) {\n                    upperLimit = midPoint;\n                } else {\n                    lowerLimit = midPoint;\n                }\n            }\n            currentArrayPoint = lowerLimit;\n            if (Math.abs(this.getX(lowerLimit) - inValue) > Math.abs(this.getX(upperLimit) - inValue)) {\n                currentArrayPoint = upperLimit;\n            }\n            return currentArrayPoint;\n        } else {\n            return 0;\n        }\n    }\n\n    /**\n     * Returns the separation between 2 consecutive points in the frequency domain\n     * @return {number}\n     */\n    getDeltaX() {\n        return (this.getLastX() - this.getFirstX()) / (this.getNbPoints() - 1);\n    }\n\n    /**\n     * This function scales the values of Y between the min and max parameters\n     * @param {number} min - Minimum desired value for Y\n     * @param {number} max - Maximum desired value for Y\n     */\n    setMinMax(min, max) {\n        let y = this.getYData();\n        rescale(y, {min: min, max: max, output: y});\n        this.updateFirstLastY();\n    }\n\n    /**\n     * This function scales the values of Y to fit the min parameter\n     * @param {number} min - Minimum desired value for Y\n     */\n    setMin(min) {\n        let y = this.getYData();\n        rescale(y, {min: min, output: y, autoMinMax: true});\n        this.updateFirstLastY();\n    }\n\n    /**\n     * This function scales the values of Y to fit the max parameter\n     * @param {number} max - Maximum desired value for Y\n     */\n    setMax(max) {\n        let y = this.getYData();\n        rescale(y, {max: max, output: y, autoMinMax: true});\n        this.updateFirstLastY();\n    }\n\n    /**\n     * This function shifts the values of Y\n     * @param {number} value - Distance of the shift\n     */\n    yShift(value) {\n        var y = this.getYData();\n        for (var i = 0; i < y.length; i++) {\n            y[i] += value;\n        }\n        this.updateFirstLastY(y);\n    }\n\n    /**\n     * This function shift the given spectraData. After this function is applied, all the peaks in the\n     * spectraData will be found at xi+globalShift\n     * @param {number} globalShift - Distance of the shift for direct dimension.\n     */\n    shift(globalShift) {\n        for (let i = 0; i < this.getNbSubSpectra(); i++) {\n            this.setActiveElement(i);\n            var x = this.getSpectrumData().x;\n            var length = this.getNbPoints();\n            for (var j = 0; j < length; j++) {\n                x[j] += globalShift;\n            }\n            this.updateFirstLastX(x);\n        }\n    }\n\n    /**\n     * Update first and last values of Y data.\n     * @param {Array} y - array of Y spectra data.\n     */\n    updateFirstLastY(y) {\n        if (!Array.isArray(y)) {\n            y = this.getYData();\n        }\n        this.setFirstY(y[0]);\n        this.setLastY(y[y.length - 1]);\n    }\n\n    /**\n     * Update first and last values of X data.\n     * @param {Array} x - array of X spectra data.\n     */\n    updateFirstLastX(x) {\n        if (!Array.isArray(x)) {\n            x = this.getXData();\n        }\n        this.setFirstX(x[0]);\n        this.setLastX(x[x.length - 1]);\n    }\n    /**\n     * Fills a zone of the spectrum with the given value.\n     * If value is undefined it will suppress the elements\n     * @param {number} from - one limit the spectrum to fill\n     * @param {number} to - one limit the spectrum to fill\n     * @param {number} value - value with which to fill\n     */\n    fill(from, to, value) {\n        var start, end, x, y;\n        for (var i = 0; i < this.getNbSubSpectra(); i++) {\n            this.setActiveElement(i);\n\n            x = this.getXData();\n            y = this.getYData();\n\n            start = this.unitsToArrayPoint(from);\n            end = this.unitsToArrayPoint(to);\n\n            if (start > end) {\n                [start, end] = [end, start];\n            }\n\n            if (typeof value !== 'number') {\n                y.splice(start, end - start);\n                x.splice(start, end - start);\n            } else {\n                for (i = start; i <= end; i++) {\n                    y[i] = value;\n                }\n            }\n        }\n    }\n\n    /**\n     * This function suppress a zone from the given spectraData within the given x range.\n     * Returns a spectraData of type PEAKDATA without peaks in the given region\n     * @param {number} from - one limit the spectrum to suppress\n     * @param {number} to - one limit the spectrum to suppress\n     */\n    suppressZone(from, to) {\n        this.fill(from, to);\n        this.setDataClass(DATACLASS_PEAK);\n    }\n\n    /**\n     * This function suppress a zones of the given spectraData within the given x range.\n     * Returns a spectraData of type PEAKDATA without peaks in the given region\n     * @param {Array} zones - Array with from-to limits of the spectrum to suppress.\n     */\n    suppressZones(zones = []) {\n        for (var i = 0; i < zones.length; i++) {\n            this.suppressZone(zones[i].from, zones[i].to);\n        }\n    }\n\n\n    /**\n     * This function performs a simple peak detection in a spectraData. The parameters that can be specified are:\n     * Returns a two dimensional array of double specifying [x,y] of the detected peaks.\n     * @option from:    Lower limit.\n     * @option to:      Upper limit.\n     * @option threshold: The minimum intensity to consider a peak as a signal, expressed as a percentage of the highest peak.\n     * @option stdev: Number of standard deviation of the noise for the threshold calculation if a threshold is not specified.\n     * @option resolution: The maximum resolution of the spectrum for considering peaks.\n     * @option yInverted: Is it a Y inverted spectrum?(like an IR spectrum)\n     * @option smooth: A function for smoothing the spectraData before the detection. If your are dealing with\n     * experimental spectra, smoothing will make the algorithm less prune to false positives.\n     */\n    /*\n    simplePeakPicking(parameters) {\n        //@TODO implements this filter\n    }\n    */\n\n    /**\n     * Get the maximum peak the spectrum\n     * @return {[x, y]}\n     */\n    getMaxPeak() {\n        var y = this.getSpectraDataY();\n        var max = y[0];\n        var index = 0;\n        for (var i = 0; i < y.length; i++) {\n            if (max < y[i]) {\n                max = y[i];\n                index = i;\n            }\n        }\n        return [this.getX(index), max];\n    }\n\n    /** TODO: should be modifed, this is same that getParamInt and getParam\n     * Get the value of the parameter. If it is null, will set up a default value\n     * @param {string} name - The parameter name\n     * @param {*} defvalue - The default value\n     * @return {number}\n     */\n\n    getParamDouble(name, defvalue) {\n        var value = this.sd.info[name];\n        if (!value) {\n            value = defvalue;\n        }\n        return value;\n    }\n\n    /**\n     * Get the string of the value of the parameter. If it is null, will set up a default value\n     * @param {string} name - The parameter name\n     * @param {*} defvalue - The default value\n     * @return {string}\n     */\n    getParamString(name, defvalue) {\n        var value = this.sd.info[name];\n        if (!value) {\n            value = defvalue;\n        }\n        return value + '';\n    }\n\n    /**\n     * Get the value of the parameter\n     * @param {string} name - The parameter name\n     * @param {*} defvalue - The default value\n     * @return {number}\n     */\n    getParamInt(name, defvalue) {\n        var value = this.sd.info[name];\n        if (!value) {\n            value = defvalue;\n        }\n        return value;\n    }\n\n    /**\n     * Get the value of the parameter\n     * @param {string} name - The parameter name\n     * @param {*} defvalue - The default value\n     * @return {*}\n     */\n    getParam(name, defvalue) {\n        var value = this.sd.info[name];\n        if (!value) {\n            value = defvalue;\n        }\n        return value;\n    }\n\n    /**\n     * True if the spectrum.info contains the given parameter\n     * @param {string} name - The parameter name\n     * @return {boolean}\n     */\n    containsParam(name) {\n        if (this.sd.info[name]) {\n            return true;\n        }\n        return false;\n    }\n\n    /**\n     * Return the y elements of the current spectrum. Same as getYData. Kept for backward compatibility.\n     * @return {Array}\n     */\n    getSpectraDataY() {\n        return this.getYData();\n    }\n\n    /**\n     * Return the x elements of the current spectrum. Same as getXData. Kept for backward compatibility.\n     * @return {Array}\n     */\n    getSpectraDataX() {\n        return this.getXData();\n    }\n\n    /**\n     * Update min max values of X and Y axis.\n     */\n    resetMinMax() {\n        //TODO: Implement this function\n    }\n\n    /**\n     * Set a new parameter to this spectrum\n     * @param {string} name - the parameter name\n     * @param {number | *} value - the parameter value\n     */\n    putParam(name, value) {\n        this.sd.info[name] = value;\n    }\n\n    /**\n     * This function returns the area under the spectrum in the given window (spectrum units)\n     * @param {number} from - one limit in spectrum units\n     * @param {number} to - one limit in spectrum units\n     * @return {number}\n     */\n    getArea(from, to) {\n        var i0 = this.unitsToArrayPoint(from);\n        var ie = this.unitsToArrayPoint(to);\n        var area = 0;\n\n        if (i0 > ie) {\n            [i0, ie] = [ie, i0];\n        }\n\n        for (var i = i0; i < ie; i++) {\n            area += this.getY(i);\n        }\n        return area * Math.abs(this.getDeltaX());\n    }\n\n    /**\n     * This function return the integral values for certains ranges at specific SD instance .\n     * @param {Array} ranges - array of objects ranges\n     * @param {object} options - option such as nH for normalization, if it is nH is zero the integral value returned is absolute value\n     */\n    updateIntegrals(ranges, options = {}) {\n        ranges.forEach(range => range.integral = this.getArea(range.from, range.to));\n        ranges.updateIntegrals({sum: options.nH});\n    }\n\n    /**\n     * Returns a equally spaced vector within the given window.\n     * @param {number} from - one limit in spectrum units\n     * @param {number} to - one limit in spectrum units\n     * @param {number} nPoints - number of points to return(!!!sometimes it is not possible to return exactly the required nbPoints)\n     * @return {Array}\n     */\n    getVector(from, to, nPoints) {\n        if (nPoints) {\n            return ArrayUtils.getEquallySpacedData(this.getSpectraDataX(), this.getSpectraDataY(),\n                {from: from, to: to, numberOfPoints: nPoints});\n        } else {\n            return this.getPointsInWindow(from, to);\n        }\n    }\n\n    /**\n     * In place modification of the data to usually reduce the size\n     * This will convert the data in equally spaces X.\n     * @param {number} from - one limit in spectrum units\n     * @param {number} to - one limit in spectrum units\n     * @param {object} options\n     * @param {number} options.nbPoints - number of points to return(!!!sometimes it is not possible to return exactly the required nbPoints)\n     * @return {this}\n     */\n    reduceData(from, to, options = {}) {\n        if (!this.isDataClassXY()) {\n            throw Error('reduceData can only apply on equidistant data');\n        }\n\n        for (let i = 0; i < this.getNbSubSpectra(); i++) {\n            this.setActiveElement(i);\n            if (this.getXUnits().toLowerCase() !== 'hz') {\n                if (options.nbPoints) {\n                    let x = this.getSpectraDataX();\n                    let y = this.getSpectraDataY();\n\n                    if (x[0] > x[1] && from < to) {\n                        [from, to] = [to, from];\n                    } else if (from > to) {\n                        [from, to] = [to, from];\n                    }\n                    y = ArrayUtils.getEquallySpacedData(x, y, {from: from, to: to, numberOfPoints: options.nbPoints});\n\n                    let step = (to - from) / (y.length - 1);\n                    x = new Array(y.length).fill(from);\n                    for (let j = 0; j < y.length; j++) {\n                        x[j] += step * j;\n                    }\n\n                    this.sd.spectra[i].data[0].x = x;\n                    this.sd.spectra[i].data[0].y = y;\n                    this.setFirstX(x[0]); this.setLastX(x[x.length - 1]);\n                    this.sd.spectra[i].nbPoints = y.length;\n                } else {\n                    var xyData = this.getPointsInWindow(from, to);\n                    this.sd.spectra[i].data[0].x = xyData[0];\n                    this.sd.spectra[i].data[0].y = xyData[1];\n                    this.setFirstX(xyData[0][0]); this.setLastX(xyData[0][xyData[0].length - 1]);\n                    this.sd.spectra[i].nbPoints = xyData[1].length;\n                }\n            }\n        }\n        this.setActiveElement(0);\n        return this;\n    }\n\n    /**\n     * Returns all the point in a given window.\n     * Not tested, you have to know what you are doing\n     * @param {number} from - index of a limit of the desired window.\n     * @param {number} to - index of a limit of the desired window\n     * @param {object} options\n     * @param {boolean} options.withoutX\n     * @return {Array} XYarray/Yarray data of the desired window.\n     */\n    getPointsInWindow(from, to, options = {}) {\n        if (!this.isDataClassXY()) {\n            throw Error('getPointsInWindow can only apply on equidistant data');\n        }\n\n        var indexOfFrom = this.unitsToArrayPoint(from);\n        var indexOfTo = this.unitsToArrayPoint(to);\n\n        if (indexOfFrom > indexOfTo) {\n            [indexOfFrom, indexOfTo] = [indexOfTo, indexOfFrom];\n        }\n        if (indexOfFrom >= 0 && indexOfTo <= this.getNbPoints() - 2) {\n            var data = this.getSpectraDataY().slice(indexOfFrom, indexOfTo + 1);\n            if (!options.withoutX) {\n                var x = this.getSpectraDataX().slice(indexOfFrom, indexOfTo + 1);\n                data = [x, data];\n            }\n            return data;\n        } else {\n            throw Error('values outside this in range');\n        }\n    }\n\n    /**\n     * Is it a 2D spectrum?\n     * @return {boolean}\n     */\n    is2D() {\n        if (typeof this.sd.twoD === 'undefined') {\n            return false;\n        }\n        return this.sd.twoD;\n    }\n\n    /**\n     * Set the normalization value for this spectrum\n     * @param {number} value - integral value to set up\n     */\n    setTotalIntegral(value) {\n        this.totalIntegralValue = value;\n    }\n\n    /**\n     * Return the normalization value. It is not set check the molfile and guess it from the number of atoms.\n     * @return {number}\n     */\n    get totalIntegral() {\n        if (this.totalIntegralValue) {\n            return this.totalIntegralValue;\n        } else if (this.molecule) {\n            if (this.getNucleus(0).indexOf('H')) {\n                return this.mf.replace(/.*H([0-9]+).*/, '$1') * 1;\n            }\n            if (this.getNucleus(0).indexOf('C')) {\n                return this.mf.replace(/.*C([0-9]+).*/, '$1') * 1;\n            }\n        } else {\n            return 100;\n        }\n        return 1;\n    }\n\n    /**\n     * this function set a molfile, molecule and molecular formula.\n     * @param {string} molfile - The molfile that correspond to current spectra data\n     */\n    setMolfile(molfile) {\n        this.molfile = molfile;\n    }\n\n    setMF(mf) {\n        this.mf = mf;\n    }\n\n    /**\n     * this function create a new peakPicking\n     * @param {object} options - parameters to calculation of peakPicking\n     * @return {*}\n     */\n    createPeaks(options = {}) {\n        this.peaks = peakPicking(this, options);\n        return this.peaks;\n    }\n\n    /**\n     * this function return the peak table or extract the peak of the spectrum.\n     * @param {object} options - parameters to calculation of peakPicking\n     * @return {*}\n     */\n    getPeaks(options) {\n        let peaks;\n        if (this.peaks) {\n            peaks = this.peaks;\n        } else {\n            peaks = peakPicking(this, options);\n        }\n        return peaks;\n    }\n\n    /*autoAssignment(options) {\n\n    }*/\n\n    /**\n     * This function creates a String that represents the given spectraData in the format JCAMP-DX 5.0\n     * The X,Y data can be compressed using one of the methods described in:\n     * \"JCAMP-DX. A STANDARD FORMAT FOR THE EXCHANGE OF ION MOBILITY SPECTROMETRY DATA\",\n     *  http://www.iupac.org/publications/pac/pdf/2001/pdf/7311x1765.pdf\n     * @param {object} options - some options are availables:\n     * @option {string} encode  - ['FIX','SQZ','DIF','DIFDUP','CVS','PAC'] (Default: 'DIFDUP')\n     * @option {number} yfactor - The YFACTOR. It allows to compress the data by removing digits from the ordinate. (Default: 1)\n     * @option {string} type - [\"NTUPLES\", \"SIMPLE\"] (Default: \"SIMPLE\")\n     * @option {object} keep - A set of user defined parameters of the given SpectraData to be stored in the jcamp.\n     * @example SD.toJcamp(spectraData,{encode:'DIFDUP',yfactor:0.01,type:\"SIMPLE\",keep:['#batchID','#url']});\n     * @return {*} a string containing the jcamp-DX file\n     */\n    toJcamp(options = {}) {\n        var creator = new JcampCreator();\n        return creator.convert(this, Object.assign({}, {yFactor: 1, encode: 'DIFDUP', type: 'SIMPLE'}, options));\n    }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/spectra-data/src/SD.js","'use strict';\n\nvar Asplice = Array.prototype.splice,\n    Aconcat = Array.prototype.concat;\n\n// For performance : http://jsperf.com/clone-array-slice-vs-while-vs-for\nfunction slice(arr) {\n    var i = 0,\n        ii = arr.length,\n        result = new Array(ii);\n    for (; i < ii; i++) {\n        result[i] = arr[i];\n    }\n    return result;\n}\n\n/**\n * Real matrix.\n * @constructor\n * @param {number|Array} nRows - Number of rows of the new matrix or a 2D array containing the data.\n * @param {number|boolean} [nColumns] - Number of columns of the new matrix or a boolean specifying if the input array should be cloned\n */\nfunction Matrix(nRows, nColumns) {\n    var i = 0, rows, columns, matrix, newInstance;\n    if (Array.isArray(nRows)) {\n        newInstance = nColumns;\n        matrix = newInstance ? slice(nRows) : nRows;\n        nRows = matrix.length;\n        nColumns = matrix[0].length;\n        if (typeof nColumns === 'undefined') {\n            throw new TypeError('Data must be a 2D array');\n        }\n        if (nRows > 0 && nColumns > 0) {\n            for (; i < nRows; i++) {\n                if (matrix[i].length !== nColumns) {\n                    throw new RangeError('Inconsistent array dimensions');\n                } else if (newInstance) {\n                    matrix[i] = slice(matrix[i]);\n                }\n            }\n        } else {\n            throw new RangeError('Invalid dimensions: ' + nRows + 'x' + nColumns);\n        }\n    } else if (typeof nRows === 'number') { // Create empty matrix\n        if (nRows > 0 && nColumns > 0) {\n            matrix = new Array(nRows);\n            for (; i < nRows; i++) {\n                matrix[i] = new Array(nColumns);\n            }\n        } else {\n            throw new RangeError('Invalid dimensions: ' + nRows + 'x' + nColumns);\n        }\n    } else {\n        throw new TypeError('Invalid arguments');\n    }\n\n    Object.defineProperty(matrix, 'rows', {writable: true, value: nRows});\n    Object.defineProperty(matrix, 'columns', {writable: true, value: nColumns});\n\n    matrix.__proto__ = Matrix.prototype;\n\n    return matrix;\n}\n\n/**\n * Constructs a Matrix with the chosen dimensions from a 1D array.\n * @param {number} newRows - Number of rows\n * @param {number} newColumns - Number of columns\n * @param {Array} newData - A 1D array containing data for the matrix\n * @returns {Matrix} - The new matrix\n */\nMatrix.from1DArray = function from1DArray(newRows, newColumns, newData) {\n    var length, data, i = 0;\n\n    length = newRows * newColumns;\n    if (length !== newData.length)\n        throw new RangeError('Data length does not match given dimensions');\n\n    data = new Array(newRows);\n    for (; i < newRows; i++) {\n        data[i] = newData.slice(i * newColumns, (i + 1) * newColumns);\n    }\n    return new Matrix(data);\n};\n\n/**\n * Creates a row vector, a matrix with only one row.\n * @param {Array} newData - A 1D array containing data for the vector\n * @returns {Matrix} - The new matrix\n */\nMatrix.rowVector = function rowVector(newData) {\n    return new Matrix([newData]);\n};\n\n/**\n * Creates a column vector, a matrix with only one column.\n * @param {Array} newData - A 1D array containing data for the vector\n * @returns {Matrix} - The new matrix\n */\nMatrix.columnVector = function columnVector(newData) {\n    var l = newData.length, vector = new Array(l);\n    for (var i = 0; i < l; i++)\n        vector[i] = [newData[i]];\n    return new Matrix(vector);\n};\n\n/**\n * Creates an empty matrix with the given dimensions. Values will be undefined. Same as using new Matrix(rows, columns).\n * @param {number} rows - Number of rows\n * @param {number} columns - Number of columns\n * @returns {Matrix} - The new matrix\n */\nMatrix.empty = function empty(rows, columns) {\n    return new Matrix(rows, columns);\n};\n\n/**\n * Creates a matrix with the given dimensions. Values will be set to zero.\n * @param {number} rows - Number of rows\n * @param {number} columns - Number of columns\n * @returns {Matrix} - The new matrix\n */\nMatrix.zeros = function zeros(rows, columns) {\n    return Matrix.empty(rows, columns).fill(0);\n};\n\n/**\n * Creates a matrix with the given dimensions. Values will be set to one.\n * @param {number} rows - Number of rows\n * @param {number} columns - Number of columns\n * @returns {Matrix} - The new matrix\n */\nMatrix.ones = function ones(rows, columns) {\n    return Matrix.empty(rows, columns).fill(1);\n};\n\n/**\n * Creates a matrix with the given dimensions. Values will be randomly set using Math.random().\n * @param {number} rows - Number of rows\n * @param {number} columns - Number of columns\n * @returns {Matrix} The new matrix\n */\nMatrix.rand = function rand(rows, columns) {\n    var matrix = Matrix.empty(rows, columns);\n    for (var i = 0, ii = matrix.rows; i < ii; i++) {\n        for (var j = 0, jj = matrix.columns; j < jj; j++) {\n            matrix[i][j] = Math.random();\n        }\n    }\n    return matrix;\n};\n\n/**\n * Creates an identity matrix with the given dimension. Values of the diagonal will be 1 and other will be 0.\n * @param {number} n - Number of rows and columns\n * @returns {Matrix} - The new matrix\n */\nMatrix.eye = function eye(n) {\n    var matrix = Matrix.zeros(n, n), l = matrix.rows;\n    for (var i = 0; i < l; i++) {\n        matrix[i][i] = 1;\n    }\n    return matrix;\n};\n\n/**\n * Creates a diagonal matrix based on the given array.\n * @param {Array} data - Array containing the data for the diagonal\n * @returns {Matrix} - The new matrix\n */\nMatrix.diag = function diag(data) {\n    var l = data.length, matrix = Matrix.zeros(l, l);\n    for (var i = 0; i < l; i++) {\n        matrix[i][i] = data[i];\n    }\n    return matrix;\n};\n\n/**\n * Creates an array of indices between two values\n * @param {number} from\n * @param {number} to\n * @returns {Array}\n */\nMatrix.indices = function indices(from, to) {\n    var vector = new Array(to - from);\n    for (var i = 0; i < vector.length; i++)\n        vector[i] = from++;\n    return vector;\n};\n\n// TODO DOC\nMatrix.stack = function stack(arg1) {\n    var i, j, k;\n    if (Matrix.isMatrix(arg1)) {\n        var rows = 0,\n            cols = 0;\n        for (i = 0; i < arguments.length; i++) {\n            rows += arguments[i].rows;\n            if (arguments[i].columns > cols)\n                cols = arguments[i].columns;\n        }\n\n        var r = Matrix.zeros(rows, cols);\n        var c = 0;\n        for (i = 0; i < arguments.length; i++) {\n            var current = arguments[i];\n            for (j = 0; j < current.rows; j++) {\n                for (k = 0; k < current.columns; k++)\n                    r[c][k] = current[j][k];\n                c++;\n            }\n        }\n        return r;\n    }\n    else if (Array.isArray(arg1)) {\n        var matrix = Matrix.empty(arguments.length, arg1.length);\n        for (i = 0; i < arguments.length; i++)\n            matrix.setRow(i, arguments[i]);\n        return matrix;\n    }\n};\n\n// TODO DOC\nMatrix.expand = function expand(base, count) {\n    var expansion = [];\n    for (var i = 0; i < count.length; i++)\n        for (var j = 0; j < count[i]; j++)\n            expansion.push(base[i]);\n    return new Matrix(expansion);\n};\n\n/**\n * Check that the provided value is a Matrix and tries to instantiate one if not\n * @param value - The value to check\n * @returns {Matrix}\n * @throws {TypeError}\n */\nMatrix.checkMatrix = function checkMatrix(value) {\n    if (!value) {\n        throw new TypeError('Argument has to be a matrix');\n    }\n    if (value.klass !== 'Matrix') {\n        value = new Matrix(value);\n    }\n    return value;\n};\n\n/**\n * Returns true if the argument is a Matrix, false otherwise\n * @param value - The value to check\n * @returns {boolean}\n */\nMatrix.isMatrix = function isMatrix(value) {\n    return value ? value.klass === 'Matrix' : false;\n};\n\n/**\n * @property {string} - The name of this class.\n */\nObject.defineProperty(Matrix.prototype, 'klass', {\n    get: function klass() {\n        return 'Matrix';\n    }\n});\n\n/**\n * @property {number} - The number of elements in the matrix.\n */\nObject.defineProperty(Matrix.prototype, 'size', {\n    get: function size() {\n        return this.rows * this.columns;\n    }\n});\n\n/**\n * @private\n * Internal check that a row index is not out of bounds\n * @param {number} index\n */\nMatrix.prototype.checkRowIndex = function checkRowIndex(index) {\n    if (index < 0 || index > this.rows - 1)\n        throw new RangeError('Row index out of range.');\n};\n\n/**\n * @private\n * Internal check that a column index is not out of bounds\n * @param {number} index\n */\nMatrix.prototype.checkColumnIndex = function checkColumnIndex(index) {\n    if (index < 0 || index > this.columns - 1)\n        throw new RangeError('Column index out of range.');\n};\n\n/**\n * @private\n * Internal check that two matrices have the same dimensions\n * @param {Matrix} otherMatrix\n */\nMatrix.prototype.checkDimensions = function checkDimensions(otherMatrix) {\n    if ((this.rows !== otherMatrix.rows) || (this.columns !== otherMatrix.columns))\n        throw new RangeError('Matrices dimensions must be equal.');\n};\n\n/**\n * Applies a callback for each element of the matrix. The function is called in the matrix (this) context.\n * @param {function} callback - Function that will be called with two parameters : i (row) and j (column)\n * @returns {Matrix} this\n */\nMatrix.prototype.apply = function apply(callback) {\n    var ii = this.rows, jj = this.columns;\n    for (var i = 0; i < ii; i++) {\n        for (var j = 0; j < jj; j++) {\n            callback.call(this, i, j);\n        }\n    }\n    return this;\n};\n\n/**\n * Creates an exact and independent copy of the matrix\n * @returns {Matrix}\n */\nMatrix.prototype.clone = function clone() {\n    return new Matrix(this.to2DArray());\n};\n\n/**\n * Returns a new 1D array filled row by row with the matrix values\n * @returns {Array}\n */\nMatrix.prototype.to1DArray = function to1DArray() {\n    return Aconcat.apply([], this);\n};\n\n/**\n * Returns a 2D array containing a copy of the data\n * @returns {Array}\n */\nMatrix.prototype.to2DArray = function to2DArray() {\n    var l = this.rows, copy = new Array(l);\n    for (var i = 0; i < l; i++) {\n        copy[i] = slice(this[i]);\n    }\n    return copy;\n};\n\n/**\n * @returns {boolean} true if the matrix has one row\n */\nMatrix.prototype.isRowVector = function isRowVector() {\n    return this.rows === 1;\n};\n\n/**\n * @returns {boolean} true if the matrix has one column\n */\nMatrix.prototype.isColumnVector = function isColumnVector() {\n    return this.columns === 1;\n};\n\n/**\n * @returns {boolean} true if the matrix has one row or one column\n */\nMatrix.prototype.isVector = function isVector() {\n    return (this.rows === 1) || (this.columns === 1);\n};\n\n/**\n * @returns {boolean} true if the matrix has the same number of rows and columns\n */\nMatrix.prototype.isSquare = function isSquare() {\n    return this.rows === this.columns;\n};\n\n/**\n * @returns {boolean} true if the matrix is square and has the same values on both sides of the diagonal\n */\nMatrix.prototype.isSymmetric = function isSymmetric() {\n    if (this.isSquare()) {\n        var l = this.rows;\n        for (var i = 0; i < l; i++) {\n            for (var j = 0; j <= i; j++) {\n                if (this[i][j] !== this[j][i]) {\n                    return false;\n                }\n            }\n        }\n        return true;\n    }\n    return false;\n};\n\n/**\n * Sets a given element of the matrix. mat.set(3,4,1) is equivalent to mat[3][4]=1\n * @param {number} rowIndex - Index of the row\n * @param {number} columnIndex - Index of the column\n * @param {number} value - The new value for the element\n * @returns {Matrix} this\n */\nMatrix.prototype.set = function set(rowIndex, columnIndex, value) {\n    this[rowIndex][columnIndex] = value;\n    return this;\n};\n\n/**\n * Returns the given element of the matrix. mat.get(3,4) is equivalent to matrix[3][4]\n * @param {number} rowIndex - Index of the row\n * @param {number} columnIndex - Index of the column\n * @returns {number}\n */\nMatrix.prototype.get = function get(rowIndex, columnIndex) {\n    return this[rowIndex][columnIndex];\n};\n\n/**\n * Fills the matrix with a given value. All elements will be set to this value.\n * @param {number} value - New value\n * @returns {Matrix} this\n */\nMatrix.prototype.fill = function fill(value) {\n    var ii = this.rows, jj = this.columns;\n    for (var i = 0; i < ii; i++) {\n        for (var j = 0; j < jj; j++) {\n            this[i][j] = value;\n        }\n    }\n    return this;\n};\n\n/**\n * Negates the matrix. All elements will be multiplied by (-1)\n * @returns {Matrix} this\n */\nMatrix.prototype.neg = function neg() {\n    return this.mulS(-1);\n};\n\n/**\n * Adds a scalar or values from another matrix (in place)\n * @param {number|Matrix} value\n * @returns {Matrix} this\n */\nMatrix.prototype.add = function add(value) {\n    if (typeof value === 'number')\n        return this.addS(value);\n    value = Matrix.checkMatrix(value);\n        return this.addM(value);\n};\n\n/**\n * Adds a scalar to each element of the matrix\n * @param {number} value\n * @returns {Matrix} this\n */\nMatrix.prototype.addS = function addS(value) {\n    var ii = this.rows, jj = this.columns;\n    for (var i = 0; i < ii; i++) {\n        for (var j = 0; j < jj; j++) {\n            this[i][j] += value;\n        }\n    }\n    return this;\n};\n\n/**\n * Adds the value of each element of matrix to the corresponding element of this\n * @param {Matrix} matrix\n * @returns {Matrix} this\n */\nMatrix.prototype.addM = function addM(matrix) {\n    this.checkDimensions(matrix);\n    var ii = this.rows, jj = this.columns;\n    for (var i = 0; i < ii; i++) {\n        for (var j = 0; j < jj; j++) {\n            this[i][j] += matrix[i][j];\n        }\n    }\n    return this;\n};\n\n/**\n * Subtracts a scalar or values from another matrix (in place)\n * @param {number|Matrix} value\n * @returns {Matrix} this\n */\nMatrix.prototype.sub = function sub(value) {\n    if (typeof value === 'number')\n        return this.subS(value);\n    value = Matrix.checkMatrix(value);\n        return this.subM(value);\n};\n\n/**\n * Subtracts a scalar from each element of the matrix\n * @param {number} value\n * @returns {Matrix} this\n */\nMatrix.prototype.subS = function subS(value) {\n    var ii = this.rows, jj = this.columns;\n    for (var i = 0; i < ii; i++) {\n        for (var j = 0; j < jj; j++) {\n            this[i][j] -= value;\n        }\n    }\n    return this;\n};\n\n/**\n * Subtracts the value of each element of matrix from the corresponding element of this\n * @param {Matrix} matrix\n * @returns {Matrix} this\n */\nMatrix.prototype.subM = function subM(matrix) {\n    this.checkDimensions(matrix);\n    var ii = this.rows, jj = this.columns;\n    for (var i = 0; i < ii; i++) {\n        for (var j = 0; j < jj; j++) {\n            this[i][j] -= matrix[i][j];\n        }\n    }\n    return this;\n};\n\n/**\n * Multiplies a scalar or values from another matrix (in place)\n * @param {number|Matrix} value\n * @returns {Matrix} this\n */\nMatrix.prototype.mul = function mul(value) {\n    if (typeof value === 'number')\n        return this.mulS(value);\n    value = Matrix.checkMatrix(value);\n        return this.mulM(value);\n};\n\n/**\n * Multiplies a scalar with each element of the matrix\n * @param {number} value\n * @returns {Matrix} this\n */\nMatrix.prototype.mulS = function mulS(value) {\n    var ii = this.rows, jj = this.columns;\n    for (var i = 0; i < ii; i++) {\n        for (var j = 0; j < jj; j++) {\n            this[i][j] *= value;\n        }\n    }\n    return this;\n};\n\n/**\n * Multiplies the value of each element of matrix with the corresponding element of this\n * @param {Matrix} matrix\n * @returns {Matrix} this\n */\nMatrix.prototype.mulM = function mulM(matrix) {\n    this.checkDimensions(matrix);\n    var ii = this.rows, jj = this.columns;\n    for (var i = 0; i < ii; i++) {\n        for (var j = 0; j < jj; j++) {\n            this[i][j] *= matrix[i][j];\n        }\n    }\n    return this;\n};\n\n/**\n * Divides by a scalar or values from another matrix (in place)\n * @param {number|Matrix} value\n * @returns {Matrix} this\n */\nMatrix.prototype.div = function div(value) {\n    if (typeof value === 'number')\n        return this.divS(value);\n    value = Matrix.checkMatrix(value);\n        return this.divM(value);\n};\n\n/**\n * Divides each element of the matrix by a scalar\n * @param {number} value\n * @returns {Matrix} this\n */\nMatrix.prototype.divS = function divS(value) {\n    var ii = this.rows, jj = this.columns;\n    for (var i = 0; i < ii; i++) {\n        for (var j = 0; j < jj; j++) {\n            this[i][j] /= value;\n        }\n    }\n    return this;\n};\n\n/**\n * Divides each element of this by the corresponding element of matrix\n * @param {Matrix} matrix\n * @returns {Matrix} this\n */\nMatrix.prototype.divM = function divM(matrix) {\n    this.checkDimensions(matrix);\n    var ii = this.rows, jj = this.columns;\n    for (var i = 0; i < ii; i++) {\n        for (var j = 0; j < jj; j++) {\n            this[i][j] /= matrix[i][j];\n        }\n    }\n    return this;\n};\n\n/**\n * Returns a new array from the given row index\n * @param {number} index - Row index\n * @returns {Array}\n */\nMatrix.prototype.getRow = function getRow(index) {\n    this.checkRowIndex(index);\n    return slice(this[index]);\n};\n\n/**\n * Returns a new row vector from the given row index\n * @param {number} index - Row index\n * @returns {Matrix}\n */\nMatrix.prototype.getRowVector = function getRowVector(index) {\n    return Matrix.rowVector(this.getRow(index));\n};\n\n/**\n * Sets a row at the given index\n * @param {number} index - Row index\n * @param {Array|Matrix} array - Array or vector\n * @returns {Matrix} this\n */\nMatrix.prototype.setRow = function setRow(index, array) {\n    this.checkRowIndex(index);\n    if (Matrix.isMatrix(array)) array = array.to1DArray();\n    if (array.length !== this.columns)\n        throw new RangeError('Invalid row size');\n    this[index] = slice(array);\n    return this;\n};\n\n/**\n * Removes a row from the given index\n * @param {number} index - Row index\n * @returns {Matrix} this\n */\nMatrix.prototype.removeRow = function removeRow(index) {\n    this.checkRowIndex(index);\n    if (this.rows === 1)\n        throw new RangeError('A matrix cannot have less than one row');\n    Asplice.call(this, index, 1);\n    this.rows -= 1;\n    return this;\n};\n\n/**\n * Adds a row at the given index\n * @param {number} [index = this.rows] - Row index\n * @param {Array|Matrix} array - Array or vector\n * @returns {Matrix} this\n */\nMatrix.prototype.addRow = function addRow(index, array) {\n    if (typeof array === 'undefined') {\n        array = index;\n        index = this.rows;\n    }\n    if (index < 0 || index > this.rows)\n        throw new RangeError('Row index out of range.');\n    if (Matrix.isMatrix(array)) array = array.to1DArray();\n    if (array.length !== this.columns)\n        throw new RangeError('Invalid row size');\n    Asplice.call(this, index, 0, slice(array));\n    this.rows += 1;\n    return this;\n};\n\n/**\n * Swaps two rows\n * @param {number} row1 - First row index\n * @param {number} row2 - Second row index\n * @returns {Matrix} this\n */\nMatrix.prototype.swapRows = function swapRows(row1, row2) {\n    this.checkRowIndex(row1);\n    this.checkRowIndex(row2);\n    var temp = this[row1];\n    this[row1] = this[row2];\n    this[row2] = temp;\n    return this;\n};\n\n/**\n * Returns a new array from the given column index\n * @param {number} index - Column index\n * @returns {Array}\n */\nMatrix.prototype.getColumn = function getColumn(index) {\n    this.checkColumnIndex(index);\n    var l = this.rows, column = new Array(l);\n    for (var i = 0; i < l; i++) {\n        column[i] = this[i][index];\n    }\n    return column;\n};\n\n/**\n * Returns a new column vector from the given column index\n * @param {number} index - Column index\n * @returns {Matrix}\n */\nMatrix.prototype.getColumnVector = function getColumnVector(index) {\n    return Matrix.columnVector(this.getColumn(index));\n};\n\n/**\n * Sets a column at the given index\n * @param {number} index - Column index\n * @param {Array|Matrix} array - Array or vector\n * @returns {Matrix} this\n */\nMatrix.prototype.setColumn = function setColumn(index, array) {\n    this.checkColumnIndex(index);\n    if (Matrix.isMatrix(array)) array = array.to1DArray();\n    var l = this.rows;\n    if (array.length !== l)\n        throw new RangeError('Invalid column size');\n    for (var i = 0; i < l; i++) {\n        this[i][index] = array[i];\n    }\n    return this;\n};\n\n/**\n * Removes a column from the given index\n * @param {number} index - Column index\n * @returns {Matrix} this\n */\nMatrix.prototype.removeColumn = function removeColumn(index) {\n    this.checkColumnIndex(index);\n    if (this.columns === 1)\n        throw new RangeError('A matrix cannot have less than one column');\n    for (var i = 0, ii = this.rows; i < ii; i++) {\n        this[i].splice(index, 1);\n    }\n    this.columns -= 1;\n    return this;\n};\n\n/**\n * Adds a column at the given index\n * @param {number} [index = this.columns] - Column index\n * @param {Array|Matrix} array - Array or vector\n * @returns {Matrix} this\n */\nMatrix.prototype.addColumn = function addColumn(index, array) {\n    if (typeof array === 'undefined') {\n        array = index;\n        index = this.columns;\n    }\n    if (index < 0 || index > this.columns)\n        throw new RangeError('Column index out of range.');\n    if (Matrix.isMatrix(array)) array = array.to1DArray();\n    var l = this.rows;\n    if (array.length !== l)\n        throw new RangeError('Invalid column size');\n    for (var i = 0; i < l; i++) {\n        this[i].splice(index, 0, array[i]);\n    }\n    this.columns += 1;\n    return this;\n};\n\n/**\n * Swaps two columns\n * @param {number} column1 - First column index\n * @param {number} column2 - Second column index\n * @returns {Matrix} this\n */\nMatrix.prototype.swapColumns = function swapColumns(column1, column2) {\n    this.checkRowIndex(column1);\n    this.checkRowIndex(column2);\n    var l = this.rows, temp, row;\n    for (var i = 0; i < l; i++) {\n        row = this[i];\n        temp = row[column1];\n        row[column1] = row[column2];\n        row[column2] = temp;\n    }\n    return this;\n};\n\n/**\n * @private\n * Internal check that the provided vector is an array with the right length\n * @param {Array|Matrix} vector\n * @returns {Array}\n * @throws {RangeError}\n */\nMatrix.prototype.checkRowVector = function checkRowVector(vector) {\n    if (Matrix.isMatrix(vector))\n        vector = vector.to1DArray();\n    if (vector.length !== this.columns)\n        throw new RangeError('vector size must be the same as the number of columns');\n    return vector;\n};\n\n/**\n * @private\n * Internal check that the provided vector is an array with the right length\n * @param {Array|Matrix} vector\n * @returns {Array}\n * @throws {RangeError}\n */\nMatrix.prototype.checkColumnVector = function checkColumnVector(vector) {\n    if (Matrix.isMatrix(vector))\n        vector = vector.to1DArray();\n    if (vector.length !== this.rows)\n        throw new RangeError('vector size must be the same as the number of rows');\n    return vector;\n};\n\n/**\n * Adds the values of a vector to each row\n * @param {Array|Matrix} vector - Array or vector\n * @returns {Matrix} this\n */\nMatrix.prototype.addRowVector = function addRowVector(vector) {\n    vector = this.checkRowVector(vector);\n    var ii = this.rows, jj = this.columns;\n    for (var i = 0; i < ii; i++) {\n        for (var j = 0; j < jj; j++) {\n            this[i][j] += vector[j];\n        }\n    }\n    return this;\n};\n\n/**\n * Subtracts the values of a vector from each row\n * @param {Array|Matrix} vector - Array or vector\n * @returns {Matrix} this\n */\nMatrix.prototype.subRowVector = function subRowVector(vector) {\n    vector = this.checkRowVector(vector);\n    var ii = this.rows, jj = this.columns;\n    for (var i = 0; i < ii; i++) {\n        for (var j = 0; j < jj; j++) {\n            this[i][j] -= vector[j];\n        }\n    }\n    return this;\n};\n\n/**\n * Multiplies the values of a vector with each row\n * @param {Array|Matrix} vector - Array or vector\n * @returns {Matrix} this\n */\nMatrix.prototype.mulRowVector = function mulRowVector(vector) {\n    vector = this.checkRowVector(vector);\n    var ii = this.rows, jj = this.columns;\n    for (var i = 0; i < ii; i++) {\n        for (var j = 0; j < jj; j++) {\n            this[i][j] *= vector[j];\n        }\n    }\n    return this;\n};\n\n/**\n * Divides the values of each row by those of a vector\n * @param {Array|Matrix} vector - Array or vector\n * @returns {Matrix} this\n */\nMatrix.prototype.divRowVector = function divRowVector(vector) {\n    vector = this.checkRowVector(vector);\n    var ii = this.rows, jj = this.columns;\n    for (var i = 0; i < ii; i++) {\n        for (var j = 0; j < jj; j++) {\n            this[i][j] /= vector[j];\n        }\n    }\n    return this;\n};\n\n/**\n * Adds the values of a vector to each column\n * @param {Array|Matrix} vector - Array or vector\n * @returns {Matrix} this\n */\nMatrix.prototype.addColumnVector = function addColumnVector(vector) {\n    vector = this.checkColumnVector(vector);\n    var ii = this.rows, jj = this.columns;\n    for (var i = 0; i < ii; i++) {\n        for (var j = 0; j < jj; j++) {\n            this[i][j] += vector[i];\n        }\n    }\n    return this;\n};\n\n/**\n * Subtracts the values of a vector from each column\n * @param {Array|Matrix} vector - Array or vector\n * @returns {Matrix} this\n */\nMatrix.prototype.subColumnVector = function subColumnVector(vector) {\n    vector = this.checkColumnVector(vector);\n    var ii = this.rows, jj = this.columns;\n    for (var i = 0; i < ii; i++) {\n        for (var j = 0; j < jj; j++) {\n            this[i][j] -= vector[i];\n        }\n    }\n    return this;\n};\n\n/**\n * Multiplies the values of a vector with each column\n * @param {Array|Matrix} vector - Array or vector\n * @returns {Matrix} this\n */\nMatrix.prototype.mulColumnVector = function mulColumnVector(vector) {\n    vector = this.checkColumnVector(vector);\n    var ii = this.rows, jj = this.columns;\n    for (var i = 0; i < ii; i++) {\n        for (var j = 0; j < jj; j++) {\n            this[i][j] *= vector[i];\n        }\n    }\n    return this;\n};\n\n/**\n * Divides the values of each column by those of a vector\n * @param {Array|Matrix} vector - Array or vector\n * @returns {Matrix} this\n */\nMatrix.prototype.divColumnVector = function divColumnVector(vector) {\n    vector = this.checkColumnVector(vector);\n    var ii = this.rows, jj = this.columns;\n    for (var i = 0; i < ii; i++) {\n        for (var j = 0; j < jj; j++) {\n            this[i][j] /= vector[i];\n        }\n    }\n    return this;\n};\n\n/**\n * Multiplies the values of a row with a scalar\n * @param {number} index - Row index\n * @param {number} value\n * @returns {Matrix} this\n */\nMatrix.prototype.mulRow = function mulRow(index, value) {\n    this.checkRowIndex(index);\n    var i = 0, l = this.columns;\n    for (; i < l; i++) {\n        this[index][i] *= value;\n    }\n    return this;\n};\n\n/**\n * Multiplies the values of a column with a scalar\n * @param {number} index - Column index\n * @param {number} value\n * @returns {Matrix} this\n */\nMatrix.prototype.mulColumn = function mulColumn(index, value) {\n    this.checkColumnIndex(index);\n    var i = 0, l = this.rows;\n    for (; i < l; i++) {\n        this[i][index] *= value;\n    }\n};\n\n/**\n * A matrix index\n * @typedef {Object} MatrixIndex\n * @property {number} row\n * @property {number} column\n */\n\n/**\n * Returns the maximum value of the matrix\n * @returns {number}\n */\nMatrix.prototype.max = function max() {\n    var v = -Infinity;\n    var ii = this.rows, jj = this.columns;\n    for (var i = 0; i < ii; i++) {\n        for (var j = 0; j < jj; j++) {\n            if (this[i][j] > v) {\n                v = this[i][j];\n            }\n        }\n    }\n    return v;\n};\n\n/**\n * Returns the index of the maximum value\n * @returns {MatrixIndex}\n */\nMatrix.prototype.maxIndex = function maxIndex() {\n    var v = -Infinity;\n    var idx = {};\n    var ii = this.rows, jj = this.columns;\n    for (var i = 0; i < ii; i++) {\n        for (var j = 0; j < jj; j++) {\n            if (this[i][j] > v) {\n                v = this[i][j];\n                idx.row = i;\n                idx.column = j;\n            }\n        }\n    }\n    return idx;\n};\n\n/**\n * Returns the minimum value of the matrix\n * @returns {number}\n */\nMatrix.prototype.min = function min() {\n    var v = Infinity;\n    var ii = this.rows, jj = this.columns;\n    for (var i = 0; i < ii; i++) {\n        for (var j = 0; j < jj; j++) {\n            if (this[i][j] < v) {\n                v = this[i][j];\n            }\n        }\n    }\n    return v;\n};\n\n/**\n * Returns the index of the minimum value\n * @returns {MatrixIndex}\n */\nMatrix.prototype.minIndex = function minIndex() {\n    var v = Infinity;\n    var idx = {};\n    var ii = this.rows, jj = this.columns;\n    for (var i = 0; i < ii; i++) {\n        for (var j = 0; j < jj; j++) {\n            if (this[i][j] < v) {\n                v = this[i][j];\n                idx.row = i;\n                idx.column = j;\n            }\n        }\n    }\n    return idx;\n};\n\n/**\n * Returns the maximum value of one row\n * @param {number} index - Row index\n * @returns {number}\n */\nMatrix.prototype.maxRow = function maxRow(index) {\n    this.checkRowIndex(index);\n    var v = -Infinity;\n    for (var i = 0, ii = this.columns; i < ii; i++) {\n        if (this[index][i] > v) {\n            v = this[index][i];\n        }\n    }\n    return v;\n};\n\n/**\n * Returns the index of the maximum value of one row\n * @param {number} index - Row index\n * @returns {MatrixIndex}\n */\nMatrix.prototype.maxRowIndex = function maxRowIndex(index) {\n    this.checkRowIndex(index);\n    var v = -Infinity;\n    var idx = {\n            row: index\n        };\n    for (var i = 0, ii = this.columns; i < ii; i++) {\n        if (this[index][i] > v) {\n            v = this[index][i];\n            idx.column = i;\n        }\n    }\n    return idx;\n};\n\n/**\n * Returns the minimum value of one row\n * @param {number} index - Row index\n * @returns {number}\n */\nMatrix.prototype.minRow = function minRow(index) {\n    this.checkRowIndex(index);\n    var v = Infinity;\n    for (var i = 0, ii = this.columns; i < ii; i++) {\n        if (this[index][i] < v) {\n            v = this[index][i];\n        }\n    }\n    return v;\n};\n\n/**\n * Returns the index of the maximum value of one row\n * @param {number} index - Row index\n * @returns {MatrixIndex}\n */\nMatrix.prototype.minRowIndex = function minRowIndex(index) {\n    this.checkRowIndex(index);\n    var v = Infinity;\n    var idx = {\n        row: index,\n        column: 0\n    };\n    for (var i = 0, ii = this.columns; i < ii; i++) {\n        if (this[index][i] < v) {\n            v = this[index][i];\n            idx.column = i;\n        }\n    }\n    return idx;\n};\n\n/**\n * Returns the maximum value of one column\n * @param {number} index - Column index\n * @returns {number}\n */\nMatrix.prototype.maxColumn = function maxColumn(index) {\n    this.checkColumnIndex(index);\n    var v = -Infinity;\n    for (var i = 0, ii = this.rows; i < ii; i++) {\n        if (this[i][index] > v) {\n            v = this[i][index];\n        }\n    }\n    return v;\n};\n\n/**\n * Returns the index of the maximum value of one column\n * @param {number} index - Column index\n * @returns {MatrixIndex}\n */\nMatrix.prototype.maxColumnIndex = function maxColumnIndex(index) {\n    this.checkColumnIndex(index);\n    var v = -Infinity;\n    var idx = {\n        row: 0,\n        column: index\n    };\n    for (var i = 0, ii = this.rows; i < ii; i++) {\n        if (this[i][index] > v) {\n            v = this[i][index];\n            idx.row = i;\n        }\n    }\n    return idx;\n};\n\n/**\n * Returns the minimum value of one column\n * @param {number} index - Column index\n * @returns {number}\n */\nMatrix.prototype.minColumn = function minColumn(index) {\n    this.checkColumnIndex(index);\n    var v = Infinity;\n    for (var i = 0, ii = this.rows; i < ii; i++) {\n        if (this[i][index] < v) {\n            v = this[i][index];\n        }\n    }\n    return v;\n};\n\n/**\n * Returns the index of the minimum value of one column\n * @param {number} index - Column index\n * @returns {MatrixIndex}\n */\nMatrix.prototype.minColumnIndex = function minColumnIndex(index) {\n    this.checkColumnIndex(index);\n    var v = Infinity;\n    var idx = {\n        row: 0,\n        column: index\n    };\n    for (var i = 0, ii = this.rows; i < ii; i++) {\n        if (this[i][index] < v) {\n            v = this[i][index];\n            idx.row = i;\n        }\n    }\n    return idx;\n};\n\n/**\n * Returns an array containing the diagonal values of the matrix\n * @returns {Array}\n */\nMatrix.prototype.diag = function diag() {\n    if (!this.isSquare())\n        throw new TypeError('Only square matrices have a diagonal.');\n    var diag = new Array(this.rows);\n    for (var i = 0, ii = this.rows; i < ii; i++) {\n        diag[i] = this[i][i];\n    }\n    return diag;\n};\n\n/**\n * Returns the sum of all elements of the matrix\n * @returns {number}\n */\nMatrix.prototype.sum = function sum() {\n    var v = 0;\n    var ii = this.rows, jj = this.columns;\n    for (var i = 0; i < ii; i++) {\n        for (var j = 0; j < jj; j++) {\n            v += this[i][j];\n        }\n    }\n    return v;\n};\n\n/**\n * Returns the mean of all elements of the matrix\n * @returns {number}\n */\nMatrix.prototype.mean = function mean() {\n    return this.sum() / this.size;\n};\n\n/**\n * Returns the product of all elements of the matrix\n * @returns {number}\n */\nMatrix.prototype.prod = function prod() {\n    var prod = 1;\n    var ii = this.rows, jj = this.columns;\n    for (var i = 0; i < ii; i++) {\n        for (var j = 0; j < jj; j++) {\n            prod *= this[i][j];\n        }\n    }\n    return prod;\n};\n\n/**\n * Computes the cumulative sum of the matrix elements (in place, row by row)\n * @returns {Matrix} this\n */\nMatrix.prototype.cumulativeSum = function cumulativeSum() {\n    var sum = 0;\n    var ii = this.rows, jj = this.columns;\n    for (var i = 0; i < ii; i++) {\n        for (var j = 0; j < jj; j++) {\n            sum += this[i][j];\n            this[i][j] = sum;\n        }\n    }\n    return this;\n};\n\n/**\n * Computes the dot (scalar) product between the matrix and another\n * @param {Matrix} other vector\n * @returns {number}\n */\nMatrix.prototype.dot = function dot(other) {\n    if (this.size !== other.size)\n        throw new RangeError('vectors do not have the same size');\n    var vector1 = this.to1DArray();\n    var vector2 = other.to1DArray();\n    var dot = 0, l = vector1.length;\n    for (var i = 0; i < l; i++) {\n        dot += vector1[i] * vector2[i];\n    }\n    return dot;\n};\n\n/**\n * Returns the matrix product between this and other\n * @returns {Matrix}\n */\nMatrix.prototype.mmul = function mmul(other) {\n    if (!Matrix.isMatrix(other))\n        throw new TypeError('parameter \"other\" must be a matrix');\n    if (this.columns !== other.rows)\n        console.warn('Number of columns of left matrix are not equal to number of rows of right matrix.');\n\n    var m = this.rows, n = this.columns, p = other.columns;\n    var result = new Matrix(m, p);\n\n    var Bcolj = new Array(n);\n    var i, j, k;\n    for (j = 0; j < p; j++) {\n        for (k = 0; k < n; k++)\n            Bcolj[k] = other[k][j];\n\n        for (i = 0; i < m; i++) {\n            var Arowi = this[i];\n\n            var s = 0;\n            for (k = 0; k < n; k++)\n                s += Arowi[k] * Bcolj[k];\n\n            result[i][j] = s;\n        }\n    }\n    return result;\n};\n\n/**\n * Sorts the rows (in place)\n * @param {function} compareFunction - usual Array.prototype.sort comparison function\n * @returns {Matrix} this\n */\nMatrix.prototype.sortRows = function sortRows(compareFunction) {\n    for (var i = 0, ii = this.rows; i < ii; i++) {\n        this[i].sort(compareFunction);\n    }\n    return this;\n};\n\n/**\n * Sorts the columns (in place)\n * @param {function} compareFunction - usual Array.prototype.sort comparison function\n * @returns {Matrix} this\n */\nMatrix.prototype.sortColumns = function sortColumns(compareFunction) {\n    for (var i = 0, ii = this.columns; i < ii; i++) {\n        this.setColumn(i, this.getColumn(i).sort(compareFunction));\n    }\n    return this;\n};\n\n/**\n * Transposes the matrix and returns a new one containing the result\n * @returns {Matrix}\n */\nMatrix.prototype.transpose = function transpose() {\n    var result = new Matrix(this.columns, this.rows);\n    var ii = this.rows, jj = this.columns;\n    for (var i = 0; i < ii; i++) {\n        for (var j = 0; j < jj; j++) {\n            result[j][i] = this[i][j];\n        }\n    }\n    return result;\n};\n\n/**\n * Returns a subset of the matrix\n * @param {number} startRow - First row index\n * @param {number} endRow - Last row index\n * @param {number} startColumn - First column index\n * @param {number} endColumn - Last column index\n * @returns {Matrix}\n */\nMatrix.prototype.subMatrix = function subMatrix(startRow, endRow, startColumn, endColumn) {\n    if ((startRow > endRow) || (startColumn > endColumn) || (startRow < 0) || (startRow >= this.rows) || (endRow < 0) || (endRow >= this.rows) || (startColumn < 0) || (startColumn >= this.columns) || (endColumn < 0) || (endColumn >= this.columns))\n        throw new RangeError('Argument out of range');\n    var newMatrix = new Matrix(endRow - startRow + 1, endColumn - startColumn + 1);\n    for (var i = startRow; i <= endRow; i++) {\n        for (var j = startColumn; j <= endColumn; j++) {\n            newMatrix[i - startRow][j - startColumn] = this[i][j];\n        }\n    }\n    return newMatrix;\n};\n\n/**\n * Returns a subset of the matrix based on an array of row indices\n * @param {Array} indices - Array containing the row indices\n * @param {number} [startColumn = 0] - First column index\n * @param {number} [endColumn = this.columns-1] - Last column index\n * @returns {Matrix}\n */\nMatrix.prototype.subMatrixRow = function subMatrixRow(indices, startColumn, endColumn) {\n    if (typeof startColumn === 'undefined') {\n        startColumn = 0;\n        endColumn = this.columns - 1;\n    } else if (typeof endColumn === 'undefined') {\n        endColumn = this.columns - 1;\n    }\n    if ((startColumn > endColumn) || (startColumn < 0) || (startColumn >= this.columns) || (endColumn < 0) || (endColumn >= this.columns))\n        throw new RangeError('Argument out of range.');\n    var l = indices.length, rows = this.rows,\n        X = new Matrix(l, endColumn - startColumn + 1);\n    for (var i = 0; i < l; i++) {\n        for (var j = startColumn; j <= endColumn; j++) {\n            if ((indices[i] < 0) || (indices[i] >= rows))\n                throw new RangeError('Argument out of range.');\n            X[i][j - startColumn] = this[indices[i]][j];\n        }\n    }\n    return X;\n};\n\n/**\n * Returns a subset of the matrix based on an array of column indices\n * @param {Array} indices - Array containing the column indices\n * @param {number} [startRow = 0] - First row index\n * @param {number} [endRow = this.rows-1] - Last row index\n * @returns {Matrix}\n */\nMatrix.prototype.subMatrixColumn = function subMatrixColumn(indices, startRow, endRow) {\n    if (typeof startRow === 'undefined') {\n        startRow = 0;\n        endRow = this.rows - 1;\n    } else if (typeof endRow === 'undefined') {\n        endRow = this.rows - 1;\n    }\n    if ((startRow > endRow) || (startRow < 0) || (startRow >= this.rows) || (endRow < 0) || (endRow >= this.rows))\n        throw new RangeError('Argument out of range.');\n    var l = indices.length, columns = this.columns,\n        X = new Matrix(endRow - startRow + 1, l);\n    for (var i = 0; i < l; i++) {\n        for (var j = startRow; j <= endRow; j++) {\n            if ((indices[i] < 0) || (indices[i] >= columns))\n                throw new RangeError('Argument out of range.');\n            X[j - startRow][i] = this[j][indices[i]];\n        }\n    }\n    return X;\n};\n\n/**\n * Returns the trace of the matrix (sum of the diagonal elements)\n * @returns {number}\n */\nMatrix.prototype.trace = function trace() {\n    if (!this.isSquare())\n        throw new TypeError('The matrix is not square');\n    var trace = 0, i = 0, l = this.rows;\n    for (; i < l; i++) {\n        trace += this[i][i];\n    }\n    return trace;\n};\n\n/**\n * Sets each element of the matrix to its absolute value\n * @returns {Matrix} this\n */\nMatrix.prototype.abs = function abs() {\n    var ii = this.rows, jj = this.columns;\n    for (var i = 0; i < ii; i++) {\n        for (var j = 0; j < jj; j++) {\n            this[i][j] = Math.abs(this[i][j]);\n        }\n    }\n};\n\nmodule.exports = Matrix;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-optimize-lorentzian/node_modules/ml-matrix/src/matrix.js","'use strict';\n\nrequire('./symbol-species');\nvar abstractMatrix = require('./abstractMatrix');\nvar util = require('./util');\n\nclass Matrix extends abstractMatrix(Array) {\n    constructor(nRows, nColumns) {\n        var i;\n        if (arguments.length === 1 && typeof nRows === 'number') {\n            return new Array(nRows);\n        }\n        if (Matrix.isMatrix(nRows)) {\n            return nRows.clone();\n        } else if (Number.isInteger(nRows) && nRows > 0) { // Create an empty matrix\n            super(nRows);\n            if (Number.isInteger(nColumns) && nColumns > 0) {\n                for (i = 0; i < nRows; i++) {\n                    this[i] = new Array(nColumns);\n                }\n            } else {\n                throw new TypeError('nColumns must be a positive integer');\n            }\n        } else if (Array.isArray(nRows)) { // Copy the values from the 2D array\n            const matrix = nRows;\n            nRows = matrix.length;\n            nColumns = matrix[0].length;\n            if (typeof nColumns !== 'number' || nColumns === 0) {\n                throw new TypeError('Data must be a 2D array with at least one element');\n            }\n            super(nRows);\n            for (i = 0; i < nRows; i++) {\n                if (matrix[i].length !== nColumns) {\n                    throw new RangeError('Inconsistent array dimensions');\n                }\n                this[i] = [].concat(matrix[i]);\n            }\n        } else {\n            throw new TypeError('First argument must be a positive number or an array');\n        }\n        this.rows = nRows;\n        this.columns = nColumns;\n        return this;\n    }\n\n    set(rowIndex, columnIndex, value) {\n        this[rowIndex][columnIndex] = value;\n        return this;\n    }\n\n    get(rowIndex, columnIndex) {\n        return this[rowIndex][columnIndex];\n    }\n\n    /**\n     * Creates an exact and independent copy of the matrix\n     * @return {Matrix}\n     */\n    clone() {\n        var newMatrix = new this.constructor[Symbol.species](this.rows, this.columns);\n        for (var row = 0; row < this.rows; row++) {\n            for (var column = 0; column < this.columns; column++) {\n                newMatrix.set(row, column, this.get(row, column));\n            }\n        }\n        return newMatrix;\n    }\n\n    /**\n     * Removes a row from the given index\n     * @param {number} index - Row index\n     * @return {Matrix} this\n     */\n    removeRow(index) {\n        util.checkRowIndex(this, index);\n        if (this.rows === 1) {\n            throw new RangeError('A matrix cannot have less than one row');\n        }\n        this.splice(index, 1);\n        this.rows -= 1;\n        return this;\n    }\n\n    /**\n     * Adds a row at the given index\n     * @param {number} [index = this.rows] - Row index\n     * @param {Array|Matrix} array - Array or vector\n     * @return {Matrix} this\n     */\n    addRow(index, array) {\n        if (array === undefined) {\n            array = index;\n            index = this.rows;\n        }\n        util.checkRowIndex(this, index, true);\n        array = util.checkRowVector(this, array, true);\n        this.splice(index, 0, array);\n        this.rows += 1;\n        return this;\n    }\n\n    /**\n     * Removes a column from the given index\n     * @param {number} index - Column index\n     * @return {Matrix} this\n     */\n    removeColumn(index) {\n        util.checkColumnIndex(this, index);\n        if (this.columns === 1) {\n            throw new RangeError('A matrix cannot have less than one column');\n        }\n        for (var i = 0; i < this.rows; i++) {\n            this[i].splice(index, 1);\n        }\n        this.columns -= 1;\n        return this;\n    }\n\n    /**\n     * Adds a column at the given index\n     * @param {number} [index = this.columns] - Column index\n     * @param {Array|Matrix} array - Array or vector\n     * @return {Matrix} this\n     */\n    addColumn(index, array) {\n        if (typeof array === 'undefined') {\n            array = index;\n            index = this.columns;\n        }\n        util.checkColumnIndex(this, index, true);\n        array = util.checkColumnVector(this, array);\n        for (var i = 0; i < this.rows; i++) {\n            this[i].splice(index, 0, array[i]);\n        }\n        this.columns += 1;\n        return this;\n    }\n}\n\nexports.Matrix = Matrix;\nMatrix.abstractMatrix = abstractMatrix;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-matrix/src/matrix.js","'use strict';\nvar support = require('./support');\nvar compressions = require('./compressions');\nvar nodeBuffer = require('./nodeBuffer');\n/**\n * Convert a string to a \"binary string\" : a string containing only char codes between 0 and 255.\n * @param {string} str the string to transform.\n * @return {String} the binary string.\n */\nexports.string2binary = function(str) {\n    var result = \"\";\n    for (var i = 0; i < str.length; i++) {\n        result += String.fromCharCode(str.charCodeAt(i) & 0xff);\n    }\n    return result;\n};\nexports.arrayBuffer2Blob = function(buffer, mimeType) {\n    exports.checkSupport(\"blob\");\n\tmimeType = mimeType || 'application/zip';\n\n    try {\n        // Blob constructor\n        return new Blob([buffer], {\n            type: mimeType\n        });\n    }\n    catch (e) {\n\n        try {\n            // deprecated, browser only, old way\n            var Builder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder;\n            var builder = new Builder();\n            builder.append(buffer);\n            return builder.getBlob(mimeType);\n        }\n        catch (e) {\n\n            // well, fuck ?!\n            throw new Error(\"Bug : can't construct the Blob.\");\n        }\n    }\n\n\n};\n/**\n * The identity function.\n * @param {Object} input the input.\n * @return {Object} the same input.\n */\nfunction identity(input) {\n    return input;\n}\n\n/**\n * Fill in an array with a string.\n * @param {String} str the string to use.\n * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to fill in (will be mutated).\n * @return {Array|ArrayBuffer|Uint8Array|Buffer} the updated array.\n */\nfunction stringToArrayLike(str, array) {\n    for (var i = 0; i < str.length; ++i) {\n        array[i] = str.charCodeAt(i) & 0xFF;\n    }\n    return array;\n}\n\n/**\n * Transform an array-like object to a string.\n * @param {Array|ArrayBuffer|Uint8Array|Buffer} array the array to transform.\n * @return {String} the result.\n */\nfunction arrayLikeToString(array) {\n    // Performances notes :\n    // --------------------\n    // String.fromCharCode.apply(null, array) is the fastest, see\n    // see http://jsperf.com/converting-a-uint8array-to-a-string/2\n    // but the stack is limited (and we can get huge arrays !).\n    //\n    // result += String.fromCharCode(array[i]); generate too many strings !\n    //\n    // This code is inspired by http://jsperf.com/arraybuffer-to-string-apply-performance/2\n    var chunk = 65536;\n    var result = [],\n        len = array.length,\n        type = exports.getTypeOf(array),\n        k = 0,\n        canUseApply = true;\n      try {\n         switch(type) {\n            case \"uint8array\":\n               String.fromCharCode.apply(null, new Uint8Array(0));\n               break;\n            case \"nodebuffer\":\n               String.fromCharCode.apply(null, nodeBuffer(0));\n               break;\n         }\n      } catch(e) {\n         canUseApply = false;\n      }\n\n      // no apply : slow and painful algorithm\n      // default browser on android 4.*\n      if (!canUseApply) {\n         var resultStr = \"\";\n         for(var i = 0; i < array.length;i++) {\n            resultStr += String.fromCharCode(array[i]);\n         }\n    return resultStr;\n    }\n    while (k < len && chunk > 1) {\n        try {\n            if (type === \"array\" || type === \"nodebuffer\") {\n                result.push(String.fromCharCode.apply(null, array.slice(k, Math.min(k + chunk, len))));\n            }\n            else {\n                result.push(String.fromCharCode.apply(null, array.subarray(k, Math.min(k + chunk, len))));\n            }\n            k += chunk;\n        }\n        catch (e) {\n            chunk = Math.floor(chunk / 2);\n        }\n    }\n    return result.join(\"\");\n}\n\nexports.applyFromCharCode = arrayLikeToString;\n\n\n/**\n * Copy the data from an array-like to an other array-like.\n * @param {Array|ArrayBuffer|Uint8Array|Buffer} arrayFrom the origin array.\n * @param {Array|ArrayBuffer|Uint8Array|Buffer} arrayTo the destination array which will be mutated.\n * @return {Array|ArrayBuffer|Uint8Array|Buffer} the updated destination array.\n */\nfunction arrayLikeToArrayLike(arrayFrom, arrayTo) {\n    for (var i = 0; i < arrayFrom.length; i++) {\n        arrayTo[i] = arrayFrom[i];\n    }\n    return arrayTo;\n}\n\n// a matrix containing functions to transform everything into everything.\nvar transform = {};\n\n// string to ?\ntransform[\"string\"] = {\n    \"string\": identity,\n    \"array\": function(input) {\n        return stringToArrayLike(input, new Array(input.length));\n    },\n    \"arraybuffer\": function(input) {\n        return transform[\"string\"][\"uint8array\"](input).buffer;\n    },\n    \"uint8array\": function(input) {\n        return stringToArrayLike(input, new Uint8Array(input.length));\n    },\n    \"nodebuffer\": function(input) {\n        return stringToArrayLike(input, nodeBuffer(input.length));\n    }\n};\n\n// array to ?\ntransform[\"array\"] = {\n    \"string\": arrayLikeToString,\n    \"array\": identity,\n    \"arraybuffer\": function(input) {\n        return (new Uint8Array(input)).buffer;\n    },\n    \"uint8array\": function(input) {\n        return new Uint8Array(input);\n    },\n    \"nodebuffer\": function(input) {\n        return nodeBuffer(input);\n    }\n};\n\n// arraybuffer to ?\ntransform[\"arraybuffer\"] = {\n    \"string\": function(input) {\n        return arrayLikeToString(new Uint8Array(input));\n    },\n    \"array\": function(input) {\n        return arrayLikeToArrayLike(new Uint8Array(input), new Array(input.byteLength));\n    },\n    \"arraybuffer\": identity,\n    \"uint8array\": function(input) {\n        return new Uint8Array(input);\n    },\n    \"nodebuffer\": function(input) {\n        return nodeBuffer(new Uint8Array(input));\n    }\n};\n\n// uint8array to ?\ntransform[\"uint8array\"] = {\n    \"string\": arrayLikeToString,\n    \"array\": function(input) {\n        return arrayLikeToArrayLike(input, new Array(input.length));\n    },\n    \"arraybuffer\": function(input) {\n        return input.buffer;\n    },\n    \"uint8array\": identity,\n    \"nodebuffer\": function(input) {\n        return nodeBuffer(input);\n    }\n};\n\n// nodebuffer to ?\ntransform[\"nodebuffer\"] = {\n    \"string\": arrayLikeToString,\n    \"array\": function(input) {\n        return arrayLikeToArrayLike(input, new Array(input.length));\n    },\n    \"arraybuffer\": function(input) {\n        return transform[\"nodebuffer\"][\"uint8array\"](input).buffer;\n    },\n    \"uint8array\": function(input) {\n        return arrayLikeToArrayLike(input, new Uint8Array(input.length));\n    },\n    \"nodebuffer\": identity\n};\n\n/**\n * Transform an input into any type.\n * The supported output type are : string, array, uint8array, arraybuffer, nodebuffer.\n * If no output type is specified, the unmodified input will be returned.\n * @param {String} outputType the output type.\n * @param {String|Array|ArrayBuffer|Uint8Array|Buffer} input the input to convert.\n * @throws {Error} an Error if the browser doesn't support the requested output type.\n */\nexports.transformTo = function(outputType, input) {\n    if (!input) {\n        // undefined, null, etc\n        // an empty string won't harm.\n        input = \"\";\n    }\n    if (!outputType) {\n        return input;\n    }\n    exports.checkSupport(outputType);\n    var inputType = exports.getTypeOf(input);\n    var result = transform[inputType][outputType](input);\n    return result;\n};\n\n/**\n * Return the type of the input.\n * The type will be in a format valid for JSZip.utils.transformTo : string, array, uint8array, arraybuffer.\n * @param {Object} input the input to identify.\n * @return {String} the (lowercase) type of the input.\n */\nexports.getTypeOf = function(input) {\n    if (typeof input === \"string\") {\n        return \"string\";\n    }\n    if (Object.prototype.toString.call(input) === \"[object Array]\") {\n        return \"array\";\n    }\n    if (support.nodebuffer && nodeBuffer.test(input)) {\n        return \"nodebuffer\";\n    }\n    if (support.uint8array && input instanceof Uint8Array) {\n        return \"uint8array\";\n    }\n    if (support.arraybuffer && input instanceof ArrayBuffer) {\n        return \"arraybuffer\";\n    }\n};\n\n/**\n * Throw an exception if the type is not supported.\n * @param {String} type the type to check.\n * @throws {Error} an Error if the browser doesn't support the requested type.\n */\nexports.checkSupport = function(type) {\n    var supported = support[type.toLowerCase()];\n    if (!supported) {\n        throw new Error(type + \" is not supported by this browser\");\n    }\n};\nexports.MAX_VALUE_16BITS = 65535;\nexports.MAX_VALUE_32BITS = -1; // well, \"\\xFF\\xFF\\xFF\\xFF\\xFF\\xFF\\xFF\\xFF\" is parsed as -1\n\n/**\n * Prettify a string read as binary.\n * @param {string} str the string to prettify.\n * @return {string} a pretty string.\n */\nexports.pretty = function(str) {\n    var res = '',\n        code, i;\n    for (i = 0; i < (str || \"\").length; i++) {\n        code = str.charCodeAt(i);\n        res += '\\\\x' + (code < 16 ? \"0\" : \"\") + code.toString(16).toUpperCase();\n    }\n    return res;\n};\n\n/**\n * Find a compression registered in JSZip.\n * @param {string} compressionMethod the method magic to find.\n * @return {Object|null} the JSZip compression object, null if none found.\n */\nexports.findCompression = function(compressionMethod) {\n    for (var method in compressions) {\n        if (!compressions.hasOwnProperty(method)) {\n            continue;\n        }\n        if (compressions[method].magic === compressionMethod) {\n            return compressions[method];\n        }\n    }\n    return null;\n};\n/**\n* Cross-window, cross-Node-context regular expression detection\n* @param  {Object}  object Anything\n* @return {Boolean}        true if the object is a regular expression,\n* false otherwise\n*/\nexports.isRegExp = function (object) {\n    return Object.prototype.toString.call(object) === \"[object RegExp]\";\n};\n\n/**\n * Merge the objects passed as parameters into a new one.\n * @private\n * @param {...Object} var_args All objects to merge.\n * @return {Object} a new object with the data of the others.\n */\nexports.extend = function() {\n    var result = {}, i, attr;\n    for (i = 0; i < arguments.length; i++) { // arguments is not enumerable in some browsers\n        for (attr in arguments[i]) {\n            if (arguments[i].hasOwnProperty(attr) && typeof result[attr] === \"undefined\") {\n                result[attr] = arguments[i][attr];\n            }\n        }\n    }\n    return result;\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/jszip/lib/utils.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 65);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 3b729be728ed5a5b4d68","'use strict';\n\n\nvar TYPED_OK =  (typeof Uint8Array !== 'undefined') &&\n                (typeof Uint16Array !== 'undefined') &&\n                (typeof Int32Array !== 'undefined');\n\nfunction _has(obj, key) {\n  return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexports.assign = function (obj /*from1, from2, from3, ...*/) {\n  var sources = Array.prototype.slice.call(arguments, 1);\n  while (sources.length) {\n    var source = sources.shift();\n    if (!source) { continue; }\n\n    if (typeof source !== 'object') {\n      throw new TypeError(source + 'must be non-object');\n    }\n\n    for (var p in source) {\n      if (_has(source, p)) {\n        obj[p] = source[p];\n      }\n    }\n  }\n\n  return obj;\n};\n\n\n// reduce buffer size, avoiding mem copy\nexports.shrinkBuf = function (buf, size) {\n  if (buf.length === size) { return buf; }\n  if (buf.subarray) { return buf.subarray(0, size); }\n  buf.length = size;\n  return buf;\n};\n\n\nvar fnTyped = {\n  arraySet: function (dest, src, src_offs, len, dest_offs) {\n    if (src.subarray && dest.subarray) {\n      dest.set(src.subarray(src_offs, src_offs + len), dest_offs);\n      return;\n    }\n    // Fallback to ordinary array\n    for (var i = 0; i < len; i++) {\n      dest[dest_offs + i] = src[src_offs + i];\n    }\n  },\n  // Join array of chunks to single array.\n  flattenChunks: function (chunks) {\n    var i, l, len, pos, chunk, result;\n\n    // calculate data length\n    len = 0;\n    for (i = 0, l = chunks.length; i < l; i++) {\n      len += chunks[i].length;\n    }\n\n    // join chunks\n    result = new Uint8Array(len);\n    pos = 0;\n    for (i = 0, l = chunks.length; i < l; i++) {\n      chunk = chunks[i];\n      result.set(chunk, pos);\n      pos += chunk.length;\n    }\n\n    return result;\n  }\n};\n\nvar fnUntyped = {\n  arraySet: function (dest, src, src_offs, len, dest_offs) {\n    for (var i = 0; i < len; i++) {\n      dest[dest_offs + i] = src[src_offs + i];\n    }\n  },\n  // Join array of chunks to single array.\n  flattenChunks: function (chunks) {\n    return [].concat.apply([], chunks);\n  }\n};\n\n\n// Enable/Disable typed arrays use, for testing\n//\nexports.setTyped = function (on) {\n  if (on) {\n    exports.Buf8  = Uint8Array;\n    exports.Buf16 = Uint16Array;\n    exports.Buf32 = Int32Array;\n    exports.assign(exports, fnTyped);\n  } else {\n    exports.Buf8  = Array;\n    exports.Buf16 = Array;\n    exports.Buf32 = Array;\n    exports.assign(exports, fnUntyped);\n  }\n};\n\nexports.setTyped(TYPED_OK);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/pako/lib/utils/common.js","'use strict';\n\nvar abstractMatrix = require('../abstractMatrix');\nvar Matrix = require('../matrix');\n\nclass BaseView extends abstractMatrix() {\n    constructor(matrix, rows, columns) {\n        super();\n        this.matrix = matrix;\n        this.rows = rows;\n        this.columns = columns;\n    }\n\n    static get [Symbol.species]() {\n        return Matrix.Matrix;\n    }\n}\n\nmodule.exports = BaseView;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-matrix/src/views/base.js","'use strict';\nexports.base64 = true;\nexports.array = true;\nexports.string = true;\nexports.arraybuffer = typeof ArrayBuffer !== \"undefined\" && typeof Uint8Array !== \"undefined\";\n// contains true if JSZip can read/generate nodejs Buffer, false otherwise.\n// Browserify will provide a Buffer implementation for browsers, which is\n// an augmented Uint8Array (i.e., can be used as either Buffer or U8).\nexports.nodebuffer = typeof Buffer !== \"undefined\";\n// contains true if JSZip can read/generate Uint8Array, false otherwise.\nexports.uint8array = typeof Uint8Array !== \"undefined\";\n\nif (typeof ArrayBuffer === \"undefined\") {\n    exports.blob = false;\n}\nelse {\n    var buffer = new ArrayBuffer(0);\n    try {\n        exports.blob = new Blob([buffer], {\n            type: \"application/zip\"\n        }).size === 0;\n    }\n    catch (e) {\n        try {\n            var Builder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder;\n            var builder = new Builder();\n            builder.append(buffer);\n            exports.blob = builder.getBlob('application/zip').size === 0;\n        }\n        catch (e) {\n            exports.blob = false;\n        }\n    }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/jszip/lib/support.js","'use strict';\n\nexports.array = require('./array');\nexports.matrix = require('./matrix');\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-stat/index.js","'use strict';\n\nmodule.exports = require('./matrix');\nmodule.exports.Decompositions = module.exports.DC = require('./decompositions');\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-optimize-lorentzian/node_modules/ml-matrix/src/index.js","'use strict';\n\nvar Matrix = require('./matrix');\n\n/**\n * @private\n * Check that a row index is not out of bounds\n * @param {Matrix} matrix\n * @param {number} index\n * @param {boolean} [outer]\n */\nexports.checkRowIndex = function checkRowIndex(matrix, index, outer) {\n    var max = outer ? matrix.rows : matrix.rows - 1;\n    if (index < 0 || index > max) {\n        throw new RangeError('Row index out of range');\n    }\n};\n\n/**\n * @private\n * Check that a column index is not out of bounds\n * @param {Matrix} matrix\n * @param {number} index\n * @param {boolean} [outer]\n */\nexports.checkColumnIndex = function checkColumnIndex(matrix, index, outer) {\n    var max = outer ? matrix.columns : matrix.columns - 1;\n    if (index < 0 || index > max) {\n        throw new RangeError('Column index out of range');\n    }\n};\n\n/**\n * @private\n * Check that the provided vector is an array with the right length\n * @param {Matrix} matrix\n * @param {Array|Matrix} vector\n * @return {Array}\n * @throws {RangeError}\n */\nexports.checkRowVector = function checkRowVector(matrix, vector) {\n    if (vector.to1DArray) {\n        vector = vector.to1DArray();\n    }\n    if (vector.length !== matrix.columns) {\n        throw new RangeError('vector size must be the same as the number of columns');\n    }\n    return vector;\n};\n\n/**\n * @private\n * Check that the provided vector is an array with the right length\n * @param {Matrix} matrix\n * @param {Array|Matrix} vector\n * @return {Array}\n * @throws {RangeError}\n */\nexports.checkColumnVector = function checkColumnVector(matrix, vector) {\n    if (vector.to1DArray) {\n        vector = vector.to1DArray();\n    }\n    if (vector.length !== matrix.rows) {\n        throw new RangeError('vector size must be the same as the number of rows');\n    }\n    return vector;\n};\n\nexports.checkIndices = function checkIndices(matrix, rowIndices, columnIndices) {\n    var rowOut = rowIndices.some(r => {\n        return r < 0 || r >= matrix.rows;\n\n    });\n\n    var columnOut = columnIndices.some(c => {\n        return c < 0 || c >= matrix.columns;\n    });\n\n    if (rowOut || columnOut) {\n        throw new RangeError('Indices are out of range');\n    }\n\n    if (typeof rowIndices !== 'object' || typeof columnIndices !== 'object') {\n        throw new TypeError('Unexpected type for row/column indices');\n    }\n    if (!Array.isArray(rowIndices)) rowIndices = Array.from(rowIndices);\n    if (!Array.isArray(columnIndices)) rowIndices = Array.from(columnIndices);\n\n    return {\n        row: rowIndices,\n        column: columnIndices\n    };\n};\n\nexports.checkRange = function checkRange(matrix, startRow, endRow, startColumn, endColumn) {\n    if (arguments.length !== 5) throw new TypeError('Invalid argument type');\n    var notAllNumbers = Array.from(arguments).slice(1).some(function (arg) {\n        return typeof arg !== 'number';\n    });\n    if (notAllNumbers) throw new TypeError('Invalid argument type');\n    if (startRow > endRow || startColumn > endColumn || startRow < 0 || startRow >= matrix.rows || endRow < 0 || endRow >= matrix.rows || startColumn < 0 || startColumn >= matrix.columns || endColumn < 0 || endColumn >= matrix.columns) {\n        throw new RangeError('Submatrix indices are out of range');\n    }\n};\n\nexports.getRange = function getRange(from, to) {\n    var arr = new Array(to - from + 1);\n    for (var i = 0; i < arr.length; i++) {\n        arr[i] = from + i;\n    }\n    return arr;\n};\n\nexports.sumByRow = function sumByRow(matrix) {\n    var sum = Matrix.Matrix.zeros(matrix.rows, 1);\n    for (var i = 0; i < matrix.rows; ++i) {\n        for (var j = 0; j < matrix.columns; ++j) {\n            sum.set(i, 0, sum.get(i, 0) + matrix.get(i, j));\n        }\n    }\n    return sum;\n};\n\nexports.sumByColumn = function sumByColumn(matrix) {\n    var sum = Matrix.Matrix.zeros(1, matrix.columns);\n    for (var i = 0; i < matrix.rows; ++i) {\n        for (var j = 0; j < matrix.columns; ++j) {\n            sum.set(0, j, sum.get(0, j) + matrix.get(i, j));\n        }\n    }\n    return sum;\n};\n\nexports.sumAll = function sumAll(matrix) {\n    var v = 0;\n    for (var i = 0; i < matrix.rows; i++) {\n        for (var j = 0; j < matrix.columns; j++) {\n            v += matrix.get(i, j);\n        }\n    }\n    return v;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-matrix/src/util.js","/**\n * Computes the minimum of the given values\n * @param {Array<number>} input\n * @return {number}\n */\nexport default function min(input) {\n    if (!Array.isArray(input)) {\n        throw new Error('input must be an array');\n    }\n\n    if (input.length === 0) {\n        throw new Error('input must not be empty');\n    }\n\n    var min = input[0];\n    for (var i = 1; i < input.length; i++) {\n        if (input[i] < min) min = input[i];\n    }\n    return min;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-array-min/src/index.js","/**\n * Computes the maximum of the given values\n * @param {Array<number>} input\n * @return {number}\n */\nexport default function max(input) {\n    if (!Array.isArray(input)) {\n        throw new Error('input must be an array');\n    }\n\n    if (input.length === 0) {\n        throw new Error('input must not be empty');\n    }\n\n    var max = input[0];\n    for (var i = 1; i < input.length; i++) {\n        if (input[i] > max) max = input[i];\n    }\n    return max;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-array-max/src/index.js","'use strict';\n// private property\nvar _keyStr = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n\n\n// public method for encoding\nexports.encode = function(input, utf8) {\n    var output = \"\";\n    var chr1, chr2, chr3, enc1, enc2, enc3, enc4;\n    var i = 0;\n\n    while (i < input.length) {\n\n        chr1 = input.charCodeAt(i++);\n        chr2 = input.charCodeAt(i++);\n        chr3 = input.charCodeAt(i++);\n\n        enc1 = chr1 >> 2;\n        enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n        enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n        enc4 = chr3 & 63;\n\n        if (isNaN(chr2)) {\n            enc3 = enc4 = 64;\n        }\n        else if (isNaN(chr3)) {\n            enc4 = 64;\n        }\n\n        output = output + _keyStr.charAt(enc1) + _keyStr.charAt(enc2) + _keyStr.charAt(enc3) + _keyStr.charAt(enc4);\n\n    }\n\n    return output;\n};\n\n// public method for decoding\nexports.decode = function(input, utf8) {\n    var output = \"\";\n    var chr1, chr2, chr3;\n    var enc1, enc2, enc3, enc4;\n    var i = 0;\n\n    input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\n\n    while (i < input.length) {\n\n        enc1 = _keyStr.indexOf(input.charAt(i++));\n        enc2 = _keyStr.indexOf(input.charAt(i++));\n        enc3 = _keyStr.indexOf(input.charAt(i++));\n        enc4 = _keyStr.indexOf(input.charAt(i++));\n\n        chr1 = (enc1 << 2) | (enc2 >> 4);\n        chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n        chr3 = ((enc3 & 3) << 6) | enc4;\n\n        output = output + String.fromCharCode(chr1);\n\n        if (enc3 != 64) {\n            output = output + String.fromCharCode(chr2);\n        }\n        if (enc4 != 64) {\n            output = output + String.fromCharCode(chr3);\n        }\n\n    }\n\n    return output;\n\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/jszip/lib/base64.js","'use strict';\nvar support = require('./support');\nvar utils = require('./utils');\nvar crc32 = require('./crc32');\nvar signature = require('./signature');\nvar defaults = require('./defaults');\nvar base64 = require('./base64');\nvar compressions = require('./compressions');\nvar CompressedObject = require('./compressedObject');\nvar nodeBuffer = require('./nodeBuffer');\nvar utf8 = require('./utf8');\nvar StringWriter = require('./stringWriter');\nvar Uint8ArrayWriter = require('./uint8ArrayWriter');\n\n/**\n * Returns the raw data of a ZipObject, decompress the content if necessary.\n * @param {ZipObject} file the file to use.\n * @return {String|ArrayBuffer|Uint8Array|Buffer} the data.\n */\nvar getRawData = function(file) {\n    if (file._data instanceof CompressedObject) {\n        file._data = file._data.getContent();\n        file.options.binary = true;\n        file.options.base64 = false;\n\n        if (utils.getTypeOf(file._data) === \"uint8array\") {\n            var copy = file._data;\n            // when reading an arraybuffer, the CompressedObject mechanism will keep it and subarray() a Uint8Array.\n            // if we request a file in the same format, we might get the same Uint8Array or its ArrayBuffer (the original zip file).\n            file._data = new Uint8Array(copy.length);\n            // with an empty Uint8Array, Opera fails with a \"Offset larger than array size\"\n            if (copy.length !== 0) {\n                file._data.set(copy, 0);\n            }\n        }\n    }\n    return file._data;\n};\n\n/**\n * Returns the data of a ZipObject in a binary form. If the content is an unicode string, encode it.\n * @param {ZipObject} file the file to use.\n * @return {String|ArrayBuffer|Uint8Array|Buffer} the data.\n */\nvar getBinaryData = function(file) {\n    var result = getRawData(file),\n        type = utils.getTypeOf(result);\n    if (type === \"string\") {\n        if (!file.options.binary) {\n            // unicode text !\n            // unicode string => binary string is a painful process, check if we can avoid it.\n            if (support.nodebuffer) {\n                return nodeBuffer(result, \"utf-8\");\n            }\n        }\n        return file.asBinary();\n    }\n    return result;\n};\n\n/**\n * Transform this._data into a string.\n * @param {function} filter a function String -> String, applied if not null on the result.\n * @return {String} the string representing this._data.\n */\nvar dataToString = function(asUTF8) {\n    var result = getRawData(this);\n    if (result === null || typeof result === \"undefined\") {\n        return \"\";\n    }\n    // if the data is a base64 string, we decode it before checking the encoding !\n    if (this.options.base64) {\n        result = base64.decode(result);\n    }\n    if (asUTF8 && this.options.binary) {\n        // JSZip.prototype.utf8decode supports arrays as input\n        // skip to array => string step, utf8decode will do it.\n        result = out.utf8decode(result);\n    }\n    else {\n        // no utf8 transformation, do the array => string step.\n        result = utils.transformTo(\"string\", result);\n    }\n\n    if (!asUTF8 && !this.options.binary) {\n        result = utils.transformTo(\"string\", out.utf8encode(result));\n    }\n    return result;\n};\n/**\n * A simple object representing a file in the zip file.\n * @constructor\n * @param {string} name the name of the file\n * @param {String|ArrayBuffer|Uint8Array|Buffer} data the data\n * @param {Object} options the options of the file\n */\nvar ZipObject = function(name, data, options) {\n    this.name = name;\n    this.dir = options.dir;\n    this.date = options.date;\n    this.comment = options.comment;\n    this.unixPermissions = options.unixPermissions;\n    this.dosPermissions = options.dosPermissions;\n\n    this._data = data;\n    this.options = options;\n\n    /*\n     * This object contains initial values for dir and date.\n     * With them, we can check if the user changed the deprecated metadata in\n     * `ZipObject#options` or not.\n     */\n    this._initialMetadata = {\n      dir : options.dir,\n      date : options.date\n    };\n};\n\nZipObject.prototype = {\n    /**\n     * Return the content as UTF8 string.\n     * @return {string} the UTF8 string.\n     */\n    asText: function() {\n        return dataToString.call(this, true);\n    },\n    /**\n     * Returns the binary content.\n     * @return {string} the content as binary.\n     */\n    asBinary: function() {\n        return dataToString.call(this, false);\n    },\n    /**\n     * Returns the content as a nodejs Buffer.\n     * @return {Buffer} the content as a Buffer.\n     */\n    asNodeBuffer: function() {\n        var result = getBinaryData(this);\n        return utils.transformTo(\"nodebuffer\", result);\n    },\n    /**\n     * Returns the content as an Uint8Array.\n     * @return {Uint8Array} the content as an Uint8Array.\n     */\n    asUint8Array: function() {\n        var result = getBinaryData(this);\n        return utils.transformTo(\"uint8array\", result);\n    },\n    /**\n     * Returns the content as an ArrayBuffer.\n     * @return {ArrayBuffer} the content as an ArrayBufer.\n     */\n    asArrayBuffer: function() {\n        return this.asUint8Array().buffer;\n    }\n};\n\n/**\n * Transform an integer into a string in hexadecimal.\n * @private\n * @param {number} dec the number to convert.\n * @param {number} bytes the number of bytes to generate.\n * @returns {string} the result.\n */\nvar decToHex = function(dec, bytes) {\n    var hex = \"\",\n        i;\n    for (i = 0; i < bytes; i++) {\n        hex += String.fromCharCode(dec & 0xff);\n        dec = dec >>> 8;\n    }\n    return hex;\n};\n\n/**\n * Transforms the (incomplete) options from the user into the complete\n * set of options to create a file.\n * @private\n * @param {Object} o the options from the user.\n * @return {Object} the complete set of options.\n */\nvar prepareFileAttrs = function(o) {\n    o = o || {};\n    if (o.base64 === true && (o.binary === null || o.binary === undefined)) {\n        o.binary = true;\n    }\n    o = utils.extend(o, defaults);\n    o.date = o.date || new Date();\n    if (o.compression !== null) o.compression = o.compression.toUpperCase();\n\n    return o;\n};\n\n/**\n * Add a file in the current folder.\n * @private\n * @param {string} name the name of the file\n * @param {String|ArrayBuffer|Uint8Array|Buffer} data the data of the file\n * @param {Object} o the options of the file\n * @return {Object} the new file.\n */\nvar fileAdd = function(name, data, o) {\n    // be sure sub folders exist\n    var dataType = utils.getTypeOf(data),\n        parent;\n\n    o = prepareFileAttrs(o);\n\n    if (typeof o.unixPermissions === \"string\") {\n        o.unixPermissions = parseInt(o.unixPermissions, 8);\n    }\n\n    // UNX_IFDIR  0040000 see zipinfo.c\n    if (o.unixPermissions && (o.unixPermissions & 0x4000)) {\n        o.dir = true;\n    }\n    // Bit 4    Directory\n    if (o.dosPermissions && (o.dosPermissions & 0x0010)) {\n        o.dir = true;\n    }\n\n    if (o.dir) {\n        name = forceTrailingSlash(name);\n    }\n\n    if (o.createFolders && (parent = parentFolder(name))) {\n        folderAdd.call(this, parent, true);\n    }\n\n    if (o.dir || data === null || typeof data === \"undefined\") {\n        o.base64 = false;\n        o.binary = false;\n        data = null;\n        dataType = null;\n    }\n    else if (dataType === \"string\") {\n        if (o.binary && !o.base64) {\n            // optimizedBinaryString == true means that the file has already been filtered with a 0xFF mask\n            if (o.optimizedBinaryString !== true) {\n                // this is a string, not in a base64 format.\n                // Be sure that this is a correct \"binary string\"\n                data = utils.string2binary(data);\n            }\n        }\n    }\n    else { // arraybuffer, uint8array, ...\n        o.base64 = false;\n        o.binary = true;\n\n        if (!dataType && !(data instanceof CompressedObject)) {\n            throw new Error(\"The data of '\" + name + \"' is in an unsupported format !\");\n        }\n\n        // special case : it's way easier to work with Uint8Array than with ArrayBuffer\n        if (dataType === \"arraybuffer\") {\n            data = utils.transformTo(\"uint8array\", data);\n        }\n    }\n\n    var object = new ZipObject(name, data, o);\n    this.files[name] = object;\n    return object;\n};\n\n/**\n * Find the parent folder of the path.\n * @private\n * @param {string} path the path to use\n * @return {string} the parent folder, or \"\"\n */\nvar parentFolder = function (path) {\n    if (path.slice(-1) == '/') {\n        path = path.substring(0, path.length - 1);\n    }\n    var lastSlash = path.lastIndexOf('/');\n    return (lastSlash > 0) ? path.substring(0, lastSlash) : \"\";\n};\n\n\n/**\n * Returns the path with a slash at the end.\n * @private\n * @param {String} path the path to check.\n * @return {String} the path with a trailing slash.\n */\nvar forceTrailingSlash = function(path) {\n    // Check the name ends with a /\n    if (path.slice(-1) != \"/\") {\n        path += \"/\"; // IE doesn't like substr(-1)\n    }\n    return path;\n};\n/**\n * Add a (sub) folder in the current folder.\n * @private\n * @param {string} name the folder's name\n * @param {boolean=} [createFolders] If true, automatically create sub\n *  folders. Defaults to false.\n * @return {Object} the new folder.\n */\nvar folderAdd = function(name, createFolders) {\n    createFolders = (typeof createFolders !== 'undefined') ? createFolders : false;\n\n    name = forceTrailingSlash(name);\n\n    // Does this folder already exist?\n    if (!this.files[name]) {\n        fileAdd.call(this, name, null, {\n            dir: true,\n            createFolders: createFolders\n        });\n    }\n    return this.files[name];\n};\n\n/**\n * Generate a JSZip.CompressedObject for a given zipOject.\n * @param {ZipObject} file the object to read.\n * @param {JSZip.compression} compression the compression to use.\n * @param {Object} compressionOptions the options to use when compressing.\n * @return {JSZip.CompressedObject} the compressed result.\n */\nvar generateCompressedObjectFrom = function(file, compression, compressionOptions) {\n    var result = new CompressedObject(),\n        content;\n\n    // the data has not been decompressed, we might reuse things !\n    if (file._data instanceof CompressedObject) {\n        result.uncompressedSize = file._data.uncompressedSize;\n        result.crc32 = file._data.crc32;\n\n        if (result.uncompressedSize === 0 || file.dir) {\n            compression = compressions['STORE'];\n            result.compressedContent = \"\";\n            result.crc32 = 0;\n        }\n        else if (file._data.compressionMethod === compression.magic) {\n            result.compressedContent = file._data.getCompressedContent();\n        }\n        else {\n            content = file._data.getContent();\n            // need to decompress / recompress\n            result.compressedContent = compression.compress(utils.transformTo(compression.compressInputType, content), compressionOptions);\n        }\n    }\n    else {\n        // have uncompressed data\n        content = getBinaryData(file);\n        if (!content || content.length === 0 || file.dir) {\n            compression = compressions['STORE'];\n            content = \"\";\n        }\n        result.uncompressedSize = content.length;\n        result.crc32 = crc32(content);\n        result.compressedContent = compression.compress(utils.transformTo(compression.compressInputType, content), compressionOptions);\n    }\n\n    result.compressedSize = result.compressedContent.length;\n    result.compressionMethod = compression.magic;\n\n    return result;\n};\n\n\n\n\n/**\n * Generate the UNIX part of the external file attributes.\n * @param {Object} unixPermissions the unix permissions or null.\n * @param {Boolean} isDir true if the entry is a directory, false otherwise.\n * @return {Number} a 32 bit integer.\n *\n * adapted from http://unix.stackexchange.com/questions/14705/the-zip-formats-external-file-attribute :\n *\n * TTTTsstrwxrwxrwx0000000000ADVSHR\n * ^^^^____________________________ file type, see zipinfo.c (UNX_*)\n *     ^^^_________________________ setuid, setgid, sticky\n *        ^^^^^^^^^________________ permissions\n *                 ^^^^^^^^^^______ not used ?\n *                           ^^^^^^ DOS attribute bits : Archive, Directory, Volume label, System file, Hidden, Read only\n */\nvar generateUnixExternalFileAttr = function (unixPermissions, isDir) {\n\n    var result = unixPermissions;\n    if (!unixPermissions) {\n        // I can't use octal values in strict mode, hence the hexa.\n        //  040775 => 0x41fd\n        // 0100664 => 0x81b4\n        result = isDir ? 0x41fd : 0x81b4;\n    }\n\n    return (result & 0xFFFF) << 16;\n};\n\n/**\n * Generate the DOS part of the external file attributes.\n * @param {Object} dosPermissions the dos permissions or null.\n * @param {Boolean} isDir true if the entry is a directory, false otherwise.\n * @return {Number} a 32 bit integer.\n *\n * Bit 0     Read-Only\n * Bit 1     Hidden\n * Bit 2     System\n * Bit 3     Volume Label\n * Bit 4     Directory\n * Bit 5     Archive\n */\nvar generateDosExternalFileAttr = function (dosPermissions, isDir) {\n\n    // the dir flag is already set for compatibility\n\n    return (dosPermissions || 0)  & 0x3F;\n};\n\n/**\n * Generate the various parts used in the construction of the final zip file.\n * @param {string} name the file name.\n * @param {ZipObject} file the file content.\n * @param {JSZip.CompressedObject} compressedObject the compressed object.\n * @param {number} offset the current offset from the start of the zip file.\n * @param {String} platform let's pretend we are this platform (change platform dependents fields)\n * @param {Function} encodeFileName the function to encode the file name / comment.\n * @return {object} the zip parts.\n */\nvar generateZipParts = function(name, file, compressedObject, offset, platform, encodeFileName) {\n    var data = compressedObject.compressedContent,\n        useCustomEncoding = encodeFileName !== utf8.utf8encode,\n        encodedFileName = utils.transformTo(\"string\", encodeFileName(file.name)),\n        utfEncodedFileName = utils.transformTo(\"string\", utf8.utf8encode(file.name)),\n        comment = file.comment || \"\",\n        encodedComment = utils.transformTo(\"string\", encodeFileName(comment)),\n        utfEncodedComment = utils.transformTo(\"string\", utf8.utf8encode(comment)),\n        useUTF8ForFileName = utfEncodedFileName.length !== file.name.length,\n        useUTF8ForComment = utfEncodedComment.length !== comment.length,\n        o = file.options,\n        dosTime,\n        dosDate,\n        extraFields = \"\",\n        unicodePathExtraField = \"\",\n        unicodeCommentExtraField = \"\",\n        dir, date;\n\n\n    // handle the deprecated options.dir\n    if (file._initialMetadata.dir !== file.dir) {\n        dir = file.dir;\n    } else {\n        dir = o.dir;\n    }\n\n    // handle the deprecated options.date\n    if(file._initialMetadata.date !== file.date) {\n        date = file.date;\n    } else {\n        date = o.date;\n    }\n\n    var extFileAttr = 0;\n    var versionMadeBy = 0;\n    if (dir) {\n        // dos or unix, we set the dos dir flag\n        extFileAttr |= 0x00010;\n    }\n    if(platform === \"UNIX\") {\n        versionMadeBy = 0x031E; // UNIX, version 3.0\n        extFileAttr |= generateUnixExternalFileAttr(file.unixPermissions, dir);\n    } else { // DOS or other, fallback to DOS\n        versionMadeBy = 0x0014; // DOS, version 2.0\n        extFileAttr |= generateDosExternalFileAttr(file.dosPermissions, dir);\n    }\n\n    // date\n    // @see http://www.delorie.com/djgpp/doc/rbinter/it/52/13.html\n    // @see http://www.delorie.com/djgpp/doc/rbinter/it/65/16.html\n    // @see http://www.delorie.com/djgpp/doc/rbinter/it/66/16.html\n\n    dosTime = date.getHours();\n    dosTime = dosTime << 6;\n    dosTime = dosTime | date.getMinutes();\n    dosTime = dosTime << 5;\n    dosTime = dosTime | date.getSeconds() / 2;\n\n    dosDate = date.getFullYear() - 1980;\n    dosDate = dosDate << 4;\n    dosDate = dosDate | (date.getMonth() + 1);\n    dosDate = dosDate << 5;\n    dosDate = dosDate | date.getDate();\n\n    if (useUTF8ForFileName) {\n        // set the unicode path extra field. unzip needs at least one extra\n        // field to correctly handle unicode path, so using the path is as good\n        // as any other information. This could improve the situation with\n        // other archive managers too.\n        // This field is usually used without the utf8 flag, with a non\n        // unicode path in the header (winrar, winzip). This helps (a bit)\n        // with the messy Windows' default compressed folders feature but\n        // breaks on p7zip which doesn't seek the unicode path extra field.\n        // So for now, UTF-8 everywhere !\n        unicodePathExtraField =\n            // Version\n            decToHex(1, 1) +\n            // NameCRC32\n            decToHex(crc32(encodedFileName), 4) +\n            // UnicodeName\n            utfEncodedFileName;\n\n        extraFields +=\n            // Info-ZIP Unicode Path Extra Field\n            \"\\x75\\x70\" +\n            // size\n            decToHex(unicodePathExtraField.length, 2) +\n            // content\n            unicodePathExtraField;\n    }\n\n    if(useUTF8ForComment) {\n\n        unicodeCommentExtraField =\n            // Version\n            decToHex(1, 1) +\n            // CommentCRC32\n            decToHex(this.crc32(encodedComment), 4) +\n            // UnicodeName\n            utfEncodedComment;\n\n        extraFields +=\n            // Info-ZIP Unicode Path Extra Field\n            \"\\x75\\x63\" +\n            // size\n            decToHex(unicodeCommentExtraField.length, 2) +\n            // content\n            unicodeCommentExtraField;\n    }\n\n    var header = \"\";\n\n    // version needed to extract\n    header += \"\\x0A\\x00\";\n    // general purpose bit flag\n    // set bit 11 if utf8\n    header += !useCustomEncoding && (useUTF8ForFileName || useUTF8ForComment) ? \"\\x00\\x08\" : \"\\x00\\x00\";\n    // compression method\n    header += compressedObject.compressionMethod;\n    // last mod file time\n    header += decToHex(dosTime, 2);\n    // last mod file date\n    header += decToHex(dosDate, 2);\n    // crc-32\n    header += decToHex(compressedObject.crc32, 4);\n    // compressed size\n    header += decToHex(compressedObject.compressedSize, 4);\n    // uncompressed size\n    header += decToHex(compressedObject.uncompressedSize, 4);\n    // file name length\n    header += decToHex(encodedFileName.length, 2);\n    // extra field length\n    header += decToHex(extraFields.length, 2);\n\n\n    var fileRecord = signature.LOCAL_FILE_HEADER + header + encodedFileName + extraFields;\n\n    var dirRecord = signature.CENTRAL_FILE_HEADER +\n    // version made by (00: DOS)\n    decToHex(versionMadeBy, 2) +\n    // file header (common to file and central directory)\n    header +\n    // file comment length\n    decToHex(encodedComment.length, 2) +\n    // disk number start\n    \"\\x00\\x00\" +\n    // internal file attributes TODO\n    \"\\x00\\x00\" +\n    // external file attributes\n    decToHex(extFileAttr, 4) +\n    // relative offset of local header\n    decToHex(offset, 4) +\n    // file name\n    encodedFileName +\n    // extra field\n    extraFields +\n    // file comment\n    encodedComment;\n\n    return {\n        fileRecord: fileRecord,\n        dirRecord: dirRecord,\n        compressedObject: compressedObject\n    };\n};\n\n\n// return the actual prototype of JSZip\nvar out = {\n    /**\n     * Read an existing zip and merge the data in the current JSZip object.\n     * The implementation is in jszip-load.js, don't forget to include it.\n     * @param {String|ArrayBuffer|Uint8Array|Buffer} stream  The stream to load\n     * @param {Object} options Options for loading the stream.\n     *  options.base64 : is the stream in base64 ? default : false\n     * @return {JSZip} the current JSZip object\n     */\n    load: function(stream, options) {\n        throw new Error(\"Load method is not defined. Is the file jszip-load.js included ?\");\n    },\n\n    /**\n     * Filter nested files/folders with the specified function.\n     * @param {Function} search the predicate to use :\n     * function (relativePath, file) {...}\n     * It takes 2 arguments : the relative path and the file.\n     * @return {Array} An array of matching elements.\n     */\n    filter: function(search) {\n        var result = [],\n            filename, relativePath, file, fileClone;\n        for (filename in this.files) {\n            if (!this.files.hasOwnProperty(filename)) {\n                continue;\n            }\n            file = this.files[filename];\n            // return a new object, don't let the user mess with our internal objects :)\n            fileClone = new ZipObject(file.name, file._data, utils.extend(file.options));\n            relativePath = filename.slice(this.root.length, filename.length);\n            if (filename.slice(0, this.root.length) === this.root && // the file is in the current root\n            search(relativePath, fileClone)) { // and the file matches the function\n                result.push(fileClone);\n            }\n        }\n        return result;\n    },\n\n    /**\n     * Add a file to the zip file, or search a file.\n     * @param   {string|RegExp} name The name of the file to add (if data is defined),\n     * the name of the file to find (if no data) or a regex to match files.\n     * @param   {String|ArrayBuffer|Uint8Array|Buffer} data  The file data, either raw or base64 encoded\n     * @param   {Object} o     File options\n     * @return  {JSZip|Object|Array} this JSZip object (when adding a file),\n     * a file (when searching by string) or an array of files (when searching by regex).\n     */\n    file: function(name, data, o) {\n        if (arguments.length === 1) {\n            if (utils.isRegExp(name)) {\n                var regexp = name;\n                return this.filter(function(relativePath, file) {\n                    return !file.dir && regexp.test(relativePath);\n                });\n            }\n            else { // text\n                return this.filter(function(relativePath, file) {\n                    return !file.dir && relativePath === name;\n                })[0] || null;\n            }\n        }\n        else { // more than one argument : we have data !\n            name = this.root + name;\n            fileAdd.call(this, name, data, o);\n        }\n        return this;\n    },\n\n    /**\n     * Add a directory to the zip file, or search.\n     * @param   {String|RegExp} arg The name of the directory to add, or a regex to search folders.\n     * @return  {JSZip} an object with the new directory as the root, or an array containing matching folders.\n     */\n    folder: function(arg) {\n        if (!arg) {\n            return this;\n        }\n\n        if (utils.isRegExp(arg)) {\n            return this.filter(function(relativePath, file) {\n                return file.dir && arg.test(relativePath);\n            });\n        }\n\n        // else, name is a new folder\n        var name = this.root + arg;\n        var newFolder = folderAdd.call(this, name);\n\n        // Allow chaining by returning a new object with this folder as the root\n        var ret = this.clone();\n        ret.root = newFolder.name;\n        return ret;\n    },\n\n    /**\n     * Delete a file, or a directory and all sub-files, from the zip\n     * @param {string} name the name of the file to delete\n     * @return {JSZip} this JSZip object\n     */\n    remove: function(name) {\n        name = this.root + name;\n        var file = this.files[name];\n        if (!file) {\n            // Look for any folders\n            if (name.slice(-1) != \"/\") {\n                name += \"/\";\n            }\n            file = this.files[name];\n        }\n\n        if (file && !file.dir) {\n            // file\n            delete this.files[name];\n        } else {\n            // maybe a folder, delete recursively\n            var kids = this.filter(function(relativePath, file) {\n                return file.name.slice(0, name.length) === name;\n            });\n            for (var i = 0; i < kids.length; i++) {\n                delete this.files[kids[i].name];\n            }\n        }\n\n        return this;\n    },\n\n    /**\n     * Generate the complete zip file\n     * @param {Object} options the options to generate the zip file :\n     * - base64, (deprecated, use type instead) true to generate base64.\n     * - compression, \"STORE\" by default.\n     * - type, \"base64\" by default. Values are : string, base64, uint8array, arraybuffer, blob.\n     * @return {String|Uint8Array|ArrayBuffer|Buffer|Blob} the zip file\n     */\n    generate: function(options) {\n        options = utils.extend(options || {}, {\n            base64: true,\n            compression: \"STORE\",\n            compressionOptions : null,\n            type: \"base64\",\n            platform: \"DOS\",\n            comment: null,\n            mimeType: 'application/zip',\n            encodeFileName: utf8.utf8encode\n        });\n\n        utils.checkSupport(options.type);\n\n        // accept nodejs `process.platform`\n        if(\n          options.platform === 'darwin' ||\n          options.platform === 'freebsd' ||\n          options.platform === 'linux' ||\n          options.platform === 'sunos'\n        ) {\n          options.platform = \"UNIX\";\n        }\n        if (options.platform === 'win32') {\n          options.platform = \"DOS\";\n        }\n\n        var zipData = [],\n            localDirLength = 0,\n            centralDirLength = 0,\n            writer, i,\n            encodedComment = utils.transformTo(\"string\", options.encodeFileName(options.comment || this.comment || \"\"));\n\n        // first, generate all the zip parts.\n        for (var name in this.files) {\n            if (!this.files.hasOwnProperty(name)) {\n                continue;\n            }\n            var file = this.files[name];\n\n            var compressionName = file.options.compression || options.compression.toUpperCase();\n            var compression = compressions[compressionName];\n            if (!compression) {\n                throw new Error(compressionName + \" is not a valid compression method !\");\n            }\n            var compressionOptions = file.options.compressionOptions || options.compressionOptions || {};\n\n            var compressedObject = generateCompressedObjectFrom.call(this, file, compression, compressionOptions);\n\n            var zipPart = generateZipParts.call(this, name, file, compressedObject, localDirLength, options.platform, options.encodeFileName);\n            localDirLength += zipPart.fileRecord.length + compressedObject.compressedSize;\n            centralDirLength += zipPart.dirRecord.length;\n            zipData.push(zipPart);\n        }\n\n        var dirEnd = \"\";\n\n        // end of central dir signature\n        dirEnd = signature.CENTRAL_DIRECTORY_END +\n        // number of this disk\n        \"\\x00\\x00\" +\n        // number of the disk with the start of the central directory\n        \"\\x00\\x00\" +\n        // total number of entries in the central directory on this disk\n        decToHex(zipData.length, 2) +\n        // total number of entries in the central directory\n        decToHex(zipData.length, 2) +\n        // size of the central directory   4 bytes\n        decToHex(centralDirLength, 4) +\n        // offset of start of central directory with respect to the starting disk number\n        decToHex(localDirLength, 4) +\n        // .ZIP file comment length\n        decToHex(encodedComment.length, 2) +\n        // .ZIP file comment\n        encodedComment;\n\n\n        // we have all the parts (and the total length)\n        // time to create a writer !\n        var typeName = options.type.toLowerCase();\n        if(typeName===\"uint8array\"||typeName===\"arraybuffer\"||typeName===\"blob\"||typeName===\"nodebuffer\") {\n            writer = new Uint8ArrayWriter(localDirLength + centralDirLength + dirEnd.length);\n        }else{\n            writer = new StringWriter(localDirLength + centralDirLength + dirEnd.length);\n        }\n\n        for (i = 0; i < zipData.length; i++) {\n            writer.append(zipData[i].fileRecord);\n            writer.append(zipData[i].compressedObject.compressedContent);\n        }\n        for (i = 0; i < zipData.length; i++) {\n            writer.append(zipData[i].dirRecord);\n        }\n\n        writer.append(dirEnd);\n\n        var zip = writer.finalize();\n\n\n\n        switch(options.type.toLowerCase()) {\n            // case \"zip is an Uint8Array\"\n            case \"uint8array\" :\n            case \"arraybuffer\" :\n            case \"nodebuffer\" :\n               return utils.transformTo(options.type.toLowerCase(), zip);\n            case \"blob\" :\n               return utils.arrayBuffer2Blob(utils.transformTo(\"arraybuffer\", zip), options.mimeType);\n            // case \"zip is a string\"\n            case \"base64\" :\n               return (options.base64) ? base64.encode(zip) : zip;\n            default : // case \"string\" :\n               return zip;\n         }\n\n    },\n\n    /**\n     * @deprecated\n     * This method will be removed in a future version without replacement.\n     */\n    crc32: function (input, crc) {\n        return crc32(input, crc);\n    },\n\n    /**\n     * @deprecated\n     * This method will be removed in a future version without replacement.\n     */\n    utf8encode: function (string) {\n        return utils.transformTo(\"string\", utf8.utf8encode(string));\n    },\n\n    /**\n     * @deprecated\n     * This method will be removed in a future version without replacement.\n     */\n    utf8decode: function (input) {\n        return utf8.utf8decode(input);\n    }\n};\nmodule.exports = out;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/jszip/lib/object.js","var g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function(\"return this\")() || (1,eval)(\"this\");\r\n} catch(e) {\r\n\t// This works if the window reference is available\r\n\tif(typeof window === \"object\")\r\n\t\tg = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it's\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n\n\n\n// WEBPACK FOOTER //\n// (webpack)/buildin/global.js","'use strict';\nexports.STORE = {\n    magic: \"\\x00\\x00\",\n    compress: function(content, compressionOptions) {\n        return content; // no compression\n    },\n    uncompress: function(content) {\n        return content; // no compression\n    },\n    compressInputType: null,\n    uncompressInputType: null\n};\nexports.DEFLATE = require('./flate');\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/jszip/lib/compressions.js","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//   claim that you wrote the original software. If you use this software\n//   in a product, an acknowledgment in the product documentation would be\n//   appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n//   misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nmodule.exports = {\n  2:      'need dictionary',     /* Z_NEED_DICT       2  */\n  1:      'stream end',          /* Z_STREAM_END      1  */\n  0:      '',                    /* Z_OK              0  */\n  '-1':   'file error',          /* Z_ERRNO         (-1) */\n  '-2':   'stream error',        /* Z_STREAM_ERROR  (-2) */\n  '-3':   'data error',          /* Z_DATA_ERROR    (-3) */\n  '-4':   'insufficient memory', /* Z_MEM_ERROR     (-4) */\n  '-5':   'buffer error',        /* Z_BUF_ERROR     (-5) */\n  '-6':   'incompatible version' /* Z_VERSION_ERROR (-6) */\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/pako/lib/zlib/messages.js","'use strict';\nmodule.exports = function(data, encoding){\n    return new Buffer(data, encoding);\n};\nmodule.exports.test = function(b){\n    return Buffer.isBuffer(b);\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/jszip/lib/nodeBuffer.js","'use strict';\n\nmodule.exports = require('./matrix').Matrix;\nmodule.exports.Decompositions = module.exports.DC = require('./decompositions');\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-matrix/src/index.js","'use strict';\n\nexports.hypotenuse = function hypotenuse(a, b) {\n    var r;\n    if (Math.abs(a) > Math.abs(b)) {\n        r = b / a;\n        return Math.abs(a) * Math.sqrt(1 + r * r);\n    }\n    if (b !== 0) {\n        r = a / b;\n        return Math.abs(b) * Math.sqrt(1 + r * r);\n    }\n    return 0;\n};\n\n// For use in the decomposition algorithms. With big matrices, access time is\n// too long on elements from array subclass\n// todo check when it is fixed in v8\n// http://jsperf.com/access-and-write-array-subclass\nexports.getEmpty2DArray = function (rows, columns) {\n    var array = new Array(rows);\n    for (var i = 0; i < rows; i++) {\n        array[i] = new Array(columns);\n    }\n    return array;\n};\n\nexports.getFilled2DArray = function (rows, columns, value) {\n    var array = new Array(rows);\n    for (var i = 0; i < rows; i++) {\n        array[i] = new Array(columns);\n        for (var j = 0; j < columns; j++) {\n            array[i][j] = value;\n        }\n    }\n    return array;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-matrix/src/dc/util.js","'use strict';\n\nconst Heap = require('heap');\n\nfunction Cluster() {\n    this.children = [];\n    this.distance = -1;\n    this.index = [];\n}\n\n/**\n * Creates an array of values where maximum distance smaller than the threshold\n * @param {number} threshold\n * @return {Array <Cluster>}\n */\nCluster.prototype.cut = function (threshold) {\n    if (threshold < 0) throw new RangeError('Threshold too small');\n    var root = new Cluster();\n    root.children = this.children;\n    root.distance = this.distance;\n    root.index = this.index;\n    var list = [root];\n    var ans = [];\n    while (list.length > 0) {\n        var aux = list.shift();\n        if (threshold >= aux.distance) {\n            ans.push(aux);\n        } else {\n            list = list.concat(aux.children);\n        }\n    }\n    return ans;\n};\n\n/**\n * Merge the leaves in the minimum way to have 'minGroups' number of clusters\n * @param {number} minGroups - Them minimum number of children the first level of the tree should have\n * @return {Cluster}\n */\nCluster.prototype.group = function (minGroups) {\n    if (!Number.isInteger(minGroups) || minGroups < 1) throw new RangeError('Number of groups must be a positive integer');\n\n    const heap = new Heap(function (a, b) {\n        return b.distance - a.distance;\n    });\n\n    heap.push(this);\n\n    while (heap.size() < minGroups) {\n        var first = heap.pop();\n        if (first.children.length === 0) {\n            break;\n        }\n        first.children.forEach(child => heap.push(child));\n    }\n\n    var root = new Cluster();\n    root.children = heap.toArray();\n    root.distance = this.distance;\n\n    return root;\n};\n\n/**\n * Traverses the tree depth-first and provide callback to be called on each individual node\n * @param {function} cb - The callback to be called on each node encounter\n * @type {Cluster}\n */\nCluster.prototype.traverse = function (cb) {\n    function visit(root, callback) {\n        callback(root);\n        if (root.children) {\n            for (var i = root.children.length - 1; i >= 0; i--) {\n                visit(root.children[i], callback);\n            }\n        }\n    }\n    visit(this, cb);\n};\n\nmodule.exports = Cluster;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-hclust/src/Cluster.js","export {default as SD} from './SD';\nexport {default as NMR} from './NMR';\nexport {default as NMR2D} from './NMR2D';\nexport {Ranges, getACS} from 'spectra-data-ranges';\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/spectra-data/src/index.js","module.exports = exports = require('./ArrayUtils');\n\n\nexports.getEquallySpacedData = require('./getEquallySpaced').getEquallySpacedData;\nexports.SNV = require('./snv').SNV;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-array-utils/src/index.js","'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\n\nvar isArray = function isArray(arr) {\n\tif (typeof Array.isArray === 'function') {\n\t\treturn Array.isArray(arr);\n\t}\n\n\treturn toStr.call(arr) === '[object Array]';\n};\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) {/**/}\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\nmodule.exports = function extend() {\n\tvar options, name, src, copy, copyIsArray, clone,\n\t\ttarget = arguments[0],\n\t\ti = 1,\n\t\tlength = arguments.length,\n\t\tdeep = false;\n\n\t// Handle a deep copy situation\n\tif (typeof target === 'boolean') {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t} else if ((typeof target !== 'object' && typeof target !== 'function') || target == null) {\n\t\ttarget = {};\n\t}\n\n\tfor (; i < length; ++i) {\n\t\toptions = arguments[i];\n\t\t// Only deal with non-null/undefined values\n\t\tif (options != null) {\n\t\t\t// Extend the base object\n\t\t\tfor (name in options) {\n\t\t\t\tsrc = target[name];\n\t\t\t\tcopy = options[name];\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif (target !== copy) {\n\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\tif (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n\t\t\t\t\t\tif (copyIsArray) {\n\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\tclone = src && isArray(src) ? src : [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tclone = src && isPlainObject(src) ? src : {};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\ttarget[name] = extend(deep, clone, copy);\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t} else if (typeof copy !== 'undefined') {\n\t\t\t\t\t\ttarget[name] = copy;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/extend/index.js","'use strict';\n\nfunction compareNumbers(a, b) {\n    return a - b;\n}\n\n/**\n * Computes the sum of the given values\n * @param {Array} values\n * @returns {number}\n */\nexports.sum = function sum(values) {\n    var sum = 0;\n    for (var i = 0; i < values.length; i++) {\n        sum += values[i];\n    }\n    return sum;\n};\n\n/**\n * Computes the maximum of the given values\n * @param {Array} values\n * @returns {number}\n */\nexports.max = function max(values) {\n    var max = -Infinity;\n    var l = values.length;\n    for (var i = 0; i < l; i++) {\n        if (values[i] > max) max = values[i];\n    }\n    return max;\n};\n\n/**\n * Computes the minimum of the given values\n * @param {Array} values\n * @returns {number}\n */\nexports.min = function min(values) {\n    var min = Infinity;\n    var l = values.length;\n    for (var i = 0; i < l; i++) {\n        if (values[i] < min) min = values[i];\n    }\n    return min;\n};\n\n/**\n * Computes the min and max of the given values\n * @param {Array} values\n * @returns {{min: number, max: number}}\n */\nexports.minMax = function minMax(values) {\n    var min = Infinity;\n    var max = -Infinity;\n    var l = values.length;\n    for (var i = 0; i < l; i++) {\n        if (values[i] < min) min = values[i];\n        if (values[i] > max) max = values[i];\n    }\n    return {\n        min: min,\n        max: max\n    };\n};\n\n/**\n * Computes the arithmetic mean of the given values\n * @param {Array} values\n * @returns {number}\n */\nexports.arithmeticMean = function arithmeticMean(values) {\n    var sum = 0;\n    var l = values.length;\n    for (var i = 0; i < l; i++) {\n        sum += values[i];\n    }\n    return sum / l;\n};\n\n/**\n * {@link arithmeticMean}\n */\nexports.mean = exports.arithmeticMean;\n\n/**\n * Computes the geometric mean of the given values\n * @param {Array} values\n * @returns {number}\n */\nexports.geometricMean = function geometricMean(values) {\n    var mul = 1;\n    var l = values.length;\n    for (var i = 0; i < l; i++) {\n        mul *= values[i];\n    }\n    return Math.pow(mul, 1 / l);\n};\n\n/**\n * Computes the mean of the log of the given values\n * If the return value is exponentiated, it gives the same result as the\n * geometric mean.\n * @param {Array} values\n * @returns {number}\n */\nexports.logMean = function logMean(values) {\n    var lnsum = 0;\n    var l = values.length;\n    for (var i = 0; i < l; i++) {\n        lnsum += Math.log(values[i]);\n    }\n    return lnsum / l;\n};\n\n/**\n * Computes the weighted grand mean for a list of means and sample sizes\n * @param {Array} means - Mean values for each set of samples\n * @param {Array} samples - Number of original values for each set of samples\n * @returns {number}\n */\nexports.grandMean = function grandMean(means, samples) {\n    var sum = 0;\n    var n = 0;\n    var l = means.length;\n    for (var i = 0; i < l; i++) {\n        sum += samples[i] * means[i];\n        n += samples[i];\n    }\n    return sum / n;\n};\n\n/**\n * Computes the truncated mean of the given values using a given percentage\n * @param {Array} values\n * @param {number} percent - The percentage of values to keep (range: [0,1])\n * @param {boolean} [alreadySorted=false]\n * @returns {number}\n */\nexports.truncatedMean = function truncatedMean(values, percent, alreadySorted) {\n    if (alreadySorted === undefined) alreadySorted = false;\n    if (!alreadySorted) {\n        values = values.slice().sort(compareNumbers);\n    }\n    var l = values.length;\n    var k = Math.floor(l * percent);\n    var sum = 0;\n    for (var i = k; i < (l - k); i++) {\n        sum += values[i];\n    }\n    return sum / (l - 2 * k);\n};\n\n/**\n * Computes the harmonic mean of the given values\n * @param {Array} values\n * @returns {number}\n */\nexports.harmonicMean = function harmonicMean(values) {\n    var sum = 0;\n    var l = values.length;\n    for (var i = 0; i < l; i++) {\n        if (values[i] === 0) {\n            throw new RangeError('value at index ' + i + 'is zero');\n        }\n        sum += 1 / values[i];\n    }\n    return l / sum;\n};\n\n/**\n * Computes the contraharmonic mean of the given values\n * @param {Array} values\n * @returns {number}\n */\nexports.contraHarmonicMean = function contraHarmonicMean(values) {\n    var r1 = 0;\n    var r2 = 0;\n    var l = values.length;\n    for (var i = 0; i < l; i++) {\n        r1 += values[i] * values[i];\n        r2 += values[i];\n    }\n    if (r2 < 0) {\n        throw new RangeError('sum of values is negative');\n    }\n    return r1 / r2;\n};\n\n/**\n * Computes the median of the given values\n * @param {Array} values\n * @param {boolean} [alreadySorted=false]\n * @returns {number}\n */\nexports.median = function median(values, alreadySorted) {\n    if (alreadySorted === undefined) alreadySorted = false;\n    if (!alreadySorted) {\n        values = values.slice().sort(compareNumbers);\n    }\n    var l = values.length;\n    var half = Math.floor(l / 2);\n    if (l % 2 === 0) {\n        return (values[half - 1] + values[half]) * 0.5;\n    } else {\n        return values[half];\n    }\n};\n\n/**\n * Computes the variance of the given values\n * @param {Array} values\n * @param {boolean} [unbiased=true] - if true, divide by (n-1); if false, divide by n.\n * @returns {number}\n */\nexports.variance = function variance(values, unbiased) {\n    if (unbiased === undefined) unbiased = true;\n    var theMean = exports.mean(values);\n    var theVariance = 0;\n    var l = values.length;\n\n    for (var i = 0; i < l; i++) {\n        var x = values[i] - theMean;\n        theVariance += x * x;\n    }\n\n    if (unbiased) {\n        return theVariance / (l - 1);\n    } else {\n        return theVariance / l;\n    }\n};\n\n/**\n * Computes the standard deviation of the given values\n * @param {Array} values\n * @param {boolean} [unbiased=true] - if true, divide by (n-1); if false, divide by n.\n * @returns {number}\n */\nexports.standardDeviation = function standardDeviation(values, unbiased) {\n    return Math.sqrt(exports.variance(values, unbiased));\n};\n\nexports.standardError = function standardError(values) {\n    return exports.standardDeviation(values) / Math.sqrt(values.length);\n};\n\nexports.quartiles = function quartiles(values, alreadySorted) {\n    if (typeof(alreadySorted) === 'undefined') alreadySorted = false;\n    if (!alreadySorted) {\n        values = values.slice();\n        values.sort(compareNumbers);\n    }\n\n    var quart = values.length / 4;\n    var q1 = values[Math.ceil(quart) - 1];\n    var q2 = exports.median(values, true);\n    var q3 = values[Math.ceil(quart * 3) - 1];\n\n    return {q1: q1, q2: q2, q3: q3};\n};\n\nexports.pooledStandardDeviation = function pooledStandardDeviation(samples, unbiased) {\n    return Math.sqrt(exports.pooledVariance(samples, unbiased));\n};\n\nexports.pooledVariance = function pooledVariance(samples, unbiased) {\n    if (typeof(unbiased) === 'undefined') unbiased = true;\n    var sum = 0;\n    var length = 0, l = samples.length;\n    for (var i = 0; i < l; i++) {\n        var values = samples[i];\n        var vari = exports.variance(values);\n\n        sum += (values.length - 1) * vari;\n\n        if (unbiased)\n            length += values.length - 1;\n        else\n            length += values.length;\n    }\n    return sum / length;\n};\n\nexports.mode = function mode(values) {\n    var l = values.length,\n        itemCount = new Array(l),\n        i;\n    for (i = 0; i < l; i++) {\n        itemCount[i] = 0;\n    }\n    var itemArray = new Array(l);\n    var count = 0;\n\n    for (i = 0; i < l; i++) {\n        var index = itemArray.indexOf(values[i]);\n        if (index >= 0)\n            itemCount[index]++;\n        else {\n            itemArray[count] = values[i];\n            itemCount[count] = 1;\n            count++;\n        }\n    }\n\n    var maxValue = 0, maxIndex = 0;\n    for (i = 0; i < count; i++) {\n        if (itemCount[i] > maxValue) {\n            maxValue = itemCount[i];\n            maxIndex = i;\n        }\n    }\n\n    return itemArray[maxIndex];\n};\n\nexports.covariance = function covariance(vector1, vector2, unbiased) {\n    if (typeof(unbiased) === 'undefined') unbiased = true;\n    var mean1 = exports.mean(vector1);\n    var mean2 = exports.mean(vector2);\n\n    if (vector1.length !== vector2.length)\n        throw \"Vectors do not have the same dimensions\";\n\n    var cov = 0, l = vector1.length;\n    for (var i = 0; i < l; i++) {\n        var x = vector1[i] - mean1;\n        var y = vector2[i] - mean2;\n        cov += x * y;\n    }\n\n    if (unbiased)\n        return cov / (l - 1);\n    else\n        return cov / l;\n};\n\nexports.skewness = function skewness(values, unbiased) {\n    if (typeof(unbiased) === 'undefined') unbiased = true;\n    var theMean = exports.mean(values);\n\n    var s2 = 0, s3 = 0, l = values.length;\n    for (var i = 0; i < l; i++) {\n        var dev = values[i] - theMean;\n        s2 += dev * dev;\n        s3 += dev * dev * dev;\n    }\n    var m2 = s2 / l;\n    var m3 = s3 / l;\n\n    var g = m3 / (Math.pow(m2, 3 / 2.0));\n    if (unbiased) {\n        var a = Math.sqrt(l * (l - 1));\n        var b = l - 2;\n        return (a / b) * g;\n    }\n    else {\n        return g;\n    }\n};\n\nexports.kurtosis = function kurtosis(values, unbiased) {\n    if (typeof(unbiased) === 'undefined') unbiased = true;\n    var theMean = exports.mean(values);\n    var n = values.length, s2 = 0, s4 = 0;\n\n    for (var i = 0; i < n; i++) {\n        var dev = values[i] - theMean;\n        s2 += dev * dev;\n        s4 += dev * dev * dev * dev;\n    }\n    var m2 = s2 / n;\n    var m4 = s4 / n;\n\n    if (unbiased) {\n        var v = s2 / (n - 1);\n        var a = (n * (n + 1)) / ((n - 1) * (n - 2) * (n - 3));\n        var b = s4 / (v * v);\n        var c = ((n - 1) * (n - 1)) / ((n - 2) * (n - 3));\n\n        return a * b - 3 * c;\n    }\n    else {\n        return m4 / (m2 * m2) - 3;\n    }\n};\n\nexports.entropy = function entropy(values, eps) {\n    if (typeof(eps) === 'undefined') eps = 0;\n    var sum = 0, l = values.length;\n    for (var i = 0; i < l; i++)\n        sum += values[i] * Math.log(values[i] + eps);\n    return -sum;\n};\n\nexports.weightedMean = function weightedMean(values, weights) {\n    var sum = 0, l = values.length;\n    for (var i = 0; i < l; i++)\n        sum += values[i] * weights[i];\n    return sum;\n};\n\nexports.weightedStandardDeviation = function weightedStandardDeviation(values, weights) {\n    return Math.sqrt(exports.weightedVariance(values, weights));\n};\n\nexports.weightedVariance = function weightedVariance(values, weights) {\n    var theMean = exports.weightedMean(values, weights);\n    var vari = 0, l = values.length;\n    var a = 0, b = 0;\n\n    for (var i = 0; i < l; i++) {\n        var z = values[i] - theMean;\n        var w = weights[i];\n\n        vari += w * (z * z);\n        b += w;\n        a += w * w;\n    }\n\n    return vari * (b / (b * b - a));\n};\n\nexports.center = function center(values, inPlace) {\n    if (typeof(inPlace) === 'undefined') inPlace = false;\n\n    var result = values;\n    if (!inPlace)\n        result = values.slice();\n\n    var theMean = exports.mean(result), l = result.length;\n    for (var i = 0; i < l; i++)\n        result[i] -= theMean;\n};\n\nexports.standardize = function standardize(values, standardDev, inPlace) {\n    if (typeof(standardDev) === 'undefined') standardDev = exports.standardDeviation(values);\n    if (typeof(inPlace) === 'undefined') inPlace = false;\n    var l = values.length;\n    var result = inPlace ? values : new Array(l);\n    for (var i = 0; i < l; i++)\n        result[i] = values[i] / standardDev;\n    return result;\n};\n\nexports.cumulativeSum = function cumulativeSum(array) {\n    var l = array.length;\n    var result = new Array(l);\n    result[0] = array[0];\n    for (var i = 1; i < l; i++)\n        result[i] = result[i - 1] + array[i];\n    return result;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-savitzky-golay-generalized/node_modules/ml-stat/array.js","export {default as fourierTransform} from './fourierTransform';\nexport {default as zeroFilling} from './zeroFilling';\nexport {default as phaseCorrection} from './phaseCorrection';\nexport {default as digitalFilter} from './digitalFilter';\nexport {default as absoluteValue} from './absoluteValue';\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/spectra-data/src/filters/Filters.js","'use strict';\n\nexports.FFTUtils = require(\"./FFTUtils\");\nexports.FFT = require('./fftlib');\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-fft/src/index.js","\"use strict\";\n\nconst Converter = require(\"jcampconverter\");\nconst IOBuffer = require('iobuffer');\nconst JSZip = require(\"jszip\");\n\n// constants\nvar BINARY = 1;\nvar TEXT = 2;\n\n\nfunction readZIP(zipFile, options) {\n    options = options || {};\n\n    var zip = new JSZip();\n    zip.load(zipFile, options);\n\n    var files = {\n        'ser': BINARY,\n        'fid': BINARY,\n        'acqus': TEXT,\n        'acqu2s': TEXT,\n        'procs': TEXT,\n        'proc2s': TEXT,\n        '1r': BINARY,\n        '1i': BINARY,\n        '2rr': BINARY\n    };\n    var folders = zip.filter(function (relativePath, file) {\n        if(relativePath.indexOf(\"ser\")>=0||relativePath.indexOf(\"fid\")>=0\n            ||relativePath.indexOf(\"1r\")>=0||relativePath.indexOf(\"2rr\")>=0){\n            return true;\n        }\n\n        return false;\n\n    });\n\n    var spectra = new Array(folders.length);\n\n    for(var i = 0; i < folders.length; ++i) {\n        var len = folders[i].name.length;\n        var name = folders[i].name;\n        name = name.substr(0,name.lastIndexOf(\"/\")+1);\n        var currFolder = zip.folder(name);\n        var currFiles = currFolder.filter(function (relativePath, file) {\n            return files[relativePath] ? true : false;\n        });\n        var brukerFiles = {};\n        if(name.indexOf(\"pdata\")>=0){\n            brukerFiles['acqus'] = zip.file(name.replace(/pdata\\/[0-9]\\//,\"acqus\")).asText();\n        }\n        for(var j = 0; j < currFiles.length; ++j) {\n            var idx = currFiles[j].name.lastIndexOf('/');\n            var name = currFiles[j].name.substr(idx + 1);\n            if(files[name] === BINARY) {\n                brukerFiles[name] = new IOBuffer(currFiles[j].asArrayBuffer());\n            } else {\n                brukerFiles[name] = currFiles[j].asText();\n            }\n        }\n        //console.log(folders[i].name);\n        spectra[i] = {\"filename\":folders[i].name,value:convert(brukerFiles,options)};\n    }\n\n    return spectra;\n}\n\nfunction convert(brukerFiles, options) {\n    options = options || {};\n    var start = new Date();\n    var result;\n    if(brukerFiles['ser'] || brukerFiles['2rr']) {\n        result =  convert2D(brukerFiles, options);\n    } else if(brukerFiles['1r'] || brukerFiles['1i'] || brukerFiles['fid']) {\n        result =   convert1D(brukerFiles, options);\n    } else {\n        throw new RangeError('The current files are invalid');\n    }\n\n    if (result.twoD && !options.noContours) {\n        //console.log(\"Countours\");\n        add2D(result);\n        if (result.profiling) result.profiling.push({\n            action: 'Finished countour plot calculation',\n            time: new Date() - start\n        });\n        if (!options.keepSpectra) {\n            delete result.spectra;\n        }\n    }\n\n    var spectra = result.spectra;\n    if (options.xy) { // the spectraData should not be a oneD array but an object with x and y\n        if (spectra.length > 0) {\n            for (var i=0; i<spectra.length; i++) {\n                var spectrum=spectra[i];\n                if (spectrum.data.length>0) {\n                    for (var j=0; j<spectrum.data.length; j++) {\n                        var data=spectrum.data[j];\n                        var newData={x: new Array(data.length/2), y:new Array(data.length/2)};\n                        for (var k=0; k<data.length; k=k+2) {\n                            newData.x[k/2]=data[k];\n                            newData.y[k/2]=data[k+1];\n                        }\n                        spectrum.data[j]=newData;\n                    }\n\n                }\n            }\n        }\n    }\n\n    return result;\n}\n\nfunction convert1D(files, options) {\n    var result = parseData(files[\"procs\"], options);\n    var temp = parseData(files['acqus'], options);\n\n    var keys = Object.keys(temp.info);\n    for (var i = 0; i < keys.length; i++) {\n        var currKey = keys[i];\n        if(result.info[currKey] === undefined) {\n            result.info[currKey] = temp.info[currKey];\n        }\n    }\n\n    if(files['1r'] || files['1i']) {\n        if(files['1r']) {\n            setXYSpectrumData(files['1r'], result, '1r', true);\n        }\n        if(files['1i']) {\n            setXYSpectrumData(files['1i'], result, '1i', false);\n        }\n    } else if(files['fid']) {\n        setFIDSpectrumData(files['fid'], result)\n    }\n    \n    return result;\n}\n\nfunction convert2D(files, options) {\n    var SF,SW_p,SW,offset;\n    if(files['2rr']) {\n        var result = parseData(files['procs'], options);\n        var temp = parseData(files['acqus'], options);\n\n        var keys = Object.keys(temp.info);\n        for (var i = 0; i < keys.length; i++) {\n            var currKey = keys[i];\n            if(result.info[currKey] === undefined) {\n                result.info[currKey] = temp.info[currKey];\n            }\n        }\n        \n        temp = parseData(files['proc2s'], options);\n        result.info.nbSubSpectra = temp.info['$SI'] = parseInt(temp.info['$SI']);\n        SF = temp.info['$SF'] = parseFloat(temp.info['$SF']);\n        SW_p = temp.info['$SWP'] = parseFloat(temp.info['$SWP']);\n        offset = temp.info['$OFFSET'] = parseFloat(temp.info['$OFFSET']);\n\n    } else if(files['ser']) {\n        result = parseData(files['acqus'], options);\n        temp = parseData(files['acqu2s'], options);\n        result.info.nbSubSpectra = temp.info['$SI'] = parseInt(temp.info['$TD']);\n        result.info['$SI'] = parseInt(result.info['$TD']);\n        //SW_p = temp.info['$SWH'] = parseFloat(temp.info['$SWH']);\n\n        SW_p = temp.info[\"$SW\"];\n\n        result.info[\"$SWP\"]=result.info[\"$SWH\"];\n        result.info[\"$SF\"]=parseFloat(temp.info['$SFO1']);\n        result.info['$OFFSET']=0;\n        SF = temp.info['$SFO1'] = parseFloat(temp.info['$SFO1']);\n        SF = 1;\n        offset=0;\n        result.info['$AXNUC']=result.info['$NUC1'];\n        temp.info['$AXNUC']=temp.info['$NUC1'];\n    }\n\n    result.info.firstY = offset;\n    result.info.lastY = offset - SW_p / SF;\n    result.info['$BF2'] = SF;\n    result.info['$SFO1'] = SF;\n\n    var nbSubSpectra = result.info.nbSubSpectra;\n    var pageValue = result.info.firstY;\n    var deltaY = (result.info.lastY-result.info.firstY)/(nbSubSpectra-1);\n\n    if(files['2rr']) {\n        setXYSpectrumData(files['2rr'], result, '2rr', true);\n    } else if(files['ser']) {\n        setFIDSpectrumData(files['ser'], result, 'ser', true);\n    }\n\n    for(var i = 0; i < nbSubSpectra; i++) {\n        pageValue+=deltaY;\n        result.spectra[i].pageValue=pageValue;\n    }\n\n    var dataType = files['ser'] ? 'TYPE_2DNMR_FID' : 'TYPE_2DNMR_SPECTRUM';\n\n    result.info['2D_Y_NUCLEUS'] = temp.info['$AXNUC'];\n    result.info['2D_X_NUCLEUS'] = result.info['$AXNUC'];\n    result.info['2D_Y_FRECUENCY'] = SF;\n    result.info['2D_Y_OFFSET'] = offset;\n    result.info['2D_X_FRECUENCY'] = result.info['$SF'];\n    result.info['2D_X_OFFSET'] = result.info['$OFFSET'];\n\n    result.twoD = true;\n\n    return result;\n}\n\nfunction setXYSpectrumData(file, spectra, store, real) {\n    var td = spectra.info['$SI'] = parseInt(spectra.info['$SI']);\n\n    var SW_p = parseFloat(spectra.info[\"$SWP\"]);\n    var SF = parseFloat(spectra.info[\"$SF\"]);\n    var BF = SF;\n    //var BF = parseFloat(spectra.info[\"$BF1\"]);\n    var offset = spectra.shiftOffsetVal;//parseFloat(spectra.info[\"$OFFSET\"]);\n\n    spectra.info[\"observeFrequency\"] = SF;\n    spectra.info[\"$BF1\"] = BF;\n    spectra.info[\"$SFO1\"] = SF;\n    spectra.info.brukerReference = BF;\n\n    var endian = parseInt(spectra.info[\"$BYTORDP\"]);\n    endian = endian ? 0 : 1;\n\n    // number of spectras\n    var nbSubSpectra = spectra.info.nbSubSpectra ? spectra.info.nbSubSpectra : 1;\n\n    if(endian)\n        file.setLittleEndian();\n    else\n        file.setBigEndian();\n\n    for(var i = 0; i < nbSubSpectra; i++) {\n        var toSave = {\n            dataType : \"NMR Spectrum\",\n            dataTable : \"(X++(R..R))\",\n            nbPoints : td,\n            firstX : offset,\n            lastX : offset - SW_p / SF,\n            xUnit : \"PPM\",\n            yUnit : \"Arbitrary\",\n            data:[new Array(td*2)],//[{x:new Array(td),y:new Array(td)}],\n            isXYdata:true,\n            observeFrequency:SF,\n            title:spectra.info['TITLE'],\n            deltaX:-(SW_p / SF)/(td-1)\n\n        };\n\n        var x = offset;\n        var deltaX = toSave.deltaX;\n        if(real) {\n            for(var k = 0; k < td; ++k) {\n                toSave.data[0][2*k] = x;\n                toSave.data[0][2*k+1] = file.readInt32();\n                if(toSave.data[0][2*k+1]===null||isNaN(toSave.data[0][2*k+1])){\n                    toSave.data[0][2*k+1] = 0;\n                }\n                x += deltaX;\n            }\n        } else {\n            for(k = td - 1; k >= 0; --k) {\n                toSave.data[0][2*k] = x;\n                toSave.data[0][2*k+1] = file.readInt32();\n                if(toSave.data[0][2*k+1]===null||isNaN(toSave.data[0][2*k+1])) {\n                    toSave.data[0][2*k+1] = 0;\n                }\n                x += deltaX;\n            }\n        }\n\n        spectra.spectra.push(toSave);\n    }\n}\n\nfunction parseData(file, options) {\n    var keepRecordsRegExp=/.*/;\n    if (options.keepRecordsRegExp) keepRecordsRegExp=options.keepRecordsRegExp;\n    return Converter.convert(file, {\n        keepRecordsRegExp:keepRecordsRegExp\n    });\n}\n\nfunction setFIDSpectrumData(file, spectra) {\n    var td = spectra.info['$TD'] = parseInt(spectra.info['$TD']);\n\n    var SW_h = spectra.info['$SWH'] = parseFloat(spectra.info['$SWH']);\n    var SW = spectra.info['$SW'] = parseFloat(spectra.info['$SW']);\n\n    var SF = spectra.info['$SFO1'] = parseFloat(spectra.info['$SFO1']);\n    var BF =  parseFloat(spectra.info['$BF1']);\n    spectra.info['$BF1'] = BF;\n\n    //var DW = 1 / (2 * SW_h);\n    //var AQ = td * DW;\n    var AQ = SW;\n    var DW = AQ/(td-1);\n\n    //console.log(DW+\" \"+SW+\" \"+td);\n    var endian = parseInt(spectra.info[\"$BYTORDP\"]);\n    endian = endian ? 0 : 1;\n\n    if(endian)\n        file.setLittleEndian();\n    else\n        file.setBigEndian();\n\n    var nbSubSpectra = spectra.info.nbSubSpectra ? spectra.info.nbSubSpectra : 1;\n    spectra.spectra = new Array(nbSubSpectra);\n    \n    for(var j = 0; j < nbSubSpectra/2; j++) {\n        var toSave = {\n            dataType : \"NMR FID\",\n            dataTable : \"(X++(R..R))\",\n            nbPoints : td,\n            firstX : 0,\n            lastX : AQ,\n            nucleus : spectra.info[\"$NUC1\"] ? spectra.info[\"$NUC1\"] : undefined,\n            xUnit : \"Sec\",\n            yUnit : \"Arbitrary\",\n            data:[new Array(2*td)],//[{x:new Array(td),y:new Array(td)}],\n            isXYdata:true,\n            observeFrequency:SF,\n            title:spectra.info['TITLE'],\n            deltaX:DW\n        };\n        spectra.spectra[j*2] = toSave;\n\n        toSave = {\n            dataType : \"NMR FID\",\n            dataTable : \"(X++(I..I))\",\n            nbPoints : td,\n            firstX : 0,\n            lastX : AQ,\n            nucleus : spectra.info[\"$NUC1\"] ? spectra.info[\"$NUC1\"] : undefined,\n            xUnit : \"Sec\",\n            yUnit : \"Arbitrary\",\n            data:[new Array(2*td)],//[{x:new Array(td),y:new Array(td)}],\n            isXYdata:true,\n            observeFrequency:SF,\n            title:spectra.info['TITLE'],\n            deltaX:DW\n        };\n        spectra.spectra[j*2+1] = toSave;\n        \n        var x = 0;\n        var y;\n        for(var i = 0; file.available(8)&&i<td; i++, x = i*DW) {\n            y = file.readInt32();\n            if(y===null || isNaN(y)){\n                y=0;\n            }\n            spectra.spectra[j*2].data[0][2*i+1] = y;\n            spectra.spectra[j*2].data[0][2*i] = x;\n            y = file.readInt32();\n            if(y===null || isNaN(y)){\n                y=0;\n            }\n            spectra.spectra[j*2+1].data[0][2*i+1] = y;\n            spectra.spectra[j*2+1].data[0][2*i] = x;\n\n        }\n\n        for(; i < td; i++, x = i*DW) {\n            spectra.spectra[j*2].data[0][2*i+1] = 0;\n            spectra.spectra[j*2].data[0][2*i] = x;\n            spectra.spectra[j*2+1].data[0][2*i+1] = 0;\n            spectra.spectra[j*2+1].data[0][2*i] = x;\n        }\n    }\n}\n\n/**\n * Those functions should disappear if add2D becomes accessible in jcampconvert\n * @param spectra\n * @returns {{z: Array, minX: *, maxX: *, minY: *, maxY: *, minZ: *, maxZ: *, noise: number}}\n */\n\nfunction convertTo3DZ(spectra) {\n    var noise = 0;\n    var minZ = spectra[0].data[0][0];\n    var maxZ = minZ;\n    var ySize = spectra.length;\n    var xSize = spectra[0].data[0].length / 2;\n    var z = new Array(ySize);\n    for (var i = 0; i < ySize; i++) {\n        z[i] = new Array(xSize);\n        for (var j = 0; j < xSize; j++) {\n            z[i][j] = spectra[i].data[0][j * 2 + 1];\n            if (z[i][j] < minZ) minZ = spectra[i].data[0][j * 2 + 1];\n            if (z[i][j] > maxZ) maxZ = spectra[i].data[0][j * 2 + 1];\n            if (i !== 0 && j !== 0) {\n                noise += Math.abs(z[i][j] - z[i][j - 1]) + Math.abs(z[i][j] - z[i - 1][j]);\n            }\n        }\n    }\n    return {\n        z: z,\n        minX: spectra[0].data[0][0],\n        maxX: spectra[0].data[0][spectra[0].data[0].length - 2],\n        minY: spectra[0].pageValue,\n        maxY: spectra[ySize - 1].pageValue,\n        minZ: minZ,\n        maxZ: maxZ,\n        noise: noise / ((ySize - 1) * (xSize - 1) * 2)\n    };\n\n}\n\nfunction add2D(result) {\n    var zData = convertTo3DZ(result.spectra);\n    result.contourLines = generateContourLines(zData);\n    delete zData.z;\n    result.minMax = zData;\n}\n\n\nfunction generateContourLines(zData, options) {\n    //console.time('generateContourLines');\n    var noise = zData.noise;\n    var z = zData.z;\n    var contourLevels = [];\n    var nbLevels = 7;\n    var povarHeight = new Float32Array(4);\n    var isOver = [];\n    var nbSubSpectra = z.length;\n    var nbPovars = z[0].length;\n    var pAx, pAy, pBx, pBy;\n\n    var x0 = zData.minX;\n    var xN = zData.maxX;\n    var dx = (xN - x0) / (nbPovars - 1);\n    var y0 = zData.minY;\n    var yN = zData.maxY;\n    var dy = (yN - y0) / (nbSubSpectra - 1);\n    var minZ = zData.minZ;\n    var maxZ = zData.maxZ;\n\n    //System.out.prvarln('y0 '+y0+' yN '+yN);\n    // -------------------------\n    // Povars attribution\n    //\n    // 0----1\n    // |  / |\n    // | /  |\n    // 2----3\n    //\n    // ---------------------d------\n\n    var lineZValue;\n    for (var level = 0; level < nbLevels * 2; level++) { // multiply by 2 for positif and negatif\n        var contourLevel = {};\n        contourLevels.push(contourLevel);\n        var side = level % 2;\n        if (side === 0) {\n            lineZValue = (maxZ - 5 * noise) * Math.exp(level / 2 - nbLevels) + 5 * noise;\n        } else {\n            lineZValue = -(maxZ - 5 * noise) * Math.exp(level / 2 - nbLevels) - 5 * noise;\n        }\n        var lines = [];\n        contourLevel.zValue = lineZValue;\n        contourLevel.lines = lines;\n\n        if (lineZValue <= minZ || lineZValue >= maxZ) continue;\n\n        for (var iSubSpectra = 0; iSubSpectra < nbSubSpectra - 1; iSubSpectra++) {\n            for (var povar = 0; povar < nbPovars - 1; povar++) {\n                povarHeight[0] = z[iSubSpectra][povar];\n                povarHeight[1] = z[iSubSpectra][povar + 1];\n                povarHeight[2] = z[(iSubSpectra + 1)][povar];\n                povarHeight[3] = z[(iSubSpectra + 1)][(povar + 1)];\n\n                for (var i = 0; i < 4; i++) {\n                    isOver[i] = (povarHeight[i] > lineZValue);\n                }\n\n                // Example povar0 is over the plane and povar1 and\n                // povar2 are below, we find the varersections and add\n                // the segment\n                if (isOver[0] !== isOver[1] && isOver[0] !== isOver[2]) {\n                    pAx = povar + (lineZValue - povarHeight[0]) / (povarHeight[1] - povarHeight[0]);\n                    pAy = iSubSpectra;\n                    pBx = povar;\n                    pBy = iSubSpectra + (lineZValue - povarHeight[0]) / (povarHeight[2] - povarHeight[0]);\n                    lines.push(pAx * dx + x0, pAy * dy + y0, pBx * dx + x0, pBy * dy + y0);\n                }\n                if (isOver[3] !== isOver[1] && isOver[3] !== isOver[2]) {\n                    pAx = povar + 1;\n                    pAy = iSubSpectra + 1 - (lineZValue - povarHeight[3]) / (povarHeight[1] - povarHeight[3]);\n                    pBx = povar + 1 - (lineZValue - povarHeight[3]) / (povarHeight[2] - povarHeight[3]);\n                    pBy = iSubSpectra + 1;\n                    lines.push(pAx * dx + x0, pAy * dy + y0, pBx * dx + x0, pBy * dy + y0);\n                }\n                // test around the diagonal\n                if (isOver[1] !== isOver[2]) {\n                    pAx = povar + 1 - (lineZValue - povarHeight[1]) / (povarHeight[2] - povarHeight[1]);\n                    pAy = iSubSpectra + (lineZValue - povarHeight[1]) / (povarHeight[2] - povarHeight[1]);\n                    if (isOver[1] !== isOver[0]) {\n                        pBx = povar + 1 - (lineZValue - povarHeight[1]) / (povarHeight[0] - povarHeight[1]);\n                        pBy = iSubSpectra;\n                        lines.push(pAx * dx + x0, pAy * dy + y0, pBx * dx + x0, pBy * dy + y0);\n                    }\n                    if (isOver[2] !== isOver[0]) {\n                        pBx = povar;\n                        pBy = iSubSpectra + 1 - (lineZValue - povarHeight[2]) / (povarHeight[0] - povarHeight[2]);\n                        lines.push(pAx * dx + x0, pAy * dy + y0, pBx * dx + x0, pBy * dy + y0);\n                    }\n                    if (isOver[1] !== isOver[3]) {\n                        pBx = povar + 1;\n                        pBy = iSubSpectra + (lineZValue - povarHeight[1]) / (povarHeight[3] - povarHeight[1]);\n                        lines.push(pAx * dx + x0, pAy * dy + y0, pBx * dx + x0, pBy * dy + y0);\n                    }\n                    if (isOver[2] !== isOver[3]) {\n                        pBx = povar + (lineZValue - povarHeight[2]) / (povarHeight[3] - povarHeight[2]);\n                        pBy = iSubSpectra + 1;\n                        lines.push(pAx * dx + x0, pAy * dy + y0, pBx * dx + x0, pBy * dy + y0);\n                    }\n                }\n            }\n        }\n    }\n    // console.timeEnd('generateContourLines');\n    return {\n        minX: zData.minX,\n        maxX: zData.maxX,\n        minY: zData.minY,\n        maxY: zData.maxY,\n        segments: contourLevels\n    };\n    //return contourLevels;\n}\n\n\nmodule.exports =  {\n    convertZip: readZIP,\n    converFolder: convert\n};\n\n\n// WEBPACK FOOTER //\n// ./node_modules/brukerconverter/src/brukerconverter.js","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>\n * @license  MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar isArray = require('isarray')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n *   === true    Use Uint8Array implementation (fastest)\n *   === false   Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n *   - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n *     See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n *   - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n *   - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n *     incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n  ? global.TYPED_ARRAY_SUPPORT\n  : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n  try {\n    var arr = new Uint8Array(1)\n    arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n    return arr.foo() === 42 && // typed array instances can be augmented\n        typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n        arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n  } catch (e) {\n    return false\n  }\n}\n\nfunction kMaxLength () {\n  return Buffer.TYPED_ARRAY_SUPPORT\n    ? 0x7fffffff\n    : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n  if (kMaxLength() < length) {\n    throw new RangeError('Invalid typed array length')\n  }\n  if (Buffer.TYPED_ARRAY_SUPPORT) {\n    // Return an augmented `Uint8Array` instance, for best performance\n    that = new Uint8Array(length)\n    that.__proto__ = Buffer.prototype\n  } else {\n    // Fallback: Return an object instance of the Buffer class\n    if (that === null) {\n      that = new Buffer(length)\n    }\n    that.length = length\n  }\n\n  return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n  if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n    return new Buffer(arg, encodingOrOffset, length)\n  }\n\n  // Common case.\n  if (typeof arg === 'number') {\n    if (typeof encodingOrOffset === 'string') {\n      throw new Error(\n        'If encoding is specified then the first argument must be a string'\n      )\n    }\n    return allocUnsafe(this, arg)\n  }\n  return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n  arr.__proto__ = Buffer.prototype\n  return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n  if (typeof value === 'number') {\n    throw new TypeError('\"value\" argument must not be a number')\n  }\n\n  if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n    return fromArrayBuffer(that, value, encodingOrOffset, length)\n  }\n\n  if (typeof value === 'string') {\n    return fromString(that, value, encodingOrOffset)\n  }\n\n  return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n  return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n  Buffer.prototype.__proto__ = Uint8Array.prototype\n  Buffer.__proto__ = Uint8Array\n  if (typeof Symbol !== 'undefined' && Symbol.species &&\n      Buffer[Symbol.species] === Buffer) {\n    // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n    Object.defineProperty(Buffer, Symbol.species, {\n      value: null,\n      configurable: true\n    })\n  }\n}\n\nfunction assertSize (size) {\n  if (typeof size !== 'number') {\n    throw new TypeError('\"size\" argument must be a number')\n  } else if (size < 0) {\n    throw new RangeError('\"size\" argument must not be negative')\n  }\n}\n\nfunction alloc (that, size, fill, encoding) {\n  assertSize(size)\n  if (size <= 0) {\n    return createBuffer(that, size)\n  }\n  if (fill !== undefined) {\n    // Only pay attention to encoding if it's a string. This\n    // prevents accidentally sending in a number that would\n    // be interpretted as a start offset.\n    return typeof encoding === 'string'\n      ? createBuffer(that, size).fill(fill, encoding)\n      : createBuffer(that, size).fill(fill)\n  }\n  return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n  return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n  assertSize(size)\n  that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n  if (!Buffer.TYPED_ARRAY_SUPPORT) {\n    for (var i = 0; i < size; ++i) {\n      that[i] = 0\n    }\n  }\n  return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n  return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n  return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n  if (typeof encoding !== 'string' || encoding === '') {\n    encoding = 'utf8'\n  }\n\n  if (!Buffer.isEncoding(encoding)) {\n    throw new TypeError('\"encoding\" must be a valid string encoding')\n  }\n\n  var length = byteLength(string, encoding) | 0\n  that = createBuffer(that, length)\n\n  var actual = that.write(string, encoding)\n\n  if (actual !== length) {\n    // Writing a hex string, for example, that contains invalid characters will\n    // cause everything after the first invalid character to be ignored. (e.g.\n    // 'abxxcd' will be treated as 'ab')\n    that = that.slice(0, actual)\n  }\n\n  return that\n}\n\nfunction fromArrayLike (that, array) {\n  var length = array.length < 0 ? 0 : checked(array.length) | 0\n  that = createBuffer(that, length)\n  for (var i = 0; i < length; i += 1) {\n    that[i] = array[i] & 255\n  }\n  return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n  array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n  if (byteOffset < 0 || array.byteLength < byteOffset) {\n    throw new RangeError('\\'offset\\' is out of bounds')\n  }\n\n  if (array.byteLength < byteOffset + (length || 0)) {\n    throw new RangeError('\\'length\\' is out of bounds')\n  }\n\n  if (byteOffset === undefined && length === undefined) {\n    array = new Uint8Array(array)\n  } else if (length === undefined) {\n    array = new Uint8Array(array, byteOffset)\n  } else {\n    array = new Uint8Array(array, byteOffset, length)\n  }\n\n  if (Buffer.TYPED_ARRAY_SUPPORT) {\n    // Return an augmented `Uint8Array` instance, for best performance\n    that = array\n    that.__proto__ = Buffer.prototype\n  } else {\n    // Fallback: Return an object instance of the Buffer class\n    that = fromArrayLike(that, array)\n  }\n  return that\n}\n\nfunction fromObject (that, obj) {\n  if (Buffer.isBuffer(obj)) {\n    var len = checked(obj.length) | 0\n    that = createBuffer(that, len)\n\n    if (that.length === 0) {\n      return that\n    }\n\n    obj.copy(that, 0, 0, len)\n    return that\n  }\n\n  if (obj) {\n    if ((typeof ArrayBuffer !== 'undefined' &&\n        obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n      if (typeof obj.length !== 'number' || isnan(obj.length)) {\n        return createBuffer(that, 0)\n      }\n      return fromArrayLike(that, obj)\n    }\n\n    if (obj.type === 'Buffer' && isArray(obj.data)) {\n      return fromArrayLike(that, obj.data)\n    }\n  }\n\n  throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n  // Note: cannot use `length < kMaxLength()` here because that fails when\n  // length is NaN (which is otherwise coerced to zero.)\n  if (length >= kMaxLength()) {\n    throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n                         'size: 0x' + kMaxLength().toString(16) + ' bytes')\n  }\n  return length | 0\n}\n\nfunction SlowBuffer (length) {\n  if (+length != length) { // eslint-disable-line eqeqeq\n    length = 0\n  }\n  return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n  return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n  if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n    throw new TypeError('Arguments must be Buffers')\n  }\n\n  if (a === b) return 0\n\n  var x = a.length\n  var y = b.length\n\n  for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n    if (a[i] !== b[i]) {\n      x = a[i]\n      y = b[i]\n      break\n    }\n  }\n\n  if (x < y) return -1\n  if (y < x) return 1\n  return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n  switch (String(encoding).toLowerCase()) {\n    case 'hex':\n    case 'utf8':\n    case 'utf-8':\n    case 'ascii':\n    case 'latin1':\n    case 'binary':\n    case 'base64':\n    case 'ucs2':\n    case 'ucs-2':\n    case 'utf16le':\n    case 'utf-16le':\n      return true\n    default:\n      return false\n  }\n}\n\nBuffer.concat = function concat (list, length) {\n  if (!isArray(list)) {\n    throw new TypeError('\"list\" argument must be an Array of Buffers')\n  }\n\n  if (list.length === 0) {\n    return Buffer.alloc(0)\n  }\n\n  var i\n  if (length === undefined) {\n    length = 0\n    for (i = 0; i < list.length; ++i) {\n      length += list[i].length\n    }\n  }\n\n  var buffer = Buffer.allocUnsafe(length)\n  var pos = 0\n  for (i = 0; i < list.length; ++i) {\n    var buf = list[i]\n    if (!Buffer.isBuffer(buf)) {\n      throw new TypeError('\"list\" argument must be an Array of Buffers')\n    }\n    buf.copy(buffer, pos)\n    pos += buf.length\n  }\n  return buffer\n}\n\nfunction byteLength (string, encoding) {\n  if (Buffer.isBuffer(string)) {\n    return string.length\n  }\n  if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n      (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n    return string.byteLength\n  }\n  if (typeof string !== 'string') {\n    string = '' + string\n  }\n\n  var len = string.length\n  if (len === 0) return 0\n\n  // Use a for loop to avoid recursion\n  var loweredCase = false\n  for (;;) {\n    switch (encoding) {\n      case 'ascii':\n      case 'latin1':\n      case 'binary':\n        return len\n      case 'utf8':\n      case 'utf-8':\n      case undefined:\n        return utf8ToBytes(string).length\n      case 'ucs2':\n      case 'ucs-2':\n      case 'utf16le':\n      case 'utf-16le':\n        return len * 2\n      case 'hex':\n        return len >>> 1\n      case 'base64':\n        return base64ToBytes(string).length\n      default:\n        if (loweredCase) return utf8ToBytes(string).length // assume utf8\n        encoding = ('' + encoding).toLowerCase()\n        loweredCase = true\n    }\n  }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n  var loweredCase = false\n\n  // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n  // property of a typed array.\n\n  // This behaves neither like String nor Uint8Array in that we set start/end\n  // to their upper/lower bounds if the value passed is out of range.\n  // undefined is handled specially as per ECMA-262 6th Edition,\n  // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n  if (start === undefined || start < 0) {\n    start = 0\n  }\n  // Return early if start > this.length. Done here to prevent potential uint32\n  // coercion fail below.\n  if (start > this.length) {\n    return ''\n  }\n\n  if (end === undefined || end > this.length) {\n    end = this.length\n  }\n\n  if (end <= 0) {\n    return ''\n  }\n\n  // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n  end >>>= 0\n  start >>>= 0\n\n  if (end <= start) {\n    return ''\n  }\n\n  if (!encoding) encoding = 'utf8'\n\n  while (true) {\n    switch (encoding) {\n      case 'hex':\n        return hexSlice(this, start, end)\n\n      case 'utf8':\n      case 'utf-8':\n        return utf8Slice(this, start, end)\n\n      case 'ascii':\n        return asciiSlice(this, start, end)\n\n      case 'latin1':\n      case 'binary':\n        return latin1Slice(this, start, end)\n\n      case 'base64':\n        return base64Slice(this, start, end)\n\n      case 'ucs2':\n      case 'ucs-2':\n      case 'utf16le':\n      case 'utf-16le':\n        return utf16leSlice(this, start, end)\n\n      default:\n        if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n        encoding = (encoding + '').toLowerCase()\n        loweredCase = true\n    }\n  }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n  var i = b[n]\n  b[n] = b[m]\n  b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n  var len = this.length\n  if (len % 2 !== 0) {\n    throw new RangeError('Buffer size must be a multiple of 16-bits')\n  }\n  for (var i = 0; i < len; i += 2) {\n    swap(this, i, i + 1)\n  }\n  return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n  var len = this.length\n  if (len % 4 !== 0) {\n    throw new RangeError('Buffer size must be a multiple of 32-bits')\n  }\n  for (var i = 0; i < len; i += 4) {\n    swap(this, i, i + 3)\n    swap(this, i + 1, i + 2)\n  }\n  return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n  var len = this.length\n  if (len % 8 !== 0) {\n    throw new RangeError('Buffer size must be a multiple of 64-bits')\n  }\n  for (var i = 0; i < len; i += 8) {\n    swap(this, i, i + 7)\n    swap(this, i + 1, i + 6)\n    swap(this, i + 2, i + 5)\n    swap(this, i + 3, i + 4)\n  }\n  return this\n}\n\nBuffer.prototype.toString = function toString () {\n  var length = this.length | 0\n  if (length === 0) return ''\n  if (arguments.length === 0) return utf8Slice(this, 0, length)\n  return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n  if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n  if (this === b) return true\n  return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n  var str = ''\n  var max = exports.INSPECT_MAX_BYTES\n  if (this.length > 0) {\n    str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n    if (this.length > max) str += ' ... '\n  }\n  return '<Buffer ' + str + '>'\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n  if (!Buffer.isBuffer(target)) {\n    throw new TypeError('Argument must be a Buffer')\n  }\n\n  if (start === undefined) {\n    start = 0\n  }\n  if (end === undefined) {\n    end = target ? target.length : 0\n  }\n  if (thisStart === undefined) {\n    thisStart = 0\n  }\n  if (thisEnd === undefined) {\n    thisEnd = this.length\n  }\n\n  if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n    throw new RangeError('out of range index')\n  }\n\n  if (thisStart >= thisEnd && start >= end) {\n    return 0\n  }\n  if (thisStart >= thisEnd) {\n    return -1\n  }\n  if (start >= end) {\n    return 1\n  }\n\n  start >>>= 0\n  end >>>= 0\n  thisStart >>>= 0\n  thisEnd >>>= 0\n\n  if (this === target) return 0\n\n  var x = thisEnd - thisStart\n  var y = end - start\n  var len = Math.min(x, y)\n\n  var thisCopy = this.slice(thisStart, thisEnd)\n  var targetCopy = target.slice(start, end)\n\n  for (var i = 0; i < len; ++i) {\n    if (thisCopy[i] !== targetCopy[i]) {\n      x = thisCopy[i]\n      y = targetCopy[i]\n      break\n    }\n  }\n\n  if (x < y) return -1\n  if (y < x) return 1\n  return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n  // Empty buffer means no match\n  if (buffer.length === 0) return -1\n\n  // Normalize byteOffset\n  if (typeof byteOffset === 'string') {\n    encoding = byteOffset\n    byteOffset = 0\n  } else if (byteOffset > 0x7fffffff) {\n    byteOffset = 0x7fffffff\n  } else if (byteOffset < -0x80000000) {\n    byteOffset = -0x80000000\n  }\n  byteOffset = +byteOffset  // Coerce to Number.\n  if (isNaN(byteOffset)) {\n    // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n    byteOffset = dir ? 0 : (buffer.length - 1)\n  }\n\n  // Normalize byteOffset: negative offsets start from the end of the buffer\n  if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n  if (byteOffset >= buffer.length) {\n    if (dir) return -1\n    else byteOffset = buffer.length - 1\n  } else if (byteOffset < 0) {\n    if (dir) byteOffset = 0\n    else return -1\n  }\n\n  // Normalize val\n  if (typeof val === 'string') {\n    val = Buffer.from(val, encoding)\n  }\n\n  // Finally, search either indexOf (if dir is true) or lastIndexOf\n  if (Buffer.isBuffer(val)) {\n    // Special case: looking for empty string/buffer always fails\n    if (val.length === 0) {\n      return -1\n    }\n    return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n  } else if (typeof val === 'number') {\n    val = val & 0xFF // Search for a byte value [0-255]\n    if (Buffer.TYPED_ARRAY_SUPPORT &&\n        typeof Uint8Array.prototype.indexOf === 'function') {\n      if (dir) {\n        return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n      } else {\n        return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n      }\n    }\n    return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n  }\n\n  throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n  var indexSize = 1\n  var arrLength = arr.length\n  var valLength = val.length\n\n  if (encoding !== undefined) {\n    encoding = String(encoding).toLowerCase()\n    if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n        encoding === 'utf16le' || encoding === 'utf-16le') {\n      if (arr.length < 2 || val.length < 2) {\n        return -1\n      }\n      indexSize = 2\n      arrLength /= 2\n      valLength /= 2\n      byteOffset /= 2\n    }\n  }\n\n  function read (buf, i) {\n    if (indexSize === 1) {\n      return buf[i]\n    } else {\n      return buf.readUInt16BE(i * indexSize)\n    }\n  }\n\n  var i\n  if (dir) {\n    var foundIndex = -1\n    for (i = byteOffset; i < arrLength; i++) {\n      if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n        if (foundIndex === -1) foundIndex = i\n        if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n      } else {\n        if (foundIndex !== -1) i -= i - foundIndex\n        foundIndex = -1\n      }\n    }\n  } else {\n    if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n    for (i = byteOffset; i >= 0; i--) {\n      var found = true\n      for (var j = 0; j < valLength; j++) {\n        if (read(arr, i + j) !== read(val, j)) {\n          found = false\n          break\n        }\n      }\n      if (found) return i\n    }\n  }\n\n  return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n  return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n  return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n  return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n  offset = Number(offset) || 0\n  var remaining = buf.length - offset\n  if (!length) {\n    length = remaining\n  } else {\n    length = Number(length)\n    if (length > remaining) {\n      length = remaining\n    }\n  }\n\n  // must be an even number of digits\n  var strLen = string.length\n  if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n  if (length > strLen / 2) {\n    length = strLen / 2\n  }\n  for (var i = 0; i < length; ++i) {\n    var parsed = parseInt(string.substr(i * 2, 2), 16)\n    if (isNaN(parsed)) return i\n    buf[offset + i] = parsed\n  }\n  return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n  return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n  return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n  return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n  return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n  return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n  // Buffer#write(string)\n  if (offset === undefined) {\n    encoding = 'utf8'\n    length = this.length\n    offset = 0\n  // Buffer#write(string, encoding)\n  } else if (length === undefined && typeof offset === 'string') {\n    encoding = offset\n    length = this.length\n    offset = 0\n  // Buffer#write(string, offset[, length][, encoding])\n  } else if (isFinite(offset)) {\n    offset = offset | 0\n    if (isFinite(length)) {\n      length = length | 0\n      if (encoding === undefined) encoding = 'utf8'\n    } else {\n      encoding = length\n      length = undefined\n    }\n  // legacy write(string, encoding, offset, length) - remove in v0.13\n  } else {\n    throw new Error(\n      'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n    )\n  }\n\n  var remaining = this.length - offset\n  if (length === undefined || length > remaining) length = remaining\n\n  if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n    throw new RangeError('Attempt to write outside buffer bounds')\n  }\n\n  if (!encoding) encoding = 'utf8'\n\n  var loweredCase = false\n  for (;;) {\n    switch (encoding) {\n      case 'hex':\n        return hexWrite(this, string, offset, length)\n\n      case 'utf8':\n      case 'utf-8':\n        return utf8Write(this, string, offset, length)\n\n      case 'ascii':\n        return asciiWrite(this, string, offset, length)\n\n      case 'latin1':\n      case 'binary':\n        return latin1Write(this, string, offset, length)\n\n      case 'base64':\n        // Warning: maxLength not taken into account in base64Write\n        return base64Write(this, string, offset, length)\n\n      case 'ucs2':\n      case 'ucs-2':\n      case 'utf16le':\n      case 'utf-16le':\n        return ucs2Write(this, string, offset, length)\n\n      default:\n        if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n        encoding = ('' + encoding).toLowerCase()\n        loweredCase = true\n    }\n  }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n  return {\n    type: 'Buffer',\n    data: Array.prototype.slice.call(this._arr || this, 0)\n  }\n}\n\nfunction base64Slice (buf, start, end) {\n  if (start === 0 && end === buf.length) {\n    return base64.fromByteArray(buf)\n  } else {\n    return base64.fromByteArray(buf.slice(start, end))\n  }\n}\n\nfunction utf8Slice (buf, start, end) {\n  end = Math.min(buf.length, end)\n  var res = []\n\n  var i = start\n  while (i < end) {\n    var firstByte = buf[i]\n    var codePoint = null\n    var bytesPerSequence = (firstByte > 0xEF) ? 4\n      : (firstByte > 0xDF) ? 3\n      : (firstByte > 0xBF) ? 2\n      : 1\n\n    if (i + bytesPerSequence <= end) {\n      var secondByte, thirdByte, fourthByte, tempCodePoint\n\n      switch (bytesPerSequence) {\n        case 1:\n          if (firstByte < 0x80) {\n            codePoint = firstByte\n          }\n          break\n        case 2:\n          secondByte = buf[i + 1]\n          if ((secondByte & 0xC0) === 0x80) {\n            tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n            if (tempCodePoint > 0x7F) {\n              codePoint = tempCodePoint\n            }\n          }\n          break\n        case 3:\n          secondByte = buf[i + 1]\n          thirdByte = buf[i + 2]\n          if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n            tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n            if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n              codePoint = tempCodePoint\n            }\n          }\n          break\n        case 4:\n          secondByte = buf[i + 1]\n          thirdByte = buf[i + 2]\n          fourthByte = buf[i + 3]\n          if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n            tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n            if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n              codePoint = tempCodePoint\n            }\n          }\n      }\n    }\n\n    if (codePoint === null) {\n      // we did not generate a valid codePoint so insert a\n      // replacement char (U+FFFD) and advance only 1 byte\n      codePoint = 0xFFFD\n      bytesPerSequence = 1\n    } else if (codePoint > 0xFFFF) {\n      // encode to utf16 (surrogate pair dance)\n      codePoint -= 0x10000\n      res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n      codePoint = 0xDC00 | codePoint & 0x3FF\n    }\n\n    res.push(codePoint)\n    i += bytesPerSequence\n  }\n\n  return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n  var len = codePoints.length\n  if (len <= MAX_ARGUMENTS_LENGTH) {\n    return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n  }\n\n  // Decode in chunks to avoid \"call stack size exceeded\".\n  var res = ''\n  var i = 0\n  while (i < len) {\n    res += String.fromCharCode.apply(\n      String,\n      codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n    )\n  }\n  return res\n}\n\nfunction asciiSlice (buf, start, end) {\n  var ret = ''\n  end = Math.min(buf.length, end)\n\n  for (var i = start; i < end; ++i) {\n    ret += String.fromCharCode(buf[i] & 0x7F)\n  }\n  return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n  var ret = ''\n  end = Math.min(buf.length, end)\n\n  for (var i = start; i < end; ++i) {\n    ret += String.fromCharCode(buf[i])\n  }\n  return ret\n}\n\nfunction hexSlice (buf, start, end) {\n  var len = buf.length\n\n  if (!start || start < 0) start = 0\n  if (!end || end < 0 || end > len) end = len\n\n  var out = ''\n  for (var i = start; i < end; ++i) {\n    out += toHex(buf[i])\n  }\n  return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n  var bytes = buf.slice(start, end)\n  var res = ''\n  for (var i = 0; i < bytes.length; i += 2) {\n    res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n  }\n  return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n  var len = this.length\n  start = ~~start\n  end = end === undefined ? len : ~~end\n\n  if (start < 0) {\n    start += len\n    if (start < 0) start = 0\n  } else if (start > len) {\n    start = len\n  }\n\n  if (end < 0) {\n    end += len\n    if (end < 0) end = 0\n  } else if (end > len) {\n    end = len\n  }\n\n  if (end < start) end = start\n\n  var newBuf\n  if (Buffer.TYPED_ARRAY_SUPPORT) {\n    newBuf = this.subarray(start, end)\n    newBuf.__proto__ = Buffer.prototype\n  } else {\n    var sliceLen = end - start\n    newBuf = new Buffer(sliceLen, undefined)\n    for (var i = 0; i < sliceLen; ++i) {\n      newBuf[i] = this[i + start]\n    }\n  }\n\n  return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n  if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n  if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n  offset = offset | 0\n  byteLength = byteLength | 0\n  if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n  var val = this[offset]\n  var mul = 1\n  var i = 0\n  while (++i < byteLength && (mul *= 0x100)) {\n    val += this[offset + i] * mul\n  }\n\n  return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n  offset = offset | 0\n  byteLength = byteLength | 0\n  if (!noAssert) {\n    checkOffset(offset, byteLength, this.length)\n  }\n\n  var val = this[offset + --byteLength]\n  var mul = 1\n  while (byteLength > 0 && (mul *= 0x100)) {\n    val += this[offset + --byteLength] * mul\n  }\n\n  return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n  if (!noAssert) checkOffset(offset, 1, this.length)\n  return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n  if (!noAssert) checkOffset(offset, 2, this.length)\n  return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n  if (!noAssert) checkOffset(offset, 2, this.length)\n  return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n  if (!noAssert) checkOffset(offset, 4, this.length)\n\n  return ((this[offset]) |\n      (this[offset + 1] << 8) |\n      (this[offset + 2] << 16)) +\n      (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n  if (!noAssert) checkOffset(offset, 4, this.length)\n\n  return (this[offset] * 0x1000000) +\n    ((this[offset + 1] << 16) |\n    (this[offset + 2] << 8) |\n    this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n  offset = offset | 0\n  byteLength = byteLength | 0\n  if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n  var val = this[offset]\n  var mul = 1\n  var i = 0\n  while (++i < byteLength && (mul *= 0x100)) {\n    val += this[offset + i] * mul\n  }\n  mul *= 0x80\n\n  if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n  return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n  offset = offset | 0\n  byteLength = byteLength | 0\n  if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n  var i = byteLength\n  var mul = 1\n  var val = this[offset + --i]\n  while (i > 0 && (mul *= 0x100)) {\n    val += this[offset + --i] * mul\n  }\n  mul *= 0x80\n\n  if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n  return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n  if (!noAssert) checkOffset(offset, 1, this.length)\n  if (!(this[offset] & 0x80)) return (this[offset])\n  return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n  if (!noAssert) checkOffset(offset, 2, this.length)\n  var val = this[offset] | (this[offset + 1] << 8)\n  return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n  if (!noAssert) checkOffset(offset, 2, this.length)\n  var val = this[offset + 1] | (this[offset] << 8)\n  return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n  if (!noAssert) checkOffset(offset, 4, this.length)\n\n  return (this[offset]) |\n    (this[offset + 1] << 8) |\n    (this[offset + 2] << 16) |\n    (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n  if (!noAssert) checkOffset(offset, 4, this.length)\n\n  return (this[offset] << 24) |\n    (this[offset + 1] << 16) |\n    (this[offset + 2] << 8) |\n    (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n  if (!noAssert) checkOffset(offset, 4, this.length)\n  return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n  if (!noAssert) checkOffset(offset, 4, this.length)\n  return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n  if (!noAssert) checkOffset(offset, 8, this.length)\n  return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n  if (!noAssert) checkOffset(offset, 8, this.length)\n  return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n  if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n  if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n  if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n  value = +value\n  offset = offset | 0\n  byteLength = byteLength | 0\n  if (!noAssert) {\n    var maxBytes = Math.pow(2, 8 * byteLength) - 1\n    checkInt(this, value, offset, byteLength, maxBytes, 0)\n  }\n\n  var mul = 1\n  var i = 0\n  this[offset] = value & 0xFF\n  while (++i < byteLength && (mul *= 0x100)) {\n    this[offset + i] = (value / mul) & 0xFF\n  }\n\n  return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n  value = +value\n  offset = offset | 0\n  byteLength = byteLength | 0\n  if (!noAssert) {\n    var maxBytes = Math.pow(2, 8 * byteLength) - 1\n    checkInt(this, value, offset, byteLength, maxBytes, 0)\n  }\n\n  var i = byteLength - 1\n  var mul = 1\n  this[offset + i] = value & 0xFF\n  while (--i >= 0 && (mul *= 0x100)) {\n    this[offset + i] = (value / mul) & 0xFF\n  }\n\n  return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n  value = +value\n  offset = offset | 0\n  if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n  if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n  this[offset] = (value & 0xff)\n  return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n  if (value < 0) value = 0xffff + value + 1\n  for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n    buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n      (littleEndian ? i : 1 - i) * 8\n  }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n  value = +value\n  offset = offset | 0\n  if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n  if (Buffer.TYPED_ARRAY_SUPPORT) {\n    this[offset] = (value & 0xff)\n    this[offset + 1] = (value >>> 8)\n  } else {\n    objectWriteUInt16(this, value, offset, true)\n  }\n  return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n  value = +value\n  offset = offset | 0\n  if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n  if (Buffer.TYPED_ARRAY_SUPPORT) {\n    this[offset] = (value >>> 8)\n    this[offset + 1] = (value & 0xff)\n  } else {\n    objectWriteUInt16(this, value, offset, false)\n  }\n  return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n  if (value < 0) value = 0xffffffff + value + 1\n  for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n    buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n  }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n  value = +value\n  offset = offset | 0\n  if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n  if (Buffer.TYPED_ARRAY_SUPPORT) {\n    this[offset + 3] = (value >>> 24)\n    this[offset + 2] = (value >>> 16)\n    this[offset + 1] = (value >>> 8)\n    this[offset] = (value & 0xff)\n  } else {\n    objectWriteUInt32(this, value, offset, true)\n  }\n  return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n  value = +value\n  offset = offset | 0\n  if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n  if (Buffer.TYPED_ARRAY_SUPPORT) {\n    this[offset] = (value >>> 24)\n    this[offset + 1] = (value >>> 16)\n    this[offset + 2] = (value >>> 8)\n    this[offset + 3] = (value & 0xff)\n  } else {\n    objectWriteUInt32(this, value, offset, false)\n  }\n  return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n  value = +value\n  offset = offset | 0\n  if (!noAssert) {\n    var limit = Math.pow(2, 8 * byteLength - 1)\n\n    checkInt(this, value, offset, byteLength, limit - 1, -limit)\n  }\n\n  var i = 0\n  var mul = 1\n  var sub = 0\n  this[offset] = value & 0xFF\n  while (++i < byteLength && (mul *= 0x100)) {\n    if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n      sub = 1\n    }\n    this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n  }\n\n  return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n  value = +value\n  offset = offset | 0\n  if (!noAssert) {\n    var limit = Math.pow(2, 8 * byteLength - 1)\n\n    checkInt(this, value, offset, byteLength, limit - 1, -limit)\n  }\n\n  var i = byteLength - 1\n  var mul = 1\n  var sub = 0\n  this[offset + i] = value & 0xFF\n  while (--i >= 0 && (mul *= 0x100)) {\n    if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n      sub = 1\n    }\n    this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n  }\n\n  return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n  value = +value\n  offset = offset | 0\n  if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n  if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n  if (value < 0) value = 0xff + value + 1\n  this[offset] = (value & 0xff)\n  return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n  value = +value\n  offset = offset | 0\n  if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n  if (Buffer.TYPED_ARRAY_SUPPORT) {\n    this[offset] = (value & 0xff)\n    this[offset + 1] = (value >>> 8)\n  } else {\n    objectWriteUInt16(this, value, offset, true)\n  }\n  return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n  value = +value\n  offset = offset | 0\n  if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n  if (Buffer.TYPED_ARRAY_SUPPORT) {\n    this[offset] = (value >>> 8)\n    this[offset + 1] = (value & 0xff)\n  } else {\n    objectWriteUInt16(this, value, offset, false)\n  }\n  return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n  value = +value\n  offset = offset | 0\n  if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n  if (Buffer.TYPED_ARRAY_SUPPORT) {\n    this[offset] = (value & 0xff)\n    this[offset + 1] = (value >>> 8)\n    this[offset + 2] = (value >>> 16)\n    this[offset + 3] = (value >>> 24)\n  } else {\n    objectWriteUInt32(this, value, offset, true)\n  }\n  return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n  value = +value\n  offset = offset | 0\n  if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n  if (value < 0) value = 0xffffffff + value + 1\n  if (Buffer.TYPED_ARRAY_SUPPORT) {\n    this[offset] = (value >>> 24)\n    this[offset + 1] = (value >>> 16)\n    this[offset + 2] = (value >>> 8)\n    this[offset + 3] = (value & 0xff)\n  } else {\n    objectWriteUInt32(this, value, offset, false)\n  }\n  return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n  if (offset + ext > buf.length) throw new RangeError('Index out of range')\n  if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n  if (!noAssert) {\n    checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n  }\n  ieee754.write(buf, value, offset, littleEndian, 23, 4)\n  return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n  return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n  return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n  if (!noAssert) {\n    checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n  }\n  ieee754.write(buf, value, offset, littleEndian, 52, 8)\n  return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n  return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n  return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n  if (!start) start = 0\n  if (!end && end !== 0) end = this.length\n  if (targetStart >= target.length) targetStart = target.length\n  if (!targetStart) targetStart = 0\n  if (end > 0 && end < start) end = start\n\n  // Copy 0 bytes; we're done\n  if (end === start) return 0\n  if (target.length === 0 || this.length === 0) return 0\n\n  // Fatal error conditions\n  if (targetStart < 0) {\n    throw new RangeError('targetStart out of bounds')\n  }\n  if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n  if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n  // Are we oob?\n  if (end > this.length) end = this.length\n  if (target.length - targetStart < end - start) {\n    end = target.length - targetStart + start\n  }\n\n  var len = end - start\n  var i\n\n  if (this === target && start < targetStart && targetStart < end) {\n    // descending copy from end\n    for (i = len - 1; i >= 0; --i) {\n      target[i + targetStart] = this[i + start]\n    }\n  } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n    // ascending copy from start\n    for (i = 0; i < len; ++i) {\n      target[i + targetStart] = this[i + start]\n    }\n  } else {\n    Uint8Array.prototype.set.call(\n      target,\n      this.subarray(start, start + len),\n      targetStart\n    )\n  }\n\n  return len\n}\n\n// Usage:\n//    buffer.fill(number[, offset[, end]])\n//    buffer.fill(buffer[, offset[, end]])\n//    buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n  // Handle string cases:\n  if (typeof val === 'string') {\n    if (typeof start === 'string') {\n      encoding = start\n      start = 0\n      end = this.length\n    } else if (typeof end === 'string') {\n      encoding = end\n      end = this.length\n    }\n    if (val.length === 1) {\n      var code = val.charCodeAt(0)\n      if (code < 256) {\n        val = code\n      }\n    }\n    if (encoding !== undefined && typeof encoding !== 'string') {\n      throw new TypeError('encoding must be a string')\n    }\n    if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n      throw new TypeError('Unknown encoding: ' + encoding)\n    }\n  } else if (typeof val === 'number') {\n    val = val & 255\n  }\n\n  // Invalid ranges are not set to a default, so can range check early.\n  if (start < 0 || this.length < start || this.length < end) {\n    throw new RangeError('Out of range index')\n  }\n\n  if (end <= start) {\n    return this\n  }\n\n  start = start >>> 0\n  end = end === undefined ? this.length : end >>> 0\n\n  if (!val) val = 0\n\n  var i\n  if (typeof val === 'number') {\n    for (i = start; i < end; ++i) {\n      this[i] = val\n    }\n  } else {\n    var bytes = Buffer.isBuffer(val)\n      ? val\n      : utf8ToBytes(new Buffer(val, encoding).toString())\n    var len = bytes.length\n    for (i = 0; i < end - start; ++i) {\n      this[i + start] = bytes[i % len]\n    }\n  }\n\n  return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n  // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n  str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n  // Node converts strings with length < 2 to ''\n  if (str.length < 2) return ''\n  // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n  while (str.length % 4 !== 0) {\n    str = str + '='\n  }\n  return str\n}\n\nfunction stringtrim (str) {\n  if (str.trim) return str.trim()\n  return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n  if (n < 16) return '0' + n.toString(16)\n  return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n  units = units || Infinity\n  var codePoint\n  var length = string.length\n  var leadSurrogate = null\n  var bytes = []\n\n  for (var i = 0; i < length; ++i) {\n    codePoint = string.charCodeAt(i)\n\n    // is surrogate component\n    if (codePoint > 0xD7FF && codePoint < 0xE000) {\n      // last char was a lead\n      if (!leadSurrogate) {\n        // no lead yet\n        if (codePoint > 0xDBFF) {\n          // unexpected trail\n          if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n          continue\n        } else if (i + 1 === length) {\n          // unpaired lead\n          if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n          continue\n        }\n\n        // valid lead\n        leadSurrogate = codePoint\n\n        continue\n      }\n\n      // 2 leads in a row\n      if (codePoint < 0xDC00) {\n        if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n        leadSurrogate = codePoint\n        continue\n      }\n\n      // valid surrogate pair\n      codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n    } else if (leadSurrogate) {\n      // valid bmp char, but last char was a lead\n      if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n    }\n\n    leadSurrogate = null\n\n    // encode utf8\n    if (codePoint < 0x80) {\n      if ((units -= 1) < 0) break\n      bytes.push(codePoint)\n    } else if (codePoint < 0x800) {\n      if ((units -= 2) < 0) break\n      bytes.push(\n        codePoint >> 0x6 | 0xC0,\n        codePoint & 0x3F | 0x80\n      )\n    } else if (codePoint < 0x10000) {\n      if ((units -= 3) < 0) break\n      bytes.push(\n        codePoint >> 0xC | 0xE0,\n        codePoint >> 0x6 & 0x3F | 0x80,\n        codePoint & 0x3F | 0x80\n      )\n    } else if (codePoint < 0x110000) {\n      if ((units -= 4) < 0) break\n      bytes.push(\n        codePoint >> 0x12 | 0xF0,\n        codePoint >> 0xC & 0x3F | 0x80,\n        codePoint >> 0x6 & 0x3F | 0x80,\n        codePoint & 0x3F | 0x80\n      )\n    } else {\n      throw new Error('Invalid code point')\n    }\n  }\n\n  return bytes\n}\n\nfunction asciiToBytes (str) {\n  var byteArray = []\n  for (var i = 0; i < str.length; ++i) {\n    // Node's code seems to be doing this and not & 0x7F..\n    byteArray.push(str.charCodeAt(i) & 0xFF)\n  }\n  return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n  var c, hi, lo\n  var byteArray = []\n  for (var i = 0; i < str.length; ++i) {\n    if ((units -= 2) < 0) break\n\n    c = str.charCodeAt(i)\n    hi = c >> 8\n    lo = c % 256\n    byteArray.push(lo)\n    byteArray.push(hi)\n  }\n\n  return byteArray\n}\n\nfunction base64ToBytes (str) {\n  return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n  for (var i = 0; i < length; ++i) {\n    if ((i + offset >= dst.length) || (i >= src.length)) break\n    dst[i + offset] = src[i]\n  }\n  return i\n}\n\nfunction isnan (val) {\n  return val !== val // eslint-disable-line no-self-compare\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/buffer/index.js","'use strict';\n\n// Note: adler32 takes 12% for level 0 and 2% for level 6.\n// It isn't worth it to make additional optimizations as in original.\n// Small size is preferable.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//   claim that you wrote the original software. If you use this software\n//   in a product, an acknowledgment in the product documentation would be\n//   appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n//   misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction adler32(adler, buf, len, pos) {\n  var s1 = (adler & 0xffff) |0,\n      s2 = ((adler >>> 16) & 0xffff) |0,\n      n = 0;\n\n  while (len !== 0) {\n    // Set limit ~ twice less than 5552, to keep\n    // s2 in 31-bits, because we force signed ints.\n    // in other case %= will fail.\n    n = len > 2000 ? 2000 : len;\n    len -= n;\n\n    do {\n      s1 = (s1 + buf[pos++]) |0;\n      s2 = (s2 + s1) |0;\n    } while (--n);\n\n    s1 %= 65521;\n    s2 %= 65521;\n  }\n\n  return (s1 | (s2 << 16)) |0;\n}\n\n\nmodule.exports = adler32;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/pako/lib/zlib/adler32.js","'use strict';\n\n// Note: we can't get significant speed boost here.\n// So write code to minimize size - no pregenerated tables\n// and array tools dependencies.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//   claim that you wrote the original software. If you use this software\n//   in a product, an acknowledgment in the product documentation would be\n//   appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n//   misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// Use ordinary array, since untyped makes no boost here\nfunction makeTable() {\n  var c, table = [];\n\n  for (var n = 0; n < 256; n++) {\n    c = n;\n    for (var k = 0; k < 8; k++) {\n      c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n    }\n    table[n] = c;\n  }\n\n  return table;\n}\n\n// Create table on load. Just 255 signed longs. Not a problem.\nvar crcTable = makeTable();\n\n\nfunction crc32(crc, buf, len, pos) {\n  var t = crcTable,\n      end = pos + len;\n\n  crc ^= -1;\n\n  for (var i = pos; i < end; i++) {\n    crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];\n  }\n\n  return (crc ^ (-1)); // >>> 0;\n}\n\n\nmodule.exports = crc32;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/pako/lib/zlib/crc32.js","// String encode/decode helpers\n'use strict';\n\n\nvar utils = require('./common');\n\n\n// Quick check if we can use fast array to bin string conversion\n//\n// - apply(Array) can fail on Android 2.2\n// - apply(Uint8Array) can fail on iOS 5.1 Safari\n//\nvar STR_APPLY_OK = true;\nvar STR_APPLY_UIA_OK = true;\n\ntry { String.fromCharCode.apply(null, [ 0 ]); } catch (__) { STR_APPLY_OK = false; }\ntry { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; }\n\n\n// Table with utf8 lengths (calculated by first byte of sequence)\n// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,\n// because max possible codepoint is 0x10ffff\nvar _utf8len = new utils.Buf8(256);\nfor (var q = 0; q < 256; q++) {\n  _utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1);\n}\n_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start\n\n\n// convert string to array (typed, when possible)\nexports.string2buf = function (str) {\n  var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;\n\n  // count binary size\n  for (m_pos = 0; m_pos < str_len; m_pos++) {\n    c = str.charCodeAt(m_pos);\n    if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n      c2 = str.charCodeAt(m_pos + 1);\n      if ((c2 & 0xfc00) === 0xdc00) {\n        c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n        m_pos++;\n      }\n    }\n    buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;\n  }\n\n  // allocate buffer\n  buf = new utils.Buf8(buf_len);\n\n  // convert\n  for (i = 0, m_pos = 0; i < buf_len; m_pos++) {\n    c = str.charCodeAt(m_pos);\n    if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n      c2 = str.charCodeAt(m_pos + 1);\n      if ((c2 & 0xfc00) === 0xdc00) {\n        c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n        m_pos++;\n      }\n    }\n    if (c < 0x80) {\n      /* one byte */\n      buf[i++] = c;\n    } else if (c < 0x800) {\n      /* two bytes */\n      buf[i++] = 0xC0 | (c >>> 6);\n      buf[i++] = 0x80 | (c & 0x3f);\n    } else if (c < 0x10000) {\n      /* three bytes */\n      buf[i++] = 0xE0 | (c >>> 12);\n      buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n      buf[i++] = 0x80 | (c & 0x3f);\n    } else {\n      /* four bytes */\n      buf[i++] = 0xf0 | (c >>> 18);\n      buf[i++] = 0x80 | (c >>> 12 & 0x3f);\n      buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n      buf[i++] = 0x80 | (c & 0x3f);\n    }\n  }\n\n  return buf;\n};\n\n// Helper (used in 2 places)\nfunction buf2binstring(buf, len) {\n  // use fallback for big arrays to avoid stack overflow\n  if (len < 65537) {\n    if ((buf.subarray && STR_APPLY_UIA_OK) || (!buf.subarray && STR_APPLY_OK)) {\n      return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len));\n    }\n  }\n\n  var result = '';\n  for (var i = 0; i < len; i++) {\n    result += String.fromCharCode(buf[i]);\n  }\n  return result;\n}\n\n\n// Convert byte array to binary string\nexports.buf2binstring = function (buf) {\n  return buf2binstring(buf, buf.length);\n};\n\n\n// Convert binary string (typed, when possible)\nexports.binstring2buf = function (str) {\n  var buf = new utils.Buf8(str.length);\n  for (var i = 0, len = buf.length; i < len; i++) {\n    buf[i] = str.charCodeAt(i);\n  }\n  return buf;\n};\n\n\n// convert array to string\nexports.buf2string = function (buf, max) {\n  var i, out, c, c_len;\n  var len = max || buf.length;\n\n  // Reserve max possible length (2 words per char)\n  // NB: by unknown reasons, Array is significantly faster for\n  //     String.fromCharCode.apply than Uint16Array.\n  var utf16buf = new Array(len * 2);\n\n  for (out = 0, i = 0; i < len;) {\n    c = buf[i++];\n    // quick process ascii\n    if (c < 0x80) { utf16buf[out++] = c; continue; }\n\n    c_len = _utf8len[c];\n    // skip 5 & 6 byte codes\n    if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; }\n\n    // apply mask on first byte\n    c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;\n    // join the rest\n    while (c_len > 1 && i < len) {\n      c = (c << 6) | (buf[i++] & 0x3f);\n      c_len--;\n    }\n\n    // terminated by end of string?\n    if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }\n\n    if (c < 0x10000) {\n      utf16buf[out++] = c;\n    } else {\n      c -= 0x10000;\n      utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);\n      utf16buf[out++] = 0xdc00 | (c & 0x3ff);\n    }\n  }\n\n  return buf2binstring(utf16buf, out);\n};\n\n\n// Calculate max possible position in utf8 buffer,\n// that will not break sequence. If that's not possible\n// - (very small limits) return max size as is.\n//\n// buf[] - utf8 bytes array\n// max   - length limit (mandatory);\nexports.utf8border = function (buf, max) {\n  var pos;\n\n  max = max || buf.length;\n  if (max > buf.length) { max = buf.length; }\n\n  // go back from last position, until start of sequence found\n  pos = max - 1;\n  while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }\n\n  // Very small and broken sequence,\n  // return max, because we should return something anyway.\n  if (pos < 0) { return max; }\n\n  // If we came to start of buffer - that means buffer is too small,\n  // return max too.\n  if (pos === 0) { return max; }\n\n  return (pos + _utf8len[buf[pos]] > max) ? pos : max;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/pako/lib/utils/strings.js","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//   claim that you wrote the original software. If you use this software\n//   in a product, an acknowledgment in the product documentation would be\n//   appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n//   misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction ZStream() {\n  /* next input byte */\n  this.input = null; // JS specific, because we have no pointers\n  this.next_in = 0;\n  /* number of bytes available at input */\n  this.avail_in = 0;\n  /* total number of input bytes read so far */\n  this.total_in = 0;\n  /* next output byte should be put there */\n  this.output = null; // JS specific, because we have no pointers\n  this.next_out = 0;\n  /* remaining free space at output */\n  this.avail_out = 0;\n  /* total number of bytes output so far */\n  this.total_out = 0;\n  /* last error message, NULL if no error */\n  this.msg = ''/*Z_NULL*/;\n  /* not visible by applications */\n  this.state = null;\n  /* best guess about the data type: binary or text */\n  this.data_type = 2/*Z_UNKNOWN*/;\n  /* adler32 value of the uncompressed data */\n  this.adler = 0;\n}\n\nmodule.exports = ZStream;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/pako/lib/zlib/zstream.js","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//   claim that you wrote the original software. If you use this software\n//   in a product, an acknowledgment in the product documentation would be\n//   appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n//   misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nmodule.exports = {\n\n  /* Allowed flush values; see deflate() and inflate() below for details */\n  Z_NO_FLUSH:         0,\n  Z_PARTIAL_FLUSH:    1,\n  Z_SYNC_FLUSH:       2,\n  Z_FULL_FLUSH:       3,\n  Z_FINISH:           4,\n  Z_BLOCK:            5,\n  Z_TREES:            6,\n\n  /* Return codes for the compression/decompression functions. Negative values\n  * are errors, positive values are used for special but normal events.\n  */\n  Z_OK:               0,\n  Z_STREAM_END:       1,\n  Z_NEED_DICT:        2,\n  Z_ERRNO:           -1,\n  Z_STREAM_ERROR:    -2,\n  Z_DATA_ERROR:      -3,\n  //Z_MEM_ERROR:     -4,\n  Z_BUF_ERROR:       -5,\n  //Z_VERSION_ERROR: -6,\n\n  /* compression levels */\n  Z_NO_COMPRESSION:         0,\n  Z_BEST_SPEED:             1,\n  Z_BEST_COMPRESSION:       9,\n  Z_DEFAULT_COMPRESSION:   -1,\n\n\n  Z_FILTERED:               1,\n  Z_HUFFMAN_ONLY:           2,\n  Z_RLE:                    3,\n  Z_FIXED:                  4,\n  Z_DEFAULT_STRATEGY:       0,\n\n  /* Possible values of the data_type field (though see inflate()) */\n  Z_BINARY:                 0,\n  Z_TEXT:                   1,\n  //Z_ASCII:                1, // = Z_TEXT (deprecated)\n  Z_UNKNOWN:                2,\n\n  /* The deflate compression method */\n  Z_DEFLATED:               8\n  //Z_NULL:                 null // Use -1 or null inline, depending on var type\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/pako/lib/zlib/constants.js","'use strict';\nexports.LOCAL_FILE_HEADER = \"PK\\x03\\x04\";\nexports.CENTRAL_FILE_HEADER = \"PK\\x01\\x02\";\nexports.CENTRAL_DIRECTORY_END = \"PK\\x05\\x06\";\nexports.ZIP64_CENTRAL_DIRECTORY_LOCATOR = \"PK\\x06\\x07\";\nexports.ZIP64_CENTRAL_DIRECTORY_END = \"PK\\x06\\x06\";\nexports.DATA_DESCRIPTOR = \"PK\\x07\\x08\";\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/jszip/lib/signature.js","'use strict';\nexports.base64 = false;\nexports.binary = false;\nexports.dir = false;\nexports.createFolders = false;\nexports.date = null;\nexports.compression = null;\nexports.compressionOptions = null;\nexports.comment = null;\nexports.unixPermissions = null;\nexports.dosPermissions = null;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/jszip/lib/defaults.js","'use strict';\nfunction CompressedObject() {\n    this.compressedSize = 0;\n    this.uncompressedSize = 0;\n    this.crc32 = 0;\n    this.compressionMethod = null;\n    this.compressedContent = null;\n}\n\nCompressedObject.prototype = {\n    /**\n     * Return the decompressed content in an unspecified format.\n     * The format will depend on the decompressor.\n     * @return {Object} the decompressed content.\n     */\n    getContent: function() {\n        return null; // see implementation\n    },\n    /**\n     * Return the compressed content in an unspecified format.\n     * The format will depend on the compressed conten source.\n     * @return {Object} the compressed content.\n     */\n    getCompressedContent: function() {\n        return null; // see implementation\n    }\n};\nmodule.exports = CompressedObject;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/jszip/lib/compressedObject.js","'use strict';\n\nvar utils = require('./utils');\nvar support = require('./support');\nvar nodeBuffer = require('./nodeBuffer');\n\n/**\n * The following functions come from pako, from pako/lib/utils/strings\n * released under the MIT license, see pako https://github.com/nodeca/pako/\n */\n\n// Table with utf8 lengths (calculated by first byte of sequence)\n// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,\n// because max possible codepoint is 0x10ffff\nvar _utf8len = new Array(256);\nfor (var i=0; i<256; i++) {\n  _utf8len[i] = (i >= 252 ? 6 : i >= 248 ? 5 : i >= 240 ? 4 : i >= 224 ? 3 : i >= 192 ? 2 : 1);\n}\n_utf8len[254]=_utf8len[254]=1; // Invalid sequence start\n\n// convert string to array (typed, when possible)\nvar string2buf = function (str) {\n    var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;\n\n    // count binary size\n    for (m_pos = 0; m_pos < str_len; m_pos++) {\n        c = str.charCodeAt(m_pos);\n        if ((c & 0xfc00) === 0xd800 && (m_pos+1 < str_len)) {\n            c2 = str.charCodeAt(m_pos+1);\n            if ((c2 & 0xfc00) === 0xdc00) {\n                c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n                m_pos++;\n            }\n        }\n        buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;\n    }\n\n    // allocate buffer\n    if (support.uint8array) {\n        buf = new Uint8Array(buf_len);\n    } else {\n        buf = new Array(buf_len);\n    }\n\n    // convert\n    for (i=0, m_pos = 0; i < buf_len; m_pos++) {\n        c = str.charCodeAt(m_pos);\n        if ((c & 0xfc00) === 0xd800 && (m_pos+1 < str_len)) {\n            c2 = str.charCodeAt(m_pos+1);\n            if ((c2 & 0xfc00) === 0xdc00) {\n                c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n                m_pos++;\n            }\n        }\n        if (c < 0x80) {\n            /* one byte */\n            buf[i++] = c;\n        } else if (c < 0x800) {\n            /* two bytes */\n            buf[i++] = 0xC0 | (c >>> 6);\n            buf[i++] = 0x80 | (c & 0x3f);\n        } else if (c < 0x10000) {\n            /* three bytes */\n            buf[i++] = 0xE0 | (c >>> 12);\n            buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n            buf[i++] = 0x80 | (c & 0x3f);\n        } else {\n            /* four bytes */\n            buf[i++] = 0xf0 | (c >>> 18);\n            buf[i++] = 0x80 | (c >>> 12 & 0x3f);\n            buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n            buf[i++] = 0x80 | (c & 0x3f);\n        }\n    }\n\n    return buf;\n};\n\n// Calculate max possible position in utf8 buffer,\n// that will not break sequence. If that's not possible\n// - (very small limits) return max size as is.\n//\n// buf[] - utf8 bytes array\n// max   - length limit (mandatory);\nvar utf8border = function(buf, max) {\n    var pos;\n\n    max = max || buf.length;\n    if (max > buf.length) { max = buf.length; }\n\n    // go back from last position, until start of sequence found\n    pos = max-1;\n    while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }\n\n    // Fuckup - very small and broken sequence,\n    // return max, because we should return something anyway.\n    if (pos < 0) { return max; }\n\n    // If we came to start of buffer - that means vuffer is too small,\n    // return max too.\n    if (pos === 0) { return max; }\n\n    return (pos + _utf8len[buf[pos]] > max) ? pos : max;\n};\n\n// convert array to string\nvar buf2string = function (buf) {\n    var str, i, out, c, c_len;\n    var len = buf.length;\n\n    // Reserve max possible length (2 words per char)\n    // NB: by unknown reasons, Array is significantly faster for\n    //     String.fromCharCode.apply than Uint16Array.\n    var utf16buf = new Array(len*2);\n\n    for (out=0, i=0; i<len;) {\n        c = buf[i++];\n        // quick process ascii\n        if (c < 0x80) { utf16buf[out++] = c; continue; }\n\n        c_len = _utf8len[c];\n        // skip 5 & 6 byte codes\n        if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len-1; continue; }\n\n        // apply mask on first byte\n        c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;\n        // join the rest\n        while (c_len > 1 && i < len) {\n            c = (c << 6) | (buf[i++] & 0x3f);\n            c_len--;\n        }\n\n        // terminated by end of string?\n        if (c_len > 1) { utf16buf[out++] = 0xfffd; continue; }\n\n        if (c < 0x10000) {\n            utf16buf[out++] = c;\n        } else {\n            c -= 0x10000;\n            utf16buf[out++] = 0xd800 | ((c >> 10) & 0x3ff);\n            utf16buf[out++] = 0xdc00 | (c & 0x3ff);\n        }\n    }\n\n    // shrinkBuf(utf16buf, out)\n    if (utf16buf.length !== out) {\n        if(utf16buf.subarray) {\n            utf16buf = utf16buf.subarray(0, out);\n        } else {\n            utf16buf.length = out;\n        }\n    }\n\n    // return String.fromCharCode.apply(null, utf16buf);\n    return utils.applyFromCharCode(utf16buf);\n};\n\n\n// That's all for the pako functions.\n\n\n/**\n * Transform a javascript string into an array (typed if possible) of bytes,\n * UTF-8 encoded.\n * @param {String} str the string to encode\n * @return {Array|Uint8Array|Buffer} the UTF-8 encoded string.\n */\nexports.utf8encode = function utf8encode(str) {\n    if (support.nodebuffer) {\n        return nodeBuffer(str, \"utf-8\");\n    }\n\n    return string2buf(str);\n};\n\n\n/**\n * Transform a bytes array (or a representation) representing an UTF-8 encoded\n * string into a javascript string.\n * @param {Array|Uint8Array|Buffer} buf the data de decode\n * @return {String} the decoded string.\n */\nexports.utf8decode = function utf8decode(buf) {\n    if (support.nodebuffer) {\n        return utils.transformTo(\"nodebuffer\", buf).toString(\"utf-8\");\n    }\n\n    buf = utils.transformTo(support.uint8array ? \"uint8array\" : \"array\", buf);\n\n    // return buf2string(buf);\n    // Chrome prefers to work with \"small\" chunks of data\n    // for the method buf2string.\n    // Firefox and Chrome has their own shortcut, IE doesn't seem to really care.\n    var result = [], k = 0, len = buf.length, chunk = 65536;\n    while (k < len) {\n        var nextBoundary = utf8border(buf, Math.min(k + chunk, len));\n        if (support.uint8array) {\n            result.push(buf2string(buf.subarray(k, nextBoundary)));\n        } else {\n            result.push(buf2string(buf.slice(k, nextBoundary)));\n        }\n        k = nextBoundary;\n    }\n    return result.join(\"\");\n\n};\n// vim: set shiftwidth=4 softtabstop=4:\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/jszip/lib/utf8.js","'use strict';\nvar DataReader = require('./dataReader');\nvar utils = require('./utils');\n\nfunction StringReader(data, optimizedBinaryString) {\n    this.data = data;\n    if (!optimizedBinaryString) {\n        this.data = utils.string2binary(this.data);\n    }\n    this.length = this.data.length;\n    this.index = 0;\n    this.zero = 0;\n}\nStringReader.prototype = new DataReader();\n/**\n * @see DataReader.byteAt\n */\nStringReader.prototype.byteAt = function(i) {\n    return this.data.charCodeAt(this.zero + i);\n};\n/**\n * @see DataReader.lastIndexOfSignature\n */\nStringReader.prototype.lastIndexOfSignature = function(sig) {\n    return this.data.lastIndexOf(sig) - this.zero;\n};\n/**\n * @see DataReader.readData\n */\nStringReader.prototype.readData = function(size) {\n    this.checkOffset(size);\n    // this will work because the constructor applied the \"& 0xff\" mask.\n    var result = this.data.slice(this.zero + this.index, this.zero + this.index + size);\n    this.index += size;\n    return result;\n};\nmodule.exports = StringReader;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/jszip/lib/stringReader.js","'use strict';\nvar utils = require('./utils');\n\nfunction DataReader(data) {\n    this.data = null; // type : see implementation\n    this.length = 0;\n    this.index = 0;\n    this.zero = 0;\n}\nDataReader.prototype = {\n    /**\n     * Check that the offset will not go too far.\n     * @param {string} offset the additional offset to check.\n     * @throws {Error} an Error if the offset is out of bounds.\n     */\n    checkOffset: function(offset) {\n        this.checkIndex(this.index + offset);\n    },\n    /**\n     * Check that the specifed index will not be too far.\n     * @param {string} newIndex the index to check.\n     * @throws {Error} an Error if the index is out of bounds.\n     */\n    checkIndex: function(newIndex) {\n        if (this.length < this.zero + newIndex || newIndex < 0) {\n            throw new Error(\"End of data reached (data length = \" + this.length + \", asked index = \" + (newIndex) + \"). Corrupted zip ?\");\n        }\n    },\n    /**\n     * Change the index.\n     * @param {number} newIndex The new index.\n     * @throws {Error} if the new index is out of the data.\n     */\n    setIndex: function(newIndex) {\n        this.checkIndex(newIndex);\n        this.index = newIndex;\n    },\n    /**\n     * Skip the next n bytes.\n     * @param {number} n the number of bytes to skip.\n     * @throws {Error} if the new index is out of the data.\n     */\n    skip: function(n) {\n        this.setIndex(this.index + n);\n    },\n    /**\n     * Get the byte at the specified index.\n     * @param {number} i the index to use.\n     * @return {number} a byte.\n     */\n    byteAt: function(i) {\n        // see implementations\n    },\n    /**\n     * Get the next number with a given byte size.\n     * @param {number} size the number of bytes to read.\n     * @return {number} the corresponding number.\n     */\n    readInt: function(size) {\n        var result = 0,\n            i;\n        this.checkOffset(size);\n        for (i = this.index + size - 1; i >= this.index; i--) {\n            result = (result << 8) + this.byteAt(i);\n        }\n        this.index += size;\n        return result;\n    },\n    /**\n     * Get the next string with a given byte size.\n     * @param {number} size the number of bytes to read.\n     * @return {string} the corresponding string.\n     */\n    readString: function(size) {\n        return utils.transformTo(\"string\", this.readData(size));\n    },\n    /**\n     * Get raw data without conversion, <size> bytes.\n     * @param {number} size the number of bytes to read.\n     * @return {Object} the raw data, implementation specific.\n     */\n    readData: function(size) {\n        // see implementations\n    },\n    /**\n     * Find the last occurence of a zip signature (4 bytes).\n     * @param {string} sig the signature to find.\n     * @return {number} the index of the last occurence, -1 if not found.\n     */\n    lastIndexOfSignature: function(sig) {\n        // see implementations\n    },\n    /**\n     * Get the next date.\n     * @return {Date} the date.\n     */\n    readDate: function() {\n        var dostime = this.readInt(4);\n        return new Date(\n        ((dostime >> 25) & 0x7f) + 1980, // year\n        ((dostime >> 21) & 0x0f) - 1, // month\n        (dostime >> 16) & 0x1f, // day\n        (dostime >> 11) & 0x1f, // hour\n        (dostime >> 5) & 0x3f, // minute\n        (dostime & 0x1f) << 1); // second\n    }\n};\nmodule.exports = DataReader;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/jszip/lib/dataReader.js","'use strict';\nvar ArrayReader = require('./arrayReader');\n\nfunction Uint8ArrayReader(data) {\n    if (data) {\n        this.data = data;\n        this.length = this.data.length;\n        this.index = 0;\n        this.zero = 0;\n    }\n}\nUint8ArrayReader.prototype = new ArrayReader();\n/**\n * @see DataReader.readData\n */\nUint8ArrayReader.prototype.readData = function(size) {\n    this.checkOffset(size);\n    if(size === 0) {\n        // in IE10, when using subarray(idx, idx), we get the array [0x00] instead of [].\n        return new Uint8Array(0);\n    }\n    var result = this.data.subarray(this.zero + this.index, this.zero + this.index + size);\n    this.index += size;\n    return result;\n};\nmodule.exports = Uint8ArrayReader;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/jszip/lib/uint8ArrayReader.js","'use strict';\nvar DataReader = require('./dataReader');\n\nfunction ArrayReader(data) {\n    if (data) {\n        this.data = data;\n        this.length = this.data.length;\n        this.index = 0;\n        this.zero = 0;\n\n        for(var i = 0; i < this.data.length; i++) {\n            data[i] = data[i] & 0xFF;\n        }\n    }\n}\nArrayReader.prototype = new DataReader();\n/**\n * @see DataReader.byteAt\n */\nArrayReader.prototype.byteAt = function(i) {\n    return this.data[this.zero + i];\n};\n/**\n * @see DataReader.lastIndexOfSignature\n */\nArrayReader.prototype.lastIndexOfSignature = function(sig) {\n    var sig0 = sig.charCodeAt(0),\n        sig1 = sig.charCodeAt(1),\n        sig2 = sig.charCodeAt(2),\n        sig3 = sig.charCodeAt(3);\n    for (var i = this.length - 4; i >= 0; --i) {\n        if (this.data[i] === sig0 && this.data[i + 1] === sig1 && this.data[i + 2] === sig2 && this.data[i + 3] === sig3) {\n            return i - this.zero;\n        }\n    }\n\n    return -1;\n};\n/**\n * @see DataReader.readData\n */\nArrayReader.prototype.readData = function(size) {\n    this.checkOffset(size);\n    if(size === 0) {\n        return [];\n    }\n    var result = this.data.slice(this.zero + this.index, this.zero + this.index + size);\n    this.index += size;\n    return result;\n};\nmodule.exports = ArrayReader;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/jszip/lib/arrayReader.js","/* eslint-disable camelcase */\nexport default {\n    cdcl3: {\n        tms: [\n            {\n                proton: 'X',\n                coupling: 0,\n                multiplicity: '',\n                shift: 0\n            }\n        ],\n        solvent_residual_peak: [\n            {\n                proton: 'X',\n                coupling: 0,\n                multiplicity: 'ds',\n                shift: 7.26\n            }\n        ],\n        h2o: [\n            {\n                proton: 'H2O',\n                coupling: 0,\n                multiplicity: 'bs',\n                shift: 1.56\n            }\n        ],\n        acetic_acid: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.1\n            }\n        ],\n        acetone: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.17\n            }\n        ],\n        acetonitrile: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.1\n            }\n        ],\n        benzene: [\n            {\n                proton: 'CH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 7.36\n            }\n        ],\n        'tert-butyl_alcohol': [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.28\n            }\n        ],\n        'tert-butyl_methyl_ether': [\n            {\n                proton: 'CCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.19\n            },\n            {\n                proton: 'OCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.22\n            }\n        ],\n        bhtb: [\n            {\n                proton: 'ArH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 6.98\n            },\n            {\n                proton: 'OHc',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 5.01\n            },\n            {\n                proton: 'ArCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.27\n            },\n            {\n                proton: 'ArC(CH3)3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.43\n            }\n        ],\n        chloroform: [\n            {\n                proton: 'CH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 7.26\n            }\n        ],\n        cyclohexane: [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.43\n            }\n        ],\n        '1,2-dichloroethane': [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.73\n            }\n        ],\n        dichloromethane: [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 5.3\n            }\n        ],\n        diethyl_ether: [\n            {\n                proton: 'CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 1.21\n            },\n            {\n                proton: 'CH2',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 3.48\n            }\n        ],\n        diglyme: [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 3.65\n            },\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 3.57\n            },\n            {\n                proton: 'OCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.39\n            }\n        ],\n        '1,2-dimethoxyethane': [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.4\n            },\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.55\n            }\n        ],\n        dimethylacetamide: [\n            {\n                proton: 'CH3CO',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.09\n            },\n            {\n                proton: 'NCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.02\n            },\n            {\n                proton: 'NCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.94\n            }\n        ],\n        dimethylformamide: [\n            {\n                proton: 'CH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 8.02\n            },\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.96\n            },\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.88\n            }\n        ],\n        dimethyl_sulfoxide: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.62\n            }\n        ],\n        dioxane: [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.71\n            }\n        ],\n        ethanol: [\n            {\n                proton: 'CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 1.25\n            },\n            {\n                proton: 'CH2',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 3.72\n            },\n            {\n                proton: 'OH',\n                coupling: 5,\n                multiplicity: 's,t',\n                shift: 1.32\n            }\n        ],\n        ethyl_acetate: [\n            {\n                proton: 'CH3CO',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.05\n            },\n            {\n                proton: 'CH2CH3',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 4.12\n            },\n            {\n                proton: 'CH2CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 1.26\n            }\n        ],\n        ethyl_methyl_ketone: [\n            {\n                proton: 'CH3CO',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.14\n            },\n            {\n                proton: 'CH2CH3',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 2.46\n            },\n            {\n                proton: 'CH2CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 1.06\n            }\n        ],\n        ethylene_glycol: [\n            {\n                proton: 'CH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.76\n            }\n        ],\n        'grease^f': [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 0.86\n            },\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'br_s',\n                shift: 1.26\n            }\n        ],\n        'n-hexane': [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 't',\n                shift: 0.88\n            },\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 1.26\n            }\n        ],\n        hmpag: [\n            {\n                proton: 'CH3',\n                coupling: 9.5,\n                multiplicity: 'd',\n                shift: 2.65\n            }\n        ],\n        methanol: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.49\n            },\n            {\n                proton: 'OH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.09\n            }\n        ],\n        nitromethane: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 4.33\n            }\n        ],\n        'n-pentane': [\n            {\n                proton: 'CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 7\n            },\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 1.27\n            }\n        ],\n        '2-propanol': [\n            {\n                proton: 'CH3',\n                coupling: 6,\n                multiplicity: 'd',\n                shift: 1.22\n            },\n            {\n                proton: 'CH',\n                coupling: 6,\n                multiplicity: 'sep',\n                shift: 4.04\n            }\n        ],\n        pyridine: [\n            {\n                proton: 'CH(2)',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 8.62\n            },\n            {\n                proton: 'CH(3)',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 7.29\n            },\n            {\n                proton: 'CH(4)',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 7.68\n            }\n        ],\n        silicone_greasei: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 0.07\n            }\n        ],\n        tetrahydrofuran: [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 1.85\n            },\n            {\n                proton: 'CH2O',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 3.76\n            }\n        ],\n        toluene: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.36\n            },\n            {\n                proton: 'CH(o/p)',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 7.17\n            },\n            {\n                proton: 'CH(m)',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 7.25\n            }\n        ],\n        triethylamine: [\n            {\n                proton: 'CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 1.03\n            },\n            {\n                proton: 'CH2',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 2.53\n            }\n        ]\n    },\n    '(cd3)2co': {\n        tms: [\n            {\n                proton: 'X',\n                coupling: 0,\n                multiplicity: '',\n                shift: 0\n            }\n        ],\n        solvent_residual_peak: [\n            {\n                proton: 'X',\n                coupling: 0,\n                multiplicity: '',\n                shift: 2.05\n            }\n        ],\n        h2o: [\n            {\n                proton: 'H2O',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.84\n            }\n        ],\n        acetic_acid: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.96\n            }\n        ],\n        acetone: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.09\n            }\n        ],\n        acetonitrile: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.05\n            }\n        ],\n        benzene: [\n            {\n                proton: 'CH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 7.36\n            }\n        ],\n        'tert-butyl_alcohol': [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.18\n            }\n        ],\n        'tert-butyl_methyl_ether': [\n            {\n                proton: 'CCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.13\n            },\n            {\n                proton: 'OCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.13\n            }\n        ],\n        bhtb: [\n            {\n                proton: 'ArH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 6.96\n            },\n            {\n                proton: 'ArCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.22\n            },\n            {\n                proton: 'ArC(CH3)3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.41\n            }\n        ],\n        chloroform: [\n            {\n                proton: 'CH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 8.02\n            }\n        ],\n        cyclohexane: [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.43\n            }\n        ],\n        '1,2-dichloroethane': [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.87\n            }\n        ],\n        dichloromethane: [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 5.63\n            }\n        ],\n        diethyl_ether: [\n            {\n                proton: 'CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 1.11\n            },\n            {\n                proton: 'CH2',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 3.41\n            }\n        ],\n        diglyme: [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 3.56\n            },\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 3.47\n            },\n            {\n                proton: 'OCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.28\n            }\n        ],\n        '1,2-dimethoxyethane': [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.28\n            },\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.46\n            }\n        ],\n        dimethylacetamide: [\n            {\n                proton: 'CH3CO',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.97\n            },\n            {\n                proton: 'NCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3\n            },\n            {\n                proton: 'NCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.83\n            }\n        ],\n        dimethylformamide: [\n            {\n                proton: 'CH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 7.96\n            },\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.94\n            },\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.78\n            }\n        ],\n        dimethyl_sulfoxide: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.52\n            }\n        ],\n        dioxane: [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.59\n            }\n        ],\n        ethanol: [\n            {\n                proton: 'CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 1.12\n            },\n            {\n                proton: 'CH2',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 3.57\n            },\n            {\n                proton: 'OH',\n                coupling: 5,\n                multiplicity: 's,t',\n                shift: 3.39\n            }\n        ],\n        ethyl_acetate: [\n            {\n                proton: 'CH3CO',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.97\n            },\n            {\n                proton: 'CH2CH3',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 4.05\n            },\n            {\n                proton: 'CH2CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 1.2\n            }\n        ],\n        ethyl_methyl_ketone: [\n            {\n                proton: 'CH3CO',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.07\n            },\n            {\n                proton: 'CH2CH3',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 2.45\n            },\n            {\n                proton: 'CH2CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 0.96\n            }\n        ],\n        ethylene_glycol: [\n            {\n                proton: 'CH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.28\n            }\n        ],\n        'grease^f': [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 0.87\n            },\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'br_s',\n                shift: 1.29\n            }\n        ],\n        'n-hexane': [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 't',\n                shift: 0.88\n            },\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 1.28\n            }\n        ],\n        hmpag: [\n            {\n                proton: 'CH3',\n                coupling: 9.5,\n                multiplicity: 'd',\n                shift: 2.59\n            }\n        ],\n        methanol: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.31\n            },\n            {\n                proton: 'OH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.12\n            }\n        ],\n        nitromethane: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 4.43\n            }\n        ],\n        'n-pentane': [\n            {\n                proton: 'CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 0.88\n            },\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 1.27\n            }\n        ],\n        '2-propanol': [\n            {\n                proton: 'CH3',\n                coupling: 6,\n                multiplicity: 'd',\n                shift: 1.1\n            },\n            {\n                proton: 'CH',\n                coupling: 6,\n                multiplicity: 'sep',\n                shift: 3.9\n            }\n        ],\n        pyridine: [\n            {\n                proton: 'CH(2)',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 8.58\n            },\n            {\n                proton: 'CH(3)',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 7.35\n            },\n            {\n                proton: 'CH(4)',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 7.76\n            }\n        ],\n        silicone_greasei: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 0.13\n            }\n        ],\n        tetrahydrofuran: [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 1.79\n            },\n            {\n                proton: 'CH2O',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 3.63\n            }\n        ],\n        toluene: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.32\n            },\n            {\n                proton: 'CH(o/p)',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 7.5\n            },\n            {\n                proton: 'CH(m)',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 7.5\n            }\n        ],\n        triethylamine: [\n            {\n                proton: 'CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 0.96\n            },\n            {\n                proton: 'CH2',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 2.45\n            }\n        ]\n    },\n    dmso: {\n        tms: [\n            {\n                proton: 'X',\n                coupling: 0,\n                multiplicity: '',\n                shift: 0\n            }\n        ],\n        solvent_residual_peak: [\n            {\n                proton: 'X',\n                coupling: 0,\n                multiplicity: 'quint',\n                shift: 2.5\n            }\n        ],\n        h2o: [\n            {\n                proton: 'H2O',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.33\n            }\n        ],\n        acetic_acid: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.91\n            }\n        ],\n        acetone: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.09\n            }\n        ],\n        acetonitrile: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.07\n            }\n        ],\n        benzene: [\n            {\n                proton: 'CH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 7.37\n            }\n        ],\n        'tert-butyl_alcohol': [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.11\n            },\n            {\n                proton: 'OHc',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 4.19\n            }\n        ],\n        'tert-butyl_methyl_ether': [\n            {\n                proton: 'CCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.11\n            },\n            {\n                proton: 'OCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.08\n            }\n        ],\n        bhtb: [\n            {\n                proton: 'ArH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 6.87\n            },\n            {\n                proton: 'OHc',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 6.65\n            },\n            {\n                proton: 'ArCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.18\n            },\n            {\n                proton: 'ArC(CH3)3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.36\n            }\n        ],\n        chloroform: [\n            {\n                proton: 'CH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 8.32\n            }\n        ],\n        cyclohexane: [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.4\n            }\n        ],\n        '1,2-dichloroethane': [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.9\n            }\n        ],\n        dichloromethane: [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 5.76\n            }\n        ],\n        diethyl_ether: [\n            {\n                proton: 'CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 1.09\n            },\n            {\n                proton: 'CH2',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 3.38\n            }\n        ],\n        diglyme: [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 3.51\n            },\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 3.38\n            },\n            {\n                proton: 'OCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.24\n            }\n        ],\n        '1,2-dimethoxyethane': [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.24\n            },\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.43\n            }\n        ],\n        dimethylacetamide: [\n            {\n                proton: 'CH3CO',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.96\n            },\n            {\n                proton: 'NCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.94\n            },\n            {\n                proton: 'NCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.78\n            }\n        ],\n        dimethylformamide: [\n            {\n                proton: 'CH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 7.95\n            },\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.89\n            },\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.73\n            }\n        ],\n        dimethyl_sulfoxide: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.54\n            }\n        ],\n        dioxane: [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.57\n            }\n        ],\n        ethanol: [\n            {\n                proton: 'CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 1.06\n            },\n            {\n                proton: 'CH2',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 3.44\n            },\n            {\n                proton: 'OH',\n                coupling: 5,\n                multiplicity: 's,t',\n                shift: 4.63\n            }\n        ],\n        ethyl_acetate: [\n            {\n                proton: 'CH3CO',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.99\n            },\n            {\n                proton: 'CH2CH3',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 4.03\n            },\n            {\n                proton: 'CH2CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 1.17\n            }\n        ],\n        ethyl_methyl_ketone: [\n            {\n                proton: 'CH3CO',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.07\n            },\n            {\n                proton: 'CH2CH3',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 2.43\n            },\n            {\n                proton: 'CH2CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 0.91\n            }\n        ],\n        ethylene_glycol: [\n            {\n                proton: 'CH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.34\n            }\n        ],\n        'grease^f': [],\n        'n-hexane': [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 't',\n                shift: 0.86\n            },\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 1.25\n            }\n        ],\n        hmpag: [\n            {\n                proton: 'CH3',\n                coupling: 9.5,\n                multiplicity: 'd',\n                shift: 2.53\n            }\n        ],\n        methanol: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.16\n            },\n            {\n                proton: 'OH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 4.01\n            }\n        ],\n        nitromethane: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 4.42\n            }\n        ],\n        'n-pentane': [\n            {\n                proton: 'CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 0.88\n            },\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 1.27\n            }\n        ],\n        '2-propanol': [\n            {\n                proton: 'CH3',\n                coupling: 6,\n                multiplicity: 'd',\n                shift: 1.04\n            },\n            {\n                proton: 'CH',\n                coupling: 6,\n                multiplicity: 'sep',\n                shift: 3.78\n            }\n        ],\n        pyridine: [\n            {\n                proton: 'CH(2)',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 8.58\n            },\n            {\n                proton: 'CH(3)',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 7.39\n            },\n            {\n                proton: 'CH(4)',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 7.79\n            }\n        ],\n        silicone_greasei: [],\n        tetrahydrofuran: [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 1.76\n            },\n            {\n                proton: 'CH2O',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 3.6\n            }\n        ],\n        toluene: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.3\n            },\n            {\n                proton: 'CH(o/p)',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 7.18\n            },\n            {\n                proton: 'CH(m)',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 7.25\n            }\n        ],\n        triethylamine: [\n            {\n                proton: 'CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 0.93\n            },\n            {\n                proton: 'CH2',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 2.43\n            }\n        ]\n    },\n    c6d6: {\n        tms: [\n            {\n                proton: 'X',\n                coupling: 0,\n                multiplicity: '',\n                shift: 0\n            }\n        ],\n        solvent_residual_peak: [\n            {\n                proton: 'X',\n                coupling: 0,\n                multiplicity: '',\n                shift: 7.16\n            }\n        ],\n        h2o: [\n            {\n                proton: 'H2O',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 0.4\n            }\n        ],\n        acetic_acid: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.55\n            }\n        ],\n        acetone: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.55\n            }\n        ],\n        acetonitrile: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.55\n            }\n        ],\n        benzene: [\n            {\n                proton: 'CH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 7.15\n            }\n        ],\n        'tert-butyl_alcohol': [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.05\n            },\n            {\n                proton: 'OHc',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.55\n            }\n        ],\n        'tert-butyl_methyl_ether': [\n            {\n                proton: 'CCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.07\n            },\n            {\n                proton: 'OCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.04\n            }\n        ],\n        bhtb: [\n            {\n                proton: 'ArH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 7.05\n            },\n            {\n                proton: 'OHc',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 4.79\n            },\n            {\n                proton: 'ArCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.24\n            },\n            {\n                proton: 'ArC(CH3)3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.38\n            }\n        ],\n        chloroform: [\n            {\n                proton: 'CH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 6.15\n            }\n        ],\n        cyclohexane: [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.4\n            }\n        ],\n        '1,2-dichloroethane': [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.9\n            }\n        ],\n        dichloromethane: [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 4.27\n            }\n        ],\n        diethyl_ether: [\n            {\n                proton: 'CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 1.11\n            },\n            {\n                proton: 'CH2',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 3.26\n            }\n        ],\n        diglyme: [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 3.46\n            },\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 3.34\n            },\n            {\n                proton: 'OCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.11\n            }\n        ],\n        '1,2-dimethoxyethane': [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.12\n            },\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.33\n            }\n        ],\n        dimethylacetamide: [\n            {\n                proton: 'CH3CO',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.6\n            },\n            {\n                proton: 'NCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.57\n            },\n            {\n                proton: 'NCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.05\n            }\n        ],\n        dimethylformamide: [\n            {\n                proton: 'CH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 7.63\n            },\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.36\n            },\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.86\n            }\n        ],\n        dimethyl_sulfoxide: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.68\n            }\n        ],\n        dioxane: [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.35\n            }\n        ],\n        ethanol: [\n            {\n                proton: 'CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 0.96\n            },\n            {\n                proton: 'CH2',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 3.34\n            }\n        ],\n        ethyl_acetate: [\n            {\n                proton: 'CH3CO',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.65\n            },\n            {\n                proton: 'CH2CH3',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 3.89\n            },\n            {\n                proton: 'CH2CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 0.92\n            }\n        ],\n        ethyl_methyl_ketone: [\n            {\n                proton: 'CH3CO',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.58\n            },\n            {\n                proton: 'CH2CH3',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 1.81\n            },\n            {\n                proton: 'CH2CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 0.85\n            }\n        ],\n        ethylene_glycol: [\n            {\n                proton: 'CH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.41\n            }\n        ],\n        'grease^f': [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 0.92\n            },\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'br_s',\n                shift: 1.36\n            }\n        ],\n        'n-hexane': [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 't',\n                shift: 0.89\n            },\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 1.24\n            }\n        ],\n        hmpag: [\n            {\n                proton: 'CH3',\n                coupling: 9.5,\n                multiplicity: 'd',\n                shift: 2.4\n            }\n        ],\n        methanol: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.07\n            }\n        ],\n        nitromethane: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.94\n            }\n        ],\n        'n-pentane': [\n            {\n                proton: 'CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 0.86\n            },\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 1.23\n            }\n        ],\n        '2-propanol': [\n            {\n                proton: 'CH3',\n                coupling: 6,\n                multiplicity: 'd',\n                shift: 0.95\n            },\n            {\n                proton: 'CH',\n                coupling: 6,\n                multiplicity: 'sep',\n                shift: 3.67\n            }\n        ],\n        pyridine: [\n            {\n                proton: 'CH(2)',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 8.53\n            },\n            {\n                proton: 'CH(3)',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 6.66\n            },\n            {\n                proton: 'CH(4)',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 6.98\n            }\n        ],\n        silicone_greasei: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 0.29\n            }\n        ],\n        tetrahydrofuran: [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 1.4\n            },\n            {\n                proton: 'CH2O',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 3.57\n            }\n        ],\n        toluene: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.11\n            },\n            {\n                proton: 'CH(o/p)',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 7.02\n            },\n            {\n                proton: 'CH(m)',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 7.13\n            }\n        ],\n        triethylamine: [\n            {\n                proton: 'CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 0.96\n            },\n            {\n                proton: 'CH2',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 2.4\n            }\n        ]\n    },\n    cd3cn: {\n        tms: [\n            {\n                proton: 'X',\n                coupling: 0,\n                multiplicity: '',\n                shift: 0\n            }\n        ],\n        solvent_residual_peak: [\n            {\n                proton: 'X',\n                coupling: 0,\n                multiplicity: '',\n                shift: 1.94\n            }\n        ],\n        h2o: [\n            {\n                proton: 'H2O',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.13\n            }\n        ],\n        acetic_acid: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.96\n            }\n        ],\n        acetone: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.08\n            }\n        ],\n        acetonitrile: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.96\n            }\n        ],\n        benzene: [\n            {\n                proton: 'CH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 7.37\n            }\n        ],\n        'tert-butyl_alcohol': [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.16\n            },\n            {\n                proton: 'OHc',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.18\n            }\n        ],\n        'tert-butyl_methyl_ether': [\n            {\n                proton: 'CCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.14\n            },\n            {\n                proton: 'OCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.13\n            }\n        ],\n        bhtb: [\n            {\n                proton: 'ArH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 6.97\n            },\n            {\n                proton: 'OHc',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 5.2\n            },\n            {\n                proton: 'ArCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.22\n            },\n            {\n                proton: 'ArC(CH3)3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.39\n            }\n        ],\n        chloroform: [\n            {\n                proton: 'CH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 7.58\n            }\n        ],\n        cyclohexane: [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.44\n            }\n        ],\n        '1,2-dichloroethane': [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.81\n            }\n        ],\n        dichloromethane: [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 5.44\n            }\n        ],\n        diethyl_ether: [\n            {\n                proton: 'CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 1.12\n            },\n            {\n                proton: 'CH2',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 3.42\n            }\n        ],\n        diglyme: [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 3.53\n            },\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 3.45\n            },\n            {\n                proton: 'OCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.29\n            }\n        ],\n        '1,2-dimethoxyethane': [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.28\n            },\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.45\n            }\n        ],\n        dimethylacetamide: [\n            {\n                proton: 'CH3CO',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.97\n            },\n            {\n                proton: 'NCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.96\n            },\n            {\n                proton: 'NCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.83\n            }\n        ],\n        dimethylformamide: [\n            {\n                proton: 'CH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 7.92\n            },\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.89\n            },\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.77\n            }\n        ],\n        dimethyl_sulfoxide: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.5\n            }\n        ],\n        dioxane: [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.6\n            }\n        ],\n        ethanol: [\n            {\n                proton: 'CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 1.12\n            },\n            {\n                proton: 'CH2',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 3.54\n            },\n            {\n                proton: 'OH',\n                coupling: 5,\n                multiplicity: 's,t',\n                shift: 2.47\n            }\n        ],\n        ethyl_acetate: [\n            {\n                proton: 'CH3CO',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.97\n            },\n            {\n                proton: 'CH2CH3',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 4.06\n            },\n            {\n                proton: 'CH2CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 1.2\n            }\n        ],\n        ethyl_methyl_ketone: [\n            {\n                proton: 'CH3CO',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.06\n            },\n            {\n                proton: 'CH2CH3',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 2.43\n            },\n            {\n                proton: 'CH2CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 0.96\n            }\n        ],\n        ethylene_glycol: [\n            {\n                proton: 'CH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.51\n            }\n        ],\n        'grease^f': [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 0.86\n            },\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'br_s',\n                shift: 1.27\n            }\n        ],\n        'n-hexane': [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 't',\n                shift: 0.89\n            },\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 1.28\n            }\n        ],\n        hmpag: [\n            {\n                proton: 'CH3',\n                coupling: 9.5,\n                multiplicity: 'd',\n                shift: 2.57\n            }\n        ],\n        methanol: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.28\n            },\n            {\n                proton: 'OH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.16\n            }\n        ],\n        nitromethane: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 4.31\n            }\n        ],\n        'n-pentane': [\n            {\n                proton: 'CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 0.87\n            },\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 1.29\n            }\n        ],\n        '2-propanol': [\n            {\n                proton: 'CH3',\n                coupling: 6,\n                multiplicity: 'd',\n                shift: 1.09\n            },\n            {\n                proton: 'CH',\n                coupling: 6,\n                multiplicity: 'sep',\n                shift: 3.87\n            }\n        ],\n        pyridine: [\n            {\n                proton: 'CH(2)',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 8.57\n            },\n            {\n                proton: 'CH(3)',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 7.33\n            },\n            {\n                proton: 'CH(4)',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 7.73\n            }\n        ],\n        silicone_greasei: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 0.08\n            }\n        ],\n        tetrahydrofuran: [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 1.8\n            },\n            {\n                proton: 'CH2O',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 3.64\n            }\n        ],\n        toluene: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.33\n            },\n            {\n                proton: 'CH(o/p)',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 7.2\n            },\n            {\n                proton: 'CH(m)',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 7.2\n            }\n        ],\n        triethylamine: [\n            {\n                proton: 'CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 0.96\n            },\n            {\n                proton: 'CH2',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 2.45\n            }\n        ]\n    },\n    cd3od: {\n        tms: [\n            {\n                proton: 'X',\n                coupling: 0,\n                multiplicity: '',\n                shift: 0\n            }\n        ],\n        solvent_residual_peak: [\n            {\n                proton: 'X',\n                coupling: 0,\n                multiplicity: '',\n                shift: 3.31\n            }\n        ],\n        h2o: [\n            {\n                proton: 'H2O',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 4.87\n            }\n        ],\n        acetic_acid: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.99\n            }\n        ],\n        acetone: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.15\n            }\n        ],\n        acetonitrile: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.03\n            }\n        ],\n        benzene: [\n            {\n                proton: 'CH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 7.33\n            }\n        ],\n        'tert-butyl_alcohol': [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.4\n            }\n        ],\n        'tert-butyl_methyl_ether': [\n            {\n                proton: 'CCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.15\n            },\n            {\n                proton: 'OCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.2\n            }\n        ],\n        bhtb: [\n            {\n                proton: 'ArH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 6.92\n            },\n            {\n                proton: 'ArCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.21\n            },\n            {\n                proton: 'ArC(CH3)3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.4\n            }\n        ],\n        chloroform: [\n            {\n                proton: 'CH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 7.9\n            }\n        ],\n        cyclohexane: [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.45\n            }\n        ],\n        '1,2-dichloroethane': [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.78\n            }\n        ],\n        dichloromethane: [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 5.49\n            }\n        ],\n        diethyl_ether: [\n            {\n                proton: 'CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 1.18\n            },\n            {\n                proton: 'CH2',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 3.49\n            }\n        ],\n        diglyme: [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 3.61\n            },\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 3.58\n            },\n            {\n                proton: 'OCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.35\n            }\n        ],\n        '1,2-dimethoxyethane': [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.35\n            },\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.52\n            }\n        ],\n        dimethylacetamide: [\n            {\n                proton: 'CH3CO',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.07\n            },\n            {\n                proton: 'NCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.31\n            },\n            {\n                proton: 'NCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.92\n            }\n        ],\n        dimethylformamide: [\n            {\n                proton: 'CH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 7.97\n            },\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.99\n            },\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.86\n            }\n        ],\n        dimethyl_sulfoxide: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.65\n            }\n        ],\n        dioxane: [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.66\n            }\n        ],\n        ethanol: [\n            {\n                proton: 'CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 1.19\n            },\n            {\n                proton: 'CH2',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 3.6\n            }\n        ],\n        ethyl_acetate: [\n            {\n                proton: 'CH3CO',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.01\n            },\n            {\n                proton: 'CH2CH3',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 4.09\n            },\n            {\n                proton: 'CH2CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 1.24\n            }\n        ],\n        ethyl_methyl_ketone: [\n            {\n                proton: 'CH3CO',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.12\n            },\n            {\n                proton: 'CH2CH3',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 2.5\n            },\n            {\n                proton: 'CH2CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 1.01\n            }\n        ],\n        ethylene_glycol: [\n            {\n                proton: 'CH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.59\n            }\n        ],\n        'grease^f': [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 0.88\n            },\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'br_s',\n                shift: 1.29\n            }\n        ],\n        'n-hexane': [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 't',\n                shift: 0.9\n            },\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 1.29\n            }\n        ],\n        hmpag: [\n            {\n                proton: 'CH3',\n                coupling: 9.5,\n                multiplicity: 'd',\n                shift: 2.64\n            }\n        ],\n        methanol: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.34\n            }\n        ],\n        nitromethane: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 4.34\n            }\n        ],\n        'n-pentane': [\n            {\n                proton: 'CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 0.89\n            },\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 1.29\n            }\n        ],\n        '2-propanol': [\n            {\n                proton: 'CH3',\n                coupling: 6,\n                multiplicity: 'd',\n                shift: 1.5\n            },\n            {\n                proton: 'CH',\n                coupling: 6,\n                multiplicity: 'sep',\n                shift: 3.92\n            }\n        ],\n        pyridine: [\n            {\n                proton: 'CH(2)',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 8.53\n            },\n            {\n                proton: 'CH(3)',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 7.44\n            },\n            {\n                proton: 'CH(4)',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 7.85\n            }\n        ],\n        silicone_greasei: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 0.1\n            }\n        ],\n        tetrahydrofuran: [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 1.87\n            },\n            {\n                proton: 'CH2O',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 3.71\n            }\n        ],\n        toluene: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.32\n            },\n            {\n                proton: 'CH(o/p)',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 7.16\n            },\n            {\n                proton: 'CH(m)',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 7.16\n            }\n        ],\n        triethylamine: [\n            {\n                proton: 'CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 1.05\n            },\n            {\n                proton: 'CH2',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 2.58\n            }\n        ]\n    },\n    d2o: {\n        tms: [\n            {\n                proton: 'X',\n                coupling: 0,\n                multiplicity: '',\n                shift: 0\n            }\n        ],\n        solvent_residual_peak: [\n            {\n                proton: 'X',\n                coupling: 0,\n                multiplicity: '',\n                shift: 4.79\n            }\n        ],\n        h2o: [],\n        acetic_acid: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.08\n            }\n        ],\n        acetone: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.22\n            }\n        ],\n        acetonitrile: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.06\n            }\n        ],\n        benzene: [],\n        'tert-butyl_alcohol': [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.24\n            }\n        ],\n        'tert-butyl_methyl_ether': [\n            {\n                proton: 'CCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 1.21\n            },\n            {\n                proton: 'OCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.22\n            }\n        ],\n        bhtb: [],\n        chloroform: [],\n        cyclohexane: [],\n        '1,2-dichloroethane': [],\n        dichloromethane: [],\n        diethyl_ether: [\n            {\n                proton: 'CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 1.17\n            },\n            {\n                proton: 'CH2',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 3.56\n            }\n        ],\n        diglyme: [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 3.67\n            },\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 3.61\n            },\n            {\n                proton: 'OCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.37\n            }\n        ],\n        '1,2-dimethoxyethane': [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.37\n            },\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.6\n            }\n        ],\n        dimethylacetamide: [\n            {\n                proton: 'CH3CO',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.08\n            },\n            {\n                proton: 'NCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.06\n            },\n            {\n                proton: 'NCH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.9\n            }\n        ],\n        dimethylformamide: [\n            {\n                proton: 'CH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 7.92\n            },\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.01\n            },\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.85\n            }\n        ],\n        dimethyl_sulfoxide: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.71\n            }\n        ],\n        dioxane: [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.75\n            }\n        ],\n        ethanol: [\n            {\n                proton: 'CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 1.17\n            },\n            {\n                proton: 'CH2',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 3.65\n            }\n        ],\n        ethyl_acetate: [\n            {\n                proton: 'CH3CO',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.07\n            },\n            {\n                proton: 'CH2CH3',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 4.14\n            },\n            {\n                proton: 'CH2CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 1.24\n            }\n        ],\n        ethyl_methyl_ketone: [\n            {\n                proton: 'CH3CO',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 2.19\n            },\n            {\n                proton: 'CH2CH3',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 3.18\n            },\n            {\n                proton: 'CH2CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 1.26\n            }\n        ],\n        ethylene_glycol: [\n            {\n                proton: 'CH',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.65\n            }\n        ],\n        'grease^f': [],\n        'n-hexane': [],\n        hmpag: [\n            {\n                proton: 'CH3',\n                coupling: 9.5,\n                multiplicity: 'd',\n                shift: 2.61\n            }\n        ],\n        methanol: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 3.34\n            }\n        ],\n        nitromethane: [\n            {\n                proton: 'CH3',\n                coupling: 0,\n                multiplicity: 's',\n                shift: 4.4\n            }\n        ],\n        'n-pentane': [\n            {\n                proton: 'CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 0.9\n            }\n        ],\n        '2-propanol': [\n            {\n                proton: 'CH3',\n                coupling: 6,\n                multiplicity: 'd',\n                shift: 1.17\n            },\n            {\n                proton: 'CH',\n                coupling: 6,\n                multiplicity: 'sep',\n                shift: 4.02\n            }\n        ],\n        pyridine: [\n            {\n                proton: 'CH(2)',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 8.52\n            },\n            {\n                proton: 'CH(3)',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 7.45\n            },\n            {\n                proton: 'CH(4)',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 7.87\n            }\n        ],\n        silicone_greasei: [],\n        tetrahydrofuran: [\n            {\n                proton: 'CH2',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 1.88\n            },\n            {\n                proton: 'CH2O',\n                coupling: 0,\n                multiplicity: 'm',\n                shift: 3.74\n            }\n        ],\n        toluene: [],\n        triethylamine: [\n            {\n                proton: 'CH3',\n                coupling: 7,\n                multiplicity: 't',\n                shift: 0.99\n            },\n            {\n                proton: 'CH2',\n                coupling: 7,\n                multiplicity: 'q',\n                shift: 2.57\n            }\n        ]\n    }\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/spectra-data/src/peakPicking/impurities.js","export {default as Ranges} from './range/Ranges';\nexport {default as getACS} from './acs/acs.js';\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/spectra-data-ranges/src/index.js","/**\n * nbDecimalsDelta : default depends nucleus H, F: 2 otherwise 1\n * nbDecimalsJ : default depends nucleus H, F: 1, otherwise 0\n * ascending : true / false\n * format : default \"AIMJ\" or when 2D data is collected the default format may be \"IMJA\"\n * deltaSeparator : ', '\n * detailSeparator : ', '\n */\n\nimport {joinCoupling} from 'spectra-nmr-utilities';\nconst globalOptions = {\n    h: {\n        nucleus: '1H',\n        nbDecimalDelta: 2,\n        nbDecimalJ: 1,\n        observedFrequency: 400\n    },\n    c: {\n        nucleus: '13C',\n        nbDecimalDelta: 1,\n        nbDecimalJ: 1,\n        observedFrequency: 100\n    },\n    f: {\n        nucleus: '19F',\n        nbDecimalDelta: 2,\n        nbDecimalJ: 1,\n        observedFrequency: 400\n    }\n};\n\nexport default function toAcs(ranges, options = {}) {\n    options = Object.assign({}, options);\n    if (!options.nucleus) options.nucleus = '1H';\n    var nucleus = options.nucleus.toLowerCase().replace(/[0-9]/g, '');\n    var defaultOptions = globalOptions[nucleus];\n    options = Object.assign({}, defaultOptions, {ascending: false, format: 'IMJA'}, options);\n\n    ranges = JSON.parse(JSON.stringify(ranges));\n    if (options.ascending === true) {\n        ranges.sort((a, b) => {\n            let fromA = Math.min(a.from, a.to);\n            let fromB = Math.min(b.from, b.to);\n            return fromA - fromB;\n        });\n    }\n    var acsString = formatAcs(ranges, options);\n\n    if (acsString.length > 0) acsString += '.';\n\n    return acsString;\n}\n\nfunction formatAcs(ranges, options) {\n    var acs = spectroInformation(options);\n    if (acs.length === 0) acs = 'δ ';\n    var acsRanges = [];\n    for (let range of ranges) {\n        pushDelta(range, acsRanges, options);\n    }\n    if (acsRanges.length > 0) {\n        return acs + acsRanges.join(', ');\n    } else {\n        return '';\n    }\n}\n\nfunction spectroInformation(options) {\n    let parenthesis = [];\n    let strings = formatNucleus(options.nucleus) + ' NMR';\n    if (options.solvent) {\n        parenthesis.push(formatMF(options.solvent));\n    }\n    if (options.frequencyObserved) {\n        parenthesis.push((options.frequencyObserved * 1).toFixed(0) + ' MHz');\n    }\n    if (parenthesis.length > 0) {\n        strings += ' (' + parenthesis.join(', ') + '): δ ';\n    } else {\n        strings += ': δ ';\n    }\n    return strings;\n}\n\nfunction pushDelta(range, acsRanges, options) {\n    var strings = '';\n    var parenthesis = [];\n    let fromTo = [range.from, range.to];\n    if (Array.isArray(range.signal) && range.signal.length > 0) {\n        var signals = range.signal;\n        if (signals.length > 1) {\n            if (options.ascending === true) {\n                signals.sort((a, b) => {\n                    return a.delta - b.delta;\n                });\n            }\n            strings += Math.min(...fromTo).toFixed(options.nbDecimalDelta) + '-'\n                     + Math.max(...fromTo).toFixed(options.nbDecimalDelta);\n            strings += ' (' + getIntegral(range, options);\n            for (let signal of signals) {\n                parenthesis = [];\n                if (signal.delta !== undefined) {\n                    strings = appendSeparator(strings);\n                    strings += signal.delta.toFixed(options.nbDecimalDelta);\n                }\n                switchFormat({}, signal, parenthesis, options);\n                if (parenthesis.length > 0) strings += ' (' + parenthesis.join(', ') + ')';\n            }\n            strings += ')';\n        } else {\n            parenthesis = [];\n            if (signals[0].delta !== undefined) {\n                strings += signals[0].delta.toFixed(options.nbDecimalDelta);\n                switchFormat(range, signals[0], parenthesis, options);\n                if (parenthesis.length > 0) strings += ' (' + parenthesis.join(', ') + ')';\n            } else {\n                strings += Math.min(...fromTo).toFixed(options.nbDecimalDelta) + '-' + Math.max(...fromTo).toFixed(options.nbDecimalDelta);\n                switchFormat(range, signals[0], parenthesis, options);\n                if (parenthesis.length > 0) strings += ' (' + parenthesis + ')';\n            }\n        }\n    } else {\n        strings += Math.min(...fromTo).toFixed(options.nbDecimalDelta) + '-' + Math.max(...fromTo).toFixed(options.nbDecimalDelta);\n        switchFormat(range, [], parenthesis, options);\n        if (parenthesis.length > 0) strings += ' (' + parenthesis.join(', ') + ')';\n    }\n    acsRanges.push(strings);\n}\n\nfunction getIntegral(range, options) {\n    let integral = '';\n    if (range.pubIntegral) {\n        integral = range.pubIntegral;\n    } else if (range.integral) {\n        integral = range.integral.toFixed(0) + options.nucleus[options.nucleus.length - 1];\n    }\n    return integral;\n}\n\nfunction pushIntegral(range, parenthesis, options) {\n    let integral = getIntegral(range, options);\n    if (integral.length > 0) parenthesis.push(integral);\n}\n\nfunction pushMultiplicityFromSignal(signal, parenthesis) {\n    let multiplicity = signal.multiplicity || joinCoupling(signal, 0.05);\n    if (multiplicity.length > 0) parenthesis.push(multiplicity);\n}\n\nfunction switchFormat(range, signal, parenthesis, options) {\n    for (const char of options.format) {\n        switch (char.toUpperCase()) {\n            case 'I':\n                pushIntegral(range, parenthesis, options);\n                break;\n            case 'M':\n                pushMultiplicityFromSignal(signal, parenthesis);\n                break;\n            case 'A':\n                pushAssignment(signal, parenthesis);\n                break;\n            case 'J':\n                pushCoupling(signal, parenthesis, options);\n                break;\n            default:\n                throw new Error('Unknow format letter: ' + char);\n        }\n    }\n}\n\nfunction formatMF(mf) {\n    return mf.replace(/([0-9]+)/g, '<sub>$1</sub>');\n}\n\nfunction formatNucleus(nucleus) {\n    return nucleus.replace(/([0-9]+)/g, '<sup>$1</sup>');\n}\n\nfunction appendSeparator(strings) {\n    if ((strings.length > 0) && (!strings.match(/ $/)) && (!strings.match(/\\($/))) {\n        strings += ', ';\n    }\n    return strings;\n}\n\nfunction formatAssignment(assignment) {\n    assignment = assignment.replace(/([0-9]+)/g, '<sub>$1</sub>');\n    assignment = assignment.replace(/\"([^\"]*)\"/g, '<i>$1</i>');\n    return assignment;\n}\n\nfunction pushCoupling(signal, parenthesis, options) {\n    if (Array.isArray(signal.j) && signal.j.length > 0) {\n        signal.j.sort(function (a, b) {\n            return b.coupling - a.coupling;\n        });\n\n        var values = [];\n        for (let j of signal.j) {\n            if (j.coupling !== undefined) {\n                values.push(j.coupling.toFixed(options.nbDecimalJ));\n            }\n        }\n        if (values.length > 0) parenthesis.push('<i>J</i> = ' + values.join(', ') + ' Hz');\n    }\n}\n\nfunction pushAssignment(signal, parenthesis) {\n    if (signal.pubAssignment) {\n        parenthesis.push(formatAssignment(signal.pubAssignment));\n    } else if (signal.assignment) {\n        parenthesis.push(formatAssignment(signal.assignment));\n    }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/spectra-data-ranges/src/acs/acs.js","\nconst patterns = ['s', 'd', 't', 'q', 'quint', 'h', 'sept', 'o', 'n'];\n\nexport function nmrJ(Js, options = {}) {\n    var jString = '';\n    options = Object.assign({}, {separator: ', ', nbDecimal: 2}, options);\n    let j, i;\n    for (i = 0; i < Js.length; i++) {\n        j = Js[i];\n        if (j.length > 11) {\n            j += options.separator;\n        }\n        jString += j.multiplicity + ' ' + j.coupling.toFixed(options.nbDecimal);\n    }\n    return jString;\n}\n\nexport function joinCoupling(signal, tolerance = 0.05) {\n    var jc = signal.j;\n    if (jc && jc.length > 0) {\n        var cont = jc[0].assignment ? jc[0].assignment.length : 1;\n        var pattern = '';\n        var newNmrJs = [];\n        var diaIDs = [];\n        var atoms = [];\n        jc.sort(function (a, b) {\n            return b.coupling - a.coupling;\n        });\n        if (jc[0].diaID) {\n            diaIDs = [jc[0].diaID];\n        }\n        if (jc[0].assignment) {\n            atoms = jc[0].assignment;\n        }\n        for (var i = 0; i < jc.length - 1; i++) {\n            if (Math.abs(jc[i].coupling - jc[i + 1].coupling) < tolerance) {\n                cont += jc[i + 1].assignment ? jc[i + 1].assignment.length : 1;\n                diaIDs.push(jc[i].diaID);\n                atoms = atoms.concat(jc[i + 1].assignment);\n            } else {\n                let jTemp = {\n                    coupling: Math.abs(jc[i].coupling),\n                    multiplicity: patterns[cont]\n                };\n                if (diaIDs.length > 0) {\n                    jTemp.diaID = diaIDs;\n                }\n                if (atoms.length > 0) {\n                    jTemp.assignment = atoms;\n                }\n                newNmrJs.push(jTemp);\n                if (jc[0].diaID) {\n                    diaIDs = [jc[i].diaID];\n                }\n                if (jc[0].assignment) {\n                    atoms = jc[i].assignment;\n                }\n                pattern += patterns[cont];\n                cont = jc[i + 1].assignment ? jc[i + 1].assignment.length : 1;\n            }\n        }\n        let jTemp = {\n            coupling: Math.abs(jc[i].coupling),\n            multiplicity: patterns[cont]\n        };\n        if (diaIDs.length > 0) {\n            jTemp.diaID = diaIDs;\n        }\n        if (atoms.length > 0) {\n            jTemp.assignment = atoms;\n        }\n        newNmrJs.push(jTemp);\n\n        pattern += patterns[cont];\n        signal.j = newNmrJs;\n\n    } else if (signal.delta) {\n        pattern = 's';\n    } else {\n        pattern = 'm';\n    }\n    return pattern;\n}\n\nexport function group(signals, options = {}) {\n    var i, k;\n    for (i = 0; i < signals.length; i++) {\n        var j = signals[i].j;\n        if (j && j.lengthpublish > 0) {\n            for (k = j.length - 2; k >= 0; k--) {\n                for (var m = j.length - 1; m > k; m--) {\n                    if (j[k].diaID === j[m].diaID &&\n                        j[k].coupling === j[m].coupling &&\n                        j[k].distance === j[m].distance) {\n                        j[k].assignment = j[k].assignment.concat(j[m].assignment);\n                        j.splice(m, 1);\n                    }\n                }\n            }\n        }\n    }\n    signals.sort((a, b) => {\n        if (a.diaIDs[0] < b.diaIDs[0]) return -1;\n        if (a.diaIDs[0] > b.diaIDs[0]) return 1;\n        return 0;\n    });\n\n    for (i = signals.length - 2; i >= 0; i--) {\n        if (signals[i].diaIDs[0] === signals[i + 1].diaIDs[0]) {\n            signals[i].nbAtoms += signals[i + 1].nbAtoms;\n            signals[i].atomIDs = signals[i].atomIDs.concat(signals[i + 1].atomIDs);\n            signals.splice(i + 1, 1);\n        }\n    }\n    for (i = 0; i < signals.length; i++) {\n        j = signals[i].j;\n        for (k = 0; k < j.length; k++) {\n            j[k].multiplicity = patterns[j[k].assignment.length];\n        }\n        signals[i].multiplicity = module.exports.compilePattern(signals[i], options.tolerance);\n    }\n    return signals;\n}\n\n\nexport function compilePattern(signal, tolerance = 0.05) {\n    var jc = signal.j;\n    var pattern = '';\n    if (jc && jc.length > 0) {\n        var cont = jc[0].assignment ? jc[0].assignment.length : 0;\n        jc.sort(function (a, b) {\n            return b.coupling - a.coupling;\n        });\n        for (var i = 0; i < jc.length - 1; i++) {\n            if (Math.abs(jc[i].coupling - jc[i + 1].coupling) < tolerance) {\n                cont += jc[i + 1].assignment ? jc[i + 1].assignment.length : 1;\n            } else {\n                pattern += patterns[cont];\n                cont = jc[i + 1].assignment ? jc[i + 1].assignment.length : 1;\n            }\n        }\n        pattern += patterns[cont];\n    } else if (signal.delta) {\n        pattern = 's';\n    } else {\n        pattern = 'm';\n    }\n    return pattern;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/spectra-nmr-utilities/src/index.js","/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n    MAX_INTEGER = 1.7976931348623157e+308,\n    NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n    symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n  // Exit early for strings to avoid a performance hit in some environments.\n  if (typeof value == 'string') {\n    return value;\n  }\n  if (isSymbol(value)) {\n    return symbolToString ? symbolToString.call(value) : '';\n  }\n  var result = (value + '');\n  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Creates a function like `_.round`.\n *\n * @private\n * @param {string} methodName The name of the `Math` method to use when rounding.\n * @returns {Function} Returns the new round function.\n */\nfunction createRound(methodName) {\n  var func = Math[methodName];\n  return function(number, precision) {\n    number = toNumber(number);\n    precision = nativeMin(toInteger(precision), 292);\n    if (precision) {\n      // Shift with exponential notation to avoid floating-point issues.\n      // See [MDN](https://mdn.io/round#Examples) for more details.\n      var pair = (toString(number) + 'e').split('e'),\n          value = func(pair[0] + 'e' + (+pair[1] + precision));\n\n      pair = (toString(value) + 'e').split('e');\n      return +(pair[0] + 'e' + (+pair[1] - precision));\n    }\n    return func(number);\n  };\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n  var type = typeof value;\n  return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n  return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n  return typeof value == 'symbol' ||\n    (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\nfunction toFinite(value) {\n  if (!value) {\n    return value === 0 ? value : 0;\n  }\n  value = toNumber(value);\n  if (value === INFINITY || value === -INFINITY) {\n    var sign = (value < 0 ? -1 : 1);\n    return sign * MAX_INTEGER;\n  }\n  return value === value ? value : 0;\n}\n\n/**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\nfunction toInteger(value) {\n  var result = toFinite(value),\n      remainder = result % 1;\n\n  return result === result ? (remainder ? result - remainder : result) : 0;\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n  if (typeof value == 'number') {\n    return value;\n  }\n  if (isSymbol(value)) {\n    return NAN;\n  }\n  if (isObject(value)) {\n    var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n    value = isObject(other) ? (other + '') : other;\n  }\n  if (typeof value != 'string') {\n    return value === 0 ? value : +value;\n  }\n  value = value.replace(reTrim, '');\n  var isBinary = reIsBinary.test(value);\n  return (isBinary || reIsOctal.test(value))\n    ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n    : (reIsBadHex.test(value) ? NAN : +value);\n}\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n  return value == null ? '' : baseToString(value);\n}\n\n/**\n * Computes `number` rounded to `precision`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Math\n * @param {number} number The number to round.\n * @param {number} [precision=0] The precision to round to.\n * @returns {number} Returns the rounded number.\n * @example\n *\n * _.round(4.006);\n * // => 4\n *\n * _.round(4.006, 2);\n * // => 4.01\n *\n * _.round(4060, -2);\n * // => 4100\n */\nvar round = createRound('round');\n\nmodule.exports = round;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/lodash.round/index.js","export {default as SpinSystem} from './SpinSystem';\nexport {default as simulate1D} from './simulate1D';\nexport {default as simulate2D} from './simulate2D';\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/nmr-simulation/src/index.js","'use strict';\n\nmodule.exports = abstractMatrix;\n\nvar LuDecomposition = require('./dc/lu');\nvar SvDecomposition = require('./dc/svd');\nvar arrayUtils = require('ml-array-utils');\nvar util = require('./util');\nvar MatrixTransposeView = require('./views/transpose');\nvar MatrixRowView = require('./views/row');\nvar MatrixSubView = require('./views/sub');\nvar MatrixSelectionView = require('./views/selection');\nvar MatrixColumnView = require('./views/column');\nvar MatrixFlipRowView = require('./views/flipRow');\nvar MatrixFlipColumnView = require('./views/flipColumn');\n\nfunction abstractMatrix(superCtor) {\n    if (superCtor === undefined) superCtor = Object;\n\n    /**\n     * Real matrix\n     * @class Matrix\n     * @param {number|Array|Matrix} nRows - Number of rows of the new matrix,\n     * 2D array containing the data or Matrix instance to clone\n     * @param {number} [nColumns] - Number of columns of the new matrix\n     */\n    class Matrix extends superCtor {\n        static get [Symbol.species]() {\n            return this;\n        }\n\n        /**\n         * Constructs a Matrix with the chosen dimensions from a 1D array\n         * @param {number} newRows - Number of rows\n         * @param {number} newColumns - Number of columns\n         * @param {Array} newData - A 1D array containing data for the matrix\n         * @return {Matrix} - The new matrix\n         */\n        static from1DArray(newRows, newColumns, newData) {\n            var length = newRows * newColumns;\n            if (length !== newData.length) {\n                throw new RangeError('Data length does not match given dimensions');\n            }\n            var newMatrix = new this(newRows, newColumns);\n            for (var row = 0; row < newRows; row++) {\n                for (var column = 0; column < newColumns; column++) {\n                    newMatrix.set(row, column, newData[row * newColumns + column]);\n                }\n            }\n            return newMatrix;\n        }\n\n        /**\n         * Creates a row vector, a matrix with only one row.\n         * @param {Array} newData - A 1D array containing data for the vector\n         * @return {Matrix} - The new matrix\n         */\n        static rowVector(newData) {\n            var vector = new this(1, newData.length);\n            for (var i = 0; i < newData.length; i++) {\n                vector.set(0, i, newData[i]);\n            }\n            return vector;\n        }\n\n        /**\n         * Creates a column vector, a matrix with only one column.\n         * @param {Array} newData - A 1D array containing data for the vector\n         * @return {Matrix} - The new matrix\n         */\n        static columnVector(newData) {\n            var vector = new this(newData.length, 1);\n            for (var i = 0; i < newData.length; i++) {\n                vector.set(i, 0, newData[i]);\n            }\n            return vector;\n        }\n\n        /**\n         * Creates an empty matrix with the given dimensions. Values will be undefined. Same as using new Matrix(rows, columns).\n         * @param {number} rows - Number of rows\n         * @param {number} columns - Number of columns\n         * @return {Matrix} - The new matrix\n         */\n        static empty(rows, columns) {\n            return new this(rows, columns);\n        }\n\n        /**\n         * Creates a matrix with the given dimensions. Values will be set to zero.\n         * @param {number} rows - Number of rows\n         * @param {number} columns - Number of columns\n         * @return {Matrix} - The new matrix\n         */\n        static zeros(rows, columns) {\n            return this.empty(rows, columns).fill(0);\n        }\n\n        /**\n         * Creates a matrix with the given dimensions. Values will be set to one.\n         * @param {number} rows - Number of rows\n         * @param {number} columns - Number of columns\n         * @return {Matrix} - The new matrix\n         */\n        static ones(rows, columns) {\n            return this.empty(rows, columns).fill(1);\n        }\n\n        /**\n         * Creates a matrix with the given dimensions. Values will be randomly set.\n         * @param {number} rows - Number of rows\n         * @param {number} columns - Number of columns\n         * @param {function} [rng=Math.random] - Random number generator\n         * @return {Matrix} The new matrix\n         */\n        static rand(rows, columns, rng) {\n            if (rng === undefined) rng = Math.random;\n            var matrix = this.empty(rows, columns);\n            for (var i = 0; i < rows; i++) {\n                for (var j = 0; j < columns; j++) {\n                    matrix.set(i, j, rng());\n                }\n            }\n            return matrix;\n        }\n\n        /**\n         * Creates a matrix with the given dimensions. Values will be random integers.\n         * @param {number} rows - Number of rows\n         * @param {number} columns - Number of columns\n         * @param {number} [maxValue=1000] - Maximum value\n         * @param {function} [rng=Math.random] - Random number generator\n         * @return {Matrix} The new matrix\n         */\n        static randInt(rows, columns, maxValue, rng) {\n            if (maxValue === undefined) maxValue = 1000;\n            if (rng === undefined) rng = Math.random;\n            var matrix = this.empty(rows, columns);\n            for (var i = 0; i < rows; i++) {\n                for (var j = 0; j < columns; j++) {\n                    var value = Math.floor(rng() * maxValue);\n                    matrix.set(i, j, value);\n                }\n            }\n            return matrix;\n        }\n\n        /**\n         * Creates an identity matrix with the given dimension. Values of the diagonal will be 1 and others will be 0.\n         * @param {number} rows - Number of rows\n         * @param {number} [columns=rows] - Number of columns\n         * @param {number} [value=1] - Value to fill the diagonal with\n         * @return {Matrix} - The new identity matrix\n         */\n        static eye(rows, columns, value) {\n            if (columns === undefined) columns = rows;\n            if (value === undefined) value = 1;\n            var min = Math.min(rows, columns);\n            var matrix = this.zeros(rows, columns);\n            for (var i = 0; i < min; i++) {\n                matrix.set(i, i, value);\n            }\n            return matrix;\n        }\n\n        /**\n         * Creates a diagonal matrix based on the given array.\n         * @param {Array} data - Array containing the data for the diagonal\n         * @param {number} [rows] - Number of rows (Default: data.length)\n         * @param {number} [columns] - Number of columns (Default: rows)\n         * @return {Matrix} - The new diagonal matrix\n         */\n        static diag(data, rows, columns) {\n            var l = data.length;\n            if (rows === undefined) rows = l;\n            if (columns === undefined) columns = rows;\n            var min = Math.min(l, rows, columns);\n            var matrix = this.zeros(rows, columns);\n            for (var i = 0; i < min; i++) {\n                matrix.set(i, i, data[i]);\n            }\n            return matrix;\n        }\n\n        /**\n         * Returns a matrix whose elements are the minimum between matrix1 and matrix2\n         * @param {Matrix} matrix1\n         * @param {Matrix} matrix2\n         * @return {Matrix}\n         */\n        static min(matrix1, matrix2) {\n            matrix1 = this.checkMatrix(matrix1);\n            matrix2 = this.checkMatrix(matrix2);\n            var rows = matrix1.rows;\n            var columns = matrix1.columns;\n            var result = new this(rows, columns);\n            for (var i = 0; i < rows; i++) {\n                for (var j = 0; j < columns; j++) {\n                    result.set(i, j, Math.min(matrix1.get(i, j), matrix2.get(i, j)));\n                }\n            }\n            return result;\n        }\n\n        /**\n         * Returns a matrix whose elements are the maximum between matrix1 and matrix2\n         * @param {Matrix} matrix1\n         * @param {Matrix} matrix2\n         * @return {Matrix}\n         */\n        static max(matrix1, matrix2) {\n            matrix1 = this.checkMatrix(matrix1);\n            matrix2 = this.checkMatrix(matrix2);\n            var rows = matrix1.rows;\n            var columns = matrix1.columns;\n            var result = new this(rows, columns);\n            for (var i = 0; i < rows; i++) {\n                for (var j = 0; j < columns; j++) {\n                    result.set(i, j, Math.max(matrix1.get(i, j), matrix2.get(i, j)));\n                }\n            }\n            return result;\n        }\n\n        /**\n         * Check that the provided value is a Matrix and tries to instantiate one if not\n         * @param {*} value - The value to check\n         * @return {Matrix}\n         */\n        static checkMatrix(value) {\n            return Matrix.isMatrix(value) ? value : new this(value);\n        }\n\n        /**\n         * Returns true if the argument is a Matrix, false otherwise\n         * @param {*} value - The value to check\n         * @return {boolean}\n         */\n        static isMatrix(value) {\n            return (value != null) && (value.klass === 'Matrix');\n        }\n\n        /**\n         * @prop {number} size - The number of elements in the matrix.\n         */\n        get size() {\n            return this.rows * this.columns;\n        }\n\n        /**\n         * Applies a callback for each element of the matrix. The function is called in the matrix (this) context.\n         * @param {function} callback - Function that will be called with two parameters : i (row) and j (column)\n         * @return {Matrix} this\n         */\n        apply(callback) {\n            if (typeof callback !== 'function') {\n                throw new TypeError('callback must be a function');\n            }\n            var ii = this.rows;\n            var jj = this.columns;\n            for (var i = 0; i < ii; i++) {\n                for (var j = 0; j < jj; j++) {\n                    callback.call(this, i, j);\n                }\n            }\n            return this;\n        }\n\n        /**\n         * Returns a new 1D array filled row by row with the matrix values\n         * @return {Array}\n         */\n        to1DArray() {\n            var array = new Array(this.size);\n            for (var i = 0; i < this.rows; i++) {\n                for (var j = 0; j < this.columns; j++) {\n                    array[i * this.columns + j] = this.get(i, j);\n                }\n            }\n            return array;\n        }\n\n        /**\n         * Returns a 2D array containing a copy of the data\n         * @return {Array}\n         */\n        to2DArray() {\n            var copy = new Array(this.rows);\n            for (var i = 0; i < this.rows; i++) {\n                copy[i] = new Array(this.columns);\n                for (var j = 0; j < this.columns; j++) {\n                    copy[i][j] = this.get(i, j);\n                }\n            }\n            return copy;\n        }\n\n        /**\n         * @return {boolean} true if the matrix has one row\n         */\n        isRowVector() {\n            return this.rows === 1;\n        }\n\n        /**\n         * @return {boolean} true if the matrix has one column\n         */\n        isColumnVector() {\n            return this.columns === 1;\n        }\n\n        /**\n         * @return {boolean} true if the matrix has one row or one column\n         */\n        isVector() {\n            return (this.rows === 1) || (this.columns === 1);\n        }\n\n        /**\n         * @return {boolean} true if the matrix has the same number of rows and columns\n         */\n        isSquare() {\n            return this.rows === this.columns;\n        }\n\n        /**\n         * @return {boolean} true if the matrix is square and has the same values on both sides of the diagonal\n         */\n        isSymmetric() {\n            if (this.isSquare()) {\n                for (var i = 0; i < this.rows; i++) {\n                    for (var j = 0; j <= i; j++) {\n                        if (this.get(i, j) !== this.get(j, i)) {\n                            return false;\n                        }\n                    }\n                }\n                return true;\n            }\n            return false;\n        }\n\n        /**\n         * Sets a given element of the matrix. mat.set(3,4,1) is equivalent to mat[3][4]=1\n         * @abstract\n         * @param {number} rowIndex - Index of the row\n         * @param {number} columnIndex - Index of the column\n         * @param {number} value - The new value for the element\n         * @return {Matrix} this\n         */\n        set(rowIndex, columnIndex, value) { // eslint-disable-line no-unused-vars\n            throw new Error('set method is unimplemented');\n        }\n\n        /**\n         * Returns the given element of the matrix. mat.get(3,4) is equivalent to matrix[3][4]\n         * @abstract\n         * @param {number} rowIndex - Index of the row\n         * @param {number} columnIndex - Index of the column\n         * @return {number}\n         */\n        get(rowIndex, columnIndex) { // eslint-disable-line no-unused-vars\n            throw new Error('get method is unimplemented');\n        }\n\n        /**\n         * Creates a new matrix that is a repetition of the current matrix. New matrix has rowRep times the number of\n         * rows of the matrix, and colRep times the number of columns of the matrix\n         * @param {number} rowRep - Number of times the rows should be repeated\n         * @param {number} colRep - Number of times the columns should be re\n         * @return {Matrix}\n         * @example\n         * var matrix = new Matrix([[1,2]]);\n         * matrix.repeat(2); // [[1,2],[1,2]]\n         */\n        repeat(rowRep, colRep) {\n            rowRep = rowRep || 1;\n            colRep = colRep || 1;\n            var matrix = new this.constructor[Symbol.species](this.rows * rowRep, this.columns * colRep);\n            for (var i = 0; i < rowRep; i++) {\n                for (var j = 0; j < colRep; j++) {\n                    matrix.setSubMatrix(this, this.rows * i, this.columns * j);\n                }\n            }\n            return matrix;\n        }\n\n        /**\n         * Fills the matrix with a given value. All elements will be set to this value.\n         * @param {number} value - New value\n         * @return {Matrix} this\n         */\n        fill(value) {\n            for (var i = 0; i < this.rows; i++) {\n                for (var j = 0; j < this.columns; j++) {\n                    this.set(i, j, value);\n                }\n            }\n            return this;\n        }\n\n        /**\n         * Negates the matrix. All elements will be multiplied by (-1)\n         * @return {Matrix} this\n         */\n        neg() {\n            return this.mulS(-1);\n        }\n\n        /**\n         * Returns a new array from the given row index\n         * @param {number} index - Row index\n         * @return {Array}\n         */\n        getRow(index) {\n            util.checkRowIndex(this, index);\n            var row = new Array(this.columns);\n            for (var i = 0; i < this.columns; i++) {\n                row[i] = this.get(index, i);\n            }\n            return row;\n        }\n\n        /**\n         * Returns a new row vector from the given row index\n         * @param {number} index - Row index\n         * @return {Matrix}\n         */\n        getRowVector(index) {\n            return this.constructor.rowVector(this.getRow(index));\n        }\n\n        /**\n         * Sets a row at the given index\n         * @param {number} index - Row index\n         * @param {Array|Matrix} array - Array or vector\n         * @return {Matrix} this\n         */\n        setRow(index, array) {\n            util.checkRowIndex(this, index);\n            array = util.checkRowVector(this, array);\n            for (var i = 0; i < this.columns; i++) {\n                this.set(index, i, array[i]);\n            }\n            return this;\n        }\n\n        /**\n         * Swaps two rows\n         * @param {number} row1 - First row index\n         * @param {number} row2 - Second row index\n         * @return {Matrix} this\n         */\n        swapRows(row1, row2) {\n            util.checkRowIndex(this, row1);\n            util.checkRowIndex(this, row2);\n            for (var i = 0; i < this.columns; i++) {\n                var temp = this.get(row1, i);\n                this.set(row1, i, this.get(row2, i));\n                this.set(row2, i, temp);\n            }\n            return this;\n        }\n\n        /**\n         * Returns a new array from the given column index\n         * @param {number} index - Column index\n         * @return {Array}\n         */\n        getColumn(index) {\n            util.checkColumnIndex(this, index);\n            var column = new Array(this.rows);\n            for (var i = 0; i < this.rows; i++) {\n                column[i] = this.get(i, index);\n            }\n            return column;\n        }\n\n        /**\n         * Returns a new column vector from the given column index\n         * @param {number} index - Column index\n         * @return {Matrix}\n         */\n        getColumnVector(index) {\n            return this.constructor.columnVector(this.getColumn(index));\n        }\n\n        /**\n         * Sets a column at the given index\n         * @param {number} index - Column index\n         * @param {Array|Matrix} array - Array or vector\n         * @return {Matrix} this\n         */\n        setColumn(index, array) {\n            util.checkColumnIndex(this, index);\n            array = util.checkColumnVector(this, array);\n            for (var i = 0; i < this.rows; i++) {\n                this.set(i, index, array[i]);\n            }\n            return this;\n        }\n\n        /**\n         * Swaps two columns\n         * @param {number} column1 - First column index\n         * @param {number} column2 - Second column index\n         * @return {Matrix} this\n         */\n        swapColumns(column1, column2) {\n            util.checkColumnIndex(this, column1);\n            util.checkColumnIndex(this, column2);\n            for (var i = 0; i < this.rows; i++) {\n                var temp = this.get(i, column1);\n                this.set(i, column1, this.get(i, column2));\n                this.set(i, column2, temp);\n            }\n            return this;\n        }\n\n        /**\n         * Adds the values of a vector to each row\n         * @param {Array|Matrix} vector - Array or vector\n         * @return {Matrix} this\n         */\n        addRowVector(vector) {\n            vector = util.checkRowVector(this, vector);\n            for (var i = 0; i < this.rows; i++) {\n                for (var j = 0; j < this.columns; j++) {\n                    this.set(i, j, this.get(i, j) + vector[j]);\n                }\n            }\n            return this;\n        }\n\n        /**\n         * Subtracts the values of a vector from each row\n         * @param {Array|Matrix} vector - Array or vector\n         * @return {Matrix} this\n         */\n        subRowVector(vector) {\n            vector = util.checkRowVector(this, vector);\n            for (var i = 0; i < this.rows; i++) {\n                for (var j = 0; j < this.columns; j++) {\n                    this.set(i, j, this.get(i, j) - vector[j]);\n                }\n            }\n            return this;\n        }\n\n        /**\n         * Multiplies the values of a vector with each row\n         * @param {Array|Matrix} vector - Array or vector\n         * @return {Matrix} this\n         */\n        mulRowVector(vector) {\n            vector = util.checkRowVector(this, vector);\n            for (var i = 0; i < this.rows; i++) {\n                for (var j = 0; j < this.columns; j++) {\n                    this.set(i, j, this.get(i, j) * vector[j]);\n                }\n            }\n            return this;\n        }\n\n        /**\n         * Divides the values of each row by those of a vector\n         * @param {Array|Matrix} vector - Array or vector\n         * @return {Matrix} this\n         */\n        divRowVector(vector) {\n            vector = util.checkRowVector(this, vector);\n            for (var i = 0; i < this.rows; i++) {\n                for (var j = 0; j < this.columns; j++) {\n                    this.set(i, j, this.get(i, j) / vector[j]);\n                }\n            }\n            return this;\n        }\n\n        /**\n         * Adds the values of a vector to each column\n         * @param {Array|Matrix} vector - Array or vector\n         * @return {Matrix} this\n         */\n        addColumnVector(vector) {\n            vector = util.checkColumnVector(this, vector);\n            for (var i = 0; i < this.rows; i++) {\n                for (var j = 0; j < this.columns; j++) {\n                    this.set(i, j, this.get(i, j) + vector[i]);\n                }\n            }\n            return this;\n        }\n\n        /**\n         * Subtracts the values of a vector from each column\n         * @param {Array|Matrix} vector - Array or vector\n         * @return {Matrix} this\n         */\n        subColumnVector(vector) {\n            vector = util.checkColumnVector(this, vector);\n            for (var i = 0; i < this.rows; i++) {\n                for (var j = 0; j < this.columns; j++) {\n                    this.set(i, j, this.get(i, j) - vector[i]);\n                }\n            }\n            return this;\n        }\n\n        /**\n         * Multiplies the values of a vector with each column\n         * @param {Array|Matrix} vector - Array or vector\n         * @return {Matrix} this\n         */\n        mulColumnVector(vector) {\n            vector = util.checkColumnVector(this, vector);\n            for (var i = 0; i < this.rows; i++) {\n                for (var j = 0; j < this.columns; j++) {\n                    this.set(i, j, this.get(i, j) * vector[i]);\n                }\n            }\n            return this;\n        }\n\n        /**\n         * Divides the values of each column by those of a vector\n         * @param {Array|Matrix} vector - Array or vector\n         * @return {Matrix} this\n         */\n        divColumnVector(vector) {\n            vector = util.checkColumnVector(this, vector);\n            for (var i = 0; i < this.rows; i++) {\n                for (var j = 0; j < this.columns; j++) {\n                    this.set(i, j, this.get(i, j) / vector[i]);\n                }\n            }\n            return this;\n        }\n\n        /**\n         * Multiplies the values of a row with a scalar\n         * @param {number} index - Row index\n         * @param {number} value\n         * @return {Matrix} this\n         */\n        mulRow(index, value) {\n            util.checkRowIndex(this, index);\n            for (var i = 0; i < this.columns; i++) {\n                this.set(index, i, this.get(index, i) * value);\n            }\n            return this;\n        }\n\n        /**\n         * Multiplies the values of a column with a scalar\n         * @param {number} index - Column index\n         * @param {number} value\n         * @return {Matrix} this\n         */\n        mulColumn(index, value) {\n            util.checkColumnIndex(this, index);\n            for (var i = 0; i < this.rows; i++) {\n                this.set(i, index, this.get(i, index) * value);\n            }\n            return this;\n        }\n\n        /**\n         * Returns the maximum value of the matrix\n         * @return {number}\n         */\n        max() {\n            var v = this.get(0, 0);\n            for (var i = 0; i < this.rows; i++) {\n                for (var j = 0; j < this.columns; j++) {\n                    if (this.get(i, j) > v) {\n                        v = this.get(i, j);\n                    }\n                }\n            }\n            return v;\n        }\n\n        /**\n         * Returns the index of the maximum value\n         * @return {Array}\n         */\n        maxIndex() {\n            var v = this.get(0, 0);\n            var idx = [0, 0];\n            for (var i = 0; i < this.rows; i++) {\n                for (var j = 0; j < this.columns; j++) {\n                    if (this.get(i, j) > v) {\n                        v = this.get(i, j);\n                        idx[0] = i;\n                        idx[1] = j;\n                    }\n                }\n            }\n            return idx;\n        }\n\n        /**\n         * Returns the minimum value of the matrix\n         * @return {number}\n         */\n        min() {\n            var v = this.get(0, 0);\n            for (var i = 0; i < this.rows; i++) {\n                for (var j = 0; j < this.columns; j++) {\n                    if (this.get(i, j) < v) {\n                        v = this.get(i, j);\n                    }\n                }\n            }\n            return v;\n        }\n\n        /**\n         * Returns the index of the minimum value\n         * @return {Array}\n         */\n        minIndex() {\n            var v = this.get(0, 0);\n            var idx = [0, 0];\n            for (var i = 0; i < this.rows; i++) {\n                for (var j = 0; j < this.columns; j++) {\n                    if (this.get(i, j) < v) {\n                        v = this.get(i, j);\n                        idx[0] = i;\n                        idx[1] = j;\n                    }\n                }\n            }\n            return idx;\n        }\n\n        /**\n         * Returns the maximum value of one row\n         * @param {number} row - Row index\n         * @return {number}\n         */\n        maxRow(row) {\n            util.checkRowIndex(this, row);\n            var v = this.get(row, 0);\n            for (var i = 1; i < this.columns; i++) {\n                if (this.get(row, i) > v) {\n                    v = this.get(row, i);\n                }\n            }\n            return v;\n        }\n\n        /**\n         * Returns the index of the maximum value of one row\n         * @param {number} row - Row index\n         * @return {Array}\n         */\n        maxRowIndex(row) {\n            util.checkRowIndex(this, row);\n            var v = this.get(row, 0);\n            var idx = [row, 0];\n            for (var i = 1; i < this.columns; i++) {\n                if (this.get(row, i) > v) {\n                    v = this.get(row, i);\n                    idx[1] = i;\n                }\n            }\n            return idx;\n        }\n\n        /**\n         * Returns the minimum value of one row\n         * @param {number} row - Row index\n         * @return {number}\n         */\n        minRow(row) {\n            util.checkRowIndex(this, row);\n            var v = this.get(row, 0);\n            for (var i = 1; i < this.columns; i++) {\n                if (this.get(row, i) < v) {\n                    v = this.get(row, i);\n                }\n            }\n            return v;\n        }\n\n        /**\n         * Returns the index of the maximum value of one row\n         * @param {number} row - Row index\n         * @return {Array}\n         */\n        minRowIndex(row) {\n            util.checkRowIndex(this, row);\n            var v = this.get(row, 0);\n            var idx = [row, 0];\n            for (var i = 1; i < this.columns; i++) {\n                if (this.get(row, i) < v) {\n                    v = this.get(row, i);\n                    idx[1] = i;\n                }\n            }\n            return idx;\n        }\n\n        /**\n         * Returns the maximum value of one column\n         * @param {number} column - Column index\n         * @return {number}\n         */\n        maxColumn(column) {\n            util.checkColumnIndex(this, column);\n            var v = this.get(0, column);\n            for (var i = 1; i < this.rows; i++) {\n                if (this.get(i, column) > v) {\n                    v = this.get(i, column);\n                }\n            }\n            return v;\n        }\n\n        /**\n         * Returns the index of the maximum value of one column\n         * @param {number} column - Column index\n         * @return {Array}\n         */\n        maxColumnIndex(column) {\n            util.checkColumnIndex(this, column);\n            var v = this.get(0, column);\n            var idx = [0, column];\n            for (var i = 1; i < this.rows; i++) {\n                if (this.get(i, column) > v) {\n                    v = this.get(i, column);\n                    idx[0] = i;\n                }\n            }\n            return idx;\n        }\n\n        /**\n         * Returns the minimum value of one column\n         * @param {number} column - Column index\n         * @return {number}\n         */\n        minColumn(column) {\n            util.checkColumnIndex(this, column);\n            var v = this.get(0, column);\n            for (var i = 1; i < this.rows; i++) {\n                if (this.get(i, column) < v) {\n                    v = this.get(i, column);\n                }\n            }\n            return v;\n        }\n\n        /**\n         * Returns the index of the minimum value of one column\n         * @param {number} column - Column index\n         * @return {Array}\n         */\n        minColumnIndex(column) {\n            util.checkColumnIndex(this, column);\n            var v = this.get(0, column);\n            var idx = [0, column];\n            for (var i = 1; i < this.rows; i++) {\n                if (this.get(i, column) < v) {\n                    v = this.get(i, column);\n                    idx[0] = i;\n                }\n            }\n            return idx;\n        }\n\n        /**\n         * Returns an array containing the diagonal values of the matrix\n         * @return {Array}\n         */\n        diag() {\n            var min = Math.min(this.rows, this.columns);\n            var diag = new Array(min);\n            for (var i = 0; i < min; i++) {\n                diag[i] = this.get(i, i);\n            }\n            return diag;\n        }\n\n        /**\n         * Returns the sum by the argument given, if no argument given,\n         * it returns the sum of all elements of the matrix.\n         * @param {string} by - sum by 'row' or 'column'.\n         * @return {Matrix|number}\n         */\n        sum(by) {\n            switch (by) {\n                case 'row':\n                    return util.sumByRow(this);\n                case 'column':\n                    return util.sumByColumn(this);\n                default:\n                    return util.sumAll(this);\n            }\n        }\n\n        /**\n         * Returns the mean of all elements of the matrix\n         * @return {number}\n         */\n        mean() {\n            return this.sum() / this.size;\n        }\n\n        /**\n         * Returns the product of all elements of the matrix\n         * @return {number}\n         */\n        prod() {\n            var prod = 1;\n            for (var i = 0; i < this.rows; i++) {\n                for (var j = 0; j < this.columns; j++) {\n                    prod *= this.get(i, j);\n                }\n            }\n            return prod;\n        }\n\n        /**\n         * Computes the cumulative sum of the matrix elements (in place, row by row)\n         * @return {Matrix} this\n         */\n        cumulativeSum() {\n            var sum = 0;\n            for (var i = 0; i < this.rows; i++) {\n                for (var j = 0; j < this.columns; j++) {\n                    sum += this.get(i, j);\n                    this.set(i, j, sum);\n                }\n            }\n            return this;\n        }\n\n        /**\n         * Computes the dot (scalar) product between the matrix and another\n         * @param {Matrix} vector2 vector\n         * @return {number}\n         */\n        dot(vector2) {\n            if (Matrix.isMatrix(vector2)) vector2 = vector2.to1DArray();\n            var vector1 = this.to1DArray();\n            if (vector1.length !== vector2.length) {\n                throw new RangeError('vectors do not have the same size');\n            }\n            var dot = 0;\n            for (var i = 0; i < vector1.length; i++) {\n                dot += vector1[i] * vector2[i];\n            }\n            return dot;\n        }\n\n        /**\n         * Returns the matrix product between this and other\n         * @param {Matrix} other\n         * @return {Matrix}\n         */\n        mmul(other) {\n            other = this.constructor.checkMatrix(other);\n            if (this.columns !== other.rows) {\n                // eslint-disable-next-line no-console\n                console.warn('Number of columns of left matrix are not equal to number of rows of right matrix.');\n            }\n\n            var m = this.rows;\n            var n = this.columns;\n            var p = other.columns;\n\n            var result = new this.constructor[Symbol.species](m, p);\n\n            var Bcolj = new Array(n);\n            for (var j = 0; j < p; j++) {\n                for (var k = 0; k < n; k++) {\n                    Bcolj[k] = other.get(k, j);\n                }\n\n                for (var i = 0; i < m; i++) {\n                    var s = 0;\n                    for (k = 0; k < n; k++) {\n                        s += this.get(i, k) * Bcolj[k];\n                    }\n\n                    result.set(i, j, s);\n                }\n            }\n            return result;\n        }\n\n        strassen2x2(other) {\n            var result = new this.constructor[Symbol.species](2, 2);\n            const a11 = this.get(0, 0);\n            const b11 = other.get(0, 0);\n            const a12 = this.get(0, 1);\n            const b12 = other.get(0, 1);\n            const a21 = this.get(1, 0);\n            const b21 = other.get(1, 0);\n            const a22 = this.get(1, 1);\n            const b22 = other.get(1, 1);\n\n            // Compute intermediate values.\n            const m1 = (a11 + a22) * (b11 + b22);\n            const m2 = (a21 + a22) * b11;\n            const m3 = a11 * (b12 - b22);\n            const m4 = a22 * (b21 - b11);\n            const m5 = (a11 + a12) * b22;\n            const m6 = (a21 - a11) * (b11 + b12);\n            const m7 = (a12 - a22) * (b21 + b22);\n\n            // Combine intermediate values into the output.\n            const c00 = m1 + m4 - m5 + m7;\n            const c01 = m3 + m5;\n            const c10 = m2 + m4;\n            const c11 = m1 - m2 + m3 + m6;\n\n            result.set(0, 0, c00);\n            result.set(0, 1, c01);\n            result.set(1, 0, c10);\n            result.set(1, 1, c11);\n            return result;\n        }\n\n        strassen3x3(other) {\n            var result = new this.constructor[Symbol.species](3, 3);\n\n            const a00 = this.get(0, 0);\n            const a01 = this.get(0, 1);\n            const a02 = this.get(0, 2);\n            const a10 = this.get(1, 0);\n            const a11 = this.get(1, 1);\n            const a12 = this.get(1, 2);\n            const a20 = this.get(2, 0);\n            const a21 = this.get(2, 1);\n            const a22 = this.get(2, 2);\n\n            const b00 = other.get(0, 0);\n            const b01 = other.get(0, 1);\n            const b02 = other.get(0, 2);\n            const b10 = other.get(1, 0);\n            const b11 = other.get(1, 1);\n            const b12 = other.get(1, 2);\n            const b20 = other.get(2, 0);\n            const b21 = other.get(2, 1);\n            const b22 = other.get(2, 2);\n\n            const m1 = (a00 + a01 + a02 - a10 - a11 - a21 - a22) * b11;\n            const m2 = (a00 - a10) * (-b01 + b11);\n            const m3 = a11 * (-b00 + b01 + b10 - b11 - b12 - b20 + b22);\n            const m4 = (-a00 + a10 + a11) * (b00 - b01 + b11);\n            const m5 = (a10 + a11) * (-b00 + b01);\n            const m6 = a00 * b00;\n            const m7 = (-a00 + a20 + a21) * (b00 - b02 + b12);\n            const m8 = (-a00 + a20) * (b02 - b12);\n            const m9 = (a20 + a21) * (-b00 + b02);\n            const m10 = (a00 + a01 + a02 - a11 - a12 - a20 - a21) * b12;\n            const m11 = a21 * (-b00 + b02 + b10 - b11 - b12 - b20 + b21);\n            const m12 = (-a02 + a21 + a22) * (b11 + b20 - b21);\n            const m13 = (a02 - a22) * (b11 - b21);\n            const m14 = a02 * b20;\n            const m15 = (a21 + a22) * (-b20 + b21);\n            const m16 = (-a02 + a11 + a12) * (b12 + b20 - b22);\n            const m17 = (a02 - a12) * (b12 - b22);\n            const m18 = (a11 + a12) * (-b20 + b22);\n            const m19 = a01 * b10;\n            const m20 = a12 * b21;\n            const m21 = a10 * b02;\n            const m22 = a20 * b01;\n            const m23 = a22 * b22;\n\n            const c00 = m6 + m14 + m19;\n            const c01 = m1 + m4 + m5 + m6 + m12 + m14 + m15;\n            const c02 = m6 + m7 + m9 + m10 + m14 + m16 + m18;\n            const c10 = m2 + m3 + m4 + m6 + m14 + m16 + m17;\n            const c11 = m2 + m4 + m5 + m6 + m20;\n            const c12 = m14 + m16 + m17 + m18 + m21;\n            const c20 = m6 + m7 + m8 + m11 + m12 + m13 + m14;\n            const c21 = m12 + m13 + m14 + m15 + m22;\n            const c22 = m6 + m7 + m8 + m9 + m23;\n\n            result.set(0, 0, c00);\n            result.set(0, 1, c01);\n            result.set(0, 2, c02);\n            result.set(1, 0, c10);\n            result.set(1, 1, c11);\n            result.set(1, 2, c12);\n            result.set(2, 0, c20);\n            result.set(2, 1, c21);\n            result.set(2, 2, c22);\n            return result;\n        }\n\n        /**\n         * Returns the matrix product between x and y. More efficient than mmul(other) only when we multiply squared matrix and when the size of the matrix is > 1000.\n         * @param {Matrix} y\n         * @return {Matrix}\n         */\n        mmulStrassen(y) {\n            var x = this.clone();\n            var r1 = x.rows;\n            var c1 = x.columns;\n            var r2 = y.rows;\n            var c2 = y.columns;\n            if (c1 !== r2) {\n                // eslint-disable-next-line no-console\n                console.warn(`Multiplying ${r1} x ${c1} and ${r2} x ${c2} matrix: dimensions do not match.`);\n            }\n\n            // Put a matrix into the top left of a matrix of zeros.\n            // `rows` and `cols` are the dimensions of the output matrix.\n            function embed(mat, rows, cols) {\n                var r = mat.rows;\n                var c = mat.columns;\n                if ((r === rows) && (c === cols)) {\n                    return mat;\n                } else {\n                    var resultat = Matrix.zeros(rows, cols);\n                    resultat = resultat.setSubMatrix(mat, 0, 0);\n                    return resultat;\n                }\n            }\n\n\n            // Make sure both matrices are the same size.\n            // This is exclusively for simplicity:\n            // this algorithm can be implemented with matrices of different sizes.\n\n            var r = Math.max(r1, r2);\n            var c = Math.max(c1, c2);\n            x = embed(x, r, c);\n            y = embed(y, r, c);\n\n            // Our recursive multiplication function.\n            function blockMult(a, b, rows, cols) {\n                // For small matrices, resort to naive multiplication.\n                if (rows <= 512 || cols <= 512) {\n                    return a.mmul(b); // a is equivalent to this\n                }\n\n                // Apply dynamic padding.\n                if ((rows % 2 === 1) && (cols % 2 === 1)) {\n                    a = embed(a, rows + 1, cols + 1);\n                    b = embed(b, rows + 1, cols + 1);\n                } else if (rows % 2 === 1) {\n                    a = embed(a, rows + 1, cols);\n                    b = embed(b, rows + 1, cols);\n                } else if (cols % 2 === 1) {\n                    a = embed(a, rows, cols + 1);\n                    b = embed(b, rows, cols + 1);\n                }\n\n                var halfRows = parseInt(a.rows / 2);\n                var halfCols = parseInt(a.columns / 2);\n                // Subdivide input matrices.\n                var a11 = a.subMatrix(0, halfRows - 1, 0, halfCols - 1);\n                var b11 = b.subMatrix(0, halfRows - 1, 0, halfCols - 1);\n\n                var a12 = a.subMatrix(0, halfRows - 1, halfCols, a.columns - 1);\n                var b12 = b.subMatrix(0, halfRows - 1, halfCols, b.columns - 1);\n\n                var a21 = a.subMatrix(halfRows, a.rows - 1, 0, halfCols - 1);\n                var b21 = b.subMatrix(halfRows, b.rows - 1, 0, halfCols - 1);\n\n                var a22 = a.subMatrix(halfRows, a.rows - 1, halfCols, a.columns - 1);\n                var b22 = b.subMatrix(halfRows, b.rows - 1, halfCols, b.columns - 1);\n\n                // Compute intermediate values.\n                var m1 = blockMult(Matrix.add(a11, a22), Matrix.add(b11, b22), halfRows, halfCols);\n                var m2 = blockMult(Matrix.add(a21, a22), b11, halfRows, halfCols);\n                var m3 = blockMult(a11, Matrix.sub(b12, b22), halfRows, halfCols);\n                var m4 = blockMult(a22, Matrix.sub(b21, b11), halfRows, halfCols);\n                var m5 = blockMult(Matrix.add(a11, a12), b22, halfRows, halfCols);\n                var m6 = blockMult(Matrix.sub(a21, a11), Matrix.add(b11, b12), halfRows, halfCols);\n                var m7 = blockMult(Matrix.sub(a12, a22), Matrix.add(b21, b22), halfRows, halfCols);\n\n                // Combine intermediate values into the output.\n                var c11 = Matrix.add(m1, m4);\n                c11.sub(m5);\n                c11.add(m7);\n                var c12 = Matrix.add(m3, m5);\n                var c21 = Matrix.add(m2, m4);\n                var c22 = Matrix.sub(m1, m2);\n                c22.add(m3);\n                c22.add(m6);\n\n                //Crop output to the desired size (undo dynamic padding).\n                var resultat = Matrix.zeros(2 * c11.rows, 2 * c11.columns);\n                resultat = resultat.setSubMatrix(c11, 0, 0);\n                resultat = resultat.setSubMatrix(c12, c11.rows, 0);\n                resultat = resultat.setSubMatrix(c21, 0, c11.columns);\n                resultat = resultat.setSubMatrix(c22, c11.rows, c11.columns);\n                return resultat.subMatrix(0, rows - 1, 0, cols - 1);\n            }\n            return blockMult(x, y, r, c);\n        }\n\n        /**\n         * Returns a row-by-row scaled matrix\n         * @param {number} [min=0] - Minimum scaled value\n         * @param {number} [max=1] - Maximum scaled value\n         * @return {Matrix} - The scaled matrix\n         */\n        scaleRows(min, max) {\n            min = min === undefined ? 0 : min;\n            max = max === undefined ? 1 : max;\n            if (min >= max) {\n                throw new RangeError('min should be strictly smaller than max');\n            }\n            var newMatrix = this.constructor.empty(this.rows, this.columns);\n            for (var i = 0; i < this.rows; i++) {\n                var scaled = arrayUtils.scale(this.getRow(i), {min, max});\n                newMatrix.setRow(i, scaled);\n            }\n            return newMatrix;\n        }\n\n        /**\n         * Returns a new column-by-column scaled matrix\n         * @param {number} [min=0] - Minimum scaled value\n         * @param {number} [max=1] - Maximum scaled value\n         * @return {Matrix} - The new scaled matrix\n         * @example\n         * var matrix = new Matrix([[1,2],[-1,0]]);\n         * var scaledMatrix = matrix.scaleColumns(); // [[1,1],[0,0]]\n         */\n        scaleColumns(min, max) {\n            min = min === undefined ? 0 : min;\n            max = max === undefined ? 1 : max;\n            if (min >= max) {\n                throw new RangeError('min should be strictly smaller than max');\n            }\n            var newMatrix = this.constructor.empty(this.rows, this.columns);\n            for (var i = 0; i < this.columns; i++) {\n                var scaled = arrayUtils.scale(this.getColumn(i), {\n                    min: min,\n                    max: max\n                });\n                newMatrix.setColumn(i, scaled);\n            }\n            return newMatrix;\n        }\n\n\n        /**\n         * Returns the Kronecker product (also known as tensor product) between this and other\n         * See https://en.wikipedia.org/wiki/Kronecker_product\n         * @param {Matrix} other\n         * @return {Matrix}\n         */\n        kroneckerProduct(other) {\n            other = this.constructor.checkMatrix(other);\n\n            var m = this.rows;\n            var n = this.columns;\n            var p = other.rows;\n            var q = other.columns;\n\n            var result = new this.constructor[Symbol.species](m * p, n * q);\n            for (var i = 0; i < m; i++) {\n                for (var j = 0; j < n; j++) {\n                    for (var k = 0; k < p; k++) {\n                        for (var l = 0; l < q; l++) {\n                            result[p * i + k][q * j + l] = this.get(i, j) * other.get(k, l);\n                        }\n                    }\n                }\n            }\n            return result;\n        }\n\n        /**\n         * Transposes the matrix and returns a new one containing the result\n         * @return {Matrix}\n         */\n        transpose() {\n            var result = new this.constructor[Symbol.species](this.columns, this.rows);\n            for (var i = 0; i < this.rows; i++) {\n                for (var j = 0; j < this.columns; j++) {\n                    result.set(j, i, this.get(i, j));\n                }\n            }\n            return result;\n        }\n\n        /**\n         * Sorts the rows (in place)\n         * @param {function} compareFunction - usual Array.prototype.sort comparison function\n         * @return {Matrix} this\n         */\n        sortRows(compareFunction) {\n            if (compareFunction === undefined) compareFunction = compareNumbers;\n            for (var i = 0; i < this.rows; i++) {\n                this.setRow(i, this.getRow(i).sort(compareFunction));\n            }\n            return this;\n        }\n\n        /**\n         * Sorts the columns (in place)\n         * @param {function} compareFunction - usual Array.prototype.sort comparison function\n         * @return {Matrix} this\n         */\n        sortColumns(compareFunction) {\n            if (compareFunction === undefined) compareFunction = compareNumbers;\n            for (var i = 0; i < this.columns; i++) {\n                this.setColumn(i, this.getColumn(i).sort(compareFunction));\n            }\n            return this;\n        }\n\n        /**\n         * Returns a subset of the matrix\n         * @param {number} startRow - First row index\n         * @param {number} endRow - Last row index\n         * @param {number} startColumn - First column index\n         * @param {number} endColumn - Last column index\n         * @return {Matrix}\n         */\n        subMatrix(startRow, endRow, startColumn, endColumn) {\n            util.checkRange(this, startRow, endRow, startColumn, endColumn);\n            var newMatrix = new this.constructor[Symbol.species](endRow - startRow + 1, endColumn - startColumn + 1);\n            for (var i = startRow; i <= endRow; i++) {\n                for (var j = startColumn; j <= endColumn; j++) {\n                    newMatrix[i - startRow][j - startColumn] = this.get(i, j);\n                }\n            }\n            return newMatrix;\n        }\n\n        /**\n         * Returns a subset of the matrix based on an array of row indices\n         * @param {Array} indices - Array containing the row indices\n         * @param {number} [startColumn = 0] - First column index\n         * @param {number} [endColumn = this.columns-1] - Last column index\n         * @return {Matrix}\n         */\n        subMatrixRow(indices, startColumn, endColumn) {\n            if (startColumn === undefined) startColumn = 0;\n            if (endColumn === undefined) endColumn = this.columns - 1;\n            if ((startColumn > endColumn) || (startColumn < 0) || (startColumn >= this.columns) || (endColumn < 0) || (endColumn >= this.columns)) {\n                throw new RangeError('Argument out of range');\n            }\n\n            var newMatrix = new this.constructor[Symbol.species](indices.length, endColumn - startColumn + 1);\n            for (var i = 0; i < indices.length; i++) {\n                for (var j = startColumn; j <= endColumn; j++) {\n                    if (indices[i] < 0 || indices[i] >= this.rows) {\n                        throw new RangeError('Row index out of range: ' + indices[i]);\n                    }\n                    newMatrix.set(i, j - startColumn, this.get(indices[i], j));\n                }\n            }\n            return newMatrix;\n        }\n\n        /**\n         * Returns a subset of the matrix based on an array of column indices\n         * @param {Array} indices - Array containing the column indices\n         * @param {number} [startRow = 0] - First row index\n         * @param {number} [endRow = this.rows-1] - Last row index\n         * @return {Matrix}\n         */\n        subMatrixColumn(indices, startRow, endRow) {\n            if (startRow === undefined) startRow = 0;\n            if (endRow === undefined) endRow = this.rows - 1;\n            if ((startRow > endRow) || (startRow < 0) || (startRow >= this.rows) || (endRow < 0) || (endRow >= this.rows)) {\n                throw new RangeError('Argument out of range');\n            }\n\n            var newMatrix = new this.constructor[Symbol.species](endRow - startRow + 1, indices.length);\n            for (var i = 0; i < indices.length; i++) {\n                for (var j = startRow; j <= endRow; j++) {\n                    if (indices[i] < 0 || indices[i] >= this.columns) {\n                        throw new RangeError('Column index out of range: ' + indices[i]);\n                    }\n                    newMatrix.set(j - startRow, i, this.get(j, indices[i]));\n                }\n            }\n            return newMatrix;\n        }\n\n        /**\n         * Set a part of the matrix to the given sub-matrix\n         * @param {Matrix|Array< Array >} matrix - The source matrix from which to extract values.\n         * @param {number} startRow - The index of the first row to set\n         * @param {number} startColumn - The index of the first column to set\n         * @return {Matrix}\n         */\n        setSubMatrix(matrix, startRow, startColumn) {\n            matrix = this.constructor.checkMatrix(matrix);\n            var endRow = startRow + matrix.rows - 1;\n            var endColumn = startColumn + matrix.columns - 1;\n            util.checkRange(this, startRow, endRow, startColumn, endColumn);\n            for (var i = 0; i < matrix.rows; i++) {\n                for (var j = 0; j < matrix.columns; j++) {\n                    this[startRow + i][startColumn + j] = matrix.get(i, j);\n                }\n            }\n            return this;\n        }\n\n        /**\n         * Return a new matrix based on a selection of rows and columns\n         * @param {Array<number>} rowIndices - The row indices to select. Order matters and an index can be more than once.\n         * @param {Array<number>} columnIndices - The column indices to select. Order matters and an index can be use more than once.\n         * @return {Matrix} The new matrix\n         */\n        selection(rowIndices, columnIndices) {\n            var indices = util.checkIndices(this, rowIndices, columnIndices);\n            var newMatrix = new this.constructor[Symbol.species](rowIndices.length, columnIndices.length);\n            for (var i = 0; i < indices.row.length; i++) {\n                var rowIndex = indices.row[i];\n                for (var j = 0; j < indices.column.length; j++) {\n                    var columnIndex = indices.column[j];\n                    newMatrix[i][j] = this.get(rowIndex, columnIndex);\n                }\n            }\n            return newMatrix;\n        }\n\n        /**\n         * Returns the trace of the matrix (sum of the diagonal elements)\n         * @return {number}\n         */\n        trace() {\n            var min = Math.min(this.rows, this.columns);\n            var trace = 0;\n            for (var i = 0; i < min; i++) {\n                trace += this.get(i, i);\n            }\n            return trace;\n        }\n\n        /*\n         Matrix views\n         */\n\n        /**\n         * Returns a view of the transposition of the matrix\n         * @return {MatrixTransposeView}\n         */\n        transposeView() {\n            return new MatrixTransposeView(this);\n        }\n\n        /**\n         * Returns a view of the row vector with the given index\n         * @param {number} row - row index of the vector\n         * @return {MatrixRowView}\n         */\n        rowView(row) {\n            util.checkRowIndex(this, row);\n            return new MatrixRowView(this, row);\n        }\n\n        /**\n         * Returns a view of the column vector with the given index\n         * @param {number} column - column index of the vector\n         * @return {MatrixColumnView}\n         */\n        columnView(column) {\n            util.checkColumnIndex(this, column);\n            return new MatrixColumnView(this, column);\n        }\n\n        /**\n         * Returns a view of the matrix flipped in the row axis\n         * @return {MatrixFlipRowView}\n         */\n        flipRowView() {\n            return new MatrixFlipRowView(this);\n        }\n\n        /**\n         * Returns a view of the matrix flipped in the column axis\n         * @return {MatrixFlipColumnView}\n         */\n        flipColumnView() {\n            return new MatrixFlipColumnView(this);\n        }\n\n        /**\n         * Returns a view of a submatrix giving the index boundaries\n         * @param {number} startRow - first row index of the submatrix\n         * @param {number} endRow - last row index of the submatrix\n         * @param {number} startColumn - first column index of the submatrix\n         * @param {number} endColumn - last column index of the submatrix\n         * @return {MatrixSubView}\n         */\n        subMatrixView(startRow, endRow, startColumn, endColumn) {\n            return new MatrixSubView(this, startRow, endRow, startColumn, endColumn);\n        }\n\n        /**\n         * Returns a view of the cross of the row indices and the column indices\n         * @example\n         * // resulting vector is [[2], [2]]\n         * var matrix = new Matrix([[1,2,3], [4,5,6]]).selectionView([0, 0], [1])\n         * @param {Array<number>} rowIndices\n         * @param {Array<number>} columnIndices\n         * @return {MatrixSelectionView}\n         */\n        selectionView(rowIndices, columnIndices) {\n            return new MatrixSelectionView(this, rowIndices, columnIndices);\n        }\n\n\n        /**\n        * Calculates and returns the determinant of a matrix as a Number\n        * @example\n        *   new Matrix([[1,2,3], [4,5,6]]).det()\n        * @return {number}\n        */\n        det() {\n            if (this.isSquare()) {\n                var a, b, c, d;\n                if (this.columns === 2) {\n                    // 2 x 2 matrix\n                    a = this.get(0, 0);\n                    b = this.get(0, 1);\n                    c = this.get(1, 0);\n                    d = this.get(1, 1);\n\n                    return a * d - (b * c);\n                } else if (this.columns === 3) {\n                    // 3 x 3 matrix\n                    var subMatrix0, subMatrix1, subMatrix2;\n                    subMatrix0 = this.selectionView([1, 2], [1, 2]);\n                    subMatrix1 = this.selectionView([1, 2], [0, 2]);\n                    subMatrix2 = this.selectionView([1, 2], [0, 1]);\n                    a = this.get(0, 0);\n                    b = this.get(0, 1);\n                    c = this.get(0, 2);\n\n                    return a * subMatrix0.det() - b * subMatrix1.det() + c * subMatrix2.det();\n                } else {\n                    // general purpose determinant using the LU decomposition\n                    return new LuDecomposition(this).determinant;\n                }\n\n            } else {\n                throw Error('Determinant can only be calculated for a square matrix.');\n            }\n        }\n\n        /**\n         * Returns inverse of a matrix if it exists or the pseudoinverse\n         * @param {number} threshold - threshold for taking inverse of singular values (default = 1e-15)\n         * @return {Matrix} the (pseudo)inverted matrix.\n         */\n        pseudoInverse(threshold) {\n            if (threshold === undefined) threshold = Number.EPSILON;\n            var svdSolution = new SvDecomposition(this, {autoTranspose: true});\n\n            var U = svdSolution.leftSingularVectors;\n            var V = svdSolution.rightSingularVectors;\n            var s = svdSolution.diagonal;\n\n            for (var i = 0; i < s.length; i++) {\n                if (Math.abs(s[i]) > threshold) {\n                    s[i] = 1.0 / s[i];\n                } else {\n                    s[i] = 0.0;\n                }\n            }\n\n            // convert list to diagonal\n            s = this.constructor[Symbol.species].diag(s);\n            return V.mmul(s.mmul(U.transposeView()));\n        }\n    }\n\n    Matrix.prototype.klass = 'Matrix';\n\n    /**\n     * @private\n     * Check that two matrices have the same dimensions\n     * @param {Matrix} matrix\n     * @param {Matrix} otherMatrix\n     */\n    function checkDimensions(matrix, otherMatrix) { // eslint-disable-line no-unused-vars\n        if (matrix.rows !== otherMatrix.rows ||\n            matrix.columns !== otherMatrix.columns) {\n            throw new RangeError('Matrices dimensions must be equal');\n        }\n    }\n\n    function compareNumbers(a, b) {\n        return a - b;\n    }\n\n    /*\n     Synonyms\n     */\n\n    Matrix.random = Matrix.rand;\n    Matrix.diagonal = Matrix.diag;\n    Matrix.prototype.diagonal = Matrix.prototype.diag;\n    Matrix.identity = Matrix.eye;\n    Matrix.prototype.negate = Matrix.prototype.neg;\n    Matrix.prototype.tensorProduct = Matrix.prototype.kroneckerProduct;\n    Matrix.prototype.determinant = Matrix.prototype.det;\n\n    /*\n     Add dynamically instance and static methods for mathematical operations\n     */\n\n    var inplaceOperator = `\n(function %name%(value) {\n    if (typeof value === 'number') return this.%name%S(value);\n    return this.%name%M(value);\n})\n`;\n\n    var inplaceOperatorScalar = `\n(function %name%S(value) {\n    for (var i = 0; i < this.rows; i++) {\n        for (var j = 0; j < this.columns; j++) {\n            this.set(i, j, this.get(i, j) %op% value);\n        }\n    }\n    return this;\n})\n`;\n\n    var inplaceOperatorMatrix = `\n(function %name%M(matrix) {\n    matrix = this.constructor.checkMatrix(matrix);\n    checkDimensions(this, matrix);\n    for (var i = 0; i < this.rows; i++) {\n        for (var j = 0; j < this.columns; j++) {\n            this.set(i, j, this.get(i, j) %op% matrix.get(i, j));\n        }\n    }\n    return this;\n})\n`;\n\n    var staticOperator = `\n(function %name%(matrix, value) {\n    var newMatrix = new this[Symbol.species](matrix);\n    return newMatrix.%name%(value);\n})\n`;\n\n    var inplaceMethod = `\n(function %name%() {\n    for (var i = 0; i < this.rows; i++) {\n        for (var j = 0; j < this.columns; j++) {\n            this.set(i, j, %method%(this.get(i, j)));\n        }\n    }\n    return this;\n})\n`;\n\n    var staticMethod = `\n(function %name%(matrix) {\n    var newMatrix = new this[Symbol.species](matrix);\n    return newMatrix.%name%();\n})\n`;\n\n    var inplaceMethodWithArgs = `\n(function %name%(%args%) {\n    for (var i = 0; i < this.rows; i++) {\n        for (var j = 0; j < this.columns; j++) {\n            this.set(i, j, %method%(this.get(i, j), %args%));\n        }\n    }\n    return this;\n})\n`;\n\n    var staticMethodWithArgs = `\n(function %name%(matrix, %args%) {\n    var newMatrix = new this[Symbol.species](matrix);\n    return newMatrix.%name%(%args%);\n})\n`;\n\n\n    var inplaceMethodWithOneArgScalar = `\n(function %name%S(value) {\n    for (var i = 0; i < this.rows; i++) {\n        for (var j = 0; j < this.columns; j++) {\n            this.set(i, j, %method%(this.get(i, j), value));\n        }\n    }\n    return this;\n})\n`;\n    var inplaceMethodWithOneArgMatrix = `\n(function %name%M(matrix) {\n    matrix = this.constructor.checkMatrix(matrix);\n    checkDimensions(this, matrix);\n    for (var i = 0; i < this.rows; i++) {\n        for (var j = 0; j < this.columns; j++) {\n            this.set(i, j, %method%(this.get(i, j), matrix.get(i, j)));\n        }\n    }\n    return this;\n})\n`;\n\n    var inplaceMethodWithOneArg = `\n(function %name%(value) {\n    if (typeof value === 'number') return this.%name%S(value);\n    return this.%name%M(value);\n})\n`;\n\n    var staticMethodWithOneArg = staticMethodWithArgs;\n\n    var operators = [\n        // Arithmetic operators\n        ['+', 'add'],\n        ['-', 'sub', 'subtract'],\n        ['*', 'mul', 'multiply'],\n        ['/', 'div', 'divide'],\n        ['%', 'mod', 'modulus'],\n        // Bitwise operators\n        ['&', 'and'],\n        ['|', 'or'],\n        ['^', 'xor'],\n        ['<<', 'leftShift'],\n        ['>>', 'signPropagatingRightShift'],\n        ['>>>', 'rightShift', 'zeroFillRightShift']\n    ];\n\n    var i;\n\n    for (var operator of operators) {\n        var inplaceOp = eval(fillTemplateFunction(inplaceOperator, {name: operator[1], op: operator[0]}));\n        var inplaceOpS = eval(fillTemplateFunction(inplaceOperatorScalar, {name: operator[1] + 'S', op: operator[0]}));\n        var inplaceOpM = eval(fillTemplateFunction(inplaceOperatorMatrix, {name: operator[1] + 'M', op: operator[0]}));\n        var staticOp = eval(fillTemplateFunction(staticOperator, {name: operator[1]}));\n        for (i = 1; i < operator.length; i++) {\n            Matrix.prototype[operator[i]] = inplaceOp;\n            Matrix.prototype[operator[i] + 'S'] = inplaceOpS;\n            Matrix.prototype[operator[i] + 'M'] = inplaceOpM;\n            Matrix[operator[i]] = staticOp;\n        }\n    }\n\n    var methods = [\n        ['~', 'not']\n    ];\n\n    [\n        'abs', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atanh', 'cbrt', 'ceil',\n        'clz32', 'cos', 'cosh', 'exp', 'expm1', 'floor', 'fround', 'log', 'log1p',\n        'log10', 'log2', 'round', 'sign', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'trunc'\n    ].forEach(function (mathMethod) {\n        methods.push(['Math.' + mathMethod, mathMethod]);\n    });\n\n    for (var method of methods) {\n        var inplaceMeth = eval(fillTemplateFunction(inplaceMethod, {name: method[1], method: method[0]}));\n        var staticMeth = eval(fillTemplateFunction(staticMethod, {name: method[1]}));\n        for (i = 1; i < method.length; i++) {\n            Matrix.prototype[method[i]] = inplaceMeth;\n            Matrix[method[i]] = staticMeth;\n        }\n    }\n\n    var methodsWithArgs = [\n        ['Math.pow', 1, 'pow']\n    ];\n\n    for (var methodWithArg of methodsWithArgs) {\n        var args = 'arg0';\n        for (i = 1; i < methodWithArg[1]; i++) {\n            args += `, arg${i}`;\n        }\n        if (methodWithArg[1] !== 1) {\n            var inplaceMethWithArgs = eval(fillTemplateFunction(inplaceMethodWithArgs, {\n                name: methodWithArg[2],\n                method: methodWithArg[0],\n                args: args\n            }));\n            var staticMethWithArgs = eval(fillTemplateFunction(staticMethodWithArgs, {name: methodWithArg[2], args: args}));\n            for (i = 2; i < methodWithArg.length; i++) {\n                Matrix.prototype[methodWithArg[i]] = inplaceMethWithArgs;\n                Matrix[methodWithArg[i]] = staticMethWithArgs;\n            }\n        } else {\n            var tmplVar = {\n                name: methodWithArg[2],\n                args: args,\n                method: methodWithArg[0]\n            };\n            var inplaceMethod2 = eval(fillTemplateFunction(inplaceMethodWithOneArg, tmplVar));\n            var inplaceMethodS = eval(fillTemplateFunction(inplaceMethodWithOneArgScalar, tmplVar));\n            var inplaceMethodM = eval(fillTemplateFunction(inplaceMethodWithOneArgMatrix, tmplVar));\n            var staticMethod2 = eval(fillTemplateFunction(staticMethodWithOneArg, tmplVar));\n            for (i = 2; i < methodWithArg.length; i++) {\n                Matrix.prototype[methodWithArg[i]] = inplaceMethod2;\n                Matrix.prototype[methodWithArg[i] + 'M'] = inplaceMethodM;\n                Matrix.prototype[methodWithArg[i] + 'S'] = inplaceMethodS;\n                Matrix[methodWithArg[i]] = staticMethod2;\n            }\n        }\n    }\n\n    function fillTemplateFunction(template, values) {\n        for (var value in values) {\n            template = template.replace(new RegExp('%' + value + '%', 'g'), values[value]);\n        }\n        return template;\n    }\n\n    return Matrix;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-matrix/src/abstractMatrix.js","'use strict';\n\nvar Matrix = require('../matrix');\n\n// https://github.com/lutzroeder/Mapack/blob/master/Source/LuDecomposition.cs\nfunction LuDecomposition(matrix) {\n    if (!(this instanceof LuDecomposition)) {\n        return new LuDecomposition(matrix);\n    }\n\n    matrix = Matrix.Matrix.checkMatrix(matrix);\n\n    var lu = matrix.clone(),\n        rows = lu.rows,\n        columns = lu.columns,\n        pivotVector = new Array(rows),\n        pivotSign = 1,\n        i, j, k, p, s, t, v,\n        LUrowi, LUcolj, kmax;\n\n    for (i = 0; i < rows; i++) {\n        pivotVector[i] = i;\n    }\n\n    LUcolj = new Array(rows);\n\n    for (j = 0; j < columns; j++) {\n\n        for (i = 0; i < rows; i++) {\n            LUcolj[i] = lu[i][j];\n        }\n\n        for (i = 0; i < rows; i++) {\n            LUrowi = lu[i];\n            kmax = Math.min(i, j);\n            s = 0;\n            for (k = 0; k < kmax; k++) {\n                s += LUrowi[k] * LUcolj[k];\n            }\n            LUrowi[j] = LUcolj[i] -= s;\n        }\n\n        p = j;\n        for (i = j + 1; i < rows; i++) {\n            if (Math.abs(LUcolj[i]) > Math.abs(LUcolj[p])) {\n                p = i;\n            }\n        }\n\n        if (p !== j) {\n            for (k = 0; k < columns; k++) {\n                t = lu[p][k];\n                lu[p][k] = lu[j][k];\n                lu[j][k] = t;\n            }\n\n            v = pivotVector[p];\n            pivotVector[p] = pivotVector[j];\n            pivotVector[j] = v;\n\n            pivotSign = -pivotSign;\n        }\n\n        if (j < rows && lu[j][j] !== 0) {\n            for (i = j + 1; i < rows; i++) {\n                lu[i][j] /= lu[j][j];\n            }\n        }\n    }\n\n    this.LU = lu;\n    this.pivotVector = pivotVector;\n    this.pivotSign = pivotSign;\n}\n\nLuDecomposition.prototype = {\n    isSingular: function () {\n        var data = this.LU,\n            col = data.columns;\n        for (var j = 0; j < col; j++) {\n            if (data[j][j] === 0) {\n                return true;\n            }\n        }\n        return false;\n    },\n    get determinant() {\n        var data = this.LU;\n        if (!data.isSquare()) {\n            throw new Error('Matrix must be square');\n        }\n        var determinant = this.pivotSign, col = data.columns;\n        for (var j = 0; j < col; j++) {\n            determinant *= data[j][j];\n        }\n        return determinant;\n    },\n    get lowerTriangularMatrix() {\n        var data = this.LU,\n            rows = data.rows,\n            columns = data.columns,\n            X = new Matrix.Matrix(rows, columns);\n        for (var i = 0; i < rows; i++) {\n            for (var j = 0; j < columns; j++) {\n                if (i > j) {\n                    X[i][j] = data[i][j];\n                } else if (i === j) {\n                    X[i][j] = 1;\n                } else {\n                    X[i][j] = 0;\n                }\n            }\n        }\n        return X;\n    },\n    get upperTriangularMatrix() {\n        var data = this.LU,\n            rows = data.rows,\n            columns = data.columns,\n            X = new Matrix.Matrix(rows, columns);\n        for (var i = 0; i < rows; i++) {\n            for (var j = 0; j < columns; j++) {\n                if (i <= j) {\n                    X[i][j] = data[i][j];\n                } else {\n                    X[i][j] = 0;\n                }\n            }\n        }\n        return X;\n    },\n    get pivotPermutationVector() {\n        return this.pivotVector.slice();\n    },\n    solve: function (value) {\n        value = Matrix.Matrix.checkMatrix(value);\n\n        var lu = this.LU,\n            rows = lu.rows;\n\n        if (rows !== value.rows) {\n            throw new Error('Invalid matrix dimensions');\n        }\n        if (this.isSingular()) {\n            throw new Error('LU matrix is singular');\n        }\n\n        var count = value.columns;\n        var X = value.subMatrixRow(this.pivotVector, 0, count - 1);\n        var columns = lu.columns;\n        var i, j, k;\n\n        for (k = 0; k < columns; k++) {\n            for (i = k + 1; i < columns; i++) {\n                for (j = 0; j < count; j++) {\n                    X[i][j] -= X[k][j] * lu[i][k];\n                }\n            }\n        }\n        for (k = columns - 1; k >= 0; k--) {\n            for (j = 0; j < count; j++) {\n                X[k][j] /= lu[k][k];\n            }\n            for (i = 0; i < k; i++) {\n                for (j = 0; j < count; j++) {\n                    X[i][j] -= X[k][j] * lu[i][k];\n                }\n            }\n        }\n        return X;\n    }\n};\n\nmodule.exports = LuDecomposition;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-matrix/src/dc/lu.js","'use strict';\n\nvar Matrix = require('../matrix');\nvar util = require('./util');\nvar hypotenuse = util.hypotenuse;\nvar getFilled2DArray = util.getFilled2DArray;\n\n// https://github.com/lutzroeder/Mapack/blob/master/Source/SingularValueDecomposition.cs\nfunction SingularValueDecomposition(value, options) {\n    if (!(this instanceof SingularValueDecomposition)) {\n        return new SingularValueDecomposition(value, options);\n    }\n    value = Matrix.Matrix.checkMatrix(value);\n\n    options = options || {};\n\n    var m = value.rows,\n        n = value.columns,\n        nu = Math.min(m, n);\n\n    var wantu = true, wantv = true;\n    if (options.computeLeftSingularVectors === false) wantu = false;\n    if (options.computeRightSingularVectors === false) wantv = false;\n    var autoTranspose = options.autoTranspose === true;\n\n    var swapped = false;\n    var a;\n    if (m < n) {\n        if (!autoTranspose) {\n            a = value.clone();\n            // eslint-disable-next-line no-console\n            console.warn('Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose');\n        } else {\n            a = value.transpose();\n            m = a.rows;\n            n = a.columns;\n            swapped = true;\n            var aux = wantu;\n            wantu = wantv;\n            wantv = aux;\n        }\n    } else {\n        a = value.clone();\n    }\n\n    var s = new Array(Math.min(m + 1, n)),\n        U = getFilled2DArray(m, nu, 0),\n        V = getFilled2DArray(n, n, 0),\n        e = new Array(n),\n        work = new Array(m);\n\n    var nct = Math.min(m - 1, n);\n    var nrt = Math.max(0, Math.min(n - 2, m));\n\n    var i, j, k, p, t, ks, f, cs, sn, max, kase,\n        scale, sp, spm1, epm1, sk, ek, b, c, shift, g;\n\n    for (k = 0, max = Math.max(nct, nrt); k < max; k++) {\n        if (k < nct) {\n            s[k] = 0;\n            for (i = k; i < m; i++) {\n                s[k] = hypotenuse(s[k], a[i][k]);\n            }\n            if (s[k] !== 0) {\n                if (a[k][k] < 0) {\n                    s[k] = -s[k];\n                }\n                for (i = k; i < m; i++) {\n                    a[i][k] /= s[k];\n                }\n                a[k][k] += 1;\n            }\n            s[k] = -s[k];\n        }\n\n        for (j = k + 1; j < n; j++) {\n            if ((k < nct) && (s[k] !== 0)) {\n                t = 0;\n                for (i = k; i < m; i++) {\n                    t += a[i][k] * a[i][j];\n                }\n                t = -t / a[k][k];\n                for (i = k; i < m; i++) {\n                    a[i][j] += t * a[i][k];\n                }\n            }\n            e[j] = a[k][j];\n        }\n\n        if (wantu && (k < nct)) {\n            for (i = k; i < m; i++) {\n                U[i][k] = a[i][k];\n            }\n        }\n\n        if (k < nrt) {\n            e[k] = 0;\n            for (i = k + 1; i < n; i++) {\n                e[k] = hypotenuse(e[k], e[i]);\n            }\n            if (e[k] !== 0) {\n                if (e[k + 1] < 0) {\n                    e[k] = 0 - e[k];\n                }\n                for (i = k + 1; i < n; i++) {\n                    e[i] /= e[k];\n                }\n                e[k + 1] += 1;\n            }\n            e[k] = -e[k];\n            if ((k + 1 < m) && (e[k] !== 0)) {\n                for (i = k + 1; i < m; i++) {\n                    work[i] = 0;\n                }\n                for (j = k + 1; j < n; j++) {\n                    for (i = k + 1; i < m; i++) {\n                        work[i] += e[j] * a[i][j];\n                    }\n                }\n                for (j = k + 1; j < n; j++) {\n                    t = -e[j] / e[k + 1];\n                    for (i = k + 1; i < m; i++) {\n                        a[i][j] += t * work[i];\n                    }\n                }\n            }\n            if (wantv) {\n                for (i = k + 1; i < n; i++) {\n                    V[i][k] = e[i];\n                }\n            }\n        }\n    }\n\n    p = Math.min(n, m + 1);\n    if (nct < n) {\n        s[nct] = a[nct][nct];\n    }\n    if (m < p) {\n        s[p - 1] = 0;\n    }\n    if (nrt + 1 < p) {\n        e[nrt] = a[nrt][p - 1];\n    }\n    e[p - 1] = 0;\n\n    if (wantu) {\n        for (j = nct; j < nu; j++) {\n            for (i = 0; i < m; i++) {\n                U[i][j] = 0;\n            }\n            U[j][j] = 1;\n        }\n        for (k = nct - 1; k >= 0; k--) {\n            if (s[k] !== 0) {\n                for (j = k + 1; j < nu; j++) {\n                    t = 0;\n                    for (i = k; i < m; i++) {\n                        t += U[i][k] * U[i][j];\n                    }\n                    t = -t / U[k][k];\n                    for (i = k; i < m; i++) {\n                        U[i][j] += t * U[i][k];\n                    }\n                }\n                for (i = k; i < m; i++) {\n                    U[i][k] = -U[i][k];\n                }\n                U[k][k] = 1 + U[k][k];\n                for (i = 0; i < k - 1; i++) {\n                    U[i][k] = 0;\n                }\n            } else {\n                for (i = 0; i < m; i++) {\n                    U[i][k] = 0;\n                }\n                U[k][k] = 1;\n            }\n        }\n    }\n\n    if (wantv) {\n        for (k = n - 1; k >= 0; k--) {\n            if ((k < nrt) && (e[k] !== 0)) {\n                for (j = k + 1; j < n; j++) {\n                    t = 0;\n                    for (i = k + 1; i < n; i++) {\n                        t += V[i][k] * V[i][j];\n                    }\n                    t = -t / V[k + 1][k];\n                    for (i = k + 1; i < n; i++) {\n                        V[i][j] += t * V[i][k];\n                    }\n                }\n            }\n            for (i = 0; i < n; i++) {\n                V[i][k] = 0;\n            }\n            V[k][k] = 1;\n        }\n    }\n\n    var pp = p - 1,\n        iter = 0,\n        eps = Math.pow(2, -52);\n    while (p > 0) {\n        for (k = p - 2; k >= -1; k--) {\n            if (k === -1) {\n                break;\n            }\n            if (Math.abs(e[k]) <= eps * (Math.abs(s[k]) + Math.abs(s[k + 1]))) {\n                e[k] = 0;\n                break;\n            }\n        }\n        if (k === p - 2) {\n            kase = 4;\n        } else {\n            for (ks = p - 1; ks >= k; ks--) {\n                if (ks === k) {\n                    break;\n                }\n                t = (ks !== p ? Math.abs(e[ks]) : 0) + (ks !== k + 1 ? Math.abs(e[ks - 1]) : 0);\n                if (Math.abs(s[ks]) <= eps * t) {\n                    s[ks] = 0;\n                    break;\n                }\n            }\n            if (ks === k) {\n                kase = 3;\n            } else if (ks === p - 1) {\n                kase = 1;\n            } else {\n                kase = 2;\n                k = ks;\n            }\n        }\n\n        k++;\n\n        switch (kase) {\n            case 1: {\n                f = e[p - 2];\n                e[p - 2] = 0;\n                for (j = p - 2; j >= k; j--) {\n                    t = hypotenuse(s[j], f);\n                    cs = s[j] / t;\n                    sn = f / t;\n                    s[j] = t;\n                    if (j !== k) {\n                        f = -sn * e[j - 1];\n                        e[j - 1] = cs * e[j - 1];\n                    }\n                    if (wantv) {\n                        for (i = 0; i < n; i++) {\n                            t = cs * V[i][j] + sn * V[i][p - 1];\n                            V[i][p - 1] = -sn * V[i][j] + cs * V[i][p - 1];\n                            V[i][j] = t;\n                        }\n                    }\n                }\n                break;\n            }\n            case 2 : {\n                f = e[k - 1];\n                e[k - 1] = 0;\n                for (j = k; j < p; j++) {\n                    t = hypotenuse(s[j], f);\n                    cs = s[j] / t;\n                    sn = f / t;\n                    s[j] = t;\n                    f = -sn * e[j];\n                    e[j] = cs * e[j];\n                    if (wantu) {\n                        for (i = 0; i < m; i++) {\n                            t = cs * U[i][j] + sn * U[i][k - 1];\n                            U[i][k - 1] = -sn * U[i][j] + cs * U[i][k - 1];\n                            U[i][j] = t;\n                        }\n                    }\n                }\n                break;\n            }\n            case 3 : {\n                scale = Math.max(Math.max(Math.max(Math.max(Math.abs(s[p - 1]), Math.abs(s[p - 2])), Math.abs(e[p - 2])), Math.abs(s[k])), Math.abs(e[k]));\n                sp = s[p - 1] / scale;\n                spm1 = s[p - 2] / scale;\n                epm1 = e[p - 2] / scale;\n                sk = s[k] / scale;\n                ek = e[k] / scale;\n                b = ((spm1 + sp) * (spm1 - sp) + epm1 * epm1) / 2;\n                c = (sp * epm1) * (sp * epm1);\n                shift = 0;\n                if ((b !== 0) || (c !== 0)) {\n                    shift = Math.sqrt(b * b + c);\n                    if (b < 0) {\n                        shift = -shift;\n                    }\n                    shift = c / (b + shift);\n                }\n                f = (sk + sp) * (sk - sp) + shift;\n                g = sk * ek;\n                for (j = k; j < p - 1; j++) {\n                    t = hypotenuse(f, g);\n                    cs = f / t;\n                    sn = g / t;\n                    if (j !== k) {\n                        e[j - 1] = t;\n                    }\n                    f = cs * s[j] + sn * e[j];\n                    e[j] = cs * e[j] - sn * s[j];\n                    g = sn * s[j + 1];\n                    s[j + 1] = cs * s[j + 1];\n                    if (wantv) {\n                        for (i = 0; i < n; i++) {\n                            t = cs * V[i][j] + sn * V[i][j + 1];\n                            V[i][j + 1] = -sn * V[i][j] + cs * V[i][j + 1];\n                            V[i][j] = t;\n                        }\n                    }\n                    t = hypotenuse(f, g);\n                    cs = f / t;\n                    sn = g / t;\n                    s[j] = t;\n                    f = cs * e[j] + sn * s[j + 1];\n                    s[j + 1] = -sn * e[j] + cs * s[j + 1];\n                    g = sn * e[j + 1];\n                    e[j + 1] = cs * e[j + 1];\n                    if (wantu && (j < m - 1)) {\n                        for (i = 0; i < m; i++) {\n                            t = cs * U[i][j] + sn * U[i][j + 1];\n                            U[i][j + 1] = -sn * U[i][j] + cs * U[i][j + 1];\n                            U[i][j] = t;\n                        }\n                    }\n                }\n                e[p - 2] = f;\n                iter = iter + 1;\n                break;\n            }\n            case 4: {\n                if (s[k] <= 0) {\n                    s[k] = (s[k] < 0 ? -s[k] : 0);\n                    if (wantv) {\n                        for (i = 0; i <= pp; i++) {\n                            V[i][k] = -V[i][k];\n                        }\n                    }\n                }\n                while (k < pp) {\n                    if (s[k] >= s[k + 1]) {\n                        break;\n                    }\n                    t = s[k];\n                    s[k] = s[k + 1];\n                    s[k + 1] = t;\n                    if (wantv && (k < n - 1)) {\n                        for (i = 0; i < n; i++) {\n                            t = V[i][k + 1];\n                            V[i][k + 1] = V[i][k];\n                            V[i][k] = t;\n                        }\n                    }\n                    if (wantu && (k < m - 1)) {\n                        for (i = 0; i < m; i++) {\n                            t = U[i][k + 1];\n                            U[i][k + 1] = U[i][k];\n                            U[i][k] = t;\n                        }\n                    }\n                    k++;\n                }\n                iter = 0;\n                p--;\n                break;\n            }\n            // no default\n        }\n    }\n\n    if (swapped) {\n        var tmp = V;\n        V = U;\n        U = tmp;\n    }\n\n    this.m = m;\n    this.n = n;\n    this.s = s;\n    this.U = U;\n    this.V = V;\n}\n\nSingularValueDecomposition.prototype = {\n    get condition() {\n        return this.s[0] / this.s[Math.min(this.m, this.n) - 1];\n    },\n    get norm2() {\n        return this.s[0];\n    },\n    get rank() {\n        var eps = Math.pow(2, -52),\n            tol = Math.max(this.m, this.n) * this.s[0] * eps,\n            r = 0,\n            s = this.s;\n        for (var i = 0, ii = s.length; i < ii; i++) {\n            if (s[i] > tol) {\n                r++;\n            }\n        }\n        return r;\n    },\n    get diagonal() {\n        return this.s;\n    },\n    // https://github.com/accord-net/framework/blob/development/Sources/Accord.Math/Decompositions/SingularValueDecomposition.cs\n    get threshold() {\n        return (Math.pow(2, -52) / 2) * Math.max(this.m, this.n) * this.s[0];\n    },\n    get leftSingularVectors() {\n        if (!Matrix.Matrix.isMatrix(this.U)) {\n            this.U = new Matrix.Matrix(this.U);\n        }\n        return this.U;\n    },\n    get rightSingularVectors() {\n        if (!Matrix.Matrix.isMatrix(this.V)) {\n            this.V = new Matrix.Matrix(this.V);\n        }\n        return this.V;\n    },\n    get diagonalMatrix() {\n        return Matrix.Matrix.diag(this.s);\n    },\n    solve: function (value) {\n\n        var Y = value,\n            e = this.threshold,\n            scols = this.s.length,\n            Ls = Matrix.Matrix.zeros(scols, scols),\n            i;\n\n        for (i = 0; i < scols; i++) {\n            if (Math.abs(this.s[i]) <= e) {\n                Ls[i][i] = 0;\n            } else {\n                Ls[i][i] = 1 / this.s[i];\n            }\n        }\n\n        var U = this.U;\n        var V = this.rightSingularVectors;\n\n        var VL = V.mmul(Ls),\n            vrows = V.rows,\n            urows = U.length,\n            VLU = Matrix.Matrix.zeros(vrows, urows),\n            j, k, sum;\n\n        for (i = 0; i < vrows; i++) {\n            for (j = 0; j < urows; j++) {\n                sum = 0;\n                for (k = 0; k < scols; k++) {\n                    sum += VL[i][k] * U[j][k];\n                }\n                VLU[i][j] = sum;\n            }\n        }\n\n        return VLU.mmul(Y);\n    },\n    solveForDiagonal: function (value) {\n        return this.solve(Matrix.Matrix.diag(value));\n    },\n    inverse: function () {\n        var V = this.V;\n        var e = this.threshold,\n            vrows = V.length,\n            vcols = V[0].length,\n            X = new Matrix.Matrix(vrows, this.s.length),\n            i, j;\n\n        for (i = 0; i < vrows; i++) {\n            for (j = 0; j < vcols; j++) {\n                if (Math.abs(this.s[j]) > e) {\n                    X[i][j] = V[i][j] / this.s[j];\n                } else {\n                    X[i][j] = 0;\n                }\n            }\n        }\n\n        var U = this.U;\n\n        var urows = U.length,\n            ucols = U[0].length,\n            Y = new Matrix.Matrix(vrows, urows),\n            k, sum;\n\n        for (i = 0; i < vrows; i++) {\n            for (j = 0; j < urows; j++) {\n                sum = 0;\n                for (k = 0; k < ucols; k++) {\n                    sum += X[i][k] * U[j][k];\n                }\n                Y[i][j] = sum;\n            }\n        }\n\n        return Y;\n    }\n};\n\nmodule.exports = SingularValueDecomposition;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-matrix/src/dc/svd.js","module.exports = newArray\n\nfunction newArray (n, value) {\n  n = n || 0\n  var array = new Array(n)\n  for (var i = 0; i < n; i++) {\n    array[i] = value\n  }\n  return array\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/new-array/index.js","/**\n * Created by acastillo on 8/8/16.\n */\n'use strict';\n\nconst defOptions = {\n    threshold:0,\n    out:\"assignment\"\n};\n//TODO Consider a matrix of distances too\nmodule.exports = function fullClusterGenerator(conMat, opt) {\n    const options = Object.assign({}, defOptions, opt);\n    var clList, i, j, k;\n    if(typeof conMat[0] === \"number\"){\n        clList = fullClusterGeneratorVector(conMat);\n    }\n    else{\n        if(typeof conMat[0] === \"object\"){\n            var nRows = conMat.length;\n            var conn = new Array(nRows*(nRows+1)/2);\n            var index = 0;\n            for(var i=0;i<nRows;i++){\n                for(var j=i;j<nRows;j++){\n                    if(conMat[i][j]>options.threshold)\n                        conn[index++]= 1;\n                    else\n                        conn[index++]= 0;\n                }\n            }\n            clList = fullClusterGeneratorVector(conn);\n        }\n    }\n    if (options.out === \"indexes\" || options.out === \"values\") {\n        var result = new Array(clList.length);\n        for(i=0;i<clList.length;i++){\n            result[i] = [];\n            for(j=0;j<clList[i].length;j++){\n                if(clList[i][j] != 0){\n                    result[i].push(j);\n                }\n            }\n        }\n        if (options.out === \"values\") {\n            var resultAsMatrix = new Array(result.length);\n            for (i = 0; i<result.length;i++){\n                resultAsMatrix[i]=new Array(result[i].length);\n                for(j = 0; j < result[i].length; j++){\n                    resultAsMatrix[i][j]=new Array(result[i].length);\n                    for(k = 0; k < result[i].length; k++){\n                        resultAsMatrix[i][j][k]=conMat[result[i][j]][result[i][k]];\n                    }\n                }\n            }\n            return resultAsMatrix;\n        }\n        else{\n            return result;\n        }\n    }\n\n    return clList;\n\n}\n\nfunction fullClusterGeneratorVector(conn){\n    var nRows = Math.sqrt(conn.length*2+0.25)-0.5;\n    var clusterList = [];\n    var available = new Array(nRows);\n    var remaining = nRows, i=0;\n    var cluster = [];\n    //Mark all the elements as available\n    for(i=nRows-1;i>=0;i--){\n        available[i]=1;\n    }\n    var nextAv=-1;\n    var toInclude = [];\n    while(remaining>0){\n        if(toInclude.length===0){\n            //If there is no more elements to include. Start a new cluster\n            cluster = new Array(nRows);\n            for(i = 0;i < nRows ;i++)\n                cluster[i]=0;\n            clusterList.push(cluster);\n            for(nextAv = 0;available[nextAv]==0;nextAv++){};\n        }\n        else{\n            nextAv=toInclude.splice(0,1);\n        }\n        cluster[nextAv]=1;\n        available[nextAv]=0;\n        remaining--;\n        //Copy the next available row\n        var row = new Array(nRows);\n        for( i = 0;i < nRows;i++){\n            var c=Math.max(nextAv,i);\n            var r=Math.min(nextAv,i);\n            //The element in the conn matrix\n            //console.log(\"index: \"+r*(2*nRows-r-1)/2+c)\n            row[i]=conn[r*(2*nRows-r-1)/2+c];\n            //There is new elements to include in this row?\n            //Then, include it to the current cluster\n            if(row[i]==1&&available[i]==1&&cluster[i]==0){\n                toInclude.push(i);\n                cluster[i]=1;\n            }\n        }\n    }\n    return clusterList;\n}\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-simple-clustering/src/index.js","'use strict';\n\nfunction squaredEuclidean(p, q) {\n    var d = 0;\n    for (var i = 0; i < p.length; i++) {\n        d += (p[i] - q[i]) * (p[i] - q[i]);\n    }\n    return d;\n}\n\nfunction euclidean(p, q) {\n    return Math.sqrt(squaredEuclidean(p, q));\n}\n\nmodule.exports = euclidean;\neuclidean.squared = squaredEuclidean;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-distance-euclidean/euclidean.js","'use strict';\n\nconst Cluster = require('./Cluster');\nconst util = require('util');\n\nfunction ClusterLeaf(index) {\n    Cluster.call(this);\n    this.index = index;\n    this.distance = 0;\n    this.children = [];\n}\n\nutil.inherits(ClusterLeaf, Cluster);\n\nmodule.exports = ClusterLeaf;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-hclust/src/ClusterLeaf.js","const HashTable = require('ml-hash-table');\n\nclass SparseMatrix {\n    constructor(rows, columns, options = {}) {\n        if (rows instanceof SparseMatrix) { // clone\n            const other = rows;\n            this._init(other.rows, other.columns, other.elements.clone(), other.threshold);\n            return;\n        }\n\n        if (Array.isArray(rows)) {\n            const matrix = rows;\n            rows = matrix.length;\n            options = columns || {};\n            columns = matrix[0].length;\n            this._init(rows, columns, new HashTable(options), options.threshold);\n            for (var i = 0; i < rows; i++) {\n                for (var j = 0; j < columns; j++) {\n                    var value = matrix[i][j];\n                    if (this.threshold && Math.abs(value) < this.threshold) value = 0;\n                    if (value !== 0) {\n                        this.elements.set(i * columns + j, matrix[i][j]);\n                    }\n                }\n            }\n        } else {\n            this._init(rows, columns, new HashTable(options), options.threshold);\n        }\n    }\n\n    _init(rows, columns, elements, threshold) {\n        this.rows = rows;\n        this.columns = columns;\n        this.elements = elements;\n        this.threshold = threshold || 0;\n    }\n    \n    static eye(rows = 1, columns = rows) {\n        const min = Math.min(rows, columns);\n        const matrix = new SparseMatrix(rows, columns, {initialCapacity: min});\n        for (var i = 0; i < min; i++) {\n            matrix.set(i, i, 1);\n        }\n        return matrix;\n    }\n\n    clone() {\n        return new SparseMatrix(this);\n    }\n    \n    to2DArray() {\n        const copy = new Array(this.rows);\n        for (var i = 0; i < this.rows; i++) {\n            copy[i] = new Array(this.columns);\n            for (var j = 0; j < this.columns; j++) {\n                copy[i][j] = this.get(i, j);\n            }\n        }\n        return copy;\n    }\n\n    isSquare() {\n        return this.rows === this.columns;\n    }\n\n    isSymmetric() {\n        if (!this.isSquare()) return false;\n\n        var symmetric = true;\n        this.forEachNonZero((i, j, v) => {\n            if (this.get(j, i) !== v) {\n                symmetric = false;\n                return false;\n            }\n            return v;\n        });\n        return symmetric;\n    }\n\n    get cardinality() {\n        return this.elements.size;\n    }\n\n    get size() {\n        return this.rows * this.columns;\n    }\n\n    get(row, column) {\n        return this.elements.get(row * this.columns + column);\n    }\n\n    set(row, column, value) {\n        if (this.threshold && Math.abs(value) < this.threshold) value = 0;\n        if (value === 0) {\n            this.elements.remove(row * this.columns + column);\n        } else {\n            this.elements.set(row * this.columns + column, value);\n        }\n        return this;\n    }\n    \n    mmul(other) {\n        if (this.columns !== other.rows)\n            console.warn('Number of columns of left matrix are not equal to number of rows of right matrix.');\n        \n        const m = this.rows;\n        const p = other.columns;\n        \n        const result = new SparseMatrix(m, p);\n        this.forEachNonZero((i, j, v1) => {\n            other.forEachNonZero((k, l, v2) => {\n                if (j === k) {\n                    result.set(i, l, result.get(i, l) + v1 * v2);\n                }\n                return v2;\n            });\n            return v1;\n        });\n        return result;\n    }\n\n    kroneckerProduct(other) {\n        const m = this.rows;\n        const n = this.columns;\n        const p = other.rows;\n        const q = other.columns;\n\n        const result = new SparseMatrix(m * p, n * q, {\n            initialCapacity: this.cardinality * other.cardinality\n        });\n        this.forEachNonZero((i, j, v1) => {\n            other.forEachNonZero((k, l, v2) => {\n                result.set(p * i + k, q * j + l, v1 * v2);\n                return v2;\n            });\n            return v1;\n        });\n        return result;\n    }\n\n    forEachNonZero(callback) {\n        this.elements.forEachPair((key, value) => {\n            const i = (key / this.columns) | 0;\n            const j = key % this.columns;\n            let r = callback(i, j, value);\n            if (r === false) return false; // stop iteration\n            if (this.threshold && Math.abs(r) < this.threshold) r = 0;\n            if (r !== value) {\n                if (r === 0) {\n                    this.elements.remove(key, true);\n                } else {\n                    this.elements.set(key, r);\n                }\n            }\n            return true;\n        });\n        this.elements.maybeShrinkCapacity();\n        return this;\n    }\n\n    getNonZeros() {\n        const cardinality = this.cardinality;\n        const rows = new Array(cardinality);\n        const columns = new Array(cardinality);\n        const values = new Array(cardinality);\n        var idx = 0;\n        this.forEachNonZero((i, j, value) => {\n            rows[idx] = i;\n            columns[idx] = j;\n            values[idx] = value;\n            idx++;\n            return value;\n        });\n        return {rows, columns, values};\n    }\n\n    setThreshold(newThreshold) {\n        if (newThreshold !== 0 && newThreshold !== this.threshold) {\n            this.threshold = newThreshold;\n            this.forEachNonZero((i, j, v) => v);\n        }\n        return this;\n    }\n}\n\nSparseMatrix.prototype.klass = 'Matrix';\n\nSparseMatrix.identity = SparseMatrix.eye;\nSparseMatrix.prototype.tensorProduct = SparseMatrix.prototype.kroneckerProduct;\n\nmodule.exports = SparseMatrix;\n\n/*\n Add dynamically instance and static methods for mathematical operations\n */\n\nvar inplaceOperator = `\n(function %name%(value) {\n    if (typeof value === 'number') return this.%name%S(value);\n    return this.%name%M(value);\n})\n`;\n\nvar inplaceOperatorScalar = `\n(function %name%S(value) {\n    this.forEachNonZero((i, j, v) => v %op% value);\n    return this;\n})\n`;\n\nvar inplaceOperatorMatrix = `\n(function %name%M(matrix) {\n    matrix.forEachNonZero((i, j, v) => {\n        this.set(i, j, this.get(i, j) %op% v);\n        return v;\n    });\n    return this;\n})\n`;\n\nvar staticOperator = `\n(function %name%(matrix, value) {\n    var newMatrix = new SparseMatrix(matrix);\n    return newMatrix.%name%(value);\n})\n`;\n\nvar inplaceMethod = `\n(function %name%() {\n    this.forEachNonZero((i, j, v) => %method%(v));\n    return this;\n})\n`;\n\nvar staticMethod = `\n(function %name%(matrix) {\n    var newMatrix = new SparseMatrix(matrix);\n    return newMatrix.%name%();\n})\n`;\n\nvar operators = [\n    // Arithmetic operators\n    ['+', 'add'],\n    ['-', 'sub', 'subtract'],\n    ['*', 'mul', 'multiply'],\n    ['/', 'div', 'divide'],\n    ['%', 'mod', 'modulus'],\n    // Bitwise operators\n    ['&', 'and'],\n    ['|', 'or'],\n    ['^', 'xor'],\n    ['<<', 'leftShift'],\n    ['>>', 'signPropagatingRightShift'],\n    ['>>>', 'rightShift', 'zeroFillRightShift']\n];\n\nfor (var operator of operators) {\n    for (var i = 1; i < operator.length; i++) {\n        SparseMatrix.prototype[operator[i]] = eval(fillTemplateFunction(inplaceOperator, {name: operator[i], op: operator[0]}));\n        SparseMatrix.prototype[operator[i] + 'S'] = eval(fillTemplateFunction(inplaceOperatorScalar, {name: operator[i] + 'S', op: operator[0]}));\n        SparseMatrix.prototype[operator[i] + 'M'] = eval(fillTemplateFunction(inplaceOperatorMatrix, {name: operator[i] + 'M', op: operator[0]}));\n\n        SparseMatrix[operator[i]] = eval(fillTemplateFunction(staticOperator, {name: operator[i]}));\n    }\n}\n\nvar methods = [\n    ['~', 'not']\n];\n\n[\n    'abs', 'acos', 'acosh', 'asin', 'asinh', 'atan', 'atanh', 'cbrt', 'ceil',\n    'clz32', 'cos', 'cosh', 'exp', 'expm1', 'floor', 'fround', 'log', 'log1p',\n    'log10', 'log2', 'round', 'sign', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'trunc'\n].forEach(function (mathMethod) {\n    methods.push(['Math.' + mathMethod, mathMethod]);\n});\n\nfor (var method of methods) {\n    for (var i = 1; i < method.length; i++) {\n        SparseMatrix.prototype[method[i]] = eval(fillTemplateFunction(inplaceMethod, {name: method[i], method: method[0]}));\n        SparseMatrix[method[i]] = eval(fillTemplateFunction(staticMethod, {name: method[i]}));\n    }\n}\n\nfunction fillTemplateFunction(template, values) {\n    for (var i in values) {\n        template = template.replace(new RegExp('%' + i + '%', 'g'), values[i]);\n    }\n    return template;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-sparse-matrix/src/SparseMatrix.js","module.exports = function(haystack, needle, comparator, low, high) {\n  var mid, cmp;\n\n  if(low === undefined)\n    low = 0;\n\n  else {\n    low = low|0;\n    if(low < 0 || low >= haystack.length)\n      throw new RangeError(\"invalid lower bound\");\n  }\n\n  if(high === undefined)\n    high = haystack.length - 1;\n\n  else {\n    high = high|0;\n    if(high < low || high >= haystack.length)\n      throw new RangeError(\"invalid upper bound\");\n  }\n\n  while(low <= high) {\n    /* Note that \"(low + high) >>> 1\" may overflow, and results in a typecast\n     * to double (which gives the wrong results). */\n    mid = low + (high - low >> 1);\n    cmp = +comparator(haystack[mid], needle, mid, haystack);\n\n    /* Too low. */\n    if(cmp < 0.0)\n      low  = mid + 1;\n\n    /* Too high. */\n    else if(cmp > 0.0)\n      high = mid - 1;\n\n    /* Key found. */\n    else\n      return mid;\n  }\n\n  /* Key not found. */\n  return ~low;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/binary-search/index.js","'use strict';\nvar numberIsNan = require('number-is-nan');\n\nfunction assertNum(x) {\n\tif (typeof x !== 'number' || numberIsNan(x)) {\n\t\tthrow new TypeError('Expected a number');\n\t}\n}\n\nexports.asc = function (a, b) {\n\tassertNum(a);\n\tassertNum(b);\n\treturn a - b;\n};\n\nexports.desc = function (a, b) {\n\tassertNum(a);\n\tassertNum(b);\n\treturn b - a;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/num-sort/index.js","var diagonalError = 0.05;\nvar\ttolerance = 0.05;\n\nexport default {\n\n    clean: function (peaks, threshold) {\n        var max = Number.NEGATIVE_INFINITY;\n        var i;\n        //double min = Double.MAX_VALUE;\n        for (i = peaks.length - 1; i >= 0; i--) {\n            if (Math.abs(peaks[i].z) > max) {\n                max = Math.abs(peaks[i].z);\n            }\n        }\n        max *= threshold;\n        for (i = peaks.length - 1; i >= 0; i--) {\n            if (Math.abs(peaks[i].z) < max) {\n                peaks.splice(i, 1);\n            }\n        }\n        return peaks;\n    },\n\n    enhanceSymmetry: function (signals) {\n\n        var properties = initializeProperties(signals);\n        var output = signals;\n\n        //First step of the optimization: Symmetry validation\n        var i, hits, index;\n        var signal;\n        for (i = output.length - 1; i >= 0; i--) {\n            signal = output[i];\n            if (signal.peaks.length > 1)\t\t\t\t{\n                properties[i][1]++;\n            }\n            if (properties[i][0] === 1) {\n                index = exist(output, properties, signal, -1, true);\n                if (index >= 0) {\n                    properties[i][1] += 2;\n                    properties[index][1] += 2;\n                }\n            }\n        }\n        //Second step of the optimization: Diagonal image existence\n        for (i = output.length - 1; i >= 0; i--) {\n            signal = output[i];\n            if (properties[i][0] === 0) {\n                hits = checkCrossPeaks(output, properties, signal, true);\n                properties[i][1] += hits;\n                //checkCrossPeaks(output, properties, signal, false);\n            }\n        }\n\n        //Now, each peak have a score between 0 and 4, we can complete the patterns which\n        //contains peaks with high scores, and finally, we can remove peaks with scores 0 and 1\n        var count = 0;\n        for (i = output.length - 1; i >= 0; i--) {\n            if (properties[i][0] !== 0 && properties[i][1] > 2) {\n                count++;\n                count += completeMissingIfNeeded(output, properties, output[i], properties[i]);\n            }\n            if (properties[i][1] >= 2 && properties[i][0] === 0)\t\t\t\t{\n                count++;\n            }\n        }\n\n        var toReturn = new Array(count);\n        count--;\n        for (i = output.length - 1; i >= 0; i--) {\n            if (properties[i][0] !== 0 && properties[i][1] > 2\n     || properties[i][0] === 0 && properties[i][1] > 1) {\n                toReturn[count--] = output[i];\n            }\n        }\n        return toReturn;\n    },\n\n    /**\n     * This function maps the corresponding 2D signals to the given set of 1D signals\n     * @param {Array} signals2D\n     * @param {Array} references\n     */\n    alignDimensions: function (signals2D, references) {\n        //For each reference dimension\n        for (var i = 0; i < references.length; i++) {\n            var ref = references[i];\n            if (ref)\t\t\t\t{\n                alignSingleDimension(signals2D, ref);\n            }\n        }\n    }\n};\n\nfunction completeMissingIfNeeded(output, properties, thisSignal, thisProp) {\n    //Check for symmetry\n    var index = exist(output, properties, thisSignal, -thisProp[0], true);\n    var addedPeaks = 0;\n    var newSignal = null;\n    var tmpProp = null;\n    if (index < 0) {//If this signal have no a symmetry image, we have to include it\n        newSignal = {nucleusX: thisSignal.nucleusX, nucleusY: thisSignal.nucleusY};\n        newSignal.resolutionX = thisSignal.resolutionX;\n        newSignal.resolutionY = thisSignal.resolutionY;\n        newSignal.shiftX = thisSignal.shiftY;\n        newSignal.shiftY = thisSignal.shiftX;\n        newSignal.peaks = [{x: thisSignal.shiftY, y: thisSignal.shiftX, z: 1}];\n        output.push(newSignal);\n        tmpProp = [-thisProp[0], thisProp[1]];\n        properties.push(tmpProp);\n        addedPeaks++;\n    }\n    //Check for diagonal peaks\n    var j, signal;\n    var diagX = false;\n    var diagY = false;\n    for (j = output.length - 1; j >= 0; j--) {\n        signal = output[j];\n        if (properties[j][0] === 0) {\n            if (Math.abs(signal.shiftX - thisSignal.shiftX) < diagonalError)\t\t\t\t{\n                diagX = true;\n            }\n            if (Math.abs(signal.shiftY - thisSignal.shiftY) < diagonalError)\t\t\t\t{\n                diagY = true;\n            }\n        }\n    }\n    if (diagX === false) {\n        newSignal = {nucleusX: thisSignal.nucleusX, nucleusY: thisSignal.nucleusY};\n        newSignal.resolutionX = thisSignal.resolutionX;\n        newSignal.resolutionY = thisSignal.resolutionY;\n        newSignal.shiftX = thisSignal.shiftX;\n        newSignal.shiftY = thisSignal.shiftX;\n        newSignal.peaks = [{x: thisSignal.shiftX, y: thisSignal.shiftX, z: 1}];\n        output.push(newSignal);\n        tmpProp = [0, thisProp[1]];\n        properties.push(tmpProp);\n        addedPeaks++;\n    }\n    if (diagY === false) {\n        newSignal = {nucleusX: thisSignal.nucleusX, nucleusY: thisSignal.nucleusY};\n        newSignal.resolutionX = thisSignal.resolutionX;\n        newSignal.resolutionY = thisSignal.resolutionY;\n        newSignal.shiftX = thisSignal.shiftY;\n        newSignal.shiftY = thisSignal.shiftY;\n        newSignal.peaks = [{x: thisSignal.shiftY, y: thisSignal.shiftY, z: 1}];\n        output.push(newSignal);\n        tmpProp = [0, thisProp[1]];\n        properties.push(tmpProp);\n        addedPeaks++;\n    }\n    return addedPeaks;\n\n}\n\n//Check for any diagonal peak that match this cross peak\nfunction checkCrossPeaks(output, properties, signal, updateProperties) {\n    var hits = 0;\n    var shift = signal.shiftX * 4;\n    var crossPeaksX = [];\n    var crossPeaksY = [];\n    var cross;\n    for (var i = output.length - 1; i >= 0; i--) {\n        cross = output[i];\n        if (properties[i][0] !== 0) {\n            if (Math.abs(cross.shiftX - signal.shiftX) < diagonalError) {\n                hits++;\n                if (updateProperties)\t\t\t\t\t{\n                    properties[i][1]++;\n                }\n                crossPeaksX.push(i);\n                shift += cross.shiftX;\n            } else {\n                if (Math.abs(cross.shiftY - signal.shiftY) < diagonalError) {\n                    hits++;\n                    if (updateProperties)\t\t\t\t\t\t{\n                        properties[i][1]++;\n                    }\n                    crossPeaksY.push(i);\n                    shift += cross.shiftY;\n                }\n            }\n        }\n    }\n    //Update found crossPeaks and diagonal peak\n    shift /= (crossPeaksX.length + crossPeaksY.length + 4);\n    if (crossPeaksX.length > 0) {\n        for (i = crossPeaksX.length - 1; i >= 0; i--) {\n            output[crossPeaksX[i]].shiftX = shift;\n        }\n    }\n    if (crossPeaksY.length > 0) {\n        for (i = crossPeaksY.length - 1; i >= 0; i--) {\n            output[crossPeaksY[i]].shiftY = shift;\n        }\n    }\n    signal.shiftX = shift;\n    signal.shiftY = shift;\n    return hits;\n}\n\nfunction exist(output, properties, signal, type, symmetricSearch) {\n    for (var i = output.length - 1; i >= 0; i--) {\n        if (properties[i][0] === type) {\n            if (distanceTo(signal, output[i], symmetricSearch) < tolerance) {\n                if (!symmetricSearch) {\n                    let shiftX = (output[i].shiftX + signal.shiftX) / 2.0;\n                    let shiftY = (output[i].shiftY + signal.shiftY) / 2.0;\n                    output[i].shiftX = shiftX;\n                    output[i].shiftY = shiftY;\n                    signal.shiftX = shiftX;\n                    signal.shiftY = shiftY;\n                } else {\n                    let shiftX = signal.shiftX;\n                    let shiftY = output[i].shiftX;\n                    output[i].shiftY = shiftX;\n                    signal.shiftY = shiftY;\n                }\n                return i;\n            }\n        }\n    }\n    return -1;\n}\n/**\n * Try to determine the position of each signal within the spectrum matrix.\n * Peaks could be of 3 types: upper diagonal, diagonal or under diagonal 1,0,-1\n * respectively.\n * @param {Array} signals\n * @return {*} A matrix containing the properties of each signal\n * @private\n */\nfunction initializeProperties(signals) {\n    var signalsProperties = new Array(signals.length);\n    for (var i = signals.length - 1; i >= 0; i--) {\n        signalsProperties[i] = [0, 0];\n        //We check if it is a diagonal peak\n        if (Math.abs(signals[i].shiftX - signals[i].shiftY) <= diagonalError) {\n            signalsProperties[i][1] = 1;\n            var shift = (signals[i].shiftX * 2 + signals[i].shiftY) / 3.0;\n            signals[i].shiftX = shift;\n            signals[i].shiftY = shift;\n        } else {\n            if (signals[i].shiftX - signals[i].shiftY > 0)\t\t\t\t{\n                signalsProperties[i][0] = 1;\n            } else\t\t\t\t{\n                signalsProperties[i][0] = -1;\n            }\n        }\n    }\n    return signalsProperties;\n}\n\n/**\n * This function calculates the distance between 2 nmr signals . If toImage is true,\n * it will interchange x by y in the distance calculation for the second signal.\n * @param {object} a\n * @param {object} b\n * @param {boolean} toImage\n * @return {number}\n * @private\n */\nfunction distanceTo(a, b, toImage) {\n    if (!toImage) {\n        return Math.sqrt(Math.pow(a.shiftX - b.shiftX, 2)\n   + Math.pow(a.shiftY - b.shiftY, 2));\n    } else {\n        return Math.sqrt(Math.pow(a.shiftX - b.shiftY, 2)\n   + Math.pow(a.shiftY - b.shiftX, 2));\n    }\n}\n\nfunction alignSingleDimension(signals2D, references) {\n    //For each 2D signal\n    var center = 0;\n    var width = 0;\n    var i, j;\n    for (i = 0; i < signals2D.length; i++) {\n        var signal2D = signals2D[i];\n        for (j = 0; j < references.length; j++) {\n            center = (references[j].startX + references[j].stopX) / 2;\n            width = Math.abs(references[j].startX - references[j].stopX) / 2;\n            if (signal2D.nucleusX === references[j].nucleus) {\n                //The 2D peak overlaps with the 1D signal\n                if (Math.abs(signal2D.shiftX - center) <= width) {\n                    signal2D._highlight.push(references[j]._highlight[0]);\n                }\n\n            }\n            if (signal2D.nucleusY === references[j].nucleus) {\n                if (Math.abs(signal2D.shiftY - center) <= width) {\n                    signal2D._highlight.push(references[j]._highlight[0]);\n                }\n            }\n        }\n\n    }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/spectra-data/src/peakPicking/peakOptimizer.js","/**\n * Fast Fourier Transform module\n * 1D-FFT/IFFT, 2D-FFT/IFFT (radix-2)\n */\nvar FFT = (function(){\n  var FFT;  \n  \n  if(typeof exports !== 'undefined') {\n    FFT = exports;   // for CommonJS\n  } else {\n    FFT = {};\n  }\n  \n  var version = {\n    release: '0.3.0',\n    date: '2013-03'\n  };\n  FFT.toString = function() {\n    return \"version \" + version.release + \", released \" + version.date;\n  };\n\n  // core operations\n  var _n = 0,          // order\n      _bitrev = null,  // bit reversal table\n      _cstb = null;    // sin/cos table\n\n  var core = {\n    init : function(n) {\n      if(n !== 0 && (n & (n - 1)) === 0) {\n        _n = n;\n        core._initArray();\n        core._makeBitReversalTable();\n        core._makeCosSinTable();\n      } else {\n        throw new Error(\"init: radix-2 required\");\n      }\n    },\n    // 1D-FFT\n    fft1d : function(re, im) {\n      core.fft(re, im, 1);\n    },\n    // 1D-IFFT\n    ifft1d : function(re, im) {\n      var n = 1/_n;\n      core.fft(re, im, -1);\n      for(var i=0; i<_n; i++) {\n        re[i] *= n;\n        im[i] *= n;\n      }\n    },\n     // 1D-IFFT\n    bt1d : function(re, im) {\n      core.fft(re, im, -1);\n    },\n    // 2D-FFT Not very useful if the number of rows have to be equal to cols\n    fft2d : function(re, im) {\n      var tre = [],\n          tim = [],\n          i = 0;\n      // x-axis\n      for(var y=0; y<_n; y++) {\n        i = y*_n;\n        for(var x1=0; x1<_n; x1++) {\n          tre[x1] = re[x1 + i];\n          tim[x1] = im[x1 + i];\n        }\n        core.fft1d(tre, tim);\n        for(var x2=0; x2<_n; x2++) {\n          re[x2 + i] = tre[x2];\n          im[x2 + i] = tim[x2];\n        }\n      }\n      // y-axis\n      for(var x=0; x<_n; x++) {\n        for(var y1=0; y1<_n; y1++) {\n          i = x + y1*_n;\n          tre[y1] = re[i];\n          tim[y1] = im[i];\n        }\n        core.fft1d(tre, tim);\n        for(var y2=0; y2<_n; y2++) {\n          i = x + y2*_n;\n          re[i] = tre[y2];\n          im[i] = tim[y2];\n        }\n      }\n    },\n    // 2D-IFFT\n    ifft2d : function(re, im) {\n      var tre = [],\n          tim = [],\n          i = 0;\n      // x-axis\n      for(var y=0; y<_n; y++) {\n        i = y*_n;\n        for(var x1=0; x1<_n; x1++) {\n          tre[x1] = re[x1 + i];\n          tim[x1] = im[x1 + i];\n        }\n        core.ifft1d(tre, tim);\n        for(var x2=0; x2<_n; x2++) {\n          re[x2 + i] = tre[x2];\n          im[x2 + i] = tim[x2];\n        }\n      }\n      // y-axis\n      for(var x=0; x<_n; x++) {\n        for(var y1=0; y1<_n; y1++) {\n          i = x + y1*_n;\n          tre[y1] = re[i];\n          tim[y1] = im[i];\n        }\n        core.ifft1d(tre, tim);\n        for(var y2=0; y2<_n; y2++) {\n          i = x + y2*_n;\n          re[i] = tre[y2];\n          im[i] = tim[y2];\n        }\n      }\n    },\n    // core operation of FFT\n    fft : function(re, im, inv) {\n      var d, h, ik, m, tmp, wr, wi, xr, xi,\n          n4 = _n >> 2;\n      // bit reversal\n      for(var l=0; l<_n; l++) {\n        m = _bitrev[l];\n        if(l < m) {\n          tmp = re[l];\n          re[l] = re[m];\n          re[m] = tmp;\n          tmp = im[l];\n          im[l] = im[m];\n          im[m] = tmp;\n        }\n      }\n      // butterfly operation\n      for(var k=1; k<_n; k<<=1) {\n        h = 0;\n        d = _n/(k << 1);\n        for(var j=0; j<k; j++) {\n          wr = _cstb[h + n4];\n          wi = inv*_cstb[h];\n          for(var i=j; i<_n; i+=(k<<1)) {\n            ik = i + k;\n            xr = wr*re[ik] + wi*im[ik];\n            xi = wr*im[ik] - wi*re[ik];\n            re[ik] = re[i] - xr;\n            re[i] += xr;\n            im[ik] = im[i] - xi;\n            im[i] += xi;\n          }\n          h += d;\n        }\n      }\n    },\n    // initialize the array (supports TypedArray)\n    _initArray : function() {\n      if(typeof Uint32Array !== 'undefined') {\n        _bitrev = new Uint32Array(_n);\n      } else {\n        _bitrev = [];\n      }\n      if(typeof Float64Array !== 'undefined') {\n        _cstb = new Float64Array(_n*1.25);\n      } else {\n        _cstb = [];\n      }\n    },\n    // zero padding\n    _paddingZero : function() {\n      // TODO\n    },\n    // makes bit reversal table\n    _makeBitReversalTable : function() {\n      var i = 0,\n          j = 0,\n          k = 0;\n      _bitrev[0] = 0;\n      while(++i < _n) {\n        k = _n >> 1;\n        while(k <= j) {\n          j -= k;\n          k >>= 1;\n        }\n        j += k;\n        _bitrev[i] = j;\n      }\n    },\n    // makes trigonometiric function table\n    _makeCosSinTable : function() {\n      var n2 = _n >> 1,\n          n4 = _n >> 2,\n          n8 = _n >> 3,\n          n2p4 = n2 + n4,\n          t = Math.sin(Math.PI/_n),\n          dc = 2*t*t,\n          ds = Math.sqrt(dc*(2 - dc)),\n          c = _cstb[n4] = 1,\n          s = _cstb[0] = 0;\n      t = 2*dc;\n      for(var i=1; i<n8; i++) {\n        c -= dc;\n        dc += t*c;\n        s += ds;\n        ds -= t*s;\n        _cstb[i] = s;\n        _cstb[n4 - i] = c;\n      }\n      if(n8 !== 0) {\n        _cstb[n8] = Math.sqrt(0.5);\n      }\n      for(var j=0; j<n4; j++) {\n        _cstb[n2 - j]  = _cstb[j];\n      }\n      for(var k=0; k<n2p4; k++) {\n        _cstb[k + n2] = -_cstb[k];\n      }\n    }\n  };\n  // aliases (public APIs)\n  var apis = ['init', 'fft1d', 'ifft1d', 'fft2d', 'ifft2d'];\n  for(var i=0; i<apis.length; i++) {\n    FFT[apis[i]] = core[apis[i]];\n  }\n  FFT.bt = core.bt1d;\n  FFT.fft = core.fft1d;\n  FFT.ifft = core.ifft1d;\n  \n  return FFT;\n}).call(this);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-matrix-convolution/node_modules/ml-fft/src/fftlib.js","'use strict';\n\nmodule.exports = require('spectra-data');\n\n\n\n// WEBPACK FOOTER //\n// ./index.js","'use strict';\n\nconst Stat = require('ml-stat').array;\n/**\n * Function that returns an array of points given 1D array as follows:\n *\n * [x1, y1, .. , x2, y2, ..]\n *\n * And receive the number of dimensions of each point.\n * @param array\n * @param dimensions\n * @returns {Array} - Array of points.\n */\nfunction coordArrayToPoints(array, dimensions) {\n    if(array.length % dimensions !== 0) {\n        throw new RangeError('Dimensions number must be accordance with the size of the array.');\n    }\n\n    var length = array.length / dimensions;\n    var pointsArr = new Array(length);\n\n    var k = 0;\n    for(var i = 0; i < array.length; i += dimensions) {\n        var point = new Array(dimensions);\n        for(var j = 0; j < dimensions; ++j) {\n            point[j] = array[i + j];\n        }\n\n        pointsArr[k] = point;\n        k++;\n    }\n\n    return pointsArr;\n}\n\n\n/**\n * Function that given an array as follows:\n * [x1, y1, .. , x2, y2, ..]\n *\n * Returns an array as follows:\n * [[x1, x2, ..], [y1, y2, ..], [ .. ]]\n *\n * And receives the number of dimensions of each coordinate.\n * @param array\n * @param dimensions\n * @returns {Array} - Matrix of coordinates\n */\nfunction coordArrayToCoordMatrix(array, dimensions) {\n    if(array.length % dimensions !== 0) {\n        throw new RangeError('Dimensions number must be accordance with the size of the array.');\n    }\n\n    var coordinatesArray = new Array(dimensions);\n    var points = array.length / dimensions;\n    for (var i = 0; i < coordinatesArray.length; i++) {\n        coordinatesArray[i] = new Array(points);\n    }\n\n    for(i = 0; i < array.length; i += dimensions) {\n        for(var j = 0; j < dimensions; ++j) {\n            var currentPoint = Math.floor(i / dimensions);\n            coordinatesArray[j][currentPoint] = array[i + j];\n        }\n    }\n\n    return coordinatesArray;\n}\n\n/**\n * Function that receives a coordinate matrix as follows:\n * [[x1, x2, ..], [y1, y2, ..], [ .. ]]\n *\n * Returns an array of coordinates as follows:\n * [x1, y1, .. , x2, y2, ..]\n *\n * @param coordMatrix\n * @returns {Array}\n */\nfunction coordMatrixToCoordArray(coordMatrix) {\n    var coodinatesArray = new Array(coordMatrix.length * coordMatrix[0].length);\n    var k = 0;\n    for(var i = 0; i < coordMatrix[0].length; ++i) {\n        for(var j = 0; j < coordMatrix.length; ++j) {\n            coodinatesArray[k] = coordMatrix[j][i];\n            ++k;\n        }\n    }\n\n    return coodinatesArray;\n}\n\n/**\n * Tranpose a matrix, this method is for coordMatrixToPoints and\n * pointsToCoordMatrix, that because only transposing the matrix\n * you can change your representation.\n *\n * @param matrix\n * @returns {Array}\n */\nfunction transpose(matrix) {\n    var resultMatrix = new Array(matrix[0].length);\n    for(var i = 0; i < resultMatrix.length; ++i) {\n        resultMatrix[i] = new Array(matrix.length);\n    }\n\n    for (i = 0; i < matrix.length; ++i) {\n        for(var j = 0; j < matrix[0].length; ++j) {\n            resultMatrix[j][i] = matrix[i][j];\n        }\n    }\n\n    return resultMatrix;\n}\n\n/**\n * Function that transform an array of points into a coordinates array\n * as follows:\n * [x1, y1, .. , x2, y2, ..]\n *\n * @param points\n * @returns {Array}\n */\nfunction pointsToCoordArray(points) {\n    var coodinatesArray = new Array(points.length * points[0].length);\n    var k = 0;\n    for(var i = 0; i < points.length; ++i) {\n        for(var j = 0; j < points[0].length; ++j) {\n            coodinatesArray[k] = points[i][j];\n            ++k;\n        }\n    }\n\n    return coodinatesArray;\n}\n\n/**\n * Apply the dot product between the smaller vector and a subsets of the\n * largest one.\n *\n * @param firstVector\n * @param secondVector\n * @returns {Array} each dot product of size of the difference between the\n *                  larger and the smallest one.\n */\nfunction applyDotProduct(firstVector, secondVector) {\n    var largestVector, smallestVector;\n    if(firstVector.length <= secondVector.length) {\n        smallestVector = firstVector;\n        largestVector = secondVector;\n    } else {\n        smallestVector = secondVector;\n        largestVector = firstVector;\n    }\n\n    var difference = largestVector.length - smallestVector.length + 1;\n    var dotProductApplied = new Array(difference);\n\n    for (var i = 0; i < difference; ++i) {\n        var sum = 0;\n        for (var j = 0; j < smallestVector.length; ++j) {\n            sum += smallestVector[j] * largestVector[i + j];\n        }\n        dotProductApplied[i] = sum;\n    }\n\n    return dotProductApplied;\n}\n/**\n * To scale the input array between the specified min and max values. The operation is performed inplace\n * if the options.inplace is specified. If only one of the min or max parameters is specified, then the scaling\n * will multiply the input array by min/min(input) or max/max(input)\n * @param input\n * @param options\n * @returns {*}\n */\nfunction scale(input, options){\n    var y;\n    if(options.inPlace){\n        y = input;\n    }\n    else{\n        y = new Array(input.length);\n    }\n    const max = options.max;\n    const min = options.min;\n    if(typeof max === \"number\"){\n        if(typeof min === \"number\"){\n            var minMax = Stat.minMax(input);\n            var factor = (max - min)/(minMax.max-minMax.min);\n            for(var i=0;i< y.length;i++){\n                y[i]=(input[i]-minMax.min)*factor+min;\n            }\n        }\n        else{\n            var currentMin = Stat.max(input);\n            var factor = max/currentMin;\n            for(var i=0;i< y.length;i++){\n                y[i] = input[i]*factor;\n            }\n        }\n    }\n    else{\n        if(typeof min === \"number\"){\n            var currentMin = Stat.min(input);\n            var factor = min/currentMin;\n            for(var i=0;i< y.length;i++){\n                y[i] = input[i]*factor;\n            }\n        }\n    }\n    return y;\n}\n\nmodule.exports = {\n    coordArrayToPoints: coordArrayToPoints,\n    coordArrayToCoordMatrix: coordArrayToCoordMatrix,\n    coordMatrixToCoordArray: coordMatrixToCoordArray,\n    coordMatrixToPoints: transpose,\n    pointsToCoordArray: pointsToCoordArray,\n    pointsToCoordMatrix: transpose,\n    applyDotProduct: applyDotProduct,\n    scale:scale\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-array-utils/src/ArrayUtils.js","'use strict';\n\nvar arrayStat = require('./array');\n\nfunction compareNumbers(a, b) {\n    return a - b;\n}\n\nexports.max = function max(matrix) {\n    var max = -Infinity;\n    for (var i = 0; i < matrix.length; i++) {\n        for (var j = 0; j < matrix[i].length; j++) {\n            if (matrix[i][j] > max) max = matrix[i][j];\n        }\n    }\n    return max;\n};\n\nexports.min = function min(matrix) {\n    var min = Infinity;\n    for (var i = 0; i < matrix.length; i++) {\n        for (var j = 0; j < matrix[i].length; j++) {\n            if (matrix[i][j] < min) min = matrix[i][j];\n        }\n    }\n    return min;\n};\n\nexports.minMax = function minMax(matrix) {\n    var min = Infinity;\n    var max = -Infinity;\n    for (var i = 0; i < matrix.length; i++) {\n        for (var j = 0; j < matrix[i].length; j++) {\n            if (matrix[i][j] < min) min = matrix[i][j];\n            if (matrix[i][j] > max) max = matrix[i][j];\n        }\n    }\n    return {\n        min:min,\n        max:max\n    };\n};\n\nexports.entropy = function entropy(matrix, eps) {\n    if (typeof (eps) === 'undefined') {\n        eps = 0;\n    }\n    var sum = 0,\n        l1 = matrix.length,\n        l2 = matrix[0].length;\n    for (var i = 0; i < l1; i++) {\n        for (var j = 0; j < l2; j++) {\n            sum += matrix[i][j] * Math.log(matrix[i][j] + eps);\n        }\n    }\n    return -sum;\n};\n\nexports.mean = function mean(matrix, dimension) {\n    if (typeof (dimension) === 'undefined') {\n        dimension = 0;\n    }\n    var rows = matrix.length,\n        cols = matrix[0].length,\n        theMean, N, i, j;\n\n    if (dimension === -1) {\n        theMean = [0];\n        N = rows * cols;\n        for (i = 0; i < rows; i++) {\n            for (j = 0; j < cols; j++) {\n                theMean[0] += matrix[i][j];\n            }\n        }\n        theMean[0] /= N;\n    } else if (dimension === 0) {\n        theMean = new Array(cols);\n        N = rows;\n        for (j = 0; j < cols; j++) {\n            theMean[j] = 0;\n            for (i = 0; i < rows; i++) {\n                theMean[j] += matrix[i][j];\n            }\n            theMean[j] /= N;\n        }\n    } else if (dimension === 1) {\n        theMean = new Array(rows);\n        N = cols;\n        for (j = 0; j < rows; j++) {\n            theMean[j] = 0;\n            for (i = 0; i < cols; i++) {\n                theMean[j] += matrix[j][i];\n            }\n            theMean[j] /= N;\n        }\n    } else {\n        throw new Error('Invalid dimension');\n    }\n    return theMean;\n};\n\nexports.sum = function sum(matrix, dimension) {\n    if (typeof (dimension) === 'undefined') {\n        dimension = 0;\n    }\n    var rows = matrix.length,\n        cols = matrix[0].length,\n        theSum, i, j;\n\n    if (dimension === -1) {\n        theSum = [0];\n        for (i = 0; i < rows; i++) {\n            for (j = 0; j < cols; j++) {\n                theSum[0] += matrix[i][j];\n            }\n        }\n    } else if (dimension === 0) {\n        theSum = new Array(cols);\n        for (j = 0; j < cols; j++) {\n            theSum[j] = 0;\n            for (i = 0; i < rows; i++) {\n                theSum[j] += matrix[i][j];\n            }\n        }\n    } else if (dimension === 1) {\n        theSum = new Array(rows);\n        for (j = 0; j < rows; j++) {\n            theSum[j] = 0;\n            for (i = 0; i < cols; i++) {\n                theSum[j] += matrix[j][i];\n            }\n        }\n    } else {\n        throw new Error('Invalid dimension');\n    }\n    return theSum;\n};\n\nexports.product = function product(matrix, dimension) {\n    if (typeof (dimension) === 'undefined') {\n        dimension = 0;\n    }\n    var rows = matrix.length,\n        cols = matrix[0].length,\n        theProduct, i, j;\n\n    if (dimension === -1) {\n        theProduct = [1];\n        for (i = 0; i < rows; i++) {\n            for (j = 0; j < cols; j++) {\n                theProduct[0] *= matrix[i][j];\n            }\n        }\n    } else if (dimension === 0) {\n        theProduct = new Array(cols);\n        for (j = 0; j < cols; j++) {\n            theProduct[j] = 1;\n            for (i = 0; i < rows; i++) {\n                theProduct[j] *= matrix[i][j];\n            }\n        }\n    } else if (dimension === 1) {\n        theProduct = new Array(rows);\n        for (j = 0; j < rows; j++) {\n            theProduct[j] = 1;\n            for (i = 0; i < cols; i++) {\n                theProduct[j] *= matrix[j][i];\n            }\n        }\n    } else {\n        throw new Error('Invalid dimension');\n    }\n    return theProduct;\n};\n\nexports.standardDeviation = function standardDeviation(matrix, means, unbiased) {\n    var vari = exports.variance(matrix, means, unbiased), l = vari.length;\n    for (var i = 0; i < l; i++) {\n        vari[i] = Math.sqrt(vari[i]);\n    }\n    return vari;\n};\n\nexports.variance = function variance(matrix, means, unbiased) {\n    if (typeof (unbiased) === 'undefined') {\n        unbiased = true;\n    }\n    means = means || exports.mean(matrix);\n    var rows = matrix.length;\n    if (rows === 0) return [];\n    var cols = matrix[0].length;\n    var vari = new Array(cols);\n\n    for (var j = 0; j < cols; j++) {\n        var sum1 = 0, sum2 = 0, x = 0;\n        for (var i = 0; i < rows; i++) {\n            x = matrix[i][j] - means[j];\n            sum1 += x;\n            sum2 += x * x;\n        }\n        if (unbiased) {\n            vari[j] = (sum2 - ((sum1 * sum1) / rows)) / (rows - 1);\n        } else {\n            vari[j] = (sum2 - ((sum1 * sum1) / rows)) / rows;\n        }\n    }\n    return vari;\n};\n\nexports.median = function median(matrix) {\n    var rows = matrix.length, cols = matrix[0].length;\n    var medians = new Array(cols);\n\n    for (var i = 0; i < cols; i++) {\n        var data = new Array(rows);\n        for (var j = 0; j < rows; j++) {\n            data[j] = matrix[j][i];\n        }\n        data.sort(compareNumbers);\n        var N = data.length;\n        if (N % 2 === 0) {\n            medians[i] = (data[N / 2] + data[(N / 2) - 1]) * 0.5;\n        } else {\n            medians[i] = data[Math.floor(N / 2)];\n        }\n    }\n    return medians;\n};\n\nexports.mode = function mode(matrix) {\n    var rows = matrix.length,\n        cols = matrix[0].length,\n        modes = new Array(cols),\n        i, j;\n    for (i = 0; i < cols; i++) {\n        var itemCount = new Array(rows);\n        for (var k = 0; k < rows; k++) {\n            itemCount[k] = 0;\n        }\n        var itemArray = new Array(rows);\n        var count = 0;\n\n        for (j = 0; j < rows; j++) {\n            var index = itemArray.indexOf(matrix[j][i]);\n            if (index >= 0) {\n                itemCount[index]++;\n            } else {\n                itemArray[count] = matrix[j][i];\n                itemCount[count] = 1;\n                count++;\n            }\n        }\n\n        var maxValue = 0, maxIndex = 0;\n        for (j = 0; j < count; j++) {\n            if (itemCount[j] > maxValue) {\n                maxValue = itemCount[j];\n                maxIndex = j;\n            }\n        }\n\n        modes[i] = itemArray[maxIndex];\n    }\n    return modes;\n};\n\nexports.skewness = function skewness(matrix, unbiased) {\n    if (typeof (unbiased) === 'undefined') unbiased = true;\n    var means = exports.mean(matrix);\n    var n = matrix.length, l = means.length;\n    var skew = new Array(l);\n\n    for (var j = 0; j < l; j++) {\n        var s2 = 0, s3 = 0;\n        for (var i = 0; i < n; i++) {\n            var dev = matrix[i][j] - means[j];\n            s2 += dev * dev;\n            s3 += dev * dev * dev;\n        }\n\n        var m2 = s2 / n;\n        var m3 = s3 / n;\n        var g = m3 / Math.pow(m2, 3 / 2);\n\n        if (unbiased) {\n            var a = Math.sqrt(n * (n - 1));\n            var b = n - 2;\n            skew[j] = (a / b) * g;\n        } else {\n            skew[j] = g;\n        }\n    }\n    return skew;\n};\n\nexports.kurtosis = function kurtosis(matrix, unbiased) {\n    if (typeof (unbiased) === 'undefined') unbiased = true;\n    var means = exports.mean(matrix);\n    var n = matrix.length, m = matrix[0].length;\n    var kurt = new Array(m);\n\n    for (var j = 0; j < m; j++) {\n        var s2 = 0, s4 = 0;\n        for (var i = 0; i < n; i++) {\n            var dev = matrix[i][j] - means[j];\n            s2 += dev * dev;\n            s4 += dev * dev * dev * dev;\n        }\n        var m2 = s2 / n;\n        var m4 = s4 / n;\n\n        if (unbiased) {\n            var v = s2 / (n - 1);\n            var a = (n * (n + 1)) / ((n - 1) * (n - 2) * (n - 3));\n            var b = s4 / (v * v);\n            var c = ((n - 1) * (n - 1)) / ((n - 2) * (n - 3));\n            kurt[j] = a * b - 3 * c;\n        } else {\n            kurt[j] = m4 / (m2 * m2) - 3;\n        }\n    }\n    return kurt;\n};\n\nexports.standardError = function standardError(matrix) {\n    var samples = matrix.length;\n    var standardDeviations = exports.standardDeviation(matrix);\n    var l = standardDeviations.length;\n    var standardErrors = new Array(l);\n    var sqrtN = Math.sqrt(samples);\n\n    for (var i = 0; i < l; i++) {\n        standardErrors[i] = standardDeviations[i] / sqrtN;\n    }\n    return standardErrors;\n};\n\nexports.covariance = function covariance(matrix, dimension) {\n    return exports.scatter(matrix, undefined, dimension);\n};\n\nexports.scatter = function scatter(matrix, divisor, dimension) {\n    if (typeof (dimension) === 'undefined') {\n        dimension = 0;\n    }\n    if (typeof (divisor) === 'undefined') {\n        if (dimension === 0) {\n            divisor = matrix.length - 1;\n        } else if (dimension === 1) {\n            divisor = matrix[0].length - 1;\n        }\n    }\n    var means = exports.mean(matrix, dimension);\n    var rows = matrix.length;\n    if (rows === 0) {\n        return [[]];\n    }\n    var cols = matrix[0].length,\n        cov, i, j, s, k;\n\n    if (dimension === 0) {\n        cov = new Array(cols);\n        for (i = 0; i < cols; i++) {\n            cov[i] = new Array(cols);\n        }\n        for (i = 0; i < cols; i++) {\n            for (j = i; j < cols; j++) {\n                s = 0;\n                for (k = 0; k < rows; k++) {\n                    s += (matrix[k][j] - means[j]) * (matrix[k][i] - means[i]);\n                }\n                s /= divisor;\n                cov[i][j] = s;\n                cov[j][i] = s;\n            }\n        }\n    } else if (dimension === 1) {\n        cov = new Array(rows);\n        for (i = 0; i < rows; i++) {\n            cov[i] = new Array(rows);\n        }\n        for (i = 0; i < rows; i++) {\n            for (j = i; j < rows; j++) {\n                s = 0;\n                for (k = 0; k < cols; k++) {\n                    s += (matrix[j][k] - means[j]) * (matrix[i][k] - means[i]);\n                }\n                s /= divisor;\n                cov[i][j] = s;\n                cov[j][i] = s;\n            }\n        }\n    } else {\n        throw new Error('Invalid dimension');\n    }\n\n    return cov;\n};\n\nexports.correlation = function correlation(matrix) {\n    var means = exports.mean(matrix),\n        standardDeviations = exports.standardDeviation(matrix, true, means),\n        scores = exports.zScores(matrix, means, standardDeviations),\n        rows = matrix.length,\n        cols = matrix[0].length,\n        i, j;\n\n    var cor = new Array(cols);\n    for (i = 0; i < cols; i++) {\n        cor[i] = new Array(cols);\n    }\n    for (i = 0; i < cols; i++) {\n        for (j = i; j < cols; j++) {\n            var c = 0;\n            for (var k = 0, l = scores.length; k < l; k++) {\n                c += scores[k][j] * scores[k][i];\n            }\n            c /= rows - 1;\n            cor[i][j] = c;\n            cor[j][i] = c;\n        }\n    }\n    return cor;\n};\n\nexports.zScores = function zScores(matrix, means, standardDeviations) {\n    means = means || exports.mean(matrix);\n    if (typeof (standardDeviations) === 'undefined') standardDeviations = exports.standardDeviation(matrix, true, means);\n    return exports.standardize(exports.center(matrix, means, false), standardDeviations, true);\n};\n\nexports.center = function center(matrix, means, inPlace) {\n    means = means || exports.mean(matrix);\n    var result = matrix,\n        l = matrix.length,\n        i, j, jj;\n\n    if (!inPlace) {\n        result = new Array(l);\n        for (i = 0; i < l; i++) {\n            result[i] = new Array(matrix[i].length);\n        }\n    }\n\n    for (i = 0; i < l; i++) {\n        var row = result[i];\n        for (j = 0, jj = row.length; j < jj; j++) {\n            row[j] = matrix[i][j] - means[j];\n        }\n    }\n    return result;\n};\n\nexports.standardize = function standardize(matrix, standardDeviations, inPlace) {\n    if (typeof (standardDeviations) === 'undefined') standardDeviations = exports.standardDeviation(matrix);\n    var result = matrix,\n        l = matrix.length,\n        i, j, jj;\n\n    if (!inPlace) {\n        result = new Array(l);\n        for (i = 0; i < l; i++) {\n            result[i] = new Array(matrix[i].length);\n        }\n    }\n\n    for (i = 0; i < l; i++) {\n        var resultRow = result[i];\n        var sourceRow = matrix[i];\n        for (j = 0, jj = resultRow.length; j < jj; j++) {\n            if (standardDeviations[j] !== 0 && !isNaN(standardDeviations[j])) {\n                resultRow[j] = sourceRow[j] / standardDeviations[j];\n            }\n        }\n    }\n    return result;\n};\n\nexports.weightedVariance = function weightedVariance(matrix, weights) {\n    var means = exports.mean(matrix);\n    var rows = matrix.length;\n    if (rows === 0) return [];\n    var cols = matrix[0].length;\n    var vari = new Array(cols);\n\n    for (var j = 0; j < cols; j++) {\n        var sum = 0;\n        var a = 0, b = 0;\n\n        for (var i = 0; i < rows; i++) {\n            var z = matrix[i][j] - means[j];\n            var w = weights[i];\n\n            sum += w * (z * z);\n            b += w;\n            a += w * w;\n        }\n\n        vari[j] = sum * (b / (b * b - a));\n    }\n\n    return vari;\n};\n\nexports.weightedMean = function weightedMean(matrix, weights, dimension) {\n    if (typeof (dimension) === 'undefined') {\n        dimension = 0;\n    }\n    var rows = matrix.length;\n    if (rows === 0) return [];\n    var cols = matrix[0].length,\n        means, i, ii, j, w, row;\n\n    if (dimension === 0) {\n        means = new Array(cols);\n        for (i = 0; i < cols; i++) {\n            means[i] = 0;\n        }\n        for (i = 0; i < rows; i++) {\n            row = matrix[i];\n            w = weights[i];\n            for (j = 0; j < cols; j++) {\n                means[j] += row[j] * w;\n            }\n        }\n    } else if (dimension === 1) {\n        means = new Array(rows);\n        for (i = 0; i < rows; i++) {\n            means[i] = 0;\n        }\n        for (j = 0; j < rows; j++) {\n            row = matrix[j];\n            w = weights[j];\n            for (i = 0; i < cols; i++) {\n                means[j] += row[i] * w;\n            }\n        }\n    } else {\n        throw new Error('Invalid dimension');\n    }\n\n    var weightSum = arrayStat.sum(weights);\n    if (weightSum !== 0) {\n        for (i = 0, ii = means.length; i < ii; i++) {\n            means[i] /= weightSum;\n        }\n    }\n    return means;\n};\n\nexports.weightedCovariance = function weightedCovariance(matrix, weights, means, dimension) {\n    dimension = dimension || 0;\n    means = means || exports.weightedMean(matrix, weights, dimension);\n    var s1 = 0, s2 = 0;\n    for (var i = 0, ii = weights.length; i < ii; i++) {\n        s1 += weights[i];\n        s2 += weights[i] * weights[i];\n    }\n    var factor = s1 / (s1 * s1 - s2);\n    return exports.weightedScatter(matrix, weights, means, factor, dimension);\n};\n\nexports.weightedScatter = function weightedScatter(matrix, weights, means, factor, dimension) {\n    dimension = dimension || 0;\n    means = means || exports.weightedMean(matrix, weights, dimension);\n    if (typeof (factor) === 'undefined') {\n        factor = 1;\n    }\n    var rows = matrix.length;\n    if (rows === 0) {\n        return [[]];\n    }\n    var cols = matrix[0].length,\n        cov, i, j, k, s;\n\n    if (dimension === 0) {\n        cov = new Array(cols);\n        for (i = 0; i < cols; i++) {\n            cov[i] = new Array(cols);\n        }\n        for (i = 0; i < cols; i++) {\n            for (j = i; j < cols; j++) {\n                s = 0;\n                for (k = 0; k < rows; k++) {\n                    s += weights[k] * (matrix[k][j] - means[j]) * (matrix[k][i] - means[i]);\n                }\n                cov[i][j] = s * factor;\n                cov[j][i] = s * factor;\n            }\n        }\n    } else if (dimension === 1) {\n        cov = new Array(rows);\n        for (i = 0; i < rows; i++) {\n            cov[i] = new Array(rows);\n        }\n        for (i = 0; i < rows; i++) {\n            for (j = i; j < rows; j++) {\n                s = 0;\n                for (k = 0; k < cols; k++) {\n                    s += weights[k] * (matrix[j][k] - means[j]) * (matrix[i][k] - means[i]);\n                }\n                cov[i][j] = s * factor;\n                cov[j][i] = s * factor;\n            }\n        }\n    } else {\n        throw new Error('Invalid dimension');\n    }\n\n    return cov;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-stat/matrix.js","'use strict';\n\nexports.SNV = SNV;\nvar Stat = require('ml-stat').array;\n\n/**\n * Function that applies the standard normal variate (SNV) to an array of values.\n *\n * @param data - Array of values.\n * @returns {Array} - applied the SNV.\n */\nfunction SNV(data) {\n    var mean = Stat.mean(data);\n    var std = Stat.standardDeviation(data);\n    var result = data.slice();\n    for (var i = 0; i < data.length; i++) {\n        result[i] = (result[i] - mean) / std;\n    }\n    return result;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-array-utils/src/snv.js","import quickSelectMedian from 'median-quickselect';\n\n/**\n * Computes the median of the given values\n * @param {Array<number>} input\n * @return {number}\n */\nexport default function median(input) {\n    if (!Array.isArray(input)) {\n        throw new Error('input must be an array');\n    }\n\n    if (input.length === 0) {\n        throw new Error('input must not be empty');\n    }\n\n    return quickSelectMedian(input.slice());\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-array-median/src/index.js","(function(){function a(d){for(var e=0,f=d.length-1,g=void 0,h=void 0,i=void 0,j=c(e,f);!0;){if(f<=e)return d[j];if(f==e+1)return d[e]>d[f]&&b(d,e,f),d[j];for(g=c(e,f),d[g]>d[f]&&b(d,g,f),d[e]>d[f]&&b(d,e,f),d[g]>d[e]&&b(d,g,e),b(d,g,e+1),h=e+1,i=f;!0;){do h++;while(d[e]>d[h]);do i--;while(d[i]>d[e]);if(i<h)break;b(d,h,i)}b(d,e,i),i<=j&&(e=h),i>=j&&(f=i-1)}}var b=function b(d,e,f){var _ref;return _ref=[d[f],d[e]],d[e]=_ref[0],d[f]=_ref[1],_ref},c=function c(d,e){return~~((d+e)/2)};'undefined'!=typeof module&&module.exports?module.exports=a:window.median=a})();\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/median-quickselect/lib/median-quickselect.min.js","import max from 'ml-array-max';\nimport min from 'ml-array-min';\n\nexport default function rescale(input, options = {}) {\n    if (!Array.isArray(input)) {\n        throw new TypeError('input must be an array');\n    } else if (input.length === 0) {\n        throw new TypeError('input must not be empty');\n    }\n\n    let output;\n    if (options.output !== undefined) {\n        if (!Array.isArray(options.output)) {\n            throw new TypeError('output option must be an array if specified');\n        }\n        output = options.output;\n    } else {\n        output = new Array(input.length);\n    }\n\n    const currentMin = min(input);\n    const currentMax = max(input);\n\n    if (currentMin === currentMax) {\n        throw new RangeError('minimum and maximum input values are equal. Cannot rescale a constant array');\n    }\n\n    const {\n        min: minValue = options.autoMinMax ? currentMin : 0,\n        max: maxValue = options.autoMinMax ? currentMax : 1\n    } = options;\n\n    if (minValue >= maxValue) {\n        throw new RangeError('min option must be smaller than max option');\n    }\n\n    const factor = (maxValue - minValue) / (currentMax - currentMin);\n    for (var i = 0; i < input.length; i++) {\n        output[i] = (input[i] - currentMin) * factor + minValue;\n    }\n\n    return output;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-array-rescale/src/index.js","import Encoder from './VectorEncoder';\n\nconst CRLF = '\\r\\n';\nconst version = 'Cheminfo tools ' + require('../../package.json').version;\nconst defaultParameters = {encode: 'DIFDUP', yFactor: 1, type: 'SIMPLE', keep: []};\n/**\n * This class converts a SpectraData object into a String that can be stored as a jcamp file.\n * The string reflects the current state of the object and not the raw data from where this\n * spectrum was initially loaded.\n * @author acastillo\n *\n */\nexport default class JcampCreator {\n\n    /**\n     * This function creates a String that represents the given spectraData, in the format JCAM-DX 5.0\n     * The X,Y data can be compressed using one of the methods described in:\n     * \"JCAMP-DX. A STANDARD FORMAT FOR THE EXCHANGE OF ION MOBILITY SPECTROMETRY DATA\",\n     *  http://www.iupac.org/publications/pac/pdf/2001/pdf/7311x1765.pdf\n     * @param {SD} spectraData\n     * @param {object} options - Optional paramteres\n     * @param {string} [options.encode = 'DIFDUP']\n     * @param {number} [options.yFactor = 1]\n     * @param {string} [options.type = 'SIMPLE']\n     * @param {Array} [options.keep = [] ]\n     * @return {string}\n     */\n    convert(spectraData, options) {\n        options = Object.assign({}, defaultParameters, options);\n        const encodeFormat = options.encode.toUpperCase().trim();\n        const factorY = options.yFactor || 1;\n        const limitIntensity = Math.pow(2, 31);\n        let type = options.type;\n        const userDefinedParams = options.keep;\n\n        if (type === null || type.length === 0) {\n            type = 'SIMPLE';\n        }\n\n        var outString = '';\n        spectraData.setActiveElement(0);\n\n        var scale = factorY / spectraData.getParamDouble('YFACTOR', 1);\n        let minMax = {};\n\n        if (!spectraData.is2D()) {\n            minMax = spectraData.getMinMaxY();\n        } else {\n            minMax = {min: spectraData.getMinZ(), max: spectraData.getMaxZ()};\n        }\n\n        if (minMax.max * scale >= limitIntensity) {\n            scale = limitIntensity / minMax.max;\n        }\n\n        var scaleX = Math.abs(1.0 / spectraData.getDeltaX());\n\n        outString += '##TITLE= ' + spectraData.getTitle() + CRLF;\n        outString += '##JCAMP-DX= 5.00\\t$$' + version + CRLF;\n        outString += '##OWNER= ' + spectraData.getParamString('##OWNER=', '') + CRLF;\n        outString += '##DATA TYPE= ' + spectraData.getDataType() + CRLF;\n\n        if (type === 'NTUPLES') {\n            outString += ntuplesHead(spectraData, scale, scaleX, encodeFormat, userDefinedParams);\n        }\n\n        if (type === 'SIMPLE') {\n            outString += simpleHead(spectraData, scale, scaleX, encodeFormat, userDefinedParams);\n        }\n\n        return outString;\n    }\n}\n\nfunction ntuplesHead(spectraData, scale, scaleX, encodeFormat, userDefinedParams) {\n    var outString = '';\n    var variableX = spectraData.getSpectraVariable(0);\n    var variableY = spectraData.getSpectraVariable(1);\n    var variableZ = spectraData.getSpectraVariable(2);\n\n    outString += '##DATA CLASS= NTUPLES' + CRLF;\n    outString += '##NUM DIM= 2' + CRLF;\n    var nTuplesName = spectraData.getDataType().trim();\n    // we set the VarName parameter to the most common ones.\n    // These tables contain the number of occurences of each one\n    var abscVar = {};\n    var sub;\n    for (sub = 0; sub < spectraData.getNbSubSpectra(); sub++) {\n        spectraData.setActiveElement(sub);\n        if (abscVar[spectraData.getXUnits()]) {\n            abscVar[spectraData.getXUnits()].value++;\n        } else {\n            abscVar[spectraData.getXUnits()] = {value: 1, index: sub};\n        }\n    }\n\n    var keys = Object.keys(abscVar);\n    var mostCommon = keys[0];\n    var defaultSub = 0;\n\n    for (sub = 1; sub < keys.length; sub++) {\n        if (abscVar[keys[sub]].value > abscVar[mostCommon].value) {\n            mostCommon = keys[sub];\n            defaultSub = abscVar[keys[sub]].index;\n        }\n    }\n    var isComplex = false;\n    spectraData.setActiveElement(defaultSub);\n    var isNMR = spectraData.getDataType().indexOf('NMR') >= 0;\n\n    if (isNMR) {\n        outString += '##.OBSERVE FREQUENCY= ' + spectraData.getParamDouble('observefrequency', 0) + CRLF;\n        outString += '##.OBSERVE NUCLEUS= ^' + spectraData.getNucleus() + CRLF;\n        outString += '##$DECIM= ' + spectraData.getParamDouble('$DECIM', 0) + CRLF;\n        outString += '##$DSPFVS= ' + spectraData.getParamDouble('$DSPFVS', 0) + CRLF;\n        outString += '##$FCOR= ' + (Math.floor(spectraData.getParamDouble('$FCOR', 0))) + CRLF;\n        if (spectraData.containsParam('$SW_h')) {\n            outString += '##$SW_h= ' + spectraData.getParamDouble('$SW_h', 0) + CRLF;\n        } else if (spectraData.containsParam('$SW_p')) {\n            outString += '##$SW_p= ' + spectraData.getParamDouble('$SW_p', 0) + CRLF;\n        }\n        outString += '##$SW= ' + spectraData.getParamDouble('$SW', 0) + CRLF;\n        outString += '##$TD= ' + (Math.floor(spectraData.getParamDouble('$TD', 0))) + CRLF;\n        outString += '##$BF1= ' + spectraData.getParamDouble('$BF1', 0) + CRLF;\n        outString += '##$GRPDLY= ' + spectraData.getParamDouble('$GRPDLY', 0) + CRLF;\n        outString += '##.DIGITISER RES= ' + spectraData.getParamInt('.DIGITISER RES', 0) + CRLF;\n        outString += '##.PULSE SEQUENCE= ' + spectraData.getParamString('.PULSE SEQUENCE', '') + CRLF;\n        outString += '##.SOLVENT NAME= ' + spectraData.getSolventName() + CRLF;\n        outString += '##$NUC1= <' + spectraData.getNucleus() + '>' + CRLF;\n        if (spectraData.containsParam('2D_X_FREQUENCY')) {\n            outString += '##$SFO1= ' + spectraData.getParamDouble('2D_X_FREQUENCY', 0) + CRLF;\n        } else {\n            outString += '##$SFO1= ' + spectraData.getParamDouble('$SFO1', 0) + CRLF;\n        }\n\n        if (spectraData.containsParam('2D_X_OFFSET')) {\n            outString += '##$OFFSET= ' + spectraData.getParamDouble('2D_X_OFFSET', 0) + CRLF;\n        }\n\n        if (spectraData.is2D()) {\n            outString += '$$Parameters for 2D NMR Spectrum' + CRLF;\n            outString += '##$NUC1= <' + spectraData.getNucleus(2) + '>' + CRLF;\n            if (spectraData.containsParam('2D_Y_FREQUENCY')) {\n                outString += '##$SFO1= ' + spectraData.getParamDouble('2D_Y_FREQUENCY', 0) + CRLF;\n                outString += '##$SFO2= ' + spectraData.getParamDouble('2D_Y_FREQUENCY', 0) + CRLF;\n                outString += '##$BF2= ' + spectraData.getParamDouble('2D_Y_FREQUENCY', 0) + CRLF;\n            }\n            if (spectraData.containsParam('2D_Y_OFFSET')) {\n                outString += '##$OFFSET= ' + spectraData.getParamDouble('2D_Y_OFFSET', 0) + CRLF;\n            }\n\n            outString += '$$End of Parameters for 2D NMR Spectrum' + CRLF;\n        }\n    }\n    outString += '##NTUPLES=\\t' + nTuplesName + CRLF;\n    var freq1 = 1;\n    var freq2 = 1;\n    if (!spectraData.is2D() && spectraData.getNbSubSpectra() > 1 && isNMR) {\n        isComplex = true;\n    }\n    if (isComplex) {\n        outString += '##VAR_NAME=\\t' + spectraData.getXUnits() + ',\\t' + nTuplesName.substring(4) + '/REAL,\\t' + nTuplesName.substring(4) + '/IMAG' + CRLF;\n        outString += '##SYMBOL=\\tX,\\tR,\\tI' + CRLF;\n        outString += '##VAR_TYPE=\\tINDEPENDENT,\\tDEPENDENT,\\tDEPENDENT' + CRLF;\n        if (encodeFormat !== 'CSV' || encodeFormat !== 'PAC') {\n            outString += '##VAR_FORM=\\tAFFN,\\tASDF,\\tASDF' + CRLF;\n        } else {\n            outString += '##VAR_FORM=\\tAFFN,\\tAFFN,\\tAFFN' + CRLF;\n        }\n        outString += '##VAR_DIM=\\t' + spectraData.getNbPoints() + ',\\t' + spectraData.getNbPoints() + ',\\t' + spectraData.getNbPoints() + CRLF;\n        outString += '##UNITS=\\tHZ' + ',\\t' + spectraData.getYUnits() + ',\\t' + variableZ.units + CRLF;\n        outString += '##FACTOR=\\t' + 1.0 / scaleX + ',\\t' + 1.0 / scale + ',\\t' + 1.0 / scale + CRLF;\n\n        if (spectraData.getXUnits() === 'PPM') {\n            freq1 = spectraData.observeFrequencyX();\n        }\n\n        outString += '##FIRST=\\t' + spectraData.getFirstX() * freq1 + ',\\t' + spectraData.getY(0) + ',\\t0' + CRLF;\n        outString += '##LAST=\\t' + spectraData.getLastX() * freq1 + ',\\t' + spectraData.getLastY() + ',\\t0' + CRLF;\n    } else {\n        freq1 = 1;\n        if (spectraData.is2D()) {\n            outString += '##VAR_NAME=\\tFREQUENCY1,\\tFREQUENCY2,\\tSPECTRUM' + CRLF;\n            outString += '##SYMBOL=\\tF1,\\tF2,\\tY' + CRLF;\n            outString += '##.NUCLEUS=\\t' + spectraData.getNucleus(2) + ',\\t' + spectraData.getNucleus(1) + CRLF;\n            outString += '##VAR_TYPE=\\tINDEPENDENT,\\tINDEPENDENT,\\tDEPENDENT' + CRLF;\n            if (encodeFormat !== 'CSV' || encodeFormat !== 'PAC') {\n                outString += '##VAR_FORM=\\tAFFN,\\tAFFN,\\tASDF' + CRLF;\n            } else {\n                outString += '##VAR_FORM=\\tAFFN,\\tAFFN,\\tASDF' + CRLF;\n            }\n            outString += '##VAR_DIM=\\t' + spectraData.getNbSubSpectra() + ',\\t' + spectraData.getNbPoints() + ',\\t' + spectraData.getNbPoints() + CRLF;\n            //We had to change this, for Mestre compatibility\n            //outString+=(\"##UNITS=\\tHZ,\\t\"+ spectraData.getXUnits() + \",\\t\" + spectraData.getYUnits()+CRLF);\n            outString += '##UNITS=\\tHZ,\\tHZ,\\t' + spectraData.getZUnits() + CRLF;\n            if (spectraData.getXUnits() === 'PPM') {\n                freq1 = spectraData.getParamDouble('2D_Y_FREQUENCY', 1);\n            }\n            if (spectraData.getYUnits() === 'PPM') {\n                freq2 = spectraData.getParamDouble('2D_X_FREQUENCY', 1);\n            }\n            outString += '##FACTOR=\\t1,\\t' + freq2 / scaleX + ',\\t' + 1.0 / scale + CRLF;\n            outString += '##FIRST=\\t' + spectraData.getParamDouble('firstY', 0) * freq1 + ',\\t' + spectraData.getFirstX() * freq2 + ',\\t' + spectraData.getY(0) + CRLF;\n            outString += '##LAST=\\t' + spectraData.getParamDouble('lastY', 0) * freq1 + ',\\t' + spectraData.getLastX() * freq2\n            + ',\\t' + spectraData.getY(spectraData.getNbPoints() - 1) + CRLF;\n        } else {\n            outString += '##VAR_NAME=\\t' + variableX.varname + ',\\t' + variableY.varname + ',\\t' + variableX.varname + CRLF;\n            outString += '##SYMBOL=\\t' + variableX.symbol + ',\\t' + variableY.symbol + ',\\t' + variableZ.symbol + CRLF;\n            outString += '##VAR_TYPE=\\t' + variableX.vartype + ',\\t' + variableY.vartype + ',\\t' + variableZ.vartype + CRLF;\n            if (encodeFormat !== 'CSV' || encodeFormat !== 'PAC') {\n                outString += '##VAR_FORM=\\tAFFN,\\tASDF,\\tASDF' + CRLF;\n            } else {\n                outString += '##VAR_FORM=\\tAFFN,\\tAFFN,\\tAFFN' + CRLF;\n            }\n            outString += '##VAR_DIM=\\t' + variableX.vardim + ',\\t' + variableY.vardim + ',\\t' + variableZ.vardim + CRLF;\n            outString += '##UNITS=\\tHZ' + ',\\t' + spectraData.getYUnits() + ',\\t' + variableZ.units + CRLF;\n            if (spectraData.getXUnits() === 'PPM') {\n                freq1 = spectraData.observeFrequencyX();\n            }\n            outString += '##FACTOR=\\t' + 1.0 / scaleX + ',\\t' + 1.0 / scale + CRLF;\n            outString += '##FIRST=\\t' + variableX.first * freq1 + ',\\t' + variableY.first + ',\\t' + variableZ.first + CRLF;\n            outString += '##LAST=\\t' + variableX.last * freq1 + ',\\t' + variableY.last + ',\\t' + variableZ.last + CRLF;\n\n        }\n    }\n\n    //Set the user defined parameters\n    if (userDefinedParams !== null) {\n        for (var i = userDefinedParams.length - 1; i >= 0; i--) {\n            if (spectraData.containsParam(userDefinedParams[i])) {\n                outString += '##' + userDefinedParams[i] + '= '\n                + spectraData.getParam(userDefinedParams[i], '') + CRLF;\n            }\n        }\n    }\n    //Ordinate of the second dimension in case of 2D NMR spectra\n    var yUnits = 0;\n    var lastY = 0;\n    var dy = 1;\n\n    if (spectraData.is2D() && isNMR) {\n        yUnits = spectraData.getParamDouble('firstY', 0) * freq1;\n        lastY = spectraData.getParamDouble('lastY', 0) * freq1;\n        dy = (lastY - yUnits) / (spectraData.getNbSubSpectra() - 1);\n    }\n\n    for (sub = 0; sub < spectraData.getNbSubSpectra(); sub++) {\n        spectraData.setActiveElement(sub);\n        yUnits = spectraData.getParamDouble('firstY', 0) * freq1 + dy * sub;\n        outString += '##PAGE= ' + yUnits + CRLF;\n\n        if (spectraData.is2D() && isNMR) {\n            outString += '##FIRST=\\t' + spectraData.getParamDouble('firstY', 0) * freq1 + ',\\t'\n            + spectraData.getFirstX() * freq2 + ',\\t' + spectraData.getY(0) + CRLF;\n        }\n\n        outString += '##DATA TABLE= ';\n        if (spectraData.isDataClassPeak()) {\n            outString += '(XY..XY), PEAKS' + CRLF;\n            for (let point = 0; point < spectraData.getNbPoints(); point++) {\n                outString += spectraData.getX(point) + ', ' + spectraData.getY(point) + CRLF;\n            }\n\n        } else if (spectraData.isDataClassXY()) {\n            if (isNMR) {\n                if (spectraData.is2D()) {\n                    outString += '(F2++(Y..Y)), PROFILE' + CRLF;\n                } else {\n                    if (sub % 2 === 0) {\n                        outString += '(X++(R..R)), XYDATA' + CRLF;\n                    } else {\n                        outString += '(X++(I..I)), XYDATA' + CRLF;\n                    }\n                }\n            } else {\n                outString += '(X++(Y..Y)), XYDATA' + CRLF;\n            }\n\n            var tempString = '';\n            var data = new Array(spectraData.getNbPoints());\n            for (let point = data.length - 1; point >= 0; point--) {\n                data[point] = Math.round((spectraData.getY(point) * scale));\n            }\n\n            tempString += Encoder.encode(data,\n                spectraData.getFirstX() * scaleX, spectraData.getDeltaX() * scaleX, encodeFormat);\n            outString += tempString + CRLF;\n        }\n    }\n    outString += '##END NTUPLES= ' + nTuplesName + CRLF;\n    outString += '##END= ';\n\n    spectraData.setActiveElement(0);\n\n    return outString;\n}\n\nfunction simpleHead(spectraData, scale, scaleX, encodeFormat, userDefinedParams) {\n    //var variableX = spectraData.getSpectraVariable(0);\n    //var variableY = spectraData.getSpectraVariable(1);\n    var outString = '';\n    if (spectraData.isDataClassPeak()) {\n        outString += '##DATA CLASS= PEAK TABLE' + CRLF;\n    }\n    if (spectraData.isDataClassXY()) {\n        outString += '##DATA CLASS= XYDATA' + CRLF;\n    }\n\n    spectraData.setActiveElement(0);\n    //If it is a NMR spectrum\n    if (spectraData.getDataType().indexOf('NMR') >= 0) {\n        outString += '##.OBSERVE FREQUENCY= ' + spectraData.getParamDouble('observefrequency', 0) + CRLF;\n        outString += '##.OBSERVE NUCLEUS= ^' + spectraData.getNucleus() + CRLF;\n        outString += '##$DECIM= ' + (Math.round(spectraData.getParamDouble('$DECIM', 0))) + CRLF;\n        outString += '##$DSPFVS= ' + (Math.round(spectraData.getParamDouble('$DSPFVS', 0))) + CRLF;\n        outString += '##$FCOR= ' + (Math.round(spectraData.getParamDouble('$FCOR', 0))) + CRLF;\n        outString += '##$SW_h= ' + spectraData.getParamDouble('$SW_h', 0) + CRLF;\n        outString += '##$SW= ' + spectraData.getParamDouble('$SW', 0) + CRLF;\n        outString += '##$TD= ' + (Math.round(spectraData.getParamDouble('$TD', 0))) + CRLF;\n        outString += '##$GRPDLY= ' + spectraData.getParamDouble('$GRPDLY', 0) + CRLF;\n        outString += '##$BF1= ' + spectraData.getParamDouble('$BF1', 0) + CRLF;\n        outString += '##$SFO1= ' + spectraData.getParamDouble('$SFO1', 0) + CRLF;\n        outString += '##$NUC1= <' + spectraData.getNucleus() + '>' + CRLF;\n        outString += '##.SOLVENT NAME= ' + spectraData.getSolventName() + CRLF;\n    }\n    outString += '##XUNITS=\\t' + spectraData.getXUnits() + CRLF;\n    outString += '##YUNITS=\\t' + spectraData.getYUnits() + CRLF;\n    outString += '##NPOINTS=\\t' + spectraData.getNbPoints() + CRLF;\n    outString += '##FIRSTX=\\t' + spectraData.getFirstX() + CRLF;\n    outString += '##LASTX=\\t' + spectraData.getLastX() + CRLF;\n    outString += '##FIRSTY=\\t' + spectraData.getFirstY() + CRLF;\n    outString += '##LASTY=\\t' + spectraData.getLastY() + CRLF;\n    if (spectraData.isDataClassPeak()) {\n        outString += '##XFACTOR=1' + CRLF;\n        outString += '##YFACTOR=1' + CRLF;\n    } else if (spectraData.isDataClassXY()) {\n        outString += '##XFACTOR= ' + 1.0 / scaleX + CRLF;\n        outString += '##YFACTOR= ' + 1.0 / scale + CRLF;\n    }\n    outString += '##MAXY= ' + spectraData.getMaxY() + CRLF;\n    outString += '##MINY= ' + spectraData.getMinY() + CRLF;\n\n    //Set the user defined parameters\n    if (userDefinedParams !== null) {\n        for (var i = userDefinedParams.length - 1; i >= 0; i--) {\n            if (spectraData.containsParam(userDefinedParams[i])) {\n                outString += '##' + userDefinedParams[i] + '= '\n                + spectraData.getParam(userDefinedParams[i], '') + CRLF;\n            }\n        }\n    }\n\n\n    if (spectraData.isDataClassPeak()) {\n        outString += '##PEAK TABLE= (XY..XY)' + CRLF;\n        for (var point = 0; point < spectraData.getNbPoints(); point++) {\n            outString += spectraData.getX(point) + ', ' + spectraData.getY(point) + CRLF;\n        }\n        outString += '##END ';\n\n    } else if (spectraData.isDataClassXY()) {\n        outString += '##DELTAX= ' + spectraData.getDeltaX() + CRLF;\n        outString += '##XYDATA=(X++(Y..Y))' + CRLF;\n        var tempString = '';\n        var data = new Array(spectraData.getNbPoints());\n        for (let point = data.length - 1; point >= 0; point--) {\n            data[point] = Math.round(spectraData.getY(point) * scale);\n        }\n\n        tempString += Encoder.encode(data, spectraData.getFirstX() * scaleX, spectraData.getDeltaX() * scaleX, encodeFormat);\n\n        outString += tempString + CRLF;\n        outString += '##END= ';\n    }\n\n    spectraData.setActiveElement(0);\n    return outString;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/spectra-data/src/jcampEncoder/JcampCreator.js","\n/**\n * class encodes a integer vector as a String in order to store it in a text file.\n * The algorithms used to encode the data are describe in:\n *            http://www.iupac.org/publications/pac/pdf/2001/pdf/7311x1765.pdf\n * Created by acastillo on 3/2/16.\n */\nconst newLine = '\\r\\n';\n\nconst pseudoDigits = [\n    ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],\n    ['@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I'],\n    ['@', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i'],\n    ['%', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R'],\n    ['%', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r'],\n    [' ', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 's']\n];\n\nconst SQZ_P = 1;\nconst SQZ_N = 2;\nconst DIF_P = 3;\nconst DIF_N = 4;\nconst DUP = 5;\nconst MaxLinelength = 100;\n\n/**\n * This function encodes the given vector. The encoding format is specified by the\n * encoding option\n * @param {Array} data\n * @param {number} firstX\n * @param {number} intervalX\n * @param {string} encoding: ('FIX','SQZ','DIF','DIFDUP','CVS','PAC') Default 'DIFDUP'\n * @return {string}\n */\nfunction encode(data, firstX, intervalX, encoding) {\n    switch (encoding) {\n        case 'FIX':\n            return fixEncoding(data, firstX, intervalX);\n        case 'SQZ':\n            return squeezedEncoding(data, firstX, intervalX);\n        case 'DIF':\n            return differenceEncoding(data, firstX, intervalX);\n        case 'DIFDUP':\n            return differenceDuplicateEncoding(data, firstX, intervalX);\n        case 'CSV':\n            return commaSeparatedValuesEncoding(data, firstX, intervalX);\n        case 'PAC':\n            return packedEncoding(data, firstX, intervalX);\n        default:\n            return differenceEncoding(data, firstX, intervalX);\n    }\n}\n\n/**\n * @private\n * No data compression used. The data is separated by a comma(',').\n * @param {Array} data\n * @param {number} firstX\n * @param {number} intervalX\n * @return {string}\n */\nfunction commaSeparatedValuesEncoding(data, firstX, intervalX) {\n    return fixEncoding(data, firstX, intervalX, ',');\n}\n\n/**\n * @private\n * No data compression used. The data is separated by the specified separator.\n * @param {Array} data\n * @param {number} firstX\n * @param {number} intervalX\n * @param {string} separator, The separator character\n * @return {string}\n */\nfunction fixEncoding(data, firstX, intervalX, separator) {\n    if (!separator) {\n        separator = ' ';\n    }\n    var outputData = '';\n    var j = 0;\n    var TD = data.length;\n    var i;\n    while (j < TD - 7) {\n        outputData += Math.ceil(firstX + j * intervalX);\n        for (i = 0; i < 8; i++) {\n            outputData += separator + data[j++];\n        }\n        outputData += newLine;\n    }\n    if (j < TD) {\n        //We add last numbers\n        outputData += Math.ceil(firstX + j * intervalX);\n        for (i = j; i < TD; i++) {\n            outputData += separator + data[i];\n        }\n    }\n    return outputData;\n}\n\n/**\n * @private\n * No data compression used. The data is separated by the sign of the number.\n * @param {Array} data\n * @param {number} firstX\n * @param {number} intervalX\n * @return {string}\n */\nfunction packedEncoding(data, firstX, intervalX) {\n    var outputData = '';\n    var j = 0;\n    var TD = data.length;\n    var i;\n\n    while (j < TD - 7) {\n        outputData += Math.ceil(firstX + j * intervalX);\n        for (i = 0; i < 8; i++) {\n            if (data[j] < 0) {\n                outputData += '-' + data[j++];\n            } else {\n                outputData += '+' + data[j++];\n            }\n        }\n        outputData += newLine;\n    }\n    if (j < TD) {\n        //We add last numbers\n        outputData += Math.ceil(firstX + j * intervalX);\n        for (i = j; i < TD; i++) {\n            if (data[i] < 0) {\n                outputData += '-' + data[i];\n            } else {\n                outputData += '+' + data[i];\n            }\n        }\n    }\n    return outputData;\n}\n\n/**\n * @private\n * Data compression is possible using the squeezed form (SQZ) in which the delimiter, the leading digit,\n * and sign are replaced by a pseudo-digit from Table 1. For example, the Y-values 30, 32 would be\n * represented as C0C2.\n * @param {Array} data\n * @param {number} firstX\n * @param {number} intervalX\n * @return {string}\n */\nfunction squeezedEncoding(data, firstX, intervalX) {\n    var outputData = '';\n    //String outputData = new String();\n    var j = 0;\n    var TD = data.length;\n    var i;\n\n    while (j < TD - 10) {\n        outputData += Math.ceil(firstX + j * intervalX);\n        for (i = 0; i < 10; i++) {\n            outputData += squeezedDigit(data[j++].toString());\n        }\n        outputData += newLine;\n    }\n    if (j < TD) {\n        //We add last numbers\n        outputData += Math.ceil(firstX + j * intervalX);\n        for (i = j; i < TD; i++) {\n            outputData += squeezedDigit(data[i].toString());\n        }\n    }\n\n    return outputData;\n}\n\n/**\n * @private\n * Duplicate suppression encoding\n * @param {Array} data\n * @param {number} firstX\n * @param {number} intervalX\n * @return {string}\n */\nfunction differenceDuplicateEncoding(data, firstX, intervalX) {\n    var mult = 0;\n    var index = 0;\n    var charCount = 0;\n    var i;\n    //We built a string where we store the encoded data.\n    var encodData = '';\n    var encodNumber = '';\n    var temp = '';\n\n    //We calculate the differences vector\n    var diffData = new Array(data.length - 1);\n    for (i = 0; i < diffData.length; i++) {\n        diffData[i] = data[i + 1] - data[i];\n    }\n\n    //We simulate a line carry\n    var numDiff = diffData.length;\n    while (index < numDiff) {\n        if (charCount === 0) {//Start line\n            encodNumber = Math.ceil(firstX + index * intervalX) + squeezedDigit(data[index].toString()) + differenceDigit(diffData[index].toString());\n            encodData += encodNumber;\n            charCount += encodNumber.length;\n        } else {\n            //Try to insert next difference\n            if (diffData[index - 1] === diffData[index]) {\n                mult++;\n            } else {\n                if (mult > 0) {//Now we know that it can be in line\n                    mult++;\n                    encodNumber = duplicateDigit(mult.toString());\n                    encodData += encodNumber;\n                    charCount += encodNumber.length;\n                    mult = 0;\n                    index--;\n                } else {\n                    //Mirar si cabe, en caso contrario iniciar una nueva linea\n                    encodNumber = differenceDigit(diffData[index].toString());\n                    if (encodNumber.length + charCount < MaxLinelength) {\n                        encodData += encodNumber;\n                        charCount += encodNumber.length;\n                    } else {//Iniciar nueva linea\n                        encodData += newLine;\n                        temp = Math.ceil(firstX + index * intervalX) + squeezedDigit(data[index].toString()) + encodNumber;\n                        encodData += temp;//Each line start with first index number.\n                        charCount = temp.length;\n                    }\n                }\n            }\n        }\n        index++;\n    }\n    if (mult > 0) {\n        encodData += duplicateDigit((mult + 1).toString());\n    }\n    //We insert the last data from fid. It is done to control of data\n    //The last line start with the number of datas in the fid.\n    encodData += newLine + Math.ceil(firstX + index * intervalX) + squeezedDigit(data[index].toString());\n\n    return encodData;\n}\n\n/**\n * @private\n * Differential encoding\n * @param {Array} data\n * @param {number} firstX\n * @param {number} intervalX\n * @return {string}\n */\nfunction differenceEncoding(data, firstX, intervalX) {\n    var index = 0;\n    var charCount = 0;\n    var i;\n\n    var encodData = '';\n    var encodNumber = '';\n    var temp = '';\n\n    //We calculate the differences vector\n    var diffData = new Array(data.length - 1);\n    for (i = 0; i < diffData.length; i++) {\n        diffData[i] = data[i + 1] - data[i];\n    }\n\n    var numDiff = diffData.length;\n    while (index < numDiff) {\n        if (charCount === 0) {\n            //We convert the first number.\n            encodNumber = Math.ceil(firstX + index * intervalX) + squeezedDigit(data[index].toString()) + differenceDigit(diffData[index].toString());\n            encodData += encodNumber;\n            charCount += encodNumber.length;\n        } else {\n            encodNumber = differenceDigit(diffData[index].toString());\n            if (encodNumber.length + charCount < MaxLinelength) {\n                encodData += encodNumber;\n                charCount += encodNumber.length;\n            } else {\n                encodData += newLine;\n                temp = Math.ceil(firstX + index * intervalX) + squeezedDigit(data[index].toString()) + encodNumber;\n                encodData += temp;//Each line start with first index number.\n                charCount = temp.length;\n            }\n        }\n        index++;\n    }\n    //We insert the last number from data. It is done to control of data\n    encodData += newLine + Math.ceil(firstX + index * intervalX) + squeezedDigit(data[index].toString());\n\n    return encodData;\n}\n\n/**\n * @private\n * Convert number to the ZQZ format, using pseudo digits.\n * @param {number} num\n * @return {string}\n */\nfunction squeezedDigit(num) {\n    var SQZdigit = '';\n    if (num.charAt(0) === '-') {\n        SQZdigit += pseudoDigits[SQZ_N][num.charAt(1)];\n        if (num.length > 2) {\n            SQZdigit += num.substring(2);\n        }\n    } else {\n        SQZdigit += pseudoDigits[SQZ_P][num.charAt(0)];\n        if (num.length > 1) {\n            SQZdigit += num.substring(1);\n        }\n    }\n\n    return SQZdigit;\n}\n\n/**\n * @private\n * Convert number to the DIF format, using pseudo digits.\n * @param {number} num\n * @return {string}\n */\nfunction differenceDigit(num) {\n    var DIFFdigit = '';\n\n    if (num.charAt(0) === '-') {\n        DIFFdigit += pseudoDigits[DIF_N][num.charAt(1)];\n        if (num.length > 2) {\n            DIFFdigit += num.substring(2);\n        }\n\n    } else {\n        DIFFdigit += pseudoDigits[DIF_P][num.charAt(0)];\n        if (num.length > 1) {\n            DIFFdigit += num.substring(1);\n        }\n\n    }\n\n    return DIFFdigit;\n}\n\n/**\n * @private\n * Convert number to the DUP format, using pseudo digits.\n * @param {number} num\n * @return {string}\n */\nfunction duplicateDigit(num) {\n    var DUPdigit = '';\n    DUPdigit += pseudoDigits[DUP][num.charAt(0)];\n    if (num.length > 1) {\n        DUPdigit += num.substring(1);\n    }\n\n    return DUPdigit;\n}\n\nmodule.exports = {\n    encode,\n    fixEncoding,\n    commaSeparatedValuesEncoding,\n    packedEncoding,\n    squeezedEncoding,\n    differenceDuplicateEncoding,\n    differenceEncoding\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/spectra-data/src/jcampEncoder/VectorEncoder.js","module.exports = {\"_from\":\"spectra-data@3.2.0\",\"_id\":\"spectra-data@3.2.0\",\"_inBundle\":false,\"_integrity\":\"sha512-D1e1JThbnNS2zKW+SObJBpbbmnwUHvKA3LbAUscTtcorT9yfgOTIf5kuMvz2PfnPI9/VhA+hNP0ldfDvyUFc0w==\",\"_location\":\"/spectra-data\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"version\",\"registry\":true,\"raw\":\"spectra-data@3.2.0\",\"name\":\"spectra-data\",\"escapedName\":\"spectra-data\",\"rawSpec\":\"3.2.0\",\"saveSpec\":null,\"fetchSpec\":\"3.2.0\"},\"_requiredBy\":[\"/\"],\"_resolved\":\"https://registry.npmjs.org/spectra-data/-/spectra-data-3.2.0.tgz\",\"_shasum\":\"2f42033c530abb28c3ed3cf6219657356cedf3da\",\"_spec\":\"spectra-data@3.2.0\",\"_where\":\"/usr/local/www/sites/www.lactame.com/node/grm-data/git/cheminfo-js/spectra-data\",\"author\":{\"name\":\"Andres Castillo\"},\"bugs\":{\"url\":\"https://github.com/cheminfo-js/spectra/issues\"},\"bundleDependencies\":false,\"contributors\":[{\"name\":\"Michaël Zasso\"},{\"name\":\"Luc Patiny\"}],\"dependencies\":{\"brukerconverter\":\"^1.0.1\",\"jcampconverter\":\"^2.4.5\",\"lodash.round\":\"^4.0.4\",\"ml-array-max\":\"^1.0.1\",\"ml-array-median\":\"^1.0.0\",\"ml-array-min\":\"^1.0.1\",\"ml-array-rescale\":\"^1.1.0\",\"ml-array-utils\":\"^0.3.0\",\"ml-curve-fitting\":\"^0.0.7\",\"ml-fft\":\"^1.3.5\",\"ml-gsd\":\"^2.0.1\",\"ml-matrix-peaks-finder\":\"^0.2.1\",\"ml-simple-clustering\":\"^0.1.0\",\"nmr-simulation\":\"^1.0.11\",\"spectra-data-ranges\":\"^1.0.5\",\"spectra-nmr-utilities\":\"^1.0.1\"},\"deprecated\":false,\"description\":\"spectra-data project - manipulate spectra\",\"devDependencies\":{\"nmr-predictor\":\"^1.1.4\"},\"files\":[\"lib\",\"src\"],\"homepage\":\"https://github.com/cheminfo-js/spectra/packages/spectra-data\",\"jest\":{\"testEnvironment\":\"node\"},\"keywords\":[\"spectra-data\",\"project\"],\"license\":\"MIT\",\"main\":\"./lib/index.js\",\"module\":\"./src/index.js\",\"name\":\"spectra-data\",\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/cheminfo-js/spectra.git\"},\"version\":\"3.2.0\"}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/spectra-data/package.json\n// module id = 75\n// module chunks = 0","import GSD from 'ml-gsd';\n\n/**\n * Implementation of the peak picking method described by Cobas in:\n * A new approach to improving automated analysis of proton NMR spectra\n * through Global Spectral Deconvolution (GSD)\n * http://www.spectroscopyeurope.com/images/stories/ColumnPDFs/TD_23_1.pdf\n * @param {SD} spectrum - SD instance.\n * @param {Object} peakList - nmr signals.\n * @param {Object} options - options object with some parameter for GSD.\n * @param {boolean} [options.compile = true] - If true, the Janalyzer function is run over signals to compile the patterns.\n * @param {number} [options.minMaxRatio = 0.01] - Threshold to determine if a given peak should be considered as a noise, bases on its relative height compared to the highest peak.\n * @param {number} [options.broadRatio = 0.00025] - If broadRatio is higher than 0, then all the peaks which second derivative smaller than broadRatio * maxAbsSecondDerivative will be marked with the soft mask equal to true.\n * @param {boolean} [options.smoothY = true] - Select the peak intensities from a smoothed version of the independent variables?\n * @param {number} [options.nL = 4] - factor to determine the width at the moment to group the peaks in signals in 'GSD.optimizePeaks' function.\n * @param {boolean} [options.optimize = true] - if it's true adjust an train of gaussian or lorentzian shapes to spectrum.\n * @param {string} [options.functionType = 'gaussian'] - This option allows us choose between 'gaussian' or 'lorentzian' function when options.optimize is true.\n * @param {number} [options.broadWidth = 0.25] - Threshold to determine if some peak is candidate to clustering into range.\n * @return {Array}\n */\n\nconst defaultOptions = {\n    thresholdFactor: 1,\n    optimize: false,\n    minMaxRatio: 0.01,\n    broadRatio: 0.00025,\n    smoothY: true,\n    widthFactor: 4,\n    realTop: true,\n    functionName: 'gaussian',\n    broadWidth: 0.25,\n    sgOptions: {windowSize: 9, polynomial: 3}\n};\n\n\nexport default function extractPeaks(spectrum, options = {}) {\n    options = Object.assign({}, defaultOptions, options, {optimize: false, broadWidth: false});\n\n    if (!options.noiseLevel) {\n        options.noiseLevel = Math.abs(spectrum.getNoiseLevel()) * (options.thresholdFactor);\n    }\n\n    var data = spectrum.getXYData();\n\n    if (options.from && options.to) {\n        data = spectrum.getVector(options.from, options.to);\n    }\n    var peakList = GSD.gsd(data[0], data[1], options);\n\n    if (options.broadWidth) {\n        peakList = GSD.post.joinBroadPeaks(peakList, {width: options.broadWidth});\n    }\n    if (options.optimize) {\n        peakList = GSD.post.optimizePeaks(peakList, data[0], data[1], options);\n    }\n\n    return clearList(peakList, options.noiseLevel);\n}\n\n/**\n * this function remove the peaks with an intensity lower to threshold\n * @param {object} peakList - peaks\n * @param {number} threshold\n * @return {object} the clean peakList\n * @private\n */\nfunction clearList(peakList, threshold) {\n    for (var i = 0, l = peakList.length; i < l; i++) {\n        if (Math.abs(peakList[i].y) < threshold) {\n            peakList.splice(i, 1);\n        }\n    }\n    return peakList;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/spectra-data/src/peakPicking/peakPicking.js","'use strict';\n\nmodule.exports.post = require('../src/optimize');\nmodule.exports.gsd = require('../src/gsd');\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-gsd/src/index.js","/**\n * Created by acastillo on 9/6/15.\n */\n'use strict';\n\nvar Opt = require('ml-optimize-lorentzian');\n\nfunction sampleFunction(from, to, x, y, lastIndex) {\n    var nbPoints = x.length;\n    var sampleX = [];\n    var sampleY = [];\n    var direction = Math.sign(x[1] - x[0]);//Direction of the derivative\n    if (direction === -1) {\n        lastIndex[0] = x.length - 1;\n    }\n\n    var delta = Math.abs(to - from) / 2;\n    var mid = (from + to) / 2;\n    var stop = false;\n    var index = lastIndex[0];\n    while (!stop && index < nbPoints && index >= 0) {\n        if (Math.abs(x[index] - mid) <= delta) {\n            sampleX.push(x[index]);\n            sampleY.push(y[index]);\n            index += direction;\n        } else {\n            //It is outside the range.\n            if (Math.sign(mid - x[index]) === 1) {\n                //We'll reach the mid going in the current direction\n                index += direction;\n            } else {\n                //There is not more peaks in the current range\n                stop = true;\n            }\n        }\n        //console.log(sampleX);\n    }\n    lastIndex[0] = index;\n    return [sampleX, sampleY];\n}\n\nfunction optimizePeaks(peakList, x, y, n, fnType) {\n    var i, j, lastIndex = [0];\n    var groups = groupPeaks(peakList, n);\n    var result = [];\n    var factor = 1;\n    if (fnType === 'gaussian')\n        factor = 1.17741;//From https://en.wikipedia.org/wiki/Gaussian_function#Properties\n    var sampling, error, opts;\n    for (i = 0; i < groups.length; i++) {\n        var peaks = groups[i].group;\n        if (peaks.length > 1) {\n            //Multiple peaks\n            //console.log(\"Pending group of overlaped peaks \"+peaks.length);\n            //console.log(\"here1\");\n            //console.log(groups[i].limits);\n            sampling = sampleFunction(groups[i].limits[0] - groups[i].limits[1], groups[i].limits[0] + groups[i].limits[1], x, y, lastIndex);\n            //console.log(sampling);\n            if (sampling[0].length > 5) {\n                error = peaks[0].width / 1000;\n                opts = [  3,    100, error, error, error, error * 10, error * 10,    11,    9,        1 ];\n                //var gauss = Opt.optimizeSingleGaussian(sampling[0], sampling[1], opts, peaks);\n                var optPeaks = [];\n                if (fnType === 'gaussian')\n                    optPeaks = Opt.optimizeGaussianSum(sampling, peaks, opts);\n                else {\n                    if (fnType === 'lorentzian') {\n                        optPeaks = Opt.optimizeLorentzianSum(sampling, peaks, opts);\n                    }\n                }\n                //console.log(optPeak);\n                for (j = 0; j < optPeaks.length; j++) {\n                    result.push({x: optPeaks[j][0][0], y: optPeaks[j][1][0], width: optPeaks[j][2][0] * factor});\n                }\n            }\n        } else {\n            //Single peak\n            peaks = peaks[0];\n            sampling = sampleFunction(peaks.x - n * peaks.width,\n                peaks.x + n * peaks.width, x, y, lastIndex);\n            //console.log(\"here2\");\n            //console.log(groups[i].limits);\n            if (sampling[0].length > 5) {\n                error = peaks.width / 1000;\n                opts = [3, 100, error, error, error, error * 10, error * 10, 11, 9, 1];\n                //var gauss = Opt.optimizeSingleGaussian(sampling[0], sampling[1], opts, peaks);\n                //var gauss = Opt.optimizeSingleGaussian([sampling[0],sampling[1]], peaks, opts);\n                var optPeak = [];\n                if (fnType === 'gaussian')\n                    optPeak = Opt.optimizeSingleGaussian([sampling[0], sampling[1]], peaks,  opts);\n                else {\n                    if (fnType === 'lorentzian') {\n                        optPeak = Opt.optimizeSingleLorentzian([sampling[0], sampling[1]], peaks,  opts);\n                    }\n                }\n                //console.log(optPeak);\n                result.push({x: optPeak[0][0], y: optPeak[1][0], width: optPeak[2][0] * factor}); // From https://en.wikipedia.org/wiki/Gaussian_function#Properties}\n            }\n        }\n\n    }\n    return result;\n}\n\nfunction groupPeaks(peakList, nL) {\n    var group = [];\n    var groups = [];\n    var i, j;\n    var limits = [peakList[0].x, nL * peakList[0].width];\n    var upperLimit, lowerLimit;\n    //Merge forward\n    for (i = 0; i < peakList.length; i++) {\n        //If the 2 things overlaps\n        if (Math.abs(peakList[i].x - limits[0]) < (nL * peakList[i].width + limits[1])) {\n            //Add the peak to the group\n            group.push(peakList[i]);\n            //Update the group limits\n            upperLimit = limits[0] + limits[1];\n            if (peakList[i].x + nL * peakList[i].width > upperLimit) {\n                upperLimit = peakList[i].x + nL * peakList[i].width;\n            }\n            lowerLimit = limits[0] - limits[1];\n            if (peakList[i].x - nL * peakList[i].width < lowerLimit) {\n                lowerLimit = peakList[i].x - nL * peakList[i].width;\n            }\n            limits = [(upperLimit + lowerLimit) / 2, Math.abs(upperLimit - lowerLimit) / 2];\n\n        } else {\n            groups.push({limits: limits, group: group});\n            //var optmimalPeak = fitSpectrum(group,limits,spectrum);\n            group = [peakList[i]];\n            limits = [peakList[i].x, nL * peakList[i].width];\n        }\n    }\n    groups.push({limits: limits, group: group});\n    //Merge backward\n    for (i = groups.length - 2; i >= 0; i--) {\n        //The groups overlaps\n        if (Math.abs(groups[i].limits[0] - groups[i + 1].limits[0]) <\n            (groups[i].limits[1] + groups[i + 1].limits[1]) / 2) {\n            for (j = 0; j < groups[i + 1].group.length; j++) {\n                groups[i].group.push(groups[i + 1].group[j]);\n            }\n            upperLimit = groups[i].limits[0] + groups[i].limits[1];\n            if (groups[i + 1].limits[0] + groups[i + 1].limits[1] > upperLimit) {\n                upperLimit = groups[i + 1].limits[0] + groups[i + 1].limits[1];\n            }\n            lowerLimit = groups[i].limits[0] - groups[i].limits[1];\n            if (groups[i + 1].limits[0] - groups[i + 1].limits[1] < lowerLimit) {\n                lowerLimit = groups[i + 1].limits[0] - groups[i + 1].limits[1];\n            }\n            //console.log(limits);\n            groups[i].limits = [(upperLimit + lowerLimit) / 2, Math.abs(upperLimit - lowerLimit) / 2];\n\n            groups.splice(i + 1, 1);\n        }\n    }\n    return groups;\n}\n/**\n * This function try to join the peaks that seems to belong to a broad signal in a single broad peak.\n * @param peakList\n * @param options\n */\nfunction joinBroadPeaks(peakList, options) {\n    var width = options.width;\n    var broadLines = [];\n    //Optimize the possible broad lines\n    var max = 0, maxI = 0, count = 1;\n    for (let i = peakList.length - 1; i >= 0; i--) {\n        if (peakList[i].soft) {\n            broadLines.push(peakList.splice(i, 1)[0]);\n        }\n    }\n    //Push a feak peak\n    broadLines.push({x: Number.MAX_VALUE});\n\n    var candidates = [[broadLines[0].x,\n                        broadLines[0].y]];\n    var indexes = [0];\n\n    for (let i = 1; i < broadLines.length; i++) {\n        //console.log(broadLines[i-1].x+\" \"+broadLines[i].x);\n        if (Math.abs(broadLines[i - 1].x - broadLines[i].x) < width) {\n            candidates.push([broadLines[i].x, broadLines[i].y]);\n            if (broadLines[i].y > max) {\n                max = broadLines[i].y;\n                maxI = i;\n            }\n            indexes.push(i);\n            count++;\n        } else {\n            if (count > 2) {\n                var fitted = Opt.optimizeSingleLorentzian(candidates,\n                    {x: broadLines[maxI].x, y: max, width: Math.abs(candidates[0][0] - candidates[candidates.length - 1][0])});\n                peakList.push({x: fitted[0][0], y: fitted[1][0], width: fitted[2][0], soft: false});\n\n            } else {\n                //Put back the candidates to the signals list\n                indexes.map(function (index) {\n                    peakList.push(broadLines[index]);\n                });\n            }\n            candidates = [[broadLines[i].x, broadLines[i].y]];\n            indexes = [i];\n            max = broadLines[i].y;\n            maxI = i;\n            count = 1;\n        }\n    }\n\n    peakList.sort(function (a, b) {\n        return a.x - b.x;\n    });\n\n    return peakList;\n\n}\n\n/*\n var isPartOf = true\nif(options.broadRatio>0){\n var broadLines=[[Number.MAX_VALUE,0,0]];\n //Optimize the possible broad lines\n var max=0, maxI=0,count=0;\n var candidates = [],broadLinesS=[];\n var isPartOf = false;\n\n for(var i=broadLines.length-1;i>0;i--){\n //console.log(broadLines[i][0]+\" \"+rangeX+\" \"+Math.abs(broadLines[i-1][0]-broadLines[i][0]));\n if(Math.abs(broadLines[i-1][0]-broadLines[i][0])<rangeX){\n\n candidates.push(broadLines[i]);\n if(broadLines[i][1]>max){\n max = broadLines[i][1];\n maxI = i;\n }\n count++;\n }\n else{\n isPartOf = true;\n if(count>30){ // TODO, an options ?\n isPartOf = false;\n //for(var j=0;j<signals.length;j++){\n //    if(Math.abs(broadLines[maxI][0]-signals[j][0])<rangeX)\n //       isPartOf = true;\n //    }\n //console.log(\"Was part of \"+isPartOf);\n }\n if(isPartOf){\n for(var j=0;j<candidates.length;j++){\n signals.push([candidates[j][0], candidates[j][1], dx]);\n }\n }\n else{\n var fitted =  Opt.optimizeSingleLorentzian(candidates,{x:candidates[maxI][0],\n width:Math.abs(candidates[0][0]-candidates[candidates.length-1][0])},\n []);\n //console.log(fitted);\n signals.push([fitted[0][0],fitted[0][1],fitted[0][2]]);\n }\n candidates = [];\n max = 0;\n maxI = 0;\n count = 0;\n }\n }\n }*/\n\nmodule.exports = {optimizePeaks: optimizePeaks, joinBroadPeaks: joinBroadPeaks};\n\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-gsd/src/optimize.js","'use strict';\n\nvar LM = require('ml-curve-fitting');\nvar math = LM.Matrix.algebra;\nvar Matrix = require('ml-matrix');\n\n/**\n * This function calculates the spectrum as a sum of lorentzian functions. The Lorentzian\n * parameters are divided in 3 batches. 1st: centers; 2nd: heights; 3th: widths;\n * @param t Ordinate values\n * @param p Lorentzian parameters\n * @param c Constant parameters(Not used)\n * @returns {*}\n */\nfunction sumOfLorentzians(t,p,c){\n    var nL = p.length/3,factor,i, j,p2, cols = t.rows;\n    var result = Matrix.zeros(t.length,1);\n\n    for(i=0;i<nL;i++){\n        p2 = Math.pow(p[i+nL*2][0]/2,2);\n        factor = p[i+nL][0]*p2;\n        for(j=0;j<cols;j++){\n            result[j][0]+=factor/(Math.pow(t[j][0]-p[i][0],2)+p2);\n        }\n    }\n    return result;\n}\n\n/**\n * This function calculates the spectrum as a sum of gaussian functions. The Gaussian\n * parameters are divided in 3 batches. 1st: centers; 2nd: height; 3th: std's;\n * @param t Ordinate values\n * @param p Gaussian parameters\n * @param c Constant parameters(Not used)\n * @returns {*}\n */\nfunction sumOfGaussians(t,p,c){\n    var nL = p.length/3,factor,i, j, cols = t.rows;\n    var result = Matrix.zeros(t.length,1);\n\n    for(i=0;i<nL;i++){\n        factor = p[i+nL*2][0]*p[i+nL*2][0]/2;\n        for(j=0;j<cols;j++){\n            result[j][0]+=p[i+nL][0]*Math.exp(-(t[i][0]-p[i][0])*(t[i][0]-p[i][0])/factor);\n        }\n    }\n    return result;\n}\n/**\n * Single 4 parameter lorentzian function\n * @param t Ordinate values\n * @param p Lorentzian parameters\n * @param c Constant parameters(Not used)\n * @returns {*}\n */\nfunction singleLorentzian(t,p,c){\n    var factor = p[1][0]*Math.pow(p[2][0]/2,2);\n    var rows = t.rows;\n    var result = new Matrix(t.rows, t.columns);\n    for(var i=0;i<rows;i++){\n        result[i][0]=factor/(Math.pow(t[i][0]-p[0][0],2)+Math.pow(p[2][0]/2,2));\n    }\n    return result;\n}\n\n/**\n * Single 3 parameter gaussian function\n * @param t Ordinate values\n * @param p Gaussian parameters [mean, height, std]\n * @param c Constant parameters(Not used)\n * @returns {*}\n */\nfunction singleGaussian(t,p,c){\n    var factor2 = p[2][0]*p[2][0]/2;\n    var rows = t.rows;\n    var result = new Matrix(t.rows, t.columns);\n    for(var i=0;i<rows;i++){\n        result[i][0]=p[1][0]*Math.exp(-(t[i][0]-p[0][0])*(t[i][0]-p[0][0])/factor2);\n    }\n    return result;\n}\n\n/**\n * * Fits a set of points to a Lorentzian function. Returns the center of the peak, the width at half height, and the height of the signal.\n * @param data,[y]\n * @returns {*[]}\n */\nfunction optimizeSingleLorentzian(xy, peak, opts) {\n    opts = opts || {};\n    var xy2 = parseData(xy, opts.percentage||0);\n\n    if(xy2===null||xy2[0].rows<3){\n        return null; //Cannot run an optimization with less than 3 points\n    }\n\n    var t = xy2[0];\n    var y_data = xy2[1];\n    var maxY = xy2[2];\n    var nbPoints = t.rows, i;\n\n    var weight = [nbPoints / Math.sqrt(y_data.dot(y_data))];\n\n    var opts=Object.create(opts.LMOptions || [  3,    100, 1e-3, 1e-3, 1e-3, 1e-2, 1e-2,    11,    9,        1 ]);\n    //var opts = [  3,    100, 1e-3, 1e-3, 1e-3, 1e-2, 1e-2,    11,    9,        1 ];\n    var consts = [ ];\n    var dt = Math.abs(t[0][0]-t[1][0]);// optional vector of constants\n    var dx = new Matrix([[-dt/10000],[-1e-3],[-dt/10000]]);//-Math.abs(t[0][0]-t[1][0])/100;\n    var p_init = new Matrix([[peak.x],[1],[peak.width]]);\n    var p_min = new Matrix([[peak.x-dt],[0.75],[peak.width/4]]);\n    var p_max = new Matrix([[peak.x+dt],[1.25],[peak.width*4]]);\n\n    var p_fit = LM.optimize(singleLorentzian,p_init,t,y_data,weight,dx,p_min,p_max,consts,opts);\n\n\n    p_fit = p_fit.p;\n    return [p_fit[0],[p_fit[1][0]*maxY],p_fit[2]];\n\n}\n\n/**\n * Fits a set of points to a gaussian bell. Returns the mean of the peak, the std and the height of the signal.\n * @param data,[y]\n * @returns {*[]}\n */\nfunction optimizeSingleGaussian(xy, peak, opts) {\n    opts = opts || {};\n    var xy2 = parseData(xy, opts.percentage||0);\n\n    if(xy2===null||xy2[0].rows<3){\n        return null; //Cannot run an optimization with less than 3 points\n    }\n\n    var t = xy2[0];\n    var y_data = xy2[1];\n    var maxY = xy2[2];\n\n    var nbPoints = t.rows, i;\n\n\n\n    var weight = [nbPoints / Math.sqrt(y_data.dot(y_data))];\n\n    var opts=Object.create(opts.LMOptions || [  3,    100, 1e-3, 1e-3, 1e-3, 1e-2, 1e-2,    11,    9,        1 ]);\n    //var opts = [  3,    100, 1e-3, 1e-3, 1e-3, 1e-2, 1e-2,    11,    9,        1 ];\n    var consts = [ ];                         // optional vector of constants\n    var dt = Math.abs(t[0][0]-t[1][0]);\n    var dx = new Matrix([[-dt/10000],[-1e-3],[-dt/10000]]);//-Math.abs(t[0][0]-t[1][0])/100;\n\n    var dx = new Matrix([[-Math.abs(t[0][0]-t[1][0])/1000],[-1e-3],[-peak.width/1000]]);\n    var p_init = new Matrix([[peak.x],[1],[peak.width]]);\n    var p_min = new Matrix([[peak.x-dt],[0.75],[peak.width/4]]);\n    var p_max = new Matrix([[peak.x+dt],[1.25],[peak.width*4]]);\n    //var p_min = new Matrix([[peak.x-peak.width/4],[0.75],[peak.width/3]]);\n    //var p_max = new Matrix([[peak.x+peak.width/4],[1.25],[peak.width*3]]);\n\n    var p_fit = LM.optimize(singleGaussian,p_init,t,y_data,weight,dx,p_min,p_max,consts,opts);\n    p_fit = p_fit.p;\n    return [p_fit[0],[p_fit[1][0]*maxY],p_fit[2]];\n}\n\n/*\n peaks on group should sorted\n */\nfunction optimizeLorentzianTrain(xy, group, opts){\n    var xy2 = parseData(xy);\n    //console.log(xy2[0].rows);\n    if(xy2===null||xy2[0].rows<3){\n        return null; //Cannot run an optimization with less than 3 points\n    }\n\n    var t = xy2[0];\n    var y_data = xy2[1];\n    var maxY = xy2[2];\n    var currentIndex = 0;\n    var nbPoints = t.length;\n    var nextX;\n    var tI, yI, maxY;\n    var result=[], current;\n    for(var i=0; i<group.length;i++){\n        nextX = group[i].x-group[i].width*4;\n        //console.log(group[i]);\n        while(t[currentIndex++]<nextX&&currentIndex<nbPoints);\n        nextX = group[i].x+group[i].width*4;\n        tI = [];\n        yI = [];\n        while(t[currentIndex]<=nextX&&currentIndex<nbPoints){\n            tI.push(t[currentIndex][0]);\n            yI.push(y_data[currentIndex][0]*maxY);\n            currentIndex++;\n        }\n\n        current=optimizeSingleLorentzian([tI, yI], group[i], opts);\n        if(current){\n            result.push({\"x\":current[0][0],\"y\":current[1][0],\"width\":current[2][0],\"opt\":true});\n        }\n        else{\n            result.push({\"x\":group[i].x,\"y\":group[i].y,\"width\":group[i].width,\"opt\":false});\n        }\n    }\n\n    return result;\n\n}\n\nfunction optimizeGaussianTrain(xy, group, opts){\n    var xy2 = parseData(xy);\n    //console.log(xy2[0].rows);\n    if(xy2===null||xy2[0].rows<3){\n        return null; //Cannot run an optimization with less than 3 points\n    }\n\n    var t = xy2[0];\n    var y_data = xy2[1];\n    var maxY = xy2[2];\n    var currentIndex = 0;\n    var nbPoints = t.length;\n    var nextX;\n    var tI, yI, maxY;\n    var result=[], current;\n    for(var i=0; i<group.length;i++){\n        nextX = group[i].x-group[i].width*4;\n        //console.log(group[i]);\n        while(t[currentIndex++]<nextX&&currentIndex<nbPoints);\n        nextX = group[i].x+group[i].width*4;\n        tI = [];\n        yI = [];\n        while(t[currentIndex]<=nextX&&currentIndex<nbPoints){\n            tI.push(t[currentIndex][0]);\n            yI.push(y_data[currentIndex][0]*maxY);\n            currentIndex++;\n        }\n\n        current=optimizeSingleGaussian([tI, yI], group[i], opts);\n        if(current){\n            result.push({\"x\":current[0][0],\"y\":current[1][0],\"width\":current[2][0],\"opt\":true});\n        }\n        else{\n            result.push({\"x\":group[i].x,\"y\":group[i].y,\"width\":group[i].width,\"opt\":false});\n        }\n    }\n\n    return result;\n}\n\n\n\n/**\n *\n * @param xy A two column matrix containing the x and y data to be fitted\n * @param group A set of initial lorentzian parameters to be optimized [center, heigth, half_width_at_half_height]\n * @returns {Array} A set of final lorentzian parameters [center, heigth, hwhh*2]\n */\nfunction optimizeLorentzianSum(xy, group, opts){\n    var xy2 = parseData(xy);\n\n    if(xy2===null||xy2[0].rows<3){\n        return null; //Cannot run an optimization with less than 3 points\n    }\n\n    var t = xy2[0];\n    var y_data = xy2[1];\n    var maxY = xy2[2];\n    var nbPoints = t.rows, i;\n\n    var weight = [nbPoints / math.sqrt(y_data.dot(y_data))];\n    var opts=Object.create(opts || [  3,    100, 1e-3, 1e-3, 1e-3, 1e-2, 1e-2, 11, 9, 1 ]);\n    var consts = [ ];// optional vector of constants\n\n    var nL = group.length;\n    var p_init = new Matrix(nL*3,1);\n    var p_min =  new Matrix(nL*3,1);\n    var p_max =  new Matrix(nL*3,1);\n    var dx = new Matrix(nL*3,1);\n    var dt = Math.abs(t[0][0]-t[1][0]);\n    for( i=0;i<nL;i++){\n        p_init[i][0] = group[i].x;\n        p_init[i+nL][0] = 1;\n        p_init[i+2*nL][0] = group[i].width;\n\n        p_min[i][0] = group[i].x-dt;//-group[i].width/4;\n        p_min[i+nL][0] = 0;\n        p_min[i+2*nL][0] = group[i].width/4;\n\n        p_max[i][0] = group[i].x+dt;//+group[i].width/4;\n        p_max[i+nL][0] = 1.5;\n        p_max[i+2*nL][0] = group[i].width*4;\n\n        dx[i][0] = -dt/1000;\n        dx[i+nL][0] = -1e-3;\n        dx[i+2*nL][0] = -dt/1000;\n    }\n\n    var dx = -Math.abs(t[0][0]-t[1][0])/10000;\n    var p_fit = LM.optimize(sumOfLorentzians, p_init, t, y_data, weight, dx, p_min, p_max, consts, opts);\n    p_fit=p_fit.p;\n    //Put back the result in the correct format\n    var result = new Array(nL);\n    for( i=0;i<nL;i++){\n        result[i]=[p_fit[i],[p_fit[i+nL][0]*maxY],p_fit[i+2*nL]];\n    }\n\n    return result;\n\n}\n\n/**\n *\n * @param xy A two column matrix containing the x and y data to be fitted\n * @param group A set of initial lorentzian parameters to be optimized [center, heigth, half_width_at_half_height]\n * @returns {Array} A set of final lorentzian parameters [center, heigth, hwhh*2]\n */\nfunction optimizeGaussianSum(xy, group, opts){\n    var xy2 = parseData(xy);\n\n    if(xy2===null||xy2[0].rows<3){\n        return null; //Cannot run an optimization with less than 3 points\n    }\n\n    var t = xy2[0];\n    var y_data = xy2[1];\n    var maxY = xy2[2];\n    var nbPoints = t.rows,i;\n\n    var weight = new Matrix(nbPoints,1);//[nbPoints / math.sqrt(y_data.dot(y_data))];\n    var k = nbPoints / math.sqrt(y_data.dot(y_data));\n    for(i=0;i<nbPoints;i++){\n        weight[i][0]=k;///(y_data[i][0]);\n        //weight[i][0]=k*(2-y_data[i][0]);\n    }\n\n    var opts=Object.create(opts || [  3,    100, 1e-3, 1e-3, 1e-3, 1e-2, 1e-2,    11,    9,        2 ]);\n    //var opts=[  3,    100, 1e-5, 1e-6, 1e-6, 1e-6, 1e-6,    11,    9,        1 ];\n    var consts = [ ];// optional vector of constants\n\n    var nL = group.length;\n    var p_init = new Matrix(nL*3,1);\n    var p_min =  new Matrix(nL*3,1);\n    var p_max =  new Matrix(nL*3,1);\n    var dx = new Matrix(nL*3,1);\n    var dt = Math.abs(t[0][0]-t[1][0]);\n    for( i=0;i<nL;i++){\n        p_init[i][0] = group[i].x;\n        p_init[i+nL][0] = group[i].y/maxY;\n        p_init[i+2*nL][0] = group[i].width;\n\n        p_min[i][0] = group[i].x-dt;\n        p_min[i+nL][0] = group[i].y*0.8/maxY;\n        p_min[i+2*nL][0] = group[i].width/2;\n\n        p_max[i][0] = group[i].x+dt;\n        p_max[i+nL][0] = group[i].y*1.2/maxY;\n        p_max[i+2*nL][0] = group[i].width*2;\n\n        dx[i][0] = -dt/1000;\n        dx[i+nL][0] = -1e-3;\n        dx[i+2*nL][0] = -dt/1000;\n    }\n    //console.log(t);\n    var p_fit = LM.optimize(sumOfLorentzians,p_init,t,y_data,weight,dx,p_min,p_max,consts,opts);\n    p_fit = p_fit.p;\n    //Put back the result in the correct format\n    var result = new Array(nL);\n    for( i=0;i<nL;i++){\n        result[i]=[p_fit[i],[p_fit[i+nL][0]*maxY],p_fit[i+2*nL]];\n    }\n\n    return result;\n\n}\n/**\n *\n * Converts the given input to the required x, y column matrices. y data is normalized to max(y)=1\n * @param xy\n * @returns {*[]}\n */\nfunction parseData(xy, threshold){\n    var nbSeries = xy.length;\n    var t = null;\n    var y_data = null, x,y;\n    var maxY = 0, i,j;\n\n    if(nbSeries==2){\n        //Looks like row wise matrix [x,y]\n        var nbPoints = xy[0].length;\n        //if(nbPoints<3)\n        //    throw new Exception(nbPoints);\n        //else{\n        t = new Array(nbPoints);//new Matrix(nbPoints,1);\n        y_data = new Array(nbPoints);//new Matrix(nbPoints,1);\n        x = xy[0];\n        y = xy[1];\n        if(typeof x[0] === \"number\"){\n            for(i=0;i<nbPoints;i++){\n                t[i]=x[i];\n                y_data[i]=y[i];\n                if(y[i]>maxY)\n                    maxY = y[i];\n            }\n        }\n        else{\n            //It is a colum matrix\n            if(typeof x[0] === \"object\"){\n                for(i=0;i<nbPoints;i++){\n                    t[i]=x[i][0];\n                    y_data[i]=y[i][0];\n                    if(y[i][0]>maxY)\n                        maxY = y[i][0];\n                }\n            }\n\n        }\n\n        //}\n    }\n    else{\n        //Looks like a column wise matrix [[x],[y]]\n        var nbPoints = nbSeries;\n        //if(nbPoints<3)\n        //    throw new SizeException(nbPoints);\n        //else {\n        t = new Array(nbPoints);//new Matrix(nbPoints, 1);\n        y_data = new Array(nbPoints);//new Matrix(nbPoints, 1);\n        for (i = 0; i < nbPoints; i++) {\n            t[i] = xy[i][0];\n            y_data[i] = xy[i][1];\n            if(y_data[i]>maxY)\n                maxY = y_data[i];\n        }\n        //}\n    }\n    for (i = 0; i < nbPoints; i++) {\n        y_data[i]/=maxY;\n    }\n    if(threshold){\n        for (i = nbPoints-1; i >=0; i--) {\n            if(y_data[i]<threshold) {\n                y_data.splice(i,1);\n                t.splice(i,1);\n            }\n        }\n    }\n    if(t.length>0)\n        return [(new Matrix([t])).transpose(),(new Matrix([y_data])).transpose(),maxY];\n    return null;\n}\n\nfunction sizeException(nbPoints) {\n    return new RangeError(\"Not enough points to perform the optimization: \"+nbPoints +\"< 3\");\n}\n\nmodule.exports.optimizeSingleLorentzian = optimizeSingleLorentzian;\nmodule.exports.optimizeLorentzianSum = optimizeLorentzianSum;\nmodule.exports.optimizeSingleGaussian = optimizeSingleGaussian;\nmodule.exports.optimizeGaussianSum = optimizeGaussianSum;\nmodule.exports.singleGaussian = singleGaussian;\nmodule.exports.singleLorentzian = singleLorentzian;\nmodule.exports.optimizeGaussianTrain = optimizeGaussianTrain;\nmodule.exports.optimizeLorentzianTrain = optimizeLorentzianTrain;\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-optimize-lorentzian/src/index.js","'use strict';\n\nmodule.exports = require('./LM');\nmodule.exports.Matrix = require('ml-matrix');\nmodule.exports.Matrix.algebra = require('./algebra');\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-optimize-lorentzian/node_modules/ml-curve-fitting/src/index.js","/**\n * Created by acastillo on 8/5/15.\n */\nvar Matrix = require(\"ml-matrix\");\nvar math = require(\"./algebra\");\n\nvar DEBUG = false;\n/** Levenberg Marquardt curve-fitting: minimize sum of weighted squared residuals\n ----------  INPUT  VARIABLES  -----------\n func   = function of n independent variables, 't', and m parameters, 'p',\n returning the simulated model: y_hat = func(t,p,c)\n p      = n-vector of initial guess of parameter values\n t      = m-vectors or matrix of independent variables (used as arg to func)\n y_dat  = m-vectors or matrix of data to be fit by func(t,p)\n weight = weighting vector for least squares fit ( weight >= 0 ) ...\n inverse of the standard measurement errors\n Default:  sqrt(d.o.f. / ( y_dat' * y_dat ))\n dp     = fractional increment of 'p' for numerical derivatives\n dp(j)>0 central differences calculated\n dp(j)<0 one sided 'backwards' differences calculated\n dp(j)=0 sets corresponding partials to zero; i.e. holds p(j) fixed\n Default:  0.001;\n p_min  = n-vector of lower bounds for parameter values\n p_max  = n-vector of upper bounds for parameter values\n c      = an optional matrix of values passed to func(t,p,c)\n opts   = vector of algorithmic parameters\n parameter    defaults    meaning\n opts(1)  =  prnt            3        >1 intermediate results; >2 plots\n opts(2)  =  MaxIter      10*Npar     maximum number of iterations\n opts(3)  =  epsilon_1       1e-3     convergence tolerance for gradient\n opts(4)  =  epsilon_2       1e-3     convergence tolerance for parameters\n opts(5)  =  epsilon_3       1e-3     convergence tolerance for Chi-square\n opts(6)  =  epsilon_4       1e-2     determines acceptance of a L-M step\n opts(7)  =  lambda_0        1e-2     initial value of L-M paramter\n opts(8)  =  lambda_UP_fac   11       factor for increasing lambda\n opts(9)  =  lambda_DN_fac    9       factor for decreasing lambda\n opts(10) =  Update_Type      1       1: Levenberg-Marquardt lambda update\n 2: Quadratic update\n 3: Nielsen's lambda update equations\n\n ----------  OUTPUT  VARIABLES  -----------\n p       = least-squares optimal estimate of the parameter values\n X2      = Chi squared criteria\n sigma_p = asymptotic standard error of the parameters\n sigma_y = asymptotic standard error of the curve-fit\n corr    = correlation matrix of the parameters\n R_sq    = R-squared cofficient of multiple determination\n cvg_hst = convergence history\n\n Henri Gavin, Dept. Civil & Environ. Engineering, Duke Univ. 22 Sep 2013\n modified from: http://octave.sourceforge.net/optim/function/leasqr.html\n using references by\n Press, et al., Numerical Recipes, Cambridge Univ. Press, 1992, Chapter 15.\n Sam Roweis       http://www.cs.toronto.edu/~roweis/notes/lm.pdf\n Manolis Lourakis http://www.ics.forth.gr/~lourakis/levmar/levmar.pdf\n Hans Nielson     http://www2.imm.dtu.dk/~hbn/publ/TR9905.ps\n Mathworks        optimization toolbox reference manual\n K. Madsen, H.B., Nielsen, and O. Tingleff\n http://www2.imm.dtu.dk/pubdb/views/edoc_download.php/3215/pdf/imm3215.pdf\n */\nvar LM = {\n\n    optimize: function(func,p,t,y_dat,weight,dp,p_min,p_max,c,opts){\n\n        var tensor_parameter = 0;\t\t\t// set to 1 of parameter is a tensor\n\n        var iteration  = 0;\t\t\t// iteration counter\n        //func_calls = 0;\t\t\t// running count of function evaluations\n\n        if((typeof p[0])!=\"object\"){\n            for(var i=0;i< p.length;i++){\n                p[i]=[p[i]];\n            }\n\n        }\n        //p = p(:); y_dat = y_dat(:);\t\t// make column vectors\n        var i,k;\n        var eps = 2^-52;\n        var Npar   = p.length;//length(p); \t\t\t// number of parameters\n        var Npnt   = y_dat.length;//length(y_dat);\t\t// number of data points\n        var p_old  = Matrix.zeros(Npar,1);\t\t// previous set of parameters\n        var y_old  = Matrix.zeros(Npnt,1);\t\t// previous model, y_old = y_hat(t;p_old)\n        var X2     = 1e-2/eps;\t\t\t// a really big initial Chi-sq value\n        var X2_old = 1e-2/eps;\t\t\t// a really big initial Chi-sq value\n        var J =  Matrix.zeros(Npnt,Npar);\n\n\n        if (t.length != y_dat.length) {\n            console.log('lm.m error: the length of t must equal the length of y_dat');\n\n            length_t = t.length;\n            length_y_dat = y_dat.length;\n            var X2 = 0, corr = 0, sigma_p = 0, sigma_y = 0, R_sq = 0, cvg_hist = 0;\n            if (!tensor_parameter) {\n                return;\n            }\n        }\n\n        weight = weight||Math.sqrt((Npnt-Npar+1)/(math.multiply(math.transpose(y_dat),y_dat)));\n        dp = dp || 0.001;\n        p_min   = p_min || math.multiply(Math.abs(p),-100);\n        p_max   = p_max || math.multiply(Math.abs(p),100);\n        c = c || 1;\n        // Algorithmic Paramters\n        //prnt MaxIter  eps1  eps2  epx3  eps4  lam0  lamUP lamDN UpdateType\n        opts = opts ||[  3,10*Npar, 1e-3, 1e-3, 1e-3, 1e-2, 1e-2, 11, 9, 1 ];\n\n        var prnt          = opts[0];\t// >1 intermediate results; >2 plots\n        var MaxIter       = opts[1];\t// maximum number of iterations\n        var epsilon_1     = opts[2];\t// convergence tolerance for gradient\n        var epsilon_2     = opts[3];\t// convergence tolerance for parameter\n        var epsilon_3     = opts[4];\t// convergence tolerance for Chi-square\n        var epsilon_4     = opts[5];\t// determines acceptance of a L-M step\n        var lambda_0      = opts[6];\t// initial value of damping paramter, lambda\n        var lambda_UP_fac = opts[7];\t// factor for increasing lambda\n        var lambda_DN_fac = opts[8];\t// factor for decreasing lambda\n        var Update_Type   = opts[9];\t// 1: Levenberg-Marquardt lambda update\n        // 2: Quadratic update\n        // 3: Nielsen's lambda update equations\n\n        if ( tensor_parameter && prnt == 3 ) prnt = 2;\n\n\n        if(!dp.length || dp.length == 1){\n            var dp_array = new Array(Npar);\n            for(var i=0;i<Npar;i++)\n                dp_array[i]=[dp];\n            dp=dp_array;\n        }\n\n        // indices of the parameters to be fit\n        var idx   = [];\n        for(i=0;i<dp.length;i++){\n            if(dp[i][0]!=0){\n                idx.push(i);\n            }\n        }\n\n        var Nfit = idx.length;\t\t\t// number of parameters to fit\n        var stop = false;\t\t\t\t// termination flag\n\n        var weight_sq = null;\n        //console.log(weight);\n        if ( !weight.length || weight.length < Npnt )\t{\n            // squared weighting vector\n            //weight_sq = ( weight(1)*ones(Npnt,1) ).^2;\n            //console.log(\"weight[0] \"+typeof weight[0]);\n            var tmp = math.multiply(Matrix.ones(Npnt,1),weight[0]);\n            weight_sq = math.dotMultiply(tmp,tmp);\n        }\n        else{\n            //weight_sq = (weight(:)).^2;\n            weight_sq = math.dotMultiply(weight,weight);\n        }\n\n\n        // initialize Jacobian with finite difference calculation\n        //console.log(\"J \"+weight_sq);\n        var result = this.lm_matx(func,t,p_old,y_old,1,J,p,y_dat,weight_sq,dp,c);\n        var JtWJ = result.JtWJ,JtWdy=result.JtWdy,X2=result.Chi_sq,y_hat=result.y_hat,J=result.J;\n        //[JtWJ,JtWdy,X2,y_hat,J] = this.lm_matx(func,t,p_old,y_old,1,J,p,y_dat,weight_sq,dp,c);\n        //console.log(JtWJ);\n\n        if ( Math.max(Math.abs(JtWdy)) < epsilon_1 ){\n            console.log(' *** Your Initial Guess is Extremely Close to Optimal ***')\n            console.log(' *** epsilon_1 = ', epsilon_1);\n            stop = true;\n        }\n\n\n        switch(Update_Type){\n            case 1: // Marquardt: init'l lambda\n                lambda  = lambda_0;\n                break;\n            default:    // Quadratic and Nielsen\n                lambda  = lambda_0 * Math.max(math.diag(JtWJ));\n                nu=2;\n        }\n        //console.log(X2);\n        X2_old = X2; // previous value of X2\n        //console.log(MaxIter+\" \"+Npar);\n        //var cvg_hst = Matrix.ones(MaxIter,Npar+3);\t\t// initialize convergence history\n        var h = null;\n        while ( !stop && iteration <= MaxIter ) {\t\t// --- Main Loop\n            iteration = iteration + 1;\n            // incremental change in parameters\n            switch(Update_Type){\n                case 1:\t\t\t\t\t// Marquardt\n                    //h = ( JtWJ + lambda * math.diag(math.diag(JtWJ)) ) \\ JtWdy;\n                    //h = math.multiply(math.inv(JtWdy),math.add(JtWJ,math.multiply(lambda,math.diag(math.diag(Npar)))));\n                    h = math.solve(math.add(JtWJ,math.multiply(math.diag(math.diag(JtWJ)),lambda)),JtWdy);\n                    break;\n                default:\t\t\t\t\t// Quadratic and Nielsen\n                    //h = ( JtWJ + lambda * math.eye(Npar) ) \\ JtWdy;\n\n                    h = math.solve(math.add(JtWJ,math.multiply( Matrix.eye(Npar),lambda)),JtWdy);\n            }\n\n            /*for(var k=0;k< h.length;k++){\n             h[k]=[h[k]];\n             }*/\n            //console.log(\"h \"+h);\n            //h=math.matrix(h);\n            //  big = max(abs(h./p)) > 2;\n            //this is a big step\n            // --- Are parameters [p+h] much better than [p] ?\n            var hidx = new Array(idx.length);\n            for(k=0;k<idx.length;k++){\n                hidx[k]=h[idx[k]];\n            }\n            var p_try = math.add(p, hidx);// update the [idx] elements\n\n            for(k=0;k<p_try.length;k++){\n                p_try[k][0]=Math.min(Math.max(p_min[k][0],p_try[k][0]),p_max[k][0]);\n            }\n            // p_try = Math.min(Math.max(p_min,p_try),p_max);           // apply constraints\n\n            var delta_y = math.subtract(y_dat, func(t,p_try,c));       // residual error using p_try\n            //func_calls = func_calls + 1;\n            //X2_try = delta_y' * ( delta_y .* weight_sq );  // Chi-squared error criteria\n\n            var X2_try = math.multiply(math.transpose(delta_y),math.dotMultiply(delta_y,weight_sq));\n\n            if ( Update_Type == 2 ){  \t\t\t  // Quadratic\n                //    One step of quadratic line update in the h direction for minimum X2\n                //var alpha =  JtWdy'*h / ( (X2_try - X2)/2 + 2*JtWdy'*h ) ;\n                var JtWdy_th = math.multiply(math.transpose(JtWdy),h);\n                var alpha =  math.multiply(JtWdy_th,math.inv(math.add(math.multiply(math.subtract(X2_try - X2),1/2)),math.multiply(JtWdy_th,2)));//JtWdy'*h / ( (X2_try - X2)/2 + 2*JtWdy'*h ) ;\n\n                h = math.multiply(alpha, h);\n                for(var k=0;k<idx.length;k++){\n                    hidx[k]=h[idx[k]];\n                }\n\n                p_try = math.add(p ,hidx);                     // update only [idx] elements\n                p_try = math.min(math.max(p_min,p_try),p_max);          // apply constraints\n\n                delta_y = math.subtract(y_dat, func(t,p_try,c));      // residual error using p_try\n                // func_calls = func_calls + 1;\n                //X2_try = delta_y' * ( delta_y .* weight_sq ); // Chi-squared error criteria\n                X2_try = math.multiply(math.transpose(delta_y), mat.dotMultiply(delta_y, weight_sq));\n            }\n\n            //rho = (X2 - X2_try) / ( 2*h' * (lambda * h + JtWdy) ); // Nielsen\n            var rho = (X2-X2_try)/math.multiply(math.multiply(math.transpose(h),2),math.add(math.multiply(lambda, h),JtWdy));\n            //console.log(\"rho \"+rho);\n            if ( rho > epsilon_4 ) {\t\t// it IS significantly better\n                //console.log(\"Here\");\n                dX2 = X2 - X2_old;\n                X2_old = X2;\n                p_old = p;\n                y_old = y_hat;\n                p = p_try;\t\t\t// accept p_try\n\n                result = this.lm_matx(func, t, p_old, y_old, dX2, J, p, y_dat, weight_sq, dp, c);\n                JtWJ = result.JtWJ,JtWdy=result.JtWdy,X2=result.Chi_sq,y_hat=result.y_hat,J=result.J;\n                // decrease lambda ==> Gauss-Newton method\n\n                switch (Update_Type) {\n                    case 1:\t\t\t\t\t\t\t// Levenberg\n                        lambda = Math.max(lambda / lambda_DN_fac, 1.e-7);\n                        break;\n                    case 2:\t\t\t\t\t\t\t// Quadratic\n                        lambda = Math.max(lambda / (1 + alpha), 1.e-7);\n                        break;\n                    case 3:\t\t\t\t\t\t\t// Nielsen\n                        lambda = math.multiply(Math.max(1 / 3, 1 - (2 * rho - 1) ^ 3),lambda);\n                        nu = 2;\n                        break;\n                }\n            }\n            else {\t\t\t\t\t// it IS NOT better\n                X2 = X2_old;\t\t\t// do not accept p_try\n                if (iteration%(2 * Npar)==0) {\t// rank-1 update of Jacobian\n                    result = this.lm_matx(func, t, p_old, y_old, -1, J, p, y_dat, weight_sq, dp, c);\n                    JtWJ = result.JtWJ,JtWdy=result.JtWdy,dX2=result.Chi_sq,y_hat=result.y_hat,J=result.J;\n                }\n\n                // increase lambda  ==> gradient descent method\n                switch (Update_Type) {\n                    case 1:\t\t\t\t\t\t\t// Levenberg\n                        lambda = Math.min(lambda * lambda_UP_fac, 1.e7);\n                        break;\n                    case 2:\t\t\t\t\t\t\t// Quadratic\n                        lambda = lambda + Math.abs((X2_try - X2) / 2 / alpha);\n                        break;\n                    case 3:\t\t\t\t\t\t// Nielsen\n                        lambda = lambda * nu;\n                        nu = 2 * nu;\n                        break;\n                }\n            }\n        }// --- End of Main Loop\n\n        // --- convergence achieved, find covariance and confidence intervals\n\n        // equal weights for paramter error analysis\n        weight_sq = math.multiply(math.multiply(math.transpose(delta_y),delta_y), Matrix.ones(Npnt,1));\n\n        weight_sq.apply(function(i,j){\n            weight_sq[i][j] = (Npnt-Nfit+1)/weight_sq[i][j];\n        });\n        //console.log(weight_sq);\n        result = this.lm_matx(func,t,p_old,y_old,-1,J,p,y_dat,weight_sq,dp,c);\n        JtWJ = result.JtWJ,JtWdy=result.JtWdy,X2=result.Chi_sq,y_hat=result.y_hat,J=result.J;\n\n        /*if nargout > 2\t\t\t\t// standard error of parameters\n         covar = inv(JtWJ);\n         sigma_p = sqrt(diag(covar));\n         end\n\n         if nargout > 3\t\t\t\t// standard error of the fit\n         //  sigma_y = sqrt(diag(J * covar * J'));\t// slower version of below\n         sigma_y = zeros(Npnt,1);\n         for i=1:Npnt\n         sigma_y(i) = J(i,:) * covar * J(i,:)';\n         end\n         sigma_y = sqrt(sigma_y);\n         end\n\n         if nargout > 4\t\t\t\t// parameter correlation matrix\n         corr = covar ./ [sigma_p*sigma_p'];\n         end\n\n         if nargout > 5\t\t\t\t// coefficient of multiple determination\n         R_sq = corrcoef([y_dat y_hat]);\n         R_sq = R_sq(1,2).^2;\n         end\n\n         if nargout > 6\t\t\t\t// convergence history\n         cvg_hst = cvg_hst(1:iteration,:);\n         end*/\n\n        // endfunction  # ---------------------------------------------------------- LM\n\n        return { p:p, X2:X2};\n    },\n\n    lm_FD_J:function(func,t,p,y,dp,c) {\n        // J = lm_FD_J(func,t,p,y,{dp},{c})\n        //\n        // partial derivatives (Jacobian) dy/dp for use with lm.m\n        // computed via Finite Differences\n        // Requires n or 2n function evaluations, n = number of nonzero values of dp\n        // -------- INPUT VARIABLES ---------\n        // func = function of independent variables, 't', and parameters, 'p',\n        //        returning the simulated model: y_hat = func(t,p,c)\n        // t  = m-vector of independent variables (used as arg to func)\n        // p  = n-vector of current parameter values\n        // y  = func(t,p,c) n-vector initialised by user before each call to lm_FD_J\n        // dp = fractional increment of p for numerical derivatives\n        //      dp(j)>0 central differences calculated\n        //      dp(j)<0 one sided differences calculated\n        //      dp(j)=0 sets corresponding partials to zero; i.e. holds p(j) fixed\n        //      Default:  0.001;\n        // c  = optional vector of constants passed to y_hat = func(t,p,c)\n        //---------- OUTPUT VARIABLES -------\n        // J  = Jacobian Matrix J(i,j)=dy(i)/dp(j)\ti=1:n; j=1:m\n\n        //   Henri Gavin, Dept. Civil & Environ. Engineering, Duke Univ. November 2005\n        //   modified from: ftp://fly.cnuce.cnr.it/pub/software/octave/leasqr/\n        //   Press, et al., Numerical Recipes, Cambridge Univ. Press, 1992, Chapter 15.\n\n        var m = y.length;\t\t\t// number of data points\n        var n = p.length;\t\t\t// number of parameters\n\n        dp = dp || math.multiply( Matrix.ones(n, 1), 0.001);\n\n        var ps = p.clone();//JSON.parse(JSON.stringify(p));\n        //var ps = $.extend(true, [], p);\n        var J = new Matrix(m,n), del =new Array(n);         // initialize Jacobian to Zero\n\n        for (var j = 0;j < n; j++) {\n            //console.log(j+\" \"+dp[j]+\" \"+p[j]+\" \"+ps[j]+\" \"+del[j]);\n            del[j] = dp[j]*(1+Math.abs(p[j][0]));  // parameter perturbation\n            p[j] = [ps[j][0]+del[j]];\t      // perturb parameter p(j)\n            //console.log(j+\" \"+dp[j]+\" \"+p[j]+\" \"+ps[j]+\" \"+del[j]);\n\n            if (del[j] != 0){\n                y1 = func(t, p, c);\n                //func_calls = func_calls + 1;\n                if (dp[j][0] < 0) {\t\t// backwards difference\n                    //J(:,j) = math.dotDivide(math.subtract(y1, y),del[j]);//. / del[j];\n                    //console.log(del[j]);\n                    //console.log(y);\n                    var column = math.dotDivide(math.subtract(y1, y),del[j]);\n                    for(var k=0;k< m;k++){\n                        J[k][j]=column[k][0];\n                    }\n                    //console.log(column);\n                }\n                else{\n                    p[j][0] = ps[j][0] - del[j];\n                    //J(:,j) = (y1 - feval(func, t, p, c)). / (2. * del[j]);\n                    var column = math.dotDivide(math.subtract(y1,func(t,p,c)),2*del[j]);\n                    for(var k=0;k< m;k++){\n                        J[k][j]=column[k][0];\n                    }\n\n                }\t\t\t// central difference, additional func call\n            }\n\n            p[j] = ps[j];\t\t// restore p(j)\n\n        }\n        //console.log(\"lm_FD_J: \"+ JSON.stringify(J));\n        return J;\n\n    },\n\n    // endfunction # -------------------------------------------------- LM_FD_J\n    lm_Broyden_J: function(p_old,y_old,J,p,y){\n        // J = lm_Broyden_J(p_old,y_old,J,p,y)\n        // carry out a rank-1 update to the Jacobian matrix using Broyden's equation\n        //---------- INPUT VARIABLES -------\n        // p_old = previous set of parameters\n        // y_old = model evaluation at previous set of parameters, y_hat(t;p_old)\n        // J  = current version of the Jacobian matrix\n        // p     = current  set of parameters\n        // y     = model evaluation at current  set of parameters, y_hat(t;p)\n        //---------- OUTPUT VARIABLES -------\n        // J = rank-1 update to Jacobian Matrix J(i,j)=dy(i)/dp(j)\ti=1:n; j=1:m\n        //console.log(p+\" X \"+ p_old)\n        var h  = math.subtract(p, p_old);\n\n        //console.log(\"hhh \"+h);\n        var h_t = math.transpose(h);\n        h_t.div(math.multiply(h_t,h));\n\n        //console.log(h_t);\n        //J = J + ( y - y_old - J*h )*h' / (h'*h);\t// Broyden rank-1 update eq'n\n        J = math.add(J, math.multiply(math.subtract(y, math.add(y_old,math.multiply(J,h))),h_t));\n        return J;\n        // endfunction # ---------------------------------------------- LM_Broyden_J\n    },\n\n    lm_matx : function (func,t,p_old,y_old,dX2,J,p,y_dat,weight_sq,dp,c,iteration){\n        // [JtWJ,JtWdy,Chi_sq,y_hat,J] = this.lm_matx(func,t,p_old,y_old,dX2,J,p,y_dat,weight_sq,{da},{c})\n        //\n        // Evaluate the linearized fitting matrix, JtWJ, and vector JtWdy,\n        // and calculate the Chi-squared error function, Chi_sq\n        // Used by Levenberg-Marquard algorithm, lm.m\n        // -------- INPUT VARIABLES ---------\n        // func   = function ofpn independent variables, p, and m parameters, p,\n        //         returning the simulated model: y_hat = func(t,p,c)\n        // t      = m-vectors or matrix of independent variables (used as arg to func)\n        // p_old  = n-vector of previous parameter values\n        // y_old  = m-vector of previous model ... y_old = y_hat(t;p_old);\n        // dX2    = previous change in Chi-squared criteria\n        // J   = m-by-n Jacobian of model, y_hat, with respect to parameters, p\n        // p      = n-vector of current  parameter values\n        // y_dat  = n-vector of data to be fit by func(t,p,c)\n        // weight_sq = square of the weighting vector for least squares fit ...\n        //\t    inverse of the standard measurement errors\n        // dp     = fractional increment of 'p' for numerical derivatives\n        //          dp(j)>0 central differences calculated\n        //          dp(j)<0 one sided differences calculated\n        //          dp(j)=0 sets corresponding partials to zero; i.e. holds p(j) fixed\n        //          Default:  0.001;\n        // c      = optional vector of constants passed to y_hat = func(t,p,c)\n        //---------- OUTPUT VARIABLES -------\n        // JtWJ\t = linearized Hessian matrix (inverse of covariance matrix)\n        // JtWdy   = linearized fitting vector\n        // Chi_sq = Chi-squared criteria: weighted sum of the squared residuals WSSR\n        // y_hat  = model evaluated with parameters 'p'\n        // J   = m-by-n Jacobian of model, y_hat, with respect to parameters, p\n\n        //   Henri Gavin, Dept. Civil & Environ. Engineering, Duke Univ. November 2005\n        //   modified from: ftp://fly.cnuce.cnr.it/pub/software/octave/leasqr/\n        //   Press, et al., Numerical Recipes, Cambridge Univ. Press, 1992, Chapter 15.\n\n\n        var Npnt = y_dat.length;\t\t// number of data points\n        var Npar = p.length;\t\t// number of parameters\n\n        dp = dp || 0.001;\n\n\n        //var JtWJ = new Matrix.zeros(Npar);\n        //var JtWdy  = new Matrix.zeros(Npar,1);\n\n        var y_hat = func(t,p,c);\t// evaluate model using parameters 'p'\n        //func_calls = func_calls + 1;\n        //console.log(J);\n        if ( (iteration%(2*Npar))==0 || dX2 > 0 ) {\n            //console.log(\"Par\");\n            J = this.lm_FD_J(func, t, p, y_hat, dp, c);\t\t// finite difference\n        }\n        else{\n            //console.log(\"ImPar\");\n            J = this.lm_Broyden_J(p_old, y_old, J, p, y_hat); // rank-1 update\n        }\n        var delta_y = math.subtract(y_dat, y_hat);\t// residual error between model and data\n        //console.log(delta_y[0][0]);\n        //console.log(delta_y.rows+\" \"+delta_y.columns+\" \"+JSON.stringify(weight_sq));\n        //var Chi_sq = delta_y' * ( delta_y .* weight_sq ); \t// Chi-squared error criteria\n        var Chi_sq = math.multiply(math.transpose(delta_y),math.dotMultiply(delta_y,weight_sq));\n        //JtWJ  = J' * ( J .* ( weight_sq * ones(1,Npar) ) );\n        var Jt = math.transpose(J);\n\n        //console.log(weight_sq);\n\n        var JtWJ = math.multiply(Jt, math.dotMultiply(J,math.multiply(weight_sq, Matrix.ones(1,Npar))));\n\n        //JtWdy = J' * ( weight_sq .* delta_y );\n        var JtWdy = math.multiply(Jt, math.dotMultiply(weight_sq,delta_y));\n\n\n        return {JtWJ:JtWJ,JtWdy:JtWdy,Chi_sq:Chi_sq,y_hat:y_hat,J:J};\n        // endfunction  # ------------------------------------------------------ LM_MATX\n    }\n\n\n\n};\n\nmodule.exports = LM;\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-optimize-lorentzian/node_modules/ml-curve-fitting/src/LM.js","'use strict';\n\nvar Matrix = require('./matrix');\n\nvar SingularValueDecomposition = require('./dc/svd');\nvar EigenvalueDecomposition = require('./dc/evd');\nvar LuDecomposition = require('./dc/lu');\nvar QrDecomposition = require('./dc/qr');\nvar CholeskyDecomposition = require('./dc/cholesky');\n\nfunction inverse(matrix) {\n    return solve(matrix, Matrix.eye(matrix.rows));\n}\n\nMatrix.prototype.inverse = function () {\n    return inverse(this);\n};\n\nfunction solve(leftHandSide, rightHandSide) {\n    return leftHandSide.isSquare() ? new LuDecomposition(leftHandSide).solve(rightHandSide) : new QrDecomposition(leftHandSide).solve(rightHandSide);\n}\n\nMatrix.prototype.solve = function (other) {\n    return solve(this, other);\n};\n\nmodule.exports = {\n    SingularValueDecomposition: SingularValueDecomposition,\n    SVD: SingularValueDecomposition,\n    EigenvalueDecomposition: EigenvalueDecomposition,\n    EVD: EigenvalueDecomposition,\n    LuDecomposition: LuDecomposition,\n    LU: LuDecomposition,\n    QrDecomposition: QrDecomposition,\n    QR: QrDecomposition,\n    CholeskyDecomposition: CholeskyDecomposition,\n    CHO: CholeskyDecomposition,\n    inverse: inverse,\n    solve: solve\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-optimize-lorentzian/node_modules/ml-matrix/src/decompositions.js","'use strict';\n\nvar Matrix = require('../matrix');\nvar hypotenuse = require('./util').hypotenuse;\n\n// https://github.com/lutzroeder/Mapack/blob/master/Source/SingularValueDecomposition.cs\nfunction SingularValueDecomposition(value, options) {\n    if (!(this instanceof SingularValueDecomposition)) {\n        return new SingularValueDecomposition(value, options);\n    }\n    value = Matrix.checkMatrix(value);\n\n    options = options || {};\n\n    var a = value.clone(),\n        m = value.rows,\n        n = value.columns,\n        nu = Math.min(m, n);\n\n    var wantu = true, wantv = true;\n    if (options.computeLeftSingularVectors === false)\n        wantu = false;\n    if (options.computeRightSingularVectors === false)\n        wantv = false;\n    var autoTranspose = options.autoTranspose === true;\n\n    var swapped = false;\n    if (m < n) {\n        if (!autoTranspose) {\n            console.warn('Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose');\n        } else {\n            a = a.transpose();\n            m = a.rows;\n            n = a.columns;\n            swapped = true;\n            var aux = wantu;\n            wantu = wantv;\n            wantv = aux;\n        }\n    }\n\n    var s = new Array(Math.min(m + 1, n)),\n        U = Matrix.zeros(m, nu),\n        V = Matrix.zeros(n, n),\n        e = new Array(n),\n        work = new Array(m);\n\n    var nct = Math.min(m - 1, n);\n    var nrt = Math.max(0, Math.min(n - 2, m));\n\n    var i, j, k, p, t, ks, f, cs, sn, max, kase,\n        scale, sp, spm1, epm1, sk, ek, b, c, shift, g;\n\n    for (k = 0, max = Math.max(nct, nrt); k < max; k++) {\n        if (k < nct) {\n            s[k] = 0;\n            for (i = k; i < m; i++) {\n                s[k] = hypotenuse(s[k], a[i][k]);\n            }\n            if (s[k] !== 0) {\n                if (a[k][k] < 0) {\n                    s[k] = -s[k];\n                }\n                for (i = k; i < m; i++) {\n                    a[i][k] /= s[k];\n                }\n                a[k][k] += 1;\n            }\n            s[k] = -s[k];\n        }\n\n        for (j = k + 1; j < n; j++) {\n            if ((k < nct) && (s[k] !== 0)) {\n                t = 0;\n                for (i = k; i < m; i++) {\n                    t += a[i][k] * a[i][j];\n                }\n                t = -t / a[k][k];\n                for (i = k; i < m; i++) {\n                    a[i][j] += t * a[i][k];\n                }\n            }\n            e[j] = a[k][j];\n        }\n\n        if (wantu && (k < nct)) {\n            for (i = k; i < m; i++) {\n                U[i][k] = a[i][k];\n            }\n        }\n\n        if (k < nrt) {\n            e[k] = 0;\n            for (i = k + 1; i < n; i++) {\n                e[k] = hypotenuse(e[k], e[i]);\n            }\n            if (e[k] !== 0) {\n                if (e[k + 1] < 0)\n                    e[k] = -e[k];\n                for (i = k + 1; i < n; i++) {\n                    e[i] /= e[k];\n                }\n                e[k + 1] += 1;\n            }\n            e[k] = -e[k];\n            if ((k + 1 < m) && (e[k] !== 0)) {\n                for (i = k + 1; i < m; i++) {\n                    work[i] = 0;\n                }\n                for (j = k + 1; j < n; j++) {\n                    for (i = k + 1; i < m; i++) {\n                        work[i] += e[j] * a[i][j];\n                    }\n                }\n                for (j = k + 1; j < n; j++) {\n                    t = -e[j] / e[k + 1];\n                    for (i = k + 1; i < m; i++) {\n                        a[i][j] += t * work[i];\n                    }\n                }\n            }\n            if (wantv) {\n                for (i = k + 1; i < n; i++) {\n                    V[i][k] = e[i];\n                }\n            }\n        }\n    }\n\n    p = Math.min(n, m + 1);\n    if (nct < n) {\n        s[nct] = a[nct][nct];\n    }\n    if (m < p) {\n        s[p - 1] = 0;\n    }\n    if (nrt + 1 < p) {\n        e[nrt] = a[nrt][p - 1];\n    }\n    e[p - 1] = 0;\n\n    if (wantu) {\n        for (j = nct; j < nu; j++) {\n            for (i = 0; i < m; i++) {\n                U[i][j] = 0;\n            }\n            U[j][j] = 1;\n        }\n        for (k = nct - 1; k >= 0; k--) {\n            if (s[k] !== 0) {\n                for (j = k + 1; j < nu; j++) {\n                    t = 0;\n                    for (i = k; i < m; i++) {\n                        t += U[i][k] * U[i][j];\n                    }\n                    t = -t / U[k][k];\n                    for (i = k; i < m; i++) {\n                        U[i][j] += t * U[i][k];\n                    }\n                }\n                for (i = k; i < m; i++) {\n                    U[i][k] = -U[i][k];\n                }\n                U[k][k] = 1 + U[k][k];\n                for (i = 0; i < k - 1; i++) {\n                    U[i][k] = 0;\n                }\n            } else {\n                for (i = 0; i < m; i++) {\n                    U[i][k] = 0;\n                }\n                U[k][k] = 1;\n            }\n        }\n    }\n\n    if (wantv) {\n        for (k = n - 1; k >= 0; k--) {\n            if ((k < nrt) && (e[k] !== 0)) {\n                for (j = k + 1; j < n; j++) {\n                    t = 0;\n                    for (i = k + 1; i < n; i++) {\n                        t += V[i][k] * V[i][j];\n                    }\n                    t = -t / V[k + 1][k];\n                    for (i = k + 1; i < n; i++) {\n                        V[i][j] += t * V[i][k];\n                    }\n                }\n            }\n            for (i = 0; i < n; i++) {\n                V[i][k] = 0;\n            }\n            V[k][k] = 1;\n        }\n    }\n\n    var pp = p - 1,\n        iter = 0,\n        eps = Math.pow(2, -52);\n    while (p > 0) {\n        for (k = p - 2; k >= -1; k--) {\n            if (k === -1) {\n                break;\n            }\n            if (Math.abs(e[k]) <= eps * (Math.abs(s[k]) + Math.abs(s[k + 1]))) {\n                e[k] = 0;\n                break;\n            }\n        }\n        if (k === p - 2) {\n            kase = 4;\n        } else {\n            for (ks = p - 1; ks >= k; ks--) {\n                if (ks === k) {\n                    break;\n                }\n                t = (ks !== p ? Math.abs(e[ks]) : 0) + (ks !== k + 1 ? Math.abs(e[ks - 1]) : 0);\n                if (Math.abs(s[ks]) <= eps * t) {\n                    s[ks] = 0;\n                    break;\n                }\n            }\n            if (ks === k) {\n                kase = 3;\n            } else if (ks === p - 1) {\n                kase = 1;\n            } else {\n                kase = 2;\n                k = ks;\n            }\n        }\n\n        k++;\n\n        switch (kase) {\n            case 1: {\n                f = e[p - 2];\n                e[p - 2] = 0;\n                for (j = p - 2; j >= k; j--) {\n                    t = hypotenuse(s[j], f);\n                    cs = s[j] / t;\n                    sn = f / t;\n                    s[j] = t;\n                    if (j !== k) {\n                        f = -sn * e[j - 1];\n                        e[j - 1] = cs * e[j - 1];\n                    }\n                    if (wantv) {\n                        for (i = 0; i < n; i++) {\n                            t = cs * V[i][j] + sn * V[i][p - 1];\n                            V[i][p - 1] = -sn * V[i][j] + cs * V[i][p - 1];\n                            V[i][j] = t;\n                        }\n                    }\n                }\n                break;\n            }\n            case 2 : {\n                f = e[k - 1];\n                e[k - 1] = 0;\n                for (j = k; j < p; j++) {\n                    t = hypotenuse(s[j], f);\n                    cs = s[j] / t;\n                    sn = f / t;\n                    s[j] = t;\n                    f = -sn * e[j];\n                    e[j] = cs * e[j];\n                    if (wantu) {\n                        for (i = 0; i < m; i++) {\n                            t = cs * U[i][j] + sn * U[i][k - 1];\n                            U[i][k - 1] = -sn * U[i][j] + cs * U[i][k - 1];\n                            U[i][j] = t;\n                        }\n                    }\n                }\n                break;\n            }\n            case 3 : {\n                scale = Math.max(Math.max(Math.max(Math.max(Math.abs(s[p - 1]), Math.abs(s[p - 2])), Math.abs(e[p - 2])), Math.abs(s[k])), Math.abs(e[k]));\n                sp = s[p - 1] / scale;\n                spm1 = s[p - 2] / scale;\n                epm1 = e[p - 2] / scale;\n                sk = s[k] / scale;\n                ek = e[k] / scale;\n                b = ((spm1 + sp) * (spm1 - sp) + epm1 * epm1) / 2;\n                c = (sp * epm1) * (sp * epm1);\n                shift = 0;\n                if ((b !== 0) || (c !== 0)) {\n                    shift = Math.sqrt(b * b + c);\n                    if (b < 0) {\n                        shift = -shift;\n                    }\n                    shift = c / (b + shift);\n                }\n                f = (sk + sp) * (sk - sp) + shift;\n                g = sk * ek;\n                for (j = k; j < p - 1; j++) {\n                    t = hypotenuse(f, g);\n                    cs = f / t;\n                    sn = g / t;\n                    if (j !== k) {\n                        e[j - 1] = t;\n                    }\n                    f = cs * s[j] + sn * e[j];\n                    e[j] = cs * e[j] - sn * s[j];\n                    g = sn * s[j + 1];\n                    s[j + 1] = cs * s[j + 1];\n                    if (wantv) {\n                        for (i = 0; i < n; i++) {\n                            t = cs * V[i][j] + sn * V[i][j + 1];\n                            V[i][j + 1] = -sn * V[i][j] + cs * V[i][j + 1];\n                            V[i][j] = t;\n                        }\n                    }\n                    t = hypotenuse(f, g);\n                    cs = f / t;\n                    sn = g / t;\n                    s[j] = t;\n                    f = cs * e[j] + sn * s[j + 1];\n                    s[j + 1] = -sn * e[j] + cs * s[j + 1];\n                    g = sn * e[j + 1];\n                    e[j + 1] = cs * e[j + 1];\n                    if (wantu && (j < m - 1)) {\n                        for (i = 0; i < m; i++) {\n                            t = cs * U[i][j] + sn * U[i][j + 1];\n                            U[i][j + 1] = -sn * U[i][j] + cs * U[i][j + 1];\n                            U[i][j] = t;\n                        }\n                    }\n                }\n                e[p - 2] = f;\n                iter = iter + 1;\n                break;\n            }\n            case 4: {\n                if (s[k] <= 0) {\n                    s[k] = (s[k] < 0 ? -s[k] : 0);\n                    if (wantv) {\n                        for (i = 0; i <= pp; i++) {\n                            V[i][k] = -V[i][k];\n                        }\n                    }\n                }\n                while (k < pp) {\n                    if (s[k] >= s[k + 1]) {\n                        break;\n                    }\n                    t = s[k];\n                    s[k] = s[k + 1];\n                    s[k + 1] = t;\n                    if (wantv && (k < n - 1)) {\n                        for (i = 0; i < n; i++) {\n                            t = V[i][k + 1];\n                            V[i][k + 1] = V[i][k];\n                            V[i][k] = t;\n                        }\n                    }\n                    if (wantu && (k < m - 1)) {\n                        for (i = 0; i < m; i++) {\n                            t = U[i][k + 1];\n                            U[i][k + 1] = U[i][k];\n                            U[i][k] = t;\n                        }\n                    }\n                    k++;\n                }\n                iter = 0;\n                p--;\n                break;\n            }\n        }\n    }\n\n    if (swapped) {\n        var tmp = V;\n        V = U;\n        U = tmp;\n    }\n\n    this.m = m;\n    this.n = n;\n    this.s = s;\n    this.U = U;\n    this.V = V;\n}\n\nSingularValueDecomposition.prototype = {\n    get condition() {\n        return this.s[0] / this.s[Math.min(this.m, this.n) - 1];\n    },\n    get norm2() {\n        return this.s[0];\n    },\n    get rank() {\n        var eps = Math.pow(2, -52),\n            tol = Math.max(this.m, this.n) * this.s[0] * eps,\n            r = 0,\n            s = this.s;\n        for (var i = 0, ii = s.length; i < ii; i++) {\n            if (s[i] > tol) {\n                r++;\n            }\n        }\n        return r;\n    },\n    get diagonal() {\n        return this.s;\n    },\n    // https://github.com/accord-net/framework/blob/development/Sources/Accord.Math/Decompositions/SingularValueDecomposition.cs\n    get threshold() {\n        return (Math.pow(2, -52) / 2) * Math.max(this.m, this.n) * this.s[0];\n    },\n    get leftSingularVectors() {\n        return this.U;\n    },\n    get rightSingularVectors() {\n        return this.V;\n    },\n    get diagonalMatrix() {\n        return Matrix.diag(this.s);\n    },\n    solve: function (value) {\n\n        var Y = value,\n            e = this.threshold,\n            scols = this.s.length,\n            Ls = Matrix.zeros(scols, scols),\n            i;\n\n        for (i = 0; i < scols; i++) {\n            if (Math.abs(this.s[i]) <= e) {\n                Ls[i][i] = 0;\n            } else {\n                Ls[i][i] = 1 / this.s[i];\n            }\n        }\n\n\n        var VL = this.V.mmul(Ls),\n            vrows = this.V.rows,\n            urows = this.U.rows,\n            VLU = Matrix.zeros(vrows, urows),\n            j, k, sum;\n\n        for (i = 0; i < vrows; i++) {\n            for (j = 0; j < urows; j++) {\n                sum = 0;\n                for (k = 0; k < scols; k++) {\n                    sum += VL[i][k] * this.U[j][k];\n                }\n                VLU[i][j] = sum;\n            }\n        }\n\n        return VLU.mmul(Y);\n    },\n    solveForDiagonal: function (value) {\n        return this.solve(Matrix.diag(value));\n    },\n    inverse: function () {\n        var e = this.threshold,\n            vrows = this.V.rows,\n            vcols = this.V.columns,\n            X = new Matrix(vrows, this.s.length),\n            i, j;\n\n        for (i = 0; i < vrows; i++) {\n            for (j = 0; j < vcols; j++) {\n                if (Math.abs(this.s[j]) > e) {\n                    X[i][j] = this.V[i][j] / this.s[j];\n                } else {\n                    X[i][j] = 0;\n                }\n            }\n        }\n\n        var urows = this.U.rows,\n            ucols = this.U.columns,\n            Y = new Matrix(vrows, urows),\n            k, sum;\n\n        for (i = 0; i < vrows; i++) {\n            for (j = 0; j < urows; j++) {\n                sum = 0;\n                for (k = 0; k < ucols; k++) {\n                    sum += X[i][k] * this.U[j][k];\n                }\n                Y[i][j] = sum;\n            }\n        }\n\n        return Y;\n    }\n};\n\nmodule.exports = SingularValueDecomposition;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-optimize-lorentzian/node_modules/ml-matrix/src/dc/svd.js","'use strict';\n\nvar Matrix = require('../matrix');\nvar hypotenuse = require('./util').hypotenuse;\n\n// https://github.com/lutzroeder/Mapack/blob/master/Source/EigenvalueDecomposition.cs\nfunction EigenvalueDecomposition(matrix) {\n    if (!(this instanceof EigenvalueDecomposition)) {\n        return new EigenvalueDecomposition(matrix);\n    }\n    matrix = Matrix.checkMatrix(matrix);\n    if (!matrix.isSquare()) {\n        throw new Error('Matrix is not a square matrix');\n    }\n\n    var n = matrix.columns,\n        V = Matrix.zeros(n, n),\n        d = new Array(n),\n        e = new Array(n),\n        value = matrix,\n        i, j;\n\n    if (matrix.isSymmetric()) {\n        for (i = 0; i < n; i++) {\n            for (j = 0; j < n; j++) {\n                V[i][j] = value[i][j];\n            }\n        }\n        tred2(n, e, d, V);\n        tql2(n, e, d, V);\n    }\n    else {\n        var H = Matrix.zeros(n, n),\n            ort = new Array(n);\n        for (j = 0; j < n; j++) {\n            for (i = 0; i < n; i++) {\n                H[i][j] = value[i][j];\n            }\n        }\n        orthes(n, H, ort, V);\n        hqr2(n, e, d, V, H);\n    }\n\n    this.n = n;\n    this.e = e;\n    this.d = d;\n    this.V = V;\n}\n\nEigenvalueDecomposition.prototype = {\n    get realEigenvalues() {\n        return this.d;\n    },\n    get imaginaryEigenvalues() {\n        return this.e;\n    },\n    get eigenvectorMatrix() {\n        return this.V;\n    },\n    get diagonalMatrix() {\n        var n = this.n,\n            e = this.e,\n            d = this.d,\n            X = new Matrix(n, n),\n            i, j;\n        for (i = 0; i < n; i++) {\n            for (j = 0; j < n; j++) {\n                X[i][j] = 0;\n            }\n            X[i][i] = d[i];\n            if (e[i] > 0) {\n                X[i][i + 1] = e[i];\n            }\n            else if (e[i] < 0) {\n                X[i][i - 1] = e[i];\n            }\n        }\n        return X;\n    }\n};\n\nfunction tred2(n, e, d, V) {\n\n    var f, g, h, i, j, k,\n        hh, scale;\n\n    for (j = 0; j < n; j++) {\n        d[j] = V[n - 1][j];\n    }\n\n    for (i = n - 1; i > 0; i--) {\n        scale = 0;\n        h = 0;\n        for (k = 0; k < i; k++) {\n            scale = scale + Math.abs(d[k]);\n        }\n\n        if (scale === 0) {\n            e[i] = d[i - 1];\n            for (j = 0; j < i; j++) {\n                d[j] = V[i - 1][j];\n                V[i][j] = 0;\n                V[j][i] = 0;\n            }\n        } else {\n            for (k = 0; k < i; k++) {\n                d[k] /= scale;\n                h += d[k] * d[k];\n            }\n\n            f = d[i - 1];\n            g = Math.sqrt(h);\n            if (f > 0) {\n                g = -g;\n            }\n\n            e[i] = scale * g;\n            h = h - f * g;\n            d[i - 1] = f - g;\n            for (j = 0; j < i; j++) {\n                e[j] = 0;\n            }\n\n            for (j = 0; j < i; j++) {\n                f = d[j];\n                V[j][i] = f;\n                g = e[j] + V[j][j] * f;\n                for (k = j + 1; k <= i - 1; k++) {\n                    g += V[k][j] * d[k];\n                    e[k] += V[k][j] * f;\n                }\n                e[j] = g;\n            }\n\n            f = 0;\n            for (j = 0; j < i; j++) {\n                e[j] /= h;\n                f += e[j] * d[j];\n            }\n\n            hh = f / (h + h);\n            for (j = 0; j < i; j++) {\n                e[j] -= hh * d[j];\n            }\n\n            for (j = 0; j < i; j++) {\n                f = d[j];\n                g = e[j];\n                for (k = j; k <= i - 1; k++) {\n                    V[k][j] -= (f * e[k] + g * d[k]);\n                }\n                d[j] = V[i - 1][j];\n                V[i][j] = 0;\n            }\n        }\n        d[i] = h;\n    }\n\n    for (i = 0; i < n - 1; i++) {\n        V[n - 1][i] = V[i][i];\n        V[i][i] = 1;\n        h = d[i + 1];\n        if (h !== 0) {\n            for (k = 0; k <= i; k++) {\n                d[k] = V[k][i + 1] / h;\n            }\n\n            for (j = 0; j <= i; j++) {\n                g = 0;\n                for (k = 0; k <= i; k++) {\n                    g += V[k][i + 1] * V[k][j];\n                }\n                for (k = 0; k <= i; k++) {\n                    V[k][j] -= g * d[k];\n                }\n            }\n        }\n\n        for (k = 0; k <= i; k++) {\n            V[k][i + 1] = 0;\n        }\n    }\n\n    for (j = 0; j < n; j++) {\n        d[j] = V[n - 1][j];\n        V[n - 1][j] = 0;\n    }\n\n    V[n - 1][n - 1] = 1;\n    e[0] = 0;\n}\n\nfunction tql2(n, e, d, V) {\n\n    var g, h, i, j, k, l, m, p, r,\n        dl1, c, c2, c3, el1, s, s2,\n        iter;\n\n    for (i = 1; i < n; i++) {\n        e[i - 1] = e[i];\n    }\n\n    e[n - 1] = 0;\n\n    var f = 0,\n        tst1 = 0,\n        eps = Math.pow(2, -52);\n\n    for (l = 0; l < n; l++) {\n        tst1 = Math.max(tst1, Math.abs(d[l]) + Math.abs(e[l]));\n        m = l;\n        while (m < n) {\n            if (Math.abs(e[m]) <= eps * tst1) {\n                break;\n            }\n            m++;\n        }\n\n        if (m > l) {\n            iter = 0;\n            do {\n                iter = iter + 1;\n\n                g = d[l];\n                p = (d[l + 1] - g) / (2 * e[l]);\n                r = hypotenuse(p, 1);\n                if (p < 0) {\n                    r = -r;\n                }\n\n                d[l] = e[l] / (p + r);\n                d[l + 1] = e[l] * (p + r);\n                dl1 = d[l + 1];\n                h = g - d[l];\n                for (i = l + 2; i < n; i++) {\n                    d[i] -= h;\n                }\n\n                f = f + h;\n\n                p = d[m];\n                c = 1;\n                c2 = c;\n                c3 = c;\n                el1 = e[l + 1];\n                s = 0;\n                s2 = 0;\n                for (i = m - 1; i >= l; i--) {\n                    c3 = c2;\n                    c2 = c;\n                    s2 = s;\n                    g = c * e[i];\n                    h = c * p;\n                    r = hypotenuse(p, e[i]);\n                    e[i + 1] = s * r;\n                    s = e[i] / r;\n                    c = p / r;\n                    p = c * d[i] - s * g;\n                    d[i + 1] = h + s * (c * g + s * d[i]);\n\n                    for (k = 0; k < n; k++) {\n                        h = V[k][i + 1];\n                        V[k][i + 1] = s * V[k][i] + c * h;\n                        V[k][i] = c * V[k][i] - s * h;\n                    }\n                }\n\n                p = -s * s2 * c3 * el1 * e[l] / dl1;\n                e[l] = s * p;\n                d[l] = c * p;\n\n            }\n            while (Math.abs(e[l]) > eps * tst1);\n        }\n        d[l] = d[l] + f;\n        e[l] = 0;\n    }\n\n    for (i = 0; i < n - 1; i++) {\n        k = i;\n        p = d[i];\n        for (j = i + 1; j < n; j++) {\n            if (d[j] < p) {\n                k = j;\n                p = d[j];\n            }\n        }\n\n        if (k !== i) {\n            d[k] = d[i];\n            d[i] = p;\n            for (j = 0; j < n; j++) {\n                p = V[j][i];\n                V[j][i] = V[j][k];\n                V[j][k] = p;\n            }\n        }\n    }\n}\n\nfunction orthes(n, H, ort, V) {\n\n    var low = 0,\n        high = n - 1,\n        f, g, h, i, j, m,\n        scale;\n\n    for (m = low + 1; m <= high - 1; m++) {\n        scale = 0;\n        for (i = m; i <= high; i++) {\n            scale = scale + Math.abs(H[i][m - 1]);\n        }\n\n        if (scale !== 0) {\n            h = 0;\n            for (i = high; i >= m; i--) {\n                ort[i] = H[i][m - 1] / scale;\n                h += ort[i] * ort[i];\n            }\n\n            g = Math.sqrt(h);\n            if (ort[m] > 0) {\n                g = -g;\n            }\n\n            h = h - ort[m] * g;\n            ort[m] = ort[m] - g;\n\n            for (j = m; j < n; j++) {\n                f = 0;\n                for (i = high; i >= m; i--) {\n                    f += ort[i] * H[i][j];\n                }\n\n                f = f / h;\n                for (i = m; i <= high; i++) {\n                    H[i][j] -= f * ort[i];\n                }\n            }\n\n            for (i = 0; i <= high; i++) {\n                f = 0;\n                for (j = high; j >= m; j--) {\n                    f += ort[j] * H[i][j];\n                }\n\n                f = f / h;\n                for (j = m; j <= high; j++) {\n                    H[i][j] -= f * ort[j];\n                }\n            }\n\n            ort[m] = scale * ort[m];\n            H[m][m - 1] = scale * g;\n        }\n    }\n\n    for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n            V[i][j] = (i === j ? 1 : 0);\n        }\n    }\n\n    for (m = high - 1; m >= low + 1; m--) {\n        if (H[m][m - 1] !== 0) {\n            for (i = m + 1; i <= high; i++) {\n                ort[i] = H[i][m - 1];\n            }\n\n            for (j = m; j <= high; j++) {\n                g = 0;\n                for (i = m; i <= high; i++) {\n                    g += ort[i] * V[i][j];\n                }\n\n                g = (g / ort[m]) / H[m][m - 1];\n                for (i = m; i <= high; i++) {\n                    V[i][j] += g * ort[i];\n                }\n            }\n        }\n    }\n}\n\nfunction hqr2(nn, e, d, V, H) {\n    var n = nn - 1,\n        low = 0,\n        high = nn - 1,\n        eps = Math.pow(2, -52),\n        exshift = 0,\n        norm = 0,\n        p = 0,\n        q = 0,\n        r = 0,\n        s = 0,\n        z = 0,\n        iter = 0,\n        i, j, k, l, m, t, w, x, y,\n        ra, sa, vr, vi,\n        notlast, cdivres;\n\n    for (i = 0; i < nn; i++) {\n        if (i < low || i > high) {\n            d[i] = H[i][i];\n            e[i] = 0;\n        }\n\n        for (j = Math.max(i - 1, 0); j < nn; j++) {\n            norm = norm + Math.abs(H[i][j]);\n        }\n    }\n\n    while (n >= low) {\n        l = n;\n        while (l > low) {\n            s = Math.abs(H[l - 1][l - 1]) + Math.abs(H[l][l]);\n            if (s === 0) {\n                s = norm;\n            }\n            if (Math.abs(H[l][l - 1]) < eps * s) {\n                break;\n            }\n            l--;\n        }\n\n        if (l === n) {\n            H[n][n] = H[n][n] + exshift;\n            d[n] = H[n][n];\n            e[n] = 0;\n            n--;\n            iter = 0;\n        } else if (l === n - 1) {\n            w = H[n][n - 1] * H[n - 1][n];\n            p = (H[n - 1][n - 1] - H[n][n]) / 2;\n            q = p * p + w;\n            z = Math.sqrt(Math.abs(q));\n            H[n][n] = H[n][n] + exshift;\n            H[n - 1][n - 1] = H[n - 1][n - 1] + exshift;\n            x = H[n][n];\n\n            if (q >= 0) {\n                z = (p >= 0) ? (p + z) : (p - z);\n                d[n - 1] = x + z;\n                d[n] = d[n - 1];\n                if (z !== 0) {\n                    d[n] = x - w / z;\n                }\n                e[n - 1] = 0;\n                e[n] = 0;\n                x = H[n][n - 1];\n                s = Math.abs(x) + Math.abs(z);\n                p = x / s;\n                q = z / s;\n                r = Math.sqrt(p * p + q * q);\n                p = p / r;\n                q = q / r;\n\n                for (j = n - 1; j < nn; j++) {\n                    z = H[n - 1][j];\n                    H[n - 1][j] = q * z + p * H[n][j];\n                    H[n][j] = q * H[n][j] - p * z;\n                }\n\n                for (i = 0; i <= n; i++) {\n                    z = H[i][n - 1];\n                    H[i][n - 1] = q * z + p * H[i][n];\n                    H[i][n] = q * H[i][n] - p * z;\n                }\n\n                for (i = low; i <= high; i++) {\n                    z = V[i][n - 1];\n                    V[i][n - 1] = q * z + p * V[i][n];\n                    V[i][n] = q * V[i][n] - p * z;\n                }\n            } else {\n                d[n - 1] = x + p;\n                d[n] = x + p;\n                e[n - 1] = z;\n                e[n] = -z;\n            }\n\n            n = n - 2;\n            iter = 0;\n        } else {\n            x = H[n][n];\n            y = 0;\n            w = 0;\n            if (l < n) {\n                y = H[n - 1][n - 1];\n                w = H[n][n - 1] * H[n - 1][n];\n            }\n\n            if (iter === 10) {\n                exshift += x;\n                for (i = low; i <= n; i++) {\n                    H[i][i] -= x;\n                }\n                s = Math.abs(H[n][n - 1]) + Math.abs(H[n - 1][n - 2]);\n                x = y = 0.75 * s;\n                w = -0.4375 * s * s;\n            }\n\n            if (iter === 30) {\n                s = (y - x) / 2;\n                s = s * s + w;\n                if (s > 0) {\n                    s = Math.sqrt(s);\n                    if (y < x) {\n                        s = -s;\n                    }\n                    s = x - w / ((y - x) / 2 + s);\n                    for (i = low; i <= n; i++) {\n                        H[i][i] -= s;\n                    }\n                    exshift += s;\n                    x = y = w = 0.964;\n                }\n            }\n\n            iter = iter + 1;\n\n            m = n - 2;\n            while (m >= l) {\n                z = H[m][m];\n                r = x - z;\n                s = y - z;\n                p = (r * s - w) / H[m + 1][m] + H[m][m + 1];\n                q = H[m + 1][m + 1] - z - r - s;\n                r = H[m + 2][m + 1];\n                s = Math.abs(p) + Math.abs(q) + Math.abs(r);\n                p = p / s;\n                q = q / s;\n                r = r / s;\n                if (m === l) {\n                    break;\n                }\n                if (Math.abs(H[m][m - 1]) * (Math.abs(q) + Math.abs(r)) < eps * (Math.abs(p) * (Math.abs(H[m - 1][m - 1]) + Math.abs(z) + Math.abs(H[m + 1][m + 1])))) {\n                    break;\n                }\n                m--;\n            }\n\n            for (i = m + 2; i <= n; i++) {\n                H[i][i - 2] = 0;\n                if (i > m + 2) {\n                    H[i][i - 3] = 0;\n                }\n            }\n\n            for (k = m; k <= n - 1; k++) {\n                notlast = (k !== n - 1);\n                if (k !== m) {\n                    p = H[k][k - 1];\n                    q = H[k + 1][k - 1];\n                    r = (notlast ? H[k + 2][k - 1] : 0);\n                    x = Math.abs(p) + Math.abs(q) + Math.abs(r);\n                    if (x !== 0) {\n                        p = p / x;\n                        q = q / x;\n                        r = r / x;\n                    }\n                }\n\n                if (x === 0) {\n                    break;\n                }\n\n                s = Math.sqrt(p * p + q * q + r * r);\n                if (p < 0) {\n                    s = -s;\n                }\n\n                if (s !== 0) {\n                    if (k !== m) {\n                        H[k][k - 1] = -s * x;\n                    } else if (l !== m) {\n                        H[k][k - 1] = -H[k][k - 1];\n                    }\n\n                    p = p + s;\n                    x = p / s;\n                    y = q / s;\n                    z = r / s;\n                    q = q / p;\n                    r = r / p;\n\n                    for (j = k; j < nn; j++) {\n                        p = H[k][j] + q * H[k + 1][j];\n                        if (notlast) {\n                            p = p + r * H[k + 2][j];\n                            H[k + 2][j] = H[k + 2][j] - p * z;\n                        }\n\n                        H[k][j] = H[k][j] - p * x;\n                        H[k + 1][j] = H[k + 1][j] - p * y;\n                    }\n\n                    for (i = 0; i <= Math.min(n, k + 3); i++) {\n                        p = x * H[i][k] + y * H[i][k + 1];\n                        if (notlast) {\n                            p = p + z * H[i][k + 2];\n                            H[i][k + 2] = H[i][k + 2] - p * r;\n                        }\n\n                        H[i][k] = H[i][k] - p;\n                        H[i][k + 1] = H[i][k + 1] - p * q;\n                    }\n\n                    for (i = low; i <= high; i++) {\n                        p = x * V[i][k] + y * V[i][k + 1];\n                        if (notlast) {\n                            p = p + z * V[i][k + 2];\n                            V[i][k + 2] = V[i][k + 2] - p * r;\n                        }\n\n                        V[i][k] = V[i][k] - p;\n                        V[i][k + 1] = V[i][k + 1] - p * q;\n                    }\n                }\n            }\n        }\n    }\n\n    if (norm === 0) {\n        return;\n    }\n\n    for (n = nn - 1; n >= 0; n--) {\n        p = d[n];\n        q = e[n];\n\n        if (q === 0) {\n            l = n;\n            H[n][n] = 1;\n            for (i = n - 1; i >= 0; i--) {\n                w = H[i][i] - p;\n                r = 0;\n                for (j = l; j <= n; j++) {\n                    r = r + H[i][j] * H[j][n];\n                }\n\n                if (e[i] < 0) {\n                    z = w;\n                    s = r;\n                } else {\n                    l = i;\n                    if (e[i] === 0) {\n                        H[i][n] = (w !== 0) ? (-r / w) : (-r / (eps * norm));\n                    } else {\n                        x = H[i][i + 1];\n                        y = H[i + 1][i];\n                        q = (d[i] - p) * (d[i] - p) + e[i] * e[i];\n                        t = (x * s - z * r) / q;\n                        H[i][n] = t;\n                        H[i + 1][n] = (Math.abs(x) > Math.abs(z)) ? ((-r - w * t) / x) : ((-s - y * t) / z);\n                    }\n\n                    t = Math.abs(H[i][n]);\n                    if ((eps * t) * t > 1) {\n                        for (j = i; j <= n; j++) {\n                            H[j][n] = H[j][n] / t;\n                        }\n                    }\n                }\n            }\n        } else if (q < 0) {\n            l = n - 1;\n\n            if (Math.abs(H[n][n - 1]) > Math.abs(H[n - 1][n])) {\n                H[n - 1][n - 1] = q / H[n][n - 1];\n                H[n - 1][n] = -(H[n][n] - p) / H[n][n - 1];\n            } else {\n                cdivres = cdiv(0, -H[n - 1][n], H[n - 1][n - 1] - p, q);\n                H[n - 1][n - 1] = cdivres[0];\n                H[n - 1][n] = cdivres[1];\n            }\n\n            H[n][n - 1] = 0;\n            H[n][n] = 1;\n            for (i = n - 2; i >= 0; i--) {\n                ra = 0;\n                sa = 0;\n                for (j = l; j <= n; j++) {\n                    ra = ra + H[i][j] * H[j][n - 1];\n                    sa = sa + H[i][j] * H[j][n];\n                }\n\n                w = H[i][i] - p;\n\n                if (e[i] < 0) {\n                    z = w;\n                    r = ra;\n                    s = sa;\n                } else {\n                    l = i;\n                    if (e[i] === 0) {\n                        cdivres = cdiv(-ra, -sa, w, q);\n                        H[i][n - 1] = cdivres[0];\n                        H[i][n] = cdivres[1];\n                    } else {\n                        x = H[i][i + 1];\n                        y = H[i + 1][i];\n                        vr = (d[i] - p) * (d[i] - p) + e[i] * e[i] - q * q;\n                        vi = (d[i] - p) * 2 * q;\n                        if (vr === 0 && vi === 0) {\n                            vr = eps * norm * (Math.abs(w) + Math.abs(q) + Math.abs(x) + Math.abs(y) + Math.abs(z));\n                        }\n                        cdivres = cdiv(x * r - z * ra + q * sa, x * s - z * sa - q * ra, vr, vi);\n                        H[i][n - 1] = cdivres[0];\n                        H[i][n] = cdivres[1];\n                        if (Math.abs(x) > (Math.abs(z) + Math.abs(q))) {\n                            H[i + 1][n - 1] = (-ra - w * H[i][n - 1] + q * H[i][n]) / x;\n                            H[i + 1][n] = (-sa - w * H[i][n] - q * H[i][n - 1]) / x;\n                        } else {\n                            cdivres = cdiv(-r - y * H[i][n - 1], -s - y * H[i][n], z, q);\n                            H[i + 1][n - 1] = cdivres[0];\n                            H[i + 1][n] = cdivres[1];\n                        }\n                    }\n\n                    t = Math.max(Math.abs(H[i][n - 1]), Math.abs(H[i][n]));\n                    if ((eps * t) * t > 1) {\n                        for (j = i; j <= n; j++) {\n                            H[j][n - 1] = H[j][n - 1] / t;\n                            H[j][n] = H[j][n] / t;\n                        }\n                    }\n                }\n            }\n        }\n    }\n\n    for (i = 0; i < nn; i++) {\n        if (i < low || i > high) {\n            for (j = i; j < nn; j++) {\n                V[i][j] = H[i][j];\n            }\n        }\n    }\n\n    for (j = nn - 1; j >= low; j--) {\n        for (i = low; i <= high; i++) {\n            z = 0;\n            for (k = low; k <= Math.min(j, high); k++) {\n                z = z + V[i][k] * H[k][j];\n            }\n            V[i][j] = z;\n        }\n    }\n}\n\nfunction cdiv(xr, xi, yr, yi) {\n    var r, d;\n    if (Math.abs(yr) > Math.abs(yi)) {\n        r = yi / yr;\n        d = yr + r * yi;\n        return [(xr + r * xi) / d, (xi - r * xr) / d];\n    }\n    else {\n        r = yr / yi;\n        d = yi + r * yr;\n        return [(r * xr + xi) / d, (r * xi - xr) / d];\n    }\n}\n\nmodule.exports = EigenvalueDecomposition;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-optimize-lorentzian/node_modules/ml-matrix/src/dc/evd.js","'use strict';\n\nvar Matrix = require('../matrix');\n\n// https://github.com/lutzroeder/Mapack/blob/master/Source/LuDecomposition.cs\nfunction LuDecomposition(matrix) {\n    if (!(this instanceof LuDecomposition)) {\n        return new LuDecomposition(matrix);\n    }\n    matrix = Matrix.checkMatrix(matrix);\n\n    var lu = matrix.clone(),\n        rows = lu.rows,\n        columns = lu.columns,\n        pivotVector = new Array(rows),\n        pivotSign = 1,\n        i, j, k, p, s, t, v,\n        LUrowi, LUcolj, kmax;\n\n    for (i = 0; i < rows; i++) {\n        pivotVector[i] = i;\n    }\n\n    LUcolj = new Array(rows);\n\n    for (j = 0; j < columns; j++) {\n\n        for (i = 0; i < rows; i++) {\n            LUcolj[i] = lu[i][j];\n        }\n\n        for (i = 0; i < rows; i++) {\n            LUrowi = lu[i];\n            kmax = Math.min(i, j);\n            s = 0;\n            for (k = 0; k < kmax; k++) {\n                s += LUrowi[k] * LUcolj[k];\n            }\n            LUrowi[j] = LUcolj[i] -= s;\n        }\n\n        p = j;\n        for (i = j + 1; i < rows; i++) {\n            if (Math.abs(LUcolj[i]) > Math.abs(LUcolj[p])) {\n                p = i;\n            }\n        }\n\n        if (p !== j) {\n            for (k = 0; k < columns; k++) {\n                t = lu[p][k];\n                lu[p][k] = lu[j][k];\n                lu[j][k] = t;\n            }\n\n            v = pivotVector[p];\n            pivotVector[p] = pivotVector[j];\n            pivotVector[j] = v;\n\n            pivotSign = -pivotSign;\n        }\n\n        if (j < rows && lu[j][j] !== 0) {\n            for (i = j + 1; i < rows; i++) {\n                lu[i][j] /= lu[j][j];\n            }\n        }\n    }\n\n    this.LU = lu;\n    this.pivotVector = pivotVector;\n    this.pivotSign = pivotSign;\n}\n\nLuDecomposition.prototype = {\n    isSingular: function () {\n        var data = this.LU,\n            col = data.columns;\n        for (var j = 0; j < col; j++) {\n            if (data[j][j] === 0) {\n                return true;\n            }\n        }\n        return false;\n    },\n    get determinant() {\n        var data = this.LU;\n        if (!data.isSquare())\n            throw new Error('Matrix must be square');\n        var determinant = this.pivotSign, col = data.columns;\n        for (var j = 0; j < col; j++)\n            determinant *= data[j][j];\n        return determinant;\n    },\n    get lowerTriangularFactor() {\n        var data = this.LU,\n            rows = data.rows,\n            columns = data.columns,\n            X = new Matrix(rows, columns);\n        for (var i = 0; i < rows; i++) {\n            for (var j = 0; j < columns; j++) {\n                if (i > j) {\n                    X[i][j] = data[i][j];\n                } else if (i === j) {\n                    X[i][j] = 1;\n                } else {\n                    X[i][j] = 0;\n                }\n            }\n        }\n        return X;\n    },\n    get upperTriangularFactor() {\n        var data = this.LU,\n            rows = data.rows,\n            columns = data.columns,\n            X = new Matrix(rows, columns);\n        for (var i = 0; i < rows; i++) {\n            for (var j = 0; j < columns; j++) {\n                if (i <= j) {\n                    X[i][j] = data[i][j];\n                } else {\n                    X[i][j] = 0;\n                }\n            }\n        }\n        return X;\n    },\n    get pivotPermutationVector() {\n        return this.pivotVector.slice();\n    },\n    solve: function (value) {\n        value = Matrix.checkMatrix(value);\n\n        var lu = this.LU,\n            rows = lu.rows;\n\n        if (rows !== value.rows)\n            throw new Error('Invalid matrix dimensions');\n        if (this.isSingular())\n            throw new Error('LU matrix is singular');\n\n        var count = value.columns,\n            X = value.subMatrixRow(this.pivotVector, 0, count - 1),\n            columns = lu.columns,\n            i, j, k;\n\n        for (k = 0; k < columns; k++) {\n            for (i = k + 1; i < columns; i++) {\n                for (j = 0; j < count; j++) {\n                    X[i][j] -= X[k][j] * lu[i][k];\n                }\n            }\n        }\n        for (k = columns - 1; k >= 0; k--) {\n            for (j = 0; j < count; j++) {\n                X[k][j] /= lu[k][k];\n            }\n            for (i = 0; i < k; i++) {\n                for (j = 0; j < count; j++) {\n                    X[i][j] -= X[k][j] * lu[i][k];\n                }\n            }\n        }\n        return X;\n    }\n};\n\nmodule.exports = LuDecomposition;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-optimize-lorentzian/node_modules/ml-matrix/src/dc/lu.js","'use strict';\n\nvar Matrix = require('../matrix');\nvar hypotenuse = require('./util').hypotenuse;\n\n//https://github.com/lutzroeder/Mapack/blob/master/Source/QrDecomposition.cs\nfunction QrDecomposition(value) {\n    if (!(this instanceof QrDecomposition)) {\n        return new QrDecomposition(value);\n    }\n    value = Matrix.checkMatrix(value);\n\n    var qr = value.clone(),\n        m = value.rows,\n        n = value.columns,\n        rdiag = new Array(n),\n        i, j, k, s;\n\n    for (k = 0; k < n; k++) {\n        var nrm = 0;\n        for (i = k; i < m; i++) {\n            nrm = hypotenuse(nrm, qr[i][k]);\n        }\n        if (nrm !== 0) {\n            if (qr[k][k] < 0) {\n                nrm = -nrm;\n            }\n            for (i = k; i < m; i++) {\n                qr[i][k] /= nrm;\n            }\n            qr[k][k] += 1;\n            for (j = k + 1; j < n; j++) {\n                s = 0;\n                for (i = k; i < m; i++) {\n                    s += qr[i][k] * qr[i][j];\n                }\n                s = -s / qr[k][k];\n                for (i = k; i < m; i++) {\n                    qr[i][j] += s * qr[i][k];\n                }\n            }\n        }\n        rdiag[k] = -nrm;\n    }\n\n    this.QR = qr;\n    this.Rdiag = rdiag;\n}\n\nQrDecomposition.prototype = {\n    solve: function (value) {\n        value = Matrix.checkMatrix(value);\n\n        var qr = this.QR,\n            m = qr.rows;\n\n        if (value.rows !== m)\n            throw new Error('Matrix row dimensions must agree');\n        if (!this.isFullRank())\n            throw new Error('Matrix is rank deficient');\n\n        var count = value.columns,\n            X = value.clone(),\n            n = qr.columns,\n            i, j, k, s;\n\n        for (k = 0; k < n; k++) {\n            for (j = 0; j < count; j++) {\n                s = 0;\n                for (i = k; i < m; i++) {\n                    s += qr[i][k] * X[i][j];\n                }\n                s = -s / qr[k][k];\n                for (i = k; i < m; i++) {\n                    X[i][j] += s * qr[i][k];\n                }\n            }\n        }\n        for (k = n - 1; k >= 0; k--) {\n            for (j = 0; j < count; j++) {\n                X[k][j] /= this.Rdiag[k];\n            }\n            for (i = 0; i < k; i++) {\n                for (j = 0; j < count; j++) {\n                    X[i][j] -= X[k][j] * qr[i][k];\n                }\n            }\n        }\n\n        return X.subMatrix(0, n - 1, 0, count - 1);\n    },\n    isFullRank: function () {\n        var columns = this.QR.columns;\n        for (var i = 0; i < columns; i++) {\n            if (this.Rdiag[i] === 0) {\n                return false;\n            }\n        }\n        return true;\n    },\n    get upperTriangularFactor() {\n        var qr = this.QR,\n            n = qr.columns,\n            X = new Matrix(n, n),\n            i, j;\n        for (i = 0; i < n; i++) {\n            for (j = 0; j < n; j++) {\n                if (i < j) {\n                    X[i][j] = qr[i][j];\n                } else if (i === j) {\n                    X[i][j] = this.Rdiag[i];\n                } else {\n                    X[i][j] = 0;\n                }\n            }\n        }\n        return X;\n    },\n    get orthogonalFactor() {\n        var qr = this.QR,\n            rows = qr.rows,\n            columns = qr.columns,\n            X = new Matrix(rows, columns),\n            i, j, k, s;\n\n        for (k = columns - 1; k >= 0; k--) {\n            for (i = 0; i < rows; i++) {\n                X[i][k] = 0;\n            }\n            X[k][k] = 1;\n            for (j = k; j < columns; j++) {\n                if (qr[k][k] !== 0) {\n                    s = 0;\n                    for (i = k; i < rows; i++) {\n                        s += qr[i][k] * X[i][j];\n                    }\n\n                    s = -s / qr[k][k];\n\n                    for (i = k; i < rows; i++) {\n                        X[i][j] += s * qr[i][k];\n                    }\n                }\n            }\n        }\n        return X;\n    }\n};\n\nmodule.exports = QrDecomposition;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-optimize-lorentzian/node_modules/ml-matrix/src/dc/qr.js","'use strict';\n\nvar Matrix = require('../matrix');\n\n// https://github.com/lutzroeder/Mapack/blob/master/Source/CholeskyDecomposition.cs\nfunction CholeskyDecomposition(value) {\n    if (!(this instanceof CholeskyDecomposition)) {\n        return new CholeskyDecomposition(value);\n    }\n    value = Matrix.checkMatrix(value);\n    if (!value.isSymmetric())\n        throw new Error('Matrix is not symmetric');\n\n    var a = value,\n        dimension = a.rows,\n        l = new Matrix(dimension, dimension),\n        positiveDefinite = true,\n        i, j, k;\n\n    for (j = 0; j < dimension; j++) {\n        var Lrowj = l[j];\n        var d = 0;\n        for (k = 0; k < j; k++) {\n            var Lrowk = l[k];\n            var s = 0;\n            for (i = 0; i < k; i++) {\n                s += Lrowk[i] * Lrowj[i];\n            }\n            Lrowj[k] = s = (a[j][k] - s) / l[k][k];\n            d = d + s * s;\n        }\n\n        d = a[j][j] - d;\n\n        positiveDefinite &= (d > 0);\n        l[j][j] = Math.sqrt(Math.max(d, 0));\n        for (k = j + 1; k < dimension; k++) {\n            l[j][k] = 0;\n        }\n    }\n\n    if (!positiveDefinite) {\n        throw new Error('Matrix is not positive definite');\n    }\n\n    this.L = l;\n}\n\nCholeskyDecomposition.prototype = {\n    get leftTriangularFactor() {\n        return this.L;\n    },\n    solve: function (value) {\n        value = Matrix.checkMatrix(value);\n\n        var l = this.L,\n            dimension = l.rows;\n\n        if (value.rows !== dimension) {\n            throw new Error('Matrix dimensions do not match');\n        }\n\n        var count = value.columns,\n            B = value.clone(),\n            i, j, k;\n\n        for (k = 0; k < dimension; k++) {\n            for (j = 0; j < count; j++) {\n                for (i = 0; i < k; i++) {\n                    B[k][j] -= B[i][j] * l[k][i];\n                }\n                B[k][j] /= l[k][k];\n            }\n        }\n\n        for (k = dimension - 1; k >= 0; k--) {\n            for (j = 0; j < count; j++) {\n                for (i = k + 1; i < dimension; i++) {\n                    B[k][j] -= B[i][j] * l[i][k];\n                }\n                B[k][j] /= l[k][k];\n            }\n        }\n\n        return B;\n    }\n};\n\nmodule.exports = CholeskyDecomposition;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-optimize-lorentzian/node_modules/ml-matrix/src/dc/cholesky.js","'use strict';\n\nconst extend = require('extend');\nconst SG = require('ml-savitzky-golay-generalized');\n\nconst defaultOptions = {\n    sgOptions: {\n        windowSize: 9,\n        polynomial: 3\n    },\n    minMaxRatio: 0.00025,\n    broadRatio: 0.00,\n    maxCriteria: true,\n    smoothY: true,\n    realTopDetection: false,\n    heightFactor: 0,\n    boundaries: false,\n    derivativeThreshold: -1\n};\n\n/**\n * Global spectra deconvolution\n * @param {Array<Number>} x - Independent variable\n * @param {Array<Number>} yIn - Dependent variable\n * @param {Object} [options] - Options object\n * @param {Object} [options.sgOptions] - Options object for Savitzky-Golay filter. See https://github.com/mljs/savitzky-golay-generalized#options\n * @param {Number} [options.sgOptions.windowSize = 9] - points to use in the approximations\n * @param {Number} [options.sgOptions.polynomial = 3] - degree of the polynomial to use in the approximations\n * @param {Number} [options.minMaxRatio = 0.00025] - Threshold to determine if a given peak should be considered as a noise\n * @param {Number} [options.broadRatio = 0.00] - If `broadRatio` is higher than 0, then all the peaks which second derivative\n * smaller than `broadRatio * maxAbsSecondDerivative` will be marked with the soft mask equal to true.\n * @param {Number} [options.noiseLevel = 0] - Noise threshold in spectrum units\n * @param {Boolean} [options.maxCriteria = true] - Peaks are local maximum(true) or minimum(false)\n * @param {Boolean} [options.smoothY = true] - Select the peak intensities from a smoothed version of the independent variables\n * @param {Boolean} [options.realTopDetection = false] - Use a quadratic optimizations with the peak and its 3 closest neighbors\n * to determine the true x,y values of the peak?\n * @param {Number} [options.heightFactor = 0] - Factor to multiply the calculated height (usually 2)\n * @param {Boolean} [options.boundaries = false] - Return also the inflection points of the peaks\n * @param {Number} [options.derivativeThreshold = -1] - Filters based on the amplitude of the first derivative\n * @return {Array<Object>}\n */\nfunction gsd(x, yIn, options) {\n    options = extend({}, defaultOptions, options);\n    let sgOptions = options.sgOptions;\n    const y = [].concat(yIn);\n\n    if (!('noiseLevel' in options)) {\n        // We have to know if x is equally spaced\n        var maxDx = 0,\n            minDx = Number.MAX_VALUE,\n            tmp;\n        for (let i = 0; i < x.length - 1; ++i) {\n            tmp = Math.abs(x[i + 1] - x[i]);\n            if (tmp < minDx) {\n                minDx = tmp;\n            }\n            if (tmp > maxDx) {\n                maxDx = tmp;\n            }\n        }\n\n        if ((maxDx - minDx) / maxDx < 0.05) {\n            options.noiseLevel = getNoiseLevel(y);\n        } else {\n            options.noiseLevel = 0;\n        }\n    }\n    const yCorrection = {m: 1, b: options.noiseLevel};\n    if (!options.maxCriteria) {\n        yCorrection.m = -1;\n        yCorrection.b *= -1;\n    }\n\n    for (let i = 0; i < y.length; i++) {\n        y[i] = yCorrection.m * y[i] - yCorrection.b;\n    }\n\n    for (let i = 0; i < y.length; i++) {\n        if (y[i] < 0) {\n            y[i] = 0;\n        }\n    }\n    // If the max difference between delta x is less than 5%, then, we can assume it to be equally spaced variable\n    let Y = y;\n    let dY, ddY;\n    if ((maxDx - minDx) / maxDx < 0.05) {\n        if (options.smoothY)\n            Y = SG(y, x[1] - x[0], {windowSize: sgOptions.windowSize, polynomial: sgOptions.polynomial, derivative: 0});\n        dY = SG(y, x[1] - x[0], {windowSize: sgOptions.windowSize, polynomial: sgOptions.polynomial, derivative: 1});\n        ddY = SG(y, x[1] - x[0], {windowSize: sgOptions.windowSize, polynomial: sgOptions.polynomial, derivative: 2});\n    } else {\n        if (options.smoothY)\n            Y = SG(y, x, {windowSize: sgOptions.windowSize, polynomial: sgOptions.polynomial, derivative: 0});\n        dY = SG(y, x, {windowSize: sgOptions.windowSize, polynomial: sgOptions.polynomial, derivative: 1});\n        ddY = SG(y, x, {windowSize: sgOptions.windowSize, polynomial: sgOptions.polynomial, derivative: 2});\n    }\n\n    const X = x;\n    const dx = x[1] - x[0];\n    var maxDdy = 0;\n    var maxY = 0;\n    for (let i = 0; i < Y.length; i++) {\n        if (Math.abs(ddY[i]) > maxDdy) {\n            maxDdy = Math.abs(ddY[i]);\n        }\n        if (Math.abs(Y[i]) > maxY) {\n            maxY = Math.abs(Y[i]);\n        }\n    }\n\n    var lastMax = null;\n    var lastMin = null;\n    var minddY = new Array(Y.length - 2);\n    var intervalL = new Array(Y.length);\n    var intervalR = new Array(Y.length);\n    var broadMask = new Array(Y.length - 2);\n    var minddYLen = 0;\n    var intervalLLen = 0;\n    var intervalRLen = 0;\n    var broadMaskLen = 0;\n    // By the intermediate value theorem We cannot find 2 consecutive maximum or minimum\n    for (let i = 1; i < Y.length - 1; ++i) {\n\n        // filter based on derivativeThreshold\n        if (Math.abs(dY[i]) > options.derivativeThreshold) {\n\n            // Minimum in first derivative\n            if ((dY[i] < dY[i - 1]) && (dY[i] <= dY[i + 1]) ||\n                (dY[i] <= dY[i - 1]) && (dY[i] < dY[i + 1])) {\n                lastMin = {\n                    x: X[i],\n                    index: i\n                };\n                if (dx > 0 && lastMax !== null) {\n                    intervalL[intervalLLen++] = lastMax;\n                    intervalR[intervalRLen++] = lastMin;\n                }\n            }\n\n            // Maximum in first derivative\n            if ((dY[i] >= dY[i - 1]) && (dY[i] > dY[i + 1]) ||\n                (dY[i] > dY[i - 1]) && (dY[i] >= dY[i + 1])) {\n                lastMax = {\n                    x: X[i],\n                    index: i\n                };\n                if (dx < 0 && lastMin !== null) {\n                    intervalL[intervalLLen++] = lastMax;\n                    intervalR[intervalRLen++] = lastMin;\n                }\n            }\n        }\n\n        // Minimum in second derivative\n        if ((ddY[i] < ddY[i - 1]) && (ddY[i] < ddY[i + 1])) {\n            // TODO should we change this to have 3 arrays ? Huge overhead creating arrays\n            minddY[minddYLen++] = i; //( [X[i], Y[i], i] );\n            broadMask[broadMaskLen++] = Math.abs(ddY[i]) <= options.broadRatio * maxDdy;\n        }\n    }\n    minddY.length = minddYLen;\n    intervalL.length = intervalLLen;\n    intervalR.length = intervalRLen;\n    broadMask.length = broadMaskLen;\n\n    let signals = new Array(minddY.length);\n    let signalsLen = 0;\n    let lastK = -1;\n    let possible, frequency, distanceJ, minDistance, gettingCloser;\n    for (let j = 0; j < minddY.length; ++j) {\n        frequency = X[minddY[j]];\n        possible = -1;\n        let k = lastK + 1;\n        minDistance = Number.MAX_VALUE;\n        distanceJ = 0;\n        gettingCloser = true;\n        while (possible === -1 && (k < intervalL.length) && gettingCloser) {\n            distanceJ = Math.abs(frequency - (intervalL[k].x + intervalR[k].x) / 2);\n\n            //Still getting closer?\n            if (distanceJ < minDistance) {\n                minDistance = distanceJ;\n            } else {\n                gettingCloser = false;\n            }\n            if (distanceJ < Math.abs(intervalL[k].x - intervalR[k].x) / 2) {\n                possible = k;\n                lastK = k;\n            }\n            ++k;\n        }\n\n        if (possible !== -1) {\n            if (Math.abs(Y[minddY[j]]) > options.minMaxRatio * maxY) {\n                signals[signalsLen++] = {\n                    index: minddY[j],\n                    x: frequency,\n                    y: (Y[minddY[j]] + yCorrection.b) / yCorrection.m,\n                    width: Math.abs(intervalR[possible].x - intervalL[possible].x), //widthCorrection\n                    soft: broadMask[j]\n                };\n                if (options.boundaries) {\n                    signals[signalsLen - 1].left = intervalL[possible];\n                    signals[signalsLen - 1].right = intervalR[possible];\n                }\n                if (options.heightFactor) {\n                    let yLeft = Y[intervalL[possible].index];\n                    let yRight = Y[intervalR[possible].index];\n                    signals[signalsLen - 1].height = options.heightFactor * (signals[signalsLen - 1].y - ((yLeft + yRight) / 2));\n                }\n            }\n        }\n    }\n    signals.length = signalsLen;\n\n    if (options.realTopDetection)\n        realTopDetection(signals, X, Y);\n\n    //Correct the values to fit the original spectra data\n    for (let j = 0; j < signals.length; j++) {\n        signals[j].base = options.noiseLevel;\n    }\n\n    signals.sort(function (a, b) {\n        return a.x - b.x;\n    });\n\n    return signals;\n\n}\n\nfunction getNoiseLevel(y) {\n    var mean = 0, stddev = 0;\n    var length = y.length;\n    for (let i = 0; i < length; ++i) {\n        mean += y[i];\n    }\n    mean /= length;\n    var averageDeviations = new Array(length);\n    for (let i = 0; i < length; ++i)\n        averageDeviations[i] = Math.abs(y[i] - mean);\n    averageDeviations.sort();\n    if (length % 2 === 1) {\n        stddev = averageDeviations[(length - 1) / 2] / 0.6745;\n    } else {\n        stddev = 0.5 * (averageDeviations[length / 2] + averageDeviations[length / 2 - 1]) / 0.6745;\n    }\n\n    return stddev;\n}\n\nfunction realTopDetection(peakList, x, y) {\n    var alpha, beta, gamma, p, currentPoint;\n    for (var j = 0; j < peakList.length; j++) {\n        currentPoint = peakList[j].i;//peakList[j][2];\n        //The detected peak could be moved 1 or 2 unit to left or right.\n        if (y[currentPoint - 1] >= y[currentPoint - 2]\n            && y[currentPoint - 1] >= y[currentPoint]) {\n            currentPoint--;\n        } else {\n            if (y[currentPoint + 1] >= y[currentPoint]\n                && y[currentPoint + 1] >= y[currentPoint + 2]) {\n                currentPoint++;\n            } else {\n                if (y[currentPoint - 2] >= y[currentPoint - 3]\n                    && y[currentPoint - 2] >= y[currentPoint - 1]) {\n                    currentPoint -= 2;\n                } else {\n                    if (y[currentPoint + 2] >= y[currentPoint + 1]\n                        && y[currentPoint + 2] >= y[currentPoint + 3]) {\n                        currentPoint += 2;\n                    }\n                }\n            }\n        }\n        if (y[currentPoint - 1] > 0 && y[currentPoint + 1] > 0\n            && y[currentPoint] >= y[currentPoint - 1]\n            && y[currentPoint] >= y[currentPoint + 1]) {\n            alpha = 20 * Math.log10(y[currentPoint - 1]);\n            beta = 20 * Math.log10(y[currentPoint]);\n            gamma = 20 * Math.log10(y[currentPoint + 1]);\n            p = 0.5 * (alpha - gamma) / (alpha - 2 * beta + gamma);\n            //console.log(\"p: \"+p);\n            //console.log(x[currentPoint]+\" \"+tmp+\" \"+currentPoint);\n            peakList[j].x = x[currentPoint] + (x[currentPoint] - x[currentPoint - 1]) * p;\n            peakList[j].y = y[currentPoint] - 0.25 * (y[currentPoint - 1] - y[currentPoint + 1]) * p;\n        }\n    }\n}\n\nmodule.exports = gsd;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-gsd/src/gsd.js","//Code translate from Pascal source in http://pubs.acs.org/doi/pdf/10.1021/ac00205a007\nvar extend = require('extend');\nvar stat = require('ml-stat');\n\nvar defaultOptions = {\n    windowSize: 9,\n    derivative: 0,\n    polynomial: 3,\n};\n\n\nfunction SavitzkyGolay(data, h, options) {\n    options = extend({}, defaultOptions, options);\n\n    if ((options.windowSize % 2 === 0) || (options.windowSize < 5) || !(Number.isInteger(options.windowSize)))\n            throw new RangeError('Invalid window size (should be odd and at least 5 integer number)')\n\n\n    if (options.windowSize>data.length)\n        throw new RangeError('Window size is higher than the data length '+options.windowSize+\">\"+data.length);\n    if ((options.derivative < 0) || !(Number.isInteger(options.derivative)))\n        throw new RangeError('Derivative should be a positive integer');\n    if ((options.polynomial < 1) || !(Number.isInteger(options.polynomial)))\n        throw new RangeError('Polynomial should be a positive integer');\n    if (options.polynomial >= 6)\n        console.warn('You should not use polynomial grade higher than 5 if you are' +\n            ' not sure that your data arises from such a model. Possible polynomial oscillation problems');\n\n    var windowSize = options.windowSize;\n\n    var half = Math.floor(windowSize/2);\n    var np = data.length;\n    var ans = new Array(np);\n    var weights = fullWeights(windowSize,options.polynomial,options.derivative);\n    var hs = 0;\n    var constantH = true;\n    if( Object.prototype.toString.call( h ) === '[object Array]' ) {\n        constantH = false;\n    }\n    else{\n        hs = Math.pow(h, options.derivative);\n    }\n    //console.log(\"Constant h: \"+constantH);\n    //For the borders\n    for(var i=0;i<half;i++){\n        var wg1=weights[half-i-1];\n        var wg2=weights[half+i+1];\n        var d1 = 0,d2=0;\n        for (var l = 0; l < windowSize; l++){\n            d1 += wg1[l] * data[l];\n            d2 += wg2[l] * data[np-windowSize+l-1];\n        }\n        if(constantH){\n            ans[half-i-1] = d1/hs;\n            ans[np-half+i] = d2/hs;\n        }\n        else{\n            hs = getHs(h,half-i-1,half, options.derivative);\n            ans[half-i-1] = d1/hs;\n            hs = getHs(h,np-half+i,half, options.derivative);\n            ans[np-half+i] = d2/hs;\n        }\n    }\n    //For the internal points\n    var wg = weights[half];\n    for(var i=windowSize;i<np+1;i++){\n        var d = 0;\n        for (var l = 0; l < windowSize; l++)\n            d += wg[l] * data[l+i-windowSize];\n        if(!constantH)\n            hs = getHs(h,i-half-1,half, options.derivative);\n        ans[i-half-1] = d/hs;\n    }\n    return ans;\n}\n\nfunction getHs(h,center,half,derivative){\n    var hs = 0;\n    var count = 0;\n    for(var i=center-half;i<center+half;i++){\n        if(i>=0 && i < h.length-1){\n            hs+= (h[i+1]-h[i]);\n            count++;\n        }\n    }\n    return Math.pow(hs/count,derivative);\n}\n\nfunction GramPoly(i,m,k,s){\n    var Grampoly = 0;\n    if(k>0){\n        Grampoly = (4*k-2)/(k*(2*m-k+1))*(i*GramPoly(i,m,k-1,s) +\n            s*GramPoly(i,m,k-1,s-1)) - ((k-1)*(2*m+k))/(k*(2*m-k+1))*GramPoly(i,m,k-2,s);\n    }\n    else{\n        if(k==0&&s==0){\n            Grampoly=1;\n        }\n        else{\n            Grampoly=0;\n        }\n    }\n    //console.log(Grampoly);\n    return Grampoly;\n}\n\nfunction GenFact(a,b){\n    var gf=1;\n    if(a>=b){\n        for(var j=a-b+1;j<=a;j++){\n            gf*=j;\n        }\n    }\n    return gf;\n}\n\nfunction Weight(i,t,m,n,s){\n    var sum=0;\n    for(var k=0;k<=n;k++){\n        //console.log(k);\n        sum+=(2*k+1)*(GenFact(2*m,k)/GenFact(2*m+k+1,k+1))*GramPoly(i,m,k,0)*GramPoly(t,m,k,s)\n    }\n    return sum;\n}\n\n/**\n *\n * @param m  Number of points\n * @param n  Polynomial grade\n * @param s  Derivative\n */\nfunction fullWeights(m,n,s){\n    var weights = new Array(m);\n    var np = Math.floor(m/2);\n    for(var t=-np;t<=np;t++){\n        weights[t+np] = new Array(m);\n        for(var j=-np;j<=np;j++){\n            weights[t+np][j+np]=Weight(j,t,np,n,s);\n        }\n    }\n    return weights;\n}\n\n/*function entropy(data,h,options){\n    var trend = SavitzkyGolay(data,h,trendOptions);\n    var copy = new Array(data.length);\n    var sum = 0;\n    var max = 0;\n    for(var i=0;i<data.length;i++){\n        copy[i] = data[i]-trend[i];\n    }\n\n    sum/=data.length;\n    console.log(sum+\" \"+max);\n    console.log(stat.array.standardDeviation(copy));\n    console.log(Math.abs(stat.array.mean(copy))/stat.array.standardDeviation(copy));\n    return sum;\n\n}\n\n\n\nfunction guessWindowSize(data, h){\n    console.log(\"entropy \"+entropy(data,h,trendOptions));\n    return 5;\n}\n*/\nmodule.exports = SavitzkyGolay;\n \n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-savitzky-golay-generalized/src/index.js","'use strict';\n\nexports.array = require('./array');\nexports.matrix = require('./matrix');\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-savitzky-golay-generalized/node_modules/ml-stat/index.js","'use strict';\nvar arrayStat = require('./array');\n\n// https://github.com/accord-net/framework/blob/development/Sources/Accord.Statistics/Tools.cs\n\nfunction entropy(matrix, eps) {\n    if (typeof(eps) === 'undefined') {\n        eps = 0;\n    }\n    var sum = 0,\n        l1 = matrix.length,\n        l2 = matrix[0].length;\n    for (var i = 0; i < l1; i++) {\n        for (var j = 0; j < l2; j++) {\n            sum += matrix[i][j] * Math.log(matrix[i][j] + eps);\n        }\n    }\n    return -sum;\n}\n\nfunction mean(matrix, dimension) {\n    if (typeof(dimension) === 'undefined') {\n        dimension = 0;\n    }\n    var rows = matrix.length,\n        cols = matrix[0].length,\n        theMean, N, i, j;\n\n    if (dimension === -1) {\n        theMean = [0];\n        N = rows * cols;\n        for (i = 0; i < rows; i++) {\n            for (j = 0; j < cols; j++) {\n                theMean[0] += matrix[i][j];\n            }\n        }\n        theMean[0] /= N;\n    } else if (dimension === 0) {\n        theMean = new Array(cols);\n        N = rows;\n        for (j = 0; j < cols; j++) {\n            theMean[j] = 0;\n            for (i = 0; i < rows; i++) {\n                theMean[j] += matrix[i][j];\n            }\n            theMean[j] /= N;\n        }\n    } else if (dimension === 1) {\n        theMean = new Array(rows);\n        N = cols;\n        for (j = 0; j < rows; j++) {\n            theMean[j] = 0;\n            for (i = 0; i < cols; i++) {\n                theMean[j] += matrix[j][i];\n            }\n            theMean[j] /= N;\n        }\n    } else {\n        throw new Error('Invalid dimension');\n    }\n    return theMean;\n}\n\nfunction standardDeviation(matrix, means, unbiased) {\n    var vari = variance(matrix, means, unbiased), l = vari.length;\n    for (var i = 0; i < l; i++) {\n        vari[i] = Math.sqrt(vari[i]);\n    }\n    return vari;\n}\n\nfunction variance(matrix, means, unbiased) {\n    if (typeof(unbiased) === 'undefined') {\n        unbiased = true;\n    }\n    means = means || mean(matrix);\n    var rows = matrix.length;\n    if (rows === 0) return [];\n    var cols = matrix[0].length;\n    var vari = new Array(cols);\n\n    for (var j = 0; j < cols; j++) {\n        var sum1 = 0, sum2 = 0, x = 0;\n        for (var i = 0; i < rows; i++) {\n            x = matrix[i][j] - means[j];\n            sum1 += x;\n            sum2 += x * x;\n        }\n        if (unbiased) {\n            vari[j] = (sum2 - ((sum1 * sum1) / rows)) / (rows - 1);\n        } else {\n            vari[j] = (sum2 - ((sum1 * sum1) / rows)) / rows;\n        }\n    }\n    return vari;\n}\n\nfunction median(matrix) {\n    var rows = matrix.length, cols = matrix[0].length;\n    var medians = new Array(cols);\n\n    for (var i = 0; i < cols; i++) {\n        var data = new Array(rows);\n        for (var j = 0; j < rows; j++) {\n            data[j] = matrix[j][i];\n        }\n        data.sort();\n        var N = data.length;\n        if (N % 2 === 0) {\n            medians[i] = (data[N / 2] + data[(N / 2) - 1]) * 0.5;\n        } else {\n            medians[i] = data[Math.floor(N / 2)];\n        }\n    }\n    return medians;\n}\n\nfunction mode(matrix) {\n    var rows = matrix.length,\n        cols = matrix[0].length,\n        modes = new Array(cols),\n        i, j;\n    for (i = 0; i < cols; i++) {\n        var itemCount = new Array(rows);\n        for (var k = 0; k < rows; k++) {\n            itemCount[k] = 0;\n        }\n        var itemArray = new Array(rows);\n        var count = 0;\n\n        for (j = 0; j < rows; j++) {\n            var index = itemArray.indexOf(matrix[j][i]);\n            if (index >= 0) {\n                itemCount[index]++;\n            } else {\n                itemArray[count] = matrix[j][i];\n                itemCount[count] = 1;\n                count++;\n            }\n        }\n\n        var maxValue = 0, maxIndex = 0;\n        for (j = 0; j < count; j++) {\n            if (itemCount[j] > maxValue) {\n                maxValue = itemCount[j];\n                maxIndex = j;\n            }\n        }\n\n        modes[i] = itemArray[maxIndex];\n    }\n    return modes;\n}\n\nfunction skewness(matrix, unbiased) {\n    if (typeof(unbiased) === 'undefined') unbiased = true;\n    var means = mean(matrix);\n    var n = matrix.length, l = means.length;\n    var skew = new Array(l);\n\n    for (var j = 0; j < l; j++) {\n        var s2 = 0, s3 = 0;\n        for (var i = 0; i < n; i++) {\n            var dev = matrix[i][j] - means[j];\n            s2 += dev * dev;\n            s3 += dev * dev * dev;\n        }\n\n        var m2 = s2 / n;\n        var m3 = s3 / n;\n        var g = m3 / Math.pow(m2, 3 / 2);\n\n        if (unbiased) {\n            var a = Math.sqrt(n * (n - 1));\n            var b = n - 2;\n            skew[j] = (a / b) * g;\n        } else {\n            skew[j] = g;\n        }\n    }\n    return skew;\n}\n\nfunction kurtosis(matrix, unbiased) {\n    if (typeof(unbiased) === 'undefined') unbiased = true;\n    var means = mean(matrix);\n    var n = matrix.length, m = matrix[0].length;\n    var kurt = new Array(m);\n\n    for (var j = 0; j < m; j++) {\n        var s2 = 0, s4 = 0;\n        for (var i = 0; i < n; i++) {\n            var dev = matrix[i][j] - means[j];\n            s2 += dev * dev;\n            s4 += dev * dev * dev * dev;\n        }\n        var m2 = s2 / n;\n        var m4 = s4 / n;\n\n        if (unbiased) {\n            var v = s2 / (n - 1);\n            var a = (n * (n + 1)) / ((n - 1) * (n - 2) * (n - 3));\n            var b = s4 / (v * v);\n            var c = ((n - 1) * (n - 1)) / ((n - 2) * (n - 3));\n            kurt[j] = a * b - 3 * c;\n        } else {\n            kurt[j] = m4 / (m2 * m2) - 3;\n        }\n    }\n    return kurt;\n}\n\nfunction standardError(matrix) {\n    var samples = matrix.length;\n    var standardDeviations = standardDeviation(matrix), l = standardDeviations.length;\n    var standardErrors = new Array(l);\n    var sqrtN = Math.sqrt(samples);\n\n    for (var i = 0; i < l; i++) {\n        standardErrors[i] = standardDeviations[i] / sqrtN;\n    }\n    return standardErrors;\n}\n\nfunction covariance(matrix, dimension) {\n    return scatter(matrix, undefined, dimension);\n}\n\nfunction scatter(matrix, divisor, dimension) {\n    if (typeof(dimension) === 'undefined') {\n        dimension = 0;\n    }\n    if (typeof(divisor) === 'undefined') {\n        if (dimension === 0) {\n            divisor = matrix.length - 1;\n        } else if (dimension === 1) {\n            divisor = matrix[0].length - 1;\n        }\n    }\n    var means = mean(matrix, dimension),\n        rows = matrix.length;\n    if (rows === 0) {\n        return [[]];\n    }\n    var cols = matrix[0].length,\n        cov, i, j, s, k;\n\n    if (dimension === 0) {\n        cov = new Array(cols);\n        for (i = 0; i < cols; i++) {\n            cov[i] = new Array(cols);\n        }\n        for (i = 0; i < cols; i++) {\n            for (j = i; j < cols; j++) {\n                s = 0;\n                for (k = 0; k < rows; k++) {\n                    s += (matrix[k][j] - means[j]) * (matrix[k][i] - means[i]);\n                }\n                s /= divisor;\n                cov[i][j] = s;\n                cov[j][i] = s;\n            }\n        }\n    } else if (dimension === 1) {\n        cov = new Array(rows);\n        for (i = 0; i < rows; i++) {\n            cov[i] = new Array(rows);\n        }\n        for (i = 0; i < rows; i++) {\n            for (j = i; j < rows; j++) {\n                s = 0;\n                for (k = 0; k < cols; k++) {\n                    s += (matrix[j][k] - means[j]) * (matrix[i][k] - means[i]);\n                }\n                s /= divisor;\n                cov[i][j] = s;\n                cov[j][i] = s;\n            }\n        }\n    } else {\n        throw new Error('Invalid dimension');\n    }\n\n    return cov;\n}\n\nfunction correlation(matrix) {\n    var means = mean(matrix),\n        standardDeviations = standardDeviation(matrix, true, means),\n        scores = zScores(matrix, means, standardDeviations),\n        rows = matrix.length,\n        cols = matrix[0].length,\n        i, j;\n\n    var cor = new Array(cols);\n    for (i = 0; i < cols; i++) {\n        cor[i] = new Array(cols);\n    }\n    for (i = 0; i < cols; i++) {\n        for (j = i; j < cols; j++) {\n            var c = 0;\n            for (var k = 0, l = scores.length; k < l; k++) {\n                c += scores[k][j] * scores[k][i];\n            }\n            c /= rows - 1;\n            cor[i][j] = c;\n            cor[j][i] = c;\n        }\n    }\n    return cor;\n}\n\nfunction zScores(matrix, means, standardDeviations) {\n    means = means || mean(matrix);\n    if (typeof(standardDeviations) === 'undefined') standardDeviations = standardDeviation(matrix, true, means);\n    return standardize(center(matrix, means, false), standardDeviations, true);\n}\n\nfunction center(matrix, means, inPlace) {\n    means = means || mean(matrix);\n    var result = matrix,\n        l = matrix.length,\n        i, j, jj;\n\n    if (!inPlace) {\n        result = new Array(l);\n        for (i = 0; i < l; i++) {\n            result[i] = new Array(matrix[i].length);\n        }\n    }\n\n    for (i = 0; i < l; i++) {\n        var row = result[i];\n        for (j = 0, jj = row.length; j < jj; j++) {\n            row[j] = matrix[i][j] - means[j];\n        }\n    }\n    return result;\n}\n\nfunction standardize(matrix, standardDeviations, inPlace) {\n    if (typeof(standardDeviations) === 'undefined') standardDeviations = standardDeviation(matrix);\n    var result = matrix,\n        l = matrix.length,\n        i, j, jj;\n\n    if (!inPlace) {\n        result = new Array(l);\n        for (i = 0; i < l; i++) {\n            result[i] = new Array(matrix[i].length);\n        }\n    }\n\n    for (i = 0; i < l; i++) {\n        var resultRow = result[i];\n        var sourceRow = matrix[i];\n        for (j = 0, jj = resultRow.length; j < jj; j++) {\n            if (standardDeviations[j] !== 0 && !isNaN(standardDeviations[j])) {\n                resultRow[j] = sourceRow[j] / standardDeviations[j];\n            }\n        }\n    }\n    return result;\n}\n\nfunction weightedVariance(matrix, weights) {\n    var means = mean(matrix);\n    var rows = matrix.length;\n    if (rows === 0) return [];\n    var cols = matrix[0].length;\n    var vari = new Array(cols);\n\n    for (var j = 0; j < cols; j++) {\n        var sum = 0;\n        var a = 0, b = 0;\n\n        for (var i = 0; i < rows; i++) {\n            var z = matrix[i][j] - means[j];\n            var w = weights[i];\n\n            sum += w * (z * z);\n            b += w;\n            a += w * w;\n        }\n\n        vari[j] = sum * (b / (b * b - a));\n    }\n\n    return vari;\n}\n\nfunction weightedMean(matrix, weights, dimension) {\n    if (typeof(dimension) === 'undefined') {\n        dimension = 0;\n    }\n    var rows = matrix.length;\n    if (rows === 0) return [];\n    var cols = matrix[0].length,\n        means, i, ii, j, w, row;\n\n    if (dimension === 0) {\n        means = new Array(cols);\n        for (i = 0; i < cols; i++) {\n            means[i] = 0;\n        }\n        for (i = 0; i < rows; i++) {\n            row = matrix[i];\n            w = weights[i];\n            for (j = 0; j < cols; j++) {\n                means[j] += row[j] * w;\n            }\n        }\n    } else if (dimension === 1) {\n        means = new Array(rows);\n        for (i = 0; i < rows; i++) {\n            means[i] = 0;\n        }\n        for (j = 0; j < rows; j++) {\n            row = matrix[j];\n            w = weights[j];\n            for (i = 0; i < cols; i++) {\n                means[j] += row[i] * w;\n            }\n        }\n    } else {\n        throw new Error('Invalid dimension');\n    }\n\n    var weightSum = arrayStat.sum(weights);\n    if (weightSum !== 0) {\n        for (i = 0, ii = means.length; i < ii; i++) {\n            means[i] /= weightSum;\n        }\n    }\n    return means;\n}\n\nfunction weightedCovariance(matrix, weights, means, dimension) {\n    dimension = dimension || 0;\n    means = means || weightedMean(matrix, weights, dimension);\n    var s1 = 0, s2 = 0;\n    for (var i = 0, ii = weights.length; i < ii; i++) {\n        s1 += weights[i];\n        s2 += weights[i] * weights[i];\n    }\n    var factor = s1 / (s1 * s1 - s2);\n    return weightedScatter(matrix, weights, means, factor, dimension);\n}\n\nfunction weightedScatter(matrix, weights, means, factor, dimension) {\n    dimension = dimension || 0;\n    means = means || weightedMean(matrix, weights, dimension);\n    if (typeof(factor) === 'undefined') {\n        factor = 1;\n    }\n    var rows = matrix.length;\n    if (rows === 0) {\n        return [[]];\n    }\n    var cols = matrix[0].length,\n        cov, i, j, k, s;\n\n    if (dimension === 0) {\n        cov = new Array(cols);\n        for (i = 0; i < cols; i++) {\n            cov[i] = new Array(cols);\n        }\n        for (i = 0; i < cols; i++) {\n            for (j = i; j < cols; j++) {\n                s = 0;\n                for (k = 0; k < rows; k++) {\n                    s += weights[k] * (matrix[k][j] - means[j]) * (matrix[k][i] - means[i]);\n                }\n                cov[i][j] = s * factor;\n                cov[j][i] = s * factor;\n            }\n        }\n    } else if (dimension === 1) {\n        cov = new Array(rows);\n        for (i = 0; i < rows; i++) {\n            cov[i] = new Array(rows);\n        }\n        for (i = 0; i < rows; i++) {\n            for (j = i; j < rows; j++) {\n                s = 0;\n                for (k = 0; k < cols; k++) {\n                    s += weights[k] * (matrix[j][k] - means[j]) * (matrix[i][k] - means[i]);\n                }\n                cov[i][j] = s * factor;\n                cov[j][i] = s * factor;\n            }\n        }\n    } else {\n        throw new Error('Invalid dimension');\n    }\n\n    return cov;\n}\n\nmodule.exports = {\n    entropy: entropy,\n    mean: mean,\n    standardDeviation: standardDeviation,\n    variance: variance,\n    median: median,\n    mode: mode,\n    skewness: skewness,\n    kurtosis: kurtosis,\n    standardError: standardError,\n    covariance: covariance,\n    scatter: scatter,\n    correlation: correlation,\n    zScores: zScores,\n    center: center,\n    standardize: standardize,\n    weightedVariance: weightedVariance,\n    weightedMean: weightedMean,\n    weightedCovariance: weightedCovariance,\n    weightedScatter: weightedScatter\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-savitzky-golay-generalized/node_modules/ml-stat/matrix.js","import SD from './SD';\nimport * as Filters from './filters/Filters.js';\nimport Brukerconverter from 'brukerconverter';\nimport peaks2Ranges from './peakPicking/peaks2Ranges';\nimport {SpinSystem, simulate1D} from 'nmr-simulation';\nimport impurities from './peakPicking/impurities.js';\n\n/**\n * @class NMR\n * @extends SD\n */\nexport default class NMR extends SD {\n\n    constructor(sd) {\n        super(sd);\n        // TODO: add stuff specific to NMR\n    }\n\n    /**\n     * This function creates a SD instance from the given 1D prediction\n     * @param {Array} prediction\n     * @param {object} options\n     * @return {SD}\n     */\n    static fromSignals(prediction, options = {}) {\n\n        options = Object.assign({}, {\n            nbPoints: 16 * 1024,\n            maxClusterSize: 8,\n            output: 'xy'\n        }, options);\n\n        const spinSystem = SpinSystem.fromPrediction(prediction);\n\n        spinSystem.ensureClusterSize(options);\n        var data = simulate1D(spinSystem, options);\n        return NMR.fromXY(data.x, data.y, options);\n    }\n\n    /**\n     * This function create a SD instance from xy data\n     * @param {Array} x - X data.\n     * @param {Array} y - Y data.\n     * @param {object} options - Optional parameters\n     * @return {NMR} SD instance from x and y data\n     */\n    static fromXY(x, y, options) {\n        options = Object.assign({}, options, {\n            xUnit: 'PPM',\n            yUnit: 'Intensity',\n            dataType: 'NMR SPECTRUM'\n        });\n        var spectraData = SD.fromXY(x, y, options);\n        var spectrum = spectraData.sd.spectra[0];\n\n        spectrum.observeFrequency = options.frequency || 400;\n        spectraData.putParam('observefrequency', spectrum.observeFrequency);\n        spectraData.putParam('.SOLVENTNAME', options.solvent || 'none');\n        // eslint-disable-next-line camelcase\n        spectraData.putParam('.$SW_h', Math.abs(spectrum.lastX - spectrum.firstX) * spectrum.observeFrequency);\n        spectraData.putParam('.$SW', Math.abs(spectrum.lastX - spectrum.firstX));\n        spectraData.putParam('.$TD', spectrum.nbPoints);\n        spectraData.sd.xType = options.nucleus || '1H';\n        return new NMR(spectraData.sd);\n    }\n\n\n    /**\n     * This function returns a NMR instance from Array of folders or zip file with folders\n     * @param {Array | zipFile} brukerFile - spectra data in two possible input\n     * @param {object} options - the options dependent on brukerFile input, but some parameter are permanents like:\n     * @option {boolean} xy - The spectraData should not be a oneD array but an object with x and y\n     * @option {boolean} keepSpectra - keep the spectra in 2D NMR instance\n     * @option {boolean} noContours - option to generate not generate countour plot for 2Dnmr spectra\n     * @option {string} keepRecordsRegExp - regular expressions to parse data\n     * @return {*}\n     */\n    static fromBruker(brukerFile, options) {\n        options = Object.assign({}, {xy: true, keepSpectra: true, keepRecordsRegExp: /^.+$/}, options);\n        var brukerSpectra = null;\n        if (Array.isArray(brukerFile)) {\n            brukerSpectra = Brukerconverter.converFolder(brukerFile, options);\n        } else {\n            brukerSpectra = Brukerconverter.convertZip(brukerFile, options);\n        }\n        if (brukerSpectra) {\n            return brukerSpectra.map(function (spectrum) {\n                return new NMR(spectrum);\n            });\n        }\n        return null;\n    }\n\n    /**\n     * create a SD instance with the magnitude mode spectra for 1D data.\n     * @return {NMR} absolute value spectra-data instance.\n     */\n    getMagnitude() {\n        return Filters.absoluteValue(this);\n    }\n\n    /**\n     * @private\n     * Returns the observed nucleus. A dimension parameter is accepted for compatibility with 2DNMR\n     * @param {number} dim\n     * @return {string}\n     */\n    getNucleus(dim) {\n        if (!dim || dim === 0 || dim === 1) {\n            return this.sd.xType;\n        } else {\n            return '';\n        }\n    }\n\n    /**\n     * @private\n     * Returns the solvent name.\n     * @return {string|XML}\n     */\n    getSolventName() {\n        return (this.sd.info['.SOLVENTNAME'] || this.sd.info.$SOLVENT || '').replace('<', '').replace('>', '');\n    }\n\n    /**\n     * @private\n     * Returns the observe frequency in the direct dimension\n     * @return {number}\n     */\n    observeFrequencyX() {\n        return this.sd.spectra[0].observeFrequency;\n    }\n\n    /**\n     * @private\n     * Returns the noise factor depending on the nucleus.\n     * @param {string} nucleus\n     * @return {number}\n     */\n    getNMRPeakThreshold(nucleus) {\n        if (nucleus === '1H') {\n            return 3.0;\n        }\n        if (nucleus === '13C') {\n            return 5.0;\n        }\n        return 1.0;\n    }\n\n\n    /**\n     * This function adds white noise to the the given spectraData. The intensity of the noise is\n     * calculated from the given signal to noise ratio.\n     * @param SNR Signal to noise ratio\n     * @return {NMR} this object\n     */\n    /*addNoise(SNR) {\n        //@TODO Implement addNoise filter\n    }*/\n\n\n    /**\n     *  This filter performs a linear combination of two spectraDatas.\n     * A=spec1\n     * B=spec2\n     * After to apply this filter you will get:\n     *      A=A*factor1+B*factor2\n     * if autoscale is set to 'true' then you will obtain:\n     *  A=A*factor1+B*k*factor2\n     * Where the k is a factor such that the maximum peak in A is equal to the maximum peak in spectraData2\n     * @param spec2 spectraData2\n     * @param factor1 linear factor for spec1\n     * @param factor2 linear factor for spec2\n     * @param autoscale Auto-adjust scales before combine the spectraDatas\n     * @return {NMR} this object\n     * @example spec1 = addSpectraDatas(spec1,spec2,1,-1, false) This subtract spec2 from spec1\n     */\n    /*addSpectraDatas(spec2, factor1, factor2, autoscale) {\n        //@TODO Implement addSpectraDatas filter\n\n    }*/\n\n    /**\n     * Automatically corrects the base line of a given spectraData. After this process the spectraData\n     * should have meaningful integrals.\n     * @return {NMR} this object\n     */\n    /*autoBaseline() {\n        //@TODO Implement autoBaseline filter\n    }*/\n\n    /**\n     * Fourier transforms the given spectraData (Note. no 2D handling yet) this spectraData have to be\n     * of type NMR_FID or 2DNMR_FID\n     * @return {NMR} this object\n     */\n    fourierTransform() {\n        return Filters.fourierTransform(this);\n    }\n\n    /**\n     * This filter makes an phase 1 correction that corrects the problem of the spectra that has been obtained\n     * on spectrometers using the Bruker digital filters. This method is used in cases when the BrukerSpectra\n     * filter could not find the correct number of points to perform a circular shift.\n     * The actual problem is that not all of the spectra has the necessary parameters for use only one method for\n     * correcting the problem of the Bruker digital filters.\n     * @param {number} ph1corr - Phase 1 correction value in radians.\n     * @return {NMR} this object\n     */\n    postFourierTransform(ph1corr) {\n        return Filters.phaseCorrection(0, ph1corr);\n    }\n\n    /**\n     * This function increase the size of the spectrum, filling the new positions with zero values. Doing it one\n     * could increase artificially the spectral resolution.\n     * @param {number} nPointsX - Number of new zero points in the direct dimension\n     * @param {number} nPointsY - Number of new zero points in the indirect dimension\n     * @return {NMR} this object\n     */\n    zeroFilling(nPointsX, nPointsY) {\n        return Filters.zeroFilling(this, nPointsX, nPointsY);\n    }\n\n    /**\n     * Applies a baseline correction as described in J Magn Resonance 183 (2006) 145-151 10.1016/j.jmr.2006.07.013\n     * The needed parameters are the wavelet scale and the lambda used in the whittaker smoother.\n     * @param waveletScale To be described\n     * @param whittakerLambda To be described\n     * @return {NMR} this object\n     */\n    /*haarWhittakerBaselineCorrection(waveletScale, whittakerLambda) {\n        //@TODO Implement haarWhittakerBaselineCorrection filter\n    }*/\n\n    /**\n     * Applies a baseline correction as described in J Magn Resonance 183 (2006) 145-151 10.1016/j.jmr.2006.07.013\n     * The needed parameters are the Wavelet scale and the lambda used in the Whittaker smoother.\n     * @param waveletScale To be described\n     * @param whittakerLambda To be described\n     * @param ranges A string containing the ranges of no signal.\n     * @return {NMR} this object\n     */\n    /*whittakerBaselineCorrection(whittakerLambda, ranges) {\n        //@TODO Implement whittakerBaselineCorrection filter\n    }*/\n\n    /**\n     * This filter applies a circular shift(phase 1 correction in the time domain) to an NMR FID spectrum that\n     * have been obtained on spectrometers using the Bruker digital filters. The amount of shift depends on the\n     * parameters DECIM and DSPFVS. This spectraData have to be of type NMR_FID\n     * @return {NMR} this object\n     */\n    brukerFilter() {\n        return Filters.digitalFilter(this, {brukerFilter: true});\n    }\n\n    /**\n     * This filter applies a circular shift(phase 1 correction in the time domain) to an NMR FID spectrum that\n     * have been obtained on spectrometers using the Bruker digital filters. The amount of shift depends on the\n     * parameters DECIM and DSPFVS. This spectraData have to be of type NMR_FID\n     * @param {object} options ->\n     * nbPoints: The number of points to shift. Positive values will shift the values to the rigth\n     * and negative values will do to the left.\n     * @return {NMR} this object\n     */\n    digitalFilter(options) {\n        return Filters.digitalFilter(this, options);\n    }\n\n    /**\n     * That decodes an Echo-Antiecho 2D spectrum.\n     * @return {NMR} this object\n     */\n    echoAntiechoFilter() {\n        //@TODO Implement echoAntiechoFilter filter\n        return this;\n    }\n\n    /**\n     * This function apply a Standard Normal Variate Transformation over the given spectraData. Mainly used for IR spectra.\n     * @return {NMR} this object\n     */\n    SNVFilter() {\n        //@TODO Implement SNVFilter\n        return this;\n    }\n\n    /**\n     * This function applies a power to all the Y values. If the power is less than 1 and the spectrum has negative values,\n     * it will be shifted so that the lowest value is zero\n     * @param {number} power - The power value to apply\n     * @return {NMR} this object\n     */\n    powerFilter(power) {\n        var minY = this.getMinY();\n        if (power < 1 && minY < 0) {\n            this.YShift(-1 * minY);\n            //console.warn('SD.powerFilter: The spectrum had negative values and was automatically shifted before applying the function.');\n        }\n        //@TODO Implement powerFilter\n        return this;\n    }\n\n    /**\n     * This function applies a log to all the Y values.<br>If the spectrum has negative or zero values, it will be shifted so that the lowest value is 1\n     * @param   base    The base to use\n     * @return this object\n     */\n    /*logarithmFilter(base) {\n        var minY = this.getMinY();\n        if (minY <= 0) {\n            this.yShift((-1 * minY) + 1);\n            //console.warn('SD.logarithmFilter: The spectrum had negative values and was automatically shifted before applying the function.');\n        }\n        //@TODO Implement logarithmFilter filter\n    }*/\n\n\n    /**\n     * This function correlates the given spectraData with the given vector func. The correlation\n     * operation (*) is defined as:\n     *\n     *                    __ inf\n     *  c(x)=f(x)(*)g(x)= \\        f(x)*g(x+i)\n     *                   ./\n     *                    -- i=-inf\n     * @param func A double array containing the function to correlates the spectraData\n     * @return this object\n     * @example var smoothedSP = SD.correlationFilter(spectraData,[1,1]) returns a smoothed version of the\n     * given spectraData.\n     */\n    /*correlationFilter(func) {\n        //@TODO Implement correlationFilter filter\n    }*/\n\n    /**\n     * Applies the phase correction (phi0,phi1) to a Fourier transformed spectraData. The angles must be given in radians.\n     * @param {number} phi0 - the value of Zero order phase correction\n     * @param {number} phi1 - the value of first order phase correction\n     * @return {NMR}\n     */\n    phaseCorrection(phi0, phi1) {\n        return Filters.phaseCorrection(this, phi0, phi1);\n    }\n\n    /**\n     * This function determines automatically the correct parameters phi0 and phi1 for a phaseCorrection\n     * function and applies it.\n     * @return {NMR}\n     */\n    /*automaticPhase() {\n        //@TODO Implement automaticPhase filter\n    }*/\n\n\n    /**\n     * This function process the given spectraData and tries to determine the NMR signals. Returns an NMRSignal1D array\n     * containing all the detected 1D-NMR Signals\n     * @param {object} options - A JSONObject containing the optional parameters:\n     * @option fromX:   Lower limit.\n     * @option toX:     Upper limit.\n     * @option threshold: The minimum intensity to consider a peak as a signal, expressed as a percentage of the highest peak.\n     * @option stdev: Number of standard deviation of the noise for the threshold calculation if a threshold is not specified.\n     * @return {*}\n     */\n    getRanges(options = {}) {\n        if (this.ranges) {\n            return this.ranges;\n        } else {\n            var peaks = this.getPeaks(options);\n            var ranges = peaks2Ranges(this, peaks, options);\n            return ranges;\n        }\n    }\n\n    /**\n     * This function compute again the process of the given spectraData and tries to determine the NMR signals.\n     * Returns an NMRSignal1D array containing all the detected 1D-NMR Signals\n     * @param {object} options - A JSONObject containing the optional parameters:\n     * @option fromX:   Lower limit.\n     * @option toX:     Upper limit.\n     * @option threshold: The minimum intensity to consider a peak as a signal, expressed as a percentage of the highest peak.\n     * @option stdev: Number of standard deviation of the noise for the threshold calculation if a threshold is not specified.\n     * @return {null|*}\n     */\n    createRanges(options) {\n        this.ranges = null;\n        this.peaks = null;\n        this.ranges = this.getRanges(options);\n        return this.ranges;\n    }\n\n    /**\n     * Return the information with respect to residual signal solvent\n     * @param {string} solvent - solvent name\n     * @return {object}\n     */\n    getResidual(solvent) {\n        return this.getImpurity(solvent, 'solvent_residual_peak');\n    }\n\n    /**\n     * Return an object with possible impurities in a NMR spectrum with respect to a solvent\n     * @param {string} solvent - solvent name\n     * @return {object}\n     */\n    getImpurities(solvent) {\n        return this.getImpurity(solvent);\n    }\n\n    /**\n     * Return the impurity information with respect to a solvent\n     * @param {string} solvent - solvent name\n     * @param {string} impurity - impurity name\n     * @return {object}\n     */\n    getImpurity(solvent, impurity = null) {\n        solvent = solvent.toLowerCase();\n        if (solvent === '(cd3)2so') solvent = 'dmso';\n        var result = impurities[solvent];\n        if (impurity) {\n            result = result[impurity.toLocaleLowerCase()];\n        }\n        return result;\n    }\n\n    /**\n     * Change the intensities of a respective impurities signals based on peak picking and solvent impurities\n     * @param {string} solvent - solvent name\n     * @param {object} [options = {}] - object may have the peak picking options if this.peaks does not exist.\n     * @param {string} [options.impurity = null] - options to fill a particular impurity of the solvent some thing like 'solvent_residual_peak'\n     * @param {number} [options.value = 0] - value to fill\n     * @param {number} [options.error = 0.025] - tolerance to find the chemical shift of the impurities.\n     */\n    fillImpurity(solvent, options = {}) {\n        const {\n            impurity = null,\n            value = 0,\n            error = 0.025\n        } = options;\n\n        const solventImpurities = this.getImpurities(solvent, impurity);\n        if (!solventImpurities) {\n            throw Error('The solvent does not mach with a impurities into the list');\n        }\n\n        let peaks = this.getPeaks(options);\n\n        peaks.forEach((peak) => {\n            for (let impurity in solventImpurities) {\n                for (let signal of impurity) {\n                    if (peak.width + error > Math.abs(signal.shift - peak.x)) {\n                        let from = peak.x + peak.width;\n                        let to = peak.x - peak.width;\n                        this.fill(from, to, value);\n                    }\n                }\n            }\n        });\n    }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/spectra-data/src/NMR.js","import fft from 'ml-fft';\n\n/**\n * This function make a fourier transformation to each FID withing a SD instance\n * @param {SD} spectraData - SD instance\n * @returns {SD} return SD with spectrum and FID\n */\n\nexport default function fourierTransform(spectraData) {\n\n    var nbPoints = spectraData.getNbPoints();\n    var nSubSpectra = spectraData.getNbSubSpectra() / 2;\n    var spectraType = 'NMR SPECTRUM';//spectraData.TYPE_NMR_SPECTRUM;\n    var FFT = fft.FFT;\n    if (nSubSpectra > 1) {\n        spectraType = 'nD NMR SPECTRUM';\n    }//spectraData.TYPE_2DNMR_SPECTRUM;\n\n    FFT.init(nbPoints);\n\n    var fcor = spectraData.getParamDouble('$FCOR', 0.0);\n    //var tempArray = new Array(nbPoints / 2);\n    for (var iSubSpectra = 0; iSubSpectra < nSubSpectra; iSubSpectra++) {\n        var re = spectraData.getYData(2 * iSubSpectra);\n        var im = spectraData.getYData(2 * iSubSpectra + 1);\n\n        re[0] *= fcor;\n        im[0] *= fcor;\n\n        FFT.fft(re, im);\n        re = re.concat(re.slice(0, (nbPoints + 1) / 2)); // TODO why +1 ???\n        re.splice(0, (nbPoints + 1) / 2);\n        im = im.concat(im.slice(0, (nbPoints + 1) / 2));\n        im.splice(0, (nbPoints + 1) / 2);\n\n        spectraData.setActiveElement(2 * iSubSpectra);\n        updateSpectra(spectraData, spectraType);\n\n        spectraData.setActiveElement(2 * iSubSpectra + 1);\n        updateSpectra(spectraData, spectraType);\n    }\n    //TODO For Alejandro\n    //Now we can try to apply the FFt on the second dimension\n    if (spectraData.is2D()) {\n        throw new Error('FT of 2D is not implemented');\n        //var mode = spectraData.getParam('.ACQUISITION SCHEME');\n        /*switch (mode) {\n            case 1://\"State-TPP\"\n                break;\n            case 2://State\n                break;\n            case 3://Echo-Antiecho\n                break;\n                //QF\n                //Does not transform in the indirect dimension\n        }*/\n    }\n    spectraData.setActiveElement(0);\n    return spectraData;\n}\n\nfunction updateSpectra(spectraData, spectraType) {\n    var baseFrequency = spectraData.getParamDouble('$BF1', NaN);\n    var spectralFrequency = spectraData.getParamDouble('$SFO1', NaN);\n    var spectralWidth = spectraData.getParamDouble('$SW', NaN);\n    var xMiddle = ((spectralFrequency - baseFrequency) / baseFrequency) * 1e6;\n    var dx = 0.5 * spectralWidth * spectralFrequency / baseFrequency;\n\n    spectraData.setDataType(spectraType);\n    spectraData.setFirstX(xMiddle + dx);\n    spectraData.setLastX(xMiddle - dx);\n    spectraData.setXUnits('PPM');\n\n    var x = spectraData.getXData();\n    var tmp = xMiddle + dx;\n    dx = -2 * dx / (x.length - 1);\n\n    for (var i = 0; i < x.length; i++) {\n        x[i] = tmp;\n        tmp += dx;\n    }\n\n    //TODO update minmax in Y axis\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/spectra-data/src/filters/fourierTransform.js","'use strict'\n\nvar FFT = require('./fftlib');\n\nvar FFTUtils= {\n    DEBUG : false,\n\n    /**\n     * Calculates the inverse of a 2D Fourier transform\n     *\n     * @param ft\n     * @param ftRows\n     * @param ftCols\n     * @return\n     */\n    ifft2DArray : function(ft, ftRows, ftCols){\n        var tempTransform = new Array(ftRows * ftCols);\n        var nRows = ftRows / 2;\n        var nCols = (ftCols - 1) * 2;\n        // reverse transform columns\n        FFT.init(nRows);\n        var tmpCols = {re: new Array(nRows), im: new Array(nRows)};\n        for (var iCol = 0; iCol < ftCols; iCol++) {\n            for (var iRow = nRows - 1; iRow >= 0; iRow--) {\n                tmpCols.re[iRow] = ft[(iRow * 2) * ftCols + iCol];\n                tmpCols.im[iRow] = ft[(iRow * 2 + 1) * ftCols + iCol];\n            }\n            //Unnormalized inverse transform\n            FFT.bt(tmpCols.re, tmpCols.im);\n            for (var iRow = nRows - 1; iRow >= 0; iRow--) {\n                tempTransform[(iRow * 2) * ftCols + iCol] = tmpCols.re[iRow];\n                tempTransform[(iRow * 2 + 1) * ftCols + iCol] = tmpCols.im[iRow];\n            }\n        }\n\n        // reverse row transform\n        var finalTransform = new Array(nRows * nCols);\n        FFT.init(nCols);\n        var tmpRows = {re: new Array(nCols), im: new Array(nCols)};\n        var scale = nCols * nRows;\n        for (var iRow = 0; iRow < ftRows; iRow += 2) {\n            tmpRows.re[0] = tempTransform[iRow * ftCols];\n            tmpRows.im[0] = tempTransform[(iRow + 1) * ftCols];\n            for (var iCol = 1; iCol < ftCols; iCol++) {\n                tmpRows.re[iCol] = tempTransform[iRow * ftCols + iCol];\n                tmpRows.im[iCol] = tempTransform[(iRow + 1) * ftCols + iCol];\n                tmpRows.re[nCols - iCol] = tempTransform[iRow * ftCols + iCol];\n                tmpRows.im[nCols - iCol] = -tempTransform[(iRow + 1) * ftCols + iCol];\n            }\n            //Unnormalized inverse transform\n            FFT.bt(tmpRows.re, tmpRows.im);\n\n            var indexB = (iRow / 2) * nCols;\n            for (var iCol = nCols - 1; iCol >= 0; iCol--) {\n                finalTransform[indexB + iCol] = tmpRows.re[iCol] / scale;\n            }\n        }\n        return finalTransform;\n    },\n    /**\n     * Calculates the fourier transform of a matrix of size (nRows,nCols) It is\n     * assumed that both nRows and nCols are a power of two\n     *\n     * On exit the matrix has dimensions (nRows * 2, nCols / 2 + 1) where the\n     * even rows contain the real part and the odd rows the imaginary part of the\n     * transform\n     * @param data\n     * @param nRows\n     * @param nCols\n     * @return\n     */\n    fft2DArray:function(data, nRows, nCols, opt) {\n        var options = Object.assign({},{inplace:true})\n        var ftCols = (nCols / 2 + 1);\n        var ftRows = nRows * 2;\n        var tempTransform = new Array(ftRows * ftCols);\n        FFT.init(nCols);\n        // transform rows\n        var tmpRows = {re: new Array(nCols), im: new Array(nCols)};\n        var row1 = {re: new Array(nCols), im: new Array(nCols)}\n        var row2 = {re: new Array(nCols), im: new Array(nCols)}\n        var index, iRow0, iRow1, iRow2, iRow3;\n        for (var iRow = 0; iRow < nRows / 2; iRow++) {\n            index = (iRow * 2) * nCols;\n            tmpRows.re = data.slice(index, index + nCols);\n\n            index = (iRow * 2 + 1) * nCols;\n            tmpRows.im = data.slice(index, index + nCols);\n\n            FFT.fft1d(tmpRows.re, tmpRows.im);\n\n            this.reconstructTwoRealFFT(tmpRows, row1, row2);\n            //Now lets put back the result into the output array\n            iRow0 = (iRow * 4) * ftCols;\n            iRow1 = (iRow * 4 + 1) * ftCols;\n            iRow2 = (iRow * 4 + 2) * ftCols;\n            iRow3 = (iRow * 4 + 3) * ftCols;\n            for (var k = ftCols - 1; k >= 0; k--) {\n                tempTransform[iRow0 + k] = row1.re[k];\n                tempTransform[iRow1 + k] = row1.im[k];\n                tempTransform[iRow2 + k] = row2.re[k];\n                tempTransform[iRow3 + k] = row2.im[k];\n            }\n        }\n\n        //console.log(tempTransform);\n        row1 = null;\n        row2 = null;\n        // transform columns\n        var finalTransform = new Array(ftRows * ftCols);\n\n        FFT.init(nRows);\n        var tmpCols = {re: new Array(nRows), im: new Array(nRows)};\n        for (var iCol = ftCols - 1; iCol >= 0; iCol--) {\n            for (var iRow = nRows - 1; iRow >= 0; iRow--) {\n                tmpCols.re[iRow] = tempTransform[(iRow * 2) * ftCols + iCol];\n                tmpCols.im[iRow] = tempTransform[(iRow * 2 + 1) * ftCols + iCol];\n                //TODO Chech why this happens\n                if(isNaN(tmpCols.re[iRow])){\n                    tmpCols.re[iRow]=0;\n                }\n                if(isNaN(tmpCols.im[iRow])){\n                    tmpCols.im[iRow]=0;\n                }\n            }\n            FFT.fft1d(tmpCols.re, tmpCols.im);\n            for (var iRow = nRows - 1; iRow >= 0; iRow--) {\n                finalTransform[(iRow * 2) * ftCols + iCol] = tmpCols.re[iRow];\n                finalTransform[(iRow * 2 + 1) * ftCols + iCol] = tmpCols.im[iRow];\n            }\n        }\n\n        //console.log(finalTransform);\n        return finalTransform;\n\n    },\n    /**\n     *\n     * @param fourierTransform\n     * @param realTransform1\n     * @param realTransform2\n     *\n     * Reconstructs the individual Fourier transforms of two simultaneously\n     * transformed series. Based on the Symmetry relationships (the asterisk\n     * denotes the complex conjugate)\n     *\n     * F_{N-n} = F_n^{*} for a purely real f transformed to F\n     *\n     * G_{N-n} = G_n^{*} for a purely imaginary g transformed to G\n     *\n     */\n    reconstructTwoRealFFT:function(fourierTransform, realTransform1, realTransform2) {\n        var length = fourierTransform.re.length;\n\n        // the components n=0 are trivial\n        realTransform1.re[0] = fourierTransform.re[0];\n        realTransform1.im[0] = 0.0;\n        realTransform2.re[0] = fourierTransform.im[0];\n        realTransform2.im[0] = 0.0;\n        var rm, rp, im, ip, j;\n        for (var i = length / 2; i > 0; i--) {\n            j = length - i;\n            rm = 0.5 * (fourierTransform.re[i] - fourierTransform.re[j]);\n            rp = 0.5 * (fourierTransform.re[i] + fourierTransform.re[j]);\n            im = 0.5 * (fourierTransform.im[i] - fourierTransform.im[j]);\n            ip = 0.5 * (fourierTransform.im[i] + fourierTransform.im[j]);\n            realTransform1.re[i] = rp;\n            realTransform1.im[i] = im;\n            realTransform1.re[j] = rp;\n            realTransform1.im[j] = -im;\n            realTransform2.re[i] = ip;\n            realTransform2.im[i] = -rm;\n            realTransform2.re[j] = ip;\n            realTransform2.im[j] = rm;\n        }\n    },\n\n    /**\n     * In place version of convolute 2D\n     *\n     * @param ftSignal\n     * @param ftFilter\n     * @param ftRows\n     * @param ftCols\n     * @return\n     */\n    convolute2DI:function(ftSignal, ftFilter, ftRows, ftCols) {\n        var re, im;\n        for (var iRow = 0; iRow < ftRows / 2; iRow++) {\n            for (var iCol = 0; iCol < ftCols; iCol++) {\n                //\n                re = ftSignal[(iRow * 2) * ftCols + iCol]\n                    * ftFilter[(iRow * 2) * ftCols + iCol]\n                    - ftSignal[(iRow * 2 + 1) * ftCols + iCol]\n                    * ftFilter[(iRow * 2 + 1) * ftCols + iCol];\n                im = ftSignal[(iRow * 2) * ftCols + iCol]\n                    * ftFilter[(iRow * 2 + 1) * ftCols + iCol]\n                    + ftSignal[(iRow * 2 + 1) * ftCols + iCol]\n                    * ftFilter[(iRow * 2) * ftCols + iCol];\n                //\n                ftSignal[(iRow * 2) * ftCols + iCol] = re;\n                ftSignal[(iRow * 2 + 1) * ftCols + iCol] = im;\n            }\n        }\n    },\n    /**\n     *\n     * @param data\n     * @param kernel\n     * @param nRows\n     * @param nCols\n     * @returns {*}\n     */\n    convolute:function(data, kernel, nRows, nCols, opt) {\n        var ftSpectrum = new Array(nCols * nRows);\n        for (var i = 0; i<nRows * nCols; i++) {\n            ftSpectrum[i] = data[i];\n        }\n\n        ftSpectrum = this.fft2DArray(ftSpectrum, nRows, nCols);\n\n\n        var dimR = kernel.length;\n        var dimC = kernel[0].length;\n        var ftFilterData = new Array(nCols * nRows);\n        for(var i = 0; i < nCols * nRows; i++) {\n            ftFilterData[i] = 0;\n        }\n\n        var iRow, iCol;\n        var shiftR = Math.floor((dimR - 1) / 2);\n        var shiftC = Math.floor((dimC - 1) / 2);\n        for (var ir = 0; ir < dimR; ir++) {\n            iRow = (ir - shiftR + nRows) % nRows;\n            for (var ic = 0; ic < dimC; ic++) {\n                iCol = (ic - shiftC + nCols) % nCols;\n                ftFilterData[iRow * nCols + iCol] = kernel[ir][ic];\n            }\n        }\n        ftFilterData = this.fft2DArray(ftFilterData, nRows, nCols);\n\n        var ftRows = nRows * 2;\n        var ftCols = nCols / 2 + 1;\n        this.convolute2DI(ftSpectrum, ftFilterData, ftRows, ftCols);\n\n        return this.ifft2DArray(ftSpectrum, ftRows, ftCols);\n    },\n\n\n    toRadix2:function(data, nRows, nCols) {\n        var i, j, irow, icol;\n        var cols = nCols, rows = nRows, prows=0, pcols=0;\n        if(!(nCols !== 0 && (nCols & (nCols - 1)) === 0)) {\n            //Then we have to make a pading to next radix2\n            cols = 0;\n            while((nCols>>++cols)!=0);\n            cols=1<<cols;\n            pcols = cols-nCols;\n        }\n        if(!(nRows !== 0 && (nRows & (nRows - 1)) === 0)) {\n            //Then we have to make a pading to next radix2\n            rows = 0;\n            while((nRows>>++rows)!=0);\n            rows=1<<rows;\n            prows = (rows-nRows)*cols;\n        }\n        if(rows==nRows&&cols==nCols)//Do nothing. Returns the same input!!! Be careful\n            return {data:data, rows:nRows, cols:nCols};\n\n        var output = new Array(rows*cols);\n        var shiftR = Math.floor((rows-nRows)/2)-nRows;\n        var shiftC = Math.floor((cols-nCols)/2)-nCols;\n\n        for( i = 0; i < rows; i++) {\n            irow = i*cols;\n            icol = ((i-shiftR) % nRows) * nCols;\n            for( j = 0; j < cols; j++) {\n                output[irow+j] = data[(icol+(j-shiftC) % nCols) ];\n            }\n        }\n        return {data:output, rows:rows, cols:cols};\n    },\n\n    /**\n     * Crop the given matrix to fit the corresponding number of rows and columns\n     */\n    crop:function(data, rows, cols, nRows, nCols, opt) {\n\n        if(rows == nRows && cols == nCols)//Do nothing. Returns the same input!!! Be careful\n            return data;\n\n        var options = Object.assign({}, opt);\n\n        var output = new Array(nCols*nRows);\n\n        var shiftR = Math.floor((rows-nRows)/2);\n        var shiftC = Math.floor((cols-nCols)/2);\n        var destinyRow, sourceRow, i, j;\n        for( i = 0; i < nRows; i++) {\n            destinyRow = i*nCols;\n            sourceRow = (i+shiftR)*cols;\n            for( j = 0;j < nCols; j++) {\n                output[destinyRow+j] = data[sourceRow+(j+shiftC)];\n            }\n        }\n\n        return output;\n    }\n}\n\nmodule.exports = FFTUtils;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-fft/src/FFTUtils.js","/**\n * This function make a zero filling to each Active element in a SD instance.\n * @param {SD} spectraData instance.\n * @param {number} zeroFillingX - number of points that FID will have, if is it lower\n * than initial number of points, the FID will be spliced\n * @return {SD}\n */\nexport default function zeroFilling(spectraData, zeroFillingX) {\n    var nbSubSpectra = spectraData.getNbSubSpectra();\n    //var zeroPadding = spectraData.getParamDouble(\"$$ZEROPADDING\", 0);\n    var nbXPoints, lastX, deltaX, k, x, y;\n    if (zeroFillingX !== 0) {\n        for (var iSubSpectra = 0; iSubSpectra < nbSubSpectra; iSubSpectra++) {\n            spectraData.setActiveElement(iSubSpectra);\n            nbXPoints = spectraData.getNbPoints();\n            y = spectraData.getYData();\n            x = spectraData.getXData();\n            lastX = spectraData.getLastX();\n            deltaX = (lastX - x[0]) / (nbXPoints - 1);\n            for (k = nbXPoints; k < zeroFillingX; k++) {\n                y.push(0);\n                x.push(lastX + deltaX);\n            }\n            if (zeroFillingX < nbXPoints) {\n                y.splice(zeroFillingX, y.length - 1);\n                x.splice(zeroFillingX, x.length - 1);\n            }\n            spectraData.setFirstX(x[0]);\n            spectraData.setLastX(x[x.length - 1]);\n        }\n    }\n\n    spectraData.setActiveElement(0);\n    return spectraData;\n    // @TODO implement zeroFillingY for 2D spectra\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/spectra-data/src/filters/zeroFilling.js","/**\n * Phase correction filter\n * @param {SD} spectraData - SD instance\n * @param {number} [phi0 = 0] - value\n * @param {number} [phi1 = 0] - value\n * @return {SD} returns the modified spectraData\n */\nexport default function phaseCorrection(spectraData, phi0, phi1) {\n\n    phi0 = Number.isFinite(phi0) ? phi0 : 0;\n    phi1 = Number.isFinite(phi1) ? phi1 : 0;\n\n    var nbPoints = spectraData.getNbPoints();\n    var reData = spectraData.getYData(0);\n    var imData = spectraData.getYData(1);\n\n    var delta = phi1 / nbPoints;\n    var alpha = 2 * Math.pow(Math.sin(delta / 2), 2);\n    var beta = Math.sin(delta);\n    var cosTheta = Math.cos(phi0);\n    var sinTheta = Math.sin(phi0);\n    var cosThetaNew, sinThetaNew;\n\n    var reTmp, imTmp;\n    var index;\n    for (var i = 0; i < nbPoints; i++) {\n        index = nbPoints - i - 1;\n        index = i;\n        reTmp = reData[index] * cosTheta - imData[index] * sinTheta;\n        imTmp = reData[index] * sinTheta + imData[index] * cosTheta;\n        reData[index] = reTmp;\n        imData[index] = imTmp;\n        // calculate angles i+1 from i\n        cosThetaNew = cosTheta - (alpha * cosTheta + beta * sinTheta);\n        sinThetaNew = sinTheta - (alpha * sinTheta - beta * cosTheta);\n        cosTheta = cosThetaNew;\n        sinTheta = sinThetaNew;\n    }\n\n    spectraData.resetMinMax();\n    spectraData.putParam('PHC0', phi0);\n    spectraData.putParam('PHC1', phi1);\n\n    return spectraData;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/spectra-data/src/filters/phaseCorrection.js","import rotate from './rotate';\n\nexport default function digitalFilter(spectraData, options) {\n    let activeElement = spectraData.activeElement;\n    var nbPoints = 0;\n    if (options.nbPoints) {\n        nbPoints = options.nbPoints;\n    } else {\n        if (options.brukerFilter) {\n            //TODO Determine the number of points to shift, or the ph1 correction\n            //based on DECIM and DSPSVF parameters\n            nbPoints = 0;\n        }\n    }\n\n    var nbSubSpectra = spectraData.getNbSubSpectra();\n    if (nbPoints !== 0) {\n        for (var iSubSpectra = 0; iSubSpectra < nbSubSpectra; iSubSpectra++) {\n            spectraData.setActiveElement(iSubSpectra);\n            rotate(spectraData.getYData(), nbPoints);\n            if (options.rotateX) {\n                rotate(spectraData.getXData(), nbPoints);\n                spectraData.setFirstX(spectraData.getX(0));\n                spectraData.setLastX(spectraData.getX(spectraData.getNbPoints() - 1));\n            }\n        }\n    }\n    spectraData.setActiveElement(activeElement);\n    return spectraData;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/spectra-data/src/filters/digitalFilter.js","/**\n * This function performs a circular shift of the input object without realocating memory.\n * Positive values of shifts will shift to the right and negative values will do to the left\n * @example rotate([1,2,3,4],1) -> [4,1,2,3]\n * @example rotate([1,2,3,4],-1) -> [2,3,4,1]\n * @param {Array} array - the array that will be rotated\n * @param {number} shift\n */\nexport default function rotate(array, shift) {\n    var nbPoints = array.length;\n    //Lets calculate the lest amount of points to shift.\n    //It decreases the amount of validations in the loop\n    shift = shift % nbPoints;\n\n    if (Math.abs(shift) > nbPoints / 2) {\n        shift = shift > 0 ? shift - nbPoints : shift + nbPoints;\n    }\n\n    if (shift !== 0) {\n        var currentIndex = 0;\n        var nextIndex = shift;\n        var toMove = nbPoints;\n        var current = array[currentIndex];\n        var next;\n        var lastFirstIndex = shift;\n        var direction = shift > 0 ? 1 : -1;\n\n        while (toMove > 0) {\n            nextIndex = putInRange(nextIndex, nbPoints);\n            next = array[nextIndex];\n            array[nextIndex] = current;\n            nextIndex += shift;\n            current = next;\n            toMove--;\n\n            if (nextIndex === lastFirstIndex) {\n                nextIndex = putInRange(nextIndex + direction, nbPoints);\n                lastFirstIndex = nextIndex;\n                currentIndex = putInRange(nextIndex - shift, nbPoints);\n                current = array[currentIndex];\n            }\n        }\n    }\n}\n/**\n * Put a new value in the range\n * @param {number} value\n * @param {number} nbPoints\n * @return {*}\n * @private\n */\nfunction putInRange(value, nbPoints) {\n    if (value < 0) {\n        value += nbPoints;\n    }\n    if (value >= nbPoints) {\n        value -= nbPoints;\n    }\n    return value;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/spectra-data/src/filters/rotate.js","import {NMR} from '../index';\n\nexport default function absoluteValue(spectrum) {\n    if (spectrum.is2D()) new TypeError('The data should be one dimensional');\n    if (spectrum.getXUnits(0) !== 'ppm') new TypeError('Should be processed data');\n    if (spectrum.getXUnits(1) !== 'Hz') new TypeError('The data has not imaginary part');\n\n    let re = spectrum.getYData(0);\n    let im = spectrum.getYData(1);\n\n    let result = JSON.parse(JSON.stringify(spectrum.sd));\n\n    result.spectra.splice(1);\n    result.spectra[0].data[0].y = re.map((val, index) => {\n        let imValSquare = Math.pow(im[index], 2);\n        return Math.sqrt(imValSquare + val * val);\n    });\n\n    return new NMR(result);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/spectra-data/src/filters/absoluteValue.js","'use strict';\n\nconst defaultByteLength = 1024 * 8;\nconst charArray = [];\n\nclass IOBuffer {\n    constructor(data, options) {\n        options = options || {};\n        if (data === undefined) {\n            data = defaultByteLength;\n        }\n        if (typeof data === 'number') {\n            data = new ArrayBuffer(data);\n        }\n        let length = data.byteLength;\n        const offset = options.offset ? options.offset>>>0 : 0;\n        if (data.buffer) {\n            length = data.byteLength - offset;\n            if (data.byteLength !== data.buffer.byteLength) { // Node.js buffer from pool\n                data = data.buffer.slice(data.byteOffset + offset, data.byteOffset + data.byteLength);\n            } else if (offset) {\n                data = data.buffer.slice(offset);\n            } else {\n                data = data.buffer;\n            }\n        }\n        this.buffer = data;\n        this.length = length;\n        this.byteLength = length;\n        this.byteOffset = 0;\n        this.offset = 0;\n        this.littleEndian = true;\n        this._data = new DataView(this.buffer);\n        this._increment = length || defaultByteLength;\n        this._mark = 0;\n    }\n\n    available(byteLength) {\n        if (byteLength === undefined) byteLength = 1;\n        return (this.offset + byteLength) <= this.length;\n    }\n\n    isLittleEndian() {\n        return this.littleEndian;\n    }\n\n    setLittleEndian() {\n        this.littleEndian = true;\n    }\n\n    isBigEndian() {\n        return !this.littleEndian;\n    }\n\n    setBigEndian() {\n        this.littleEndian = false;\n    }\n\n    skip(n) {\n        if (n === undefined) n = 1;\n        this.offset += n;\n    }\n\n    seek(offset) {\n        this.offset = offset;\n    }\n\n    mark() {\n        this._mark = this.offset;\n    }\n\n    reset() {\n        this.offset = this._mark;\n    }\n\n    rewind() {\n        this.offset = 0;\n    }\n\n    ensureAvailable(byteLength) {\n        if (byteLength === undefined) byteLength = 1;\n        if (!this.available(byteLength)) {\n            const newIncrement = this._increment + this._increment;\n            this._increment = newIncrement;\n            const newLength = this.length + newIncrement;\n            const newArray = new Uint8Array(newLength);\n            newArray.set(new Uint8Array(this.buffer));\n            this.buffer = newArray.buffer;\n            this.length = newLength;\n            this._data = new DataView(this.buffer);\n        }\n    }\n\n    readBoolean() {\n        return this.readUint8() !== 0;\n    }\n\n    readInt8() {\n        return this._data.getInt8(this.offset++);\n    }\n\n    readUint8() {\n        return this._data.getUint8(this.offset++);\n    }\n\n    readByte() {\n        return this.readUint8();\n    }\n\n    readBytes(n) {\n        if (n === undefined) n = 1;\n        var bytes = new Uint8Array(n);\n        for (var i = 0; i < n; i++) {\n            bytes[i] = this.readByte();\n        }\n        return bytes;\n    }\n\n    readInt16() {\n        var value = this._data.getInt16(this.offset, this.littleEndian);\n        this.offset += 2;\n        return value;\n    }\n\n    readUint16() {\n        var value = this._data.getUint16(this.offset, this.littleEndian);\n        this.offset += 2;\n        return value;\n    }\n\n    readInt32() {\n        var value = this._data.getInt32(this.offset, this.littleEndian);\n        this.offset += 4;\n        return value;\n    }\n\n    readUint32() {\n        var value = this._data.getUint32(this.offset, this.littleEndian);\n        this.offset += 4;\n        return value;\n    }\n\n    readFloat32() {\n        var value = this._data.getFloat32(this.offset, this.littleEndian);\n        this.offset += 4;\n        return value;\n    }\n\n    readFloat64() {\n        var value = this._data.getFloat64(this.offset, this.littleEndian);\n        this.offset += 8;\n        return value;\n    }\n\n    readChar() {\n        return String.fromCharCode(this.readInt8());\n    }\n\n    readChars(n) {\n        if (n === undefined) n = 1;\n        charArray.length = n;\n        for (var i = 0; i < n; i++) {\n            charArray[i] = this.readChar();\n        }\n        return charArray.join('');\n    }\n\n    writeBoolean(bool) {\n        this.writeUint8(bool ? 0xff : 0x00);\n    }\n\n    writeInt8(value) {\n        this.ensureAvailable(1);\n        this._data.setInt8(this.offset++, value);\n    }\n\n    writeUint8(value) {\n        this.ensureAvailable(1);\n        this._data.setUint8(this.offset++, value);\n    }\n\n    writeByte(value) {\n        this.writeUint8(value);\n    }\n\n    writeBytes(bytes) {\n        this.ensureAvailable(bytes.length);\n        for (var i = 0; i < bytes.length; i++) {\n            this._data.setUint8(this.offset++, bytes[i]);\n        }\n    }\n\n    writeInt16(value) {\n        this.ensureAvailable(2);\n        this._data.setInt16(this.offset, value, this.littleEndian);\n        this.offset += 2;\n    }\n\n    writeUint16(value) {\n        this.ensureAvailable(2);\n        this._data.setUint16(this.offset, value, this.littleEndian);\n        this.offset += 2;\n    }\n\n    writeInt32(value) {\n        this.ensureAvailable(4);\n        this._data.setInt32(this.offset, value, this.littleEndian);\n        this.offset += 4;\n    }\n\n    writeUint32(value) {\n        this.ensureAvailable(4);\n        this._data.setUint32(this.offset, value, this.littleEndian);\n        this.offset += 4;\n    }\n\n    writeFloat32(value) {\n        this.ensureAvailable(4);\n        this._data.setFloat32(this.offset, value, this.littleEndian);\n        this.offset += 4;\n    }\n\n    writeFloat64(value) {\n        this.ensureAvailable(8);\n        this._data.setFloat64(this.offset, value, this.littleEndian);\n        this.offset += 8;\n    }\n\n    writeChar(str) {\n        this.writeUint8(str.charCodeAt(0));\n    }\n\n    writeChars(str) {\n        for (var i = 0; i < str.length; i++) {\n            this.writeUint8(str.charCodeAt(i));\n        }\n    }\n\n    toArray() {\n        return new Uint8Array(this.buffer, 0, this.offset);\n    }\n}\n\nmodule.exports = IOBuffer;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/iobuffer/IOBuffer.js","'use strict';\n\nvar base64 = require('./base64');\n\n/**\nUsage:\n   zip = new JSZip();\n   zip.file(\"hello.txt\", \"Hello, World!\").file(\"tempfile\", \"nothing\");\n   zip.folder(\"images\").file(\"smile.gif\", base64Data, {base64: true});\n   zip.file(\"Xmas.txt\", \"Ho ho ho !\", {date : new Date(\"December 25, 2007 00:00:01\")});\n   zip.remove(\"tempfile\");\n\n   base64zip = zip.generate();\n\n**/\n\n/**\n * Representation a of zip file in js\n * @constructor\n * @param {String=|ArrayBuffer=|Uint8Array=} data the data to load, if any (optional).\n * @param {Object=} options the options for creating this objects (optional).\n */\nfunction JSZip(data, options) {\n    // if this constructor is used without `new`, it adds `new` before itself:\n    if(!(this instanceof JSZip)) return new JSZip(data, options);\n\n    // object containing the files :\n    // {\n    //   \"folder/\" : {...},\n    //   \"folder/data.txt\" : {...}\n    // }\n    this.files = {};\n\n    this.comment = null;\n\n    // Where we are in the hierarchy\n    this.root = \"\";\n    if (data) {\n        this.load(data, options);\n    }\n    this.clone = function() {\n        var newObj = new JSZip();\n        for (var i in this) {\n            if (typeof this[i] !== \"function\") {\n                newObj[i] = this[i];\n            }\n        }\n        return newObj;\n    };\n}\nJSZip.prototype = require('./object');\nJSZip.prototype.load = require('./load');\nJSZip.support = require('./support');\nJSZip.defaults = require('./defaults');\n\n/**\n * @deprecated\n * This namespace will be removed in a future version without replacement.\n */\nJSZip.utils = require('./deprecatedPublicUtils');\n\nJSZip.base64 = {\n    /**\n     * @deprecated\n     * This method will be removed in a future version without replacement.\n     */\n    encode : function(input) {\n        return base64.encode(input);\n    },\n    /**\n     * @deprecated\n     * This method will be removed in a future version without replacement.\n     */\n    decode : function(input) {\n        return base64.decode(input);\n    }\n};\nJSZip.compressions = require('./compressions');\nmodule.exports = JSZip;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/jszip/lib/index.js","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n  lookup[i] = code[i]\n  revLookup[code.charCodeAt(i)] = i\n}\n\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction placeHoldersCount (b64) {\n  var len = b64.length\n  if (len % 4 > 0) {\n    throw new Error('Invalid string. Length must be a multiple of 4')\n  }\n\n  // the number of equal signs (place holders)\n  // if there are two placeholders, than the two characters before it\n  // represent one byte\n  // if there is only one, then the three characters before it represent 2 bytes\n  // this is just a cheap hack to not do indexOf twice\n  return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0\n}\n\nfunction byteLength (b64) {\n  // base64 is 4/3 + up to two characters of the original data\n  return (b64.length * 3 / 4) - placeHoldersCount(b64)\n}\n\nfunction toByteArray (b64) {\n  var i, l, tmp, placeHolders, arr\n  var len = b64.length\n  placeHolders = placeHoldersCount(b64)\n\n  arr = new Arr((len * 3 / 4) - placeHolders)\n\n  // if there are placeholders, only get up to the last complete 4 chars\n  l = placeHolders > 0 ? len - 4 : len\n\n  var L = 0\n\n  for (i = 0; i < l; i += 4) {\n    tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]\n    arr[L++] = (tmp >> 16) & 0xFF\n    arr[L++] = (tmp >> 8) & 0xFF\n    arr[L++] = tmp & 0xFF\n  }\n\n  if (placeHolders === 2) {\n    tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)\n    arr[L++] = tmp & 0xFF\n  } else if (placeHolders === 1) {\n    tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)\n    arr[L++] = (tmp >> 8) & 0xFF\n    arr[L++] = tmp & 0xFF\n  }\n\n  return arr\n}\n\nfunction tripletToBase64 (num) {\n  return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n  var tmp\n  var output = []\n  for (var i = start; i < end; i += 3) {\n    tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])\n    output.push(tripletToBase64(tmp))\n  }\n  return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n  var tmp\n  var len = uint8.length\n  var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n  var output = ''\n  var parts = []\n  var maxChunkLength = 16383 // must be multiple of 3\n\n  // go through the array every three bytes, we'll deal with trailing stuff later\n  for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n    parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n  }\n\n  // pad the end with zeros, but make sure to not forget the extra bytes\n  if (extraBytes === 1) {\n    tmp = uint8[len - 1]\n    output += lookup[tmp >> 2]\n    output += lookup[(tmp << 4) & 0x3F]\n    output += '=='\n  } else if (extraBytes === 2) {\n    tmp = (uint8[len - 2] << 8) + (uint8[len - 1])\n    output += lookup[tmp >> 10]\n    output += lookup[(tmp >> 4) & 0x3F]\n    output += lookup[(tmp << 2) & 0x3F]\n    output += '='\n  }\n\n  parts.push(output)\n\n  return parts.join('')\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/base64-js/index.js","exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n  var e, m\n  var eLen = nBytes * 8 - mLen - 1\n  var eMax = (1 << eLen) - 1\n  var eBias = eMax >> 1\n  var nBits = -7\n  var i = isLE ? (nBytes - 1) : 0\n  var d = isLE ? -1 : 1\n  var s = buffer[offset + i]\n\n  i += d\n\n  e = s & ((1 << (-nBits)) - 1)\n  s >>= (-nBits)\n  nBits += eLen\n  for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n  m = e & ((1 << (-nBits)) - 1)\n  e >>= (-nBits)\n  nBits += mLen\n  for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}\n\n  if (e === 0) {\n    e = 1 - eBias\n  } else if (e === eMax) {\n    return m ? NaN : ((s ? -1 : 1) * Infinity)\n  } else {\n    m = m + Math.pow(2, mLen)\n    e = e - eBias\n  }\n  return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n  var e, m, c\n  var eLen = nBytes * 8 - mLen - 1\n  var eMax = (1 << eLen) - 1\n  var eBias = eMax >> 1\n  var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n  var i = isLE ? 0 : (nBytes - 1)\n  var d = isLE ? 1 : -1\n  var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n  value = Math.abs(value)\n\n  if (isNaN(value) || value === Infinity) {\n    m = isNaN(value) ? 1 : 0\n    e = eMax\n  } else {\n    e = Math.floor(Math.log(value) / Math.LN2)\n    if (value * (c = Math.pow(2, -e)) < 1) {\n      e--\n      c *= 2\n    }\n    if (e + eBias >= 1) {\n      value += rt / c\n    } else {\n      value += rt * Math.pow(2, 1 - eBias)\n    }\n    if (value * c >= 2) {\n      e++\n      c /= 2\n    }\n\n    if (e + eBias >= eMax) {\n      m = 0\n      e = eMax\n    } else if (e + eBias >= 1) {\n      m = (value * c - 1) * Math.pow(2, mLen)\n      e = e + eBias\n    } else {\n      m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n      e = 0\n    }\n  }\n\n  for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n  e = (e << mLen) | m\n  eLen += mLen\n  for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n  buffer[offset + i - d] |= s * 128\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ieee754/index.js","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n  return toString.call(arr) == '[object Array]';\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/isarray/index.js","'use strict';\nvar USE_TYPEDARRAY = (typeof Uint8Array !== 'undefined') && (typeof Uint16Array !== 'undefined') && (typeof Uint32Array !== 'undefined');\n\nvar pako = require(\"pako\");\nexports.uncompressInputType = USE_TYPEDARRAY ? \"uint8array\" : \"array\";\nexports.compressInputType = USE_TYPEDARRAY ? \"uint8array\" : \"array\";\n\nexports.magic = \"\\x08\\x00\";\nexports.compress = function(input, compressionOptions) {\n    return pako.deflateRaw(input, {\n        level : compressionOptions.level || -1 // default compression\n    });\n};\nexports.uncompress =  function(input) {\n    return pako.inflateRaw(input);\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/jszip/lib/flate.js","// Top level file is just a mixin of submodules & constants\n'use strict';\n\nvar assign    = require('./lib/utils/common').assign;\n\nvar deflate   = require('./lib/deflate');\nvar inflate   = require('./lib/inflate');\nvar constants = require('./lib/zlib/constants');\n\nvar pako = {};\n\nassign(pako, deflate, inflate, constants);\n\nmodule.exports = pako;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/pako/index.js","'use strict';\n\n\nvar zlib_deflate = require('./zlib/deflate');\nvar utils        = require('./utils/common');\nvar strings      = require('./utils/strings');\nvar msg          = require('./zlib/messages');\nvar ZStream      = require('./zlib/zstream');\n\nvar toString = Object.prototype.toString;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nvar Z_NO_FLUSH      = 0;\nvar Z_FINISH        = 4;\n\nvar Z_OK            = 0;\nvar Z_STREAM_END    = 1;\nvar Z_SYNC_FLUSH    = 2;\n\nvar Z_DEFAULT_COMPRESSION = -1;\n\nvar Z_DEFAULT_STRATEGY    = 0;\n\nvar Z_DEFLATED  = 8;\n\n/* ===========================================================================*/\n\n\n/**\n * class Deflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[deflate]],\n * [[deflateRaw]] and [[gzip]].\n **/\n\n/* internal\n * Deflate.chunks -> Array\n *\n * Chunks of output data, if [[Deflate#onData]] not overridden.\n **/\n\n/**\n * Deflate.result -> Uint8Array|Array\n *\n * Compressed result, generated by default [[Deflate#onData]]\n * and [[Deflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Deflate#push]] with `Z_FINISH` / `true` param)  or if you\n * push a chunk with explicit flush (call [[Deflate#push]] with\n * `Z_SYNC_FLUSH` param).\n **/\n\n/**\n * Deflate.err -> Number\n *\n * Error code after deflate finished. 0 (Z_OK) on success.\n * You will not need it in real life, because deflate errors\n * are possible only on wrong options or bad `onData` / `onEnd`\n * custom handlers.\n **/\n\n/**\n * Deflate.msg -> String\n *\n * Error message, if [[Deflate.err]] != 0\n **/\n\n\n/**\n * new Deflate(options)\n * - options (Object): zlib deflate options.\n *\n * Creates new deflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `level`\n * - `windowBits`\n * - `memLevel`\n * - `strategy`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw deflate\n * - `gzip` (Boolean) - create gzip wrapper\n * - `to` (String) - if equal to 'string', then result will be \"binary string\"\n *    (each char code [0..255])\n * - `header` (Object) - custom header for gzip\n *   - `text` (Boolean) - true if compressed data believed to be text\n *   - `time` (Number) - modification time, unix timestamp\n *   - `os` (Number) - operation system code\n *   - `extra` (Array) - array of bytes with extra data (max 65536)\n *   - `name` (String) - file name (binary string)\n *   - `comment` (String) - comment (binary string)\n *   - `hcrc` (Boolean) - true if header crc should be added\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n *   , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])\n *   , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * var deflate = new pako.Deflate({ level: 3});\n *\n * deflate.push(chunk1, false);\n * deflate.push(chunk2, true);  // true -> last chunk\n *\n * if (deflate.err) { throw new Error(deflate.err); }\n *\n * console.log(deflate.result);\n * ```\n **/\nfunction Deflate(options) {\n  if (!(this instanceof Deflate)) return new Deflate(options);\n\n  this.options = utils.assign({\n    level: Z_DEFAULT_COMPRESSION,\n    method: Z_DEFLATED,\n    chunkSize: 16384,\n    windowBits: 15,\n    memLevel: 8,\n    strategy: Z_DEFAULT_STRATEGY,\n    to: ''\n  }, options || {});\n\n  var opt = this.options;\n\n  if (opt.raw && (opt.windowBits > 0)) {\n    opt.windowBits = -opt.windowBits;\n  }\n\n  else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) {\n    opt.windowBits += 16;\n  }\n\n  this.err    = 0;      // error code, if happens (0 = Z_OK)\n  this.msg    = '';     // error message\n  this.ended  = false;  // used to avoid multiple onEnd() calls\n  this.chunks = [];     // chunks of compressed data\n\n  this.strm = new ZStream();\n  this.strm.avail_out = 0;\n\n  var status = zlib_deflate.deflateInit2(\n    this.strm,\n    opt.level,\n    opt.method,\n    opt.windowBits,\n    opt.memLevel,\n    opt.strategy\n  );\n\n  if (status !== Z_OK) {\n    throw new Error(msg[status]);\n  }\n\n  if (opt.header) {\n    zlib_deflate.deflateSetHeader(this.strm, opt.header);\n  }\n\n  if (opt.dictionary) {\n    var dict;\n    // Convert data if needed\n    if (typeof opt.dictionary === 'string') {\n      // If we need to compress text, change encoding to utf8.\n      dict = strings.string2buf(opt.dictionary);\n    } else if (toString.call(opt.dictionary) === '[object ArrayBuffer]') {\n      dict = new Uint8Array(opt.dictionary);\n    } else {\n      dict = opt.dictionary;\n    }\n\n    status = zlib_deflate.deflateSetDictionary(this.strm, dict);\n\n    if (status !== Z_OK) {\n      throw new Error(msg[status]);\n    }\n\n    this._dict_set = true;\n  }\n}\n\n/**\n * Deflate#push(data[, mode]) -> Boolean\n * - data (Uint8Array|Array|ArrayBuffer|String): input data. Strings will be\n *   converted to utf8 byte sequence.\n * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.\n *   See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.\n *\n * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with\n * new compressed chunks. Returns `true` on success. The last data block must have\n * mode Z_FINISH (or `true`). That will flush internal pending buffers and call\n * [[Deflate#onEnd]]. For interim explicit flushes (without ending the stream) you\n * can use mode Z_SYNC_FLUSH, keeping the compression context.\n *\n * On fail call [[Deflate#onEnd]] with error code and return false.\n *\n * We strongly recommend to use `Uint8Array` on input for best speed (output\n * array format is detected automatically). Also, don't skip last param and always\n * use the same type in your code (boolean or number). That will improve JS speed.\n *\n * For regular `Array`-s make sure all elements are [0..255].\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true);  // push last chunk\n * ```\n **/\nDeflate.prototype.push = function (data, mode) {\n  var strm = this.strm;\n  var chunkSize = this.options.chunkSize;\n  var status, _mode;\n\n  if (this.ended) { return false; }\n\n  _mode = (mode === ~~mode) ? mode : ((mode === true) ? Z_FINISH : Z_NO_FLUSH);\n\n  // Convert data if needed\n  if (typeof data === 'string') {\n    // If we need to compress text, change encoding to utf8.\n    strm.input = strings.string2buf(data);\n  } else if (toString.call(data) === '[object ArrayBuffer]') {\n    strm.input = new Uint8Array(data);\n  } else {\n    strm.input = data;\n  }\n\n  strm.next_in = 0;\n  strm.avail_in = strm.input.length;\n\n  do {\n    if (strm.avail_out === 0) {\n      strm.output = new utils.Buf8(chunkSize);\n      strm.next_out = 0;\n      strm.avail_out = chunkSize;\n    }\n    status = zlib_deflate.deflate(strm, _mode);    /* no bad return value */\n\n    if (status !== Z_STREAM_END && status !== Z_OK) {\n      this.onEnd(status);\n      this.ended = true;\n      return false;\n    }\n    if (strm.avail_out === 0 || (strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH))) {\n      if (this.options.to === 'string') {\n        this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out)));\n      } else {\n        this.onData(utils.shrinkBuf(strm.output, strm.next_out));\n      }\n    }\n  } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== Z_STREAM_END);\n\n  // Finalize on the last chunk.\n  if (_mode === Z_FINISH) {\n    status = zlib_deflate.deflateEnd(this.strm);\n    this.onEnd(status);\n    this.ended = true;\n    return status === Z_OK;\n  }\n\n  // callback interim results if Z_SYNC_FLUSH.\n  if (_mode === Z_SYNC_FLUSH) {\n    this.onEnd(Z_OK);\n    strm.avail_out = 0;\n    return true;\n  }\n\n  return true;\n};\n\n\n/**\n * Deflate#onData(chunk) -> Void\n * - chunk (Uint8Array|Array|String): output data. Type of array depends\n *   on js engine support. When string output requested, each chunk\n *   will be string.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\nDeflate.prototype.onData = function (chunk) {\n  this.chunks.push(chunk);\n};\n\n\n/**\n * Deflate#onEnd(status) -> Void\n * - status (Number): deflate status. 0 (Z_OK) on success,\n *   other if not.\n *\n * Called once after you tell deflate that the input stream is\n * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)\n * or if an error happened. By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nDeflate.prototype.onEnd = function (status) {\n  // On success - join\n  if (status === Z_OK) {\n    if (this.options.to === 'string') {\n      this.result = this.chunks.join('');\n    } else {\n      this.result = utils.flattenChunks(this.chunks);\n    }\n  }\n  this.chunks = [];\n  this.err = status;\n  this.msg = this.strm.msg;\n};\n\n\n/**\n * deflate(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * Compress `data` with deflate algorithm and `options`.\n *\n * Supported options are:\n *\n * - level\n * - windowBits\n * - memLevel\n * - strategy\n * - dictionary\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n *   negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be \"binary string\"\n *    (each char code [0..255])\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n *   , data = Uint8Array([1,2,3,4,5,6,7,8,9]);\n *\n * console.log(pako.deflate(data));\n * ```\n **/\nfunction deflate(input, options) {\n  var deflator = new Deflate(options);\n\n  deflator.push(input, true);\n\n  // That will never happens, if you don't cheat with options :)\n  if (deflator.err) { throw deflator.msg || msg[deflator.err]; }\n\n  return deflator.result;\n}\n\n\n/**\n * deflateRaw(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction deflateRaw(input, options) {\n  options = options || {};\n  options.raw = true;\n  return deflate(input, options);\n}\n\n\n/**\n * gzip(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to compress.\n * - options (Object): zlib deflate options.\n *\n * The same as [[deflate]], but create gzip wrapper instead of\n * deflate one.\n **/\nfunction gzip(input, options) {\n  options = options || {};\n  options.gzip = true;\n  return deflate(input, options);\n}\n\n\nexports.Deflate = Deflate;\nexports.deflate = deflate;\nexports.deflateRaw = deflateRaw;\nexports.gzip = gzip;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/pako/lib/deflate.js","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//   claim that you wrote the original software. If you use this software\n//   in a product, an acknowledgment in the product documentation would be\n//   appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n//   misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar utils   = require('../utils/common');\nvar trees   = require('./trees');\nvar adler32 = require('./adler32');\nvar crc32   = require('./crc32');\nvar msg     = require('./messages');\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n/* Allowed flush values; see deflate() and inflate() below for details */\nvar Z_NO_FLUSH      = 0;\nvar Z_PARTIAL_FLUSH = 1;\n//var Z_SYNC_FLUSH    = 2;\nvar Z_FULL_FLUSH    = 3;\nvar Z_FINISH        = 4;\nvar Z_BLOCK         = 5;\n//var Z_TREES         = 6;\n\n\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\nvar Z_OK            = 0;\nvar Z_STREAM_END    = 1;\n//var Z_NEED_DICT     = 2;\n//var Z_ERRNO         = -1;\nvar Z_STREAM_ERROR  = -2;\nvar Z_DATA_ERROR    = -3;\n//var Z_MEM_ERROR     = -4;\nvar Z_BUF_ERROR     = -5;\n//var Z_VERSION_ERROR = -6;\n\n\n/* compression levels */\n//var Z_NO_COMPRESSION      = 0;\n//var Z_BEST_SPEED          = 1;\n//var Z_BEST_COMPRESSION    = 9;\nvar Z_DEFAULT_COMPRESSION = -1;\n\n\nvar Z_FILTERED            = 1;\nvar Z_HUFFMAN_ONLY        = 2;\nvar Z_RLE                 = 3;\nvar Z_FIXED               = 4;\nvar Z_DEFAULT_STRATEGY    = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\n//var Z_BINARY              = 0;\n//var Z_TEXT                = 1;\n//var Z_ASCII               = 1; // = Z_TEXT\nvar Z_UNKNOWN             = 2;\n\n\n/* The deflate compression method */\nvar Z_DEFLATED  = 8;\n\n/*============================================================================*/\n\n\nvar MAX_MEM_LEVEL = 9;\n/* Maximum value for memLevel in deflateInit2 */\nvar MAX_WBITS = 15;\n/* 32K LZ77 window */\nvar DEF_MEM_LEVEL = 8;\n\n\nvar LENGTH_CODES  = 29;\n/* number of length codes, not counting the special END_BLOCK code */\nvar LITERALS      = 256;\n/* number of literal bytes 0..255 */\nvar L_CODES       = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\nvar D_CODES       = 30;\n/* number of distance codes */\nvar BL_CODES      = 19;\n/* number of codes used to transfer the bit lengths */\nvar HEAP_SIZE     = 2 * L_CODES + 1;\n/* maximum heap size */\nvar MAX_BITS  = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nvar MIN_MATCH = 3;\nvar MAX_MATCH = 258;\nvar MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);\n\nvar PRESET_DICT = 0x20;\n\nvar INIT_STATE = 42;\nvar EXTRA_STATE = 69;\nvar NAME_STATE = 73;\nvar COMMENT_STATE = 91;\nvar HCRC_STATE = 103;\nvar BUSY_STATE = 113;\nvar FINISH_STATE = 666;\n\nvar BS_NEED_MORE      = 1; /* block not completed, need more input or more output */\nvar BS_BLOCK_DONE     = 2; /* block flush performed */\nvar BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */\nvar BS_FINISH_DONE    = 4; /* finish done, accept no more input or output */\n\nvar OS_CODE = 0x03; // Unix :) . Don't detect, use this default.\n\nfunction err(strm, errorCode) {\n  strm.msg = msg[errorCode];\n  return errorCode;\n}\n\nfunction rank(f) {\n  return ((f) << 1) - ((f) > 4 ? 9 : 0);\n}\n\nfunction zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n\n/* =========================================================================\n * Flush as much pending output as possible. All deflate() output goes\n * through this function so some applications may wish to modify it\n * to avoid allocating a large strm->output buffer and copying into it.\n * (See also read_buf()).\n */\nfunction flush_pending(strm) {\n  var s = strm.state;\n\n  //_tr_flush_bits(s);\n  var len = s.pending;\n  if (len > strm.avail_out) {\n    len = strm.avail_out;\n  }\n  if (len === 0) { return; }\n\n  utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);\n  strm.next_out += len;\n  s.pending_out += len;\n  strm.total_out += len;\n  strm.avail_out -= len;\n  s.pending -= len;\n  if (s.pending === 0) {\n    s.pending_out = 0;\n  }\n}\n\n\nfunction flush_block_only(s, last) {\n  trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);\n  s.block_start = s.strstart;\n  flush_pending(s.strm);\n}\n\n\nfunction put_byte(s, b) {\n  s.pending_buf[s.pending++] = b;\n}\n\n\n/* =========================================================================\n * Put a short in the pending buffer. The 16-bit value is put in MSB order.\n * IN assertion: the stream state is correct and there is enough room in\n * pending_buf.\n */\nfunction putShortMSB(s, b) {\n//  put_byte(s, (Byte)(b >> 8));\n//  put_byte(s, (Byte)(b & 0xff));\n  s.pending_buf[s.pending++] = (b >>> 8) & 0xff;\n  s.pending_buf[s.pending++] = b & 0xff;\n}\n\n\n/* ===========================================================================\n * Read a new buffer from the current input stream, update the adler32\n * and total number of bytes read.  All deflate() input goes through\n * this function so some applications may wish to modify it to avoid\n * allocating a large strm->input buffer and copying from it.\n * (See also flush_pending()).\n */\nfunction read_buf(strm, buf, start, size) {\n  var len = strm.avail_in;\n\n  if (len > size) { len = size; }\n  if (len === 0) { return 0; }\n\n  strm.avail_in -= len;\n\n  // zmemcpy(buf, strm->next_in, len);\n  utils.arraySet(buf, strm.input, strm.next_in, len, start);\n  if (strm.state.wrap === 1) {\n    strm.adler = adler32(strm.adler, buf, len, start);\n  }\n\n  else if (strm.state.wrap === 2) {\n    strm.adler = crc32(strm.adler, buf, len, start);\n  }\n\n  strm.next_in += len;\n  strm.total_in += len;\n\n  return len;\n}\n\n\n/* ===========================================================================\n * Set match_start to the longest match starting at the given string and\n * return its length. Matches shorter or equal to prev_length are discarded,\n * in which case the result is equal to prev_length and match_start is\n * garbage.\n * IN assertions: cur_match is the head of the hash chain for the current\n *   string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1\n * OUT assertion: the match length is not greater than s->lookahead.\n */\nfunction longest_match(s, cur_match) {\n  var chain_length = s.max_chain_length;      /* max hash chain length */\n  var scan = s.strstart; /* current string */\n  var match;                       /* matched string */\n  var len;                           /* length of current match */\n  var best_len = s.prev_length;              /* best match length so far */\n  var nice_match = s.nice_match;             /* stop if match long enough */\n  var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?\n      s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;\n\n  var _win = s.window; // shortcut\n\n  var wmask = s.w_mask;\n  var prev  = s.prev;\n\n  /* Stop when cur_match becomes <= limit. To simplify the code,\n   * we prevent matches with the string of window index 0.\n   */\n\n  var strend = s.strstart + MAX_MATCH;\n  var scan_end1  = _win[scan + best_len - 1];\n  var scan_end   = _win[scan + best_len];\n\n  /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.\n   * It is easy to get rid of this optimization if necessary.\n   */\n  // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, \"Code too clever\");\n\n  /* Do not waste too much time if we already have a good match: */\n  if (s.prev_length >= s.good_match) {\n    chain_length >>= 2;\n  }\n  /* Do not look for matches beyond the end of the input. This is necessary\n   * to make deflate deterministic.\n   */\n  if (nice_match > s.lookahead) { nice_match = s.lookahead; }\n\n  // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, \"need lookahead\");\n\n  do {\n    // Assert(cur_match < s->strstart, \"no future\");\n    match = cur_match;\n\n    /* Skip to next match if the match length cannot increase\n     * or if the match length is less than 2.  Note that the checks below\n     * for insufficient lookahead only occur occasionally for performance\n     * reasons.  Therefore uninitialized memory will be accessed, and\n     * conditional jumps will be made that depend on those values.\n     * However the length of the match is limited to the lookahead, so\n     * the output of deflate is not affected by the uninitialized values.\n     */\n\n    if (_win[match + best_len]     !== scan_end  ||\n        _win[match + best_len - 1] !== scan_end1 ||\n        _win[match]                !== _win[scan] ||\n        _win[++match]              !== _win[scan + 1]) {\n      continue;\n    }\n\n    /* The check at best_len-1 can be removed because it will be made\n     * again later. (This heuristic is not always a win.)\n     * It is not necessary to compare scan[2] and match[2] since they\n     * are always equal when the other bytes match, given that\n     * the hash keys are equal and that HASH_BITS >= 8.\n     */\n    scan += 2;\n    match++;\n    // Assert(*scan == *match, \"match[2]?\");\n\n    /* We check for insufficient lookahead only every 8th comparison;\n     * the 256th check will be made at strstart+258.\n     */\n    do {\n      /*jshint noempty:false*/\n    } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n             _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n             _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n             _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&\n             scan < strend);\n\n    // Assert(scan <= s->window+(unsigned)(s->window_size-1), \"wild scan\");\n\n    len = MAX_MATCH - (strend - scan);\n    scan = strend - MAX_MATCH;\n\n    if (len > best_len) {\n      s.match_start = cur_match;\n      best_len = len;\n      if (len >= nice_match) {\n        break;\n      }\n      scan_end1  = _win[scan + best_len - 1];\n      scan_end   = _win[scan + best_len];\n    }\n  } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);\n\n  if (best_len <= s.lookahead) {\n    return best_len;\n  }\n  return s.lookahead;\n}\n\n\n/* ===========================================================================\n * Fill the window when the lookahead becomes insufficient.\n * Updates strstart and lookahead.\n *\n * IN assertion: lookahead < MIN_LOOKAHEAD\n * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD\n *    At least one byte has been read, or avail_in == 0; reads are\n *    performed for at least two bytes (required for the zip translate_eol\n *    option -- not supported here).\n */\nfunction fill_window(s) {\n  var _w_size = s.w_size;\n  var p, n, m, more, str;\n\n  //Assert(s->lookahead < MIN_LOOKAHEAD, \"already enough lookahead\");\n\n  do {\n    more = s.window_size - s.lookahead - s.strstart;\n\n    // JS ints have 32 bit, block below not needed\n    /* Deal with !@#$% 64K limit: */\n    //if (sizeof(int) <= 2) {\n    //    if (more == 0 && s->strstart == 0 && s->lookahead == 0) {\n    //        more = wsize;\n    //\n    //  } else if (more == (unsigned)(-1)) {\n    //        /* Very unlikely, but possible on 16 bit machine if\n    //         * strstart == 0 && lookahead == 1 (input done a byte at time)\n    //         */\n    //        more--;\n    //    }\n    //}\n\n\n    /* If the window is almost full and there is insufficient lookahead,\n     * move the upper half to the lower one to make room in the upper half.\n     */\n    if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {\n\n      utils.arraySet(s.window, s.window, _w_size, _w_size, 0);\n      s.match_start -= _w_size;\n      s.strstart -= _w_size;\n      /* we now have strstart >= MAX_DIST */\n      s.block_start -= _w_size;\n\n      /* Slide the hash table (could be avoided with 32 bit values\n       at the expense of memory usage). We slide even when level == 0\n       to keep the hash table consistent if we switch back to level > 0\n       later. (Using level 0 permanently is not an optimal usage of\n       zlib, so we don't care about this pathological case.)\n       */\n\n      n = s.hash_size;\n      p = n;\n      do {\n        m = s.head[--p];\n        s.head[p] = (m >= _w_size ? m - _w_size : 0);\n      } while (--n);\n\n      n = _w_size;\n      p = n;\n      do {\n        m = s.prev[--p];\n        s.prev[p] = (m >= _w_size ? m - _w_size : 0);\n        /* If n is not on any hash chain, prev[n] is garbage but\n         * its value will never be used.\n         */\n      } while (--n);\n\n      more += _w_size;\n    }\n    if (s.strm.avail_in === 0) {\n      break;\n    }\n\n    /* If there was no sliding:\n     *    strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&\n     *    more == window_size - lookahead - strstart\n     * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)\n     * => more >= window_size - 2*WSIZE + 2\n     * In the BIG_MEM or MMAP case (not yet supported),\n     *   window_size == input_size + MIN_LOOKAHEAD  &&\n     *   strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.\n     * Otherwise, window_size == 2*WSIZE so more >= 2.\n     * If there was sliding, more >= WSIZE. So in all cases, more >= 2.\n     */\n    //Assert(more >= 2, \"more < 2\");\n    n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);\n    s.lookahead += n;\n\n    /* Initialize the hash value now that we have some input: */\n    if (s.lookahead + s.insert >= MIN_MATCH) {\n      str = s.strstart - s.insert;\n      s.ins_h = s.window[str];\n\n      /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */\n      s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;\n//#if MIN_MATCH != 3\n//        Call update_hash() MIN_MATCH-3 more times\n//#endif\n      while (s.insert) {\n        /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n        s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n        s.prev[str & s.w_mask] = s.head[s.ins_h];\n        s.head[s.ins_h] = str;\n        str++;\n        s.insert--;\n        if (s.lookahead + s.insert < MIN_MATCH) {\n          break;\n        }\n      }\n    }\n    /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,\n     * but this is not important since only literal bytes will be emitted.\n     */\n\n  } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);\n\n  /* If the WIN_INIT bytes after the end of the current data have never been\n   * written, then zero those bytes in order to avoid memory check reports of\n   * the use of uninitialized (or uninitialised as Julian writes) bytes by\n   * the longest match routines.  Update the high water mark for the next\n   * time through here.  WIN_INIT is set to MAX_MATCH since the longest match\n   * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.\n   */\n//  if (s.high_water < s.window_size) {\n//    var curr = s.strstart + s.lookahead;\n//    var init = 0;\n//\n//    if (s.high_water < curr) {\n//      /* Previous high water mark below current data -- zero WIN_INIT\n//       * bytes or up to end of window, whichever is less.\n//       */\n//      init = s.window_size - curr;\n//      if (init > WIN_INIT)\n//        init = WIN_INIT;\n//      zmemzero(s->window + curr, (unsigned)init);\n//      s->high_water = curr + init;\n//    }\n//    else if (s->high_water < (ulg)curr + WIN_INIT) {\n//      /* High water mark at or above current data, but below current data\n//       * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up\n//       * to end of window, whichever is less.\n//       */\n//      init = (ulg)curr + WIN_INIT - s->high_water;\n//      if (init > s->window_size - s->high_water)\n//        init = s->window_size - s->high_water;\n//      zmemzero(s->window + s->high_water, (unsigned)init);\n//      s->high_water += init;\n//    }\n//  }\n//\n//  Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,\n//    \"not enough room for search\");\n}\n\n/* ===========================================================================\n * Copy without compression as much as possible from the input stream, return\n * the current block state.\n * This function does not insert new strings in the dictionary since\n * uncompressible data is probably not useful. This function is used\n * only for the level=0 compression option.\n * NOTE: this function should be optimized to avoid extra copying from\n * window to pending_buf.\n */\nfunction deflate_stored(s, flush) {\n  /* Stored blocks are limited to 0xffff bytes, pending_buf is limited\n   * to pending_buf_size, and each stored block has a 5 byte header:\n   */\n  var max_block_size = 0xffff;\n\n  if (max_block_size > s.pending_buf_size - 5) {\n    max_block_size = s.pending_buf_size - 5;\n  }\n\n  /* Copy as much as possible from input to output: */\n  for (;;) {\n    /* Fill the window as much as possible: */\n    if (s.lookahead <= 1) {\n\n      //Assert(s->strstart < s->w_size+MAX_DIST(s) ||\n      //  s->block_start >= (long)s->w_size, \"slide too late\");\n//      if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||\n//        s.block_start >= s.w_size)) {\n//        throw  new Error(\"slide too late\");\n//      }\n\n      fill_window(s);\n      if (s.lookahead === 0 && flush === Z_NO_FLUSH) {\n        return BS_NEED_MORE;\n      }\n\n      if (s.lookahead === 0) {\n        break;\n      }\n      /* flush the current block */\n    }\n    //Assert(s->block_start >= 0L, \"block gone\");\n//    if (s.block_start < 0) throw new Error(\"block gone\");\n\n    s.strstart += s.lookahead;\n    s.lookahead = 0;\n\n    /* Emit a stored block if pending_buf will be full: */\n    var max_start = s.block_start + max_block_size;\n\n    if (s.strstart === 0 || s.strstart >= max_start) {\n      /* strstart == 0 is possible when wraparound on 16-bit machine */\n      s.lookahead = s.strstart - max_start;\n      s.strstart = max_start;\n      /*** FLUSH_BLOCK(s, 0); ***/\n      flush_block_only(s, false);\n      if (s.strm.avail_out === 0) {\n        return BS_NEED_MORE;\n      }\n      /***/\n\n\n    }\n    /* Flush if we may have to slide, otherwise block_start may become\n     * negative and the data will be gone:\n     */\n    if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) {\n      /*** FLUSH_BLOCK(s, 0); ***/\n      flush_block_only(s, false);\n      if (s.strm.avail_out === 0) {\n        return BS_NEED_MORE;\n      }\n      /***/\n    }\n  }\n\n  s.insert = 0;\n\n  if (flush === Z_FINISH) {\n    /*** FLUSH_BLOCK(s, 1); ***/\n    flush_block_only(s, true);\n    if (s.strm.avail_out === 0) {\n      return BS_FINISH_STARTED;\n    }\n    /***/\n    return BS_FINISH_DONE;\n  }\n\n  if (s.strstart > s.block_start) {\n    /*** FLUSH_BLOCK(s, 0); ***/\n    flush_block_only(s, false);\n    if (s.strm.avail_out === 0) {\n      return BS_NEED_MORE;\n    }\n    /***/\n  }\n\n  return BS_NEED_MORE;\n}\n\n/* ===========================================================================\n * Compress as much as possible from the input stream, return the current\n * block state.\n * This function does not perform lazy evaluation of matches and inserts\n * new strings in the dictionary only for unmatched strings or for short\n * matches. It is used only for the fast compression options.\n */\nfunction deflate_fast(s, flush) {\n  var hash_head;        /* head of the hash chain */\n  var bflush;           /* set if current block must be flushed */\n\n  for (;;) {\n    /* Make sure that we always have enough lookahead, except\n     * at the end of the input file. We need MAX_MATCH bytes\n     * for the next match, plus MIN_MATCH bytes to insert the\n     * string following the next match.\n     */\n    if (s.lookahead < MIN_LOOKAHEAD) {\n      fill_window(s);\n      if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n        return BS_NEED_MORE;\n      }\n      if (s.lookahead === 0) {\n        break; /* flush the current block */\n      }\n    }\n\n    /* Insert the string window[strstart .. strstart+2] in the\n     * dictionary, and set hash_head to the head of the hash chain:\n     */\n    hash_head = 0/*NIL*/;\n    if (s.lookahead >= MIN_MATCH) {\n      /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n      s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n      hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n      s.head[s.ins_h] = s.strstart;\n      /***/\n    }\n\n    /* Find the longest match, discarding those <= prev_length.\n     * At this point we have always match_length < MIN_MATCH\n     */\n    if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {\n      /* To simplify the code, we prevent matches with the string\n       * of window index 0 (in particular we have to avoid a match\n       * of the string with itself at the start of the input file).\n       */\n      s.match_length = longest_match(s, hash_head);\n      /* longest_match() sets match_start */\n    }\n    if (s.match_length >= MIN_MATCH) {\n      // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only\n\n      /*** _tr_tally_dist(s, s.strstart - s.match_start,\n                     s.match_length - MIN_MATCH, bflush); ***/\n      bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);\n\n      s.lookahead -= s.match_length;\n\n      /* Insert new strings in the hash table only if the match length\n       * is not too large. This saves time but degrades compression.\n       */\n      if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {\n        s.match_length--; /* string at strstart already in table */\n        do {\n          s.strstart++;\n          /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n          s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n          hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n          s.head[s.ins_h] = s.strstart;\n          /***/\n          /* strstart never exceeds WSIZE-MAX_MATCH, so there are\n           * always MIN_MATCH bytes ahead.\n           */\n        } while (--s.match_length !== 0);\n        s.strstart++;\n      } else\n      {\n        s.strstart += s.match_length;\n        s.match_length = 0;\n        s.ins_h = s.window[s.strstart];\n        /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */\n        s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;\n\n//#if MIN_MATCH != 3\n//                Call UPDATE_HASH() MIN_MATCH-3 more times\n//#endif\n        /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not\n         * matter since it will be recomputed at next deflate call.\n         */\n      }\n    } else {\n      /* No match, output a literal byte */\n      //Tracevv((stderr,\"%c\", s.window[s.strstart]));\n      /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n      bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n      s.lookahead--;\n      s.strstart++;\n    }\n    if (bflush) {\n      /*** FLUSH_BLOCK(s, 0); ***/\n      flush_block_only(s, false);\n      if (s.strm.avail_out === 0) {\n        return BS_NEED_MORE;\n      }\n      /***/\n    }\n  }\n  s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);\n  if (flush === Z_FINISH) {\n    /*** FLUSH_BLOCK(s, 1); ***/\n    flush_block_only(s, true);\n    if (s.strm.avail_out === 0) {\n      return BS_FINISH_STARTED;\n    }\n    /***/\n    return BS_FINISH_DONE;\n  }\n  if (s.last_lit) {\n    /*** FLUSH_BLOCK(s, 0); ***/\n    flush_block_only(s, false);\n    if (s.strm.avail_out === 0) {\n      return BS_NEED_MORE;\n    }\n    /***/\n  }\n  return BS_BLOCK_DONE;\n}\n\n/* ===========================================================================\n * Same as above, but achieves better compression. We use a lazy\n * evaluation for matches: a match is finally adopted only if there is\n * no better match at the next window position.\n */\nfunction deflate_slow(s, flush) {\n  var hash_head;          /* head of hash chain */\n  var bflush;              /* set if current block must be flushed */\n\n  var max_insert;\n\n  /* Process the input block. */\n  for (;;) {\n    /* Make sure that we always have enough lookahead, except\n     * at the end of the input file. We need MAX_MATCH bytes\n     * for the next match, plus MIN_MATCH bytes to insert the\n     * string following the next match.\n     */\n    if (s.lookahead < MIN_LOOKAHEAD) {\n      fill_window(s);\n      if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {\n        return BS_NEED_MORE;\n      }\n      if (s.lookahead === 0) { break; } /* flush the current block */\n    }\n\n    /* Insert the string window[strstart .. strstart+2] in the\n     * dictionary, and set hash_head to the head of the hash chain:\n     */\n    hash_head = 0/*NIL*/;\n    if (s.lookahead >= MIN_MATCH) {\n      /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n      s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n      hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n      s.head[s.ins_h] = s.strstart;\n      /***/\n    }\n\n    /* Find the longest match, discarding those <= prev_length.\n     */\n    s.prev_length = s.match_length;\n    s.prev_match = s.match_start;\n    s.match_length = MIN_MATCH - 1;\n\n    if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&\n        s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {\n      /* To simplify the code, we prevent matches with the string\n       * of window index 0 (in particular we have to avoid a match\n       * of the string with itself at the start of the input file).\n       */\n      s.match_length = longest_match(s, hash_head);\n      /* longest_match() sets match_start */\n\n      if (s.match_length <= 5 &&\n         (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {\n\n        /* If prev_match is also MIN_MATCH, match_start is garbage\n         * but we will ignore the current match anyway.\n         */\n        s.match_length = MIN_MATCH - 1;\n      }\n    }\n    /* If there was a match at the previous step and the current\n     * match is not better, output the previous match:\n     */\n    if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {\n      max_insert = s.strstart + s.lookahead - MIN_MATCH;\n      /* Do not insert strings in hash table beyond this. */\n\n      //check_match(s, s.strstart-1, s.prev_match, s.prev_length);\n\n      /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,\n                     s.prev_length - MIN_MATCH, bflush);***/\n      bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);\n      /* Insert in hash table all strings up to the end of the match.\n       * strstart-1 and strstart are already inserted. If there is not\n       * enough lookahead, the last two strings are not inserted in\n       * the hash table.\n       */\n      s.lookahead -= s.prev_length - 1;\n      s.prev_length -= 2;\n      do {\n        if (++s.strstart <= max_insert) {\n          /*** INSERT_STRING(s, s.strstart, hash_head); ***/\n          s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;\n          hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];\n          s.head[s.ins_h] = s.strstart;\n          /***/\n        }\n      } while (--s.prev_length !== 0);\n      s.match_available = 0;\n      s.match_length = MIN_MATCH - 1;\n      s.strstart++;\n\n      if (bflush) {\n        /*** FLUSH_BLOCK(s, 0); ***/\n        flush_block_only(s, false);\n        if (s.strm.avail_out === 0) {\n          return BS_NEED_MORE;\n        }\n        /***/\n      }\n\n    } else if (s.match_available) {\n      /* If there was no match at the previous position, output a\n       * single literal. If there was a match but the current match\n       * is longer, truncate the previous match to a single literal.\n       */\n      //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n      /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n      bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n      if (bflush) {\n        /*** FLUSH_BLOCK_ONLY(s, 0) ***/\n        flush_block_only(s, false);\n        /***/\n      }\n      s.strstart++;\n      s.lookahead--;\n      if (s.strm.avail_out === 0) {\n        return BS_NEED_MORE;\n      }\n    } else {\n      /* There is no previous match to compare with, wait for\n       * the next step to decide.\n       */\n      s.match_available = 1;\n      s.strstart++;\n      s.lookahead--;\n    }\n  }\n  //Assert (flush != Z_NO_FLUSH, \"no flush?\");\n  if (s.match_available) {\n    //Tracevv((stderr,\"%c\", s->window[s->strstart-1]));\n    /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/\n    bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);\n\n    s.match_available = 0;\n  }\n  s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;\n  if (flush === Z_FINISH) {\n    /*** FLUSH_BLOCK(s, 1); ***/\n    flush_block_only(s, true);\n    if (s.strm.avail_out === 0) {\n      return BS_FINISH_STARTED;\n    }\n    /***/\n    return BS_FINISH_DONE;\n  }\n  if (s.last_lit) {\n    /*** FLUSH_BLOCK(s, 0); ***/\n    flush_block_only(s, false);\n    if (s.strm.avail_out === 0) {\n      return BS_NEED_MORE;\n    }\n    /***/\n  }\n\n  return BS_BLOCK_DONE;\n}\n\n\n/* ===========================================================================\n * For Z_RLE, simply look for runs of bytes, generate matches only of distance\n * one.  Do not maintain a hash table.  (It will be regenerated if this run of\n * deflate switches away from Z_RLE.)\n */\nfunction deflate_rle(s, flush) {\n  var bflush;            /* set if current block must be flushed */\n  var prev;              /* byte at distance one to match */\n  var scan, strend;      /* scan goes up to strend for length of run */\n\n  var _win = s.window;\n\n  for (;;) {\n    /* Make sure that we always have enough lookahead, except\n     * at the end of the input file. We need MAX_MATCH bytes\n     * for the longest run, plus one for the unrolled loop.\n     */\n    if (s.lookahead <= MAX_MATCH) {\n      fill_window(s);\n      if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {\n        return BS_NEED_MORE;\n      }\n      if (s.lookahead === 0) { break; } /* flush the current block */\n    }\n\n    /* See how many times the previous byte repeats */\n    s.match_length = 0;\n    if (s.lookahead >= MIN_MATCH && s.strstart > 0) {\n      scan = s.strstart - 1;\n      prev = _win[scan];\n      if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {\n        strend = s.strstart + MAX_MATCH;\n        do {\n          /*jshint noempty:false*/\n        } while (prev === _win[++scan] && prev === _win[++scan] &&\n                 prev === _win[++scan] && prev === _win[++scan] &&\n                 prev === _win[++scan] && prev === _win[++scan] &&\n                 prev === _win[++scan] && prev === _win[++scan] &&\n                 scan < strend);\n        s.match_length = MAX_MATCH - (strend - scan);\n        if (s.match_length > s.lookahead) {\n          s.match_length = s.lookahead;\n        }\n      }\n      //Assert(scan <= s->window+(uInt)(s->window_size-1), \"wild scan\");\n    }\n\n    /* Emit match if have run of MIN_MATCH or longer, else emit literal */\n    if (s.match_length >= MIN_MATCH) {\n      //check_match(s, s.strstart, s.strstart - 1, s.match_length);\n\n      /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/\n      bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);\n\n      s.lookahead -= s.match_length;\n      s.strstart += s.match_length;\n      s.match_length = 0;\n    } else {\n      /* No match, output a literal byte */\n      //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n      /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n      bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n\n      s.lookahead--;\n      s.strstart++;\n    }\n    if (bflush) {\n      /*** FLUSH_BLOCK(s, 0); ***/\n      flush_block_only(s, false);\n      if (s.strm.avail_out === 0) {\n        return BS_NEED_MORE;\n      }\n      /***/\n    }\n  }\n  s.insert = 0;\n  if (flush === Z_FINISH) {\n    /*** FLUSH_BLOCK(s, 1); ***/\n    flush_block_only(s, true);\n    if (s.strm.avail_out === 0) {\n      return BS_FINISH_STARTED;\n    }\n    /***/\n    return BS_FINISH_DONE;\n  }\n  if (s.last_lit) {\n    /*** FLUSH_BLOCK(s, 0); ***/\n    flush_block_only(s, false);\n    if (s.strm.avail_out === 0) {\n      return BS_NEED_MORE;\n    }\n    /***/\n  }\n  return BS_BLOCK_DONE;\n}\n\n/* ===========================================================================\n * For Z_HUFFMAN_ONLY, do not look for matches.  Do not maintain a hash table.\n * (It will be regenerated if this run of deflate switches away from Huffman.)\n */\nfunction deflate_huff(s, flush) {\n  var bflush;             /* set if current block must be flushed */\n\n  for (;;) {\n    /* Make sure that we have a literal to write. */\n    if (s.lookahead === 0) {\n      fill_window(s);\n      if (s.lookahead === 0) {\n        if (flush === Z_NO_FLUSH) {\n          return BS_NEED_MORE;\n        }\n        break;      /* flush the current block */\n      }\n    }\n\n    /* Output a literal byte */\n    s.match_length = 0;\n    //Tracevv((stderr,\"%c\", s->window[s->strstart]));\n    /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/\n    bflush = trees._tr_tally(s, 0, s.window[s.strstart]);\n    s.lookahead--;\n    s.strstart++;\n    if (bflush) {\n      /*** FLUSH_BLOCK(s, 0); ***/\n      flush_block_only(s, false);\n      if (s.strm.avail_out === 0) {\n        return BS_NEED_MORE;\n      }\n      /***/\n    }\n  }\n  s.insert = 0;\n  if (flush === Z_FINISH) {\n    /*** FLUSH_BLOCK(s, 1); ***/\n    flush_block_only(s, true);\n    if (s.strm.avail_out === 0) {\n      return BS_FINISH_STARTED;\n    }\n    /***/\n    return BS_FINISH_DONE;\n  }\n  if (s.last_lit) {\n    /*** FLUSH_BLOCK(s, 0); ***/\n    flush_block_only(s, false);\n    if (s.strm.avail_out === 0) {\n      return BS_NEED_MORE;\n    }\n    /***/\n  }\n  return BS_BLOCK_DONE;\n}\n\n/* Values for max_lazy_match, good_match and max_chain_length, depending on\n * the desired pack level (0..9). The values given below have been tuned to\n * exclude worst case performance for pathological files. Better values may be\n * found for specific files.\n */\nfunction Config(good_length, max_lazy, nice_length, max_chain, func) {\n  this.good_length = good_length;\n  this.max_lazy = max_lazy;\n  this.nice_length = nice_length;\n  this.max_chain = max_chain;\n  this.func = func;\n}\n\nvar configuration_table;\n\nconfiguration_table = [\n  /*      good lazy nice chain */\n  new Config(0, 0, 0, 0, deflate_stored),          /* 0 store only */\n  new Config(4, 4, 8, 4, deflate_fast),            /* 1 max speed, no lazy matches */\n  new Config(4, 5, 16, 8, deflate_fast),           /* 2 */\n  new Config(4, 6, 32, 32, deflate_fast),          /* 3 */\n\n  new Config(4, 4, 16, 16, deflate_slow),          /* 4 lazy matches */\n  new Config(8, 16, 32, 32, deflate_slow),         /* 5 */\n  new Config(8, 16, 128, 128, deflate_slow),       /* 6 */\n  new Config(8, 32, 128, 256, deflate_slow),       /* 7 */\n  new Config(32, 128, 258, 1024, deflate_slow),    /* 8 */\n  new Config(32, 258, 258, 4096, deflate_slow)     /* 9 max compression */\n];\n\n\n/* ===========================================================================\n * Initialize the \"longest match\" routines for a new zlib stream\n */\nfunction lm_init(s) {\n  s.window_size = 2 * s.w_size;\n\n  /*** CLEAR_HASH(s); ***/\n  zero(s.head); // Fill with NIL (= 0);\n\n  /* Set the default configuration parameters:\n   */\n  s.max_lazy_match = configuration_table[s.level].max_lazy;\n  s.good_match = configuration_table[s.level].good_length;\n  s.nice_match = configuration_table[s.level].nice_length;\n  s.max_chain_length = configuration_table[s.level].max_chain;\n\n  s.strstart = 0;\n  s.block_start = 0;\n  s.lookahead = 0;\n  s.insert = 0;\n  s.match_length = s.prev_length = MIN_MATCH - 1;\n  s.match_available = 0;\n  s.ins_h = 0;\n}\n\n\nfunction DeflateState() {\n  this.strm = null;            /* pointer back to this zlib stream */\n  this.status = 0;            /* as the name implies */\n  this.pending_buf = null;      /* output still pending */\n  this.pending_buf_size = 0;  /* size of pending_buf */\n  this.pending_out = 0;       /* next pending byte to output to the stream */\n  this.pending = 0;           /* nb of bytes in the pending buffer */\n  this.wrap = 0;              /* bit 0 true for zlib, bit 1 true for gzip */\n  this.gzhead = null;         /* gzip header information to write */\n  this.gzindex = 0;           /* where in extra, name, or comment */\n  this.method = Z_DEFLATED; /* can only be DEFLATED */\n  this.last_flush = -1;   /* value of flush param for previous deflate call */\n\n  this.w_size = 0;  /* LZ77 window size (32K by default) */\n  this.w_bits = 0;  /* log2(w_size)  (8..16) */\n  this.w_mask = 0;  /* w_size - 1 */\n\n  this.window = null;\n  /* Sliding window. Input bytes are read into the second half of the window,\n   * and move to the first half later to keep a dictionary of at least wSize\n   * bytes. With this organization, matches are limited to a distance of\n   * wSize-MAX_MATCH bytes, but this ensures that IO is always\n   * performed with a length multiple of the block size.\n   */\n\n  this.window_size = 0;\n  /* Actual size of window: 2*wSize, except when the user input buffer\n   * is directly used as sliding window.\n   */\n\n  this.prev = null;\n  /* Link to older string with same hash index. To limit the size of this\n   * array to 64K, this link is maintained only for the last 32K strings.\n   * An index in this array is thus a window index modulo 32K.\n   */\n\n  this.head = null;   /* Heads of the hash chains or NIL. */\n\n  this.ins_h = 0;       /* hash index of string to be inserted */\n  this.hash_size = 0;   /* number of elements in hash table */\n  this.hash_bits = 0;   /* log2(hash_size) */\n  this.hash_mask = 0;   /* hash_size-1 */\n\n  this.hash_shift = 0;\n  /* Number of bits by which ins_h must be shifted at each input\n   * step. It must be such that after MIN_MATCH steps, the oldest\n   * byte no longer takes part in the hash key, that is:\n   *   hash_shift * MIN_MATCH >= hash_bits\n   */\n\n  this.block_start = 0;\n  /* Window position at the beginning of the current output block. Gets\n   * negative when the window is moved backwards.\n   */\n\n  this.match_length = 0;      /* length of best match */\n  this.prev_match = 0;        /* previous match */\n  this.match_available = 0;   /* set if previous match exists */\n  this.strstart = 0;          /* start of string to insert */\n  this.match_start = 0;       /* start of matching string */\n  this.lookahead = 0;         /* number of valid bytes ahead in window */\n\n  this.prev_length = 0;\n  /* Length of the best match at previous step. Matches not greater than this\n   * are discarded. This is used in the lazy match evaluation.\n   */\n\n  this.max_chain_length = 0;\n  /* To speed up deflation, hash chains are never searched beyond this\n   * length.  A higher limit improves compression ratio but degrades the\n   * speed.\n   */\n\n  this.max_lazy_match = 0;\n  /* Attempt to find a better match only when the current match is strictly\n   * smaller than this value. This mechanism is used only for compression\n   * levels >= 4.\n   */\n  // That's alias to max_lazy_match, don't use directly\n  //this.max_insert_length = 0;\n  /* Insert new strings in the hash table only if the match length is not\n   * greater than this length. This saves time but degrades compression.\n   * max_insert_length is used only for compression levels <= 3.\n   */\n\n  this.level = 0;     /* compression level (1..9) */\n  this.strategy = 0;  /* favor or force Huffman coding*/\n\n  this.good_match = 0;\n  /* Use a faster search when the previous match is longer than this */\n\n  this.nice_match = 0; /* Stop searching when current match exceeds this */\n\n              /* used by trees.c: */\n\n  /* Didn't use ct_data typedef below to suppress compiler warning */\n\n  // struct ct_data_s dyn_ltree[HEAP_SIZE];   /* literal and length tree */\n  // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */\n  // struct ct_data_s bl_tree[2*BL_CODES+1];  /* Huffman tree for bit lengths */\n\n  // Use flat array of DOUBLE size, with interleaved fata,\n  // because JS does not support effective\n  this.dyn_ltree  = new utils.Buf16(HEAP_SIZE * 2);\n  this.dyn_dtree  = new utils.Buf16((2 * D_CODES + 1) * 2);\n  this.bl_tree    = new utils.Buf16((2 * BL_CODES + 1) * 2);\n  zero(this.dyn_ltree);\n  zero(this.dyn_dtree);\n  zero(this.bl_tree);\n\n  this.l_desc   = null;         /* desc. for literal tree */\n  this.d_desc   = null;         /* desc. for distance tree */\n  this.bl_desc  = null;         /* desc. for bit length tree */\n\n  //ush bl_count[MAX_BITS+1];\n  this.bl_count = new utils.Buf16(MAX_BITS + 1);\n  /* number of codes at each bit length for an optimal tree */\n\n  //int heap[2*L_CODES+1];      /* heap used to build the Huffman trees */\n  this.heap = new utils.Buf16(2 * L_CODES + 1);  /* heap used to build the Huffman trees */\n  zero(this.heap);\n\n  this.heap_len = 0;               /* number of elements in the heap */\n  this.heap_max = 0;               /* element of largest frequency */\n  /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.\n   * The same heap array is used to build all trees.\n   */\n\n  this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1];\n  zero(this.depth);\n  /* Depth of each subtree used as tie breaker for trees of equal frequency\n   */\n\n  this.l_buf = 0;          /* buffer index for literals or lengths */\n\n  this.lit_bufsize = 0;\n  /* Size of match buffer for literals/lengths.  There are 4 reasons for\n   * limiting lit_bufsize to 64K:\n   *   - frequencies can be kept in 16 bit counters\n   *   - if compression is not successful for the first block, all input\n   *     data is still in the window so we can still emit a stored block even\n   *     when input comes from standard input.  (This can also be done for\n   *     all blocks if lit_bufsize is not greater than 32K.)\n   *   - if compression is not successful for a file smaller than 64K, we can\n   *     even emit a stored file instead of a stored block (saving 5 bytes).\n   *     This is applicable only for zip (not gzip or zlib).\n   *   - creating new Huffman trees less frequently may not provide fast\n   *     adaptation to changes in the input data statistics. (Take for\n   *     example a binary file with poorly compressible code followed by\n   *     a highly compressible string table.) Smaller buffer sizes give\n   *     fast adaptation but have of course the overhead of transmitting\n   *     trees more frequently.\n   *   - I can't count above 4\n   */\n\n  this.last_lit = 0;      /* running index in l_buf */\n\n  this.d_buf = 0;\n  /* Buffer index for distances. To simplify the code, d_buf and l_buf have\n   * the same number of elements. To use different lengths, an extra flag\n   * array would be necessary.\n   */\n\n  this.opt_len = 0;       /* bit length of current block with optimal trees */\n  this.static_len = 0;    /* bit length of current block with static trees */\n  this.matches = 0;       /* number of string matches in current block */\n  this.insert = 0;        /* bytes at end of window left to insert */\n\n\n  this.bi_buf = 0;\n  /* Output buffer. bits are inserted starting at the bottom (least\n   * significant bits).\n   */\n  this.bi_valid = 0;\n  /* Number of valid bits in bi_buf.  All bits above the last valid bit\n   * are always zero.\n   */\n\n  // Used for window memory init. We safely ignore it for JS. That makes\n  // sense only for pointers and memory check tools.\n  //this.high_water = 0;\n  /* High water mark offset in window for initialized bytes -- bytes above\n   * this are set to zero in order to avoid memory check warnings when\n   * longest match routines access bytes past the input.  This is then\n   * updated to the new high water mark.\n   */\n}\n\n\nfunction deflateResetKeep(strm) {\n  var s;\n\n  if (!strm || !strm.state) {\n    return err(strm, Z_STREAM_ERROR);\n  }\n\n  strm.total_in = strm.total_out = 0;\n  strm.data_type = Z_UNKNOWN;\n\n  s = strm.state;\n  s.pending = 0;\n  s.pending_out = 0;\n\n  if (s.wrap < 0) {\n    s.wrap = -s.wrap;\n    /* was made negative by deflate(..., Z_FINISH); */\n  }\n  s.status = (s.wrap ? INIT_STATE : BUSY_STATE);\n  strm.adler = (s.wrap === 2) ?\n    0  // crc32(0, Z_NULL, 0)\n  :\n    1; // adler32(0, Z_NULL, 0)\n  s.last_flush = Z_NO_FLUSH;\n  trees._tr_init(s);\n  return Z_OK;\n}\n\n\nfunction deflateReset(strm) {\n  var ret = deflateResetKeep(strm);\n  if (ret === Z_OK) {\n    lm_init(strm.state);\n  }\n  return ret;\n}\n\n\nfunction deflateSetHeader(strm, head) {\n  if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n  if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; }\n  strm.state.gzhead = head;\n  return Z_OK;\n}\n\n\nfunction deflateInit2(strm, level, method, windowBits, memLevel, strategy) {\n  if (!strm) { // === Z_NULL\n    return Z_STREAM_ERROR;\n  }\n  var wrap = 1;\n\n  if (level === Z_DEFAULT_COMPRESSION) {\n    level = 6;\n  }\n\n  if (windowBits < 0) { /* suppress zlib wrapper */\n    wrap = 0;\n    windowBits = -windowBits;\n  }\n\n  else if (windowBits > 15) {\n    wrap = 2;           /* write gzip wrapper instead */\n    windowBits -= 16;\n  }\n\n\n  if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||\n    windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||\n    strategy < 0 || strategy > Z_FIXED) {\n    return err(strm, Z_STREAM_ERROR);\n  }\n\n\n  if (windowBits === 8) {\n    windowBits = 9;\n  }\n  /* until 256-byte window bug fixed */\n\n  var s = new DeflateState();\n\n  strm.state = s;\n  s.strm = strm;\n\n  s.wrap = wrap;\n  s.gzhead = null;\n  s.w_bits = windowBits;\n  s.w_size = 1 << s.w_bits;\n  s.w_mask = s.w_size - 1;\n\n  s.hash_bits = memLevel + 7;\n  s.hash_size = 1 << s.hash_bits;\n  s.hash_mask = s.hash_size - 1;\n  s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);\n\n  s.window = new utils.Buf8(s.w_size * 2);\n  s.head = new utils.Buf16(s.hash_size);\n  s.prev = new utils.Buf16(s.w_size);\n\n  // Don't need mem init magic for JS.\n  //s.high_water = 0;  /* nothing written to s->window yet */\n\n  s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */\n\n  s.pending_buf_size = s.lit_bufsize * 4;\n\n  //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);\n  //s->pending_buf = (uchf *) overlay;\n  s.pending_buf = new utils.Buf8(s.pending_buf_size);\n\n  // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)\n  //s->d_buf = overlay + s->lit_bufsize/sizeof(ush);\n  s.d_buf = 1 * s.lit_bufsize;\n\n  //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;\n  s.l_buf = (1 + 2) * s.lit_bufsize;\n\n  s.level = level;\n  s.strategy = strategy;\n  s.method = method;\n\n  return deflateReset(strm);\n}\n\nfunction deflateInit(strm, level) {\n  return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);\n}\n\n\nfunction deflate(strm, flush) {\n  var old_flush, s;\n  var beg, val; // for gzip header write only\n\n  if (!strm || !strm.state ||\n    flush > Z_BLOCK || flush < 0) {\n    return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;\n  }\n\n  s = strm.state;\n\n  if (!strm.output ||\n      (!strm.input && strm.avail_in !== 0) ||\n      (s.status === FINISH_STATE && flush !== Z_FINISH)) {\n    return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);\n  }\n\n  s.strm = strm; /* just in case */\n  old_flush = s.last_flush;\n  s.last_flush = flush;\n\n  /* Write the header */\n  if (s.status === INIT_STATE) {\n\n    if (s.wrap === 2) { // GZIP header\n      strm.adler = 0;  //crc32(0L, Z_NULL, 0);\n      put_byte(s, 31);\n      put_byte(s, 139);\n      put_byte(s, 8);\n      if (!s.gzhead) { // s->gzhead == Z_NULL\n        put_byte(s, 0);\n        put_byte(s, 0);\n        put_byte(s, 0);\n        put_byte(s, 0);\n        put_byte(s, 0);\n        put_byte(s, s.level === 9 ? 2 :\n                    (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n                     4 : 0));\n        put_byte(s, OS_CODE);\n        s.status = BUSY_STATE;\n      }\n      else {\n        put_byte(s, (s.gzhead.text ? 1 : 0) +\n                    (s.gzhead.hcrc ? 2 : 0) +\n                    (!s.gzhead.extra ? 0 : 4) +\n                    (!s.gzhead.name ? 0 : 8) +\n                    (!s.gzhead.comment ? 0 : 16)\n                );\n        put_byte(s, s.gzhead.time & 0xff);\n        put_byte(s, (s.gzhead.time >> 8) & 0xff);\n        put_byte(s, (s.gzhead.time >> 16) & 0xff);\n        put_byte(s, (s.gzhead.time >> 24) & 0xff);\n        put_byte(s, s.level === 9 ? 2 :\n                    (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?\n                     4 : 0));\n        put_byte(s, s.gzhead.os & 0xff);\n        if (s.gzhead.extra && s.gzhead.extra.length) {\n          put_byte(s, s.gzhead.extra.length & 0xff);\n          put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);\n        }\n        if (s.gzhead.hcrc) {\n          strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);\n        }\n        s.gzindex = 0;\n        s.status = EXTRA_STATE;\n      }\n    }\n    else // DEFLATE header\n    {\n      var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;\n      var level_flags = -1;\n\n      if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {\n        level_flags = 0;\n      } else if (s.level < 6) {\n        level_flags = 1;\n      } else if (s.level === 6) {\n        level_flags = 2;\n      } else {\n        level_flags = 3;\n      }\n      header |= (level_flags << 6);\n      if (s.strstart !== 0) { header |= PRESET_DICT; }\n      header += 31 - (header % 31);\n\n      s.status = BUSY_STATE;\n      putShortMSB(s, header);\n\n      /* Save the adler32 of the preset dictionary: */\n      if (s.strstart !== 0) {\n        putShortMSB(s, strm.adler >>> 16);\n        putShortMSB(s, strm.adler & 0xffff);\n      }\n      strm.adler = 1; // adler32(0L, Z_NULL, 0);\n    }\n  }\n\n//#ifdef GZIP\n  if (s.status === EXTRA_STATE) {\n    if (s.gzhead.extra/* != Z_NULL*/) {\n      beg = s.pending;  /* start of bytes to update crc */\n\n      while (s.gzindex < (s.gzhead.extra.length & 0xffff)) {\n        if (s.pending === s.pending_buf_size) {\n          if (s.gzhead.hcrc && s.pending > beg) {\n            strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n          }\n          flush_pending(strm);\n          beg = s.pending;\n          if (s.pending === s.pending_buf_size) {\n            break;\n          }\n        }\n        put_byte(s, s.gzhead.extra[s.gzindex] & 0xff);\n        s.gzindex++;\n      }\n      if (s.gzhead.hcrc && s.pending > beg) {\n        strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n      }\n      if (s.gzindex === s.gzhead.extra.length) {\n        s.gzindex = 0;\n        s.status = NAME_STATE;\n      }\n    }\n    else {\n      s.status = NAME_STATE;\n    }\n  }\n  if (s.status === NAME_STATE) {\n    if (s.gzhead.name/* != Z_NULL*/) {\n      beg = s.pending;  /* start of bytes to update crc */\n      //int val;\n\n      do {\n        if (s.pending === s.pending_buf_size) {\n          if (s.gzhead.hcrc && s.pending > beg) {\n            strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n          }\n          flush_pending(strm);\n          beg = s.pending;\n          if (s.pending === s.pending_buf_size) {\n            val = 1;\n            break;\n          }\n        }\n        // JS specific: little magic to add zero terminator to end of string\n        if (s.gzindex < s.gzhead.name.length) {\n          val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;\n        } else {\n          val = 0;\n        }\n        put_byte(s, val);\n      } while (val !== 0);\n\n      if (s.gzhead.hcrc && s.pending > beg) {\n        strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n      }\n      if (val === 0) {\n        s.gzindex = 0;\n        s.status = COMMENT_STATE;\n      }\n    }\n    else {\n      s.status = COMMENT_STATE;\n    }\n  }\n  if (s.status === COMMENT_STATE) {\n    if (s.gzhead.comment/* != Z_NULL*/) {\n      beg = s.pending;  /* start of bytes to update crc */\n      //int val;\n\n      do {\n        if (s.pending === s.pending_buf_size) {\n          if (s.gzhead.hcrc && s.pending > beg) {\n            strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n          }\n          flush_pending(strm);\n          beg = s.pending;\n          if (s.pending === s.pending_buf_size) {\n            val = 1;\n            break;\n          }\n        }\n        // JS specific: little magic to add zero terminator to end of string\n        if (s.gzindex < s.gzhead.comment.length) {\n          val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;\n        } else {\n          val = 0;\n        }\n        put_byte(s, val);\n      } while (val !== 0);\n\n      if (s.gzhead.hcrc && s.pending > beg) {\n        strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);\n      }\n      if (val === 0) {\n        s.status = HCRC_STATE;\n      }\n    }\n    else {\n      s.status = HCRC_STATE;\n    }\n  }\n  if (s.status === HCRC_STATE) {\n    if (s.gzhead.hcrc) {\n      if (s.pending + 2 > s.pending_buf_size) {\n        flush_pending(strm);\n      }\n      if (s.pending + 2 <= s.pending_buf_size) {\n        put_byte(s, strm.adler & 0xff);\n        put_byte(s, (strm.adler >> 8) & 0xff);\n        strm.adler = 0; //crc32(0L, Z_NULL, 0);\n        s.status = BUSY_STATE;\n      }\n    }\n    else {\n      s.status = BUSY_STATE;\n    }\n  }\n//#endif\n\n  /* Flush as much pending output as possible */\n  if (s.pending !== 0) {\n    flush_pending(strm);\n    if (strm.avail_out === 0) {\n      /* Since avail_out is 0, deflate will be called again with\n       * more output space, but possibly with both pending and\n       * avail_in equal to zero. There won't be anything to do,\n       * but this is not an error situation so make sure we\n       * return OK instead of BUF_ERROR at next call of deflate:\n       */\n      s.last_flush = -1;\n      return Z_OK;\n    }\n\n    /* Make sure there is something to do and avoid duplicate consecutive\n     * flushes. For repeated and useless calls with Z_FINISH, we keep\n     * returning Z_STREAM_END instead of Z_BUF_ERROR.\n     */\n  } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&\n    flush !== Z_FINISH) {\n    return err(strm, Z_BUF_ERROR);\n  }\n\n  /* User must not provide more input after the first FINISH: */\n  if (s.status === FINISH_STATE && strm.avail_in !== 0) {\n    return err(strm, Z_BUF_ERROR);\n  }\n\n  /* Start a new block or continue the current one.\n   */\n  if (strm.avail_in !== 0 || s.lookahead !== 0 ||\n    (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {\n    var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) :\n      (s.strategy === Z_RLE ? deflate_rle(s, flush) :\n        configuration_table[s.level].func(s, flush));\n\n    if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {\n      s.status = FINISH_STATE;\n    }\n    if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {\n      if (strm.avail_out === 0) {\n        s.last_flush = -1;\n        /* avoid BUF_ERROR next call, see above */\n      }\n      return Z_OK;\n      /* If flush != Z_NO_FLUSH && avail_out == 0, the next call\n       * of deflate should use the same flush parameter to make sure\n       * that the flush is complete. So we don't have to output an\n       * empty block here, this will be done at next call. This also\n       * ensures that for a very small output buffer, we emit at most\n       * one empty block.\n       */\n    }\n    if (bstate === BS_BLOCK_DONE) {\n      if (flush === Z_PARTIAL_FLUSH) {\n        trees._tr_align(s);\n      }\n      else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */\n\n        trees._tr_stored_block(s, 0, 0, false);\n        /* For a full flush, this empty block will be recognized\n         * as a special marker by inflate_sync().\n         */\n        if (flush === Z_FULL_FLUSH) {\n          /*** CLEAR_HASH(s); ***/             /* forget history */\n          zero(s.head); // Fill with NIL (= 0);\n\n          if (s.lookahead === 0) {\n            s.strstart = 0;\n            s.block_start = 0;\n            s.insert = 0;\n          }\n        }\n      }\n      flush_pending(strm);\n      if (strm.avail_out === 0) {\n        s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */\n        return Z_OK;\n      }\n    }\n  }\n  //Assert(strm->avail_out > 0, \"bug2\");\n  //if (strm.avail_out <= 0) { throw new Error(\"bug2\");}\n\n  if (flush !== Z_FINISH) { return Z_OK; }\n  if (s.wrap <= 0) { return Z_STREAM_END; }\n\n  /* Write the trailer */\n  if (s.wrap === 2) {\n    put_byte(s, strm.adler & 0xff);\n    put_byte(s, (strm.adler >> 8) & 0xff);\n    put_byte(s, (strm.adler >> 16) & 0xff);\n    put_byte(s, (strm.adler >> 24) & 0xff);\n    put_byte(s, strm.total_in & 0xff);\n    put_byte(s, (strm.total_in >> 8) & 0xff);\n    put_byte(s, (strm.total_in >> 16) & 0xff);\n    put_byte(s, (strm.total_in >> 24) & 0xff);\n  }\n  else\n  {\n    putShortMSB(s, strm.adler >>> 16);\n    putShortMSB(s, strm.adler & 0xffff);\n  }\n\n  flush_pending(strm);\n  /* If avail_out is zero, the application will call deflate again\n   * to flush the rest.\n   */\n  if (s.wrap > 0) { s.wrap = -s.wrap; }\n  /* write the trailer only once! */\n  return s.pending !== 0 ? Z_OK : Z_STREAM_END;\n}\n\nfunction deflateEnd(strm) {\n  var status;\n\n  if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {\n    return Z_STREAM_ERROR;\n  }\n\n  status = strm.state.status;\n  if (status !== INIT_STATE &&\n    status !== EXTRA_STATE &&\n    status !== NAME_STATE &&\n    status !== COMMENT_STATE &&\n    status !== HCRC_STATE &&\n    status !== BUSY_STATE &&\n    status !== FINISH_STATE\n  ) {\n    return err(strm, Z_STREAM_ERROR);\n  }\n\n  strm.state = null;\n\n  return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;\n}\n\n\n/* =========================================================================\n * Initializes the compression dictionary from the given byte\n * sequence without producing any compressed output.\n */\nfunction deflateSetDictionary(strm, dictionary) {\n  var dictLength = dictionary.length;\n\n  var s;\n  var str, n;\n  var wrap;\n  var avail;\n  var next;\n  var input;\n  var tmpDict;\n\n  if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {\n    return Z_STREAM_ERROR;\n  }\n\n  s = strm.state;\n  wrap = s.wrap;\n\n  if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {\n    return Z_STREAM_ERROR;\n  }\n\n  /* when using zlib wrappers, compute Adler-32 for provided dictionary */\n  if (wrap === 1) {\n    /* adler32(strm->adler, dictionary, dictLength); */\n    strm.adler = adler32(strm.adler, dictionary, dictLength, 0);\n  }\n\n  s.wrap = 0;   /* avoid computing Adler-32 in read_buf */\n\n  /* if dictionary would fill window, just replace the history */\n  if (dictLength >= s.w_size) {\n    if (wrap === 0) {            /* already empty otherwise */\n      /*** CLEAR_HASH(s); ***/\n      zero(s.head); // Fill with NIL (= 0);\n      s.strstart = 0;\n      s.block_start = 0;\n      s.insert = 0;\n    }\n    /* use the tail */\n    // dictionary = dictionary.slice(dictLength - s.w_size);\n    tmpDict = new utils.Buf8(s.w_size);\n    utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0);\n    dictionary = tmpDict;\n    dictLength = s.w_size;\n  }\n  /* insert dictionary into window and hash */\n  avail = strm.avail_in;\n  next = strm.next_in;\n  input = strm.input;\n  strm.avail_in = dictLength;\n  strm.next_in = 0;\n  strm.input = dictionary;\n  fill_window(s);\n  while (s.lookahead >= MIN_MATCH) {\n    str = s.strstart;\n    n = s.lookahead - (MIN_MATCH - 1);\n    do {\n      /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */\n      s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;\n\n      s.prev[str & s.w_mask] = s.head[s.ins_h];\n\n      s.head[s.ins_h] = str;\n      str++;\n    } while (--n);\n    s.strstart = str;\n    s.lookahead = MIN_MATCH - 1;\n    fill_window(s);\n  }\n  s.strstart += s.lookahead;\n  s.block_start = s.strstart;\n  s.insert = s.lookahead;\n  s.lookahead = 0;\n  s.match_length = s.prev_length = MIN_MATCH - 1;\n  s.match_available = 0;\n  strm.next_in = next;\n  strm.input = input;\n  strm.avail_in = avail;\n  s.wrap = wrap;\n  return Z_OK;\n}\n\n\nexports.deflateInit = deflateInit;\nexports.deflateInit2 = deflateInit2;\nexports.deflateReset = deflateReset;\nexports.deflateResetKeep = deflateResetKeep;\nexports.deflateSetHeader = deflateSetHeader;\nexports.deflate = deflate;\nexports.deflateEnd = deflateEnd;\nexports.deflateSetDictionary = deflateSetDictionary;\nexports.deflateInfo = 'pako deflate (from Nodeca project)';\n\n/* Not implemented\nexports.deflateBound = deflateBound;\nexports.deflateCopy = deflateCopy;\nexports.deflateParams = deflateParams;\nexports.deflatePending = deflatePending;\nexports.deflatePrime = deflatePrime;\nexports.deflateTune = deflateTune;\n*/\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/pako/lib/zlib/deflate.js","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//   claim that you wrote the original software. If you use this software\n//   in a product, an acknowledgment in the product documentation would be\n//   appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n//   misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar utils = require('../utils/common');\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n//var Z_FILTERED          = 1;\n//var Z_HUFFMAN_ONLY      = 2;\n//var Z_RLE               = 3;\nvar Z_FIXED               = 4;\n//var Z_DEFAULT_STRATEGY  = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\nvar Z_BINARY              = 0;\nvar Z_TEXT                = 1;\n//var Z_ASCII             = 1; // = Z_TEXT\nvar Z_UNKNOWN             = 2;\n\n/*============================================================================*/\n\n\nfunction zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n// From zutil.h\n\nvar STORED_BLOCK = 0;\nvar STATIC_TREES = 1;\nvar DYN_TREES    = 2;\n/* The three kinds of block type */\n\nvar MIN_MATCH    = 3;\nvar MAX_MATCH    = 258;\n/* The minimum and maximum match lengths */\n\n// From deflate.h\n/* ===========================================================================\n * Internal compression state.\n */\n\nvar LENGTH_CODES  = 29;\n/* number of length codes, not counting the special END_BLOCK code */\n\nvar LITERALS      = 256;\n/* number of literal bytes 0..255 */\n\nvar L_CODES       = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\n\nvar D_CODES       = 30;\n/* number of distance codes */\n\nvar BL_CODES      = 19;\n/* number of codes used to transfer the bit lengths */\n\nvar HEAP_SIZE     = 2 * L_CODES + 1;\n/* maximum heap size */\n\nvar MAX_BITS      = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nvar Buf_size      = 16;\n/* size of bit buffer in bi_buf */\n\n\n/* ===========================================================================\n * Constants\n */\n\nvar MAX_BL_BITS = 7;\n/* Bit length codes must not exceed MAX_BL_BITS bits */\n\nvar END_BLOCK   = 256;\n/* end of block literal code */\n\nvar REP_3_6     = 16;\n/* repeat previous bit length 3-6 times (2 bits of repeat count) */\n\nvar REPZ_3_10   = 17;\n/* repeat a zero length 3-10 times  (3 bits of repeat count) */\n\nvar REPZ_11_138 = 18;\n/* repeat a zero length 11-138 times  (7 bits of repeat count) */\n\n/* eslint-disable comma-spacing,array-bracket-spacing */\nvar extra_lbits =   /* extra bits for each length code */\n  [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];\n\nvar extra_dbits =   /* extra bits for each distance code */\n  [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];\n\nvar extra_blbits =  /* extra bits for each bit length code */\n  [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];\n\nvar bl_order =\n  [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];\n/* eslint-enable comma-spacing,array-bracket-spacing */\n\n/* The lengths of the bit length codes are sent in order of decreasing\n * probability, to avoid transmitting the lengths for unused bit length codes.\n */\n\n/* ===========================================================================\n * Local data. These are initialized only once.\n */\n\n// We pre-fill arrays with 0 to avoid uninitialized gaps\n\nvar DIST_CODE_LEN = 512; /* see definition of array dist_code below */\n\n// !!!! Use flat array instead of structure, Freq = i*2, Len = i*2+1\nvar static_ltree  = new Array((L_CODES + 2) * 2);\nzero(static_ltree);\n/* The static literal tree. Since the bit lengths are imposed, there is no\n * need for the L_CODES extra codes used during heap construction. However\n * The codes 286 and 287 are needed to build a canonical tree (see _tr_init\n * below).\n */\n\nvar static_dtree  = new Array(D_CODES * 2);\nzero(static_dtree);\n/* The static distance tree. (Actually a trivial tree since all codes use\n * 5 bits.)\n */\n\nvar _dist_code    = new Array(DIST_CODE_LEN);\nzero(_dist_code);\n/* Distance codes. The first 256 values correspond to the distances\n * 3 .. 258, the last 256 values correspond to the top 8 bits of\n * the 15 bit distances.\n */\n\nvar _length_code  = new Array(MAX_MATCH - MIN_MATCH + 1);\nzero(_length_code);\n/* length code for each normalized match length (0 == MIN_MATCH) */\n\nvar base_length   = new Array(LENGTH_CODES);\nzero(base_length);\n/* First normalized length for each code (0 = MIN_MATCH) */\n\nvar base_dist     = new Array(D_CODES);\nzero(base_dist);\n/* First normalized distance for each code (0 = distance of 1) */\n\n\nfunction StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {\n\n  this.static_tree  = static_tree;  /* static tree or NULL */\n  this.extra_bits   = extra_bits;   /* extra bits for each code or NULL */\n  this.extra_base   = extra_base;   /* base index for extra_bits */\n  this.elems        = elems;        /* max number of elements in the tree */\n  this.max_length   = max_length;   /* max bit length for the codes */\n\n  // show if `static_tree` has data or dummy - needed for monomorphic objects\n  this.has_stree    = static_tree && static_tree.length;\n}\n\n\nvar static_l_desc;\nvar static_d_desc;\nvar static_bl_desc;\n\n\nfunction TreeDesc(dyn_tree, stat_desc) {\n  this.dyn_tree = dyn_tree;     /* the dynamic tree */\n  this.max_code = 0;            /* largest code with non zero frequency */\n  this.stat_desc = stat_desc;   /* the corresponding static tree */\n}\n\n\n\nfunction d_code(dist) {\n  return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];\n}\n\n\n/* ===========================================================================\n * Output a short LSB first on the stream.\n * IN assertion: there is enough room in pendingBuf.\n */\nfunction put_short(s, w) {\n//    put_byte(s, (uch)((w) & 0xff));\n//    put_byte(s, (uch)((ush)(w) >> 8));\n  s.pending_buf[s.pending++] = (w) & 0xff;\n  s.pending_buf[s.pending++] = (w >>> 8) & 0xff;\n}\n\n\n/* ===========================================================================\n * Send a value on a given number of bits.\n * IN assertion: length <= 16 and value fits in length bits.\n */\nfunction send_bits(s, value, length) {\n  if (s.bi_valid > (Buf_size - length)) {\n    s.bi_buf |= (value << s.bi_valid) & 0xffff;\n    put_short(s, s.bi_buf);\n    s.bi_buf = value >> (Buf_size - s.bi_valid);\n    s.bi_valid += length - Buf_size;\n  } else {\n    s.bi_buf |= (value << s.bi_valid) & 0xffff;\n    s.bi_valid += length;\n  }\n}\n\n\nfunction send_code(s, c, tree) {\n  send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/);\n}\n\n\n/* ===========================================================================\n * Reverse the first len bits of a code, using straightforward code (a faster\n * method would use a table)\n * IN assertion: 1 <= len <= 15\n */\nfunction bi_reverse(code, len) {\n  var res = 0;\n  do {\n    res |= code & 1;\n    code >>>= 1;\n    res <<= 1;\n  } while (--len > 0);\n  return res >>> 1;\n}\n\n\n/* ===========================================================================\n * Flush the bit buffer, keeping at most 7 bits in it.\n */\nfunction bi_flush(s) {\n  if (s.bi_valid === 16) {\n    put_short(s, s.bi_buf);\n    s.bi_buf = 0;\n    s.bi_valid = 0;\n\n  } else if (s.bi_valid >= 8) {\n    s.pending_buf[s.pending++] = s.bi_buf & 0xff;\n    s.bi_buf >>= 8;\n    s.bi_valid -= 8;\n  }\n}\n\n\n/* ===========================================================================\n * Compute the optimal bit lengths for a tree and update the total bit length\n * for the current block.\n * IN assertion: the fields freq and dad are set, heap[heap_max] and\n *    above are the tree nodes sorted by increasing frequency.\n * OUT assertions: the field len is set to the optimal bit length, the\n *     array bl_count contains the frequencies for each bit length.\n *     The length opt_len is updated; static_len is also updated if stree is\n *     not null.\n */\nfunction gen_bitlen(s, desc)\n//    deflate_state *s;\n//    tree_desc *desc;    /* the tree descriptor */\n{\n  var tree            = desc.dyn_tree;\n  var max_code        = desc.max_code;\n  var stree           = desc.stat_desc.static_tree;\n  var has_stree       = desc.stat_desc.has_stree;\n  var extra           = desc.stat_desc.extra_bits;\n  var base            = desc.stat_desc.extra_base;\n  var max_length      = desc.stat_desc.max_length;\n  var h;              /* heap index */\n  var n, m;           /* iterate over the tree elements */\n  var bits;           /* bit length */\n  var xbits;          /* extra bits */\n  var f;              /* frequency */\n  var overflow = 0;   /* number of elements with bit length too large */\n\n  for (bits = 0; bits <= MAX_BITS; bits++) {\n    s.bl_count[bits] = 0;\n  }\n\n  /* In a first pass, compute the optimal bit lengths (which may\n   * overflow in the case of the bit length tree).\n   */\n  tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */\n\n  for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {\n    n = s.heap[h];\n    bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;\n    if (bits > max_length) {\n      bits = max_length;\n      overflow++;\n    }\n    tree[n * 2 + 1]/*.Len*/ = bits;\n    /* We overwrite tree[n].Dad which is no longer needed */\n\n    if (n > max_code) { continue; } /* not a leaf node */\n\n    s.bl_count[bits]++;\n    xbits = 0;\n    if (n >= base) {\n      xbits = extra[n - base];\n    }\n    f = tree[n * 2]/*.Freq*/;\n    s.opt_len += f * (bits + xbits);\n    if (has_stree) {\n      s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);\n    }\n  }\n  if (overflow === 0) { return; }\n\n  // Trace((stderr,\"\\nbit length overflow\\n\"));\n  /* This happens for example on obj2 and pic of the Calgary corpus */\n\n  /* Find the first bit length which could increase: */\n  do {\n    bits = max_length - 1;\n    while (s.bl_count[bits] === 0) { bits--; }\n    s.bl_count[bits]--;      /* move one leaf down the tree */\n    s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */\n    s.bl_count[max_length]--;\n    /* The brother of the overflow item also moves one step up,\n     * but this does not affect bl_count[max_length]\n     */\n    overflow -= 2;\n  } while (overflow > 0);\n\n  /* Now recompute all bit lengths, scanning in increasing frequency.\n   * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all\n   * lengths instead of fixing only the wrong ones. This idea is taken\n   * from 'ar' written by Haruhiko Okumura.)\n   */\n  for (bits = max_length; bits !== 0; bits--) {\n    n = s.bl_count[bits];\n    while (n !== 0) {\n      m = s.heap[--h];\n      if (m > max_code) { continue; }\n      if (tree[m * 2 + 1]/*.Len*/ !== bits) {\n        // Trace((stderr,\"code %d bits %d->%d\\n\", m, tree[m].Len, bits));\n        s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;\n        tree[m * 2 + 1]/*.Len*/ = bits;\n      }\n      n--;\n    }\n  }\n}\n\n\n/* ===========================================================================\n * Generate the codes for a given tree and bit counts (which need not be\n * optimal).\n * IN assertion: the array bl_count contains the bit length statistics for\n * the given tree and the field len is set for all tree elements.\n * OUT assertion: the field code is set for all tree elements of non\n *     zero code length.\n */\nfunction gen_codes(tree, max_code, bl_count)\n//    ct_data *tree;             /* the tree to decorate */\n//    int max_code;              /* largest code with non zero frequency */\n//    ushf *bl_count;            /* number of codes at each bit length */\n{\n  var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n  var code = 0;              /* running code value */\n  var bits;                  /* bit index */\n  var n;                     /* code index */\n\n  /* The distribution counts are first used to generate the code values\n   * without bit reversal.\n   */\n  for (bits = 1; bits <= MAX_BITS; bits++) {\n    next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n  }\n  /* Check that the bit counts in bl_count are consistent. The last code\n   * must be all ones.\n   */\n  //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n  //        \"inconsistent bit counts\");\n  //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n  for (n = 0;  n <= max_code; n++) {\n    var len = tree[n * 2 + 1]/*.Len*/;\n    if (len === 0) { continue; }\n    /* Now reverse the bits */\n    tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n    //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n    //     n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n  }\n}\n\n\n/* ===========================================================================\n * Initialize the various 'constant' tables.\n */\nfunction tr_static_init() {\n  var n;        /* iterates over tree elements */\n  var bits;     /* bit counter */\n  var length;   /* length value */\n  var code;     /* code value */\n  var dist;     /* distance index */\n  var bl_count = new Array(MAX_BITS + 1);\n  /* number of codes at each bit length for an optimal tree */\n\n  // do check in _tr_init()\n  //if (static_init_done) return;\n\n  /* For some embedded targets, global variables are not initialized: */\n/*#ifdef NO_INIT_GLOBAL_POINTERS\n  static_l_desc.static_tree = static_ltree;\n  static_l_desc.extra_bits = extra_lbits;\n  static_d_desc.static_tree = static_dtree;\n  static_d_desc.extra_bits = extra_dbits;\n  static_bl_desc.extra_bits = extra_blbits;\n#endif*/\n\n  /* Initialize the mapping length (0..255) -> length code (0..28) */\n  length = 0;\n  for (code = 0; code < LENGTH_CODES - 1; code++) {\n    base_length[code] = length;\n    for (n = 0; n < (1 << extra_lbits[code]); n++) {\n      _length_code[length++] = code;\n    }\n  }\n  //Assert (length == 256, \"tr_static_init: length != 256\");\n  /* Note that the length 255 (match length 258) can be represented\n   * in two different ways: code 284 + 5 bits or code 285, so we\n   * overwrite length_code[255] to use the best encoding:\n   */\n  _length_code[length - 1] = code;\n\n  /* Initialize the mapping dist (0..32K) -> dist code (0..29) */\n  dist = 0;\n  for (code = 0; code < 16; code++) {\n    base_dist[code] = dist;\n    for (n = 0; n < (1 << extra_dbits[code]); n++) {\n      _dist_code[dist++] = code;\n    }\n  }\n  //Assert (dist == 256, \"tr_static_init: dist != 256\");\n  dist >>= 7; /* from now on, all distances are divided by 128 */\n  for (; code < D_CODES; code++) {\n    base_dist[code] = dist << 7;\n    for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {\n      _dist_code[256 + dist++] = code;\n    }\n  }\n  //Assert (dist == 256, \"tr_static_init: 256+dist != 512\");\n\n  /* Construct the codes of the static literal tree */\n  for (bits = 0; bits <= MAX_BITS; bits++) {\n    bl_count[bits] = 0;\n  }\n\n  n = 0;\n  while (n <= 143) {\n    static_ltree[n * 2 + 1]/*.Len*/ = 8;\n    n++;\n    bl_count[8]++;\n  }\n  while (n <= 255) {\n    static_ltree[n * 2 + 1]/*.Len*/ = 9;\n    n++;\n    bl_count[9]++;\n  }\n  while (n <= 279) {\n    static_ltree[n * 2 + 1]/*.Len*/ = 7;\n    n++;\n    bl_count[7]++;\n  }\n  while (n <= 287) {\n    static_ltree[n * 2 + 1]/*.Len*/ = 8;\n    n++;\n    bl_count[8]++;\n  }\n  /* Codes 286 and 287 do not exist, but we must include them in the\n   * tree construction to get a canonical Huffman tree (longest code\n   * all ones)\n   */\n  gen_codes(static_ltree, L_CODES + 1, bl_count);\n\n  /* The static distance tree is trivial: */\n  for (n = 0; n < D_CODES; n++) {\n    static_dtree[n * 2 + 1]/*.Len*/ = 5;\n    static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);\n  }\n\n  // Now data ready and we can init static trees\n  static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);\n  static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0,          D_CODES, MAX_BITS);\n  static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0,         BL_CODES, MAX_BL_BITS);\n\n  //static_init_done = true;\n}\n\n\n/* ===========================================================================\n * Initialize a new block.\n */\nfunction init_block(s) {\n  var n; /* iterates over tree elements */\n\n  /* Initialize the trees. */\n  for (n = 0; n < L_CODES;  n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }\n  for (n = 0; n < D_CODES;  n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }\n  for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }\n\n  s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;\n  s.opt_len = s.static_len = 0;\n  s.last_lit = s.matches = 0;\n}\n\n\n/* ===========================================================================\n * Flush the bit buffer and align the output on a byte boundary\n */\nfunction bi_windup(s)\n{\n  if (s.bi_valid > 8) {\n    put_short(s, s.bi_buf);\n  } else if (s.bi_valid > 0) {\n    //put_byte(s, (Byte)s->bi_buf);\n    s.pending_buf[s.pending++] = s.bi_buf;\n  }\n  s.bi_buf = 0;\n  s.bi_valid = 0;\n}\n\n/* ===========================================================================\n * Copy a stored block, storing first the length and its\n * one's complement if requested.\n */\nfunction copy_block(s, buf, len, header)\n//DeflateState *s;\n//charf    *buf;    /* the input data */\n//unsigned len;     /* its length */\n//int      header;  /* true if block header must be written */\n{\n  bi_windup(s);        /* align on byte boundary */\n\n  if (header) {\n    put_short(s, len);\n    put_short(s, ~len);\n  }\n//  while (len--) {\n//    put_byte(s, *buf++);\n//  }\n  utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);\n  s.pending += len;\n}\n\n/* ===========================================================================\n * Compares to subtrees, using the tree depth as tie breaker when\n * the subtrees have equal frequency. This minimizes the worst case length.\n */\nfunction smaller(tree, n, m, depth) {\n  var _n2 = n * 2;\n  var _m2 = m * 2;\n  return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||\n         (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));\n}\n\n/* ===========================================================================\n * Restore the heap property by moving down the tree starting at node k,\n * exchanging a node with the smallest of its two sons if necessary, stopping\n * when the heap property is re-established (each father smaller than its\n * two sons).\n */\nfunction pqdownheap(s, tree, k)\n//    deflate_state *s;\n//    ct_data *tree;  /* the tree to restore */\n//    int k;               /* node to move down */\n{\n  var v = s.heap[k];\n  var j = k << 1;  /* left son of k */\n  while (j <= s.heap_len) {\n    /* Set j to the smallest of the two sons: */\n    if (j < s.heap_len &&\n      smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {\n      j++;\n    }\n    /* Exit if v is smaller than both sons */\n    if (smaller(tree, v, s.heap[j], s.depth)) { break; }\n\n    /* Exchange v with the smallest son */\n    s.heap[k] = s.heap[j];\n    k = j;\n\n    /* And continue down the tree, setting j to the left son of k */\n    j <<= 1;\n  }\n  s.heap[k] = v;\n}\n\n\n// inlined manually\n// var SMALLEST = 1;\n\n/* ===========================================================================\n * Send the block data compressed using the given Huffman trees\n */\nfunction compress_block(s, ltree, dtree)\n//    deflate_state *s;\n//    const ct_data *ltree; /* literal tree */\n//    const ct_data *dtree; /* distance tree */\n{\n  var dist;           /* distance of matched string */\n  var lc;             /* match length or unmatched char (if dist == 0) */\n  var lx = 0;         /* running index in l_buf */\n  var code;           /* the code to send */\n  var extra;          /* number of extra bits to send */\n\n  if (s.last_lit !== 0) {\n    do {\n      dist = (s.pending_buf[s.d_buf + lx * 2] << 8) | (s.pending_buf[s.d_buf + lx * 2 + 1]);\n      lc = s.pending_buf[s.l_buf + lx];\n      lx++;\n\n      if (dist === 0) {\n        send_code(s, lc, ltree); /* send a literal byte */\n        //Tracecv(isgraph(lc), (stderr,\" '%c' \", lc));\n      } else {\n        /* Here, lc is the match length - MIN_MATCH */\n        code = _length_code[lc];\n        send_code(s, code + LITERALS + 1, ltree); /* send the length code */\n        extra = extra_lbits[code];\n        if (extra !== 0) {\n          lc -= base_length[code];\n          send_bits(s, lc, extra);       /* send the extra length bits */\n        }\n        dist--; /* dist is now the match distance - 1 */\n        code = d_code(dist);\n        //Assert (code < D_CODES, \"bad d_code\");\n\n        send_code(s, code, dtree);       /* send the distance code */\n        extra = extra_dbits[code];\n        if (extra !== 0) {\n          dist -= base_dist[code];\n          send_bits(s, dist, extra);   /* send the extra distance bits */\n        }\n      } /* literal or match pair ? */\n\n      /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */\n      //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,\n      //       \"pendingBuf overflow\");\n\n    } while (lx < s.last_lit);\n  }\n\n  send_code(s, END_BLOCK, ltree);\n}\n\n\n/* ===========================================================================\n * Construct one Huffman tree and assigns the code bit strings and lengths.\n * Update the total bit length for the current block.\n * IN assertion: the field freq is set for all tree elements.\n * OUT assertions: the fields len and code are set to the optimal bit length\n *     and corresponding code. The length opt_len is updated; static_len is\n *     also updated if stree is not null. The field max_code is set.\n */\nfunction build_tree(s, desc)\n//    deflate_state *s;\n//    tree_desc *desc; /* the tree descriptor */\n{\n  var tree     = desc.dyn_tree;\n  var stree    = desc.stat_desc.static_tree;\n  var has_stree = desc.stat_desc.has_stree;\n  var elems    = desc.stat_desc.elems;\n  var n, m;          /* iterate over heap elements */\n  var max_code = -1; /* largest code with non zero frequency */\n  var node;          /* new node being created */\n\n  /* Construct the initial heap, with least frequent element in\n   * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].\n   * heap[0] is not used.\n   */\n  s.heap_len = 0;\n  s.heap_max = HEAP_SIZE;\n\n  for (n = 0; n < elems; n++) {\n    if (tree[n * 2]/*.Freq*/ !== 0) {\n      s.heap[++s.heap_len] = max_code = n;\n      s.depth[n] = 0;\n\n    } else {\n      tree[n * 2 + 1]/*.Len*/ = 0;\n    }\n  }\n\n  /* The pkzip format requires that at least one distance code exists,\n   * and that at least one bit should be sent even if there is only one\n   * possible code. So to avoid special checks later on we force at least\n   * two codes of non zero frequency.\n   */\n  while (s.heap_len < 2) {\n    node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0);\n    tree[node * 2]/*.Freq*/ = 1;\n    s.depth[node] = 0;\n    s.opt_len--;\n\n    if (has_stree) {\n      s.static_len -= stree[node * 2 + 1]/*.Len*/;\n    }\n    /* node is 0 or 1 so it does not have extra bits */\n  }\n  desc.max_code = max_code;\n\n  /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,\n   * establish sub-heaps of increasing lengths:\n   */\n  for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }\n\n  /* Construct the Huffman tree by repeatedly combining the least two\n   * frequent nodes.\n   */\n  node = elems;              /* next internal node of the tree */\n  do {\n    //pqremove(s, tree, n);  /* n = node of least frequency */\n    /*** pqremove ***/\n    n = s.heap[1/*SMALLEST*/];\n    s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];\n    pqdownheap(s, tree, 1/*SMALLEST*/);\n    /***/\n\n    m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */\n\n    s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */\n    s.heap[--s.heap_max] = m;\n\n    /* Create a new node father of n and m */\n    tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;\n    s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;\n    tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node;\n\n    /* and insert the new node in the heap */\n    s.heap[1/*SMALLEST*/] = node++;\n    pqdownheap(s, tree, 1/*SMALLEST*/);\n\n  } while (s.heap_len >= 2);\n\n  s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];\n\n  /* At this point, the fields freq and dad are set. We can now\n   * generate the bit lengths.\n   */\n  gen_bitlen(s, desc);\n\n  /* The field len is now set, we can generate the bit codes */\n  gen_codes(tree, max_code, s.bl_count);\n}\n\n\n/* ===========================================================================\n * Scan a literal or distance tree to determine the frequencies of the codes\n * in the bit length tree.\n */\nfunction scan_tree(s, tree, max_code)\n//    deflate_state *s;\n//    ct_data *tree;   /* the tree to be scanned */\n//    int max_code;    /* and its largest code of non zero frequency */\n{\n  var n;                     /* iterates over all tree elements */\n  var prevlen = -1;          /* last emitted length */\n  var curlen;                /* length of current code */\n\n  var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n  var count = 0;             /* repeat count of the current code */\n  var max_count = 7;         /* max repeat count */\n  var min_count = 4;         /* min repeat count */\n\n  if (nextlen === 0) {\n    max_count = 138;\n    min_count = 3;\n  }\n  tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */\n\n  for (n = 0; n <= max_code; n++) {\n    curlen = nextlen;\n    nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n    if (++count < max_count && curlen === nextlen) {\n      continue;\n\n    } else if (count < min_count) {\n      s.bl_tree[curlen * 2]/*.Freq*/ += count;\n\n    } else if (curlen !== 0) {\n\n      if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }\n      s.bl_tree[REP_3_6 * 2]/*.Freq*/++;\n\n    } else if (count <= 10) {\n      s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;\n\n    } else {\n      s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;\n    }\n\n    count = 0;\n    prevlen = curlen;\n\n    if (nextlen === 0) {\n      max_count = 138;\n      min_count = 3;\n\n    } else if (curlen === nextlen) {\n      max_count = 6;\n      min_count = 3;\n\n    } else {\n      max_count = 7;\n      min_count = 4;\n    }\n  }\n}\n\n\n/* ===========================================================================\n * Send a literal or distance tree in compressed form, using the codes in\n * bl_tree.\n */\nfunction send_tree(s, tree, max_code)\n//    deflate_state *s;\n//    ct_data *tree; /* the tree to be scanned */\n//    int max_code;       /* and its largest code of non zero frequency */\n{\n  var n;                     /* iterates over all tree elements */\n  var prevlen = -1;          /* last emitted length */\n  var curlen;                /* length of current code */\n\n  var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */\n\n  var count = 0;             /* repeat count of the current code */\n  var max_count = 7;         /* max repeat count */\n  var min_count = 4;         /* min repeat count */\n\n  /* tree[max_code+1].Len = -1; */  /* guard already set */\n  if (nextlen === 0) {\n    max_count = 138;\n    min_count = 3;\n  }\n\n  for (n = 0; n <= max_code; n++) {\n    curlen = nextlen;\n    nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;\n\n    if (++count < max_count && curlen === nextlen) {\n      continue;\n\n    } else if (count < min_count) {\n      do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);\n\n    } else if (curlen !== 0) {\n      if (curlen !== prevlen) {\n        send_code(s, curlen, s.bl_tree);\n        count--;\n      }\n      //Assert(count >= 3 && count <= 6, \" 3_6?\");\n      send_code(s, REP_3_6, s.bl_tree);\n      send_bits(s, count - 3, 2);\n\n    } else if (count <= 10) {\n      send_code(s, REPZ_3_10, s.bl_tree);\n      send_bits(s, count - 3, 3);\n\n    } else {\n      send_code(s, REPZ_11_138, s.bl_tree);\n      send_bits(s, count - 11, 7);\n    }\n\n    count = 0;\n    prevlen = curlen;\n    if (nextlen === 0) {\n      max_count = 138;\n      min_count = 3;\n\n    } else if (curlen === nextlen) {\n      max_count = 6;\n      min_count = 3;\n\n    } else {\n      max_count = 7;\n      min_count = 4;\n    }\n  }\n}\n\n\n/* ===========================================================================\n * Construct the Huffman tree for the bit lengths and return the index in\n * bl_order of the last bit length code to send.\n */\nfunction build_bl_tree(s) {\n  var max_blindex;  /* index of last bit length code of non zero freq */\n\n  /* Determine the bit length frequencies for literal and distance trees */\n  scan_tree(s, s.dyn_ltree, s.l_desc.max_code);\n  scan_tree(s, s.dyn_dtree, s.d_desc.max_code);\n\n  /* Build the bit length tree: */\n  build_tree(s, s.bl_desc);\n  /* opt_len now includes the length of the tree representations, except\n   * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.\n   */\n\n  /* Determine the number of bit length codes to send. The pkzip format\n   * requires that at least 4 bit length codes be sent. (appnote.txt says\n   * 3 but the actual value used is 4.)\n   */\n  for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {\n    if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {\n      break;\n    }\n  }\n  /* Update opt_len to include the bit length tree and counts */\n  s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;\n  //Tracev((stderr, \"\\ndyn trees: dyn %ld, stat %ld\",\n  //        s->opt_len, s->static_len));\n\n  return max_blindex;\n}\n\n\n/* ===========================================================================\n * Send the header for a block using dynamic Huffman trees: the counts, the\n * lengths of the bit length codes, the literal tree and the distance tree.\n * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.\n */\nfunction send_all_trees(s, lcodes, dcodes, blcodes)\n//    deflate_state *s;\n//    int lcodes, dcodes, blcodes; /* number of codes for each tree */\n{\n  var rank;                    /* index in bl_order */\n\n  //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, \"not enough codes\");\n  //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,\n  //        \"too many codes\");\n  //Tracev((stderr, \"\\nbl counts: \"));\n  send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */\n  send_bits(s, dcodes - 1,   5);\n  send_bits(s, blcodes - 4,  4); /* not -3 as stated in appnote.txt */\n  for (rank = 0; rank < blcodes; rank++) {\n    //Tracev((stderr, \"\\nbl code %2d \", bl_order[rank]));\n    send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);\n  }\n  //Tracev((stderr, \"\\nbl tree: sent %ld\", s->bits_sent));\n\n  send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */\n  //Tracev((stderr, \"\\nlit tree: sent %ld\", s->bits_sent));\n\n  send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */\n  //Tracev((stderr, \"\\ndist tree: sent %ld\", s->bits_sent));\n}\n\n\n/* ===========================================================================\n * Check if the data type is TEXT or BINARY, using the following algorithm:\n * - TEXT if the two conditions below are satisfied:\n *    a) There are no non-portable control characters belonging to the\n *       \"black list\" (0..6, 14..25, 28..31).\n *    b) There is at least one printable character belonging to the\n *       \"white list\" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).\n * - BINARY otherwise.\n * - The following partially-portable control characters form a\n *   \"gray list\" that is ignored in this detection algorithm:\n *   (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).\n * IN assertion: the fields Freq of dyn_ltree are set.\n */\nfunction detect_data_type(s) {\n  /* black_mask is the bit mask of black-listed bytes\n   * set bits 0..6, 14..25, and 28..31\n   * 0xf3ffc07f = binary 11110011111111111100000001111111\n   */\n  var black_mask = 0xf3ffc07f;\n  var n;\n\n  /* Check for non-textual (\"black-listed\") bytes. */\n  for (n = 0; n <= 31; n++, black_mask >>>= 1) {\n    if ((black_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) {\n      return Z_BINARY;\n    }\n  }\n\n  /* Check for textual (\"white-listed\") bytes. */\n  if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||\n      s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {\n    return Z_TEXT;\n  }\n  for (n = 32; n < LITERALS; n++) {\n    if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {\n      return Z_TEXT;\n    }\n  }\n\n  /* There are no \"black-listed\" or \"white-listed\" bytes:\n   * this stream either is empty or has tolerated (\"gray-listed\") bytes only.\n   */\n  return Z_BINARY;\n}\n\n\nvar static_init_done = false;\n\n/* ===========================================================================\n * Initialize the tree data structures for a new zlib stream.\n */\nfunction _tr_init(s)\n{\n\n  if (!static_init_done) {\n    tr_static_init();\n    static_init_done = true;\n  }\n\n  s.l_desc  = new TreeDesc(s.dyn_ltree, static_l_desc);\n  s.d_desc  = new TreeDesc(s.dyn_dtree, static_d_desc);\n  s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);\n\n  s.bi_buf = 0;\n  s.bi_valid = 0;\n\n  /* Initialize the first block of the first file: */\n  init_block(s);\n}\n\n\n/* ===========================================================================\n * Send a stored block\n */\nfunction _tr_stored_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf;       /* input block */\n//ulg stored_len;   /* length of input block */\n//int last;         /* one if this is the last block for a file */\n{\n  send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3);    /* send block type */\n  copy_block(s, buf, stored_len, true); /* with header */\n}\n\n\n/* ===========================================================================\n * Send one empty static block to give enough lookahead for inflate.\n * This takes 10 bits, of which 7 may remain in the bit buffer.\n */\nfunction _tr_align(s) {\n  send_bits(s, STATIC_TREES << 1, 3);\n  send_code(s, END_BLOCK, static_ltree);\n  bi_flush(s);\n}\n\n\n/* ===========================================================================\n * Determine the best encoding for the current block: dynamic trees, static\n * trees or store, and output the encoded block to the zip file.\n */\nfunction _tr_flush_block(s, buf, stored_len, last)\n//DeflateState *s;\n//charf *buf;       /* input block, or NULL if too old */\n//ulg stored_len;   /* length of input block */\n//int last;         /* one if this is the last block for a file */\n{\n  var opt_lenb, static_lenb;  /* opt_len and static_len in bytes */\n  var max_blindex = 0;        /* index of last bit length code of non zero freq */\n\n  /* Build the Huffman trees unless a stored block is forced */\n  if (s.level > 0) {\n\n    /* Check if the file is binary or text */\n    if (s.strm.data_type === Z_UNKNOWN) {\n      s.strm.data_type = detect_data_type(s);\n    }\n\n    /* Construct the literal and distance trees */\n    build_tree(s, s.l_desc);\n    // Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\", s->opt_len,\n    //        s->static_len));\n\n    build_tree(s, s.d_desc);\n    // Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\", s->opt_len,\n    //        s->static_len));\n    /* At this point, opt_len and static_len are the total bit lengths of\n     * the compressed block data, excluding the tree representations.\n     */\n\n    /* Build the bit length tree for the above two trees, and get the index\n     * in bl_order of the last bit length code to send.\n     */\n    max_blindex = build_bl_tree(s);\n\n    /* Determine the best encoding. Compute the block lengths in bytes. */\n    opt_lenb = (s.opt_len + 3 + 7) >>> 3;\n    static_lenb = (s.static_len + 3 + 7) >>> 3;\n\n    // Tracev((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u \",\n    //        opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,\n    //        s->last_lit));\n\n    if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }\n\n  } else {\n    // Assert(buf != (char*)0, \"lost buf\");\n    opt_lenb = static_lenb = stored_len + 5; /* force a stored block */\n  }\n\n  if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {\n    /* 4: two words for the lengths */\n\n    /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.\n     * Otherwise we can't have processed more than WSIZE input bytes since\n     * the last block flush, because compression would have been\n     * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n     * transform a block into a stored block.\n     */\n    _tr_stored_block(s, buf, stored_len, last);\n\n  } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {\n\n    send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);\n    compress_block(s, static_ltree, static_dtree);\n\n  } else {\n    send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);\n    send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);\n    compress_block(s, s.dyn_ltree, s.dyn_dtree);\n  }\n  // Assert (s->compressed_len == s->bits_sent, \"bad compressed size\");\n  /* The above check is made mod 2^32, for files larger than 512 MB\n   * and uLong implemented on 32 bits.\n   */\n  init_block(s);\n\n  if (last) {\n    bi_windup(s);\n  }\n  // Tracev((stderr,\"\\ncomprlen %lu(%lu) \", s->compressed_len>>3,\n  //       s->compressed_len-7*last));\n}\n\n/* ===========================================================================\n * Save the match info and tally the frequency counts. Return true if\n * the current block must be flushed.\n */\nfunction _tr_tally(s, dist, lc)\n//    deflate_state *s;\n//    unsigned dist;  /* distance of matched string */\n//    unsigned lc;    /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n  //var out_length, in_length, dcode;\n\n  s.pending_buf[s.d_buf + s.last_lit * 2]     = (dist >>> 8) & 0xff;\n  s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n  s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n  s.last_lit++;\n\n  if (dist === 0) {\n    /* lc is the unmatched char */\n    s.dyn_ltree[lc * 2]/*.Freq*/++;\n  } else {\n    s.matches++;\n    /* Here, lc is the match length - MIN_MATCH */\n    dist--;             /* dist = match distance - 1 */\n    //Assert((ush)dist < (ush)MAX_DIST(s) &&\n    //       (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n    //       (ush)d_code(dist) < (ush)D_CODES,  \"_tr_tally: bad match\");\n\n    s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;\n    s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n  }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n//  /* Try to guess if it is profitable to stop the current block here */\n//  if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n//    /* Compute an upper bound for the compressed length */\n//    out_length = s.last_lit*8;\n//    in_length = s.strstart - s.block_start;\n//\n//    for (dcode = 0; dcode < D_CODES; dcode++) {\n//      out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n//    }\n//    out_length >>>= 3;\n//    //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n//    //       s->last_lit, in_length, out_length,\n//    //       100L - out_length*100L/in_length));\n//    if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n//      return true;\n//    }\n//  }\n//#endif\n\n  return (s.last_lit === s.lit_bufsize - 1);\n  /* We avoid equality with lit_bufsize because of wraparound at 64K\n   * on 16 bit machines and because stored blocks are restricted to\n   * 64K-1 bytes.\n   */\n}\n\nexports._tr_init  = _tr_init;\nexports._tr_stored_block = _tr_stored_block;\nexports._tr_flush_block  = _tr_flush_block;\nexports._tr_tally = _tr_tally;\nexports._tr_align = _tr_align;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/pako/lib/zlib/trees.js","'use strict';\n\n\nvar zlib_inflate = require('./zlib/inflate');\nvar utils        = require('./utils/common');\nvar strings      = require('./utils/strings');\nvar c            = require('./zlib/constants');\nvar msg          = require('./zlib/messages');\nvar ZStream      = require('./zlib/zstream');\nvar GZheader     = require('./zlib/gzheader');\n\nvar toString = Object.prototype.toString;\n\n/**\n * class Inflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[inflate]]\n * and [[inflateRaw]].\n **/\n\n/* internal\n * inflate.chunks -> Array\n *\n * Chunks of output data, if [[Inflate#onData]] not overridden.\n **/\n\n/**\n * Inflate.result -> Uint8Array|Array|String\n *\n * Uncompressed result, generated by default [[Inflate#onData]]\n * and [[Inflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Inflate#push]] with `Z_FINISH` / `true` param) or if you\n * push a chunk with explicit flush (call [[Inflate#push]] with\n * `Z_SYNC_FLUSH` param).\n **/\n\n/**\n * Inflate.err -> Number\n *\n * Error code after inflate finished. 0 (Z_OK) on success.\n * Should be checked if broken data possible.\n **/\n\n/**\n * Inflate.msg -> String\n *\n * Error message, if [[Inflate.err]] != 0\n **/\n\n\n/**\n * new Inflate(options)\n * - options (Object): zlib inflate options.\n *\n * Creates new inflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `windowBits`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw inflate\n * - `to` (String) - if equal to 'string', then result will be converted\n *   from utf8 to utf16 (javascript) string. When string output requested,\n *   chunk length can differ from `chunkSize`, depending on content.\n *\n * By default, when no options set, autodetect deflate/gzip data format via\n * wrapper header.\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n *   , chunk1 = Uint8Array([1,2,3,4,5,6,7,8,9])\n *   , chunk2 = Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * var inflate = new pako.Inflate({ level: 3});\n *\n * inflate.push(chunk1, false);\n * inflate.push(chunk2, true);  // true -> last chunk\n *\n * if (inflate.err) { throw new Error(inflate.err); }\n *\n * console.log(inflate.result);\n * ```\n **/\nfunction Inflate(options) {\n  if (!(this instanceof Inflate)) return new Inflate(options);\n\n  this.options = utils.assign({\n    chunkSize: 16384,\n    windowBits: 0,\n    to: ''\n  }, options || {});\n\n  var opt = this.options;\n\n  // Force window size for `raw` data, if not set directly,\n  // because we have no header for autodetect.\n  if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {\n    opt.windowBits = -opt.windowBits;\n    if (opt.windowBits === 0) { opt.windowBits = -15; }\n  }\n\n  // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate\n  if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&\n      !(options && options.windowBits)) {\n    opt.windowBits += 32;\n  }\n\n  // Gzip header has no info about windows size, we can do autodetect only\n  // for deflate. So, if window size not set, force it to max when gzip possible\n  if ((opt.windowBits > 15) && (opt.windowBits < 48)) {\n    // bit 3 (16) -> gzipped data\n    // bit 4 (32) -> autodetect gzip/deflate\n    if ((opt.windowBits & 15) === 0) {\n      opt.windowBits |= 15;\n    }\n  }\n\n  this.err    = 0;      // error code, if happens (0 = Z_OK)\n  this.msg    = '';     // error message\n  this.ended  = false;  // used to avoid multiple onEnd() calls\n  this.chunks = [];     // chunks of compressed data\n\n  this.strm   = new ZStream();\n  this.strm.avail_out = 0;\n\n  var status  = zlib_inflate.inflateInit2(\n    this.strm,\n    opt.windowBits\n  );\n\n  if (status !== c.Z_OK) {\n    throw new Error(msg[status]);\n  }\n\n  this.header = new GZheader();\n\n  zlib_inflate.inflateGetHeader(this.strm, this.header);\n}\n\n/**\n * Inflate#push(data[, mode]) -> Boolean\n * - data (Uint8Array|Array|ArrayBuffer|String): input data\n * - mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.\n *   See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.\n *\n * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with\n * new output chunks. Returns `true` on success. The last data block must have\n * mode Z_FINISH (or `true`). That will flush internal pending buffers and call\n * [[Inflate#onEnd]]. For interim explicit flushes (without ending the stream) you\n * can use mode Z_SYNC_FLUSH, keeping the decompression context.\n *\n * On fail call [[Inflate#onEnd]] with error code and return false.\n *\n * We strongly recommend to use `Uint8Array` on input for best speed (output\n * format is detected automatically). Also, don't skip last param and always\n * use the same type in your code (boolean or number). That will improve JS speed.\n *\n * For regular `Array`-s make sure all elements are [0..255].\n *\n * ##### Example\n *\n * ```javascript\n * push(chunk, false); // push one of data chunks\n * ...\n * push(chunk, true);  // push last chunk\n * ```\n **/\nInflate.prototype.push = function (data, mode) {\n  var strm = this.strm;\n  var chunkSize = this.options.chunkSize;\n  var dictionary = this.options.dictionary;\n  var status, _mode;\n  var next_out_utf8, tail, utf8str;\n  var dict;\n\n  // Flag to properly process Z_BUF_ERROR on testing inflate call\n  // when we check that all output data was flushed.\n  var allowBufError = false;\n\n  if (this.ended) { return false; }\n  _mode = (mode === ~~mode) ? mode : ((mode === true) ? c.Z_FINISH : c.Z_NO_FLUSH);\n\n  // Convert data if needed\n  if (typeof data === 'string') {\n    // Only binary strings can be decompressed on practice\n    strm.input = strings.binstring2buf(data);\n  } else if (toString.call(data) === '[object ArrayBuffer]') {\n    strm.input = new Uint8Array(data);\n  } else {\n    strm.input = data;\n  }\n\n  strm.next_in = 0;\n  strm.avail_in = strm.input.length;\n\n  do {\n    if (strm.avail_out === 0) {\n      strm.output = new utils.Buf8(chunkSize);\n      strm.next_out = 0;\n      strm.avail_out = chunkSize;\n    }\n\n    status = zlib_inflate.inflate(strm, c.Z_NO_FLUSH);    /* no bad return value */\n\n    if (status === c.Z_NEED_DICT && dictionary) {\n      // Convert data if needed\n      if (typeof dictionary === 'string') {\n        dict = strings.string2buf(dictionary);\n      } else if (toString.call(dictionary) === '[object ArrayBuffer]') {\n        dict = new Uint8Array(dictionary);\n      } else {\n        dict = dictionary;\n      }\n\n      status = zlib_inflate.inflateSetDictionary(this.strm, dict);\n\n    }\n\n    if (status === c.Z_BUF_ERROR && allowBufError === true) {\n      status = c.Z_OK;\n      allowBufError = false;\n    }\n\n    if (status !== c.Z_STREAM_END && status !== c.Z_OK) {\n      this.onEnd(status);\n      this.ended = true;\n      return false;\n    }\n\n    if (strm.next_out) {\n      if (strm.avail_out === 0 || status === c.Z_STREAM_END || (strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH))) {\n\n        if (this.options.to === 'string') {\n\n          next_out_utf8 = strings.utf8border(strm.output, strm.next_out);\n\n          tail = strm.next_out - next_out_utf8;\n          utf8str = strings.buf2string(strm.output, next_out_utf8);\n\n          // move tail\n          strm.next_out = tail;\n          strm.avail_out = chunkSize - tail;\n          if (tail) { utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); }\n\n          this.onData(utf8str);\n\n        } else {\n          this.onData(utils.shrinkBuf(strm.output, strm.next_out));\n        }\n      }\n    }\n\n    // When no more input data, we should check that internal inflate buffers\n    // are flushed. The only way to do it when avail_out = 0 - run one more\n    // inflate pass. But if output data not exists, inflate return Z_BUF_ERROR.\n    // Here we set flag to process this error properly.\n    //\n    // NOTE. Deflate does not return error in this case and does not needs such\n    // logic.\n    if (strm.avail_in === 0 && strm.avail_out === 0) {\n      allowBufError = true;\n    }\n\n  } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c.Z_STREAM_END);\n\n  if (status === c.Z_STREAM_END) {\n    _mode = c.Z_FINISH;\n  }\n\n  // Finalize on the last chunk.\n  if (_mode === c.Z_FINISH) {\n    status = zlib_inflate.inflateEnd(this.strm);\n    this.onEnd(status);\n    this.ended = true;\n    return status === c.Z_OK;\n  }\n\n  // callback interim results if Z_SYNC_FLUSH.\n  if (_mode === c.Z_SYNC_FLUSH) {\n    this.onEnd(c.Z_OK);\n    strm.avail_out = 0;\n    return true;\n  }\n\n  return true;\n};\n\n\n/**\n * Inflate#onData(chunk) -> Void\n * - chunk (Uint8Array|Array|String): output data. Type of array depends\n *   on js engine support. When string output requested, each chunk\n *   will be string.\n *\n * By default, stores data blocks in `chunks[]` property and glue\n * those in `onEnd`. Override this handler, if you need another behaviour.\n **/\nInflate.prototype.onData = function (chunk) {\n  this.chunks.push(chunk);\n};\n\n\n/**\n * Inflate#onEnd(status) -> Void\n * - status (Number): inflate status. 0 (Z_OK) on success,\n *   other if not.\n *\n * Called either after you tell inflate that the input stream is\n * complete (Z_FINISH) or should be flushed (Z_SYNC_FLUSH)\n * or if an error happened. By default - join collected chunks,\n * free memory and fill `results` / `err` properties.\n **/\nInflate.prototype.onEnd = function (status) {\n  // On success - join\n  if (status === c.Z_OK) {\n    if (this.options.to === 'string') {\n      // Glue & convert here, until we teach pako to send\n      // utf8 aligned strings to onData\n      this.result = this.chunks.join('');\n    } else {\n      this.result = utils.flattenChunks(this.chunks);\n    }\n  }\n  this.chunks = [];\n  this.err = status;\n  this.msg = this.strm.msg;\n};\n\n\n/**\n * inflate(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Decompress `data` with inflate/ungzip and `options`. Autodetect\n * format via wrapper header by default. That's why we don't provide\n * separate `ungzip` method.\n *\n * Supported options are:\n *\n * - windowBits\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information.\n *\n * Sugar (options):\n *\n * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify\n *   negative windowBits implicitly.\n * - `to` (String) - if equal to 'string', then result will be converted\n *   from utf8 to utf16 (javascript) string. When string output requested,\n *   chunk length can differ from `chunkSize`, depending on content.\n *\n *\n * ##### Example:\n *\n * ```javascript\n * var pako = require('pako')\n *   , input = pako.deflate([1,2,3,4,5,6,7,8,9])\n *   , output;\n *\n * try {\n *   output = pako.inflate(input);\n * } catch (err)\n *   console.log(err);\n * }\n * ```\n **/\nfunction inflate(input, options) {\n  var inflator = new Inflate(options);\n\n  inflator.push(input, true);\n\n  // That will never happens, if you don't cheat with options :)\n  if (inflator.err) { throw inflator.msg || msg[inflator.err]; }\n\n  return inflator.result;\n}\n\n\n/**\n * inflateRaw(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * The same as [[inflate]], but creates raw data, without wrapper\n * (header and adler32 crc).\n **/\nfunction inflateRaw(input, options) {\n  options = options || {};\n  options.raw = true;\n  return inflate(input, options);\n}\n\n\n/**\n * ungzip(data[, options]) -> Uint8Array|Array|String\n * - data (Uint8Array|Array|String): input data to decompress.\n * - options (Object): zlib inflate options.\n *\n * Just shortcut to [[inflate]], because it autodetects format\n * by header.content. Done for convenience.\n **/\n\n\nexports.Inflate = Inflate;\nexports.inflate = inflate;\nexports.inflateRaw = inflateRaw;\nexports.ungzip  = inflate;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/pako/lib/inflate.js","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//   claim that you wrote the original software. If you use this software\n//   in a product, an acknowledgment in the product documentation would be\n//   appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n//   misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar utils         = require('../utils/common');\nvar adler32       = require('./adler32');\nvar crc32         = require('./crc32');\nvar inflate_fast  = require('./inffast');\nvar inflate_table = require('./inftrees');\n\nvar CODES = 0;\nvar LENS = 1;\nvar DISTS = 2;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n/* Allowed flush values; see deflate() and inflate() below for details */\n//var Z_NO_FLUSH      = 0;\n//var Z_PARTIAL_FLUSH = 1;\n//var Z_SYNC_FLUSH    = 2;\n//var Z_FULL_FLUSH    = 3;\nvar Z_FINISH        = 4;\nvar Z_BLOCK         = 5;\nvar Z_TREES         = 6;\n\n\n/* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\nvar Z_OK            = 0;\nvar Z_STREAM_END    = 1;\nvar Z_NEED_DICT     = 2;\n//var Z_ERRNO         = -1;\nvar Z_STREAM_ERROR  = -2;\nvar Z_DATA_ERROR    = -3;\nvar Z_MEM_ERROR     = -4;\nvar Z_BUF_ERROR     = -5;\n//var Z_VERSION_ERROR = -6;\n\n/* The deflate compression method */\nvar Z_DEFLATED  = 8;\n\n\n/* STATES ====================================================================*/\n/* ===========================================================================*/\n\n\nvar    HEAD = 1;       /* i: waiting for magic header */\nvar    FLAGS = 2;      /* i: waiting for method and flags (gzip) */\nvar    TIME = 3;       /* i: waiting for modification time (gzip) */\nvar    OS = 4;         /* i: waiting for extra flags and operating system (gzip) */\nvar    EXLEN = 5;      /* i: waiting for extra length (gzip) */\nvar    EXTRA = 6;      /* i: waiting for extra bytes (gzip) */\nvar    NAME = 7;       /* i: waiting for end of file name (gzip) */\nvar    COMMENT = 8;    /* i: waiting for end of comment (gzip) */\nvar    HCRC = 9;       /* i: waiting for header crc (gzip) */\nvar    DICTID = 10;    /* i: waiting for dictionary check value */\nvar    DICT = 11;      /* waiting for inflateSetDictionary() call */\nvar        TYPE = 12;      /* i: waiting for type bits, including last-flag bit */\nvar        TYPEDO = 13;    /* i: same, but skip check to exit inflate on new block */\nvar        STORED = 14;    /* i: waiting for stored size (length and complement) */\nvar        COPY_ = 15;     /* i/o: same as COPY below, but only first time in */\nvar        COPY = 16;      /* i/o: waiting for input or output to copy stored block */\nvar        TABLE = 17;     /* i: waiting for dynamic block table lengths */\nvar        LENLENS = 18;   /* i: waiting for code length code lengths */\nvar        CODELENS = 19;  /* i: waiting for length/lit and distance code lengths */\nvar            LEN_ = 20;      /* i: same as LEN below, but only first time in */\nvar            LEN = 21;       /* i: waiting for length/lit/eob code */\nvar            LENEXT = 22;    /* i: waiting for length extra bits */\nvar            DIST = 23;      /* i: waiting for distance code */\nvar            DISTEXT = 24;   /* i: waiting for distance extra bits */\nvar            MATCH = 25;     /* o: waiting for output space to copy string */\nvar            LIT = 26;       /* o: waiting for output space to write literal */\nvar    CHECK = 27;     /* i: waiting for 32-bit check value */\nvar    LENGTH = 28;    /* i: waiting for 32-bit length (gzip) */\nvar    DONE = 29;      /* finished check, done -- remain here until reset */\nvar    BAD = 30;       /* got a data error -- remain here until reset */\nvar    MEM = 31;       /* got an inflate() memory error -- remain here until reset */\nvar    SYNC = 32;      /* looking for synchronization bytes to restart inflate() */\n\n/* ===========================================================================*/\n\n\n\nvar ENOUGH_LENS = 852;\nvar ENOUGH_DISTS = 592;\n//var ENOUGH =  (ENOUGH_LENS+ENOUGH_DISTS);\n\nvar MAX_WBITS = 15;\n/* 32K LZ77 window */\nvar DEF_WBITS = MAX_WBITS;\n\n\nfunction zswap32(q) {\n  return  (((q >>> 24) & 0xff) +\n          ((q >>> 8) & 0xff00) +\n          ((q & 0xff00) << 8) +\n          ((q & 0xff) << 24));\n}\n\n\nfunction InflateState() {\n  this.mode = 0;             /* current inflate mode */\n  this.last = false;          /* true if processing last block */\n  this.wrap = 0;              /* bit 0 true for zlib, bit 1 true for gzip */\n  this.havedict = false;      /* true if dictionary provided */\n  this.flags = 0;             /* gzip header method and flags (0 if zlib) */\n  this.dmax = 0;              /* zlib header max distance (INFLATE_STRICT) */\n  this.check = 0;             /* protected copy of check value */\n  this.total = 0;             /* protected copy of output count */\n  // TODO: may be {}\n  this.head = null;           /* where to save gzip header information */\n\n  /* sliding window */\n  this.wbits = 0;             /* log base 2 of requested window size */\n  this.wsize = 0;             /* window size or zero if not using window */\n  this.whave = 0;             /* valid bytes in the window */\n  this.wnext = 0;             /* window write index */\n  this.window = null;         /* allocated sliding window, if needed */\n\n  /* bit accumulator */\n  this.hold = 0;              /* input bit accumulator */\n  this.bits = 0;              /* number of bits in \"in\" */\n\n  /* for string and stored block copying */\n  this.length = 0;            /* literal or length of data to copy */\n  this.offset = 0;            /* distance back to copy string from */\n\n  /* for table and code decoding */\n  this.extra = 0;             /* extra bits needed */\n\n  /* fixed and dynamic code tables */\n  this.lencode = null;          /* starting table for length/literal codes */\n  this.distcode = null;         /* starting table for distance codes */\n  this.lenbits = 0;           /* index bits for lencode */\n  this.distbits = 0;          /* index bits for distcode */\n\n  /* dynamic table building */\n  this.ncode = 0;             /* number of code length code lengths */\n  this.nlen = 0;              /* number of length code lengths */\n  this.ndist = 0;             /* number of distance code lengths */\n  this.have = 0;              /* number of code lengths in lens[] */\n  this.next = null;              /* next available space in codes[] */\n\n  this.lens = new utils.Buf16(320); /* temporary storage for code lengths */\n  this.work = new utils.Buf16(288); /* work area for code table building */\n\n  /*\n   because we don't have pointers in js, we use lencode and distcode directly\n   as buffers so we don't need codes\n  */\n  //this.codes = new utils.Buf32(ENOUGH);       /* space for code tables */\n  this.lendyn = null;              /* dynamic table for length/literal codes (JS specific) */\n  this.distdyn = null;             /* dynamic table for distance codes (JS specific) */\n  this.sane = 0;                   /* if false, allow invalid distance too far */\n  this.back = 0;                   /* bits back of last unprocessed length/lit */\n  this.was = 0;                    /* initial length of match */\n}\n\nfunction inflateResetKeep(strm) {\n  var state;\n\n  if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n  state = strm.state;\n  strm.total_in = strm.total_out = state.total = 0;\n  strm.msg = ''; /*Z_NULL*/\n  if (state.wrap) {       /* to support ill-conceived Java test suite */\n    strm.adler = state.wrap & 1;\n  }\n  state.mode = HEAD;\n  state.last = 0;\n  state.havedict = 0;\n  state.dmax = 32768;\n  state.head = null/*Z_NULL*/;\n  state.hold = 0;\n  state.bits = 0;\n  //state.lencode = state.distcode = state.next = state.codes;\n  state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);\n  state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);\n\n  state.sane = 1;\n  state.back = -1;\n  //Tracev((stderr, \"inflate: reset\\n\"));\n  return Z_OK;\n}\n\nfunction inflateReset(strm) {\n  var state;\n\n  if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n  state = strm.state;\n  state.wsize = 0;\n  state.whave = 0;\n  state.wnext = 0;\n  return inflateResetKeep(strm);\n\n}\n\nfunction inflateReset2(strm, windowBits) {\n  var wrap;\n  var state;\n\n  /* get the state */\n  if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n  state = strm.state;\n\n  /* extract wrap request from windowBits parameter */\n  if (windowBits < 0) {\n    wrap = 0;\n    windowBits = -windowBits;\n  }\n  else {\n    wrap = (windowBits >> 4) + 1;\n    if (windowBits < 48) {\n      windowBits &= 15;\n    }\n  }\n\n  /* set number of window bits, free window if different */\n  if (windowBits && (windowBits < 8 || windowBits > 15)) {\n    return Z_STREAM_ERROR;\n  }\n  if (state.window !== null && state.wbits !== windowBits) {\n    state.window = null;\n  }\n\n  /* update state and reset the rest of it */\n  state.wrap = wrap;\n  state.wbits = windowBits;\n  return inflateReset(strm);\n}\n\nfunction inflateInit2(strm, windowBits) {\n  var ret;\n  var state;\n\n  if (!strm) { return Z_STREAM_ERROR; }\n  //strm.msg = Z_NULL;                 /* in case we return an error */\n\n  state = new InflateState();\n\n  //if (state === Z_NULL) return Z_MEM_ERROR;\n  //Tracev((stderr, \"inflate: allocated\\n\"));\n  strm.state = state;\n  state.window = null/*Z_NULL*/;\n  ret = inflateReset2(strm, windowBits);\n  if (ret !== Z_OK) {\n    strm.state = null/*Z_NULL*/;\n  }\n  return ret;\n}\n\nfunction inflateInit(strm) {\n  return inflateInit2(strm, DEF_WBITS);\n}\n\n\n/*\n Return state with length and distance decoding tables and index sizes set to\n fixed code decoding.  Normally this returns fixed tables from inffixed.h.\n If BUILDFIXED is defined, then instead this routine builds the tables the\n first time it's called, and returns those tables the first time and\n thereafter.  This reduces the size of the code by about 2K bytes, in\n exchange for a little execution time.  However, BUILDFIXED should not be\n used for threaded applications, since the rewriting of the tables and virgin\n may not be thread-safe.\n */\nvar virgin = true;\n\nvar lenfix, distfix; // We have no pointers in JS, so keep tables separate\n\nfunction fixedtables(state) {\n  /* build fixed huffman tables if first call (may not be thread safe) */\n  if (virgin) {\n    var sym;\n\n    lenfix = new utils.Buf32(512);\n    distfix = new utils.Buf32(32);\n\n    /* literal/length table */\n    sym = 0;\n    while (sym < 144) { state.lens[sym++] = 8; }\n    while (sym < 256) { state.lens[sym++] = 9; }\n    while (sym < 280) { state.lens[sym++] = 7; }\n    while (sym < 288) { state.lens[sym++] = 8; }\n\n    inflate_table(LENS,  state.lens, 0, 288, lenfix,   0, state.work, { bits: 9 });\n\n    /* distance table */\n    sym = 0;\n    while (sym < 32) { state.lens[sym++] = 5; }\n\n    inflate_table(DISTS, state.lens, 0, 32,   distfix, 0, state.work, { bits: 5 });\n\n    /* do this just once */\n    virgin = false;\n  }\n\n  state.lencode = lenfix;\n  state.lenbits = 9;\n  state.distcode = distfix;\n  state.distbits = 5;\n}\n\n\n/*\n Update the window with the last wsize (normally 32K) bytes written before\n returning.  If window does not exist yet, create it.  This is only called\n when a window is already in use, or when output has been written during this\n inflate call, but the end of the deflate stream has not been reached yet.\n It is also called to create a window for dictionary data when a dictionary\n is loaded.\n\n Providing output buffers larger than 32K to inflate() should provide a speed\n advantage, since only the last 32K of output is copied to the sliding window\n upon return from inflate(), and since all distances after the first 32K of\n output will fall in the output data, making match copies simpler and faster.\n The advantage may be dependent on the size of the processor's data caches.\n */\nfunction updatewindow(strm, src, end, copy) {\n  var dist;\n  var state = strm.state;\n\n  /* if it hasn't been done already, allocate space for the window */\n  if (state.window === null) {\n    state.wsize = 1 << state.wbits;\n    state.wnext = 0;\n    state.whave = 0;\n\n    state.window = new utils.Buf8(state.wsize);\n  }\n\n  /* copy state->wsize or less output bytes into the circular window */\n  if (copy >= state.wsize) {\n    utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);\n    state.wnext = 0;\n    state.whave = state.wsize;\n  }\n  else {\n    dist = state.wsize - state.wnext;\n    if (dist > copy) {\n      dist = copy;\n    }\n    //zmemcpy(state->window + state->wnext, end - copy, dist);\n    utils.arraySet(state.window, src, end - copy, dist, state.wnext);\n    copy -= dist;\n    if (copy) {\n      //zmemcpy(state->window, end - copy, copy);\n      utils.arraySet(state.window, src, end - copy, copy, 0);\n      state.wnext = copy;\n      state.whave = state.wsize;\n    }\n    else {\n      state.wnext += dist;\n      if (state.wnext === state.wsize) { state.wnext = 0; }\n      if (state.whave < state.wsize) { state.whave += dist; }\n    }\n  }\n  return 0;\n}\n\nfunction inflate(strm, flush) {\n  var state;\n  var input, output;          // input/output buffers\n  var next;                   /* next input INDEX */\n  var put;                    /* next output INDEX */\n  var have, left;             /* available input and output */\n  var hold;                   /* bit buffer */\n  var bits;                   /* bits in bit buffer */\n  var _in, _out;              /* save starting available input and output */\n  var copy;                   /* number of stored or match bytes to copy */\n  var from;                   /* where to copy match bytes from */\n  var from_source;\n  var here = 0;               /* current decoding table entry */\n  var here_bits, here_op, here_val; // paked \"here\" denormalized (JS specific)\n  //var last;                   /* parent table entry */\n  var last_bits, last_op, last_val; // paked \"last\" denormalized (JS specific)\n  var len;                    /* length to copy for repeats, bits to drop */\n  var ret;                    /* return code */\n  var hbuf = new utils.Buf8(4);    /* buffer for gzip header crc calculation */\n  var opts;\n\n  var n; // temporary var for NEED_BITS\n\n  var order = /* permutation of code lengths */\n    [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ];\n\n\n  if (!strm || !strm.state || !strm.output ||\n      (!strm.input && strm.avail_in !== 0)) {\n    return Z_STREAM_ERROR;\n  }\n\n  state = strm.state;\n  if (state.mode === TYPE) { state.mode = TYPEDO; }    /* skip check */\n\n\n  //--- LOAD() ---\n  put = strm.next_out;\n  output = strm.output;\n  left = strm.avail_out;\n  next = strm.next_in;\n  input = strm.input;\n  have = strm.avail_in;\n  hold = state.hold;\n  bits = state.bits;\n  //---\n\n  _in = have;\n  _out = left;\n  ret = Z_OK;\n\n  inf_leave: // goto emulation\n  for (;;) {\n    switch (state.mode) {\n      case HEAD:\n        if (state.wrap === 0) {\n          state.mode = TYPEDO;\n          break;\n        }\n        //=== NEEDBITS(16);\n        while (bits < 16) {\n          if (have === 0) { break inf_leave; }\n          have--;\n          hold += input[next++] << bits;\n          bits += 8;\n        }\n        //===//\n        if ((state.wrap & 2) && hold === 0x8b1f) {  /* gzip header */\n          state.check = 0/*crc32(0L, Z_NULL, 0)*/;\n          //=== CRC2(state.check, hold);\n          hbuf[0] = hold & 0xff;\n          hbuf[1] = (hold >>> 8) & 0xff;\n          state.check = crc32(state.check, hbuf, 2, 0);\n          //===//\n\n          //=== INITBITS();\n          hold = 0;\n          bits = 0;\n          //===//\n          state.mode = FLAGS;\n          break;\n        }\n        state.flags = 0;           /* expect zlib header */\n        if (state.head) {\n          state.head.done = false;\n        }\n        if (!(state.wrap & 1) ||   /* check if zlib header allowed */\n          (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {\n          strm.msg = 'incorrect header check';\n          state.mode = BAD;\n          break;\n        }\n        if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {\n          strm.msg = 'unknown compression method';\n          state.mode = BAD;\n          break;\n        }\n        //--- DROPBITS(4) ---//\n        hold >>>= 4;\n        bits -= 4;\n        //---//\n        len = (hold & 0x0f)/*BITS(4)*/ + 8;\n        if (state.wbits === 0) {\n          state.wbits = len;\n        }\n        else if (len > state.wbits) {\n          strm.msg = 'invalid window size';\n          state.mode = BAD;\n          break;\n        }\n        state.dmax = 1 << len;\n        //Tracev((stderr, \"inflate:   zlib header ok\\n\"));\n        strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n        state.mode = hold & 0x200 ? DICTID : TYPE;\n        //=== INITBITS();\n        hold = 0;\n        bits = 0;\n        //===//\n        break;\n      case FLAGS:\n        //=== NEEDBITS(16); */\n        while (bits < 16) {\n          if (have === 0) { break inf_leave; }\n          have--;\n          hold += input[next++] << bits;\n          bits += 8;\n        }\n        //===//\n        state.flags = hold;\n        if ((state.flags & 0xff) !== Z_DEFLATED) {\n          strm.msg = 'unknown compression method';\n          state.mode = BAD;\n          break;\n        }\n        if (state.flags & 0xe000) {\n          strm.msg = 'unknown header flags set';\n          state.mode = BAD;\n          break;\n        }\n        if (state.head) {\n          state.head.text = ((hold >> 8) & 1);\n        }\n        if (state.flags & 0x0200) {\n          //=== CRC2(state.check, hold);\n          hbuf[0] = hold & 0xff;\n          hbuf[1] = (hold >>> 8) & 0xff;\n          state.check = crc32(state.check, hbuf, 2, 0);\n          //===//\n        }\n        //=== INITBITS();\n        hold = 0;\n        bits = 0;\n        //===//\n        state.mode = TIME;\n        /* falls through */\n      case TIME:\n        //=== NEEDBITS(32); */\n        while (bits < 32) {\n          if (have === 0) { break inf_leave; }\n          have--;\n          hold += input[next++] << bits;\n          bits += 8;\n        }\n        //===//\n        if (state.head) {\n          state.head.time = hold;\n        }\n        if (state.flags & 0x0200) {\n          //=== CRC4(state.check, hold)\n          hbuf[0] = hold & 0xff;\n          hbuf[1] = (hold >>> 8) & 0xff;\n          hbuf[2] = (hold >>> 16) & 0xff;\n          hbuf[3] = (hold >>> 24) & 0xff;\n          state.check = crc32(state.check, hbuf, 4, 0);\n          //===\n        }\n        //=== INITBITS();\n        hold = 0;\n        bits = 0;\n        //===//\n        state.mode = OS;\n        /* falls through */\n      case OS:\n        //=== NEEDBITS(16); */\n        while (bits < 16) {\n          if (have === 0) { break inf_leave; }\n          have--;\n          hold += input[next++] << bits;\n          bits += 8;\n        }\n        //===//\n        if (state.head) {\n          state.head.xflags = (hold & 0xff);\n          state.head.os = (hold >> 8);\n        }\n        if (state.flags & 0x0200) {\n          //=== CRC2(state.check, hold);\n          hbuf[0] = hold & 0xff;\n          hbuf[1] = (hold >>> 8) & 0xff;\n          state.check = crc32(state.check, hbuf, 2, 0);\n          //===//\n        }\n        //=== INITBITS();\n        hold = 0;\n        bits = 0;\n        //===//\n        state.mode = EXLEN;\n        /* falls through */\n      case EXLEN:\n        if (state.flags & 0x0400) {\n          //=== NEEDBITS(16); */\n          while (bits < 16) {\n            if (have === 0) { break inf_leave; }\n            have--;\n            hold += input[next++] << bits;\n            bits += 8;\n          }\n          //===//\n          state.length = hold;\n          if (state.head) {\n            state.head.extra_len = hold;\n          }\n          if (state.flags & 0x0200) {\n            //=== CRC2(state.check, hold);\n            hbuf[0] = hold & 0xff;\n            hbuf[1] = (hold >>> 8) & 0xff;\n            state.check = crc32(state.check, hbuf, 2, 0);\n            //===//\n          }\n          //=== INITBITS();\n          hold = 0;\n          bits = 0;\n          //===//\n        }\n        else if (state.head) {\n          state.head.extra = null/*Z_NULL*/;\n        }\n        state.mode = EXTRA;\n        /* falls through */\n      case EXTRA:\n        if (state.flags & 0x0400) {\n          copy = state.length;\n          if (copy > have) { copy = have; }\n          if (copy) {\n            if (state.head) {\n              len = state.head.extra_len - state.length;\n              if (!state.head.extra) {\n                // Use untyped array for more convenient processing later\n                state.head.extra = new Array(state.head.extra_len);\n              }\n              utils.arraySet(\n                state.head.extra,\n                input,\n                next,\n                // extra field is limited to 65536 bytes\n                // - no need for additional size check\n                copy,\n                /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/\n                len\n              );\n              //zmemcpy(state.head.extra + len, next,\n              //        len + copy > state.head.extra_max ?\n              //        state.head.extra_max - len : copy);\n            }\n            if (state.flags & 0x0200) {\n              state.check = crc32(state.check, input, copy, next);\n            }\n            have -= copy;\n            next += copy;\n            state.length -= copy;\n          }\n          if (state.length) { break inf_leave; }\n        }\n        state.length = 0;\n        state.mode = NAME;\n        /* falls through */\n      case NAME:\n        if (state.flags & 0x0800) {\n          if (have === 0) { break inf_leave; }\n          copy = 0;\n          do {\n            // TODO: 2 or 1 bytes?\n            len = input[next + copy++];\n            /* use constant limit because in js we should not preallocate memory */\n            if (state.head && len &&\n                (state.length < 65536 /*state.head.name_max*/)) {\n              state.head.name += String.fromCharCode(len);\n            }\n          } while (len && copy < have);\n\n          if (state.flags & 0x0200) {\n            state.check = crc32(state.check, input, copy, next);\n          }\n          have -= copy;\n          next += copy;\n          if (len) { break inf_leave; }\n        }\n        else if (state.head) {\n          state.head.name = null;\n        }\n        state.length = 0;\n        state.mode = COMMENT;\n        /* falls through */\n      case COMMENT:\n        if (state.flags & 0x1000) {\n          if (have === 0) { break inf_leave; }\n          copy = 0;\n          do {\n            len = input[next + copy++];\n            /* use constant limit because in js we should not preallocate memory */\n            if (state.head && len &&\n                (state.length < 65536 /*state.head.comm_max*/)) {\n              state.head.comment += String.fromCharCode(len);\n            }\n          } while (len && copy < have);\n          if (state.flags & 0x0200) {\n            state.check = crc32(state.check, input, copy, next);\n          }\n          have -= copy;\n          next += copy;\n          if (len) { break inf_leave; }\n        }\n        else if (state.head) {\n          state.head.comment = null;\n        }\n        state.mode = HCRC;\n        /* falls through */\n      case HCRC:\n        if (state.flags & 0x0200) {\n          //=== NEEDBITS(16); */\n          while (bits < 16) {\n            if (have === 0) { break inf_leave; }\n            have--;\n            hold += input[next++] << bits;\n            bits += 8;\n          }\n          //===//\n          if (hold !== (state.check & 0xffff)) {\n            strm.msg = 'header crc mismatch';\n            state.mode = BAD;\n            break;\n          }\n          //=== INITBITS();\n          hold = 0;\n          bits = 0;\n          //===//\n        }\n        if (state.head) {\n          state.head.hcrc = ((state.flags >> 9) & 1);\n          state.head.done = true;\n        }\n        strm.adler = state.check = 0;\n        state.mode = TYPE;\n        break;\n      case DICTID:\n        //=== NEEDBITS(32); */\n        while (bits < 32) {\n          if (have === 0) { break inf_leave; }\n          have--;\n          hold += input[next++] << bits;\n          bits += 8;\n        }\n        //===//\n        strm.adler = state.check = zswap32(hold);\n        //=== INITBITS();\n        hold = 0;\n        bits = 0;\n        //===//\n        state.mode = DICT;\n        /* falls through */\n      case DICT:\n        if (state.havedict === 0) {\n          //--- RESTORE() ---\n          strm.next_out = put;\n          strm.avail_out = left;\n          strm.next_in = next;\n          strm.avail_in = have;\n          state.hold = hold;\n          state.bits = bits;\n          //---\n          return Z_NEED_DICT;\n        }\n        strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;\n        state.mode = TYPE;\n        /* falls through */\n      case TYPE:\n        if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }\n        /* falls through */\n      case TYPEDO:\n        if (state.last) {\n          //--- BYTEBITS() ---//\n          hold >>>= bits & 7;\n          bits -= bits & 7;\n          //---//\n          state.mode = CHECK;\n          break;\n        }\n        //=== NEEDBITS(3); */\n        while (bits < 3) {\n          if (have === 0) { break inf_leave; }\n          have--;\n          hold += input[next++] << bits;\n          bits += 8;\n        }\n        //===//\n        state.last = (hold & 0x01)/*BITS(1)*/;\n        //--- DROPBITS(1) ---//\n        hold >>>= 1;\n        bits -= 1;\n        //---//\n\n        switch ((hold & 0x03)/*BITS(2)*/) {\n          case 0:                             /* stored block */\n            //Tracev((stderr, \"inflate:     stored block%s\\n\",\n            //        state.last ? \" (last)\" : \"\"));\n            state.mode = STORED;\n            break;\n          case 1:                             /* fixed block */\n            fixedtables(state);\n            //Tracev((stderr, \"inflate:     fixed codes block%s\\n\",\n            //        state.last ? \" (last)\" : \"\"));\n            state.mode = LEN_;             /* decode codes */\n            if (flush === Z_TREES) {\n              //--- DROPBITS(2) ---//\n              hold >>>= 2;\n              bits -= 2;\n              //---//\n              break inf_leave;\n            }\n            break;\n          case 2:                             /* dynamic block */\n            //Tracev((stderr, \"inflate:     dynamic codes block%s\\n\",\n            //        state.last ? \" (last)\" : \"\"));\n            state.mode = TABLE;\n            break;\n          case 3:\n            strm.msg = 'invalid block type';\n            state.mode = BAD;\n        }\n        //--- DROPBITS(2) ---//\n        hold >>>= 2;\n        bits -= 2;\n        //---//\n        break;\n      case STORED:\n        //--- BYTEBITS() ---// /* go to byte boundary */\n        hold >>>= bits & 7;\n        bits -= bits & 7;\n        //---//\n        //=== NEEDBITS(32); */\n        while (bits < 32) {\n          if (have === 0) { break inf_leave; }\n          have--;\n          hold += input[next++] << bits;\n          bits += 8;\n        }\n        //===//\n        if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {\n          strm.msg = 'invalid stored block lengths';\n          state.mode = BAD;\n          break;\n        }\n        state.length = hold & 0xffff;\n        //Tracev((stderr, \"inflate:       stored length %u\\n\",\n        //        state.length));\n        //=== INITBITS();\n        hold = 0;\n        bits = 0;\n        //===//\n        state.mode = COPY_;\n        if (flush === Z_TREES) { break inf_leave; }\n        /* falls through */\n      case COPY_:\n        state.mode = COPY;\n        /* falls through */\n      case COPY:\n        copy = state.length;\n        if (copy) {\n          if (copy > have) { copy = have; }\n          if (copy > left) { copy = left; }\n          if (copy === 0) { break inf_leave; }\n          //--- zmemcpy(put, next, copy); ---\n          utils.arraySet(output, input, next, copy, put);\n          //---//\n          have -= copy;\n          next += copy;\n          left -= copy;\n          put += copy;\n          state.length -= copy;\n          break;\n        }\n        //Tracev((stderr, \"inflate:       stored end\\n\"));\n        state.mode = TYPE;\n        break;\n      case TABLE:\n        //=== NEEDBITS(14); */\n        while (bits < 14) {\n          if (have === 0) { break inf_leave; }\n          have--;\n          hold += input[next++] << bits;\n          bits += 8;\n        }\n        //===//\n        state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;\n        //--- DROPBITS(5) ---//\n        hold >>>= 5;\n        bits -= 5;\n        //---//\n        state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;\n        //--- DROPBITS(5) ---//\n        hold >>>= 5;\n        bits -= 5;\n        //---//\n        state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;\n        //--- DROPBITS(4) ---//\n        hold >>>= 4;\n        bits -= 4;\n        //---//\n//#ifndef PKZIP_BUG_WORKAROUND\n        if (state.nlen > 286 || state.ndist > 30) {\n          strm.msg = 'too many length or distance symbols';\n          state.mode = BAD;\n          break;\n        }\n//#endif\n        //Tracev((stderr, \"inflate:       table sizes ok\\n\"));\n        state.have = 0;\n        state.mode = LENLENS;\n        /* falls through */\n      case LENLENS:\n        while (state.have < state.ncode) {\n          //=== NEEDBITS(3);\n          while (bits < 3) {\n            if (have === 0) { break inf_leave; }\n            have--;\n            hold += input[next++] << bits;\n            bits += 8;\n          }\n          //===//\n          state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);\n          //--- DROPBITS(3) ---//\n          hold >>>= 3;\n          bits -= 3;\n          //---//\n        }\n        while (state.have < 19) {\n          state.lens[order[state.have++]] = 0;\n        }\n        // We have separate tables & no pointers. 2 commented lines below not needed.\n        //state.next = state.codes;\n        //state.lencode = state.next;\n        // Switch to use dynamic table\n        state.lencode = state.lendyn;\n        state.lenbits = 7;\n\n        opts = { bits: state.lenbits };\n        ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);\n        state.lenbits = opts.bits;\n\n        if (ret) {\n          strm.msg = 'invalid code lengths set';\n          state.mode = BAD;\n          break;\n        }\n        //Tracev((stderr, \"inflate:       code lengths ok\\n\"));\n        state.have = 0;\n        state.mode = CODELENS;\n        /* falls through */\n      case CODELENS:\n        while (state.have < state.nlen + state.ndist) {\n          for (;;) {\n            here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/\n            here_bits = here >>> 24;\n            here_op = (here >>> 16) & 0xff;\n            here_val = here & 0xffff;\n\n            if ((here_bits) <= bits) { break; }\n            //--- PULLBYTE() ---//\n            if (have === 0) { break inf_leave; }\n            have--;\n            hold += input[next++] << bits;\n            bits += 8;\n            //---//\n          }\n          if (here_val < 16) {\n            //--- DROPBITS(here.bits) ---//\n            hold >>>= here_bits;\n            bits -= here_bits;\n            //---//\n            state.lens[state.have++] = here_val;\n          }\n          else {\n            if (here_val === 16) {\n              //=== NEEDBITS(here.bits + 2);\n              n = here_bits + 2;\n              while (bits < n) {\n                if (have === 0) { break inf_leave; }\n                have--;\n                hold += input[next++] << bits;\n                bits += 8;\n              }\n              //===//\n              //--- DROPBITS(here.bits) ---//\n              hold >>>= here_bits;\n              bits -= here_bits;\n              //---//\n              if (state.have === 0) {\n                strm.msg = 'invalid bit length repeat';\n                state.mode = BAD;\n                break;\n              }\n              len = state.lens[state.have - 1];\n              copy = 3 + (hold & 0x03);//BITS(2);\n              //--- DROPBITS(2) ---//\n              hold >>>= 2;\n              bits -= 2;\n              //---//\n            }\n            else if (here_val === 17) {\n              //=== NEEDBITS(here.bits + 3);\n              n = here_bits + 3;\n              while (bits < n) {\n                if (have === 0) { break inf_leave; }\n                have--;\n                hold += input[next++] << bits;\n                bits += 8;\n              }\n              //===//\n              //--- DROPBITS(here.bits) ---//\n              hold >>>= here_bits;\n              bits -= here_bits;\n              //---//\n              len = 0;\n              copy = 3 + (hold & 0x07);//BITS(3);\n              //--- DROPBITS(3) ---//\n              hold >>>= 3;\n              bits -= 3;\n              //---//\n            }\n            else {\n              //=== NEEDBITS(here.bits + 7);\n              n = here_bits + 7;\n              while (bits < n) {\n                if (have === 0) { break inf_leave; }\n                have--;\n                hold += input[next++] << bits;\n                bits += 8;\n              }\n              //===//\n              //--- DROPBITS(here.bits) ---//\n              hold >>>= here_bits;\n              bits -= here_bits;\n              //---//\n              len = 0;\n              copy = 11 + (hold & 0x7f);//BITS(7);\n              //--- DROPBITS(7) ---//\n              hold >>>= 7;\n              bits -= 7;\n              //---//\n            }\n            if (state.have + copy > state.nlen + state.ndist) {\n              strm.msg = 'invalid bit length repeat';\n              state.mode = BAD;\n              break;\n            }\n            while (copy--) {\n              state.lens[state.have++] = len;\n            }\n          }\n        }\n\n        /* handle error breaks in while */\n        if (state.mode === BAD) { break; }\n\n        /* check for end-of-block code (better have one) */\n        if (state.lens[256] === 0) {\n          strm.msg = 'invalid code -- missing end-of-block';\n          state.mode = BAD;\n          break;\n        }\n\n        /* build code tables -- note: do not change the lenbits or distbits\n           values here (9 and 6) without reading the comments in inftrees.h\n           concerning the ENOUGH constants, which depend on those values */\n        state.lenbits = 9;\n\n        opts = { bits: state.lenbits };\n        ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);\n        // We have separate tables & no pointers. 2 commented lines below not needed.\n        // state.next_index = opts.table_index;\n        state.lenbits = opts.bits;\n        // state.lencode = state.next;\n\n        if (ret) {\n          strm.msg = 'invalid literal/lengths set';\n          state.mode = BAD;\n          break;\n        }\n\n        state.distbits = 6;\n        //state.distcode.copy(state.codes);\n        // Switch to use dynamic table\n        state.distcode = state.distdyn;\n        opts = { bits: state.distbits };\n        ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);\n        // We have separate tables & no pointers. 2 commented lines below not needed.\n        // state.next_index = opts.table_index;\n        state.distbits = opts.bits;\n        // state.distcode = state.next;\n\n        if (ret) {\n          strm.msg = 'invalid distances set';\n          state.mode = BAD;\n          break;\n        }\n        //Tracev((stderr, 'inflate:       codes ok\\n'));\n        state.mode = LEN_;\n        if (flush === Z_TREES) { break inf_leave; }\n        /* falls through */\n      case LEN_:\n        state.mode = LEN;\n        /* falls through */\n      case LEN:\n        if (have >= 6 && left >= 258) {\n          //--- RESTORE() ---\n          strm.next_out = put;\n          strm.avail_out = left;\n          strm.next_in = next;\n          strm.avail_in = have;\n          state.hold = hold;\n          state.bits = bits;\n          //---\n          inflate_fast(strm, _out);\n          //--- LOAD() ---\n          put = strm.next_out;\n          output = strm.output;\n          left = strm.avail_out;\n          next = strm.next_in;\n          input = strm.input;\n          have = strm.avail_in;\n          hold = state.hold;\n          bits = state.bits;\n          //---\n\n          if (state.mode === TYPE) {\n            state.back = -1;\n          }\n          break;\n        }\n        state.back = 0;\n        for (;;) {\n          here = state.lencode[hold & ((1 << state.lenbits) - 1)];  /*BITS(state.lenbits)*/\n          here_bits = here >>> 24;\n          here_op = (here >>> 16) & 0xff;\n          here_val = here & 0xffff;\n\n          if (here_bits <= bits) { break; }\n          //--- PULLBYTE() ---//\n          if (have === 0) { break inf_leave; }\n          have--;\n          hold += input[next++] << bits;\n          bits += 8;\n          //---//\n        }\n        if (here_op && (here_op & 0xf0) === 0) {\n          last_bits = here_bits;\n          last_op = here_op;\n          last_val = here_val;\n          for (;;) {\n            here = state.lencode[last_val +\n                    ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n            here_bits = here >>> 24;\n            here_op = (here >>> 16) & 0xff;\n            here_val = here & 0xffff;\n\n            if ((last_bits + here_bits) <= bits) { break; }\n            //--- PULLBYTE() ---//\n            if (have === 0) { break inf_leave; }\n            have--;\n            hold += input[next++] << bits;\n            bits += 8;\n            //---//\n          }\n          //--- DROPBITS(last.bits) ---//\n          hold >>>= last_bits;\n          bits -= last_bits;\n          //---//\n          state.back += last_bits;\n        }\n        //--- DROPBITS(here.bits) ---//\n        hold >>>= here_bits;\n        bits -= here_bits;\n        //---//\n        state.back += here_bits;\n        state.length = here_val;\n        if (here_op === 0) {\n          //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n          //        \"inflate:         literal '%c'\\n\" :\n          //        \"inflate:         literal 0x%02x\\n\", here.val));\n          state.mode = LIT;\n          break;\n        }\n        if (here_op & 32) {\n          //Tracevv((stderr, \"inflate:         end of block\\n\"));\n          state.back = -1;\n          state.mode = TYPE;\n          break;\n        }\n        if (here_op & 64) {\n          strm.msg = 'invalid literal/length code';\n          state.mode = BAD;\n          break;\n        }\n        state.extra = here_op & 15;\n        state.mode = LENEXT;\n        /* falls through */\n      case LENEXT:\n        if (state.extra) {\n          //=== NEEDBITS(state.extra);\n          n = state.extra;\n          while (bits < n) {\n            if (have === 0) { break inf_leave; }\n            have--;\n            hold += input[next++] << bits;\n            bits += 8;\n          }\n          //===//\n          state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n          //--- DROPBITS(state.extra) ---//\n          hold >>>= state.extra;\n          bits -= state.extra;\n          //---//\n          state.back += state.extra;\n        }\n        //Tracevv((stderr, \"inflate:         length %u\\n\", state.length));\n        state.was = state.length;\n        state.mode = DIST;\n        /* falls through */\n      case DIST:\n        for (;;) {\n          here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/\n          here_bits = here >>> 24;\n          here_op = (here >>> 16) & 0xff;\n          here_val = here & 0xffff;\n\n          if ((here_bits) <= bits) { break; }\n          //--- PULLBYTE() ---//\n          if (have === 0) { break inf_leave; }\n          have--;\n          hold += input[next++] << bits;\n          bits += 8;\n          //---//\n        }\n        if ((here_op & 0xf0) === 0) {\n          last_bits = here_bits;\n          last_op = here_op;\n          last_val = here_val;\n          for (;;) {\n            here = state.distcode[last_val +\n                    ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];\n            here_bits = here >>> 24;\n            here_op = (here >>> 16) & 0xff;\n            here_val = here & 0xffff;\n\n            if ((last_bits + here_bits) <= bits) { break; }\n            //--- PULLBYTE() ---//\n            if (have === 0) { break inf_leave; }\n            have--;\n            hold += input[next++] << bits;\n            bits += 8;\n            //---//\n          }\n          //--- DROPBITS(last.bits) ---//\n          hold >>>= last_bits;\n          bits -= last_bits;\n          //---//\n          state.back += last_bits;\n        }\n        //--- DROPBITS(here.bits) ---//\n        hold >>>= here_bits;\n        bits -= here_bits;\n        //---//\n        state.back += here_bits;\n        if (here_op & 64) {\n          strm.msg = 'invalid distance code';\n          state.mode = BAD;\n          break;\n        }\n        state.offset = here_val;\n        state.extra = (here_op) & 15;\n        state.mode = DISTEXT;\n        /* falls through */\n      case DISTEXT:\n        if (state.extra) {\n          //=== NEEDBITS(state.extra);\n          n = state.extra;\n          while (bits < n) {\n            if (have === 0) { break inf_leave; }\n            have--;\n            hold += input[next++] << bits;\n            bits += 8;\n          }\n          //===//\n          state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;\n          //--- DROPBITS(state.extra) ---//\n          hold >>>= state.extra;\n          bits -= state.extra;\n          //---//\n          state.back += state.extra;\n        }\n//#ifdef INFLATE_STRICT\n        if (state.offset > state.dmax) {\n          strm.msg = 'invalid distance too far back';\n          state.mode = BAD;\n          break;\n        }\n//#endif\n        //Tracevv((stderr, \"inflate:         distance %u\\n\", state.offset));\n        state.mode = MATCH;\n        /* falls through */\n      case MATCH:\n        if (left === 0) { break inf_leave; }\n        copy = _out - left;\n        if (state.offset > copy) {         /* copy from window */\n          copy = state.offset - copy;\n          if (copy > state.whave) {\n            if (state.sane) {\n              strm.msg = 'invalid distance too far back';\n              state.mode = BAD;\n              break;\n            }\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n//          Trace((stderr, \"inflate.c too far\\n\"));\n//          copy -= state.whave;\n//          if (copy > state.length) { copy = state.length; }\n//          if (copy > left) { copy = left; }\n//          left -= copy;\n//          state.length -= copy;\n//          do {\n//            output[put++] = 0;\n//          } while (--copy);\n//          if (state.length === 0) { state.mode = LEN; }\n//          break;\n//#endif\n          }\n          if (copy > state.wnext) {\n            copy -= state.wnext;\n            from = state.wsize - copy;\n          }\n          else {\n            from = state.wnext - copy;\n          }\n          if (copy > state.length) { copy = state.length; }\n          from_source = state.window;\n        }\n        else {                              /* copy from output */\n          from_source = output;\n          from = put - state.offset;\n          copy = state.length;\n        }\n        if (copy > left) { copy = left; }\n        left -= copy;\n        state.length -= copy;\n        do {\n          output[put++] = from_source[from++];\n        } while (--copy);\n        if (state.length === 0) { state.mode = LEN; }\n        break;\n      case LIT:\n        if (left === 0) { break inf_leave; }\n        output[put++] = state.length;\n        left--;\n        state.mode = LEN;\n        break;\n      case CHECK:\n        if (state.wrap) {\n          //=== NEEDBITS(32);\n          while (bits < 32) {\n            if (have === 0) { break inf_leave; }\n            have--;\n            // Use '|' instead of '+' to make sure that result is signed\n            hold |= input[next++] << bits;\n            bits += 8;\n          }\n          //===//\n          _out -= left;\n          strm.total_out += _out;\n          state.total += _out;\n          if (_out) {\n            strm.adler = state.check =\n                /*UPDATE(state.check, put - _out, _out);*/\n                (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));\n\n          }\n          _out = left;\n          // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too\n          if ((state.flags ? hold : zswap32(hold)) !== state.check) {\n            strm.msg = 'incorrect data check';\n            state.mode = BAD;\n            break;\n          }\n          //=== INITBITS();\n          hold = 0;\n          bits = 0;\n          //===//\n          //Tracev((stderr, \"inflate:   check matches trailer\\n\"));\n        }\n        state.mode = LENGTH;\n        /* falls through */\n      case LENGTH:\n        if (state.wrap && state.flags) {\n          //=== NEEDBITS(32);\n          while (bits < 32) {\n            if (have === 0) { break inf_leave; }\n            have--;\n            hold += input[next++] << bits;\n            bits += 8;\n          }\n          //===//\n          if (hold !== (state.total & 0xffffffff)) {\n            strm.msg = 'incorrect length check';\n            state.mode = BAD;\n            break;\n          }\n          //=== INITBITS();\n          hold = 0;\n          bits = 0;\n          //===//\n          //Tracev((stderr, \"inflate:   length matches trailer\\n\"));\n        }\n        state.mode = DONE;\n        /* falls through */\n      case DONE:\n        ret = Z_STREAM_END;\n        break inf_leave;\n      case BAD:\n        ret = Z_DATA_ERROR;\n        break inf_leave;\n      case MEM:\n        return Z_MEM_ERROR;\n      case SYNC:\n        /* falls through */\n      default:\n        return Z_STREAM_ERROR;\n    }\n  }\n\n  // inf_leave <- here is real place for \"goto inf_leave\", emulated via \"break inf_leave\"\n\n  /*\n     Return from inflate(), updating the total counts and the check value.\n     If there was no progress during the inflate() call, return a buffer\n     error.  Call updatewindow() to create and/or update the window state.\n     Note: a memory error from inflate() is non-recoverable.\n   */\n\n  //--- RESTORE() ---\n  strm.next_out = put;\n  strm.avail_out = left;\n  strm.next_in = next;\n  strm.avail_in = have;\n  state.hold = hold;\n  state.bits = bits;\n  //---\n\n  if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&\n                      (state.mode < CHECK || flush !== Z_FINISH))) {\n    if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {\n      state.mode = MEM;\n      return Z_MEM_ERROR;\n    }\n  }\n  _in -= strm.avail_in;\n  _out -= strm.avail_out;\n  strm.total_in += _in;\n  strm.total_out += _out;\n  state.total += _out;\n  if (state.wrap && _out) {\n    strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/\n      (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));\n  }\n  strm.data_type = state.bits + (state.last ? 64 : 0) +\n                    (state.mode === TYPE ? 128 : 0) +\n                    (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);\n  if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {\n    ret = Z_BUF_ERROR;\n  }\n  return ret;\n}\n\nfunction inflateEnd(strm) {\n\n  if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {\n    return Z_STREAM_ERROR;\n  }\n\n  var state = strm.state;\n  if (state.window) {\n    state.window = null;\n  }\n  strm.state = null;\n  return Z_OK;\n}\n\nfunction inflateGetHeader(strm, head) {\n  var state;\n\n  /* check state */\n  if (!strm || !strm.state) { return Z_STREAM_ERROR; }\n  state = strm.state;\n  if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }\n\n  /* save header structure */\n  state.head = head;\n  head.done = false;\n  return Z_OK;\n}\n\nfunction inflateSetDictionary(strm, dictionary) {\n  var dictLength = dictionary.length;\n\n  var state;\n  var dictid;\n  var ret;\n\n  /* check state */\n  if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; }\n  state = strm.state;\n\n  if (state.wrap !== 0 && state.mode !== DICT) {\n    return Z_STREAM_ERROR;\n  }\n\n  /* check for correct dictionary identifier */\n  if (state.mode === DICT) {\n    dictid = 1; /* adler32(0, null, 0)*/\n    /* dictid = adler32(dictid, dictionary, dictLength); */\n    dictid = adler32(dictid, dictionary, dictLength, 0);\n    if (dictid !== state.check) {\n      return Z_DATA_ERROR;\n    }\n  }\n  /* copy dictionary to window using updatewindow(), which will amend the\n   existing dictionary if appropriate */\n  ret = updatewindow(strm, dictionary, dictLength, dictLength);\n  if (ret) {\n    state.mode = MEM;\n    return Z_MEM_ERROR;\n  }\n  state.havedict = 1;\n  // Tracev((stderr, \"inflate:   dictionary set\\n\"));\n  return Z_OK;\n}\n\nexports.inflateReset = inflateReset;\nexports.inflateReset2 = inflateReset2;\nexports.inflateResetKeep = inflateResetKeep;\nexports.inflateInit = inflateInit;\nexports.inflateInit2 = inflateInit2;\nexports.inflate = inflate;\nexports.inflateEnd = inflateEnd;\nexports.inflateGetHeader = inflateGetHeader;\nexports.inflateSetDictionary = inflateSetDictionary;\nexports.inflateInfo = 'pako inflate (from Nodeca project)';\n\n/* Not implemented\nexports.inflateCopy = inflateCopy;\nexports.inflateGetDictionary = inflateGetDictionary;\nexports.inflateMark = inflateMark;\nexports.inflatePrime = inflatePrime;\nexports.inflateSync = inflateSync;\nexports.inflateSyncPoint = inflateSyncPoint;\nexports.inflateUndermine = inflateUndermine;\n*/\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/pako/lib/zlib/inflate.js","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//   claim that you wrote the original software. If you use this software\n//   in a product, an acknowledgment in the product documentation would be\n//   appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n//   misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// See state defs from inflate.js\nvar BAD = 30;       /* got a data error -- remain here until reset */\nvar TYPE = 12;      /* i: waiting for type bits, including last-flag bit */\n\n/*\n   Decode literal, length, and distance codes and write out the resulting\n   literal and match bytes until either not enough input or output is\n   available, an end-of-block is encountered, or a data error is encountered.\n   When large enough input and output buffers are supplied to inflate(), for\n   example, a 16K input buffer and a 64K output buffer, more than 95% of the\n   inflate execution time is spent in this routine.\n\n   Entry assumptions:\n\n        state.mode === LEN\n        strm.avail_in >= 6\n        strm.avail_out >= 258\n        start >= strm.avail_out\n        state.bits < 8\n\n   On return, state.mode is one of:\n\n        LEN -- ran out of enough output space or enough available input\n        TYPE -- reached end of block code, inflate() to interpret next block\n        BAD -- error in block data\n\n   Notes:\n\n    - The maximum input bits used by a length/distance pair is 15 bits for the\n      length code, 5 bits for the length extra, 15 bits for the distance code,\n      and 13 bits for the distance extra.  This totals 48 bits, or six bytes.\n      Therefore if strm.avail_in >= 6, then there is enough input to avoid\n      checking for available input while decoding.\n\n    - The maximum bytes that a single length/distance pair can output is 258\n      bytes, which is the maximum length that can be coded.  inflate_fast()\n      requires strm.avail_out >= 258 for each loop to avoid checking for\n      output space.\n */\nmodule.exports = function inflate_fast(strm, start) {\n  var state;\n  var _in;                    /* local strm.input */\n  var last;                   /* have enough input while in < last */\n  var _out;                   /* local strm.output */\n  var beg;                    /* inflate()'s initial strm.output */\n  var end;                    /* while out < end, enough space available */\n//#ifdef INFLATE_STRICT\n  var dmax;                   /* maximum distance from zlib header */\n//#endif\n  var wsize;                  /* window size or zero if not using window */\n  var whave;                  /* valid bytes in the window */\n  var wnext;                  /* window write index */\n  // Use `s_window` instead `window`, avoid conflict with instrumentation tools\n  var s_window;               /* allocated sliding window, if wsize != 0 */\n  var hold;                   /* local strm.hold */\n  var bits;                   /* local strm.bits */\n  var lcode;                  /* local strm.lencode */\n  var dcode;                  /* local strm.distcode */\n  var lmask;                  /* mask for first level of length codes */\n  var dmask;                  /* mask for first level of distance codes */\n  var here;                   /* retrieved table entry */\n  var op;                     /* code bits, operation, extra bits, or */\n                              /*  window position, window bytes to copy */\n  var len;                    /* match length, unused bytes */\n  var dist;                   /* match distance */\n  var from;                   /* where to copy match from */\n  var from_source;\n\n\n  var input, output; // JS specific, because we have no pointers\n\n  /* copy state to local variables */\n  state = strm.state;\n  //here = state.here;\n  _in = strm.next_in;\n  input = strm.input;\n  last = _in + (strm.avail_in - 5);\n  _out = strm.next_out;\n  output = strm.output;\n  beg = _out - (start - strm.avail_out);\n  end = _out + (strm.avail_out - 257);\n//#ifdef INFLATE_STRICT\n  dmax = state.dmax;\n//#endif\n  wsize = state.wsize;\n  whave = state.whave;\n  wnext = state.wnext;\n  s_window = state.window;\n  hold = state.hold;\n  bits = state.bits;\n  lcode = state.lencode;\n  dcode = state.distcode;\n  lmask = (1 << state.lenbits) - 1;\n  dmask = (1 << state.distbits) - 1;\n\n\n  /* decode literals and length/distances until end-of-block or not enough\n     input data or output space */\n\n  top:\n  do {\n    if (bits < 15) {\n      hold += input[_in++] << bits;\n      bits += 8;\n      hold += input[_in++] << bits;\n      bits += 8;\n    }\n\n    here = lcode[hold & lmask];\n\n    dolen:\n    for (;;) { // Goto emulation\n      op = here >>> 24/*here.bits*/;\n      hold >>>= op;\n      bits -= op;\n      op = (here >>> 16) & 0xff/*here.op*/;\n      if (op === 0) {                          /* literal */\n        //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?\n        //        \"inflate:         literal '%c'\\n\" :\n        //        \"inflate:         literal 0x%02x\\n\", here.val));\n        output[_out++] = here & 0xffff/*here.val*/;\n      }\n      else if (op & 16) {                     /* length base */\n        len = here & 0xffff/*here.val*/;\n        op &= 15;                           /* number of extra bits */\n        if (op) {\n          if (bits < op) {\n            hold += input[_in++] << bits;\n            bits += 8;\n          }\n          len += hold & ((1 << op) - 1);\n          hold >>>= op;\n          bits -= op;\n        }\n        //Tracevv((stderr, \"inflate:         length %u\\n\", len));\n        if (bits < 15) {\n          hold += input[_in++] << bits;\n          bits += 8;\n          hold += input[_in++] << bits;\n          bits += 8;\n        }\n        here = dcode[hold & dmask];\n\n        dodist:\n        for (;;) { // goto emulation\n          op = here >>> 24/*here.bits*/;\n          hold >>>= op;\n          bits -= op;\n          op = (here >>> 16) & 0xff/*here.op*/;\n\n          if (op & 16) {                      /* distance base */\n            dist = here & 0xffff/*here.val*/;\n            op &= 15;                       /* number of extra bits */\n            if (bits < op) {\n              hold += input[_in++] << bits;\n              bits += 8;\n              if (bits < op) {\n                hold += input[_in++] << bits;\n                bits += 8;\n              }\n            }\n            dist += hold & ((1 << op) - 1);\n//#ifdef INFLATE_STRICT\n            if (dist > dmax) {\n              strm.msg = 'invalid distance too far back';\n              state.mode = BAD;\n              break top;\n            }\n//#endif\n            hold >>>= op;\n            bits -= op;\n            //Tracevv((stderr, \"inflate:         distance %u\\n\", dist));\n            op = _out - beg;                /* max distance in output */\n            if (dist > op) {                /* see if copy from window */\n              op = dist - op;               /* distance back in window */\n              if (op > whave) {\n                if (state.sane) {\n                  strm.msg = 'invalid distance too far back';\n                  state.mode = BAD;\n                  break top;\n                }\n\n// (!) This block is disabled in zlib defaults,\n// don't enable it for binary compatibility\n//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR\n//                if (len <= op - whave) {\n//                  do {\n//                    output[_out++] = 0;\n//                  } while (--len);\n//                  continue top;\n//                }\n//                len -= op - whave;\n//                do {\n//                  output[_out++] = 0;\n//                } while (--op > whave);\n//                if (op === 0) {\n//                  from = _out - dist;\n//                  do {\n//                    output[_out++] = output[from++];\n//                  } while (--len);\n//                  continue top;\n//                }\n//#endif\n              }\n              from = 0; // window index\n              from_source = s_window;\n              if (wnext === 0) {           /* very common case */\n                from += wsize - op;\n                if (op < len) {         /* some from window */\n                  len -= op;\n                  do {\n                    output[_out++] = s_window[from++];\n                  } while (--op);\n                  from = _out - dist;  /* rest from output */\n                  from_source = output;\n                }\n              }\n              else if (wnext < op) {      /* wrap around window */\n                from += wsize + wnext - op;\n                op -= wnext;\n                if (op < len) {         /* some from end of window */\n                  len -= op;\n                  do {\n                    output[_out++] = s_window[from++];\n                  } while (--op);\n                  from = 0;\n                  if (wnext < len) {  /* some from start of window */\n                    op = wnext;\n                    len -= op;\n                    do {\n                      output[_out++] = s_window[from++];\n                    } while (--op);\n                    from = _out - dist;      /* rest from output */\n                    from_source = output;\n                  }\n                }\n              }\n              else {                      /* contiguous in window */\n                from += wnext - op;\n                if (op < len) {         /* some from window */\n                  len -= op;\n                  do {\n                    output[_out++] = s_window[from++];\n                  } while (--op);\n                  from = _out - dist;  /* rest from output */\n                  from_source = output;\n                }\n              }\n              while (len > 2) {\n                output[_out++] = from_source[from++];\n                output[_out++] = from_source[from++];\n                output[_out++] = from_source[from++];\n                len -= 3;\n              }\n              if (len) {\n                output[_out++] = from_source[from++];\n                if (len > 1) {\n                  output[_out++] = from_source[from++];\n                }\n              }\n            }\n            else {\n              from = _out - dist;          /* copy direct from output */\n              do {                        /* minimum length is three */\n                output[_out++] = output[from++];\n                output[_out++] = output[from++];\n                output[_out++] = output[from++];\n                len -= 3;\n              } while (len > 2);\n              if (len) {\n                output[_out++] = output[from++];\n                if (len > 1) {\n                  output[_out++] = output[from++];\n                }\n              }\n            }\n          }\n          else if ((op & 64) === 0) {          /* 2nd level distance code */\n            here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n            continue dodist;\n          }\n          else {\n            strm.msg = 'invalid distance code';\n            state.mode = BAD;\n            break top;\n          }\n\n          break; // need to emulate goto via \"continue\"\n        }\n      }\n      else if ((op & 64) === 0) {              /* 2nd level length code */\n        here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];\n        continue dolen;\n      }\n      else if (op & 32) {                     /* end-of-block */\n        //Tracevv((stderr, \"inflate:         end of block\\n\"));\n        state.mode = TYPE;\n        break top;\n      }\n      else {\n        strm.msg = 'invalid literal/length code';\n        state.mode = BAD;\n        break top;\n      }\n\n      break; // need to emulate goto via \"continue\"\n    }\n  } while (_in < last && _out < end);\n\n  /* return unused bytes (on entry, bits < 8, so in won't go too far back) */\n  len = bits >> 3;\n  _in -= len;\n  bits -= len << 3;\n  hold &= (1 << bits) - 1;\n\n  /* update state and return */\n  strm.next_in = _in;\n  strm.next_out = _out;\n  strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));\n  strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));\n  state.hold = hold;\n  state.bits = bits;\n  return;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/pako/lib/zlib/inffast.js","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//   claim that you wrote the original software. If you use this software\n//   in a product, an acknowledgment in the product documentation would be\n//   appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n//   misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nvar utils = require('../utils/common');\n\nvar MAXBITS = 15;\nvar ENOUGH_LENS = 852;\nvar ENOUGH_DISTS = 592;\n//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nvar CODES = 0;\nvar LENS = 1;\nvar DISTS = 2;\n\nvar lbase = [ /* Length codes 257..285 base */\n  3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,\n  35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0\n];\n\nvar lext = [ /* Length codes 257..285 extra */\n  16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,\n  19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78\n];\n\nvar dbase = [ /* Distance codes 0..29 base */\n  1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,\n  257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,\n  8193, 12289, 16385, 24577, 0, 0\n];\n\nvar dext = [ /* Distance codes 0..29 extra */\n  16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,\n  23, 23, 24, 24, 25, 25, 26, 26, 27, 27,\n  28, 28, 29, 29, 64, 64\n];\n\nmodule.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts)\n{\n  var bits = opts.bits;\n      //here = opts.here; /* table entry for duplication */\n\n  var len = 0;               /* a code's length in bits */\n  var sym = 0;               /* index of code symbols */\n  var min = 0, max = 0;          /* minimum and maximum code lengths */\n  var root = 0;              /* number of index bits for root table */\n  var curr = 0;              /* number of index bits for current table */\n  var drop = 0;              /* code bits to drop for sub-table */\n  var left = 0;                   /* number of prefix codes available */\n  var used = 0;              /* code entries in table used */\n  var huff = 0;              /* Huffman code */\n  var incr;              /* for incrementing code, index */\n  var fill;              /* index for replicating entries */\n  var low;               /* low bits for current root entry */\n  var mask;              /* mask for low root bits */\n  var next;             /* next available space in table */\n  var base = null;     /* base value table to use */\n  var base_index = 0;\n//  var shoextra;    /* extra bits table to use */\n  var end;                    /* use base and extra for symbol > end */\n  var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1];    /* number of codes of each length */\n  var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1];     /* offsets in table for each length */\n  var extra = null;\n  var extra_index = 0;\n\n  var here_bits, here_op, here_val;\n\n  /*\n   Process a set of code lengths to create a canonical Huffman code.  The\n   code lengths are lens[0..codes-1].  Each length corresponds to the\n   symbols 0..codes-1.  The Huffman code is generated by first sorting the\n   symbols by length from short to long, and retaining the symbol order\n   for codes with equal lengths.  Then the code starts with all zero bits\n   for the first code of the shortest length, and the codes are integer\n   increments for the same length, and zeros are appended as the length\n   increases.  For the deflate format, these bits are stored backwards\n   from their more natural integer increment ordering, and so when the\n   decoding tables are built in the large loop below, the integer codes\n   are incremented backwards.\n\n   This routine assumes, but does not check, that all of the entries in\n   lens[] are in the range 0..MAXBITS.  The caller must assure this.\n   1..MAXBITS is interpreted as that code length.  zero means that that\n   symbol does not occur in this code.\n\n   The codes are sorted by computing a count of codes for each length,\n   creating from that a table of starting indices for each length in the\n   sorted table, and then entering the symbols in order in the sorted\n   table.  The sorted table is work[], with that space being provided by\n   the caller.\n\n   The length counts are used for other purposes as well, i.e. finding\n   the minimum and maximum length codes, determining if there are any\n   codes at all, checking for a valid set of lengths, and looking ahead\n   at length counts to determine sub-table sizes when building the\n   decoding tables.\n   */\n\n  /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */\n  for (len = 0; len <= MAXBITS; len++) {\n    count[len] = 0;\n  }\n  for (sym = 0; sym < codes; sym++) {\n    count[lens[lens_index + sym]]++;\n  }\n\n  /* bound code lengths, force root to be within code lengths */\n  root = bits;\n  for (max = MAXBITS; max >= 1; max--) {\n    if (count[max] !== 0) { break; }\n  }\n  if (root > max) {\n    root = max;\n  }\n  if (max === 0) {                     /* no symbols to code at all */\n    //table.op[opts.table_index] = 64;  //here.op = (var char)64;    /* invalid code marker */\n    //table.bits[opts.table_index] = 1;   //here.bits = (var char)1;\n    //table.val[opts.table_index++] = 0;   //here.val = (var short)0;\n    table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n\n    //table.op[opts.table_index] = 64;\n    //table.bits[opts.table_index] = 1;\n    //table.val[opts.table_index++] = 0;\n    table[table_index++] = (1 << 24) | (64 << 16) | 0;\n\n    opts.bits = 1;\n    return 0;     /* no symbols, but wait for decoding to report error */\n  }\n  for (min = 1; min < max; min++) {\n    if (count[min] !== 0) { break; }\n  }\n  if (root < min) {\n    root = min;\n  }\n\n  /* check for an over-subscribed or incomplete set of lengths */\n  left = 1;\n  for (len = 1; len <= MAXBITS; len++) {\n    left <<= 1;\n    left -= count[len];\n    if (left < 0) {\n      return -1;\n    }        /* over-subscribed */\n  }\n  if (left > 0 && (type === CODES || max !== 1)) {\n    return -1;                      /* incomplete set */\n  }\n\n  /* generate offsets into symbol table for each length for sorting */\n  offs[1] = 0;\n  for (len = 1; len < MAXBITS; len++) {\n    offs[len + 1] = offs[len] + count[len];\n  }\n\n  /* sort symbols by length, by symbol order within each length */\n  for (sym = 0; sym < codes; sym++) {\n    if (lens[lens_index + sym] !== 0) {\n      work[offs[lens[lens_index + sym]]++] = sym;\n    }\n  }\n\n  /*\n   Create and fill in decoding tables.  In this loop, the table being\n   filled is at next and has curr index bits.  The code being used is huff\n   with length len.  That code is converted to an index by dropping drop\n   bits off of the bottom.  For codes where len is less than drop + curr,\n   those top drop + curr - len bits are incremented through all values to\n   fill the table with replicated entries.\n\n   root is the number of index bits for the root table.  When len exceeds\n   root, sub-tables are created pointed to by the root entry with an index\n   of the low root bits of huff.  This is saved in low to check for when a\n   new sub-table should be started.  drop is zero when the root table is\n   being filled, and drop is root when sub-tables are being filled.\n\n   When a new sub-table is needed, it is necessary to look ahead in the\n   code lengths to determine what size sub-table is needed.  The length\n   counts are used for this, and so count[] is decremented as codes are\n   entered in the tables.\n\n   used keeps track of how many table entries have been allocated from the\n   provided *table space.  It is checked for LENS and DIST tables against\n   the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in\n   the initial root table size constants.  See the comments in inftrees.h\n   for more information.\n\n   sym increments through all symbols, and the loop terminates when\n   all codes of length max, i.e. all codes, have been processed.  This\n   routine permits incomplete codes, so another loop after this one fills\n   in the rest of the decoding tables with invalid code markers.\n   */\n\n  /* set up for code type */\n  // poor man optimization - use if-else instead of switch,\n  // to avoid deopts in old v8\n  if (type === CODES) {\n    base = extra = work;    /* dummy value--not used */\n    end = 19;\n\n  } else if (type === LENS) {\n    base = lbase;\n    base_index -= 257;\n    extra = lext;\n    extra_index -= 257;\n    end = 256;\n\n  } else {                    /* DISTS */\n    base = dbase;\n    extra = dext;\n    end = -1;\n  }\n\n  /* initialize opts for loop */\n  huff = 0;                   /* starting code */\n  sym = 0;                    /* starting code symbol */\n  len = min;                  /* starting code length */\n  next = table_index;              /* current table to fill in */\n  curr = root;                /* current table index bits */\n  drop = 0;                   /* current bits to drop from code for index */\n  low = -1;                   /* trigger new sub-table when len > root */\n  used = 1 << root;          /* use root table entries */\n  mask = used - 1;            /* mask for comparing low */\n\n  /* check available table space */\n  if ((type === LENS && used > ENOUGH_LENS) ||\n    (type === DISTS && used > ENOUGH_DISTS)) {\n    return 1;\n  }\n\n  /* process all codes and make table entries */\n  for (;;) {\n    /* create table entry */\n    here_bits = len - drop;\n    if (work[sym] < end) {\n      here_op = 0;\n      here_val = work[sym];\n    }\n    else if (work[sym] > end) {\n      here_op = extra[extra_index + work[sym]];\n      here_val = base[base_index + work[sym]];\n    }\n    else {\n      here_op = 32 + 64;         /* end of block */\n      here_val = 0;\n    }\n\n    /* replicate for those indices with low len bits equal to huff */\n    incr = 1 << (len - drop);\n    fill = 1 << curr;\n    min = fill;                 /* save offset to next table */\n    do {\n      fill -= incr;\n      table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;\n    } while (fill !== 0);\n\n    /* backwards increment the len-bit code huff */\n    incr = 1 << (len - 1);\n    while (huff & incr) {\n      incr >>= 1;\n    }\n    if (incr !== 0) {\n      huff &= incr - 1;\n      huff += incr;\n    } else {\n      huff = 0;\n    }\n\n    /* go to next symbol, update count, len */\n    sym++;\n    if (--count[len] === 0) {\n      if (len === max) { break; }\n      len = lens[lens_index + work[sym]];\n    }\n\n    /* create new sub-table if needed */\n    if (len > root && (huff & mask) !== low) {\n      /* if first time, transition to sub-tables */\n      if (drop === 0) {\n        drop = root;\n      }\n\n      /* increment past last table */\n      next += min;            /* here min is 1 << curr */\n\n      /* determine length of next table */\n      curr = len - drop;\n      left = 1 << curr;\n      while (curr + drop < max) {\n        left -= count[curr + drop];\n        if (left <= 0) { break; }\n        curr++;\n        left <<= 1;\n      }\n\n      /* check for enough space */\n      used += 1 << curr;\n      if ((type === LENS && used > ENOUGH_LENS) ||\n        (type === DISTS && used > ENOUGH_DISTS)) {\n        return 1;\n      }\n\n      /* point entry in root table to sub-table */\n      low = huff & mask;\n      /*table.op[low] = curr;\n      table.bits[low] = root;\n      table.val[low] = next - opts.table_index;*/\n      table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;\n    }\n  }\n\n  /* fill in remaining table entry if code is incomplete (guaranteed to have\n   at most one remaining entry, since if the code is incomplete, the\n   maximum code length that was allowed to get this far is one bit) */\n  if (huff !== 0) {\n    //table.op[next + huff] = 64;            /* invalid code marker */\n    //table.bits[next + huff] = len - drop;\n    //table.val[next + huff] = 0;\n    table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;\n  }\n\n  /* set return parameters */\n  //opts.table_index += used;\n  opts.bits = root;\n  return 0;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/pako/lib/zlib/inftrees.js","'use strict';\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n//   claim that you wrote the original software. If you use this software\n//   in a product, an acknowledgment in the product documentation would be\n//   appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n//   misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction GZheader() {\n  /* true if compressed data believed to be text */\n  this.text       = 0;\n  /* modification time */\n  this.time       = 0;\n  /* extra flags (not used when writing a gzip file) */\n  this.xflags     = 0;\n  /* operating system */\n  this.os         = 0;\n  /* pointer to extra field or Z_NULL if none */\n  this.extra      = null;\n  /* extra field length (valid if extra != Z_NULL) */\n  this.extra_len  = 0; // Actually, we don't need it in JS,\n                       // but leave for few code modifications\n\n  //\n  // Setup limits is not necessary because in js we should not preallocate memory\n  // for inflate use constant limit in 65536 bytes\n  //\n\n  /* space at extra (only when reading header) */\n  // this.extra_max  = 0;\n  /* pointer to zero-terminated file name or Z_NULL */\n  this.name       = '';\n  /* space at name (only when reading header) */\n  // this.name_max   = 0;\n  /* pointer to zero-terminated comment or Z_NULL */\n  this.comment    = '';\n  /* space at comment (only when reading header) */\n  // this.comm_max   = 0;\n  /* true if there was or will be a header crc */\n  this.hcrc       = 0;\n  /* true when done reading gzip header (not used when writing a gzip file) */\n  this.done       = false;\n}\n\nmodule.exports = GZheader;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/pako/lib/zlib/gzheader.js","'use strict';\n\nvar utils = require('./utils');\n\nvar table = [\n    0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA,\n    0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,\n    0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988,\n    0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,\n    0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE,\n    0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,\n    0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC,\n    0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,\n    0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172,\n    0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,\n    0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940,\n    0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,\n    0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116,\n    0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,\n    0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,\n    0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,\n    0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A,\n    0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,\n    0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818,\n    0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,\n    0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E,\n    0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,\n    0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C,\n    0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,\n    0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2,\n    0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,\n    0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0,\n    0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,\n    0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086,\n    0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,\n    0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4,\n    0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,\n    0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A,\n    0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,\n    0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8,\n    0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,\n    0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE,\n    0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,\n    0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC,\n    0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,\n    0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252,\n    0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,\n    0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60,\n    0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,\n    0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,\n    0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,\n    0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04,\n    0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,\n    0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A,\n    0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,\n    0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38,\n    0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,\n    0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E,\n    0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,\n    0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C,\n    0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,\n    0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2,\n    0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,\n    0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0,\n    0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,\n    0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6,\n    0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,\n    0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,\n    0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D\n];\n\n/**\n *\n *  Javascript crc32\n *  http://www.webtoolkit.info/\n *\n */\nmodule.exports = function crc32(input, crc) {\n    if (typeof input === \"undefined\" || !input.length) {\n        return 0;\n    }\n\n    var isArray = utils.getTypeOf(input) !== \"string\";\n\n    if (typeof(crc) == \"undefined\") {\n        crc = 0;\n    }\n    var x = 0;\n    var y = 0;\n    var b = 0;\n\n    crc = crc ^ (-1);\n    for (var i = 0, iTop = input.length; i < iTop; i++) {\n        b = isArray ? input[i] : input.charCodeAt(i);\n        y = (crc ^ b) & 0xFF;\n        x = table[y];\n        crc = (crc >>> 8) ^ x;\n    }\n\n    return crc ^ (-1);\n};\n// vim: set shiftwidth=4 softtabstop=4:\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/jszip/lib/crc32.js","'use strict';\n\nvar utils = require('./utils');\n\n/**\n * An object to write any content to a string.\n * @constructor\n */\nvar StringWriter = function() {\n    this.data = [];\n};\nStringWriter.prototype = {\n    /**\n     * Append any content to the current string.\n     * @param {Object} input the content to add.\n     */\n    append: function(input) {\n        input = utils.transformTo(\"string\", input);\n        this.data.push(input);\n    },\n    /**\n     * Finalize the construction an return the result.\n     * @return {string} the generated string.\n     */\n    finalize: function() {\n        return this.data.join(\"\");\n    }\n};\n\nmodule.exports = StringWriter;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/jszip/lib/stringWriter.js","'use strict';\n\nvar utils = require('./utils');\n\n/**\n * An object to write any content to an Uint8Array.\n * @constructor\n * @param {number} length The length of the array.\n */\nvar Uint8ArrayWriter = function(length) {\n    this.data = new Uint8Array(length);\n    this.index = 0;\n};\nUint8ArrayWriter.prototype = {\n    /**\n     * Append any content to the current array.\n     * @param {Object} input the content to add.\n     */\n    append: function(input) {\n        if (input.length !== 0) {\n            // with an empty Uint8Array, Opera fails with a \"Offset larger than array size\"\n            input = utils.transformTo(\"uint8array\", input);\n            this.data.set(input, this.index);\n            this.index += input.length;\n        }\n    },\n    /**\n     * Finalize the construction an return the result.\n     * @return {Uint8Array} the generated array.\n     */\n    finalize: function() {\n        return this.data;\n    }\n};\n\nmodule.exports = Uint8ArrayWriter;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/jszip/lib/uint8ArrayWriter.js","'use strict';\nvar base64 = require('./base64');\nvar utf8 = require('./utf8');\nvar utils = require('./utils');\nvar ZipEntries = require('./zipEntries');\nmodule.exports = function(data, options) {\n    var files, zipEntries, i, input;\n    options = utils.extend(options || {}, {\n        base64: false,\n        checkCRC32: false,\n        optimizedBinaryString : false,\n        createFolders: false,\n        decodeFileName: utf8.utf8decode\n    });\n    if (options.base64) {\n        data = base64.decode(data);\n    }\n\n    zipEntries = new ZipEntries(data, options);\n    files = zipEntries.files;\n    for (i = 0; i < files.length; i++) {\n        input = files[i];\n        this.file(input.fileNameStr, input.decompressed, {\n            binary: true,\n            optimizedBinaryString: true,\n            date: input.date,\n            dir: input.dir,\n            comment : input.fileCommentStr.length ? input.fileCommentStr : null,\n            unixPermissions : input.unixPermissions,\n            dosPermissions : input.dosPermissions,\n            createFolders: options.createFolders\n        });\n    }\n    if (zipEntries.zipComment.length) {\n        this.comment = zipEntries.zipComment;\n    }\n\n    return this;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/jszip/lib/load.js","'use strict';\nvar StringReader = require('./stringReader');\nvar NodeBufferReader = require('./nodeBufferReader');\nvar Uint8ArrayReader = require('./uint8ArrayReader');\nvar ArrayReader = require('./arrayReader');\nvar utils = require('./utils');\nvar sig = require('./signature');\nvar ZipEntry = require('./zipEntry');\nvar support = require('./support');\nvar jszipProto = require('./object');\n//  class ZipEntries {{{\n/**\n * All the entries in the zip file.\n * @constructor\n * @param {String|ArrayBuffer|Uint8Array} data the binary stream to load.\n * @param {Object} loadOptions Options for loading the stream.\n */\nfunction ZipEntries(data, loadOptions) {\n    this.files = [];\n    this.loadOptions = loadOptions;\n    if (data) {\n        this.load(data);\n    }\n}\nZipEntries.prototype = {\n    /**\n     * Check that the reader is on the speficied signature.\n     * @param {string} expectedSignature the expected signature.\n     * @throws {Error} if it is an other signature.\n     */\n    checkSignature: function(expectedSignature) {\n        var signature = this.reader.readString(4);\n        if (signature !== expectedSignature) {\n            throw new Error(\"Corrupted zip or bug : unexpected signature \" + \"(\" + utils.pretty(signature) + \", expected \" + utils.pretty(expectedSignature) + \")\");\n        }\n    },\n    /**\n     * Check if the given signature is at the given index.\n     * @param {number} askedIndex the index to check.\n     * @param {string} expectedSignature the signature to expect.\n     * @return {boolean} true if the signature is here, false otherwise.\n     */\n    isSignature: function(askedIndex, expectedSignature) {\n        var currentIndex = this.reader.index;\n        this.reader.setIndex(askedIndex);\n        var signature = this.reader.readString(4);\n        var result = signature === expectedSignature;\n        this.reader.setIndex(currentIndex);\n        return result;\n    },\n    /**\n     * Read the end of the central directory.\n     */\n    readBlockEndOfCentral: function() {\n        this.diskNumber = this.reader.readInt(2);\n        this.diskWithCentralDirStart = this.reader.readInt(2);\n        this.centralDirRecordsOnThisDisk = this.reader.readInt(2);\n        this.centralDirRecords = this.reader.readInt(2);\n        this.centralDirSize = this.reader.readInt(4);\n        this.centralDirOffset = this.reader.readInt(4);\n\n        this.zipCommentLength = this.reader.readInt(2);\n        // warning : the encoding depends of the system locale\n        // On a linux machine with LANG=en_US.utf8, this field is utf8 encoded.\n        // On a windows machine, this field is encoded with the localized windows code page.\n        var zipComment = this.reader.readData(this.zipCommentLength);\n        var decodeParamType = support.uint8array ? \"uint8array\" : \"array\";\n        // To get consistent behavior with the generation part, we will assume that\n        // this is utf8 encoded unless specified otherwise.\n        var decodeContent = utils.transformTo(decodeParamType, zipComment);\n        this.zipComment = this.loadOptions.decodeFileName(decodeContent);\n    },\n    /**\n     * Read the end of the Zip 64 central directory.\n     * Not merged with the method readEndOfCentral :\n     * The end of central can coexist with its Zip64 brother,\n     * I don't want to read the wrong number of bytes !\n     */\n    readBlockZip64EndOfCentral: function() {\n        this.zip64EndOfCentralSize = this.reader.readInt(8);\n        this.versionMadeBy = this.reader.readString(2);\n        this.versionNeeded = this.reader.readInt(2);\n        this.diskNumber = this.reader.readInt(4);\n        this.diskWithCentralDirStart = this.reader.readInt(4);\n        this.centralDirRecordsOnThisDisk = this.reader.readInt(8);\n        this.centralDirRecords = this.reader.readInt(8);\n        this.centralDirSize = this.reader.readInt(8);\n        this.centralDirOffset = this.reader.readInt(8);\n\n        this.zip64ExtensibleData = {};\n        var extraDataSize = this.zip64EndOfCentralSize - 44,\n            index = 0,\n            extraFieldId,\n            extraFieldLength,\n            extraFieldValue;\n        while (index < extraDataSize) {\n            extraFieldId = this.reader.readInt(2);\n            extraFieldLength = this.reader.readInt(4);\n            extraFieldValue = this.reader.readString(extraFieldLength);\n            this.zip64ExtensibleData[extraFieldId] = {\n                id: extraFieldId,\n                length: extraFieldLength,\n                value: extraFieldValue\n            };\n        }\n    },\n    /**\n     * Read the end of the Zip 64 central directory locator.\n     */\n    readBlockZip64EndOfCentralLocator: function() {\n        this.diskWithZip64CentralDirStart = this.reader.readInt(4);\n        this.relativeOffsetEndOfZip64CentralDir = this.reader.readInt(8);\n        this.disksCount = this.reader.readInt(4);\n        if (this.disksCount > 1) {\n            throw new Error(\"Multi-volumes zip are not supported\");\n        }\n    },\n    /**\n     * Read the local files, based on the offset read in the central part.\n     */\n    readLocalFiles: function() {\n        var i, file;\n        for (i = 0; i < this.files.length; i++) {\n            file = this.files[i];\n            this.reader.setIndex(file.localHeaderOffset);\n            this.checkSignature(sig.LOCAL_FILE_HEADER);\n            file.readLocalPart(this.reader);\n            file.handleUTF8();\n            file.processAttributes();\n        }\n    },\n    /**\n     * Read the central directory.\n     */\n    readCentralDir: function() {\n        var file;\n\n        this.reader.setIndex(this.centralDirOffset);\n        while (this.reader.readString(4) === sig.CENTRAL_FILE_HEADER) {\n            file = new ZipEntry({\n                zip64: this.zip64\n            }, this.loadOptions);\n            file.readCentralPart(this.reader);\n            this.files.push(file);\n        }\n\n        if (this.centralDirRecords !== this.files.length) {\n            if (this.centralDirRecords !== 0 && this.files.length === 0) {\n                // We expected some records but couldn't find ANY.\n                // This is really suspicious, as if something went wrong.\n                throw new Error(\"Corrupted zip or bug: expected \" + this.centralDirRecords + \" records in central dir, got \" + this.files.length);\n            } else {\n                // We found some records but not all.\n                // Something is wrong but we got something for the user: no error here.\n                // console.warn(\"expected\", this.centralDirRecords, \"records in central dir, got\", this.files.length);\n            }\n        }\n    },\n    /**\n     * Read the end of central directory.\n     */\n    readEndOfCentral: function() {\n        var offset = this.reader.lastIndexOfSignature(sig.CENTRAL_DIRECTORY_END);\n        if (offset < 0) {\n            // Check if the content is a truncated zip or complete garbage.\n            // A \"LOCAL_FILE_HEADER\" is not required at the beginning (auto\n            // extractible zip for example) but it can give a good hint.\n            // If an ajax request was used without responseType, we will also\n            // get unreadable data.\n            var isGarbage = !this.isSignature(0, sig.LOCAL_FILE_HEADER);\n\n            if (isGarbage) {\n                throw new Error(\"Can't find end of central directory : is this a zip file ? \" +\n                                \"If it is, see http://stuk.github.io/jszip/documentation/howto/read_zip.html\");\n            } else {\n                throw new Error(\"Corrupted zip : can't find end of central directory\");\n            }\n        }\n        this.reader.setIndex(offset);\n        var endOfCentralDirOffset = offset;\n        this.checkSignature(sig.CENTRAL_DIRECTORY_END);\n        this.readBlockEndOfCentral();\n\n\n        /* extract from the zip spec :\n            4)  If one of the fields in the end of central directory\n                record is too small to hold required data, the field\n                should be set to -1 (0xFFFF or 0xFFFFFFFF) and the\n                ZIP64 format record should be created.\n            5)  The end of central directory record and the\n                Zip64 end of central directory locator record must\n                reside on the same disk when splitting or spanning\n                an archive.\n         */\n        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) {\n            this.zip64 = true;\n\n            /*\n            Warning : the zip64 extension is supported, but ONLY if the 64bits integer read from\n            the zip file can fit into a 32bits integer. This cannot be solved : Javascript represents\n            all numbers as 64-bit double precision IEEE 754 floating point numbers.\n            So, we have 53bits for integers and bitwise operations treat everything as 32bits.\n            see https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Operators/Bitwise_Operators\n            and http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf section 8.5\n            */\n\n            // should look for a zip64 EOCD locator\n            offset = this.reader.lastIndexOfSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR);\n            if (offset < 0) {\n                throw new Error(\"Corrupted zip : can't find the ZIP64 end of central directory locator\");\n            }\n            this.reader.setIndex(offset);\n            this.checkSignature(sig.ZIP64_CENTRAL_DIRECTORY_LOCATOR);\n            this.readBlockZip64EndOfCentralLocator();\n\n            // now the zip64 EOCD record\n            if (!this.isSignature(this.relativeOffsetEndOfZip64CentralDir, sig.ZIP64_CENTRAL_DIRECTORY_END)) {\n                // console.warn(\"ZIP64 end of central directory not where expected.\");\n                this.relativeOffsetEndOfZip64CentralDir = this.reader.lastIndexOfSignature(sig.ZIP64_CENTRAL_DIRECTORY_END);\n                if (this.relativeOffsetEndOfZip64CentralDir < 0) {\n                    throw new Error(\"Corrupted zip : can't find the ZIP64 end of central directory\");\n                }\n            }\n            this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir);\n            this.checkSignature(sig.ZIP64_CENTRAL_DIRECTORY_END);\n            this.readBlockZip64EndOfCentral();\n        }\n\n        var expectedEndOfCentralDirOffset = this.centralDirOffset + this.centralDirSize;\n        if (this.zip64) {\n            expectedEndOfCentralDirOffset += 20; // end of central dir 64 locator\n            expectedEndOfCentralDirOffset += 12 /* should not include the leading 12 bytes */ + this.zip64EndOfCentralSize;\n        }\n\n        var extraBytes = endOfCentralDirOffset - expectedEndOfCentralDirOffset;\n\n        if (extraBytes > 0) {\n            // console.warn(extraBytes, \"extra bytes at beginning or within zipfile\");\n            if (this.isSignature(endOfCentralDirOffset, sig.CENTRAL_FILE_HEADER)) {\n                // The offsets seem wrong, but we have something at the specified offset.\n                // So… we keep it.\n            } else {\n                // the offset is wrong, update the \"zero\" of the reader\n                // this happens if data has been prepended (crx files for example)\n                this.reader.zero = extraBytes;\n            }\n        } else if (extraBytes < 0) {\n            throw new Error(\"Corrupted zip: missing \" + Math.abs(extraBytes) + \" bytes.\");\n        }\n    },\n    prepareReader: function(data) {\n        var type = utils.getTypeOf(data);\n        utils.checkSupport(type);\n        if (type === \"string\" && !support.uint8array) {\n            this.reader = new StringReader(data, this.loadOptions.optimizedBinaryString);\n        }\n        else if (type === \"nodebuffer\") {\n            this.reader = new NodeBufferReader(data);\n        }\n        else if (support.uint8array) {\n            this.reader = new Uint8ArrayReader(utils.transformTo(\"uint8array\", data));\n        } else if (support.array) {\n            this.reader = new ArrayReader(utils.transformTo(\"array\", data));\n        } else {\n            throw new Error(\"Unexpected error: unsupported type '\" + type + \"'\");\n        }\n    },\n    /**\n     * Read a zip file and create ZipEntries.\n     * @param {String|ArrayBuffer|Uint8Array|Buffer} data the binary string representing a zip file.\n     */\n    load: function(data) {\n        this.prepareReader(data);\n        this.readEndOfCentral();\n        this.readCentralDir();\n        this.readLocalFiles();\n    }\n};\n// }}} end of ZipEntries\nmodule.exports = ZipEntries;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/jszip/lib/zipEntries.js","'use strict';\nvar Uint8ArrayReader = require('./uint8ArrayReader');\n\nfunction NodeBufferReader(data) {\n    this.data = data;\n    this.length = this.data.length;\n    this.index = 0;\n    this.zero = 0;\n}\nNodeBufferReader.prototype = new Uint8ArrayReader();\n\n/**\n * @see DataReader.readData\n */\nNodeBufferReader.prototype.readData = function(size) {\n    this.checkOffset(size);\n    var result = this.data.slice(this.zero + this.index, this.zero + this.index + size);\n    this.index += size;\n    return result;\n};\nmodule.exports = NodeBufferReader;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/jszip/lib/nodeBufferReader.js","'use strict';\nvar StringReader = require('./stringReader');\nvar utils = require('./utils');\nvar CompressedObject = require('./compressedObject');\nvar jszipProto = require('./object');\nvar support = require('./support');\n\nvar MADE_BY_DOS = 0x00;\nvar MADE_BY_UNIX = 0x03;\n\n// class ZipEntry {{{\n/**\n * An entry in the zip file.\n * @constructor\n * @param {Object} options Options of the current file.\n * @param {Object} loadOptions Options for loading the stream.\n */\nfunction ZipEntry(options, loadOptions) {\n    this.options = options;\n    this.loadOptions = loadOptions;\n}\nZipEntry.prototype = {\n    /**\n     * say if the file is encrypted.\n     * @return {boolean} true if the file is encrypted, false otherwise.\n     */\n    isEncrypted: function() {\n        // bit 1 is set\n        return (this.bitFlag & 0x0001) === 0x0001;\n    },\n    /**\n     * say if the file has utf-8 filename/comment.\n     * @return {boolean} true if the filename/comment is in utf-8, false otherwise.\n     */\n    useUTF8: function() {\n        // bit 11 is set\n        return (this.bitFlag & 0x0800) === 0x0800;\n    },\n    /**\n     * Prepare the function used to generate the compressed content from this ZipFile.\n     * @param {DataReader} reader the reader to use.\n     * @param {number} from the offset from where we should read the data.\n     * @param {number} length the length of the data to read.\n     * @return {Function} the callback to get the compressed content (the type depends of the DataReader class).\n     */\n    prepareCompressedContent: function(reader, from, length) {\n        return function() {\n            var previousIndex = reader.index;\n            reader.setIndex(from);\n            var compressedFileData = reader.readData(length);\n            reader.setIndex(previousIndex);\n\n            return compressedFileData;\n        };\n    },\n    /**\n     * Prepare the function used to generate the uncompressed content from this ZipFile.\n     * @param {DataReader} reader the reader to use.\n     * @param {number} from the offset from where we should read the data.\n     * @param {number} length the length of the data to read.\n     * @param {JSZip.compression} compression the compression used on this file.\n     * @param {number} uncompressedSize the uncompressed size to expect.\n     * @return {Function} the callback to get the uncompressed content (the type depends of the DataReader class).\n     */\n    prepareContent: function(reader, from, length, compression, uncompressedSize) {\n        return function() {\n\n            var compressedFileData = utils.transformTo(compression.uncompressInputType, this.getCompressedContent());\n            var uncompressedFileData = compression.uncompress(compressedFileData);\n\n            if (uncompressedFileData.length !== uncompressedSize) {\n                throw new Error(\"Bug : uncompressed data size mismatch\");\n            }\n\n            return uncompressedFileData;\n        };\n    },\n    /**\n     * Read the local part of a zip file and add the info in this object.\n     * @param {DataReader} reader the reader to use.\n     */\n    readLocalPart: function(reader) {\n        var compression, localExtraFieldsLength;\n\n        // we already know everything from the central dir !\n        // If the central dir data are false, we are doomed.\n        // On the bright side, the local part is scary  : zip64, data descriptors, both, etc.\n        // The less data we get here, the more reliable this should be.\n        // Let's skip the whole header and dash to the data !\n        reader.skip(22);\n        // in some zip created on windows, the filename stored in the central dir contains \\ instead of /.\n        // Strangely, the filename here is OK.\n        // I would love to treat these zip files as corrupted (see http://www.info-zip.org/FAQ.html#backslashes\n        // or APPNOTE#4.4.17.1, \"All slashes MUST be forward slashes '/'\") but there are a lot of bad zip generators...\n        // Search \"unzip mismatching \"local\" filename continuing with \"central\" filename version\" on\n        // the internet.\n        //\n        // I think I see the logic here : the central directory is used to display\n        // content and the local directory is used to extract the files. Mixing / and \\\n        // may be used to display \\ to windows users and use / when extracting the files.\n        // Unfortunately, this lead also to some issues : http://seclists.org/fulldisclosure/2009/Sep/394\n        this.fileNameLength = reader.readInt(2);\n        localExtraFieldsLength = reader.readInt(2); // can't be sure this will be the same as the central dir\n        this.fileName = reader.readData(this.fileNameLength);\n        reader.skip(localExtraFieldsLength);\n\n        if (this.compressedSize == -1 || this.uncompressedSize == -1) {\n            throw new Error(\"Bug or corrupted zip : didn't get enough informations from the central directory \" + \"(compressedSize == -1 || uncompressedSize == -1)\");\n        }\n\n        compression = utils.findCompression(this.compressionMethod);\n        if (compression === null) { // no compression found\n            throw new Error(\"Corrupted zip : compression \" + utils.pretty(this.compressionMethod) + \" unknown (inner file : \" +  utils.transformTo(\"string\", this.fileName) + \")\");\n        }\n        this.decompressed = new CompressedObject();\n        this.decompressed.compressedSize = this.compressedSize;\n        this.decompressed.uncompressedSize = this.uncompressedSize;\n        this.decompressed.crc32 = this.crc32;\n        this.decompressed.compressionMethod = this.compressionMethod;\n        this.decompressed.getCompressedContent = this.prepareCompressedContent(reader, reader.index, this.compressedSize, compression);\n        this.decompressed.getContent = this.prepareContent(reader, reader.index, this.compressedSize, compression, this.uncompressedSize);\n\n        // we need to compute the crc32...\n        if (this.loadOptions.checkCRC32) {\n            this.decompressed = utils.transformTo(\"string\", this.decompressed.getContent());\n            if (jszipProto.crc32(this.decompressed) !== this.crc32) {\n                throw new Error(\"Corrupted zip : CRC32 mismatch\");\n            }\n        }\n    },\n\n    /**\n     * Read the central part of a zip file and add the info in this object.\n     * @param {DataReader} reader the reader to use.\n     */\n    readCentralPart: function(reader) {\n        this.versionMadeBy = reader.readInt(2);\n        this.versionNeeded = reader.readInt(2);\n        this.bitFlag = reader.readInt(2);\n        this.compressionMethod = reader.readString(2);\n        this.date = reader.readDate();\n        this.crc32 = reader.readInt(4);\n        this.compressedSize = reader.readInt(4);\n        this.uncompressedSize = reader.readInt(4);\n        this.fileNameLength = reader.readInt(2);\n        this.extraFieldsLength = reader.readInt(2);\n        this.fileCommentLength = reader.readInt(2);\n        this.diskNumberStart = reader.readInt(2);\n        this.internalFileAttributes = reader.readInt(2);\n        this.externalFileAttributes = reader.readInt(4);\n        this.localHeaderOffset = reader.readInt(4);\n\n        if (this.isEncrypted()) {\n            throw new Error(\"Encrypted zip are not supported\");\n        }\n\n        this.fileName = reader.readData(this.fileNameLength);\n        this.readExtraFields(reader);\n        this.parseZIP64ExtraField(reader);\n        this.fileComment = reader.readData(this.fileCommentLength);\n    },\n\n    /**\n     * Parse the external file attributes and get the unix/dos permissions.\n     */\n    processAttributes: function () {\n        this.unixPermissions = null;\n        this.dosPermissions = null;\n        var madeBy = this.versionMadeBy >> 8;\n\n        // Check if we have the DOS directory flag set.\n        // We look for it in the DOS and UNIX permissions\n        // but some unknown platform could set it as a compatibility flag.\n        this.dir = this.externalFileAttributes & 0x0010 ? true : false;\n\n        if(madeBy === MADE_BY_DOS) {\n            // first 6 bits (0 to 5)\n            this.dosPermissions = this.externalFileAttributes & 0x3F;\n        }\n\n        if(madeBy === MADE_BY_UNIX) {\n            this.unixPermissions = (this.externalFileAttributes >> 16) & 0xFFFF;\n            // the octal permissions are in (this.unixPermissions & 0x01FF).toString(8);\n        }\n\n        // fail safe : if the name ends with a / it probably means a folder\n        if (!this.dir && this.fileNameStr.slice(-1) === '/') {\n            this.dir = true;\n        }\n    },\n\n    /**\n     * Parse the ZIP64 extra field and merge the info in the current ZipEntry.\n     * @param {DataReader} reader the reader to use.\n     */\n    parseZIP64ExtraField: function(reader) {\n\n        if (!this.extraFields[0x0001]) {\n            return;\n        }\n\n        // should be something, preparing the extra reader\n        var extraReader = new StringReader(this.extraFields[0x0001].value);\n\n        // I really hope that these 64bits integer can fit in 32 bits integer, because js\n        // won't let us have more.\n        if (this.uncompressedSize === utils.MAX_VALUE_32BITS) {\n            this.uncompressedSize = extraReader.readInt(8);\n        }\n        if (this.compressedSize === utils.MAX_VALUE_32BITS) {\n            this.compressedSize = extraReader.readInt(8);\n        }\n        if (this.localHeaderOffset === utils.MAX_VALUE_32BITS) {\n            this.localHeaderOffset = extraReader.readInt(8);\n        }\n        if (this.diskNumberStart === utils.MAX_VALUE_32BITS) {\n            this.diskNumberStart = extraReader.readInt(4);\n        }\n    },\n    /**\n     * Read the central part of a zip file and add the info in this object.\n     * @param {DataReader} reader the reader to use.\n     */\n    readExtraFields: function(reader) {\n        var start = reader.index,\n            extraFieldId,\n            extraFieldLength,\n            extraFieldValue;\n\n        this.extraFields = this.extraFields || {};\n\n        while (reader.index < start + this.extraFieldsLength) {\n            extraFieldId = reader.readInt(2);\n            extraFieldLength = reader.readInt(2);\n            extraFieldValue = reader.readString(extraFieldLength);\n\n            this.extraFields[extraFieldId] = {\n                id: extraFieldId,\n                length: extraFieldLength,\n                value: extraFieldValue\n            };\n        }\n    },\n    /**\n     * Apply an UTF8 transformation if needed.\n     */\n    handleUTF8: function() {\n        var decodeParamType = support.uint8array ? \"uint8array\" : \"array\";\n        if (this.useUTF8()) {\n            this.fileNameStr = jszipProto.utf8decode(this.fileName);\n            this.fileCommentStr = jszipProto.utf8decode(this.fileComment);\n        } else {\n            var upath = this.findExtraFieldUnicodePath();\n            if (upath !== null) {\n                this.fileNameStr = upath;\n            } else {\n                var fileNameByteArray =  utils.transformTo(decodeParamType, this.fileName);\n                this.fileNameStr = this.loadOptions.decodeFileName(fileNameByteArray);\n            }\n\n            var ucomment = this.findExtraFieldUnicodeComment();\n            if (ucomment !== null) {\n                this.fileCommentStr = ucomment;\n            } else {\n                var commentByteArray =  utils.transformTo(decodeParamType, this.fileComment);\n                this.fileCommentStr = this.loadOptions.decodeFileName(commentByteArray);\n            }\n        }\n    },\n\n    /**\n     * Find the unicode path declared in the extra field, if any.\n     * @return {String} the unicode path, null otherwise.\n     */\n    findExtraFieldUnicodePath: function() {\n        var upathField = this.extraFields[0x7075];\n        if (upathField) {\n            var extraReader = new StringReader(upathField.value);\n\n            // wrong version\n            if (extraReader.readInt(1) !== 1) {\n                return null;\n            }\n\n            // the crc of the filename changed, this field is out of date.\n            if (jszipProto.crc32(this.fileName) !== extraReader.readInt(4)) {\n                return null;\n            }\n\n            return jszipProto.utf8decode(extraReader.readString(upathField.length - 5));\n        }\n        return null;\n    },\n\n    /**\n     * Find the unicode comment declared in the extra field, if any.\n     * @return {String} the unicode comment, null otherwise.\n     */\n    findExtraFieldUnicodeComment: function() {\n        var ucommentField = this.extraFields[0x6375];\n        if (ucommentField) {\n            var extraReader = new StringReader(ucommentField.value);\n\n            // wrong version\n            if (extraReader.readInt(1) !== 1) {\n                return null;\n            }\n\n            // the crc of the comment changed, this field is out of date.\n            if (jszipProto.crc32(this.fileComment) !== extraReader.readInt(4)) {\n                return null;\n            }\n\n            return jszipProto.utf8decode(extraReader.readString(ucommentField.length - 5));\n        }\n        return null;\n    }\n};\nmodule.exports = ZipEntry;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/jszip/lib/zipEntry.js","'use strict';\nvar utils = require('./utils');\n\n/**\n * @deprecated\n * This function will be removed in a future version without replacement.\n */\nexports.string2binary = function(str) {\n    return utils.string2binary(str);\n};\n\n/**\n * @deprecated\n * This function will be removed in a future version without replacement.\n */\nexports.string2Uint8Array = function(str) {\n    return utils.transformTo(\"uint8array\", str);\n};\n\n/**\n * @deprecated\n * This function will be removed in a future version without replacement.\n */\nexports.uint8Array2String = function(array) {\n    return utils.transformTo(\"string\", array);\n};\n\n/**\n * @deprecated\n * This function will be removed in a future version without replacement.\n */\nexports.string2Blob = function(str) {\n    var buffer = utils.transformTo(\"arraybuffer\", str);\n    return utils.arrayBuffer2Blob(buffer);\n};\n\n/**\n * @deprecated\n * This function will be removed in a future version without replacement.\n */\nexports.arrayBuffer2Blob = function(buffer) {\n    return utils.arrayBuffer2Blob(buffer);\n};\n\n/**\n * @deprecated\n * This function will be removed in a future version without replacement.\n */\nexports.transformTo = function(outputType, input) {\n    return utils.transformTo(outputType, input);\n};\n\n/**\n * @deprecated\n * This function will be removed in a future version without replacement.\n */\nexports.getTypeOf = function(input) {\n    return utils.getTypeOf(input);\n};\n\n/**\n * @deprecated\n * This function will be removed in a future version without replacement.\n */\nexports.checkSupport = function(type) {\n    return utils.checkSupport(type);\n};\n\n/**\n * @deprecated\n * This value will be removed in a future version without replacement.\n */\nexports.MAX_VALUE_16BITS = utils.MAX_VALUE_16BITS;\n\n/**\n * @deprecated\n * This value will be removed in a future version without replacement.\n */\nexports.MAX_VALUE_32BITS = utils.MAX_VALUE_32BITS;\n\n\n/**\n * @deprecated\n * This function will be removed in a future version without replacement.\n */\nexports.pretty = function(str) {\n    return utils.pretty(str);\n};\n\n/**\n * @deprecated\n * This function will be removed in a future version without replacement.\n */\nexports.findCompression = function(compressionMethod) {\n    return utils.findCompression(compressionMethod);\n};\n\n/**\n * @deprecated\n * This function will be removed in a future version without replacement.\n */\nexports.isRegExp = function (object) {\n    return utils.isRegExp(object);\n};\n\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/jszip/lib/deprecatedPublicUtils.js","import JAnalyzer from './jAnalyzer';\nimport impurityRemover from './ImpurityRemover';\nimport {Ranges} from 'spectra-data-ranges';\nimport round from 'lodash.round';\n\nconst defaultOptions = {\n    nH: 100,\n    clean: 0.5,\n    thresholdFactor: 1,\n    compile: true,\n    integralType: 'sum',\n    optimize: true,\n    frequencyCluster: 16,\n    keepPeaks: false\n};\n\n/**\n * This function clustering peaks and calculate the integral value for each range from the peak list returned from extractPeaks function.\n * @param {SD} spectrum - SD instance\n * @param {Object} peakList - nmr signals\n * @param {Object} options - options object with some parameter for GSD, detectSignal functions.\n * @param {number} [options.nH = 100] - Number of hydrogens or some number to normalize the integral data. If it's zero return the absolute integral value\n * @param {string} [options.integralType = 'sum'] - option to chose between approx area with peaks or the sum of the points of given range ('sum', 'peaks')\n * @param {number} [options.frequencyCluster = 16] - distance limit to clustering peaks.\n * @param {number} [options.clean] - If exits it remove all the signals with integral < clean value\n * @param {boolean} [options.compile = true] - If true, the Janalyzer function is run over signals to compile the patterns.\n * @param {boolean} [options.keepPeaks = false] - If true each signal will contain an array of peaks.\n * @returns {Array}\n */\n\nexport default function createRanges(spectrum, peakList, options) {\n    options = Object.assign({}, defaultOptions, options);\n    var i, j;\n    var nH = options.nH;\n    peakList = impurityRemover(peakList, options.removeImpurity);\n    var signals = detectSignals(spectrum, peakList, options);\n\n    if (options.clean) {\n        for (i = 0; i < signals.length; i++) {\n            if (signals[i].integralData.value < options.clean) {\n                signals.splice(i, 1);\n            }\n        }\n    }\n\n    if (options.compile) {\n        var nHi, sum;\n        for (i = 0; i < signals.length; i++) {\n            JAnalyzer.compilePattern(signals[i]);\n\n            if (signals[i].maskPattern &&\n                signals[i].multiplicity !== 'm' &&\n                signals[i].multiplicity !== ''\n            ) {\n                //Create a new signal with the removed peaks\n                nHi = 0;\n                sum = 0;\n                var peaksO = [];\n                for (j = signals[i].maskPattern.length - 1; j >= 0; j--) {\n                    sum += computeArea(signals[i].peaks[j]);\n                    if (signals[i].maskPattern[j] === false) {\n                        var peakR = signals[i].peaks.splice(j, 1)[0];\n                        peaksO.push({x: peakR.x, y: peakR.intensity, width: peakR.width});\n                        signals[i].mask.splice(j, 1);\n                        signals[i].mask2.splice(j, 1);\n                        signals[i].maskPattern.splice(j, 1);\n                        signals[i].nbPeaks--;\n                        nHi += computeArea(peakR);\n                    }\n                }\n                if (peaksO.length > 0) {\n                    nHi = nHi * signals[i].integralData.value / sum;\n                    signals[i].integralData.value -= nHi;\n                    var peaks1 = [];\n                    for (j = peaksO.length - 1; j >= 0; j--) {\n                        peaks1.push(peaksO[j]);\n                    }\n                    options.nH = nHi;\n                    let ranges = detectSignals(spectrum, peaks1, options);\n\n                    for (j = 0; j < ranges.length; j++) {\n                        signals.push(ranges[j]);\n                    }\n                }\n            }\n        }\n        // it was a updateIntegrals function.\n        var sumIntegral = 0;\n        var sumObserved = 0;\n        for (i = 0; i < signals.length; i++) {\n            sumObserved += Math.round(signals[i].integralData.value);\n        }\n        if (sumObserved !== nH) {\n            sumIntegral = nH / sumObserved;\n            for (i = 0; i < signals.length; i++) {\n                signals[i].integralData.value *= sumIntegral;\n            }\n        }\n    }\n\n    signals.sort(function (a, b) {\n        return b.delta1 - a.delta1;\n    });\n\n    if (options.clean) {\n        for (i = signals.length - 1; i >= 0; i--) {\n            if (signals[i].integralData.value < options.clean) {\n                signals.splice(i, 1);\n            }\n        }\n    }\n\n    let ranges = new Array(signals.length);\n    for (i = 0; i < signals.length; i++) {\n        var signal = signals[i];\n        ranges[i] = {\n            from: round(signal.integralData.from, 5),\n            to: round(signal.integralData.to, 5),\n            integral: round(signal.integralData.value, 5),\n            signal: [{\n                nbAtoms: 0,\n                diaID: [],\n                multiplicity: signal.multiplicity,\n                kind: '',\n                remark: ''\n            }]\n\n        };\n        if (options.keepPeaks) {\n            ranges[i].signal[0].peak = signal.peaks;\n        }\n        if (signal.nmrJs) {\n            ranges[i].signal[0].j = signal.nmrJs;\n        }\n        if (!signal.asymmetric || signal.multiplicity === 'm') {\n            ranges[i].signal[0].delta = round(signal.delta1, 5);\n        }\n    }\n\n    return new Ranges(ranges);\n}\n\n\n/**\n * Extract the signals from the peakList and the given spectrum.\n * @param {object} spectrum - spectra data\n * @param {object} peakList - nmr signals\n * @param {object} options\n * @param {...number} options.nH - Number of hydrogens or some number to normalize the integral data, If it's zero return the absolute integral value\n * @param {string} options.integralType - option to chose between approx area with peaks or the sum of the points of given range\n * @param {...number} options.frequencyCluster - distance limit to clustering the peaks.\n * range = frequencyCluster / observeFrequency -> Peaks withing this range are considered to belongs to the same signal1D\n * @return {Array} nmr signals\n * @private\n */\nfunction detectSignals(spectrum, peakList, options = {}) {\n    var {\n        nH = 100,\n        integralType = 'sum',\n        frequencyCluster = 16,\n        frequency = spectrum.observeFrequencyX()\n    } = options;\n\n    var i, j, signal1D, peaks;\n    var signals = [];\n    var prevPeak = {x: 100000};\n    var spectrumIntegral = 0;\n    frequencyCluster /= frequency;\n    for (i = 0; i < peakList.length; i++) {\n        if (Math.abs(peakList[i].x - prevPeak.x) > frequencyCluster) {\n            signal1D = {\n                nbPeaks: 1, units: 'PPM',\n                startX: peakList[i].x - peakList[i].width,\n                stopX: peakList[i].x + peakList[i].width,\n                multiplicity: '', pattern: '',\n                observe: frequency, nucleus: spectrum.getNucleus(1),\n                integralData: {\n                    from: peakList[i].x - peakList[i].width * 3,\n                    to: peakList[i].x + peakList[i].width * 3\n                },\n                peaks: [{x: peakList[i].x, intensity: peakList[i].y, width: peakList[i].width}]\n            };\n            signals.push(signal1D);\n        } else {\n            var tmp = peakList[i].x + peakList[i].width;\n            signal1D.stopX = Math.max(signal1D.stopX, tmp);\n            signal1D.startX = Math.min(signal1D.startX, tmp);\n            signal1D.nbPeaks++;\n            signal1D.peaks.push({x: peakList[i].x, intensity: peakList[i].y, width: peakList[i].width});\n            signal1D.integralData.from = Math.min(signal1D.integralData.from, peakList[i].x - peakList[i].width * 3);\n            signal1D.integralData.to = Math.max(signal1D.integralData.to, peakList[i].x + peakList[i].width * 3);\n        }\n        prevPeak = peakList[i];\n    }\n\n    for (i = 0; i < signals.length; i++) {\n        peaks = signals[i].peaks;\n        let integral = signals[i].integralData;\n        let chemicalShift = 0;\n        let integralPeaks = 0;\n\n        for (j = 0; j < peaks.length; j++) {\n            var area = computeArea(peaks[j]);\n            chemicalShift += peaks[j].x * area;\n            integralPeaks += area;\n        }\n        signals[i].delta1 = chemicalShift / integralPeaks;\n\n        if (integralType === 'sum') {\n            integral.value = spectrum.getArea(integral.from, integral.to);\n        } else {\n            integral.value = integralPeaks;\n        }\n        spectrumIntegral += integral.value;\n    }\n\n    if (nH > 0) {\n        let integralFactor = nH / spectrumIntegral;\n        for (i = 0; i < signals.length; i++) {\n            let integral = signals[i].integralData;\n            integral.value *= integralFactor;\n        }\n    }\n\n    return signals;\n}\n\n/**\n * Return the area of a Lorentzian function\n * @param {object} peak - object with peak information\n * @return {number}\n * @private\n */\nfunction computeArea(peak) {\n    return Math.abs(peak.intensity * peak.width * 1.57); // todo add an option with this value: 1.772453851\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/spectra-data/src/peakPicking/peaks2Ranges.js","/*\n * This library implements the J analyser described by Cobas et al in the paper:\n * A two-stage approach to automatic determination of 1H NMR coupling constants\n */\nconst patterns = ['s', 'd', 't', 'q', 'quint', 'h', 'sept', 'o', 'n'];\nvar symRatio = 1.5;\nvar maxErrorIter1 = 2.5;//Hz\nvar maxErrorIter2 = 1;//Hz\n\nexport default {\n    /**\n     * The compilation process implements at the first stage a normalization procedure described by Golotvin et al.\n     * embedding in peak-component-counting method described by Hoyes et al.\n     * @param {object} signal\n     * @private\n     */\n    compilePattern: function (signal) {\n        signal.multiplicity = 'm';\n        // 1.1 symmetrize\n        // It will add a set of peaks(signal.peaksComp) to the signal that will be used during\n        // the compilation process. The unit of those peaks will be in Hz\n        signal.symRank = symmetrizeChoiseBest(signal, maxErrorIter1, 1);\n        signal.asymmetric = true;\n        //Is the signal symmetric?\n        if (signal.symRank >= 0.95 && signal.peaksComp.length < 32) {\n            signal.asymmetric = false;\n            var i, j, n, P1, n2, maxFlagged;\n            var k = 1;\n            var Jc = [];\n\n            //Loop over the possible number of coupling contributing to the multiplet\n            for (n = 0; n < 9; n++) {\n                //1.2 Normalize. It makes a deep copy of the peaks before to modify them.\n                var peaks = normalize(signal, n);\n                //signal.peaksCompX = peaks;\n                var validPattern = false;//It will change to true, when we find the good patter\n                //Lets check if the signal could be a singulet.\n                if (peaks.length === 1 && n === 0) {\n                    validPattern = true;\n                } else {\n                    if (peaks.length <= 1) {\n                        continue;\n                    }\n                }\n                // 1.3 Establish a range for the Heights Hi [peaks.intensity*0.85,peaks.intensity*1.15];\n                var ranges = getRanges(peaks);\n                n2 = Math.pow(2, n);\n\n                // 1.4 Find a combination of integer heights Hi, one from each Si, that sums to 2^n.\n                var heights = null;\n                var counter = 1;\n                while (!validPattern && (heights = getNextCombination(ranges, n2)) !== null && counter < 400) {\n                    // 2.1 Number the components of the multiplet consecutively from 1 to 2n,\n                    // starting at peak 1\n                    var numbering = new Array(heights.length);\n                    k = 1;\n                    for (i = 0; i < heights.length; i++) {\n                        numbering[i] = new Array(heights[i]);\n                        for (j = 0; j < heights[i]; j++) {\n                            numbering[i][j] = k++;\n                        }\n                    }\n\n                    Jc = []; //The array to store the detected j-coupling\n                    // 2.2 Set j = 1; J1 = P2 - P1. Flag components 1 and 2 as accounted for.\n                    j = 1;\n                    Jc.push(peaks[1].x - peaks[0].x);\n                    P1 = peaks[0].x;\n                    numbering[0].splice(0, 1);//Flagged\n                    numbering[1].splice(0, 1);//Flagged\n                    k = 1;\n                    var nFlagged = 2;\n                    maxFlagged = Math.pow(2, n) - 1;\n                    while (Jc.length < n && nFlagged < maxFlagged && k < peaks.length) {\n                        counter += 1;\n                        // 4.1. Increment j. Set k to the number of the first unflagged component.\n                        j++;\n                        while (k < peaks.length && numbering[k].length === 0) {\n                            k++;\n                        }\n                        if (k < peaks.length) {\n                            // 4.2 Jj = Pk - P1.\n                            Jc.push(peaks[k].x - peaks[0].x);\n                            //Flag component k and, for each sum of the...\n                            numbering[k].splice(0, 1);//Flageed\n                            nFlagged++;\n                            //Flag the other components of the multiplet\n                            for (var u = 2; u <= j; u++) {\n                                //TODO improve those loops\n                                var jSum = 0;\n                                for (i = 0; i < u; i++) {\n                                    jSum += Jc[i];\n                                }\n                                for (i = 1; i < numbering.length; i++) {\n                                    //Maybe 0.25 Hz is too much?\n                                    if (Math.abs(peaks[i].x - (P1 + jSum)) < 0.25) {\n                                        numbering[i].splice(0, 1);//Flageed\n                                        nFlagged++;\n                                        break;\n                                    }\n                                }\n                            }\n                        }\n                    }\n                    //Calculate the ideal patter by using the extracted j-couplings\n                    var pattern = idealPattern(Jc);\n                    //Compare the ideal pattern with the proposed intensities.\n                    // All the intensities have to match to accept the multiplet\n                    validPattern = true;\n                    for (i = 0; i < pattern.length; i++) {\n                        if (pattern[i].intensity !== heights[i]) {\n                            validPattern = false;\n                        }\n                    }\n                }\n                //If we found a valid pattern we should inform about the pattern.\n                if (validPattern) {\n                    updateSignal(signal, Jc);\n                }\n            }\n        }\n        //Before to return, change the units of peaksComp from Hz to PPM again\n        for (i = 0; i < signal.peaksComp.length; i++) {\n            signal.peaksComp[i].x /= signal.observe;\n        }\n    }\n};\n\nfunction updateSignal(signal, Jc) {\n    //Update the limits of the signal\n    var peaks = signal.peaksComp;//Always in Hz\n    var nbPeaks = peaks.length;\n    signal.startX = peaks[0].x / signal.observe - peaks[0].width;\n    signal.stopX = peaks[nbPeaks - 1].x / signal.observe + peaks[nbPeaks - 1].width;\n\n    signal.integralData.from = peaks[0].x / signal.observe - peaks[0].width * 3;\n    signal.integralData.to = peaks[nbPeaks - 1].x / signal.observe + peaks[nbPeaks - 1].width * 3;\n\n    //Compile the pattern and format the constant couplings\n    signal.maskPattern = signal.mask2;\n    signal.multiplicity = abstractPattern(signal, Jc);\n    signal.pattern = signal.multiplicity;//Our library depends on this parameter, but it is old\n    //console.log(signal);\n    /*if (DEBUG)        {\n        console.log('Final j-couplings: ' + JSON.stringify(Jc));\n    }*/\n}\n\n/**\n * Returns the multiplet in the compact format\n * @param {object} signal\n * @param {object} Jc\n * @return {string}\n * @private\n */\nfunction abstractPattern(signal, Jc) {\n    var tol = 0.05;\n    var i;\n    var pattern = '';\n    var cont = 1;\n    var newNmrJs = [];\n\n    if (Jc && Jc.length > 0) {\n        Jc.sort(function (a, b) {\n            return b - a;\n        });\n\n        for (i = 0; i < Jc.length - 1; i++) {\n            if (Math.abs(Jc[i] - Jc[i + 1]) < tol) {\n                cont++;\n            } else {\n                newNmrJs.push({coupling: Math.abs(Jc[i]), multiplicity: patterns[cont]});\n                pattern += patterns[cont];\n                cont = 1;\n            }\n        }\n        newNmrJs.push({coupling: Math.abs(Jc[i]), multiplicity: patterns[cont]});\n        pattern += patterns[cont];\n        signal.nmrJs = newNmrJs;\n    } else {\n        pattern = 's';\n        if (Math.abs(signal.startX - signal.stopX) * signal.observe > 16) {\n            pattern = 'br s';\n        }\n    }\n    return pattern;\n}\n\n/**\n * This function creates an ideal pattern from the given J-couplings\n * @private\n * @param {Array} Jc\n * @return {*[]}\n * @private\n */\nfunction idealPattern(Jc) {\n    var hsum = Math.pow(2, Jc.length);\n    var i, j;\n    var pattern = [{x: 0, intensity: hsum}];\n    //To split the initial height\n    for (i = 0; i < Jc.length; i++) {\n        for (j = pattern.length - 1; j >= 0; j--) {\n            pattern.push({x: pattern[j].x + Jc[i] / 2,\n                intensity: pattern[j].intensity / 2});\n            pattern[j].x = pattern[j].x - Jc[i] / 2;\n            pattern[j].intensity = pattern[j].intensity / 2;\n        }\n    }\n    //To sum the heights in the same positions\n    pattern.sort(function compare(a, b) {\n        return a.x - b.x;\n    });\n    for (j = pattern.length - 2; j >= 0; j--) {\n        if (Math.abs(pattern[j].x - pattern[j + 1].x) < 0.1) {\n            pattern[j].intensity += pattern[j + 1].intensity;\n            pattern.splice(j + 1, 1);\n        }\n    }\n    return pattern;\n}\n\n/**\n * Find a combination of integer heights Hi, one from each Si, that sums to 2n.\n * @param {object} ranges\n * @param {number} value\n * @return {*}\n * @private\n */\nfunction getNextCombination(ranges, value) {\n    var half = Math.ceil(ranges.values.length * 0.5);\n    var lng = ranges.values.length;\n    var sum = 0;\n    var i, ok;\n    while (sum !== value) {\n        //Update the indexes to point at the next possible combination\n        ok = false;\n        while (!ok) {\n            ok = true;\n            ranges.currentIndex[ranges.active]++;\n            if (ranges.currentIndex[ranges.active] >= ranges.values[ranges.active].length) {\n                //In this case, there is no more possible combinations\n                if (ranges.active + 1 === half) {\n                    return null;\n                } else {\n                    //If this happens we need to try the next active peak\n                    ranges.currentIndex[ranges.active] = 0;\n                    ok = false;\n                    ranges.active++;\n                }\n            } else {\n                ranges.active = 0;\n            }\n        }\n        // Sum the heights for this combination\n        sum = 0;\n        for (i = 0; i < half; i++) {\n            sum += ranges.values[i][ranges.currentIndex[i]] * 2;\n        }\n        if (ranges.values.length % 2 !== 0) {\n            sum -= ranges.values[half - 1][ranges.currentIndex[half - 1]];\n        }\n    }\n    //If the sum is equal to the expected value, fill the array to return\n    if (sum === value) {\n        var heights = new Array(lng);\n        for (i = 0; i < half; i++) {\n            heights[i] = ranges.values[i][ranges.currentIndex[i]];\n            heights[lng - i - 1] = ranges.values[i][ranges.currentIndex[i]];\n        }\n        return heights;\n    }\n    return null;\n}\n\n/**\n * This function generates the possible values that each peak can contribute\n * to the multiplet.\n * @param {Array} peaks Array of objects with peaks information {intensity}\n * @return {{values: Array, currentIndex: Array, active: number}}\n */\nfunction getRanges(peaks) {\n    var ranges = new Array(peaks.length);\n    var currentIndex = new Array(peaks.length);\n    var min, max;\n    ranges[0] = [1];\n    ranges[peaks.length - 1] = [1];\n    currentIndex[0] = -1;\n    currentIndex[peaks.length - 1] = 0;\n    for (var i = 1; i < peaks.length - 1; i++) {\n        min = Math.round(peaks[i].intensity * 0.85);\n        max = Math.round(peaks[i].intensity * 1.15);\n        ranges[i] = [];\n        for (var j = min; j <= max; j++) {\n            ranges[i].push(j);\n        }\n        currentIndex[i] = 0;\n    }\n    return {values: ranges, currentIndex: currentIndex, active: 0};\n}\n/**\n * Performs a symmetrization of the signal by using different aproximations to the center.\n * It will return the result of the symmetrization that removes less peaks from the signal\n * @param {object} signal\n * @param {number} maxError\n * @param {number} iteration\n * @return {*}\n * @private\n */\nfunction symmetrizeChoiseBest(signal, maxError, iteration) {\n    var symRank1 = symmetrize(signal, maxError, iteration);\n    var tmpPeaks = signal.peaksComp;\n    var tmpMask = signal.mask;\n    var cs = signal.delta1;\n    signal.delta1 = (signal.peaks[0].x + signal.peaks[signal.peaks.length - 1].x) / 2;\n    var symRank2 = symmetrize(signal, maxError, iteration);\n    if (signal.peaksComp.length > tmpPeaks.length) {\n        return symRank2;\n    } else {\n        signal.delta1 = cs;\n        signal.peaksComp = tmpPeaks;\n        signal.mask = tmpMask;\n        return symRank1;\n    }\n\n}\n\n/**\n * This function will return a set of symmetric peaks that will\n * be the enter point for the patter compilation process.\n * @param {object} signal\n * @param {number} maxError\n * @param {number} iteration\n * @return {number}\n * @private\n */\nfunction symmetrize(signal, maxError, iteration) {\n    //Before to symmetrize we need to keep only the peaks that possibly conforms the multiplete\n    var max, min, avg, ratio, avgWidth, i;\n    var peaks = new Array(signal.peaks.length);\n    //Make a deep copy of the peaks and convert PPM ot HZ\n    for (i = 0; i < peaks.length; i++) {\n        peaks[i] = {x: signal.peaks[i].x * signal.observe,\n            intensity: signal.peaks[i].intensity,\n            width: signal.peaks[i].width};\n    }\n    //Join the peaks that are closer than 0.25 Hz\n    for (i = peaks.length - 2; i >= 0; i--) {\n        if (Math.abs(peaks[i].x - peaks[i + 1].x) < 0.25) {\n            peaks[i].x = (peaks[i].x * peaks[i].intensity + peaks[i + 1].x * peaks[i + 1].intensity);\n            peaks[i].intensity = peaks[i].intensity + peaks[i + 1].intensity;\n            peaks[i].x /= peaks[i].intensity;\n            peaks[i].intensity /= 2;\n            peaks[i].width += peaks[i + 1].width;\n            peaks.splice(i + 1, 1);\n        }\n    }\n    signal.peaksComp = peaks;\n    var nbPeaks = peaks.length;\n    var mask = new Array(nbPeaks);\n    signal.mask = mask;\n    var left = 0;\n    var right = peaks.length - 1;\n    var cs = signal.delta1 * signal.observe;\n    var middle = [(peaks[0].x + peaks[nbPeaks - 1].x) / 2, 1];\n    maxError = error(Math.abs(cs - middle[0]));\n    var heightSum = 0;\n    //We try to symmetrize the extreme peaks. We consider as candidates for symmetricing those which have\n    //ratio smaller than 3\n    for (i = 0; i < nbPeaks; i++) {\n        mask[i] = true;\n        heightSum += signal.peaks[i].intensity;\n    }\n\n    while (left <= right) {\n        mask[left] = true;\n        mask[right] = true;\n        if (left === right) {\n            if (nbPeaks > 2 && Math.abs(peaks[left].x - cs) > maxError) {\n                mask[left] = false;\n            }\n        } else {\n            max = Math.max(peaks[left].intensity, peaks[right].intensity);\n            min = Math.min(peaks[left].intensity, peaks[right].intensity);\n            ratio = max / min;\n            if (ratio > symRatio) {\n                if (peaks[left].intensity === min) {\n                    mask[left] = false;\n                    right++;\n                } else {\n                    mask[right] = false;\n                    left--;\n                }\n            } else {\n                var diffL = Math.abs(peaks[left].x - cs);\n                var diffR = Math.abs(peaks[right].x - cs);\n\n                if (Math.abs(diffL - diffR) < maxError) {\n                    avg = Math.min(peaks[left].intensity, peaks[right].intensity);\n                    avgWidth = Math.min(peaks[left].width, peaks[right].width);\n                    peaks[left].intensity = peaks[right].intensity = avg;\n                    peaks[left].width = peaks[right].width = avgWidth;\n                    middle = [middle[0] + ((peaks[right].x + peaks[left].x) / 2), middle[1] + 1];\n                } else {\n                    if (Math.max(diffL, diffR) === diffR) {\n                        mask[right] = false;\n                        left--;\n                    } else {\n                        mask[left] = false;\n                        right++;\n                    }\n                }\n            }\n        }\n        left++;\n        right--;\n        //Only alter cs if it is the first iteration of the sym process.\n        if (iteration === 1) {\n            cs = chemicalShift(peaks, mask);\n            //There is not more available peaks\n            if (isNaN(cs)) {\n                return 0;\n            }\n        }\n        maxError = error(Math.abs(cs - middle[0] / middle[1]));\n    }\n    //To remove the weak peaks and recalculate the cs\n    for (i = nbPeaks - 1; i >= 0; i--) {\n        if (mask[i] === false) {\n            peaks.splice(i, 1);\n        }\n    }\n    cs = chemicalShift(peaks);\n    if (isNaN(cs)) {\n        return 0;\n    }\n    signal.delta1 = cs / signal.observe;\n    //Now, the peak should be symmetric in heights, but we need to know if it is symmetric in x\n    let symFactor = 0;\n    let weight = 0;\n    if (peaks.length > 1) {\n        for (i = Math.ceil(peaks.length / 2) - 1; i >= 0; i--) {\n            symFactor += (3 + Math.min(Math.abs(peaks[i].x - cs), Math.abs(peaks[peaks.length - 1 - i].x - cs)))\n                / (3 + Math.max(Math.abs(peaks[i].x - cs), Math.abs(peaks[peaks.length - 1 - i].x - cs))) * peaks[i].intensity;\n            weight += peaks[i].intensity;\n        }\n        symFactor /= weight;\n    } else {\n        if (peaks.length === 1) {\n            symFactor = 1;\n        }\n    }\n    var newSumHeights = 0;\n    for (i = 0; i < peaks.length; i++) {\n        newSumHeights += peaks[i].intensity;\n    }\n    symFactor -= (heightSum - newSumHeights) / heightSum * 0.12; //Removed peaks penalty\n    //Sometimes we need a second opinion after the first symmetrization.\n    if (symFactor > 0.8 && symFactor < 0.97 && iteration < 2) {\n        return symmetrize(signal, maxErrorIter2, 2);\n    } else {\n        //Center the given pattern at cs and symmetrize x\n        if (peaks.length > 1) {\n            let dxi;\n            for (i = Math.ceil(peaks.length / 2) - 1; i >= 0; i--) {\n                dxi = (peaks[i].x - peaks[peaks.length - 1 - i].x) / 2.0;\n                peaks[i].x = cs + dxi;\n                peaks[peaks.length - 1 - i].x = cs - dxi;\n            }\n        }\n    }\n    return symFactor;\n}\n/**\n * Error validator\n * @param {number} value\n * @return {number}\n * @private\n */\nfunction error(value) {\n    var maxError = value * 2.5;\n    if (maxError < 0.75) {\n        maxError = 0.75;\n    }\n    if (maxError > 3) {\n        maxError = 3;\n    }\n    return maxError;\n}\n/**\n * 2 stages normalizarion of the peaks heights to Math.pow(2,n).\n * Creates a new mask with the peaks that could contribute to the multiplete\n * @param {object} signal\n * @param {number} n\n * @return {*}\n */\nfunction normalize(signal, n) {\n    //Perhaps this is slow\n    var peaks = JSON.parse(JSON.stringify(signal.peaksComp));\n    var norm = 0;\n    var norm2 = 0;\n    for (var i = 0; i < peaks.length; i++) {\n        norm += peaks[i].intensity;\n    }\n    norm = Math.pow(2, n) / norm;\n    signal.mask2 = JSON.parse(JSON.stringify(signal.mask));\n\n    var index = signal.mask2.length - 1;\n    for (i = peaks.length - 1; i >= 0; i--) {\n        peaks[i].intensity *= norm;\n        while (index >= 0 && signal.mask2[index] === false) {\n            index--;\n        }\n        if (peaks[i].intensity < 0.75) {\n            peaks.splice(i, 1);\n            signal.mask2[index] = false;\n        } else {\n            norm2 += peaks[i].intensity;\n        }\n        index--;\n    }\n    norm2 = Math.pow(2, n) / norm2;\n    for (i = peaks.length - 1; i >= 0; i--) {\n        peaks[i].intensity *= norm2;\n    }\n    return peaks;\n}\n\n/**\n * Calculates the chemical shift as the weighted sum of the peaks\n * @param {Array} peaks\n * @param {Array} mask\n * @return {number}\n */\nfunction chemicalShift(peaks, mask) {\n    var sum = 0;\n    var cs = 0;\n    var i, area;\n    if (mask) {\n        for (i = 0; i < peaks.length; i++) {\n            if (mask[i] === true) {\n                area = getArea(peaks[i]);\n                sum += area;\n                cs += area * peaks[i].x;\n            }\n        }\n    } else {\n        for (i = 0; i < peaks.length; i++) {\n            area = getArea(peaks[i]);\n            sum += area;\n            cs += area * peaks[i].x;\n        }\n    }\n    return cs / sum;\n}\n\n/**\n * Return the area of a Lorentzian function\n * @param {object} peak - object with peak information\n * @return {number}\n * @private\n */\nfunction getArea(peak) {\n    return Math.abs(peak.intensity * peak.width * 1.57);//1.772453851);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/spectra-data/src/peakPicking/jAnalyzer.js","import impurities from './impurities';\nconst toCheck = ['solvent_residual_peak', 'H2O', 'TMS'];\n\nfunction checkImpurity(peakList, impurity, options) {\n    var j, tolerance, diference;\n    var i = impurity.length;\n    while (i--) {\n        j = peakList.length;\n        while (j--) {\n            if (!peakList[j].asymmetric) {\n                tolerance = options.error + peakList[j].width;\n                diference = Math.abs(impurity[i].shift - peakList[j].x);\n                if (diference < tolerance) { // && (impurity[i].multiplicity === '' || (impurity[i].multiplicity.indexOf(peakList[j].multiplicity)) { // some impurities has multiplicities like 'bs' but at presents it is unsupported\n                    peakList.splice(j, 1);\n                }\n            }\n        }\n    }\n}\n\nexport default function removeImpurities(peakList, options = {}) {\n    var {\n        solvent = '',\n        error = 0.025\n    } = options;\n    solvent = solvent.toLowerCase();\n    if (solvent === '(cd3)2so') solvent = 'dmso';\n    if (solvent === 'meod') solvent = 'cd3od';\n    var solventImpurities = impurities[solvent];\n    if (solventImpurities) {\n        for (let impurity of toCheck) {\n            let impurityShifts = solventImpurities[impurity.toLowerCase()];\n            checkImpurity(peakList, impurityShifts, {error: error});\n        }\n    }\n    return peakList;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/spectra-data/src/peakPicking/ImpurityRemover.js","import acs from '../acs/acs';\nimport peak2Vector from './peak2Vector';\nimport * as utils from 'spectra-nmr-utilities';\nimport {array as arrayUtils} from 'ml-stat';\nimport round from 'lodash.round';\n\nexport default class Ranges extends Array {\n\n    constructor(ranges) {\n        if (Array.isArray(ranges)) {\n            super(ranges.length);\n            for (let i = 0; i < ranges.length; i++) {\n                this[i] = ranges[i];\n            }\n        } else if (typeof ranges === 'number') {\n            super(ranges);\n        } else {\n            super();\n        }\n    }\n\n    /**\n     * This function return a Range instance from predictions\n     * @param {object} signals - predictions of a spin system\n     * @param {object} options - options object\n     * @param {number} [options.lineWidth] - spectral line width\n     * @param {number} [options.frequency] - frequency to determine the [from, to] of a range\n     * @return {Ranges}\n     */\n    static fromSignals(signals, options) {\n        options = Object.assign({}, {lineWidth: 1, frequency: 400, nucleus: '1H'}, options);\n        //1. Collapse all the equivalent predictions\n\n        signals = utils.group(signals, options);\n        const nSignals = signals.length;\n        var i, j, signal, width, center, jc;\n\n        const result = new Array(nSignals);\n\n        for (i = 0; i < nSignals; i++) {\n            signal = signals[i];\n            width = 0;\n            jc = signal.j;\n            if (jc) {\n                for (j = 0; j < jc.length; j++) {\n                    width += jc[j].coupling;\n                }\n            }\n\n            width += 2 * options.lineWidth;\n\n            width /= options.frequency;\n\n            result[i] = {\n                from: signal.delta - width,\n                to: signal.delta + width,\n                integral: signal.nbAtoms,\n                signal: [signal]\n            };\n        }\n\n        //2. Merge the overlaping ranges\n        for (i = 0; i < result.length; i++) {\n            center = (result[i].from + result[i].to) / 2;\n            width = Math.abs(result[i].from - result[i].to);\n            for (j = result.length - 1; j > i; j--) {\n                //Does it overlap?\n                if (Math.abs(center - (result[j].from + result[j].to) / 2)\n                    <= Math.abs(width + Math.abs(result[j].from - result[j].to)) / 2) {\n                    result[i].from = Math.min(result[i].from, result[j].from);\n                    result[i].to = Math.max(result[i].to, result[j].to);\n                    result[i].integral += result[j].integral;\n                    result[j].signal.forEach(a => {\n                        result[i].signal.push(a);\n                    });\n                    result.splice(j, 1);\n                    j = result.length - 1;\n                    center = (result[i].from + result[i].to) / 2;\n                    width = Math.abs(result[i].from - result[i].to);\n                }\n            }\n        }\n        result.sort((a, b) => {\n            return a.from - b.from;\n        });\n        return new Ranges(result);\n    }\n\n    /**\n     * This function return Ranges instance from a SD instance\n     * @param {SD} spectrum - SD instance\n     * @param {object} options - options object to extractPeaks function\n     * @return {Ranges}\n     */\n    static fromSpectrum(spectrum, options = {}) {\n        return spectrum.getRanges(options);\n    }\n\n\n    /**\n     * TODO it is the same code that updateIntegrals in Range class\n     * This function normalize or scale the integral data\n     * @param {object} options - object with the options\n     * @param {boolean} [options.sum] - anything factor to normalize the integrals, Similar to the number of proton in the molecule for a nmr spectrum\n     * @param {number} [options.factor] - Factor that multiply the intensities, if [options.sum] is defined it is override\n     * @return {Ranges}\n     */\n    updateIntegrals(options = {}) {\n        var factor = options.factor || 1;\n        var i;\n        if (options.sum) {\n            var nH = options.sum || 1;\n            var sumObserved = 0;\n            for (i = 0; i < this.length; i++) {\n                sumObserved += this[i].integral;\n            }\n            factor = nH / sumObserved;\n        }\n        for (i = 0; i < this.length; i++) {\n            this[i].integral = round(this[i].integral * factor, 5);\n        }\n        return this;\n    }\n\n    /**\n     * This function return the peak list as a object with x and y arrays\n     * @param {bject} options - See the options parameter in {@link #peak2vector} function documentation\n     * @return {object} - {x: Array, y: Array}\n     */\n    getVector(options) {\n        if (this[0].signal[0].peak) {\n            return peak2Vector(this.getPeakList(), options);\n        } else {\n            throw Error('This method is only for signals with peaks');\n        }\n    }\n\n    /**\n     * This function return the peaks of a Ranges instance into an array\n     * @return {Array}\n     */\n    getPeakList() {\n        if (this[0].signal[0].peak) {\n            var peaks = [];\n            for (var i = 0; i < this.length; i++) {\n                var range = this[i];\n                for (var j = 0; j < range.signal.length; j++) {\n                    peaks = peaks.concat(range.signal[j].peak);\n                }\n            }\n            return peaks;\n        } else {\n            throw Error('This method is only for signals with peaks');\n        }\n    }\n\n    /**\n     * This function return format for each range\n     * @param {object} options - options object for toAcs function\n     * @return {*}\n     */\n    getACS(options) {\n        return acs(this, options);\n    }\n\n    toIndex(options = {}) {\n        var index = [];\n        if (options.joinCouplings) {\n            this.joinCouplings(options);\n        }\n        for (let range of this) {\n            if (Array.isArray(range.signal) && range.signal.length > 0) {\n                let l = range.signal.length;\n                var delta = new Array(l);\n                for (let i = 0; i < l; i++) {\n                    delta[i] = range.signal[i].delta;\n                }\n                index.push({\n                    multiplicity: (l > 1) ? 'm' : (range.signal[0].multiplicity ||\n                    utils.joinCoupling(range.signal[0], options.tolerance)),\n                    delta: arrayUtils.arithmeticMean(delta) || (range.to + range.from) * 0.5,\n                    integral: range.integral\n                });\n            } else {\n                index.push({\n                    delta: (range.to + range.from) * 0.5,\n                    multiplicity: 'm'\n                });\n            }\n        }\n        return index;\n    }\n\n\n    /**\n     * Joins coupling constants\n     * @param {object} [options]\n     * @param {number} [options.tolerance=0.05]\n     */\n    joinCouplings(options = {}) {\n        this.forEach(range => {\n            range.signal.forEach(signal => {\n                signal.multiplicity = utils.joinCoupling(signal, options.tolerance);\n            });\n        });\n    }\n\n    updateMultiplicity(options = {}) {\n        this.forEach(range => {\n            if (range.signal) {\n                let signal = range.signal;\n                if (signal.length === 1) {\n                    signal[0].multiplicity = utils.joinCoupling(signal[0], options.tolerance);\n                } else {\n                    signal.forEach(signal => signal.multiplicity = 'm');\n                }\n            }\n        });\n    }\n\n    clone() {\n        let newRanges = JSON.parse(JSON.stringify(this));\n        return new Ranges(newRanges);\n    }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/spectra-data-ranges/src/range/Ranges.js","/**\n * This function converts an array of peaks [{x, y, width}] in a vector equally x,y vector from a given window\n * TODO: This function is very general and should be placed somewhere else\n * @param {Array} peaks - List of the peaks\n * @param {object} options - it has some options to\n * @param {number} [options.from] - one limit of given window\n * @param {number} [options.to] - one limit of given window\n * @param {string} [options.fnName] - function name to generate the signals form\n * @param {number} [options.nWidth] - width factor of signal form\n * @param {number} [options.nbPoints] - number of points that the vector will have\n * @return {{x: Array, y: Array}}\n */\n\nexport default function peak2Vector(peaks, options = {}) {\n    var {\n        from = null,\n        to = null,\n        nbPoints = 1024,\n        functionName = '',\n        nWidth = 4\n    } = options;\n\n    var factor;\n    if (from === null) {\n        from = Number.MAX_VALUE;\n        for (let i = 0; i < peaks.length; i++) {\n            factor = peaks[i].x - peaks[i].width * nWidth;\n            if (factor < from) {\n                from = factor;\n            }\n        }\n    }\n    if (to === null) {\n        to = Number.MIN_VALUE;\n        for (let i = 0; i < peaks.length; i++) {\n            factor = peaks[i].x + peaks[i].width * nWidth;\n            if (factor > to) {\n                to = factor;\n            }\n        }\n    }\n\n    var x = new Array(nbPoints);\n    var y = new Array(nbPoints);\n    var dx = (to - from) / (nbPoints - 1);\n    for (let i = 0; i < nbPoints; i++) {\n        x[i] = from + i * dx;\n        y[i] = 0;\n    }\n\n    var intensity = peaks[0].y ? 'y' : 'intensity';\n\n    var functionToUse;\n    switch (functionName.toLowerCase()) {\n        case 'lorentzian':\n            functionToUse = lorentzian;\n            break;\n        default:\n            functionToUse = gaussian;\n    }\n\n    for (let i = 0; i < peaks.length; i++) {\n        var peak = peaks[i];\n        if (peak.x > from && peak.x < to) {\n            var index = Math.round((peak.x - from) / dx);\n            var w = Math.round(peak.width * nWidth / dx);\n            for (var j = index - w; j < index + w; j++) {\n                if (j >= 0 && j < nbPoints) {\n                    y[j] += functionToUse(peak[intensity], x[j], peak.width, peak.x);\n                }\n            }\n        }\n    }\n\n    function lorentzian(intensity, x, width, mean) {\n        var factor = intensity * Math.pow(width, 2) / 4;\n        return factor / (Math.pow(mean - x, 2) + Math.pow(width / 2, 2));\n    }\n\n    function gaussian(intensity, x, width, mean) {\n        return intensity * Math.exp(-0.5 * Math.pow((mean - x) / (width / 2), 2));\n    }\n\n    return {x: x, y: y};\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/spectra-data-ranges/src/range/peak2Vector.js","import Matrix from 'ml-matrix';\nimport newArray from 'new-array';\nimport simpleClustering from 'ml-simple-clustering';\nimport hlClust from 'ml-hclust';\n\nexport default class SpinSystem {\n    constructor(chemicalShifts, couplingConstants, multiplicity) {\n        this.chemicalShifts = chemicalShifts;\n        this.couplingConstants = couplingConstants;\n        this.multiplicity = multiplicity;\n        this.nSpins = chemicalShifts.length;\n        this._initConnectivity();\n        this._initClusters();\n    }\n\n    static fromSpinusPrediction(result) {\n        var lines = result.split('\\n');\n        var nspins = lines.length - 1;\n        var cs = new Array(nspins);\n        var integrals = new Array(nspins);\n        var ids = {};\n        var jc = Matrix.zeros(nspins, nspins);\n        for (let i = 0; i < nspins; i++) {\n            var tokens = lines[i].split('\\t');\n            cs[i] = +tokens[2];\n            ids[tokens[0] - 1] = i;\n            integrals[i] = +tokens[5];//Is it always 1??\n        }\n        for (let i = 0; i < nspins; i++) {\n            tokens = lines[i].split('\\t');\n            var nCoup = (tokens.length - 4) / 3;\n            for (j = 0; j < nCoup; j++) {\n                var withID = tokens[4 + 3 * j] - 1;\n                var idx = ids[withID];\n                jc[i][idx] = +tokens[6 + 3 * j];\n            }\n        }\n\n        for (var j = 0; j < nspins; j++) {\n            for (var i = j; i < nspins; i++) {\n                jc[j][i] = jc[i][j];\n            }\n        }\n        return new SpinSystem(cs, jc, newArray(nspins, 2));\n    }\n\n    static fromPrediction(input) {\n        let predictions = SpinSystem.ungroupAtoms(input);\n        const nSpins = predictions.length;\n        const cs = new Array(nSpins);\n        const jc = Matrix.zeros(nSpins, nSpins);\n        const multiplicity = new Array(nSpins);\n        const ids = {};\n        var i, k, j;\n        for (i = 0; i < nSpins; i++) {\n            cs[i] = predictions[i].delta;\n            ids[predictions[i].atomIDs[0]] = i;\n        }\n        for (i = 0; i < nSpins; i++) {\n            cs[i] = predictions[i].delta;\n            j = predictions[i].j;\n            for (k = 0; k < j.length; k++) {\n                jc[ids[predictions[i].atomIDs[0]]][ids[j[k].assignment]] = j[k].coupling;\n                jc[ids[j[k].assignment]][ids[predictions[i].atomIDs[0]]] = j[k].coupling;\n            }\n            multiplicity[i] = predictions[i].integral + 1;\n        }\n\n        return new SpinSystem(cs, jc, multiplicity);\n    }\n\n\n    static ungroupAtoms(prediction) {\n        let result = [];\n        prediction.forEach(pred => {\n            let atomIDs = pred.atomIDs;\n            for (let i = 0; i < atomIDs.length; i++) {\n                let tempPred = JSON.parse(JSON.stringify(pred));\n                let nmrJ = [];\n                tempPred.atomIDs = [atomIDs[i]];\n                tempPred.integral = 1;\n                for (let j = 0; j < tempPred.j.length; j++) {\n                    let assignment = tempPred.j[j].assignment;\n                    for (let k = 0; k < assignment.length; k++) {\n                        let tempJ = JSON.parse(JSON.stringify(tempPred.j[j]));\n                        tempJ.assignment = assignment[k];\n                        nmrJ.push(tempJ);\n                    }\n                }\n                tempPred.j = nmrJ;\n                delete tempPred.nbAtoms;\n                result.push(tempPred);\n            }\n        });\n\n        return result;\n    }\n\n\n    _initClusters() {\n        this.clusters = simpleClustering(this.connectivity, {out: 'indexes'});\n    }\n\n    _initConnectivity() {\n        const couplings = this.couplingConstants;\n        const connectivity = Matrix.ones(couplings.length, couplings.length);\n        for (var i = 0; i < couplings.length; i++) {\n            for (var j = i; j < couplings[i].length; j++) {\n                if (couplings[i][j] === 0) {\n                    connectivity[i][j] = 0;\n                    connectivity[j][i] = 0;\n                }\n            }\n        }\n        this.connectivity = connectivity;\n    }\n\n\n    _calculateBetas(J, frequency) {\n        var betas = Matrix.zeros(J.length, J.length);\n        //Before clustering, we must add hidden J, we could use molecular information if available\n        var i, j;\n        for (i = 0; i < J.rows; i++) {\n            for (j = i; j < J.columns; j++) {\n                if ((this.chemicalShifts[i] - this.chemicalShifts[j]) !== 0) {\n                    betas[i][j] = 1 - Math.abs(J[i][j] / ((this.chemicalShifts[i] - this.chemicalShifts[j]) * frequency));\n                    betas[j][i] = betas[i][j];\n                } else if (!(i === j || J[i][j] !== 0)) {\n                    betas[i][j] = 1;\n                    betas[j][i] = 1;\n                }\n            }\n        }\n        return betas;\n    }\n\n    ensureClusterSize(options) {\n        var betas = this._calculateBetas(this.couplingConstants, options.frequency || 400);\n        var cluster = hlClust.agnes(betas, {isDistanceMatrix: true});\n        var list = [];\n        this._splitCluster(cluster, list, options.maxClusterSize || 8, false);\n        var clusters = this._mergeClusters(list);\n        this.nClusters = clusters.length;\n        //console.log(clusters);\n        this.clusters = new Array(clusters.length);\n        //System.out.println(this.conmatrix);\n        for (var j = 0; j < this.nClusters; j++) {\n            this.clusters[j] = [];\n            for (var i = 0; i < this.nSpins; i++) {\n                if (clusters[j][i] !== 0) {\n                    if (clusters[j][i] < 0) {\n                        this.clusters[j].push(-(i + 1));\n                    } else {\n                        this.clusters[j].push(i);\n                    }\n                }\n            }\n        }\n    }\n\n    /**\n     * Recursively split the clusters until the maxClusterSize criteria has been ensured.\n     * @param {Array} cluster\n     * @param {Array} clusterList\n     * @param {number} maxClusterSize\n     * @param  {boolean} force\n     */\n    _splitCluster(cluster, clusterList, maxClusterSize, force) {\n        if (!force && cluster.index.length <= maxClusterSize) {\n            clusterList.push(this._getMembers(cluster));\n        } else {\n            for (var child of cluster.children) {\n                if (!isNaN(child.index) || child.index.length <= maxClusterSize) {\n                    var members = this._getMembers(child);\n                    //Add the neighbors that shares at least 1 coupling with the given cluster\n                    var count = 0;\n                    for (var i = 0; i < this.nSpins; i++) {\n                        if (members[i] === 1) {\n                            count++;\n                            for (var j = 0; j < this.nSpins; j++) {\n                                if (this.connectivity[i][j] === 1 && members[j] === 0) {\n                                    members[j] = -1;\n                                    count++;\n                                }\n                            }\n                        }\n                    }\n\n                    if (count <= maxClusterSize) {\n                        clusterList.push(members);\n                    } else {\n                        if (isNaN(child.index)) {\n                            this._splitCluster(child, clusterList, maxClusterSize, true);\n                        } else {\n                            //We have to threat this spin alone and use the resurrection algorithm instead of the simulation\n                            members[child.index] = 2;\n                            clusterList.push(members);\n                        }\n                    }\n                } else {\n                    this._splitCluster(child, clusterList, maxClusterSize, false);\n                }\n            }\n        }\n    }\n    /**\n     * Recursively gets the cluster members\n     * @param cluster\n     * @param members\n     */\n\n    _getMembers(cluster) {\n        var members = new Array(this.nSpins);\n        for (var i = 0; i < this.nSpins; i++) {\n            members[i] = 0;\n        }\n        if (!isNaN(cluster.index)) {\n            members[cluster.index * 1] = 1;\n        } else {\n            for (var index of cluster.index) {\n                members[index.index * 1] = 1;\n            }\n        }\n        return members;\n    }\n\n    _mergeClusters(list) {\n        var nElements = 0;\n        var clusterA, clusterB, i, j, index, common, count;\n        for (i = list.length - 1; i >= 0; i--) {\n            clusterA = list[i];\n            nElements = clusterA.length;\n            index = 0;\n\n            //Is it a candidate to be merged?\n            while (index < nElements && clusterA[index++] !== -1);\n\n            if (index < nElements) {\n                for (j = list.length - 1; j >= i + 1; j--) {\n                    clusterB = list[j];\n                    //Do they have common elements?\n                    index = 0;\n                    common = 0;\n                    count = 0;\n                    while (index < nElements) {\n                        if (clusterA[index] * clusterB[index] === -1) {\n                            common++;\n                        }\n                        if (clusterA[index] !== 0 || clusterB[index] !== 0) {\n                            count++;\n                        }\n                        index++;\n                    }\n\n                    if (common > 0 && count <= this.maxClusterSize) {\n                        //Then we can merge those 2 clusters\n                        index = 0;\n                        while (index < nElements) {\n                            if (clusterB[index] === 1) {\n                                clusterA[index] = 1;\n                            } else {\n                                if (clusterB[index] === -1 && clusterA[index] !== 1) {\n                                    clusterA[index] = -1;\n                                }\n                            }\n                            index++;\n                        }\n                        //list.remove(clusterB);\n                        list.splice(j, 1);\n                        j++;\n                    }\n                }\n            }\n        }\n\n        return list;\n    }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/nmr-simulation/src/SpinSystem.js","'use strict';\n\nif (!Symbol.species) {\n    Symbol.species = Symbol.for('@@species');\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-matrix/src/symbol-species.js","'use strict';\n\nvar BaseView = require('./base');\n\nclass MatrixTransposeView extends BaseView {\n    constructor(matrix) {\n        super(matrix, matrix.columns, matrix.rows);\n    }\n\n    set(rowIndex, columnIndex, value) {\n        this.matrix.set(columnIndex, rowIndex, value);\n        return this;\n    }\n\n    get(rowIndex, columnIndex) {\n        return this.matrix.get(columnIndex, rowIndex);\n    }\n}\n\nmodule.exports = MatrixTransposeView;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-matrix/src/views/transpose.js","'use strict';\n\nvar BaseView = require('./base');\n\nclass MatrixRowView extends BaseView {\n    constructor(matrix, row) {\n        super(matrix, 1, matrix.columns);\n        this.row = row;\n    }\n\n    set(rowIndex, columnIndex, value) {\n        this.matrix.set(this.row, columnIndex, value);\n        return this;\n    }\n\n    get(rowIndex, columnIndex) {\n        return this.matrix.get(this.row, columnIndex);\n    }\n}\n\nmodule.exports = MatrixRowView;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-matrix/src/views/row.js","'use strict';\n\nvar BaseView = require('./base');\nvar util = require('../util');\n\nclass MatrixSubView extends BaseView {\n    constructor(matrix, startRow, endRow, startColumn, endColumn) {\n        util.checkRange(matrix, startRow, endRow, startColumn, endColumn);\n        super(matrix, endRow - startRow + 1, endColumn - startColumn + 1);\n        this.startRow = startRow;\n        this.startColumn = startColumn;\n    }\n\n    set(rowIndex, columnIndex, value) {\n        this.matrix.set(this.startRow + rowIndex, this.startColumn + columnIndex, value);\n        return this;\n    }\n\n    get(rowIndex, columnIndex) {\n        return this.matrix.get(this.startRow + rowIndex, this.startColumn + columnIndex);\n    }\n}\n\nmodule.exports = MatrixSubView;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-matrix/src/views/sub.js","'use strict';\n\nvar BaseView = require('./base');\nvar util = require('../util');\n\nclass MatrixSelectionView extends BaseView {\n    constructor(matrix, rowIndices, columnIndices) {\n        var indices = util.checkIndices(matrix, rowIndices, columnIndices);\n        super(matrix, indices.row.length, indices.column.length);\n        this.rowIndices = indices.row;\n        this.columnIndices = indices.column;\n    }\n\n    set(rowIndex, columnIndex, value) {\n        this.matrix.set(this.rowIndices[rowIndex], this.columnIndices[columnIndex], value);\n        return this;\n    }\n\n    get(rowIndex, columnIndex) {\n        return this.matrix.get(this.rowIndices[rowIndex], this.columnIndices[columnIndex]);\n    }\n}\n\nmodule.exports = MatrixSelectionView;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-matrix/src/views/selection.js","'use strict';\n\nvar BaseView = require('./base');\n\nclass MatrixColumnView extends BaseView {\n    constructor(matrix, column) {\n        super(matrix, matrix.rows, 1);\n        this.column = column;\n    }\n\n    set(rowIndex, columnIndex, value) {\n        this.matrix.set(rowIndex, this.column, value);\n        return this;\n    }\n\n    get(rowIndex) {\n        return this.matrix.get(rowIndex, this.column);\n    }\n}\n\nmodule.exports = MatrixColumnView;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-matrix/src/views/column.js","'use strict';\n\nvar BaseView = require('./base');\n\nclass MatrixFlipRowView extends BaseView {\n    constructor(matrix) {\n        super(matrix, matrix.rows, matrix.columns);\n    }\n\n    set(rowIndex, columnIndex, value) {\n        this.matrix.set(this.rows - rowIndex - 1, columnIndex, value);\n        return this;\n    }\n\n    get(rowIndex, columnIndex) {\n        return this.matrix.get(this.rows - rowIndex - 1, columnIndex);\n    }\n}\n\nmodule.exports = MatrixFlipRowView;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-matrix/src/views/flipRow.js","'use strict';\n\nvar BaseView = require('./base');\n\nclass MatrixFlipColumnView extends BaseView {\n    constructor(matrix) {\n        super(matrix, matrix.rows, matrix.columns);\n    }\n\n    set(rowIndex, columnIndex, value) {\n        this.matrix.set(rowIndex, this.columns - columnIndex - 1, value);\n        return this;\n    }\n\n    get(rowIndex, columnIndex) {\n        return this.matrix.get(rowIndex, this.columns - columnIndex - 1);\n    }\n}\n\nmodule.exports = MatrixFlipColumnView;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-matrix/src/views/flipColumn.js","'use strict';\n\nvar Matrix = require('./matrix').Matrix;\n\nvar SingularValueDecomposition = require('./dc/svd');\nvar EigenvalueDecomposition = require('./dc/evd');\nvar LuDecomposition = require('./dc/lu');\nvar QrDecomposition = require('./dc/qr');\nvar CholeskyDecomposition = require('./dc/cholesky');\n\nfunction inverse(matrix) {\n    matrix = Matrix.checkMatrix(matrix);\n    return solve(matrix, Matrix.eye(matrix.rows));\n}\n\n/**\n * Returns the inverse\n * @memberOf Matrix\n * @static\n * @param {Matrix} matrix\n * @return {Matrix} matrix\n * @alias inv\n */\nMatrix.inverse = Matrix.inv = inverse;\n\n/**\n * Returns the inverse\n * @memberOf Matrix\n * @static\n * @param {Matrix} matrix\n * @return {Matrix} matrix\n * @alias inv\n */\nMatrix.prototype.inverse = Matrix.prototype.inv = function () {\n    return inverse(this);\n};\n\nfunction solve(leftHandSide, rightHandSide) {\n    leftHandSide = Matrix.checkMatrix(leftHandSide);\n    rightHandSide = Matrix.checkMatrix(rightHandSide);\n    return leftHandSide.isSquare() ? new LuDecomposition(leftHandSide).solve(rightHandSide) : new QrDecomposition(leftHandSide).solve(rightHandSide);\n}\n\nMatrix.solve = solve;\nMatrix.prototype.solve = function (other) {\n    return solve(this, other);\n};\n\nmodule.exports = {\n    SingularValueDecomposition: SingularValueDecomposition,\n    SVD: SingularValueDecomposition,\n    EigenvalueDecomposition: EigenvalueDecomposition,\n    EVD: EigenvalueDecomposition,\n    LuDecomposition: LuDecomposition,\n    LU: LuDecomposition,\n    QrDecomposition: QrDecomposition,\n    QR: QrDecomposition,\n    CholeskyDecomposition: CholeskyDecomposition,\n    CHO: CholeskyDecomposition,\n    inverse: inverse,\n    solve: solve\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-matrix/src/decompositions.js","'use strict';\n\nconst Matrix = require('../matrix').Matrix;\nconst util = require('./util');\nconst hypotenuse = util.hypotenuse;\nconst getFilled2DArray = util.getFilled2DArray;\n\nconst defaultOptions = {\n    assumeSymmetric: false\n};\n\n// https://github.com/lutzroeder/Mapack/blob/master/Source/EigenvalueDecomposition.cs\nfunction EigenvalueDecomposition(matrix, options) {\n    options = Object.assign({}, defaultOptions, options);\n    if (!(this instanceof EigenvalueDecomposition)) {\n        return new EigenvalueDecomposition(matrix, options);\n    }\n    matrix = Matrix.checkMatrix(matrix);\n    if (!matrix.isSquare()) {\n        throw new Error('Matrix is not a square matrix');\n    }\n\n    var n = matrix.columns,\n        V = getFilled2DArray(n, n, 0),\n        d = new Array(n),\n        e = new Array(n),\n        value = matrix,\n        i, j;\n\n    var isSymmetric = false;\n    if (options.assumeSymmetric) {\n        isSymmetric = true;\n    } else {\n        isSymmetric = matrix.isSymmetric();\n    }\n\n    if (isSymmetric) {\n        for (i = 0; i < n; i++) {\n            for (j = 0; j < n; j++) {\n                V[i][j] = value.get(i, j);\n            }\n        }\n        tred2(n, e, d, V);\n        tql2(n, e, d, V);\n    } else {\n        var H = getFilled2DArray(n, n, 0),\n            ort = new Array(n);\n        for (j = 0; j < n; j++) {\n            for (i = 0; i < n; i++) {\n                H[i][j] = value.get(i, j);\n            }\n        }\n        orthes(n, H, ort, V);\n        hqr2(n, e, d, V, H);\n    }\n\n    this.n = n;\n    this.e = e;\n    this.d = d;\n    this.V = V;\n}\n\nEigenvalueDecomposition.prototype = {\n    get realEigenvalues() {\n        return this.d;\n    },\n    get imaginaryEigenvalues() {\n        return this.e;\n    },\n    get eigenvectorMatrix() {\n        if (!Matrix.isMatrix(this.V)) {\n            this.V = new Matrix(this.V);\n        }\n        return this.V;\n    },\n    get diagonalMatrix() {\n        var n = this.n,\n            e = this.e,\n            d = this.d,\n            X = new Matrix(n, n),\n            i, j;\n        for (i = 0; i < n; i++) {\n            for (j = 0; j < n; j++) {\n                X[i][j] = 0;\n            }\n            X[i][i] = d[i];\n            if (e[i] > 0) {\n                X[i][i + 1] = e[i];\n            } else if (e[i] < 0) {\n                X[i][i - 1] = e[i];\n            }\n        }\n        return X;\n    }\n};\n\nfunction tred2(n, e, d, V) {\n\n    var f, g, h, i, j, k,\n        hh, scale;\n\n    for (j = 0; j < n; j++) {\n        d[j] = V[n - 1][j];\n    }\n\n    for (i = n - 1; i > 0; i--) {\n        scale = 0;\n        h = 0;\n        for (k = 0; k < i; k++) {\n            scale = scale + Math.abs(d[k]);\n        }\n\n        if (scale === 0) {\n            e[i] = d[i - 1];\n            for (j = 0; j < i; j++) {\n                d[j] = V[i - 1][j];\n                V[i][j] = 0;\n                V[j][i] = 0;\n            }\n        } else {\n            for (k = 0; k < i; k++) {\n                d[k] /= scale;\n                h += d[k] * d[k];\n            }\n\n            f = d[i - 1];\n            g = Math.sqrt(h);\n            if (f > 0) {\n                g = -g;\n            }\n\n            e[i] = scale * g;\n            h = h - f * g;\n            d[i - 1] = f - g;\n            for (j = 0; j < i; j++) {\n                e[j] = 0;\n            }\n\n            for (j = 0; j < i; j++) {\n                f = d[j];\n                V[j][i] = f;\n                g = e[j] + V[j][j] * f;\n                for (k = j + 1; k <= i - 1; k++) {\n                    g += V[k][j] * d[k];\n                    e[k] += V[k][j] * f;\n                }\n                e[j] = g;\n            }\n\n            f = 0;\n            for (j = 0; j < i; j++) {\n                e[j] /= h;\n                f += e[j] * d[j];\n            }\n\n            hh = f / (h + h);\n            for (j = 0; j < i; j++) {\n                e[j] -= hh * d[j];\n            }\n\n            for (j = 0; j < i; j++) {\n                f = d[j];\n                g = e[j];\n                for (k = j; k <= i - 1; k++) {\n                    V[k][j] -= (f * e[k] + g * d[k]);\n                }\n                d[j] = V[i - 1][j];\n                V[i][j] = 0;\n            }\n        }\n        d[i] = h;\n    }\n\n    for (i = 0; i < n - 1; i++) {\n        V[n - 1][i] = V[i][i];\n        V[i][i] = 1;\n        h = d[i + 1];\n        if (h !== 0) {\n            for (k = 0; k <= i; k++) {\n                d[k] = V[k][i + 1] / h;\n            }\n\n            for (j = 0; j <= i; j++) {\n                g = 0;\n                for (k = 0; k <= i; k++) {\n                    g += V[k][i + 1] * V[k][j];\n                }\n                for (k = 0; k <= i; k++) {\n                    V[k][j] -= g * d[k];\n                }\n            }\n        }\n\n        for (k = 0; k <= i; k++) {\n            V[k][i + 1] = 0;\n        }\n    }\n\n    for (j = 0; j < n; j++) {\n        d[j] = V[n - 1][j];\n        V[n - 1][j] = 0;\n    }\n\n    V[n - 1][n - 1] = 1;\n    e[0] = 0;\n}\n\nfunction tql2(n, e, d, V) {\n\n    var g, h, i, j, k, l, m, p, r,\n        dl1, c, c2, c3, el1, s, s2,\n        iter;\n\n    for (i = 1; i < n; i++) {\n        e[i - 1] = e[i];\n    }\n\n    e[n - 1] = 0;\n\n    var f = 0,\n        tst1 = 0,\n        eps = Math.pow(2, -52);\n\n    for (l = 0; l < n; l++) {\n        tst1 = Math.max(tst1, Math.abs(d[l]) + Math.abs(e[l]));\n        m = l;\n        while (m < n) {\n            if (Math.abs(e[m]) <= eps * tst1) {\n                break;\n            }\n            m++;\n        }\n\n        if (m > l) {\n            iter = 0;\n            do {\n                iter = iter + 1;\n\n                g = d[l];\n                p = (d[l + 1] - g) / (2 * e[l]);\n                r = hypotenuse(p, 1);\n                if (p < 0) {\n                    r = -r;\n                }\n\n                d[l] = e[l] / (p + r);\n                d[l + 1] = e[l] * (p + r);\n                dl1 = d[l + 1];\n                h = g - d[l];\n                for (i = l + 2; i < n; i++) {\n                    d[i] -= h;\n                }\n\n                f = f + h;\n\n                p = d[m];\n                c = 1;\n                c2 = c;\n                c3 = c;\n                el1 = e[l + 1];\n                s = 0;\n                s2 = 0;\n                for (i = m - 1; i >= l; i--) {\n                    c3 = c2;\n                    c2 = c;\n                    s2 = s;\n                    g = c * e[i];\n                    h = c * p;\n                    r = hypotenuse(p, e[i]);\n                    e[i + 1] = s * r;\n                    s = e[i] / r;\n                    c = p / r;\n                    p = c * d[i] - s * g;\n                    d[i + 1] = h + s * (c * g + s * d[i]);\n\n                    for (k = 0; k < n; k++) {\n                        h = V[k][i + 1];\n                        V[k][i + 1] = s * V[k][i] + c * h;\n                        V[k][i] = c * V[k][i] - s * h;\n                    }\n                }\n\n                p = -s * s2 * c3 * el1 * e[l] / dl1;\n                e[l] = s * p;\n                d[l] = c * p;\n\n            }\n            while (Math.abs(e[l]) > eps * tst1);\n        }\n        d[l] = d[l] + f;\n        e[l] = 0;\n    }\n\n    for (i = 0; i < n - 1; i++) {\n        k = i;\n        p = d[i];\n        for (j = i + 1; j < n; j++) {\n            if (d[j] < p) {\n                k = j;\n                p = d[j];\n            }\n        }\n\n        if (k !== i) {\n            d[k] = d[i];\n            d[i] = p;\n            for (j = 0; j < n; j++) {\n                p = V[j][i];\n                V[j][i] = V[j][k];\n                V[j][k] = p;\n            }\n        }\n    }\n}\n\nfunction orthes(n, H, ort, V) {\n\n    var low = 0,\n        high = n - 1,\n        f, g, h, i, j, m,\n        scale;\n\n    for (m = low + 1; m <= high - 1; m++) {\n        scale = 0;\n        for (i = m; i <= high; i++) {\n            scale = scale + Math.abs(H[i][m - 1]);\n        }\n\n        if (scale !== 0) {\n            h = 0;\n            for (i = high; i >= m; i--) {\n                ort[i] = H[i][m - 1] / scale;\n                h += ort[i] * ort[i];\n            }\n\n            g = Math.sqrt(h);\n            if (ort[m] > 0) {\n                g = -g;\n            }\n\n            h = h - ort[m] * g;\n            ort[m] = ort[m] - g;\n\n            for (j = m; j < n; j++) {\n                f = 0;\n                for (i = high; i >= m; i--) {\n                    f += ort[i] * H[i][j];\n                }\n\n                f = f / h;\n                for (i = m; i <= high; i++) {\n                    H[i][j] -= f * ort[i];\n                }\n            }\n\n            for (i = 0; i <= high; i++) {\n                f = 0;\n                for (j = high; j >= m; j--) {\n                    f += ort[j] * H[i][j];\n                }\n\n                f = f / h;\n                for (j = m; j <= high; j++) {\n                    H[i][j] -= f * ort[j];\n                }\n            }\n\n            ort[m] = scale * ort[m];\n            H[m][m - 1] = scale * g;\n        }\n    }\n\n    for (i = 0; i < n; i++) {\n        for (j = 0; j < n; j++) {\n            V[i][j] = (i === j ? 1 : 0);\n        }\n    }\n\n    for (m = high - 1; m >= low + 1; m--) {\n        if (H[m][m - 1] !== 0) {\n            for (i = m + 1; i <= high; i++) {\n                ort[i] = H[i][m - 1];\n            }\n\n            for (j = m; j <= high; j++) {\n                g = 0;\n                for (i = m; i <= high; i++) {\n                    g += ort[i] * V[i][j];\n                }\n\n                g = (g / ort[m]) / H[m][m - 1];\n                for (i = m; i <= high; i++) {\n                    V[i][j] += g * ort[i];\n                }\n            }\n        }\n    }\n}\n\nfunction hqr2(nn, e, d, V, H) {\n    var n = nn - 1,\n        low = 0,\n        high = nn - 1,\n        eps = Math.pow(2, -52),\n        exshift = 0,\n        norm = 0,\n        p = 0,\n        q = 0,\n        r = 0,\n        s = 0,\n        z = 0,\n        iter = 0,\n        i, j, k, l, m, t, w, x, y,\n        ra, sa, vr, vi,\n        notlast, cdivres;\n\n    for (i = 0; i < nn; i++) {\n        if (i < low || i > high) {\n            d[i] = H[i][i];\n            e[i] = 0;\n        }\n\n        for (j = Math.max(i - 1, 0); j < nn; j++) {\n            norm = norm + Math.abs(H[i][j]);\n        }\n    }\n\n    while (n >= low) {\n        l = n;\n        while (l > low) {\n            s = Math.abs(H[l - 1][l - 1]) + Math.abs(H[l][l]);\n            if (s === 0) {\n                s = norm;\n            }\n            if (Math.abs(H[l][l - 1]) < eps * s) {\n                break;\n            }\n            l--;\n        }\n\n        if (l === n) {\n            H[n][n] = H[n][n] + exshift;\n            d[n] = H[n][n];\n            e[n] = 0;\n            n--;\n            iter = 0;\n        } else if (l === n - 1) {\n            w = H[n][n - 1] * H[n - 1][n];\n            p = (H[n - 1][n - 1] - H[n][n]) / 2;\n            q = p * p + w;\n            z = Math.sqrt(Math.abs(q));\n            H[n][n] = H[n][n] + exshift;\n            H[n - 1][n - 1] = H[n - 1][n - 1] + exshift;\n            x = H[n][n];\n\n            if (q >= 0) {\n                z = (p >= 0) ? (p + z) : (p - z);\n                d[n - 1] = x + z;\n                d[n] = d[n - 1];\n                if (z !== 0) {\n                    d[n] = x - w / z;\n                }\n                e[n - 1] = 0;\n                e[n] = 0;\n                x = H[n][n - 1];\n                s = Math.abs(x) + Math.abs(z);\n                p = x / s;\n                q = z / s;\n                r = Math.sqrt(p * p + q * q);\n                p = p / r;\n                q = q / r;\n\n                for (j = n - 1; j < nn; j++) {\n                    z = H[n - 1][j];\n                    H[n - 1][j] = q * z + p * H[n][j];\n                    H[n][j] = q * H[n][j] - p * z;\n                }\n\n                for (i = 0; i <= n; i++) {\n                    z = H[i][n - 1];\n                    H[i][n - 1] = q * z + p * H[i][n];\n                    H[i][n] = q * H[i][n] - p * z;\n                }\n\n                for (i = low; i <= high; i++) {\n                    z = V[i][n - 1];\n                    V[i][n - 1] = q * z + p * V[i][n];\n                    V[i][n] = q * V[i][n] - p * z;\n                }\n            } else {\n                d[n - 1] = x + p;\n                d[n] = x + p;\n                e[n - 1] = z;\n                e[n] = -z;\n            }\n\n            n = n - 2;\n            iter = 0;\n        } else {\n            x = H[n][n];\n            y = 0;\n            w = 0;\n            if (l < n) {\n                y = H[n - 1][n - 1];\n                w = H[n][n - 1] * H[n - 1][n];\n            }\n\n            if (iter === 10) {\n                exshift += x;\n                for (i = low; i <= n; i++) {\n                    H[i][i] -= x;\n                }\n                s = Math.abs(H[n][n - 1]) + Math.abs(H[n - 1][n - 2]);\n                x = y = 0.75 * s;\n                w = -0.4375 * s * s;\n            }\n\n            if (iter === 30) {\n                s = (y - x) / 2;\n                s = s * s + w;\n                if (s > 0) {\n                    s = Math.sqrt(s);\n                    if (y < x) {\n                        s = -s;\n                    }\n                    s = x - w / ((y - x) / 2 + s);\n                    for (i = low; i <= n; i++) {\n                        H[i][i] -= s;\n                    }\n                    exshift += s;\n                    x = y = w = 0.964;\n                }\n            }\n\n            iter = iter + 1;\n\n            m = n - 2;\n            while (m >= l) {\n                z = H[m][m];\n                r = x - z;\n                s = y - z;\n                p = (r * s - w) / H[m + 1][m] + H[m][m + 1];\n                q = H[m + 1][m + 1] - z - r - s;\n                r = H[m + 2][m + 1];\n                s = Math.abs(p) + Math.abs(q) + Math.abs(r);\n                p = p / s;\n                q = q / s;\n                r = r / s;\n                if (m === l) {\n                    break;\n                }\n                if (Math.abs(H[m][m - 1]) * (Math.abs(q) + Math.abs(r)) < eps * (Math.abs(p) * (Math.abs(H[m - 1][m - 1]) + Math.abs(z) + Math.abs(H[m + 1][m + 1])))) {\n                    break;\n                }\n                m--;\n            }\n\n            for (i = m + 2; i <= n; i++) {\n                H[i][i - 2] = 0;\n                if (i > m + 2) {\n                    H[i][i - 3] = 0;\n                }\n            }\n\n            for (k = m; k <= n - 1; k++) {\n                notlast = (k !== n - 1);\n                if (k !== m) {\n                    p = H[k][k - 1];\n                    q = H[k + 1][k - 1];\n                    r = (notlast ? H[k + 2][k - 1] : 0);\n                    x = Math.abs(p) + Math.abs(q) + Math.abs(r);\n                    if (x !== 0) {\n                        p = p / x;\n                        q = q / x;\n                        r = r / x;\n                    }\n                }\n\n                if (x === 0) {\n                    break;\n                }\n\n                s = Math.sqrt(p * p + q * q + r * r);\n                if (p < 0) {\n                    s = -s;\n                }\n\n                if (s !== 0) {\n                    if (k !== m) {\n                        H[k][k - 1] = -s * x;\n                    } else if (l !== m) {\n                        H[k][k - 1] = -H[k][k - 1];\n                    }\n\n                    p = p + s;\n                    x = p / s;\n                    y = q / s;\n                    z = r / s;\n                    q = q / p;\n                    r = r / p;\n\n                    for (j = k; j < nn; j++) {\n                        p = H[k][j] + q * H[k + 1][j];\n                        if (notlast) {\n                            p = p + r * H[k + 2][j];\n                            H[k + 2][j] = H[k + 2][j] - p * z;\n                        }\n\n                        H[k][j] = H[k][j] - p * x;\n                        H[k + 1][j] = H[k + 1][j] - p * y;\n                    }\n\n                    for (i = 0; i <= Math.min(n, k + 3); i++) {\n                        p = x * H[i][k] + y * H[i][k + 1];\n                        if (notlast) {\n                            p = p + z * H[i][k + 2];\n                            H[i][k + 2] = H[i][k + 2] - p * r;\n                        }\n\n                        H[i][k] = H[i][k] - p;\n                        H[i][k + 1] = H[i][k + 1] - p * q;\n                    }\n\n                    for (i = low; i <= high; i++) {\n                        p = x * V[i][k] + y * V[i][k + 1];\n                        if (notlast) {\n                            p = p + z * V[i][k + 2];\n                            V[i][k + 2] = V[i][k + 2] - p * r;\n                        }\n\n                        V[i][k] = V[i][k] - p;\n                        V[i][k + 1] = V[i][k + 1] - p * q;\n                    }\n                }\n            }\n        }\n    }\n\n    if (norm === 0) {\n        return;\n    }\n\n    for (n = nn - 1; n >= 0; n--) {\n        p = d[n];\n        q = e[n];\n\n        if (q === 0) {\n            l = n;\n            H[n][n] = 1;\n            for (i = n - 1; i >= 0; i--) {\n                w = H[i][i] - p;\n                r = 0;\n                for (j = l; j <= n; j++) {\n                    r = r + H[i][j] * H[j][n];\n                }\n\n                if (e[i] < 0) {\n                    z = w;\n                    s = r;\n                } else {\n                    l = i;\n                    if (e[i] === 0) {\n                        H[i][n] = (w !== 0) ? (-r / w) : (-r / (eps * norm));\n                    } else {\n                        x = H[i][i + 1];\n                        y = H[i + 1][i];\n                        q = (d[i] - p) * (d[i] - p) + e[i] * e[i];\n                        t = (x * s - z * r) / q;\n                        H[i][n] = t;\n                        H[i + 1][n] = (Math.abs(x) > Math.abs(z)) ? ((-r - w * t) / x) : ((-s - y * t) / z);\n                    }\n\n                    t = Math.abs(H[i][n]);\n                    if ((eps * t) * t > 1) {\n                        for (j = i; j <= n; j++) {\n                            H[j][n] = H[j][n] / t;\n                        }\n                    }\n                }\n            }\n        } else if (q < 0) {\n            l = n - 1;\n\n            if (Math.abs(H[n][n - 1]) > Math.abs(H[n - 1][n])) {\n                H[n - 1][n - 1] = q / H[n][n - 1];\n                H[n - 1][n] = -(H[n][n] - p) / H[n][n - 1];\n            } else {\n                cdivres = cdiv(0, -H[n - 1][n], H[n - 1][n - 1] - p, q);\n                H[n - 1][n - 1] = cdivres[0];\n                H[n - 1][n] = cdivres[1];\n            }\n\n            H[n][n - 1] = 0;\n            H[n][n] = 1;\n            for (i = n - 2; i >= 0; i--) {\n                ra = 0;\n                sa = 0;\n                for (j = l; j <= n; j++) {\n                    ra = ra + H[i][j] * H[j][n - 1];\n                    sa = sa + H[i][j] * H[j][n];\n                }\n\n                w = H[i][i] - p;\n\n                if (e[i] < 0) {\n                    z = w;\n                    r = ra;\n                    s = sa;\n                } else {\n                    l = i;\n                    if (e[i] === 0) {\n                        cdivres = cdiv(-ra, -sa, w, q);\n                        H[i][n - 1] = cdivres[0];\n                        H[i][n] = cdivres[1];\n                    } else {\n                        x = H[i][i + 1];\n                        y = H[i + 1][i];\n                        vr = (d[i] - p) * (d[i] - p) + e[i] * e[i] - q * q;\n                        vi = (d[i] - p) * 2 * q;\n                        if (vr === 0 && vi === 0) {\n                            vr = eps * norm * (Math.abs(w) + Math.abs(q) + Math.abs(x) + Math.abs(y) + Math.abs(z));\n                        }\n                        cdivres = cdiv(x * r - z * ra + q * sa, x * s - z * sa - q * ra, vr, vi);\n                        H[i][n - 1] = cdivres[0];\n                        H[i][n] = cdivres[1];\n                        if (Math.abs(x) > (Math.abs(z) + Math.abs(q))) {\n                            H[i + 1][n - 1] = (-ra - w * H[i][n - 1] + q * H[i][n]) / x;\n                            H[i + 1][n] = (-sa - w * H[i][n] - q * H[i][n - 1]) / x;\n                        } else {\n                            cdivres = cdiv(-r - y * H[i][n - 1], -s - y * H[i][n], z, q);\n                            H[i + 1][n - 1] = cdivres[0];\n                            H[i + 1][n] = cdivres[1];\n                        }\n                    }\n\n                    t = Math.max(Math.abs(H[i][n - 1]), Math.abs(H[i][n]));\n                    if ((eps * t) * t > 1) {\n                        for (j = i; j <= n; j++) {\n                            H[j][n - 1] = H[j][n - 1] / t;\n                            H[j][n] = H[j][n] / t;\n                        }\n                    }\n                }\n            }\n        }\n    }\n\n    for (i = 0; i < nn; i++) {\n        if (i < low || i > high) {\n            for (j = i; j < nn; j++) {\n                V[i][j] = H[i][j];\n            }\n        }\n    }\n\n    for (j = nn - 1; j >= low; j--) {\n        for (i = low; i <= high; i++) {\n            z = 0;\n            for (k = low; k <= Math.min(j, high); k++) {\n                z = z + V[i][k] * H[k][j];\n            }\n            V[i][j] = z;\n        }\n    }\n}\n\nfunction cdiv(xr, xi, yr, yi) {\n    var r, d;\n    if (Math.abs(yr) > Math.abs(yi)) {\n        r = yi / yr;\n        d = yr + r * yi;\n        return [(xr + r * xi) / d, (xi - r * xr) / d];\n    } else {\n        r = yr / yi;\n        d = yi + r * yr;\n        return [(r * xr + xi) / d, (r * xi - xr) / d];\n    }\n}\n\nmodule.exports = EigenvalueDecomposition;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-matrix/src/dc/evd.js","'use strict';\n\nvar Matrix = require('../matrix').Matrix;\nvar hypotenuse = require('./util').hypotenuse;\n\n//https://github.com/lutzroeder/Mapack/blob/master/Source/QrDecomposition.cs\nfunction QrDecomposition(value) {\n    if (!(this instanceof QrDecomposition)) {\n        return new QrDecomposition(value);\n    }\n    value = Matrix.checkMatrix(value);\n\n    var qr = value.clone(),\n        m = value.rows,\n        n = value.columns,\n        rdiag = new Array(n),\n        i, j, k, s;\n\n    for (k = 0; k < n; k++) {\n        var nrm = 0;\n        for (i = k; i < m; i++) {\n            nrm = hypotenuse(nrm, qr[i][k]);\n        }\n        if (nrm !== 0) {\n            if (qr[k][k] < 0) {\n                nrm = -nrm;\n            }\n            for (i = k; i < m; i++) {\n                qr[i][k] /= nrm;\n            }\n            qr[k][k] += 1;\n            for (j = k + 1; j < n; j++) {\n                s = 0;\n                for (i = k; i < m; i++) {\n                    s += qr[i][k] * qr[i][j];\n                }\n                s = -s / qr[k][k];\n                for (i = k; i < m; i++) {\n                    qr[i][j] += s * qr[i][k];\n                }\n            }\n        }\n        rdiag[k] = -nrm;\n    }\n\n    this.QR = qr;\n    this.Rdiag = rdiag;\n}\n\nQrDecomposition.prototype = {\n    solve: function (value) {\n        value = Matrix.checkMatrix(value);\n\n        var qr = this.QR,\n            m = qr.rows;\n\n        if (value.rows !== m) {\n            throw new Error('Matrix row dimensions must agree');\n        }\n        if (!this.isFullRank()) {\n            throw new Error('Matrix is rank deficient');\n        }\n\n        var count = value.columns;\n        var X = value.clone();\n        var n = qr.columns;\n        var i, j, k, s;\n\n        for (k = 0; k < n; k++) {\n            for (j = 0; j < count; j++) {\n                s = 0;\n                for (i = k; i < m; i++) {\n                    s += qr[i][k] * X[i][j];\n                }\n                s = -s / qr[k][k];\n                for (i = k; i < m; i++) {\n                    X[i][j] += s * qr[i][k];\n                }\n            }\n        }\n        for (k = n - 1; k >= 0; k--) {\n            for (j = 0; j < count; j++) {\n                X[k][j] /= this.Rdiag[k];\n            }\n            for (i = 0; i < k; i++) {\n                for (j = 0; j < count; j++) {\n                    X[i][j] -= X[k][j] * qr[i][k];\n                }\n            }\n        }\n\n        return X.subMatrix(0, n - 1, 0, count - 1);\n    },\n    isFullRank: function () {\n        var columns = this.QR.columns;\n        for (var i = 0; i < columns; i++) {\n            if (this.Rdiag[i] === 0) {\n                return false;\n            }\n        }\n        return true;\n    },\n    get upperTriangularMatrix() {\n        var qr = this.QR,\n            n = qr.columns,\n            X = new Matrix(n, n),\n            i, j;\n        for (i = 0; i < n; i++) {\n            for (j = 0; j < n; j++) {\n                if (i < j) {\n                    X[i][j] = qr[i][j];\n                } else if (i === j) {\n                    X[i][j] = this.Rdiag[i];\n                } else {\n                    X[i][j] = 0;\n                }\n            }\n        }\n        return X;\n    },\n    get orthogonalMatrix() {\n        var qr = this.QR,\n            rows = qr.rows,\n            columns = qr.columns,\n            X = new Matrix(rows, columns),\n            i, j, k, s;\n\n        for (k = columns - 1; k >= 0; k--) {\n            for (i = 0; i < rows; i++) {\n                X[i][k] = 0;\n            }\n            X[k][k] = 1;\n            for (j = k; j < columns; j++) {\n                if (qr[k][k] !== 0) {\n                    s = 0;\n                    for (i = k; i < rows; i++) {\n                        s += qr[i][k] * X[i][j];\n                    }\n\n                    s = -s / qr[k][k];\n\n                    for (i = k; i < rows; i++) {\n                        X[i][j] += s * qr[i][k];\n                    }\n                }\n            }\n        }\n        return X;\n    }\n};\n\nmodule.exports = QrDecomposition;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-matrix/src/dc/qr.js","'use strict';\n\nvar Matrix = require('../matrix').Matrix;\n\n// https://github.com/lutzroeder/Mapack/blob/master/Source/CholeskyDecomposition.cs\nfunction CholeskyDecomposition(value) {\n    if (!(this instanceof CholeskyDecomposition)) {\n        return new CholeskyDecomposition(value);\n    }\n    value = Matrix.checkMatrix(value);\n    if (!value.isSymmetric()) {\n        throw new Error('Matrix is not symmetric');\n    }\n\n    var a = value,\n        dimension = a.rows,\n        l = new Matrix(dimension, dimension),\n        positiveDefinite = true,\n        i, j, k;\n\n    for (j = 0; j < dimension; j++) {\n        var Lrowj = l[j];\n        var d = 0;\n        for (k = 0; k < j; k++) {\n            var Lrowk = l[k];\n            var s = 0;\n            for (i = 0; i < k; i++) {\n                s += Lrowk[i] * Lrowj[i];\n            }\n            Lrowj[k] = s = (a[j][k] - s) / l[k][k];\n            d = d + s * s;\n        }\n\n        d = a[j][j] - d;\n\n        positiveDefinite &= (d > 0);\n        l[j][j] = Math.sqrt(Math.max(d, 0));\n        for (k = j + 1; k < dimension; k++) {\n            l[j][k] = 0;\n        }\n    }\n\n    if (!positiveDefinite) {\n        throw new Error('Matrix is not positive definite');\n    }\n\n    this.L = l;\n}\n\nCholeskyDecomposition.prototype = {\n    get lowerTriangularMatrix() {\n        return this.L;\n    },\n    solve: function (value) {\n        value = Matrix.checkMatrix(value);\n\n        var l = this.L,\n            dimension = l.rows;\n\n        if (value.rows !== dimension) {\n            throw new Error('Matrix dimensions do not match');\n        }\n\n        var count = value.columns,\n            B = value.clone(),\n            i, j, k;\n\n        for (k = 0; k < dimension; k++) {\n            for (j = 0; j < count; j++) {\n                for (i = 0; i < k; i++) {\n                    B[k][j] -= B[i][j] * l[k][i];\n                }\n                B[k][j] /= l[k][k];\n            }\n        }\n\n        for (k = dimension - 1; k >= 0; k--) {\n            for (j = 0; j < count; j++) {\n                for (i = k + 1; i < dimension; i++) {\n                    B[k][j] -= B[i][j] * l[i][k];\n                }\n                B[k][j] /= l[k][k];\n            }\n        }\n\n        return B;\n    }\n};\n\nmodule.exports = CholeskyDecomposition;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-matrix/src/dc/cholesky.js","'use strict';\n\nexports.agnes = require('./agnes');\nexports.diana = require('./diana');\n//exports.birch = require('./birch');\n//exports.cure = require('./cure');\n//exports.chameleon = require('./chameleon');\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-hclust/src/index.js","'use strict';\n\nconst euclidean = require('ml-distance-euclidean');\nconst ClusterLeaf = require('./ClusterLeaf');\nconst Cluster = require('./Cluster');\nconst distanceMatrix = require('ml-distance-matrix');\n\n/**\n * @private\n * @param cluster1\n * @param cluster2\n * @param disFun\n * @returns {number}\n */\nfunction simpleLink(cluster1, cluster2, disFun) {\n    var m = 10e100;\n    for (var i = 0; i < cluster1.length; i++) {\n        for (var j = 0; j < cluster2.length; j++) {\n            var d = disFun[cluster1[i]][ cluster2[j]];\n            m = Math.min(d, m);\n        }\n    }\n    return m;\n}\n\n/**\n * @private\n * @param cluster1\n * @param cluster2\n * @param disFun\n * @returns {number}\n */\nfunction completeLink(cluster1, cluster2, disFun) {\n    var m = -1;\n    for (var i = 0; i < cluster1.length; i++) {\n        for (var j = 0; j < cluster2.length; j++) {\n            var d = disFun[cluster1[i]][ cluster2[j]];\n            m = Math.max(d, m);\n        }\n    }\n    return m;\n}\n\n/**\n * @private\n * @param cluster1\n * @param cluster2\n * @param disFun\n * @returns {number}\n */\nfunction averageLink(cluster1, cluster2, disFun) {\n    var m = 0;\n    for (var i = 0; i < cluster1.length; i++) {\n        for (var j = 0; j < cluster2.length; j++) {\n            m += disFun[cluster1[i]][ cluster2[j]];\n        }\n    }\n    return m / (cluster1.length * cluster2.length);\n}\n\n/**\n * @private\n * @param cluster1\n * @param cluster2\n * @param disFun\n * @returns {*}\n */\nfunction centroidLink(cluster1, cluster2, disFun) {\n    var dist = new Array(cluster1.length * cluster2.length);\n    for (var i = 0; i < cluster1.length; i++) {\n        for (var j = 0; j < cluster2.length; j++) {\n            dist[i * cluster2.length + j] = (disFun[cluster1[i]][ cluster2[j]]);\n        }\n    }\n    return median(dist);\n}\n\n/**\n * @private\n * @param cluster1\n * @param cluster2\n * @param disFun\n * @returns {number}\n */\nfunction wardLink(cluster1, cluster2, disFun) {\n    return centroidLink(cluster1, cluster2, disFun)\n        * cluster1.length * cluster2.length / (cluster1.length + cluster2.length);\n}\n\nfunction compareNumbers(a, b) {\n    return a - b;\n}\n\nfunction median(values, alreadySorted) {\n    if (alreadySorted === undefined) alreadySorted = false;\n    if (!alreadySorted) {\n        values = [].concat(values).sort(compareNumbers);\n    }\n    var l = values.length;\n    var half = Math.floor(l / 2);\n    if (l % 2 === 0) {\n        return (values[half - 1] + values[half]) * 0.5;\n    } else {\n        return values[half];\n    }\n}\n\nvar defaultOptions = {\n    disFunc: euclidean,\n    kind: 'single',\n    isDistanceMatrix: false\n\n};\n\n/**\n * Continuously merge nodes that have the least dissimilarity\n * @param {Array <Array <number>>} distance - Array of points to be clustered\n * @param {json} options\n * @option isDistanceMatrix: Is the input a distance matrix?\n * @constructor\n */\nfunction agnes(data, options) {\n    options = Object.assign({}, defaultOptions, options);\n    var len = data.length;\n    var distance = data;//If source\n    if (!options.isDistanceMatrix) {\n        distance = distanceMatrix(data, options.disFunc);\n    }\n\n\n    // allows to use a string or a given function\n    if (typeof options.kind === 'string') {\n        switch (options.kind) {\n            case 'single':\n                options.kind = simpleLink;\n                break;\n            case 'complete':\n                options.kind = completeLink;\n                break;\n            case 'average':\n                options.kind = averageLink;\n                break;\n            case 'centroid':\n                options.kind = centroidLink;\n                break;\n            case 'ward':\n                options.kind = wardLink;\n                break;\n            default:\n                throw new RangeError('Unknown kind of similarity');\n        }\n    } else if (typeof options.kind !== 'function') {\n        throw new TypeError('Undefined kind of similarity');\n    }\n\n    var list = new Array(len);\n    for (var i = 0; i < distance.length; i++) {\n        list[i] = new ClusterLeaf(i);\n    }\n    var min = 10e5,\n        d = {},\n        dis = 0;\n\n    while (list.length > 1) {\n        // calculates the minimum distance\n        d = {};\n        min = 10e5;\n        for (var j = 0; j < list.length; j++) {\n            for (var k = j + 1; k < list.length; k++) {\n                var fdistance, sdistance;\n                if (list[j] instanceof ClusterLeaf) {\n                    fdistance = [list[j].index];\n                } else {\n                    fdistance = new Array(list[j].index.length);\n                    for (var e = 0; e < fdistance.length; e++) {\n                        fdistance[e] = list[j].index[e].index;\n                    }\n                }\n                if (list[k] instanceof ClusterLeaf) {\n                    sdistance = [list[k].index];\n                } else {\n                    sdistance = new Array(list[k].index.length);\n                    for (var f = 0; f < sdistance.length; f++) {\n                        sdistance[f] = list[k].index[f].index;\n                    }\n                }\n                dis = options.kind(fdistance, sdistance, distance).toFixed(4);\n                if (dis in d) {\n                    d[dis].push([list[j], list[k]]);\n                } else {\n                    d[dis] = [[list[j], list[k]]];\n                }\n                min = Math.min(dis, min);\n            }\n        }\n        // cluster dots\n        var dmin = d[min.toFixed(4)];\n        var clustered = new Array(dmin.length);\n        var aux,\n            count = 0;\n        while (dmin.length > 0) {\n            aux = dmin.shift();\n            for (var q = 0; q < dmin.length; q++) {\n                var int = dmin[q].filter(function (n) {\n                    //noinspection JSReferencingMutableVariableFromClosure\n                    return aux.indexOf(n) !== -1;\n                });\n                if (int.length > 0) {\n                    var diff = dmin[q].filter(function (n) {\n                        //noinspection JSReferencingMutableVariableFromClosure\n                        return aux.indexOf(n) === -1;\n                    });\n                    aux = aux.concat(diff);\n                    dmin.splice(q--, 1);\n                }\n            }\n            clustered[count++] = aux;\n        }\n        clustered.length = count;\n\n        for (var ii = 0; ii < clustered.length; ii++) {\n            var obj = new Cluster();\n            obj.children = clustered[ii].concat();\n            obj.distance = min;\n            obj.index = new Array(len);\n            var indCount = 0;\n            for (var jj = 0; jj < clustered[ii].length; jj++) {\n                if (clustered[ii][jj] instanceof ClusterLeaf) {\n                    obj.index[indCount++] = clustered[ii][jj];\n                } else {\n                    indCount += clustered[ii][jj].index.length;\n                    obj.index = clustered[ii][jj].index.concat(obj.index);\n                }\n                list.splice((list.indexOf(clustered[ii][jj])), 1);\n            }\n            obj.index.length = indCount;\n            list.push(obj);\n        }\n    }\n    return list[0];\n}\n\nmodule.exports = agnes;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-hclust/src/agnes.js","module.exports = require('./lib/heap');\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/heap/index.js","// Generated by CoffeeScript 1.8.0\n(function() {\n  var Heap, defaultCmp, floor, heapify, heappop, heappush, heappushpop, heapreplace, insort, min, nlargest, nsmallest, updateItem, _siftdown, _siftup;\n\n  floor = Math.floor, min = Math.min;\n\n\n  /*\n  Default comparison function to be used\n   */\n\n  defaultCmp = function(x, y) {\n    if (x < y) {\n      return -1;\n    }\n    if (x > y) {\n      return 1;\n    }\n    return 0;\n  };\n\n\n  /*\n  Insert item x in list a, and keep it sorted assuming a is sorted.\n  \n  If x is already in a, insert it to the right of the rightmost x.\n  \n  Optional args lo (default 0) and hi (default a.length) bound the slice\n  of a to be searched.\n   */\n\n  insort = function(a, x, lo, hi, cmp) {\n    var mid;\n    if (lo == null) {\n      lo = 0;\n    }\n    if (cmp == null) {\n      cmp = defaultCmp;\n    }\n    if (lo < 0) {\n      throw new Error('lo must be non-negative');\n    }\n    if (hi == null) {\n      hi = a.length;\n    }\n    while (lo < hi) {\n      mid = floor((lo + hi) / 2);\n      if (cmp(x, a[mid]) < 0) {\n        hi = mid;\n      } else {\n        lo = mid + 1;\n      }\n    }\n    return ([].splice.apply(a, [lo, lo - lo].concat(x)), x);\n  };\n\n\n  /*\n  Push item onto heap, maintaining the heap invariant.\n   */\n\n  heappush = function(array, item, cmp) {\n    if (cmp == null) {\n      cmp = defaultCmp;\n    }\n    array.push(item);\n    return _siftdown(array, 0, array.length - 1, cmp);\n  };\n\n\n  /*\n  Pop the smallest item off the heap, maintaining the heap invariant.\n   */\n\n  heappop = function(array, cmp) {\n    var lastelt, returnitem;\n    if (cmp == null) {\n      cmp = defaultCmp;\n    }\n    lastelt = array.pop();\n    if (array.length) {\n      returnitem = array[0];\n      array[0] = lastelt;\n      _siftup(array, 0, cmp);\n    } else {\n      returnitem = lastelt;\n    }\n    return returnitem;\n  };\n\n\n  /*\n  Pop and return the current smallest value, and add the new item.\n  \n  This is more efficient than heappop() followed by heappush(), and can be\n  more appropriate when using a fixed size heap. Note that the value\n  returned may be larger than item! That constrains reasonable use of\n  this routine unless written as part of a conditional replacement:\n      if item > array[0]\n        item = heapreplace(array, item)\n   */\n\n  heapreplace = function(array, item, cmp) {\n    var returnitem;\n    if (cmp == null) {\n      cmp = defaultCmp;\n    }\n    returnitem = array[0];\n    array[0] = item;\n    _siftup(array, 0, cmp);\n    return returnitem;\n  };\n\n\n  /*\n  Fast version of a heappush followed by a heappop.\n   */\n\n  heappushpop = function(array, item, cmp) {\n    var _ref;\n    if (cmp == null) {\n      cmp = defaultCmp;\n    }\n    if (array.length && cmp(array[0], item) < 0) {\n      _ref = [array[0], item], item = _ref[0], array[0] = _ref[1];\n      _siftup(array, 0, cmp);\n    }\n    return item;\n  };\n\n\n  /*\n  Transform list into a heap, in-place, in O(array.length) time.\n   */\n\n  heapify = function(array, cmp) {\n    var i, _i, _j, _len, _ref, _ref1, _results, _results1;\n    if (cmp == null) {\n      cmp = defaultCmp;\n    }\n    _ref1 = (function() {\n      _results1 = [];\n      for (var _j = 0, _ref = floor(array.length / 2); 0 <= _ref ? _j < _ref : _j > _ref; 0 <= _ref ? _j++ : _j--){ _results1.push(_j); }\n      return _results1;\n    }).apply(this).reverse();\n    _results = [];\n    for (_i = 0, _len = _ref1.length; _i < _len; _i++) {\n      i = _ref1[_i];\n      _results.push(_siftup(array, i, cmp));\n    }\n    return _results;\n  };\n\n\n  /*\n  Update the position of the given item in the heap.\n  This function should be called every time the item is being modified.\n   */\n\n  updateItem = function(array, item, cmp) {\n    var pos;\n    if (cmp == null) {\n      cmp = defaultCmp;\n    }\n    pos = array.indexOf(item);\n    if (pos === -1) {\n      return;\n    }\n    _siftdown(array, 0, pos, cmp);\n    return _siftup(array, pos, cmp);\n  };\n\n\n  /*\n  Find the n largest elements in a dataset.\n   */\n\n  nlargest = function(array, n, cmp) {\n    var elem, result, _i, _len, _ref;\n    if (cmp == null) {\n      cmp = defaultCmp;\n    }\n    result = array.slice(0, n);\n    if (!result.length) {\n      return result;\n    }\n    heapify(result, cmp);\n    _ref = array.slice(n);\n    for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n      elem = _ref[_i];\n      heappushpop(result, elem, cmp);\n    }\n    return result.sort(cmp).reverse();\n  };\n\n\n  /*\n  Find the n smallest elements in a dataset.\n   */\n\n  nsmallest = function(array, n, cmp) {\n    var elem, i, los, result, _i, _j, _len, _ref, _ref1, _results;\n    if (cmp == null) {\n      cmp = defaultCmp;\n    }\n    if (n * 10 <= array.length) {\n      result = array.slice(0, n).sort(cmp);\n      if (!result.length) {\n        return result;\n      }\n      los = result[result.length - 1];\n      _ref = array.slice(n);\n      for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n        elem = _ref[_i];\n        if (cmp(elem, los) < 0) {\n          insort(result, elem, 0, null, cmp);\n          result.pop();\n          los = result[result.length - 1];\n        }\n      }\n      return result;\n    }\n    heapify(array, cmp);\n    _results = [];\n    for (i = _j = 0, _ref1 = min(n, array.length); 0 <= _ref1 ? _j < _ref1 : _j > _ref1; i = 0 <= _ref1 ? ++_j : --_j) {\n      _results.push(heappop(array, cmp));\n    }\n    return _results;\n  };\n\n  _siftdown = function(array, startpos, pos, cmp) {\n    var newitem, parent, parentpos;\n    if (cmp == null) {\n      cmp = defaultCmp;\n    }\n    newitem = array[pos];\n    while (pos > startpos) {\n      parentpos = (pos - 1) >> 1;\n      parent = array[parentpos];\n      if (cmp(newitem, parent) < 0) {\n        array[pos] = parent;\n        pos = parentpos;\n        continue;\n      }\n      break;\n    }\n    return array[pos] = newitem;\n  };\n\n  _siftup = function(array, pos, cmp) {\n    var childpos, endpos, newitem, rightpos, startpos;\n    if (cmp == null) {\n      cmp = defaultCmp;\n    }\n    endpos = array.length;\n    startpos = pos;\n    newitem = array[pos];\n    childpos = 2 * pos + 1;\n    while (childpos < endpos) {\n      rightpos = childpos + 1;\n      if (rightpos < endpos && !(cmp(array[childpos], array[rightpos]) < 0)) {\n        childpos = rightpos;\n      }\n      array[pos] = array[childpos];\n      pos = childpos;\n      childpos = 2 * pos + 1;\n    }\n    array[pos] = newitem;\n    return _siftdown(array, startpos, pos, cmp);\n  };\n\n  Heap = (function() {\n    Heap.push = heappush;\n\n    Heap.pop = heappop;\n\n    Heap.replace = heapreplace;\n\n    Heap.pushpop = heappushpop;\n\n    Heap.heapify = heapify;\n\n    Heap.updateItem = updateItem;\n\n    Heap.nlargest = nlargest;\n\n    Heap.nsmallest = nsmallest;\n\n    function Heap(cmp) {\n      this.cmp = cmp != null ? cmp : defaultCmp;\n      this.nodes = [];\n    }\n\n    Heap.prototype.push = function(x) {\n      return heappush(this.nodes, x, this.cmp);\n    };\n\n    Heap.prototype.pop = function() {\n      return heappop(this.nodes, this.cmp);\n    };\n\n    Heap.prototype.peek = function() {\n      return this.nodes[0];\n    };\n\n    Heap.prototype.contains = function(x) {\n      return this.nodes.indexOf(x) !== -1;\n    };\n\n    Heap.prototype.replace = function(x) {\n      return heapreplace(this.nodes, x, this.cmp);\n    };\n\n    Heap.prototype.pushpop = function(x) {\n      return heappushpop(this.nodes, x, this.cmp);\n    };\n\n    Heap.prototype.heapify = function() {\n      return heapify(this.nodes, this.cmp);\n    };\n\n    Heap.prototype.updateItem = function(x) {\n      return updateItem(this.nodes, x, this.cmp);\n    };\n\n    Heap.prototype.clear = function() {\n      return this.nodes = [];\n    };\n\n    Heap.prototype.empty = function() {\n      return this.nodes.length === 0;\n    };\n\n    Heap.prototype.size = function() {\n      return this.nodes.length;\n    };\n\n    Heap.prototype.clone = function() {\n      var heap;\n      heap = new Heap();\n      heap.nodes = this.nodes.slice(0);\n      return heap;\n    };\n\n    Heap.prototype.toArray = function() {\n      return this.nodes.slice(0);\n    };\n\n    Heap.prototype.insert = Heap.prototype.push;\n\n    Heap.prototype.top = Heap.prototype.peek;\n\n    Heap.prototype.front = Heap.prototype.peek;\n\n    Heap.prototype.has = Heap.prototype.contains;\n\n    Heap.prototype.copy = Heap.prototype.clone;\n\n    return Heap;\n\n  })();\n\n  (function(root, factory) {\n    if (typeof define === 'function' && define.amd) {\n      return define([], factory);\n    } else if (typeof exports === 'object') {\n      return module.exports = factory();\n    } else {\n      return root.Heap = factory();\n    }\n  })(this, function() {\n    return Heap;\n  });\n\n}).call(this);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/heap/lib/heap.js","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar formatRegExp = /%[sdj%]/g;\nexports.format = function(f) {\n  if (!isString(f)) {\n    var objects = [];\n    for (var i = 0; i < arguments.length; i++) {\n      objects.push(inspect(arguments[i]));\n    }\n    return objects.join(' ');\n  }\n\n  var i = 1;\n  var args = arguments;\n  var len = args.length;\n  var str = String(f).replace(formatRegExp, function(x) {\n    if (x === '%%') return '%';\n    if (i >= len) return x;\n    switch (x) {\n      case '%s': return String(args[i++]);\n      case '%d': return Number(args[i++]);\n      case '%j':\n        try {\n          return JSON.stringify(args[i++]);\n        } catch (_) {\n          return '[Circular]';\n        }\n      default:\n        return x;\n    }\n  });\n  for (var x = args[i]; i < len; x = args[++i]) {\n    if (isNull(x) || !isObject(x)) {\n      str += ' ' + x;\n    } else {\n      str += ' ' + inspect(x);\n    }\n  }\n  return str;\n};\n\n\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nexports.deprecate = function(fn, msg) {\n  // Allow for deprecating things in the process of starting up.\n  if (isUndefined(global.process)) {\n    return function() {\n      return exports.deprecate(fn, msg).apply(this, arguments);\n    };\n  }\n\n  if (process.noDeprecation === true) {\n    return fn;\n  }\n\n  var warned = false;\n  function deprecated() {\n    if (!warned) {\n      if (process.throwDeprecation) {\n        throw new Error(msg);\n      } else if (process.traceDeprecation) {\n        console.trace(msg);\n      } else {\n        console.error(msg);\n      }\n      warned = true;\n    }\n    return fn.apply(this, arguments);\n  }\n\n  return deprecated;\n};\n\n\nvar debugs = {};\nvar debugEnviron;\nexports.debuglog = function(set) {\n  if (isUndefined(debugEnviron))\n    debugEnviron = process.env.NODE_DEBUG || '';\n  set = set.toUpperCase();\n  if (!debugs[set]) {\n    if (new RegExp('\\\\b' + set + '\\\\b', 'i').test(debugEnviron)) {\n      var pid = process.pid;\n      debugs[set] = function() {\n        var msg = exports.format.apply(exports, arguments);\n        console.error('%s %d: %s', set, pid, msg);\n      };\n    } else {\n      debugs[set] = function() {};\n    }\n  }\n  return debugs[set];\n};\n\n\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n/* legacy: obj, showHidden, depth, colors*/\nfunction inspect(obj, opts) {\n  // default options\n  var ctx = {\n    seen: [],\n    stylize: stylizeNoColor\n  };\n  // legacy...\n  if (arguments.length >= 3) ctx.depth = arguments[2];\n  if (arguments.length >= 4) ctx.colors = arguments[3];\n  if (isBoolean(opts)) {\n    // legacy...\n    ctx.showHidden = opts;\n  } else if (opts) {\n    // got an \"options\" object\n    exports._extend(ctx, opts);\n  }\n  // set default options\n  if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n  if (isUndefined(ctx.depth)) ctx.depth = 2;\n  if (isUndefined(ctx.colors)) ctx.colors = false;\n  if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n  if (ctx.colors) ctx.stylize = stylizeWithColor;\n  return formatValue(ctx, obj, ctx.depth);\n}\nexports.inspect = inspect;\n\n\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\ninspect.colors = {\n  'bold' : [1, 22],\n  'italic' : [3, 23],\n  'underline' : [4, 24],\n  'inverse' : [7, 27],\n  'white' : [37, 39],\n  'grey' : [90, 39],\n  'black' : [30, 39],\n  'blue' : [34, 39],\n  'cyan' : [36, 39],\n  'green' : [32, 39],\n  'magenta' : [35, 39],\n  'red' : [31, 39],\n  'yellow' : [33, 39]\n};\n\n// Don't use 'blue' not visible on cmd.exe\ninspect.styles = {\n  'special': 'cyan',\n  'number': 'yellow',\n  'boolean': 'yellow',\n  'undefined': 'grey',\n  'null': 'bold',\n  'string': 'green',\n  'date': 'magenta',\n  // \"name\": intentionally not styling\n  'regexp': 'red'\n};\n\n\nfunction stylizeWithColor(str, styleType) {\n  var style = inspect.styles[styleType];\n\n  if (style) {\n    return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n           '\\u001b[' + inspect.colors[style][1] + 'm';\n  } else {\n    return str;\n  }\n}\n\n\nfunction stylizeNoColor(str, styleType) {\n  return str;\n}\n\n\nfunction arrayToHash(array) {\n  var hash = {};\n\n  array.forEach(function(val, idx) {\n    hash[val] = true;\n  });\n\n  return hash;\n}\n\n\nfunction formatValue(ctx, value, recurseTimes) {\n  // Provide a hook for user-specified inspect functions.\n  // Check that value is an object with an inspect function on it\n  if (ctx.customInspect &&\n      value &&\n      isFunction(value.inspect) &&\n      // Filter out the util module, it's inspect function is special\n      value.inspect !== exports.inspect &&\n      // Also filter out any prototype objects using the circular check.\n      !(value.constructor && value.constructor.prototype === value)) {\n    var ret = value.inspect(recurseTimes, ctx);\n    if (!isString(ret)) {\n      ret = formatValue(ctx, ret, recurseTimes);\n    }\n    return ret;\n  }\n\n  // Primitive types cannot have properties\n  var primitive = formatPrimitive(ctx, value);\n  if (primitive) {\n    return primitive;\n  }\n\n  // Look up the keys of the object.\n  var keys = Object.keys(value);\n  var visibleKeys = arrayToHash(keys);\n\n  if (ctx.showHidden) {\n    keys = Object.getOwnPropertyNames(value);\n  }\n\n  // IE doesn't make error fields non-enumerable\n  // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n  if (isError(value)\n      && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n    return formatError(value);\n  }\n\n  // Some type of object without properties can be shortcutted.\n  if (keys.length === 0) {\n    if (isFunction(value)) {\n      var name = value.name ? ': ' + value.name : '';\n      return ctx.stylize('[Function' + name + ']', 'special');\n    }\n    if (isRegExp(value)) {\n      return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n    }\n    if (isDate(value)) {\n      return ctx.stylize(Date.prototype.toString.call(value), 'date');\n    }\n    if (isError(value)) {\n      return formatError(value);\n    }\n  }\n\n  var base = '', array = false, braces = ['{', '}'];\n\n  // Make Array say that they are Array\n  if (isArray(value)) {\n    array = true;\n    braces = ['[', ']'];\n  }\n\n  // Make functions say that they are functions\n  if (isFunction(value)) {\n    var n = value.name ? ': ' + value.name : '';\n    base = ' [Function' + n + ']';\n  }\n\n  // Make RegExps say that they are RegExps\n  if (isRegExp(value)) {\n    base = ' ' + RegExp.prototype.toString.call(value);\n  }\n\n  // Make dates with properties first say the date\n  if (isDate(value)) {\n    base = ' ' + Date.prototype.toUTCString.call(value);\n  }\n\n  // Make error with message first say the error\n  if (isError(value)) {\n    base = ' ' + formatError(value);\n  }\n\n  if (keys.length === 0 && (!array || value.length == 0)) {\n    return braces[0] + base + braces[1];\n  }\n\n  if (recurseTimes < 0) {\n    if (isRegExp(value)) {\n      return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n    } else {\n      return ctx.stylize('[Object]', 'special');\n    }\n  }\n\n  ctx.seen.push(value);\n\n  var output;\n  if (array) {\n    output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n  } else {\n    output = keys.map(function(key) {\n      return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n    });\n  }\n\n  ctx.seen.pop();\n\n  return reduceToSingleString(output, base, braces);\n}\n\n\nfunction formatPrimitive(ctx, value) {\n  if (isUndefined(value))\n    return ctx.stylize('undefined', 'undefined');\n  if (isString(value)) {\n    var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n                                             .replace(/'/g, \"\\\\'\")\n                                             .replace(/\\\\\"/g, '\"') + '\\'';\n    return ctx.stylize(simple, 'string');\n  }\n  if (isNumber(value))\n    return ctx.stylize('' + value, 'number');\n  if (isBoolean(value))\n    return ctx.stylize('' + value, 'boolean');\n  // For some reason typeof null is \"object\", so special case here.\n  if (isNull(value))\n    return ctx.stylize('null', 'null');\n}\n\n\nfunction formatError(value) {\n  return '[' + Error.prototype.toString.call(value) + ']';\n}\n\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n  var output = [];\n  for (var i = 0, l = value.length; i < l; ++i) {\n    if (hasOwnProperty(value, String(i))) {\n      output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n          String(i), true));\n    } else {\n      output.push('');\n    }\n  }\n  keys.forEach(function(key) {\n    if (!key.match(/^\\d+$/)) {\n      output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n          key, true));\n    }\n  });\n  return output;\n}\n\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n  var name, str, desc;\n  desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n  if (desc.get) {\n    if (desc.set) {\n      str = ctx.stylize('[Getter/Setter]', 'special');\n    } else {\n      str = ctx.stylize('[Getter]', 'special');\n    }\n  } else {\n    if (desc.set) {\n      str = ctx.stylize('[Setter]', 'special');\n    }\n  }\n  if (!hasOwnProperty(visibleKeys, key)) {\n    name = '[' + key + ']';\n  }\n  if (!str) {\n    if (ctx.seen.indexOf(desc.value) < 0) {\n      if (isNull(recurseTimes)) {\n        str = formatValue(ctx, desc.value, null);\n      } else {\n        str = formatValue(ctx, desc.value, recurseTimes - 1);\n      }\n      if (str.indexOf('\\n') > -1) {\n        if (array) {\n          str = str.split('\\n').map(function(line) {\n            return '  ' + line;\n          }).join('\\n').substr(2);\n        } else {\n          str = '\\n' + str.split('\\n').map(function(line) {\n            return '   ' + line;\n          }).join('\\n');\n        }\n      }\n    } else {\n      str = ctx.stylize('[Circular]', 'special');\n    }\n  }\n  if (isUndefined(name)) {\n    if (array && key.match(/^\\d+$/)) {\n      return str;\n    }\n    name = JSON.stringify('' + key);\n    if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n      name = name.substr(1, name.length - 2);\n      name = ctx.stylize(name, 'name');\n    } else {\n      name = name.replace(/'/g, \"\\\\'\")\n                 .replace(/\\\\\"/g, '\"')\n                 .replace(/(^\"|\"$)/g, \"'\");\n      name = ctx.stylize(name, 'string');\n    }\n  }\n\n  return name + ': ' + str;\n}\n\n\nfunction reduceToSingleString(output, base, braces) {\n  var numLinesEst = 0;\n  var length = output.reduce(function(prev, cur) {\n    numLinesEst++;\n    if (cur.indexOf('\\n') >= 0) numLinesEst++;\n    return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n  }, 0);\n\n  if (length > 60) {\n    return braces[0] +\n           (base === '' ? '' : base + '\\n ') +\n           ' ' +\n           output.join(',\\n  ') +\n           ' ' +\n           braces[1];\n  }\n\n  return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n}\n\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nfunction isArray(ar) {\n  return Array.isArray(ar);\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n  return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n  return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n  return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n  return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n  return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n  return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n  return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n  return isObject(re) && objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n  return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n  return isObject(d) && objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n  return isObject(e) &&\n      (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n  return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n  return arg === null ||\n         typeof arg === 'boolean' ||\n         typeof arg === 'number' ||\n         typeof arg === 'string' ||\n         typeof arg === 'symbol' ||  // ES6 symbol\n         typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = require('./support/isBuffer');\n\nfunction objectToString(o) {\n  return Object.prototype.toString.call(o);\n}\n\n\nfunction pad(n) {\n  return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n              'Oct', 'Nov', 'Dec'];\n\n// 26 Feb 16:19:34\nfunction timestamp() {\n  var d = new Date();\n  var time = [pad(d.getHours()),\n              pad(d.getMinutes()),\n              pad(d.getSeconds())].join(':');\n  return [d.getDate(), months[d.getMonth()], time].join(' ');\n}\n\n\n// log is just a thin wrapper to console.log that prepends a timestamp\nexports.log = function() {\n  console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n *     prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nexports.inherits = require('inherits');\n\nexports._extend = function(origin, add) {\n  // Don't do anything if add isn't an object\n  if (!add || !isObject(add)) return origin;\n\n  var keys = Object.keys(add);\n  var i = keys.length;\n  while (i--) {\n    origin[keys[i]] = add[keys[i]];\n  }\n  return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n  return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/util/util.js","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things.  But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals.  It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n    throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n    throw new Error('clearTimeout has not been defined');\n}\n(function () {\n    try {\n        if (typeof setTimeout === 'function') {\n            cachedSetTimeout = setTimeout;\n        } else {\n            cachedSetTimeout = defaultSetTimout;\n        }\n    } catch (e) {\n        cachedSetTimeout = defaultSetTimout;\n    }\n    try {\n        if (typeof clearTimeout === 'function') {\n            cachedClearTimeout = clearTimeout;\n        } else {\n            cachedClearTimeout = defaultClearTimeout;\n        }\n    } catch (e) {\n        cachedClearTimeout = defaultClearTimeout;\n    }\n} ())\nfunction runTimeout(fun) {\n    if (cachedSetTimeout === setTimeout) {\n        //normal enviroments in sane situations\n        return setTimeout(fun, 0);\n    }\n    // if setTimeout wasn't available but was latter defined\n    if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n        cachedSetTimeout = setTimeout;\n        return setTimeout(fun, 0);\n    }\n    try {\n        // when when somebody has screwed with setTimeout but no I.E. maddness\n        return cachedSetTimeout(fun, 0);\n    } catch(e){\n        try {\n            // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n            return cachedSetTimeout.call(null, fun, 0);\n        } catch(e){\n            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n            return cachedSetTimeout.call(this, fun, 0);\n        }\n    }\n\n\n}\nfunction runClearTimeout(marker) {\n    if (cachedClearTimeout === clearTimeout) {\n        //normal enviroments in sane situations\n        return clearTimeout(marker);\n    }\n    // if clearTimeout wasn't available but was latter defined\n    if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n        cachedClearTimeout = clearTimeout;\n        return clearTimeout(marker);\n    }\n    try {\n        // when when somebody has screwed with setTimeout but no I.E. maddness\n        return cachedClearTimeout(marker);\n    } catch (e){\n        try {\n            // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally\n            return cachedClearTimeout.call(null, marker);\n        } catch (e){\n            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n            // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n            return cachedClearTimeout.call(this, marker);\n        }\n    }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n    if (!draining || !currentQueue) {\n        return;\n    }\n    draining = false;\n    if (currentQueue.length) {\n        queue = currentQueue.concat(queue);\n    } else {\n        queueIndex = -1;\n    }\n    if (queue.length) {\n        drainQueue();\n    }\n}\n\nfunction drainQueue() {\n    if (draining) {\n        return;\n    }\n    var timeout = runTimeout(cleanUpNextTick);\n    draining = true;\n\n    var len = queue.length;\n    while(len) {\n        currentQueue = queue;\n        queue = [];\n        while (++queueIndex < len) {\n            if (currentQueue) {\n                currentQueue[queueIndex].run();\n            }\n        }\n        queueIndex = -1;\n        len = queue.length;\n    }\n    currentQueue = null;\n    draining = false;\n    runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n    var args = new Array(arguments.length - 1);\n    if (arguments.length > 1) {\n        for (var i = 1; i < arguments.length; i++) {\n            args[i - 1] = arguments[i];\n        }\n    }\n    queue.push(new Item(fun, args));\n    if (queue.length === 1 && !draining) {\n        runTimeout(drainQueue);\n    }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n    this.fun = fun;\n    this.array = array;\n}\nItem.prototype.run = function () {\n    this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n    throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n    throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/process/browser.js","module.exports = function isBuffer(arg) {\n  return arg && typeof arg === 'object'\n    && typeof arg.copy === 'function'\n    && typeof arg.fill === 'function'\n    && typeof arg.readUInt8 === 'function';\n}\n\n\n// WEBPACK FOOTER //\n// ./node_modules/util/support/isBufferBrowser.js","if (typeof Object.create === 'function') {\n  // implementation from standard node.js 'util' module\n  module.exports = function inherits(ctor, superCtor) {\n    ctor.super_ = superCtor\n    ctor.prototype = Object.create(superCtor.prototype, {\n      constructor: {\n        value: ctor,\n        enumerable: false,\n        writable: true,\n        configurable: true\n      }\n    });\n  };\n} else {\n  // old school shim for old browsers\n  module.exports = function inherits(ctor, superCtor) {\n    ctor.super_ = superCtor\n    var TempCtor = function () {}\n    TempCtor.prototype = superCtor.prototype\n    ctor.prototype = new TempCtor()\n    ctor.prototype.constructor = ctor\n  }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/util/node_modules/inherits/inherits_browser.js","'use strict';\n\n\n/**\n * Computes a distance/similarity matrix given an array of data and a distance/similarity function.\n * @param {Array} data An array of data\n * @param {function} distanceFn  A function that accepts two arguments and computes a distance/similarity between them\n * @return {Array<Array>} The similarity matrix. The similarity matrix is square and has a size equal to the length of\n * the data array\n */\nfunction distanceMatrix(data, distanceFn) {\n    const length = data.length;\n    let result = Array.from({length}).map(() => Array.from({length}));\n\n    // Compute upper distance matrix\n    for (let i = 0; i < length; i++) {\n        for (let j = 0; j <= i; j++) {\n            result[i][j] = distanceFn(data[i], data[j]);\n        }\n    }\n\n    // Copy to lower distance matrix\n    for (let i = 0; i < length; i++) {\n        for (let j = i + 1; j < length; j++) {\n            result[i][j] = result[j][i];\n        }\n    }\n\n    return result;\n}\n\nmodule.exports = distanceMatrix;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-distance-matrix/src/index.js","'use strict';\n\nconst euclidean = require('ml-distance-euclidean');\nconst ClusterLeaf = require('./ClusterLeaf');\nconst Cluster = require('./Cluster');\n\n/**\n * @private\n * @param {Array <Array <number>>} cluster1\n * @param {Array <Array <number>>} cluster2\n * @param {function} disFun\n * @returns {number}\n */\nfunction simpleLink(cluster1, cluster2, disFun) {\n    var m = 10e100;\n    for (var i = 0; i < cluster1.length; i++) {\n        for (var j = i; j < cluster2.length; j++) {\n            var d = disFun(cluster1[i], cluster2[j]);\n            m = Math.min(d, m);\n        }\n    }\n    return m;\n}\n\n/**\n * @private\n * @param {Array <Array <number>>} cluster1\n * @param {Array <Array <number>>} cluster2\n * @param {function} disFun\n * @returns {number}\n */\nfunction completeLink(cluster1, cluster2, disFun) {\n    var m = -1;\n    for (var i = 0; i < cluster1.length; i++) {\n        for (var j = i; j < cluster2.length; j++) {\n            var d = disFun(cluster1[i], cluster2[j]);\n            m = Math.max(d, m);\n        }\n    }\n    return m;\n}\n\n/**\n * @private\n * @param {Array <Array <number>>} cluster1\n * @param {Array <Array <number>>} cluster2\n * @param {function} disFun\n * @returns {number}\n */\nfunction averageLink(cluster1, cluster2, disFun) {\n    var m = 0;\n    for (var i = 0; i < cluster1.length; i++) {\n        for (var j = 0; j < cluster2.length; j++) {\n            m += disFun(cluster1[i], cluster2[j]);\n        }\n    }\n    return m / (cluster1.length * cluster2.length);\n}\n\n/**\n * @private\n * @param {Array <Array <number>>} cluster1\n * @param {Array <Array <number>>} cluster2\n * @param {function} disFun\n * @returns {number}\n */\nfunction centroidLink(cluster1, cluster2, disFun) {\n    var x1 = 0,\n        y1 = 0,\n        x2 = 0,\n        y2 = 0;\n    for (var i = 0; i < cluster1.length; i++) {\n        x1 += cluster1[i][0];\n        y1 += cluster1[i][1];\n    }\n    for (var j = 0; j < cluster2.length; j++) {\n        x2 += cluster2[j][0];\n        y2 += cluster2[j][1];\n    }\n    x1 /= cluster1.length;\n    y1 /= cluster1.length;\n    x2 /= cluster2.length;\n    y2 /= cluster2.length;\n    return disFun([x1, y1], [x2, y2]);\n}\n\n/**\n * @private\n * @param {Array <Array <number>>} cluster1\n * @param {Array <Array <number>>} cluster2\n * @param {function} disFun\n * @returns {number}\n */\nfunction wardLink(cluster1, cluster2, disFun) {\n    var x1 = 0,\n        y1 = 0,\n        x2 = 0,\n        y2 = 0;\n    for (var i = 0; i < cluster1.length; i++) {\n        x1 += cluster1[i][0];\n        y1 += cluster1[i][1];\n    }\n    for (var j = 0; j < cluster2.length; j++) {\n        x2 += cluster2[j][0];\n        y2 += cluster2[j][1];\n    }\n    x1 /= cluster1.length;\n    y1 /= cluster1.length;\n    x2 /= cluster2.length;\n    y2 /= cluster2.length;\n    return disFun([x1, y1], [x2, y2]) * cluster1.length * cluster2.length / (cluster1.length + cluster2.length);\n}\n\n/**\n * @private\n * Returns the most distant point and his distance\n * @param {Array <Array <number>>} splitting - Clusters to split\n * @param {Array <Array <number>>} data - Original data\n * @param {function} disFun - Distance function\n * @returns {{d: number, p: number}} - d: maximum difference between points, p: the point more distant\n */\nfunction diff(splitting, data, disFun) {\n    var ans = {\n        d: 0,\n        p: 0\n    };\n\n    var Ci = new Array(splitting[0].length);\n    for (var e = 0; e < splitting[0].length; e++) {\n        Ci[e] = data[splitting[0][e]];\n    }\n    var Cj = new Array(splitting[1].length);\n    for (var f = 0; f < splitting[1].length; f++) {\n        Cj[f] = data[splitting[1][f]];\n    }\n\n    var dist, ndist;\n    for (var i = 0; i < Ci.length; i++) {\n        dist = 0;\n        for (var j = 0; j < Ci.length; j++) {\n            if (i !== j) {\n                dist += disFun(Ci[i], Ci[j]);\n            }\n        }\n        dist /= (Ci.length - 1);\n        ndist = 0;\n        for (var k = 0; k < Cj.length; k++) {\n            ndist += disFun(Ci[i], Cj[k]);\n        }\n        ndist /= Cj.length;\n        if ((dist - ndist) > ans.d) {\n            ans.d = (dist - ndist);\n            ans.p = i;\n        }\n    }\n    return ans;\n}\n\nvar defaultOptions = {\n    dist: euclidean,\n    kind: 'single'\n};\n\n/**\n * @private\n * Intra-cluster distance\n * @param {Array} index\n * @param {Array} data\n * @param {function} disFun\n * @returns {number}\n */\nfunction intrDist(index, data, disFun) {\n    var dist = 0,\n        count = 0;\n    for (var i = 0; i < index.length; i++) {\n        for (var j = i; j < index.length; j++) {\n            dist += disFun(data[index[i].index], data[index[j].index]);\n            count++;\n        }\n    }\n    return dist / count;\n}\n\n/**\n * Splits the higher level clusters\n * @param {Array <Array <number>>} data - Array of points to be clustered\n * @param {json} options\n * @constructor\n */\nfunction diana(data, options) {\n    options = Object.assign({}, defaultOptions, options);\n    if (typeof options.kind === 'string') {\n        switch (options.kind) {\n            case 'single':\n                options.kind = simpleLink;\n                break;\n            case 'complete':\n                options.kind = completeLink;\n                break;\n            case 'average':\n                options.kind = averageLink;\n                break;\n            case 'centroid':\n                options.kind = centroidLink;\n                break;\n            case 'ward':\n                options.kind = wardLink;\n                break;\n            default:\n                throw new RangeError('Unknown kind of similarity');\n        }\n    } else if (typeof options.kind !== 'function') {\n        throw new TypeError('Undefined kind of similarity');\n    }\n    var tree = new Cluster();\n    tree.children = new Array(data.length);\n    tree.index = new Array(data.length);\n    for (var ind = 0; ind < data.length; ind++) {\n        tree.children[ind] = new ClusterLeaf(ind);\n        tree.index[ind] = new ClusterLeaf(ind);\n    }\n\n    tree.distance = intrDist(tree.index, data, options.dist);\n    var m, M, clId,\n        dist, rebel;\n    var list = [tree];\n    while (list.length > 0) {\n        M = 0;\n        clId = 0;\n        for (var i = 0; i < list.length; i++) {\n            m = 0;\n            for (var j = 0; j < list[i].length; j++) {\n                for (var l = (j + 1); l < list[i].length; l++) {\n                    m = Math.max(options.dist(data[list[i].index[j].index], data[list[i].index[l].index]), m);\n                }\n            }\n            if (m > M) {\n                M = m;\n                clId = i;\n            }\n        }\n        M = 0;\n        if (list[clId].index.length === 2) {\n            list[clId].children = [list[clId].index[0], list[clId].index[1]];\n            list[clId].distance = options.dist(data[list[clId].index[0].index], data[list[clId].index[1].index]);\n        } else if (list[clId].index.length === 3) {\n            list[clId].children = [list[clId].index[0], list[clId].index[1], list[clId].index[2]];\n            var d = [\n                options.dist(data[list[clId].index[0].index], data[list[clId].index[1].index]),\n                options.dist(data[list[clId].index[1].index], data[list[clId].index[2].index])\n            ];\n            list[clId].distance = (d[0] + d[1]) / 2;\n        } else {\n            var C = new Cluster();\n            var sG = new Cluster();\n            var splitting = [new Array(list[clId].index.length), []];\n            for (var spl = 0; spl < splitting[0].length; spl++) {\n                splitting[0][spl] = spl;\n            }\n            for (var ii = 0; ii < splitting[0].length; ii++) {\n                dist = 0;\n                for (var jj = 0; jj < splitting[0].length; jj++) {\n                    if (ii !== jj) {\n                        dist += options.dist(data[list[clId].index[splitting[0][jj]].index], data[list[clId].index[splitting[0][ii]].index]);\n                    }\n                }\n                dist /= (splitting[0].length - 1);\n                if (dist > M) {\n                    M = dist;\n                    rebel = ii;\n                }\n            }\n            splitting[1] = [rebel];\n            splitting[0].splice(rebel, 1);\n            dist = diff(splitting, data, options.dist);\n            while (dist.d > 0) {\n                splitting[1].push(splitting[0][dist.p]);\n                splitting[0].splice(dist.p, 1);\n                dist = diff(splitting, data, options.dist);\n            }\n            var fData = new Array(splitting[0].length);\n            C.index = new Array(splitting[0].length);\n            for (var e = 0; e < fData.length; e++) {\n                fData[e] = data[list[clId].index[splitting[0][e]].index];\n                C.index[e] = list[clId].index[splitting[0][e]];\n                C.children[e] = list[clId].index[splitting[0][e]];\n            }\n            var sData = new Array(splitting[1].length);\n            sG.index = new Array(splitting[1].length);\n            for (var f = 0; f < sData.length; f++) {\n                sData[f] = data[list[clId].index[splitting[1][f]].index];\n                sG.index[f] = list[clId].index[splitting[1][f]];\n                sG.children[f] = list[clId].index[splitting[1][f]];\n            }\n            C.distance = intrDist(C.index, data, options.dist);\n            sG.distance = intrDist(sG.index, data, options.dist);\n            list.push(C);\n            list.push(sG);\n            list[clId].children = [C, sG];\n        }\n        list.splice(clId, 1);\n    }\n    return tree;\n}\n\nmodule.exports = diana;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-hclust/src/diana.js","import Matrix from 'ml-matrix';\nimport SparseMatrix from 'ml-sparse-matrix';\nimport binarySearch from 'binary-search';\nimport {asc as sortAsc} from 'num-sort';\n\nimport getPauli from './pauli';\n\nconst smallValue = 1e-2;\n\nexport default function simulate1d(spinSystem, options) {\n    var i, j;\n    const {\n        lineWidth = 1,\n        nbPoints = 1024,\n        maxClusterSize = 10,\n        output = 'y',\n        frequency: frequencyMHz = 400,\n        noiseFactor = 1\n    } = options;\n\n    const from = options.from * frequencyMHz || 0;\n    const to = (options.to || 10) * frequencyMHz;\n\n    const chemicalShifts = spinSystem.chemicalShifts.slice();\n    for (i = 0; i < chemicalShifts.length; i++) {\n        chemicalShifts[i] = chemicalShifts[i] * frequencyMHz;\n    }\n\n    let lineWidthPoints = (nbPoints * lineWidth / Math.abs(to - from)) / 2.355;\n    let lnPoints = lineWidthPoints * 20;\n\n    const gaussianLength = lnPoints | 0;\n    const gaussian = new Array(gaussianLength);\n    const b = lnPoints / 2;\n    const c = lineWidthPoints * lineWidthPoints * 2;\n    for (i = 0; i < gaussianLength; i++) {\n        gaussian[i] = 1e9 * Math.exp(-((i - b) * (i - b)) / c);\n    }\n\n    var result = options.withNoise ? [...new Array(nbPoints)].map(() => Math.random() * noiseFactor) : new Array(nbPoints).fill(0);\n\n    const multiplicity = spinSystem.multiplicity;\n    for (var h = 0; h < spinSystem.clusters.length; h++) {\n        const cluster = spinSystem.clusters[h];\n\n        var clusterFake = new Array(cluster.length);\n        for (i = 0; i < cluster.length; i++) {\n            clusterFake[i] = cluster[i] < 0 ? -cluster[i] - 1 : cluster[i];\n        }\n\n        var weight = 1;\n        var sumI = 0;\n        const frequencies = [];\n        const intensities = [];\n        if (cluster.length > maxClusterSize) {\n            //This is a single spin, but the cluster exceeds the maxClusterSize criteria\n            //we use the simple multiplicity algorithm\n            //Add the central peak. It will be split with every single J coupling.\n            var index = 0;\n            while (cluster[index++] < 0);\n            index = cluster[index - 1];\n            var currentSize, jc;\n            frequencies.push(-chemicalShifts[index]);\n            for (i = 0; i < cluster.length; i++) {\n                if (cluster[i] < 0) {\n                    jc = spinSystem.couplingConstants[index][clusterFake[i]] / 2;\n                    currentSize = frequencies.length;\n                    for (j = 0; j < currentSize; j++) {\n                        frequencies.push(frequencies[j] + jc);\n                        frequencies[j] -= jc;\n                    }\n                }\n            }\n\n            frequencies.sort(sortAsc);\n            sumI = frequencies.length;\n            weight = 1;\n\n            for (i = 0; i < sumI; i++) {\n                intensities.push(1);\n            }\n\n        } else {\n            const hamiltonian = getHamiltonian(\n                chemicalShifts,\n                spinSystem.couplingConstants,\n                multiplicity,\n                spinSystem.connectivity,\n                clusterFake\n            );\n\n            const hamSize = hamiltonian.rows;\n            const evd = new Matrix.DC.EVD(hamiltonian);\n            const V = evd.eigenvectorMatrix;\n            const diagB = evd.realEigenvalues;\n            const assignmentMatrix = new SparseMatrix(hamSize, hamSize);\n            const multLen = cluster.length;\n            weight = 0;\n            for (var n = 0; n < multLen; n++) {\n                const L = getPauli(multiplicity[clusterFake[n]]);\n\n                let temp = 1;\n                for (j = 0; j < n; j++) {\n                    temp *= multiplicity[clusterFake[j]];\n                }\n                const A = SparseMatrix.eye(temp);\n\n                temp = 1;\n                for (j = n + 1; j < multLen; j++) {\n                    temp *= multiplicity[clusterFake[j]];\n                }\n                const B = SparseMatrix.eye(temp);\n                const tempMat = A.kroneckerProduct(L.m).kroneckerProduct(B);\n                if (cluster[n] >= 0) {\n                    assignmentMatrix.add(tempMat.mul(cluster[n] + 1));\n                    weight++;\n                } else {\n                    assignmentMatrix.add(tempMat.mul(cluster[n]));\n                }\n            }\n\n            let rhoip = Matrix.zeros(hamSize, hamSize);\n            assignmentMatrix.forEachNonZero((i, j, v) => {\n                if (v > 0) {\n                    const row = V[j];\n                    for (var k = 0; k < row.length; k++) {\n                        if (row[k] !== 0) {\n                            rhoip.set(i, k, rhoip.get(i, k) + row[k]);\n                        }\n                    }\n                }\n                return v;\n            });\n\n            let rhoip2 = rhoip.clone();\n            assignmentMatrix.forEachNonZero((i, j, v) => {\n                if (v < 0) {\n                    const row = V[j];\n                    for (var k = 0; k < row.length; k++) {\n                        if (row[k] !== 0) {\n                            rhoip2.set(i, k, rhoip2.get(i, k) + row[k]);\n                        }\n                    }\n                }\n                return v;\n            });\n\n            const tV = V.transpose();\n            rhoip = tV.mmul(rhoip);\n            rhoip = new SparseMatrix(rhoip, {threshold: smallValue});\n            triuTimesAbs(rhoip, smallValue);\n            rhoip2 = tV.mmul(rhoip2);\n            rhoip2 = new SparseMatrix(rhoip2, {threshold: smallValue});\n            triuTimesAbs(rhoip2, smallValue);\n\n            rhoip2.forEachNonZero((i, j, v) => {\n                var val = rhoip.get(i, j);\n                val = Math.min(Math.abs(val), Math.abs(v));\n                val *= val;\n\n                sumI += val;\n                var valFreq = diagB[i] - diagB[j];\n                var insertIn = binarySearch(frequencies, valFreq, sortAsc);\n                if (insertIn < 0) {\n                    frequencies.splice(-1 - insertIn, 0, valFreq);\n                    intensities.splice(-1 - insertIn, 0, val);\n                } else {\n                    intensities[insertIn] += val;\n                }\n            });\n        }\n        const numFreq = frequencies.length;\n        if (numFreq > 0) {\n            weight = weight / sumI;\n            const diff = lineWidth / 32;\n            let valFreq = frequencies[0];\n            let inte = intensities[0];\n            let count = 1;\n            for (i = 1; i < numFreq; i++) {\n                if (Math.abs(frequencies[i] - valFreq / count) < diff) {\n                    inte += intensities[i];\n                    valFreq += frequencies[i];\n                    count++;\n                } else {\n                    addPeak(result, valFreq / count, inte * weight, from, to, nbPoints, gaussian);\n                    valFreq = frequencies[i];\n                    inte = intensities[i];\n                    count = 1;\n                }\n            }\n            addPeak(result, valFreq / count, inte * weight, from, to, nbPoints, gaussian);\n        }\n    }\n    if (output === 'xy') {\n        return {x: _getX(options.from, options.to, nbPoints), y: result};\n    }\n    if (output === 'y') {\n        return result;\n    }\n    throw new RangeError('wrong output option');\n}\n\nfunction addPeak(result, freq, height, from, to, nbPoints, gaussian) {\n    const center = (nbPoints * (-freq - from) / (to - from)) | 0;\n    const lnPoints = gaussian.length;\n    var index = 0;\n    var indexLorentz = 0;\n    for (var i = center - lnPoints / 2; i < center + lnPoints / 2; i++) {\n        index = i | 0;\n        if (i >= 0 && i < nbPoints) {\n            result[index] = result[index] + gaussian[indexLorentz] * height;\n        }\n        indexLorentz++;\n    }\n}\n\nfunction triuTimesAbs(A, val) {\n    A.forEachNonZero((i, j, v) => {\n        if (i > j) return 0;\n        if (Math.abs(v) <= val) return 0;\n        return v;\n    });\n}\n\nfunction getHamiltonian(chemicalShifts, couplingConstants, multiplicity, conMatrix, cluster) {\n    let hamSize = 1;\n    for (var i = 0; i < cluster.length; i++) {\n        hamSize *= multiplicity[cluster[i]];\n    }\n\n    const clusterHam = new SparseMatrix(hamSize, hamSize);\n\n    for (var pos = 0; pos < cluster.length; pos++) {\n        var n = cluster[pos];\n\n        const L = getPauli(multiplicity[n]);\n\n        let A1, B1;\n        let temp = 1;\n        for (let i = 0; i < pos; i++) {\n            temp *= multiplicity[cluster[i]];\n        }\n        A1 = SparseMatrix.eye(temp);\n\n        temp = 1;\n        for (let i = pos + 1; i < cluster.length; i++) {\n            temp *= multiplicity[cluster[i]];\n        }\n        B1 = SparseMatrix.eye(temp);\n\n        const alpha = chemicalShifts[n];\n        const kronProd = A1.kroneckerProduct(L.z).kroneckerProduct(B1);\n        clusterHam.add(kronProd.mul(alpha));\n\n        for (var pos2 = 0; pos2 < cluster.length; pos2++) {\n            const k = cluster[pos2];\n            if (conMatrix[n][k] === 1) {\n                const S = getPauli(multiplicity[k]);\n\n                let A2, B2;\n                let temp = 1;\n                for (let i = 0; i < pos2; i++) {\n                    temp *= multiplicity[cluster[i]];\n                }\n                A2 = SparseMatrix.eye(temp);\n\n                temp = 1;\n                for (let i = pos2 + 1; i < cluster.length; i++) {\n                    temp *= multiplicity[cluster[i]];\n                }\n                B2 = SparseMatrix.eye(temp);\n\n                const kron1 = A1.kroneckerProduct(L.x).kroneckerProduct(B1).mmul(A2.kroneckerProduct(S.x).kroneckerProduct(B2));\n                kron1.add(A1.kroneckerProduct(L.y).kroneckerProduct(B1).mul(-1).mmul(A2.kroneckerProduct(S.y).kroneckerProduct(B2)));\n                kron1.add(A1.kroneckerProduct(L.z).kroneckerProduct(B1).mmul(A2.kroneckerProduct(S.z).kroneckerProduct(B2)));\n\n                clusterHam.add(kron1.mul(couplingConstants[n][k] / 2));\n            }\n        }\n    }\n\n    return clusterHam;\n}\n\nfunction _getX(from, to, nbPoints) {\n    const x = new Array(nbPoints);\n    const dx = (to - from) / (nbPoints - 1);\n    for (var i = 0; i < nbPoints; i++) {\n        x[i] = from + i * dx;\n    }\n    return x;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/nmr-simulation/src/simulate1D.js","'use strict';\n\nconst newArray = require('new-array');\n\nconst primeFinder = require('./primeFinder');\nconst nextPrime = primeFinder.nextPrime;\nconst largestPrime = primeFinder.largestPrime;\n\nconst FREE = 0;\nconst FULL = 1;\nconst REMOVED = 2;\n\nconst defaultInitialCapacity = 150;\nconst defaultMinLoadFactor = 1 / 6;\nconst defaultMaxLoadFactor = 2 / 3;\n\nclass HashTable {\n    constructor(options = {}) {\n        if (options instanceof HashTable) {\n            this.table = options.table.slice();\n            this.values = options.values.slice();\n            this.state = options.state.slice();\n            this.minLoadFactor = options.minLoadFactor;\n            this.maxLoadFactor = options.maxLoadFactor;\n            this.distinct = options.distinct;\n            this.freeEntries = options.freeEntries;\n            this.lowWaterMark = options.lowWaterMark;\n            this.highWaterMark = options.maxLoadFactor;\n            return;\n        }\n\n        const initialCapacity = options.initialCapacity === undefined ? defaultInitialCapacity : options.initialCapacity;\n        if (initialCapacity < 0) {\n            throw new RangeError(`initial capacity must not be less than zero: ${initialCapacity}`);\n        }\n\n        const minLoadFactor = options.minLoadFactor === undefined ? defaultMinLoadFactor : options.minLoadFactor;\n        const maxLoadFactor = options.maxLoadFactor === undefined ? defaultMaxLoadFactor : options.maxLoadFactor;\n        if (minLoadFactor < 0 || minLoadFactor >= 1) {\n            throw new RangeError(`invalid minLoadFactor: ${minLoadFactor}`);\n        }\n        if (maxLoadFactor <= 0 || maxLoadFactor >= 1) {\n            throw new RangeError(`invalid maxLoadFactor: ${maxLoadFactor}`);\n        }\n        if (minLoadFactor >= maxLoadFactor) {\n            throw new RangeError(`minLoadFactor (${minLoadFactor}) must be smaller than maxLoadFactor (${maxLoadFactor})`);\n        }\n\n        let capacity = initialCapacity;\n        // User wants to put at least capacity elements. We need to choose the size based on the maxLoadFactor to\n        // avoid the need to rehash before this capacity is reached.\n        // actualCapacity * maxLoadFactor >= capacity\n        capacity = (capacity / maxLoadFactor) | 0;\n        capacity = nextPrime(capacity);\n        if (capacity === 0) capacity = 1;\n\n        this.table = newArray(capacity, 0);\n        this.values = newArray(capacity, 0);\n        this.state = newArray(capacity, 0);\n\n        this.minLoadFactor = minLoadFactor;\n        if (capacity === largestPrime) {\n            this.maxLoadFactor = 1;\n        } else {\n            this.maxLoadFactor = maxLoadFactor;\n        }\n\n        this.distinct = 0;\n        this.freeEntries = capacity;\n\n        this.lowWaterMark = 0;\n        this.highWaterMark = chooseHighWaterMark(capacity, this.maxLoadFactor);\n    }\n\n    clone() {\n        return new HashTable(this);\n    }\n\n    get size() {\n        return this.distinct;\n    }\n\n    get(key) {\n        const i = this.indexOfKey(key);\n        if (i < 0) return 0;\n        return this.values[i];\n    }\n\n    set(key, value) {\n        let i = this.indexOfInsertion(key);\n        if (i < 0) {\n            i = -i - 1;\n            this.values[i] = value;\n            return false;\n        }\n\n        if (this.distinct > this.highWaterMark) {\n            const newCapacity = chooseGrowCapacity(this.distinct + 1, this.minLoadFactor, this.maxLoadFactor);\n            this.rehash(newCapacity);\n            return this.set(key, value);\n        }\n\n        this.table[i] = key;\n        this.values[i] = value;\n        if (this.state[i] === FREE) this.freeEntries--;\n        this.state[i] = FULL;\n        this.distinct++;\n\n        if (this.freeEntries < 1) {\n            const newCapacity = chooseGrowCapacity(this.distinct + 1, this.minLoadFactor, this.maxLoadFactor);\n            this.rehash(newCapacity);\n        }\n\n        return true;\n    }\n    \n    remove(key, noRehash) {\n        const i = this.indexOfKey(key);\n        if (i < 0) return false;\n\n        this.state[i] = REMOVED;\n        this.distinct--;\n\n        if (!noRehash) this.maybeShrinkCapacity();\n\n        return true;\n    }\n\n    delete(key, noRehash) {\n        const i = this.indexOfKey(key);\n        if (i < 0) return false;\n\n        this.state[i] = FREE;\n        this.distinct--;\n\n        if (!noRehash) this.maybeShrinkCapacity();\n\n        return true;\n    }\n\n    maybeShrinkCapacity() {\n        if (this.distinct < this.lowWaterMark) {\n            const newCapacity = chooseShrinkCapacity(this.distinct, this.minLoadFactor, this.maxLoadFactor);\n            this.rehash(newCapacity);\n        }\n    }\n\n    containsKey(key) {\n        return this.indexOfKey(key) >= 0;\n    }\n\n    indexOfKey(key) {\n        const table = this.table;\n        const state = this.state;\n        const length = this.table.length;\n\n        const hash = key & 0x7fffffff;\n        let i = hash % length;\n        let decrement = hash % (length - 2);\n        if (decrement === 0) decrement = 1;\n\n        while (state[i] !== FREE && (state[i] === REMOVED || table[i] !== key)) {\n            i -= decrement;\n            if (i < 0) i += length;\n        }\n\n        if (state[i] === FREE) return -1;\n        return i;\n    }\n\n    containsValue(value) {\n        return this.indexOfValue(value) >= 0;\n    }\n\n    indexOfValue(value) {\n        const values = this.values;\n        const state = this.state;\n\n        for (var i = 0; i < state.length; i++) {\n            if (state[i] === FULL && values[i] === value) {\n                return i;\n            }\n        }\n\n        return -1;\n    }\n\n    indexOfInsertion(key) {\n        const table = this.table;\n        const state = this.state;\n        const length = table.length;\n\n\n        const hash = key & 0x7fffffff;\n        let i = hash % length;\n        let decrement = hash % (length - 2);\n        if (decrement === 0) decrement = 1;\n\n        while (state[i] === FULL && table[i] !== key) {\n            i -= decrement;\n            if (i < 0) i += length;\n        }\n\n        if (state[i] === REMOVED) {\n            const j = i;\n            while (state[i] !== FREE && (state[i] === REMOVED || table[i] !== key)) {\n                i -= decrement;\n                if (i < 0) i += length;\n            }\n            if (state[i] === FREE) i = j;\n        }\n\n        if (state[i] === FULL) {\n            return -i - 1;\n        }\n\n        return i;\n    }\n\n    ensureCapacity(minCapacity) {\n        if (this.table.length < minCapacity) {\n            const newCapacity = nextPrime(minCapacity);\n            this.rehash(newCapacity);\n        }\n    }\n\n    rehash(newCapacity) {\n        const oldCapacity = this.table.length;\n\n        if (newCapacity <= this.distinct) throw new Error('Unexpected');\n\n        const oldTable = this.table;\n        const oldValues = this.values;\n        const oldState = this.state;\n\n        const newTable = newArray(newCapacity, 0);\n        const newValues = newArray(newCapacity, 0);\n        const newState = newArray(newCapacity, 0);\n\n        this.lowWaterMark = chooseLowWaterMark(newCapacity, this.minLoadFactor);\n        this.highWaterMark = chooseHighWaterMark(newCapacity, this.maxLoadFactor);\n\n        this.table = newTable;\n        this.values = newValues;\n        this.state = newState;\n        this.freeEntries = newCapacity - this.distinct;\n\n        for (var i = 0; i < oldCapacity; i++) {\n            if (oldState[i] === FULL) {\n                var element = oldTable[i];\n                var index = this.indexOfInsertion(element);\n                newTable[index] = element;\n                newValues[index] = oldValues[i];\n                newState[index] = FULL;\n            }\n        }\n    }\n\n    forEachKey(callback) {\n        for (var i = 0; i < this.state.length; i++) {\n            if (this.state[i] === FULL) {\n                if (!callback(this.table[i])) return false;\n            }\n        }\n        return true;\n    }\n\n    forEachValue(callback) {\n        for (var i = 0; i < this.state.length; i++) {\n            if (this.state[i] === FULL) {\n                if (!callback(this.values[i])) return false;\n            }\n        }\n        return true;\n    }\n\n    forEachPair(callback) {\n        for (var i = 0; i < this.state.length; i++) {\n            if (this.state[i] === FULL) {\n                if (!callback(this.table[i], this.values[i])) return false;\n            }\n        }\n        return true;\n    }\n}\n\nmodule.exports = HashTable;\n\nfunction chooseLowWaterMark(capacity, minLoad) {\n    return (capacity * minLoad) | 0;\n}\n\nfunction chooseHighWaterMark(capacity, maxLoad) {\n    return Math.min(capacity - 2, (capacity * maxLoad) | 0);\n}\n\nfunction chooseGrowCapacity(size, minLoad, maxLoad) {\n    return nextPrime(Math.max(size + 1, (4 * size / (3 * minLoad + maxLoad)) | 0));\n}\n\nfunction chooseShrinkCapacity(size, minLoad, maxLoad) {\n    return nextPrime(Math.max(size + 1, (4 * size / (minLoad + 3 * maxLoad)) | 0));\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-hash-table/src/HashTable.js","const binarySearch = require('binary-search');\nconst sortAsc = require('num-sort').asc;\n\nconst largestPrime = 0x7fffffff;\n\nconst primeNumbers = [\n    //chunk #0\n    largestPrime, // 2^31-1\n\n    //chunk #1\n    5, 11, 23, 47, 97, 197, 397, 797, 1597, 3203, 6421, 12853, 25717, 51437, 102877, 205759,\n    411527, 823117, 1646237, 3292489, 6584983, 13169977, 26339969, 52679969, 105359939,\n    210719881, 421439783, 842879579, 1685759167,\n\n    //chunk #2\n    433, 877, 1759, 3527, 7057, 14143, 28289, 56591, 113189, 226379, 452759, 905551, 1811107,\n    3622219, 7244441, 14488931, 28977863, 57955739, 115911563, 231823147, 463646329, 927292699,\n    1854585413,\n\n    //chunk #3\n    953, 1907, 3821, 7643, 15287, 30577, 61169, 122347, 244703, 489407, 978821, 1957651, 3915341,\n    7830701, 15661423, 31322867, 62645741, 125291483, 250582987, 501165979, 1002331963,\n    2004663929,\n\n    //chunk #4\n    1039, 2081, 4177, 8363, 16729, 33461, 66923, 133853, 267713, 535481, 1070981, 2141977, 4283963,\n    8567929, 17135863, 34271747, 68543509, 137087021, 274174111, 548348231, 1096696463,\n\n    //chunk #5\n    31, 67, 137, 277, 557, 1117, 2237, 4481, 8963, 17929, 35863, 71741, 143483, 286973, 573953,\n    1147921, 2295859, 4591721, 9183457, 18366923, 36733847, 73467739, 146935499, 293871013,\n    587742049, 1175484103,\n\n    //chunk #6\n    599, 1201, 2411, 4831, 9677, 19373, 38747, 77509, 155027, 310081, 620171, 1240361, 2480729,\n    4961459, 9922933, 19845871, 39691759, 79383533, 158767069, 317534141, 635068283, 1270136683,\n\n    //chunk #7\n    311, 631, 1277, 2557, 5119, 10243, 20507, 41017, 82037, 164089, 328213, 656429, 1312867,\n    2625761, 5251529, 10503061, 21006137, 42012281, 84024581, 168049163, 336098327, 672196673,\n    1344393353,\n\n    //chunk #8\n    3, 7, 17, 37, 79, 163, 331, 673, 1361, 2729, 5471, 10949, 21911, 43853, 87719, 175447, 350899,\n    701819, 1403641, 2807303, 5614657, 11229331, 22458671, 44917381, 89834777, 179669557,\n    359339171, 718678369, 1437356741,\n\n    //chunk #9\n    43, 89, 179, 359, 719, 1439, 2879, 5779, 11579, 23159, 46327, 92657, 185323, 370661, 741337,\n    1482707, 2965421, 5930887, 11861791, 23723597, 47447201, 94894427, 189788857, 379577741,\n    759155483, 1518310967,\n\n    //chunk #10\n    379, 761, 1523, 3049, 6101, 12203, 24407, 48817, 97649, 195311, 390647, 781301, 1562611,\n    3125257, 6250537, 12501169, 25002389, 50004791, 100009607, 200019221, 400038451, 800076929,\n    1600153859,\n\n    //chunk #11\n    13, 29, 59, 127, 257, 521, 1049, 2099, 4201, 8419, 16843, 33703, 67409, 134837, 269683,\n    539389, 1078787, 2157587, 4315183, 8630387, 17260781, 34521589, 69043189, 138086407,\n    276172823, 552345671, 1104691373,\n\n    //chunk #12\n    19, 41, 83, 167, 337, 677,\n    1361, 2729, 5471, 10949, 21911, 43853, 87719, 175447, 350899,\n    701819, 1403641, 2807303, 5614657, 11229331, 22458671, 44917381, 89834777, 179669557,\n    359339171, 718678369, 1437356741,\n\n    //chunk #13\n    53, 107, 223, 449, 907, 1823, 3659, 7321, 14653, 29311, 58631, 117269,\n    234539, 469099, 938207, 1876417, 3752839, 7505681, 15011389, 30022781,\n    60045577, 120091177, 240182359, 480364727, 960729461, 1921458943\n];\n\nprimeNumbers.sort(sortAsc);\n\nfunction nextPrime(value) {\n    let index = binarySearch(primeNumbers, value, sortAsc);\n    if (index < 0) {\n        index = ~index;\n    }\n    return primeNumbers[index];\n}\n\nexports.nextPrime = nextPrime;\nexports.largestPrime = largestPrime;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-hash-table/src/primeFinder.js","'use strict';\nmodule.exports = Number.isNaN || function (x) {\n\treturn x !== x;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/number-is-nan/index.js","import SparseMatrix from 'ml-sparse-matrix';\n\nfunction createPauli(mult) {\n    const spin = (mult - 1) / 2;\n    const prjs = new Array(mult);\n    const temp = new Array(mult);\n    for (var i = 0; i < mult; i++) {\n        prjs[i] = (mult - 1) - i - spin;\n        temp[i] = Math.sqrt(spin * (spin + 1) - prjs[i] * (prjs[i] + 1));\n    }\n    const p = diag(temp, 1, mult, mult);\n    for (i = 0; i < mult; i++) {\n        temp[i] = Math.sqrt(spin * (spin + 1) - prjs[i] * (prjs[i] - 1));\n    }\n    const m = diag(temp, -1, mult, mult);\n    const x = p.clone().add(m).mul(0.5);\n    const y = m.clone().mul(-1).add(p).mul(-0.5);\n    const z = diag(prjs, 0, mult, mult);\n    return {x, y, z, m, p};\n}\n\nfunction diag(A, d, n, m) {\n    const diag = new SparseMatrix(n, m, {initialCapacity: 20});\n    for (var i = 0; i < A.length; i++) {\n        if ((i - d) >= 0 && (i - d) < n && i < m) {\n            diag.set(i - d, i, A[i]);\n        }\n    }\n    return diag;\n}\n\nconst pauli2 = createPauli(2);\n\nexport default function getPauli(mult) {\n    if (mult === 2) return pauli2;\n    else return createPauli(mult);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/nmr-simulation/src/pauli.js","import Matrix from 'ml-matrix';\n\nlet defOptions = {\n    H: {frequency: 400, lineWidth: 10},\n    C: {frequency: 100, lineWidth: 10}\n};\n\nexport default function simule2DNmrSpectrum(table, options) {\n    var i;\n    const fromLabel = table[0].fromAtomLabel;\n    const toLabel = table[0].toLabel;\n    const frequencyX = options.frequencyX || defOptions[fromLabel].frequency;\n    const frequencyY = options.frequencyY || defOptions[toLabel].frequency;\n    var lineWidthX = options.lineWidthX || defOptions[fromLabel].lineWidth;\n    var lineWidthY = options.lineWidthY || defOptions[toLabel].lineWidth;\n\n    var sigmaX = lineWidthX / frequencyX;\n    var sigmaY = lineWidthY / frequencyY;\n\n    var minX = table[0].fromChemicalShift;\n    var maxX = table[0].fromChemicalShift;\n    var minY = table[0].toChemicalShift;\n    var maxY = table[0].toChemicalShift;\n    i = 1;\n    while (i < table.length) {\n        minX = Math.min(minX, table[i].fromChemicalShift);\n        maxX = Math.max(maxX, table[i].fromChemicalShift);\n        minY = Math.min(minY, table[i].toChemicalShift);\n        maxY = Math.max(maxY, table[i].toChemicalShift);\n        i++;\n    }\n\n    if (options.firstX !== null && !isNaN(options.firstX)) {\n        minX = options.firstX;\n    }\n    if (options.firstY !== null && !isNaN(options.firstY)) {\n        minY = options.firstY;\n    }\n    if (options.lastX !== null && !isNaN(options.lastX)) {\n        maxX = options.lastX;\n    }\n    if (options.lastY !== null && !isNaN(options.lastY)) {\n        maxY = options.lastY;\n    }\n\n    var nbPointsX = options.nbPointsX || 512;\n    var nbPointsY = options.nbPointsY || 512;\n\n    var spectraMatrix = new Matrix(nbPointsY, nbPointsX).fill(0);\n    i = 0;\n    while (i < table.length) {\n        //parameters.couplingConstant = table[i].j;\n        //parameters.pathLength = table[i].pathLength;\n        let peak = {\n            x: unitsToArrayPoints(table[i].fromChemicalShift, minX, maxX, nbPointsX),\n            y: unitsToArrayPoints(table[i].toChemicalShift, minY, maxY, nbPointsY),\n            z: table[i].fromAtoms.length + table[i].toAtoms.length,\n            widthX: unitsToArrayPoints(sigmaX + minX, minX, maxX, nbPointsX),\n            widthY: unitsToArrayPoints(sigmaY + minY, minY, maxY, nbPointsY)\n        };\n        addPeak(spectraMatrix, peak);\n        i++;\n    }\n    return spectraMatrix;\n}\n\nfunction unitsToArrayPoints(x, from, to, nbPoints) {\n    return ((x - from) * nbPoints - 1) / (to - from);\n}\n\nfunction addPeak(matrix, peak) {\n    var nSigma = 4;\n    var fromX = Math.max(0, Math.round(peak.x - peak.widthX * nSigma));\n    var toX = Math.min(matrix[0].length - 1, Math.round(peak.x + peak.widthX * nSigma));\n    var fromY = Math.max(0, Math.round(peak.y - peak.widthY * nSigma));\n    var toY = Math.min(matrix.length - 1, Math.round(peak.y + peak.widthY * nSigma));\n\n    var squareSigmaX = peak.widthX * peak.widthX;\n    var squareSigmaY = peak.widthY * peak.widthY;\n    for (var j = fromY; j < toY; j++) {\n        for (var i = fromX; i < toX; i++) {\n            var exponent = Math.pow(peak.x - i, 2) / squareSigmaX +\n                Math.pow(peak.y - j, 2) / squareSigmaY;\n            var result = 10000 * peak.z * Math.exp(-exponent);\n            matrix[j][i] += result;\n        }\n    }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/nmr-simulation/src/simulate2D.js","import SD from './SD';\nimport peakPicking2D from './peakPicking/peakPicking2D';\nimport PeakOptimizer from './peakPicking/peakOptimizer';\nimport Brukerconverter from 'brukerconverter';\nimport Filters from './filters/Filters.js';\nimport min from 'ml-array-min';\nimport max from 'ml-array-max';\nimport {simulate2D as simule2DNmrSpectrum} from 'nmr-simulation';\n\nexport default class NMR2D extends SD {\n\n    constructor(sd) {\n        super(sd);\n    }\n\n    /**\n     * This function creates a SD instance from the given 2D prediction\n     * @param {Array} prediction\n     * @param {object} options\n     * @return {SD}\n     */\n    static fromPrediction(prediction, options) {\n        var data = simule2DNmrSpectrum(prediction, options);\n        var spectrum = NMR2D.fromMatrix(data, options);\n        var jcamp = spectrum.toJcamp({type: 'NTUPLES'});\n        return NMR2D.fromJcamp(jcamp);\n    }\n\n    /**\n     * This function return a NMR instance from Array of folders or zip file with folders\n     * @param {Array} brukerFile - spectra data in two possible input\n     * @param {object} options - the options dependent on brukerFile input, but some parameter are permanents like:\n     * @option {boolean} xy - The spectraData should not be a oneD array but an object with x and y\n     * @option {boolean} keepSpectra - keep the spectra in 2D NMR instance\n     * @option {boolean} noContours - option to generate not generate countour plot for 2Dnmr spectra\n     * @option {string} keepRecordsRegExp - regular expressions to parse data\n     * @return {*}\n     */\n    static fromBruker(brukerFile, options) {\n        options = Object.assign({}, {xy: true, keepSpectra: true, keepRecordsRegExp: /^.+$/}, options);\n        var brukerSpectra = null;\n        if (Array.isArray(brukerFile)) {\n            //It is a folder\n            brukerSpectra = Brukerconverter.converFolder(brukerFile, options);\n        } else {\n            //It is a zip\n            brukerSpectra = Brukerconverter.convertZip(brukerFile, options);\n        }\n        if (brukerSpectra) {\n            return brukerSpectra.map(function (spectrum) {\n                return new NMR2D(spectrum);\n            });\n        }\n        return null;\n    }\n\n    /**\n     * This function creates a 2D spectrum from a matrix containing the independent values of the spectrum and a set\n     * of options...\n     * @param {Array} data\n     * @param {object} options\n     * @return {*}\n     */\n    static fromMatrix(data, options) {\n        var result = {};\n        result.profiling = [];\n        result.logs = [];\n        var spectra = [];\n        let nbPoints = data[0].length;\n        result.spectra = spectra;\n        result.info = {};\n        let firstY = options.firstY || 0;\n        let lastY = options.lastY || data.length - 1;\n        let deltaY = (lastY - firstY) / (data.length - 1);\n\n        let firstX = options.firstX || 0;\n        let lastX = options.lastX || nbPoints - 1;\n        let deltaX = (lastY - firstY) / (nbPoints - 1);\n        let x = options.x;\n        if (!x) {\n            x = new Array(nbPoints);\n            for (let i = 0; i < nbPoints; i++) {\n                x[i] = firstX + deltaX * i;\n            }\n        }\n\n        let observeFrequency = options.frequencyX || 400;\n        let minZ = Number.MAX_SAFE_INTEGER;\n        let maxZ = Number.MIN_SAFE_INTEGER;\n\n        data.forEach((y, index) => {\n            var spectrum = {};\n            spectrum.isXYdata = true;\n            spectrum.nbPoints = nbPoints;\n            spectrum.firstX = firstX;\n            spectrum.firstY = y[0];\n            spectrum.lastX = lastX;\n            spectrum.lastY = y[spectrum.nbPoints - 1];\n            spectrum.xFactor = 1;\n            spectrum.yFactor = 1;\n            spectrum.deltaX = (spectrum.lastX - spectrum.firstX) / (spectrum.nbPoints - 1);\n            spectrum.title = options.title || 'spectra-data from matrix';\n            spectrum.dataType = options.dataType || 'nD NMR SPECTRUM';\n            spectrum.observeFrequency = observeFrequency;\n            spectrum.data = [{x: x, y: y}];\n            spectrum.page = firstY + index * deltaY;\n            result.xType = options.xType || options.nucleusX || '1H';\n            spectra.push(spectrum);\n\n            // let minMax = StatArray.minMax(y);\n\n            minZ = Math.min(minZ, min(y));\n            maxZ = Math.max(maxZ, max(y));\n\n        });\n\n        result.ntuples = [{units: options.xUnit || 'PPM'}, {units: options.yUnit || 'PPM'}, {units: options.zUnit || 'Intensity'}];\n        result.info['2D_Y_FREQUENCY'] = options.frequencyY || 400;\n        result.info['2D_X_FREQUENCY'] = options.frequencyX || 400;\n        result.info.observefrequency = result.info['2D_X_FREQUENCY'];\n        result.info.$BF1 = result.info.observefrequency;\n        result.info['.SOLVENTNAME'] = options.solvent || 'none';\n        // eslint-disable-next-line camelcase\n        result.info.$SW_h = Math.abs(lastX - firstX) * observeFrequency;\n        result.info.$SW = Math.abs(lastX - firstX);\n        result.info.$TD = nbPoints;\n        result.info.firstY = firstY;\n        result.info.lastY = lastY;\n        result.minMax = {\n            minY: firstY,\n            maxY: lastY,\n            minX: firstX,\n            maxX: lastX,\n            minZ: minZ,\n            maxZ: maxZ\n        };\n\n        result.yType = options.yType || options.nucleusY || '1H';\n        result.twoD = true;\n        return new NMR2D(result);\n    }\n    /**\n     * Return true if the it is an homo-nuclear experiment\n     * @return {boolean}\n     */\n    isHomoNuclear() {\n        return this.sd.xType === this.sd.yType;\n    }\n\n    /**\n     * Return the observe frequency in the direct dimension\n     * @return {number}\n     */\n    observeFrequencyX() {\n        return this.sd.spectra[0].observeFrequency;\n    }\n    /**\n     * Return the observe frequency in the indirect dimension\n     * @return {number}\n     */\n    observeFrequencyY() {\n        return this.sd.indirectFrequency;\n    }\n\n    /**\n     * Return the solvent name.\n     * @return {string|XML}\n     */\n    getSolventName() {\n        return (this.sd.info['.SOLVENTNAME'] || this.sd.info.$SOLVENT).replace('<', '').replace('>', '');\n    }\n\n    /**\n     * This function Return the units of the direct dimension. It overrides the SD getXUnits function\n     * @return {ntuples.units|*|b.units}\n     */\n    getXUnits() {\n        return this.sd.ntuples[1].units;\n    }\n    /**\n     * This function Return the units of the indirect dimension. It overrides the SD getYUnits function\n     * @return {ntuples.units|*|b.units}\n     */\n    getYUnits() {\n        return this.sd.ntuples[0].units;\n    }\n    /**\n     * Return the units of the dependent variable\n     * @return {ntuples.units|*|b.units}\n     */\n    getZUnits() {\n        return this.sd.ntuples[2].units;\n    }\n    /**\n     * Return the min value in the indirect dimension.\n     * @return {sd.minMax.maxY}\n     */\n    getLastY() {\n        return this.sd.minMax.maxY;\n    }\n\n\n    /**\n     * Return the min value in the indirect dimension.\n     * @return {sd.minMax.minY}\n     */\n    getFirstY() {\n        return this.sd.minMax.minY;\n    }\n    /**\n     * Return the separation between 2 consecutive points in the indirect domain\n     * @return {number}\n     */\n    getDeltaY() {\n        return (this.getLastY() - this.getFirstY()) / (this.getNbSubSpectra() - 1);\n    }\n\n    /**\n     * Return the minimum value of the independent variable\n     * @return {number}\n     */\n    getMinZ() {\n        return this.sd.minMax.minZ;\n    }\n\n    /**\n     * Return the maximum value of the independent variable\n     * @return {number}\n     */\n    getMaxZ() {\n        return this.sd.minMax.maxZ;\n    }\n\n    /**\n     * This function process the given spectraData and tries to determine the NMR signals.\n     * Return an NMRSignal2D array containing all the detected 2D-NMR Signals\n     * @param\t{object} options - Object containing the options.\n     * @option\t{number} thresholdFactor - A factor to scale the automatically determined noise threshold.\n     * @return  {*}\tset of NMRSignal2D.\n     */\n    getZones(options) {\n        options = options || {};\n        if (!options.thresholdFactor) {\n            options.thresholdFactor = 1;\n        }\n        var id = Math.round(Math.random() * 255);\n        if (options.idPrefix) {\n            id = options.idPrefix;\n        }\n        var peakList = peakPicking2D(this, options.thresholdFactor);\n\n        //lets add an unique ID for each peak.\n        for (var i = 0; i < peakList.length; i++) {\n            peakList[i]._highlight = [id + '_' + i];\n            peakList[i].signalID = id + '_' + i;\n        }\n        if (options.references) {\n            PeakOptimizer.alignDimensions(peakList, options.references);\n        }\n\n        if (options.format === 'new') {\n            var zones = new Array(peakList.length);\n            for (var k = peakList.length - 1; k >= 0; k--) {\n                var signal = peakList[k];\n                zones[k] = {\n                    fromTo: signal.fromTo,\n                    integral: signal.intensity || 1,\n                    remark: '',\n                    signal: [{\n                        peak: signal.peaks,\n                        delta: [signal.shiftX, signal.shiftY]\n                    }],\n                    _highlight: signal._highlight,\n                    signalID: signal.signalID,\n                };\n            }\n            peakList = zones;\n        }\n\n        this.zones = peakList;\n\n        return this.zones;\n    }\n\n    /**\n     * Return the noise factor depending on the nucleus.\n     * @param {string} nucleus\n     * @return {number}\n     */\n    getNMRPeakThreshold(nucleus) {\n        if (nucleus === '1H') {\n            return 3.0;\n        }\n        if (nucleus === '13C') {\n            return 5.0;\n        }\n        return 1.0;\n    }\n\n    /**\n     * Return the observed nucleus in the specified dimension\n     * @param {number} dim\n     * @return {string}\n     */\n    getNucleus(dim) {\n        if (dim === 1) {\n            return this.sd.xType;\n        }\n        if (dim === 2) {\n            return this.sd.yType;\n        }\n        return this.sd.xType;\n    }\n\n\n    /**\n     * This function increase the size of the spectrum, filling the new positions with zero values. Doing it one\n     * could increase artificially the spectral resolution.\n     * @param {number} nPointsX Number of new zero points in the direct dimension\n     * @param {number} nPointsY Number of new zero points in the indirect dimension\n     * @return {NMR2D} this object\n     */\n    zeroFilling(nPointsX, nPointsY) {\n        return Filters.zeroFilling(this, nPointsX, nPointsY);\n    }\n\n    /**\n     * This filter applies a circular shift(phase 1 correction in the time domain) to an NMR FID spectrum that\n     * have been obtained on spectrometers using the Bruker digital filters. The amount of shift depends on the\n     * parameters DECIM and DSPFVS. This spectraData have to be of type NMR_FID\n     * @return {NMR2D} this object\n     */\n    brukerFilter() {\n        return Filters.digitalFilter(this, {brukerFilter: true});\n    }\n\n    /**\n     * This filter applies a circular shift(phase 1 correction in the time domain) to an NMR FID spectrum that\n     * have been obtained on spectrometers using the Bruker digital filters. The amount of shift depends on the\n     * parameters DECIM and DSPFVS. This spectraData have to be of type NMR_FID\n     * @param {object} options - some options are availables:\n     * @option nbPoints: The number of points to shift. Positive values will shift the values to the rigth\n     * and negative values will do to the left.\n     * @option brukerSpectra\n     * @return {NMR2D} this object\n     */\n    digitalFilter(options) {\n        return Filters.digitalFilter(this, options);\n    }\n\n\n    /**\n     * Fourier transforms the given spectraData (Note. no 2D handling yet) this spectraData have to be of type NMR_FID or 2DNMR_FID\n     * @return {NMR2D} this object\n     */\n    fourierTransform() {\n        return Filters.fourierTransform(this);\n    }\n\n    /**\n     * This filter makes an phase 1 correction that corrects the problem of the spectra that has been obtained\n     * on spectrometers using the Bruker digital filters. This method is used in cases when the BrukerSpectra\n     * filter could not find the correct number of points to perform a circular shift.\n     * The actual problem is that not all of the spectra has the necessary parameters for use only one method for\n     * correcting the problem of the Bruker digital filters.\n     * @param {number} ph1corr - Phase 1 correction value in radians.\n     * @return {NMR2D} this object\n     */\n    postFourierTransform(ph1corr) {\n        return Filters.phaseCorrection(0, ph1corr);\n    }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/spectra-data/src/NMR2D.js","import PeakOptimizer from './peakOptimizer';\nimport simpleClustering from 'ml-simple-clustering';\nimport matrixPeakFinders from 'ml-matrix-peaks-finder';\nimport {FFTUtils} from 'ml-fft';\n\nconst smallFilter = [\n    [0, 0, 1, 2, 2, 2, 1, 0, 0],\n    [0, 1, 4, 7, 7, 7, 4, 1, 0],\n    [1, 4, 5, 3, 0, 3, 5, 4, 1],\n    [2, 7, 3, -12, -23, -12, 3, 7, 2],\n    [2, 7, 0, -23, -40, -23, 0, 7, 2],\n    [2, 7, 3, -12, -23, -12, 3, 7, 2],\n    [1, 4, 5, 3, 0, 3, 5, 4, 1],\n    [0, 1, 3, 7, 7, 7, 3, 1, 0],\n    [0, 0, 1, 2, 2, 2, 1, 0, 0]];\n\nexport default function getZones(spectraData, thresholdFactor) {\n    if (thresholdFactor === 0) {\n        thresholdFactor = 1;\n    }\n    if (thresholdFactor < 0) {\n        thresholdFactor = -thresholdFactor;\n    }\n    var nbPoints = spectraData.getNbPoints();\n    var nbSubSpectra = spectraData.getNbSubSpectra();\n\n    var data = new Array(nbPoints * nbSubSpectra);\n    var isHomonuclear = spectraData.isHomoNuclear();\n\n    for (var iSubSpectra = 0; iSubSpectra < nbSubSpectra; iSubSpectra++) {\n        var spectrum = spectraData.getYData(iSubSpectra);\n        for (var iCol = 0; iCol < nbPoints; iCol++) {\n            if (isHomonuclear) {\n                data[iSubSpectra * nbPoints + iCol] = (spectrum[iCol] > 0 ? spectrum[iCol] : 0);\n            } else {\n                data[iSubSpectra * nbPoints + iCol] = Math.abs(spectrum[iCol]);\n            }\n        }\n    }\n\n    var nStdDev = getLoGnStdDevNMR(spectraData);\n    if (isHomonuclear) {\n        let convolutedSpectrum = FFTUtils.convolute(data, smallFilter, nbSubSpectra, nbPoints);\n        let peaksMC1 = matrixPeakFinders.findPeaks2DRegion(data, {filteredData: convolutedSpectrum, rows: nbSubSpectra, cols: nbPoints, nStdDev: nStdDev * thresholdFactor});//)1.5);\n        var peaksMax1 = matrixPeakFinders.findPeaks2DMax(data, {filteredData: convolutedSpectrum, rows: nbSubSpectra, cols: nbPoints, nStdDev: (nStdDev + 0.5) * thresholdFactor});//2.0);\n        for (var i = 0; i < peaksMC1.length; i++) {\n            peaksMax1.push(peaksMC1[i]);\n        }\n        return PeakOptimizer.enhanceSymmetry(createSignals2D(peaksMax1, spectraData, 24));\n\n    } else {\n        let convolutedSpectrum = FFTUtils.convolute(data, smallFilter, nbSubSpectra, nbPoints);\n        let peaksMC1 = matrixPeakFinders.findPeaks2DRegion(data, {filteredData: convolutedSpectrum, rows: nbSubSpectra, cols: nbPoints, nStdDev: nStdDev * thresholdFactor});\n        //Peak2D[] peaksMC1 = matrixPeakFinders.findPeaks2DMax(data, nbSubSpectra, nbPoints, (nStdDev+0.5)*thresholdFactor);\n        //Remove peaks with less than 3% of the intensity of the highest peak\n        return createSignals2D(PeakOptimizer.clean(peaksMC1, 0.05), spectraData, 24);\n    }\n}\n\n\n//How noisy is the spectrum depending on the kind of experiment.\nfunction getLoGnStdDevNMR(spectraData) {\n    if (spectraData.isHomoNuclear()) {\n        return 1.5;\n    } else {\n        return 3;\n    }\n}\n\n/**\n * This function converts a set of 2D-peaks in 2D-signals. Each signal could be composed\n * of many 2D-peaks, and it has some additional information related to the NMR spectrum.\n * @param {Array} peaks\n * @param {NMR} spectraData\n * @param {number} tolerance\n * @return {Array}\n * @private\n */\nfunction createSignals2D(peaks, spectraData, tolerance) {\n\n    var bf1 = spectraData.observeFrequencyX();\n    var bf2 = spectraData.observeFrequencyY();\n\n    var firstY = spectraData.getFirstY();\n    var dy = spectraData.getDeltaY();\n    var i;\n    for (i = peaks.length - 1; i >= 0; i--) {\n        peaks[i].x = (spectraData.arrayPointToUnits(peaks[i].x));\n        peaks[i].y = (firstY + dy * (peaks[i].y));\n\n        //Still having problems to correctly detect peaks on those areas. So I'm removing everything there.\n        if (peaks[i].y < -1 || peaks[i].y >= 210) {\n            peaks.splice(i, 1);\n        }\n    }\n    //The connectivity matrix is an square and symmetric matrix, so we'll only store the upper diagonal in an\n    //array like form\n    var connectivity = [];\n    var tmp = 0;\n    tolerance *= tolerance;\n    //console.log(tolerance);\n    for (i = 0; i < peaks.length; i++) {\n        for (var j = i; j < peaks.length; j++) {\n            tmp = Math.pow((peaks[i].x - peaks[j].x) * bf1, 2) + Math.pow((peaks[i].y - peaks[j].y) * bf2, 2);\n            if (tmp < tolerance) {//30*30Hz We cannot distinguish peaks with less than 20 Hz of separation\n                connectivity.push(1);\n            } else {\n                connectivity.push(0);\n            }\n        }\n    }\n\n    var clusters = simpleClustering(connectivity);\n\n    var signals = [];\n    if (peaks != null) {\n        for (var iCluster = 0; iCluster < clusters.length; iCluster++) {\n            var signal = {nucleusX: spectraData.getNucleus(1), nucleusY: spectraData.getNucleus(2)};\n            signal.resolutionX = (spectraData.getLastX() - spectraData.getFirstX()) / spectraData.getNbPoints();\n            signal.resolutionY = dy;\n            var peaks2D = [];\n            signal.shiftX = 0;\n            signal.shiftY = 0;\n            var minMax1 = [Number.MAX_VALUE, 0];\n            var minMax2 = [Number.MAX_VALUE, 0];\n            var sumZ = 0;\n            for (var jPeak = clusters[iCluster].length - 1; jPeak >= 0; jPeak--) {\n                if (clusters[iCluster][jPeak] === 1) {\n                    peaks2D.push({\n                        x: peaks[jPeak].x,\n                        y: peaks[jPeak].y,\n                        z: peaks[jPeak].z\n\n                    });\n                    signal.shiftX += peaks[jPeak].x * peaks[jPeak].z;\n                    signal.shiftY += peaks[jPeak].y * peaks[jPeak].z;\n                    sumZ += peaks[jPeak].z;\n                    if (peaks[jPeak].x < minMax1[0]) {\n                        minMax1[0] = peaks[jPeak].x;\n                    }\n                    if (peaks[jPeak].x > minMax1[1]) {\n                        minMax1[1] = peaks[jPeak].x;\n                    }\n                    if (peaks[jPeak].y < minMax2[0]) {\n                        minMax2[0] = peaks[jPeak].y;\n                    }\n                    if (peaks[jPeak].y > minMax2[1]) {\n                        minMax2[1] = peaks[jPeak].y;\n                    }\n\n                }\n            }\n            signal.fromTo = [{from: minMax1[0], to: minMax1[1]},\n                {from: minMax2[0], to: minMax2[1]}];\n            signal.shiftX /= sumZ;\n            signal.shiftY /= sumZ;\n            signal.peaks = peaks2D;\n            signals.push(signal);\n        }\n    }\n    return signals;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/spectra-data/src/peakPicking/peakPicking2D.js","'use strict'\n/**\n * Created by acastillo on 7/7/16.\n */\nvar StatArray = require('ml-stat').array;\nvar convolution = require('ml-matrix-convolution');\nvar labeling = require(\"./ccLabeling\");\n\n\nconst smallFilter = [\n    [0, 0, 1, 2, 2, 2, 1, 0, 0],\n    [0, 1, 4, 7, 7, 7, 4, 1, 0],\n    [1, 4, 5, 3, 0, 3, 5, 4, 1],\n    [2, 7, 3, -12, -23, -12, 3, 7, 2],\n    [2, 7, 0, -23, -40, -23, 0, 7, 2],\n    [2, 7, 3, -12, -23, -12, 3, 7, 2],\n    [1, 4, 5, 3, 0, 3, 5, 4, 1],\n    [0, 1, 3, 7, 7, 7, 3, 1, 0],\n    [0, 0, 1, 2, 2, 2, 1, 0, 0]];\n\nconst DEBUG = false;\n\n/**\n Detects all the 2D-peaks in the given spectrum based on center of mass logic.\n */\nfunction findPeaks2DRegion(input, opt) {\n    var options = Object.assign({},{nStdev:3, kernel:smallFilter}, opt);\n    var tmp = convolution.matrix2Array(input);\n    var inputData = tmp.data;\n    var i;\n    if(tmp.rows&&tmp.cols){\n        options.rows = tmp.rows;\n        options.cols = tmp.cols;\n    }\n    var nRows = options.rows;\n    var nCols = options.cols;\n    if(!nRows||!nCols){\n        throw new Error(\"Invalid number of rows or columns \"+nRows+\" \"+nCols);\n    }\n\n    var customFilter = options.kernel;\n    var cs = options.filteredData;\n    if(!cs)\n        cs = convolution.fft(inputData, customFilter, options);\n\n    var nStdDev = options.nStdev;\n\n    var threshold = 0;\n    for( i=nCols*nRows-2;i>=0;i--)\n        threshold+=Math.pow(cs[i]-cs[i+1],2);\n    threshold=-Math.sqrt(threshold);\n    threshold*=nStdDev/nRows;\n\n    var bitmask = new Array(nCols * nRows);\n    for( i=nCols * nRows-1;i>=0;i--){\n        bitmask[i]=0;\n    }\n    var nbDetectedPoints = 0;\n    for ( i = cs.length-1; i >=0 ; i--) {\n        if (cs[i] < threshold) {\n            bitmask[i] = 1;\n            nbDetectedPoints++;\n        }\n    }\n\n    var pixels = labeling(bitmask, nCols, nRows, {neighbours:8});\n    var peakList  = extractPeaks(pixels, inputData, nRows, nCols);\n\n    if (peakList.length > 0&&DEBUG) {\n        console.log(\"No peak found\");\n    }\n    return peakList;\n}\n/**\n Detects all the 2D-peaks in the given spectrum based on the Max logic.\n amc\n */\nfunction findPeaks2DMax(input, opt) {\n    var options = Object.assign({},{nStdev:3, kernel:smallFilter}, opt);\n    var tmp = convolution.matrix2Array(input);\n    var inputData = tmp.data;\n\n    if(tmp.rows&&tmp.cols){\n        options.rows = tmp.rows;\n        options.cols = tmp.cols;\n    }\n    var nRows = options.rows;\n    var nCols = options.cols;\n    if(!nRows||!nCols){\n        throw new Error(\"Invalid number of rows or columns \"+nRows+\" \"+nCols);\n    }\n\n    var customFilter = options.kernel;\n    var cs = options.filteredData;\n    if(!cs)\n        cs = convolution.fft(inputData, customFilter, options);\n\n\n    var nStdDev = options.nStdev;\n    var threshold = 0;\n    for( var i=nCols*nRows-2;i>=0;i--)\n        threshold+=Math.pow(cs[i]-cs[i+1],2);\n    threshold=-Math.sqrt(threshold);\n    threshold*=nStdDev/nRows;\n\n    var rowI,colI;\n    var peakListMax = [];\n    var tmpIndex = 0;\n    for ( var i = 0; i < cs.length; i++) {\n        if (cs[i] < threshold) {\n            //It is a peak?\n            rowI=Math.floor(i/nCols);\n            colI=i%nCols;\n            //Verifies if this point is a peak;\n            if(rowI>0&&rowI+1<nRows&&colI+1<nCols&&colI>0){\n                //It is the minimum in the same row\n                if(cs[i]<cs[i+1]&&cs[i]<cs[i-1]){\n                    //It is the minimum in the previous row\n                    tmpIndex=(rowI-1)*nCols+colI;\n                    if(cs[i]<cs[tmpIndex-1]&&cs[i]<cs[tmpIndex]&&cs[i]<cs[tmpIndex+1]){\n                        //It is the minimum in the next row\n                        tmpIndex=(rowI+1)*nCols+colI;\n                        if(cs[i]<cs[tmpIndex-1]&&cs[i]<cs[tmpIndex]&&cs[i]<cs[tmpIndex+1]){\n                            peakListMax.push({x:colI,y:rowI,z:inputData[i]});\n                        }\n                    }\n                }\n            }\n        }\n    }\n    return peakListMax;\n}\n\nfunction extractPeaks(pixels, data, nRow, nCols){\n    //console.log(JSON.stringify(pixels));\n    //How many different groups we have?\n    var labels = {};\n    var row, col, tmp, i;\n    for( i = 0; i < pixels.length; i++){\n        if(pixels[i]!=0){\n            col = i%nCols;\n            row = (i-col) / nCols;\n            if(labels[pixels[i]]){\n                tmp = labels[pixels[i]];\n                tmp.x+=col*data[i];\n                tmp.y+=row*data[i];\n                tmp.z+=data[i];\n                if( col < tmp.minX)\n                    tmp.minX = col;\n                if( col > tmp.maxX)\n                    tmp.maxX = col;\n                if( row < tmp.minY)\n                    tmp.minY = row;\n                if( row > tmp.maxY)\n                    tmp.maxY = row;\n            }\n            else{\n                labels[pixels[i]]={\n                    x:col*data[i],\n                    y:row*data[i],\n                    z:data[i],\n                    minX:col,\n                    maxX:col,\n                    minY:row,\n                    maxY:row\n                };\n            }\n        }\n    }\n    var keys = Object.keys(labels);\n    var peakList = new Array(keys.length);\n    for( i = 0; i < keys.length; i++ ){\n        peakList[i] = labels[keys[i]];\n        peakList[i].x/=peakList[i].z;\n        peakList[i].y/=peakList[i].z;\n    }\n    return peakList;\n}\n\nmodule.exports={\n    findPeaks2DRegion:findPeaks2DRegion,\n    findPeaks2DMax:findPeaks2DMax\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-matrix-peaks-finder/src/index.js","'use strict;'\n/**\n * Created by acastillo on 7/7/16.\n */\nvar FFTUtils = require(\"ml-fft\").FFTUtils;\n\nfunction convolutionFFT(input, kernel, opt) {\n    var tmp = matrix2Array(input);\n    var inputData = tmp.data;\n    var options = Object.assign({normalize : false, divisor : 1, rows:tmp.rows, cols:tmp.cols}, opt);\n\n    var nRows, nCols;\n    if (options.rows&&options.cols) {\n        nRows = options.rows;\n        nCols = options.cols;\n    }\n    else {\n        throw new Error(\"Invalid number of rows or columns \" + nRows + \" \" + nCols)\n    }\n\n    var divisor = options.divisor;\n    var i,j;\n    var kHeight =  kernel.length;\n    var kWidth =  kernel[0].length;\n    if (options.normalize) {\n        divisor = 0;\n        for (i = 0; i < kHeight; i++)\n            for (j = 0; j < kWidth; j++)\n                divisor += kernel[i][j];\n    }\n    if (divisor === 0) {\n        throw new RangeError('convolution: The divisor is equal to zero');\n    }\n\n    var radix2Sized = FFTUtils.toRadix2(inputData, nRows, nCols);\n    var conv = FFTUtils.convolute(radix2Sized.data, kernel, radix2Sized.rows, radix2Sized.cols);\n    conv = FFTUtils.crop(conv, radix2Sized.rows, radix2Sized.cols, nRows, nCols);\n\n    if(divisor!=0){\n        for(i=0;i<conv.length;i++){\n            conv[i]/divisor;\n        }\n    }\n\n    return conv;\n}\n\nfunction convolutionDirect(input, kernel, opt) {\n    var tmp = matrix2Array(input);\n    var inputData = tmp.data;\n    var options = Object.assign({normalize : false, divisor : 1, rows:tmp.rows, cols:tmp.cols}, opt);\n\n    var nRows, nCols;\n    if (options.rows&&options.cols) {\n        nRows = options.rows;\n        nCols = options.cols;\n    }\n    else {\n        throw new Error(\"Invalid number of rows or columns \" + nRows + \" \" + nCols)\n    }\n\n    var divisor = options.divisor;\n    var kHeight =  kernel.length;\n    var kWidth =  kernel[0].length;\n    var i, j, x, y, index, sum, kVal, row, col;\n    if (options.normalize) {\n        divisor = 0;\n        for (i = 0; i < kHeight; i++)\n            for (j = 0; j < kWidth; j++)\n                divisor += kernel[i][j];\n    }\n    if (divisor === 0) {\n        throw new RangeError('convolution: The divisor is equal to zero');\n    }\n\n    var output = new Array(nRows*nCols);\n\n    var hHeight = Math.floor(kHeight/2);\n    var hWidth = Math.floor(kWidth/2);\n\n    for (y = 0; y < nRows; y++) {\n        for (x = 0; x < nCols; x++) {\n            sum = 0;\n            for ( j = 0; j < kHeight; j++) {\n                for ( i = 0; i < kWidth; i++) {\n                    kVal = kernel[kHeight - j - 1][kWidth - i - 1];\n                    row = (y + j -hHeight + nRows) % nRows;\n                    col = (x + i - hWidth + nCols) % nCols;\n                    index = (row * nCols + col);\n                    sum += inputData[index] * kVal;\n                }\n            }\n            index = (y * nCols + x);\n            output[index]= sum / divisor;\n        }\n    }\n    return output;\n}\n\n\n\nfunction LoG(sigma, nPoints, options){\n    var factor = 1000;\n    if(options&&options.factor){\n        factor = options.factor;\n    }\n\n    var kernel = new Array(nPoints);\n    var i,j,tmp,y2,tmp2;\n\n    factor*=-1;//-1/(Math.PI*Math.pow(sigma,4));\n    var center = (nPoints-1)/2;\n    var sigma2 = 2*sigma*sigma;\n    for( i=0;i<nPoints;i++){\n        kernel[i]=new Array(nPoints);\n        y2 = (i-center)*(i-center);\n        for( j=0;j<nPoints;j++){\n            tmp = -((j-center)*(j-center)+y2)/sigma2;\n            kernel[i][j]=Math.round(factor*(1+tmp)*Math.exp(tmp));\n        }\n    }\n\n    return kernel;\n}\n\nfunction matrix2Array(input){\n    var inputData=input;\n    var nRows, nCols;\n    if(typeof input[0]!=\"number\"){\n        nRows = input.length;\n        nCols = input[0].length;\n        inputData = new Array(nRows*nCols);\n        for(var i=0;i<nRows;i++){\n            for(var j=0;j<nCols;j++){\n                inputData[i*nCols+j]=input[i][j];\n            }\n        }\n    }\n    else{\n        var tmp = Math.sqrt(input.length);\n        if(Number.isInteger(tmp)){\n            nRows=tmp;\n            nCols=tmp;\n        }\n    }\n\n    return {data:inputData,rows:nRows,cols:nCols};\n}\n\n\nmodule.exports = {\n    fft:convolutionFFT,\n    direct:convolutionDirect,\n    kernelFactory:{LoG:LoG},\n    matrix2Array:matrix2Array\n};\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-matrix-convolution/src/index.js","'use strict';\n\nexports.FFTUtils = require(\"./FFTUtils\");\nexports.FFT = require('./fftlib');\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-matrix-convolution/node_modules/ml-fft/src/index.js","'use strict'\n\nvar FFT = require('./fftlib');\n\nvar FFTUtils= {\n    DEBUG : false,\n\n    /**\n     * Calculates the inverse of a 2D Fourier transform\n     *\n     * @param ft\n     * @param ftRows\n     * @param ftCols\n     * @return\n     */\n    ifft2DArray : function(ft, ftRows, ftCols){\n        var tempTransform = new Array(ftRows * ftCols);\n        var nRows = ftRows / 2;\n        var nCols = (ftCols - 1) * 2;\n        // reverse transform columns\n        FFT.init(nRows);\n        var tmpCols = {re: new Array(nRows), im: new Array(nRows)};\n        for (var iCol = 0; iCol < ftCols; iCol++) {\n            for (var iRow = nRows - 1; iRow >= 0; iRow--) {\n                tmpCols.re[iRow] = ft[(iRow * 2) * ftCols + iCol];\n                tmpCols.im[iRow] = ft[(iRow * 2 + 1) * ftCols + iCol];\n            }\n            //Unnormalized inverse transform\n            FFT.bt(tmpCols.re, tmpCols.im);\n            for (var iRow = nRows - 1; iRow >= 0; iRow--) {\n                tempTransform[(iRow * 2) * ftCols + iCol] = tmpCols.re[iRow];\n                tempTransform[(iRow * 2 + 1) * ftCols + iCol] = tmpCols.im[iRow];\n            }\n        }\n\n        // reverse row transform\n        var finalTransform = new Array(nRows * nCols);\n        FFT.init(nCols);\n        var tmpRows = {re: new Array(nCols), im: new Array(nCols)};\n        var scale = nCols * nRows;\n        for (var iRow = 0; iRow < ftRows; iRow += 2) {\n            tmpRows.re[0] = tempTransform[iRow * ftCols];\n            tmpRows.im[0] = tempTransform[(iRow + 1) * ftCols];\n            for (var iCol = 1; iCol < ftCols; iCol++) {\n                tmpRows.re[iCol] = tempTransform[iRow * ftCols + iCol];\n                tmpRows.im[iCol] = tempTransform[(iRow + 1) * ftCols + iCol];\n                tmpRows.re[nCols - iCol] = tempTransform[iRow * ftCols + iCol];\n                tmpRows.im[nCols - iCol] = -tempTransform[(iRow + 1) * ftCols + iCol];\n            }\n            //Unnormalized inverse transform\n            FFT.bt(tmpRows.re, tmpRows.im);\n\n            var indexB = (iRow / 2) * nCols;\n            for (var iCol = nCols - 1; iCol >= 0; iCol--) {\n                finalTransform[indexB + iCol] = tmpRows.re[iCol] / scale;\n            }\n        }\n        return finalTransform;\n    },\n    /**\n     * Calculates the fourier transform of a matrix of size (nRows,nCols) It is\n     * assumed that both nRows and nCols are a power of two\n     *\n     * On exit the matrix has dimensions (nRows * 2, nCols / 2 + 1) where the\n     * even rows contain the real part and the odd rows the imaginary part of the\n     * transform\n     * @param data\n     * @param nRows\n     * @param nCols\n     * @return\n     */\n    fft2DArray:function(data, nRows, nCols, opt) {\n        var options = Object.assign({},{inplace:true})\n        var ftCols = (nCols / 2 + 1);\n        var ftRows = nRows * 2;\n        var tempTransform = new Array(ftRows * ftCols);\n        FFT.init(nCols);\n        // transform rows\n        var tmpRows = {re: new Array(nCols), im: new Array(nCols)};\n        var row1 = {re: new Array(nCols), im: new Array(nCols)}\n        var row2 = {re: new Array(nCols), im: new Array(nCols)}\n        var index, iRow0, iRow1, iRow2, iRow3;\n        for (var iRow = 0; iRow < nRows / 2; iRow++) {\n            index = (iRow * 2) * nCols;\n            tmpRows.re = data.slice(index, index + nCols);\n\n            index = (iRow * 2 + 1) * nCols;\n            tmpRows.im = data.slice(index, index + nCols);\n\n            FFT.fft1d(tmpRows.re, tmpRows.im);\n\n            this.reconstructTwoRealFFT(tmpRows, row1, row2);\n            //Now lets put back the result into the output array\n            iRow0 = (iRow * 4) * ftCols;\n            iRow1 = (iRow * 4 + 1) * ftCols;\n            iRow2 = (iRow * 4 + 2) * ftCols;\n            iRow3 = (iRow * 4 + 3) * ftCols;\n            for (var k = ftCols - 1; k >= 0; k--) {\n                tempTransform[iRow0 + k] = row1.re[k];\n                tempTransform[iRow1 + k] = row1.im[k];\n                tempTransform[iRow2 + k] = row2.re[k];\n                tempTransform[iRow3 + k] = row2.im[k];\n            }\n        }\n\n        //console.log(tempTransform);\n        row1 = null;\n        row2 = null;\n        // transform columns\n        var finalTransform = new Array(ftRows * ftCols);\n\n        FFT.init(nRows);\n        var tmpCols = {re: new Array(nRows), im: new Array(nRows)};\n        for (var iCol = ftCols - 1; iCol >= 0; iCol--) {\n            for (var iRow = nRows - 1; iRow >= 0; iRow--) {\n                tmpCols.re[iRow] = tempTransform[(iRow * 2) * ftCols + iCol];\n                tmpCols.im[iRow] = tempTransform[(iRow * 2 + 1) * ftCols + iCol];\n                //TODO Chech why this happens\n                if(isNaN(tmpCols.re[iRow])){\n                    tmpCols.re[iRow]=0;\n                }\n                if(isNaN(tmpCols.im[iRow])){\n                    tmpCols.im[iRow]=0;\n                }\n            }\n            FFT.fft1d(tmpCols.re, tmpCols.im);\n            for (var iRow = nRows - 1; iRow >= 0; iRow--) {\n                finalTransform[(iRow * 2) * ftCols + iCol] = tmpCols.re[iRow];\n                finalTransform[(iRow * 2 + 1) * ftCols + iCol] = tmpCols.im[iRow];\n            }\n        }\n\n        //console.log(finalTransform);\n        return finalTransform;\n\n    },\n    /**\n     *\n     * @param fourierTransform\n     * @param realTransform1\n     * @param realTransform2\n     *\n     * Reconstructs the individual Fourier transforms of two simultaneously\n     * transformed series. Based on the Symmetry relationships (the asterisk\n     * denotes the complex conjugate)\n     *\n     * F_{N-n} = F_n^{*} for a purely real f transformed to F\n     *\n     * G_{N-n} = G_n^{*} for a purely imaginary g transformed to G\n     *\n     */\n    reconstructTwoRealFFT:function(fourierTransform, realTransform1, realTransform2) {\n        var length = fourierTransform.re.length;\n\n        // the components n=0 are trivial\n        realTransform1.re[0] = fourierTransform.re[0];\n        realTransform1.im[0] = 0.0;\n        realTransform2.re[0] = fourierTransform.im[0];\n        realTransform2.im[0] = 0.0;\n        var rm, rp, im, ip, j;\n        for (var i = length / 2; i > 0; i--) {\n            j = length - i;\n            rm = 0.5 * (fourierTransform.re[i] - fourierTransform.re[j]);\n            rp = 0.5 * (fourierTransform.re[i] + fourierTransform.re[j]);\n            im = 0.5 * (fourierTransform.im[i] - fourierTransform.im[j]);\n            ip = 0.5 * (fourierTransform.im[i] + fourierTransform.im[j]);\n            realTransform1.re[i] = rp;\n            realTransform1.im[i] = im;\n            realTransform1.re[j] = rp;\n            realTransform1.im[j] = -im;\n            realTransform2.re[i] = ip;\n            realTransform2.im[i] = -rm;\n            realTransform2.re[j] = ip;\n            realTransform2.im[j] = rm;\n        }\n    },\n\n    /**\n     * In place version of convolute 2D\n     *\n     * @param ftSignal\n     * @param ftFilter\n     * @param ftRows\n     * @param ftCols\n     * @return\n     */\n    convolute2DI:function(ftSignal, ftFilter, ftRows, ftCols) {\n        var re, im;\n        for (var iRow = 0; iRow < ftRows / 2; iRow++) {\n            for (var iCol = 0; iCol < ftCols; iCol++) {\n                //\n                re = ftSignal[(iRow * 2) * ftCols + iCol]\n                    * ftFilter[(iRow * 2) * ftCols + iCol]\n                    - ftSignal[(iRow * 2 + 1) * ftCols + iCol]\n                    * ftFilter[(iRow * 2 + 1) * ftCols + iCol];\n                im = ftSignal[(iRow * 2) * ftCols + iCol]\n                    * ftFilter[(iRow * 2 + 1) * ftCols + iCol]\n                    + ftSignal[(iRow * 2 + 1) * ftCols + iCol]\n                    * ftFilter[(iRow * 2) * ftCols + iCol];\n                //\n                ftSignal[(iRow * 2) * ftCols + iCol] = re;\n                ftSignal[(iRow * 2 + 1) * ftCols + iCol] = im;\n            }\n        }\n    },\n    /**\n     *\n     * @param data\n     * @param kernel\n     * @param nRows\n     * @param nCols\n     * @returns {*}\n     */\n    convolute:function(data, kernel, nRows, nCols, opt){\n        var ftSpectrum = new Array(nCols * nRows);\n        for (var i = 0; i<nRows * nCols; i++){\n            ftSpectrum[i] = data[i];\n        }\n\n        ftSpectrum = this.fft2DArray(ftSpectrum, nRows, nCols);\n\n\n        var dimR = kernel.length;\n        var dimC = kernel[0].length;\n        var ftFilterData = new Array(nCols * nRows);\n        for(var i=0;i<nCols * nRows;i++){\n            ftFilterData[i]=0;\n        }\n\n        var iRow, iCol;\n        var shiftR = Math.floor((dimR - 1) / 2);\n        var shiftC = Math.floor((dimC - 1) / 2);\n        for (var ir = 0; ir < dimR; ir++) {\n            iRow = (ir - shiftR + nRows) % nRows;\n            for (var ic = 0; ic < dimC; ic++) {\n                iCol = (ic - shiftC + nCols) % nCols;\n                ftFilterData[iRow * nCols + iCol] = kernel[ir][ic];\n            }\n        }\n        ftFilterData = this.fft2DArray(ftFilterData, nRows, nCols);\n\n        var ftRows = nRows * 2;\n        var ftCols = nCols / 2 + 1;\n        this.convolute2DI(ftSpectrum, ftFilterData, ftRows, ftCols);\n\n        return this.ifft2DArray(ftSpectrum, ftRows, ftCols);\n    },\n\n\n    toRadix2:function(data, nRows, nCols){\n        var i,j,irow, icol;\n        var cols = nCols, rows = nRows, prows=0, pcols=0;\n        if(!(nCols !== 0 && (nCols & (nCols - 1)) === 0)) {\n            //Then we have to make a pading to next radix2\n            cols = 0;\n            while((nCols>>++cols)!=0);\n            cols=1<<cols;\n            pcols = cols-nCols;\n        }\n        if(!(nRows !== 0 && (nRows & (nRows - 1)) === 0)) {\n            //Then we have to make a pading to next radix2\n            rows = 0;\n            while((nRows>>++rows)!=0);\n            rows=1<<rows;\n            prows = (rows-nRows)*cols;\n        }\n        if(rows==nRows&&cols==nCols)//Do nothing. Returns the same input!!! Be careful\n            return {data:data, rows:nRows, cols:nCols};\n\n        var output = new Array(rows*cols);\n        var shiftR = Math.floor((rows-nRows)/2)-nRows;\n        var shiftC = Math.floor((cols-nCols)/2)-nCols;\n\n        for( i=0;i<rows;i++){\n            irow = i*cols;\n            icol = ((i-shiftR) % nRows) * nCols;\n            for( j = 0;j<cols;j++){\n                output[irow+j]=data[(icol+(j-shiftC) % nCols) ];\n            }\n        }\n        return {data:output, rows:rows, cols:cols};\n    },\n\n    /**\n     * Crop the given matrix to fit the corresponding number of rows and columns\n     */\n    crop:function(data, rows, cols, nRows, nCols, opt){\n\n        if(rows == nRows && cols == nCols)//Do nothing. Returns the same input!!! Be careful\n            return data;\n\n        var options = Object.assign({}, opt);\n\n        var output = new Array(nCols*nRows);\n\n        var shiftR = Math.floor((rows-nRows)/2);\n        var shiftC = Math.floor((cols-nCols)/2);\n        var irow, icol, i, j;\n\n        for( i=0;i<nRows;i++){\n            irow = i*nRows;\n            icol = (i+shiftR)*cols;\n            for( j = 0;j<nCols;j++){\n                output[irow+j]=data[icol+(j+shiftC)];\n            }\n        }\n\n        return output;\n    }\n}\n\nmodule.exports = FFTUtils;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-matrix-convolution/node_modules/ml-fft/src/FFTUtils.js","'use strict'\n\nconst DisjointSet = require('ml-disjoint-set');\n\nconst direction4X = [-1, 0];\nconst direction4Y = [0, -1];\nconst neighbours4 = [null, null];\n\nconst direction8X = [-1, -1, 0, 1];\nconst direction8Y = [0, -1, -1, -1];\nconst neighbours8 = [null, null, null, null];\n\nfunction ccLabeling(mask, width, height, options) {\n    options = options || {};\n    const neighbours = options.neighbours || 8;\n\n    var directionX;\n    var directionY;\n    var neighboursList;\n    if (neighbours === 8) {\n        directionX = direction8X;\n        directionY = direction8Y;\n        neighboursList = neighbours8;\n    } else if (neighbours === 4) {\n        directionX = direction4X;\n        directionY = direction4Y;\n        neighboursList = neighbours4;\n    } else {\n        throw new RangeError('unsupported neighbours count: ' + neighbours);\n    }\n\n    const size = mask.length;\n    const labels = new Array(size);\n    const pixels = new Int16Array(size);\n    const linked = new DisjointSet();\n    var index;\n    var currentLabel = 1;\n    for (var j = 0; j < height; j++) {\n        for (var i = 0; i < width; i++) {\n            // true means out of background\n            var smallestNeighbor = null;\n            index = i + j * width;\n\n            if (mask[index]) {\n                for (var k = 0; k < neighboursList.length; k++) {\n                    var ii = i + directionX[k];\n                    var jj = j + directionY[k];\n                    if (ii >= 0 && jj >= 0 && ii < width && jj < height) {\n                        var neighbor = labels[ii + jj * width];\n                        if (!neighbor) {\n                            neighboursList[k] = null;\n                        } else {\n                            neighboursList[k] = neighbor;\n                            if (!smallestNeighbor || neighboursList[k].value < smallestNeighbor.value) {\n                                smallestNeighbor = neighboursList[k];\n                            }\n                        }\n                    }\n                }\n                if (!smallestNeighbor) {\n                    labels[index] = linked.add(currentLabel++);\n                } else {\n                    labels[index] = smallestNeighbor;\n                    for (var k = 0; k < neighboursList.length; k++) {\n                        if (neighboursList[k] && neighboursList[k] !== smallestNeighbor) {\n                            linked.union(smallestNeighbor, neighboursList[k]);\n                        }\n                    }\n                }\n            }\n        }\n    }\n\n    for (var j = 0; j < height; j++) {\n        for (var i = 0; i < width; i++) {\n            index = i + j * width;\n            if (mask[index]) {\n                pixels[index] = linked.find(labels[index]).value;\n            }\n        }\n    }\n    return pixels;\n\n}\n\nmodule.exports = ccLabeling;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-matrix-peaks-finder/src/ccLabeling.js","'use strict';\n\n/**\n * @class DisjointSet\n */\nclass DisjointSet {\n    constructor() {\n        this.nodes = new Map();\n    }\n\n    /**\n     * Adds an element as a new set\n     * @param {*} value\n     * @return {DisjointSetNode} Object holding the element\n     */\n    add(value) {\n        var node = this.nodes.get(value);\n        if (!node) {\n            node = new DisjointSetNode(value);\n            this.nodes.set(value, node);\n        }\n        return node;\n    }\n\n    /**\n     * Merges the sets that contain x and y\n     * @param {DisjointSetNode} x\n     * @param {DisjointSetNode} y\n     */\n    union(x, y) {\n        const rootX = this.find(x);\n        const rootY = this.find(y);\n        if (rootX === rootY) {\n            return;\n        }\n        if (rootX.rank < rootY.rank) {\n            rootX.parent = rootY;\n        } else if (rootX.rank > rootY.rank) {\n            rootY.parent = rootX;\n        } else {\n            rootY.parent = rootX;\n            rootX.rank++;\n        }\n    }\n\n    /**\n     * Finds and returns the root node of the set that contains node\n     * @param {DisjointSetNode} node\n     * @return {DisjointSetNode}\n     */\n    find(node) {\n        var rootX = node;\n        while (rootX.parent !== null) {\n            rootX = rootX.parent;\n        }\n        var toUpdateX = node;\n        while (toUpdateX.parent !== null) {\n            var toUpdateParent = toUpdateX;\n            toUpdateX = toUpdateX.parent;\n            toUpdateParent.parent = rootX;\n        }\n        return rootX;\n    }\n\n    /**\n     * Returns true if x and y belong to the same set\n     * @param {DisjointSetNode} x\n     * @param {DisjointSetNode} y\n     */\n    connected(x, y) {\n        return this.find(x) === this.find(y);\n    }\n}\n\nmodule.exports = DisjointSet;\n\nfunction DisjointSetNode(value) {\n    this.value = value;\n    this.parent = null;\n    this.rank = 0;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/ml-disjoint-set/src/DisjointSet.js"],"sourceRoot":""}