biofriction-wp-theme/node_modules/unbzip2-stream/dist/unbzip2-stream.min.js

2 lines
82 KiB
JavaScript
Raw Normal View History

2021-10-26 14:18:09 +02:00
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.unbzip2Stream=e()}}(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){(function(Buffer){var through=require("through");var bz2=require("./lib/bzip2");var bitIterator=require("./lib/bit_iterator");module.exports=unbzip2Stream;function unbzip2Stream(){var bufferQueue=[];var hasBytes=0;var blockSize=0;var broken=false;var done=false;var bitReader=null;var streamCRC=null;function decompressBlock(push){if(!blockSize){blockSize=bz2.header(bitReader);return true}else{var bufsize=1e5*blockSize;var buf=new Int32Array(bufsize);var chunk=[];var f=function(b){chunk.push(b)};streamCRC=bz2.decompress(bitReader,f,buf,bufsize,streamCRC);if(streamCRC===null){blockSize=0;return false}else{push(new Buffer(chunk));return true}}}var outlength=0;function decompressAndQueue(stream){if(broken)return;try{return decompressBlock(function(d){stream.queue(d);if(d!==null){outlength+=d.length}else{}})}catch(e){stream.emit("error",e);broken=true;return false}}return through(function write(data){bufferQueue.push(data);hasBytes+=data.length;if(bitReader===null){bitReader=bitIterator(function(){return bufferQueue.shift()})}while(!broken&&hasBytes-bitReader.bytesRead+1>=(25e3+1e5*blockSize||4)){decompressAndQueue(this)}},function end(x){while(!broken&&hasBytes>bitReader.bytesRead){decompressAndQueue(this)}if(!broken){if(streamCRC!==null)stream.emit("error",new Error("input stream ended prematurely"));this.queue(null)}})}}).call(this,require("buffer").Buffer)},{"./lib/bit_iterator":2,"./lib/bzip2":3,buffer:6,through:27}],2:[function(require,module,exports){var BITMASK=[0,1,3,7,15,31,63,127,255];module.exports=function bitIterator(nextBuffer){var bit=0,byte=0;var bytes=nextBuffer();var f=function(n){if(n===null&&bit!=0){bit=0;byte++;return}var result=0;while(n>0){if(byte>=bytes.length){byte=0;bytes=nextBuffer()}var left=8-bit;if(bit===0&&n>0)f.bytesRead++;if(n>=left){result<<=left;result|=BITMASK[left]&bytes[byte++];bit=0;n-=left}else{result<<=n;result|=(bytes[byte]&BITMASK[n]<<8-n-bit)>>8-n-bit;bit+=n;n=0}}return result};f.bytesRead=0;return f}},{}],3:[function(require,module,exports){function Bzip2Error(message){this.name="Bzip2Error";this.message=message;this.stack=(new Error).stack}Bzip2Error.prototype=new Error;var message={Error:function(message){throw new Bzip2Error(message)}};var bzip2={};bzip2.Bzip2Error=Bzip2Error;bzip2.crcTable=[0,79764919,159529838,222504665,319059676,398814059,445009330,507990021,638119352,583659535,797628118,726387553,890018660,835552979,1015980042,944750013,1276238704,1221641927,1167319070,1095957929,1595256236,1540665371,1452775106,1381403509,1780037320,1859660671,1671105958,1733955601,2031960084,2111593891,1889500026,1952343757,2552477408,2632100695,2443283854,2506133561,2334638140,2414271883,2191915858,2254759653,3190512472,3135915759,3081330742,3009969537,2905550212,2850959411,2762807018,2691435357,3560074640,3505614887,3719321342,3648080713,3342211916,3287746299,3467911202,3396681109,4063920168,4143685023,4223187782,4286162673,3779000052,3858754371,3904687514,3967668269,881225847,809987520,1023691545,969234094,662832811,591600412,771767749,717299826,311336399,374308984,453813921,533576470,25881363,88864420,134795389,214552010,2023205639,2086057648,1897238633,1976864222,1804852699,1867694188,1645340341,1724971778,1587496639,1516133128,1461550545,1406951526,1302016099,1230646740,1142491917,10879034