@cesium/engine 9.0.0 → 9.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Build/ThirdParty/Workers/z-worker-pako.js +6 -5
- package/Build/Workers/{chunk-ZNVSKMQ2.js → chunk-2CSEEWHN.js} +6 -6
- package/Build/Workers/{chunk-2ZBL3MVO.js → chunk-34DGOKCO.js} +10 -12
- package/Build/Workers/{chunk-QKBGRKKG.js → chunk-3RZK5NNV.js} +4 -4
- package/Build/Workers/{chunk-RV7ZOSS6.js → chunk-3S2MFY4B.js} +13 -13
- package/Build/Workers/{chunk-5TIV3L26.js → chunk-4AJGCQFX.js} +13 -13
- package/Build/Workers/{chunk-YV4H2Y7M.js → chunk-4KIUON73.js} +4 -4
- package/Build/Workers/{chunk-QCQUZGXI.js → chunk-4PHPQRSH.js} +4 -4
- package/Build/Workers/{chunk-HBQPB6IH.js → chunk-66E3H2KU.js} +12 -12
- package/Build/Workers/{chunk-TJBU6GML.js → chunk-6HCAQOVK.js} +6 -6
- package/Build/Workers/{chunk-VR5RBW52.js → chunk-7LPEGKOF.js} +7 -7
- package/Build/Workers/{chunk-MWV7IZK4.js → chunk-7VZNXIKG.js} +7 -7
- package/Build/Workers/{chunk-SE4PXOEA.js → chunk-A6NCZSL3.js} +19 -19
- package/Build/Workers/{chunk-Z7FQLK6N.js → chunk-AOFMPKUB.js} +4 -4
- package/Build/Workers/{chunk-73FKKY52.js → chunk-AOIKO5Y7.js} +5 -5
- package/Build/Workers/{chunk-YDVSBWEO.js → chunk-BDUJXBVF.js} +1 -1
- package/Build/Workers/{chunk-ADOVHYWO.js → chunk-C5CE4OG6.js} +469 -6
- package/Build/Workers/{chunk-LQJ5FFFR.js → chunk-CE6GTZ4I.js} +11 -13
- package/Build/Workers/{chunk-DGDUKCJJ.js → chunk-CYAJYEKW.js} +6 -6
- package/Build/Workers/{chunk-NP2GYYE5.js → chunk-FOZQIHZK.js} +6 -6
- package/Build/Workers/{chunk-L4BW3RUA.js → chunk-G7CJQKKD.js} +7 -7
- package/Build/Workers/{chunk-CO35JNNE.js → chunk-GIFJ77E4.js} +4 -4
- package/Build/Workers/{chunk-7COR472O.js → chunk-I5TDPPC4.js} +7197 -5096
- package/Build/Workers/{chunk-RMOEYCZW.js → chunk-IBXGK4WV.js} +2 -2
- package/Build/Workers/{chunk-GFA4SMXV.js → chunk-JI2445T5.js} +11 -11
- package/Build/Workers/{chunk-5R6VWLMH.js → chunk-KPY4F4BW.js} +6 -6
- package/Build/Workers/{chunk-C3XBUYBO.js → chunk-LVJCR7DH.js} +17 -17
- package/Build/Workers/{chunk-X2F6BEPY.js → chunk-LW7WGHEU.js} +16 -16
- package/Build/Workers/{chunk-BCU2LH5T.js → chunk-MWYZ64MH.js} +10 -10
- package/Build/Workers/chunk-NI2R52QD.js +961 -0
- package/Build/Workers/{chunk-I37B3MZ2.js → chunk-PEABJLCK.js} +1 -1
- package/Build/Workers/{chunk-P2YAAMT2.js → chunk-PK7TEP3J.js} +15 -15
- package/Build/Workers/{chunk-3NCVAGDA.js → chunk-POLFRINT.js} +14 -14
- package/Build/Workers/{chunk-E6WXPSJS.js → chunk-PS6AEMBR.js} +7 -7
- package/Build/Workers/{chunk-M2AYBTNH.js → chunk-PWF3YJJ5.js} +13 -13
- package/Build/Workers/{chunk-2632RVPI.js → chunk-QKF7XXEQ.js} +7 -7
- package/Build/Workers/{chunk-EOXYZ34O.js → chunk-RL73GOEF.js} +2 -2
- package/Build/Workers/{chunk-6WF3KIF5.js → chunk-RR7EOKGZ.js} +10 -10
- package/Build/Workers/{chunk-GXUXEOE2.js → chunk-S4XDCPKD.js} +1 -1
- package/Build/Workers/{chunk-NZWNZA6S.js → chunk-TMMOULW3.js} +5 -5
- package/Build/Workers/{chunk-SS4ESNE3.js → chunk-U4IMCOF5.js} +2 -2
- package/Build/Workers/{chunk-PXB7T27O.js → chunk-UAJEGIWA.js} +6 -6
- package/Build/Workers/{chunk-TZORKRNK.js → chunk-UCPPWV64.js} +1 -1
- package/Build/Workers/{chunk-EPKE7GE3.js → chunk-V7JB576Q.js} +5 -5
- package/Build/Workers/{chunk-DPUSFA7S.js → chunk-WEGCQ5DY.js} +6 -6
- package/Build/Workers/{chunk-N4KXMWQU.js → chunk-WFICTTOE.js} +2 -2
- package/Build/Workers/{chunk-P4XKB3QZ.js → chunk-WWP3I7R5.js} +5 -5
- package/Build/Workers/{chunk-WHUSTDIB.js → chunk-XHLDDE65.js} +10 -10
- package/Build/Workers/{chunk-24YTYWNB.js → chunk-XWML5Y7N.js} +11 -13
- package/Build/Workers/{chunk-C6OI26DR.js → chunk-YLZTCEBJ.js} +1 -1
- package/Build/Workers/{chunk-LAQP3SCC.js → chunk-ZC4AGBZK.js} +2 -2
- package/Build/Workers/{chunk-RSJXEO2A.js → chunk-ZDP32RQI.js} +2 -2
- package/Build/Workers/{chunk-ZYPTP7GS.js → chunk-ZWPIM77Q.js} +11 -11
- package/Build/Workers/combineGeometry.js +22 -24
- package/Build/Workers/createBoxGeometry.js +16 -18
- package/Build/Workers/createBoxOutlineGeometry.js +14 -16
- package/Build/Workers/createCircleGeometry.js +24 -26
- package/Build/Workers/createCircleOutlineGeometry.js +17 -19
- package/Build/Workers/createCoplanarPolygonGeometry.js +33 -34
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +29 -31
- package/Build/Workers/createCorridorGeometry.js +27 -29
- package/Build/Workers/createCorridorOutlineGeometry.js +26 -28
- package/Build/Workers/createCylinderGeometry.js +18 -20
- package/Build/Workers/createCylinderOutlineGeometry.js +16 -18
- package/Build/Workers/createEllipseGeometry.js +24 -26
- package/Build/Workers/createEllipseOutlineGeometry.js +17 -19
- package/Build/Workers/createEllipsoidGeometry.js +17 -19
- package/Build/Workers/createEllipsoidOutlineGeometry.js +16 -18
- package/Build/Workers/createFrustumGeometry.js +16 -18
- package/Build/Workers/createFrustumOutlineGeometry.js +18 -19
- package/Build/Workers/createGeometry.js +22 -24
- package/Build/Workers/createGroundPolylineGeometry.js +23 -25
- package/Build/Workers/createPlaneGeometry.js +14 -16
- package/Build/Workers/createPlaneOutlineGeometry.js +13 -15
- package/Build/Workers/createPolygonGeometry.js +32 -34
- package/Build/Workers/createPolygonOutlineGeometry.js +28 -30
- package/Build/Workers/createPolylineGeometry.js +23 -25
- package/Build/Workers/createPolylineVolumeGeometry.js +29 -31
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +25 -27
- package/Build/Workers/createRectangleGeometry.js +27 -29
- package/Build/Workers/createRectangleOutlineGeometry.js +18 -20
- package/Build/Workers/createSimplePolylineGeometry.js +21 -23
- package/Build/Workers/createSphereGeometry.js +17 -19
- package/Build/Workers/createSphereOutlineGeometry.js +16 -18
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +14 -16
- package/Build/Workers/createVectorTileGeometries.js +22 -24
- package/Build/Workers/createVectorTilePoints.js +12 -12
- package/Build/Workers/createVectorTilePolygons.js +20 -22
- package/Build/Workers/createVectorTilePolylines.js +14 -16
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +23 -25
- package/Build/Workers/createVerticesFromHeightmap.js +23 -25
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +19 -22
- package/Build/Workers/createWallGeometry.js +22 -24
- package/Build/Workers/createWallOutlineGeometry.js +21 -23
- package/Build/Workers/decodeDraco.js +11 -11
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +10 -11
- package/Build/Workers/transcodeKTX2.js +8 -8
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +20 -22
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/PixelFormat.js +1 -0
- package/Source/Core/Rectangle.js +89 -0
- package/Source/DataSources/DataSourceDisplay.js +5 -0
- package/Source/Renderer/ShaderBuilder.js +6 -3
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/Billboard.js +5 -3
- package/Source/Scene/Cesium3DTile.js +65 -0
- package/Source/Scene/Cesium3DTileset.js +48 -1
- package/Source/Scene/ClippingPolygon.js +212 -0
- package/Source/Scene/ClippingPolygonCollection.js +968 -0
- package/Source/Scene/Globe.js +14 -0
- package/Source/Scene/GlobeSurfaceShaderSet.js +81 -15
- package/Source/Scene/GlobeSurfaceTileProvider.js +81 -1
- package/Source/Scene/Model/Model.js +83 -0
- package/Source/Scene/Model/Model3DTileContent.js +21 -0
- package/Source/Scene/Model/ModelClippingPolygonsPipelineStage.js +92 -0
- package/Source/Scene/Model/ModelSceneGraph.js +5 -0
- package/Source/Scene/Terrain.js +2 -2
- package/Source/Shaders/Builtin/CzmBuiltins.js +4 -0
- package/Source/Shaders/Builtin/Functions/clipPolygons.glsl +37 -0
- package/Source/Shaders/Builtin/Functions/clipPolygons.js +39 -0
- package/Source/Shaders/Builtin/Functions/unpackClippingExtents.glsl +14 -0
- package/Source/Shaders/Builtin/Functions/unpackClippingExtents.js +15 -0
- package/Source/Shaders/GlobeFS.glsl +12 -0
- package/Source/Shaders/GlobeFS.js +12 -0
- package/Source/Shaders/GlobeVS.glsl +32 -0
- package/Source/Shaders/GlobeVS.js +32 -0
- package/Source/Shaders/Model/GeometryStageVS.glsl +1 -1
- package/Source/Shaders/Model/GeometryStageVS.js +1 -1
- package/Source/Shaders/Model/ModelClippingPolygonsStageFS.glsl +6 -0
- package/Source/Shaders/Model/ModelClippingPolygonsStageFS.js +8 -0
- package/Source/Shaders/Model/ModelClippingPolygonsStageVS.glsl +27 -0
- package/Source/Shaders/Model/ModelClippingPolygonsStageVS.js +29 -0
- package/Source/Shaders/Model/ModelFS.glsl +6 -0
- package/Source/Shaders/Model/ModelFS.js +7 -1
- package/Source/Shaders/Model/ModelVS.glsl +4 -0
- package/Source/Shaders/Model/ModelVS.js +4 -0
- package/Source/Shaders/PolygonSignedDistanceFS.glsl +100 -0
- package/Source/Shaders/PolygonSignedDistanceFS.js +101 -0
- package/Source/ThirdParty/Workers/z-worker-pako.js +1 -1
- package/index.d.ts +227 -1
- package/index.js +34 -26
- package/package.json +1 -1
- package/Build/Workers/chunk-2KACWKS4.js +0 -501
- package/Build/Workers/chunk-2XPLH3JY.js +0 -2977
- package/Build/Workers/chunk-X6XOMPWL.js +0 -73
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";const{Array:e,Object:t,Number:n,Math:s,Error:r,Uint8Array:a,Uint16Array:o,Uint32Array:i,Int32Array:c,Map:l,DataView:u,Promise:h,TextEncoder:f,crypto:p,postMessage:d,TransformStream:g,ReadableStream:w,WritableStream:y,CompressionStream:m,DecompressionStream:_}=self,b=void 0,S="undefined",v="function";class k{constructor(e){return class extends g{constructor(t,n){const s=new e(n);super({transform(e,t){t.enqueue(s.append(e))},flush(e){const t=s.flush();t&&e.enqueue(t)}})}}}}const z=[];for(let e=0;256>e;e++){let t=e;for(let e=0;8>e;e++)1&t?t=t>>>1^3988292384:t>>>=1;z[e]=t}class D{constructor(e){this.crc=e||-1}append(e){let t=0|this.crc;for(let n=0,s=0|e.length;s>n;n++)t=t>>>8^z[255&(t^e[n])];this.crc=t}get(){return~this.crc}}class C extends g{constructor(){let e;const t=new D;super({transform(e,n){t.append(e),n.enqueue(e)},flush(){const n=new a(4);new u(n.buffer).setUint32(0,t.get()),e.value=n}}),e=this}}const I={concat(e,t){if(0===e.length||0===t.length)return e.concat(t);const n=e[e.length-1],s=I.getPartial(n);return 32===s?e.concat(t):I._shiftRight(t,s,0|n,e.slice(0,e.length-1))},bitLength(e){const t=e.length;if(0===t)return 0;const n=e[t-1];return 32*(t-1)+I.getPartial(n)},clamp(e,t){if(32*e.length<t)return e;const n=(e=e.slice(0,s.ceil(t/32))).length;return t&=31,n>0&&t&&(e[n-1]=I.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial:(e,t,n)=>32===e?t:(n?0|t:t<<32-e)+1099511627776*e,getPartial:e=>s.round(e/1099511627776)||32,_shiftRight(e,t,n,s){for(void 0===s&&(s=[]);t>=32;t-=32)s.push(n),n=0;if(0===t)return s.concat(e);for(let r=0;r<e.length;r++)s.push(n|e[r]>>>t),n=e[r]<<32-t;const r=e.length?e[e.length-1]:0,a=I.getPartial(r);return s.push(I.partial(t+a&31,t+a>32?n:s.pop(),1)),s}},A={bytes:{fromBits(e){const t=I.bitLength(e)/8,n=new a(t);let s;for(let r=0;t>r;r++)0==(3&r)&&(s=e[r/4]),n[r]=s>>>24,s<<=8;return n},toBits(e){const t=[];let n,s=0;for(n=0;n<e.length;n++)s=s<<8|e[n],3==(3&n)&&(t.push(s),s=0);return 3&n&&t.push(I.partial(8*(3&n),s)),t}}},q=class{constructor(e){const t=this;t.blockSize=512,t._init=[1732584193,4023233417,2562383102,271733878,3285377520],t._key=[1518500249,1859775393,2400959708,3395469782],e?(t._h=e._h.slice(0),t._buffer=e._buffer.slice(0),t._length=e._length):t.reset()}reset(){const e=this;return e._h=e._init.slice(0),e._buffer=[],e._length=0,e}update(e){const t=this;"string"==typeof e&&(e=A.utf8String.toBits(e));const n=t._buffer=I.concat(t._buffer,e),s=t._length,a=t._length=s+I.bitLength(e);if(a>9007199254740991)throw new r("Cannot hash more than 2^53 - 1 bits");const o=new i(n);let c=0;for(let e=t.blockSize+s-(t.blockSize+s&t.blockSize-1);a>=e;e+=t.blockSize)t._block(o.subarray(16*c,16*(c+1))),c+=1;return n.splice(0,16*c),t}finalize(){const e=this;let t=e._buffer;const n=e._h;t=I.concat(t,[I.partial(1,1)]);for(let e=t.length+2;15&e;e++)t.push(0);for(t.push(s.floor(e._length/4294967296)),t.push(0|e._length);t.length;)e._block(t.splice(0,16));return e.reset(),n}_f(e,t,n,s){return e>19?e>39?e>59?e>79?void 0:t^n^s:t&n|t&s|n&s:t^n^s:t&n|~t&s}_S(e,t){return t<<e|t>>>32-e}_block(t){const n=this,r=n._h,a=e(80);for(let e=0;16>e;e++)a[e]=t[e];let o=r[0],i=r[1],c=r[2],l=r[3],u=r[4];for(let e=0;79>=e;e++){16>e||(a[e]=n._S(1,a[e-3]^a[e-8]^a[e-14]^a[e-16]));const t=n._S(5,o)+n._f(e,i,c,l)+u+a[e]+n._key[s.floor(e/20)]|0;u=l,l=c,c=n._S(30,i),i=o,o=t}r[0]=r[0]+o|0,r[1]=r[1]+i|0,r[2]=r[2]+c|0,r[3]=r[3]+l|0,r[4]=r[4]+u|0}},R={getRandomValues(e){const t=new i(e.buffer),n=e=>{let t=987654321;const n=4294967295;return()=>(t=36969*(65535&t)+(t>>16)&n,(((t<<16)+(e=18e3*(65535&e)+(e>>16)&n)&n)/4294967296+.5)*(s.random()>.5?1:-1))};for(let r,a=0;a<e.length;a+=4){const e=n(4294967296*(r||s.random()));r=987654071*e(),t[a/4]=4294967296*e()|0}return e}},H={importKey:e=>new H.hmacSha1(A.bytes.toBits(e)),pbkdf2(e,t,n,s){if(n=n||1e4,0>s||0>n)throw new r("invalid params to pbkdf2");const a=1+(s>>5)<<2;let o,i,c,l,h;const f=new ArrayBuffer(a),p=new u(f);let d=0;const g=I;for(t=A.bytes.toBits(t),h=1;(a||1)>d;h++){for(o=i=e.encrypt(g.concat(t,[h])),c=1;n>c;c++)for(i=e.encrypt(i),l=0;l<i.length;l++)o[l]^=i[l];for(c=0;(a||1)>d&&c<o.length;c++)p.setInt32(d,o[c]),d+=4}return f.slice(0,s/8)},hmacSha1:class{constructor(e){const t=this,n=t._hash=q,s=[[],[]];t._baseHash=[new n,new n];const r=t._baseHash[0].blockSize/32;e.length>r&&(e=(new n).update(e).finalize());for(let t=0;r>t;t++)s[0][t]=909522486^e[t],s[1][t]=1549556828^e[t];t._baseHash[0].update(s[0]),t._baseHash[1].update(s[1]),t._resultHash=new n(t._baseHash[0])}reset(){const e=this;e._resultHash=new e._hash(e._baseHash[0]),e._updated=!1}update(e){this._updated=!0,this._resultHash.update(e)}digest(){const e=this,t=e._resultHash.finalize(),n=new e._hash(e._baseHash[1]).update(t).finalize();return e.reset(),n}encrypt(e){if(this._updated)throw new r("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}}},P=typeof p!=S&&typeof p.getRandomValues==v,B="Invalid password",K="Invalid signature",T="zipjs-abort-check-password";function V(e){return P?p.getRandomValues(e):R.getRandomValues(e)}const x=16,E={name:"PBKDF2"},U=t.assign({hash:{name:"HMAC"}},E),W=t.assign({iterations:1e3,hash:{name:"SHA-1"}},E),M=["deriveBits"],N=[8,12,16],O=[16,24,32],L=10,F=[0,0,0,0],j=typeof p!=S,G=j&&p.subtle,X=j&&typeof G!=S,J=A.bytes,Q=class{constructor(e){const t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();const n=t._tables[0][4],s=t._tables[1],a=e.length;let o,i,c,l=1;if(4!==a&&6!==a&&8!==a)throw new r("invalid aes key size");for(t._key=[i=e.slice(0),c=[]],o=a;4*a+28>o;o++){let e=i[o-1];(o%a==0||8===a&&o%a==4)&&(e=n[e>>>24]<<24^n[e>>16&255]<<16^n[e>>8&255]<<8^n[255&e],o%a==0&&(e=e<<8^e>>>24^l<<24,l=l<<1^283*(l>>7))),i[o]=i[o-a]^e}for(let e=0;o;e++,o--){const t=i[3&e?o:o-4];c[e]=4>=o||4>e?t:s[0][n[t>>>24]]^s[1][n[t>>16&255]]^s[2][n[t>>8&255]]^s[3][n[255&t]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){const e=this._tables[0],t=this._tables[1],n=e[4],s=t[4],r=[],a=[];let o,i,c,l;for(let e=0;256>e;e++)a[(r[e]=e<<1^283*(e>>7))^e]=e;for(let u=o=0;!n[u];u^=i||1,o=a[o]||1){let a=o^o<<1^o<<2^o<<3^o<<4;a=a>>8^255&a^99,n[u]=a,s[a]=u,l=r[c=r[i=r[u]]];let h=16843009*l^65537*c^257*i^16843008*u,f=257*r[a]^16843008*a;for(let n=0;4>n;n++)e[n][u]=f=f<<24^f>>>8,t[n][a]=h=h<<24^h>>>8}for(let n=0;5>n;n++)e[n]=e[n].slice(0),t[n]=t[n].slice(0)}_crypt(e,t){if(4!==e.length)throw new r("invalid aes block size");const n=this._key[t],s=n.length/4-2,a=[0,0,0,0],o=this._tables[t],i=o[0],c=o[1],l=o[2],u=o[3],h=o[4];let f,p,d,g=e[0]^n[0],w=e[t?3:1]^n[1],y=e[2]^n[2],m=e[t?1:3]^n[3],_=4;for(let e=0;s>e;e++)f=i[g>>>24]^c[w>>16&255]^l[y>>8&255]^u[255&m]^n[_],p=i[w>>>24]^c[y>>16&255]^l[m>>8&255]^u[255&g]^n[_+1],d=i[y>>>24]^c[m>>16&255]^l[g>>8&255]^u[255&w]^n[_+2],m=i[m>>>24]^c[g>>16&255]^l[w>>8&255]^u[255&y]^n[_+3],_+=4,g=f,w=p,y=d;for(let e=0;4>e;e++)a[t?3&-e:e]=h[g>>>24]<<24^h[w>>16&255]<<16^h[y>>8&255]<<8^h[255&m]^n[_++],f=g,g=w,w=y,y=m,m=f;return a}},Y=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if(255==(e>>24&255)){let t=e>>16&255,n=e>>8&255,s=255&e;255===t?(t=0,255===n?(n=0,255===s?s=0:++s):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=s}else e+=1<<24;return e}incCounter(e){0===(e[0]=this.incWord(e[0]))&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let s;if(!(s=t.length))return[];const r=I.bitLength(t);for(let r=0;s>r;r+=4){this.incCounter(n);const s=e.encrypt(n);t[r]^=s[0],t[r+1]^=s[1],t[r+2]^=s[2],t[r+3]^=s[3]}return I.clamp(t,r)}},Z=H.hmacSha1;let $=j&&X&&typeof G.importKey==v,ee=j&&X&&typeof G.deriveBits==v;class te extends g{constructor({password:e,rawPassword:n,signed:s,encryptionStrength:o,checkPasswordOnly:i}){super({start(){t.assign(this,{ready:new h((e=>this.resolveReady=e)),password:ae(e,n),signed:s,strength:o-1,pending:new a})},async transform(e,t){const n=this,{password:s,strength:o,resolveReady:c,ready:l}=n;s?(await(async(e,t,n,s)=>{const a=await re(e,t,n,ie(s,0,N[t])),o=ie(s,N[t]);if(a[0]!=o[0]||a[1]!=o[1])throw new r(B)})(n,o,s,ie(e,0,N[o]+2)),e=ie(e,N[o]+2),i?t.error(new r(T)):c()):await l;const u=new a(e.length-L-(e.length-L)%x);t.enqueue(se(n,e,u,0,L,!0))},async flush(e){const{signed:t,ctr:n,hmac:s,pending:o,ready:i}=this;if(s&&n){await i;const c=ie(o,0,o.length-L),l=ie(o,o.length-L);let u=new a;if(c.length){const e=le(J,c);s.update(e);const t=n.update(e);u=ce(J,t)}if(t){const e=ie(ce(J,s.digest()),0,L);for(let t=0;L>t;t++)if(e[t]!=l[t])throw new r(K)}e.enqueue(u)}}})}}class ne extends g{constructor({password:e,rawPassword:n,encryptionStrength:s}){let r;super({start(){t.assign(this,{ready:new h((e=>this.resolveReady=e)),password:ae(e,n),strength:s-1,pending:new a})},async transform(e,t){const n=this,{password:s,strength:r,resolveReady:o,ready:i}=n;let c=new a;s?(c=await(async(e,t,n)=>{const s=V(new a(N[t]));return oe(s,await re(e,t,n,s))})(n,r,s),o()):await i;const l=new a(c.length+e.length-e.length%x);l.set(c,0),t.enqueue(se(n,e,l,c.length,0))},async flush(e){const{ctr:t,hmac:n,pending:s,ready:o}=this;if(n&&t){await o;let i=new a;if(s.length){const e=t.update(le(J,s));n.update(e),i=ce(J,e)}r.signature=ce(J,n.digest()).slice(0,L),e.enqueue(oe(i,r.signature))}}}),r=this}}function se(e,t,n,s,r,o){const{ctr:i,hmac:c,pending:l}=e,u=t.length-r;let h;for(l.length&&(t=oe(l,t),n=((e,t)=>{if(t&&t>e.length){const n=e;(e=new a(t)).set(n,0)}return e})(n,u-u%x)),h=0;u-x>=h;h+=x){const e=le(J,ie(t,h,h+x));o&&c.update(e);const r=i.update(e);o||c.update(r),n.set(ce(J,r),h+s)}return e.pending=ie(t,h),n}async function re(n,s,r,o){n.password=null;const i=await(async(e,t,n,s,r)=>{if(!$)return H.importKey(t);try{return await G.importKey("raw",t,n,!1,r)}catch(e){return $=!1,H.importKey(t)}})(0,r,U,0,M),c=await(async(e,t,n)=>{if(!ee)return H.pbkdf2(t,e.salt,W.iterations,n);try{return await G.deriveBits(e,t,n)}catch(s){return ee=!1,H.pbkdf2(t,e.salt,W.iterations,n)}})(t.assign({salt:o},W),i,8*(2*O[s]+2)),l=new a(c),u=le(J,ie(l,0,O[s])),h=le(J,ie(l,O[s],2*O[s])),f=ie(l,2*O[s]);return t.assign(n,{keys:{key:u,authentication:h,passwordVerification:f},ctr:new Y(new Q(u),e.from(F)),hmac:new Z(h)}),f}function ae(e,t){return t===b?(e=>{if(typeof f==S){const t=new a((e=unescape(encodeURIComponent(e))).length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}return(new f).encode(e)})(e):t}function oe(e,t){let n=e;return e.length+t.length&&(n=new a(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function ie(e,t,n){return e.subarray(t,n)}function ce(e,t){return e.fromBits(t)}function le(e,t){return e.toBits(t)}class ue extends g{constructor({password:e,passwordVerification:n,checkPasswordOnly:s}){super({start(){t.assign(this,{password:e,passwordVerification:n}),de(this,e)},transform(e,t){const n=this;if(n.password){const t=fe(n,e.subarray(0,12));if(n.password=null,t[11]!=n.passwordVerification)throw new r(B);e=e.subarray(12)}s?t.error(new r(T)):t.enqueue(fe(n,e))}})}}class he extends g{constructor({password:e,passwordVerification:n}){super({start(){t.assign(this,{password:e,passwordVerification:n}),de(this,e)},transform(e,t){const n=this;let s,r;if(n.password){n.password=null;const t=V(new a(12));t[11]=n.passwordVerification,s=new a(e.length+t.length),s.set(pe(n,t),0),r=12}else s=new a(e.length),r=0;s.set(pe(n,e),r),t.enqueue(s)}})}}function fe(e,t){const n=new a(t.length);for(let s=0;s<t.length;s++)n[s]=we(e)^t[s],ge(e,n[s]);return n}function pe(e,t){const n=new a(t.length);for(let s=0;s<t.length;s++)n[s]=we(e)^t[s],ge(e,t[s]);return n}function de(e,n){const s=[305419896,591751049,878082192];t.assign(e,{keys:s,crcKey0:new D(s[0]),crcKey2:new D(s[2])});for(let t=0;t<n.length;t++)ge(e,n.charCodeAt(t))}function ge(e,t){let[n,r,a]=e.keys;e.crcKey0.append([t]),n=~e.crcKey0.get(),r=me(s.imul(me(r+ye(n)),134775813)+1),e.crcKey2.append([r>>>24]),a=~e.crcKey2.get(),e.keys=[n,r,a]}function we(e){const t=2|e.keys[2];return ye(s.imul(t,1^t)>>>8)}function ye(e){return 255&e}function me(e){return 4294967295&e}const _e="deflate-raw";class be extends g{constructor(e,{chunkSize:t,CompressionStream:n,CompressionStreamNative:s}){super({});const{compressed:r,encrypted:a,useCompressionStream:o,zipCrypto:i,signed:c,level:l}=e,h=this;let f,p,d=ve(super.readable);a&&!i||!c||(f=new C,d=De(d,f)),r&&(d=ze(d,o,{level:l,chunkSize:t},s,n)),a&&(i?d=De(d,new he(e)):(p=new ne(e),d=De(d,p))),ke(h,d,(()=>{let e;a&&!i&&(e=p.signature),a&&!i||!c||(e=new u(f.value.buffer).getUint32(0)),h.signature=e}))}}class Se extends g{constructor(e,{chunkSize:t,DecompressionStream:n,DecompressionStreamNative:s}){super({});const{zipCrypto:a,encrypted:o,signed:i,signature:c,compressed:l,useCompressionStream:h}=e;let f,p,d=ve(super.readable);o&&(a?d=De(d,new ue(e)):(p=new te(e),d=De(d,p))),l&&(d=ze(d,h,{chunkSize:t},s,n)),o&&!a||!i||(f=new C,d=De(d,f)),ke(this,d,(()=>{if((!o||a)&&i){const e=new u(f.value.buffer);if(c!=e.getUint32(0,!1))throw new r(K)}}))}}function ve(e){return De(e,new g({transform(e,t){e&&e.length&&t.enqueue(e)}}))}function ke(e,n,s){n=De(n,new g({flush:s})),t.defineProperty(e,"readable",{get:()=>n})}function ze(e,t,n,s,r){try{e=De(e,new(t&&s?s:r)(_e,n))}catch(s){if(!t)return e;try{e=De(e,new r(_e,n))}catch(t){return e}}return e}function De(e,t){return e.pipeThrough(t)}const Ce="data",Ie="close";class Ae extends g{constructor(e,n){super({});const s=this,{codecType:r}=e;let a;r.startsWith("deflate")?a=be:r.startsWith("inflate")&&(a=Se);let o=0,i=0;const c=new a(e,n),l=super.readable,u=new g({transform(e,t){e&&e.length&&(i+=e.length,t.enqueue(e))},flush(){t.assign(s,{inputSize:i})}}),h=new g({transform(e,t){e&&e.length&&(o+=e.length,t.enqueue(e))},flush(){const{signature:e}=c;t.assign(s,{signature:e,outputSize:o,inputSize:i})}});t.defineProperty(s,"readable",{get:()=>l.pipeThrough(u).pipeThrough(c).pipeThrough(h)})}}class qe extends g{constructor(e){let t;super({transform:function n(s,r){if(t){const e=new a(t.length+s.length);e.set(t),e.set(s,t.length),s=e,t=null}s.length>e?(r.enqueue(s.slice(0,e)),n(s.slice(e),r)):t=s},flush(e){t&&t.length&&e.enqueue(t)}})}}const Re=new l,He=new l;let Pe,Be=0,Ke=!0;async function Te(e){try{const{options:t,scripts:s,config:r}=e;if(s&&s.length)try{Ke?importScripts.apply(b,s):await Ve(s)}catch(e){Ke=!1,await Ve(s)}self.initCodec&&self.initCodec(),r.CompressionStreamNative=self.CompressionStream,r.DecompressionStreamNative=self.DecompressionStream,self.Deflate&&(r.CompressionStream=new k(self.Deflate)),self.Inflate&&(r.DecompressionStream=new k(self.Inflate));const a={highWaterMark:1},o=e.readable||new w({async pull(e){const t=new h((e=>Re.set(Be,e)));xe({type:"pull",messageId:Be}),Be=(Be+1)%n.MAX_SAFE_INTEGER;const{value:s,done:r}=await t;e.enqueue(s),r&&e.close()}},a),i=e.writable||new y({async write(e){let t;const s=new h((e=>t=e));He.set(Be,t),xe({type:Ce,value:e,messageId:Be}),Be=(Be+1)%n.MAX_SAFE_INTEGER,await s}},a),c=new Ae(t,r);Pe=new AbortController;const{signal:l}=Pe;await o.pipeThrough(c).pipeThrough(new qe(r.chunkSize)).pipeTo(i,{signal:l,preventClose:!0,preventAbort:!0}),await i.getWriter().close();const{signature:u,inputSize:f,outputSize:p}=c;xe({type:Ie,result:{signature:u,inputSize:f,outputSize:p}})}catch(e){Ee(e)}}async function Ve(e){for(const t of e)await import(t)}function xe(e){let{value:t}=e;if(t)if(t.length)try{t=new a(t),e.value=t.buffer,d(e,[e.value])}catch(t){d(e)}else d(e);else d(e)}function Ee(e=new r("Unknown error")){const{message:t,stack:n,code:s,name:a}=e;d({error:{message:t,stack:n,code:s,name:a}})}function Ue(e,n,s){return class{constructor(r){const o=this;var i,c;i=r,c="level",(typeof t.hasOwn===v?t.hasOwn(i,c):i.hasOwnProperty(c))&&r.level===b&&delete r.level,o.codec=new e(t.assign({},n,r)),s(o.codec,(e=>{if(o.pendingData){const t=o.pendingData;o.pendingData=new a(t.length+e.length);const{pendingData:n}=o;n.set(t,0),n.set(e,t.length)}else o.pendingData=new a(e)}))}append(e){return this.codec.push(e),r(this)}flush(){return this.codec.push(new a,!0),r(this)}};function r(e){if(e.pendingData){const t=e.pendingData;return e.pendingData=null,t}return new a}}addEventListener("message",(({data:e})=>{const{type:t,messageId:n,value:s,done:r}=e;try{if("start"==t&&Te(e),t==Ce){const e=Re.get(n);Re.delete(n),e({value:new a(s),done:r})}if("ack"==t){const e=He.get(n);He.delete(n),e()}t==Ie&&Pe.abort()}catch(e){Ee(e)}})),self.initCodec=()=>{const{Deflate:e,Inflate:t}=((e,t={},n)=>({Deflate:Ue(e.Deflate,t.deflate,n),Inflate:Ue(e.Inflate,t.inflate,n)}))(pako,{deflate:{raw:!0},inflate:{raw:!0}},((e,t)=>e.onData=t));self.Deflate=e,self.Inflate=t}}();
|
|
1
|
+
!function(){"use strict";const{Array:e,Object:t,Number:n,Math:s,Error:r,Uint8Array:a,Uint16Array:o,Uint32Array:i,Int32Array:c,Map:l,DataView:u,Promise:h,TextEncoder:f,crypto:p,postMessage:d,TransformStream:g,ReadableStream:w,WritableStream:y,CompressionStream:m,DecompressionStream:_}=self,b=void 0,S="undefined",v="function";class k{constructor(e){return class extends g{constructor(t,n){const s=new e(n);super({transform(e,t){t.enqueue(s.append(e))},flush(e){const t=s.flush();t&&e.enqueue(t)}})}}}}const z=[];for(let e=0;256>e;e++){let t=e;for(let e=0;8>e;e++)1&t?t=t>>>1^3988292384:t>>>=1;z[e]=t}class D{constructor(e){this.crc=e||-1}append(e){let t=0|this.crc;for(let n=0,s=0|e.length;s>n;n++)t=t>>>8^z[255&(t^e[n])];this.crc=t}get(){return~this.crc}}class C extends g{constructor(){let e;const t=new D;super({transform(e,n){t.append(e),n.enqueue(e)},flush(){const n=new a(4);new u(n.buffer).setUint32(0,t.get()),e.value=n}}),e=this}}const I={concat(e,t){if(0===e.length||0===t.length)return e.concat(t);const n=e[e.length-1],s=I.getPartial(n);return 32===s?e.concat(t):I._shiftRight(t,s,0|n,e.slice(0,e.length-1))},bitLength(e){const t=e.length;if(0===t)return 0;const n=e[t-1];return 32*(t-1)+I.getPartial(n)},clamp(e,t){if(32*e.length<t)return e;const n=(e=e.slice(0,s.ceil(t/32))).length;return t&=31,n>0&&t&&(e[n-1]=I.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial:(e,t,n)=>32===e?t:(n?0|t:t<<32-e)+1099511627776*e,getPartial:e=>s.round(e/1099511627776)||32,_shiftRight(e,t,n,s){for(void 0===s&&(s=[]);t>=32;t-=32)s.push(n),n=0;if(0===t)return s.concat(e);for(let r=0;r<e.length;r++)s.push(n|e[r]>>>t),n=e[r]<<32-t;const r=e.length?e[e.length-1]:0,a=I.getPartial(r);return s.push(I.partial(t+a&31,t+a>32?n:s.pop(),1)),s}},A={bytes:{fromBits(e){const t=I.bitLength(e)/8,n=new a(t);let s;for(let r=0;t>r;r++)3&r||(s=e[r/4]),n[r]=s>>>24,s<<=8;return n},toBits(e){const t=[];let n,s=0;for(n=0;n<e.length;n++)s=s<<8|e[n],3&~n||(t.push(s),s=0);return 3&n&&t.push(I.partial(8*(3&n),s)),t}}},q=class{constructor(e){const t=this;t.blockSize=512,t._init=[1732584193,4023233417,2562383102,271733878,3285377520],t._key=[1518500249,1859775393,2400959708,3395469782],e?(t._h=e._h.slice(0),t._buffer=e._buffer.slice(0),t._length=e._length):t.reset()}reset(){const e=this;return e._h=e._init.slice(0),e._buffer=[],e._length=0,e}update(e){const t=this;"string"==typeof e&&(e=A.utf8String.toBits(e));const n=t._buffer=I.concat(t._buffer,e),s=t._length,a=t._length=s+I.bitLength(e);if(a>9007199254740991)throw new r("Cannot hash more than 2^53 - 1 bits");const o=new i(n);let c=0;for(let e=t.blockSize+s-(t.blockSize+s&t.blockSize-1);a>=e;e+=t.blockSize)t._block(o.subarray(16*c,16*(c+1))),c+=1;return n.splice(0,16*c),t}finalize(){const e=this;let t=e._buffer;const n=e._h;t=I.concat(t,[I.partial(1,1)]);for(let e=t.length+2;15&e;e++)t.push(0);for(t.push(s.floor(e._length/4294967296)),t.push(0|e._length);t.length;)e._block(t.splice(0,16));return e.reset(),n}_f(e,t,n,s){return e>19?e>39?e>59?e>79?void 0:t^n^s:t&n|t&s|n&s:t^n^s:t&n|~t&s}_S(e,t){return t<<e|t>>>32-e}_block(t){const n=this,r=n._h,a=e(80);for(let e=0;16>e;e++)a[e]=t[e];let o=r[0],i=r[1],c=r[2],l=r[3],u=r[4];for(let e=0;79>=e;e++){16>e||(a[e]=n._S(1,a[e-3]^a[e-8]^a[e-14]^a[e-16]));const t=n._S(5,o)+n._f(e,i,c,l)+u+a[e]+n._key[s.floor(e/20)]|0;u=l,l=c,c=n._S(30,i),i=o,o=t}r[0]=r[0]+o|0,r[1]=r[1]+i|0,r[2]=r[2]+c|0,r[3]=r[3]+l|0,r[4]=r[4]+u|0}},R={getRandomValues(e){const t=new i(e.buffer),n=e=>{let t=987654321;const n=4294967295;return()=>(t=36969*(65535&t)+(t>>16)&n,(((t<<16)+(e=18e3*(65535&e)+(e>>16)&n)&n)/4294967296+.5)*(s.random()>.5?1:-1))};for(let r,a=0;a<e.length;a+=4){const e=n(4294967296*(r||s.random()));r=987654071*e(),t[a/4]=4294967296*e()|0}return e}},H={importKey:e=>new H.hmacSha1(A.bytes.toBits(e)),pbkdf2(e,t,n,s){if(n=n||1e4,0>s||0>n)throw new r("invalid params to pbkdf2");const a=1+(s>>5)<<2;let o,i,c,l,h;const f=new ArrayBuffer(a),p=new u(f);let d=0;const g=I;for(t=A.bytes.toBits(t),h=1;(a||1)>d;h++){for(o=i=e.encrypt(g.concat(t,[h])),c=1;n>c;c++)for(i=e.encrypt(i),l=0;l<i.length;l++)o[l]^=i[l];for(c=0;(a||1)>d&&c<o.length;c++)p.setInt32(d,o[c]),d+=4}return f.slice(0,s/8)},hmacSha1:class{constructor(e){const t=this,n=t._hash=q,s=[[],[]];t._baseHash=[new n,new n];const r=t._baseHash[0].blockSize/32;e.length>r&&(e=(new n).update(e).finalize());for(let t=0;r>t;t++)s[0][t]=909522486^e[t],s[1][t]=1549556828^e[t];t._baseHash[0].update(s[0]),t._baseHash[1].update(s[1]),t._resultHash=new n(t._baseHash[0])}reset(){const e=this;e._resultHash=new e._hash(e._baseHash[0]),e._updated=!1}update(e){this._updated=!0,this._resultHash.update(e)}digest(){const e=this,t=e._resultHash.finalize(),n=new e._hash(e._baseHash[1]).update(t).finalize();return e.reset(),n}encrypt(e){if(this._updated)throw new r("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}}},P=typeof p!=S&&typeof p.getRandomValues==v,B="Invalid password",K="Invalid signature",T="zipjs-abort-check-password";function V(e){return P?p.getRandomValues(e):R.getRandomValues(e)}const x=16,E={name:"PBKDF2"},U=t.assign({hash:{name:"HMAC"}},E),W=t.assign({iterations:1e3,hash:{name:"SHA-1"}},E),M=["deriveBits"],N=[8,12,16],O=[16,24,32],L=10,F=[0,0,0,0],j=typeof p!=S,G=j&&p.subtle,X=j&&typeof G!=S,J=A.bytes,Q=class{constructor(e){const t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();const n=t._tables[0][4],s=t._tables[1],a=e.length;let o,i,c,l=1;if(4!==a&&6!==a&&8!==a)throw new r("invalid aes key size");for(t._key=[i=e.slice(0),c=[]],o=a;4*a+28>o;o++){let e=i[o-1];(o%a==0||8===a&&o%a==4)&&(e=n[e>>>24]<<24^n[e>>16&255]<<16^n[e>>8&255]<<8^n[255&e],o%a==0&&(e=e<<8^e>>>24^l<<24,l=l<<1^283*(l>>7))),i[o]=i[o-a]^e}for(let e=0;o;e++,o--){const t=i[3&e?o:o-4];c[e]=4>=o||4>e?t:s[0][n[t>>>24]]^s[1][n[t>>16&255]]^s[2][n[t>>8&255]]^s[3][n[255&t]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){const e=this._tables[0],t=this._tables[1],n=e[4],s=t[4],r=[],a=[];let o,i,c,l;for(let e=0;256>e;e++)a[(r[e]=e<<1^283*(e>>7))^e]=e;for(let u=o=0;!n[u];u^=i||1,o=a[o]||1){let a=o^o<<1^o<<2^o<<3^o<<4;a=a>>8^255&a^99,n[u]=a,s[a]=u,l=r[c=r[i=r[u]]];let h=16843009*l^65537*c^257*i^16843008*u,f=257*r[a]^16843008*a;for(let n=0;4>n;n++)e[n][u]=f=f<<24^f>>>8,t[n][a]=h=h<<24^h>>>8}for(let n=0;5>n;n++)e[n]=e[n].slice(0),t[n]=t[n].slice(0)}_crypt(e,t){if(4!==e.length)throw new r("invalid aes block size");const n=this._key[t],s=n.length/4-2,a=[0,0,0,0],o=this._tables[t],i=o[0],c=o[1],l=o[2],u=o[3],h=o[4];let f,p,d,g=e[0]^n[0],w=e[t?3:1]^n[1],y=e[2]^n[2],m=e[t?1:3]^n[3],_=4;for(let e=0;s>e;e++)f=i[g>>>24]^c[w>>16&255]^l[y>>8&255]^u[255&m]^n[_],p=i[w>>>24]^c[y>>16&255]^l[m>>8&255]^u[255&g]^n[_+1],d=i[y>>>24]^c[m>>16&255]^l[g>>8&255]^u[255&w]^n[_+2],m=i[m>>>24]^c[g>>16&255]^l[w>>8&255]^u[255&y]^n[_+3],_+=4,g=f,w=p,y=d;for(let e=0;4>e;e++)a[t?3&-e:e]=h[g>>>24]<<24^h[w>>16&255]<<16^h[y>>8&255]<<8^h[255&m]^n[_++],f=g,g=w,w=y,y=m,m=f;return a}},Y=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if(255&~(e>>24))e+=1<<24;else{let t=e>>16&255,n=e>>8&255,s=255&e;255===t?(t=0,255===n?(n=0,255===s?s=0:++s):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=s}return e}incCounter(e){0===(e[0]=this.incWord(e[0]))&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let s;if(!(s=t.length))return[];const r=I.bitLength(t);for(let r=0;s>r;r+=4){this.incCounter(n);const s=e.encrypt(n);t[r]^=s[0],t[r+1]^=s[1],t[r+2]^=s[2],t[r+3]^=s[3]}return I.clamp(t,r)}},Z=H.hmacSha1;let $=j&&X&&typeof G.importKey==v,ee=j&&X&&typeof G.deriveBits==v;class te extends g{constructor({password:e,rawPassword:n,signed:s,encryptionStrength:o,checkPasswordOnly:i}){super({start(){t.assign(this,{ready:new h((e=>this.resolveReady=e)),password:ae(e,n),signed:s,strength:o-1,pending:new a})},async transform(e,t){const n=this,{password:s,strength:o,resolveReady:c,ready:l}=n;s?(await(async(e,t,n,s)=>{const a=await re(e,t,n,ie(s,0,N[t])),o=ie(s,N[t]);if(a[0]!=o[0]||a[1]!=o[1])throw new r(B)})(n,o,s,ie(e,0,N[o]+2)),e=ie(e,N[o]+2),i?t.error(new r(T)):c()):await l;const u=new a(e.length-L-(e.length-L)%x);t.enqueue(se(n,e,u,0,L,!0))},async flush(e){const{signed:t,ctr:n,hmac:s,pending:o,ready:i}=this;if(s&&n){await i;const c=ie(o,0,o.length-L),l=ie(o,o.length-L);let u=new a;if(c.length){const e=le(J,c);s.update(e);const t=n.update(e);u=ce(J,t)}if(t){const e=ie(ce(J,s.digest()),0,L);for(let t=0;L>t;t++)if(e[t]!=l[t])throw new r(K)}e.enqueue(u)}}})}}class ne extends g{constructor({password:e,rawPassword:n,encryptionStrength:s}){let r;super({start(){t.assign(this,{ready:new h((e=>this.resolveReady=e)),password:ae(e,n),strength:s-1,pending:new a})},async transform(e,t){const n=this,{password:s,strength:r,resolveReady:o,ready:i}=n;let c=new a;s?(c=await(async(e,t,n)=>{const s=V(new a(N[t]));return oe(s,await re(e,t,n,s))})(n,r,s),o()):await i;const l=new a(c.length+e.length-e.length%x);l.set(c,0),t.enqueue(se(n,e,l,c.length,0))},async flush(e){const{ctr:t,hmac:n,pending:s,ready:o}=this;if(n&&t){await o;let i=new a;if(s.length){const e=t.update(le(J,s));n.update(e),i=ce(J,e)}r.signature=ce(J,n.digest()).slice(0,L),e.enqueue(oe(i,r.signature))}}}),r=this}}function se(e,t,n,s,r,o){const{ctr:i,hmac:c,pending:l}=e,u=t.length-r;let h;for(l.length&&(t=oe(l,t),n=((e,t)=>{if(t&&t>e.length){const n=e;(e=new a(t)).set(n,0)}return e})(n,u-u%x)),h=0;u-x>=h;h+=x){const e=le(J,ie(t,h,h+x));o&&c.update(e);const r=i.update(e);o||c.update(r),n.set(ce(J,r),h+s)}return e.pending=ie(t,h),n}async function re(n,s,r,o){n.password=null;const i=await(async(e,t,n,s,r)=>{if(!$)return H.importKey(t);try{return await G.importKey("raw",t,n,!1,r)}catch(e){return $=!1,H.importKey(t)}})(0,r,U,0,M),c=await(async(e,t,n)=>{if(!ee)return H.pbkdf2(t,e.salt,W.iterations,n);try{return await G.deriveBits(e,t,n)}catch(s){return ee=!1,H.pbkdf2(t,e.salt,W.iterations,n)}})(t.assign({salt:o},W),i,8*(2*O[s]+2)),l=new a(c),u=le(J,ie(l,0,O[s])),h=le(J,ie(l,O[s],2*O[s])),f=ie(l,2*O[s]);return t.assign(n,{keys:{key:u,authentication:h,passwordVerification:f},ctr:new Y(new Q(u),e.from(F)),hmac:new Z(h)}),f}function ae(e,t){return t===b?(e=>{if(typeof f==S){const t=new a((e=unescape(encodeURIComponent(e))).length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}return(new f).encode(e)})(e):t}function oe(e,t){let n=e;return e.length+t.length&&(n=new a(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function ie(e,t,n){return e.subarray(t,n)}function ce(e,t){return e.fromBits(t)}function le(e,t){return e.toBits(t)}class ue extends g{constructor({password:e,passwordVerification:n,checkPasswordOnly:s}){super({start(){t.assign(this,{password:e,passwordVerification:n}),de(this,e)},transform(e,t){const n=this;if(n.password){const t=fe(n,e.subarray(0,12));if(n.password=null,t[11]!=n.passwordVerification)throw new r(B);e=e.subarray(12)}s?t.error(new r(T)):t.enqueue(fe(n,e))}})}}class he extends g{constructor({password:e,passwordVerification:n}){super({start(){t.assign(this,{password:e,passwordVerification:n}),de(this,e)},transform(e,t){const n=this;let s,r;if(n.password){n.password=null;const t=V(new a(12));t[11]=n.passwordVerification,s=new a(e.length+t.length),s.set(pe(n,t),0),r=12}else s=new a(e.length),r=0;s.set(pe(n,e),r),t.enqueue(s)}})}}function fe(e,t){const n=new a(t.length);for(let s=0;s<t.length;s++)n[s]=we(e)^t[s],ge(e,n[s]);return n}function pe(e,t){const n=new a(t.length);for(let s=0;s<t.length;s++)n[s]=we(e)^t[s],ge(e,t[s]);return n}function de(e,n){const s=[305419896,591751049,878082192];t.assign(e,{keys:s,crcKey0:new D(s[0]),crcKey2:new D(s[2])});for(let t=0;t<n.length;t++)ge(e,n.charCodeAt(t))}function ge(e,t){let[n,r,a]=e.keys;e.crcKey0.append([t]),n=~e.crcKey0.get(),r=me(s.imul(me(r+ye(n)),134775813)+1),e.crcKey2.append([r>>>24]),a=~e.crcKey2.get(),e.keys=[n,r,a]}function we(e){const t=2|e.keys[2];return ye(s.imul(t,1^t)>>>8)}function ye(e){return 255&e}function me(e){return 4294967295&e}const _e="deflate-raw";class be extends g{constructor(e,{chunkSize:t,CompressionStream:n,CompressionStreamNative:s}){super({});const{compressed:r,encrypted:a,useCompressionStream:o,zipCrypto:i,signed:c,level:l}=e,h=this;let f,p,d=ve(super.readable);a&&!i||!c||(f=new C,d=De(d,f)),r&&(d=ze(d,o,{level:l,chunkSize:t},s,n)),a&&(i?d=De(d,new he(e)):(p=new ne(e),d=De(d,p))),ke(h,d,(()=>{let e;a&&!i&&(e=p.signature),a&&!i||!c||(e=new u(f.value.buffer).getUint32(0)),h.signature=e}))}}class Se extends g{constructor(e,{chunkSize:t,DecompressionStream:n,DecompressionStreamNative:s}){super({});const{zipCrypto:a,encrypted:o,signed:i,signature:c,compressed:l,useCompressionStream:h}=e;let f,p,d=ve(super.readable);o&&(a?d=De(d,new ue(e)):(p=new te(e),d=De(d,p))),l&&(d=ze(d,h,{chunkSize:t},s,n)),o&&!a||!i||(f=new C,d=De(d,f)),ke(this,d,(()=>{if((!o||a)&&i){const e=new u(f.value.buffer);if(c!=e.getUint32(0,!1))throw new r(K)}}))}}function ve(e){return De(e,new g({transform(e,t){e&&e.length&&t.enqueue(e)}}))}function ke(e,n,s){n=De(n,new g({flush:s})),t.defineProperty(e,"readable",{get:()=>n})}function ze(e,t,n,s,r){try{e=De(e,new(t&&s?s:r)(_e,n))}catch(s){if(!t)return e;try{e=De(e,new r(_e,n))}catch(t){return e}}return e}function De(e,t){return e.pipeThrough(t)}const Ce="data",Ie="close";class Ae extends g{constructor(e,n){super({});const s=this,{codecType:r}=e;let a;r.startsWith("deflate")?a=be:r.startsWith("inflate")&&(a=Se);let o=0,i=0;const c=new a(e,n),l=super.readable,u=new g({transform(e,t){e&&e.length&&(i+=e.length,t.enqueue(e))},flush(){t.assign(s,{inputSize:i})}}),h=new g({transform(e,t){e&&e.length&&(o+=e.length,t.enqueue(e))},flush(){const{signature:e}=c;t.assign(s,{signature:e,outputSize:o,inputSize:i})}});t.defineProperty(s,"readable",{get:()=>l.pipeThrough(u).pipeThrough(c).pipeThrough(h)})}}class qe extends g{constructor(e){let t;super({transform:function n(s,r){if(t){const e=new a(t.length+s.length);e.set(t),e.set(s,t.length),s=e,t=null}s.length>e?(r.enqueue(s.slice(0,e)),n(s.slice(e),r)):t=s},flush(e){t&&t.length&&e.enqueue(t)}})}}const Re=new l,He=new l;let Pe,Be=0,Ke=!0;async function Te(e){try{const{options:t,scripts:s,config:r}=e;if(s&&s.length)try{Ke?importScripts.apply(b,s):await Ve(s)}catch(e){Ke=!1,await Ve(s)}self.initCodec&&self.initCodec(),r.CompressionStreamNative=self.CompressionStream,r.DecompressionStreamNative=self.DecompressionStream,self.Deflate&&(r.CompressionStream=new k(self.Deflate)),self.Inflate&&(r.DecompressionStream=new k(self.Inflate));const a={highWaterMark:1},o=e.readable||new w({async pull(e){const t=new h((e=>Re.set(Be,e)));xe({type:"pull",messageId:Be}),Be=(Be+1)%n.MAX_SAFE_INTEGER;const{value:s,done:r}=await t;e.enqueue(s),r&&e.close()}},a),i=e.writable||new y({async write(e){let t;const s=new h((e=>t=e));He.set(Be,t),xe({type:Ce,value:e,messageId:Be}),Be=(Be+1)%n.MAX_SAFE_INTEGER,await s}},a),c=new Ae(t,r);Pe=new AbortController;const{signal:l}=Pe;await o.pipeThrough(c).pipeThrough(new qe(r.chunkSize)).pipeTo(i,{signal:l,preventClose:!0,preventAbort:!0}),await i.getWriter().close();const{signature:u,inputSize:f,outputSize:p}=c;xe({type:Ie,result:{signature:u,inputSize:f,outputSize:p}})}catch(e){Ee(e)}}async function Ve(e){for(const t of e)await import(t)}function xe(e){let{value:t}=e;if(t)if(t.length)try{t=new a(t),e.value=t.buffer,d(e,[e.value])}catch(t){d(e)}else d(e);else d(e)}function Ee(e=new r("Unknown error")){const{message:t,stack:n,code:s,name:a}=e;d({error:{message:t,stack:n,code:s,name:a}})}function Ue(e,n,s){return class{constructor(r){const o=this;var i,c;i=r,c="level",(typeof t.hasOwn===v?t.hasOwn(i,c):i.hasOwnProperty(c))&&r.level===b&&delete r.level,o.codec=new e(t.assign({},n,r)),s(o.codec,(e=>{if(o.pendingData){const t=o.pendingData;o.pendingData=new a(t.length+e.length);const{pendingData:n}=o;n.set(t,0),n.set(e,t.length)}else o.pendingData=new a(e)}))}append(e){return this.codec.push(e),r(this)}flush(){return this.codec.push(new a,!0),r(this)}};function r(e){if(e.pendingData){const t=e.pendingData;return e.pendingData=null,t}return new a}}addEventListener("message",(({data:e})=>{const{type:t,messageId:n,value:s,done:r}=e;try{if("start"==t&&Te(e),t==Ce){const e=Re.get(n);Re.delete(n),e({value:new a(s),done:r})}if("ack"==t){const e=He.get(n);He.delete(n),e()}t==Ie&&Pe.abort()}catch(e){Ee(e)}})),self.initCodec=()=>{const{Deflate:e,Inflate:t}=((e,t={},n)=>({Deflate:Ue(e.Deflate,t.deflate,n),Inflate:Ue(e.Inflate,t.inflate,n)}))(pako,{deflate:{raw:!0},inflate:{raw:!0}},((e,t)=>e.onData=t));self.Deflate=e,self.Inflate=t}}();
|
package/index.d.ts
CHANGED
|
@@ -6425,7 +6425,7 @@ export class Event<Listener extends (...args: any[]) => void = (...args: any[])
|
|
|
6425
6425
|
* Raises the event by calling each registered listener with all supplied arguments.
|
|
6426
6426
|
* @param arguments - This method takes any number of parameters and passes them through to the listener functions.
|
|
6427
6427
|
*/
|
|
6428
|
-
raiseEvent(...arguments: Parameters<Listener>
|
|
6428
|
+
raiseEvent(...arguments: Parameters<Listener>): void;
|
|
6429
6429
|
}
|
|
6430
6430
|
|
|
6431
6431
|
export namespace Event {
|
|
@@ -14210,6 +14210,14 @@ export class Rectangle {
|
|
|
14210
14210
|
* @returns The modified result parameter or a new Rectangle instance if none was provided.
|
|
14211
14211
|
*/
|
|
14212
14212
|
static fromCartesianArray(cartesians: Cartesian3[], ellipsoid?: Ellipsoid, result?: Rectangle): Rectangle;
|
|
14213
|
+
/**
|
|
14214
|
+
* Create a rectangle from a bounding sphere, ignoring height.
|
|
14215
|
+
* @param boundingSphere - The bounding sphere.
|
|
14216
|
+
* @param [ellipsoid = Ellipsoid.WGS84] - The ellipsoid.
|
|
14217
|
+
* @param [result] - The object onto which to store the result, or undefined if a new instance should be created.
|
|
14218
|
+
* @returns The modified result parameter or a new Rectangle instance if none was provided.
|
|
14219
|
+
*/
|
|
14220
|
+
static fromBoundingSphere(boundingSphere: BoundingSphere, ellipsoid?: Ellipsoid, result?: Rectangle): Rectangle;
|
|
14213
14221
|
/**
|
|
14214
14222
|
* Duplicates a Rectangle.
|
|
14215
14223
|
* @param rectangle - The rectangle to clone.
|
|
@@ -28949,6 +28957,7 @@ export namespace Cesium3DTileset {
|
|
|
28949
28957
|
* @property [immediatelyLoadDesiredLevelOfDetail = false] - When <code>skipLevelOfDetail</code> is <code>true</code>, only tiles that meet the maximum screen space error will ever be downloaded. Skipping factors are ignored and just the desired tiles are loaded.
|
|
28950
28958
|
* @property [loadSiblings = false] - When <code>skipLevelOfDetail</code> is <code>true</code>, determines whether siblings of visible tiles are always downloaded during traversal.
|
|
28951
28959
|
* @property [clippingPlanes] - The {@link ClippingPlaneCollection} used to selectively disable rendering the tileset.
|
|
28960
|
+
* @property [clippingPolygons] - The {@link ClippingPolygonCollection} used to selectively disable rendering the tileset.
|
|
28952
28961
|
* @property [classificationType] - Determines whether terrain, 3D Tiles or both will be classified by this tileset. See {@link Cesium3DTileset#classificationType} for details about restrictions and limitations.
|
|
28953
28962
|
* @property [ellipsoid = Ellipsoid.WGS84] - The ellipsoid determining the size and shape of the globe.
|
|
28954
28963
|
* @property [pointCloudShading] - Options for constructing a {@link PointCloudShading} object to control point attenuation based on geometric error and lighting.
|
|
@@ -29012,6 +29021,7 @@ export namespace Cesium3DTileset {
|
|
|
29012
29021
|
immediatelyLoadDesiredLevelOfDetail?: boolean;
|
|
29013
29022
|
loadSiblings?: boolean;
|
|
29014
29023
|
clippingPlanes?: ClippingPlaneCollection;
|
|
29024
|
+
clippingPolygons?: ClippingPolygonCollection;
|
|
29015
29025
|
classificationType?: ClassificationType;
|
|
29016
29026
|
ellipsoid?: Ellipsoid;
|
|
29017
29027
|
pointCloudShading?: any;
|
|
@@ -29531,6 +29541,10 @@ export class Cesium3DTileset {
|
|
|
29531
29541
|
* The {@link ClippingPlaneCollection} used to selectively disable rendering the tileset.
|
|
29532
29542
|
*/
|
|
29533
29543
|
clippingPlanes: ClippingPlaneCollection;
|
|
29544
|
+
/**
|
|
29545
|
+
* The {@link ClippingPolygonCollection} used to selectively disable rendering the tileset.
|
|
29546
|
+
*/
|
|
29547
|
+
clippingPolygons: ClippingPolygonCollection;
|
|
29534
29548
|
/**
|
|
29535
29549
|
* Gets the tileset's properties dictionary object, which contains metadata about per-feature properties.
|
|
29536
29550
|
* <p>
|
|
@@ -30286,6 +30300,200 @@ export class ClippingPlaneCollection {
|
|
|
30286
30300
|
destroy(): void;
|
|
30287
30301
|
}
|
|
30288
30302
|
|
|
30303
|
+
/**
|
|
30304
|
+
* A geodesic polygon to be used with {@link ClippingPlaneCollection} for selectively hiding regions in a model, a 3D tileset, or the globe.
|
|
30305
|
+
* @example
|
|
30306
|
+
* const positions = Cesium.Cartesian3.fromRadiansArray([
|
|
30307
|
+
* -1.3194369277314022,
|
|
30308
|
+
* 0.6988062530900625,
|
|
30309
|
+
* -1.31941,
|
|
30310
|
+
* 0.69879,
|
|
30311
|
+
* -1.3193955980204217,
|
|
30312
|
+
* 0.6988091578771254,
|
|
30313
|
+
* -1.3193931220959367,
|
|
30314
|
+
* 0.698743632490865,
|
|
30315
|
+
* -1.3194358224045408,
|
|
30316
|
+
* 0.6987471965556998,
|
|
30317
|
+
* ]);
|
|
30318
|
+
*
|
|
30319
|
+
* const polygon = new Cesium.ClippingPolygon({
|
|
30320
|
+
* positions: positions
|
|
30321
|
+
* });
|
|
30322
|
+
* @param options - Object with the following properties:
|
|
30323
|
+
* @param options.positions - A list of three or more Cartesian coordinates defining the outer ring of the clipping polygon.
|
|
30324
|
+
*/
|
|
30325
|
+
export class ClippingPolygon {
|
|
30326
|
+
constructor(options: {
|
|
30327
|
+
positions: Cartesian3[];
|
|
30328
|
+
ellipsoid?: Ellipsoid;
|
|
30329
|
+
});
|
|
30330
|
+
/**
|
|
30331
|
+
* Returns the total number of positions in the polygon, include any holes.
|
|
30332
|
+
*/
|
|
30333
|
+
readonly length: number;
|
|
30334
|
+
/**
|
|
30335
|
+
* Returns the outer ring of positions.
|
|
30336
|
+
*/
|
|
30337
|
+
readonly positions: Cartesian3[];
|
|
30338
|
+
/**
|
|
30339
|
+
* Returns the ellipsoid used to project the polygon onto surfaces when clipping.
|
|
30340
|
+
*/
|
|
30341
|
+
readonly ellipsoid: Ellipsoid;
|
|
30342
|
+
/**
|
|
30343
|
+
* Clones the ClippingPolygon without setting its ownership.
|
|
30344
|
+
* @param polygon - The ClippingPolygon to be cloned
|
|
30345
|
+
* @param [result] - The object on which to store the cloned parameters.
|
|
30346
|
+
* @returns a clone of the input ClippingPolygon
|
|
30347
|
+
*/
|
|
30348
|
+
static clone(polygon: ClippingPolygon, result?: ClippingPolygon): ClippingPolygon;
|
|
30349
|
+
/**
|
|
30350
|
+
* Compares the provided ClippingPolygons and returns
|
|
30351
|
+
* <code>true</code> if they are equal, <code>false</code> otherwise.
|
|
30352
|
+
* @param left - The first polygon.
|
|
30353
|
+
* @param right - The second polygon.
|
|
30354
|
+
* @returns <code>true</code> if left and right are equal, <code>false</code> otherwise.
|
|
30355
|
+
*/
|
|
30356
|
+
static equals(left: Plane, right: Plane): boolean;
|
|
30357
|
+
/**
|
|
30358
|
+
* Computes a cartographic rectangle which encloses the polygon defined by the list of positions, including cases over the international date line and the poles.
|
|
30359
|
+
* @param [result] - An object in which to store the result.
|
|
30360
|
+
* @returns The result rectangle
|
|
30361
|
+
*/
|
|
30362
|
+
computeRectangle(result?: Rectangle): Rectangle;
|
|
30363
|
+
}
|
|
30364
|
+
|
|
30365
|
+
/**
|
|
30366
|
+
* Specifies a set of clipping polygons. Clipping polygons selectively disable rendering in a region
|
|
30367
|
+
* inside or outside the specified list of {@link ClippingPolygon} objects for a single glTF model, 3D Tileset, or the globe.
|
|
30368
|
+
*
|
|
30369
|
+
* Clipping Polygons are only supported in WebGL 2 contexts.
|
|
30370
|
+
* @example
|
|
30371
|
+
* const positions = Cesium.Cartesian3.fromRadiansArray([
|
|
30372
|
+
* -1.3194369277314022,
|
|
30373
|
+
* 0.6988062530900625,
|
|
30374
|
+
* -1.31941,
|
|
30375
|
+
* 0.69879,
|
|
30376
|
+
* -1.3193955980204217,
|
|
30377
|
+
* 0.6988091578771254,
|
|
30378
|
+
* -1.3193931220959367,
|
|
30379
|
+
* 0.698743632490865,
|
|
30380
|
+
* -1.3194358224045408,
|
|
30381
|
+
* 0.6987471965556998,
|
|
30382
|
+
* ]);
|
|
30383
|
+
*
|
|
30384
|
+
* const polygon = new Cesium.ClippingPolygon({
|
|
30385
|
+
* positions: positions
|
|
30386
|
+
* });
|
|
30387
|
+
*
|
|
30388
|
+
* const polygons = new Cesium.ClippingPolygonCollection({
|
|
30389
|
+
* polygons: [ polygon ]
|
|
30390
|
+
* });
|
|
30391
|
+
* @param [options] - Object with the following properties:
|
|
30392
|
+
* @param [options.polygons = []] - An array of {@link ClippingPolygon} objects used to selectively disable rendering on the inside of each polygon.
|
|
30393
|
+
* @param [options.enabled = true] - Determines whether the clipping polygons are active.
|
|
30394
|
+
* @param [options.inverse = false] - If true, a region will be clipped if it is outside of every polygon in the collection. Otherwise, a region will only be clipped if it is on the inside of any polygon.
|
|
30395
|
+
*/
|
|
30396
|
+
export class ClippingPolygonCollection {
|
|
30397
|
+
constructor(options?: {
|
|
30398
|
+
polygons?: ClippingPolygon[];
|
|
30399
|
+
enabled?: boolean;
|
|
30400
|
+
inverse?: boolean;
|
|
30401
|
+
});
|
|
30402
|
+
/**
|
|
30403
|
+
* An event triggered when a new clipping polygon is added to the collection. Event handlers
|
|
30404
|
+
* are passed the new polygon and the index at which it was added.
|
|
30405
|
+
*/
|
|
30406
|
+
polygonAdded: Event;
|
|
30407
|
+
/**
|
|
30408
|
+
* An event triggered when a new clipping polygon is removed from the collection. Event handlers
|
|
30409
|
+
* are passed the new polygon and the index from which it was removed.
|
|
30410
|
+
*/
|
|
30411
|
+
polygonRemoved: Event;
|
|
30412
|
+
/**
|
|
30413
|
+
* Returns the number of polygons in this collection. This is commonly used with
|
|
30414
|
+
* {@link ClippingPolygonCollection#get} to iterate over all the polygons
|
|
30415
|
+
* in the collection.
|
|
30416
|
+
*/
|
|
30417
|
+
readonly length: number;
|
|
30418
|
+
/**
|
|
30419
|
+
* Adds the specified {@link ClippingPolygon} to the collection to be used to selectively disable rendering
|
|
30420
|
+
* on the inside of each polygon. Use {@link ClippingPolygonCollection#unionClippingRegions} to modify
|
|
30421
|
+
* how modify the clipping behavior of multiple polygons.
|
|
30422
|
+
* @example
|
|
30423
|
+
* const polygons = new Cesium.ClippingPolygonCollection();
|
|
30424
|
+
*
|
|
30425
|
+
* const positions = Cesium.Cartesian3.fromRadiansArray([
|
|
30426
|
+
* -1.3194369277314022,
|
|
30427
|
+
* 0.6988062530900625,
|
|
30428
|
+
* -1.31941,
|
|
30429
|
+
* 0.69879,
|
|
30430
|
+
* -1.3193955980204217,
|
|
30431
|
+
* 0.6988091578771254,
|
|
30432
|
+
* -1.3193931220959367,
|
|
30433
|
+
* 0.698743632490865,
|
|
30434
|
+
* -1.3194358224045408,
|
|
30435
|
+
* 0.6987471965556998,
|
|
30436
|
+
* ]);
|
|
30437
|
+
*
|
|
30438
|
+
* polygons.add(new Cesium.ClippingPolygon({
|
|
30439
|
+
* positions: positions
|
|
30440
|
+
* }));
|
|
30441
|
+
* @param polygon - The ClippingPolygon to add to the collection.
|
|
30442
|
+
* @returns The added ClippingPolygon.
|
|
30443
|
+
*/
|
|
30444
|
+
add(polygon: ClippingPolygon): ClippingPolygon;
|
|
30445
|
+
/**
|
|
30446
|
+
* Returns the clipping polygon in the collection at the specified index. Indices are zero-based
|
|
30447
|
+
* and increase as polygons are added. Removing a polygon polygon all polygons after
|
|
30448
|
+
* it to the left, changing their indices. This function is commonly used with
|
|
30449
|
+
* {@link ClippingPolygonCollection#length} to iterate over all the polygons
|
|
30450
|
+
* in the collection.
|
|
30451
|
+
* @param index - The zero-based index of the polygon.
|
|
30452
|
+
* @returns The ClippingPolygon at the specified index.
|
|
30453
|
+
*/
|
|
30454
|
+
get(index: number): ClippingPolygon;
|
|
30455
|
+
/**
|
|
30456
|
+
* Checks whether this collection contains a ClippingPolygon equal to the given ClippingPolygon.
|
|
30457
|
+
* @param polygon - The ClippingPolygon to check for.
|
|
30458
|
+
* @returns true if this collection contains the ClippingPolygon, false otherwise.
|
|
30459
|
+
*/
|
|
30460
|
+
contains(polygon: ClippingPolygon): boolean;
|
|
30461
|
+
/**
|
|
30462
|
+
* Removes the first occurrence of the given ClippingPolygon from the collection.
|
|
30463
|
+
* @returns <code>true</code> if the polygon was removed; <code>false</code> if the polygon was not found in the collection.
|
|
30464
|
+
*/
|
|
30465
|
+
remove(polygon: ClippingPolygon): boolean;
|
|
30466
|
+
/**
|
|
30467
|
+
* Removes all polygons from the collection.
|
|
30468
|
+
*/
|
|
30469
|
+
removeAll(): void;
|
|
30470
|
+
/**
|
|
30471
|
+
* Function for checking if the context will allow clipping polygons, which require floating point textures.
|
|
30472
|
+
* @param scene - The scene that will contain clipped objects and clipping textures.
|
|
30473
|
+
* @returns <code>true</code> if the context supports clipping polygons.
|
|
30474
|
+
*/
|
|
30475
|
+
static isSupported(scene: Scene | any): boolean;
|
|
30476
|
+
/**
|
|
30477
|
+
* Returns true if this object was destroyed; otherwise, false.
|
|
30478
|
+
* <br /><br />
|
|
30479
|
+
* If this object was destroyed, it should not be used; calling any function other than
|
|
30480
|
+
* <code>isDestroyed</code> will result in a {@link DeveloperError} exception.
|
|
30481
|
+
* @returns <code>true</code> if this object was destroyed; otherwise, <code>false</code>.
|
|
30482
|
+
*/
|
|
30483
|
+
isDestroyed(): boolean;
|
|
30484
|
+
/**
|
|
30485
|
+
* Destroys the WebGL resources held by this object. Destroying an object allows for deterministic
|
|
30486
|
+
* release of WebGL resources, instead of relying on the garbage collector to destroy this object.
|
|
30487
|
+
* <br /><br />
|
|
30488
|
+
* Once an object is destroyed, it should not be used; calling any function other than
|
|
30489
|
+
* <code>isDestroyed</code> will result in a {@link DeveloperError} exception. Therefore,
|
|
30490
|
+
* assign the return value (<code>undefined</code>) to the object as done in the example.
|
|
30491
|
+
* @example
|
|
30492
|
+
* clippingPolygons = clippingPolygons && clippingPolygons.destroy();
|
|
30493
|
+
*/
|
|
30494
|
+
destroy(): void;
|
|
30495
|
+
}
|
|
30496
|
+
|
|
30289
30497
|
/**
|
|
30290
30498
|
* A renderable collection of clouds in the 3D scene.
|
|
30291
30499
|
* <br /><br />
|
|
@@ -31695,6 +31903,10 @@ export class Globe {
|
|
|
31695
31903
|
* A property specifying a {@link ClippingPlaneCollection} used to selectively disable rendering on the outside of each plane.
|
|
31696
31904
|
*/
|
|
31697
31905
|
clippingPlanes: ClippingPlaneCollection;
|
|
31906
|
+
/**
|
|
31907
|
+
* A property specifying a {@link ClippingPolygonCollection} used to selectively disable rendering inside or outside a list of polygons.
|
|
31908
|
+
*/
|
|
31909
|
+
clippingPolygons: ClippingPolygonCollection;
|
|
31698
31910
|
/**
|
|
31699
31911
|
* A property specifying a {@link Rectangle} used to limit globe rendering to a cartographic area.
|
|
31700
31912
|
* Defaults to the maximum extent of cartographic coordinates.
|
|
@@ -36411,6 +36623,10 @@ export class Model {
|
|
|
36411
36623
|
* The {@link ClippingPlaneCollection} used to selectively disable rendering the model.
|
|
36412
36624
|
*/
|
|
36413
36625
|
clippingPlanes: ClippingPlaneCollection;
|
|
36626
|
+
/**
|
|
36627
|
+
* The {@link ClippingPolygonCollection} used to selectively disable rendering the model.
|
|
36628
|
+
*/
|
|
36629
|
+
clippingPolygons: ClippingPolygonCollection;
|
|
36414
36630
|
/**
|
|
36415
36631
|
* The light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
|
|
36416
36632
|
* <p>
|
|
@@ -36648,6 +36864,7 @@ export class Model {
|
|
|
36648
36864
|
* @param [options.showOutline = true] - Whether to display the outline for models using the {@link https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/CESIUM_primitive_outline|CESIUM_primitive_outline} extension. When true, outlines are displayed. When false, outlines are not displayed.
|
|
36649
36865
|
* @param [options.outlineColor = Color.BLACK] - The color to use when rendering outlines.
|
|
36650
36866
|
* @param [options.clippingPlanes] - The {@link ClippingPlaneCollection} used to selectively disable rendering the model.
|
|
36867
|
+
* @param [options.clippingPolygons] - The {@link ClippingPolygonCollection} used to selectively disable rendering the model.
|
|
36651
36868
|
* @param [options.lightColor] - The light color when shading the model. When <code>undefined</code> the scene's light color is used instead.
|
|
36652
36869
|
* @param [options.imageBasedLighting] - The properties for managing image-based lighting on this model.
|
|
36653
36870
|
* @param [options.backFaceCulling = true] - Whether to cull back-facing geometry. When true, back face culling is determined by the material's doubleSided property; when false, back face culling is disabled. Back faces are not culled if the model's color is translucent.
|
|
@@ -36699,6 +36916,7 @@ export class Model {
|
|
|
36699
36916
|
showOutline?: boolean;
|
|
36700
36917
|
outlineColor?: Color;
|
|
36701
36918
|
clippingPlanes?: ClippingPlaneCollection;
|
|
36919
|
+
clippingPolygons?: ClippingPolygonCollection;
|
|
36702
36920
|
lightColor?: Cartesian3;
|
|
36703
36921
|
imageBasedLighting?: ImageBasedLighting;
|
|
36704
36922
|
backFaceCulling?: boolean;
|
|
@@ -41285,6 +41503,14 @@ export class Terrain {
|
|
|
41285
41503
|
* are passed the created instance of {@link TerrainProvider}.
|
|
41286
41504
|
*/
|
|
41287
41505
|
readonly readyEvent: Event<Terrain.ReadyEventCallback>;
|
|
41506
|
+
/**
|
|
41507
|
+
* Returns true when the terrain provider has been successfully created. Otherwise, returns false.
|
|
41508
|
+
*/
|
|
41509
|
+
readonly ready: boolean;
|
|
41510
|
+
/**
|
|
41511
|
+
* The terrain provider providing surface geometry to a globe. Do not use until {@link Terrain.readyEvent} is raised.
|
|
41512
|
+
*/
|
|
41513
|
+
readonly provider: TerrainProvider;
|
|
41288
41514
|
/**
|
|
41289
41515
|
* Creates a {@link Terrain} instance for {@link https://cesium.com/content/#cesium-world-terrain|Cesium World Terrain}.
|
|
41290
41516
|
* @example
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
globalThis.CESIUM_VERSION = "1.
|
|
1
|
+
globalThis.CESIUM_VERSION = "1.117";
|
|
2
2
|
export { default as AutomaticUniforms } from './Source/Renderer/AutomaticUniforms.js';
|
|
3
3
|
export { default as Buffer } from './Source/Renderer/Buffer.js';
|
|
4
4
|
export { default as BufferUsage } from './Source/Renderer/BufferUsage.js';
|
|
@@ -172,6 +172,7 @@ export { default as _shadersOctahedralProjectionFS } from './Source/Shaders/Octa
|
|
|
172
172
|
export { default as _shadersOctahedralProjectionVS } from './Source/Shaders/OctahedralProjectionVS.js';
|
|
173
173
|
export { default as _shadersPointPrimitiveCollectionFS } from './Source/Shaders/PointPrimitiveCollectionFS.js';
|
|
174
174
|
export { default as _shadersPointPrimitiveCollectionVS } from './Source/Shaders/PointPrimitiveCollectionVS.js';
|
|
175
|
+
export { default as _shadersPolygonSignedDistanceFS } from './Source/Shaders/PolygonSignedDistanceFS.js';
|
|
175
176
|
export { default as _shadersPolylineCommon } from './Source/Shaders/PolylineCommon.js';
|
|
176
177
|
export { default as _shadersPolylineFS } from './Source/Shaders/PolylineFS.js';
|
|
177
178
|
export { default as _shadersPolylineShadowVolumeFS } from './Source/Shaders/PolylineShadowVolumeFS.js';
|
|
@@ -538,6 +539,8 @@ export { default as ClassificationPrimitive } from './Source/Scene/Classificatio
|
|
|
538
539
|
export { default as ClassificationType } from './Source/Scene/ClassificationType.js';
|
|
539
540
|
export { default as ClippingPlane } from './Source/Scene/ClippingPlane.js';
|
|
540
541
|
export { default as ClippingPlaneCollection } from './Source/Scene/ClippingPlaneCollection.js';
|
|
542
|
+
export { default as ClippingPolygon } from './Source/Scene/ClippingPolygon.js';
|
|
543
|
+
export { default as ClippingPolygonCollection } from './Source/Scene/ClippingPolygonCollection.js';
|
|
541
544
|
export { default as CloudCollection } from './Source/Scene/CloudCollection.js';
|
|
542
545
|
export { default as CloudType } from './Source/Scene/CloudType.js';
|
|
543
546
|
export { default as ColorBlendMode } from './Source/Scene/ColorBlendMode.js';
|
|
@@ -861,6 +864,8 @@ export { default as _shadersMaterialStageFS } from './Source/Shaders/Model/Mater
|
|
|
861
864
|
export { default as _shadersMetadataStageFS } from './Source/Shaders/Model/MetadataStageFS.js';
|
|
862
865
|
export { default as _shadersMetadataStageVS } from './Source/Shaders/Model/MetadataStageVS.js';
|
|
863
866
|
export { default as _shadersModelClippingPlanesStageFS } from './Source/Shaders/Model/ModelClippingPlanesStageFS.js';
|
|
867
|
+
export { default as _shadersModelClippingPolygonsStageFS } from './Source/Shaders/Model/ModelClippingPolygonsStageFS.js';
|
|
868
|
+
export { default as _shadersModelClippingPolygonsStageVS } from './Source/Shaders/Model/ModelClippingPolygonsStageVS.js';
|
|
864
869
|
export { default as _shadersModelColorStageFS } from './Source/Shaders/Model/ModelColorStageFS.js';
|
|
865
870
|
export { default as _shadersModelFS } from './Source/Shaders/Model/ModelFS.js';
|
|
866
871
|
export { default as _shadersModelSilhouetteStageFS } from './Source/Shaders/Model/ModelSilhouetteStageFS.js';
|
|
@@ -874,22 +879,6 @@ export { default as _shadersPrimitiveOutlineStageVS } from './Source/Shaders/Mod
|
|
|
874
879
|
export { default as _shadersSelectedFeatureIdStageCommon } from './Source/Shaders/Model/SelectedFeatureIdStageCommon.js';
|
|
875
880
|
export { default as _shadersSkinningStageVS } from './Source/Shaders/Model/SkinningStageVS.js';
|
|
876
881
|
export { default as _shadersVerticalExaggerationStageVS } from './Source/Shaders/Model/VerticalExaggerationStageVS.js';
|
|
877
|
-
export { default as _shadersIntersectBox } from './Source/Shaders/Voxels/IntersectBox.js';
|
|
878
|
-
export { default as _shadersIntersectClippingPlanes } from './Source/Shaders/Voxels/IntersectClippingPlanes.js';
|
|
879
|
-
export { default as _shadersIntersectCylinder } from './Source/Shaders/Voxels/IntersectCylinder.js';
|
|
880
|
-
export { default as _shadersIntersectDepth } from './Source/Shaders/Voxels/IntersectDepth.js';
|
|
881
|
-
export { default as _shadersIntersectEllipsoid } from './Source/Shaders/Voxels/IntersectEllipsoid.js';
|
|
882
|
-
export { default as _shadersIntersectLongitude } from './Source/Shaders/Voxels/IntersectLongitude.js';
|
|
883
|
-
export { default as _shadersIntersection } from './Source/Shaders/Voxels/Intersection.js';
|
|
884
|
-
export { default as _shadersIntersectionUtils } from './Source/Shaders/Voxels/IntersectionUtils.js';
|
|
885
|
-
export { default as _shadersMegatexture } from './Source/Shaders/Voxels/Megatexture.js';
|
|
886
|
-
export { default as _shadersOctree } from './Source/Shaders/Voxels/Octree.js';
|
|
887
|
-
export { default as _shadersVoxelFS } from './Source/Shaders/Voxels/VoxelFS.js';
|
|
888
|
-
export { default as _shadersVoxelUtils } from './Source/Shaders/Voxels/VoxelUtils.js';
|
|
889
|
-
export { default as _shadersVoxelVS } from './Source/Shaders/Voxels/VoxelVS.js';
|
|
890
|
-
export { default as _shadersconvertUvToBox } from './Source/Shaders/Voxels/convertUvToBox.js';
|
|
891
|
-
export { default as _shadersconvertUvToCylinder } from './Source/Shaders/Voxels/convertUvToCylinder.js';
|
|
892
|
-
export { default as _shadersconvertUvToEllipsoid } from './Source/Shaders/Voxels/convertUvToEllipsoid.js';
|
|
893
882
|
export { default as _shadersAcesTonemappingStage } from './Source/Shaders/PostProcessStages/AcesTonemappingStage.js';
|
|
894
883
|
export { default as _shadersAdditiveBlend } from './Source/Shaders/PostProcessStages/AdditiveBlend.js';
|
|
895
884
|
export { default as _shadersAmbientOcclusionGenerate } from './Source/Shaders/PostProcessStages/AmbientOcclusionGenerate.js';
|
|
@@ -915,6 +904,22 @@ export { default as _shadersPassThroughDepth } from './Source/Shaders/PostProces
|
|
|
915
904
|
export { default as _shadersPointCloudEyeDomeLighting } from './Source/Shaders/PostProcessStages/PointCloudEyeDomeLighting.js';
|
|
916
905
|
export { default as _shadersReinhardTonemapping } from './Source/Shaders/PostProcessStages/ReinhardTonemapping.js';
|
|
917
906
|
export { default as _shadersSilhouette } from './Source/Shaders/PostProcessStages/Silhouette.js';
|
|
907
|
+
export { default as _shadersIntersectBox } from './Source/Shaders/Voxels/IntersectBox.js';
|
|
908
|
+
export { default as _shadersIntersectClippingPlanes } from './Source/Shaders/Voxels/IntersectClippingPlanes.js';
|
|
909
|
+
export { default as _shadersIntersectCylinder } from './Source/Shaders/Voxels/IntersectCylinder.js';
|
|
910
|
+
export { default as _shadersIntersectDepth } from './Source/Shaders/Voxels/IntersectDepth.js';
|
|
911
|
+
export { default as _shadersIntersectEllipsoid } from './Source/Shaders/Voxels/IntersectEllipsoid.js';
|
|
912
|
+
export { default as _shadersIntersectLongitude } from './Source/Shaders/Voxels/IntersectLongitude.js';
|
|
913
|
+
export { default as _shadersIntersection } from './Source/Shaders/Voxels/Intersection.js';
|
|
914
|
+
export { default as _shadersIntersectionUtils } from './Source/Shaders/Voxels/IntersectionUtils.js';
|
|
915
|
+
export { default as _shadersMegatexture } from './Source/Shaders/Voxels/Megatexture.js';
|
|
916
|
+
export { default as _shadersOctree } from './Source/Shaders/Voxels/Octree.js';
|
|
917
|
+
export { default as _shadersVoxelFS } from './Source/Shaders/Voxels/VoxelFS.js';
|
|
918
|
+
export { default as _shadersVoxelUtils } from './Source/Shaders/Voxels/VoxelUtils.js';
|
|
919
|
+
export { default as _shadersVoxelVS } from './Source/Shaders/Voxels/VoxelVS.js';
|
|
920
|
+
export { default as _shadersconvertUvToBox } from './Source/Shaders/Voxels/convertUvToBox.js';
|
|
921
|
+
export { default as _shadersconvertUvToCylinder } from './Source/Shaders/Voxels/convertUvToCylinder.js';
|
|
922
|
+
export { default as _shadersconvertUvToEllipsoid } from './Source/Shaders/Voxels/convertUvToEllipsoid.js';
|
|
918
923
|
export { default as ForEach } from './Source/Scene/GltfPipeline/ForEach.js';
|
|
919
924
|
export { default as addBuffer } from './Source/Scene/GltfPipeline/addBuffer.js';
|
|
920
925
|
export { default as addDefaults } from './Source/Scene/GltfPipeline/addDefaults.js';
|
|
@@ -970,6 +975,7 @@ export { default as ModelAnimationCollection } from './Source/Scene/Model/ModelA
|
|
|
970
975
|
export { default as ModelArticulation } from './Source/Scene/Model/ModelArticulation.js';
|
|
971
976
|
export { default as ModelArticulationStage } from './Source/Scene/Model/ModelArticulationStage.js';
|
|
972
977
|
export { default as ModelClippingPlanesPipelineStage } from './Source/Scene/Model/ModelClippingPlanesPipelineStage.js';
|
|
978
|
+
export { default as ModelClippingPolygonsPipelineStage } from './Source/Scene/Model/ModelClippingPolygonsPipelineStage.js';
|
|
973
979
|
export { default as ModelColorPipelineStage } from './Source/Scene/Model/ModelColorPipelineStage.js';
|
|
974
980
|
export { default as ModelDrawCommand } from './Source/Scene/Model/ModelDrawCommand.js';
|
|
975
981
|
export { default as ModelFeature } from './Source/Scene/Model/ModelFeature.js';
|
|
@@ -1048,6 +1054,15 @@ export { default as _shaderssolarRadius } from './Source/Shaders/Builtin/Constan
|
|
|
1048
1054
|
export { default as _shadersthreePiOver2 } from './Source/Shaders/Builtin/Constants/threePiOver2.js';
|
|
1049
1055
|
export { default as _shaderstwoPi } from './Source/Shaders/Builtin/Constants/twoPi.js';
|
|
1050
1056
|
export { default as _shaderswebMercatorMaxLatitude } from './Source/Shaders/Builtin/Constants/webMercatorMaxLatitude.js';
|
|
1057
|
+
export { default as _shadersdepthRangeStruct } from './Source/Shaders/Builtin/Structs/depthRangeStruct.js';
|
|
1058
|
+
export { default as _shadersmaterial } from './Source/Shaders/Builtin/Structs/material.js';
|
|
1059
|
+
export { default as _shadersmaterialInput } from './Source/Shaders/Builtin/Structs/materialInput.js';
|
|
1060
|
+
export { default as _shadersmodelMaterial } from './Source/Shaders/Builtin/Structs/modelMaterial.js';
|
|
1061
|
+
export { default as _shadersmodelVertexOutput } from './Source/Shaders/Builtin/Structs/modelVertexOutput.js';
|
|
1062
|
+
export { default as _shaderspbrParameters } from './Source/Shaders/Builtin/Structs/pbrParameters.js';
|
|
1063
|
+
export { default as _shadersray } from './Source/Shaders/Builtin/Structs/ray.js';
|
|
1064
|
+
export { default as _shadersraySegment } from './Source/Shaders/Builtin/Structs/raySegment.js';
|
|
1065
|
+
export { default as _shadersshadowParameters } from './Source/Shaders/Builtin/Structs/shadowParameters.js';
|
|
1051
1066
|
export { default as _shadersHSBToRGB } from './Source/Shaders/Builtin/Functions/HSBToRGB.js';
|
|
1052
1067
|
export { default as _shadersHSLToRGB } from './Source/Shaders/Builtin/Functions/HSLToRGB.js';
|
|
1053
1068
|
export { default as _shadersRGBToHSB } from './Source/Shaders/Builtin/Functions/RGBToHSB.js';
|
|
@@ -1066,6 +1081,7 @@ export { default as _shaderscascadeColor } from './Source/Shaders/Builtin/Functi
|
|
|
1066
1081
|
export { default as _shaderscascadeDistance } from './Source/Shaders/Builtin/Functions/cascadeDistance.js';
|
|
1067
1082
|
export { default as _shaderscascadeMatrix } from './Source/Shaders/Builtin/Functions/cascadeMatrix.js';
|
|
1068
1083
|
export { default as _shaderscascadeWeights } from './Source/Shaders/Builtin/Functions/cascadeWeights.js';
|
|
1084
|
+
export { default as _shadersclipPolygons } from './Source/Shaders/Builtin/Functions/clipPolygons.js';
|
|
1069
1085
|
export { default as _shaderscolumbusViewMorph } from './Source/Shaders/Builtin/Functions/columbusViewMorph.js';
|
|
1070
1086
|
export { default as _shaderscomputeAtmosphereColor } from './Source/Shaders/Builtin/Functions/computeAtmosphereColor.js';
|
|
1071
1087
|
export { default as _shaderscomputeGroundAtmosphereScattering } from './Source/Shaders/Builtin/Functions/computeGroundAtmosphereScattering.js';
|
|
@@ -1129,6 +1145,7 @@ export { default as _shaderstransformPlane } from './Source/Shaders/Builtin/Func
|
|
|
1129
1145
|
export { default as _shaderstranslateRelativeToEye } from './Source/Shaders/Builtin/Functions/translateRelativeToEye.js';
|
|
1130
1146
|
export { default as _shaderstranslucentPhong } from './Source/Shaders/Builtin/Functions/translucentPhong.js';
|
|
1131
1147
|
export { default as _shaderstranspose } from './Source/Shaders/Builtin/Functions/transpose.js';
|
|
1148
|
+
export { default as _shadersunpackClippingExtents } from './Source/Shaders/Builtin/Functions/unpackClippingExtents.js';
|
|
1132
1149
|
export { default as _shadersunpackDepth } from './Source/Shaders/Builtin/Functions/unpackDepth.js';
|
|
1133
1150
|
export { default as _shadersunpackFloat } from './Source/Shaders/Builtin/Functions/unpackFloat.js';
|
|
1134
1151
|
export { default as _shadersunpackUint } from './Source/Shaders/Builtin/Functions/unpackUint.js';
|
|
@@ -1138,13 +1155,4 @@ export { default as _shaderswindowToEyeCoordinates } from './Source/Shaders/Buil
|
|
|
1138
1155
|
export { default as _shaderswriteDepthClamp } from './Source/Shaders/Builtin/Functions/writeDepthClamp.js';
|
|
1139
1156
|
export { default as _shaderswriteLogDepth } from './Source/Shaders/Builtin/Functions/writeLogDepth.js';
|
|
1140
1157
|
export { default as _shaderswriteNonPerspective } from './Source/Shaders/Builtin/Functions/writeNonPerspective.js';
|
|
1141
|
-
export { default as _shadersdepthRangeStruct } from './Source/Shaders/Builtin/Structs/depthRangeStruct.js';
|
|
1142
|
-
export { default as _shadersmaterial } from './Source/Shaders/Builtin/Structs/material.js';
|
|
1143
|
-
export { default as _shadersmaterialInput } from './Source/Shaders/Builtin/Structs/materialInput.js';
|
|
1144
|
-
export { default as _shadersmodelMaterial } from './Source/Shaders/Builtin/Structs/modelMaterial.js';
|
|
1145
|
-
export { default as _shadersmodelVertexOutput } from './Source/Shaders/Builtin/Structs/modelVertexOutput.js';
|
|
1146
|
-
export { default as _shaderspbrParameters } from './Source/Shaders/Builtin/Structs/pbrParameters.js';
|
|
1147
|
-
export { default as _shadersray } from './Source/Shaders/Builtin/Structs/ray.js';
|
|
1148
|
-
export { default as _shadersraySegment } from './Source/Shaders/Builtin/Structs/raySegment.js';
|
|
1149
|
-
export { default as _shadersshadowParameters } from './Source/Shaders/Builtin/Structs/shadowParameters.js';
|
|
1150
1158
|
export { default as createTaskProcessorWorker } from './Source/Workers/createTaskProcessorWorker.js';
|