Files
sdk4.0/static/Cesium/ThirdParty/Workers/pako_deflate.min.js

27 lines
26 KiB
JavaScript
Raw Permalink Normal View History

2025-07-03 13:54:01 +08:00
/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.98
*
* Copyright 2011-2022 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
/*! pako 2.0.4 https://github.com/nodeca/pako @license (MIT AND Zlib) */(function(y,z){typeof exports=="object"&&typeof module<"u"?z(exports):typeof define=="function"&&define.amd?define(["exports"],z):z((y=typeof globalThis<"u"?globalThis:y||self).pako={})})(this,function(y){"use strict";function z(e){let n=e.length;for(;--n>=0;)e[n]=0}const he=256,ze=286,H=30,M=15,oe=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),$=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),ea=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),ke=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),E=new Array(576);z(E);const P=new Array(60);z(P);const j=new Array(512);z(j);const K=new Array(256);z(K);const de=new Array(29);z(de);const ee=new Array(H);function ue(e,n,r,i,a){this.static_tree=e,this.extra_bits=n,this.extra_base=r,this.elems=i,this.max_length=a,this.has_stree=e&&e.length}let xe,Ae,Ee;function fe(e,n){this.dyn_tree=e,this.max_code=0,this.stat_desc=n}z(ee);const Ze=e=>e<256?j[e]:j[256+(e>>>7)],Y=(e,n)=>{e.pending_buf[e.pending++]=255&n,e.pending_buf[e.pending++]=n>>>8&255},w=(e,n,r)=>{e.bi_valid>16-r?(e.bi_buf|=n<<e.bi_valid&65535,Y(e,e.bi_buf),e.bi_buf=n>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=n<<e.bi_valid&65535,e.bi_valid+=r)},k=(e,n,r)=>{w(e,r[2*n],r[2*n+1])},Re=(e,n)=>{let r=0;do r|=1&e,e>>>=1,r<<=1;while(--n>0);return r>>>1},Ue=(e,n,r)=>{const i=new Array(16);let a,_,t=0;for(a=1;a<=M;a++)i[a]=t=t+r[a-1]<<1;for(_=0;_<=n;_++){let s=e[2*_+1];s!==0&&(e[2*_]=Re(i[s]++,s))}},Se=e=>{let n;for(n=0;n<ze;n++)e.dyn_ltree[2*n]=0;for(n=0;n<H;n++)e.dyn_dtree[2*n]=0;for(n=0;n<19;n++)e.bl_tree[2*n]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0},Te=e=>{e.bi_valid>8?Y(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Le=(e,n,r,i)=>{const a=2*n,_=2*r;return e[a]<e[_]||e[a]===e[_]&&i[n]<=i[r]},ce=(e,n,r)=>{const i=e.heap[r];let a=r<<1;for(;a<=e.heap_len&&(a<e.heap_len&&Le(n,e.heap[a+1],e.heap[a],e.depth)&&a++,!Le(n,i,e.heap[a],e.depth));)e.heap[r]=e.heap[a],r=a,a<<=1;e.heap[r]=i},Fe=(e,n,r)=>{let i,a,_,t,s=0;if(e.last_lit!==0)do i=e.pending_buf[e.d_buf+2*s]<<8|e.pending_buf[e.d_buf+2*s+1],a=e.pending_buf[e.l_buf+s],s++,i===0?k(e,a,n):(_=K[a],k(e,_+he+1,n),t=oe[_],t!==0&&(a-=de[_],w(e,a,t)),i--,_=Ze(i),k(e,_,r),t=$[_],t!==0&&(i-=ee[_],w(e,i,t)));while(s<e.last_lit);k(e,256,n)},pe=(e,n)=>{const r=n.dyn_tree,i=n.stat_desc.static_tree,a=n.stat_desc.has_stree,_=n.stat_desc.elems;let t,s,h,l=-1;for(e.heap_len=0,e.heap_max=573,t=0;t<_;t++)r[2*t]!==0?(e.heap[++e.heap_len]=l=t,e.depth[t]=0):r[2*t+1]=0;for(;e.heap_len<2;)h=e.heap[++e.heap_len]=l<2?++l:0,r[2*h]=1,e.depth[h]=0,e.opt_len--,a&&(e.static_len-=i[2*h+1]);for(n.max_code=l,t=e.heap_len>>1;t>=1;t--)ce(e,r,t);h=_;do t=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ce(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=t,e.heap[--e.heap_max]=s,r[2*h]=r[2*t]+r[2*s],e.depth[h]=(e.depth[t]>=e.depth[s]?e.depth[t]:e.depth[s])+1,r[2*t+1]=r[2*s+1]=h,e.heap[1]=h++,ce(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((o,u)=>{const g=u.dyn_tree,c=u.max_code,te=u.stat_desc.static_tree,La=u.stat_desc.has_stree,Fa=u.stat_desc.extra_bits,$e=u.stat_desc.extra_base,Q=u.stat_desc.max_length;let V,v,B,f,_e,ye,le=0;for(f=0;f<=M;f++)o.bl_count[f]=0;for(g[2*o.heap[o.heap_max]+1]=0,V=o.heap_max+1;V<573;V++)v=o.heap[V],f=g[2*g[2*v+1]+1]+1,f>Q&&(f=Q,le++),g[2*v+1]=f,v>c||(o.bl_count[f]++,_e=0,v>=$e&&(_e=Fa[v-$e]),ye=g[2*v],o.opt_len+=ye*(f+_e),La&&(o.static_len+=ye*(te[2*v+1]+_e)));if(le!==0){do{for(f=Q-1;o.bl_count[f]===0;)f--;o.bl_count[f]--,o.bl_count[f+1]+=2,o.bl_count[Q]--,le-=2}while(le>0);for(f=Q;f!==0;f--)for(v=o.bl_count[f];v!==0;)B=o.heap[--V],B>c||(g[2*B+1]!==f&&(o.opt_len+=(f-g[2*B+1])*g[2*B],g[2*B+1]=f),v--)}})(e,n),Ue(r,l,e.bl_count)},Oe=(e,n,r)=>{let i,a,_=-1,t=n[1],s=0,h=7,l=4;for(t===0&&(h=138,l=3),n[2*(r+1)+1]=65535,i=0;i<=r;i++)a=t,t=n[2*(i+1)+1],++s<h&&a===t||(s<l?e.bl_tree[2*a]+=s:a!==0?(a!==_&&e.bl_tree[2*a]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s