Files
sdk4_demo/sdk/Cesium/ThirdParty/Workers/pako_inflate.min.js

27 lines
21 KiB
JavaScript
Raw Normal View History

2025-07-03 15:12:58 +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(O,B){typeof exports=="object"&&typeof module<"u"?B(exports):typeof define=="function"&&define.amd?define(["exports"],B):B((O=typeof globalThis<"u"?globalThis:O||self).pako={})})(this,function(O){"use strict";var B=(e,i,t,o)=>{let s=65535&e|0,r=e>>>16&65535|0,h=0;for(;t!==0;){h=t>2e3?2e3:t,t-=h;do s=s+i[o++]|0,r=r+s|0;while(--h);s%=65521,r%=65521}return s|r<<16|0};const pt=new Uint32Array((()=>{let e,i=[];for(var t=0;t<256;t++){e=t;for(var o=0;o<8;o++)e=1&e?3988292384^e>>>1:e>>>1;i[t]=e}return i})());var U=(e,i,t,o)=>{const s=pt,r=o+t;e^=-1;for(let h=o;h<r;h++)e=e>>>8^s[255&(e^i[h])];return-1^e},vt=function(e,i){let t,o,s,r,h,l,g,n,a,Z,w,d,S,p,u,y,k,f,_,E,c,x,m,b;const v=e.state;t=e.next_in,m=e.input,o=t+(e.avail_in-5),s=e.next_out,b=e.output,r=s-(i-e.avail_out),h=s+(e.avail_out-257),l=v.dmax,g=v.wsize,n=v.whave,a=v.wnext,Z=v.window,w=v.hold,d=v.bits,S=v.lencode,p=v.distcode,u=(1<<v.lenbits)-1,y=(1<<v.distbits)-1;t:do{d<15&&(w+=m[t++]<<d,d+=8,w+=m[t++]<<d,d+=8),k=S[w&u];e:for(;;){if(f=k>>>24,w>>>=f,d-=f,f=k>>>16&255,f===0)b[s++]=65535&k;else{if(!(16&f)){if((64&f)==0){k=S[(65535&k)+(w&(1<<f)-1)];continue e}if(32&f){v.mode=12;break t}e.msg="invalid literal/length code",v.mode=30;break t}_=65535&k,f&=15,f&&(d<f&&(w+=m[t++]<<d,d+=8),_+=w&(1<<f)-1,w>>>=f,d-=f),d<15&&(w+=m[t++]<<d,d+=8,w+=m[t++]<<d,d+=8),k=p[w&y];i:for(;;){if(f=k>>>24,w>>>=f,d-=f,f=k>>>16&255,!(16&f)){if((64&f)==0){k=p[(65535&k)+(w&(1<<f)-1)];continue i}e.msg="invalid distance code",v.mode=30;break t}if(E=65535&k,f&=15,d<f&&(w+=m[t++]<<d,d+=8,d<f&&(w+=m[t++]<<d,d+=8)),E+=w&(1<<f)-1,E>l){e.msg="invalid distance too far back",v.mode=30;break t}if(w>>>=f,d-=f,f=s-r,E>f){if(f=E-f,f>n&&v.sane){e.msg="invalid distance too far back",v.mode=30;break t}if(c=0,x=Z,a===0){if(c+=g-f,f<_){_-=f;do b[s++]=Z[c++];while(--f);c=s-E,x=b}}else if(a<f){if(c+=g+a-f,f-=a,f<_){_-=f;do b[s++]=Z[c++];while(--f);if(c=0,a<_){f=a,_-=f;do b[s++]=Z[c++];while(--f);c=s-E,x=b}}}else if(c+=a-f,f<_){_-=f;do b[s++]=Z[c++];while(--f);c=s-E,x=b}for(;_>2;)b[s++]=x[c++],b[s++]=x[c++],b[s++]=x[c++],_-=3;_&&(b[s++]=x[c++],_>1&&(b[s++]=x[c++]))}else{c=s-E;do b[s++]=b[c++],b[s++]=b[c++],b[s++]=b[c++],_-=3;while(_>2);_&&(b[s++]=b[c++],_>1&&(b[s++]=b[c++]))}break}}break}}while(t<o&&s<h);_=d>>3,t-=_,d-=_<<3,w&=(1<<d)-1,e.next_in=t,e.next_out=s,e.avail_in=t<o?o-t+5:5-(t-o),e.avail_out=s<h?h-s+257:257-(s-h),v.hold=w,v.bits=d};const H=15,xt=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),yt=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Et=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Rt=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var z=(e,i,t,o,s,r,h,l)=>{const g=l.bits;let n,a,Z,w,d,S,p=0,u=0,y=0,k=0,f=0,_=0,E=0,c=0,x=0,m=0,b=null,v=0;const A=new Uint16Array(16),N=new Uint16Array(16);let _t,K,P,Y=null,gt=0;for(p=0;p<=H;p++)A[p]=0;for(u=0;u<o;u++)A[i[t+u]]++;for(f=g,k=H;k>=1&&A[k]===0;k--);if(f>k&&(f=k),k===0)return s[r++]=20971520,s[r++]=20971520,l.bits=1,0;for(y=1;y<k&&A[y]===0;y++);for(f<y&&(f=y),c=1,p=1;p<=H;p++)if(c<<=1,c-=A[p],c<0)return-1;if(c>0&&(e===0||k!==1))return-1;for(N[1]=0,p=1;p<H;p++)N[p+1]=N[p]+A[p];for(u=0;u<o;u++)i[t+u]!==0&&(h[N[i[t+u]]++]=u);if(e===0?(b=Y=h,S=19):e===1?(b=xt,v-=257,Y=yt,gt-=257,S=256):(b=Et,Y=Rt,S=-1),m=0,u=0,p=y,d=r,_=f,E=0,Z=-1,x=1<<f,w=x-1,e===1&&x>852||e===2&&x>592)return 1;for(;;){_t=p-E,h[u]<S?(K=0,P=h[u]):h[u]>S?(K=Y[gt+h[u]],P=b[v+h[u]]):(K=96,P=0),n=1<<p-E,a=1<<_,y=a;do a-=n,s[d+(m>>E)+a]=_t<<24|K<<16|P|0;while(a!==0);for(n=1<<p-1;m&n;)n>>=1;if(n!==0?(m&=n-1,m+=n):m=0,u++,--A[p]==0){if(p===k)break;p=i[t+h[u]]}if(p>f&&(m&w)!==Z){for(E===0&&(E=f),d+=y,_=p-E,c=1<<_;_+E<k&&(c-=A[_+E],!(c<=0));)_++,c<<=1;if(x+=1<<_,e===1&&x>852||e===2&&x>592)return 1;Z=m&w,s[Z]=f<<24|_<<16|d-r|0}}return m!==0&&(s[d+m]=p-E<<2