Files
portfolio/node_modules/.cache/babel-loader/cabb18bae79ab33138cf0d2ec490822e.json
2021-09-20 16:54:47 -04:00

1 line
35 KiB
JSON

{"ast":null,"code":"'use strict';\n/* eslint camelcase: \"off\" */\n\nvar assert = require('assert');\n\nvar Zstream = require('pako/lib/zlib/zstream');\n\nvar zlib_deflate = require('pako/lib/zlib/deflate.js');\n\nvar zlib_inflate = require('pako/lib/zlib/inflate.js');\n\nvar constants = require('pako/lib/zlib/constants');\n\nfor (var key in constants) {\n exports[key] = constants[key];\n} // zlib modes\n\n\nexports.NONE = 0;\nexports.DEFLATE = 1;\nexports.INFLATE = 2;\nexports.GZIP = 3;\nexports.GUNZIP = 4;\nexports.DEFLATERAW = 5;\nexports.INFLATERAW = 6;\nexports.UNZIP = 7;\nvar GZIP_HEADER_ID1 = 0x1f;\nvar GZIP_HEADER_ID2 = 0x8b;\n/**\n * Emulate Node's zlib C++ layer for use by the JS layer in index.js\n */\n\nfunction Zlib(mode) {\n if (typeof mode !== 'number' || mode < exports.DEFLATE || mode > exports.UNZIP) {\n throw new TypeError('Bad argument');\n }\n\n this.dictionary = null;\n this.err = 0;\n this.flush = 0;\n this.init_done = false;\n this.level = 0;\n this.memLevel = 0;\n this.mode = mode;\n this.strategy = 0;\n this.windowBits = 0;\n this.write_in_progress = false;\n this.pending_close = false;\n this.gzip_id_bytes_read = 0;\n}\n\nZlib.prototype.close = function () {\n if (this.write_in_progress) {\n this.pending_close = true;\n return;\n }\n\n this.pending_close = false;\n assert(this.init_done, 'close before init');\n assert(this.mode <= exports.UNZIP);\n\n if (this.mode === exports.DEFLATE || this.mode === exports.GZIP || this.mode === exports.DEFLATERAW) {\n zlib_deflate.deflateEnd(this.strm);\n } else if (this.mode === exports.INFLATE || this.mode === exports.GUNZIP || this.mode === exports.INFLATERAW || this.mode === exports.UNZIP) {\n zlib_inflate.inflateEnd(this.strm);\n }\n\n this.mode = exports.NONE;\n this.dictionary = null;\n};\n\nZlib.prototype.write = function (flush, input, in_off, in_len, out, out_off, out_len) {\n return this._write(true, flush, input, in_off, in_len, out, out_off, out_len);\n};\n\nZlib.prototype.writeSync = function (flush, input, in_off, in_len, out, out_off, out_len) {\n return this._write(false, flush, input, in_off, in_len, out, out_off, out_len);\n};\n\nZlib.prototype._write = function (async, flush, input, in_off, in_len, out, out_off, out_len) {\n assert.equal(arguments.length, 8);\n assert(this.init_done, 'write before init');\n assert(this.mode !== exports.NONE, 'already finalized');\n assert.equal(false, this.write_in_progress, 'write already in progress');\n assert.equal(false, this.pending_close, 'close is pending');\n this.write_in_progress = true;\n assert.equal(false, flush === undefined, 'must provide flush value');\n this.write_in_progress = true;\n\n if (flush !== exports.Z_NO_FLUSH && flush !== exports.Z_PARTIAL_FLUSH && flush !== exports.Z_SYNC_FLUSH && flush !== exports.Z_FULL_FLUSH && flush !== exports.Z_FINISH && flush !== exports.Z_BLOCK) {\n throw new Error('Invalid flush value');\n }\n\n if (input == null) {\n input = Buffer.alloc(0);\n in_len = 0;\n in_off = 0;\n }\n\n this.strm.avail_in = in_len;\n this.strm.input = input;\n this.strm.next_in = in_off;\n this.strm.avail_out = out_len;\n this.strm.output = out;\n this.strm.next_out = out_off;\n this.flush = flush;\n\n if (!async) {\n // sync version\n this._process();\n\n if (this._checkError()) {\n return this._afterSync();\n }\n\n return;\n } // async version\n\n\n var self = this;\n process.nextTick(function () {\n self._process();\n\n self._after();\n });\n return this;\n};\n\nZlib.prototype._afterSync = function () {\n var avail_out = this.strm.avail_out;\n var avail_in = this.strm.avail_in;\n this.write_in_progress = false;\n return [avail_in, avail_out];\n};\n\nZlib.prototype._process = function () {\n var next_expected_header_byte = null; // If the avail_out is left at 0, then it means that it ran out\n // of room. If there was avail_out left over, then it means\n // that all of the input was consumed.\n\n switch (this.mode) {\n case exports.DEFLATE:\n case exports.GZIP:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflate(this.strm, this.flush);\n break;\n\n case exports.UNZIP:\n if (this.strm.avail_in > 0) {\n next_expected_header_byte = this.strm.next_in;\n }\n\n switch (this.gzip_id_bytes_read) {\n case 0:\n if (next_expected_header_byte === null) {\n break;\n }\n\n if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID1) {\n this.gzip_id_bytes_read = 1;\n next_expected_header_byte++;\n\n if (this.strm.avail_in === 1) {\n // The only available byte was already read.\n break;\n }\n } else {\n this.mode = exports.INFLATE;\n break;\n }\n\n // fallthrough\n\n case 1:\n if (next_expected_header_byte === null) {\n break;\n }\n\n if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID2) {\n this.gzip_id_bytes_read = 2;\n this.mode = exports.GUNZIP;\n } else {\n // There is no actual difference between INFLATE and INFLATERAW\n // (after initialization).\n this.mode = exports.INFLATE;\n }\n\n break;\n\n default:\n throw new Error('invalid number of gzip magic number bytes read');\n }\n\n // fallthrough\n\n case exports.INFLATE:\n case exports.GUNZIP:\n case exports.INFLATERAW:\n this.err = zlib_inflate.inflate(this.strm, this.flush // If data was encoded with dictionary\n );\n\n if (this.err === exports.Z_NEED_DICT && this.dictionary) {\n // Load it\n this.err = zlib_inflate.inflateSetDictionary(this.strm, this.dictionary);\n\n if (this.err === exports.Z_OK) {\n // And try to decode again\n this.err = zlib_inflate.inflate(this.strm, this.flush);\n } else if (this.err === exports.Z_DATA_ERROR) {\n // Both inflateSetDictionary() and inflate() return Z_DATA_ERROR.\n // Make it possible for After() to tell a bad dictionary from bad\n // input.\n this.err = exports.Z_NEED_DICT;\n }\n }\n\n while (this.strm.avail_in > 0 && this.mode === exports.GUNZIP && this.err === exports.Z_STREAM_END && this.strm.next_in[0] !== 0x00) {\n // Bytes remain in input buffer. Perhaps this is another compressed\n // member in the same archive, or just trailing garbage.\n // Trailing zero bytes are okay, though, since they are frequently\n // used for padding.\n this.reset();\n this.err = zlib_inflate.inflate(this.strm, this.flush);\n }\n\n break;\n\n default:\n throw new Error('Unknown mode ' + this.mode);\n }\n};\n\nZlib.prototype._checkError = function () {\n // Acceptable error states depend on the type of zlib stream.\n switch (this.err) {\n case exports.Z_OK:\n case exports.Z_BUF_ERROR:\n if (this.strm.avail_out !== 0 && this.flush === exports.Z_FINISH) {\n this._error('unexpected end of file');\n\n return false;\n }\n\n break;\n\n case exports.Z_STREAM_END:\n // normal statuses, not fatal\n break;\n\n case exports.Z_NEED_DICT:\n if (this.dictionary == null) {\n this._error('Missing dictionary');\n } else {\n this._error('Bad dictionary');\n }\n\n return false;\n\n default:\n // something else.\n this._error('Zlib error');\n\n return false;\n }\n\n return true;\n};\n\nZlib.prototype._after = function () {\n if (!this._checkError()) {\n return;\n }\n\n var avail_out = this.strm.avail_out;\n var avail_in = this.strm.avail_in;\n this.write_in_progress = false; // call the write() cb\n\n this.callback(avail_in, avail_out);\n\n if (this.pending_close) {\n this.close();\n }\n};\n\nZlib.prototype._error = function (message) {\n if (this.strm.msg) {\n message = this.strm.msg;\n }\n\n this.onerror(message, this.err // no hope of rescue.\n );\n this.write_in_progress = false;\n\n if (this.pending_close) {\n this.close();\n }\n};\n\nZlib.prototype.init = function (windowBits, level, memLevel, strategy, dictionary) {\n assert(arguments.length === 4 || arguments.length === 5, 'init(windowBits, level, memLevel, strategy, [dictionary])');\n assert(windowBits >= 8 && windowBits <= 15, 'invalid windowBits');\n assert(level >= -1 && level <= 9, 'invalid compression level');\n assert(memLevel >= 1 && memLevel <= 9, 'invalid memlevel');\n assert(strategy === exports.Z_FILTERED || strategy === exports.Z_HUFFMAN_ONLY || strategy === exports.Z_RLE || strategy === exports.Z_FIXED || strategy === exports.Z_DEFAULT_STRATEGY, 'invalid strategy');\n\n this._init(level, windowBits, memLevel, strategy, dictionary);\n\n this._setDictionary();\n};\n\nZlib.prototype.params = function () {\n throw new Error('deflateParams Not supported');\n};\n\nZlib.prototype.reset = function () {\n this._reset();\n\n this._setDictionary();\n};\n\nZlib.prototype._init = function (level, windowBits, memLevel, strategy, dictionary) {\n this.level = level;\n this.windowBits = windowBits;\n this.memLevel = memLevel;\n this.strategy = strategy;\n this.flush = exports.Z_NO_FLUSH;\n this.err = exports.Z_OK;\n\n if (this.mode === exports.GZIP || this.mode === exports.GUNZIP) {\n this.windowBits += 16;\n }\n\n if (this.mode === exports.UNZIP) {\n this.windowBits += 32;\n }\n\n if (this.mode === exports.DEFLATERAW || this.mode === exports.INFLATERAW) {\n this.windowBits = -1 * this.windowBits;\n }\n\n this.strm = new Zstream();\n\n switch (this.mode) {\n case exports.DEFLATE:\n case exports.GZIP:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflateInit2(this.strm, this.level, exports.Z_DEFLATED, this.windowBits, this.memLevel, this.strategy);\n break;\n\n case exports.INFLATE:\n case exports.GUNZIP:\n case exports.INFLATERAW:\n case exports.UNZIP:\n this.err = zlib_inflate.inflateInit2(this.strm, this.windowBits);\n break;\n\n default:\n throw new Error('Unknown mode ' + this.mode);\n }\n\n if (this.err !== exports.Z_OK) {\n this._error('Init error');\n }\n\n this.dictionary = dictionary;\n this.write_in_progress = false;\n this.init_done = true;\n};\n\nZlib.prototype._setDictionary = function () {\n if (this.dictionary == null) {\n return;\n }\n\n this.err = exports.Z_OK;\n\n switch (this.mode) {\n case exports.DEFLATE:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflateSetDictionary(this.strm, this.dictionary);\n break;\n\n default:\n break;\n }\n\n if (this.err !== exports.Z_OK) {\n this._error('Failed to set dictionary');\n }\n};\n\nZlib.prototype._reset = function () {\n this.err = exports.Z_OK;\n\n switch (this.mode) {\n case exports.DEFLATE:\n case exports.DEFLATERAW:\n case exports.GZIP:\n this.err = zlib_deflate.deflateReset(this.strm);\n break;\n\n case exports.INFLATE:\n case exports.INFLATERAW:\n case exports.GUNZIP:\n this.err = zlib_inflate.inflateReset(this.strm);\n break;\n\n default:\n break;\n }\n\n if (this.err !== exports.Z_OK) {\n this._error('Failed to reset stream');\n }\n};\n\nexports.Zlib = Zlib;","map":{"version":3,"sources":["/Users/tylerkoenig/Code/personal/react-scss2/node_modules/browserify-zlib/lib/binding.js"],"names":["assert","require","Zstream","zlib_deflate","zlib_inflate","constants","key","exports","NONE","DEFLATE","INFLATE","GZIP","GUNZIP","DEFLATERAW","INFLATERAW","UNZIP","GZIP_HEADER_ID1","GZIP_HEADER_ID2","Zlib","mode","TypeError","dictionary","err","flush","init_done","level","memLevel","strategy","windowBits","write_in_progress","pending_close","gzip_id_bytes_read","prototype","close","deflateEnd","strm","inflateEnd","write","input","in_off","in_len","out","out_off","out_len","_write","writeSync","async","equal","arguments","length","undefined","Z_NO_FLUSH","Z_PARTIAL_FLUSH","Z_SYNC_FLUSH","Z_FULL_FLUSH","Z_FINISH","Z_BLOCK","Error","Buffer","alloc","avail_in","next_in","avail_out","output","next_out","_process","_checkError","_afterSync","self","process","nextTick","_after","next_expected_header_byte","deflate","inflate","Z_NEED_DICT","inflateSetDictionary","Z_OK","Z_DATA_ERROR","Z_STREAM_END","reset","Z_BUF_ERROR","_error","callback","message","msg","onerror","init","Z_FILTERED","Z_HUFFMAN_ONLY","Z_RLE","Z_FIXED","Z_DEFAULT_STRATEGY","_init","_setDictionary","params","_reset","deflateInit2","Z_DEFLATED","inflateInit2","deflateSetDictionary","deflateReset","inflateReset"],"mappings":"AAAA;AACA;;AAEA,IAAIA,MAAM,GAAGC,OAAO,CAAC,QAAD,CAApB;;AAEA,IAAIC,OAAO,GAAGD,OAAO,CAAC,uBAAD,CAArB;;AACA,IAAIE,YAAY,GAAGF,OAAO,CAAC,0BAAD,CAA1B;;AACA,IAAIG,YAAY,GAAGH,OAAO,CAAC,0BAAD,CAA1B;;AACA,IAAII,SAAS,GAAGJ,OAAO,CAAC,yBAAD,CAAvB;;AAEA,KAAK,IAAIK,GAAT,IAAgBD,SAAhB,EAA2B;AACzBE,EAAAA,OAAO,CAACD,GAAD,CAAP,GAAeD,SAAS,CAACC,GAAD,CAAxB;AACD,C,CAED;;;AACAC,OAAO,CAACC,IAAR,GAAe,CAAf;AACAD,OAAO,CAACE,OAAR,GAAkB,CAAlB;AACAF,OAAO,CAACG,OAAR,GAAkB,C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AAO,CAACsE,IAAzB,EAA+B;AAC7B,SAAKK,MAAL,CAAY,wBAAZ;AACD;AACF,CArBD;;AAuBA3E,OAAO,CAACW,IAAR,GAAeA,IAAf","sourcesContent":["'use strict';\n/* eslint camelcase: \"off\" */\n\nvar assert = require('assert');\n\nvar Zstream = require('pako/lib/zlib/zstream');\nvar zlib_deflate = require('pako/lib/zlib/deflate.js');\nvar zlib_inflate = require('pako/lib/zlib/inflate.js');\nvar constants = require('pako/lib/zlib/constants');\n\nfor (var key in constants) {\n exports[key] = constants[key];\n}\n\n// zlib modes\nexports.NONE = 0;\nexports.DEFLATE = 1;\nexports.INFLATE = 2;\nexports.GZIP = 3;\nexports.GUNZIP = 4;\nexports.DEFLATERAW = 5;\nexports.INFLATERAW = 6;\nexports.UNZIP = 7;\n\nvar GZIP_HEADER_ID1 = 0x1f;\nvar GZIP_HEADER_ID2 = 0x8b;\n\n/**\n * Emulate Node's zlib C++ layer for use by the JS layer in index.js\n */\nfunction Zlib(mode) {\n if (typeof mode !== 'number' || mode < exports.DEFLATE || mode > exports.UNZIP) {\n throw new TypeError('Bad argument');\n }\n\n this.dictionary = null;\n this.err = 0;\n this.flush = 0;\n this.init_done = false;\n this.level = 0;\n this.memLevel = 0;\n this.mode = mode;\n this.strategy = 0;\n this.windowBits = 0;\n this.write_in_progress = false;\n this.pending_close = false;\n this.gzip_id_bytes_read = 0;\n}\n\nZlib.prototype.close = function () {\n if (this.write_in_progress) {\n this.pending_close = true;\n return;\n }\n\n this.pending_close = false;\n\n assert(this.init_done, 'close before init');\n assert(this.mode <= exports.UNZIP);\n\n if (this.mode === exports.DEFLATE || this.mode === exports.GZIP || this.mode === exports.DEFLATERAW) {\n zlib_deflate.deflateEnd(this.strm);\n } else if (this.mode === exports.INFLATE || this.mode === exports.GUNZIP || this.mode === exports.INFLATERAW || this.mode === exports.UNZIP) {\n zlib_inflate.inflateEnd(this.strm);\n }\n\n this.mode = exports.NONE;\n\n this.dictionary = null;\n};\n\nZlib.prototype.write = function (flush, input, in_off, in_len, out, out_off, out_len) {\n return this._write(true, flush, input, in_off, in_len, out, out_off, out_len);\n};\n\nZlib.prototype.writeSync = function (flush, input, in_off, in_len, out, out_off, out_len) {\n return this._write(false, flush, input, in_off, in_len, out, out_off, out_len);\n};\n\nZlib.prototype._write = function (async, flush, input, in_off, in_len, out, out_off, out_len) {\n assert.equal(arguments.length, 8);\n\n assert(this.init_done, 'write before init');\n assert(this.mode !== exports.NONE, 'already finalized');\n assert.equal(false, this.write_in_progress, 'write already in progress');\n assert.equal(false, this.pending_close, 'close is pending');\n\n this.write_in_progress = true;\n\n assert.equal(false, flush === undefined, 'must provide flush value');\n\n this.write_in_progress = true;\n\n if (flush !== exports.Z_NO_FLUSH && flush !== exports.Z_PARTIAL_FLUSH && flush !== exports.Z_SYNC_FLUSH && flush !== exports.Z_FULL_FLUSH && flush !== exports.Z_FINISH && flush !== exports.Z_BLOCK) {\n throw new Error('Invalid flush value');\n }\n\n if (input == null) {\n input = Buffer.alloc(0);\n in_len = 0;\n in_off = 0;\n }\n\n this.strm.avail_in = in_len;\n this.strm.input = input;\n this.strm.next_in = in_off;\n this.strm.avail_out = out_len;\n this.strm.output = out;\n this.strm.next_out = out_off;\n this.flush = flush;\n\n if (!async) {\n // sync version\n this._process();\n\n if (this._checkError()) {\n return this._afterSync();\n }\n return;\n }\n\n // async version\n var self = this;\n process.nextTick(function () {\n self._process();\n self._after();\n });\n\n return this;\n};\n\nZlib.prototype._afterSync = function () {\n var avail_out = this.strm.avail_out;\n var avail_in = this.strm.avail_in;\n\n this.write_in_progress = false;\n\n return [avail_in, avail_out];\n};\n\nZlib.prototype._process = function () {\n var next_expected_header_byte = null;\n\n // If the avail_out is left at 0, then it means that it ran out\n // of room. If there was avail_out left over, then it means\n // that all of the input was consumed.\n switch (this.mode) {\n case exports.DEFLATE:\n case exports.GZIP:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflate(this.strm, this.flush);\n break;\n case exports.UNZIP:\n if (this.strm.avail_in > 0) {\n next_expected_header_byte = this.strm.next_in;\n }\n\n switch (this.gzip_id_bytes_read) {\n case 0:\n if (next_expected_header_byte === null) {\n break;\n }\n\n if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID1) {\n this.gzip_id_bytes_read = 1;\n next_expected_header_byte++;\n\n if (this.strm.avail_in === 1) {\n // The only available byte was already read.\n break;\n }\n } else {\n this.mode = exports.INFLATE;\n break;\n }\n\n // fallthrough\n case 1:\n if (next_expected_header_byte === null) {\n break;\n }\n\n if (this.strm.input[next_expected_header_byte] === GZIP_HEADER_ID2) {\n this.gzip_id_bytes_read = 2;\n this.mode = exports.GUNZIP;\n } else {\n // There is no actual difference between INFLATE and INFLATERAW\n // (after initialization).\n this.mode = exports.INFLATE;\n }\n\n break;\n default:\n throw new Error('invalid number of gzip magic number bytes read');\n }\n\n // fallthrough\n case exports.INFLATE:\n case exports.GUNZIP:\n case exports.INFLATERAW:\n this.err = zlib_inflate.inflate(this.strm, this.flush\n\n // If data was encoded with dictionary\n );if (this.err === exports.Z_NEED_DICT && this.dictionary) {\n // Load it\n this.err = zlib_inflate.inflateSetDictionary(this.strm, this.dictionary);\n if (this.err === exports.Z_OK) {\n // And try to decode again\n this.err = zlib_inflate.inflate(this.strm, this.flush);\n } else if (this.err === exports.Z_DATA_ERROR) {\n // Both inflateSetDictionary() and inflate() return Z_DATA_ERROR.\n // Make it possible for After() to tell a bad dictionary from bad\n // input.\n this.err = exports.Z_NEED_DICT;\n }\n }\n while (this.strm.avail_in > 0 && this.mode === exports.GUNZIP && this.err === exports.Z_STREAM_END && this.strm.next_in[0] !== 0x00) {\n // Bytes remain in input buffer. Perhaps this is another compressed\n // member in the same archive, or just trailing garbage.\n // Trailing zero bytes are okay, though, since they are frequently\n // used for padding.\n\n this.reset();\n this.err = zlib_inflate.inflate(this.strm, this.flush);\n }\n break;\n default:\n throw new Error('Unknown mode ' + this.mode);\n }\n};\n\nZlib.prototype._checkError = function () {\n // Acceptable error states depend on the type of zlib stream.\n switch (this.err) {\n case exports.Z_OK:\n case exports.Z_BUF_ERROR:\n if (this.strm.avail_out !== 0 && this.flush === exports.Z_FINISH) {\n this._error('unexpected end of file');\n return false;\n }\n break;\n case exports.Z_STREAM_END:\n // normal statuses, not fatal\n break;\n case exports.Z_NEED_DICT:\n if (this.dictionary == null) {\n this._error('Missing dictionary');\n } else {\n this._error('Bad dictionary');\n }\n return false;\n default:\n // something else.\n this._error('Zlib error');\n return false;\n }\n\n return true;\n};\n\nZlib.prototype._after = function () {\n if (!this._checkError()) {\n return;\n }\n\n var avail_out = this.strm.avail_out;\n var avail_in = this.strm.avail_in;\n\n this.write_in_progress = false;\n\n // call the write() cb\n this.callback(avail_in, avail_out);\n\n if (this.pending_close) {\n this.close();\n }\n};\n\nZlib.prototype._error = function (message) {\n if (this.strm.msg) {\n message = this.strm.msg;\n }\n this.onerror(message, this.err\n\n // no hope of rescue.\n );this.write_in_progress = false;\n if (this.pending_close) {\n this.close();\n }\n};\n\nZlib.prototype.init = function (windowBits, level, memLevel, strategy, dictionary) {\n assert(arguments.length === 4 || arguments.length === 5, 'init(windowBits, level, memLevel, strategy, [dictionary])');\n\n assert(windowBits >= 8 && windowBits <= 15, 'invalid windowBits');\n assert(level >= -1 && level <= 9, 'invalid compression level');\n\n assert(memLevel >= 1 && memLevel <= 9, 'invalid memlevel');\n\n assert(strategy === exports.Z_FILTERED || strategy === exports.Z_HUFFMAN_ONLY || strategy === exports.Z_RLE || strategy === exports.Z_FIXED || strategy === exports.Z_DEFAULT_STRATEGY, 'invalid strategy');\n\n this._init(level, windowBits, memLevel, strategy, dictionary);\n this._setDictionary();\n};\n\nZlib.prototype.params = function () {\n throw new Error('deflateParams Not supported');\n};\n\nZlib.prototype.reset = function () {\n this._reset();\n this._setDictionary();\n};\n\nZlib.prototype._init = function (level, windowBits, memLevel, strategy, dictionary) {\n this.level = level;\n this.windowBits = windowBits;\n this.memLevel = memLevel;\n this.strategy = strategy;\n\n this.flush = exports.Z_NO_FLUSH;\n\n this.err = exports.Z_OK;\n\n if (this.mode === exports.GZIP || this.mode === exports.GUNZIP) {\n this.windowBits += 16;\n }\n\n if (this.mode === exports.UNZIP) {\n this.windowBits += 32;\n }\n\n if (this.mode === exports.DEFLATERAW || this.mode === exports.INFLATERAW) {\n this.windowBits = -1 * this.windowBits;\n }\n\n this.strm = new Zstream();\n\n switch (this.mode) {\n case exports.DEFLATE:\n case exports.GZIP:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflateInit2(this.strm, this.level, exports.Z_DEFLATED, this.windowBits, this.memLevel, this.strategy);\n break;\n case exports.INFLATE:\n case exports.GUNZIP:\n case exports.INFLATERAW:\n case exports.UNZIP:\n this.err = zlib_inflate.inflateInit2(this.strm, this.windowBits);\n break;\n default:\n throw new Error('Unknown mode ' + this.mode);\n }\n\n if (this.err !== exports.Z_OK) {\n this._error('Init error');\n }\n\n this.dictionary = dictionary;\n\n this.write_in_progress = false;\n this.init_done = true;\n};\n\nZlib.prototype._setDictionary = function () {\n if (this.dictionary == null) {\n return;\n }\n\n this.err = exports.Z_OK;\n\n switch (this.mode) {\n case exports.DEFLATE:\n case exports.DEFLATERAW:\n this.err = zlib_deflate.deflateSetDictionary(this.strm, this.dictionary);\n break;\n default:\n break;\n }\n\n if (this.err !== exports.Z_OK) {\n this._error('Failed to set dictionary');\n }\n};\n\nZlib.prototype._reset = function () {\n this.err = exports.Z_OK;\n\n switch (this.mode) {\n case exports.DEFLATE:\n case exports.DEFLATERAW:\n case exports.GZIP:\n this.err = zlib_deflate.deflateReset(this.strm);\n break;\n case exports.INFLATE:\n case exports.INFLATERAW:\n case exports.GUNZIP:\n this.err = zlib_inflate.inflateReset(this.strm);\n break;\n default:\n break;\n }\n\n if (this.err !== exports.Z_OK) {\n this._error('Failed to reset stream');\n }\n};\n\nexports.Zlib = Zlib;"]},"metadata":{},"sourceType":"script"}