@galacean/cli 2.0.0-alpha.14 → 2.0.0-alpha.15

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.
Files changed (92) hide show
  1. package/dist/cli.bundle.cjs +24 -9
  2. package/dist/viewport-client/_static/{Accordion-3d330bc6.js → Accordion-930aedee.js} +1 -1
  3. package/dist/viewport-client/_static/{AmbientLightAsset-bdbc4e1d.js → AmbientLightAsset-f9c1eb91.js} +1 -1
  4. package/dist/viewport-client/_static/{AnimationClipAsset-9167378a.js → AnimationClipAsset-61699477.js} +1 -1
  5. package/dist/viewport-client/_static/{AnimatorControllerAsset-21dc6332.js → AnimatorControllerAsset-1c05f4db.js} +1 -1
  6. package/dist/viewport-client/_static/{AnimatorStore-18d3c551.js → AnimatorStore-6a3679e5.js} +1 -1
  7. package/dist/viewport-client/_static/{AssetViewer-64cd01fa.js → AssetViewer-0ce46fa1.js} +1 -1
  8. package/dist/viewport-client/_static/{AudioAsset-0c828c80.js → AudioAsset-5127eeec.js} +1 -1
  9. package/dist/viewport-client/_static/{AudioComponent-fbff3825.js → AudioComponent-18a3e59f.js} +1 -1
  10. package/dist/viewport-client/_static/{Callout-ba7e2adf.js → Callout-b6ac1af7.js} +1 -1
  11. package/dist/viewport-client/_static/{CameraComponent-74975570.js → CameraComponent-0a115258.js} +1 -1
  12. package/dist/viewport-client/_static/{Component-ed7aa0ab.js → Component-746be670.js} +1 -1
  13. package/dist/viewport-client/_static/{DirectLight-b884e7db.js → DirectLight-4c53e9f6.js} +1 -1
  14. package/dist/viewport-client/_static/{FontAsset-d1ced18d.js → FontAsset-a3a92f7d.js} +1 -1
  15. package/dist/viewport-client/_static/{FormItemArray-6d69acd4.js → FormItemArray-a2f72cf1.js} +1 -1
  16. package/dist/viewport-client/_static/{GlTFAsset-2723b84a.js → GlTFAsset-5f37feef.js} +1 -1
  17. package/dist/viewport-client/_static/{IconEdit-ab77303f.js → IconEdit-2c768a0a.js} +1 -1
  18. package/dist/viewport-client/_static/{IconPointFilled-811fc660.js → IconPointFilled-209638e2.js} +1 -1
  19. package/dist/viewport-client/_static/{LightBaseComponent-12dc27d1.js → LightBaseComponent-51d498ea.js} +1 -1
  20. package/dist/viewport-client/_static/{LottieAnimationComponent-c48c5eb5.js → LottieAnimationComponent-bff0244b.js} +1 -1
  21. package/dist/viewport-client/_static/{LottieAsset-3692580d.js → LottieAsset-9d3ef507.js} +1 -1
  22. package/dist/viewport-client/_static/{MarkdownAsset-bcb90be4.js → MarkdownAsset-a17933fb.js} +1 -1
  23. package/dist/viewport-client/_static/{MaterialAsset-6ef9b4ed.js → MaterialAsset-3b56ac00.js} +1 -1
  24. package/dist/viewport-client/_static/{MaterialInspector-e8242674.js → MaterialInspector-a36197f2.js} +1 -1
  25. package/dist/viewport-client/_static/{Menu-0b8da92f.js → Menu-0a7dbec0.js} +1 -1
  26. package/dist/viewport-client/_static/{MeshAsset-ca9305e5.js → MeshAsset-2cf47eb2.js} +1 -1
  27. package/dist/viewport-client/_static/{MeshRendererBaseComponent-9efd3943.js → MeshRendererBaseComponent-4a3af376.js} +1 -1
  28. package/dist/viewport-client/_static/{MeshRendererComponent-c9a03641.js → MeshRendererComponent-ac4c3954.js} +1 -1
  29. package/dist/viewport-client/_static/{MeshThumbnail-ab28b3b8.js → MeshThumbnail-25cd4a13.js} +1 -1
  30. package/dist/viewport-client/_static/{ParticleRendererComponent-96947c1d.js → ParticleRendererComponent-0a470dee.js} +1 -1
  31. package/dist/viewport-client/_static/{PhysicsMaterialAsset-4a1e5ea3.js → PhysicsMaterialAsset-d87d35aa.js} +1 -1
  32. package/dist/viewport-client/_static/{PhysicsStore-33cac578.js → PhysicsStore-c283b2be.js} +1 -1
  33. package/dist/viewport-client/_static/{PointLight-fd514526.js → PointLight-b7de209f.js} +1 -1
  34. package/dist/viewport-client/_static/{PostProcessComponent-d0ea27a4.js → PostProcessComponent-d4c9ef58.js} +1 -1
  35. package/dist/viewport-client/_static/{PrefabAsset-9179b95c.js → PrefabAsset-d0c0cd25.js} +1 -1
  36. package/dist/viewport-client/_static/{PrimitiveMesh-0572a073.js → PrimitiveMesh-35092ad0.js} +1 -1
  37. package/dist/viewport-client/_static/{ProxyConfigs-3a5fd860.js → ProxyConfigs-ad92ebc7.js} +1 -1
  38. package/dist/viewport-client/_static/{ReferencedMaterial-5773c9d2.js → ReferencedMaterial-800a1955.js} +1 -1
  39. package/dist/viewport-client/_static/{RenderTargetAsset-ab6e06d2.js → RenderTargetAsset-a003f9f5.js} +1 -1
  40. package/dist/viewport-client/_static/{SceneAsset-385fa837.js → SceneAsset-87f2ea92.js} +1 -1
  41. package/dist/viewport-client/_static/{ShaderAsset-f4514b03.js → ShaderAsset-98ce1f70.js} +1 -1
  42. package/dist/viewport-client/_static/{ShaderChunkAsset-34116f2c.js → ShaderChunkAsset-e9072307.js} +1 -1
  43. package/dist/viewport-client/_static/{ShaderUIScriptAsset-fc503291.js → ShaderUIScriptAsset-ac824e68.js} +1 -1
  44. package/dist/viewport-client/_static/{SkinnedMeshRendererComponent-494ad439.js → SkinnedMeshRendererComponent-5f34bf46.js} +1 -1
  45. package/dist/viewport-client/_static/{SpineAnimationComponent-3918d7b5.js → SpineAnimationComponent-7c5db747.js} +1 -1
  46. package/dist/viewport-client/_static/{SpineSkeletonDataAsset-27244892.js → SpineSkeletonDataAsset-5b202ba0.js} +1 -1
  47. package/dist/viewport-client/_static/{SpotLight-f9972dc0.js → SpotLight-2b4e593e.js} +1 -1
  48. package/dist/viewport-client/_static/{SpriteAsset-558ffca8.js → SpriteAsset-4e895da5.js} +1 -1
  49. package/dist/viewport-client/_static/{SpriteAtlasAsset-cdc34386.js → SpriteAtlasAsset-c2894c12.js} +1 -1
  50. package/dist/viewport-client/_static/{SpriteBaseComponent-3edafa31.js → SpriteBaseComponent-a75e84c1.js} +1 -1
  51. package/dist/viewport-client/_static/{SpriteMaskComponent-de2e5231.js → SpriteMaskComponent-a31f3384.js} +1 -1
  52. package/dist/viewport-client/_static/{SpriteRendererComponent-e999e735.js → SpriteRendererComponent-c2123918.js} +1 -1
  53. package/dist/viewport-client/_static/{TextBaseComponent-ce1402c3.js → TextBaseComponent-95846acf.js} +1 -1
  54. package/dist/viewport-client/_static/{TextRendererComponent-f7c0deae.js → TextRendererComponent-429cf17b.js} +1 -1
  55. package/dist/viewport-client/_static/{TextureAsset-39fb07fe.js → TextureAsset-93475ade.js} +2 -2
  56. package/dist/viewport-client/_static/{Tooltip-82063435.js → Tooltip-dfde37c6.js} +1 -1
  57. package/dist/viewport-client/_static/{TrailRendererComponent-37f5c981.js → TrailRendererComponent-112b1618.js} +1 -1
  58. package/dist/viewport-client/_static/{TransformBaseComponent-713d57e9.js → TransformBaseComponent-a8050787.js} +1 -1
  59. package/dist/viewport-client/_static/{TransformComponent-40a57948.js → TransformComponent-c95e25c2.js} +1 -1
  60. package/dist/viewport-client/_static/{XRReferenceImageAsset-2f6ff226.js → XRReferenceImageAsset-dbf129aa.js} +1 -1
  61. package/dist/viewport-client/_static/{audio-7120ec91.js → audio-10589bb4.js} +1 -1
  62. package/dist/viewport-client/_static/index-010da0b3.js +1 -0
  63. package/dist/viewport-client/_static/{index-fbe040bf.js → index-07bbf729.js} +1 -1
  64. package/dist/viewport-client/_static/{index-aec7e708.js → index-1e23212d.js} +4 -4
  65. package/dist/viewport-client/_static/{index-f2cb64af.js → index-2cdbb69f.js} +1 -1
  66. package/dist/viewport-client/_static/{index-7834b582.js → index-31b7a6d3.js} +1 -1
  67. package/dist/viewport-client/_static/index-3439012b.js +1 -0
  68. package/dist/viewport-client/_static/{index-c63c9606.js → index-48760ac4.js} +1 -1
  69. package/dist/viewport-client/_static/index-65a103b6.js +1 -0
  70. package/dist/viewport-client/_static/{index-bfe6f30e.js → index-77b1de5c.js} +1 -1
  71. package/dist/viewport-client/_static/{index-e8a45e82.js → index-92830754.js} +1 -1
  72. package/dist/viewport-client/_static/{index-7917f782.js → index-93eab932.js} +1 -1
  73. package/dist/viewport-client/_static/{index-7acd49d2.js → index-b259cf2e.js} +1 -1
  74. package/dist/viewport-client/_static/{index-74130ff3.js → index-b2e1cba4.js} +1 -1
  75. package/dist/viewport-client/_static/index-b7bf2586.js +1 -0
  76. package/dist/viewport-client/_static/{index-78269e76.js → index-c20fc198.js} +1 -1
  77. package/dist/viewport-client/_static/index-dc62ba4b.js +1 -0
  78. package/dist/viewport-client/_static/index-ea9ea505.js +1 -0
  79. package/dist/viewport-client/_static/{ktx2-encoder-53b21bdc.js → ktx2-encoder-075abd75.js} +1 -1
  80. package/dist/viewport-client/_static/{module-8816772d.js → module-251ecc50.js} +1 -1
  81. package/dist/viewport-client/_static/{module-ffeaf99f.js → module-498119f3.js} +1 -1
  82. package/dist/viewport-client/_static/{module-220b3921.js → module-c6e2d190.js} +1 -1
  83. package/dist/viewport-client/_static/postmen-9e1e15bd.js +1 -0
  84. package/dist/viewport-client/index.html +1 -1
  85. package/package.json +1 -1
  86. package/dist/viewport-client/_static/index-483b5738.js +0 -1
  87. package/dist/viewport-client/_static/index-9d3917da.js +0 -1
  88. package/dist/viewport-client/_static/index-a9b2675e.js +0 -1
  89. package/dist/viewport-client/_static/index-b5582401.js +0 -1
  90. package/dist/viewport-client/_static/index-cd1fee9d.js +0 -1
  91. package/dist/viewport-client/_static/index-e73ceaed.js +0 -1
  92. package/dist/viewport-client/_static/postmen-2f47f6bb.js +0 -1
