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Q,OAAS,OACjB,QAAQ,KAAO,KACf,QAAQ,OAAS,OAEjB,QAAQ,WAAa,WACrB,QAAQ,aAAe,aACvB,QAAQ,WAAa,WACrB,QAAQ,aAAe,aAEvB,QAAQ,eAAiB,eACzB,QAAQ,cAAgB","file":"/npm/compressor@0.1.10/lib/compress/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/compressor@0.1.10/lib/compress/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/*\n * Copyright 2010, Ivan Egorov (egorich.3.04@gmail.com).\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nvar events = require('events');\nvar Buffer = require('buffer').Buffer;\nvar assert = require('assert');\nvar bindings = require('./compress-bindings');\n\nfunction removed(str) {\n  return function() {\n    throw new Error(str);\n  }\n}\n\n\nfunction fallbackConstructor(str) {\n  return function() {\n    throw new Error(str);\n  }\n}\n\n\nfunction inherits(ctor, superCtor) {\n  ctor.prototype = Object.create(superCtor.prototype, {\n      constructor: {\n          value: ctor,\n          enumerable: false\n      }\n  });\n}\n\n\nvar Gzip = bindings.Gzip ||\n           fallbackConstructor('Library built without gzip support.');\nGzip.prototype.init = removed('Use constructor to create new gzip object.');\nGzip.prototype.deflate = removed('Use write() instead.');\nGzip.prototype.end = removed('Use close() instead.');\n\n\nvar Gunzip = bindings.Gunzip ||\n             fallbackConstructor('Library built without gzip support.');\nGunzip.prototype.init = removed('Use constructor to create new gunzip object.');\nGunzip.prototype.inflate = removed('Use write() instead.');\nGunzip.prototype.end = removed('Use close() instead.')\n\n\nvar Bzip = bindings.Bzip ||\n           fallbackConstructor('Library built without bzip support.');\nBzip.prototype.init = removed('Use constructor to create new bzip object.');\nBzip.prototype.deflate = removed('Use write() instead.');\nBzip.prototype.end = removed('Use close() instead.');\n\n\nvar Bunzip = bindings.Bunzip ||\n             fallbackConstructor('Library built without bzip support.');\nBunzip.prototype.init = removed('Use constructor to create new bunzip object.');\nBunzip.prototype.inflate = removed('Use write() instead.');\nBunzip.prototype.end = removed('Use close() instead.')\n\nvar apiWarnings = true;\nfunction setApiWarnings(value) {\n  apiWarnings = value;\n}\n\n\nfunction apiWarning(str) {\n  if (apiWarnings) {\n    console.warn(str);\n  }\n};\n\nfunction hasGzipHeader(data) {\n\t// magic GZIP file header numbers\n\t// see: http://www.gzip.org/zlib/rfc-gzip.html\n\treturn data.length >= 2 && \n\t\tdata[0] == 31 &&   // ID 1\n\t\tdata[1] == 139 &&  // ID 2\n\t\tdata[2] == 8;      // compression method (8 = deflate)\n};\n\n// === CommonStream ===\n// Common base for compress/decompress streams.\nfunction CommonStream(ctor, args) {\n  events.EventEmitter.call(this);\n\n  this.dataQueue_ = [];\n  this.paused_ = false;\n  this.inputEncoding_ = null;\n  this.outputEncoding_ = null;\n  this.readable = true;\n  this.writeable = true;\n\n  this.impl_ = ctor.createInstance_.apply(\n      null, Array.prototype.slice.call(args, 0));\n}\ninherits(CommonStream, events.EventEmitter);\n\n\nCommonStream.prototype.pause = function() {\n  this.paused_ = true;\n};\n\n\nCommonStream.prototype.resume = function() {\n  this.paused_ = false;\n  this.emitData_();\n};\n\n\nCommonStream.prototype.destroy = function() {\n  this.readable = false;\n  this.writeable = false;\n  this.impl_.destroy();\n};\n\n\nCommonStream.prototype.write = function(data, opt_encoding) {\n  if (!this.writeable) {\n    return true;\n  }\n\n  var self = this;\n  var buffer = null;\n\n  var encoding = null;\n  if (!Buffer.isBuffer(data)) {\n    encoding = opt_encoding || this.inputEncoding_ || 'utf8';\n  }\n\n  if (encoding !== null) {\n    // Not buffer input.\n    var len = Buffer.byteLength(data, encoding);\n    if (len > 0) {\n      buffer = new Buffer(len);\n      buffer.write(data, encoding, 0);\n    }\n  } else {\n    buffer = data;\n  }\n\n  if (Buffer.isBuffer(buffer)) {\n    this.impl_.write(buffer, function(err, data) {\n      self.emitEvent_(err, data);\n    });\n  } else {\n    process.nextTick(function() {\n      self.emitEvent_(Error('Fishy input'), null);\n    });\n  }\n  return true;\n};\n\n\nCommonStream.prototype.end = function() {\n  this.writeable = false;\n  this.close();\n};\n\n\nCommonStream.prototype.close = function() {\n  var self = this;\n\n  this.impl_.close(function(err, data) {\n    self.emitEvent_(err, data, true);\n  });\n};\n\n\nCommonStream.prototype.setInputEncoding = function(enc) {\n  apiWarning('setInputEncoding() breaks standard streams API.\\n' +\n      '  The method is an extension to standard API and might be removed in ' +\n      'future.');\n  this.inputEncoding_ = enc;\n};\n\n\nCommonStream.prototype.emitData_ = function() {\n  if (!this.paused_) {\n    for (var i = 0; i < this.dataQueue_.length; ++i) {\n      var data = this.dataQueue_[i];\n      if (data !== null) {\n        this.emit('data', data);\n      } else {\n        this.readable = false;\n        this.emit('end');\n      }\n    }\n    this.dataQueue_.length = 0;\n  }\n};\n\nCommonStream.prototype.emitEvent_ = function(err, data, fin) {\n  if (err) {\n    this.readable = false;\n    this.writeable = false;\n    this.emit('error', err);\n    return;\n  }\n\n  if (data.length != 0) {\n    if (this.outputEncoding_ != 'binary') {\n      var str = data;\n      var len = Buffer.byteLength(str, 'binary');\n      data = new Buffer(len);\n      if (len > 0) {\n        data.write(str, 'binary', 0); \n      }\n\n      if (this.outputEncoding_ != null) {\n        data = data.toString(this.outputEncoding_, 0, data.length);\n      }\n    }\n    this.dataQueue_.push(data);\n  }\n\n  if (fin) {\n    this.dataQueue_.push(null);\n  }\n  this.emitData_();\n};\n\n\n// === CompressStream ===\n// Common base for compression streams.\nfunction CompressStream(ctor, args) {\n  CommonStream.call(this, ctor, args);\n}\ninherits(CompressStream, CommonStream);\n\n\nCompressStream.prototype.setEncoding = function(enc) {\n  assert.equal(enc, 'binary',\n      'CompressStream emits either Buffer or binary string.');\n  this.outputEncoding_ = 'binary';\n};\n\n\n// === DecompressStream ===\n// Common base for decompress streams.\nfunction DecompressStream(ctor, args) {\n  CommonStream.call(this, ctor, args);\n}\ninherits(DecompressStream, CommonStream);\n\n\nDecompressStream.prototype.setEncoding = function(enc) {\n  this.outputEncoding_ = enc;\n};\n\n\n// === GzipStream ===\nfunction GzipStream() {\n  CompressStream.call(this, Gzip, arguments);\n}\ninherits(GzipStream, CompressStream);\n\n\n// === GunzipStream ===\nfunction GunzipStream() {\n  DecompressStream.call(this, Gunzip, arguments);\n}\ninherits(GunzipStream, DecompressStream);\n\n\n// === BzipStream ===\nfunction BzipStream() {\n  CompressStream.call(this, Bzip, arguments);\n}\ninherits(BzipStream, CompressStream);\n\n\n// === BunzipStream ===\nfunction BunzipStream() {\n  DecompressStream.call(this, Bunzip, arguments);\n}\ninherits(BunzipStream, DecompressStream);\n\n\nexports.Gzip = Gzip;\nexports.Gunzip = Gunzip;\nexports.Bzip = Bzip;\nexports.Bunzip = Bunzip;\n\nexports.GzipStream = GzipStream;\nexports.GunzipStream = GunzipStream;\nexports.BzipStream = BzipStream;\nexports.BunzipStream = BunzipStream;\n\nexports.setApiWarnings = setApiWarnings;\nexports.hasGzipHeader = hasGzipHeader;\n"]}