text: /**
   * skylark-data-compression - The skylark compression utility library
   * @author Hudaokeji Co.,Ltd
   * @version v0.9.0
   * @link www.skylarkjs.org
   * @license MIT
   */
  define(["./trees","./adler32","./crc32","./messages","./constants"],function(t,e,a,s,i){"use strict";const{_tr_init:n,_tr_stored_block:r,_tr_flush_block:h,_tr_tally:l,_tr_align:_}=t,{Z_NO_FLUSH:d,Z_PARTIAL_FLUSH:o,Z_FULL_FLUSH:g,Z_FINISH:u,Z_BLOCK:c,Z_OK:p,Z_STREAM_END:f,Z_STREAM_ERROR:w,Z_DATA_ERROR:m,Z_BUF_ERROR:z,Z_DEFAULT_COMPRESSION:k,Z_FILTERED:b,Z_HUFFMAN_ONLY:v,Z_RLE:x,Z_FIXED:y,Z_DEFAULT_STRATEGY:A,Z_UNKNOWN:U,Z_DEFLATED:R}=__module__4,Z=286,E=30,F=19,L=2*Z+1,S=15,N=(t,e)=>(t.msg=s[e],e),O=t=>(t<<1)-(t>4?9:0),T=t=>{let e=t.length;for(;--e>=0;)t[e]=0};let D=(t,e,a)=>(e<<t.hash_shift^a)&t.hash_mask;const I=t=>{const e=t.state;let a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},H=(t,e)=>{h(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,I(t.strm)},C=(t,e)=>{t.pending_buf[t.pending++]=e},K=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},M=(t,s,i,n)=>{let r=t.avail_in;return r>n&&(r=n),0===r?0:(t.avail_in-=r,s.set(t.input.subarray(t.next_in,t.next_in+r),i),1===t.state.wrap?t.adler=e(t.adler,s,r,i):2===t.state.wrap&&(t.adler=a(t.adler,s,r,i)),t.next_in+=r,t.total_in+=r,r)},B=(t,e)=>{let a,s,i=t.max_chain_length,n=t.strstart,r=t.prev_length,h=t.nice_match;const l=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,_=t.window,d=t.w_mask,o=t.prev,g=t.strstart+258;let u=_[n+r-1],c=_[n+r];t.prev_length>=t.good_match&&(i>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+r]===c&&_[a+r-1]===u&&_[a]===_[n]&&_[++a]===_[n+1]){n+=2,a++;do{}while(_[++n]===_[++a]&&_[++n]===_[++a]&&_[++n]===_[++a]&&_[++n]===_[++a]&&_[++n]===_[++a]&&_[++n]===_[++a]&&_[++n]===_[++a]&&_[++n]===_[++a]&&n<g);if(s=258-(g-n),n=g-258,s>r){if(t.match_start=e,r=s,s>=h)break;u=_[n+r-1],c=_[n+r]}}}while((e=o[e&d])>l&&0!=--i);return r<=t.lookahead?r:t.lookahead},P=t=>{const e=t.w_size;let a,s,i,n,r;do{if(n=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-262)){t.window.set(t.window.subarray(e,e+e),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,a=s=t.hash_size;do{i=t.head[--a],t.head[a]=i>=e?i-e:0}while(--s);a=s=e;do{i=t.prev[--a],t.prev[a]=i>=e?i-e:0}while(--s);n+=e}if(0===t.strm.avail_in)break;if(s=M(t.strm,t.window,t.strstart+t.lookahead,n),t.lookahead+=s,t.lookahead+t.insert>=3)for(r=t.strstart-t.insert,t.ins_h=t.window[r],t.ins_h=D(t,t.ins_h,t.window[r+1]);t.insert&&(t.ins_h=D(t,t.ins_h,t.window[r+3-1]),t.prev[r&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=r,r++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<262&&0!==t.strm.avail_in)},Y=(t,e)=>{let a,s;for(;;){if(t.lookahead<262){if(P(t),t.lookahead<262&&e===d)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=D(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-262&&(t.match_length=B(t,a)),t.match_length>=3)if(s=l(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=D(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=D(t,t.ins_h,t.window[t.strstart+1]);else s=l(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(s&&(H(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===u?(H(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(H(t,!1),0===t.strm.avail_out)?1:2},j=(t,e)=>{let a,s,i;for(;;){if(t.lookahead<262){if(P(t),t.lookahead<262&&e===d)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=D(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-262&&(t.match_length=B(t,a),t.match_length<=5&&(t.strategy===b||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-3,s=l(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=i&&(t.ins_h=D(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,s&&(H(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((s=l(t,0,t.window[t.strstart-1]))&&H(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(s=l(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===u?(H(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(H(t,!1),0===t.strm.avail_out)?1:2};function G(t,e,a,s,i){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=s,this.func=i}const W=[new G(0,0,0,0,(t,e)=>{let a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(P(t),0===t.lookahead&&e===d)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;const s=t.block_start+a;if((0===t.strstart||t.strstart>=s)&&(t.lookahead=t.strstart-s,t.strstart=s,H(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-262&&(H(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===u?(H(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(H(t,!1),t.strm.avail_out),1)}),new G(4,4,8,4,Y),new G(4,5,16,8,Y),new G(4,6,32,32,Y),new G(4,4,16,16,j),new G(8,16,32,32,j),new G(8,16,128,128,j),new G(8,32,128,256,j),new G(32,128,258,1024,j),new G(32,258,258,4096,j)];const X=t=>{if(!t||!t.state)return N(t,w);t.total_in=t.total_out=0,t.data_type=U;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:113,t.adler=2===e.wrap?0:1,e.last_flush=d,n(e),p},q=t=>{const e=X(t);return e===p&&((J=t.state).window_size=2*J.w_size,T(J.head),J.max_lazy_match=W[J.level].max_lazy,J.good_match=W[J.level].good_length,J.nice_match=W[J.level].nice_length,J.max_chain_length=W[J.level].max_chain,J.strstart=0,J.block_start=0,J.lookahead=0,J.insert=0,J.match_length=J.prev_length=2,J.match_available=0,J.ins_h=0),e};var J;const Q=(t,e,a,s,i,n)=>{if(!t)return w;let r=1;if(e===k&&(e=6),s<0?(r=0,s=-s):s>15&&(r=2,s-=16),i<1||i>9||a!==R||s<8||s>15||e<0||e>9||n<0||n>y)return N(t,w);8===s&&(s=9);const h=new function(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=R,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(2*L),this.dyn_dtree=new Uint16Array(2*(2*E+1)),this.bl_tree=new Uint16Array(2*(2*F+1)),T(this.dyn_ltree),T(this.dyn_dtree),T(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(S+1),this.heap=new Uint16Array(2*Z+1),T(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Z+1),T(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0};return t.state=h,h.strm=t,h.wrap=r,h.gzhead=null,h.w_bits=s,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=i+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<i+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=n,h.method=a,q(t)};return{deflateInit:(t,e)=>Q(t,e,R,15,8,A),deflateInit2:Q,deflateReset:q,deflateResetKeep:X,deflateSetHeader:(t,e)=>t&&t.state?2!==t.state.wrap?w:(t.state.gzhead=e,p):w,deflate:(t,e)=>{let s,i;if(!t||!t.state||e>c||e<0)return t?N(t,w):w;const n=t.state;if(!t.output||!t.input&&0!==t.avail_in||666===n.status&&e!==u)return N(t,0===t.avail_out?z:w);n.strm=t;const h=n.last_flush;if(n.last_flush=e,42===n.status)if(2===n.wrap)t.adler=0,C(n,31),C(n,139),C(n,8),n.gzhead?(C(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),C(n,255&n.gzhead.time),C(n,n.gzhead.time>>8&255),C(n,n.gzhead.time>>16&255),C(n,n.gzhead.time>>24&255),C(n,9===n.level?2:n.strategy>=v||n.level<2?4:0),C(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(C(n,255&n.gzhead.extra.length),C(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=a(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(C(n,0),C(n,0),C(n,0),C(n,0),C(n,0),C(n,9===n.level?2:n.strategy>=v||n.level<2?4:0),C(n,3),n.status=113);else{let e=R+(n.w_bits-8<<4)<<8,a=-1;e|=(a=n.strategy>=v||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(e|=32),e+=31-e%31,n.status=113,K(n,e),0!==n.strstart&&(K(n,t.adler>>>16),K(n,65535&t.adler)),t.adler=1}if(69===n.status)if(n.gzhead.extra){for(s=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>s&&(t.adler=a(t.adler,n.pending_buf,n.pending-s,s)),I(t),s=n.pending,n.pending!==n.pending_buf_size));)C(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>s&&(t.adler=a(t.adler,n.pending_buf,n.pending-s,s)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){s=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>s&&(t.adler=a(t.adler,n.pending_buf,n.pending-s,s)),I(t),s=n.pending,n.pending===n.pending_buf_size)){i=1;break}i=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,C(n,i)}while(0!==i);n.gzhead.hcrc&&n.pending>s&&(t.adler=a(t.adler,n.pending_buf,n.pending-s,s)),0===i&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){s=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>s&&(t.adler=a(t.adler,n.pending_buf,n.pending-s,s)),I(t),s=n.pending,n.pending===n.pending_buf_size)){i=1;break}i=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,C(n,i)}while(0!==i);n.gzhead.hcrc&&n.pending>s&&(t.adler=a(t.adler,n.pending_buf,n.pending-s,s)),0===i&&(n.status=103)}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&I(t),n.pending+2<=n.pending_buf_size&&(C(n,255&t.adler),C(n,t.adler>>8&255),t.adler=0,n.status=113)):n.status=113),0!==n.pending){if(I(t),0===t.avail_out)return n.last_flush=-1,p}else if(0===t.avail_in&&O(e)<=O(h)&&e!==u)return N(t,z);if(666===n.status&&0!==t.avail_in)return N(t,z);if(0!==t.avail_in||0!==n.lookahead||e!==d&&666!==n.status){let a=n.strategy===v?((t,e)=>{let a;for(;;){if(0===t.lookahead&&(P(t),0===t.lookahead)){if(e===d)return 1;break}if(t.match_length=0,a=l(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(H(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===u?(H(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(H(t,!1),0===t.strm.avail_out)?1:2})(n,e):n.strategy===x?((t,e)=>{let a,s,i,n;const r=t.window;for(;;){if(t.lookahead<=258){if(P(t),t.lookahead<=258&&e===d)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(s=r[i=t.strstart-1])===r[++i]&&s===r[++i]&&s===r[++i]){n=t.strstart+258;do{}while(s===r[++i]&&s===r[++i]&&s===r[++i]&&s===r[++i]&&s===r[++i]&&s===r[++i]&&s===r[++i]&&s===r[++i]&&i<n);t.match_length=258-(n-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=l(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=l(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(H(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===u?(H(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(H(t,!1),0===t.strm.avail_out)?1:2})(n,e):W[n.level].func(n,e);if(3!==a&&4!==a||(n.status=666),1===a||3===a)return 0===t.avail_out&&(n.last_flush=-1),p;if(2===a&&(e===o?_(n):e!==c&&(r(n,0,0,!1),e===g&&(T(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),I(t),0===t.avail_out))return n.last_flush=-1,p}return e!==u?p:n.wrap<=0?f:(2===n.wrap?(C(n,255&t.adler),C(n,t.adler>>8&255),C(n,t.adler>>16&255),C(n,t.adler>>24&255),C(n,255&t.total_in),C(n,t.total_in>>8&255),C(n,t.total_in>>16&255),C(n,t.total_in>>24&255)):(K(n,t.adler>>>16),K(n,65535&t.adler)),I(t),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?p:f)},deflateEnd:t=>{if(!t||!t.state)return w;const e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&103!==e&&113!==e&&666!==e?N(t,w):(t.state=null,113===e?N(t,m):p)},deflateSetDictionary:(t,a)=>{let s=a.length;if(!t||!t.state)return w;const i=t.state,n=i.wrap;if(2===n||1===n&&42!==i.status||i.lookahead)return w;if(1===n&&(t.adler=e(t.adler,a,s,0)),i.wrap=0,s>=i.w_size){0===n&&(T(i.head),i.strstart=0,i.block_start=0,i.insert=0);let t=new Uint8Array(i.w_size);t.set(a.subarray(s-i.w_size,s),0),a=t,s=i.w_size}const r=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=s,t.next_in=0,t.input=a,P(i);i.lookahead>=3;){let t=i.strstart,e=i.lookahead-2;do{i.ins_h=D(i,i.ins_h,i.window[t+3-1]),i.prev[t&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=t,t++}while(--e);i.strstart=t,i.lookahead=2,P(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=h,t.input=l,t.avail_in=r,i.wrap=n,p},deflateInfo:"pako deflate (from Nodeca project)"}});
  //# sourceMappingURL=../sourcemaps/zlib/deflate.js.map
  