web-common-resource/terminal/smartxKs/inflator.js

1 line
18 KiB
JavaScript
Raw Permalink Normal View History

2024-08-20 12:11:35 +00:00
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.inflator=e()}}(function(){return function e(t,i,a){function n(s,o){if(!i[s]){if(!t[s]){var f="function"==typeof require&&require;if(!o&&f)return f(s,!0);if(r)return r(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var d=i[s]={exports:{}};t[s][0].call(d.exports,function(e){var i=t[s][1][e];return n(i||e)},d,d.exports,e,t,i,a)}return i[s].exports}for(var r="function"==typeof require&&require,s=0;s<a.length;s++)n(a[s]);return n}({1:[function(e,t,i){"use strict";var a="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;i.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var i=t.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var a in i)i.hasOwnProperty(a)&&(e[a]=i[a])}}return e},i.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var n={arraySet:function(e,t,i,a,n){if(t.subarray&&e.subarray)return void e.set(t.subarray(i,i+a),n);for(var r=0;r<a;r++)e[n+r]=t[i+r]},flattenChunks:function(e){var t,i,a,n,r,s;for(a=0,t=0,i=e.length;t<i;t++)a+=e[t].length;for(s=new Uint8Array(a),n=0,t=0,i=e.length;t<i;t++)r=e[t],s.set(r,n),n+=r.length;return s}},r={arraySet:function(e,t,i,a,n){for(var r=0;r<a;r++)e[n+r]=t[i+r]},flattenChunks:function(e){return[].concat.apply([],e)}};i.setTyped=function(e){e?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,n)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,r))},i.setTyped(a)},{}],2:[function(e,t,i){"use strict";function a(e,t,i,a){for(var n=65535&e|0,r=e>>>16&65535|0,s=0;0!==i;){s=i>2e3?2e3:i,i-=s;do{n=n+t[a++]|0,r=r+n|0}while(--s);n%=65521,r%=65521}return n|r<<16|0}t.exports=a},{}],3:[function(e,t,i){"use strict";function a(e,t,i,a){var r=n,s=a+i;e^=-1;for(var o=a;o<s;o++)e=e>>>8^r[255&(e^t[o])];return-1^e}var n=function(){for(var e,t=[],i=0;i<256;i++){e=i;for(var a=0;a<8;a++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t}();t.exports=a},{}],4:[function(e,t,i){"use strict";t.exports=function(e,t){var i,a,n,r,s,o,f,l,d,c,h,u,b,m,k,w,v,g,x,p,_,y,z,B,A;i=e.state,a=e.next_in,B=e.input,n=a+(e.avail_in-5),r=e.next_out,A=e.output,s=r-(t-e.avail_out),o=r+(e.avail_out-257),f=i.dmax,l=i.wsize,d=i.whave,c=i.wnext,h=i.window,u=i.hold,b=i.bits,m=i.lencode,k=i.distcode,w=(1<<i.lenbits)-1,v=(1<<i.distbits)-1;e:do{b<15&&(u+=B[a++]<<b,b+=8,u+=B[a++]<<b,b+=8),g=m[u&w];t:for(;;){if(x=g>>>24,u>>>=x,b-=x,0===(x=g>>>16&255))A[r++]=65535&g;else{if(!(16&x)){if(0==(64&x)){g=m[(65535&g)+(u&(1<<x)-1)];continue t}if(32&x){i.mode=12;break e}e.msg="invalid literal/length code",i.mode=30;break e}p=65535&g,x&=15,x&&(b<x&&(u+=B[a++]<<b,b+=8),p+=u&(1<<x)-1,u>>>=x,b-=x),b<15&&(u+=B[a++]<<b,b+=8,u+=B[a++]<<b,b+=8),g=k[u&v];i:for(;;){if(x=g>>>24,u>>>=x,b-=x,!(16&(x=g>>>16&255))){if(0==(64&x)){g=k[(65535&g)+(u&(1<<x)-1)];continue i}e.msg="invalid distance code",i.mode=30;break e}if(_=65535&g,x&=15,b<x&&(u+=B[a++]<<b,(b+=8)<x&&(u+=B[a++]<<b,b+=8)),(_+=u&(1<<x)-1)>f){e.msg="invalid distance too far back",i.mode=30;break e}if(u>>>=x,b-=x,x=r-s,_>x){if((x=_-x)>d&&i.sane){e.msg="invalid distance too far back",i.mode=30;break e}if(y=0,z=h,0===c){if(y+=l-x,x<p){p-=x;do{A[r++]=h[y++]}while(--x);y=r-_,z=A}}else if(c<x){if(y+=l+c-x,(x-=c)<p){p-=x;do{A[r++]=h[y++]}while(--x);if(y=0,c<p){x=c,p-=x;do{A[r++]=h[y++]}while(--x);y=r-_,z=A}}}else if(y+=c-x,x<p){p-=x;do{A[r++]=h[y++]}while(--x);y=r-_,z=A}for(;p>2;)A[r++]=z[y++],A[r++]=z[y++],A[r++]=z[y++],p-=3;p&&(A[r++]=z[y++],p>1&&(A[r++]=z[y++]))}else{y=r-_;do{A[r++]=A[y++],A[r++]=A[y++],A[r++]=A[y++],p-=3}while(p>2);p&&(A[r++]=A[y++],p>1&&(A[r++]=A[y++]))}break}}break}}while(a<n&&r<o);p=b>>3,a-=p,b-=p<<3,u&=(1<<b)-1,e.next_in=a,e.next_out=r,e.avail_in=a<n?n-a+5:5-(a-n),e.avail_out=r<o?o-r+257:257-(r-o),i.hold=u,i.bits=b}},{}],5:[f