@@ -1 +1 @@
1
- var se=Object.defineProperty;var re=(t,e,n)=>e in t?se(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var k=(t,e,n)=>(re(t,typeof e!="symbol"?e+"":e,n),n);import{dm as ie,dn as oe,dp as ae,dq as M,dr as le}from"./index-aec7e708.js";import{T as fe}from"./TaskQueue-05c94a4d.js";class ce{constructor(e=4,n){k(this,"_taskQueue",[]);k(this,"_workerStatus",0);k(this,"_workerItems");this.limitedCount=e,this._workerCreator=n,this._workerItems=new Array(e)}prepareWorker(){const e=this.limitedCount,n=new Array(e);for(let r=0;r<e;r++)n.push(this._initWorker(r));return Promise.all(n)}postMessage(e){return new Promise((n,r)=>{const s=this._getIdleWorkerId();if(this._workerStatus|=1<<s,s!==-1){const u=this._workerItems;Promise.resolve(u[s]??this._initWorker(s)).then(()=>{const a=u[s];a.resolve=n,a.reject=r,a.worker.postMessage(e)}).catch(a=>{this._workerStatus^=1<<s,r(a)})}else this._taskQueue.push({resolve:n,reject:r,message:e})})}destroy(){const e=this._workerItems;for(let n=0,r=e.length;n<r;n++){const s=e[n];s.worker.terminate(),s.reject=null,s.resolve=null}e.length=0,this._taskQueue.length=0,this._workerStatus=0}_initWorker(e){return Promise.resolve(this._workerCreator()).then(n=>{const r=s=>{const u=this._workerItems[e];u!=null&&u.reject&&(u.reject(s.error||new Error("Worker error")),this._nextTask(e))};return n.addEventListener("message",this._onMessage.bind(this,e)),n.addEventListener("error",r),n.onerror=r,this._workerItems[e]={worker:n,resolve:null,reject:null},n})}_getIdleWorkerId(){for(let e=0,n=this.limitedCount;e<n;e++)if(!(this._workerStatus&1<<e))return e;return-1}_onMessage(e,n){n.data.error?this._workerItems[e].reject(n.data.error):this._workerItems[e].resolve(n),this._nextTask(e)}_nextTask(e){if(this._taskQueue.length){const n=this._taskQueue.shift(),r=this._workerItems[e];r.resolve=n.resolve,r.reject=n.reject,r.worker.postMessage(n.message)}else this._workerStatus^=1<<e}}const G=0,Q=0,ue=0,he=2,_e=0,de=0,ge=2,ye=1,q=64,Ue=0;class pe{constructor(){this.vkFormat=Ue,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=G,this.levels=[],this.dataFormatDescriptor=[{vendorId:ue,descriptorType:Q,descriptorBlockSize:0,versionNumber:he,colorModel:_e,colorPrimaries:ye,transferFunction:ge,flags:de,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class L{constructor(e,n,r,s){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+n,r),this._littleEndian=s,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian),n=this._dataView.getUint32(this._offset+4,this._littleEndian),r=e+2**32*n;return this._offset+=8,r}_nextInt32(){const e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint8Array(e){const n=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,e);return this._offset+=e,n}_skip(e){return this._offset+=e,this}_scan(e,n=0){const r=this._offset;let s=0;for(;this._dataView.getUint8(this._offset)!==n&&s<e;)s++,this._offset++;return s<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+r,s)}}const xe="KTX-Parse v0.7.1",H=new Uint8Array([0]),_=[171,75,84,88,32,50,48,187,13,10,26,10],K=68;function W(t){return new TextEncoder().encode(t)}function N(t){return new TextDecoder().decode(t)}function A(t){let e=0;for(const s of t)e+=s.byteLength;const n=new Uint8Array(e);let r=0;for(const s of t)n.set(new Uint8Array(s),r),r+=s.byteLength;return n}function me(t,e){const n=Math.max(t,e),r=Math.min(t,e);let s=n;for(;s%r!==0;)s+=n;return s}function j(t,e=4){return Math.ceil(t/e)*e-t}function we(t){return t.levels[0].levelData.byteLength/De(t,0)}function De(t,e){let n=1;const r=[t.pixelWidth,t.pixelHeight,t.pixelDepth],s=ke(t);for(let u=0;u<3;u++)if(r[u]>0){const a=Math.ceil(Math.floor(r[u]*Math.pow(2,-e))/s[u]);n*=Math.max(1,a)}return t.layerCount>0&&(n*=t.layerCount),t.faceCount>0&&(n*=t.faceCount),n}function ke(t){const[e,n,r]=t.dataFormatDescriptor[0].texelBlockDimension;return[e+1,n+1,r+1]}function be(t){const e=new Uint8Array(t.buffer,t.byteOffset,_.length);if(e[0]!==_[0]||e[1]!==_[1]||e[2]!==_[2]||e[3]!==_[3]||e[4]!==_[4]||e[5]!==_[5]||e[6]!==_[6]||e[7]!==_[7]||e[8]!==_[8]||e[9]!==_[9]||e[10]!==_[10]||e[11]!==_[11])throw new Error("Missing KTX 2.0 identifier.");const n=new pe,r=17*Uint32Array.BYTES_PER_ELEMENT,s=new L(t,_.length,r,!0);n.vkFormat=s._nextUint32(),n.typeSize=s._nextUint32(),n.pixelWidth=s._nextUint32(),n.pixelHeight=s._nextUint32(),n.pixelDepth=s._nextUint32(),n.layerCount=s._nextUint32(),n.faceCount=s._nextUint32();const u=s._nextUint32();n.supercompressionScheme=s._nextUint32();const a=s._nextUint32(),y=s._nextUint32(),c=s._nextUint32(),S=s._nextUint32(),b=s._nextUint64(),x=s._nextUint64(),U=u*3*8,m=new L(t,_.length+r,U,!0);for(let d=0;d<u;d++)n.levels.push({levelData:new Uint8Array(t.buffer,t.byteOffset+m._nextUint64(),m._nextUint64()),uncompressedByteLength:m._nextUint64()});const l=new L(t,a,y,!0),D={vendorId:l._skip(4)._nextUint16(),descriptorType:l._nextUint16(),versionNumber:l._nextUint16(),descriptorBlockSize:l._nextUint16(),colorModel:l._nextUint8(),colorPrimaries:l._nextUint8(),transferFunction:l._nextUint8(),flags:l._nextUint8(),texelBlockDimension:[l._nextUint8(),l._nextUint8(),l._nextUint8(),l._nextUint8()],bytesPlane:[l._nextUint8(),l._nextUint8(),l._nextUint8(),l._nextUint8(),l._nextUint8(),l._nextUint8(),l._nextUint8(),l._nextUint8()],samples:[]},B=6,w=4,T=(D.descriptorBlockSize/4-B)/w;for(let d=0;d<T;d++){const p={bitOffset:l._nextUint16(),bitLength:l._nextUint8(),channelType:l._nextUint8(),samplePosition:[l._nextUint8(),l._nextUint8(),l._nextUint8(),l._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};p.channelType&q?(p.sampleLower=l._nextInt32(),p.sampleUpper=l._nextInt32()):(p.sampleLower=l._nextUint32(),p.sampleUpper=l._nextUint32()),D.samples[d]=p}n.dataFormatDescriptor.length=0,n.dataFormatDescriptor.push(D);const h=new L(t,c,S,!0);for(;h._offset<S;){const d=h._nextUint32(),p=h._scan(d),I=N(p);if(n.keyValue[I]=h._nextUint8Array(d-p.byteLength-1),I.match(/^ktx/i)){const C=N(n.keyValue[I]);n.keyValue[I]=C.substring(0,C.lastIndexOf("\0"))}const ne=d%4?4-d%4:0;h._skip(ne)}if(x<=0)return n;const i=new L(t,b,x,!0),o=i._nextUint16(),f=i._nextUint16(),g=i._nextUint32(),v=i._nextUint32(),O=i._nextUint32(),Y=i._nextUint32(),P=[];for(let d=0;d<u;d++)P.push({imageFlags:i._nextUint32(),rgbSliceByteOffset:i._nextUint32(),rgbSliceByteLength:i._nextUint32(),alphaSliceByteOffset:i._nextUint32(),alphaSliceByteLength:i._nextUint32()});const R=b+i._offset,V=R+g,F=V+v,$=F+O,J=new Uint8Array(t.buffer,t.byteOffset+R,g),Z=new Uint8Array(t.buffer,t.byteOffset+V,v),ee=new Uint8Array(t.buffer,t.byteOffset+F,O),te=new Uint8Array(t.buffer,t.byteOffset+$,Y);return n.globalData={endpointCount:o,selectorCount:f,imageDescs:P,endpointsData:J,selectorsData:Z,tablesData:ee,extendedData:te},n}function E(){return E=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},E.apply(this,arguments)}const Be={keepWriter:!1};function ve(t,e={}){e=E({},Be,e);let n=new ArrayBuffer(0);if(t.globalData){const i=new ArrayBuffer(20+t.globalData.imageDescs.length*5*4),o=new DataView(i);o.setUint16(0,t.globalData.endpointCount,!0),o.setUint16(2,t.globalData.selectorCount,!0),o.setUint32(4,t.globalData.endpointsData.byteLength,!0),o.setUint32(8,t.globalData.selectorsData.byteLength,!0),o.setUint32(12,t.globalData.tablesData.byteLength,!0),o.setUint32(16,t.globalData.extendedData.byteLength,!0);for(let f=0;f<t.globalData.imageDescs.length;f++){const g=t.globalData.imageDescs[f];o.setUint32(20+f*5*4+0,g.imageFlags,!0),o.setUint32(20+f*5*4+4,g.rgbSliceByteOffset,!0),o.setUint32(20+f*5*4+8,g.rgbSliceByteLength,!0),o.setUint32(20+f*5*4+12,g.alphaSliceByteOffset,!0),o.setUint32(20+f*5*4+16,g.alphaSliceByteLength,!0)}n=A([i,t.globalData.endpointsData,t.globalData.selectorsData,t.globalData.tablesData,t.globalData.extendedData])}const r=[];let s=t.keyValue;e.keepWriter||(s=E({},t.keyValue,{KTXwriter:xe}));for(const i in s){const o=s[i],f=W(i),g=typeof o=="string"?A([W(o),H]):o,v=f.byteLength+1+g.byteLength,O=j(v,4);r.push(A([new Uint32Array([v]),f,H,g,new Uint8Array(O).fill(0)]))}const u=A(r);if(t.dataFormatDescriptor.length!==1||t.dataFormatDescriptor[0].descriptorType!==Q)throw new Error("Only BASICFORMAT Data Format Descriptor output supported.");const a=t.dataFormatDescriptor[0],y=new ArrayBuffer(28+a.samples.length*16),c=new DataView(y),S=24+a.samples.length*16;if(c.setUint32(0,y.byteLength,!0),c.setUint16(4,a.vendorId,!0),c.setUint16(6,a.descriptorType,!0),c.setUint16(8,a.versionNumber,!0),c.setUint16(10,S,!0),c.setUint8(12,a.colorModel),c.setUint8(13,a.colorPrimaries),c.setUint8(14,a.transferFunction),c.setUint8(15,a.flags),!Array.isArray(a.texelBlockDimension))throw new Error("texelBlockDimension is now an array. For dimensionality `d`, set `d - 1`.");c.setUint8(16,a.texelBlockDimension[0]),c.setUint8(17,a.texelBlockDimension[1]),c.setUint8(18,a.texelBlockDimension[2]),c.setUint8(19,a.texelBlockDimension[3]);for(let i=0;i<8;i++)c.setUint8(20+i,a.bytesPlane[i]);for(let i=0;i<a.samples.length;i++){const o=a.samples[i],f=28+i*16;if(o.channelID)throw new Error("channelID has been renamed to channelType.");c.setUint16(f+0,o.bitOffset,!0),c.setUint8(f+2,o.bitLength),c.setUint8(f+3,o.channelType),c.setUint8(f+4,o.samplePosition[0]),c.setUint8(f+5,o.samplePosition[1]),c.setUint8(f+6,o.samplePosition[2]),c.setUint8(f+7,o.samplePosition[3]),o.channelType&q?(c.setInt32(f+8,o.sampleLower,!0),c.setInt32(f+12,o.sampleUpper,!0)):(c.setUint32(f+8,o.sampleLower,!0),c.setUint32(f+12,o.sampleUpper,!0))}const b=_.length+K+t.levels.length*3*8,x=b+y.byteLength;let U=n.byteLength>0?x+u.byteLength:0;U%8&&(U+=8-U%8);const m=[],l=new DataView(new ArrayBuffer(t.levels.length*3*8)),D=new Uint32Array(t.levels.length);let B=0;t.supercompressionScheme===G&&(B=me(we(t),4));let w=(U||x+u.byteLength)+n.byteLength;for(let i=t.levels.length-1;i>=0;i--){if(w%B){const f=j(w,B);m.push(new Uint8Array(f)),w+=f}const o=t.levels[i];m.push(o.levelData),D[i]=w,w+=o.levelData.byteLength}for(let i=0;i<t.levels.length;i++){const o=t.levels[i];l.setBigUint64(i*24+0,BigInt(D[i]),!0),l.setBigUint64(i*24+8,BigInt(o.levelData.byteLength),!0),l.setBigUint64(i*24+16,BigInt(o.uncompressedByteLength),!0)}const T=new ArrayBuffer(K),h=new DataView(T);return h.setUint32(0,t.vkFormat,!0),h.setUint32(4,t.typeSize,!0),h.setUint32(8,t.pixelWidth,!0),h.setUint32(12,t.pixelHeight,!0),h.setUint32(16,t.pixelDepth,!0),h.setUint32(20,t.layerCount,!0),h.setUint32(24,t.faceCount,!0),h.setUint32(28,t.levels.length,!0),h.setUint32(32,t.supercompressionScheme,!0),h.setUint32(36,b,!0),h.setUint32(40,y.byteLength,!0),h.setUint32(44,x,!0),h.setUint32(48,u.byteLength,!0),h.setBigUint64(52,BigInt(n.byteLength>0?U:0),!0),h.setBigUint64(60,BigInt(n.byteLength),!0),new Uint8Array(A([new Uint8Array(_).buffer,T,l.buffer,y,u,U>0?new ArrayBuffer(U-(x+u.byteLength)):new ArrayBuffer(0),n,...m]))}function Le(t,e){const n=be(t);return n.keyValue.GalaceanTextureParams=new Uint8Array([e.wrapModeU,e.wrapModeV,e.filterMode,e.anisoLevel]),ve(n)}const Ae=new fe,X=ie("ktx2","upload-cache");class Se{get(e){return Ae.enqueue(()=>oe(e,X))}set(e,n){return ae(e,n,X)}}const z=new Se,Te=le("ktx2");class Oe{constructor(){k(this,"encoderWorkerPool");k(this,"initPromise");this.encoderWorkerPool=new ce(4,()=>new Worker(new URL("/_static/ktx2-worker-a04f41ea.js",self.location),{type:"module"})),this.initPromise=this.encoderWorkerPool.prepareWorker()}async encode(e,n={isUASTC:!1,enableDebug:!1,qualityLevel:255,generateMipmap:!0,isSetKTX2SRGBTransferFunc:!1}){let r;const s=M.create();if(Array.isArray(e)&&Array.isArray(e[0])){for(const a of e)for(const y of a)s.update(y);r=s.hex()}else if(Array.isArray(e)){for(const a of e)s.update(a);r=s.hex()}else r=M(e);const u=r+JSON.stringify(n);try{const a=await z.get(u);if(a)return a}catch(a){console.error(a)}return this._encode(u,e,n)}setTextureParams(e,n){return Le(e,n)}async _encode(e,n,r={isUASTC:!1,enableDebug:!1,qualityLevel:255,generateMipmap:!0,isSetKTX2SRGBTransferFunc:!1}){Te.info(`cannot find cache, use worker encoder for ${e}`),await this.initPromise;const{data:s}=await this.encoderWorkerPool.postMessage({buffer:n,options:r});return z.set(e,s),s}}const Re=new Oe;export{Re as k};
1
+ var se=Object.defineProperty;var re=(t,e,n)=>e in t?se(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var k=(t,e,n)=>(re(t,typeof e!="symbol"?e+"":e,n),n);import{dm as ie,dn as oe,dp as ae,dq as M,dr as le}from"./index-1e23212d.js";import{T as fe}from"./TaskQueue-05c94a4d.js";class ce{constructor(e=4,n){k(this,"_taskQueue",[]);k(this,"_workerStatus",0);k(this,"_workerItems");this.limitedCount=e,this._workerCreator=n,this._workerItems=new Array(e)}prepareWorker(){const e=this.limitedCount,n=new Array(e);for(let r=0;r<e;r++)n.push(this._initWorker(r));return Promise.all(n)}postMessage(e){return new Promise((n,r)=>{const s=this._getIdleWorkerId();if(this._workerStatus|=1<<s,s!==-1){const u=this._workerItems;Promise.resolve(u[s]??this._initWorker(s)).then(()=>{const a=u[s];a.resolve=n,a.reject=r,a.worker.postMessage(e)}).catch(a=>{this._workerStatus^=1<<s,r(a)})}else this._taskQueue.push({resolve:n,reject:r,message:e})})}destroy(){const e=this._workerItems;for(let n=0,r=e.length;n<r;n++){const s=e[n];s.worker.terminate(),s.reject=null,s.resolve=null}e.length=0,this._taskQueue.length=0,this._workerStatus=0}_initWorker(e){return Promise.resolve(this._workerCreator()).then(n=>{const r=s=>{const u=this._workerItems[e];u!=null&&u.reject&&(u.reject(s.error||new Error("Worker error")),this._nextTask(e))};return n.addEventListener("message",this._onMessage.bind(this,e)),n.addEventListener("error",r),n.onerror=r,this._workerItems[e]={worker:n,resolve:null,reject:null},n})}_getIdleWorkerId(){for(let e=0,n=this.limitedCount;e<n;e++)if(!(this._workerStatus&1<<e))return e;return-1}_onMessage(e,n){n.data.error?this._workerItems[e].reject(n.data.error):this._workerItems[e].resolve(n),this._nextTask(e)}_nextTask(e){if(this._taskQueue.length){const n=this._taskQueue.shift(),r=this._workerItems[e];r.resolve=n.resolve,r.reject=n.reject,r.worker.postMessage(n.message)}else this._workerStatus^=1<<e}}const G=0,Q=0,ue=0,he=2,_e=0,de=0,ge=2,ye=1,q=64,Ue=0;class pe{constructor(){this.vkFormat=Ue,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=G,this.levels=[],this.dataFormatDescriptor=[{vendorId:ue,descriptorType:Q,descriptorBlockSize:0,versionNumber:he,colorModel:_e,colorPrimaries:ye,transferFunction:ge,flags:de,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class L{constructor(e,n,r,s){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+n,r),this._littleEndian=s,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian),n=this._dataView.getUint32(this._offset+4,this._littleEndian),r=e+2**32*n;return this._offset+=8,r}_nextInt32(){const e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint8Array(e){const n=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,e);return this._offset+=e,n}_skip(e){return this._offset+=e,this}_scan(e,n=0){const r=this._offset;let s=0;for(;this._dataView.getUint8(this._offset)!==n&&s<e;)s++,this._offset++;return s<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+r,s)}}const xe="KTX-Parse v0.7.1",H=new Uint8Array([0]),_=[171,75,84,88,32,50,48,187,13,10,26,10],K=68;function W(t){return new TextEncoder().encode(t)}function N(t){return new TextDecoder().decode(t)}function A(t){let e=0;for(const s of t)e+=s.byteLength;const n=new Uint8Array(e);let r=0;for(const s of t)n.set(new Uint8Array(s),r),r+=s.byteLength;return n}function me(t,e){const n=Math.max(t,e),r=Math.min(t,e);let s=n;for(;s%r!==0;)s+=n;return s}function j(t,e=4){return Math.ceil(t/e)*e-t}function we(t){return t.levels[0].levelData.byteLength/De(t,0)}function De(t,e){let n=1;const r=[t.pixelWidth,t.pixelHeight,t.pixelDepth],s=ke(t);for(let u=0;u<3;u++)if(r[u]>0){const a=Math.ceil(Math.floor(r[u]*Math.pow(2,-e))/s[u]);n*=Math.max(1,a)}return t.layerCount>0&&(n*=t.layerCount),t.faceCount>0&&(n*=t.faceCount),n}function ke(t){const[e,n,r]=t.dataFormatDescriptor[0].texelBlockDimension;return[e+1,n+1,r+1]}function be(t){const e=new Uint8Array(t.buffer,t.byteOffset,_.length);if(e[0]!==_[0]||e[1]!==_[1]||e[2]!==_[2]||e[3]!==_[3]||e[4]!==_[4]||e[5]!==_[5]||e[6]!==_[6]||e[7]!==_[7]||e[8]!==_[8]||e[9]!==_[9]||e[10]!==_[10]||e[11]!==_[11])throw new Error("Missing KTX 2.0 identifier.");const n=new pe,r=17*Uint32Array.BYTES_PER_ELEMENT,s=new L(t,_.length,r,!0);n.vkFormat=s._nextUint32(),n.typeSize=s._nextUint32(),n.pixelWidth=s._nextUint32(),n.pixelHeight=s._nextUint32(),n.pixelDepth=s._nextUint32(),n.layerCount=s._nextUint32(),n.faceCount=s._nextUint32();const u=s._nextUint32();n.supercompressionScheme=s._nextUint32();const a=s._nextUint32(),y=s._nextUint32(),c=s._nextUint32(),S=s._nextUint32(),b=s._nextUint64(),x=s._nextUint64(),U=u*3*8,m=new L(t,_.length+r,U,!0);for(let d=0;d<u;d++)n.levels.push({levelData:new Uint8Array(t.buffer,t.byteOffset+m._nextUint64(),m._nextUint64()),uncompressedByteLength:m._nextUint64()});const l=new L(t,a,y,!0),D={vendorId:l._skip(4)._nextUint16(),descriptorType:l._nextUint16(),versionNumber:l._nextUint16(),descriptorBlockSize:l._nextUint16(),colorModel:l._nextUint8(),colorPrimaries:l._nextUint8(),transferFunction:l._nextUint8(),flags:l._nextUint8(),texelBlockDimension:[l._nextUint8(),l._nextUint8(),l._nextUint8(),l._nextUint8()],bytesPlane:[l._nextUint8(),l._nextUint8(),l._nextUint8(),l._nextUint8(),l._nextUint8(),l._nextUint8(),l._nextUint8(),l._nextUint8()],samples:[]},B=6,w=4,T=(D.descriptorBlockSize/4-B)/w;for(let d=0;d<T;d++){const p={bitOffset:l._nextUint16(),bitLength:l._nextUint8(),channelType:l._nextUint8(),samplePosition:[l._nextUint8(),l._nextUint8(),l._nextUint8(),l._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};p.channelType&q?(p.sampleLower=l._nextInt32(),p.sampleUpper=l._nextInt32()):(p.sampleLower=l._nextUint32(),p.sampleUpper=l._nextUint32()),D.samples[d]=p}n.dataFormatDescriptor.length=0,n.dataFormatDescriptor.push(D);const h=new L(t,c,S,!0);for(;h._offset<S;){const d=h._nextUint32(),p=h._scan(d),I=N(p);if(n.keyValue[I]=h._nextUint8Array(d-p.byteLength-1),I.match(/^ktx/i)){const C=N(n.keyValue[I]);n.keyValue[I]=C.substring(0,C.lastIndexOf("\0"))}const ne=d%4?4-d%4:0;h._skip(ne)}if(x<=0)return n;const i=new L(t,b,x,!0),o=i._nextUint16(),f=i._nextUint16(),g=i._nextUint32(),v=i._nextUint32(),O=i._nextUint32(),Y=i._nextUint32(),P=[];for(let d=0;d<u;d++)P.push({imageFlags:i._nextUint32(),rgbSliceByteOffset:i._nextUint32(),rgbSliceByteLength:i._nextUint32(),alphaSliceByteOffset:i._nextUint32(),alphaSliceByteLength:i._nextUint32()});const R=b+i._offset,V=R+g,F=V+v,$=F+O,J=new Uint8Array(t.buffer,t.byteOffset+R,g),Z=new Uint8Array(t.buffer,t.byteOffset+V,v),ee=new Uint8Array(t.buffer,t.byteOffset+F,O),te=new Uint8Array(t.buffer,t.byteOffset+$,Y);return n.globalData={endpointCount:o,selectorCount:f,imageDescs:P,endpointsData:J,selectorsData:Z,tablesData:ee,extendedData:te},n}function E(){return E=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},E.apply(this,arguments)}const Be={keepWriter:!1};function ve(t,e={}){e=E({},Be,e);let n=new ArrayBuffer(0);if(t.globalData){const i=new ArrayBuffer(20+t.globalData.imageDescs.length*5*4),o=new DataView(i);o.setUint16(0,t.globalData.endpointCount,!0),o.setUint16(2,t.globalData.selectorCount,!0),o.setUint32(4,t.globalData.endpointsData.byteLength,!0),o.setUint32(8,t.globalData.selectorsData.byteLength,!0),o.setUint32(12,t.globalData.tablesData.byteLength,!0),o.setUint32(16,t.globalData.extendedData.byteLength,!0);for(let f=0;f<t.globalData.imageDescs.length;f++){const g=t.globalData.imageDescs[f];o.setUint32(20+f*5*4+0,g.imageFlags,!0),o.setUint32(20+f*5*4+4,g.rgbSliceByteOffset,!0),o.setUint32(20+f*5*4+8,g.rgbSliceByteLength,!0),o.setUint32(20+f*5*4+12,g.alphaSliceByteOffset,!0),o.setUint32(20+f*5*4+16,g.alphaSliceByteLength,!0)}n=A([i,t.globalData.endpointsData,t.globalData.selectorsData,t.globalData.tablesData,t.globalData.extendedData])}const r=[];let s=t.keyValue;e.keepWriter||(s=E({},t.keyValue,{KTXwriter:xe}));for(const i in s){const o=s[i],f=W(i),g=typeof o=="string"?A([W(o),H]):o,v=f.byteLength+1+g.byteLength,O=j(v,4);r.push(A([new Uint32Array([v]),f,H,g,new Uint8Array(O).fill(0)]))}const u=A(r);if(t.dataFormatDescriptor.length!==1||t.dataFormatDescriptor[0].descriptorType!==Q)throw new Error("Only BASICFORMAT Data Format Descriptor output supported.");const a=t.dataFormatDescriptor[0],y=new ArrayBuffer(28+a.samples.length*16),c=new DataView(y),S=24+a.samples.length*16;if(c.setUint32(0,y.byteLength,!0),c.setUint16(4,a.vendorId,!0),c.setUint16(6,a.descriptorType,!0),c.setUint16(8,a.versionNumber,!0),c.setUint16(10,S,!0),c.setUint8(12,a.colorModel),c.setUint8(13,a.colorPrimaries),c.setUint8(14,a.transferFunction),c.setUint8(15,a.flags),!Array.isArray(a.texelBlockDimension))throw new Error("texelBlockDimension is now an array. For dimensionality `d`, set `d - 1`.");c.setUint8(16,a.texelBlockDimension[0]),c.setUint8(17,a.texelBlockDimension[1]),c.setUint8(18,a.texelBlockDimension[2]),c.setUint8(19,a.texelBlockDimension[3]);for(let i=0;i<8;i++)c.setUint8(20+i,a.bytesPlane[i]);for(let i=0;i<a.samples.length;i++){const o=a.samples[i],f=28+i*16;if(o.channelID)throw new Error("channelID has been renamed to channelType.");c.setUint16(f+0,o.bitOffset,!0),c.setUint8(f+2,o.bitLength),c.setUint8(f+3,o.channelType),c.setUint8(f+4,o.samplePosition[0]),c.setUint8(f+5,o.samplePosition[1]),c.setUint8(f+6,o.samplePosition[2]),c.setUint8(f+7,o.samplePosition[3]),o.channelType&q?(c.setInt32(f+8,o.sampleLower,!0),c.setInt32(f+12,o.sampleUpper,!0)):(c.setUint32(f+8,o.sampleLower,!0),c.setUint32(f+12,o.sampleUpper,!0))}const b=_.length+K+t.levels.length*3*8,x=b+y.byteLength;let U=n.byteLength>0?x+u.byteLength:0;U%8&&(U+=8-U%8);const m=[],l=new DataView(new ArrayBuffer(t.levels.length*3*8)),D=new Uint32Array(t.levels.length);let B=0;t.supercompressionScheme===G&&(B=me(we(t),4));let w=(U||x+u.byteLength)+n.byteLength;for(let i=t.levels.length-1;i>=0;i--){if(w%B){const f=j(w,B);m.push(new Uint8Array(f)),w+=f}const o=t.levels[i];m.push(o.levelData),D[i]=w,w+=o.levelData.byteLength}for(let i=0;i<t.levels.length;i++){const o=t.levels[i];l.setBigUint64(i*24+0,BigInt(D[i]),!0),l.setBigUint64(i*24+8,BigInt(o.levelData.byteLength),!0),l.setBigUint64(i*24+16,BigInt(o.uncompressedByteLength),!0)}const T=new ArrayBuffer(K),h=new DataView(T);return h.setUint32(0,t.vkFormat,!0),h.setUint32(4,t.typeSize,!0),h.setUint32(8,t.pixelWidth,!0),h.setUint32(12,t.pixelHeight,!0),h.setUint32(16,t.pixelDepth,!0),h.setUint32(20,t.layerCount,!0),h.setUint32(24,t.faceCount,!0),h.setUint32(28,t.levels.length,!0),h.setUint32(32,t.supercompressionScheme,!0),h.setUint32(36,b,!0),h.setUint32(40,y.byteLength,!0),h.setUint32(44,x,!0),h.setUint32(48,u.byteLength,!0),h.setBigUint64(52,BigInt(n.byteLength>0?U:0),!0),h.setBigUint64(60,BigInt(n.byteLength),!0),new Uint8Array(A([new Uint8Array(_).buffer,T,l.buffer,y,u,U>0?new ArrayBuffer(U-(x+u.byteLength)):new ArrayBuffer(0),n,...m]))}function Le(t,e){const n=be(t);return n.keyValue.GalaceanTextureParams=new Uint8Array([e.wrapModeU,e.wrapModeV,e.filterMode,e.anisoLevel]),ve(n)}const Ae=new fe,X=ie("ktx2","upload-cache");class Se{get(e){return Ae.enqueue(()=>oe(e,X))}set(e,n){return ae(e,n,X)}}const z=new Se,Te=le("ktx2");class Oe{constructor(){k(this,"encoderWorkerPool");k(this,"initPromise");this.encoderWorkerPool=new ce(4,()=>new Worker(new URL("/_static/ktx2-worker-a04f41ea.js",self.location),{type:"module"})),this.initPromise=this.encoderWorkerPool.prepareWorker()}async encode(e,n={isUASTC:!1,enableDebug:!1,qualityLevel:255,generateMipmap:!0,isSetKTX2SRGBTransferFunc:!1}){let r;const s=M.create();if(Array.isArray(e)&&Array.isArray(e[0])){for(const a of e)for(const y of a)s.update(y);r=s.hex()}else if(Array.isArray(e)){for(const a of e)s.update(a);r=s.hex()}else r=M(e);const u=r+JSON.stringify(n);try{const a=await z.get(u);if(a)return a}catch(a){console.error(a)}return this._encode(u,e,n)}setTextureParams(e,n){return Le(e,n)}async _encode(e,n,r={isUASTC:!1,enableDebug:!1,qualityLevel:255,generateMipmap:!0,isSetKTX2SRGBTransferFunc:!1}){Te.info(`cannot find cache, use worker encoder for ${e}`),await this.initPromise;const{data:s}=await this.encoderWorkerPool.postMessage({buffer:n,options:r});return z.set(e,s),s}}const Re=new Oe;export{Re as k};
@@ -1 +1 @@
1
- import{N as wt,W as ct,X as tt,Y as bt,Z as F,_ as q,$ as it,a0 as xt,a1 as Pt,a2 as St,a3 as nt,a4 as zt,a as At,S as Lt,a5 as W,a6 as st,a7 as et,a8 as Tt,a9 as Mt}from"./index-aec7e708.js";function ot(a,n){for(var i=0;i<n.length;i++){var t=n[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(a,t.key,t)}}function Rt(a,n,i){return n&&ot(a.prototype,n),i&&ot(a,i),a}function Y(a,n){return Y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Y(a,n)}function A(a,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(n&&n.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),n&&Y(a,n)}function O(a,n,i,t){var e=arguments.length,r=e<3?n:t===null?t=Object.getOwnPropertyDescriptor(n,i):t,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(a,n,i,t);else for(var o=a.length-1;o>=0;o--)(s=a[o])&&(r=(e<3?s(r):e>3?s(n,i,r):s(n,i))||r);return e>3&&r&&Object.defineProperty(n,i,r),r}var Ot=4,It=.001,Ct=1e-7,Vt=10,D=11,N=1/(D-1),Ft=typeof Float32Array=="function";function _t(a,n){return 1-3*n+3*a}function dt(a,n){return 3*n-6*a}function yt(a){return 3*a}function G(a,n,i){return((_t(n,i)*a+dt(n,i))*a+yt(n))*a}function gt(a,n,i){return 3*_t(n,i)*a*a+2*dt(n,i)*a+yt(n)}function Ut(a,n,i,t,e){var r,s,o=0;do s=n+(i-n)/2,r=G(s,t,e)-a,r>0?i=s:n=s;while(Math.abs(r)>Ct&&++o<Vt);return s}function Bt(a,n,i,t){for(var e=0;e<Ot;++e){var r=gt(n,i,t);if(r===0)return n;var s=G(n,i,t)-a;n-=s/r}return n}function jt(a){return a}var Dt=function(n,i,t,e){if(!(0<=n&&n<=1&&0<=t&&t<=1))throw new Error("bezier x values must be in [0, 1] range");if(n===i&&t===e)return jt;for(var r=Ft?new Float32Array(D):new Array(D),s=0;s<D;++s)r[s]=G(s*N,n,t);function o(u){for(var h=0,f=1,l=D-1;f!==l&&r[f]<=u;++f)h+=N;--f;var p=(u-r[f])/(r[f+1]-r[f]),c=h+p*N,v=gt(c,n,t);return v>=It?Bt(u,c,n,t):v===0?c:Ut(u,h,h+N,n,t)}return function(h){return h===0?0:h===1?1:G(o(h),i,e)}},at=200,ht={};function qt(a,n,i,t,e){var r=e||("bez_"+a+"_"+n+"_"+i+"_"+t).replace(/\./g,"p"),s=ht[r];return s||(s=Dt(a,n,i,t),ht[r]=s,s)}var J={};function Nt(a,n,i,t,e){var r=e?Math.min(e,at):at,s=(a[0]+"_"+a[1]+"_"+n[0]+"_"+n[1]+"_"+i[0]+"_"+i[1]+"_"+t[0]+"_"+t[1]+"_"+r).replace(/\./g,"p");if(!J[s]){for(var o=0,u,h=[],f=0;f<r;f++){for(var l=i.length,p=new Array(l),c=f/(r-1),v=0,_=0;_<l;_+=1){var d=Math.pow(1-c,3)*a[_]+3*Math.pow(1-c,2)*c*(a[_]+i[_])+3*(1-c)*Math.pow(c,2)*(n[_]+t[_])+Math.pow(c,3)*n[_];p[_]=d,u&&(v+=Math.pow(p[_]-u[_],2))}v=Math.sqrt(v),o+=v,h.push({partialLength:v,point:p}),u=p}J[s]={segmentLength:o,points:h}}return J[s]}var K={buildBezierData:Nt,getBezierEasing:qt},L={euclideanModulo:function(n,i){return(n%i+i)%i},codomainBounce:function(n,i,t){return n<i?2*i-n:n>t?2*t-n:n},clamp:function(n,i,t){return n<i?i:n>t?t:n}},mt=/(loopIn|loopOut)\(([^)]+)/,Wt=/["']\w+["']/,ut=function(){function a(i,t,e){this.begin=t,this.end=e,this.total=this.end-this.begin,this.type=i}var n=a.prototype;return n.update=function(t){if(this.type==="in")return t>=this.begin?t:this.end-L.euclideanModulo(this.begin-t,this.total);if(this.type==="out")return t<=this.end?t:this.begin+L.euclideanModulo(t-this.end,this.total)},a}(),lt=function(){function a(i,t,e){this.begin=t,this.end=e,this.total=this.end-this.begin,this.type=i}var n=a.prototype;return n.update=function(t){if(this.type==="in"&&t<this.begin||this.type==="out"&&t>this.end){var e=t-this.end;return this.pingpong(e)}return t},n.pingpong=function(t){var e=Math.floor(t/this.total)%2;return e?this.begin+L.euclideanModulo(t,this.total):this.end-L.euclideanModulo(t,this.total)},a}(),ft={loopIn:function(n,i,t){var e=n[0].t,r=n.length-1,s=Math.min(r,t),o=n[s].t;switch(i){case"cycle":return new ut("in",e,o);case"pingpong":return new lt("in",e,o)}return null},loopOut:function(n,i,t){var e=n.length-1,r=Math.max(0,e-t),s=n[r].t,o=n[e].t;switch(i){case"cycle":return new ut("out",s,o);case"pingpong":return new lt("out",s,o)}return null}};function Gt(a){var n=a.split(/\s*,\s*/);return n.map(function(i){return Wt.test(i)?i.replace(/"|'/g,""):parseInt(i)})}function Kt(a){var n=a.match(mt),i=Gt(n[2]);return{name:n[1],mode:i[0],offset:i[1]}}function Zt(a){return a.x&&mt.test(a.x)}function $t(a){var n=Kt(a.x),i=n.name,t=n.mode,e=n.offset,r=e===void 0?0:e,s=r===0?a.k.length-1:r;return ft[i]&&ft[i](a.k,t,s)}var Z={hasSupportExpression:Zt,getExpression:$t},k=function(){function a(i,t){this.mult=t||1,this.value=i.k,this.animated=i.a,Z.hasSupportExpression(i)&&(this.expression=Z.getExpression(i))}var n=a.prototype;return n.getValue=function(t,e,r,s){var o,u=r.t,h=s.t,f=r.s[e],l=(s.s||r.e)[e];if(r.h===1)return f;if(t>=h)o=1;else if(t<u)o=0;else{var p=r.beziers[e];p||(typeof r.o.x=="number"?p=K.getBezierEasing(r.o.x,r.o.y,r.i.x,r.i.y):p=K.getBezierEasing(r.o.x[e],r.o.y[e],r.i.x[e],r.i.y[e]),r.beziers[e]=p),o=p((t-u)/(h-u))}return f+(l-f)*o},n.reset=function(){},a}(),kt=function(a){A(n,a);function n(t,e){e===void 0&&(e=1);var r;return r=a.call(this,t,e)||this,r.v=e?r.value*e:r.value,r}var i=n.prototype;return i.update=function(){this.v=this.value*this.mult},n}(k),Ht=function(a){A(n,a);function n(t,e){e===void 0&&(e=1);var r;r=a.call(this,t,e)||this;var s=r.value.length;r.v=new Float32Array(s),r.newValue=new Float32Array(s);for(var o=0;o<s;o+=1)r.v[o]=r.value[o]*r.mult;return r}var i=n.prototype;return i.update=function(){var e;e=this.value;for(var r=0,s=this.v.length;r<s;r++)this.v[r]=e[r]*this.mult},n}(k),Jt=function(a){A(n,a);function n(t,e){e===void 0&&(e=1);var r;return r=a.call(this,t,e)||this,r._value=0,r.v=0,Z.hasSupportExpression(t)&&(r.expression=Z.getExpression(t)),r}var i=n.prototype;return i.reset=function(){this._value=0},i.update=function(e){this.expression&&(e=this.expression.update(e));for(var r=this.value,s,o,u=0,h=r.length-1;u<h&&(s=r[u],o=r[u+1],!(o.t>e));u++);s.beziers||(s.beziers=[]),this.v=this.getValue(e,0,s,o)*this.mult},n}(k),Qt=function(a){A(n,a);function n(t,e,r){e===void 0&&(e=1);var s;s=a.call(this,t,e)||this,s._lastPoint=0,s._addedLength=0;var o=s.value[0].s.length;return r&&(s._frames=r>>0),s.newValue=new Float32Array(o),s.v=new Float32Array(o),s}var i=n.prototype;return i.update=function(e){this.expression&&(e=this.expression.update(e));for(var r=this.value,s=this.newValue,o,u,h=0,f=r.length-1;h<f;h++)if(o=r[h],u=r[h+1],u.t>e){this._lastPoint=0,this._addedLength=0;break}if(e>u.t){for(var l=0,p=this.v.length;l<p;l++)this.v[l]=this.getValue(e,l,o,u)*this.mult;return}if(o.to){var c=u.t,v=o.t;o.bezierData||(o.bezierData=K.buildBezierData(o.s,u.s||o.e,o.to,o.ti,this._frames));var _=o.bezierData,d=_.points,m=_.segmentLength,y=o.timeBezier;y||(y=K.getBezierEasing(o.o.x,o.o.y,o.i.x,o.i.y,o.n),o.timeBezier=y);var b=0;c>=0&&(b=(e-v)/(c-v),b=Math.min(Math.max(0,b),1));for(var g=y(b),x=m*g,E=this._addedLength,P=this._lastPoint,w=P,T=d.length;w<T;w++){if(w===T-1){P=0,E=0;break}P=w;var M=d[w],R=d[w+1],I=R.partialLength;if(x>=E&&x<E+I){for(var U=(x-E)/I,S=0,B=M.point.length;S<B;S+=1)s[S]=M.point[S]+(R.point[S]-M.point[S])*U;break}E+=I}this._lastPoint=P,this._addedLength=E}else{o.beziers||(o.beziers=[]);for(var C=0,j=o.s.length;C<j;C++)s[C]=this.getValue(e,C,o,u)}for(var V=0,H=this.v.length;V<H;V++)this.v[V]=s[V]*this.mult},n}(k),Yt=function(){function a(i){this.properties=[],this.autoOrient=!1;var t=a.create;i.p.k?(this.p=t(i.p,1),this.properties.push(this.p)):(i.p.x&&(this.x=t(i.p.x,1),this.properties.push(this.x)),i.p.y&&(this.y=t(i.p.y,1),this.properties.push(this.y)),i.p.z&&(this.z=t(i.p.z,1),this.properties.push(this.z))),this.a=t(i.a,1),this.properties.push(this.a),this.s=t(i.s,1,.01),this.properties.push(this.s),this.o=t(i.o,0,.01),this.properties.push(this.o),i.r?(this.r=t(i.r,0),this.properties.push(this.r)):i.rx||i.ry||i.rz?(i.rx&&(this.rx=t(i.rx,0),this.properties.push(this.rx)),i.ry&&(this.ry=t(i.ry,0),this.properties.push(this.ry)),i.rz&&(this.rz=t(i.rz,0),this.properties.push(this.rz))):i.or&&(this.or=t(i.or,1),this.properties.push(this.or)),this.properties.length||this.update()}var n=a.prototype;return n.reset=function(){for(var t=0,e=this.properties.length;t<e;t++)this.properties[t].reset()},n.update=function(t){t===void 0&&(t=0);for(var e=this.properties.length,r=0;r<e;r++)this.properties[r].update(t);this.autoOrient},a.create=function(t,e,r){return e===void 0&&(e=0),r===void 0&&(r=1),t.k.length?typeof t.k[0]=="number"?new Ht(t,r):e?new Qt(t,r,t.k[t.k.length-1].t-t.k[0].t):new Jt(t,r):new kt(t,r)},a}(),rt=function(){function a(i){this.stretch=1,this.parent=null,this.visible=!0,this.startTime=0,this.treeIndex=[],this.childLayers=[],this.is3D=!!i.ddd,this.name=i.nm||"",this.index=i.index,this.timeRemapping=i.tm,this.width=i.w,this.height=i.h,this.inPoint=i.ip,this.outPoint=i.op,i.st&&(this.startTime=i.st),this.stretch=i.stretch||1,this.offsetTime=i.offsetTime||0,i.ks&&(this.transform=new Yt(i.ks))}var n=a.prototype;return n.reset=function(){this.transform&&this.transform.reset();for(var t=0;t<this.childLayers.length;t++)this.childLayers[t].reset()},n.update=function(t,e){t===void 0&&(t=0);var r=(t-this.offsetTime)/this.stretch;e===!0?this.visible=this.inPoint<=r&&this.outPoint>=r:e===!1&&(this.visible=!1),this.transform&&this.visible&&this.transform.update(r);for(var s=0;s<this.childLayers.length;s++)this.childLayers[s].update(t,this.visible)},n.addChild=function(t){t.parent=this,t.entity.parent=this.entity,this.childLayers.push(t)},n.destroy=function(){this.entity.parent=null,this.entity.destroy(),this.entity=null,this.transform=null,this.parent=null},a}(),Q=function(a){A(n,a);function n(t,e,r,s){var o;if(o=a.call(this,t)||this,o.layers=t.layers,o.comps=t.comps,r)o.entity=r,s&&(o.entity.name=s);else{var u=new q(e,s);o.entity=u}return o}var i=n.prototype;return i.destroy=function(){a.prototype.destroy.call(this),this.layers=null,this.comps=null},n}(rt),Xt=function(a){A(n,a);function n(t,e,r,s){var o;o=a.call(this,t)||this;var u;if(t.refId){if(s)o.entity=s,u=s.getComponent(it),o.sprite=u.sprite;else{o.sprite=e.getSprite(t.refId);var h=new q(r.engine,t.nm);u=h.addComponent(it),u.sprite=o.sprite,o.entity=h}var f=o.sprite,l=f.atlasRegion,p=f.texture;p.wrapModeU=p.wrapModeV=xt.Clamp,o.spriteRenderer=u,u.priority=(Number.MAX_SAFE_INTEGER-o.index*1e6)/Number.MAX_SAFE_INTEGER,o.width=l.width*p.width,o.height=l.height*p.height}return o}var i=n.prototype;return i.destroy=function(){a.prototype.destroy.call(this),this.sprite=null,this.spriteRenderer=null},n}(rt),te=function(a){A(n,a);function n(i,t,e,r){var s,o,u,h;s=a.call(this,i)||this,e?(s.entity=e,r&&(s.entity.name=r)):s.entity=new q(t,i.nm);var f=s.entity.addComponent(Pt),l=(h=i)==null||(u=h.t)==null||(o=u.d)==null?void 0:o.k;if(l.length===1){var p,c,v=(c=l)==null||(p=c[0])==null?void 0:p.s;if(v){var _=v.t,d=v.f,m=v.s,y=v.fc,b=v.lh;f.font=St.createFromOS(t,d),f.text=_,f.fontSize=m,f.color.set(y[0],y[1],y[2],1),f.lineSpacing=b}else nt.warn("TextLottieElement: "+r+", No corresponding text data found.")}else nt.warn("TextLottieElement: multi keyframes feature is not supported in this version.");return f.priority=(Number.MAX_SAFE_INTEGER-s.index*1e6)/Number.MAX_SAFE_INTEGER,s}return n}(rt),z=function(a){A(n,a);function n(){var t;return t=a.apply(this,arguments)||this,t.repeats=0,t.isLooping=!1,t.isAlternate=!1,t.direction=1,t.speed=1,t.pixelsPerUnit=zt._pixelsPerUnit,t._alpha=1,t._priority=0,t._priorityDirty=!0,t._layer=At.Layer0,t._layerDirty=!0,t._autoPlay=!1,t._clipEndCallbacks={},t._isPlaying=!1,t._curFrame=0,t._frame=0,t._root=null,t}var i=n.prototype;return i.play=function(e){var r=this;if(e){var s=this.resource.clips[e];this._clip=s}else this._clip=null;return this._isPlaying=!0,this._frame=this._curFrame,new Promise(function(o){e?r._clipEndCallbacks[e]=o:r._clipEndCallbacks.ALL=o})},i.pause=function(){this._isPlaying=!1,this._curFrame=this._frame},i.stop=function(){this._isPlaying=!1,this._curFrame=0,this._frame=0},i._setLayer=function(e,r){r||(r=this.entity),r.layer=e;for(var s=r.children,o=s.length-1;o>=0;o--){var u=s[o];u.layer=e,this._setLayer(e,u)}},i._createLayerElements=function(e,r,s,o){if(e)for(var u=0,h=e.length;u<h;u++){var f=e[u],l=null;if(f.td===void 0){var p=s.treeIndex.concat(u),c=o&&this._findEntityInTree(p);switch(f.ty){case 0:l=new Q(f,this.engine,c,f.id);break;case 2:l=new Xt(f,this._resource.atlas,this.entity,c);break;case 3:var v,_,d;((d=f)==null||(_=d.ks)==null||(v=_.o)==null?void 0:v.k)===0&&(f.ks.o.k=100),l=new Q(f,this.engine,c,f.id);break;case 5:l=new te(f,this.engine,c,f.id);break}l&&(l.treeIndex=p,r.push(l),s.addChild(l),f.layers&&this._createLayerElements(f.layers,r,l,o))}}},i._findEntityInTree=function(e){for(var r,s=0,o=e.length;s<o;s++){var u=e[s];r?r=r.children[u]:r=this.entity.children[u]}return r},i._createElements=function(e,r){var s=new Q(e,this.engine,this.entity);this._root=s;var o=s.layers,u=[];this._createLayerElements(o,u,s,r),this._elements=u},i._updateElements=function(e){this._root.update(e);for(var r=this._elements,s=0,o=r.length;s<o;s++){var u=r[s];this._updateElement(u)}},i._updateElement=function(e){var r,s,o,u,h=e.transform,f=e.entity,l=e.sprite,p=e.spriteRenderer,c=e.parent,v=e.width,_=e.height,d=f.transform,m=h.a.v,y=h.s.v,b=h.o.v,g=this.pixelsPerUnit,x=0,E=0,P=0;if(h.p){var w=h.p.v,T;x=(T=w[0])!=null?T:0;var M;E=(M=w[1])!=null?M:0;var R;P=(R=w[2])!=null?R:0}else h.x&&(x=h.x.v),h.y&&(E=h.y.v),h.z&&(P=h.z.v);var I=0,U=0,S=0;if(!e.visible){f.isActive=e.visible;return}if(h.r)S=h.r.v;else if(h.rx||h.ry||h.rz)I=h.rx?h.rx.v:0,U=h.ry?h.ry.v:0,S=h.rz?h.rz.v:0;else if(h.or){var B=h.or.v;I=B[0],U=B[1],S=B[2]}if(!((s=c)==null||(r=s.transform)==null)&&r.o){var C;b*=(C=c)==null?void 0:C.transform.o.v}if(l){var j=p.color,V=j.r,H=j.g,Et=j.b;p.color.set(V,H,Et,b*this._alpha),l.pixelsPerUnit=g,l.pivot=n._pivotVector.set(m[0]/v,(_-m[1])/_)}f.isActive=e.visible,d.setScale(y[0],y[1],y[2]),d.setRotation(I,U,-S),!((u=c)==null||(o=u.transform)==null)&&o.a?d.setPosition((x-c.transform.a.v[0])/g,(-E+c.transform.a.v[1])/g,P/g):d.setPosition((x-this._width/2)/g,(-E+this._height/2)/g,P/g)},i._resetElements=function(){for(var e=this._elements,r=0,s=e.length;r<s;r++)e[r].reset()},i.onUpdate=function(e){if(!this._isPlaying||!this._resource)return null;if(this._priorityDirty){this._priorityDirty=!1;var r=n._tempRenderers;r.length=0,this.entity.getComponentsIncludeChildren(bt,r);for(var s=0,o=0,u=r.length;o<u;++o){var h=r[o];o===0&&(s=this._priority-Math.floor(h.priority)),h.priority=h.priority+s}}this._layerDirty&&(this._layerDirty=!1,this._setLayer(this.layer,this.entity));var f=this.direction*this.speed*e*1e3;this._frame+=f/this._resource.timePerFrame;var l=this._clip;if(this._spill()){var p=this._resource.duration;if(this._resetElements(),this.repeats>0||this.isLooping)this.repeats>0&&--this.repeats,this.isAlternate?(this.direction*=-1,l?this._frame=L.codomainBounce(this._frame,0,l.end-l.start):this._frame=L.codomainBounce(this._frame,0,p)):(this.direction=1,l?this._frame=L.euclideanModulo(this._frame,l.end-l.start):this._frame=L.euclideanModulo(this._frame,p));else if(l){if(this._frame>=l.end-l.start){var c=this._clipEndCallbacks[l.name];c&&c(l)}this._frame=L.clamp(this._frame,0,l.end-l.start)}else{if(this._frame>=p){var v=this._clipEndCallbacks.ALL;v&&v()}this._frame=L.clamp(this._frame,0,p)}}l?this._updateElements(this._resource.inPoint+this._frame+l.start):this._updateElements(this._resource.inPoint+this._frame)},i._spill=function(){var e;if(this._clip){var r=this._clip;e=r.end-r.start}else e=this._resource.duration;var s=this._frame<=0&&this.direction===-1,o=this._frame>=e&&this.direction===1;return s||o},i._cloneTo=function(e){e._createElements(this._resource,!0)},i._destroy=function(){var e=this._elements;if(e)for(var r=0,s=e.length;r<s;r++)e[r].destroy()},i.onDestroy=function(){this._destroy()},Rt(n,[{key:"resource",get:function(){return this._resource},set:function(e){this._resource!==e&&(this._resource&&(this.pause(),this._destroy(),this._resource.refCount--,this._resource.refCount<=0&&this._resource.destroy()),this._resource=e,e&&(e.refCount++,this._width=e.width,this._height=e.height,this._createElements(e),this._priorityDirty=!0,this._layerDirty=!0),this._curFrame=0,this.play(),this.onUpdate(0),this.autoPlay||this.pause())}},{key:"priority",get:function(){return this._priority},set:function(e){this._priority!==e&&(this._priority=e,this._priorityDirty=!0)}},{key:"layer",get:function(){return this._layer},set:function(e){this._layer!==e&&(this._layer=e,this._layerDirty=!0)}},{key:"alpha",get:function(){return this._alpha},set:function(e){this._alpha!==e&&(this._alpha=e,this.isPlaying||(this.play(),this.onUpdate(0),this.pause()))}},{key:"autoPlay",get:function(){return this._autoPlay},set:function(e){this._autoPlay=e,e&&this.play()}},{key:"frame",get:function(){return this._frame}},{key:"isPlaying",get:function(){return this._isPlaying}}]),n}(Lt);(function(){z._pivotVector=new wt})();(function(){z._tempRenderers=[]})();O([F],z.prototype,"_clipEndCallbacks",void 0);O([F],z.prototype,"_isPlaying",void 0);O([F],z.prototype,"_curFrame",void 0);O([F],z.prototype,"_frame",void 0);O([F],z.prototype,"_root",void 0);O([F],z.prototype,"_elements",void 0);function ee(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function $(){return $=Object.assign||function(n){for(var i=1;i<arguments.length;i++){var t=arguments[i];for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])}return n},$.apply(this,arguments)}function re(a){"@swc/helpers - typeof";return a&&typeof Symbol<"u"&&a.constructor===Symbol?"symbol":typeof a}var X=function(a){A(n,a);function n(t,e,r){var s;s=a.call(this,t)||this,s.refCount=0,s.timePerFrame=1e3/e.fr,s.duration=Math.floor(e.op-e.ip),s.width=e.w,s.height=e.h,s.inPoint=e.ip,s.outPoint=e.op,s.atlas=r,s.layers=e.layers,s.comps=e.assets,s.name=e.nm,s.clips={};var o={},u=ee(s).comps;if(u)for(var h=0,f=u.length;h<f;h++){var l=u[h];l.id&&(o[l.id]=l)}return s._buildTree(s.layers,o),e.lolitaAnimations&&s._parseAnimations(e.lolitaAnimations),s}var i=n.prototype;return i.setClips=function(e){this.clips={},this._parseAnimations(e)},i._parseAnimations=function(e){var r=this;e.forEach(function(s){r.clips[s.name]=$({},s)})},i._buildTree=function(e,r,s,o,u,h){s===void 0&&(s=0),o===void 0&&(o=1),u===void 0&&(u=0),h===void 0&&(h=1);for(var f={},l=0,p=e.length;l<p;l++){var c=e[l],v;f[(v=c.ind)!=null?v:l]=c}for(var _=e.length-1;_>=0;_--){var d=e[_],m=d.refId,y=d.parent;d.offsetTime=s,d.stretch=o;var b;if(d.index=((b=d.ind)!=null?b:_)*h+u,y&&(f[y].layers||(f[y].layers=[]),f[y].layers.push(d),e.splice(_,1)),m&&r[m]){for(var g=[],x=0;x<r[m].layers.length;x++)g.push(this._deepClone(r[m].layers[x]));var E=(d.offsetTime||0)+(d.st||0),P=(d.stretch||1)*(d.sr||1),w=g.length-1,T,M=h/(((T=g[w].ind)!=null?T:w)+1)*h;if(this._buildTree(g,r,E,P,d.index,M),d.layers){var R;(R=d.layers).push.apply(R,[].concat(g))}else d.layers=[].concat(g)}}},i._deepClone=function(e){var r=this,s=Array.isArray(e)?[].concat(e):$({},e);return Reflect.ownKeys(s).map(function(o){s[o]=r._isObject(e[o])?r._deepClone(e[o]):e[o]}),s},i._isObject=function(e){return(typeof e=="object"||typeof e=="function")&&(typeof e>"u"?"undefined":re(e))!==null},i.destroy=function(){var e,r;(e=(r=this.atlas).destroy)==null||e.call(r),this.atlas=null,this.layers=null,this.clips=null,this.comps=null,a.prototype.destroy.call(this)},n}(Tt),pt=function(a){A(n,a);function n(){return a.apply(this,arguments)}var i=n.prototype;return i.load=function(e,r){return new W(function(s,o){var u=e.url;r._request(u,{type:"json"}).then(function(h){var f=h.jsonUrl,l=h.atlasUrl,p=r._request(st.resolveAbsoluteUrl(u,f),r),c=r.load({url:st.resolveAbsoluteUrl(u,l),type:et.SpriteAtlas});W.all([p,c]).then(function(v){var _=v[0],d=v[1],m=r.engine,y=new X(m,_,d);s(y)}).catch(o)}).catch(o)})},n}(tt);pt=O([ct("EditorLottie",["json"])],pt);var ie=function(){function a(i,t){var e=this;this.sprites={},this.assetsPromises=[],this.assetsPromises=i.map(function(r){return t.resourceManager.load({url:r.p,type:et.Texture2D}).then(function(s){var o=new Mt(t);o.texture=s,e.sprites[r.id]=o})})}var n=a.prototype;return n.request=function(){return Promise.all(this.assetsPromises)},n.getSprite=function(t){return this.sprites[t]},a}(),vt=function(a){A(n,a);function n(){return a.apply(this,arguments)}var i=n.prototype;return i.load=function(e,r){var s=e.urls,o=r._request(s[0],{type:"json"});if(s[1]){var u=r.load({url:s[1],type:et.SpriteAtlas});return W.all([o,u]).then(function(h){var f=h[0],l=h[1],p=r.engine,c=new X(p,f,l),v=new q(p),_=v.addComponent(z);return _.resource=c,v})}else return W.all([o]).then(function(h){var f=h[0],l=r.engine,p=f.assets.filter(function(v){return v.p});f.assets=f.assets.filter(function(v){return!v.p});var c=new ie(p,l);return c.request().then(function(){var v=new X(l,f,c),_=new q(l),d=_.addComponent(z);return d.resource=v,_})})},n}(tt);vt=O([ct("lottie",["json"])],vt);tt.registerClass("LottieAnimation",z);export{z as L};
1
+ import{N as wt,W as ct,X as tt,Y as bt,Z as F,_ as q,$ as it,a0 as xt,a1 as Pt,a2 as St,a3 as nt,a4 as zt,a as At,S as Lt,a5 as W,a6 as st,a7 as et,a8 as Tt,a9 as Mt}from"./index-1e23212d.js";function ot(a,n){for(var i=0;i<n.length;i++){var t=n[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(a,t.key,t)}}function Rt(a,n,i){return n&&ot(a.prototype,n),i&&ot(a,i),a}function Y(a,n){return Y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Y(a,n)}function A(a,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(n&&n.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),n&&Y(a,n)}function O(a,n,i,t){var e=arguments.length,r=e<3?n:t===null?t=Object.getOwnPropertyDescriptor(n,i):t,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(a,n,i,t);else for(var o=a.length-1;o>=0;o--)(s=a[o])&&(r=(e<3?s(r):e>3?s(n,i,r):s(n,i))||r);return e>3&&r&&Object.defineProperty(n,i,r),r}var Ot=4,It=.001,Ct=1e-7,Vt=10,D=11,N=1/(D-1),Ft=typeof Float32Array=="function";function _t(a,n){return 1-3*n+3*a}function dt(a,n){return 3*n-6*a}function yt(a){return 3*a}function G(a,n,i){return((_t(n,i)*a+dt(n,i))*a+yt(n))*a}function gt(a,n,i){return 3*_t(n,i)*a*a+2*dt(n,i)*a+yt(n)}function Ut(a,n,i,t,e){var r,s,o=0;do s=n+(i-n)/2,r=G(s,t,e)-a,r>0?i=s:n=s;while(Math.abs(r)>Ct&&++o<Vt);return s}function Bt(a,n,i,t){for(var e=0;e<Ot;++e){var r=gt(n,i,t);if(r===0)return n;var s=G(n,i,t)-a;n-=s/r}return n}function jt(a){return a}var Dt=function(n,i,t,e){if(!(0<=n&&n<=1&&0<=t&&t<=1))throw new Error("bezier x values must be in [0, 1] range");if(n===i&&t===e)return jt;for(var r=Ft?new Float32Array(D):new Array(D),s=0;s<D;++s)r[s]=G(s*N,n,t);function o(u){for(var h=0,f=1,l=D-1;f!==l&&r[f]<=u;++f)h+=N;--f;var p=(u-r[f])/(r[f+1]-r[f]),c=h+p*N,v=gt(c,n,t);return v>=It?Bt(u,c,n,t):v===0?c:Ut(u,h,h+N,n,t)}return function(h){return h===0?0:h===1?1:G(o(h),i,e)}},at=200,ht={};function qt(a,n,i,t,e){var r=e||("bez_"+a+"_"+n+"_"+i+"_"+t).replace(/\./g,"p"),s=ht[r];return s||(s=Dt(a,n,i,t),ht[r]=s,s)}var J={};function Nt(a,n,i,t,e){var r=e?Math.min(e,at):at,s=(a[0]+"_"+a[1]+"_"+n[0]+"_"+n[1]+"_"+i[0]+"_"+i[1]+"_"+t[0]+"_"+t[1]+"_"+r).replace(/\./g,"p");if(!J[s]){for(var o=0,u,h=[],f=0;f<r;f++){for(var l=i.length,p=new Array(l),c=f/(r-1),v=0,_=0;_<l;_+=1){var d=Math.pow(1-c,3)*a[_]+3*Math.pow(1-c,2)*c*(a[_]+i[_])+3*(1-c)*Math.pow(c,2)*(n[_]+t[_])+Math.pow(c,3)*n[_];p[_]=d,u&&(v+=Math.pow(p[_]-u[_],2))}v=Math.sqrt(v),o+=v,h.push({partialLength:v,point:p}),u=p}J[s]={segmentLength:o,points:h}}return J[s]}var K={buildBezierData:Nt,getBezierEasing:qt},L={euclideanModulo:function(n,i){return(n%i+i)%i},codomainBounce:function(n,i,t){return n<i?2*i-n:n>t?2*t-n:n},clamp:function(n,i,t){return n<i?i:n>t?t:n}},mt=/(loopIn|loopOut)\(([^)]+)/,Wt=/["']\w+["']/,ut=function(){function a(i,t,e){this.begin=t,this.end=e,this.total=this.end-this.begin,this.type=i}var n=a.prototype;return n.update=function(t){if(this.type==="in")return t>=this.begin?t:this.end-L.euclideanModulo(this.begin-t,this.total);if(this.type==="out")return t<=this.end?t:this.begin+L.euclideanModulo(t-this.end,this.total)},a}(),lt=function(){function a(i,t,e){this.begin=t,this.end=e,this.total=this.end-this.begin,this.type=i}var n=a.prototype;return n.update=function(t){if(this.type==="in"&&t<this.begin||this.type==="out"&&t>this.end){var e=t-this.end;return this.pingpong(e)}return t},n.pingpong=function(t){var e=Math.floor(t/this.total)%2;return e?this.begin+L.euclideanModulo(t,this.total):this.end-L.euclideanModulo(t,this.total)},a}(),ft={loopIn:function(n,i,t){var e=n[0].t,r=n.length-1,s=Math.min(r,t),o=n[s].t;switch(i){case"cycle":return new ut("in",e,o);case"pingpong":return new lt("in",e,o)}return null},loopOut:function(n,i,t){var e=n.length-1,r=Math.max(0,e-t),s=n[r].t,o=n[e].t;switch(i){case"cycle":return new ut("out",s,o);case"pingpong":return new lt("out",s,o)}return null}};function Gt(a){var n=a.split(/\s*,\s*/);return n.map(function(i){return Wt.test(i)?i.replace(/"|'/g,""):parseInt(i)})}function Kt(a){var n=a.match(mt),i=Gt(n[2]);return{name:n[1],mode:i[0],offset:i[1]}}function Zt(a){return a.x&&mt.test(a.x)}function $t(a){var n=Kt(a.x),i=n.name,t=n.mode,e=n.offset,r=e===void 0?0:e,s=r===0?a.k.length-1:r;return ft[i]&&ft[i](a.k,t,s)}var Z={hasSupportExpression:Zt,getExpression:$t},k=function(){function a(i,t){this.mult=t||1,this.value=i.k,this.animated=i.a,Z.hasSupportExpression(i)&&(this.expression=Z.getExpression(i))}var n=a.prototype;return n.getValue=function(t,e,r,s){var o,u=r.t,h=s.t,f=r.s[e],l=(s.s||r.e)[e];if(r.h===1)return f;if(t>=h)o=1;else if(t<u)o=0;else{var p=r.beziers[e];p||(typeof r.o.x=="number"?p=K.getBezierEasing(r.o.x,r.o.y,r.i.x,r.i.y):p=K.getBezierEasing(r.o.x[e],r.o.y[e],r.i.x[e],r.i.y[e]),r.beziers[e]=p),o=p((t-u)/(h-u))}return f+(l-f)*o},n.reset=function(){},a}(),kt=function(a){A(n,a);function n(t,e){e===void 0&&(e=1);var r;return r=a.call(this,t,e)||this,r.v=e?r.value*e:r.value,r}var i=n.prototype;return i.update=function(){this.v=this.value*this.mult},n}(k),Ht=function(a){A(n,a);function n(t,e){e===void 0&&(e=1);var r;r=a.call(this,t,e)||this;var s=r.value.length;r.v=new Float32Array(s),r.newValue=new Float32Array(s);for(var o=0;o<s;o+=1)r.v[o]=r.value[o]*r.mult;return r}var i=n.prototype;return i.update=function(){var e;e=this.value;for(var r=0,s=this.v.length;r<s;r++)this.v[r]=e[r]*this.mult},n}(k),Jt=function(a){A(n,a);function n(t,e){e===void 0&&(e=1);var r;return r=a.call(this,t,e)||this,r._value=0,r.v=0,Z.hasSupportExpression(t)&&(r.expression=Z.getExpression(t)),r}var i=n.prototype;return i.reset=function(){this._value=0},i.update=function(e){this.expression&&(e=this.expression.update(e));for(var r=this.value,s,o,u=0,h=r.length-1;u<h&&(s=r[u],o=r[u+1],!(o.t>e));u++);s.beziers||(s.beziers=[]),this.v=this.getValue(e,0,s,o)*this.mult},n}(k),Qt=function(a){A(n,a);function n(t,e,r){e===void 0&&(e=1);var s;s=a.call(this,t,e)||this,s._lastPoint=0,s._addedLength=0;var o=s.value[0].s.length;return r&&(s._frames=r>>0),s.newValue=new Float32Array(o),s.v=new Float32Array(o),s}var i=n.prototype;return i.update=function(e){this.expression&&(e=this.expression.update(e));for(var r=this.value,s=this.newValue,o,u,h=0,f=r.length-1;h<f;h++)if(o=r[h],u=r[h+1],u.t>e){this._lastPoint=0,this._addedLength=0;break}if(e>u.t){for(var l=0,p=this.v.length;l<p;l++)this.v[l]=this.getValue(e,l,o,u)*this.mult;return}if(o.to){var c=u.t,v=o.t;o.bezierData||(o.bezierData=K.buildBezierData(o.s,u.s||o.e,o.to,o.ti,this._frames));var _=o.bezierData,d=_.points,m=_.segmentLength,y=o.timeBezier;y||(y=K.getBezierEasing(o.o.x,o.o.y,o.i.x,o.i.y,o.n),o.timeBezier=y);var b=0;c>=0&&(b=(e-v)/(c-v),b=Math.min(Math.max(0,b),1));for(var g=y(b),x=m*g,E=this._addedLength,P=this._lastPoint,w=P,T=d.length;w<T;w++){if(w===T-1){P=0,E=0;break}P=w;var M=d[w],R=d[w+1],I=R.partialLength;if(x>=E&&x<E+I){for(var U=(x-E)/I,S=0,B=M.point.length;S<B;S+=1)s[S]=M.point[S]+(R.point[S]-M.point[S])*U;break}E+=I}this._lastPoint=P,this._addedLength=E}else{o.beziers||(o.beziers=[]);for(var C=0,j=o.s.length;C<j;C++)s[C]=this.getValue(e,C,o,u)}for(var V=0,H=this.v.length;V<H;V++)this.v[V]=s[V]*this.mult},n}(k),Yt=function(){function a(i){this.properties=[],this.autoOrient=!1;var t=a.create;i.p.k?(this.p=t(i.p,1),this.properties.push(this.p)):(i.p.x&&(this.x=t(i.p.x,1),this.properties.push(this.x)),i.p.y&&(this.y=t(i.p.y,1),this.properties.push(this.y)),i.p.z&&(this.z=t(i.p.z,1),this.properties.push(this.z))),this.a=t(i.a,1),this.properties.push(this.a),this.s=t(i.s,1,.01),this.properties.push(this.s),this.o=t(i.o,0,.01),this.properties.push(this.o),i.r?(this.r=t(i.r,0),this.properties.push(this.r)):i.rx||i.ry||i.rz?(i.rx&&(this.rx=t(i.rx,0),this.properties.push(this.rx)),i.ry&&(this.ry=t(i.ry,0),this.properties.push(this.ry)),i.rz&&(this.rz=t(i.rz,0),this.properties.push(this.rz))):i.or&&(this.or=t(i.or,1),this.properties.push(this.or)),this.properties.length||this.update()}var n=a.prototype;return n.reset=function(){for(var t=0,e=this.properties.length;t<e;t++)this.properties[t].reset()},n.update=function(t){t===void 0&&(t=0);for(var e=this.properties.length,r=0;r<e;r++)this.properties[r].update(t);this.autoOrient},a.create=function(t,e,r){return e===void 0&&(e=0),r===void 0&&(r=1),t.k.length?typeof t.k[0]=="number"?new Ht(t,r):e?new Qt(t,r,t.k[t.k.length-1].t-t.k[0].t):new Jt(t,r):new kt(t,r)},a}(),rt=function(){function a(i){this.stretch=1,this.parent=null,this.visible=!0,this.startTime=0,this.treeIndex=[],this.childLayers=[],this.is3D=!!i.ddd,this.name=i.nm||"",this.index=i.index,this.timeRemapping=i.tm,this.width=i.w,this.height=i.h,this.inPoint=i.ip,this.outPoint=i.op,i.st&&(this.startTime=i.st),this.stretch=i.stretch||1,this.offsetTime=i.offsetTime||0,i.ks&&(this.transform=new Yt(i.ks))}var n=a.prototype;return n.reset=function(){this.transform&&this.transform.reset();for(var t=0;t<this.childLayers.length;t++)this.childLayers[t].reset()},n.update=function(t,e){t===void 0&&(t=0);var r=(t-this.offsetTime)/this.stretch;e===!0?this.visible=this.inPoint<=r&&this.outPoint>=r:e===!1&&(this.visible=!1),this.transform&&this.visible&&this.transform.update(r);for(var s=0;s<this.childLayers.length;s++)this.childLayers[s].update(t,this.visible)},n.addChild=function(t){t.parent=this,t.entity.parent=this.entity,this.childLayers.push(t)},n.destroy=function(){this.entity.parent=null,this.entity.destroy(),this.entity=null,this.transform=null,this.parent=null},a}(),Q=function(a){A(n,a);function n(t,e,r,s){var o;if(o=a.call(this,t)||this,o.layers=t.layers,o.comps=t.comps,r)o.entity=r,s&&(o.entity.name=s);else{var u=new q(e,s);o.entity=u}return o}var i=n.prototype;return i.destroy=function(){a.prototype.destroy.call(this),this.layers=null,this.comps=null},n}(rt),Xt=function(a){A(n,a);function n(t,e,r,s){var o;o=a.call(this,t)||this;var u;if(t.refId){if(s)o.entity=s,u=s.getComponent(it),o.sprite=u.sprite;else{o.sprite=e.getSprite(t.refId);var h=new q(r.engine,t.nm);u=h.addComponent(it),u.sprite=o.sprite,o.entity=h}var f=o.sprite,l=f.atlasRegion,p=f.texture;p.wrapModeU=p.wrapModeV=xt.Clamp,o.spriteRenderer=u,u.priority=(Number.MAX_SAFE_INTEGER-o.index*1e6)/Number.MAX_SAFE_INTEGER,o.width=l.width*p.width,o.height=l.height*p.height}return o}var i=n.prototype;return i.destroy=function(){a.prototype.destroy.call(this),this.sprite=null,this.spriteRenderer=null},n}(rt),te=function(a){A(n,a);function n(i,t,e,r){var s,o,u,h;s=a.call(this,i)||this,e?(s.entity=e,r&&(s.entity.name=r)):s.entity=new q(t,i.nm);var f=s.entity.addComponent(Pt),l=(h=i)==null||(u=h.t)==null||(o=u.d)==null?void 0:o.k;if(l.length===1){var p,c,v=(c=l)==null||(p=c[0])==null?void 0:p.s;if(v){var _=v.t,d=v.f,m=v.s,y=v.fc,b=v.lh;f.font=St.createFromOS(t,d),f.text=_,f.fontSize=m,f.color.set(y[0],y[1],y[2],1),f.lineSpacing=b}else nt.warn("TextLottieElement: "+r+", No corresponding text data found.")}else nt.warn("TextLottieElement: multi keyframes feature is not supported in this version.");return f.priority=(Number.MAX_SAFE_INTEGER-s.index*1e6)/Number.MAX_SAFE_INTEGER,s}return n}(rt),z=function(a){A(n,a);function n(){var t;return t=a.apply(this,arguments)||this,t.repeats=0,t.isLooping=!1,t.isAlternate=!1,t.direction=1,t.speed=1,t.pixelsPerUnit=zt._pixelsPerUnit,t._alpha=1,t._priority=0,t._priorityDirty=!0,t._layer=At.Layer0,t._layerDirty=!0,t._autoPlay=!1,t._clipEndCallbacks={},t._isPlaying=!1,t._curFrame=0,t._frame=0,t._root=null,t}var i=n.prototype;return i.play=function(e){var r=this;if(e){var s=this.resource.clips[e];this._clip=s}else this._clip=null;return this._isPlaying=!0,this._frame=this._curFrame,new Promise(function(o){e?r._clipEndCallbacks[e]=o:r._clipEndCallbacks.ALL=o})},i.pause=function(){this._isPlaying=!1,this._curFrame=this._frame},i.stop=function(){this._isPlaying=!1,this._curFrame=0,this._frame=0},i._setLayer=function(e,r){r||(r=this.entity),r.layer=e;for(var s=r.children,o=s.length-1;o>=0;o--){var u=s[o];u.layer=e,this._setLayer(e,u)}},i._createLayerElements=function(e,r,s,o){if(e)for(var u=0,h=e.length;u<h;u++){var f=e[u],l=null;if(f.td===void 0){var p=s.treeIndex.concat(u),c=o&&this._findEntityInTree(p);switch(f.ty){case 0:l=new Q(f,this.engine,c,f.id);break;case 2:l=new Xt(f,this._resource.atlas,this.entity,c);break;case 3:var v,_,d;((d=f)==null||(_=d.ks)==null||(v=_.o)==null?void 0:v.k)===0&&(f.ks.o.k=100),l=new Q(f,this.engine,c,f.id);break;case 5:l=new te(f,this.engine,c,f.id);break}l&&(l.treeIndex=p,r.push(l),s.addChild(l),f.layers&&this._createLayerElements(f.layers,r,l,o))}}},i._findEntityInTree=function(e){for(var r,s=0,o=e.length;s<o;s++){var u=e[s];r?r=r.children[u]:r=this.entity.children[u]}return r},i._createElements=function(e,r){var s=new Q(e,this.engine,this.entity);this._root=s;var o=s.layers,u=[];this._createLayerElements(o,u,s,r),this._elements=u},i._updateElements=function(e){this._root.update(e);for(var r=this._elements,s=0,o=r.length;s<o;s++){var u=r[s];this._updateElement(u)}},i._updateElement=function(e){var r,s,o,u,h=e.transform,f=e.entity,l=e.sprite,p=e.spriteRenderer,c=e.parent,v=e.width,_=e.height,d=f.transform,m=h.a.v,y=h.s.v,b=h.o.v,g=this.pixelsPerUnit,x=0,E=0,P=0;if(h.p){var w=h.p.v,T;x=(T=w[0])!=null?T:0;var M;E=(M=w[1])!=null?M:0;var R;P=(R=w[2])!=null?R:0}else h.x&&(x=h.x.v),h.y&&(E=h.y.v),h.z&&(P=h.z.v);var I=0,U=0,S=0;if(!e.visible){f.isActive=e.visible;return}if(h.r)S=h.r.v;else if(h.rx||h.ry||h.rz)I=h.rx?h.rx.v:0,U=h.ry?h.ry.v:0,S=h.rz?h.rz.v:0;else if(h.or){var B=h.or.v;I=B[0],U=B[1],S=B[2]}if(!((s=c)==null||(r=s.transform)==null)&&r.o){var C;b*=(C=c)==null?void 0:C.transform.o.v}if(l){var j=p.color,V=j.r,H=j.g,Et=j.b;p.color.set(V,H,Et,b*this._alpha),l.pixelsPerUnit=g,l.pivot=n._pivotVector.set(m[0]/v,(_-m[1])/_)}f.isActive=e.visible,d.setScale(y[0],y[1],y[2]),d.setRotation(I,U,-S),!((u=c)==null||(o=u.transform)==null)&&o.a?d.setPosition((x-c.transform.a.v[0])/g,(-E+c.transform.a.v[1])/g,P/g):d.setPosition((x-this._width/2)/g,(-E+this._height/2)/g,P/g)},i._resetElements=function(){for(var e=this._elements,r=0,s=e.length;r<s;r++)e[r].reset()},i.onUpdate=function(e){if(!this._isPlaying||!this._resource)return null;if(this._priorityDirty){this._priorityDirty=!1;var r=n._tempRenderers;r.length=0,this.entity.getComponentsIncludeChildren(bt,r);for(var s=0,o=0,u=r.length;o<u;++o){var h=r[o];o===0&&(s=this._priority-Math.floor(h.priority)),h.priority=h.priority+s}}this._layerDirty&&(this._layerDirty=!1,this._setLayer(this.layer,this.entity));var f=this.direction*this.speed*e*1e3;this._frame+=f/this._resource.timePerFrame;var l=this._clip;if(this._spill()){var p=this._resource.duration;if(this._resetElements(),this.repeats>0||this.isLooping)this.repeats>0&&--this.repeats,this.isAlternate?(this.direction*=-1,l?this._frame=L.codomainBounce(this._frame,0,l.end-l.start):this._frame=L.codomainBounce(this._frame,0,p)):(this.direction=1,l?this._frame=L.euclideanModulo(this._frame,l.end-l.start):this._frame=L.euclideanModulo(this._frame,p));else if(l){if(this._frame>=l.end-l.start){var c=this._clipEndCallbacks[l.name];c&&c(l)}this._frame=L.clamp(this._frame,0,l.end-l.start)}else{if(this._frame>=p){var v=this._clipEndCallbacks.ALL;v&&v()}this._frame=L.clamp(this._frame,0,p)}}l?this._updateElements(this._resource.inPoint+this._frame+l.start):this._updateElements(this._resource.inPoint+this._frame)},i._spill=function(){var e;if(this._clip){var r=this._clip;e=r.end-r.start}else e=this._resource.duration;var s=this._frame<=0&&this.direction===-1,o=this._frame>=e&&this.direction===1;return s||o},i._cloneTo=function(e){e._createElements(this._resource,!0)},i._destroy=function(){var e=this._elements;if(e)for(var r=0,s=e.length;r<s;r++)e[r].destroy()},i.onDestroy=function(){this._destroy()},Rt(n,[{key:"resource",get:function(){return this._resource},set:function(e){this._resource!==e&&(this._resource&&(this.pause(),this._destroy(),this._resource.refCount--,this._resource.refCount<=0&&this._resource.destroy()),this._resource=e,e&&(e.refCount++,this._width=e.width,this._height=e.height,this._createElements(e),this._priorityDirty=!0,this._layerDirty=!0),this._curFrame=0,this.play(),this.onUpdate(0),this.autoPlay||this.pause())}},{key:"priority",get:function(){return this._priority},set:function(e){this._priority!==e&&(this._priority=e,this._priorityDirty=!0)}},{key:"layer",get:function(){return this._layer},set:function(e){this._layer!==e&&(this._layer=e,this._layerDirty=!0)}},{key:"alpha",get:function(){return this._alpha},set:function(e){this._alpha!==e&&(this._alpha=e,this.isPlaying||(this.play(),this.onUpdate(0),this.pause()))}},{key:"autoPlay",get:function(){return this._autoPlay},set:function(e){this._autoPlay=e,e&&this.play()}},{key:"frame",get:function(){return this._frame}},{key:"isPlaying",get:function(){return this._isPlaying}}]),n}(Lt);(function(){z._pivotVector=new wt})();(function(){z._tempRenderers=[]})();O([F],z.prototype,"_clipEndCallbacks",void 0);O([F],z.prototype,"_isPlaying",void 0);O([F],z.prototype,"_curFrame",void 0);O([F],z.prototype,"_frame",void 0);O([F],z.prototype,"_root",void 0);O([F],z.prototype,"_elements",void 0);function ee(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function $(){return $=Object.assign||function(n){for(var i=1;i<arguments.length;i++){var t=arguments[i];for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])}return n},$.apply(this,arguments)}function re(a){"@swc/helpers - typeof";return a&&typeof Symbol<"u"&&a.constructor===Symbol?"symbol":typeof a}var X=function(a){A(n,a);function n(t,e,r){var s;s=a.call(this,t)||this,s.refCount=0,s.timePerFrame=1e3/e.fr,s.duration=Math.floor(e.op-e.ip),s.width=e.w,s.height=e.h,s.inPoint=e.ip,s.outPoint=e.op,s.atlas=r,s.layers=e.layers,s.comps=e.assets,s.name=e.nm,s.clips={};var o={},u=ee(s).comps;if(u)for(var h=0,f=u.length;h<f;h++){var l=u[h];l.id&&(o[l.id]=l)}return s._buildTree(s.layers,o),e.lolitaAnimations&&s._parseAnimations(e.lolitaAnimations),s}var i=n.prototype;return i.setClips=function(e){this.clips={},this._parseAnimations(e)},i._parseAnimations=function(e){var r=this;e.forEach(function(s){r.clips[s.name]=$({},s)})},i._buildTree=function(e,r,s,o,u,h){s===void 0&&(s=0),o===void 0&&(o=1),u===void 0&&(u=0),h===void 0&&(h=1);for(var f={},l=0,p=e.length;l<p;l++){var c=e[l],v;f[(v=c.ind)!=null?v:l]=c}for(var _=e.length-1;_>=0;_--){var d=e[_],m=d.refId,y=d.parent;d.offsetTime=s,d.stretch=o;var b;if(d.index=((b=d.ind)!=null?b:_)*h+u,y&&(f[y].layers||(f[y].layers=[]),f[y].layers.push(d),e.splice(_,1)),m&&r[m]){for(var g=[],x=0;x<r[m].layers.length;x++)g.push(this._deepClone(r[m].layers[x]));var E=(d.offsetTime||0)+(d.st||0),P=(d.stretch||1)*(d.sr||1),w=g.length-1,T,M=h/(((T=g[w].ind)!=null?T:w)+1)*h;if(this._buildTree(g,r,E,P,d.index,M),d.layers){var R;(R=d.layers).push.apply(R,[].concat(g))}else d.layers=[].concat(g)}}},i._deepClone=function(e){var r=this,s=Array.isArray(e)?[].concat(e):$({},e);return Reflect.ownKeys(s).map(function(o){s[o]=r._isObject(e[o])?r._deepClone(e[o]):e[o]}),s},i._isObject=function(e){return(typeof e=="object"||typeof e=="function")&&(typeof e>"u"?"undefined":re(e))!==null},i.destroy=function(){var e,r;(e=(r=this.atlas).destroy)==null||e.call(r),this.atlas=null,this.layers=null,this.clips=null,this.comps=null,a.prototype.destroy.call(this)},n}(Tt),pt=function(a){A(n,a);function n(){return a.apply(this,arguments)}var i=n.prototype;return i.load=function(e,r){return new W(function(s,o){var u=e.url;r._request(u,{type:"json"}).then(function(h){var f=h.jsonUrl,l=h.atlasUrl,p=r._request(st.resolveAbsoluteUrl(u,f),r),c=r.load({url:st.resolveAbsoluteUrl(u,l),type:et.SpriteAtlas});W.all([p,c]).then(function(v){var _=v[0],d=v[1],m=r.engine,y=new X(m,_,d);s(y)}).catch(o)}).catch(o)})},n}(tt);pt=O([ct("EditorLottie",["json"])],pt);var ie=function(){function a(i,t){var e=this;this.sprites={},this.assetsPromises=[],this.assetsPromises=i.map(function(r){return t.resourceManager.load({url:r.p,type:et.Texture2D}).then(function(s){var o=new Mt(t);o.texture=s,e.sprites[r.id]=o})})}var n=a.prototype;return n.request=function(){return Promise.all(this.assetsPromises)},n.getSprite=function(t){return this.sprites[t]},a}(),vt=function(a){A(n,a);function n(){return a.apply(this,arguments)}var i=n.prototype;return i.load=function(e,r){var s=e.urls,o=r._request(s[0],{type:"json"});if(s[1]){var u=r.load({url:s[1],type:et.SpriteAtlas});return W.all([o,u]).then(function(h){var f=h[0],l=h[1],p=r.engine,c=new X(p,f,l),v=new q(p),_=v.addComponent(z);return _.resource=c,v})}else return W.all([o]).then(function(h){var f=h[0],l=r.engine,p=f.assets.filter(function(v){return v.p});f.assets=f.assets.filter(function(v){return!v.p});var c=new ie(p,l);return c.request().then(function(){var v=new X(l,f,c),_=new q(l),d=_.addComponent(z);return d.resource=v,_})})},n}(tt);vt=O([ct("lottie",["json"])],vt);tt.registerClass("LottieAnimation",z);export{z as L};